From a4f81d8389c81893fe3e7c19218f0988b0f67993 Mon Sep 17 00:00:00 2001 From: 唐耀东 <18861537@qq.com> Date: 星期五, 18 二月 2022 20:58:23 +0800 Subject: [PATCH] 问题修改 --- src/views/device/peripheralUnit/index.vue | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/views/device/peripheralUnit/index.vue b/src/views/device/peripheralUnit/index.vue index d350538..0de5611 100644 --- a/src/views/device/peripheralUnit/index.vue +++ b/src/views/device/peripheralUnit/index.vue @@ -121,7 +121,7 @@ </el-table-column> <el-table-column label="澶栬浠g爜" width="80" align="center" prop="code"/> <el-table-column label="澶栬鍚嶇О" align="center" prop="name" show-overflow-tooltip/> - <el-table-column label="瑙勬牸鍨嬪彿" align="center" prop="model"/> + <el-table-column label="瑙勬牸鍨嬪彿" align="center" prop="model" min-width="120"/> <el-table-column label="鐢熶骇鍘傚晢" align="center" prop="manufacturer_dictText"/> <el-table-column label="鍘傚晢浠g爜" width="100" align="center" prop="vendorCode_dictText"/> <el-table-column label="娉㈢壒鐜�" width="100" align="center" prop="baudRate"> @@ -179,7 +179,7 @@ /> <!-- 娣诲姞鎴栦慨鏀瑰璁惧崟鍏冨璇濇 --> - <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body> + <Dialog :title="title" :visible.sync="open" width="50%" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="澶栬浠g爜" prop="code"> <el-input v-model="form.code" placeholder="璇疯緭鍏ュ璁句唬鐮�" :disabled="disabled"/> @@ -227,23 +227,23 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button :loading="buttonLoading" type="primary" @click="submitForm" :disabled="disabled">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> - </el-dialog> + </Dialog> <!-- 闄勪欢绐椾綋 --> - <el-dialog :title="title" :close-on-click-modal="false" :visible.sync="uploadFlag" width="500px" append-to-body> + <Dialog :title="title" :visible.sync="uploadFlag" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="闄勪欢"> - <fileUpload v-model="form.filePath" limit="1"/> + <fileUpload v-model="form.filePath" :limit="1"/> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> - </el-dialog> + </Dialog> </div> </template> @@ -358,12 +358,12 @@ }, created() { this.getList(); - this.getManufacturerList(); + }, methods: { getManufacturerList() { listManufacturer().then(res => { - this.manufacturerList = res.data + this.manufacturerList = res.data; }) }, /** 鏌ヨ澶栬鍗曞厓鍒楄〃 */ @@ -373,6 +373,7 @@ this.peripheralUnitList = response.rows; this.total = response.total; this.loading = false; + this.getManufacturerList(); }); }, // 鍙栨秷鎸夐挳 @@ -440,7 +441,7 @@ this.loading = false; this.form = response.data; this.open = true; - this.title = "淇敼澶栬鍗曞厓"; + this.title = "鏌ョ湅澶栬鍗曞厓"; }); }, /** 淇敼鎸夐挳鎿嶄綔 */ @@ -448,11 +449,12 @@ this.loading = true; this.disabled = false this.reset(); - this.getManufacturerList(); + //this.getManufacturerList(); const id = row.id || this.ids getPeripheralUnit(id).then(response => { this.loading = false; this.form = response.data; + this.form.manufacturer = parseInt(this.form.manufacturer); this.open = true; this.title = "淇敼澶栬鍗曞厓"; }); @@ -461,6 +463,12 @@ submitForm() { this.$refs["form"].validate(valid => { if (valid) { + if(this.uploadFlag){ + if(!this.form.filePath){ + this.$modal.msgWarning("璇烽�夋嫨涓婁紶闄勪欢"); + return; + } + } this.buttonLoading = true; if (this.form.id != null) { updatePeripheralUnit(this.form).then(response => { -- Gitblit v1.9.1