From ce2570f8555ff6668da4f149521b4620bdd9d8bf Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 23 九月 2026 15:25:22 +0800
Subject: [PATCH] feat(order): 添加订单委托要求字段并优化界面流程 - 新增分包内容、样品处置、结果评价、报告交付方式等委托要求字段 - 添加分包单位信息、报告寄送地址、收件人电话等关联信息录入功能 - 更新订单状态标签,新增作废状态和全部状态页签 - 调整报告准备页面审批流程,防止审核人和批准人为同一人
---
src/views/CNAS/process/disposal/sampleReceipt/index.vue | 530 ++++++++++++++++++++++++++++------------------------------
1 files changed, 258 insertions(+), 272 deletions(-)
diff --git a/src/views/CNAS/process/disposal/sampleReceipt/index.vue b/src/views/CNAS/process/disposal/sampleReceipt/index.vue
index 46ada41..cdd34e3 100644
--- a/src/views/CNAS/process/disposal/sampleReceipt/index.vue
+++ b/src/views/CNAS/process/disposal/sampleReceipt/index.vue
@@ -1,119 +1,102 @@
<template>
- <div class="capacity-scope">
- <div style="display: flex;justify-content: space-between;align-items: flex-start">
- <el-form :model="queryParams0" ref="queryParams0" size="small" :inline="true">
- <el-form-item label="鏀舵牱鏃ユ湡" prop="receiveDate">
- <el-date-picker v-model="queryParams0.receiveDate" type="date" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
- value-format="yyyy-MM-dd" size="small" @change="refreshTable()">
- </el-date-picker>
+ <div class="app-container">
+ <div class="search">
+ <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
+ <el-form-item label="濮旀墭缂栧彿" prop="entrustCode">
+ <el-input v-model="queryParams.entrustCode" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="refreshTable"></el-input>
+ </el-form-item>
+ <el-form-item label="鏍峰搧缂栧彿" prop="sampleCode">
+ <el-input v-model="queryParams.sampleCode" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="refreshTable"></el-input>
+ </el-form-item>
+ <el-form-item label="鏍峰搧鍚嶇О" prop="sampleName">
+ <el-input v-model="queryParams.sampleName" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="refreshTable"></el-input>
</el-form-item>
<el-form-item>
- <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</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>
- <el-button size="small" @click="handleDown0">瀵煎嚭</el-button>
</div>
- <div class="table">
- <lims-table :tableData="tableData0" :column="column0" :tableLoading="tableLoading0"
- key="tableData0"
- :height="'calc(100vh - 240px)'" :page="page0" @pagination="pagination0">
- <div slot="action" slot-scope="scope">
- <el-button type="text" @click="handleAdd(scope.row)">缂栬緫</el-button>
- <el-button type="text" @click="delRow(scope.row)">
- <span style="color: #F56C6C">鍒犻櫎</span>
- </el-button>
+ <div class="container">
+ <div class="table-tab">
+ <div>
+ <ul class="tab">
+ <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 === 3 }" @click="handleTab(3)">宸插彇娑�</li>
+ <li :class="{ active: tabIndex === 4 }" @click="handleTab(4)">鍏ㄩ儴</li>
+ </ul>
</div>
- </lims-table>
+ <div>
+ <el-button size="small" @click="handleExport">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <lims-table :tableData="tableData" :column="column" @pagination="pagination"
+ :height="'calc(100vh - 280px)'" :key="upIndex" :page="page" :tableLoading="tableLoading">
+ <template slot="inspectionItem" slot-scope="scope">
+ <div style="white-space: pre-line; text-align: left; padding: 4px 0;">{{ scope.row.inspectionItem }}</div>
+ </template>
+ <template slot="remark" slot-scope="scope">
+ <span>{{ scope.row.status === 2 && scope.row.rejectRemark ? scope.row.rejectRemark : scope.row.remark }}</span>
+ </template>
+ <template slot="action" slot-scope="scope">
+ <el-button v-if="scope.row.status === 0" type="text" @click="handleEdit(scope.row)">缂栬緫</el-button>
+ <el-button v-else type="text" @click="handleView(scope.row)">鏌ョ湅</el-button>
+ </template>
+ </lims-table>
+ </div>
</div>
- <!-- 鏂板鏍峰搧 -->
- <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px">
- <el-row>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏀舵牱鏃ユ湡锛�</div>
- <div class="search_input">
- <el-date-picker v-model="addInfo.receiveDate" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
- value-format="yyyy-MM-dd" style="width: 100%;">
- </el-date-picker>
- </div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏍峰搧鍚嶇О锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="addInfo.sampleName"></el-input></div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏍峰搧缂栧彿锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="addInfo.sampleCode"></el-input></div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏁伴噺锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="addInfo.num"></el-input>
- </div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏉ユ牱鍗曚綅锛�</div>
- <div class="search_input">
- <el-select v-model="addInfo.sampleSupplier" size="small">
- <el-option :label="item.company" :value="item.company" v-for="(item, index) in customPageList"
- :key="item.id"></el-option>
- </el-select>
- </div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鐣欐牱鏃ユ湡锛�</div>
- <div class="search_input">
- <el-date-picker v-model="addInfo.leaveDate" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
- value-format="yyyy-MM-dd" style="width: 100%;">
- </el-date-picker>
- </div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">鏍峰搧鐘舵�侊細</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="addInfo.sampleState"></el-input></div>
- </div>
- </el-col>
- <el-col :span="24" style="margin-bottom: 16px;">
- <div class="search_thing">
- <div class="search_label">澶勭悊鏃ユ湡锛�</div>
- <div class="search_input">
- <el-date-picker v-model="addInfo.dealTime" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
- value-format="yyyy-MM-dd" style="width: 100%;">
- </el-date-picker>
- </div>
- </div>
- </el-col>
- </el-row>
+
+ <!-- 缂栬緫/鏌ョ湅寮圭獥 -->
+ <el-dialog :title="isEdit ? '缂栬緫' : '鏌ョ湅'" :visible.sync="editDialogVisible" width="500px"
+ :close-on-click-modal="false">
+ <el-form ref="editForm" :model="currentInfo" label-width="110px" size="small">
+ <el-form-item label="鏍峰搧鍚嶇О">
+ <el-input v-model="currentInfo.sampleName" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鏍峰搧缂栧彿">
+ <el-input v-model="currentInfo.sampleCode" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="濮旀墭缂栧彿">
+ <el-input v-model="currentInfo.entrustCode" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鏂规硶鏍囧噯">
+ <el-input v-model="currentInfo.methodStandard" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="妫�娴嬮」鐩�">
+ <el-input v-model="currentInfo.inspectionItem" type="textarea" :rows="3" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="涓绘楠屼汉" required>
+ <el-select v-model="currentInfo.mainInspectorId" clearable filterable placeholder="璇烽�夋嫨" size="small"
+ style="width: 100%;" :disabled="!isEdit">
+ <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
<span slot="footer" class="dialog-footer">
- <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitAdd" :loading="addLoading">纭� 瀹�</el-button>
+ <el-button @click="editDialogVisible = false">鍙� 娑�</el-button>
+ <el-button v-if="isEdit" type="danger" :loading="rejectLoading" @click="openReject">鎷掓敹鏍峰搧</el-button>
+ <el-button v-if="isEdit" type="primary" :loading="submitLoading" @click="handleSubmit">鎻愪氦妫�楠�</el-button>
</span>
</el-dialog>
- <!-- 璇︽儏/涓嬭浇/瀹℃牳/鎵瑰噯 -->
- <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="800px" :class="{ downPdf: title0 == '涓嬭浇' }"
- :modal="title0 != '涓嬭浇'" top="5vh">
- <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}"
- style="max-height: 70vh;overflow-y: auto;" />
- <span slot="footer" class="dialog-footer" v-if="title0 == '瀹℃牳' || title0 == '鎵瑰噯'">
- <el-button @click="submitCheck('涓嶉�氳繃')" :loading="noCheckLoading">涓嶉�氳繃</el-button>
- <el-button type="primary" @click="submitCheck('閫氳繃')" :loading="checkLoading">閫� 杩�</el-button>
+
+ <!-- 鎷掓敹澶囨敞寮圭獥 -->
+ <el-dialog title="鎷掓敹鏍峰搧" :visible.sync="rejectDialogVisible" width="400px" :close-on-click-modal="false">
+ <el-form ref="rejectForm" :model="rejectInfo" label-width="90px" size="small">
+ <el-form-item label="鎷掓敹澶囨敞" prop="remark" required>
+ <el-input v-model="rejectInfo.remark" type="textarea" :rows="3" maxlength="500" show-word-limit
+ placeholder="璇疯緭鍏ユ嫆鏀跺娉�"></el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="rejectDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="danger" :loading="rejectLoading" @click="handleReject">纭� 瀹�</el-button>
</span>
</el-dialog>
</div>
@@ -121,220 +104,223 @@
<script>
import limsTable from "@/components/Table/lims-table.vue";
-import filePreview from "@/components/Preview/filePreview.vue";
-import { selectCustomPageList } from "@/api/system/customer";
+import { selectUserCondition } from "@/api/performance/class";
import {
- pageProcessSample,
- delProcessSample,
- addProcessSample,
- exportProcessSample
-} from "@/api/cnas/process/sampleDisposal";
+ pageSampleReceipt,
+ submitSampleReceipt,
+ rejectSampleReceipt,
+ exportSampleReceipt
+} from "@/api/business/sampleReceipt";
+
export default {
name: 'SampleReceipt',
components: {
limsTable,
- filePreview,
},
data() {
return {
- activeName: '濉啓',
- title: '鏂板',
- addDialogVisible: false,
- addLoading: false,
- outLoading: false,
- editDialogVisible: false,
- lookDialogVisible: false,
- title0: '鏌ョ湅',
- noCheckLoading: false,
- checkLoading: false,
- // 鍘嗗彶鍒楄〃
- addInfo: {},//鏂板鏍峰搧
- customPageList: [],
- currentInfo: {
- arr: []
- },//鏌ョ湅鐨勮鎯�
- queryParams0: {
- receiveDate: ''
- },
- tableLoading0: false,
- tableData0: [],
- column0: [
- {
- label: "鏀舵牱鏃ユ湡",
- prop: "receiveDate",
- },
- {
- label: "鏍峰搧缂栧彿",
- prop: "sampleCode",
- },
- {
- label: "鏍峰搧鍚嶇О",
- prop: "sampleName",
- },
- {
- label: "鏍峰搧鏁伴噺",
- prop: "num",
- },
- {
- label: "鏉ユ牱鍗曚綅",
- prop: "sampleSupplier",
- },
- {
- label: "鐣欐牱鏃ユ湡",
- prop: "leaveDate",
- },
- {
- label: "鏍峰搧鐘舵��",
- prop: "sampleState",
- },
- {
- label: "閫�鏍风鏀�/澶勭悊鏃ユ湡",
- prop: "dealTime",
- },
- {
- dataType: "slot",
- slot: "action",
- label: "鎿嶄綔",
- }
+ tabIndex: 0,
+ tabList: [
+ { label: '寰呮帴鏀�', value: 0 },
+ { label: '宸叉彁浜�', value: 1 },
+ { label: '宸叉嫆鏀�', value: 2 },
+ { label: '宸插彇娑�', value: 3 },
+ { label: '鍏ㄩ儴', value: null },
],
- page0: {
+ queryParams: {
+ entrustCode: '',
+ sampleCode: '',
+ sampleName: '',
+ },
+ tableLoading: false,
+ upIndex: 0,
+ tableData: [],
+ page: {
total: 0,
size: 10,
- current: 0,
+ current: 1,
},
+ column: [
+ { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
+ { label: '鏍峰搧缂栧彿', prop: 'sampleCode' },
+ { label: '妫�娴嬮」鐩�', prop: 'inspectionItem', dataType: 'slot', slot: 'inspectionItem', width: '220px' },
+ { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
+ { label: '鏂规硶鏍囧噯', prop: 'methodStandard' },
+ { label: '涓绘浜虹瀛�', prop: 'mainInspectorName' },
+ { label: '澶囨敞', prop: 'remark', dataType: 'slot', slot: 'remark', width: '180px' },
+ { label: '鎿嶄綔', dataType: 'slot', slot: 'action', width: '120px' },
+ ],
+ personList: [],
+ editDialogVisible: false,
+ rejectDialogVisible: false,
+ isEdit: true,
+ currentInfo: {},
+ rejectInfo: {},
+ submitLoading: false,
+ rejectLoading: false,
};
},
mounted() {
- this.getList0()
+ this.getPersonList();
+ this.getList();
},
methods: {
- // 鑾峰彇閫佹牱鍗曚綅鍒楄〃
- getCustomPageList() {
- selectCustomPageList({
- current: -1,
- size: -1
- }).then(res => {
- this.customPageList = res.data.records
+ getPersonList() {
+ selectUserCondition({ type: 1 }).then(res => {
+ this.personList = (res.data || []).map(a => ({ label: a.name, value: a.id }));
}).catch(err => { });
+ },
+ handleTab(i) {
+ this.tabIndex = i;
+ this.refreshTable();
},
refresh() {
- this.queryParams0 = {};
- this.page0.current = 1;
- this.getList0();
+ this.queryParams = { entrustCode: '', sampleCode: '', sampleName: '' };
+ this.page.current = 1;
+ this.getList();
},
refreshTable() {
- this.page0.current = 1;
- this.getList0();
+ this.page.current = 1;
+ this.getList();
},
- // 鏌ヨ琛ㄦ牸鏁版嵁
- getList0() {
- this.tableLoading0 = true;
- let param = { ...this.queryParams0, ...this.page0 };
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ let status = this.tabList[this.tabIndex].value;
+ if (status !== null && status !== undefined) {
+ param.status = status;
+ }
delete param.total;
- pageProcessSample({ ...param })
- .then((res) => {
- this.tableLoading0 = false;
- if (res.code === 200) {
- this.tableData0 = res.data.records;
- this.page0.total = res.data.total;
- }
- })
- .catch((err) => {
- this.tableLoading0 = false;
+ pageSampleReceipt(param).then(res => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ this.upIndex++;
+ }
+ }).catch(err => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ handleEdit(row) {
+ this.isEdit = true;
+ this.currentInfo = { ...row, mainInspectorId: row.mainInspectorId || null };
+ this.editDialogVisible = true;
+ },
+ handleView(row) {
+ this.isEdit = false;
+ this.currentInfo = { ...row, mainInspectorId: row.mainInspectorId || null };
+ this.editDialogVisible = true;
+ },
+ handleSubmit() {
+ if (!this.currentInfo.mainInspectorId) {
+ this.$message.error('璇烽�夋嫨涓绘楠屼汉');
+ return;
+ }
+ this.$confirm('纭灏嗚鏍峰搧鎻愪氦鑷虫楠屼换鍔★紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ this.submitLoading = true;
+ submitSampleReceipt({
+ receiptId: this.currentInfo.receiptId,
+ mainInspectorId: this.currentInfo.mainInspectorId,
+ }).then(res => {
+ this.submitLoading = false;
+ this.editDialogVisible = false;
+ this.$message.success('鎻愪氦鎴愬姛');
+ this.refreshTable();
+ }).catch(err => {
+ this.submitLoading = false;
});
+ }).catch(() => { });
},
- pagination0({ page, limit }) {
- this.page0.current = page;
- this.page0.size = limit;
- this.getList0();
+ openReject() {
+ this.rejectInfo = { remark: '' };
+ this.rejectDialogVisible = true;
},
- // 鎵撳紑缂栬緫寮规
- handleAdd(row) {
- this.addInfo = this.HaveJson(row)
- this.title = '缂栬緫'
- this.addDialogVisible = true
- this.getCustomPageList()
- },
- delRow(row) {
- this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- delProcessSample({ id: row.id }).then(res => {
- if (res.code == 200) {
- this.$message.success("鍒犻櫎鎴愬姛");
- this.refreshTable();
- }
- }).catch(err => { });
- })
- .catch(() => { });
- },
- // 鎻愪氦鏂板
- submitAdd() {
- // 缂栬緫
- this.addLoading = true
- addProcessSample({
- ...this.addInfo
- }).then(res => {
- this.addLoading = false
- this.addDialogVisible = false
- this.$message({
- type: 'success',
- message: '缂栬緫鎴愬姛!'
+ handleReject() {
+ if (!this.rejectInfo.remark || !this.rejectInfo.remark.trim()) {
+ this.$message.error('璇峰~鍐欐嫆鏀跺娉�');
+ return;
+ }
+ this.$confirm('鎷掓敹鍚庡鎵樺皢浣滃簾涓斾笉鑳借繘鍏ユ楠屼换鍔★紝鏄惁缁х画锛�', '璀﹀憡', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ this.rejectLoading = true;
+ rejectSampleReceipt({
+ receiptId: this.currentInfo.receiptId,
+ remark: this.rejectInfo.remark,
+ }).then(res => {
+ this.rejectLoading = false;
+ this.rejectDialogVisible = false;
+ this.editDialogVisible = false;
+ this.$message.success('鎷掓敹鎴愬姛');
+ this.refreshTable();
+ }).catch(err => {
+ this.rejectLoading = false;
});
- this.page0.current = 1;
- this.refreshTable();
- }).catch(err => { });
+ }).catch(() => { });
},
- // 瀵煎嚭璇︽儏
- handleDown0() {
- exportProcessSample({ receiveDate: this.queryParams0.receiveDate }).then(res => {
- this.outLoading = false
- const blob = new Blob([res], { type: 'application/msword' });
- this.$download.saveAs(blob, '鏍峰搧鎺ユ敹' + '.docx');
- })
+ handleExport() {
+ let param = { ...this.queryParams };
+ let status = this.tabList[this.tabIndex].value;
+ if (status !== null && status !== undefined) {
+ param.status = status;
+ }
+ exportSampleReceipt(param).then(res => {
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '鏍峰搧鎺ユ敹瀵煎嚭.xlsx');
+ }).catch(err => {
+ console.log('err---', err);
+ });
},
},
}
</script>
<style scoped>
-.search_thing {
- width: 350px;
+.table-tab {
display: flex;
+ justify-content: space-between;
align-items: center;
}
-.search_label {
- width: 110px;
+.tab {
+ list-style-type: none;
+ display: flex;
+ margin-bottom: 12px;
+ margin-top: 0;
+ padding-left: 0;
+}
+
+.tab li {
+ line-height: 24px;
+ padding: 6px 14px;
font-size: 14px;
- text-align: right;
+ color: #333333;
+ border: 1px solid #EEEEEE;
+ cursor: pointer;
}
-.search_input {
- width: calc(100% - 110px);
+.tab li:nth-child(1) {
+ border-radius: 8px 0 0 8px;
}
-.downPdf {
- opacity: 0 !important;
+.tab li:nth-child(5) {
+ border-radius: 0 8px 8px 0;
}
-.tables td {
- height: 40px;
- width: 100px;
- text-align: center;
- font-size: 14px;
- word-wrap: break-word;
- white-space: normal;
-}
-
-.user-info .el-button {
- margin: 0;
-}
-
->>>.el-tabs__content {
- height: 100%;
+.tab li.active {
+ border-color: #3A7BFA;
+ color: #3A7BFA;
}
</style>
--
Gitblit v1.9.3