|
@@ -25,13 +25,20 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
+ <!-- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="产品大类" prop="type">
|
|
|
<el-input v-model="mainForm.type" disabled v-if="listItem"></el-input>
|
|
|
<el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%" disabled v-else>
|
|
|
<el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8">
|
|
|
+ <el-form-item label="销售类型" prop="saleType">
|
|
|
+ <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
|
|
|
+ <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="经销商编码" prop="jxsNum">
|
|
@@ -72,13 +79,6 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
- <el-form-item label="销售类型" prop="saleType">
|
|
|
- <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
|
|
|
- <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="联系人" prop="contactMan">
|
|
|
<el-input v-model="mainForm.contactMan" placeholder="请输入联系人" disabled></el-input>
|
|
|
</el-form-item>
|
|
@@ -172,11 +172,11 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="返利钱包" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利钱包" size="small" clearable @change="changeFlWallet(scope.$index)">
|
|
|
+ <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利类型" size="small" clearable @change="changeFlWallet(scope.$index)">
|
|
|
<el-option
|
|
|
- v-for="item in flWalletList"
|
|
|
+ v-for="item in scope.row.rebateWallets"
|
|
|
:key="item.customerWalletId"
|
|
|
- :label="item.name"
|
|
|
+ :label="item.customerWalletName"
|
|
|
:value="item.customerWalletId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -196,9 +196,9 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
|
|
|
<el-option
|
|
|
- v-for="item in xjWalletList"
|
|
|
+ v-for="item in scope.row.wallets"
|
|
|
:key="item.customerWalletId"
|
|
|
- :label="item.name"
|
|
|
+ :label="item.customerWalletName"
|
|
|
:value="item.customerWalletId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -242,7 +242,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="page-footer">
|
|
|
- <div class="footer" :class="classObj">
|
|
|
+ <div class="footer">
|
|
|
<el-button type="primary" @click="clickSubmitForm(1)">保 存</el-button>
|
|
|
<el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>
|
|
|
<el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
|
|
@@ -296,6 +296,7 @@
|
|
|
<el-table-column align="center" prop="recordNo" label="工程登录编号" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" prop="projectName" label="工程项目" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" prop="useUnit" label="使用单位" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" prop="organizationName" label="经销商" show-overflow-tooltip></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="pagination clearfix">
|
|
@@ -384,7 +385,7 @@ export default {
|
|
|
address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
|
|
|
},
|
|
|
salesTypeList: [],
|
|
|
- typeList: [],
|
|
|
+ // typeList: [],
|
|
|
stockList: [],
|
|
|
goodsList: [],
|
|
|
|
|
@@ -402,31 +403,15 @@ export default {
|
|
|
|
|
|
warehouseList: [],
|
|
|
warehouseValue: '',
|
|
|
-
|
|
|
- xjWalletList: [],
|
|
|
- flWalletList: [],
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- computed: {
|
|
|
- sidebar() {
|
|
|
- return this.$store.state.app.sidebar
|
|
|
- },
|
|
|
- classObj() {
|
|
|
- return {
|
|
|
- hideSidebar: !this.sidebar.opened,
|
|
|
- openSidebar: this.sidebar.opened
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
beforeCreate() {
|
|
|
that = this;
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
this.getDictList();
|
|
|
- this.getWalletList();
|
|
|
this.getSalesTypeList();
|
|
|
this.getWarehouseList();
|
|
|
|
|
@@ -463,27 +448,11 @@ export default {
|
|
|
return currentdate;
|
|
|
},
|
|
|
|
|
|
- // 获取钱包列表
|
|
|
- getWalletList() {
|
|
|
- getWalletList({
|
|
|
- customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
- type: 'COMMONLY'
|
|
|
- }).then(res => {
|
|
|
- this.xjWalletList = res.data;
|
|
|
- })
|
|
|
- getWalletList({
|
|
|
- customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
- type: 'REBATE'
|
|
|
- }).then(res => {
|
|
|
- this.flWalletList = res.data;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
// 获取产品大类列表
|
|
|
getDictList() {
|
|
|
- getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
|
|
|
- this.typeList = res.data;
|
|
|
- })
|
|
|
+ // getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
|
|
|
+ // this.typeList = res.data;
|
|
|
+ // })
|
|
|
getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
|
|
|
this.stockList = res.data;
|
|
|
})
|
|
@@ -538,6 +507,12 @@ export default {
|
|
|
data.items.forEach(item => {
|
|
|
item.status1 = '';
|
|
|
item.status2 = '';
|
|
|
+ item.rebateWallets = item.customerWalletList.filter(item => {
|
|
|
+ return item.type === 'REBATE';
|
|
|
+ });
|
|
|
+ item.wallets = item.customerWalletList.filter(item => {
|
|
|
+ return item.type === 'COMMONLY';
|
|
|
+ });
|
|
|
})
|
|
|
this.goodsList = data.items;
|
|
|
})
|
|
@@ -597,7 +572,7 @@ export default {
|
|
|
this.isShowDialog = false;
|
|
|
let data = res.data;
|
|
|
this.mainForm.type = data.productCategory;
|
|
|
- this.mainForm.loginUserId = data.userid
|
|
|
+ this.mainForm.loginUserId = data.userid;
|
|
|
// this.mainForm.saleType = '';
|
|
|
this.mainForm.loginNum = data.recordNo;
|
|
|
this.mainForm.enginName = data.projectName;
|
|
@@ -608,10 +583,14 @@ export default {
|
|
|
this.mainForm.phone = data.buyUnitPhone;
|
|
|
this.mainForm.address = data.installAddress;
|
|
|
|
|
|
+ let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
|
|
|
+
|
|
|
this.goodsList = data.items.map(item => {
|
|
|
return {
|
|
|
useRefCount: '',
|
|
|
- saleTypeName: '',
|
|
|
+ saleTypeId: saleTypeItem.id,
|
|
|
+ saleTypeCode: saleTypeItem.saleCode,
|
|
|
+ saleTypeName: saleTypeItem.saleName,
|
|
|
materialId: item.materialId,
|
|
|
materialNumber: '',
|
|
|
materialOldNumber: item.code,
|
|
@@ -632,6 +611,12 @@ export default {
|
|
|
tax: '',
|
|
|
status1: '',
|
|
|
status2: '',
|
|
|
+ rebateWallets: item.customerWalletList.filter(item => {
|
|
|
+ return item.type === 'REBATE';
|
|
|
+ }),
|
|
|
+ wallets: item.customerWalletList.filter(item => {
|
|
|
+ return item.type === 'COMMONLY';
|
|
|
+ }),
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -639,12 +624,9 @@ export default {
|
|
|
|
|
|
// 选择销售类型
|
|
|
changeSaleType() {
|
|
|
- let obj = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
|
|
|
- this.goodsList.forEach(item => {
|
|
|
- item.saleTypeId = obj.id;
|
|
|
- item.saleTypeCode= obj.saleCode;
|
|
|
- item.saleTypeName = obj.saleName;
|
|
|
- })
|
|
|
+ if(this.mainForm.loginNum) {
|
|
|
+ this.chooseItem(this.mainForm.loginNum);
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 删除产品
|
|
@@ -655,9 +637,9 @@ export default {
|
|
|
// 修改返利钱包
|
|
|
changeFlWallet(index) {
|
|
|
if(this.goodsList[index].customerWalletId2) {
|
|
|
- let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
|
|
|
+ let obj = this.goodsList[index].rebateWallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
|
|
|
this.goodsList[index].rebateRate = obj.rebateRate;
|
|
|
- this.goodsList[index].customerWalletName2 = obj.name;
|
|
|
+ this.goodsList[index].customerWalletName2 = obj.customerWalletName;
|
|
|
}else {
|
|
|
this.goodsList[index].rebateRate = '';
|
|
|
this.goodsList[index].customerWalletName2 = '';
|
|
@@ -667,8 +649,8 @@ export default {
|
|
|
// 修改现金钱包
|
|
|
changeXjWallet(index) {
|
|
|
if(this.goodsList[index].customerWalletId) {
|
|
|
- let obj = this.xjWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
|
|
|
- this.goodsList[index].customerWalletName = obj.name;
|
|
|
+ let obj = this.goodsList[index].wallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
|
|
|
+ this.goodsList[index].customerWalletName = obj.customerWalletName;
|
|
|
}else {
|
|
|
this.goodsList[index].customerWalletName = '';
|
|
|
}
|
|
@@ -716,14 +698,26 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ this.goodsList.forEach(item => {
|
|
|
+ delete item.rebateWallets;
|
|
|
+ delete item.wallets;
|
|
|
+ })
|
|
|
+
|
|
|
let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
|
|
|
let params = {
|
|
|
enginOrderId: this.mainForm.orderNum,
|
|
|
// orderDate: this.mainForm.orderDate,
|
|
|
- mainId: this.mainForm.type || '',
|
|
|
+ // mainId: this.mainForm.type || '',
|
|
|
loginUserId: this.mainForm.loginUserId,
|
|
|
refEnginRecordNo: this.mainForm.loginNum || '',
|
|
|
+ refProjectName: this.mainForm.enginName || '',
|
|
|
+ refPromiseStatus: this.mainForm.loginType || '',
|
|
|
refFactoryNo: this.mainForm.factoryNum || '',
|
|
|
+ refUseUnit: this.mainForm.company || '',
|
|
|
+ refLinkman: this.mainForm.contactMan || '',
|
|
|
+ refTel: this.mainForm.tel || '',
|
|
|
+ refPhone: this.mainForm.phone || '',
|
|
|
+ refInstallAddress: this.mainForm.address || '',
|
|
|
saleTypeId: this.mainForm.saleType,
|
|
|
saleTypeCode: saleTypeItem.saleCode,
|
|
|
saleTypeName: saleTypeItem.saleName,
|