Browse Source

修改出库工单确认出库和撤销出库
开发入库工单模块

Qukatie 2 months ago
parent
commit
b43a3e1db0

+ 48 - 89
src/views/outboundWorkOrder/detailsPage.vue

@@ -152,12 +152,7 @@
               :data="form.shipVOList"
               :key="key"
               @row-save="rowSave"
-              @row-update="rowUpdate"
-              @resetColumn="
-                resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)
-              "
-              @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
-            >
+              @row-update="rowUpdate" >
             </avue-crud>
           </el-tab-pane>
           <el-tab-pane label="历史记录" name="outbound_records">
@@ -169,12 +164,6 @@
               :key="key"
               @row-save="rowSave"
               @row-update="rowUpdate"
-              @resetColumn="
-                resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)
-              "
-              @saveColumn="
-                saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)
-              "
             >
             </avue-crud>
           </el-tab-pane>
@@ -414,21 +403,6 @@ export default {
           },
         ],
         column: [
-          //   {
-          //   label: '商品名称',
-          //   prop: 'goodsId',
-          //   disabled: true,
-          //   width: 200,
-          //   overHidden: true,
-          //   hide: true,
-          //   type: 'select',
-          //   remote: true,
-          //   props: {
-          //     label: 'cname',
-          //     value: 'id'
-          //   },
-          //   dicUrl: '/api/gubersail-admin/goodsDesc/list?current=1&size=10&cname={{key}}&enableOrNot=1'
-          // },
           {
             label: "商品名称",
             prop: "goodsName",
@@ -499,7 +473,7 @@ export default {
           {
             label: "库区",
             prop: "reservoirArea",
-            width:100,
+            width: 100,
           },
           {
             label: "库存",
@@ -632,20 +606,6 @@ export default {
     detailData: Object,
   },
   async created() {
-    isProcurement({ param: "whether.model" }).then((res) => {
-      if (res.data.data == 1) {
-        this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
-      }
-    });
-    this.key++;
-    // if (this.onLoad.id && this.detailData.id) {
-    //   console.log(1);
-    //   this.refresh(this.onLoad.id, true);
-    //   this.$set(this.optionForm, "disabled", true);
-    // } else if (this.onLoad.id) {
-    //   console.log(2);
-    //   this.refresh(this.onLoad.id, true);
-    // }
     if (this.detailData.id) {
       this.refresh(this.detailData.id, true);
       this.$set(this.optionForm, "disabled", true);
@@ -784,40 +744,40 @@ export default {
           this.form.shipItemsList.forEach((item) => {
             item.goodsName = item.$goodsId;
           });
-          submit({
+          // submit({
+          //   ...this.form,
+          //   bizTypeName: "FHGD",
+          // })
+          //   .then((res) => {
+          //     if (res.data.code === 601) {
+          //       if (this.onLoad.id && this.detailData.id) {
+          //         console.log(1);
+          //         this.refresh(this.onLoad.id, true);
+          //         this.$set(this.optionForm, "disabled", true);
+          //       } else if (this.onLoad.id) {
+          //         console.log(2);
+          //         this.refresh(this.onLoad.id, true);
+          //       }
+          //       this.$message({
+          //         type: "error",
+          //         message: res.data.msg,
+          //       });
+          //       return true;
+          //     }
+
+          //   .catch(() => {
+          //     loading.close();
+          //   });
+          warehousingComplete({
             ...this.form,
             bizTypeName: "FHGD",
           })
             .then((res) => {
-              if (res.data.code === 601) {
-                if (this.onLoad.id && this.detailData.id) {
-                  console.log(1);
-                  this.refresh(this.onLoad.id, true);
-                  this.$set(this.optionForm, "disabled", true);
-                } else 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: "FHGD",
-              })
-                .then((res) => {
-                  this.$message.success("出库完成");
-                  this.refresh(res.data.data.id);
-                  loading.close();
-                })
-                .finally(() => {
-                  loading.close();
-                });
+              this.$message.success("出库完成");
+              this.refresh(res.data.data.id);
+              loading.close();
             })
-            .catch(() => {
+            .finally(() => {
               loading.close();
             });
         } else {
@@ -874,22 +834,22 @@ export default {
             filesList: this.filesList,
           })
             .then((res) => {
-              if (res.data.code === 601) {
-                console.info("11111111111----", res);
-                if (this.onLoad.id && this.detailData.id) {
-                  console.log(1);
-                  this.refresh(this.onLoad.id, true);
-                  this.$set(this.optionForm, "disabled", true);
-                } else if (this.onLoad.id) {
-                  console.log(2);
-                  this.refresh(this.onLoad.id, true);
-                }
-                this.$message({
-                  type: "error",
-                  message: res.data.msg,
-                });
-                return true;
-              }
+              // if (res.data.code === 601) {
+              // console.info("11111111111----", res);
+              //   if (this.onLoad.id && this.detailData.id) {
+              //     console.log(1);
+              //     this.refresh(this.onLoad.id, true);
+              //     this.$set(this.optionForm, "disabled", true);
+              //   } else if (this.onLoad.id) {
+              //     console.log(2);
+              //     this.refresh(this.onLoad.id, true);
+              //   }
+              //   this.$message({
+              //     type: "error",
+              //     message: res.data.msg,
+              //   });
+              //   return true;
+              // }
               this.$message.success("保存成功");
               this.refresh(res.data.data.id);
               loading.close();
@@ -1007,11 +967,10 @@ export default {
           if (
             item.prop == "storageId" ||
             item.prop == "remarks" ||
-            item.prop == "createTime" ||
             item.prop == "stockClerkId" ||
             item.prop == "shipType" ||
             item.prop == "logisticsCorpName" ||
-            item.prop == "expressNo"||
+            item.prop == "expressNo" ||
             item.prop == "businesDate"
           ) {
             item.disabled = false;

+ 15 - 6
src/views/outboundWorkOrder/index.vue

@@ -3,8 +3,8 @@
     <basic-container v-show="!detailsOpen">
       <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="待生成" name="待生成"></el-tab-pane>
-        <el-tab-pane label="待发货" name="待发货"></el-tab-pane>
-        <el-tab-pane label="已发货" name="已发货"></el-tab-pane>
+        <el-tab-pane label="待出库" name="待出库"></el-tab-pane>
+        <el-tab-pane label="已出库" name="已出库"></el-tab-pane>
         <el-tab-pane label="全部" name="全部"></el-tab-pane>
       </el-tabs>
       <avue-crud
@@ -675,8 +675,17 @@ export default {
       done();
       this.onLoad(this.page, params);
     },
+    handleClick(tab, event) {
+      console.log(tab.name, event);
+      if (tab.name == "待生成") {
+        this.query.statusName = tab.name;
+          this.onLoad2(this.page2, this.query);
+      } else {
+        this.search.statusName = tab.name;
+        this.onLoad(this.page,this.search);
+      }
+    },
     onLoad(page, params = {}) {
-      console.log(params);
       var obj2 = this.deepClone(this.search);
       params = {
         ...params,
@@ -818,7 +827,7 @@ export default {
             poNo: item.poNo,
             inventory: item.balanceQuantity,
             sendNum: 0,
-            costpriePrice:item.inventoryCostPrice,
+            costpriePrice: item.inventoryCostPrice,
             reservoirAreaId: item.reservoirAreaId,
             reservoirArea: item.reservoirArea,
           });
@@ -852,8 +861,8 @@ export default {
         .then((res) => {
           this.generateVisible = false;
           this.$message.success("操作成功");
-          this.refreshChange()
-          this.refreshChange2()
+          this.refreshChange();
+          this.refreshChange2();
         })
         .finally(() => {
           loading.close();

+ 21 - 65
src/views/warehouseEntryOrder/detailsPage.vue

@@ -32,8 +32,7 @@
                         <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
                             :data="form.shipItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
                             @selection-change="selectionContacts"
-                            @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 274.1)"
-                            @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 274.1)">
+                            >
 
                             <!--<template slot-scope="{ row }" slot="dot">-->
                             <!--    <el-select v-model="row.dot" placeholder="请选择">-->
@@ -77,16 +76,12 @@
                     </el-tab-pane>
                     <el-tab-pane label="采购信息" name="payment_details">
                         <avue-crud :option="optionPaymentDetails" ref="payment_details" :data="form.shipVOList"
-                            :key="key"
-                            @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)"
-                            @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)">
+                            :key="key">
                         </avue-crud>
                     </el-tab-pane>
                     <el-tab-pane label="历史记录" name="outbound_records">
                         <avue-crud :option="optionOutboundRecords" ref="outbound_records" :data="form.historyList"
-                            :key="key"
-                            @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 274.3)"
-                            @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 274.3)">
+                            :key="key">
                         </avue-crud>
                     </el-tab-pane>
                 </el-tabs>
@@ -118,25 +113,25 @@
 </template>
 
 <script>
-
-// import {
-//     getDetails,
-//     tradingBox,
-//     submit,
-//     warehousingComplete,
-//     revoke,
-//     goodsDetail,
-//     dotList,
-//     getWarehouseKeeper,
-//     dotListAll,
-//     removeItem
-// } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
-// import { dateFormat } from "@/util/date";
+// @ts-nocheck
+import {
+    getDetails,
+    tradingBox,
+    submit,
+    warehousingComplete,
+    revoke,
+    goodsDetail,
+    dotList,
+    getWarehouseKeeper,
+    dotListAll,
+    removeItem
+} from "@/api/purchasingManagement/warehouseEntryOrder";
+import { dateFormat } from "@/util/date";
 import { getToken } from "@/util/auth";
-// import { getMenu } from "@/api/system/menu";
-// import reportDialog from "@/components/report-dialog/main";
-// import { corpsDescListAll } from "@/api/tirePartsMall/salesManagement/saleOrder";
-// import { isProcurement } from "@/api/basicData/configuration";
+import { getMenu } from "@/api/system/menu";
+import reportDialog from "@/components/report-dialog/main";
+import { corpsDescListAll } from "@/api/salesManagement/saleOrder";
+import { isProcurement } from "@/api/basicData/configuration";
 export default {
     name: "detailsPage",
     data() {
@@ -642,7 +637,6 @@ export default {
                 })
             }
         }
-        this.optionContacts = await this.getColumnData(this.getColumnName(274.1), this.optionContactsBack);
         isProcurement({ "param": "whether.model" }).then(res => {
             if (res.data.data == 1) {
                 this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
@@ -682,8 +676,6 @@ 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) {
@@ -696,9 +688,6 @@ export default {
         }
         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
@@ -1069,39 +1058,6 @@ export default {
         onClose(val) {
             this.switchDialog = val;
         },
-        //自定义列保存
-        async saveColumnTwo(ref, option, optionBack, code) {
-            /**
-             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-             */
-            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
-            isProcurement({ "param": "whether.model" }).then(res => {
-                if (res.data.data == 1) {
-                    this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
-                }
-            })
-            if (inSave) {
-                this.$message.success("保存成功");
-                //关闭窗口b
-                this.$refs[ref].$refs.dialogColumn.columnBox = false;
-            }
-        },
-        //自定义列重置
-        async resetColumnTwo(ref, option, optionBack, code) {
-            this[option] = this[optionBack];
-            isProcurement({ "param": "whether.model" }).then(res => {
-                if (res.data.data == 1) {
-                    this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
-                }
-            })
-            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
-            if (inSave) {
-                this.$message.success("重置成功");
-                this.$refs[ref].$refs.dialogColumn.columnBox = false;
-            }
-        },
         backToList(type) {
             this.$emit("backToList", type);
         }

+ 18 - 50
src/views/warehouseEntryOrder/index.vue

@@ -4,8 +4,7 @@
       <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
         ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @row-del="rowDel"
         @refresh-change="refreshChange" @expand-change="expandChange"
-        @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 275)"
-        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 275)" :page.sync="page">
+        :page.sync="page">
         <template slot-scope="{ row }" slot="expand">
           <avue-crud :data="row.itemData" :option="itemOption" :table-loading="row.itemLoading" :cell-style="cellStyle"
             class="itemTable"></avue-crud>
@@ -18,20 +17,13 @@
           <el-button :size="size" :type="type" :disabled="row.item >= 1"
             @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
-        <!-- <template slot-scope="{type,size,row,$index}" slot="menuLeft"> -->
-        <!-- <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新采购单</el-button> -->
-        <!--<el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>-->
-        <!-- </template> -->
-        <template slot-scope="{row,index}" slot="stockClerkName">
+        <!-- <template slot-scope="{row,index}" slot="stockClerkName">
           <el-select placeholder="请选择" v-if="row.$cellEdit" v-model="row.stockClerkName" size="small" filterable
             allow-create default-first-option clearable>
             <el-option v-for="item in stockClerkNameList" :key="item" :label="item.account"
               :value="item.account"></el-option>
           </el-select>
           <span v-else>{{ row.stockClerkName }}</span>
-        </template>
-        <!-- <template slot-scope="{type,size,row,$index}" slot="customerId">
-          <span>{{ row.customerName }}</span>
         </template> -->
         <template slot-scope="{ row, index }" slot="billno">
           <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.billno }}
@@ -48,12 +40,13 @@
 </template>
 
 <script>
-// import { customerListAll } from "@/api/tirePartsMall/basicData/warehouse"
-// import { getList, remove, getWarehouseKeeper, getGoodsInfo, confirmShipment, revokeShipment } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
-// import detailsPage from "./detailsPage.vue"
-// import { dateFormat } from '@/util/date'
-// import { getDetails } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
-// import { corpsDescListAll } from "@/api/tirePartsMall/salesManagement/saleOrder";
+// @ts-nocheck
+import { customerListAll } from "@/api/basicData/warehouse"
+import { getList, remove, getWarehouseKeeper, getGoodsInfo, confirmShipment, revokeShipment } from "@/api/purchasingManagement/warehouseEntryOrder";
+import detailsPage from "./detailsPage.vue"
+import { dateFormat } from '@/util/date'
+import { getDetails } from "@/api/purchasingManagement/warehouseEntryOrder";
+import { corpsDescListAll } from "@/api/salesManagement/saleOrder";
 export default {
   name: "index",
   components: {
@@ -163,8 +156,7 @@ export default {
           },
         ]
       },
-      option: {},
-      optionList: {
+      option: {
         viewBtn: false,
         editBtn: false,
         delBtn: false,
@@ -356,15 +348,14 @@ export default {
     }
   },
   async created() {
-    customerListAll().then((res) => {
-      this.storageNameList = res.data.data
-      this.salesCompanyId = this.storageNameList[0].salesCompanyId;
-      // stockClerkNameList
-      getWarehouseKeeper({ salesCompanyId: this.salesCompanyId }).then(res => {
-        this.stockClerkNameList = res.data.data;
-      })
-    })
-    this.option = await this.getColumnData(this.getColumnName(275), this.optionList);
+    // customerListAll().then((res) => {
+    //   this.storageNameList = res.data.data
+    //   this.salesCompanyId = this.storageNameList[0].salesCompanyId;
+    //   // stockClerkNameList
+    //   getWarehouseKeeper({ salesCompanyId: this.salesCompanyId }).then(res => {
+    //     this.stockClerkNameList = res.data.data;
+    //   })
+    // })
     this.key++
     let i = 0;
     this.option.column.forEach(item => {
@@ -550,29 +541,6 @@ export default {
           });
       }
     },
-    //自定义列保存
-    async saveColumnTwo(ref, option, optionBack, code) {
-      /**
-       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-       */
-      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
-      if (inSave) {
-        this.$message.success("保存成功");
-        //关闭窗口
-        this.$refs[ref].$refs.dialogColumn.columnBox = false;
-      }
-    },
-    //自定义列重置
-    async resetColumnTwo(ref, option, optionBack, code) {
-      this[option] = this[optionBack];
-      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
-      if (inSave) {
-        this.$message.success("重置成功");
-        this.$refs[ref].$refs.dialogColumn.columnBox = false;
-      }
-    }
   }
 }
 </script>