From 2e4c2b6e96022dc4fd197ac374c7a596a78f4223 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期六, 15 二月 2025 13:31:25 +0800 Subject: [PATCH] 能力范围联调 --- src/views/structural/capabilityAndLaboratory/capability/index.vue | 70 +++++++++++++++++++++++++---------- 1 files changed, 50 insertions(+), 20 deletions(-) diff --git a/src/views/structural/capabilityAndLaboratory/capability/index.vue b/src/views/structural/capabilityAndLaboratory/capability/index.vue index 072d09b..9916b1e 100644 --- a/src/views/structural/capabilityAndLaboratory/capability/index.vue +++ b/src/views/structural/capabilityAndLaboratory/capability/index.vue @@ -52,6 +52,7 @@ :page="testObjectPage" :tableLoading="tableLoading"></lims-table> </div> </div> + <!--浜у搧缁存姢寮规--> <el-dialog title="浜у搧缁存姢" :visible.sync="diaProduct" width="600px"> <div class="body" v-if="diaProduct" style="height: 350px;overflow-y: auto;padding: 5px 0;"> <lims-table :tableData="productData" :column="productColumn" @@ -59,7 +60,23 @@ </div> <span slot="footer" class="dialog-footer"> <el-button @click="diaProduct = false">鍙� 娑�</el-button> - <el-button type="primary" @click="openAdd2" :loading="productLoad">鏂� 澧�</el-button> + <el-button type="primary" @click="editProduct('add')" :loading="productLoad">鏂� 澧�</el-button> + </span> + </el-dialog> + <!--浜у搧缁存姢缂栬緫--> + <el-dialog title="缂栬緫浜у搧缁存姢" :visible.sync="productEditDia" width="400px"> + <el-form :model="productEditForm" ref="productEditForm" :rules="productRules"> + <el-form-item label="浜у搧鍚嶇О" prop="name"> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="productEditForm.name"></el-input> + </el-form-item> + <el-form-item label="浜у搧鍚嶇ОEN" prop="nameEn"> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="productEditForm.nameEn"> + </el-input> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="closeProduct">鍙� 娑�</el-button> + <el-button :loading="uploading" type="primary" @click="submitProduct">纭� 璁�</el-button> </span> </el-dialog> <el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px"> @@ -79,7 +96,7 @@ </span> </el-dialog> <!--妫�楠岄」鐩弬鏁�-缂栬緫寮规--> - <EditForm ref="editForm"></EditForm> + <EditForm ref="editForm" @refreshTable="refreshTable"></EditForm> <testObjectEditForm ref="testObjectEditForm"></testObjectEditForm> <BindPartDialog v-if="bindPartDialog" :bindPartDialog="bindPartDialog" :currentRow="currentRow" @@ -284,7 +301,7 @@ name: '缂栬緫', type: 'text', clickFun: (row) => { - this.editProduct(row); + this.editProduct('edit', row); }, }, { @@ -318,7 +335,15 @@ current:0 }, productableLoading: false, - inPower: true, + productEditDia: false, + productEditForm: { + name: '', + nameEn: '' + }, + productRules: { + name: [{ required: true, message: '璇峰~鍐欎骇鍝佸悕绉�', trigger: 'blur' }], + nameEn: [{ required: true, message: '璇峰~鍐欎骇鍝佸悕绉癊N', trigger: 'blur' }] + }, uploadDia: false, fileList: [], token: {Authorization: "Bearer " + getToken()}, @@ -330,13 +355,7 @@ type: null, // 闆朵欢缁戝畾鐨勭被鍨�--0锛氭楠屽璞★紝1锛氫骇鍝佺淮鎶� } }, - created() { - this.refreshTable() - }, mounted() { - this.token = { - 'token': sessionStorage.getItem('token') - } this.refreshTable() }, computed: { @@ -408,8 +427,8 @@ selectItemParameterList({...this.page, ...this.itemParameterForm}).then(res => { this.tableLoading = false if (res.code === 200) { - this.tableData = res.data - this.page.total = res.total + this.tableData = res.data.records + this.page.total = res.data.total } }).catch(err => { this.tableLoading = false @@ -418,8 +437,8 @@ selectTestObjectList({...this.testObjectPage, ...this.itemParameterForm}).then(res => { this.tableLoading = false if (res.code === 200) { - this.testObjectTableData = res.data - this.testObjectPage.total = res.total + this.testObjectTableData = res.data.records + this.testObjectPage.total = res.data.total } }).catch(err => { this.tableLoading = false @@ -478,19 +497,30 @@ selectProductListByObjectId({...params, ...this.productPage}).then(res => { this.productableLoading = false if (res.code === 200) return - this.productData = res.data + this.productData = res.data.records this.productPage.total = res.data.total }).catch(err => { this.productableLoading = false }) }, - // 浜у搧缁存姢-鏂板 - openAdd2(){ - + // 浜у搧缁存姢-鏂板-缂栬緫 + editProduct (type, row) { + this.productEditDia = true + if (type === 'edit') { + this.productEditForm = row + } }, - // 浜у搧缁存姢-缂栬緫 - editProduct () { + // 鎻愪氦浜у搧缁存姢淇敼 + submitProduct () { + this.$refs['productEditForm'].validate((valid) => { + if (valid) { + } + }) + }, + closeProduct() { + this.productEditDia = false + this.resetForm('productEditForm') }, // 浜у搧缁存姢-鍒犻櫎 deleteProduct (row) { -- Gitblit v1.9.3