From 4b9dfff19ff70db47f99cb93070d0650267c6896 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 06 三月 2025 16:22:19 +0800
Subject: [PATCH] 检验任务-添加查看工时功能
---
src/views/business/materialOrder/index.vue | 193 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 161 insertions(+), 32 deletions(-)
diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue
index 4a20344..51b698e 100644
--- a/src/views/business/materialOrder/index.vue
+++ b/src/views/business/materialOrder/index.vue
@@ -59,8 +59,11 @@
<div class="table-tab">
<div>
<ul class="tab">
- <li v-for="(m, i) in tabList" :key="m.value" :class="{ active: m.value === tabIndex }" @click="handleTab(m)">
- {{ m.label }}</li>
+ <li :class="{ active: tabIndex === 0 }" @click="handleTab(0)">寰呬笅鍗�</li>
+ <li :class="{ active: tabIndex === 1 }" @click="handleTab(1)">妫�楠屼腑</li>
+ <li :class="{ active: tabIndex === 2 }" @click="handleTab(2)">宸叉楠�</li>
+ <li :class="{ active: tabIndex === 4 }" @click="handleTab(4)">瀛e害妫�楠�</li>
+ <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:Ifs:ByAll'])" @click="handleTab(3)">鍏ㄩ儴</li>
</ul>
</div>
<div>
@@ -73,31 +76,32 @@
<!--寰呬笅鍗�-->
<div class="table">
<lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" @pagination="pagination"
- :height="'calc(100vh - 290px)'" key="tableData" :page="page" :tableLoading="tableLoading"></lims-table>
+ :rowClassName="changeRowClass" :height="'calc(100vh - 290px)'" key="tableData" :page="page"
+ :tableLoading="tableLoading"></lims-table>
</div>
<!--妫�楠屼腑-->
<div class="table">
<lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" :isSelection="true"
- :handleSelectionChange="selectMethod" @pagination="pagination1" :height="'calc(100vh - 290px)'"
- key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
+ :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination1"
+ :height="'calc(100vh - 290px)'" key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
</div>
<!--宸叉楠�-->
<div class="table">
<lims-table :tableData="tableData2" :column="column2" v-if="tabIndex === 2" :isSelection="true"
- :handleSelectionChange="selectMethod" @pagination="pagination2" :height="'calc(100vh - 290px)'"
- key="tableData2" :page="page2" :tableLoading="tableLoading2"></lims-table>
+ :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination2"
+ :height="'calc(100vh - 290px)'" key="tableData2" :page="page2" :tableLoading="tableLoading2"></lims-table>
</div>
<!--鍏ㄩ儴-->
<div class="table">
<lims-table :tableData="tableData3" :column="column3" v-if="tabIndex === 3" :isSelection="true"
- :handleSelectionChange="selectMethod" @pagination="pagination3" :height="'calc(100vh - 290px)'"
- key="tableData3" :page="page3" :tableLoading="tableLoading3"></lims-table>
+ :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination3"
+ :height="'calc(100vh - 290px)'" key="tableData3" :page="page3" :tableLoading="tableLoading3"></lims-table>
</div>
<!--瀛e害妫�楠�-->
<div class="table">
<lims-table :tableData="tableData4" :column="column4" v-if="tabIndex === 4" :isSelection="true"
- :handleSelectionChange="selectMethod" @pagination="pagination4" :height="'calc(100vh - 290px)'"
- key="tableData4" :page="page4" :tableLoading="tableLoading4"></lims-table>
+ :rowClassName="changeRowClass" :handleSelectionChange="selectMethod" @pagination="pagination4"
+ :height="'calc(100vh - 290px)'" key="tableData4" :page="page4" :tableLoading="tableLoading4"></lims-table>
</div>
</div>
</div>
@@ -117,8 +121,8 @@
</el-dialog>
<!-- 鎾ら攢鎶ユ -->
<el-dialog :visible.sync="declareDialogVisible" title="鎶ユ鎾ら攢" width="30%">
- <p style="font-size:16px;color:#333333">鎵瑰彿<span
- style="color:#34BD66">{{ this.insOrderRow.updateBatchNo }}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span>
+ <p style="font-size:16px;color:#333333">鎵瑰彿<span style="color:#34BD66">{{ this.insOrderRow.updateBatchNo
+ }}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span>
</p>
<span slot="footer" class="dialog-footer">
<el-row>
@@ -357,8 +361,48 @@
tableData2: [],
tableLoading2: false,
column2: [
- { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
- { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+ {
+ label: '濮旀墭缂栧彿',
+ prop: 'entrustCode',
+ width: "160px",
+ dataType: "link",
+ linkMethod: "changeEntrustCode",
+ },
+ {
+ 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' },
@@ -368,7 +412,13 @@
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
{ label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
{ label: '鍏嶆', prop: 'isExemption' },
- { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+ {
+ label: '鏍峰搧鍚嶇О',
+ prop: 'sampleName',
+ width: "160px",
+ dataType: "link",
+ linkMethod: "selectAllByOne",
+ },
{ label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
{ label: '妫�楠屼汉', prop: 'userName' },
{
@@ -470,8 +520,42 @@
tableData3: [],
tableLoading3: false,
column3: [
- { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
- { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+ { label: '濮旀墭缂栧彿', prop: 'entrustCode',width: "160px", },
+ {
+ 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' },
@@ -481,7 +565,13 @@
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
{ label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
{ label: '鍏嶆', prop: 'isExemption' },
- { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+ {
+ label: '鏍峰搧鍚嶇О',
+ prop: 'sampleName',
+ width: "160px",
+ dataType: "link",
+ linkMethod: "selectAllByOne",
+ },
{ label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
{ label: '妫�楠屼汉', prop: 'userName' },
{
@@ -536,8 +626,42 @@
tableData4: [],
tableLoading4: false,
column4: [
- { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
- { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' },
+ { label: '濮旀墭缂栧彿', prop: 'entrustCode',width: "160px", },
+ {
+ 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' },
@@ -547,7 +671,13 @@
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' },
{ label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' },
{ label: '鍏嶆', prop: 'isExemption' },
- { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+ {
+ label: '鏍峰搧鍚嶇О',
+ prop: 'sampleName',
+ width: "160px",
+ dataType: "link",
+ linkMethod: "selectAllByOne",
+ },
{ label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
{ label: '妫�楠屼汉', prop: 'userName' },
{
@@ -1073,17 +1203,10 @@
let entity = this.tabIndex === 3 ? { ...this.entity, isInspect: 2 } : { ...this.entity, state: 2, orderState: 4, }
delete entity.orderBy
this.outLoading = true
- rawAllExport({
- entity: entity
- }, { responseType: "blob" }).then(res => {
+ rawAllExport({ entity: entity }).then(res => {
this.outLoading = false
- this.$message.success('瀵煎嚭鎴愬姛')
const blob = new Blob([res], { type: 'application/octet-stream' });
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx';
- link.click();
+ this.$download.saveAs(blob, '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx');
})
},
// 鎻愪氦淇敼濮旀墭缂栧彿淇℃伅
@@ -1107,13 +1230,19 @@
},
// 鍒囨崲涓嬪崟tab琛ㄦ牸
handleTab(m) {
- this.tabIndex = m.value;
+ this.tabIndex = m;
this.refreshTable()
},
// 琛ㄦ牸閫夋嫨鏂规硶
selectMethod(val) {
this.multipleSelection = val
},
+ changeRowClass({ row, rowIndex }) {
+ if (row.isFirst == 1) {
+ return 'highlight-danger-row-border'
+ }
+ return ''
+ },
},
}
</script>
--
Gitblit v1.9.3