瀏覽代碼

Merge branch 'master' of git.echepei.com:zhujiawei/Warehouse_management_ui

wengyuwen 4 年之前
父節點
當前提交
54e1a3b837

+ 9 - 1
src/api/warehouseBusiness/warehouseOutStock.js

@@ -25,7 +25,7 @@ export function addWhgenleg(data) {
   })
 }
 
-// 货权转移提交
+// 请核
 export function warehouseSubmission(data) {
   return request({
     url: '/warehouseBusiness/outStock/warehouseSubmission',
@@ -102,3 +102,11 @@ export function revoke(fId) {
     method: 'get',
   })
 }
+// 状态为4撤销(请核)
+export function revokeTwo(data) {
+  return request({
+    url: '/warehouse/paths/revoke',
+    method: 'post',
+    data: data
+  })
+}

+ 27 - 34
src/views/warehouseBusiness/inStock/index.vue

@@ -334,7 +334,8 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="scope.row.fBillstatus !== 6 && scope.row.fItemsStatus === 1"
+            v-show="scope.row.fItemsStatus !== 4"
+            v-if="scope.row.fBillstatus < 4"
             @click="handleDelete(scope.row)"
             v-hasPermi="['warehouseBusiness:inStock:remove']"
           >删除
@@ -343,7 +344,7 @@
             size="mini"
             type="text"
             icon="el-icon-delete"
-            v-if="scope.row.fBillstatus == 4"
+            v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 6"
             @click="handleUpdate(scope.row, true)"
           >审核进度
           </el-button>
@@ -480,6 +481,7 @@
               <el-input
                 v-model="form.fPlanqty"
                 style="width: 80%"
+                maxlength="9"
                 laceholder="计划件数"
                 oninput='this.value=this.value.replace(/\D/g,"")'
                 :disabled="browseStatus"
@@ -491,8 +493,9 @@
               <el-input
                 v-model="form.fPlannetweight"
                 style="width: 80%"
+                maxlength="9"
                 oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-                laceholder="计划重"
+                laceholder="计划重"
                 :disabled="browseStatus"
               />
             </el-form-item>
@@ -504,6 +507,7 @@
                 oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
                 style="width: 80%"
                 laceholder="计划毛重"
+                maxlength="9"
                 :disabled="browseStatus"
               />
             </el-form-item>
@@ -822,10 +826,10 @@
             "
           >{{ detailsHidden ? "隐藏" : "展开" }}</el-button
           >
-          <el-button type="info" prop="打印" @click="showEditDialog_sss"
+          <el-button type="info" :disabled="browseStatus" prop="打印" @click="showEditDialog_sss"
           >作业单
           </el-button>
-          <el-button @click="discharge">卸货 </el-button>
+          <el-button @click="discharge" :disabled="browseStatus">卸货 </el-button>
           <el-button
             :disabled="dataListSelection.length <= 0"
             @click.prevent="creditClick"
@@ -836,10 +840,10 @@
             @click.prevent="withdrawClick"
           >撤回入库</el-button
           >
-          <el-button type="success" prop="打印" @click="showEditDialog_ss"
+          <el-button type="success" :disabled="browseStatus" prop="打印" @click="showEditDialog_ss"
           >收货单
           </el-button>
-          <el-button type="warning" prop="打印" @click="showEditDialog_s"
+          <el-button type="warning" :disabled="browseStatus" prop="打印" @click="showEditDialog_s"
           >入库单
           </el-button>
           <!--
@@ -1933,16 +1937,6 @@
         </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"
-          v-if="approVal === true"
-          @click="addOrUpdateHand(form)"
-        >审批</el-button>
         <!-- 弹窗, 新增 / 修改 -->
         <add-or-update
           v-if="addOrUpdateVisible"
@@ -1954,14 +1948,24 @@
           ref="ApprovalComments"
           @refreshDataList="returnData"
         ></approval-comments>
-        <el-button type="success" prop="打印" @click="showEditDialog_ss"
+        <el-button
+          type="primary"
+          :disabled="approvalStatus"
+          @click="addOrUpdateHandle(form)"
+        >查看审批</el-button>
+        <el-button
+          type="primary"
+          v-if="approVal === true"
+          @click="addOrUpdateHand(form)"
+        >审批</el-button>
+        <el-button :disabled="browseStatus" type="success" prop="打印" @click="showEditDialog_ss"
         >收货单
         </el-button>
-        <el-button type="warning" prop="打印" @click="showEditDialog_s"
+        <el-button :disabled="browseStatus" type="warning" prop="打印" @click="showEditDialog_s"
         >入库单
         </el-button>
-        <el-button @click="discharge">卸货 </el-button>
-        <el-button type="info" prop="打印" @click="showEditDialog_sss"
+        <el-button @click="discharge" :disabled="browseStatus">卸货完成</el-button>
+        <el-button type="info" :disabled="browseStatus" prop="打印" @click="showEditDialog_sss"
         >作业单
         </el-button>
         <el-button
@@ -2384,9 +2388,7 @@
           </tr>
           <tr v-for="(item, index) in Printinglist" :key="index">
             <td width="250">货物品名:</td>
-            <!-- <td width="200" colspan="">1</td> -->
-            <td width="250">{{ item.fGoodsids }}</td>
-            <!-- <td width="250">白色聚吕</td> -->
+             <td width="200" colspan="">{{ item.fGoodsids }}</td>
             <!-- <td width="200" colspan="2">件数: 161件</td> -->
             <!-- <td width="200"></td> -->
             <td width="200" colspan="4" class="zzss">
@@ -3018,7 +3020,6 @@ export default {
     },
     revoke(){
       revoke(this.form.fId).then(data=>{
-        console.log(data)
         if (data.code == 200){
           this.open = false;
         }
@@ -3030,9 +3031,7 @@ export default {
         billId:this.form.fId,
         id:this.form.fId
       }
-      console.log(data)
       revokeTwo(data).then(data =>{
-        console.log(data)
       })
     },
     printSomething() {
@@ -3164,7 +3163,6 @@ export default {
             this.$set(this.form, "fCorpidName", this.fMblnoOptions[corp].fName);
           }
         }
-        console.log(JSON.stringify(this.form))
         for (let sorp in this.warehouseOptions) {
           if (this.form.fWarehouseid === this.warehouseOptions[sorp].fId) {
             this.$set(
@@ -3231,7 +3229,6 @@ export default {
             return false
           }
           if (this.dataListSelection.length > 0) {
-            console.log(this.dataListSelection)
             this.fTruckno = this.dataListSelection[0].fTruckno
             this.fCntrtype = this.dataListSelection[0].fCntrtype
             this.fGoodsids = this.dataListSelection[0].fGoodsids
@@ -3732,10 +3729,9 @@ export default {
       const fId = row.fId || this.ids;
       this.dataList = [];
       getWarehousebills(fId).then((response) => {
-        this.before = response.data.corps[0].createBy
-        console.log(response.data.corps[0].createBy)
         if (response.data.warehousebills) {
           this.form = response.data.warehousebills;
+          this.before = this.form.createBy
           if (this.form.fBillstatus > 2) {
             this.approvalStatus = false;
           } else {
@@ -3822,9 +3818,7 @@ export default {
         this.title = "修改仓入库";
       });
       queryUserVal().then((response)=>{
-        console.log(response)
         this.current = response.user.userName
-        console.log(this.queryParams)
       })
     },
     // 库存总账多选框
@@ -4241,7 +4235,6 @@ export default {
             }
             disChargelist(formData).then((response) => {
               this.dataList = response.data.warehousebillsitems
-              console.log(response.data.warehousebillsitems)
               for (let dt in dataSelection) {
                 for (let li in this.dataList) {
                   // this.dataList[li].fBsdate = (new Date(response.data.warehousebillsitems[li].createTime)).getTime() / 1000

+ 217 - 9
src/views/warehouseBusiness/outStock/index.vue

@@ -293,8 +293,8 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row, true)"
-            v-hasPermi="['warehouseBusiness:outStock:edit']"
-            >查看
+            v-hasPermi="['warehouseBusiness:inStock:edit']"
+          >查看
           </el-button>
           <el-button
             size="mini"
@@ -306,21 +306,36 @@
               scope.row.fBillstatus === 3
             "
             @click="handleUpdate(scope.row, false)"
-            v-hasPermi="['warehouseBusiness:outStock:edit']"
-            >修改
+            v-hasPermi="['warehouseBusiness:inStock:edit']"
+          >修改
           </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
+            v-show="scope.row.fItemsStatus !== 4"
             v-if="scope.row.fBillstatus !== 6 && scope.row.fItemsStatus === 1"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['warehouseBusiness:outStock:remove']"
-            >删除
+            v-hasPermi="['warehouseBusiness:inStock:remove']"
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
+            @click="handleUpdate(scope.row, true)"
+          >审核进度
           </el-button>
         </template>
       </el-table-column>
     </el-table>
+    <add-or-update
+      v-if="addOrUpdateVisible"
+      ref="addOrUpdate"
+      @refreshDataList="getDataList"
+    ></add-or-update>
+    <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
     <pagination
       v-show="total > 0"
       :total="total"
@@ -501,6 +516,7 @@
                 v-model="form.fPlanqty"
                 style="width: 80%"
                 laceholder="计划件数"
+                maxlength="9"
                 oninput='this.value=this.value.replace(/\D/g,"")'
                 :disabled="browseStatus"
               />
@@ -511,8 +527,9 @@
               <el-input
                 v-model="form.fPlannetweight"
                 style="width: 80%"
+                maxlength="9"
                 oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
-                laceholder="计划重"
+                laceholder="计划重"
                 :disabled="browseStatus"
               />
             </el-form-item>
@@ -523,6 +540,7 @@
                 v-model="form.fPlangrossweight"
                 oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
                 style="width: 80%"
+                maxlength="9"
                 laceholder="计划毛重"
                 :disabled="browseStatus"
               />
@@ -1656,10 +1674,21 @@
         <!-- <el-button type="success" prop="打印" @click="showEditDialog_ss"
           >收货单
         </el-button> -->
+        <el-button
+          type="primary"
+          :disabled="approvalStatus"
+          @click="addOrUpdateHandle(form)"
+          v-if="form.fBillstatus > 3"
+        >查看审批</el-button>
+        <el-button
+          type="primary"
+          v-if="approVal === true"
+          @click="addOrUpdateHand(form)"
+        >审批</el-button>
         <el-button type="warning" prop="打印" :disabled="printinglist.length <= 0 || browseStatus" @click="showEditDialog_s"
         >出库单
         </el-button>
-        <el-button :disabled="printinglist.length <= 0 || browseStatus" @click="discharge">装货</el-button>
+        <el-button :disabled="printinglist.length <= 0 || browseStatus" @click="discharge">装货完成</el-button>
         <el-button type="info" prop="打印" :disabled="printinglist.length <= 0 || browseStatus" @click="printJobSheet"
         >作业单
         </el-button>
@@ -1670,7 +1699,10 @@
           :disabled="browseStatus"
         >请核</el-button
         >
-        <el-button @click="cancel">取 消</el-button>
+        <el-button type="danger" v-if="form.fBillstatus == '6'" @click="revoke">撤销请核</el-button>
+        <el-button type="danger" v-if="form.fBillstatus == '4' && current == before" @click="revokeTwo">撤销请核</el-button>
+        <el-button @click="cancelTwo" v-if="approVal === true">取 消</el-button>
+        <el-button @click="cancel" v-else>取 消</el-button>
       </div>
       <!-- 选择库存总账数据 -->
       <el-dialog
@@ -2207,6 +2239,8 @@ import {
   warehouseSubmission,
   updateWarehousebills,
   exportWarehousebills,
+  revokeTwo,
+  revoke,
 } from "@/api/warehouseBusiness/warehouseOutStock";
 
 import { listAgreement, operationAgreement } from "@/api/agreement/agreement";
@@ -2228,14 +2262,21 @@ import { listUser, queryUserVal } from "@/api/system/user";
 import UploadFile from "@/components/Uploadfile";
 
 import { listWhgenleg } from "@/api/reportManagement/whgenleg";
+import Global from '@/layout/components/global'
+import AddOrUpdate from "@/views/viewApproval";
+import ApprovalComments from '@/views/startApproval'
 
 export default {
   name: "Warehousebills",
   components: {
     UploadFile,
+    AddOrUpdate,
+    ApprovalComments,
   },
   data() {
     return {
+      addOrUpdateVisible: false,
+      addOrUpdateVisib: false,
       fFeeUnitid: null,
       fFeeUnitids: null,
       formBrowseStatus: false,
@@ -2255,6 +2296,7 @@ export default {
       fid: 0,
       fQty: 0,
       fSbu: 0,
+      before:'',
       // 遮罩层
       loading: true,
       // 打印地址
@@ -2280,6 +2322,7 @@ export default {
       whgenlegVisible: false,
       // 收费多选框
       feelDrSelection: [],
+      approvalStatus: false,
       // 新增用户对话框
       editDialogVisible_s: false,
       editDialogVisible_ss: false,
@@ -2288,6 +2331,7 @@ export default {
       storageAgreements: false,
       dataList: [],
       warehouseCrList: [],
+      current:'',
       warehouseDrList: [],
       printinglist: [],
       browseStatus: false,
@@ -2346,6 +2390,7 @@ export default {
       fBillstatusOptions: [],
       // 费用名称
       fWbuOptions: [],
+      approVal:false,
       // 计价单位
       jFeetunitOptions: [
         {dictLabel: "件数",dictValue: 1},
@@ -2480,7 +2525,151 @@ export default {
       this.fBillstatusOptions = response.data;
     });
   },
+  activated() {
+    this.adoPt()
+  },
   methods: {
+    adoPt(){
+      this.approval = this.$route.query.data
+      if (this.approval){
+        this.closeButton = false
+        this.approval = JSON.parse(this.approval)
+        this.approVal = true
+        this.browseStatus = status;
+        this.reset();
+        this.detailsHidden = false;
+        this.formBrowseStatus = false;
+        this.dataList = [];
+        getWarehousebills(this.approval.billId).then((response) => {
+          if (response.data.warehousebills) {
+            this.form = response.data.warehousebills;
+            if (this.form.fBillstatus > 2) {
+              this.approvalStatus = false;
+            } else {
+              this.approvalStatus = true;
+            }
+          }
+          if (response.data.warehouseBillsItem) {
+            this.dataList = response.data.warehouseBillsItem;
+            for (let list in this.dataList) {
+              if (this.dataList[list].fBillstatus > 10) {
+                this.formBrowseStatus = true;
+              }
+            }
+          }
+          if (response.data.corps) {
+            this.fMblnoOptions = response.data.corps;
+            this.KHblnoOptions = response.data.corps;
+            this.fSbuOptions = response.data.corps;
+          }
+          if (response.data.feesList) {
+            this.fWbuOptions = response.data.feesList;
+          }
+          if (response.data.warehouse) {
+            this.warehouseOptions = response.data.warehouse;
+          }
+          if (response.data.warehouseBillsItem) {
+            this.dataList = response.data.warehouseBillsItem;
+          }
+          if (response.data.enclosures) {
+            this.relevantAttachments = response.data.enclosures;
+          }
+          this.$set(this.form, "fStltypeid", this.form.fStltypeid + "");
+          this.$set(this.form, "fEta", Date.parse(this.form.fEta));
+          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],
+              "fBsdate",
+              Date.parse(this.dataList[list].fBsdate)
+            );
+          }
+          this.goodsOptions = response.data.goodsList;
+          this.kqhouseOptions = response.data.warehouseAreas;
+          this.warehouseDrList = response.data.warehousebillsfeesDr;
+          for (let dr in this.warehouseDrList) {
+            this.$set(
+              this.warehouseDrList[dr],
+              "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) {
+            this.$set(
+              this.warehouseCrList[cr],
+              "fFeeUnitid",
+              this.warehouseCrList[cr].fFeeunitid + ""
+            );
+          }
+          this.userOptions = response.data.sysUser;
+          this.open = true;
+          this.title = "修改仓入库";
+        });
+      }
+    },
+    getDataList() {
+      this.addOrUpdateVisible = false;
+    },
+    returnData() {
+      this.addOrUpdateVisib = false;
+      this.cancelTwo()
+    },
+    addOrUpdateHandle(form) {
+      this.addOrUpdateVisible = true;
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(form.fId, 120);
+      });
+    },
+    addOrUpdateHand(form) {
+      this.addOrUpdateVisib = true;
+      this.$nextTick(() => {
+        this.$refs.ApprovalComments.init(form.fId, 120);
+      });
+    },
+    cancelTwo(){
+      this.open = false
+      let view = {
+        fullPath: "/business/outStock",
+        hash: "",
+        matched: Array(2),
+        meta: Object,
+        name: "OutStock",
+        params: Object,
+        path: "/business/outStock",
+        query: Object,
+        title: "出库"
+      }
+      this.$router.push({ path: '/index'})
+      this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
+        if (this.isActive(view)) {
+          this.toLastView(visitedViews, view)
+        }
+      })
+      Global.$emit("removeCache", "closeSelectedTag", view);
+    },
     //关闭弹框的事件
     addCloseDialog(){
       this.getList()
@@ -2492,6 +2681,14 @@ export default {
         this.$set(this.relevantAttachments[list], "fName", row.fileName);
       }
     },
+    revoke(){
+      revoke(this.form.fId).then(data=>{
+        console.log(data)
+        if (data.code == 200){
+          this.open = false;
+        }
+      })
+    },
     printSomething() {
       // 此处的style即为打印时的样式
       const style = "@media print { .print-div{ padding:8px;background-color:#cccccc;line-height:12px } .red{ color:#f00} .green{color:green} td{text-align: center}}";
@@ -2556,6 +2753,17 @@ export default {
         this.whgenlegTotal = response.total;
       });
     },
+    revokeTwo(){
+      let data = {
+        actId:120,
+        billId:this.form.fId,
+        id:this.form.fId
+      }
+      console.log(data)
+      revokeTwo(data).then(data =>{
+        console.log(data)
+      })
+    },
     // 导入付款信息
     whgenlegDatas() {
       if (this.dialogWhgenlegList.length === 0) {