Browse Source

修改地图key
修改采购入库编辑限制流程

Qukatie 1 day ago
parent
commit
c2924f7bf5

+ 2 - 2
public/index.html

@@ -23,11 +23,11 @@
   <script src="https://cdn.staticfile.org/Sortable/1.10.0-rc2/Sortable.min.js"></script>
   <script>
     window._AMapSecurityConfig = {
-      securityJsCode: '3d1fa066dcbd64ac5460f63c189f0634',
+      securityJsCode: '96f5ef2c9fddff31f396cdb950de8b91',
     }
   </script>
 <!--    导入高德地图-->
-  <script src="https://webapi.amap.com/maps?v=1.4.15&key=41a0c8e6cc45f8c76306900bf45a1431&plugin=AMap.PlaceSearch,AMap.Autocomplete,AMap.DistrictSearch,AMap.Geocoder,AMap.CitySearch"></script>
+  <script src="https://webapi.amap.com/maps?v=1.4.15&key=4f3d01d4dd63fe9960d22607c3a50e20&plugin=AMap.PlaceSearch,AMap.Autocomplete,AMap.DistrictSearch,AMap.Geocoder,AMap.CitySearch"></script>
   <script src="https://webapi.amap.com/ui/1.1/main.js?v=1.0.11"></script>
 <!--    导入腾旭地图-->
 <!--    <script src="https://map.qq.com/api/gljs?v=1.exp&key=CB2BZ-T3IWN-UPWFO-SR2Y6-4YBXQ-SGBKT"></script>-->

+ 76 - 175
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -7,28 +7,18 @@
         </el-button>
       </div>
       <div class="add-customer-btn">
-        <el-button class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="form.id" @click="confirmEditing">编辑 </el-button>
-        <el-button
-          class="el-button--small-yh"
-          type="primary"
-          :disabled="isButton"
-          size="small"
-          v-if="form.statusName != '已入库'"
-          @click="editCustomer"
-          >保存数据
-        </el-button>
+        <el-button class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
+        <el-button v-else class="el-button--small-yh" type="primary" :disabled="editDisabled" size="small" @click="editCustomer">保存数据 </el-button>
         <el-button
           class="el-button--small-yh"
           type="success"
           size="small"
           v-if="form.statusName == '待入库' || form.statusName == '已撤销'"
           @click="complete"
-          :disabled="isButton"
+          :disabled="editDisabled"
           >入库完成
         </el-button>
-        <el-button class="el-button--small-yh" type="success" size="small" v-if="form.statusName == '已入库'" @click="revoke" :disabled="isButton"
-          >撤销入库
-        </el-button>
+        <el-button class="el-button--small-yh" type="success" size="small" v-if="form.statusName == '已入库'" @click="revoke">撤销入库 </el-button>
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -43,7 +33,6 @@
               v-model="formContacts"
               ref="formContacts"
               :data="form.shipItemsList"
-              :key="key"
               @row-save="rowSave"
               @row-update="rowUpdate"
               @selection-change="selectionContacts"
@@ -84,7 +73,7 @@
                 <el-button
                   v-if="reservoirArea == 1 && row.historyList.length"
                   :size="size"
-                  :disabled="!row.id || form.statusName == '已入库' || isEdit || isEdits"
+                  :disabled="!row.id || editDisabled"
                   type="text"
                   @click="rowDelArea(row, index)"
                 >
@@ -102,7 +91,7 @@
                 <el-button
                   v-if="reservoirArea == 1 && row.historyList.length == 0"
                   :size="size"
-                  :disabled="!row.id || form.statusName == '已入库' || isEdit || isEdits"
+                  :disabled="!row.id || editDisabled"
                   type="text"
                   @click="rowArea(row, index)"
                 >
@@ -111,21 +100,14 @@
                 <el-button
                   v-if="reservoirArea != 1"
                   :size="size"
-                  :disabled="disabled || isEdit"
+                  :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 || form.statusName == '已入库' || isEdit || isEdits"
-                  :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-scope="{ scope, row }" slot="menuLeft">
                 <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
@@ -133,26 +115,19 @@
                                 <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入库区
                                 </el-button> -->
                 <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
-                <el-button
-                  type="danger"
-                  plain
-                  size="small"
-                  :disabled="disabled || form.statusName == '已入库' || isEdit || isEdits"
-                  @click="batchDelete"
-                  >一键删除</el-button
-                >
+                <el-button type="danger" plain size="small" :disabled="editDisabled" @click="batchDelete">一键删除</el-button>
                 <el-button
                   v-if="reservoirArea == 1"
                   type="success"
                   size="small"
                   @click="allClick('修改库区')"
-                  :disabled="disabled || isEdit || selectionMultilist.length == 0"
+                  :disabled="editDisabled || selectionMultilist.length == 0"
                   >修改库区</el-button
                 >
-                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="disabled || isEdit"
+                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="editDisabled"
                   >导入库区</el-button
                 >
-                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('一键清空库区')" :disabled="disabled || isEdit"
+                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('一键清空库区')" :disabled="editDisabled|| selectionMultilist.length == 0"
                   >一键清空库区</el-button
                 >
               </template>
@@ -188,7 +163,7 @@
       <c-upload
         v-loading="loadingBtn"
         typeUpload="LT"
-        :disabled="isEdit"
+        :disabled="editDisabled"
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
         :data="filesList"
         display
@@ -228,7 +203,7 @@
         <el-button type="primary" @click="allClick('修改')" size="mini">修 改</el-button>
       </span>
     </el-dialog>
-    <view-area ref="viewArea" @areaData="areaData" :disabled="disabled || form.statusName == '已入库' || isEdit || isEdits"></view-area>
+    <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
     <el-dialog title="导入明细" append-to-body :visible.sync="excelBox2" width="555px" :close-on-click-modal="false" v-dialog-drag>
       <avue-form
         v-if="excelBox2"
@@ -288,12 +263,10 @@ export default {
       loadingBtn: false,
       filesList: [],
       switchDialog: false,
-      isEdit: false,
       values: "",
-      isEdits: false,
-      isButton: false,
+      editButton: false,
+      editDisabled: false,
       activeName: "sale_detail",
-      disabled: false,
       isrowAdd: true,
       excelBox: false,
       excelOption: {
@@ -367,7 +340,7 @@ export default {
           {
             label: "业务对象",
             prop: "customerId",
-            disabled: false,
+            disabled: true,
             type: "select",
             props: {
               label: "cname",
@@ -392,7 +365,6 @@ export default {
           {
             label: "仓库",
             prop: "storageId",
-            search: true,
             overHidden: true,
             type: "select",
             dicUrl: "/api/blade-sales-part/storageDesc/listAll",
@@ -451,7 +423,6 @@ export default {
           {
             label: "入库数量",
             prop: "sendTotalNum",
-            search: false,
             overHidden: true,
             disabled: true
           },
@@ -500,7 +471,6 @@ export default {
         align: "center",
         index: true,
         addBtn: false, // 新增按钮
-        addBtnText: "录入明细",
         refreshBtn: false,
         editBtn: false, // 修改按钮
         delBtn: false, //删除按钮
@@ -878,34 +848,28 @@ export default {
     this.optionPaymentDetails = await this.getColumnData(this.getColumnName(274.2), this.optionPaymentDetailsBack);
     this.optionOutboundRecords = await this.getColumnData(this.getColumnName(274.3), this.optionOutboundRecordsBack);
     this.key++;
-    this.isButton = true;
-    if (this.onLoad.id && this.detailData.id) {
-      this.refresh(this.onLoad.id, true);
-      this.$set(this.optionForm, "disabled", true);
-      this.$set(this.optionContactsBack, "disabled", true);
+    if (this.detailData.id) {
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
+      this.refresh(this.detailData.id, true);
     } else if (this.onLoad.id) {
-      console.log(2);
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
       this.refresh(this.onLoad.id, true);
     }
-    if (!this.form.id) {
-      this.isEdit = true;
-      // this.$set(this.optionContactsBack, "addBtn", false)
-      this["optionContacts"] = this["optionContactsBack"];
-      this.delColumnData(this.getColumnName("269.1"), this["optionContactsBack"]);
-    }
-    if (!this.onLoad.id) {
-      this.isrowAdd = false;
-      this.isEdit = false;
-      // this.$set(this.optionForm,'disabled',false)
-      // this.$set(this.optionContacts,'disabled',false)
-    }
-    // if (this.detailData.id) {
-    //     this.refresh()
-    // }
+
     if (this.$route.query.srcId) {
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
       this.refresh(this.$route.query.srcId);
     }
     if (this.$route.query.id) {
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
       this.refresh(this.$route.query.id);
     }
     this.$store.commit("DOMIO_IN_DETAIL");
@@ -1122,19 +1086,15 @@ export default {
           })
             .then(res => {
               if (res.data.code === 601) {
-                if (this.onLoad.id) {
-                  console.log(2);
-                  this.refresh(this.onLoad.id, true);
-                }
                 this.$message({
                   type: "error",
                   message: res.data.msg
                 });
-                return true;
+                this.refresh(this.form.id);
+              } else {
+                this.$message.success("撤销成功");
+                this.refresh(this.form.id,true);
               }
-              this.$message.success("撤销成功");
-              this.refresh(res.data.data.id);
-              loading.close();
             })
             .finally(() => {
               loading.close();
@@ -1144,57 +1104,15 @@ export default {
     },
     //编辑
     confirmEditing() {
-      this.isButton = false;
+      this.editButton = false;
       if (this.form.statusName == "待入库" || this.form.statusName == "已撤销") {
-        this.isEdit = false;
-        this.isrowAdd = false;
-        this.$set(this.optionForm, "disabled", false);
-        this.$set(this.optionContacts, "disabled", false);
-        this.optionForm.column.forEach(item => {
-          if (item.prop == "remarks" || item.prop == "createTime" || item.prop == "stockClerkId") {
-            this.$set(item, "disabled", false);
-          } else {
-            this.$set(item, "disabled", true);
-          }
-        });
-        this.optionContacts.column.forEach(item => {
-          if (item.prop == "remarks" || item.prop == "dot" || item.prop == "sendNum") {
-            this.$set(item, "disabled", false);
-          } else {
-            this.$set(item, "disabled", true);
-          }
-        });
-        if (this.form.billno.substring(0, 4) == "TKSH") {
-          // this.isEdit = true
-          this.isEdits = true;
-          this.isrowAdd = true;
-          this.optionContacts.column.forEach(item => {
-            if (item.prop == "remarks" || item.prop == "sendNum" || item.prop == "price" || item.prop == "dot") {
-              this.$set(item, "disabled", false);
-            } else {
-              this.$set(item, "disabled", true);
-            }
-          });
-        }
-      } else if (this.form.statusName == "已入库") {
-        this.$set(this.optionForm, "disabled", false);
-        this.$set(this.optionContactsBack, "disabled", false);
-        this.optionForm.column.forEach(item => {
-          if (item.prop == "remarks") {
-            this.$set(item, "disabled", false);
-          } else {
-            this.$set(item, "disabled", true);
-          }
-        });
-        this.optionContactsBack.column.forEach(item => {
-          if (item.prop == "remarks") {
-            this.$set(item, "disabled", false);
-          } else {
-            this.$set(item, "disabled", true);
-          }
-        });
+        this.editDisabled = false;
+        this.optionForm.disabled = false;
+      }
+      if (this.form.statusName == "已入库") {
+        this.editDisabled = true;
+        this.optionForm.disabled = true;
       }
-      console.log(this.form.shipItemsList[0].goodsId);
       goodsDetail({ id: this.form.shipItemsList[0].goodsId, stock: this.form.storageId ? this.form.storageId : "" }).then(res => {
         if (res.data.data.whether == 0) {
           this.findObject(this.optionContacts.column, "dot").disabled = true;
@@ -1204,7 +1122,6 @@ export default {
             storageId: this.form.storageId,
             goodsId: this.formContacts.goodsId
           }).then(res => {
-            console.log("567");
             this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
           });
         }
@@ -1234,31 +1151,24 @@ export default {
           })
             .then(res => {
               if (res.data.code === 601) {
-                if (this.onLoad.id) {
-                  console.log(2);
-                  this.refresh(this.onLoad.id, true);
-                }
                 this.$message({
                   type: "error",
                   message: res.data.msg
                 });
-                return true;
-              }
-              warehousingComplete({
-                ...this.form,
-                bizTypeName: this.form.id ? this.form.bizTypeName : "SHGD"
-              })
-                .then(res => {
-                  this.refresh(res.data.data.id);
-                  this.isEdit = true;
-                  this.$set(this.optionForm, "disabled", true);
-                  this.$set(this.optionContactsBack, "disabled", true);
-                  this.$message.success("入库完成");
-                  loading.close();
+                this.refresh(this.form.id);
+              } else {
+                warehousingComplete({
+                  ...this.form,
+                  bizTypeName: this.form.id ? this.form.bizTypeName : "SHGD"
                 })
-                .finally(() => {
-                  loading.close();
-                });
+                  .then(res => {
+                    this.refresh(res.data.data.id);
+                    this.$message.success("入库完成");
+                  })
+                  .finally(() => {
+                    loading.close();
+                  });
+              }
             })
             .catch(() => {
               loading.close();
@@ -1291,19 +1201,15 @@ export default {
           })
             .then(res => {
               if (res.data.code === 601) {
-                if (this.onLoad.id) {
-                  console.log(2);
-                  this.refresh(this.onLoad.id, true);
-                }
                 this.$message({
                   type: "error",
                   message: res.data.msg
                 });
-                return true;
+                this.refresh(this.form.id);
+              } else {
+                this.$message.success("保存成功");
+                this.refresh(res.data.data.id);
               }
-              this.$message.success("保存成功");
-              this.refresh(res.data.data.id);
-              loading.close();
             })
             .finally(() => {
               loading.close();
@@ -1320,27 +1226,22 @@ export default {
         spinner: "el-icon-loading",
         background: "rgba(255,255,255,0.7)"
       });
-      if (!this.detailData.id) {
-        getDetails({ id: id })
-          .then(res => {
-            this.form = res.data.data;
-            this.filesList = res.data.data.filesList;
-            loading.close();
-          })
-          .catch(() => {
-            loading.close();
-          });
-      } else {
-        getDetails({ id: this.detailData.id })
-          .then(res => {
-            this.form = res.data.data;
-            this.filesList = res.data.data.filesList;
-            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;
+        })
+        .finally(() => {
+          loading.close();
+        });
     },
     // 获取业务对象
     corpsDescListAllfun(corpType) {

+ 6 - 0
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -624,6 +624,9 @@ export default {
       this.refresh();
     }
     if (this.$route.query.srcId) {
+      this.editButton = true;
+      this.editDisabled = true;
+      this.optionForm.disabled = true;
       this.refresh(this.$route.query.srcId);
     }
     this.$store.commit("DOMIO_IN_DETAIL");
@@ -734,6 +737,7 @@ export default {
                   type: "error",
                   message: res.data.msg
                 });
+                this.refresh(this.form.id);
               } else {
                 this.$message.success("撤销成功");
                 this.refresh(this.form.id,true);
@@ -805,6 +809,7 @@ export default {
                   type: "error",
                   message: res.data.msg
                 });
+                this.refresh(this.form.id);
               } else {
                 warehousingComplete({
                   ...this.form,
@@ -865,6 +870,7 @@ export default {
                   type: "error",
                   message: res.data.msg
                 });
+                this.refresh(this.form.id);
               } else {
                 this.$message.success("保存成功");
                 this.refresh(res.data.data.id);

+ 1 - 1
src/views/tirePartsMall/salesService/inStorage/detailsPage.vue

@@ -137,7 +137,7 @@
                 <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="disabled || isEdit"
                   >导入库区</el-button
                 >
-                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('一键清空库区')" :disabled="disabled || isEdit"
+                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('一键清空库区')" :disabled="disabled || isEdit|| selectionMultilist.length == 0"
                   >一键清空库区</el-button
                 >
               </template>