From 58ac82fceff96784dd9e16872d1e2316fa2cfdec Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期五, 24 十一月 2023 14:36:12 +0800
Subject: [PATCH] 入库明细报表修改状态进度展示

---
 src/views/reportForm/inboundOutboundDetail/index.vue            |   13 +++-
 src/views/reportForm/outboundDetail/index.vue                   |   62 +++++++++-----------
 src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue |   58 +++++++++++++++---
 3 files changed, 84 insertions(+), 49 deletions(-)

diff --git a/src/views/reportForm/inboundOutboundDetail/index.vue b/src/views/reportForm/inboundOutboundDetail/index.vue
index b7f5122..0c7cc70 100644
--- a/src/views/reportForm/inboundOutboundDetail/index.vue
+++ b/src/views/reportForm/inboundOutboundDetail/index.vue
@@ -23,8 +23,12 @@
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
-    <!-- 缂栬緫 -->
-    <AddOverviewDialog v-if="editConfig.visible" :edit-common-config="editConfig" :add-name="this.$route.params.name" />
+    <!-- 鏌ョ湅/缂栬緫 -->
+    <AddOverviewDialog 
+      v-if="editConfig.visible" 
+      :edit-common-config="editConfig" 
+      :add-name="this.$route.params.name"
+    />
   </div>
 </template>
 
@@ -226,6 +230,9 @@
         }).then((res) => {
           if (res.code === 200) {
             res.data.map((item)=>{
+                if(item.status===""){
+                  item.status=4
+                }
                 let dateObject = new Date(item.date);  
                 let formattedDateString = dateObject.toISOString().split('T')[0];  
                 item.date=formattedDateString
@@ -254,7 +261,7 @@
     },
     // 鐘舵��
     getStatus(val) {
-      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : val===4?"瀹屾垚":val===5?"宸插彇娑�":" "
     }
   }
 }
diff --git a/src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue b/src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue
index 70bc0aa..3d11e19 100644
--- a/src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue
+++ b/src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue
@@ -10,7 +10,7 @@
       <div slot="title" class="dialog-header">
         <span>{{ editCommonConfig.title === "鏌ョ湅" ? editCommonConfig.title : editCommonConfig.title + addName }}</span>
         <div class="header_btns">
-          <span class="btn">
+          <span class="btn" @click="btnPrint">
             <i class="el-icon-printer"></i>
             <span>鎵撳嵃</span>
           </span>
@@ -18,7 +18,7 @@
             <i class="el-icon-s-tools"></i>
             <span>鍔ㄤ綔</span>
           </span>
-          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
+          <el-button v-if="showEdit" :disabled="this.editConfig.infomation.status===5" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
         </div>
       </div>
       <!-- 鍐呭 -->
@@ -36,6 +36,7 @@
             :showButton="showButton"
             :isValidateClick="isValidateClick"
             :isDelClick="isDelClick"
+            :isCancel="isCancel"
             :list="list"
             :showCancel="showCancel"
             @delClick="delClick"
@@ -314,7 +315,8 @@
   stateCancel,
   deleteOperation,
   getListTransfer,
-  getLogisticCompanyList
+  getLogisticCompanyList,
+  printReceipts
 } from "@/api/overview/overview"
 import { getCompanyList } from "@/api/common/other"
 export default {
@@ -360,13 +362,6 @@
       companyOptions: [], // 鍏徃
       memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
       toLocationOptions: [], //  婧愪綅缃� 浠撳簱浣嶇疆
-      list: [
-        { label: "鑽夌", status: "todo", value: 1 },
-        { label: "姝e湪绛夊緟", status: "todo", value: 2 },
-        { label: "灏辩华", status: "todo", value: 3 },
-        { label: "瀹屾垚", status: "todo", value: 4 },
-        { label: "宸插彇娑�", status: "todo", value: 5 }
-      ],
       showButton: true,
       activeName: "first",
       productTableList: {},
@@ -375,6 +370,7 @@
       isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
+      isCancel:false, //楠岃瘉鎸夐挳鏄惁鍙偣鍑�
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
       currentState: "todo", // 褰撳墠鐘舵��
       detailTableList: {},
@@ -394,9 +390,11 @@
         logisticWeight:0,
       },
       showCancel:false, // 鍙栨秷鏄惁鍙互鏄剧ず
+      list:[],
     }
   },
   created() {
+    this.setStatusList()
     this.setTableForm()
     this.setBottonView()
     this.setDetailTableForm()
@@ -409,6 +407,25 @@
     this.getLogisticCompanyList()
   },
   methods: {
+    setStatusList(){
+      if(this.editConfig.infomation.status===5){
+        this.list=[
+          { label: "鑽夌", status: "todo", value: 1 },
+          { label: "姝e湪绛夊緟", status: "todo", value: 2 },
+          { label: "灏辩华", status: "todo", value: 3 },
+          { label: "瀹屾垚", status: "todo", value: 4 },
+          { label: "宸插彇娑�", status: "todo", value: 5 }
+        ]
+      }else{
+        console.log(this.editConfig.infomation.status,"钘曠墖")
+        this.list=[
+          { label: "鑽夌", status: "todo", value: 1 },
+          { label: "姝e湪绛夊緟", status: "todo", value: 2 },
+          { label: "灏辩华", status: "todo", value: 3 },
+          { label: "瀹屾垚", status: "todo", value: 4 }
+        ]
+      }
+    },
     // 鑾峰彇鍏徃鍒楄〃
     async getCompanyList() {
       await getCompanyList().then((res) => {
@@ -474,9 +491,11 @@
         }else if(this.editConfig.infomation.status === 3){
           this.isValidateClick = true
           this.showCancel=true
+        }else if(this.editConfig.infomation.status===5){
+          this.isCancel=true
+          this.isValidateClick=true
         }else{
           this.isValidateClick = true
-
         }
       } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "瀹屾垚") {
         this.showButton = true
@@ -485,6 +504,7 @@
         this.showFooter = false
         this.isValidateClick = false
       } else if (this.editConfig.infomation.status === 5) {
+        this.isCancel=true
         this.showButton = true
         this.showEdit = false
         this.showFooter = false
@@ -788,6 +808,19 @@
         })
       }).catch(() => {         
       });
+    },
+    //鎵撳嵃
+    async btnPrint(){
+      await printReceipts(this.editCommonConfig.infomation.id).then((res) => {
+        console.log(res)
+        if (res.code === 200) {
+          this.$message.success("鎵撳嵃鎴愬姛")
+          const link = document.createElement('a');
+          link.href = res.data;
+          link.download = '鍑哄簱鍗�.xlsx';
+          link.click();
+        }
+      })
     }
   }
 }
@@ -804,6 +837,9 @@
     margin-left: auto;
     margin-right: 60px;
     .btn {
+      cursor: pointer;
+    }
+    .btn:nth-of-type(2){
       cursor: no-drop;
     }
   }
diff --git a/src/views/reportForm/outboundDetail/index.vue b/src/views/reportForm/outboundDetail/index.vue
index 02183b3..0cd7b83 100644
--- a/src/views/reportForm/outboundDetail/index.vue
+++ b/src/views/reportForm/outboundDetail/index.vue
@@ -1,23 +1,13 @@
 <template>
   <div class="rightContent">
     <div class="top">
-      <SearchCommonView
-        :add-title="'鏂板缓'"
-        :showAdd="false"
-        :placeholder="'璇锋牴鎹崟鍙枫�佷骇鍝併�佷笟鍔$被鍨嬭繘琛屾悳绱�'"
-        :amount-view="false"
-        @addCommonClick="addBtnClick"
-        @searchClick="getList"
-      />
+      <SearchCommonView :add-title="'鏂板缓'" :showAdd="false" :placeholder="'璇锋牴鎹崟鍙枫�佷骇鍝併�佷笟鍔$被鍨嬭繘琛屾悳绱�'" :amount-view="false"
+        @addCommonClick="addBtnClick" @searchClick="getList" />
     </div>
     <div class="list-view">
       <div class="table">
-        <TableCommonView
-          ref="tableListRef"
-          :table-list="tableList"
-          @selTableCol="selTableCol"
-          @tableRowClick="tableRowClick"
-        ></TableCommonView>
+        <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol"
+          @tableRowClick="tableRowClick"></TableCommonView>
       </div>
       <div class="btn-pager">
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
@@ -57,7 +47,7 @@
         infomation: {}
       },
       params: {},
-      baseOperationTypeList:getDataByType("baseOperationTypeTwo"),
+      baseOperationTypeList: getDataByType("baseOperationTypeTwo"),
     }
   },
   created() {
@@ -72,7 +62,6 @@
       sessionStorage.setItem("paramsList", JSON.stringify(params))
     }
     this.params = params
-    console.log(this.params,'====111')
     this.getData()
   },
   // 椤甸潰閿�姣佷箣鍓�
@@ -185,7 +174,7 @@
       this.showcol = val
       this.tableList.tableColumn = this.setTableColumn(val)
     },
-    getBaseOperationTypeList(val){
+    getBaseOperationTypeList(val) {
       let string = "--"
       if (val) {
         for (let i in this.baseOperationTypeList) {
@@ -200,18 +189,18 @@
     async getData() {
       if (this.params.name === "鎶ヨ〃") {
         await getHistory({
-          keyWord:this.params.keyWord,
-          produceId:this.params.produceId,
-          unit:this.params.unit,
-          productName:this.params.productName,
+          keyWord: this.params.keyWord,
+          produceId: this.params.produceId,
+          unit: this.params.unit,
+          productName: this.params.productName,
           page: this.pagerOptions.currPage,
           pageSize: this.pagerOptions.pageSize
         }).then((res) => {
           if (res.code === 200) {
-            res.data.map((item)=>{
-                let dateObject = new Date(item.date);  
-                let formattedDateString = dateObject.toISOString().split('T')[0];  
-                item.date=formattedDateString
+            res.data.map((item) => {
+              let dateObject = new Date(item.date);
+              let formattedDateString = dateObject.toISOString().split('T')[0];
+              item.date = formattedDateString
             })
             this.tableList.tableInfomation = res.data
             this.pagerOptions.totalCount = res.total
@@ -219,18 +208,21 @@
         })
       } else {
         await getHistory({
-          keyWord:this.params.keyWord,
-          baseOperationType:2,
+          keyWord: this.params.keyWord,
+          baseOperationType: 2,
           page: this.pagerOptions.currPage,
           pageSize: this.pagerOptions.pageSize
         }).then((res) => {
           if (res.code === 200) {
-            res.data.map((item)=>{
-                let dateObject = new Date(item.date);  
-                let formattedDateString = dateObject.toISOString().split('T')[0];  
-                item.date=formattedDateString
+            res.data.map((item) => {
+              if(item.status===""){
+                item.status=4
+              }
+              let dateObject = new Date(item.date);
+              let formattedDateString = dateObject.toISOString().split('T')[0];
+              item.date = formattedDateString
             })
-            this.tableList.tableInfomation = res.data?res.data:[]
+            this.tableList.tableInfomation = res.data ? res.data : []
             this.pagerOptions.totalCount = res.total
           }
         })
@@ -238,12 +230,12 @@
     },
     // 鎼滅储
     getList(val) {
-      this.params.keyWord=val;
+      this.params.keyWord = val;
       this.getData()
     },
     // 琛岀偣鍑�
     tableRowClick(row) {
-      console.log(row,"鐪嬬湅row")
+      console.log(row, "鐪嬬湅row")
       this.editConfig.visible = true
       this.editConfig.title = "鏌ョ湅"
       this.editConfig.infomation = { ...row }
@@ -255,7 +247,7 @@
     },
     // 鐘舵��
     getStatus(val) {
-      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : val === 4 ? "瀹屾垚" : val === 5 ? "宸插彇娑�":""
     }
   }
 }

--
Gitblit v1.8.0