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/materialOrderComponents/materialOrder/dataLookVisible.vue | 150 +++++++++++++++++++++++++++++++------------------ 1 files changed, 94 insertions(+), 56 deletions(-) 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 { -- Gitblit v1.9.3