From 7e35455e4bbad2edfe64bf6f56beff105c94eb94 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 19 二月 2025 11:32:34 +0800
Subject: [PATCH] 1.原材料下单-数据查看、附件查看弹框迁移、标签打印

---
 src/views/business/materialOrder/index.vue |  119 +++++++++++++++++++++++------------------------------------
 1 files changed, 47 insertions(+), 72 deletions(-)

diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue
index d50868c..9e9601b 100644
--- a/src/views/business/materialOrder/index.vue
+++ b/src/views/business/materialOrder/index.vue
@@ -110,14 +110,6 @@
         </div>
       </div>
     </div>
-<!--    <div style="width: 100%;height: 100%;">-->
-<!--      <CustomsInspection :active="active"-->
-<!--                         :currentId="currentId"-->
-<!--                         :customsInspection="customsInspection" :orderType="orderType" />-->
-<!--    </div>-->
-<!--    <div style="width: 100%;height: 100%;">-->
-<!--      <CopperOrder :active="active" :currentId="currentId"></CopperOrder>-->
-<!--    </div>-->
     <!-- 纭鍏嶆寮规 -->
     <el-dialog :visible.sync="exemptionVisible" title="纭鍏嶆" width="42%">
       <div style="display: flex">
@@ -211,11 +203,18 @@
 import DownFileDialog from "@/views/business/materialOrderComponents/materialOrder/downFileDialog.vue";
 import limsTable from "@/components/Table/lims-table.vue";
 import {
+  concessionRelease,
   getIfsByAll,
   getIfsByOver,
   getIfsByQuarter,
   getIfsByStateOne,
-  getPurchaseOrder
+  getPurchaseOrder,
+  rawAllExport,
+  rawOrderRelease,
+  repealEnterRawOrder,
+  repealQuarterRawOrder,
+  revokeInspectionReport,
+  updateEntrustCode
 } from "@/api/business/rawMaterialOrder";
 import {getWarehouseSubmit} from "@/api/business/materialInspection";
 // import Inspection from "../do/b1-inspect-order-plan/Inspection.vue";
@@ -405,7 +404,7 @@
           dataType: 'action',
           fixed: 'right',
           label: '鎿嶄綔',
-          width: '300px',
+          width: '420px',
           operation: [
             {
               name: '瀛e害妫�楠�',
@@ -847,7 +846,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.post(this.$api.materialInspection.concessionRelease+'?ifsInventoryId='+row.id).then(res => {
+        concessionRelease({ifsInventoryId: row.id}).then(res => {
           if (res.code === 200) {
             this.$message({
               type: 'success',
@@ -870,7 +869,7 @@
         cancelButtonText: "鍙栨秷",
         type: "warning"
       }).then(() => {
-        this.$axios.post(this.$api.rawMaterialOrder.repealQuarterRawOrder + '?quarterOrderId=' + row.quarterOrderId).then(res => {
+        repealQuarterRawOrder({quarterOrderId: row.quarterOrderId}).then(res => {
           if (res.code === 200) {
             this.$message.success('鎾ら攢鎴愬姛')
             this.refreshTable('page')
@@ -940,14 +939,9 @@
     // 鎻愪氦鍏嶆淇℃伅
     submitExemption () {
       this.exemptionLoading = true
-      this.$axios.post(this.$api.rawMaterialOrder.rawOrderRelease, {
+      rawOrderRelease({
         ifsInventoryId: this.exemptionInfo.id,
         partDetail: this.exemptionInfo.partDetail
-      }, {
-        headers: {
-          'Content-Type': 'application/json'
-        },
-        noQs: true
       }).then(res => {
         if (res.code === 200) {
           this.exemptionVisible = false
@@ -967,12 +961,10 @@
     },
     // 鎻愪氦鎾ら攢鎶ユ鐢宠
     submitDeclare () {
-      this.$axios.post(this.$api.rawMaterialOrder.revokeInspectionReport, {
-        id: this.insOrderRow.id
-      }).then(res => {
+      revokeInspectionReport({id: this.insOrderRow.id}).then(res => {
         if (res.code === 200) {
           this.declareDialogVisible = false
-          this.refreshTable('page')
+          this.refreshTable()
           this.$message.success("鎾ら攢鎶ユ鎴愬姛")
         }
       }).catch(err => {
@@ -989,7 +981,7 @@
           cancelButtonText: "鍙栨秷",
           type: "warning"
         }).then(() => {
-          this.$axios.post(this.$api.rawMaterialOrder.repealEnterRawOrder + '?enterOrderId=' + row.enterOrderId).then(res => {
+          repealEnterRawOrder({enterOrderId: row.enterOrderId}).then(res => {
             if (res.code === 200) {
               this.$message.success('鎾ら攢鎴愬姛')
               this.refreshTable('page')
@@ -1002,7 +994,7 @@
           cancelButtonText: "鍙栨秷",
           type: "warning"
         }).then(() => {
-          this.$axios.post(this.$api.rawMaterialOrder.repealQuarterRawOrder + '?quarterOrderId=' + row.quarterOrderId).then(res => {
+          repealQuarterRawOrder({quarterOrderId: row.quarterOrderId}).then(res => {
             if (res.code === 200) {
               this.$message.success('鎾ら攢鎴愬姛')
               this.refreshTable('page')
@@ -1013,21 +1005,33 @@
       this.insOrderRow = row
     },
     cancelQuashOrder (type) {
-      const url = type === 'enterOrderId' ? this.$api.rawMaterialOrder.repealEnterRawOrder : this.$api.rawMaterialOrder.repealQuarterRawOrder
-      const name = type === 'enterOrderId' ? 'enterOrderId' : 'quarterOrderId'
-      const paramInfo = type === 'enterOrderId' ? this.insOrderRow.enterOrderId : this.insOrderRow.quarterOrderId
-      this.$confirm('鏄惁鎾ら攢褰撳墠鏁版嵁?', "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      }).then(() => {
-        this.$axios.post(url + `?${name}=` + paramInfo).then(res => {
-          if (res.code === 200) {
-            this.$message.success('鎾ら攢鎴愬姛')
-            this.refreshTable('page')
-          }
-        })
-      }).catch(() => {})
+      if (type === 'enterOrderId') {
+        this.$confirm('鏄惁鎾ら攢褰撳墠鏁版嵁?', "璀﹀憡", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        }).then(() => {
+          repealEnterRawOrder({enterOrderId: this.insOrderRow.enterOrderId}).then(res => {
+            if (res.code === 200) {
+              this.$message.success('鎾ら攢鎴愬姛')
+              this.refreshTable('page')
+            }
+          })
+        }).catch(() => {})
+      } else {
+        this.$confirm('鏄惁鎾ら攢褰撳墠鏁版嵁?', "璀﹀憡", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        }).then(() => {
+          repealQuarterRawOrder({quarterOrderId: this.insOrderRow.quarterOrderId}).then(res => {
+            if (res.code === 200) {
+              this.$message.success('鎾ら攢鎴愬姛')
+              this.refreshTable('page')
+            }
+          })
+        }).catch(() => {})
+      }
     },
     // 鐐瑰嚮鏍峰搧鍚嶇О鏌ョ湅璇︽儏
     selectAllByOne(row) {
@@ -1056,28 +1060,6 @@
     closeFilesLook () {
       this.filesDialogVisible = false
     },
-    // 闄勪欢涓嬭浇
-    handleDown(row){
-      this.$axios.post(this.$api.insOrderPlan.downFile, {
-        id: row.id,
-      }).then(res => {
-        if (res.code === 200) {
-          let url = '';
-          if(res.data.type==1){
-            url = this.javaApi+'/img/'+res.data.fileUrl
-            file.downloadIamge(url,row.fileName)
-          }else{
-            url = this.javaApi+'/word/'+res.data.fileUrl
-            const link = document.createElement('a');
-            link.href = url;
-            link.download = row.fileName;
-            link.click();
-          }
-        }
-      }).catch(error => {
-
-      })
-    },
     // 鎶ュ憡涓嬭浇
     download(row) {
       this.downFileDialogVisible = true
@@ -1104,13 +1086,9 @@
       let entity = this.tabIndex === 3 ? {...this.entity, isInspect: 2} : {...this.entity,state: 2, orderState: 4,}
       delete entity.orderBy
       this.outLoading = true
-      this.$axios.post(this.$api.rawMaterialOrder.rawAllExport,{
+      rawAllExport({
         entity:entity
-      },{
-        headers: {
-          'Content-Type': 'application/json'
-        }
-        ,responseType: "blob"}).then(res => {
+      },{responseType: "blob"}).then(res => {
         this.outLoading = false
         this.$message.success('瀵煎嚭鎴愬姛')
         const blob = new Blob([res],{ type: 'application/octet-stream' });
@@ -1121,16 +1099,13 @@
         link.click();
       })
     },
+    // 鎻愪氦淇敼濮旀墭缂栧彿淇℃伅
     submitCode () {
       this.submitCodeLoading = true
       try {
-        this.$axios.post(this.$api.insOrderPlan.updateEntrustCode, {
+        updateEntrustCode({
           id: this.entrustCodeInfo.id,
           entrustCode: this.entrustCodeInfo.entrustCode,
-        }, {
-          headers: {
-            'Content-Type': 'application/json'
-          }
         }).then(res => {
           if (res.code === 200) {
             this.entrustCodeVisible = false

--
Gitblit v1.9.3