From 8edfe5a740151978422bdba16b6b68b20f0706c7 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 24 三月 2025 13:32:29 +0800
Subject: [PATCH] 设备校准计划-新增设备赋值优化
---
src/views/business/productOrder/index.vue | 134 +++++++++++++++++++++++++-------------------
1 files changed, 76 insertions(+), 58 deletions(-)
diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue
index 61af313..027fda7 100644
--- a/src/views/business/productOrder/index.vue
+++ b/src/views/business/productOrder/index.vue
@@ -15,17 +15,6 @@
<el-input v-model="entity.sampleModel" clearable placeholder="璇疯緭鍏�" size="small"
@keyup.enter.native="refreshTable()"></el-input>
</el-form-item>
- <el-form-item>
- <el-button :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3A7BFA;" type="text"
- @click="more = !more">{{ !more ? '鏇村' : '鏀惰捣' }}</el-button>
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
- </el-form-item>
- <el-form-item label="鏍峰搧缂栧彿" prop="sampleCode" v-if="more">
- <el-input v-model="entity.sampleCode" clearable placeholder="璇疯緭鍏�" size="small"
- @keyup.enter.native="refreshTable">
- </el-input>
- </el-form-item>
<el-form-item label="涓嬪崟鏃堕棿" prop="createTime" v-if="more">
<el-date-picker v-model="entity.createTime" clearable format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
style="width:100%" type="date" value-format="yyyy-MM-dd HH:mm:ss">
@@ -41,13 +30,24 @@
@keyup.enter.native="refreshTable">
</el-input>
</el-form-item>
+ <el-form-item>
+ <el-button :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3A7BFA;" type="text"
+ @click="more = !more">{{ !more ? '鏇村' : '鏀惰捣' }}</el-button>
+ <el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button>
+ <el-button size="mini" @click="refresh()">閲嶇疆</el-button>
+ </el-form-item>
</el-form>
</div>
<div class="table-tab">
<div>
<ul class="tab">
- <li v-for="(m, i) in tabList" :key="i + 'afgh'" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">{{ m.label }}
- </li>
+ <li :class="{ active: tabIndex === 0 }" v-if="checkPermi(['get:insOrder:reviewed'])" @click="handleTab(0)">寰呭鏍�</li>
+ <li :class="{ active: tabIndex === 1 }" v-if="checkPermi(['get:insOrder:checkout'])" @click="handleTab(1)">妫�楠屼腑</li>
+ <li :class="{ active: tabIndex === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">濮旀墭宸叉</li>
+ <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:insOrder:spotCheck'])" @click="handleTab(3)">鎶芥牱宸叉</li>
+ <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:insOrder:sendBack'])" @click="handleTab(4)">閫�鍥�</li>
+ <li :class="{ active: tabIndex === 5 }" v-if="checkPermi(['get:insOrder:revocation'])" @click="handleTab(5)">鎾ら攢</li>
+ <li :class="{ active: tabIndex === 6 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(6)">鍏ㄩ儴</li>
</ul>
</div>
<div>
@@ -55,7 +55,7 @@
@click="downLoad">瀵煎嚭</el-button>
<el-button v-if="tabIndex === 1" size="small" type="primary" @click="openAddIns">娣诲姞妫�楠岄」</el-button>
<el-button size="small" type="primary" @click="openPrint">鏍囩鎵撳嵃</el-button>
- <el-button size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
+ <el-button v-if="checkPermi(['add:insOrder'])" size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
</div>
</div>
<div class="table">
@@ -146,7 +146,7 @@
</el-row>
</span>
</el-dialog>
- <el-dialog :visible.sync="dataDialogVisible" title="鏁版嵁鏌ョ湅" width="80%">
+ <el-dialog :visible.sync="dataDialogVisible" title="鏁版嵁鏌ョ湅" width="80%" @close="closeDia">
<div v-if="dataDialogVisible">
<lims-table :tableData="tableDataLook" :column="tableDataLookColumn" @pagination="tableDataLookPagination"
height="500px" key="tableDataLook" :page="tableDataLookPage"
@@ -168,8 +168,7 @@
<span slot="footer" class="dialog-footer">
<el-row>
<el-button @click="handleNo">{{ deleteTilte == '鎾ら攢' ? '鍙� 娑�' : '涓嶉�氳繃' }}</el-button>
- <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '鎾ら攢' ? '纭� 瀹�' : '閫�
- 杩�'}}</el-button>
+ <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '鎾ら攢' ? '纭� 瀹�' : '閫氳繃'}}</el-button>
</el-row>
</span>
</el-dialog>
@@ -303,7 +302,6 @@
<script>
import vueQr from 'vue-qr'
import PrintJS from 'print-js'
-import file from "@/utils/file";
import PrintDialog from "@/views/business/productOrder/components/printDialog.vue";
import AddInspectionDia from "@/views/business/productOrder/components/addInspectionDia.vue";
import limsTable from "@/components/Table/lims-table.vue";
@@ -317,8 +315,8 @@
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
import {mapGetters} from "vuex";
-// import Inspection from "../do/b1-inspect-order-plan/Inspection.vue";
export default {
+ name: 'ProductOrder',
components: {
limsTable,
AddInspectionDia,
@@ -335,9 +333,21 @@
tableData: [],
tableLoading: false,
column: [
- { label: '濮旀墭缂栧彿', prop: 'entrustCode', width: '160px' },
+ {
+ label: "濮旀墭缂栧彿",
+ prop: "entrustCode",
+ width: "160px",
+ dataType: "link",
+ linkMethod: "changeEntrustCode",
+ },
{ label: '濮旀墭鍗曚綅', prop: 'company' },
- { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+ {
+ label: "鏍峰搧鍚嶇О",
+ prop: "sampleName",
+ width: "160px",
+ dataType: "link",
+ linkMethod: "selectAllByOne",
+ },
{ label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
{ label: '鏍峰搧鏁伴噺', prop: 'sampleNum' },
{ label: '妫�楠屼汉', prop: 'testingName' },
@@ -519,7 +529,7 @@
],
page: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
state: 0,// 0:鍙拌处椤碉紝1锛氭楠岄〉闈�,2妫�楠岄〉闈�(澶嶆牳)锛岄粯璁や负0,3鏁版嵁鏌ョ湅
@@ -543,11 +553,12 @@
quashDialogVisible: false,
issuedDialogVisible: false,
dataDialogVisible: false, // 鏁版嵁鏌ョ湅寮规
+ currentRow: {}, // 鏁版嵁鏌ョ湅寮规
tableDataLookTableLoading: false, // 鏁版嵁鏌ョ湅寮规
tableDataLook: [],
tableDataLookPage: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
tableDataLookColumn: [
@@ -638,7 +649,7 @@
],
pageFile: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
formData: {},
@@ -675,7 +686,7 @@
],
pageDelete: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
deleteDialogVisible: false,
@@ -744,6 +755,9 @@
this.refreshTable()
this.getAuthorizedPerson()
},
+ activated() {
+ this.refreshTable()
+ },
methods: {
// 鏌ヨ鍒楄〃鏁版嵁
refreshTable() {
@@ -758,7 +772,7 @@
}
const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
this.tableLoading = true
- selectInsOrderParameter(params).then(res => {
+ selectInsOrderParameter({...this.page,...params}).then(res => {
this.upIndex++
this.tableLoading = false
if (res.code === 200) {
@@ -779,6 +793,9 @@
},
// 鎵撳紑淇敼濮旀墭缂栧彿寮规
changeEntrustCode(row) {
+ if (this.tabIndex !== 1) {
+ return
+ }
this.entrustCodeVisible = true
this.entrustCodeInfo = { ...row }
},
@@ -872,7 +889,8 @@
},
// 瀵煎嚭璁板綍
downLoad() {
- rawAllInsOrderExport({ ...this.entity }).then(res => {
+ const params = { ...this.entity, state: this.tabList[this.tabIndex].value }
+ rawAllInsOrderExport({ ...params }).then(res => {
const blob = new Blob([res], { type: 'application/octet-stream' });
this.$download.saveAs(blob, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx');
}).catch(err => {
@@ -924,25 +942,25 @@
},
// 璇︽儏
selectAllByOne(row) {
- this.active = 2;
- // console.log(row);
- // //鎵撳紑寮规
- // this.dialogVisible = true;
- // //row = 鐐瑰嚮瀵瑰簲琛屽��
- // //澶嶅埗缁檉ormData
- // this.formData = this.HaveJson(row);
- this.currentId = row.id
- this.examine = 1
+ this.$router.push({
+ path: "/productOrder/add", query: {
+ examine: 1,
+ active: 2,
+ currentId: row.id,
+ tabIndex: this.tabIndex,
+ }
+ });
},
// 鏁版嵁鏌ョ湅
handleDataLook(row) {
this.dataDialogVisible = true;
- this.getDataTableList(row)
+ this.currentRow = row;
+ this.getDataTableList(this.currentRow)
},
// 鏌ヨ鏁版嵁鏌ョ湅鍒楄〃鏁版嵁
getDataTableList(row) {
this.tableDataLookTableLoading = true
- selectSampleAndProductByOrderId({ id: row.id }).then(res => {
+ selectSampleAndProductByOrderId({ id: row.id, ...this.tableDataLookPage }).then(res => {
this.tableDataLookTableLoading = false
if (res.code === 200) {
this.tableDataLook = res.data.records
@@ -954,7 +972,15 @@
},
tableDataLookPagination(page) {
this.tableDataLookPage.size = page.limit
- this.getDataTableList()
+ this.getDataTableList(this.currentRow)
+ },
+ closeDia () {
+ this.tableDataLookPage = {
+ total: 0,
+ size: 20,
+ current: 1
+ }
+ this.dataDialogVisible = false
},
// 闄勪欢鏌ョ湅
handleFileLook(row) {
@@ -982,25 +1008,21 @@
downFile({
id: row.id,
}).then(res => {
- if (res.code === 200) {
- let url = '';
- if (res.data.type == 1) {
- url = this.javaApi + '/img/' + res.data.fileUrl
- this.$download.saveAs(url, row.fileName);
- } else {
- url = this.javaApi + '/word/' + res.data.fileUrl
- this.$download.saveAs(url, row.fileName);
- }
- }
+ this.$download.saveAs(res.data.fileUrl, row.fileName);
}).catch(error => {
})
},
// 涓嬭浇鎶ュ憡
download(row) {
- let url = this.javaApi + '/word/' + row.urlS ? row.urlS : row.url;
- if (url) {
- this.$download.saveAs(url, this.downLoadInfo.fileName);
+ let url = row.urlS ? row.urlS : row.url;
+ if(url){
+ url = url.split('.')[0]+'.pdf'
+ const link = document.createElement('a');
+ link.href = this.javaApi + url;
+ link.target = '_blank';
+ document.body.appendChild(link);
+ link.click();
}
},
// 鎾ら攢
@@ -1018,7 +1040,7 @@
},
getDeleteList() {
this.tableLoadingDelete = true
- selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds }).then(res => {
+ selectNoProducts({ orderId: this.orderId, revocationInsProductIds: this.revocationInsProductIds, ...this.pageDelete }).then(res => {
this.tableLoadingDelete = false
this.componentDataDelete = res.data.records
this.pageDelete.total = res.data.total
@@ -1127,10 +1149,6 @@
userId: this.distributeData.userId,
sonLaboratory: this.distributeData.sonLaboratory,
}).then(res => {
- if (res.code === 201) {
- this.upLoad = false
- return
- }
this.$message.success('淇敼鎴愬姛')
this.upLoad = false
this.issuedDialogVisible = false
@@ -1176,7 +1194,7 @@
handleVerify(row) {
this.$router.push({ path: "/productOrder/add", query: { examine: 1, active: 3, currentId: row.id } });
},
- handleTab(m, i) {
+ handleTab(i) {
this.tabIndex = i;
this.refreshTable()
},
--
Gitblit v1.9.3