“linengliang”
2023-10-18 83830b509d3cce2dba0be3fdbc6f4db054b78d74
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -32,8 +32,9 @@
                placeholder="请选择设备所属分类"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="mom_eam_equipment_category,name,id"
                :dictCode="'mom_eam_equipment_category,name,id,equipment_category_uda1 = '+'\''+caytegoryParam+'\''"
                v-model="model.equipmentCategoryId"
                @change="categoryChange"
              />
            </a-form-model-item>
          </a-col>
@@ -129,7 +130,7 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="车间"
              label="工区"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="factoryModelId"
@@ -137,7 +138,7 @@
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择车间"
                placeholder="请选择工区"
                :triggerChange="true"
                dictCode="mom_base_area,name,id,del_flag!='1'"
                v-model="model.factoryModelId"
@@ -167,7 +168,7 @@
          >维护及使用信息</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="维修部门"
              label="维护部门"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="manageId"
@@ -177,7 +178,7 @@
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择维修部门"
                placeholder="请选择维护部门"
                tree-default-expand-all
                v-model="model.manageId"
              />
@@ -305,14 +306,17 @@
              :wrapperCol="wrapperCol"
              prop="operatingSystem"
            >
              <a-input
                v-model="model.operatingSystem"
              <j-dict-select-tag
                allow-clear
                placeholder="是否有操作系统"
                :disabled="formDisabled"
                placeholder="请输入操作系统"
              ></a-input>
                :triggerChange="true"
                dictCode="operation_flag"
                v-model="model.operatingSystem"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
          <a-col :span="6" v-if="model.operatingSystem=='yes'">
            <a-form-model-item
              label="系统"
              :labelCol="labelCol"
@@ -357,23 +361,6 @@
          </a-col>
        </a-row>
        <a-row>
          <!-- <a-col :span="6">
            <a-form-model-item
              label="产线"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="workCenterId"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择产线"
                :triggerChange="true"
                dictCode="mom_base_work_center,name,id,del_flag!='1'"
                v-model="model.workCenterId"
              />
            </a-form-model-item>
          </a-col> -->
          <a-col :span="6">
            <a-form-model-item
              label="资产制造商"
@@ -389,6 +376,39 @@
                dictCode="mom_base_constructor,name,id,status!='0' and del_flag!='1'"
                v-model="model.constructorId"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="技术状态鉴定周期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="checkPeriod"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择技术状态鉴定周期 "
                :triggerChange="true"
                dictCode="check_period"
                :disabled="true"
                v-model="model.checkPeriod"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="下次技术鉴定时间"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="nextTechnologyStatusQualificationTime"
            >
              <j-date
                :disabled="formDisabled"
                style="width: 100%;"
                placeholder="请选择日期"
                class="query-group-cust"
                v-model="model.nextTechnologyStatusQualificationTime"
              ></j-date>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -848,6 +868,7 @@
      ></process-parameters-template-list>
      <precision-parameters-template-list
        ref="PrecisionParametersTemplateList"
        :num="model.num"
        @sendPrecisionParametersTemplateRecord='sendPrecisionParametersTemplateRecord'
      ></precision-parameters-template-list>
    </a-spin>
@@ -878,6 +899,11 @@
      default: false,
      required: false
    },
    caytegoryParam:{
      type:String,
      default: '',
      required: false
    }
  },
  data() {
    return {
@@ -888,11 +914,11 @@
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 },
        sm: { span: 10 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
        sm: { span: 14 },
      },
      confirmLoading: false,
@@ -961,11 +987,15 @@
        propertyStatus: [
          { required: true, message: '请选择资产状态!' },
        ],
        system:[
          { required: true, message: '请输入系统!' },
        ]
      },
      url: {
        add: "/eam/equipment/add",
        edit: "/eam/equipment/edit",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getCategoryFlag:"/eam/equipmentCategory/queryById"
      },
      treeData: [],
      needSpecific: false,
@@ -985,6 +1015,9 @@
    edit(record) {
      console.log(this.disabled)
      this.model = Object.assign({}, record);
      if(!this.model.id){
          this.model.equipmentStatus = '1'
      }
      this.visible = true;
    },
    close() {
@@ -1131,6 +1164,10 @@
    },
    onSearchPrecisionParametersTemplate() {
      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 = "选择设备精度模板";
    },
@@ -1179,6 +1216,33 @@
          }
        })
      }
      //改变技术状态鉴定周期
      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);
        })
      }
    },
    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: {