From 1c50cb5546715fa21496fbdf2bdacb7ae8836b8a Mon Sep 17 00:00:00 2001 From: hdy <1105738590@qq.com> Date: 星期二, 11 三月 2025 13:17:53 +0800 Subject: [PATCH] 修改 --- billion-ui/src/views/main/bs/bomInfo/index.vue | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 54 insertions(+), 3 deletions(-) diff --git a/billion-ui/src/views/main/bs/bomInfo/index.vue b/billion-ui/src/views/main/bs/bomInfo/index.vue index 0edc8f3..e45adc8 100644 --- a/billion-ui/src/views/main/bs/bomInfo/index.vue +++ b/billion-ui/src/views/main/bs/bomInfo/index.vue @@ -74,6 +74,16 @@ </el-col> <el-col :span="1.5"> <el-button + plain + icon="el-icon-setting" + size="mini" + :disabled="multiple" + @click="statusChange" + v-hasPermi="['bs:bomInfo:remove']" + >鐘舵�佸彉鏇�</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="warning" plain icon="el-icon-download" @@ -97,7 +107,11 @@ <el-table-column show-overflow-tooltip="true" label="浜у搧缂栫爜" align="center" prop="productCode"/> <el-table-column show-overflow-tooltip="true" label="浜у搧鍚嶇О" align="center" prop="productName" /> <el-table-column show-overflow-tooltip="true" label="鐗堟湰" align="center" prop="version" /> - <el-table-column show-overflow-tooltip="true" label="鐘舵��" align="center" prop="status" /> + <el-table-column label="鐘舵��" align="center" prop="status"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> + </template> + </el-table-column> <el-table-column show-overflow-tooltip="true" label="澶囨敞" align="center" prop="remark" /> </el-table> @@ -124,6 +138,15 @@ <el-form-item label="浜у搧鍚嶇О" prop="productName"> <el-input v-model="form.productName" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" /> </el-form-item> + <el-form-item label="鐘舵��" prop="status"> + <el-radio-group v-model="form.status"> + <el-radio + v-for="dict in dict.type.sys_normal_disable" + :key="dict.value" + :label="dict.value" + >{{dict.label}}</el-radio> + </el-radio-group> + </el-form-item> <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> @@ -137,10 +160,11 @@ </template> <script> -import { listBomInfo, getBomInfo, delBomInfo, addBomInfo, updateBomInfo } from "@/api/main/bs/bomInfo"; +import { listBomInfo, getBomInfo, delBomInfo, addBomInfo, updateBomInfo,statusChange } from "@/api/main/bs/bomInfo"; export default { name: "BomInfo", + dicts: ['sys_normal_disable'], data() { return { // 閬僵灞� @@ -174,6 +198,7 @@ createUser: null, updateUser: null, dataSource: null, + }, // 琛ㄥ崟鍙傛暟 form: {}, @@ -194,7 +219,6 @@ this.loading = true; listBomInfo(this.queryParams).then(response => { this.bomInfoList = response.rows; - console.log(this.bomInfoList) this.total = response.total; this.loading = false; @@ -256,6 +280,33 @@ this.open = true; this.title = "淇敼鍩虹BOM"; }); + console.log(this.from.status) + }, + /** 鐘舵�佸彉鏇存寜閽搷浣� */ + statusChange(row) { + this.reset(); + const id = row.id || this.ids + getBomInfo(id).then(response => { + this.form = response.data; + }); + console.log(this.from) + this.$refs["form"].validate(valid => { + if(valid){ + if(this.from.status==='1'){ + this.from.status='0'; + updateBomInfo(this.form).then(response => { + this.$modal.msgSuccess("鍋滅敤鎴愬姛"); + this.getList(); + }); + }else{ + this.from.status='1'; + updateBomInfo(this.form).then(response => { + this.$modal.msgSuccess("鍚敤鎴愬姛"); + this.getList(); + }); + } + } + }); }, /** 鎻愪氦鎸夐挳 */ submitForm() { -- Gitblit v1.9.3