Explorar o código

修稿禅道备注问题
调拨优化编辑流程操作

Qukatie hai 2 días
pai
achega
16e9b01abe

+ 2 - 2
src/views/tirePartsMall/purchaseService/outStorage/detailsPage.vue

@@ -419,7 +419,7 @@ export default {
             dicUrl: "/api/blade-sales-part/stockDesc/dotList"
           },
           {
-            label: "采购数量",
+            label: "退货数量",
             prop: "goodsNum",
             disabled: false
           },
@@ -430,7 +430,7 @@ export default {
             overHidden: true
           },
           {
-            label: "退数量",
+            label: "退数量",
             prop: "sendNum",
             // cell: true,
             disabled: false

+ 1 - 6
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -194,7 +194,7 @@
           placeholder="库区"
           label="cname"
           res="records"
-          :url="'/blade-sales-part/reservoirarea/list?current=1&size=5&storageId=' + form.storageId"
+          :url="'/blade-sales-part/reservoirarea/listZero?current=1&size=5&storageId=' + form.storageId"
           :filterable="true"
           :remote="true"
           dataName="cname"
@@ -948,11 +948,6 @@ export default {
         this.diaVisible = false;
       }
       if (name == "导入库区") {
-        for (let item of this.form.shipItemsList) {
-          if (item.historyList.length) {
-            return this.$message.error("请清空库区");
-          }
-        }
         this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
         this.excelBox2 = true;
       }

+ 18 - 3
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/components/viewArea.vue

@@ -12,7 +12,7 @@
       >
         <template slot-scope="{ scope, row }" slot="menuLeft">
           <div style="display: flex;">
-            <el-button type="primary" size="small" @click="addRow">新增</el-button>
+            <el-button type="primary" size="small" @click="addRow" :disabled="disabled">新增</el-button>
             <dic-select
               v-if="dialogVisible"
               style="width: 300px;"
@@ -23,6 +23,7 @@
               :url="'/blade-sales-part/stockDesc/dotList?storageId=' + form.storageId + '&goodsId=' + query.goodsId"
               :filterable="true"
               :allowCreate="true"
+              @selectChange="dicChange('dot', $event)"
             ></dic-select>
             <el-tag type="danger" style="margin-left: 10px;">库存数量:{{ qtyMax }}</el-tag>
             <el-tag type="danger" style="margin-left: 10px;">库存融资:{{ query.inventoryFinancing }}</el-tag>
@@ -96,7 +97,7 @@
       </avue-crud>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
-        <el-button type="primary" @click="submit" size="mini">确 认</el-button>
+        <el-button type="primary" @click="submit" size="mini" :disabled="disabled">确 认</el-button>
       </span>
     </el-dialog>
   </div>
@@ -175,6 +176,19 @@ export default {
   },
   async created() {},
   methods: {
+    dicChange(name, row) {
+      if (name == "dot") {
+        if (row) {
+          this.qtyMax=row.balanceQuantity
+          this.query.inventoryFinancing=row.balanceQuantityFinancing
+          this.query.inventoryHave=row.balanceQuantityHave
+        } else {
+          this.qtyMax= 0;
+          this.query.inventoryFinancing = 0;
+          this.query.inventoryHave = 0;
+        }
+      }
+    },
     rowDicChange(name, row, el) {
       if (name == "reservoirAreaName") {
         if (row) {
@@ -260,7 +274,7 @@ export default {
       this.data = [];
       this.qtyMax = 0;
       this.form = form;
-      this.query = row;
+      this.query =this.deepClone(row) ;
       this.index = index;
       this.data = this.deepClone(row.historyList);
       this.qtyMax = row.inventory;
@@ -305,6 +319,7 @@ export default {
       let obj = {
         ...this.query,
         sendNum: sum,
+        inventory:this.qtyMax,
         sendNumFinancing: sendNumFinancing,
         sendNumHave: sendNumHave,
         historyList: this.data

+ 66 - 161
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -8,17 +8,17 @@
       </div>
       <div class="add-customer-btn">
         <el-button class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
-        <el-button class="el-button--small-yh" type="primary" size="small" :disabled="isSave" @click="editCustomer">保存数据 </el-button>
+        <el-button v-else class="el-button--small-yh" type="primary" size="small" @click="editCustomer" :disabled="editDisabled">保存数据 </el-button>
         <el-button
           class="el-button--small-yh"
           type="warning"
           size="small"
           v-if="form.statusName == '确认调拨'"
           @click="revoke"
-          :disabled="isSave || form.status == '是'"
+          :disabled=" form.status == '是'"
           >撤销调拨
         </el-button>
-        <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;" v-else @click="complete" :disabled="isSave"
+        <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;" v-else @click="complete" :disabled="editDisabled"
           >确认调拨
         </el-button>
         <el-button
@@ -28,7 +28,7 @@
           size="small"
           style="margin-left: 6px;"
           @click="confirmComplete"
-          :disabled="isSave"
+          :disabled="form.status == '是'"
           >已出仓
         </el-button>
       </div>
@@ -42,7 +42,7 @@
               placeholder="调出仓库"
               label="cname"
               res="records"
-              :disabled="isSave || isAddDisabled || form.shipItemsList.length"
+              :disabled="editDisabled || form.shipItemsList.length"
               url="/blade-sales-part/storageDesc/list?current=1&size=5"
               :filterable="true"
               :remote="true"
@@ -56,7 +56,7 @@
               placeholder="调入仓库"
               label="cname"
               res="records"
-              :disabled="isSave || isAddDisabled || form.shipItemsList.length"
+              :disabled="editDisabled || form.shipItemsList.length"
               url="/blade-sales-part/storageDesc/list?current=1&size=5"
               :filterable="true"
               :remote="true"
@@ -80,7 +80,7 @@
           @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 430)"
         >
           <template slot-scope="{ scope, row }" slot="menuLeft">
-            <el-button type="primary" icon="el-icon-printer" size="small" @click="adddiailsfun">录入明细</el-button>
+            <el-button type="primary" icon="el-icon-printer" size="small" @click="adddiailsfun" :disabled="editDisabled">录入明细</el-button>
             <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
             <el-popover width="800" trigger="click" placement="right">
               <avue-crud :data="inventoryData" :option="inventoryOption">
@@ -89,13 +89,19 @@
                     type="text"
                     icon="el-icon-refresh"
                     size="small"
-                    :disabled="row.storageId != form.storageId"
+                    :disabled="row.storageId != form.storageId || editDisabled"
                     @click.stop="synchronous(row)"
                     >更新库存
                   </el-button>
                 </template>
               </avue-crud>
-              <el-button type="primary" plain size="small" slot="reference" @click="viewInventory" :disabled="selectionMultilist.length != 1"
+              <el-button
+                type="primary"
+                plain
+                size="small"
+                slot="reference"
+                @click="viewInventory"
+                :disabled="selectionMultilist.length != 1 || editDisabled"
                 >同步库存</el-button
               >
             </el-popover>
@@ -104,7 +110,7 @@
             <el-button
               v-if="reservoirArea == 1 && row.historyList.length"
               :size="size"
-              :disabled="!row.id || disabled || isAddDisabled"
+              :disabled="!row.id || editDisabled"
               type="text"
               @click="rowDelArea(row, index)"
             >
@@ -116,7 +122,7 @@
             <el-button
               v-if="reservoirArea == 1 && row.historyList.length == 0"
               :size="size"
-              :disabled="!row.id || disabled || isAddDisabled"
+              :disabled="!row.id || editDisabled"
               type="text"
               @click="rowArea(row, index)"
             >
@@ -125,16 +131,14 @@
             <el-button
               v-if="reservoirArea != 1"
               :size="size"
-              :disabled="disabled || isAddDisabled"
+              :disabled="editDisabled"
               :type="type"
               :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
               @click="rowEdit(row, index)"
             >
               {{ row.$cellEdit ? "保存" : "编辑" }}
             </el-button>
-            <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled" :type="type" @click="rowDelBox(row, index)"
-              >删除
-            </el-button>
+            <el-button icon="el-icon-delete" :size="size" :disabled="editDisabled" :type="type" @click="rowDelBox(row, index)">删除 </el-button>
           </template>
           <template slot="goodsNum" slot-scope="{ row }">
             <el-input-number
@@ -196,12 +200,12 @@
           </template>
         </avue-crud>
       </trade-card>
-      <view-area ref="viewArea" @areaData="areaData" :disabled="disabled || isAddDisabled"></view-area>
+      <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload
         v-loading="loadingBtn"
         typeUpload="LT"
-        :disabled="isAddDisabled"
+        :disabled="editDisabled"
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
         :data="filesList"
         display
@@ -288,11 +292,8 @@ export default {
 
       switchDialog: false,
       activeName: "sale_detail",
-      editButton: true,
-      isSave: true,
-      disabled: false,
-      isDisabled: false,
-      isAddDisabled: false,
+      editButton: false,
+      editDisabled: false,
       form: {
         shipItemsList: [],
         shipVOList: [],
@@ -304,27 +305,10 @@ export default {
         menuBtn: false,
         span: 8,
         column: [
-          //     {
-          //   label: '业务对象',
-          //   disabled: false,
-          //   prop: "customerId",
-          //   type: 'select',
-          //   props: {
-          //     label: 'cname',
-          //     value: 'id'
-          //   },
-          //   dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH&enableOrNot=1',
-          //     dicData:[],
-          //   rules: [{
-          //     required: true,
-          //     message: " ",
-          //     trigger: "blur"
-          //   }]
-          // },
           {
             label: "调出仓库",
             prop: "storageName",
-            disabled: true,
+            disabled: false,
             // type: "select",
             // props: {
             //   label: "cname",
@@ -342,7 +326,7 @@ export default {
           {
             label: "调入仓库",
             prop: "callInStorageName",
-            disabled: true,
+            disabled: false,
             // type: "select",
             // props: {
             //   label: "cname",
@@ -361,7 +345,7 @@ export default {
             label: "库管",
             prop: "stockClerkId",
             type: "select",
-            disabled: true,
+            disabled: false,
             props: {
               label: "realName",
               value: "id"
@@ -379,7 +363,7 @@ export default {
             label: "业务日期",
             prop: "businesDate",
             searchProp: "businesDateList",
-            disabled: true,
+            disabled: false,
             type: "datetime",
             value: dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss"),
             format: "yyyy-MM-dd HH:mm",
@@ -417,7 +401,6 @@ export default {
       optionContactsBack: {
         align: "center",
         index: true,
-        addBtnText: "录入明细",
         updateBtnText: "保存",
         refreshBtn: false,
         dialogDrag: true,
@@ -1001,23 +984,10 @@ export default {
     });
     this.key++;
     if (this.detailData.id) {
-      this.refresh();
-    } else {
-      this.optionForm.column.forEach(item => {
-        if (item.prop == "remarks" || item.prop == "stockClerkId" || item.prop == "businesDate") {
-          item.disabled = false;
-        } else {
-          item.disabled = true;
-        }
-      });
-      this.editButton = false;
-      this.isSave = false;
-    }
-    this.$store.commit("DOMIO_IN_ALLOCATW");
-  },
-  activated() {
-    if (this.detailData.id) {
-      this.refresh();
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
+      this.refresh(this.detailData.id);
     }
     this.$store.commit("DOMIO_IN_ALLOCATW");
   },
@@ -1072,12 +1042,14 @@ export default {
       this.$refs.viewArea.openDialog(this.form, row, index);
     },
     areaData(row, index) {
-      console.log(row, index);
       this.form.shipItemsList[index].dot = row.dot;
       this.form.shipItemsList[index].goodsNum = row.sendNum;
       this.form.shipItemsList[index].sendNumFinancing = row.sendNumFinancing;
       this.form.shipItemsList[index].sendNumHave = row.sendNumHave;
       this.form.shipItemsList[index].historyList = row.historyList;
+      this.form.shipItemsList[index].inventory = row.inventory;
+      this.form.shipItemsList[index].inventoryFinancing = row.inventoryFinancing;
+      this.form.shipItemsList[index].inventoryHave = row.inventoryHave;
     },
     viewInventory() {
       inventoryList({
@@ -1115,8 +1087,7 @@ export default {
           })
             .then(res => {
               this.$message.success("撤销成功");
-              this.refresh(res.data.data.id);
-              loading.close();
+              this.refresh(this.form.id, true);
             })
             .finally(() => {
               loading.close();
@@ -1225,8 +1196,7 @@ export default {
               })
                 .then(res => {
                   this.$message.success("调拨完成");
-                  this.refresh(res.data.data.id);
-                  loading.close();
+                  this.refresh(this.form.id);
                 })
                 .finally(() => {
                   loading.close();
@@ -1259,9 +1229,7 @@ export default {
           })
             .then(res => {
               this.$message.success("保存成功");
-              this.editButton = true;
               this.refresh(res.data.data.id);
-              loading.close();
             })
             .finally(() => {
               loading.close();
@@ -1272,70 +1240,31 @@ export default {
       });
     },
     refresh(id, type) {
-      this.$set(this.optionContactsBack, "addBtn", false);
-      this.$set(this.optionContacts, "addBtn", false);
-      this.isDisabled = true;
       const loading = this.$loading({
         lock: true,
         text: "加载中",
         spinner: "el-icon-loading",
         background: "rgba(255,255,255,0.7)"
       });
-      if (!this.detailData.id) {
-        getDetails({ id: id })
-          .then(res => {
-            if (res.data.data.statusName == "确认调拨") {
-              this.$set(this.optionForm, "disabled", true);
-              this.isAddDisabled = true;
-              this.optionContacts.column.forEach(item => {
-                if (item.prop == "sendNum") {
-                  item.disabled = true;
-                }
-              });
-            }
-            this.isAddDisabled = true;
-            if (res.data.data.statusName == "录入") {
-              this.isAddDisabled = true;
-              this.isDisabled = true;
-            }
-            this.form = res.data.data;
-            this.filesList = res.data.data.filesList;
-            this.$nextTick(() => {
-              this.$refs.formContacts.refreshTable();
-            });
-            loading.close();
-          })
-          .catch(() => {
-            loading.close();
-          });
-      } else {
-        getDetails({ id: this.detailData.id })
-          .then(res => {
-            if (res.data.data.statusName == "已出库") {
-              this.$set(this.optionForm, "disabled", true);
-              this.isAddDisabled = true;
-              this.optionContacts.column.forEach(item => {
-                if (item.prop == "sendNum") {
-                  item.disabled = true;
-                }
-              });
-            }
-            this.isAddDisabled = true;
-            if (res.data.data.statusName == "待出库") {
-              this.isAddDisabled = true;
-              this.isDisabled = true;
-            }
-            this.form = res.data.data;
-            this.filesList = res.data.data.filesList;
-            this.$nextTick(() => {
-              this.$refs.formContacts.refreshTable();
-            });
-            loading.close();
-          })
-          .catch(() => {
-            loading.close();
+      getDetails({ id: id })
+        .then(res => {
+          if (res.data.data.statusName == "确认调拨") {
+            this.editDisabled = true;
+            this.optionForm.disabled = true;
+          }
+          if (type && !this.editButton) {
+            this.editDisabled = false;
+            this.optionForm.disabled = false;
+          }
+          this.form = res.data.data;
+          this.filesList = res.data.data.filesList;
+          this.$nextTick(() => {
+            this.$refs.formContacts.refreshTable();
           });
-      }
+        })
+        .finally(() => {
+          loading.close();
+        });
     },
     rowDelBox(row, index) {
       this.$confirm("确定将选择数据删除?", {
@@ -1370,7 +1299,11 @@ export default {
     // 新增出库明细
     adddiailsfun() {
       if (!this.form.storageId) {
-        this.$message.warning("请先选择调出仓库!");
+        this.$message.warning("请选择调出仓库!");
+        return;
+      }
+      if(!this.form.callInStorageId) {
+        this.$message.warning("请选择调入仓库!");
         return;
       }
       this.$refs.dialogAssemblyRef.dialogVisible = true;
@@ -1379,42 +1312,14 @@ export default {
     },
     //编辑
     confirmEditing() {
+      this.editButton = false;
       if (this.form.statusName == "录入") {
-        this.isDisabled = false;
-        this.isSave = false;
-        this.$set(this.optionForm, "disabled", false);
-        this.optionForm.column.forEach(item => {
-          if (item.prop == "remarks" || item.prop == "stockClerkId" || item.prop == "businesDate") {
-            item.disabled = false;
-          } else {
-            item.disabled = true;
-          }
-        });
-        // if (this.form.shipItemsList.length != 0) {
-        //   this.findObject(this.optionForm.column, "storageId").disabled = true;
-        // }
-
-        this.isAddDisabled = false;
-        this.optionContactsBack.column.forEach(its => {
-          if (its.prop == "dot") {
-            this.$set(its, "disabled", false);
-          }
-        });
-      } else {
-        this.$set(this.optionForm, "disabled", false);
-        this.isAddDisabled = true;
-        this.isSave = false;
-        // this.optionForm.column.forEach(item => {
-        //   if (item.prop == 'remarks') {
-        //     item.disabled = false
-        //   } else {
-        //     item.disabled = true
-        //   }
-        // })
-        this.optionForm.column.forEach(item => {
-          item.disabled = true;
-        });
-        // this.isAddDisabled = false
+        this.editDisabled = false;
+        this.optionForm.disabled = false;
+      }
+      if (this.form.statusName == "确认调拨") {
+        this.editDisabled = true;
+        this.optionForm.disabled = true;
       }
     },
     calculator(row) {

+ 1 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/index.vue

@@ -44,7 +44,7 @@
         </template>
       </avue-crud>
     </basic-container>
-    <detailsPage ref="detailsPageRef" v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+    <detailsPage ref="detailsPageRef" v-if="detailsOpen" :detailData="detailData" @backToList="backToList"></detailsPage>
 
     <el-dialog title="发货" :visible.sync="dialogVisible" append-to-body close-on-click-modal close-on-press-escape width="40%">
       <div class="elForm">