From f294efb8c01ad8b0704a92d51c14dbd55d898874 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:46 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)
---
src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue | 374 ++++++++++++++++++++++-------------------------------
1 files changed, 155 insertions(+), 219 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
index 99d88ac..012b6d4 100644
--- a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
+++ b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
@@ -5,6 +5,7 @@
<el-col :span="6" style="padding-left: 20px;text-align: left;">鏁伴噰閰嶇疆</el-col>
<el-col :span="18" style="text-align: right;">
<el-button size="small" type="primary" @click="fileConfiguration">鏂囦欢閰嶇疆</el-button>
+ <el-button size="small" type="primary" @click="addItem">妫�楠岄」鏂板</el-button>
<el-button size="small" @click="$parent.closeDataVue()">
<span style="color: #3A7BFA;">杩斿洖</span>
</el-button>
@@ -12,32 +13,24 @@
</el-row>
</div>
<div class="table">
- <el-table :data="tableList.slice(
- (page.current - 1) * page.size,
- page.current * page.size
- )
- " border tooltip-effect="dark" style="width: 74%;" height="100%" :span-method="spanMethod">
+ <el-table :data="tableList.slice((page.current - 1) * page.size,page.current * page.size)"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ tooltip-effect="dark" height="100%">
<el-table-column type="index" label="搴忓彿" align="center" width="65"></el-table-column>
- <el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О"></el-table-column>
- <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"></el-table-column>
- <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip
- label="閲囬泦鍦板潃"></el-table-column>
- <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip
- label="瀛樺偍鍦板潃"></el-table-column>
- <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"></el-table-column>
+ <el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О" show-overflow-tooltip></el-table-column>
<el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip
min-width="150"></el-table-column>
- <el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120"></el-table-column>
- <el-table-column prop="inspectionItem" align="center" label="妫�楠岄」" min-width="100"></el-table-column>
- <el-table-column prop="inspectionItemSubclass" align="center" label="妫�楠屽瓙椤�" min-width="100"></el-table-column>
- <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100"></el-table-column>
- <el-table-column prop="x" align="center" label="X"></el-table-column>
- <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100"></el-table-column>
- <el-table-column prop="y" align="center" label="Y"></el-table-column>
- <el-table-column prop="anotherName" align="center" label="鍒悕" min-width="100"></el-table-column>
- <el-table-column prop="matchingName" align="center" label="鍖归厤鍚嶇О" min-width="100"></el-table-column>
- <el-table-column prop="formula" align="center" label="鍏紡"></el-table-column>
- <el-table-column prop="section" fixed="right" label="鎿嶄綔" width="120">
+ <el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="inspectionItem" align="center" label="妫�楠岄」" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="inspectionItemSubclass" align="center" label="妫�楠屽瓙椤�" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="x" align="center" label="X" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="y" align="center" label="Y" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="anotherName" align="center" label="鍒悕" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="matchingName" align="center" label="鍖归厤鍚嶇О" min-width="100" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="formula" align="center" label="鍏紡" show-overflow-tooltip></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="120" align="center">
<template slot-scope="scope">
<el-button type="text" @click="dataConfig(scope.row)">鏁伴噰閰嶇疆</el-button>
</template>
@@ -53,7 +46,8 @@
<el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible3" width="920px" :before-close="closeForm">
<el-form :model="configForm" label-position="top" size="small" ref="configForm" label-width="100px"
class="demo-ruleForm">
- <el-table :data="domains" style="width: 100%" height="300">
+ <el-table :data="domains" style="width: 100%" height="300"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
<el-table-column label="搴忓彿" type="index" width="80">
<template v-slot="scope">
{{ getIndexWithAlphabet(scope.$index) }}
@@ -104,7 +98,7 @@
:content="formula.content" :key="key" placement="top">
<label>{{ formula.label }}()</label>
</el-tooltip>
- <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}" ze placeholder="璇疯緭鍏ュ唴瀹�"
+ <el-input type="textarea" autosize:autosize="{ minRows: 2, maxRows: 4}" placeholder="璇疯緭鍏ュ唴瀹�"
v-model="configForm.formula" @change="evalResult">
</el-input>
</template>
@@ -118,7 +112,7 @@
</el-row>
</span>
</el-dialog>
- <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible4" width="400px">
+ <el-dialog title="鏂囦欢閰嶇疆" :visible.sync="dialogVisible4" width="400px">
<div class="search_thing" style="margin-bottom: 14px;">
<div class="search_label">
<span style="color:red;margin-right: 4px;">*</span>IP锛�
@@ -156,11 +150,33 @@
<div class="search_label">鏂囦欢鍚嶇О锛�</div>
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.dbFileName"></el-input>
</div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鏁版嵁搴撹处鍙凤細</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.dbUserName"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鏁版嵁搴撳瘑鐮侊細</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.dbPassword"></el-input>
+ </div>
+ <div v-if="configForm.fileType === '.mysql'" class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>鏁版嵁搴撹〃锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.dbTable"></el-input>
+ </div>
<span slot="footer" class="dialog-footer">
<el-row>
<el-button @click="dialogVisible4 = false">鍙� 娑�</el-button>
<el-button type="primary" @click="submitForm4" :loading="upLoad4">纭� 瀹�</el-button>
</el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="娣诲姞妫�楠岄」" :visible.sync="dialogVisible5" width="1000px">
+ <lims-table :tableData="tableData5" :column="column5"
+ :isSelection="true" :handleSelectionChange="selectMethod"
+ height="540" :page="page5" :tableLoading="tableLoading5"
+ @pagination="pagination5"></lims-table>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible5 = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm5" :loading="loading5">淇� 瀛�</el-button>
</span>
</el-dialog>
</div>
@@ -171,19 +187,21 @@
queryDataAcquisitionConfiguration,
saveDataAcquisitionConfiguration,
deleteDataAcquisitionConfiguration,
+ getDeviceById,
+ saveDeviceFileConfiguration,
+ queryProductConfiguration,
+ getNoConfigProduct,
} from '@/api/cnas/resourceDemand/device.js'
+import limsTable from "@/components/Table/lims-table.vue";
export default {
name: "dataAcquisitionConfig",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {},
+ components: {limsTable},
props: {
deviceId: {
type: Number,
default: () => []
}
- },
- mounted() {
- this.init();
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
@@ -228,7 +246,10 @@
entrustCode: "",
sampleCode: "",
dbFileName: "",
- fiberOpticRibbon: ""
+ fiberOpticRibbon: "",
+ dbUserName: "",
+ dbPassword: "",
+ dbTable: ""
},
domains: [
{
@@ -247,8 +268,11 @@
{ label: "db", value: ".db" },
{ label: "mdb", value: ".mdb" },
{ label: "word", value: ".docx" },
- { label: "excel", value: ".xlsx" },
+ { label: "excelxlsx", value: ".xlsx" },
+ { label: "excelxls", value: ".xls" },
{ label: "txt", value: ".txt" },
+ { label: "mysql", value: ".mysql" },
+ { label: "mqtt", value: ".mqtt" },
{ label: "png", value: ".png" }
],
spanList: [],
@@ -296,110 +320,33 @@
]
}
},
- deleteList: []
+ deleteList: [],
+ tableData5: [],
+ column5: [
+ {label: '鏍峰搧鍚嶇О', prop: 'sample'},
+ {label: '妫�楠岄」鍒嗙被', prop: 'inspectionItemClass'},
+ {label: '妫�楠岄」', prop: 'inspectionItem'},
+ {label: '妫�楠屽瓙椤�', prop: 'inspectionItemSubclass'},
+ ],
+ page5: {
+ total:0,
+ size:20,
+ current:1
+ },
+ tableLoading5: false,
+ dialogVisible5: false,
+ loading5: false,
+ multipleSelection: []
};
+ },
+ mounted() {
+ this.init();
},
// 鏂规硶闆嗗悎
methods: {
- getIndexWithAlphabet(index) {
- const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- const letterIndex = index % 26;
- return alphabet.charAt(letterIndex) + (index + 1);
- },
- rowspan(spanArr, position, spanName) {
- this.tableList.forEach((item, index) => {
- if (index === 0) {
- spanArr.push(1);
- position = 0;
- } else {
- if (
- this.tableList[index][spanName] ===
- this.tableList[index - 1][spanName]
- ) {
- spanArr[position] += 1;
- spanArr.push(0);
- } else {
- spanArr.push(1);
- position = index;
- }
- }
- });
- },
- spanMethod({ row, column, rowIndex, columnIndex }) {
- // 涓�鑸殑鍚堝苟琛�
- if (
- this.spanConfig != undefined &&
- this.spanConfig.rows &&
- this.spanConfig.rows.length > 0
- ) {
- let i = null;
- let obj = this.spanConfig.rows.find((item, index) => {
- i = index;
- return item.index == columnIndex;
- });
- if (obj) {
- const _row = this.spanList[i].arr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- }
- // 鐗规畩鐨勫悎骞惰
- if (
- this.spanConfig != undefined &&
- this.spanConfig.special &&
- this.spanConfig.special.main &&
- this.spanConfig.special.rows &&
- this.spanConfig.special.rows.length > 0
- ) {
- let i = null;
- let obj = this.spanConfig.special.rows.find((item, index) => {
- i = index;
- return item.index == columnIndex;
- });
- if (obj) {
- const _row = this.specialSpanList[i].arr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- }
- },
- fileConfiguration() {
- this.dialogVisible4 = true;
- if (this.tableList[0]) {
- this.$set(this.configForm, "fileType", this.tableList[0].fileType);
- this.$set(this.configForm, "collectUrl", this.tableList[0].collectUrl);
- this.$set(this.configForm, "storageUrl", this.tableList[0].storageUrl);
- this.$set(this.configForm, "ip", this.tableList[0].ip);
- this.$set(
- this.configForm,
- "entrustCode",
- this.tableList[0].entrustCode
- );
- this.$set(
- this.configForm,
- "sampleCode",
- this.tableList[0].sampleCode
- );
- this.$set(
- this.configForm,
- "dbFileName",
- this.tableList[0].dbFileName
- );
- this.$set(
- this.configForm,
- "fiberOpticRibbon",
- this.tableList[0].fiberOpticRibbon
- )
- }
- },
+ // 鏌ヨ鍒楄〃
init() {
- queryDataAcquisitionConfiguration({ deviceId: this.deviceId, isDevice: false }).then(res => {
+ queryDataAcquisitionConfiguration({ deviceId: this.deviceId }).then(res => {
this.tableList = res.data;
this.tableList.forEach(i => {
let isIncludes = false
@@ -413,88 +360,75 @@
if (!isIncludes && i.formula) {
i.formula = i.formula.slice(1, -1)
}
- i.sample = i.sample
- .replace(/"/g, "")
- .replace(/],/g, "锛�")
- .replace(/\[/g, "")
- .replace(/]/g, "");
});
- if (this.tableList[0]) {
- this.$set(this.configForm, "fileType", this.tableList[0].fileType);
- this.$set(
- this.configForm,
- "collectUrl",
- this.tableList[0].collectUrl
- );
- this.$set(
- this.configForm,
- "storageUrl",
- this.tableList[0].storageUrl
- );
- this.$set(this.configForm, "ip", this.tableList[0].ip);
- this.$set(
- this.configForm,
- "entrustCode",
- this.tableList[0].entrustCode
- );
- this.$set(
- this.configForm,
- "sampleCode",
- this.tableList[0].sampleCode
- );
- this.$set(
- this.configForm,
- "dbFileName",
- this.tableList[0].dbFileName
- );
- this.$set(
- this.configForm,
- "fiberOpticRibbon",
- this.tableList[0].fiberOpticRibbon
- )
- }
- // 涓�鑸殑鍚堝苟琛�
- if (
- this.spanConfig != undefined &&
- this.spanConfig.rows &&
- this.spanConfig.rows.length > 0
- ) {
- this.spanList = [];
- this.spanConfig.rows.forEach((item, index) => {
- this.spanList.push({
- arr: [],
- position: 0
- });
- this.rowspan(
- this.spanList[index].arr,
- this.spanList[index].position,
- item.name
- );
- });
- }
- // 鐗规畩鐨勫悎骞惰
- if (
- this.spanConfig != undefined &&
- this.spanConfig.special &&
- this.spanConfig.special.main &&
- this.spanConfig.special.rows &&
- this.spanConfig.special.rows.length > 0
- ) {
- this.specialSpanList = [];
- this.spanConfig.special.rows.forEach((item, index) => {
- this.specialSpanList.push({
- arr: [],
- position: 0
- });
- this.rowspan(
- this.specialSpanList[index].arr,
- this.specialSpanList[index].position,
- this.spanConfig.special.main
- );
- });
- }
+
});
},
+ getIndexWithAlphabet(index) {
+ const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ const letterIndex = index % 26;
+ return alphabet.charAt(letterIndex) + (index + 1);
+ },
+ // 鎵撳紑鏂板妫�楠岄」寮规
+ addItem () {
+ this.dialogVisible5 = true;
+ this.getList5()
+ },
+ getList5() {
+ this.tableLoading5 = true;
+ getNoConfigProduct({deviceId: this.deviceId, ...this.page5 }).then(res => {
+ this.tableLoading5 = false;
+ this.tableData5 = res.data.records
+ this.page5.total = res.data.total
+ }).catch(err => {
+ this.tableLoading5 = false;
+ })
+ },
+ pagination5 (page) {
+ this.page5.size = page.limit
+ this.getList5()
+ },
+ // 琛ㄦ牸閫夋嫨鏂规硶
+ selectMethod(val) {
+ this.multipleSelection = val
+ },
+ // 鎻愪氦鏂板妫�楠岄」
+ submitForm5 () {
+ this.loading5 = true;
+ saveDataAcquisitionConfiguration({
+ deviceId: this.deviceId,
+ dataConfigList: this.multipleSelection,
+ }).then(res => {
+ this.loading5 = false;
+ this.dialogVisible5 = false;
+ this.init();
+ this.$message.success("娣诲姞鎴愬姛");
+ }).catch(err => {
+ this.loading5 = false;
+ })
+ },
+ // 鎵撳紑鏂囦欢閰嶇疆寮规
+ fileConfiguration() {
+ this.dialogVisible4 = true;
+ this.getInfo()
+ },
+ // 鏌ヨ鏂囦欢閰嶇疆淇℃伅
+ getInfo() {
+ getDeviceById({deviceId: this.deviceId}).then(res => {
+ this.$set(this.configForm, "fileType", res.data.fileType);
+ this.$set(this.configForm, "collectUrl", res.data.collectUrl);
+ this.$set(this.configForm, "storageUrl", res.data.storageUrl);
+ this.$set(this.configForm, "ip", res.data.ip);
+ this.$set(this.configForm, "entrustCode", res.data.entrustCode);
+ this.$set(this.configForm, "sampleCode", res.data.sampleCode);
+ this.$set(this.configForm, "dbFileName", res.data.dbFileName);
+ this.$set(this.configForm, "fiberOpticRibbon", res.data.fiberOpticRibbon);
+ this.$set(this.configForm, "dbUserName", res.data.dbUserName);
+ this.$set(this.configForm, "dbPassword", res.data.dbPassword);
+ this.$set(this.configForm, "dbTable", res.data.dbTable);
+ })
+ },
+ // 鎻愪氦鏂囦欢閰嶇疆
submitForm4() {
const obj = Object.assign({
deviceId: this.deviceId,
@@ -502,16 +436,17 @@
collectUrl: this.configForm.collectUrl,
storageUrl: this.configForm.storageUrl,
ip: this.configForm.ip,
- isDevice: true,
entrustCode: this.configForm.entrustCode,
sampleCode: this.configForm.sampleCode,
dbFileName: this.configForm.dbFileName,
- fiberOpticRibbon: this.configForm.fiberOpticRibbon
+ fiberOpticRibbon: this.configForm.fiberOpticRibbon,
+ dbUserName: this.configForm.dbUserName,
+ dbPassword: this.configForm.dbPassword,
+ dbTable: this.configForm.dbTable
});
this.upLoad4 = true;
- saveDataAcquisitionConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
+ saveDeviceFileConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
if (res.code == 200) {
- // this.tableList = res.data;
this.dialogVisible4 = false;
this.init();
this.$message.success("鎿嶄綔鎴愬姛");
@@ -522,6 +457,7 @@
this.upLoad4 = false;
});
},
+ // 鎵撳紑鏁伴噰閰嶇疆寮规
dataConfig(row) {
this.configForm = {
deviceId: row.deviceId,
@@ -531,7 +467,7 @@
inspectionItemClass: row.inspectionItemClass,
};
this.dialogVisible3 = true;
- queryDataAcquisitionConfiguration({
+ queryProductConfiguration({
deviceId: this.deviceId,
inspectionItem: row.inspectionItem.trim(),
isDevice: true,
@@ -540,6 +476,7 @@
structureItemParameterId: row.structureItemParameterId
}).then(res => {
const data = res.data;
+ console.log("鏁伴噰閰嶇疆--",data)
if (data[0]) {
this.domains.splice(0, 1);
let formula = data[0].formula
@@ -571,6 +508,7 @@
}
});
},
+ // 鎻愪氦鏁伴噰閰嶇疆
submitForm3() {
this.$refs.configForm.validate(valid => {
// 琛ㄥ崟鏍¢獙
@@ -590,7 +528,7 @@
}
}
}
- if (isIncludes === false && this.configForm.formula !== "" && this.configForm.formula !== undefined) {
+ if (isIncludes === false && this.configForm.formula !== "" && this.configForm.formula !== null && this.configForm.formula !== undefined) {
i.formula = "(" + this.configForm.formula + ")";
} else {
i.formula = this.configForm.formula;
@@ -690,7 +628,7 @@
}
.search_thing {
- width: 350px;
+ width: 370px;
display: flex;
align-items: center;
}
@@ -722,9 +660,7 @@
}
.table {
- margin-top: 10px;
background-color: #fff;
- width: calc(100vw - 1em);
height: calc(100vh - 18em);
}
--
Gitblit v1.9.3