Переглянути джерело

1.编辑,更新子表会将两个子表的id修改成一致,导致保存之后会出现两执行结果
2.入库关闭,开票关闭,到货关闭,付款关闭在新增和编辑中都不能修改,改成只读状态

002390 2 роки тому
батько
коміт
6088cf3345

+ 7 - 6
src/views/purchase/purchase-order/add/column.js

@@ -620,10 +620,10 @@ export const TabColumns = [
       },
       { key: "notaxMoney", title: "无税金额", inputType: "Input", disabled:true,},
       // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
-      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", },
-      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", },
-      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", },
-      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", },
+      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", disabled:true, },
+      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", disabled:true, },
+      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", disabled:true,},
+      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", disabled:true, },
       { key: "isGift", title: "赠品", inputType: "Checkbox", },
       {
         key: "goodsWarehouseName",
@@ -778,8 +778,9 @@ export const TabColumns = [
       {
         key: "materialName",
         title: "物料",
-        require: true,
         inputType: "PopoverSelect",
+        width: 180,
+        require: true,
         valueKey: "id",
         referName: "MATERIAL_PARAM",
         dataMapping: {
@@ -806,7 +807,7 @@ export const TabColumns = [
           isDrug:'isDrug',
         },
         queryParams: () => ({}),
-        width: 180
+        width:180,
       },
       { 
         key: "specification",

+ 18 - 17
src/views/purchase/purchase-order/add/index.vue

@@ -190,24 +190,21 @@ export default {
       // prop.splice(index, 1);
     },
     // 同步子表物料
-    handleSynchronousMaterial(key1, key2) {
+    handleSynchronousMaterial(tableOne, tableTwo) {
       let _this = this;
-      // this.params[key1]-- -> this.params[key2]
-      this.params[key1] &&
-        this.params[key1].forEach((item, index) => {
+      // this.params[tableOne]-- -> this.params[tableTwo]
+      this.params[tableOne] &&
+
+        this.params[tableOne].forEach((item, index) => {
+
           for (const key in item) {
-            if (key in _this.params[key2][index]) {
-              if (
-                key == "material" ||
-                key == "materialName" ||
-                key == "materialCode"
-              ) {
-                _this.params[key2][index].material = item.material;
-                _this.params[key2][index].materialName = item.materialName;
-                _this.params[key2][index].materialCode = item.materialCode;
-              } else {
-                _this.params[key2][index][key] = item[key];
-              }
+            
+            if (key in _this.params[tableTwo][index]) {
+
+              _this.params[tableTwo][index].material = item.material;
+
+              key !== 'id' && ( _this.params[tableTwo][index][key] = item[key]);
+
             }
           }
         });
@@ -636,7 +633,11 @@ export default {
             :label="column.title"
             :name="column.key"
           >
-            <el-table :data="params[column.key]" style="width: 100%">
+            <el-table 
+              :data="params[column.key]" 
+              style="width: 100%"
+              :height="params[column.key].length ? 300 : 100"
+            >
               <el-table-column
                 v-for="(cColumn, cIndex) in column.tableColumns"
                 :key="cIndex"

+ 19 - 18
src/views/purchase/purchase-order/edit/index.vue

@@ -67,24 +67,21 @@ export default {
 
     },
     // 同步子表物料
-    handleSynchronousMaterial(key1, key2) {
+    handleSynchronousMaterial(tableOne, tableTwo) {
       let _this = this;
-      // this.params[key1]-- -> this.params[key2]
-      this.params[key1] &&
-        this.params[key1].forEach((item, index) => {
+      // this.params[tableOne]-- -> this.params[tableTwo]
+      this.params[tableOne] &&
+
+        this.params[tableOne].forEach((item, index) => {
+
           for (const key in item) {
-            if (key in _this.params[key2][index]) {
-              if (
-                key == "material" ||
-                key == "materialName" ||
-                key == "materialCode"
-              ) {
-                _this.params[key2][index].material = item.material;
-                _this.params[key2][index].materialName = item.materialName;
-                _this.params[key2][index].materialCode = item.materialCode;
-              } else {
-                _this.params[key2][index][key] = item[key];
-              }
+
+            if (key in _this.params[tableTwo][index]) {
+
+                _this.params[tableTwo][index].material = item.material;
+
+                key !== 'id' && ( _this.params[tableTwo][index][key] = item[key]);
+
             }
           }
         });
@@ -543,7 +540,11 @@ export default {
             :label="column.title" 
             :name="column.key"
             >
-            <el-table :data="params[column.key].filter(item => item.delFlag === '0')" style="width: 100%">
+            <el-table 
+              :data="params[column.key].filter(item => item.delFlag === '0')" 
+              style="width: 100%"
+              :height="params[column.key].filter(item => item.delFlag === '0').length ? 300 : 100"
+            >
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
@@ -654,5 +655,5 @@ export default {
         </el-row>
       </el-card>
     </el-form>
-  </el-drawer>
+  </el-drawer> 
 </template>