|
@@ -25,13 +25,15 @@
|
|
|
</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="mainId">
|
|
|
<el-select v-model="mainForm.mainId" placeholder="选择产品大类" style="width: 100%">
|
|
|
<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> -->
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="经销商编码" prop="jxsNum">
|
|
|
<el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled></el-input>
|
|
@@ -154,9 +156,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
|
|
|
+ <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)" :disabled="!scope.row.saleTypeId">
|
|
|
<el-option
|
|
|
- v-for="item in retailProductList"
|
|
|
+ v-for="item in scope.row.productList"
|
|
|
:key="item.number"
|
|
|
:label="item.name"
|
|
|
:value="item.number">
|
|
@@ -194,7 +196,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;">
|
|
@@ -220,7 +222,7 @@ export default {
|
|
|
mainForm: {
|
|
|
orderNum: '',
|
|
|
orderDate: '',
|
|
|
- mainId: '102',
|
|
|
+ // mainId: '102',
|
|
|
jxsNum: '',
|
|
|
enginName: '',
|
|
|
orderType: '',
|
|
@@ -254,23 +256,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- computed: {
|
|
|
- sidebar() {
|
|
|
- return this.$store.state.app.sidebar
|
|
|
- },
|
|
|
- classObj() {
|
|
|
- return {
|
|
|
- hideSidebar: !this.sidebar.opened,
|
|
|
- openSidebar: this.sidebar.opened
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
created() {
|
|
|
this.getDictList();
|
|
|
this.getTypeList();
|
|
|
- this.getRetailProductList();
|
|
|
if(this.listItem) {
|
|
|
this.getDetail();
|
|
|
}else {
|
|
@@ -310,7 +298,7 @@ export default {
|
|
|
let data = res.data;
|
|
|
this.mainForm.orderNum = data.enginInfoNo;
|
|
|
this.mainForm.orderDate = data.orderDate;
|
|
|
- this.mainForm.mainId = data.productCategoryId;
|
|
|
+ // this.mainForm.mainId = data.productCategoryId;
|
|
|
this.mainForm.jxsNum = data.customerId;
|
|
|
this.mainForm.enginName = data.projectName;
|
|
|
this.mainForm.orderType = data.orderType;
|
|
@@ -330,6 +318,10 @@ export default {
|
|
|
this.mainForm.contractDate = data.contractExpireDate;
|
|
|
|
|
|
this.goodsList = data.items;
|
|
|
+
|
|
|
+ for (let i = 0; i < this.goodsList.length; i++) {
|
|
|
+ this.getRetailProductList(i);
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -351,12 +343,15 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 获取商品列表
|
|
|
- getRetailProductList() {
|
|
|
+ getRetailProductList(index) {
|
|
|
getRetailProductList({
|
|
|
pageNum: 1,
|
|
|
pageSize: -1,
|
|
|
+ saleId: this.goodsList[index].saleTypeId
|
|
|
}).then(res => {
|
|
|
- this.retailProductList = res.data.records;
|
|
|
+ let item = this.goodsList[index];
|
|
|
+ item.productList = res.data.records;
|
|
|
+ this.$set(this.goodsList, index, item);
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -367,19 +362,28 @@ export default {
|
|
|
this.goodsList[index].saleTypeName = obj.saleName;
|
|
|
this.goodsList[index].saleTypeCode = obj.saleCode;
|
|
|
}
|
|
|
+ this.goodsList[index].materialNumber = '';
|
|
|
+ this.goodsList[index].materialName = '';
|
|
|
+ this.goodsList[index].materialId = '';
|
|
|
+ this.goodsList[index].specification = '';
|
|
|
+ this.goodsList[index].unit = '';
|
|
|
+ this.goodsList[index].price = '';
|
|
|
+ this.goodsList[index].taxRate = '';
|
|
|
+ this.getRetailProductList(index);
|
|
|
},
|
|
|
|
|
|
// 修改产品
|
|
|
changeGoods(index) {
|
|
|
if(this.goodsList[index].materialNumber) {
|
|
|
- let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
|
|
|
- this.goodsList[index].materialName = obj.name;
|
|
|
- this.goodsList[index].materialId = obj.materialId;
|
|
|
- this.goodsList[index].specification = obj.specification;
|
|
|
- this.goodsList[index].baseUnitId = obj.baseUnit;
|
|
|
- this.goodsList[index].price = obj.batchPrice;
|
|
|
- this.goodsList[index].taxRate = obj.taxRate;
|
|
|
- this.goodsList[index].mainId = obj.mainId;
|
|
|
+ let obj = this.goodsList[index].productList.find(o => o.number == this.goodsList[index].materialNumber);
|
|
|
+ let item = this.goodsList[index];
|
|
|
+ item.materialName = obj.name;
|
|
|
+ item.materialId = obj.materialId;
|
|
|
+ item.specification = obj.specification;
|
|
|
+ item.unit = obj.unit;
|
|
|
+ item.price = obj.batchPrice;
|
|
|
+ item.taxRate = obj.taxRate;
|
|
|
+ this.$set(this.goodsList, index, item);
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -401,14 +405,10 @@ export default {
|
|
|
this.$errorMsg('请选择销售类型');
|
|
|
return;
|
|
|
}
|
|
|
- }
|
|
|
- for(let i=0; i<this.goodsList.length; i++) {
|
|
|
if(!this.goodsList[i].materialNumber) {
|
|
|
this.$errorMsg('请选择产品');
|
|
|
return;
|
|
|
}
|
|
|
- }
|
|
|
- for(let i=0; i<this.goodsList.length; i++) {
|
|
|
if(!this.goodsList[i].qty) {
|
|
|
this.$errorMsg('请输入数量');
|
|
|
return;
|
|
@@ -417,7 +417,7 @@ export default {
|
|
|
|
|
|
let params = {
|
|
|
// orderDate: this.mainForm.orderDate + ' 00:00:00',
|
|
|
- mainId: this.mainForm.mainId,
|
|
|
+ // mainId: this.mainForm.mainId,
|
|
|
projectName: this.mainForm.enginName,
|
|
|
orderType: this.mainForm.orderType,
|
|
|
useUnit: this.mainForm.company,
|