From c5842886b876f20d4411d9da4d8b3b4fef0c39a7 Mon Sep 17 00:00:00 2001 From: value <z1292839451@163.com> Date: 星期一, 29 四月 2024 02:25:27 +0800 Subject: [PATCH] 检验项目绑定产品,检验对象绑定产品 --- src/components/view/b2-standard.vue | 5 + src/components/tool/value-table.vue | 24 ++----- src/components/view/a5-capacity-scope.vue | 5 + src/App.vue | 4 + src/components/view/a7-standard-method.vue | 76 +++++++++++++++---------- src/view/index.vue | 8 +- src/assets/api/controller.js | 1 7 files changed, 69 insertions(+), 54 deletions(-) diff --git a/src/App.vue b/src/App.vue index 89018ea..834f3fb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -308,4 +308,8 @@ text-overflow: ellipsis; } + .el-cascader-menu__wrap{ + height: 300px; + } + </style> diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js index add2ebd..3c5b676 100644 --- a/src/assets/api/controller.js +++ b/src/assets/api/controller.js @@ -178,6 +178,7 @@ selectStandardProductList: "/standardTree/selectStandardProductList", //閫氳繃鏍囧噯鏍戞煡璇㈠搴旂殑妫�楠岄」鐩� selectStandardProductListByMethodId: "/standardTree/selectStandardProductListByMethodId", //閫氳繃妫�楠屾爣鍑嗘煡璇㈡楠岄」鐩� selectStandardMethodEnum: "/standardTree/selectStandardMethodEnum", //鑾峰彇鏍囧噯鏍戜笅鏍囧噯鏂规硶鏋氫妇 + getStandardTree2: "/standardTree/getStandardTree2", //鑾峰彇浜у搧鏋舵瀯 } const standardMethod = { diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue index c1e3dd7..4b530fc 100644 --- a/src/components/tool/value-table.vue +++ b/src/components/tool/value-table.vue @@ -85,11 +85,11 @@ width: 100%; } - .handleBtn.is-disabled .el-upload:focus { + .value-table .handleBtn.is-disabled .el-upload:focus { color: #C0C4CC !important; } - .avatar-uploader .el-upload { + .value-table .avatar-uploader .el-upload { height: 80px; display: flex; align-items: center; @@ -157,7 +157,7 @@ </el-pagination> </div> <el-dialog title="缂栬緫" :visible.sync="upDia" :width="data.row==1?'500px':500+data.row * 200 + 'px'" append-to-body> - <div class="body" v-if="upDia" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;"> + <div class="body" style="max-height: 550px;overflow-y: auto;padding: 5px 10px 5px 0;"> <div v-if="data.row > 1"> <div v-for="(a, ai) in upHead" :key="ai" style="line-height: 50px;"> <el-col :span="6/data.row" style="text-align: right;" :offset="1"> @@ -183,7 +183,7 @@ style="width: 80px;height: 80px;border-radius: 6px;"> <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> - <el-cascader :value="upData[a.label]" :options="data.cascaderField[a.label].tree" + <el-cascader :value="upData[a.label]" :options="data.cascaderField[a.label].tree" :show-all-levels="false" v-if="showCascader(a.label)" :placeholder="`璇烽�夋嫨${a.value}`" clearable :props="data.cascaderField.props" size="small" style="width: 100%;" @change="m=>handleCascader(m,a.label)" filterable></el-cascader> @@ -252,7 +252,7 @@ </el-upload> <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :placeholder="`璇烽�夋嫨${a.value}`" :props="data.cascaderField.props" size="small" style="width: 100%;" - @change="m=>handleCascader(m,a.label)" filterable></el-cascader> + @change="m=>handleCascader(m,a.label)" filterable :show-all-levels="false"></el-cascader> </el-col> </div> </div> @@ -280,7 +280,7 @@ </el-upload> <el-cascader :options="data.cascaderField[a.label].tree" v-if="showCascader(a.label)" clearable :placeholder="`璇烽�夋嫨${a.value}`" :props="data.cascaderField.props" size="small" style="width: 100%;" - @change="m=>handleCascader(m,a.label)" filterable></el-cascader> + @change="m=>handleCascader(m,a.label)" filterable :show-all-levels="false"></el-cascader> </el-col> </el-row> </div> @@ -450,16 +450,6 @@ ], param: {} } - }, - watch: { - tableData: { - deep: true, - handler: function() { - this.$nextTick(() => { - this.$refs.eltable.doLayout() - }) - } - }, }, beforeUpdate() { this.$nextTick(() => { @@ -710,7 +700,7 @@ else if (val.method == 'doDiy') { if (val.id == 'update') { this.upDia = true, - this.upData = this.HaveJson(row) + this.upData = this.HaveJson(row) this.upHead = this.HaveJson(this.tableHead) this.upHead.forEach((item, index) => { if (this.data.cascaderField && this.data.cascaderField[item.label]) { diff --git a/src/components/view/a5-capacity-scope.vue b/src/components/view/a5-capacity-scope.vue index 3618d06..9cd06e3 100644 --- a/src/components/view/a5-capacity-scope.vue +++ b/src/components/view/a5-capacity-scope.vue @@ -224,7 +224,8 @@ props:{ value:'name', label:'name', - checkStrictly: true + checkStrictly: true, + multiple: true } }, requiredAdd: ['sonLaboratory', 'inspectionItem', 'manHour', 'inspectionItemType', 'inspectionValueType', @@ -335,6 +336,7 @@ if (this.radio === '0') { this.showItemParameter = true; this.showTestObject = false; + this.selectTestObjectByName() /* this.$nextTick(() => { this.$refs.itemParameterTable.selectList() }) */ @@ -347,6 +349,7 @@ refreshTable() { if (this.radio === '0') { this.$refs['itemParameterTable'].selectList() + } else { this.$refs['testObjectTable'].selectList() } diff --git a/src/components/view/a7-standard-method.vue b/src/components/view/a7-standard-method.vue index 60a635d..b210005 100644 --- a/src/components/view/a7-standard-method.vue +++ b/src/components/view/a7-standard-method.vue @@ -95,7 +95,7 @@ font: '缂栬緫', type: 'text', method: 'doDiy', - field: ['sampleType', 'createUserName', 'updateUserName', '妫�楠屽璞�=structureTestObjectId'] + field: ['createUserName', 'updateUserName'] }, { id: 'delete', font: '鍒犻櫎', @@ -103,9 +103,6 @@ method: 'doDiy' }], tagField: { - structureTestObjectId: { - select: [] - }, isProduct: { select: [{ value: 0, @@ -126,14 +123,11 @@ label: '鏄�' }] }, - qualificationId:{ + qualificationId: { select: [] } }, selectField: { - structureTestObjectId: { - select: [] - }, isProduct: { select: [{ value: 0, @@ -154,12 +148,24 @@ label: '鏄�' }] }, - qualificationId:{ + qualificationId: { select: [] } }, - requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct','isUse','nameEn'], - requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct','isUse','nameEn'] + cascaderField: { + structureTestObjectId: { + tree: [] + }, + // 瀛楁閰嶇疆 + props: { + value: 'value', + label: 'label', + checkStrictly: true, + multiple: true + }, + }, + requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct', 'isUse', 'nameEn'], + requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct', 'isUse', 'nameEn'] }, entityCopy: {}, upIndex: 0, @@ -170,14 +176,16 @@ mounted() { this.entityCopy = this.HaveJson(this.componentData.entity) this.getPower() - this.selectTestObjectByName() this.getQualificationList() + this.selectTestObjectByName() }, methods: { refreshTable() { this.$refs['ValueTable'].selectList() + this.selectTestObjectByName() }, refresh() { + this.selectTestObjectByName() this.componentData.entity = this.HaveJson(this.entityCopy) this.upIndex++ }, @@ -209,27 +217,14 @@ openAdd() { this.$refs.ValueTable.openAddDia(this.$api.standardMethod.addStandardMethod); }, - selectTestObjectByName() { - this.$axios.get(this.$api.capacityScope.selectTestObjectByName).then(res => { - let data = [] - res.data.forEach(a => { - data.push({ - label: a.specimenName, - value: a.id - }) - }) - this.componentData.selectField.structureTestObjectId.select = data - this.componentData.tagField.structureTestObjectId.select = data - }) - }, - getQualificationList(){ + getQualificationList() { this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "璧勮川鍚嶇О" - }).then(res => { - let list = res.data + category: "璧勮川鍚嶇О" + }).then(res => { + let list = res.data this.componentData.selectField.qualificationId.select = list this.componentData.tagField.qualificationId.select = list - }) + }) // this.$axios.post(this.$api.certification.getCertificationDetail,{ // page: { // current: -1, @@ -252,7 +247,26 @@ // this.componentData.tagField.qualificationId.select = list // } // }) - } + }, + selectTestObjectByName() { + this.$axios.get(this.$api.standardTree.getStandardTree2).then(res => { + res.data.forEach(a => { + this.cascaderFieldData(a) + }) + this.componentData.cascaderField.structureTestObjectId.tree = 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) + }) + } + }, } } </script> diff --git a/src/components/view/b2-standard.vue b/src/components/view/b2-standard.vue index 0fac06d..6dbb881 100644 --- a/src/components/view/b2-standard.vue +++ b/src/components/view/b2-standard.vue @@ -143,7 +143,7 @@ </el-row> <el-row class="standard_table" v-loading="tableLoad"> <el-table class="el-table" :data="standardList" style="width: 100%;" height="220px" tooltip-effect="dark" - highlight-current-row @row-click="rowClick" ref="standard" :key="Math.random()"> + :highlight-current-row="true" @row-click="rowClick" ref="standard"> <el-table-column prop="code" label="鏍囧噯缂栧彿" show-overflow-tooltip width="180"> <template slot-scope="scope"> <span style="color: red;font-size: 14px;">{{scope.row['code']}}</span> @@ -763,7 +763,8 @@ rowClick(row, column, event) { this.tableLoad2 = true this.$axios.post(this.$api.standardTree.selectStandardProductListByMethodId, { - id: row.id + id: row.id, + tree: this.selectTree }).then(res => { this.productList = res.data setTimeout(() => { diff --git a/src/view/index.vue b/src/view/index.vue index 827cf8e..2d2d851 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -357,7 +357,7 @@ <el-col :span="24"> <el-card :body-style="{padding: '6px'}"> <ul> - <li @click="removeTab(activeIndex)"><i class="el-icon-close"></i>鍏抽棴</li> + <li @click="removeTab(activeIndex)" v-show="menuId!=0"><i class="el-icon-close"></i>鍏抽棴</li> <li @click="allDel"><i class="el-icon-delete"></i>鍏抽棴鎵�鏈�</li> <li @click="rightDel(activeIndex)"><i class="el-icon-d-arrow-right"></i>鍏抽棴鍙充晶椤电</li> <el-divider></el-divider> @@ -430,6 +430,7 @@ query:{}, newMsg:false, timer:null, + menuId: 0 }; }, created() { @@ -463,7 +464,7 @@ this.timer&&clearInterval(this.timer); this.timer = setInterval(()=>{ this.checkForUnreadData() - },20000) + },30000) }, methods: { saveClick(){ @@ -545,7 +546,8 @@ }, // 鍙抽敭鑿滃崟 rightKeyMenu(id, e) { - if (id == 0) return + // if (id == 0) return + this.menuId = id this.activeIndex = id var x = e.clientX + 'px' var y = e.clientY + 'px' -- Gitblit v1.9.3