From 7cec010792ea5f41997b11bc7f755771e86ea219 Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期五, 05 一月 2024 08:44:34 +0800 Subject: [PATCH] 优化 --- jcdm-ui/src/views/main/bs/processFile/index.vue | 41 ++++++++++++++++++++++------------------- 1 files changed, 22 insertions(+), 19 deletions(-) diff --git a/jcdm-ui/src/views/main/bs/processFile/index.vue b/jcdm-ui/src/views/main/bs/processFile/index.vue index b10a391..a1b860d 100644 --- a/jcdm-ui/src/views/main/bs/processFile/index.vue +++ b/jcdm-ui/src/views/main/bs/processFile/index.vue @@ -82,7 +82,6 @@ </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> - <el-table border v-loading="loading" :data="processFileList" @selection-change="handleSelectionChange" v-if="processFileList.length > 0"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode"> @@ -177,8 +176,8 @@ <el-select style="width: 100%" @change="handleSelectChangeprocessesCode(form.processesCode)" v-model="form.processesCode" placeholder="璇烽�夋嫨宸ュ簭缂栧彿"> <el-option v-for="item in options" - :key="item.processesCode" - :label="item.processesCode" + :key="item.index" + :label="item.processesName" :value="item.processesCode"> </el-option> </el-select> @@ -186,11 +185,11 @@ <el-form-item label="宸ュ簭鍚嶇О" prop="processesName"> <el-input disabled v-model="form.processesName" placeholder="璇疯緭鍏ュ伐搴忓悕绉�" /> </el-form-item> - <el-form-item label="鏂囦欢缂栧彿" prop="fileCode"> - <el-input v-model="form.fileCode" placeholder="璇疯緭鍏ユ枃浠剁紪鍙�" /> - </el-form-item> - <el-form-item label="鏂囦欢鍚嶇О" prop="fileName"> - <el-input v-model="form.fileName" placeholder="璇疯緭鍏ユ枃浠跺悕绉�" /> +<!-- <el-form-item label="鏂囦欢缂栧彿" prop="fileCode">--> +<!-- <el-input v-model="form.fileCode" placeholder="璇疯緭鍏ユ枃浠剁紪鍙�" />--> +<!-- </el-form-item>--> + <el-form-item label="鏂囦欢鍚嶇О" prop="fileName"> + <el-input v-model="form.fileName" disabled placeholder="璇疯緭鍏ユ枃浠跺悕绉�" /> </el-form-item> <el-form-item label="鏂囦欢鍦板潃" prop="fileAddress"> <!-- <el-input v-model="form.fileAddress" placeholder="璇疯緭鍏ユ枃浠跺湴鍧�" />--> @@ -200,6 +199,7 @@ accept=".doc, .docx" :action="upload.url" :headers="upload.headers" + :on-remove="removes" :file-list="upload.fileList" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" @@ -302,7 +302,7 @@ processesCodeQueryParams:{ pageNum: 1, pageSize: 10, - processesCode: null, + processesCodes: null, }, // 琛ㄥ崟鍙傛暟 form: {}, @@ -317,12 +317,6 @@ processesCode: [ { required: true, message: "宸ュ簭缂栧彿涓嶈兘涓虹┖", trigger: "blur" } ], - fileCode: [ - { required: true, message: "鏂囦欢缂栫爜涓嶈兘涓虹┖", trigger: "blur" } - ], - fileName: [ - { required: true, message: "鏂囦欢鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } - ], } }; }, @@ -333,7 +327,6 @@ methods: { // 鏂囦欢涓嬭浇澶勭悊 handleDownload(row) { - console.log(row) var name = row.fileName; var url = row.fileAddress; var suffix = url.substring(url.lastIndexOf("."), url.length); @@ -353,12 +346,14 @@ }, // 鏂囦欢涓婁紶鎴愬姛澶勭悊 handleFileSuccess(response, file, fileList) { + console.log(response) this.upload.isUploading = false; this.form.fileAddress = response.url; - this.msgSuccess(response.msg); + this.form.fileName = response.originalFilename; + this.$modal.msgSuccess(response.msg); }, handleSelectChangeprocessesCode(selectedOption) { - this.processesCodeQueryParams.processesCode = selectedOption; + this.processesCodeQueryParams.processesCodes = selectedOption; listProcesses(this.queryParams).then(response => { this.form.processesName = response.rows[0].processesName; }); @@ -453,7 +448,11 @@ }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { - this.upload.fileList = [{ name: this.form.fileName, url: this.form.fileAddress }]; + this.upload.fileList = []; + if(row.fileAddress !== ""){ + this.upload.fileList = [{ name: row.fileName, url: row.fileAddress }]; + } + // this.upload.fileList = [{ name: row.fileName, url: row.fileAddress }]; this.reset(); const id = row.id || this.ids getProcessFile(id).then(response => { @@ -482,6 +481,10 @@ } }); }, + removes(){ + this.form.fileAddress = ''; + this.form.fileName = ''; + }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ids = row.id || this.ids; -- Gitblit v1.9.3