Bladeren bron

【修改】零售单

莫绍宝 3 jaren geleden
bovenliggende
commit
31ee889d4f

+ 4 - 0
src/views/supply/apply/components/engin_return_form.vue

@@ -719,6 +719,8 @@ export default {
         this.mainForm.phone = data.refPhone;
         this.mainForm.address = data.refInstallAddress;
         this.mainForm.remark = data.remark;
+        this.mainForm.jxsNum = data.customerNumber;
+        this.mainForm.jxsName = data.customerName;
       })
     },
 
@@ -764,6 +766,8 @@ export default {
 
           let warehouseItem = this.warehouseList.find(o => o.id === this.mainForm.warehouse);
           let params = {
+            customerNumber: this.mainForm.jxsNum,
+            customerName: this.mainForm.jxsName,
             remark: this.mainForm.remark,
             enginOrderNo: this.mainForm.loginNum,
             refProjectName: this.mainForm.enginName,

+ 0 - 3
src/views/supply/engin/components/home_form.vue

@@ -519,7 +519,6 @@ export default {
         examineRemark: '',
         refCount: '',
         regionWork: '',
-        customerId: '',
       },
       mainFormRules: {
         // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
@@ -907,7 +906,6 @@ export default {
         this.mainForm.examineRemark = data.examineNote;
         this.mainForm.loginUserId = data.loginUserId;
         this.mainForm.regionWork = data.refRegionWork;
-        this.mainForm.customerId = data.customerId;
 
         data.items.forEach(item => {
           item.status1 = '';
@@ -936,7 +934,6 @@ export default {
         specification: this.goodsScreenForm.proModel,
         price1: this.goodsScreenForm.price1,
         price2: this.goodsScreenForm.price2,
-        customerId: this.listItem ? this.mainForm.customerId : '',
       }).then(res => {
         let oldGoodsList = this.goodsList;
         let newGoodsList = res.data.records;

+ 20 - 2
src/views/supply/retail/components/retail_form.vue

@@ -77,7 +77,14 @@
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="140" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="mini" clearable style="width: 100%" @change="changeSaleType(scope.$index)" v-if="listItem">
+              <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
+            </el-select>
+            <div v-else>{{scope.row.saleTypeName}}</div>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -423,6 +430,7 @@ export default {
     await this.getSalesmanList();
     this.getDictList();
     this.getWarehouseList();
+    this.getSalesTypeList();
     if(this.listItem) {
       this.isFirst = true;
       this.getDetail();
@@ -555,7 +563,6 @@ export default {
 
     // 点击 选择商品
     openDialog() {
-      this.getSalesTypeList();
       this.isShowDialog = true;
       // if(this.mainForm.type) {
         this.getGoodsList();
@@ -670,6 +677,17 @@ export default {
       }
     },
 
+    changeSaleType(index) {
+      if(this.goodsList[index].saleTypeId) {
+        let obj = this.salesTypeList.find(o => o.id == this.goodsList[index].saleTypeId);
+        this.goodsList[index].saleTypeName = obj.saleName;
+        this.goodsList[index].saleTypeCode = obj.saleCode;
+      }else {
+        this.goodsList[index].saleTypeName = '';
+        this.goodsList[index].saleTypeCode = '';
+      }
+    },
+
     // 检查库存
     checkStock() {
       if(!this.warehouseValue) {