修改页面
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-02-14 15:02:26
 | 
			
		||||
 * @LastEditTime: 2023-07-14 15:21:15
 | 
			
		||||
 * @LastEditTime: 2023-07-14 15:55:36
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
      </el-input>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item prop="processList" :label="$t('researchquality.processName')">
 | 
			
		||||
      <el-select @change="getProcessList" v-model="dataForm.processList" multiple :placeholder="$t('researchquality.processName')">
 | 
			
		||||
      <el-select  v-model="dataForm.processList" multiple :placeholder="$t('researchquality.processName')">
 | 
			
		||||
        <el-option v-for="item in processList" :key="item.id" :label="item.processName" :value="item.id">
 | 
			
		||||
        </el-option>
 | 
			
		||||
      </el-select>
 | 
			
		||||
@@ -250,7 +250,7 @@ export default {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs["dataForm"].resetFields();
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.getInfo();
 | 
			
		||||
          this.getInfo()
 | 
			
		||||
        } else {
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
@@ -305,9 +305,6 @@ export default {
 | 
			
		||||
        .catch(() => {
 | 
			
		||||
        })
 | 
			
		||||
    },
 | 
			
		||||
    getProcessList(val) {
 | 
			
		||||
      console.log(val);
 | 
			
		||||
    },
 | 
			
		||||
    // 获取信息
 | 
			
		||||
    getInfo() {
 | 
			
		||||
      this.$http
 | 
			
		||||
@@ -324,6 +321,41 @@ export default {
 | 
			
		||||
        .catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        const processArr = this.dataForm.processList.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            id:item
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        this.dataForm.processList = processArr
 | 
			
		||||
        const productTypeArr = this.dataForm.productTypeList.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            id: item
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        this.dataForm.productTypeList = productTypeArr
 | 
			
		||||
        this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm)
 | 
			
		||||
          .then(({ data: res }) => {
 | 
			
		||||
            if (res.code !== 0) {
 | 
			
		||||
              return this.$message.error(res.msg);
 | 
			
		||||
            }
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: this.$t("prompt.success"),
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.visible = false;
 | 
			
		||||
                this.$emit("refreshDataList");
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
          .catch(() => { });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    dataFormSubmitHandle: debounce(
 | 
			
		||||
      function () {
 | 
			
		||||
        this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
@@ -340,9 +372,8 @@ export default {
 | 
			
		||||
                type: "success",
 | 
			
		||||
                duration: 500,
 | 
			
		||||
                onClose: () => {
 | 
			
		||||
                  console.log(1111);
 | 
			
		||||
                  this.visible = false;
 | 
			
		||||
                  this.$emit("successSubmit");
 | 
			
		||||
                  this.$emit("refreshDataList");
 | 
			
		||||
                },
 | 
			
		||||
              });
 | 
			
		||||
            })
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user