qushaowei
2023-11-11 80989ae609bb5dc01191a583a30f8d08ca4f31f3
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -117,13 +117,21 @@
              :wrapperCol="wrapperCol"
              prop="useId"
            >
              <a-tree-select
              <!-- <a-tree-select
                style="width: 100%"
                :disabled="formDisabled"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择使用部门"
                tree-default-expand-all
                v-model="model.useId"
              /> -->
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择使用部门"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model="model.useId"
              />
            </a-form-model-item>
@@ -173,13 +181,21 @@
              :wrapperCol="wrapperCol"
              prop="manageId"
            >
              <a-tree-select
              <!-- <a-tree-select
                :disabled="formDisabled"
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择维护部门"
                tree-default-expand-all
                v-model="model.manageId"
              /> -->
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择维护部门"
                :triggerChange="true"
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model="model.manageId"
              />
            </a-form-model-item>
@@ -319,7 +335,10 @@
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="model.operatingSystem=='yes'">
          <a-col
            :span="6"
            v-if="model.operatingSystem=='yes'"
          >
            <a-form-model-item
              label="系统"
              :labelCol="labelCol"
@@ -348,12 +367,12 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
              <a-form-model-item
                label="坐标数量"
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                prop="coordinateNum"
              >
            <a-form-model-item
              label="坐标数量"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="coordinateNum"
            >
              <a-input-number
                v-model="model.coordinateNum"
                :disabled="formDisabled"
@@ -691,8 +710,8 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
          </a-row>
          <a-row hidden>
        </a-row>
        <a-row hidden>
          <a-col :span="6">
            <a-form-model-item
              label="平均使用率"
@@ -902,8 +921,8 @@
      default: false,
      required: false
    },
    caytegoryParam:{
      type:String,
    caytegoryParam: {
      type: String,
      default: '',
      required: false
    }
@@ -990,7 +1009,7 @@
        propertyStatus: [
          { required: true, message: '请选择资产状态!' },
        ],
        system:[
        system: [
          { required: true, message: '请输入系统!' },
        ]
      },
@@ -998,7 +1017,7 @@
        add: "/eam/equipment/add",
        edit: "/eam/equipment/edit",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getCategoryFlag:"/eam/equipmentCategory/queryById"
        getCategoryFlag: "/eam/equipmentCategory/queryById"
      },
      treeData: [],
      needSpecific: false,
@@ -1018,8 +1037,8 @@
    edit(record) {
      console.log(this.disabled)
      this.model = Object.assign({}, record);
      if(!this.model.id){
          this.model.equipmentStatus = '1'
      if (!this.model.id) {
        this.model.equipmentStatus = '1'
      }
      this.visible = true;
    },
@@ -1167,9 +1186,9 @@
    },
    onSearchPrecisionParametersTemplate() {
      if(this.model.num ==''||this.model.num==undefined||this.model.num==null){
           this.$message.warn("请先填写统一编码")
           return false;
      if (this.model.num == '' || this.model.num == undefined || this.model.num == null) {
        this.$message.warn("请先填写统一编码")
        return false;
      }
      this.$refs.PrecisionParametersTemplateList.list();
      this.$refs.PrecisionParametersTemplateList.title = "选择设备精度模板";
@@ -1220,32 +1239,32 @@
        })
      }
      //改变技术状态鉴定周期
      if(this.model.equipmentCategoryId!==null&&this.model.equipmentCategoryId!=''){
      if (this.model.equipmentCategoryId !== null && this.model.equipmentCategoryId != '') {
        var value = this.model.equipmentCategoryId;
        getAction(this.url.getCategoryFlag,{id:value}).then(res=>{
             if(res.result.equipmentCategoryUda1!=='weldingMachine'&&res.result.equipmentCategoryUda11!=='filesCarousel'&&res.result.equipmentCategoryUda1!=='tester'){
                if(val==='A'){
                  this.model.checkPeriod=365*3+'';
                }
                if(val==='B'||val==='C'||val==='D'){
                  this.model.checkPeriod=365*4+'';
                }
             }
             this.model = Object.assign({},this.model);
        getAction(this.url.getCategoryFlag, { id: value }).then(res => {
          if (res.result.equipmentCategoryUda1 !== 'weldingMachine' && res.result.equipmentCategoryUda11 !== 'filesCarousel' && res.result.equipmentCategoryUda1 !== 'tester') {
            if (val === 'A') {
              this.model.checkPeriod = 365 * 3 + '';
            }
            if (val === 'B' || val === 'C' || val === 'D') {
              this.model.checkPeriod = 365 * 4 + '';
            }
          }
          this.model = Object.assign({}, this.model);
        })
      }
    },
    categoryChange(value){
       getAction(this.url.getCategoryFlag,{id:value}).then(res=>{
             if(res.result.equipmentCategoryUda1==='weldingMachine'){
                this.model.checkPeriod=365*3+'';
             }else if(res.result.equipmentCategoryUda1==='filesCarousel'){
                this.model.checkPeriod=365*4+'';
             }else if(res.result.equipmentCategoryUda1==='tester'){
                this.model.checkPeriod=365*1+'';
             }
             this.model = Object.assign({},this.model);
       })
    categoryChange(value) {
      getAction(this.url.getCategoryFlag, { id: value }).then(res => {
        if (res.result.equipmentCategoryUda1 === 'weldingMachine') {
          this.model.checkPeriod = 365 * 3 + '';
        } else if (res.result.equipmentCategoryUda1 === 'filesCarousel') {
          this.model.checkPeriod = 365 * 4 + '';
        } else if (res.result.equipmentCategoryUda1 === 'tester') {
          this.model.checkPeriod = 365 * 1 + '';
        }
        this.model = Object.assign({}, this.model);
      })
    }
  },
  computed: {