From 30c8d72f0d75126a729e89aaeb1e194f63a75c9f Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 19 二月 2025 16:57:59 +0800 Subject: [PATCH] 原材料报检联调 --- src/components/Table/lims-table.vue | 3 /dev/null | 162 -------------------------------- src/views/business/rawMaterialInspection/index.vue | 108 +++++++++++++++++---- src/views/business/materialOrder/index.vue | 2 4 files changed, 88 insertions(+), 187 deletions(-) diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue index dc592f0..fdb1a62 100644 --- a/src/components/Table/lims-table.vue +++ b/src/components/Table/lims-table.vue @@ -46,7 +46,7 @@ :label="item.label" :min-width="item.minWidth" :prop="item.prop" - show-overflow-tooltip + :show-overflow-tooltip="item.dataType === 'action' ? false : true" :sortable="item.sortable ? true : false" :type="item.type" :width=" @@ -371,7 +371,6 @@ methods: { getWidth(row) { let count = 0; - console.log("row---", row); row.forEach((a) => { count += a.name.length; }); diff --git a/src/components/rawMaterialInspection/dataLookVisible.vue b/src/components/rawMaterialInspection/dataLookVisible.vue deleted file mode 100644 index 79aceca..0000000 --- a/src/components/rawMaterialInspection/dataLookVisible.vue +++ /dev/null @@ -1,162 +0,0 @@ -<template> - <div> - <el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="isShow" width="80%" @closed="$emit('closeDataLook')"> - <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> - </el-dialog> - <un-pass-retest-result :retestVisible="retestVisible" :retestInfo="retestInfo" @closeRetestLook="closeRetestLook" v-if="retestVisible"></un-pass-retest-result> - </div> -</template> - -<script> -import ValueTable from "@/components/Table/value-table.vue"; -import UnPassRetestResult from "./unPassRetestResult.vue"; - -export default { - name: "dataLookVisible", - // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� - components: {UnPassRetestResult, ValueTable}, - props: { - dataDialogVisible: { - type: Boolean, - default: () => false - }, - dataLookInfo: { - type: Object, - default: () => {} - }, - }, - data() { - // 杩欓噷瀛樻斁鏁版嵁 - return { - upIndex: 0, - isShow: this.dataDialogVisible, - dataVisibleTitle: [ - { - label: '杩涘巶妫�楠�', - value: 0 - }, - { - label: '瀛e害妫�楠�', - value: 1 - }, - ], - 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: [] - }, - retestVisible: false, - retestInfo: [] - } - }, - mounted() { - this.refreshTable() - }, - // 鏂规硶闆嗗悎 - methods: { - // 鍒囨崲鏁版嵁鏌ョ湅tab鏍� - handleDataVisibleTab (m, i) { - this.dataVisibleIndex = i - this.refreshTable() - }, - // 鏌ヨ鍥炶皟 - refreshTable(e) { - if (this.dataVisibleIndex === 0) { - this.componentDataDataLook.entity.id = this.dataLookInfo.enterOrderId - } else { - this.componentDataDataLook.entity.id = this.dataLookInfo.quarterOrderId - } - this.$nextTick(() => { - this.$refs['ValueTableDataLook'].selectList(e) - }) - }, - // 鏌ョ湅涓嶅悎鏍煎娴嬬粨鏋� - getRetestResult (row) { - this.$axios.get(this.$api.insOrder.getRetestResult+'?insProductId='+row.insProductId).then(res => { - if (res.code == 201) return - this.retestVisible = true - this.retestInfo = res.data - }) - }, - closeRetestLook () { - this.retestVisible = false - }, - }, -} -</script> - -<style scoped> -.tab { - list-style-type: none; - display: flex; - margin-bottom: 12px; -} - -.tab li { - line-height: 24px; - padding: 6px 14px; - font-size: 14px; - color: #333333; - border: 1px solid #EEEEEE; - cursor: pointer; -} - -.tab li:nth-child(1) { - border-radius: 8px 0 0 8px; -} - -.tab li:nth-child(2) { - border-radius: 0 8px 8px 0; -} - -.tab li.active { - border-color: #3A7BFA; - color: #3A7BFA; -} -</style> diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue index de58d9c..e59e5f2 100644 --- a/src/views/business/materialOrder/index.vue +++ b/src/views/business/materialOrder/index.vue @@ -1036,8 +1036,8 @@ }, // 鏁版嵁鏌ョ湅 handleDataLook(row) { - this.dataDialogVisible = true; this.dataLookInfo = row + this.dataDialogVisible = true; }, // 鍏抽棴鏁版嵁鏌ョ湅寮规 closeDataLook () { diff --git a/src/views/business/rawMaterialInspection/index.vue b/src/views/business/rawMaterialInspection/index.vue index 3430970..2ea2eb7 100644 --- a/src/views/business/rawMaterialInspection/index.vue +++ b/src/views/business/rawMaterialInspection/index.vue @@ -79,6 +79,7 @@ <!--寰呮姤妫�銆佸緟涓嬪崟--> <div class="table"> <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0 || tabIndex === 1" + :isSelection="true" :handleSelectionChange="selectMethod" @pagination="pagination" :height="'calc(100vh - 290px)'" :page="page" :tableLoading="tableLoading"></lims-table> </div> @@ -179,7 +180,7 @@ </template> <script> -import DataLookVisible from "@/components/rawMaterialInspection/dataLookVisible.vue"; +import DataLookVisible from "@/views/business/materialOrderComponents/materialOrder/dataLookVisible.vue"; import { addIfsInventoryQuantity, advancedGodown, @@ -201,7 +202,41 @@ tableData: [], tableLoading: false, column: [ - {label: '妫�楠岀姸鎬�', prop: 'inspectStatus'}, + { + dataType: 'tag', + label: '妫�楠岀姸鎬�', + prop: 'inspectStatus', + formatData: (params) => { + if (params == 0) { + return '妫�楠屼腑' + } else if (params == 1) { + return '鍚堟牸' + } else if (params == 2) { + return '涓嶅悎鏍�' + } else if (params == 3) { + return '鏈笅鍗�' + } else if (params == 4) { + return '璁╂鏀捐' + } else { + return null + } + }, + formatType: (params) => { + if (params == 0) { + return 'warning' + } else if (params == 1) { + return 'success' + } else if (params == 2) { + return 'danger' + } else if (params == 3) { + return 'info' + } else if (params == 4) { + return '' + } else { + return null + } + } + }, {label: '璁㈠崟鍙�', prop: 'orderNo'}, {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived',width: '140px',}, {label: '鎵瑰彿', prop: 'updateBatchNo'}, @@ -216,14 +251,14 @@ if (params == 1) { return '杩囨湡鐗╂枡' } else { - return '' + return null } }, formatType: (params) => { if (params == 1) { return 'info' } else { - return '' + return null } } }, @@ -232,9 +267,7 @@ {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, { dataType: 'action', - fixed: 'right', label: '鎿嶄綔', - width: '150px', operation: [ { name: '鎶ユ', @@ -278,7 +311,41 @@ tableLoading1: false, column1: [ {label: '濮旀墭缂栧彿', prop: 'entrustCode'}, - {label: '妫�楠岀姸鎬�', prop: 'inspectStatus'}, + { + dataType: 'tag', + label: '妫�楠岀姸鎬�', + prop: 'inspectStatus', + formatData: (params) => { + if (params == 0) { + return '妫�楠屼腑' + } else if (params == 1) { + return '鍚堟牸' + } else if (params == 2) { + return '涓嶅悎鏍�' + } else if (params == 3) { + return '鏈笅鍗�' + } else if (params == 4) { + return '璁╂鏀捐' + } else { + return null + } + }, + formatType: (params) => { + if (params == 0) { + return 'warning' + } else if (params == 1) { + return 'success' + } else if (params == 2) { + return 'danger' + } else if (params == 3) { + return 'info' + } else if (params == 4) { + return '' + } else { + return null + } + } + }, {label: '璁㈠崟鍙�', prop: 'orderNo'}, {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, {label: '涓嬪彂鏃堕棿', prop: 'sendTime'}, @@ -299,14 +366,14 @@ if (params == 1) { return '杩囨湡鐗╂枡' } else { - return '' + return null } }, formatType: (params) => { if (params == 1) { return 'info' } else { - return '' + return null } } }, @@ -317,7 +384,6 @@ dataType: 'action', fixed: 'right', label: '鎿嶄綔', - width: '140px', operation: [ { name: '鏁版嵁鏌ョ湅', @@ -552,8 +618,8 @@ }, // 鏁版嵁鏌ョ湅 handleDataLook(row) { - this.dataDialogVisible = true; this.dataLookInfo = row + this.dataDialogVisible = true; }, // 鐩存帴鏀捐 goPass (row) { @@ -568,7 +634,7 @@ type: 'success', message: '鏀捐鎴愬姛!' }); - this.refresh() + this.refreshTable() } }) }).catch(() => { @@ -591,7 +657,7 @@ type: 'success', message: '鎿嶄綔鎴愬姛!' }); - this.refresh() + this.refreshTable() } }) }).catch(() => { @@ -630,7 +696,7 @@ if (res.code === 200) { this.declareDialogSVisible = false this.$message.success('鎶ユ鎴愬姛') - this.refresh() + this.refreshTable() } this.submitDeclareLoading = false }).catch(err => { @@ -653,7 +719,7 @@ if (res.code === 200) { this.declareDialogVisible = false this.$message.success('鎶ユ鎴愬姛') - this.refresh() + this.refreshTable() } }).catch(err => { console.log(err) @@ -673,7 +739,7 @@ if (res.code === 200) { this.declareDialogVisible = false this.$message.success('鎶ユ鎴愬姛') - this.refresh() + this.refreshTable() } }).catch(err => { console.log(err) @@ -698,11 +764,9 @@ submitDelete () { this.deleteLoading = true delIfsInventory({id: this.deleteInfo.id}).then(res => { - if (res.code === 200) { - this.deleteVisible = false - this.$message.success('鍒犻櫎鎴愬姛') - this.refresh() - } + this.deleteVisible = false + this.$message.success('鍒犻櫎鎴愬姛') + this.refreshTable() this.deleteLoading = false }).catch(err => { console.log(err) @@ -717,7 +781,7 @@ openIFS() { this.btnLoading = true getIfsOrder().then(res => { - this.refresh() + this.refreshTable() this.btnLoading = false }).catch(err => { this.btnLoading = false -- Gitblit v1.9.3