From 8d24d963f8b82163685c34b816998a904f08234d Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 13:39:35 +0800
Subject: [PATCH] feat: 新聚-下单到检验
---
src/views/business/inspectionTask/components/InspectionWord.vue | 42 +++
src/api/cnas/process/method/standardMethod.js | 22 ++
src/views/standard/standardLibrary/index.vue | 28 -
vue.config.js | 2
src/views/business/productOrder/components/addOrder.vue | 41 ++-
src/utils/standardTree.js | 17 +
package.json | 4
src/views/CNAS/process/method/standardMethod/index.vue | 125 +++++++----
src/views/business/productOrder/components/addView.vue | 58 +++++
src/views/business/inspectionView/index.vue | 228 ++++++++++++++++----
src/workers/InspectionWorker.worker.js | 18 +
src/views/business/inspectionTask/inspection.vue | 49 +++
12 files changed, 491 insertions(+), 143 deletions(-)
diff --git a/package.json b/package.json
index 7e70330..a41a0b1 100644
--- a/package.json
+++ b/package.json
@@ -48,14 +48,16 @@
"echarts": "5.4.0",
"element-resize-detector": "^1.2.4",
"element-ui": "2.15.14",
+ "fast-png": "^5.0.0",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"html2canvas": "^1.4.1",
+ "iobuffer": "^5.0.0",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
- "jspdf": "^3.0.0",
+ "jspdf": "^2.5.0",
"mammoth": "^1.9.0",
"moment": "^2.30.1",
"nprogress": "0.2.0",
diff --git a/src/api/cnas/process/method/standardMethod.js b/src/api/cnas/process/method/standardMethod.js
index 46bd97e..6be65ef 100644
--- a/src/api/cnas/process/method/standardMethod.js
+++ b/src/api/cnas/process/method/standardMethod.js
@@ -46,3 +46,25 @@
});
}
+export function selectIndustryOptions() {
+ return request({ url: '/standardMethod/selectIndustryOptions', method: 'get' })
+}
+
+export function selectAttachments(query) {
+ return request({ url: '/standardMethod/selectAttachments', method: 'get', params: query })
+}
+
+export function uploadAttachment(data, standardMethodId) {
+ return request({
+ url: '/standardMethod/uploadAttachment',
+ method: 'post',
+ params: { standardMethodId },
+ data,
+ headers: { 'Content-Type': 'multipart/form-data' }
+ })
+}
+
+export function deleteAttachment(query) {
+ return request({ url: '/standardMethod/deleteAttachment', method: 'delete', params: query })
+}
+
diff --git a/src/utils/standardTree.js b/src/utils/standardTree.js
index c69f81e..9f96784 100644
--- a/src/utils/standardTree.js
+++ b/src/utils/standardTree.js
@@ -36,7 +36,10 @@
let cur = node;
while (cur && cur.parent) {
if (isLeaf(cur.data)) {
- tokens.push(cur.label, leafMarker);
+ const leafValue = cur.data && cur.data.standardMethodId
+ ? (cur.data.value || cur.label)
+ : cur.label;
+ tokens.push(leafValue, leafMarker);
} else {
tokens.push(cur.label);
}
@@ -75,6 +78,14 @@
// 鍘绘帀璺緞鏈锛岀敤浜庛�屽綋鍓嶆槸鍙跺瓙浣嗘煡涓嶅埌鏍囧噯銆嶆椂鍥為��鍒扮埗绾ф煡璇�
export function dropLastLabel(path) {
if (!path) return '';
- const idx = path.lastIndexOf(' - ');
- return idx === -1 ? '' : path.slice(0, idx);
+ const tokens = path.split(' - ');
+ if (tokens.length <= 1) return '';
+ // 鍙跺瓙璺緞鏍煎紡涓衡�滆涓� - null - 鏍囧噯鈥濇垨鈥滆涓� - - 鏍囧噯鈥濄��
+ // 鍘绘帀鏍囧噯鍚嶅悗杩樿鍘绘帀浠呯敤浜庢爣璇嗗彾瀛愮殑鍗犱綅娈碉紝鐖惰矾寰勬墠鏄湡瀹炵殑琛屼笟璺緞銆�
+ tokens.pop();
+ const marker = tokens[tokens.length - 1];
+ if (marker === '' || marker === 'null') {
+ tokens.pop();
+ }
+ return tokens.join(' - ');
}
diff --git a/src/views/CNAS/process/method/standardMethod/index.vue b/src/views/CNAS/process/method/standardMethod/index.vue
index 80cfd50..7998cbb 100644
--- a/src/views/CNAS/process/method/standardMethod/index.vue
+++ b/src/views/CNAS/process/method/standardMethod/index.vue
@@ -34,16 +34,14 @@
<!-- 鏂板/缂栬緫 -->
<el-dialog :title="title" :visible.sync="addDlog" width="500px">
<el-form :model="addForm" ref="addForm" :rules="addRules" label-position="right" label-width="120px">
- <el-form-item label="棰嗗煙" prop="field">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.field"></el-input>
+ <el-form-item label="琛屼笟" prop="industryIds">
+ <el-select v-model="addForm.industryIds" multiple filterable clearable collapse-tags placeholder="璇烽�夋嫨琛屼笟" style="width: 100%">
+ <el-option v-for="item in industryOptions" :key="item.id" :label="item.laboratoryName" :value="item.id" />
+ </el-select>
</el-form-item>
<el-form-item label="鏍囧噯缂栧彿" prop="code">
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.code">
</el-input>
- </el-form-item>
- <el-form-item label="妫�楠屽璞�" prop="structureTestObjectId">
- <el-cascader size="small" :options="tandardTree" v-model="addForm.structureTestObjectId" collapse-tags
- :props="{ multiple: true, checkStrictly: true }" clearable style="width: 100%"></el-cascader>
</el-form-item>
<el-form-item label="鏍囧噯鎻忚堪" prop="name">
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.name">
@@ -75,28 +73,48 @@
<el-option label="鏄�" :value="1"> </el-option>
</el-select>
</el-form-item>
+ <el-form-item v-if="title === '鏂板'" label="闄勪欢">
+ <el-upload ref="addUpload" action="#" :auto-upload="false" multiple :file-list="pendingFiles"
+ :on-change="pendingFileChange" :on-remove="pendingFileRemove" :before-upload="beforeFileUpload"
+ accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar">
+ <el-button size="small" type="primary">閫夋嫨闄勪欢</el-button><div slot="tip" class="el-upload__tip">鏀寔澶氫釜闄勪欢锛屽崟涓笉瓒呰繃10MB</div>
+ </el-upload>
+ </el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDlog = false">鍙� 娑�</el-button>
<el-button :loading="addLoading" type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
</span>
</el-dialog>
+ <el-dialog title="鏍囧噯闄勪欢" :visible.sync="attachmentDialog" width="760px">
+ <el-upload v-if="currentMethod.id" :action="attachmentAction" :headers="uploadHeader" multiple :show-file-list="false"
+ :before-upload="beforeFileUpload" :on-success="attachmentUploadSuccess"
+ accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar">
+ <el-button size="small" type="primary">涓婁紶闄勪欢</el-button>
+ </el-upload>
+ <el-table :data="attachmentList" border size="small" style="margin-top:12px">
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" min-width="280" />
+ <el-table-column label="涓婁紶鏃堕棿" prop="createTime" width="170" />
+ <el-table-column label="鎿嶄綔" width="180"><template slot-scope="scope"><el-button type="text" @click="previewAttachment(scope.row)">棰勮</el-button><el-button type="text" @click="downloadAttachment(scope.row)">涓嬭浇</el-button><el-button type="text" style="color:#f56c6c" @click="removeAttachment(scope.row)">鍒犻櫎</el-button></template></el-table-column>
+ </el-table>
+ </el-dialog>
+ <el-dialog title="棰勮闄勪欢" :visible.sync="previewDialog" fullscreen><file-preview v-if="previewDialog" :current-file="currentAttachment" :file-url="previewUrl" /></el-dialog>
</div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
import {
selectStandardMethodList,
- getStandardTree2,
delStandardMethod,
addStandardMethod,
- upStandardMethod,
+ upStandardMethod, selectIndustryOptions, selectAttachments, uploadAttachment, deleteAttachment,
} from "@/api/cnas/process/method/standardMethod";
export default {
name: 'StandardMethod',
components: {
- limsTable,
+ limsTable, filePreview,
},
data() {
return {
@@ -106,9 +124,8 @@
queryParams: {},
tableData: [],
column: [
- { label: "棰嗗煙", prop: "field", width: "100px" },
+ { label: "琛屼笟", prop: "industryNames", width: "140px" },
{ label: "鏍囧噯缂栧彿", prop: "code", width: "100px" },
- { label: "妫�楠屽璞�", prop: "structureTestObjectId", width: "140px" },
{ label: "鏍囧噯鎻忚堪", prop: "name", width: "100px" },
{ label: "鏍囧噯鎻忚堪EN", prop: "nameEn", width: "100px" },
{ label: "澶囨敞", prop: "remark" },
@@ -168,6 +185,15 @@
},
},
{
+ name: "涓婁紶闄勪欢", type: "text", clickFun: (row) => this.openAttachments(row),
+ },
+ {
+ name: "涓嬭浇闄勪欢", type: "text", clickFun: (row) => this.downloadAttachments(row),
+ },
+ {
+ name: "棰勮闄勪欢", type: "text", clickFun: (row) => this.previewAttachments(row),
+ },
+ {
name: "鍒犻櫎",
type: "text",
clickFun: (row) => {
@@ -187,7 +213,9 @@
addDlog: false,
addLoading: false,
qualificationList: [],
- tandardTree: [],
+ industryOptions: [],
+ pendingFiles: [], attachmentDialog: false, attachmentList: [], currentMethod: {},
+ previewDialog: false, currentAttachment: {}, previewUrl: '',
addRules: {
code: [{ required: true, message: "璇疯緭鍏ユ爣鍑嗙紪鍙�", trigger: "blur" }],
name: [{ required: true, message: "璇疯緭鍏ユ爣鍑嗘弿杩�", trigger: "blur" }],
@@ -202,7 +230,7 @@
},
mounted() {
this.getQualificationList();
- this.selectTestObjectByName();
+ this.loadIndustryOptions();
this.getList();
},
methods: {
@@ -230,26 +258,25 @@
refreshTable() {
this.page.current = 1;
this.getList();
- this.selectTestObjectByName();
+ this.loadIndustryOptions();
},
refresh() {
- this.selectTestObjectByName();
+ this.loadIndustryOptions();
this.page.current = 1;
this.queryParams = {};
this.getList();
},
openAdd() {
this.title = "鏂板";
- this.addForm = {};
+ this.addForm = { industryIds: [], isProduct: 1, isUse: 1 };
+ this.pendingFiles = [];
this.addDlog = true;
},
openEdit(row) {
this.title = "缂栬緫";
this.addDlog = true;
this.addForm = this.HaveJson(row)
- this.addForm.structureTestObjectId = JSON.parse(
- this.addForm.structureTestObjectId
- );
+ this.addForm.industryIds = this.addForm.industryIds || [];
},
getQualificationList() {
this.getDicts("cnas_method_qualification").then((response) => {
@@ -262,40 +289,24 @@
this.qualificationList = arr;
});
},
- selectTestObjectByName() {
- getStandardTree2().then((res) => {
- res.data.forEach((a) => {
- this.cascaderFieldData(a);
- });
- this.tandardTree = res.data;
- });
- },
- cascaderFieldData(val) {
- if (val.children === undefined) {
- return;
- } else if (val.children.length == 0) {
- delete val.children;
- } else {
- val.children.forEach((a) => {
- this.cascaderFieldData(a);
- });
- }
- },
+ loadIndustryOptions() { selectIndustryOptions().then(res => { this.industryOptions = res.data || []; }); },
submitProduct(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.addLoading = true;
let addForm = JSON.parse(JSON.stringify(this.addForm));
- addForm.structureTestObjectId = JSON.stringify(
- addForm.structureTestObjectId
- );
if (this.title == "鏂板") {
addStandardMethod(addForm)
.then((res) => {
+ const id = res.data;
+ if (!id) throw new Error('鏂板鏍囧噯鏈繑鍥炰富閿甀D');
+ return Promise.all(this.pendingFiles.map(item => {
+ const formData = new FormData();
+ formData.append('file', item.raw);
+ return uploadAttachment(formData, id);
+ }));
+ }).then(() => {
this.addLoading = false;
- if (res.code != 200) {
- return;
- }
this.$message.success("鎻愪氦鎴愬姛");
this.getList();
this.addDlog = false;
@@ -323,6 +334,31 @@
}
});
},
+ beforeFileUpload(file) { if (file.size > 10 * 1024 * 1024) { this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10MB'); return false; } return true; },
+ pendingFileChange(file, files) { this.pendingFiles = files; },
+ pendingFileRemove(file, files) { this.pendingFiles = files; },
+ openAttachments(row) { this.currentMethod = row; this.attachmentDialog = true; this.loadAttachments(); },
+ downloadAttachments(row) {
+ selectAttachments({ standardMethodId: row.id }).then(res => {
+ const attachments = res.data || [];
+ if (!attachments.length) this.$message.warning('鏆傛棤闄勪欢');
+ else if (attachments.length === 1) this.downloadAttachment(attachments[0]);
+ else this.openAttachments(row);
+ });
+ },
+ previewAttachments(row) {
+ selectAttachments({ standardMethodId: row.id }).then(res => {
+ const attachments = res.data || [];
+ if (!attachments.length) this.$message.warning('鏆傛棤闄勪欢');
+ else if (attachments.length === 1) this.previewAttachment(attachments[0]);
+ else this.openAttachments(row);
+ });
+ },
+ loadAttachments() { selectAttachments({ standardMethodId: this.currentMethod.id }).then(res => { this.attachmentList = res.data || []; }); },
+ attachmentUploadSuccess(res) { if (res.code === 200) { this.$message.success('涓婁紶鎴愬姛'); this.loadAttachments(); } },
+ downloadAttachment(row) { this.$download.saveAs(row.fileUrl, row.fileName); },
+ previewAttachment(row) { this.currentAttachment = row; this.previewUrl = /\.(jpg|jpeg|png|gif)$/i.test(row.fileUrl) ? this.javaApi + '/img/' + row.fileUrl : this.javaApi + '/word/' + row.fileUrl; this.previewDialog = true; },
+ removeAttachment(row) { this.$confirm('鏄惁鍒犻櫎璇ラ檮浠讹紵', '鎻愮ず', { type: 'warning' }).then(() => deleteAttachment({ id: row.id })).then(() => this.loadAttachments()); },
// 鍒犻櫎
handleDelete(row) {
this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
@@ -339,5 +375,6 @@
.catch(() => { });
},
},
+ computed: { attachmentAction() { return this.javaApi + '/standardMethod/uploadAttachment?standardMethodId=' + this.currentMethod.id; } },
};
</script>
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 666c720..19b5037 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -57,6 +57,16 @@
</el-select>
</el-form-item>
</el-form>
+ <el-form :inline="true" :model="currentOtherForm" class="form-inline template-panel__conclusion--divided"
+ size="small" label-width="84px">
+ <el-form-item label="妫�楠岀粨璁�:">
+ <el-radio-group v-model="currentOtherForm.insResult" :disabled="state != 2"
+ @change="m => subOtherForm(m, 'insResult')">
+ <el-radio :label="1">鍚堟牸</el-radio>
+ <el-radio :label="0">涓嶅悎鏍�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-form>
</div>
<!-- 甯歌妫�楠屽師濮嬭褰� -->
<div id="tableBox" v-loading="tableLoading" class="center-box">
@@ -458,7 +468,8 @@
humidity: null,
detectionTime: null,
detectionPlace: null,
- deviceIds: []
+ deviceIds: [],
+ insResult: null
}
}
},
@@ -504,7 +515,8 @@
humidity: item.humidity != null ? item.humidity : null,
detectionTime: item.detectionTime != null ? item.detectionTime : null,
detectionPlace: item.detectionPlace != null ? item.detectionPlace : null,
- deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : []
+ deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [],
+ insResult: item.insResult != null ? item.insResult : null
})
})
if (this.typeSource == '1') {
@@ -1347,8 +1359,9 @@
},
// 鏂拌仛鐩存帴缁戝畾妯℃澘鐨勫崟鎹紝璁惧鎸夋ā鏉块�夋嫨
isDirectTemplateOrder() {
- return this.sonLaboratory === '鏂拌仛' && this.currentSample &&
- (this.currentSample.insProduct || []).some(product => product.templateRowIndex != null)
+ return this.sonLaboratory === '鏂拌仛' &&
+ Array.isArray(this.insOrder.templateConditions) &&
+ this.insOrder.templateConditions.length > 0
},
loadDeviceOptions() {
search({ status: 0 }).then(res => {
@@ -1369,13 +1382,24 @@
upInsReview(e) {
if (e == 1) {
// 閫氳繃
+ const insResults = this.tableLists.map(
+ item => (this.otherForm[item.templateId] || {}).insResult
+ )
+ const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1)
+ if (this.isDirectTemplateOrder() && missingIndex > -1) {
+ this.$message.error(`璇烽�夋嫨銆�${this.tableLists[missingIndex].templateName}銆嶇殑妫�楠岀粨璁篳)
+ return
+ }
this.reviewLoading = true;
verifyPlan({
orderId: this.orderId,
type: 1,
laboratory: this.sonLaboratory,
tell: null,
- userId: this.checkUser
+ userId: this.checkUser,
+ insResult: this.isDirectTemplateOrder()
+ ? (insResults.every(result => result === 1) ? 1 : 0)
+ : this.insOrder.insResult
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -1423,7 +1447,8 @@
humidity: null,
detectionTime: null,
detectionPlace: null,
- deviceIds: []
+ deviceIds: [],
+ insResult: null
})
}
},
@@ -1817,6 +1842,11 @@
color: #606266;
}
+.template-panel__conclusion--divided {
+ border-top: 1px dashed #e4e7ed;
+ padding-top: 12px;
+}
+
.center {
width: calc(100% - 40px);
/* max-height: 580px; */
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index eac01ab..342b500 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -91,7 +91,7 @@
</template>
<template v-else>
<el-descriptions-item label="濮旀墭缂栧彿">{{ insOrder.entrustCode }}</el-descriptions-item>
- <el-descriptions-item label="妫�娴嬩緷鎹�">{{ insOrder.sample || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="妫�娴嬩緷鎹�">{{ standardDisplayName(insOrder.sample) }}</el-descriptions-item>
<el-descriptions-item label="鏍峰搧鍚嶇О">{{ insOrder.sampleView || '-' }}</el-descriptions-item>
<el-descriptions-item label="鏍峰搧缂栧彿">{{ currentSample.sampleCode }}</el-descriptions-item>
<el-descriptions-item label="鏍峰搧鏁伴噺">{{ insOrder.testQuantity }}</el-descriptions-item>
@@ -968,6 +968,11 @@
this.stopWorker();
},
methods: {
+ standardDisplayName(value) {
+ if (!value) return '-';
+ const separatorIndex = value.indexOf(' - ');
+ return separatorIndex > -1 ? value.slice(0, separatorIndex) : value;
+ },
validateQuality(){
let inboundLength = Number(this.calcInbondLength(this.ifsMaterialPropsForm.startMeterMark,this.ifsMaterialPropsForm.endMeterMark));
let testQuantity = Number(this.insOrder.testQuantity);
@@ -1683,9 +1688,17 @@
payload[type] = Number(m);
}
}
- write(payload).then((res) => {
- this.$message.success("淇濆瓨鎴愬姛");
- });
+ const previousSave = this.saveQueue || Promise.resolve();
+ this.saveQueue = previousSave
+ .catch(() => undefined)
+ .then(() => write(payload))
+ .then(() => {
+ this.$message.success("淇濆瓨鎴愬姛");
+ })
+ .catch((error) => {
+ console.error("妫�楠屾潯浠朵繚瀛樺け璐�", error);
+ this.$message.error("妫�楠屾潯浠朵繚瀛樺け璐ワ紝璇烽噸璇�");
+ });
},
exportTable(tableId) {
// 鑾峰彇table鍏冪礌
@@ -2197,6 +2210,11 @@
},
// 瀵硅緭鍏ュ�艰繘琛屾牸寮忔牎楠�
handleInput(n) {
+ // 鐩寸粦妯℃澘鏈厤缃楠屽�肩被鍨嬫椂鎸夎嚜鐢辨枃鏈鐞嗭紝鍏佽褰曞叆澶栬绛変腑鏂囩粨鏋溿��
+ const inspectionValueType = this.getInspectionValueType(n.i);
+ if (inspectionValueType === undefined || inspectionValueType === null) {
+ return;
+ }
try {
const v = n.v.v;
// 鑳藉姏鑼冨洿宸插簾寮�,妫�楠屽�肩被鍨嬩笉鍐嶄綔涓哄垽鏂緷鎹�傛暣涓插彧鐢辩畻寮忓瓧绗︾粍鎴愭椂鎵嶈鑼冨寲鏍煎紡,
@@ -2362,6 +2380,24 @@
return;
}
await this.waitForPendingSaves();
+ try {
+ await Promise.all(this.tableLists.map((template) => {
+ const form = this.otherForm[template.templateId] || {};
+ return write({
+ id: this.insOrder.id,
+ templateId: template.templateId,
+ temperature: form.temperature == null ? null : form.temperature,
+ humidity: form.humidity == null ? null : form.humidity,
+ detectionTime: form.detectionTime || null,
+ detectionPlace: form.detectionPlace || null,
+ deviceIds: Array.isArray(form.deviceIds) ? [...form.deviceIds] : [],
+ });
+ }));
+ } catch (error) {
+ console.error("妫�楠屾潯浠朵繚瀛樺け璐�", error);
+ this.$message.error("妫�楠屾潯浠朵繚瀛樺け璐ワ紝璇烽噸璇�");
+ return;
+ }
this.submitLoading = true;
checkSubmitPlan({
orderId: this.orderId,
@@ -2578,8 +2614,9 @@
this.saveInsContext();
},
isDirectTemplateOrder() {
- return this.sonLaboratory === "鏂拌仛" && this.currentSample &&
- (this.currentSample.insProduct || []).some((product) => product.templateRowIndex != null);
+ return this.sonLaboratory === "鏂拌仛" &&
+ Array.isArray(this.insOrder.templateConditions) &&
+ this.insOrder.templateConditions.length > 0;
},
loadDeviceOptions() {
search({ status: 0 }).then((devices) => {
diff --git a/src/views/business/inspectionView/index.vue b/src/views/business/inspectionView/index.vue
index 7346997..eec9fe9 100644
--- a/src/views/business/inspectionView/index.vue
+++ b/src/views/business/inspectionView/index.vue
@@ -1,22 +1,7 @@
<template>
<div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);">
<el-row class="title">
- <el-col :span="8" style="text-align: left">
- <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px"
- style="text-align: right; padding-top: 0; display: inline">
- <el-form-item label="娓╁害:" style="margin-bottom: 0">
- <el-input v-model="otherForm.temperature" :disabled="state > 1" placeholder="" size="small"
- style="width: 90px; line-height: 60px" @change="(m) => subOtherForm(m, 'temperature')"></el-input>
- <span style="margin-left: 4px">鈩�</span>
- </el-form-item>
- <el-form-item label="婀垮害:" style="margin-bottom: 0">
- <el-input v-model="otherForm.humidity" :disabled="state > 1" placeholder="" size="small"
- style="width: 90px; line-height: 60px" @change="(m) => subOtherForm(m, 'humidity')"></el-input>
- <span style="margin-left: 4px">%</span>
- </el-form-item>
- </el-form>
- </el-col>
- <el-col :span="16" style="text-align: right">
+ <el-col :span="24" style="text-align: right">
<el-button size="small" type="primary" @click="refreshView">鍒锋柊</el-button>
<el-button v-if="typeSource == 1" size="small" type="primary" @click="openPurchase">杩涜揣楠岃瘉</el-button>
<el-button v-if="state == 1 && typeSource == 1" size="small" type="primary"
@@ -73,12 +58,6 @@
<el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="璇疯緭鍏�" size="small"
@blur="subOtherForm(insOrder.remark, 'remark')"></el-input>
<!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> -->
- </el-form-item>
- <el-form-item label="妫�楠岀粨璁�:">
- <el-radio-group v-model="reviewInsResult" :disabled="state != 2">
- <el-radio :label="1">鍚堟牸</el-radio>
- <el-radio :label="0">涓嶅悎鏍�</el-radio>
- </el-radio-group>
</el-form-item>
</el-form>
</div>
@@ -150,6 +129,51 @@
@click="dataAcquisitionEidtAble = !dataAcquisitionEidtAble">{{ dataAcquisitionEidtAble ? "鍏抽棴缂栬緫" : "缂栬緫鏁伴噰"
}}</el-button>
</div>
+ </div>
+ <!-- 褰撳墠妫�楠屾ā鏉跨殑妫�娴嬫潯浠朵笌妫�楠岀粨璁� -->
+ <div class="template-panel">
+ <el-form v-if="showTemplateConditions" :inline="true" :model="currentOtherForm" class="form-inline"
+ size="small" label-width="84px">
+ <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="娓╁害:">
+ <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" size="small"
+ style="width: 90px" @change="m => subOtherForm(m, 'temperature')" />
+ <span class="template-panel__unit">鈩�</span>
+ </el-form-item>
+ <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="婀垮害:">
+ <el-input v-model="currentOtherForm.humidity" :disabled="state > 1" size="small"
+ style="width: 90px" @change="m => subOtherForm(m, 'humidity')" />
+ <span class="template-panel__unit">%RH</span>
+ </el-form-item>
+ <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="妫�娴嬫椂闂�:">
+ <el-date-picker v-model="currentOtherForm.detectionTime" :disabled="state > 1" type="date"
+ value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨鏃ユ湡" size="small" style="width: 160px"
+ @change="m => subOtherForm(m, 'detectionTime')" />
+ </el-form-item>
+ <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="妫�娴嬪湴鐐�:">
+ <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable
+ placeholder="璇疯緭鍏ユ娴嬪湴鐐�" size="small" style="width: 200px"
+ @change="m => subOtherForm(m, 'detectionPlace')" />
+ </el-form-item>
+ <el-form-item v-if="isDirectTemplateOrder()" label="璁惧:">
+ <el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable
+ placeholder="璇烽�夋嫨璁惧" size="small" style="width: 360px"
+ @change="m => subOtherForm(m, 'deviceIds')">
+ <el-option v-for="device in orderDeviceOptions" :key="device.id" :label="device.label"
+ :value="device.id" />
+ </el-select>
+ </el-form-item>
+ </el-form>
+ <el-form :inline="true" :model="currentOtherForm"
+ :class="['form-inline', { 'template-panel__conclusion--divided': showTemplateConditions }]"
+ size="small" label-width="84px">
+ <el-form-item label="妫�楠岀粨璁�:">
+ <el-radio-group v-model="currentOtherForm.insResult" :disabled="state != 2"
+ @change="m => subOtherForm(m, 'insResult')">
+ <el-radio :label="1">鍚堟牸</el-radio>
+ <el-radio :label="0">涓嶅悎鏍�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-form>
</div>
<!-- 甯歌妫�楠屽師濮嬭褰� -->
<div id="nav" v-loading="tableLoading" class="center-box">
@@ -551,6 +575,7 @@
comparisonList: [],
excelMethodList: [],
equipOptions: [],
+ orderDeviceOptions: [],
reviewLoading: false,
reviewDia: false,
noReason: "",
@@ -571,10 +596,8 @@
inspectionItem: 1,
inspectionItemSubclass: "20(甯告俯)",
},
- otherForm: {
- humidity: null,
- temperature: null,
- },
+ // 妫�娴嬫潯浠朵笌妫�楠岀粨璁烘寜妯℃澘 ID 鍒嗙粍
+ otherForm: {},
equipForm: {
value0: null,
code0: null,
@@ -724,8 +747,22 @@
action() {
return this.javaApi + "/insOrderPlan/uploadFile";
},
+ currentOtherForm() {
+ return this.otherForm[this.currentTable] || {
+ temperature: null,
+ humidity: null,
+ detectionTime: null,
+ detectionPlace: null,
+ deviceIds: [],
+ insResult: null,
+ };
+ },
+ showTemplateConditions() {
+ return this.insOrder.ifsOrderType !== "02wg" || this.isDirectTemplateOrder();
+ },
},
created() {
+ this.saveQueue = Promise.resolve();
let { sonLaboratory, orderId, state, inspectorList, typeSource } =
this.$route.query;
this.sonLaboratory = sonLaboratory;
@@ -898,18 +935,26 @@
this.sampleProduct = res.data.sampleProduct;
this.currentSample = this.HaveJson(this.sampleProduct[0]);
let insProduct = this.HaveJson(this.currentSample.insProduct);
- // 娓╁害銆佹箍搴﹁祴鍊�
- this.otherForm = {
- temperature: this.insOrder.temperature
- ? this.insOrder.temperature
- : null,
- humidity: this.insOrder.humidity ? this.insOrder.humidity : null,
- };
+ // 鎸夋ā鏉垮洖鏄炬娴嬫潯浠朵笌妫�楠岀粨璁�
+ this.otherForm = {};
+ (this.insOrder.templateConditions || []).forEach((item) => {
+ this.$set(this.otherForm, item.templateId, {
+ temperature: item.temperature != null ? item.temperature : null,
+ humidity: item.humidity != null ? item.humidity : null,
+ detectionTime: item.detectionTime != null ? item.detectionTime : null,
+ detectionPlace: item.detectionPlace != null ? item.detectionPlace : null,
+ deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [],
+ insResult: item.insResult != null ? item.insResult : null,
+ });
+ });
if (this.typeSource == "1") {
this.getRawMaterialTag(this.currentSample.id); // 鍘熸潗鏂欑殑妫�楠屼换鍔℃煡璇㈡壒鏁�
this.rawMaterialTag = "1";
}
this.getEquipOptions(1);
+ if (this.sonLaboratory === "鏂拌仛") {
+ this.loadDeviceOptions();
+ }
// 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
let list = await this.getCurrentProduct(this.currentSample.id, 0);
this.currentSample.insProduct = this.HaveJson(list);
@@ -920,6 +965,7 @@
this.currentSample["index"] = 1;
let bushing = this.currentSample.bushing;
this.getTableLists(); //澶勭悊妯℃澘鍒楄〃淇℃伅
+ this.tableLists.forEach((item) => this.ensureOtherForm(item.templateId));
this.currentKey = 1;
this.getCableTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎澶氭妫�楠岀殑鐢电紗閰嶇疆
@@ -1406,12 +1452,33 @@
this.worker0 = null;
}
},
- // 淇濆瓨婀垮害銆佹俯搴︽暟鎹�
+ ensureOtherForm(templateId) {
+ if (templateId == null || this.otherForm[templateId]) return;
+ this.$set(this.otherForm, templateId, {
+ temperature: null,
+ humidity: null,
+ detectionTime: null,
+ detectionPlace: null,
+ deviceIds: [],
+ insResult: null,
+ });
+ },
+ // 淇濆瓨褰撳墠妯℃澘鐨勬娴嬫潯浠讹紱澶囨敞浠嶇劧鏄鍗曠骇瀛楁
subOtherForm(m, type) {
- write({
- [type]: type === "remark" ? m : Number(m),
- id: this.insOrder.id,
- }).then((res) => {
+ const payload = { id: this.insOrder.id };
+ if (type === "remark") {
+ payload.remark = m;
+ } else {
+ payload.templateId = this.currentTable;
+ if (type === "deviceIds") {
+ payload.deviceIds = Array.isArray(m) ? [...m] : [];
+ } else if (type === "detectionTime" || type === "detectionPlace") {
+ payload[type] = m === "" || m == null ? null : m;
+ } else {
+ payload[type] = Number(m);
+ }
+ }
+ write(payload).then((res) => {
this.$message.success("淇濆瓨鎴愬姛");
});
},
@@ -1922,6 +1989,11 @@
},
// 瀵硅緭鍏ュ�艰繘琛屾牸寮忔牎楠�
handleInput(n) {
+ // 鐩寸粦妯℃澘鏈厤缃楠屽�肩被鍨嬫椂鎸夎嚜鐢辨枃鏈鐞嗭紝鍏佽褰曞叆澶栬绛変腑鏂囩粨鏋溿��
+ const inspectionValueType = this.getInspectionValueType(n.i);
+ if (inspectionValueType === undefined || inspectionValueType === null) {
+ return;
+ }
try {
n.v.v = n.v.v.replace(/[^\d.^e>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/g, "");
n.v.v = n.v.v.replace(/\.{2,}/g, "."); //鍙繚鐣欑涓�涓�. 娓呴櫎澶氫綑鐨�
@@ -1970,7 +2042,18 @@
upInsReview(e) {
if (e == 1) {
// 閫氳繃
- if (this.reviewInsResult !== 0 && this.reviewInsResult !== 1) {
+ let finalInsResult = this.reviewInsResult;
+ if (this.isDirectTemplateOrder()) {
+ const insResults = this.tableLists.map(
+ item => (this.otherForm[item.templateId] || {}).insResult
+ );
+ const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1);
+ if (missingIndex > -1) {
+ this.$message.error(`璇烽�夋嫨銆�${this.tableLists[missingIndex].templateName}銆嶇殑妫�楠岀粨璁篳);
+ return;
+ }
+ finalInsResult = insResults.every(result => result === 1) ? 1 : 0;
+ } else if (finalInsResult !== 0 && finalInsResult !== 1) {
this.$message.error("璇烽�夋嫨妫�楠岀粨璁�");
return;
}
@@ -1981,7 +2064,7 @@
laboratory: this.sonLaboratory,
tell: null,
userId: this.checkUser,
- insResult: this.reviewInsResult,
+ insResult: finalInsResult,
}).then((res) => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛");
@@ -2034,12 +2117,21 @@
this.$message.error("璇锋寚瀹氬鏍镐汉鍛�");
return;
}
- if (!this.otherForm.humidity) {
- this.$message.error("璇疯緭鍏ユ箍搴�");
- return;
- }
- if (!this.otherForm.temperature) {
- this.$message.error("璇疯緭鍏ユ俯搴�");
+ const missing = [];
+ this.tableLists.forEach((item) => {
+ const form = this.otherForm[item.templateId] || {};
+ if (this.insOrder.ifsOrderType !== "02wg") {
+ if (!form.temperature) missing.push(`璇峰~鍐欍��${item.templateName}銆嶇殑娓╁害`);
+ if (!form.humidity) missing.push(`璇峰~鍐欍��${item.templateName}銆嶇殑婀垮害`);
+ if (!form.detectionTime) missing.push(`璇烽�夋嫨銆�${item.templateName}銆嶇殑妫�娴嬫椂闂碻);
+ if (!form.detectionPlace) missing.push(`璇峰~鍐欍��${item.templateName}銆嶇殑妫�娴嬪湴鐐筦);
+ }
+ if (this.isDirectTemplateOrder() && (!form.deviceIds || form.deviceIds.length === 0)) {
+ missing.push(`璇烽�夋嫨銆�${item.templateName}銆嶇殑璁惧`);
+ }
+ });
+ if (missing.length > 0) {
+ this.$message.error(missing[0]);
return;
}
await this.waitForPendingSaves();
@@ -2257,8 +2349,19 @@
this.saveInsContext();
},
isDirectTemplateOrder() {
- return this.sonLaboratory === "鏂拌仛" && this.currentSample &&
- (this.currentSample.insProduct || []).some((product) => product.templateRowIndex != null);
+ return this.sonLaboratory === "鏂拌仛" &&
+ Array.isArray(this.insOrder.templateConditions) &&
+ this.insOrder.templateConditions.length > 0;
+ },
+ loadDeviceOptions() {
+ search({ status: 0 }).then((res) => {
+ this.orderDeviceOptions = (res.data || []).map((device) => ({
+ id: device.id,
+ label: `${device.deviceName}--${device.managementNumber}`,
+ }));
+ }).catch((error) => {
+ console.error(error);
+ });
},
async waitForPendingSaves() {
const targetRevision = this.calculationRevision;
@@ -2448,6 +2551,35 @@
text-align: left;
}
+.template-panel {
+ background-color: #f8f9fb;
+ border: 1px solid #ebeef5;
+ border-radius: 3px;
+ padding: 16px 16px 4px;
+ margin-bottom: 12px;
+ text-align: left;
+}
+
+.template-panel>>>.el-form-item {
+ display: inline-flex;
+ align-items: center;
+ margin-bottom: 12px;
+}
+
+.template-panel>>>.el-form-item__label {
+ flex: none;
+}
+
+.template-panel__unit {
+ margin-left: 4px;
+ color: #606266;
+}
+
+.template-panel__conclusion--divided {
+ border-top: 1px dashed #e4e7ed;
+ padding-top: 12px;
+}
+
.center {
width: 100%;
/* max-height: 580px; */
diff --git a/src/views/business/productOrder/components/addOrder.vue b/src/views/business/productOrder/components/addOrder.vue
index 22f6a4c..d07e55b 100644
--- a/src/views/business/productOrder/components/addOrder.vue
+++ b/src/views/business/productOrder/components/addOrder.vue
@@ -3,14 +3,14 @@
<div v-show="!cableConfigShow&&!auxiliaryShow" class="order-header">
<span class="order-header__title">濮旀墭鍗曚俊鎭�</span>
<div class="order-header__actions">
-<!-- <el-cascader-->
-<!-- v-model="addObj.quarterItemId"-->
-<!-- :disabled="active>1"-->
-<!-- :options="quarterItemOptions"-->
-<!-- placeholder="璇烽�夋嫨瀛e害"-->
-<!-- size="small"-->
-<!-- class="order-header__quarter"-->
-<!-- @focus="getQuarterOnOrderList"></el-cascader>-->
+ <el-cascader
+ v-model="addObj.quarterItemId"
+ :disabled="active>1"
+ :options="quarterItemOptions"
+ placeholder="璇烽�夋嫨瀛e害"
+ size="small"
+ class="order-header__quarter"
+ @focus="getQuarterOnOrderList"></el-cascader>
<el-select v-show="active==1" v-model="template" placeholder="涓嬪崟妯℃澘" size="small"
class="order-header__template"
@change="selectInsOrderTemplateById">
@@ -38,9 +38,9 @@
</div>
<div v-show="!cableConfigShow&&!auxiliaryShow" class="order-body">
<el-card shadow="never" class="order-card">
- <el-form ref="newJuOrder" :model="addObj" size="small" label-width="108px" label-position="right">
+ <el-form ref="newJuOrder" class="newju-order-form" :model="addObj" size="small" label-width="108px" label-position="right">
<el-row :gutter="16">
- <el-col :span="6"><el-form-item label="妫�娴嬩緷鎹�"><el-input v-model="addObj.sample" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" @click="selectStandardTree = true" /></template></el-input></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="妫�娴嬩緷鎹�"><el-input v-model="addObj.sample" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" size="small" @click="selectStandardTree = true" /></template></el-input></el-form-item></el-col>
<el-col :span="18">
<el-form-item label="鍘熷璁板綍妯℃澘">
<div v-loading="templateBindingLoading" class="template-tag-list">
@@ -53,7 +53,7 @@
<el-row :gutter="16">
<el-col :span="6"><el-form-item label="鏍峰搧鍚嶇О"><el-input v-model="addObj.sampleView" :disabled="active>1" size="small" /></el-form-item></el-col>
<el-col :span="6"><el-form-item label="鐢熶骇鍗曚綅"><el-input v-model="addObj.production" :disabled="active>1" size="small" /></el-form-item></el-col>
- <el-col :span="6"><el-form-item label="濮旀墭鍗曚綅"><el-input v-model="addObj.company" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" @click="openCompanyList" /></template></el-input></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="濮旀墭鍗曚綅"><el-input v-model="addObj.company" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" size="small" @click="openCompanyList" /></template></el-input></el-form-item></el-col>
<el-col :span="6"><el-form-item label="妫�楠岀被鍒�"><el-select v-model="addObj.orderType" :disabled="active>1" size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col>
</el-row>
<el-row :gutter="16">
@@ -957,7 +957,7 @@
};
this.addObj.type = String(this.addObj.type)
const samples = this.HaveJson(res.data.sampleProduct)
- this.sampleCode = samples.length ? samples[0].sampleCode || '' : ''
+ this.sampleCode = res.data.sampleCode || (samples.length ? samples[0].sampleCode || '' : '')
this.boundTemplateList = this.sortTemplateList(res.data.templateList)
const loadSamples = this.canSelectProduct
? Promise.all(samples.map(sample => this.loadSelectableProducts(sample)))
@@ -2392,6 +2392,23 @@
flex-wrap: wrap;
gap: 8px;
}
+.newju-order-form >>> .el-form-item {
+ display: flex;
+ margin-right: 0;
+}
+.newju-order-form >>> .el-form-item__label {
+ flex: 0 0 108px;
+}
+.newju-order-form >>> .el-form-item__content {
+ flex: 1;
+ min-width: 0;
+ margin-left: 0 !important;
+}
+.newju-order-form >>> .el-input,
+.newju-order-form >>> .el-select,
+.newju-order-form >>> .el-date-editor {
+ width: 100%;
+}
.empty-template-text {
color: #909399;
}
diff --git a/src/views/business/productOrder/components/addView.vue b/src/views/business/productOrder/components/addView.vue
index fbf92ef..366be7c 100644
--- a/src/views/business/productOrder/components/addView.vue
+++ b/src/views/business/productOrder/components/addView.vue
@@ -39,7 +39,7 @@
<div v-show="!cableConfigShow&&!auxiliaryShow" style="margin-top: 10px">
<div class="search">
<el-descriptions class="order-detail" :column="4" border>
- <el-descriptions-item label="妫�娴嬩緷鎹�">{{ addObj.sample || '-' }}</el-descriptions-item>
+ <el-descriptions-item label="妫�娴嬩緷鎹�">{{ standardDisplayName(addObj.sample) }}</el-descriptions-item>
<el-descriptions-item label="鏍峰搧鍚嶇О">{{ addObj.sampleView || '-' }}</el-descriptions-item>
<el-descriptions-item label="鐢熶骇鍗曚綅">{{ addObj.production || '-' }}</el-descriptions-item>
<el-descriptions-item label="濮旀墭鍗曚綅">{{ addObj.company || '-' }}</el-descriptions-item>
@@ -60,6 +60,38 @@
</el-descriptions-item>
<el-descriptions-item label="澶囨敞" :span="4">{{ addObj.remark || '-' }}</el-descriptions-item>
</el-descriptions>
+ <el-form class="newju-order-form" :model="addObj" label-width="108px" label-position="right">
+ <el-row>
+ <el-col :span="6"><el-form-item label="浜у搧鍚嶇О"><el-input v-model="addObj.sample" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="鐢熶骇鍗曚綅"><el-input v-model="addObj.production" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="濮旀墭鍗曚綅"><el-input v-model="addObj.company" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="妫�楠岀被鍒�"><el-select v-model="addObj.orderType" disabled size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col>
+ </el-row>
+ <el-row v-if="boundTemplateList.length">
+ <el-col :span="24">
+ <el-form-item label="鍘熷璁板綍妯℃澘">
+ <div class="template-tag-list">
+ <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag>
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="6"><el-form-item label="鏍峰搧鏁伴噺"><el-input v-model="addObj.testQuantity" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="鏍峰搧缂栧彿"><el-input v-model="sampleCode" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="鏍峰搧澶栬"><el-input v-model="addObj.sampleStatus" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="閫佹牱浜�"><el-input v-model="addObj.prepareUser" disabled size="small" /></el-form-item></el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="6"><el-form-item label="鐢熶骇鏃ユ湡"><el-date-picker v-model="addObj.productionDate" type="date" value-format="yyyy-MM-dd" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="鐢熶骇鎵瑰彿"><el-input v-model="addObj.productionBatch" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="閫佹牱鏃ユ湡"><el-date-picker v-model="addObj.sampleDate" type="date" value-format="yyyy-MM-dd" disabled size="small" /></el-form-item></el-col>
+ <el-col :span="6"><el-form-item label="鑱旂郴鏂瑰紡"><el-input v-model="addObj.phone" disabled size="small" /></el-form-item></el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12"><el-form-item label="澶囨敞"><el-input v-model="addObj.remark" disabled size="small" style="width: 520px" /></el-form-item></el-col>
+ </el-row>
+ </el-form>
<el-form v-show="false" ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="108px" label-position="right">
<el-row>
<el-col :span="6">
@@ -877,6 +909,11 @@
this.getInfo();
},
methods: {
+ standardDisplayName(value) {
+ if (!value) return '-';
+ const separatorIndex = value.indexOf(' - ');
+ return separatorIndex > -1 ? value.slice(0, separatorIndex) : value;
+ },
getInfo() {
this.selectStandardTreeList()
this.getAuthorizedPerson();
@@ -893,7 +930,7 @@
};
this.addObj.type = String(this.addObj.type)
this.sampleList = this.HaveJson(res.data.sampleProduct);
- this.sampleCode = this.sampleList.length ? this.sampleList[0].sampleCode : ''
+ this.sampleCode = res.data.sampleCode || (this.sampleList.length ? this.sampleList[0].sampleCode : '')
this.boundTemplateList = (res.data.templateList || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0))
this.specialStandardMethod = this.sampleList[0].specialStandardMethod
this.getProNum()
@@ -2270,4 +2307,21 @@
.order-detail__empty {
color: #c0c4cc;
}
+.newju-order-form >>> .el-form-item {
+ display: flex;
+ margin-right: 0;
+}
+.newju-order-form >>> .el-form-item__label {
+ flex: 0 0 108px;
+}
+.newju-order-form >>> .el-form-item__content {
+ flex: 1;
+ min-width: 0;
+ margin-left: 0 !important;
+}
+.newju-order-form >>> .el-input,
+.newju-order-form >>> .el-select,
+.newju-order-form >>> .el-date-editor {
+ width: 100%;
+}
</style>
diff --git a/src/views/standard/standardLibrary/index.vue b/src/views/standard/standardLibrary/index.vue
index 16b01f8..4bf9c90 100644
--- a/src/views/standard/standardLibrary/index.vue
+++ b/src/views/standard/standardLibrary/index.vue
@@ -8,12 +8,11 @@
<div class="head-container addButton">
<el-input v-model="search" clearable placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�" size="small" style="margin-bottom: 5px"
suffix-icon="el-icon-search" @keydown.enter.native="searchFilter" @blur="searchFilter" @clear="searchFilter"></el-input>
- <el-button circle icon="el-icon-plus" size="mini" type="primary" @click="openAddDia"></el-button>
</div>
<div class="head-container">
<el-tree ref="tree" v-loading="treeLoad" :data="list"
:default-expanded-keys="expandedKeys" :filter-node-method="filterNode"
- :props="{ children: 'children', label: 'label' }" highlight-current node-key="label"
+ :props="{ children: 'children', label: 'label' }" highlight-current node-key="id"
style="
height: calc(100vh - 173px);
overflow-y: scroll;
@@ -31,22 +30,6 @@
}`"></i>
{{ data.label }}
</span>
- </el-col>
- <el-col v-if="
- checkPermi(['standard:standardLibrary:delStandardTree']) &&
- isLeaf(node.data)
- " :span="2" style="text-align: right">
- <el-button size="mini" type="text" @click.stop="editTreeName(node)">
- <i class="el-icon-edit"></i>
- </el-button>
- </el-col>
- <el-col v-if="
- checkPermi(['standard:standardLibrary:delStandardTree']) &&
- isLeaf(node.data)
- " :span="2" style="text-align: right">
- <el-button size="mini" type="text" @click.stop="remove(node, data)">
- <i class="el-icon-delete"></i>
- </el-button>
</el-col>
</el-row>
</div>
@@ -585,7 +568,14 @@
selectStandardTreeList() {
this.treeLoad = true;
selectStandardTreeList().then((res) => {
- this.list = res.data;
+ this.list = (res.data || []).map(industry => ({
+ ...industry,
+ children: (industry.children || []).map(standard => ({
+ ...standard,
+ // 浜岀骇鑺傜偣鍙睍绀烘爣鍑嗙紪鍙凤紱鍏煎灏氭湭閲嶅惎鐨勬棫鍚庣杩斿洖鏍煎紡銆�
+ label: standard.standardCode || String(standard.label || '').split(' - ')[0],
+ })),
+ }));
this.expandedKeys = [];
this.list.forEach((a) => {
this.expandedKeys.push(a.label);
diff --git a/src/workers/InspectionWorker.worker.js b/src/workers/InspectionWorker.worker.js
index d77d1f7..8319427 100644
--- a/src/workers/InspectionWorker.worker.js
+++ b/src/workers/InspectionWorker.worker.js
@@ -176,6 +176,18 @@
}
/**
+ * 鑾峰彇绾崟鍏冩牸寮曠敤鍏紡鐨勫潗鏍囧悕锛屼緥濡� =F4銆�=$F$4銆�
+ * 绾紩鐢ㄥ簲鐩存帴澶嶅埗鍘熷�硷紝閬垮厤鎶娾�滃瑙傗�濈瓑涓枃鏂囨湰閫佸叆鏁板�艰绠椼��
+ */
+function getDirectReferenceName(f) {
+ if (typeof f !== "string") {
+ return null;
+ }
+ const matched = f.trim().match(/^=\s*\$?([A-Za-z]{1,3})\$?(\d{1,7})\s*$/);
+ return matched ? `${matched[1].toUpperCase()}${matched[2]}` : null;
+}
+
+/**
* 鎸夋楠岄」id鍙栧綋鍓嶆牱鍝佷笅鐨勬楠岄」淇℃伅,鍙栦笉鍒版椂杩斿洖绌哄璞�,閬垮厤鍏紡璁$畻鍥犵己椤逛腑鏂�
*
* @param id 妫�楠岄」id
@@ -277,7 +289,11 @@
// 濡傛灉鏄嚱鏁版柟娉曪紝鍒欐墽琛屾鏂规硶
let comResult = ""; //鍒濆鍖栬绠楃粨鏋�
try {
- if (
+ const directReferenceName = getDirectReferenceName(item.v.f);
+ if (directReferenceName && Object.prototype.hasOwnProperty.call(comValue, directReferenceName)) {
+ // =F4 杩欑被鍏紡鏃㈠彲鑳藉紩鐢ㄦ暟瀛楋紝涔熷彲鑳藉紩鐢ㄤ腑鏂囨枃鏈紝鐩存帴淇濈暀婧愬�笺��
+ comResult = comValue[directReferenceName];
+ } else if (
getInspectionValueType(item.i) == 1 ||
isNumericFormula(item.v.f)
) {
diff --git a/vue.config.js b/vue.config.js
index 2b9b9e4..6d82cf9 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -37,7 +37,7 @@
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://36.213.90.123:9015/lims`,
- target: `http://192.168.0.24:8001/lims`,
+ target: `http://127.0.0.1:8001/lims`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",
--
Gitblit v1.9.3