| | |
| | | </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"> |
| | |
| | | <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> |
| | |
| | | <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="请输入文件地址" />--> |
| | |
| | | accept=".doc, .docx" |
| | | :action="upload.url" |
| | | :headers="upload.headers" |
| | | :on-remove="removes" |
| | | :file-list="upload.fileList" |
| | | :on-progress="handleFileUploadProgress" |
| | | :on-success="handleFileSuccess" |
| | |
| | | processesCodeQueryParams:{ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | processesCode: null, |
| | | processesCodes: null, |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | processesCode: [ |
| | | { required: true, message: "工序编号不能为空", trigger: "blur" } |
| | | ], |
| | | fileCode: [ |
| | | { required: true, message: "文件编码不能为空", trigger: "blur" } |
| | | ], |
| | | fileName: [ |
| | | { required: true, message: "文件名称不能为空", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | methods: { |
| | | // 文件下载处理 |
| | | handleDownload(row) { |
| | | console.log(row) |
| | | var name = row.fileName; |
| | | var url = row.fileAddress; |
| | | var suffix = url.substring(url.lastIndexOf("."), url.length); |
| | |
| | | }, |
| | | // 文件上传成功处理 |
| | | 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; |
| | | }); |
| | |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | 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 => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | removes(){ |
| | | this.form.fileAddress = ''; |
| | | this.form.fileName = ''; |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |