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/components/Table/lims-table.vue                                           |    2 
 src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue  |  150 +++++++++-----
 src/main.js                                                                   |    3 
 package.json                                                                  |    1 
 src/api/business/rawMaterialOrder.js                                          |  116 +++++++++++
 src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue |  172 +++++++++++------
 src/views/business/materialOrderComponents/materialOrder/printDialog.vue      |   12 
 src/views/business/materialOrder/index.vue                                    |  119 ++++-------
 8 files changed, 373 insertions(+), 202 deletions(-)

diff --git a/package.json b/package.json
index 4208e1b..01b2967 100644
--- a/package.json
+++ b/package.json
@@ -56,6 +56,7 @@
     "sortablejs": "1.10.2",
     "splitpanes": "2.4.1",
     "vue": "2.6.12",
+    "vue-barcode": "^1.3.0",
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.5.5",
     "vue-meta": "2.4.0",
diff --git a/src/api/business/rawMaterialOrder.js b/src/api/business/rawMaterialOrder.js
index 7256a8f..c463090 100644
--- a/src/api/business/rawMaterialOrder.js
+++ b/src/api/business/rawMaterialOrder.js
@@ -151,14 +151,14 @@
     data: query
   })
 }
-// 閾滃崟涓濅笅鍗曡繘鍘傛楠屽厤妫�鎺ュ彛
+// 鑾峰彇鏍囧噯鏍�
 export function selectStandardTreeList2() {
   return request({
     url: '/standardTree/selectStandardTreeList2',
     method: 'get'
   })
 }
-// 閾滃崟涓濅笅鍗曡繘鍘傛楠屽厤妫�鎺ュ彛
+// 鏌ヨ妫�楠屽崟妯℃澘
 export function selectInsOrderTemplate(query) {
   return request({
     url: '/insOrder/selectInsOrderTemplate',
@@ -166,3 +166,115 @@
     params: query
   })
 }
+// 鏀捐鏁版嵁
+export function concessionRelease(query) {
+  return request({
+    url: '/rawMaterialOrder/concessionRelease',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曞搴︽挙閿�
+export function repealQuarterRawOrder(query) {
+  return request({
+    url: '/rawMaterialOrder/repealQuarterRawOrder',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曠洿鎺ュ厤妫�鍏嶆鎺ュ彛
+export function rawOrderRelease(query) {
+  return request({
+    url: '/rawMaterialOrder/rawOrderRelease',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欐牴鎹甶d鍙栨秷鎶ユ
+export function revokeInspectionReport(query) {
+  return request({
+    url: '/rawMaterialOrder/revokeInspectionReport',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿�
+export function repealEnterRawOrder(query) {
+  return request({
+    url: '/rawMaterialOrder/repealEnterRawOrder',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿�
+export function rawAllExport(query) {
+  return request({
+    url: '/rawMaterialOrder/rawAllExport',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿�
+export function updateEntrustCode(query) {
+  return request({
+    url: '/insOrder/updateEntrustCode',
+    method: 'post',
+    data: query
+  })
+}
+// 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿�
+export function printLabel(query) {
+  return request({
+    url: '/rawMaterialOrder/printLabel',
+    method: 'post',
+    data: query
+  })
+}
+// 閫氳繃妫�楠屽崟鏌ヨ妫�楠屾暟鎹紙鏁版嵁鏌ョ湅锛�
+export function selectSampleAndProductByOrderId(query) {
+  return request({
+    url: '/insOrder/selectSampleAndProductByOrderId',
+    method: 'get',
+    params: query
+  })
+}
+// 鏌ョ湅涓嶅悎鏍煎娴嬫暟鎹�
+export function getRetestResult(query) {
+  return request({
+    url: '/insOrder/getRetestResult',
+    method: 'get',
+    params: query
+  })
+}
+// 鏌ョ湅妫�楠屽崟涓嬬殑闄勪欢鍒楄〃
+export function getFileList(query) {
+  return request({
+    url: '/insOrderPlan/getFileList',
+    method: 'get',
+    params: query
+  })
+}
+// 妫�楠屽崟涓嬬殑闄勪欢鍒楄〃-闄勪欢涓嬭浇
+export function downFile(query) {
+  return request({
+    url: '/insOrderPlan/downFile',
+    method: 'get',
+    params: query
+  })
+}
+// 妫�楠屽崟涓嬬殑闄勪欢鍒楄〃-鍒犻櫎
+export function delfile(query) {
+  return request({
+    url: '/insOrderPlan/delfile',
+    method: 'delete',
+    params: query
+  })
+}
+// 妫�楠屽崟涓嬬殑闄勪欢鍒楄〃-涓婁紶
+export function uploadFile(query) {
+  return request({
+    url: '/insOrderPlan/uploadFile',
+    method: 'delete',
+    params: query
+  })
+}
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index d6a75c2..c9c9bd5 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -19,7 +19,7 @@
       @current-change="currentChange"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" v-if="isSelection" />
+      <el-table-column align="center" type="selection" width="55" v-if="isSelection" />
       <el-table-column
         align="center"
         label="搴忓彿"
diff --git a/src/main.js b/src/main.js
index e82c37b..b3b6719 100644
--- a/src/main.js
+++ b/src/main.js
@@ -42,6 +42,8 @@
 import DictTag from "@/components/DictTag";
 // 澶撮儴鏍囩缁勪欢
 import VueMeta from "vue-meta";
+// 鏉″舰鐮佺敓鎴愮粍浠�
+import VueBarcode from "vue-barcode";
 // 瀛楀吀鏁版嵁缁勪欢
 import DictData from "@/components/DictData";
 import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟
@@ -70,6 +72,7 @@
 Vue.component("FileUpload", FileUpload);
 Vue.component("ImageUpload", ImageUpload);
 Vue.component("ImagePreview", ImagePreview);
+Vue.component('barcode', VueBarcode)
 
 Vue.use(directive);
 Vue.use(plugins);
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
diff --git a/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
index 79aceca..81c4baa 100644
--- a/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue
@@ -4,10 +4,10 @@
       <ul class="tab">
         <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
       </ul>
-      <div style="height: 70vh;overflow-y: auto;">
-        <ValueTable ref="ValueTableDataLook" :url="$api.insOrder.selectSampleAndProductByOrderId"
-                    :key="upIndex"
-                    :componentData="componentDataDataLook"/>
+      <div>
+        <lims-table :tableData="tableData" :column="column"
+                    @pagination="pagination" height="500px" key="tableData"
+                    :page="page" :tableLoading="tableLoading"></lims-table>
       </div>
     </el-dialog>
     <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result>
@@ -17,11 +17,13 @@
 <script>
 import ValueTable from "@/components/Table/value-table.vue";
 import UnPassRetestResult from "./unPassRetestResult.vue";
+import limsTable from "@/components/Table/lims-table.vue";
+import {getRetestResult, selectSampleAndProductByOrderId} from "@/api/business/rawMaterialOrder";
 
 export default {
   name: "dataLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: {UnPassRetestResult, ValueTable},
+  components: {limsTable, UnPassRetestResult, ValueTable},
   props: {
     dataDialogVisible: {
       type: Boolean,
@@ -35,7 +37,71 @@
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
-      upIndex: 0,
+      tableData: [],
+      tableLoading: false,
+      column: [
+        {label: '鏍峰搧缂栧彿', prop: 'sampleCode'},
+        {label: '鏍峰搧鍚嶇О', prop: 'sample'},
+        {label: '妫�楠岄」鍒嗙被', prop: 'inspectionItemClass'},
+        {label: '妫�楠岄」', prop: 'inspectionItem'},
+        {label: '妫�楠屽瓙椤�', prop: 'inspectionItemSubclass'},
+        {label: '鍗曚綅', prop: 'unit'},
+        {label: '鏍峰搧鍨嬪彿', prop: 'model'},
+        {label: '鏉′欢', prop: 'radius'},
+        {label: '鐢电紗鏍囪瘑', prop: 'cableTag'},
+        {label: '璇曢獙瑕佹眰', prop: 'tell'},
+        {label: '妫�楠岀粨鏋�', prop: 'lastValue'},
+        {
+          dataType: 'tag',
+          label: '缁撴灉鍒ゅ畾',
+          prop: 'insResult',
+          formatData: (params) => {
+            if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 0) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '涓嶅垽瀹�'
+            } else {
+              return ''
+            }
+          },
+          formatType: (params) => {
+            if (params == 1) {
+              return 'success'
+            } else if (params == 0) {
+              return 'danger'
+            } else if (params == 3) {
+              return ''
+            }  else {
+              return ''
+            }
+          }
+        },
+        {
+          dataType: 'action',
+          fixed: 'right',
+          label: '鎿嶄綔',
+          width: '170px',
+          operation: [
+            {
+              name: '涓嶅悎鏍煎娴嬫煡鐪�',
+              type: 'text',
+              clickFun: (row) => {
+                this.getRetestResult(row);
+              },
+              disabled: (row, index) =>  {
+                return row.insResult!==0
+              }
+            },
+          ]
+        }
+      ],
+      page: {
+        total:0,
+        size:10,
+        current:1
+      },
       isShow: this.dataDialogVisible,
       dataVisibleTitle: [
         {
@@ -48,48 +114,8 @@
         },
       ],
       dataVisibleIndex: 0, // 鏁版嵁鏌ョ湅tab鏍忛�夋嫨鍊�
-      // 琛ㄦ牸鏁版嵁
-      componentDataDataLook: { // 鏁扮粍鏌ョ湅鐨則able鏁版嵁
-        entity: {
-          id: null,
-        },
-        isIndex: false,
-        showSelect: false,
-        select: false,
-        do: [
-          {
-            id: '',
-            font: '涓嶅悎鏍煎娴嬫煡鐪�',
-            type: 'text',
-            method: 'getRetestResult',
-            disabFun: (row, index) =>  {
-              return row.insResult!=0
-            }
-          }
-        ],
-        tagField: {
-          insState: {
-            select: []
-          },
-          insResult: {
-            select: [{
-              value: 1,
-              label: '鍚堟牸',
-              type: 'success'
-            },{
-              value: 0,
-              label: '涓嶅悎鏍�',
-              type: 'danger'
-            },{
-              value: 3,
-              label: '涓嶅垽瀹�',
-              type: ''
-            }]
-          }
-        },
-        selectField: {},
-        requiredAdd: [],
-        requiredUp: []
+      entity: {
+        id: null,
       },
       retestVisible: false,
       retestInfo: []
@@ -106,20 +132,31 @@
       this.refreshTable()
     },
     // 鏌ヨ鍥炶皟
-    refreshTable(e) {
+    refreshTable() {
       if (this.dataVisibleIndex === 0) {
-        this.componentDataDataLook.entity.id = this.dataLookInfo.enterOrderId
+        this.entity.id = this.dataLookInfo.enterOrderId
       } else {
-        this.componentDataDataLook.entity.id = this.dataLookInfo.quarterOrderId
+        this.entity.id = this.dataLookInfo.quarterOrderId
       }
-      this.$nextTick(() => {
-        this.$refs['ValueTableDataLook'].selectList(e)
+      this.tableLoading = true
+      const params = {...this.entity}
+      selectSampleAndProductByOrderId(params).then(res => {
+        this.tableLoading = false
+        if (res.code === 200) {
+          this.tableData = res.data.records
+          this.page.total = res.data.total
+        }
+      }).catch(err => {
+        this.tableLoading = false
       })
+    },
+    pagination (page) {
+      this.page.size = page.limit
+      this.refreshTable()
     },
     // 鏌ョ湅涓嶅悎鏍煎娴嬬粨鏋�
     getRetestResult (row) {
-      this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => {
-        if (res.code == 201) return
+      getRetestResult({insProductId: row.insProductId}).then(res => {
         this.retestVisible = true
         this.retestInfo = res.data
       })
@@ -135,7 +172,8 @@
 .tab {
   list-style-type: none;
   display: flex;
-  margin-bottom: 12px;
+  margin-top: 0 !important;
+  padding-left: 0 !important;
 }
 
 .tab li {
diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index 2ab086f..c28c5b0 100644
--- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -16,13 +16,10 @@
           <el-button size="small" type="primary" style="height: 38px">闄勪欢涓婁紶</el-button>
         </el-upload>
       </div>
-      <div style="height: 70vh;overflow-y: auto;" v-if="filesDialogVisible">
-        <ValueTable ref="fileList"
-                    :url="$api.insOrderPlan.getFileList"
-                    :delUrl="$api.insOrderPlan.delfile"
-                    class="value-table"
-                    :key="upIndex"
-                    :componentData="componentData"/>
+      <div v-if="filesDialogVisible">
+        <lims-table :tableData="tableData" :column="column"
+                    @pagination="pagination" height="500px" key="tableData"
+                    :page="page" :tableLoading="tableLoading"></lims-table>
       </div>
     </el-dialog>
   </div>
@@ -31,11 +28,13 @@
 <script>
 import ValueTable from "@/components/Table/value-table.vue";
 import file from "@/utils/file";
+import limsTable from "@/components/Table/lims-table.vue";
+import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
 
 export default {
   name: "filesLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: {ValueTable},
+  components: {limsTable, ValueTable},
   props: {
     filesDialogVisible: {
       type: Boolean,
@@ -49,7 +48,67 @@
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
-      upIndex: 0,
+      tableData: [],
+      tableLoading: false,
+      column: [
+        {
+          dataType: 'tag',
+          label: '绫诲瀷',
+          prop: 'type',
+          formatData: (params) => {
+            if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 0) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '涓嶅垽瀹�'
+            } else {
+              return ''
+            }
+          },
+          formatType: (params) => {
+            if (params == 1) {
+              return 'success'
+            } else if (params == 0) {
+              return 'danger'
+            } else if (params == 3) {
+              return ''
+            }  else {
+              return ''
+            }
+          }
+        },
+        {label: '闄勪欢鍚嶇О', prop: 'fileName'},
+        {label: '涓婁紶浜�', prop: 'name'},
+        {label: '涓婁紶鏃堕棿', prop: 'createTime'},
+        {
+          dataType: 'action',
+          fixed: 'right',
+          label: '鎿嶄綔',
+          width: '170px',
+          operation: [
+            {
+              name: '涓嬭浇',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row);
+              }
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              clickFun: (row) => {
+                this.delete(row);
+              }
+            },
+          ]
+        }
+      ],
+      page: {
+        total:0,
+        size:10,
+        current:1
+      },
       isShow: this.filesDialogVisible,
       dataVisibleTitle: [
         {
@@ -62,50 +121,9 @@
         },
       ],
       dataVisibleIndex: 0, // tab鏍忛�夋嫨鍊�
-      componentData: {
-        entity: {
-          insOrderId:''
-        },
-        isIndex: true,
-        showSelect: false,
-        select: false,
-        sort: false,
-        init:false,
-        do: [
-          {
-            id: 'parent',
-            font: '涓嬭浇',
-            type: 'text',
-            method: 'handleDown'
-          },{
-            id: 'delete',
-            font: '鍒犻櫎',
-            type: 'text',
-            method: 'doDiy',
-          }
-        ],
-        isPage: false,
-        linkEvent: {},
-        tagField: {
-          type:{
-            select:[
-              {
-                value: 1,
-                label: '鍥剧墖'
-              },
-              {
-                value: 2,
-                label: '鏂囦欢'
-              }
-            ]
-          }
-        },
-        currentId: '',
-        selectField: {},
-        requiredAdd: [],
-        requiredUp: []
+      entity: {
+        insOrderId:''
       },
-
     }
   },
   mounted() {
@@ -119,20 +137,31 @@
       this.refreshTable()
     },
     // 鏌ヨ鍥炶皟
-    refreshTable(e) {
+    refreshTable() {
       if (this.dataVisibleIndex === 0) {
-        this.componentData.entity.insOrderId = this.filesLookInfo.enterOrderId
+        this.entity.insOrderId = this.filesLookInfo.enterOrderId
       } else {
-        this.componentData.entity.insOrderId = this.filesLookInfo.quarterOrderId
+        this.entity.insOrderId = this.filesLookInfo.quarterOrderId
       }
-      this.$nextTick(() => {
-        this.$refs['fileList'].selectList(e)
+      this.tableLoading = true
+      const params = {...this.entity}
+      getFileList(params).then(res => {
+        this.tableLoading = false
+        if (res.code === 200) {
+          this.tableData = res.data.records
+          this.page.total = res.data.total
+        }
+      }).catch(err => {
+        this.tableLoading = false
       })
     },
+    pagination (page) {
+      this.page.size = page.limit
+      this.refreshTable()
+    },
+    // 涓嬭浇
     handleDown(row){
-      this.$axios.post(this.$api.insOrderPlan.downFile, {
-        id: row.id,
-      }).then(res => {
+      downFile({id: row.id,}).then(res => {
         if (res.code === 200) {
           let url = '';
           if(res.data.type==1){
@@ -179,6 +208,24 @@
       this.$message.error('涓婁紶澶辫触')
       this.$refs.upload.clearFiles()
     },
+    // 鍒犻櫎
+    delete (row) {
+      this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      }).then(() => {
+        delfile({id: row.id}).then(res => {
+          if (res.code === 500) {
+            return
+          }
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.getList()
+        }).catch(e => {
+          this.$message.error('鍒犻櫎澶辫触')
+        })
+      }).catch(() => {})
+    }
   },
   computed: {
     headers() {
@@ -187,7 +234,7 @@
       }
     },
     action() {
-      return this.javaApi + this.$api.insOrderPlan.uploadFile
+      return this.javaApi + '/insOrderPlan/uploadFile'
     }
   },
 }
@@ -197,7 +244,8 @@
 .tab {
   list-style-type: none;
   display: flex;
-  margin-bottom: 12px;
+  margin-top: 0 !important;
+  padding-left: 0 !important;
 }
 
 .tab li {
diff --git a/src/views/business/materialOrderComponents/materialOrder/printDialog.vue b/src/views/business/materialOrderComponents/materialOrder/printDialog.vue
index 9889033..fe99554 100644
--- a/src/views/business/materialOrderComponents/materialOrder/printDialog.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/printDialog.vue
@@ -47,7 +47,7 @@
                   </div>
                   <div style="font-weight: bold;display: flex;align-items: center;">
                     <span class="full-title">鏍峰搧鐘舵��</span>:
-                    <el-radio-group v-model="item.labelStatus" style="margin-top: 7px;margin-left: 4px;" v-removeAriaHidden>
+                    <el-radio-group v-model="item.labelStatus" style="margin-top: 7px;margin-left: 4px;">
                       <el-radio label="0" style="font-weight: bold;margin-right: 7px;">寰呮</el-radio>
                       <el-radio label="1" style="font-weight: bold;margin-right: 7px;">鍦ㄦ</el-radio>
                       <el-radio label="2" style="font-weight: bold;margin-right: 7px;">宸叉</el-radio>
@@ -127,6 +127,7 @@
 
 <script>
 import PrintJS from "print-js";
+import {printLabel} from "@/api/business/rawMaterialOrder";
 
 export default {
   name: "printDialog",
@@ -161,14 +162,7 @@
         selection.map(m=> {
           ids.push(m.id)
         })
-        this.$axios.post(this.$api.materialInspection.printLabel,{
-          ids: ids
-        },{
-          headers: {
-            'Content-Type': 'application/json'
-          },
-          noQs:true
-        }).then(res => {
+        printLabel({ids: ids}).then(res => {
           if (res.code === 200 && res.data.length > 0) {
             res.data.forEach(item => {
               console.log('item---', item)

--
Gitblit v1.9.3