You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

708 lines
26 KiB

<template>
<basic-container>
<div class="avue-crud">
<el-row v-if="!search" style="padding: 6px 18px">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<el-form-item label="商场名称:">
<el-input v-model="query.mallName" placeholder="请输入商场名称"></el-input>
</el-form-item>
<el-form-item label="货物名称:">
<el-input v-model="query.descriptionGoods" placeholder="请输入货物名称"></el-input>
</el-form-item>
<el-form-item label="仓库:">
<el-input v-model="query.warehouse" placeholder="请输入仓库"></el-input>
</el-form-item>
<el-form-item label="是否齐套:">
<el-input v-model="query.completeSet" placeholder="请输入是否齐套"></el-input>
</el-form-item>
<el-form-item label="品牌:">
<el-input v-model="query.brand" placeholder="请输入品牌"></el-input>
</el-form-item>
<el-form-item label="服务类型:">
<el-input v-model="query.typeService" placeholder="请输入服务类型"></el-input>
</el-form-item>
<!-- <el-form-item label="类型;1 预约单 2库存单:">-->
<!-- <el-input v-model="query.genre" placeholder="请输入类型;1 预约单 2库存单"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态;1 配送 2 待配送:">-->
<!-- <el-input v-model="query.state" placeholder="请输入状态;1 配送 2 待配送"></el-input>-->
<!-- </el-form-item>-->
<!-- 查询按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchChange">搜 索</el-button>
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> 商配</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
>市配</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="handlePickUpStore"
v-if="permission.stockArticle_add"
>自提</el-button
>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete">全部</el-button>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">未通知</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete">已通知</el-button>
</div>
<!-- 头部右侧按钮模块 -->
<!-- <div class="avue-crud__right">-->
<!-- <el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>-->
<!-- <el-button icon="el-icon-search" @click="searchHide" circle></el-button>-->
<!-- </div>-->
</div>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">创建异常</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete"
>转预约单</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="handleStockList"
>批量加配转库存品</el-button
>
<el-button type="danger" icon="el-icon-delete" @click="handleCallDelivery('3')"
>修改客户信息</el-button
>
<el-button type="danger" icon="el-icon-delete" @click="handleCallDelivery('2')"
>修改服务类型</el-button
>
</div>
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handlebill">创建提货单</el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleCallDelivery('1')"
>再次通知</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="handleCallDelivery('1')"
>通知提货</el-button
>
</div>
<!-- 头部右侧按钮模块 -->
<!-- <div class="avue-crud__right">-->
<!-- <el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>-->
<!-- <el-button icon="el-icon-search" @click="searchHide" circle></el-button>-->
<!-- </div>-->
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<el-table
ref="table"
v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
style="width: 100%"
:border="option.border"
>
<el-table-column
type="selection"
v-if="option.selection"
width="55"
align="center"
></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="60" align="center">
</el-table-column>
<template v-for="(item, index) in option.column">
<!-- table字段 -->
<el-table-column
v-if="item.hide !== true"
:prop="item.prop"
:label="item.label"
:width="item.width"
:key="index"
>
</el-table-column>
</template>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{ row }">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)"
>查看</el-button
>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)"
>编辑</el-button
>
<!-- <el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>-->
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
<!-- 提货通知 -->
<el-dialog v-model="dialogFormVisible" title="通知提货">
<el-form :model="formCall">
<el-form-item label="顾客姓名" :label-width="formLabelWidth">
<el-input v-model="formCall.customerName" autocomplete="off" />
</el-form-item>
<el-form-item label="顾客电话" :label-width="formLabelWidth">
<el-input v-model="formCall.customerTelephone" autocomplete="off" />
</el-form-item>
<el-form-item label="运单" :label-width="formLabelWidth">
<el-input v-model="formCall.waybill" autocomplete="off" />
</el-form-item>
<el-form-item label="跟进记录" :label-width="formLabelWidth">
<el-input
v-model="formCall.followUpRecord"
:rows="2"
type="textarea"
placeholder="请填写内容"
/>
</el-form-item>
<el-form-item label="历史跟进" :label-width="formLabelWidth"> </el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<!-- <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>-->
<el-button type="primary" @click="callFordelivery('1')"> 确定 </el-button>
</span>
</template>
</el-dialog>
<!-- 修改服务类型 -->
<el-dialog v-model="dialogFormService" title="修改服务类型">
<el-form :model="formService">
<el-form-item label="服务类型" :label-width="formLabelWidth">
<!-- <el-input v-model="formService.typeService" autocomplete="off" />-->
<el-select v-model="formService.typeService" clearable placeholder="请选择服务类型">
<el-option
v-for="item in distributionType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="费用" :label-width="formLabelWidth">
<el-input v-model="formService.cost" autocomplete="off" />
</el-form-item>
<el-form-item label="原因" :label-width="formLabelWidth">
<el-input
v-model="formService.cause"
:rows="2"
type="textarea"
placeholder="请填写原因"
/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormService = false">取消</el-button>
<!-- <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>-->
<el-button type="primary" @click="callFordelivery('2')"> 确定 </el-button>
</span>
</template>
</el-dialog>
<!-- 修改客户信息 -->
<el-dialog v-model="dialogFormCustomer" title="修改客户信息">
<el-form :model="formCustomer">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="formCustomer.name" autocomplete="off" />
</el-form-item>
<el-form-item label="电话" :label-width="formLabelWidth">
<el-input v-model="formCustomer.phone" autocomplete="off" />
</el-form-item>
<el-form-item label="地址" :label-width="formLabelWidth">
<el-input
v-model="formCustomer.address"
:rows="2"
type="textarea"
placeholder="请填写地址"
/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormCustomer = false">取消</el-button>
<!-- <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>-->
<el-button type="primary" @click="callFordelivery('3')"> 确定 </el-button>
</span>
</template>
</el-dialog>
<!-- 表单模块 -->
<el-dialog
:title="title"
v-model="box"
width="50%"
:before-close="beforeClose"
append-to-body
>
<el-form :disabled="view" ref="form" :model="form" label-width="80px">
<!-- 表单字段 -->
<el-form-item label="服务号" prop="serviceNumber">
<el-input v-model="form.serviceNumber" placeholder="请输入服务号" />
</el-form-item>
<el-form-item label="订单自编号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入订单自编号" />
</el-form-item>
<el-form-item label="商场名称" prop="mallName">
<el-input v-model="form.mallName" placeholder="请输入商场名称" />
</el-form-item>
<el-form-item label="货物名称" prop="descriptionGoods">
<el-input v-model="form.descriptionGoods" placeholder="请输入货物名称" />
</el-form-item>
<el-form-item label="仓库" prop="warehouse">
<el-input v-model="form.warehouse" placeholder="请输入仓库" />
</el-form-item>
<el-form-item label="入库时间" prop="warehouseEntryTime">
<!-- <el-input v-model="form.warehouseEntryTime" placeholder="请输入入库时间"/>-->
<el-date-picker
v-model="form.warehouseEntryTime"
type="datetime"
placeholder="请输入入库时间"
format="YYYY-MM-DD hh:mm:ss"
value-format="YYYY-MM-DD hh:mm:ss"
/>
</el-form-item>
<el-form-item label="在库时长" prop="storeTime">
<el-input v-model="form.storeTime" placeholder="请输入在库时长" />
</el-form-item>
<el-form-item label="订单总件数" prop="totalNumber">
<el-input v-model="form.totalNumber" placeholder="请输入订单总件数" />
</el-form-item>
<el-form-item label="在库件数" prop="handQuantity">
<el-input v-model="form.handQuantity" placeholder="请输入在库件数" />
</el-form-item>
<el-form-item label="是否齐套" prop="completeSet">
<el-select v-model="form.completeSet" clearable placeholder="请选择是否齐套">
<!-- <el-option-->
<!-- v-for="item in completeSetData"-->
<!-- :key="item.dictKey"-->
<!-- :label="item.dictValue"-->
<!-- :value="item.dictKey">-->
<!-- </el-option>-->
<el-option label="是" value="2">是</el-option>
<el-option label="否" value="1">否</el-option>
</el-select>
</el-form-item>
<el-form-item label="品牌" prop="brand">
<el-input v-model="form.brand" placeholder="请输入品牌" />
</el-form-item>
<el-form-item label="服务类型" prop="typeService">
<el-select v-model="form.typeService" clearable placeholder="请选择服务类型">
<!-- <el-option-->
<!-- v-for="item in typeServiceData"-->
<!-- :key="item.dictKey"-->
<!-- :label="item.dictValue"-->
<!-- :value="item.dictKey">-->
<!-- </el-option>-->
<el-option label="干" value="1">干</el-option>
<el-option label="仓" value="2">仓</el-option>
<el-option label="配" value="3">配</el-option>
</el-select>
</el-form-item>
<el-form-item label="顾客名字" prop="customerName">
<el-input v-model="form.customerName" placeholder="请输入顾客名字" />
</el-form-item>
<el-form-item label="顾客电话" prop="customerTelephone">
<el-input v-model="form.customerTelephone" placeholder="请输入顾客电话" />
</el-form-item>
<el-form-item label="顾客地址" prop="customerAddress">
<el-input v-model="form.customerAddress" placeholder="请输入顾客地址" />
</el-form-item>
<el-form-item label="类型;1 预约单 2库存单" prop="genre">
<el-select v-model="form.genre" clearable placeholder="请选择类型;1 预约单 2库存单">
<!-- <el-option-->
<!-- v-for="item in genreData"-->
<!-- :key="item.dictKey"-->
<!-- :label="item.dictValue"-->
<!-- :value="item.dictKey">-->
<!-- </el-option>-->
<el-option label="库存单" value="2">库存单</el-option>
<el-option label="预约单" value="1">预约单</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态;1 配送 2 待配送" prop="state">
<el-select v-model="form.state" clearable placeholder="请选择状态;1 配送 2 待配送">
<!-- <el-option-->
<!-- v-for="item in stateData"-->
<!-- :key="item.dictKey"-->
<!-- :label="item.dictValue"-->
<!-- :value="item.dictKey">-->
<!-- </el-option>-->
<el-option label="待配送" value="2">待配送</el-option>
<el-option label="配送" value="1">配送</el-option>
</el-select>
</el-form-item>
</el-form>
<!-- 表单按钮 -->
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"
>提 交</el-button
>
<el-button icon="el-icon-circle-close" @click="box = false"> </el-button>
</span>
</template>
</el-dialog>
</div>
</basic-container>
</template>
<script>
import {
getList,
getDetail,
add,
update,
remove,
addStock,
} from '@/api/distribution/distributionStockArticle';
import { addCallDelivery } from '@/api/distribution/distrilbutionCallDelivery';
import { addClient } from '@/api/distribution/distributionClientMessage';
import { addService } from '@/api/distribution/distributionServiceLog';
import option from '@/option/distribution/distributionStockArticle';
import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
export default {
data() {
return {
height: 0,
// 弹框标题
title: '',
// 是否展示弹框
box: false,
// 是否显示查询
search: true,
// 加载中
loading: true,
// 是否为查看模式
view: false,
// 查询信息
query: {},
// 分页信息
page: {
currentPage: 1,
pageSize: 30,
total: 40,
},
// 表单数据
form: {},
formCall: {}, // 通知
formService: {}, // 服务
formCustomer: {}, // 客户
// 选择行
selectionList: [],
// 表单配置
option: option,
// 表单列表
data: [],
distributionType: [],
dialogTableVisible: false,
dialogFormVisible: false,
dialogFormCustomer: false,
dialogFormService: false,
formLabelWidth: '120px',
};
},
mounted() {
this.init();
this.onLoad(this.page);
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataBrandCategory_add, false),
viewBtn: this.validData(this.permission.basicdataBrandCategory_view, false),
delBtn: this.validData(this.permission.basicdataBrandCategory_delete, false),
editBtn: this.validData(this.permission.basicdataBrandCategory_edit, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
},
methods: {
handleStockList() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择的订单转为库存品吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return addStock(this.ids);
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
//确定通知提货按钮
callFordelivery(inde) {
switch (inde) {
case '1':
console.log(this.formCall);
this.formCall.waybillNumber = this.ids;
addCallDelivery(this.formCall).then(() => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.dialogFormVisible = false;
this.formCall = {};
});
break;
case '2':
// console.log("服务类型",this.formService);
addService(this.formService).then(() => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.dialogFormService = false;
this.formService = {};
});
break;
case '3':
console.log('客户信息!!!', this.formCustomer);
this.formCustomer.stockArticleId = this.ids;
addClient(this.formCustomer).then(() => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.dialogFormCustomer = false;
this.formCustomer = {};
});
break;
}
},
//提货跳转
handlebill(row) {
console.log('>>>>', this.ids);
this.$router.push({
path: '/distribution/inventory/distrilbutionBillLading',
query: {
id: this.ids,
},
});
},
//通知提货
handleCallDelivery(ind) {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
switch (ind) {
case '1':
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.orderCode);
});
this.formCall.waybill = ids;
this.dialogFormVisible = true;
break;
case '2':
this.dialogFormService = true;
break;
case '3':
this.dialogFormCustomer = true;
break;
}
},
init() {
this.height = this.setPx(document.body.clientHeight - 340);
getDictionaryBiz('distribution_type').then(res => {
this.distributionType = res.data.data;
});
},
searchHide() {
this.search = !this.search;
},
searchChange() {
this.onLoad(this.page);
},
searchReset() {
this.query = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
handleSubmit() {
if (!this.form.id) {
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
} else {
update(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
}
},
//自提
handlePickUpStore() {
this.loading = true;
// console.log("this.query",this.query);
let params = {};
this.query.typeService = '1';
getList(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(
res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
}
);
},
handleAdd() {
this.title = '新增';
this.form = {};
this.box = true;
},
handleEdit(row) {
this.title = '编辑';
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleView(row) {
this.title = '查看';
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
rowDel(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
beforeClose(done) {
done();
this.form = {};
this.view = false;
},
selectionChange(list) {
// console.log("添加阿斯顿发生",list);
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
// this.$refs.table.clearSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad(page, params = {}) {
this.loading = true;
this.query.genre = 1;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
},
},
};
</script>
<style scoped>
.el-button--text {
margin-right: 15px;
}
.el-select {
width: 300px;
}
.el-input {
width: 300px;
}
.dialog-footer button:first-child {
margin-right: 10px;
}
</style>