“linengliang”
2023-10-29 50706e13d5df93ceb541d39810df5845b5af7d71
src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -32,8 +32,9 @@
                placeholder="请选择设备所属分类"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="mom_eam_equipment_category,name,id"
                :dictCode="caytegoryParam==='all'?'mom_eam_equipment_category,name,id':'mom_eam_equipment_category,name,id,equipment_category_uda1 = '+'\''+caytegoryParam+'\''"
                v-model="model.equipmentCategoryId"
                @change="categoryChange"
              />
            </a-form-model-item>
          </a-col>
@@ -46,7 +47,7 @@
            >
              <a-input
                v-model="model.num"
                placeholder="请输入设备编号"
                placeholder="请输入统一 编号"
                :disabled="formDisabled"
              ></a-input>
            </a-form-model-item>
@@ -79,6 +80,8 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="规格"
@@ -109,6 +112,43 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="使用部门"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="useId"
            >
              <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"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="工区"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="factoryModelId"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择工区"
                :triggerChange="true"
                dictCode="mom_base_area,name,id,del_flag!='1'"
                v-model="model.factoryModelId"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="设备图片"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@@ -120,9 +160,11 @@
              ></j-image-upload>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
            style="font-size: large;font-style: italic;color: #f20707;"
          >维护及使用信息</a-divider>
          <a-col :span="6">
            <a-form-model-item
@@ -139,24 +181,6 @@
                placeholder="请选择维护部门"
                tree-default-expand-all
                v-model="model.manageId"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="使用部门"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="useId"
            >
              <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"
              />
            </a-form-model-item>
          </a-col>
@@ -179,26 +203,26 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="资产制造商"
              label="ABC标识"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="constructorId"
              prop="equipmentImportanceId"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择资产制造商"
                placeholder="请选择ABC标识"
                :triggerChange="true"
                dictCode="mom_base_constructor,name,id,status!='0' and del_flag!='1'"
                v-model="model.constructorId"
                dictCode="ABC-standard-result"
                @change="changeNeedSpecific"
                v-model="model.equipmentImportanceId"
              />
            </a-form-model-item>
          </a-col>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >状态及标识</a-divider>
          <a-col :span="6">
          <a-col
            :span="6"
            v-if="needSpecific"
          >
            <a-form-model-item
              label="关键设备标识"
              :labelCol="labelCol"
@@ -215,6 +239,187 @@
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="安全配置"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="securityConfiguration"
            >
              <a-input
                v-model="model.securityConfiguration"
                :disabled="formDisabled"
                placeholder="请输入安全配置"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="冷却系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="coolingSystem"
            >
              <j-dict-select-tag
                allow-clear
                v-model="model.coolingSystem"
                :disabled="formDisabled"
                placeholder="请输入冷却系统"
                :triggerChange="true"
                dictCode="cooling_system"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="灭火器"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="fireExtinguisher"
            >
              <a-input
                v-model="model.fireExtinguisher"
                :disabled="formDisabled"
                placeholder="请输入灭火器"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="灭火器有效期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="fireExtinguisherValidityPeriod"
            >
              <a-input
                v-model="model.fireExtinguisherValidityPeriod"
                :disabled="formDisabled"
                placeholder="请输入灭火器有效期"
              ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="操作系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="operatingSystem"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="是否有操作系统"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="operation_flag"
                v-model="model.operatingSystem"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6" v-if="model.operatingSystem=='yes'">
            <a-form-model-item
              label="系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="system"
            >
              <a-input
                v-model="model.system"
                :disabled="formDisabled"
                placeholder="请输入系统"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="端口"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="port"
            >
              <a-input
                v-model="model.port"
                :disabled="formDisabled"
                placeholder="请输入端口"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
              <a-form-model-item
                label="坐标数量"
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                prop="coordinateNum"
              >
              <a-input-number
                v-model="model.coordinateNum"
                :disabled="formDisabled"
                placeholder="请输入坐标数量"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="资产制造商"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="constructorId"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择资产制造商"
                :triggerChange="true"
                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>
        <a-row>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >状态及标识</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="设备状态"
@@ -249,6 +454,63 @@
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="资产状态"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="propertyStatus"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请输入资产状态"
                :triggerChange="true"
                dictCode="property_status"
                v-model="model.propertyStatus"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row v-if="model.propertyStatus=='warranty'">
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >质保日期</a-divider>
          <a-col :span="6">
            <a-form-model-item
              label="质保开始日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyStart"
            >
              <j-date
                :disabled="formDisabled"
                style="width: 100%;"
                placeholder="请选择开始日期"
                class="query-group-cust"
                v-model="model.warrantyStart"
              ></j-date>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="质保结束日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="warrantyEnd"
            >
              <j-date
                :disabled="formDisabled"
                style="width: 100%;"
                placeholder="请选择结束日期"
                class="query-group-cust"
                v-model="model.warrantyEnd"
              ></j-date>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
@@ -282,6 +544,7 @@
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="验收日期"
@@ -311,7 +574,9 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
        </a-row>
        <a-row>
          <!-- <a-col :span="6">
            <a-form-model-item
              label="工区"
              :labelCol="labelCol"
@@ -324,7 +589,7 @@
                :disabled="formDisabled"
              ></a-input>
            </a-form-model-item>
          </a-col>
          </a-col> -->
          <a-col :span="6">
            <a-form-model-item
              label="重量"
@@ -339,6 +604,7 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="重量计量单位"
@@ -381,6 +647,8 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="6">
            <a-form-model-item
              label="资金来源"
@@ -411,119 +679,6 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="安全配置"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="securityConfiguration"
            >
              <a-input
                v-model="model.securityConfiguration"
                :disabled="formDisabled"
                placeholder="请输入安全配置"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="冷却系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="coolingSystem"
            >
              <a-input
                v-model="model.coolingSystem"
                :disabled="formDisabled"
                placeholder="请输入冷却系统"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="灭火器"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="fireExtinguisher"
            >
              <a-input
                v-model="model.fireExtinguisher"
                :disabled="formDisabled"
                placeholder="请输入灭火器"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="灭火器有效期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="fireExtinguisherValidityPeriod"
            >
              <a-input
                v-model="model.fireExtinguisherValidityPeriod"
                :disabled="formDisabled"
                placeholder="请输入灭火器有效期"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="操作系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="operatingSystem"
            >
              <a-input
                v-model="model.operatingSystem"
                :disabled="formDisabled"
                placeholder="请输入操作系统"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="system"
            >
              <a-input
                v-model="model.system"
                :disabled="formDisabled"
                placeholder="请输入系统"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="端口"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="port"
            >
              <a-input
                v-model="model.port"
                :disabled="formDisabled"
                placeholder="请输入端口"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="坐标数量"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="coordinateNum"
            >
              <a-input-number
                v-model="model.coordinateNum"
                :disabled="formDisabled"
                placeholder="请输入坐标数量"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="备注"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@@ -536,10 +691,8 @@
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          >ABC标识</a-divider>
          </a-row>
          <a-row hidden>
          <a-col :span="6">
            <a-form-model-item
              label="平均使用率"
@@ -558,6 +711,8 @@
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row hidden>
          <a-col :span="6">
            <a-form-model-item
              label="可替换性"
@@ -614,24 +769,6 @@
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="故障频率"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="standardE"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择故障频率"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="ABC-standardE"
                @change="standardResultCompute"
                v-model="model.standardE"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="设备价值"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@@ -648,23 +785,8 @@
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="6">
            <a-form-model-item
              label="ABC标识"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="equipmentImportanceId"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="formDisabled"
                placeholder="请选择ABC标识"
                :triggerChange="true"
                dictCode="ABC-standard-result"
                v-model="model.equipmentImportanceId"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
@@ -749,6 +871,7 @@
      ></process-parameters-template-list>
      <precision-parameters-template-list
        ref="PrecisionParametersTemplateList"
        :num="model.num"
        @sendPrecisionParametersTemplateRecord='sendPrecisionParametersTemplateRecord'
      ></precision-parameters-template-list>
    </a-spin>
@@ -779,6 +902,11 @@
      default: false,
      required: false
    },
    caytegoryParam:{
      type:String,
      default: '',
      required: false
    }
  },
  data() {
    return {
@@ -789,11 +917,11 @@
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 },
        sm: { span: 10 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
        sm: { span: 14 },
      },
      confirmLoading: false,
@@ -823,28 +951,57 @@
        equipmentCategoryId: [
          { required: true, message: '请选则设备类别!' },
        ],
        specification:[
        { required: true, message: '请选则设备规格!' },
        specification: [
          { required: true, message: '请选则设备规格!' },
        ],
        model:[
        { required: true, message: '请选则设备型号!' },
        model: [
          { required: true, message: '请选则设备型号!' },
        ],
        equipmentImportanceId:[
        { required: true, message: '请选则设备ABC标识!' },
        equipmentImportanceId: [
          { required: true, message: '请选则设备ABC标识!' },
        ],
        manageId:[
        { required: true, message: '请选择维护部门!' },
        manageId: [
          { required: true, message: '请选择维护部门!' },
        ],
        useId:[
        { required: true, message: '请选择使用部门部门!' },
        useId: [
          { required: true, message: '请选择使用部门!' },
        ],
        specificEquipment: [
          { required: true, message: '请选择关键设备标识!' },
        ],
        equipmentStatus: [
          { required: true, message: '请选择设备状态!' },
        ],
        technologyStatus: [
          { required: true, message: '请选择设备状态!' },
        ],
        workCenterId: [
          { required: true, message: '请选择设备产线!' },
        ],
        factoryModelId: [
          { required: true, message: '请选择工区!' },
        ],
        warrantyStart: [
          { required: true, message: '请选择开始日期!' },
        ],
        warrantyEnd: [
          { required: true, message: '请选择结束日期!' },
        ],
        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,
    }
  },
@@ -855,11 +1012,15 @@
  },
  methods: {
    add() {
      this
      this.edit(this.modelDefault);
    },
    edit(record) {
      console.log(this.disabled)
      this.model = Object.assign({}, record);
      if(!this.model.id){
          this.model.equipmentStatus = '1'
      }
      this.visible = true;
    },
    close() {
@@ -1006,13 +1167,17 @@
    },
    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 = "选择设备精度模板";
    },
    sendPrecisionParametersTemplateRecord(data) {
      let record = data.record;
      this.model.precisionParametersTemplateId = record.id
      this.model.precisionParametersTemplateId_dictText= record.name
      this.model.precisionParametersTemplateId_dictText = record.name
      this.model = Object.assign({}, this.model);
    },
    standardResultCompute() {
@@ -1035,6 +1200,52 @@
      }
      this.model = Object.assign({}, this.model);
    },
    changeNeedSpecific(val) {
      if (val == 'A') {
        this.needSpecific = true;
      } else {
        let that = this;
        this.$confirm({
          title: '提示',
          content: '非A类设备,是否要添加关键设备标识!',
          okText: '确认',
          cancelText: '取消',
          onOk() {
            that.needSpecific = true;
          },
          onCancel() {
            that.needSpecific = false;
          }
        })
      }
      //改变技术状态鉴定周期
      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: {