懒羊羊
2024-01-05 7cec010792ea5f41997b11bc7f755771e86ea219
优化
已修改1个文件
39 ■■■■ 文件已修改
jcdm-ui/src/views/main/bs/processFile/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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="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-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;