Browse Source

货转修改

tong 4 years ago
parent
commit
7e7275f42b

File diff suppressed because it is too large
+ 475 - 240
src/views/warehouseBusiness/goodsTransfer/index.vue


+ 50 - 14
src/views/warehouseBusiness/inStock/index.vue

@@ -829,6 +829,9 @@
           <el-button type="warning" prop="打印" @click="showEditDialog_s"
             >入库单
           </el-button>
+          <el-button @click="discharge"
+          >卸货
+        </el-button>
           <el-button type="info" prop="打印" @click="showEditDialog_sss"
             >作业单
           </el-button>
@@ -849,7 +852,7 @@
       </div>
       <el-table
         :data="dataList"
-        ref="table"
+        ref="tableList"
         tooltip-effect="dark"
         border
         stripe
@@ -1814,6 +1817,9 @@
         <el-button type="warning" prop="打印" @click="showEditDialog_s"
           >入库单
         </el-button>
+        <el-button @click="discharge"
+          >卸货
+        </el-button>
         <el-button type="info" prop="打印" @click="showEditDialog_sss"
           >作业单
         </el-button>
@@ -1913,7 +1919,7 @@
           @pagination="getWhgenlegList"
         />
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="whgenlegData">导入</el-button>
+          <el-button type="primary" @click="whgenlegData">导入作业费协议</el-button>
           <el-button @click="warehousingagreement = false">取 消</el-button>
         </div>
       </el-dialog>
@@ -2044,7 +2050,7 @@
               仓库:{{ form.fWarehouseid }}
             </td>
             <td width="450" colspan="3" class="zzss">
-              地址:青岛市市北区郑州路1344号
+              地址:{{ fAddr }}
             </td>
           </tr>
           <tr>
@@ -2210,7 +2216,7 @@
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
-            <td width="290" class="zzss">地址:淮河东路96号</td>
+            <td width="290" class="zzss">地址:{{fAddr}}</td>
             <td width="290" class="zzss">电话:{{ form.fTel }}</td>
           </tr>
           <!-- </div> -->
@@ -2300,8 +2306,8 @@
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
-            <td width="290" class="zzss">地址:淮河东路96号</td>
-            <td width="290" class="zzss">电话:18685818919</td>
+            <td width="290" class="zzss">地址:{{fAddr}}</td>
+            <td width="290" class="zzss">电话:{{form.fTel}}</td>
           </tr>
         </table>
         <button @click="printSomething2">打印</button>
@@ -2325,7 +2331,7 @@ import {
 import { listAgreement, operationAgreement } from "@/api/agreement/agreement";
 import { listCorps } from "@/api/basicdata/corps";
 
-import { listFees } from "@/api/basicdata/fees";
+import { listFees, getFees } from "@/api/basicdata/fees";
 
 import { listWarehouse } from "@/api/basicdata/warehouse";
 
@@ -2409,6 +2415,7 @@ export default {
       Printinglist: [],
       // 库存明细入账数组
       dataListSelection: [],
+      fAddr: '',
       // 库存明细撤回入账数组
       dataWithdrawList: [],
       fSbuOptions: [],
@@ -2832,21 +2839,24 @@ export default {
         });
       } else {
         for (let whgen in this.dialogWhgenlegList) {
+          let feeId = this.dialogWhgenlegList[whgen].feeFId
+          getFees(feeId).then(response => {
+                  this.fWbuOptions.push(response.data);
+                });
           this.warehouseDrList.push({
             fCorpid: this.dialogWhgenlegList[whgen].fCorpid,
-            fFeeid: this.dialogWhgenlegList[whgen].feeFId + "",
-            fFeeUnitid: this.dialogWhgenlegList[whgen].fFeeUnitid + "",
+            fFeeid: feeId,
+            fFeeUnitid: this.dialogWhgenlegList[whgen].fFeeUnitid + '',
             fUnitprice: this.dialogWhgenlegList[whgen].fPrice,
             fCurrency: "RMB",
             fExrate: "1",
           });
+          console.log(JSON.stringify(this.warehouseDrList))
         }
         this.warehousingagreement = false;
       }
     },
     zhgenlegData() {
-      console.log(this.dialogWhgenlegList);
-      console.log("((((");
       if (this.dialogWhgenlegList.length === 0) {
         this.$message({
           message: "请选择需要导入的数据",
@@ -2854,9 +2864,13 @@ export default {
         });
       } else {
         for (let zhgen in this.dialogWhgenlegList) {
+          let feeId = this.dialogWhgenlegList[zhgen].feeFId
+          getFees(feeId).then(response => {
+                  this.fWbuOptions.push(response.data);
+                });
           this.warehouseCrList.push({
             fCorpid: this.dialogWhgenlegList[zhgen].fCorpid,
-            fFeeid: this.dialogWhgenlegList[zhgen].feeFId + "",
+            fFeeid: feeId,
             fFeeUnitid: this.dialogWhgenlegList[zhgen].fFeeUnitid + "",
             fUnitprice: this.dialogWhgenlegList[zhgen].fPrice,
             fCurrency: "RMB",
@@ -2985,6 +2999,7 @@ export default {
     // 库存明细多选
     Selectinventory(selection) {
       console.log(selection);
+      console.log(this.form)
       this.Printinglist = selection;
       this.dataListSelection = [];
       if (!selection || selection.length === 0) {
@@ -3014,6 +3029,11 @@ export default {
             (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
           this.fBsdates = Y + M + D;
         }
+        
+      }
+      // 打印回显仓库
+      for (let corp in this.warehouseOptions) {
+          this.fAddr = this.warehouseOptions[corp].fAddr
       }
     },
 
@@ -3263,6 +3283,7 @@ export default {
             this.warehouseOptions[corp].createBy
           );
           this.$set(this.form, "fTel", this.warehouseOptions[corp].fTotalgross);
+          this.fAddr = this.warehouseOptions[corp].fAddr
         }
       }
     },
@@ -3325,6 +3346,7 @@ export default {
         }
         if (valid) {
           let formData = new window.FormData();
+          console.log(this.form)
           formData.append("warehouseBills", JSON.stringify(this.form));
           formData.append(
             "warehousebillsitems",
@@ -3335,7 +3357,6 @@ export default {
             this.fid = response.data;
             this.formBrowseStatus = true;
             this.msgSuccess("入账成功");
-            this.$refs.table.clearSelection();
             for (let li in this.dataListSelection) {
               for (let i in this.dataList) {
                 let fQty =
@@ -3367,9 +3388,11 @@ export default {
                 }
               }
             }
+            this.$refs.tableList.clearSelection();
           });
         }
       });
+      
     },
     // 撤回入账
     withdrawClick() {
@@ -3387,7 +3410,7 @@ export default {
         this.fid = response.data;
         this.formBrowseStatus = false;
         this.msgSuccess("撤销入账成功");
-        this.$refs.table.clearSelection();
+        this.$refs.tableList.clearSelection();
         for (let li in this.dataWithdrawList) {
           for (let i in this.dataList) {
             let fQty = this.dataList[i].fQty === this.dataWithdrawList[li].fQty;
@@ -3418,6 +3441,10 @@ export default {
         }
       });
     },
+    // 卸货按钮
+    discharge() {
+       alert("卸货按钮")
+    },
     /** 提交按钮 */
     submitForm(status) {
       this.$refs["form"].validate((valid) => {
@@ -3443,6 +3470,11 @@ export default {
               this.$message.error("请输入库区!");
               return false;
             }
+            console.log(this.dataList[list].fBillstatus)
+            if(this.dataList[list].fBillstatus != 6) {
+              this.$message.error("请入账库存明细!");
+              return false;
+            }
           }
           for (let warehouseDr in this.warehouseDrList) {
             if (!this.warehouseDrList[warehouseDr].fCorpid) {
@@ -3472,6 +3504,7 @@ export default {
               return false;
             }
           }
+
         }
         if (valid) {
           this.form.fBillstatus = status;
@@ -3510,6 +3543,8 @@ export default {
           );
           addWarehousebills(formData).then((response) => {
             this.msgSuccess("提交成功");
+            console.log(response)
+            console.log(this.dataList)
             if (status === 2) {
               this.open = true;
               this.form = response.data;
@@ -3630,6 +3665,7 @@ export default {
       let queryParams = { pageNum: 1, pageSize: 10, fName: name };
       listWarehouse(queryParams).then((response) => {
         this.warehouseOptions = response.rows;
+        console.log(response.rows)
       });
     },
     /* 远程模糊查询库区 */

+ 120 - 31
src/views/warehouseBusiness/outStock/index.vue

@@ -789,6 +789,11 @@
           @click.prevent="creditClick()"
           >出库确认
         </el-button>
+        <el-button
+            :disabled="dataWithdrawList.length <= 0"
+            @click.prevent="withdrawClick"
+            >撤回出库</el-button
+          >
         <!-- <el-button :disabled="browseStatus" @click.prevent="deleteRow(warehouseDrList)"
           >删除
         </el-button> -->
@@ -1285,8 +1290,8 @@
               placeholder="费用名称"
             >
               <el-option
-                v-for="dict in fWbuOptions"
-                :key="dict.fId"
+                v-for="(dict, index) in fWbuOptions"
+                :key="index.fId"
                 :label="dict.fName"
                 :value="dict.fId"
               ></el-option>
@@ -1309,8 +1314,8 @@
               clearable
             >
               <el-option
-                v-for="dict in jFeetunitOptions"
-                :key="dict.dictValue"
+                v-for="(dict, index) in jFeetunitOptions"
+                :key="index.dictValue"
                 :label="dict.dictLabel"
                 :value="dict.dictValue"
               />
@@ -1521,8 +1526,8 @@
               placeholder="费用名称"
             >
               <el-option
-                v-for="dict in fWbuOptions"
-                :key="dict.fId"
+                v-for="(dict, index) in fWbuOptions"
+                :key="index.fId"
                 :label="dict.fName"
                 :value="dict.fId"
               ></el-option>
@@ -1545,11 +1550,11 @@
               clearable
             >
               <el-option
-                v-for="dict in jFeetunitOptions"
-                :key="dict.dictValue"
+                v-for="(dict, index) in jFeetunitOptions"
+                :key="index.dictValue"
                 :label="dict.dictLabel"
                 :value="dict.dictValue"
-              />
+              ></el-option>
             </el-select>
           </template>
         </el-table-column>
@@ -1856,7 +1861,7 @@
           @pagination="getWhgenlegList"
         />
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="whgenlegDatas">导入</el-button>
+          <el-button type="primary" @click="whgenlegDatas">导入作业费协议</el-button>
           <el-button @click="warehousingagreement = false">取 消</el-button>
         </div>
       </el-dialog>
@@ -2121,7 +2126,7 @@
             <td width="450" colspan="2" class="zzss">货权方:{{form.fCorpid}}</td>
             <td width="450" colspan="2" class="zzss">仓库:{{form.fWarehouseid}}</td>
             <td width="450" colspan="3" class="zzss">
-              地址:青岛市市北区郑州路1344号
+              地址:{{fAddr}}
             </td>
           </tr>
           <tr>
@@ -2188,16 +2193,16 @@
             <td width="100" colspan="2" class="zzss" style="border: none">
               开单员:
             </td>
-            <td width="100" colspan="3" class="zzss" style="border: none"></td>
+            <td width="100" colspan="3" class="zzss" style="border: none">{{form.createBy}}</td>
             <td width="100" colspan="2" class="zzss" style="border: none">
-              仓管员:
+              仓管员:{{form.fContacts}}
             </td>
           </tr>
           <tr style="border: none">
             <td width="100" colspan="2" class="zzss" style="border: none">
               开单时间:
             </td>
-            <td width="100" colspan="3" class="zzss" style="border: none"></td>
+            <td width="100" colspan="3" class="zzss" style="border: none">{{fBsdate}}</td>
             <td width="100" colspan="2" class="zzss" style="border: none">
               (盖章)
             </td>
@@ -2284,7 +2289,7 @@
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
-            <td width="290" class="zzss">地址:淮河东路96号</td>
+            <td width="290" class="zzss">地址:{{fAddr}}</td>
             <td width="290" class="zzss">电话:{{form.fTel}}</td>
           </tr>
           <!-- </div> -->
@@ -2374,8 +2379,8 @@
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
             <td width="280" class="zzss"></td>
-            <td width="290" class="zzss">地址:淮河东路96号</td>
-            <td width="290" class="zzss">电话:18685818919</td>
+            <td width="290" class="zzss">地址:{{fAddr}}</td>
+            <td width="290" class="zzss">电话:{{form.fTel}}</td>
           </tr>
         </table>
         <button @click="printSomething">打印</button>
@@ -2395,13 +2400,14 @@ import {
   updateWarehousebills,
   exportWarehousebills,
 } from "@/api/warehouseBusiness/warehouseOutStock";
+import { updateCredit } from '@/api/warehouseBusiness/warehouseInStock';
 import { listAgreement,operationAgreement } from '@/api/agreement/agreement';
 
 import { listAgreements } from '@/api/warehouseBusiness/agreement';
 
 import { listCorps } from "@/api/basicdata/corps";
 
-import { listFees } from "@/api/basicdata/fees";
+import { listFees, getFees } from "@/api/basicdata/fees";
 
 import { listWarehouse } from "@/api/basicdata/warehouse";
 
@@ -2447,6 +2453,8 @@ export default {
       fSbu: "",
       // 遮罩层
       loading: true,
+      // 打印地址
+      fAddr: '',
       // 选中数组
       ids: [],
       userVal: {
@@ -2509,6 +2517,8 @@ export default {
       warehouseOptions: [],
       // 库存明细入账数组
       dataListSelection: [],
+      // 库存明细撤回入账数组
+      dataWithdrawList: [],
       kqhouseOptions: [],
       // 贸易方式(数据字典),对应t_trademodels 字典
       fTrademodeidOptions: [],
@@ -2811,9 +2821,13 @@ export default {
         });
       } else {
         for (let whgen in this.dialogWhgenlegList) {
+          let feeId = this.dialogWhgenlegList[whgen].feeFId
+          getFees(feeId).then(response => {
+                  this.fWbuOptions.push(response.data);
+                });
         this.warehouseDrList.push({
           fCorpid: this.dialogWhgenlegList[whgen].fCorpid,
-          fFeeid: this.dialogWhgenlegList[whgen].feeFId + '',
+          fFeeid: feeId,
           fFeeUnitid: this.dialogWhgenlegList[whgen].fFeeUnitid +'',
           fUnitprice: this.dialogWhgenlegList[whgen].fPrice,
           fCurrency: "RMB",
@@ -2833,14 +2847,17 @@ export default {
         });
       } else {
       for (let zhgen in this.dialogWhgenlegList) {
+        let feeId = this.dialogWhgenlegList[zhgen].feeFId
+          getFees(feeId).then(response => {
+                  this.fWbuOptions.push(response.data);
+                });
         this.warehouseCrList.push({
           fCorpid: this.dialogWhgenlegList[zhgen].fCorpid,
-          fFeeid: this.dialogWhgenlegList[zhgen].feeFId + '',
+          fFeeid: feeId,
           fFeeUnitid: this.dialogWhgenlegList[zhgen].fFeeUnitid +'',
           fUnitprice: this.dialogWhgenlegList[zhgen].fPrice,
           fCurrency: "RMB",
           fCxrate: "1"
-
         });
       }
       this.warehousingagreements = false;
@@ -3275,7 +3292,9 @@ export default {
          if(row.fWarehouseid === this.warehouseOptions[corp].fId) {
            this.$set(this.form, "fContacts", this.warehouseOptions[corp].createBy);
            this.$set(this.form, "fTel", this.warehouseOptions[corp].fTotalgross);
+           this.fAddr = this.warehouseOptions[corp].fAddr
          }
+         
        }
     },
     // 选择按钮
@@ -3297,40 +3316,42 @@ export default {
       const sums = [];
       var values = [];
       columns.forEach((column, index) => {
+        console.log(column)
         if (index === 0) {
           sums[index] = "合计";
           return;
         }
-        if (column.property === "fgrossweight") {
+        if (column.property === "fGrossweight") {
           values = data.map((item) => Number(item["fGrossweight"]));
         }
-        if (column.property === "fnetweight") {
+        if (column.property === "fNetweight") {
           values = data.map((item) => Number(item["fNetweight"]));
         }
-        if (column.property === "fqty") {
+        if (column.property === "fQty") {
           values = data.map((item) => Number(item["fQty"]));
         }
         if (column.property === "fCntqty") {
           values = data.map((item) => Number(item["fCntqty"]));
         } // const values = data.map(item => Number(item[column.property]))
         if (
-          column.property === "fgrossweight" ||
-          column.property === "fnetweight" ||
-          column.property === "fqty" ||
+          column.property === "fGrossweight" ||
+          column.property === "fNetweight" ||
+          column.property === "fQty" ||
           column.property === "fCntqty"
         ) {
           sums[index] = values.reduce((prev, curr) => {
             const value = Number(curr);
             if (!isNaN(value)) {
-              if (column.property === "fgrossweight") {
+              if (column.property === "fGrossweight") {
                 this.form.fGrossweight = prev + curr;
                 this.fGrossweight = prev + curr;
               }
-              if (column.property === "fnetweight") {
+              if (column.property === "fNetweight") {
                 this.form.fNetweight = prev + curr;
+                
                 this.fNetweight = prev + curr;
               }
-              if (column.property === "fqty") {
+              if (column.property === "fQty") {
                 this.form.fQty = prev + curr;
                 this.fQty = prev + curr;
               }
@@ -3460,6 +3481,53 @@ export default {
       });
       console.log("有东西:" + JSON.stringify(this.dataList));
     },
+     // 撤回入账
+    withdrawClick() {
+      console.log("@@@");
+      // 撤回入库
+      let formData = new window.FormData();
+      formData.append("warehouseBills", JSON.stringify(this.form));
+      console.log(this.form);
+      formData.append(
+        "warehousebillsitems",
+        JSON.stringify(this.dataWithdrawList)
+      );
+      console.log(this.dataWithdrawList);
+      updateCredit(formData).then((response) => {
+        this.fid = response.data;
+        this.formBrowseStatus = false;
+        this.msgSuccess("撤销入账成功");
+        this.$refs.tableList.clearSelection();
+        for (let li in this.dataWithdrawList) {
+          for (let i in this.dataList) {
+            let fQty = this.dataList[i].fQty === this.dataWithdrawList[li].fQty;
+            let fBsdate =
+              this.dataList[i].fBsdate === this.dataWithdrawList[li].fBsdate;
+            let fGoodsid =
+              this.dataList[i].fGoodsid === this.dataWithdrawList[li].fGoodsid;
+            let fcntrtype =
+              this.dataList[i].fcntrtype ===
+              this.dataWithdrawList[li].fcntrtype;
+            let fNetweight =
+              this.dataList[i].fNetweight ===
+              this.dataWithdrawList[li].fNetweight;
+            let fGrossweight =
+              this.dataList[i].fGrossweight ===
+              this.dataWithdrawList[li].fGrossweight;
+            if (
+              fBsdate &&
+              fGoodsid &&
+              fcntrtype &&
+              fGrossweight &&
+              fNetweight &&
+              fQty
+            ) {
+              this.$set(this.dataList[i], "fBillstatus", "1");
+            }
+          }
+        }
+      });
+    },
     // 付款信息计价单位合计
     getwarehouseCrList(param) {
       console.log(param);
@@ -3485,6 +3553,19 @@ export default {
         console.log(selection);
       this.Printinglist = selection;
       this.dataListSelection = selection;
+       if (!selection || selection.length === 0) {
+        return false;
+      } else {
+        for (let se in selection) {
+          if (!selection[se].fBillstatus || selection[se].fBillstatus !== "6") {
+            this.dataListSelection.push(selection[se]);
+          } else if (
+            selection[se].fBillstatus &&
+            selection[se].fBillstatus === "6"
+          ) {
+            this.dataWithdrawList.push(selection[se]);
+          }
+        }
       if (this.Printinglist.length > 0) {
           this.fTruckno = selection[0].fTruckno;
            this.fCntrtype = selection[0].fCntrtype;
@@ -3494,7 +3575,11 @@ export default {
           var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
           var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
           this.fBsdate = Y + M + D;
-
+      }
+      // 打印回显仓库
+      for (let corp in this.warehouseOptions) {
+          this.fAddr = this.warehouseOptions[corp].fAddr
+      }
       }
     },
     // 计价单位选择
@@ -3605,6 +3690,10 @@ export default {
               this.$message.error("请输入出库毛重!");
               return false;
             }
+            if(this.dataList[list].fBillstatus != 6) {
+              this.$message.error("请入账库存明细!");
+              return false;
+            }
           }
           // for (let list in this.relevantAttachments) {
           //   if (this.relevantAttachments[list].fName === null) {

Some files were not shown because too many files changed in this diff