From 8231542d77a49f80a49434be6ca8bfb3ae9e1efe Mon Sep 17 00:00:00 2001 From: XiaoRuby <3114200645@qq.com> Date: 星期一, 28 八月 2023 09:26:21 +0800 Subject: [PATCH] 8-28 --- src/views/basicData/index.vue | 36 ++---------- src/views/standardLibrary/index.vue | 121 +++++++++++++++++++++------------------- src/views/laboratory/personnel/index.vue | 2 3 files changed, 71 insertions(+), 88 deletions(-) diff --git a/src/views/basicData/index.vue b/src/views/basicData/index.vue index e47537f..7aa28c5 100644 --- a/src/views/basicData/index.vue +++ b/src/views/basicData/index.vue @@ -52,12 +52,8 @@ width="30%" right :before-close="handleClose" + :title="isUpdate ? '鏇存柊' : '鏂板'" > - <template slot="title"> - <div class="addTop"> - <span>{{ isUpdate ? "鏇存柊" : "鏂板" }}鍩虹鏁版嵁</span> - </div> - </template> <el-form :model="form" :rules="rules" ref="ruleForm" class="addForm"> <el-form-item prop="material" required> <span>鏍峰搧鍚嶇О锛�</span> @@ -387,13 +383,13 @@ }); }, handleSelectionChange(val) { - this.deleteList = [] + this.deleteList = []; val.forEach((v) => { - if(v.id !== undefined) { - this.deleteList.push(v.id) + if (v.id !== undefined) { + this.deleteList.push(v.id); } - }) - console.log(`output->this.deleteList`,this.deleteList) + }); + console.log(`output->this.deleteList`, this.deleteList); }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 缁撴潫 deleteListClick() { @@ -458,12 +454,6 @@ position: relative; padding: 0 10px 10px 10px; } -.el-dialog__header { - padding: 0; -} -.el-dialog__headerbtn { - top: 0; -} .el-dialog__close { padding: 8px 0; color: #ffffff !important; @@ -479,20 +469,6 @@ } .el-dialog__body { padding: 30px 20px 0 20px; -} -.addTop { - border-top-left-radius: 10px; - border-top-right-radius: 10px; - background-color: #00a5ff; - color: #ffffff; - padding: 8px 20px; - float: left; - height: 30px; - width: 100%; -} -.addTop span { - font-size: 16px; - font-weight: 700; } .table_div { margin-top: 10px; diff --git a/src/views/laboratory/personnel/index.vue b/src/views/laboratory/personnel/index.vue index e3ae762..f4f4ee2 100644 --- a/src/views/laboratory/personnel/index.vue +++ b/src/views/laboratory/personnel/index.vue @@ -86,7 +86,7 @@ <el-select v-model="form.roleId" clearable - width="100%" + style="width: 100%" placeholder="璇烽�夋嫨鏉冮檺" > <el-option diff --git a/src/views/standardLibrary/index.vue b/src/views/standardLibrary/index.vue index 5c69021..5277b3b 100644 --- a/src/views/standardLibrary/index.vue +++ b/src/views/standardLibrary/index.vue @@ -25,16 +25,22 @@ <div class="table-header"> <div class="serve-btn"> <span class="tipMsg">{{ msg !== "" ? msg : "" }}</span> - <el-select v-model="versionValue" @change="changeSelect" placeholder="璇烽�夋嫨鐗堟湰鍙�"> + <el-select + v-model="versionValue" + @change="changeSelect" + placeholder="璇烽�夋嫨鐗堟湰鍙�" + > <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" - > + > </el-option> </el-select> - <el-button type="primary" @click="addVersionFun">鏂板鐗堟湰鍙�</el-button> + <el-button type="primary" @click="addVersionFun" + >鏂板鐗堟湰鍙�</el-button + > <el-button type="primary" icon="el-icon-plus" @@ -172,15 +178,15 @@ deleteListApi, blurUpdateApi, getVersion, - addVersion + addVersion, } from "@/api/standardLibrary"; import { selectproductModelApi } from "@/api/basicData/index"; export default { data() { return { - options:[], - versionValue: '', + options: [], + versionValue: "", deleteList: [], msg: "", isAllSelect: false, @@ -213,47 +219,49 @@ created() { this.getStandardTree(); }, - mounted(){ - - }, + mounted() {}, methods: { - async initSelect(){ - this.options = []; - this.versionValue = ""; - const response = await getVersion({"specificationsId":this.selectData.id}); - if(response.code===200 && response.data.length>0){ - this.getTableByClick(this.selectData,response.data[0]) - for(let i=0;i<response.data.length;i++){ - this.options.push({ - value: response.data[i], - label: "V" + response.data[i] - }) - this.versionValue = response.data[0]; - } - } - }, - changeSelect(){ - this.tableData = []; - this.getTableByClick(this.selectData,this.versionValue); - }, - async insertVersion(){ - const resp = await addVersion({"specificationsId":this.selectData.id}); - if(resp.code===200){ - this.initSelect(); - this.$message({ - type: 'success', - message: resp.message + async initSelect() { + this.options = []; + this.versionValue = ""; + const response = await getVersion({ + specificationsId: this.selectData.id, + }); + if (response.code === 200 && response.data.length > 0) { + this.getTableByClick(this.selectData, response.data[0]); + for (let i = 0; i < response.data.length; i++) { + this.options.push({ + value: response.data[i], + label: "V" + response.data[i], }); + this.versionValue = response.data[0]; + } } }, - addVersionFun() { - this.$confirm('纭娣诲姞鏂扮殑鐗堟湰鍙峰悧?', '鎻愮ず', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning' - }).then(() => { + changeSelect() { + this.tableData = []; + this.getTableByClick(this.selectData, this.versionValue); + }, + async insertVersion() { + const resp = await addVersion({ specificationsId: this.selectData.id }); + if (resp.code === 200) { + this.initSelect(); + this.$message({ + type: "success", + message: resp.message, + }); + } + }, + addVersionFun() { + this.$confirm("纭娣诲姞鏂扮殑鐗堟湰鍙峰悧?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { this.insertVersion(); - }).catch(() => {}); + }) + .catch(() => {}); }, filterNode(value, data) { if (!value) return true; @@ -308,7 +316,7 @@ this.getParentData(node.parent, node.data.name); // 瀛樹笅閫変腑鑺傜偣 this.selectData = data; - this.getTableByClick(data,this.versionValue); + this.getTableByClick(data, this.versionValue); this.initSelect(); } if (!("children" in data)) { @@ -324,10 +332,10 @@ this.getParentData(node.parent, this.msg); } }, - async getTableByClick(data,versionVal) { + async getTableByClick(data, versionVal) { await getProductList({ specificationsId: data.id, - version: versionVal + version: versionVal, }).then((res) => { res.data.forEach((i) => { if (i.name === undefined) { @@ -349,10 +357,9 @@ this.$router.push(`/standardLibrary/SpecificationDetails/${row.id}`); }, renderContent(h, { node, data, store }) { - // console.log('data', data) - // console.log('node', node) // 鍒ゆ柇鏄惁鏄埗鑺傜偣鎴栨枃浠跺す const isFolder = "children" in data; + console.log(`output->data`, isFolder); return ( <span class="tree-node"> {isFolder ? ( @@ -408,7 +415,7 @@ addTypeArr: [], }; this.getStandardTree(); - this.getTableByClick(this.selectData,this.versionValue); + this.getTableByClick(this.selectData, this.versionValue); }, changeCascader(data) { this.addTreeForm.addTypeArr = data; @@ -499,13 +506,13 @@ }); }, handleSelectionChange(val) { - this.deleteList = [] + this.deleteList = []; val.forEach((v) => { - if(v.id !== undefined){ - this.deleteList.push(v.id) + if (v.id !== undefined) { + this.deleteList.push(v.id); } - }) - console.log(`output->this.deleteList`,this.deleteList) + }); + console.log(`output->this.deleteList`, this.deleteList); }, // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 缁撴潫 deleteListClick() { @@ -514,7 +521,7 @@ message: res.message, type: "success", }); - this.getTableByClick(this.selectData,this.versionValue); + this.getTableByClick(this.selectData, this.versionValue); }); }, async requiredOnfocus(scope) { @@ -529,7 +536,7 @@ message: res.message, type: "success", }); - this.getTableByClick(this.selectData,this.versionValue); + this.getTableByClick(this.selectData, this.versionValue); }); }, }, @@ -665,8 +672,8 @@ width: 100%; padding-bottom: 6px; text-align: right; - .el-select{ - margin-right:10px; + .el-select { + margin-right: 10px; } } .tipMsg { -- Gitblit v1.9.3