zhuo
2025-05-20 7eb190f13437b2e67788e9f4bdea725fdb165f01
src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue
@@ -105,8 +105,11 @@
          </el-col>
          <el-col :span="12" v-if="editForm.inspectionItemType == 1">
            <el-form-item label="设备绑定:" prop="deviceId">
              <el-select v-model="editForm.deviceId" clearable placeholder="请选择" size="small" style="width: 100%" multiple>
                <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
              <el-select v-model="editForm.deviceId" clearable placeholder="请选择"
                         size="small" style="width: 100%" multiple filterable>
                <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value">
                  {{item.label + ' - ' + item.managementNumber}}
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
@@ -172,6 +175,15 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="抽检类型绑定:" prop="spotCheckType">
              <el-select v-model="editForm.spotCheckType" clearable placeholder="请选择" size="small" style="width: 100%">
                <el-option v-for="item in dict.type.spot_check_type" :key="item.value" :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
<!--        <el-col :span="12">-->
<!--          <el-form-item label="字典类型:" prop="dic">-->
<!--            <el-select v-model="editForm.dic" clearable placeholder="请选择" size="small" style="width: 100%">-->
@@ -204,7 +216,7 @@
  name: "EditForm",
  // import 引入的组件需要注入到对象中才能使用
  components: {},
  dicts: ['sys_sub_lab', 'inspection_item_type', 'sys_unit', 'inspection_value_type', 'inspection_bsm'],
  dicts: ['sys_sub_lab', 'inspection_item_type', 'sys_unit', 'inspection_value_type', 'inspection_bsm', 'spot_check_type'],
  data() {
    // 这里存放数据
    return {
@@ -234,7 +246,8 @@
        inspectionItemClassEn: '', // 检验项分类EN
        method: '', // 试验方法
        radiusList: [], // 条件
        rates: '', // 条件
        rates: '', // 收费标准(元/次)
        spotCheckType: '', // 抽检类型绑定
        deviceId: [], // 设备
      },
      sampleList: [], // 检验对象下拉框
@@ -310,7 +323,8 @@
            inspectionItemClassEn: '', // 检验项分类EN
            method: '', // 试验方法
            radiusList: [], // 条件
            rates: '', // 条件
            rates: '', // 收费标准(元/次)
            spotCheckType: '', // 抽检类型绑定
        }
        this.resetForm('editForm')
      } else {
@@ -318,7 +332,9 @@
        this.editForm.sample = JSON.parse(this.editForm.sample)
        this.editForm.radiusList = this.editForm.radiusList && JSON.parse(this.editForm.radiusList)
        this.editForm.method = JSON.parse(this.editForm.method)
        this.$set(this.editForm, 'deviceId', this.editForm.deviceIds && this.editForm.deviceIds.split(","))
        const ids = this.editForm.deviceIds && this.editForm.deviceIds.split(",") || [];
        const numericIds = ids.map(Number);
        this.$set(this.editForm, 'deviceId', numericIds);
      }
    },
    // 提交编辑
@@ -448,8 +464,9 @@
      search({ status: 0 }).then((res) => {
        if (res.code === 200 && res.data) {
          this.equipOptions = res.data.map((m) => {
            m.value = m.managementNumber;
            m.value = m.id;
            m.label = m.deviceName;
            m.managementNumber = m.managementNumber;
            return m;
          });
        }