licp
2024-04-24 3f6cd5f8b39c8fdae604090e0db3995123f28cc8
src/views/quality/teststandard/standard-form.vue
@@ -32,7 +32,7 @@
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="工序" prop="operationName">
      <!-- <el-form-item label="工序" prop="operationName">
        <el-input v-model="dataForm.operationName" placeholder="请选择工序">
          <el-button
            slot="append"
@@ -40,7 +40,7 @@
            @click="openOperationDialog()"
          ></el-button>
        </el-input>
      </el-form-item>
      </el-form-item> -->
      <el-form-item label="备注" prop="remark">
        <el-input v-model="dataForm.remark" placeholder=""></el-input>
      </el-form-item>
@@ -93,11 +93,17 @@
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button
      <!-- <el-button
        type="primary"
        :disabled="isSubmit"
        v-thinclick="`dataFormSubmit`"
        v-if="editable"
        >确定</el-button
      > -->
      <el-button
        type="primary"
        :disabled="isSubmit"
        v-thinclick="`dataFormSubmit`"
        >确定</el-button
      >
    </span>
@@ -155,6 +161,23 @@
    ZttMonacoEditor,
    operationDialog
  },
  watch:{
    visible(newVal){
      if(!newVal){
        this.dataForm = {
          id: 0,
          standardName: '',
          standardNo: '',
          remark: '',
          judgeFormula: '',
          inspectionType: null,
          operationId: null,
          operationNo: null,
          operationName: null,
        }
      }
    }
  },
  created() {
    this.funcs = funcForStandard()
    this.constants = constantForStandard()
@@ -194,20 +217,8 @@
      this.visible = true
      this.$nextTick(() => {
        this.$refs.dataForm.resetFields()
        this.dataForm = {
          id: 0,
          standardName: '',
          standardNo: '',
          remark: '',
          judgeFormula: '',
          inspectionType: null,
          operationId: null,
          operationNo: null,
          operationName: null,
        }
        if (this.dataForm.id) {
          getTestStandard(this.dataForm.id).then((response) => {
            console.log(response.data.data)
            this.dataForm = response.data.data
            // this.$refs.templateJudgmentCondition.setVal(
            //   this.dataForm.judgeFormula == null
@@ -257,6 +268,9 @@
              this.visible = false
              this.isSubmit = false
              this.$emit('refreshDataList')
            }).catch(error=>{
              console.error(error);
              this.isSubmit = false
            })
          } else {
            addTestStandard(this.dataForm).then((data) => {
@@ -264,6 +278,9 @@
              this.visible = false
              this.isSubmit = false
              this.$emit('refreshDataList')
            }).catch(error=>{
              console.error(error);
              this.isSubmit = false
            })
          }
        } else {