Browse Source

完善组件赋值和禁用状态

Qukatie 5 days ago
parent
commit
5ca8029502

+ 23 - 13
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -26,7 +26,7 @@
               placeholder="调出仓库"
               label="cname"
               res="records"
-              :disabled="disabled"
+              :disabled="isSave||isAddDisabled||form.shipItemsList.length"
               url="/blade-sales-part/storageDesc/list?current=1&size=5"
               :filterable="true"
               :remote="true"
@@ -34,13 +34,13 @@
               @selectChange="dicChange('storageName', $event)"
             ></dic-select>
           </template>
-           <template slot="callInStorageName">
+          <template slot="callInStorageName">
             <dic-select
               v-model="form.callInStorageName"
               placeholder="调入仓库"
               label="cname"
               res="records"
-              :disabled="disabled"
+              :disabled="isSave||isAddDisabled||form.shipItemsList.length"
               url="/blade-sales-part/storageDesc/list?current=1&size=5"
               :filterable="true"
               :remote="true"
@@ -963,11 +963,7 @@ export default {
       this.refresh();
     } else {
       this.optionForm.column.forEach(item => {
-        if (
-          item.prop == "remarks" ||
-          item.prop == "stockClerkId" ||
-          item.prop == "businesDate"
-        ) {
+        if (item.prop == "remarks" || item.prop == "stockClerkId" || item.prop == "businesDate") {
           item.disabled = false;
         } else {
           item.disabled = true;
@@ -985,6 +981,24 @@ export default {
     this.$store.commit("DOMIO_IN_ALLOCATW");
   },
   methods: {
+    dicChange(name, row) {
+      if (name == "storageName") {
+        if (row) {
+          this.form.storageId = row.id;
+        } else {
+          this.form.storageId = null;
+          this.form.storageName = row.id;
+        }
+      }
+      if (name == "callInStorageName") {
+        if (row) {
+          this.form.callInStorageId = row.id;
+        } else {
+          this.form.callInStorageId = null;
+          this.form.callInStorageName = row.id;
+        }
+      }
+    },
     rowDelArea(row, index) {
       if (row.historyList.filter(item => item.id).length) {
         this.$confirm("是否撤销库区?", "提示", {
@@ -1314,11 +1328,7 @@ export default {
         this.isSave = false;
         this.$set(this.optionForm, "disabled", false);
         this.optionForm.column.forEach(item => {
-          if (
-            item.prop == "remarks" ||
-            item.prop == "stockClerkId" ||
-            item.prop == "businesDate"
-          ) {
+          if (item.prop == "remarks" || item.prop == "stockClerkId" || item.prop == "businesDate") {
             item.disabled = false;
           } else {
             item.disabled = true;