From b572bdc7da9c6c47df9be5939f5d3280f2127546 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 02 八月 2024 17:18:35 +0800
Subject: [PATCH] Merge branch 'test' of http://114.132.189.42:9002/r/center-lims-before into test
---
src/components/do/b1-ins-order/add.vue | 53 ++-
src/components/view/b1-inspection-order.vue | 4
src/components/do/b6-device-management/b6-data-acquisition-config.vue | 815 ++++++++++++++++++++++++++++++-----------------------
3 files changed, 493 insertions(+), 379 deletions(-)
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 5e3a46c..49505a1 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -961,7 +961,7 @@
entity: {
orderBy: {
field: 'id',
- order: 'asc'
+ order: 'desc'
}
},
isIndex: true,
@@ -2082,6 +2082,7 @@
this.sampleIds.push(row.id)
}
this.productList = row.insProduct
+ this.productList0 = JSON.parse(JSON.stringify(this.productList))
setTimeout(() => {
this.productList.forEach(a => {
if (a.state == 1) this.toggleSelection(a)
@@ -2257,7 +2258,8 @@
name: this.templateName,
thing: JSON.stringify({
addObj: this.addObj,
- sampleList: this.sampleList
+ sampleList: this.sampleList,
+ selectTree:this.selectTree
})
}, {
headers: {
@@ -2282,6 +2284,7 @@
let obj = JSON.parse(res.data)
this.addObj = obj.addObj;
this.sampleList = obj.sampleList;
+ this.selectTree = obj.selectTree
})
},
delSampleAndProduct() {
@@ -2325,10 +2328,12 @@
this.isAskOnlyRead = false
}
this.getProductLoad = true
+ let selectTreeList = this.selectTree.split(" - ")
+ selectTreeList[selectTreeList.length - 1] = this.addObj.model
this.$axios.post(this.$api.standardTree.selectStandardProductList, {
- model: row.model + '-' + row.modelNum,
+ model: this.addObj.model + '-' + row.modelNum,
standardMethodListId: val,
- factory: this.selectTree,
+ factory: selectTreeList.join(" - "),
}, {
headers: {
'Content-Type': 'application/json'
@@ -2666,25 +2671,31 @@
}
},
upBsmAll (item) {
- let sections = JSON.parse(item.bsmRow.section);
- let asks = JSON.parse(item.bsmRow.ask);
- let tells = JSON.parse(item.bsmRow.tell);
- let manHours = JSON.parse(item.bsmRow.manHour);
- let prices = JSON.parse(item.bsmRow.price);
- for (var a in sections) {
- if (item.bsm1Val === sections[a]) {
- this.productList.forEach(p => {
- if (p.id === item.bsmRow.id) {
- p.section = sections[a]
- p.ask = asks[a]
- p.tell = tells[a]
- p.manHour = manHours[a]
- p.price = prices[a]
- }
- })
- break
+ // console.log(1111,item,this.bsm1DiaList)
+ for (let i =0;i<this.bsm1DiaList.length;i++){
+ this.bsm1DiaList[i].bsm1Val = item.bsm1Val
+ let sections = JSON.parse(this.bsm1DiaList[i].bsmRow.section);
+ let asks = JSON.parse(this.bsm1DiaList[i].bsmRow.ask);
+ let tells = JSON.parse(this.bsm1DiaList[i].bsmRow.tell);
+ let manHours = JSON.parse(this.bsm1DiaList[i].bsmRow.manHour);
+ let prices = JSON.parse(this.bsm1DiaList[i].bsmRow.price);
+ for (var a in sections) {
+ if (this.bsm1DiaList[i].bsm1Val === sections[a]) {
+ this.productList.forEach(p => {
+ if (p.id === this.bsm1DiaList[i].bsmRow.id) {
+ p.section = sections[a]
+ p.ask = asks[a]
+ p.tell = tells[a]
+ p.manHour = manHours[a]
+ p.price = prices[a]
+ }
+ })
+ break
+ }
}
}
+ this.changeProductList0()
+ this.currentMethod.insProduct = this.productList0
},
beforeClose(done) {
// if (this.bsm1) {
diff --git a/src/components/do/b6-device-management/b6-data-acquisition-config.vue b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
index 83bb496..322ba4d 100644
--- a/src/components/do/b6-device-management/b6-data-acquisition-config.vue
+++ b/src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -12,15 +12,21 @@
</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: 100%;" height="100%" :span-method="spanMethod">
+ <el-table :data="tableList.slice(
+ (page.current - 1) * page.size,
+ page.current * page.size
+ )
+ " border tooltip-effect="dark" style="width: 100%;" height="100%" :span-method="spanMethod">
<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="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="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip min-width="150"></el-table-column>
+ <el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip
+ min-width="150"></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>
@@ -28,7 +34,7 @@
<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="formula" align="center" label="鍏紡"></el-table-column>
- <el-table-column prop="section" label="鎿嶄綔" width="120">
+ <el-table-column prop="section" fixed="right" label="鎿嶄綔" width="120">
<template slot-scope="scope">
<el-button type="text" @click="dataConfig(scope.row)">鏁伴噰閰嶇疆</el-button>
</template>
@@ -37,139 +43,135 @@
</div>
<div class="page" v-if="tableList.length > 0">
<el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current"
- :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
- :total="tableList.length">
+ :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
+ :total="tableList.length">
</el-pagination>
</div>
<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">
- <!-- <div class="fomItem1"> -->
- <!-- <el-form-item class="fomItemInput" label="妫�娴嬬殑鏂囦欢绫诲瀷:" prop="fileType">
- <el-select v-model="configForm.fileType" placeholder="璇烽�夋嫨鏂囦欢绫诲瀷">
- <el-option v-for="item in fileTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="fomItemInput" label="閲囬泦鍦板潃:" prop="collectUrl">
- <el-input v-model="configForm.collectUrl"></el-input>
- </el-form-item>
- <el-form-item class="fomItemInput" label="鍌ㄥ瓨鍦板潃:" prop="storageUrl">
- <el-input v-model="configForm.storageUrl"></el-input>
- </el-form-item> -->
- <!-- </div> -->
- <div class="fomItem1"
- v-for="(domain, index) in domains"
- :key="index">
- <el-form-item class="fomItemInput" label="鍙傜収X:">
- <el-input v-model="domain.referx"></el-input>
- </el-form-item>
- <el-form-item class="fomItemInput" label="X:">
- <el-input v-model="domain.x" onkeyup="value=value.replace(/[^-0-9]/g,'')"></el-input>
- </el-form-item>
- <el-form-item class="fomItemInput" label="鍙傜収Y:">
- <el-input v-model="domain.refery"></el-input>
- </el-form-item>
- <el-form-item class="fomItemInput" label="Y:">
- <el-input v-model="domain.y" onkeyup="value=value.replace(/[^-0-9]/g,'')"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button style="position: absolute; bottom: -65px" @click.prevent="removeDomain(domain)" size="small">鍒犻櫎</el-button>
- </el-form-item>
- <el-form-item>
- <el-button @click="addDomain" size="small" type="primary" style="position: absolute; bottom: -65px;left: 62px" v-if="index === domains.length-1">鏂板鍩熷悕</el-button>
- </el-form-item>
- </div>
+ <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-column label="搴忓彿" type="index" width="80">
+ <template v-slot="scope">
+ {{ getIndexWithAlphabet(scope.$index) }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="referx" label="鍙傜収X" min-width="180">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.referx"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="x" label="X" min-width="180">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.x"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="refery" label="鍙傜収Y" min-width="180">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.refery"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="y" label="Y" min-width="100">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.y"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="150">
+ <template v-slot="scope">
+ <el-button @click.prevent="removeDomain(scope.row)" size="small" type="text">鍒犻櫎</el-button>
+ <el-button @click="addDomain" size="small" type="text">鏂板</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
<div class="fomItem2">
<el-form-item class="fomItemInput1">
<template v-slot="label">
鍏紡锛�
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶澶у�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MAX(1,2)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶澶у�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MAX(A1,B2)" placement="top">
<label>MAX()</label>
</el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶灏忓�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MIN(1,2)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹傚弬鏁版渶灏忓�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MIN(A1,B2)" placement="top">
<label>MIN()</label>
</el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚拰锛屽弬鏁颁釜鏁版渶灏戜袱涓紝濡傦細SUM(1,2)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹傚拰锛屽弬鏁颁釜鏁版渶灏戜袱涓紝濡傦細SUM(A1,B2)" placement="top">
<label>SUM()</label>
</el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傜粷瀵瑰�硷紝鍙傛暟涓暟鏈�灏戜竴涓紝濡傦細ABS(1)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹傜粷瀵瑰�硷紝鍙傛暟涓暟鏈�灏戜竴涓紝濡傦細ABS(A1)" placement="top">
<label>ABS()</label>
</el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹傚钩鍧囧�硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛欰VERAGE(1,2)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹傚钩鍧囧�硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛欰VERAGE(A1,B2)" placement="top">
<label>AVERAGE()</label>
</el-tooltip>
- <el-tooltip class="itemFomItem" effect="dark" content="姹備腑鍊硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛歁EDIAN(1,2)" placement="top">
+ <el-tooltip class="itemFomItem" effect="dark" content="姹備腑鍊硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛歁EDIAN(A1,B2)" placement="top">
<label>MEDIAN()</label>
</el-tooltip>
- <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}"ze placeholder="璇疯緭鍏ュ唴瀹�" v-model="configForm.formula" @change="evalResult"> </el-input>
+ <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}" ze placeholder="璇疯緭鍏ュ唴瀹�"
+ v-model="configForm.formula" @change="evalResult">
+ </el-input>
</template>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
- <el-row>
- <el-button @click="closeForm">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitForm3" :loading="upLoad3">纭� 瀹�</el-button>
- </el-row>
- </span>
+ <el-row>
+ <el-button @click="closeForm">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm3" :loading="upLoad3">纭� 瀹�</el-button>
+ </el-row>
+ </span>
</el-dialog>
<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锛�</div>
- <el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="configForm.ip"></el-input>
- </div>
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>IP锛�
+ </div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.ip"></el-input>
+ </div>
<div 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.collectUrl"></el-input>
- </div>
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>閲囬泦鍦板潃锛�
+ </div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.collectUrl"></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.storageUrl"></el-input>
- </div>
+ <div class="search_label">鍌ㄥ瓨鍦板潃锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.storageUrl"></el-input>
+ </div>
<div class="search_thing" style="margin-bottom: 14px;">
- <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>鏂囦欢鍚庣紑锛�</div>
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>鏂囦欢鍚庣紑锛�
+ </div>
<el-select v-model="configForm.fileType" size="small" placeholder="璇烽�夋嫨" style="width: 100%;">
- <el-option
- v-for="item in fileTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
+ <el-option v-for="item in fileTypeOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
- </div>
- <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
- <div class="search_label">濮旀墭瀛楁锛�</div>
- <el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="configForm.mdbEntrustCode"></el-input>
- </div>
- <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
- <div class="search_label">鏍峰搧瀛楁锛�</div>
- <el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="configForm.mdbSampleCode"></el-input>
- </div>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">濮旀墭瀛楁锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.entrustCode"></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.sampleCode"></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.dbFileName"></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-row>
+ <el-button @click="dialogVisible4 = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm4" :loading="upLoad4">纭� 瀹�</el-button>
+ </el-row>
+ </span>
</el-dialog>
</div>
</template>
<script>
-
export default {
name: "dataAcquisitionConfig",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {
- },
+ components: {},
props: {
deviceId: {
type: Number,
@@ -177,7 +179,7 @@
}
},
mounted() {
- this.init()
+ this.init();
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
@@ -186,191 +188,247 @@
tableList: [],
page: {
current: 1,
- size: 20,
+ size: 20
},
- dialogVisible3:false,
- configForm:{
- formula: '',
+ dialogVisible3: false,
+ configForm: {
+ formula: ""
},
domains: [
{
- referx: '',
- refery: '',
- x: '',
- y: ''
+ referx: "",
+ refery: "",
+ x: "",
+ y: ""
}
],
- upLoad3:false,
- upLoad4:false,
+ upLoad3: false,
+ upLoad4: false,
fileTypeOptions: [
- {label: 'csv', value: '.csv'},
- {label: 'db', value: '.db'},
- {label: 'mdb', value: '.mdb'},
- {label: 'word', value: '.docx'},
- {label: 'excel', value: '.xlsx'},
- {label: 'txt', value: '.txt'},
- {label: 'png', value: '.png'},
+ { label: "csv", value: ".csv" },
+ { label: "db", value: ".db" },
+ { label: "mdb", value: ".mdb" },
+ { label: "word", value: ".docx" },
+ { label: "excel", value: ".xlsx" },
+ { label: "txt", value: ".txt" },
+ { label: "png", value: ".png" }
],
spanList: [],
specialSpanList: [],
spanConfig: {
- special: {
- main: "inspectionItemSubclass",
- rows:[
- {
- name:'deviceName',
- index:1
- },
- {
- name:'fileType',
- index:2
- },
- {
- name:'collectUrl',
- index:3
- },
- {
- name:'storageUrl',
- index:4
- },
- {
- name:'ip',
- index:5
- },
- {
- name:'inspectionItem',
- index:6
- },
- {
- name:'inspectionItemSubclass',
- index:7
- },
- {
- name:'formula',
- index:13
- },
- {
- name:'inspectionItemSubclass',
- index:14
- }
- ]
+ special: {
+ main: "inspectionItemSubclass",
+ rows: [
+ {
+ name: "deviceName",
+ index: 1
+ },
+ {
+ name: "fileType",
+ index: 2
+ },
+ {
+ name: "collectUrl",
+ index: 3
+ },
+ {
+ name: "storageUrl",
+ index: 4
+ },
+ {
+ name: "ip",
+ index: 5
+ },
+ {
+ name: "inspectionItem",
+ index: 6
+ },
+ {
+ name: "inspectionItemSubclass",
+ index: 7
+ },
+ {
+ name: "formula",
+ index: 13
+ },
+ {
+ name: "section",
+ index: 14
}
+ ]
+ }
},
deleteList: []
- }
+ };
},
// 鏂规硶闆嗗悎
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;
+ 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 {
- if (
- this.tableList[index][spanName] ===
- this.tableList[index - 1][spanName]
- ) {
- spanArr[position] += 1;
- spanArr.push(0);
- } else {
- spanArr.push(1);
- position = index;
- }
+ 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;
});
- },
- 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 (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,
- };
- }
+ }
+ // 鐗规畩鐨勫悎骞惰
+ 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.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);
+ }
},
init() {
- // this.tableList = []
- this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId + "&isDevice=" + false).then(res => {
- this.tableList = res.data
- this.tableList.forEach(i => {
- // replace(/=/g, ' ')
- 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, 'mdbEntrustCode', this.tableList[0].mdbEntrustCode)
- this.$set(this.configForm, 'mdbSampleCode', this.tableList[0].mdbSampleCode)
- }
- // 涓�鑸殑鍚堝苟琛�
- if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length >
- 0) {
+ this.$axios
+ .get(
+ this.$api.deviceScope.queryDataAcquisitionConfiguration +
+ "?deviceId=" +
+ this.deviceId +
+ "&isDevice=" +
+ false
+ )
+ .then(res => {
+ this.tableList = res.data;
+ this.tableList.forEach(i => {
+ // replace(/=/g, ' ')
+ 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
+ );
+ }
+ // 涓�鑸殑鍚堝苟琛�
+ 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);
- })
+ });
+ 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 = []
+ 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);
- })
+ });
+ this.rowspan(
+ this.specialSpanList[index].arr,
+ this.specialSpanList[index].position,
+ this.spanConfig.special.main
+ );
+ });
}
- })
+ });
},
submitForm4() {
const obj = Object.assign({
@@ -380,97 +438,130 @@
storageUrl: this.configForm.storageUrl,
ip: this.configForm.ip,
isDevice: true,
- mdbEntrustCode: this.configForm.mdbEntrustCode,
- mdbSampleCode: this.configForm.mdbSampleCode
- })
- this.upLoad4 = true
- this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, obj, {headers: {
- 'Content-Type': 'application/json'
- }}).then(res => {
- if(res.code == 200) {
- this.tableList = res.data
- this.dialogVisible4 = false
- this.init()
- this.$message.success('鎿嶄綔鎴愬姛')
+ entrustCode: this.configForm.entrustCode,
+ sampleCode: this.configForm.sampleCode,
+ dbFileName: this.configForm.dbFileName
+ });
+ this.upLoad4 = true;
+ this.$axios
+ .post(
+ this.$api.deviceScope.saveDataAcquisitionConfiguration +
+ "?deviceId=" +
+ this.deviceId,
+ obj,
+ {
+ headers: {
+ "Content-Type": "application/json"
}
- this.upLoad4 = false
- }).catch(err => {
- this.upLoad4 = false
- })
+ }
+ )
+ .then(res => {
+ if (res.code == 200) {
+ this.tableList = res.data;
+ this.dialogVisible4 = false;
+ this.init();
+ this.$message.success("鎿嶄綔鎴愬姛");
+ }
+ this.upLoad4 = false;
+ })
+ .catch(err => {
+ this.upLoad4 = false;
+ });
},
- dataConfig (row) {
+ dataConfig(row) {
this.configForm = {
deviceId: row.deviceId,
inspectionItem: row.inspectionItem.trim(),
inspectionItemSubclass: row.inspectionItemSubclass,
structureItemParameterId: row.structureItemParameterId
- }
- this.dialogVisible3 = true
- this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId +
- "&inspectionItem=" + row.inspectionItem.trim() +
- "&isDevice=" + true +
- "&inspectionItemSubclass=" + row.inspectionItemSubclass.trim()).then(res => {
- const data = res.data
- if(data[0]) {
- this.domains.splice(0, 1)
- this.$set(this.configForm, 'formula', data[0].formula)
- data.forEach(i => {
- this.domains.push({
- referx: i.referx,
- refery: i.refery,
- x: i.x,
- y: i.y,
- id: i.id
+ };
+ this.dialogVisible3 = true;
+ this.$axios
+ .get(
+ this.$api.deviceScope.queryDataAcquisitionConfiguration +
+ "?deviceId=" +
+ this.deviceId +
+ "&inspectionItem=" +
+ row.inspectionItem.trim() +
+ "&isDevice=" +
+ true +
+ "&inspectionItemSubclass=" +
+ row.inspectionItemSubclass.trim()
+ )
+ .then(res => {
+ const data = res.data;
+ if (data[0]) {
+ this.domains.splice(0, 1);
+ this.$set(this.configForm, "formula", data[0].formula);
+ data.forEach(i => {
+ this.domains.push({
+ referx: i.referx,
+ refery: i.refery,
+ x: i.x,
+ y: i.y,
+ id: i.id
+ });
});
- })
- }
- })
+ }
+ });
},
submitForm3() {
- this.$refs.configForm.validate((valid) => { // 琛ㄥ崟鏍¢獙
+ this.$refs.configForm.validate(valid => {
+ // 琛ㄥ崟鏍¢獙
if (valid) {
this.domains.forEach(item => {
- const isEmpty = Object.values(item).every(val => val === '')
+ const isEmpty = Object.values(item).every(val => val === "");
if (isEmpty) {
- this.$message.error('璇峰~鍐欏弬鐓ф暟鎹�')
+ this.$message.error("璇峰~鍐欏弬鐓ф暟鎹�");
}
- })
- this.domains.forEach(i => {
- if(i.x == '') {
- i.x = null
- }
- if(i.y == '') {
- i.y = null
- }
- i.formula = this.configForm.formula
- i.deviceId = this.deviceId
- i.inspectionItem = this.configForm.inspectionItem
- i.inspectionItemSubclass = this.configForm.inspectionItemSubclass
- i.structureItemParameterId = this.configForm.structureItemParameterId
- })
- this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, {dataConfigList: this.domains, isDevice: false},{headers: {
- 'Content-Type': 'application/json'
- }}).then(res => {
- this.dialogVisible3 = false
- this.domains = [
+ });
+ this.domains.forEach((i, index) => {
+ i.formula = this.configForm.formula;
+ i.deviceId = this.deviceId;
+ i.inspectionItem = this.configForm.inspectionItem;
+ i.inspectionItemSubclass = this.configForm.inspectionItemSubclass;
+ i.structureItemParameterId = this.configForm.structureItemParameterId;
+ i.serialNumber = this.getIndexWithAlphabet(index)
+ });
+ this.$axios
+ .post(
+ this.$api.deviceScope.saveDataAcquisitionConfiguration +
+ "?deviceId=" +
+ this.deviceId,
+ { dataConfigList: this.domains, isDevice: false },
{
- referx: '',
- refery: '',
- x: '',
- y: '',
- id: ''
- }
- ]
- if(this.deleteList.length > 0) {
- this.$axios.delete(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?ids=" + this.deleteList.join()).then(res => {
- if(res.code == 200) {
- this.init()
+ headers: {
+ "Content-Type": "application/json"
}
- })
- }
- this.init()
- this.$message.success('娣诲姞鎴愬姛')
- })
+ }
+ )
+ .then(res => {
+ this.dialogVisible3 = false;
+ this.domains = [
+ {
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
+ }
+ ];
+ if (this.deleteList.length > 0) {
+ this.$axios
+ .delete(
+ this.$api.deviceScope.deleteDataAcquisitionConfiguration +
+ "?ids=" +
+ this.deleteList.join()
+ )
+ .then(res => {
+ if (res.code == 200) {
+ this.init();
+ }
+ });
+ }
+ this.init();
+ this.$message.success("娣诲姞鎴愬姛");
+ });
} else {
return false;
}
@@ -478,52 +569,54 @@
},
removeDomain(item) {
// 鍒犻櫎鍏紡formItem
- const index = this.domains.indexOf(item)
+ const index = this.domains.indexOf(item);
if (index !== -1 && this.domains.length > 1) {
- if(item.id){
- this.deleteList.push(item.id)
- this.domains.splice(index, 1)
+ if (item.id) {
+ this.deleteList.push(item.id);
+ this.domains.splice(index, 1);
} else {
- this.domains.splice(index, 1)
+ this.domains.splice(index, 1);
}
} else {
- this.$message.error('涓嶅厑璁稿垹闄ゆ渶鍚庝竴鏉℃暟鎹紒');
+ this.$message.error("涓嶅厑璁稿垹闄ゆ渶鍚庝竴鏉℃暟鎹紒");
}
},
addDomain() {
// 娣诲姞鍏紡formItem
this.domains.push({
- referx: '',
- refery: '',
- x: '',
- y: '',
- id: ''
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
});
},
- evalResult (val) {
- this.configForm.formula = val
+ evalResult(val) {
+ this.configForm.formula = val;
// 鏍规嵁鍏紡璁$畻鍑虹粨鏋�
},
sizeChange(val) {
- this.page.size = val
+ this.page.size = val;
},
currentChange(val) {
- this.page.current = val
+ this.page.current = val;
},
- closeForm () {
- this.deleteList = []
- this.domains = [{
- referx: '',
- refery: '',
- x: '',
- y: '',
- id: ''
- }]
- this.dialogVisible3 = false
+ closeForm() {
+ this.deleteList = [];
+ this.domains = [
+ {
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
+ }
+ ];
+ this.dialogVisible3 = false;
this.$refs.configForm.resetFields();
}
- },
-}
+ }
+};
</script>
<style scoped>
@@ -532,31 +625,36 @@
}
.search_thing {
- width: 350px;
- display: flex;
- align-items: center;
- }
- .search_label {
- width: 110px;
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
- font-size: 14px;
- text-align: right;
- }
+.search_label {
+ width: 110px;
+
+ font-size: 14px;
+ text-align: right;
+}
+
.data-acquisition-config {
width: 100%;
height: 100%;
overflow-y: auto;
+
.title {
height: 60px;
line-height: 60px;
}
}
+
.page {
width: 100%;
height: 30px;
text-align: right;
margin-top: 10px;
}
+
.table {
margin-top: 10px;
background-color: #fff;
@@ -564,22 +662,27 @@
height: calc(100% - 60px - 80px - 10px - 40px);
padding: 20px;
}
+
.fomItem1 {
display: flex;
height: 74px;
}
+
.fomItem2 {
display: flex;
width: 100%;
}
+
.fomItemInput {
width: 180px;
margin-right: 6px;
}
+
.fomItemInput1 {
width: 100%;
margin-right: 6px;
}
+
>>>.el-form-item__label {
padding-bottom: 0 !important;
}
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index bb08934..ab95334 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -531,7 +531,7 @@
type: 'text',
method: 'handleIssued',
disabFun: (row, index) => {
- return row.state != 1 || row.sendTime != null
+ return row.state != 1 || row.assign
}
}],
linkEvent: {
@@ -635,7 +635,7 @@
},
{
name:'model',
- index:2
+ index:5
}
]
},
--
Gitblit v1.9.3