tong 4 tahun lalu
induk
melakukan
2edea3b33a
1 mengubah file dengan 149 tambahan dan 59 penghapusan
  1. 149 59
      src/views/warehouseBusiness/inStock/index.vue

+ 149 - 59
src/views/warehouseBusiness/inStock/index.vue

@@ -293,7 +293,7 @@
       >
         <template slot-scope="scope">
           <span v-if="scope.row.fBillstatus === 1">录入</span>
-          <span v-if="scope.row.fBillstatus === 2">录入</span>
+          <span v-if="scope.row.fBillstatus === 2">暂存</span>
           <span v-if="scope.row.fBillstatus === 3">驳回</span>
           <span v-if="scope.row.fBillstatus === 4">请核</span>
           <span v-if="scope.row.fBillstatus === 5">审核中</span>
@@ -1910,6 +1910,11 @@
         </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
+        <el-button type="primary" :disabled="approvalStatus" @click="addOrUpdateHandle(form)">查看审批</el-button>
+    <el-button type="primary" :disabled="approvalStatus" @click="addOrUpdateHand(form)">审批弹窗</el-button>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+    <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
         <el-button type="success" prop="打印" @click="showEditDialog_ss"
           >收货单
         </el-button>
@@ -2465,7 +2470,20 @@
             <td width="290" class="zzss">电话:{{ form.fTel }}</td>
           </tr>
         </table>
-        <button @click="printSomething2">打印</button>
+        <div style="display: flex;
+          justify-content: space-between;">
+          <el-button
+            type="primary"
+            :disabled="browseStatus"
+            @click="printSomething2"
+            >打印
+        </el-button>
+        <el-button
+            @click="editDialogVisible_sss =false"
+            >取消
+        </el-button>
+        </div>
+        
       </el-dialog>
     </el-dialog>
   </div>
@@ -2498,15 +2516,21 @@ import { listGoods } from "@/api/basicdata/goods";
 
 import { listUser, queryUserVal } from "@/api/system/user";
 import UploadFile from "@/components/Uploadfile";
+import AddOrUpdate from '@/views/viewApproval'
+import ApprovalComments from '@/views/startApproval'
 export default {
   name: "Warehousebills",
   components: {
     UploadFile,
+    AddOrUpdate,
+    ApprovalComments
   },
   data() {
     return {
       // 修改查看状态
       browseStatus: false,
+      // 审批状态控制
+      approvalStatus: false,
       detailsHidden: false,
       warehousingagreement: false,
       warehousingagreements: false,
@@ -2547,6 +2571,9 @@ export default {
       editDialogVisible_ss: false,
       editDialogVisible_sss: false,
       editDialogClosed_ss: false,
+      addOrUpdateVisible: false,
+      addOrUpdateVisib: false,
+      
       // 新增计划净重
       weightList: false,
       dataList: [],
@@ -2928,6 +2955,29 @@ export default {
     },
     showEditDialog_ss() {
       if (this.Printinglist.length > 0) {
+        for (let li in this.Printinglist) {
+        if (this.dataListSelection.length > 0) {
+          this.fTruckno = this.dataListSelection[0].fTruckno;
+          this.fCntrtype = this.dataListSelection[0].fCntrtype;
+          this.fGoodsids = this.dataListSelection[0].fGoodsids;
+          this.fPackagespecs = this.dataListSelection[0].fPackagespecs;
+          var date = new Date(this.dataListSelection[0].fBsdate);
+          var Y = date.getFullYear() + "-";
+          var M =
+            (date.getMonth() + 1 < 10
+              ? "0" + (date.getMonth() + 1)
+              : date.getMonth() + 1) + "-";
+          var D =
+            (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
+          this.fBsdates = Y + M + D;
+        }
+        console.log(this.goodsOptions)
+        for(let list in this.goodsOptions) {
+          if(this.Printinglist[li].fGoodsid === this.goodsOptions[list].fId) {
+            this.$set(this.Printinglist[li], "fGoodsids", this.goodsOptions[list].fName);
+          }
+        }
+        }
         this.editDialogVisible_ss = true;
       } else {
         this.$message.error("请选择需要打印的明细!");
@@ -2935,26 +2985,36 @@ export default {
     },
     showEditDialog_sss() {
       console.log(this.Printinglist);
+      console.log(this.dataListSelection)
+      console.log(this.dataList)
       if (this.Printinglist.length > 0) {
         for (let li in this.Printinglist) {
         if (!this.Printinglist[li].fId) {
           this.$message.error("请先保存!");
           return false;
         }
-      }
-      for (let list in this.goodsOptions) {
-        if (this.Printinglist[0].fGoodsid === this.goodsOptions[list].fId) {
-          this.$set(
-            this.Printinglists[list],
-            "fGoodsids",
-            this.goodsOptions[list].fName
-          );
+       if (this.dataListSelection.length > 0) {
+          this.fTruckno = this.dataListSelection[0].fTruckno;
+          this.fCntrtype = this.dataListSelection[0].fCntrtype;
+          this.fGoodsids = this.dataListSelection[0].fGoodsids;
+          this.fPackagespecs = this.dataListSelection[0].fPackagespecs;
+          var date = new Date(this.dataListSelection[0].fBsdate);
+          var Y = date.getFullYear() + "-";
+          var M =
+            (date.getMonth() + 1 < 10
+              ? "0" + (date.getMonth() + 1)
+              : date.getMonth() + 1) + "-";
+          var D =
+            (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
+          this.fBsdates = Y + M + D;
+        }
+        console.log(this.goodsOptions)
+        for(let list in this.goodsOptions) {
+          if(this.Printinglist[li].fGoodsid === this.goodsOptions[list].fId) {
+            this.$set(this.Printinglist[li], "fGoodsids", this.goodsOptions[list].fName);
+          }
         }
       }
-      
-      // for(let lest in this.this.fWbuOptions){
-
-      // }
       if (this.Collectionoptionss.length > 0) {
         for(let list in this.Collectionoptionss) {
           if(!this.Collectionoptionss[list].fFeeid){
@@ -3172,15 +3232,15 @@ export default {
           console.log(this.warehouseDrList)
           
            if(this.warehouseDrList[list].fFeeUnitid == 1){
-             this.$set(this.warehouseDrList[list], "fQty", this.fQty);  
+             this.$set(this.warehouseDrList[list], "fQty", (this.fQty).toFixed(2));  
            } else if(this.warehouseDrList[list].fFeeUnitid == 2) {
-             this.$set(this.warehouseDrList[list], "fQty", this.fGrossweight);
+             this.$set(this.warehouseDrList[list], "fQty", (this.fGrossweight).toFixed(2));
            } else if(this.warehouseDrList[list].fFeeUnitid == 3) {
-            this.$set(this.warehouseDrList[list], "fQty", this.fNetweight);
+            this.$set(this.warehouseDrList[list], "fQty", (this.fNetweight).toFixed(2));
            } else{
              this.$set(this.warehouseDrList[list], "fQty", 0);
            }
-           this.$set(this.warehouseDrList[list], "fAmount", Number(this.warehouseDrList[list].fUnitprice) * Number(this.warehouseDrList[list].fQty));
+           this.$set(this.warehouseDrList[list], "fAmount", (Number(this.warehouseDrList[list].fUnitprice) * Number(this.warehouseDrList[list].fQty)).toFixed(2));
         }
         this.warehousingagreement = false;
       }
@@ -3209,15 +3269,15 @@ export default {
         }
         for(let list in this.warehouseCrList) {
            if(this.warehouseCrList[list].fFeeUnitid == 1){
-             this.$set(this.warehouseCrList[list], "fQty", this.fQty);
+             this.$set(this.warehouseCrList[list], "fQty", (this.fQty).toFixed(2));
            } else if(this.warehouseCrList[list].fFeeUnitid == 2) {
-             this.$set(this.warehouseCrList[list], "fQty", this.fGrossweight);
+             this.$set(this.warehouseCrList[list], "fQty", (this.fGrossweight).toFixed(2));
            } else if(this.warehouseCrList[list].fFeeUnitid == 3) {
-            this.$set(this.warehouseCrList[list], "fQty", this.fNetweight);
+            this.$set(this.warehouseCrList[list], "fQty", (this.fNetweight).toFixed(2));
            } else{
              this.$set(this.warehouseCrList[list], "fQty", 0);
            }
-            this.$set(this.warehouseCrList[list], "fAmount", Number(this.warehouseCrList[list].fUnitprice) * Number(this.warehouseCrList[list].fQty));
+            this.$set(this.warehouseCrList[list], "fAmount", (Number(this.warehouseCrList[list].fUnitprice) * Number(this.warehouseCrList[list].fQty)).toFixed(2));
         } 
         this.warehousingagreements = false;
       }
@@ -3358,25 +3418,6 @@ export default {
             console.log(this.dataWithdrawList)
           }
         }
-
-        console.log(this.dataListSelection)
-        if (this.dataListSelection.length > 0) {
-          this.fTruckno = selection[0].fTruckno;
-          this.fCntrtype = selection[0].fCntrtype;
-          this.fGoodsids = selection[0].fGoodsids;
-          this.fPackagespecs = selection[0].fPackagespecs;
-          console.log(this.fGoodsids)
-          var date = new Date(selection[0].fBsdate);
-          var Y = date.getFullYear() + "-";
-          var M =
-            (date.getMonth() + 1 < 10
-              ? "0" + (date.getMonth() + 1)
-              : date.getMonth() + 1) + "-";
-          var D =
-            (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
-          this.fBsdates = Y + M + D;
-        }
-        
       }
       // 打印回显仓库
       for (let corp in this.warehouseOptions) {
@@ -3431,25 +3472,27 @@ export default {
       this.browseStatus = status;
       this.reset();
       this.detailsHidden = false;
+      this.formBrowseStatus = false;
       const fId = row.fId || this.ids;
       this.dataList = [];
       getWarehousebills(fId).then((response) => {
-        console.log(response)
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
-          if (this.form.fItemsStatus && this.form.fItemsStatus !== 1) {
-            this.formBrowseStatus = true;
-          } 
-           else {
-            this.formBrowseStatus = false;
+          if(this.form.fBillstatus > 2) {
+           this.approvalStatus = false;
+          }else {
+            this.approvalStatus = true;
           }
         }
         if(response.data.warehouseBillsItem) {
-          for (let li in response.data.warehouseBillsItem){
-            if(response.data.warehouseBillsItem[li] != 10){
-              this.formBrowseStatus = true;
+          this.dataList = response.data.warehouseBillsItem;
+          console.log(response.data.warehouseBillsItem)
+            for (let list in this.dataList) {
+              console.log(this.dataList[list].fBillstatus)
+              if (this.dataList[list].fBillstatus > 10) {
+                this.formBrowseStatus = true;
+              } 
             }
-          }
         }
         if (response.data.corps) {
           this.fMblnoOptions = response.data.corps;
@@ -3473,6 +3516,8 @@ export default {
         this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
         this.$set(this.form, "createTime", Date.parse(this.form.createTime));
         this.$set(this.form, "fTrademodeid", this.form.fTrademodeid + "");
+        this.$set(this.form, "fPlannetweight", (this.form.fPlannetweight).toFixed(2));
+        this.$set(this.form, "fPlangrossweight", (this.form.fPlangrossweight).toFixed(2));
         for (let list in this.dataList) {
           this.$set(
             this.dataList[list],
@@ -3489,7 +3534,16 @@ export default {
             "fFeeUnitid",
             this.warehouseDrList[dr].fFeeunitid + ""
           );
-       
+          this.$set(
+            this.warehouseDrList[dr],
+            "fQty",
+            (this.warehouseDrList[dr].fQty).toFixed(2)
+          );
+       this.$set(
+            this.warehouseDrList[dr],
+            "fAmount",
+            (this.warehouseDrList[dr].fAmount).toFixed(2)
+          );
         }
         this.warehouseCrList = response.data.warehousebillsfeesCr;
         for (let cr in this.warehouseCrList) {
@@ -3569,6 +3623,7 @@ export default {
               return prev;
             }
           }, 0);
+          sums[index] = sums[index].toFixed(2)
         }
       });
       this.sums = sums;
@@ -3598,6 +3653,7 @@ export default {
               return prev;
             }
           }, 0);
+          sums[index] = sums[index].toFixed(2)
         }
       });
       return sums;
@@ -3820,8 +3876,6 @@ export default {
             "warehousebillsitems",
             JSON.stringify(this.dataListSelection)
           );
-          console.log(this.dataListSelection);
-          formData.append("whgenleg", JSON.stringify(this.relevantAttachments));
 
           for (let li in this.dataListSelection) {
             this.dataListSelection[li].fBillstatus = 20;
@@ -3865,7 +3919,6 @@ export default {
                   for(let list in response.data.warehousebillsitems){
                     this.$set(this.dataList[i], "fSerialNumber", response.data.warehousebillsitems[list].fSerialNumber);
                   }
-                  
                 }
               }
             }
@@ -4039,7 +4092,7 @@ export default {
         formDatae.append("tWarehousebillsitems", JSON.stringify(this.dataList));
         console.log(this.dataList);
         // 附件数据
-        formDatae.append("tWhgenleg", JSON.stringify(this.relevantAttachments));
+        formDatae.append("tEnclosure", JSON.stringify(this.relevantAttachments));
         console.log(this.relevantAttachments);
         // 费用明细付款
         formDatae.append(
@@ -4052,8 +4105,6 @@ export default {
           "tWarehousebillsfeesDr",
           JSON.stringify(this.warehouseDrList)
         );
-        console.log(this.warehouseDrList)
-        console.log(formDatae);
         addWarehousebills(formDatae).then((response) => {
           console.log(response)
           this.msgSuccess("保存成功");
@@ -4066,6 +4117,21 @@ export default {
             );
             this.$set(
               this.form,
+              "fStltypeid",
+              this.form.fStltypeid + ''
+            );
+            this.$set(
+              this.form,
+              "fTrademodeid",
+              this.form.fTrademodeid + ''
+            );
+            this.$set(
+              this.form,
+              "createTime",
+              Date.parse(this.form.createTime)
+            );
+            this.$set(
+              this.form,
               "fEta",
               Date.parse(this.form.fEta)
             );
@@ -4128,7 +4194,7 @@ export default {
         // 库存明细
         formData.append("tWarehousebillsitems", JSON.stringify(this.dataList));
         // 附件数据
-        formData.append("tWhgenleg", JSON.stringify(this.relevantAttachments));
+        formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
         // 费用明细付款
         formData.append(
           "tWarehousebillsfeesCr",
@@ -4207,6 +4273,30 @@ export default {
         this.mum = sum;
       }
     },
+    // 查看审批流
+    getDataList(){
+      this.addOrUpdateVisible = false
+    },
+    returnData(){
+      this.addOrUpdateVisib = false
+    },
+    addOrUpdateHandle(form){
+      this.addOrUpdateVisible = true
+      console.log(form)
+      let id = form.fId
+      let actId = '110'
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(id,actId)
+      })
+    },
+    addOrUpdateHand(form){
+      this.addOrUpdateVisib = true
+      let id = form.fId
+      let actId = '110'
+      this.$nextTick(() => {
+        this.$refs.ApprovalComments.init(id,actId)
+      })
+    },
     /* 远程模糊查询用户 */
     corpsRemoteMethod(name) {
       if (name == null || name === "") {