1、设备TEEP页面新增故障率、故障时间以及加工时间(去除故障时间)字段的展示与筛选查询
2、设备管理页面新增设备与配送小组关联用于配送小组利用率图表页面
已修改2个文件
173 ■■■■■ 文件已修改
src/views/mdc/base/modules/EquipmentList/UserModal.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -2,34 +2,25 @@
  <a-modal
    :title="title"
    :maskClosable="true"
    :width="drawerWidth"
    :width="modalWidth"
    @cancel="visible=false"
    :visible="visible"
    :footer="null"
    centered
    style="height: 100%;overflow: auto;padding-bottom: 53px;">
    <template slot="title">
      <div style="width: 100%;">
        <span>{{ title }}</span>
        <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
          <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
        </span>
      </div>
    </template>
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules">
      <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
                    :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="统一编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
            <a-form-model-item label="统一编码" prop="equipmentId">
              <a-input-search v-model="model.equipmentId" :disabled="disableSubmit" @search="deviceSearch" enter-button
                              placeholder='请选择统一编码'/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备名称">
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入设备名称"
                       v-model="model.equipmentName"/>
            </a-form-model-item>
@@ -38,15 +29,15 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item v-if="isDepartType == 0" label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol"
            <a-form-model-item v-if="isDepartType == 0" label="部门分配"
                               v-show="!departDisabled">
              <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false"
                                         @back="backDepartInfo" :backDepart="true"
                                         :treeOpera="true"></j-select-equipment-depart>
            </a-form-model-item>
            <a-form-model-item v-if="isDepartType == -1" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-select :disabled="disableSubmit" placeholder="请选择设备类型"
            <a-form-model-item v-if="isDepartType == -1" label="设备类型">
              <a-select :disabled="disableSubmit" placeholder="请选择设备类型" allow-clear
                        :triggerChange="true"
                        v-model="model.equipmentType">
                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
@@ -56,7 +47,7 @@
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="车间分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled"
            <a-form-model-item label="车间分配" v-show="!productionDisabled"
                               ref="selectedProduction" prop="selectedProduction">
              <!--<j-select-equipment-production  v-decorator="['selectedProduction',{rules:[{required:true,message:'请选择车间!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>-->
              <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false"
@@ -68,11 +59,11 @@
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item v-if="isDepartType == -1" label="系统版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item v-if="isDepartType == -1" label="系统版本号">
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入系统版本号"
                       v-model="model.systemVersion"/>
            </a-form-model-item>
            <a-form-model-item v-if="isDepartType == 0" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item v-if="isDepartType == 0" label="设备类型">
              <a-select :disabled="disableSubmit" placeholder="请选择设备类型"
                        :triggerChange="true"
                        v-model="model.equipmentType">
@@ -84,7 +75,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备功率(kw)" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备功率(kw)">
              <a-input :disabled="disableSubmit" allow-clear placeholder="请输入设备功率"
                       v-model="model.devicePower"/>
            </a-form-model-item>
@@ -93,13 +84,13 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="机床IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="机床IP">
              <a-input :disabled="true" placeholder="请输入机床IP"
                       v-model="model.equipmentIp"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="机床端口" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="机床端口">
              <a-input :disabled="true" placeholder="请输入机床端口"
                       v-model="model.dataPort"/>
            </a-form-model-item>
@@ -108,14 +99,14 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="驱动类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="驱动类型">
              <j-dict-select-tag :disabled="true" placeholder="请选择驱动类型"
                                 :triggerChange="true" dictCode="mdc_driveType"
                                 v-model="model.driveType" allow-clear/>
                                 v-model="model.driveType"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备型号">
              <a-input :disabled="true" allow-clear placeholder="请输入设备型号"
                       v-model="model.equipmentModel"/>
            </a-form-model-item>
@@ -124,30 +115,28 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="系统类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="系统类型">
              <j-dict-select-tag placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type"
                                 :disabled="disableSubmit"
                                 v-model="model.systemType" allow-clear/>
                                 :disabled="disableSubmit" v-model="model.systemType"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备级别" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备级别">
              <j-dict-select-tag placeholder="请选择设备级别" dictCode="device_level" v-model="model.deviceLevel"
                                 :disabled="disableSubmit" allow-clear/>
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="设备种类" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备种类">
              <j-dict-select-tag placeholder="请选择设备种类" dictCode="device_category" v-model="model.deviceCategory"
                                 :disabled="disableSubmit"
                                 allow-clear/>
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="排序">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入排序"
                       v-model="model.sortNo" style="width: 100%"/>
            </a-form-model-item>
@@ -155,8 +144,14 @@
        </a-row>
        <a-row :gutter="24">
          <a-col :span='24'>
            <a-form-model-item label="设备图片" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
          <a-col :span='12'>
            <a-form-model-item label="配送小组" prop="teamCode">
              <j-dict-select-tag placeholder="请选择配送小组" dictCode="mdc_staff_team" v-model="model.teamCode"
                                 :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
            <a-form-model-item label="设备图片">
              <j-image-upload v-model="model.equipmentImage" :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
@@ -177,7 +172,7 @@
        <a-row :gutter="24">
          <a-col :span='12'>
            <a-form-model-item v-if="isDepartType == 0" label="系统版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item v-if="isDepartType == 0" label="系统版本号">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入系统版本号"
                       v-model="model.systemVersion"/>
            </a-form-model-item>
@@ -235,36 +230,16 @@
        departDisabled: false, //是否是我的部门调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth: 800,
        drawerWidth: 700,
        modalToggleFlag: true,
        modalWidth: 900,
        confirmDirty: false,
        userId: '', //保存用户id
        // disableSubmit:false,
        disableSubmit: true,
        dateFormat: 'YYYY-MM-DD',
        form: this.$form.createForm(this),
        validatorRules: {
          // equipmentId: [{required: false, message: '请选择设备编号!'}, {validator: this.validatequipmentId}],
          equipmentId:
            [
              {
                required: true, message: '请选择设备编号!'
              }
              // {
              // validator: this.validatequipmentId
              // }
            ],
          // trigger: 'blur' // 触发方式
          selectedProduction:
            [
              {
                required: true, message: '请选择车间'
              }
            ]
          equipmentId: [{ required: true, message: '请选择设备编号!' }],
          selectedProduction: [{ required: true, message: '请选择车间' }],
          teamCode: [{ required: true, message: '请选择配送小组' }]
        },
        departIdShow: false,
        title: '操作',
@@ -328,8 +303,6 @@
      this.queryGroup()
      this.queryTreeData()
      this.getAppPlatformName()
      // this.initRoleList()
      // this.initTenantList()
    },
    computed: {
      uploadAction: function() {
@@ -363,11 +336,7 @@
        getAction(this.url.queryEquipmentType).then(res => {
          if (res.success) {
            this.selectList = res.result
            // this.selectList = res.result.map((item, index, arr) => {
            //   return { label: item.id, value: item.equipmentTypeName + '' }
            // })
          } else {
            // this.$message.warning(res.message)
            this.$notification.warning({
              message: '消息',
              description: res.message
@@ -417,46 +386,31 @@
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize()
        // that.userId = record.id;
        // console.log(record)
        if (record.systemValue != null) {
          this.systemValue = record.systemValue
        } else {
          this.systemValue = '3'
        }
        that.model = Object.assign({}, record)
        // that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record);
        // this.model = Object.assign({}, record)
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
            'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue'))
        })
        if (record.hasOwnProperty('id')) {
          // that.getUserRoles(record.id);
          that.getUserDeparts(record.id)
        }
        // console.log('that.model=',that.model)
      },
      isDisabledAuth(code) {
        return disabledAuthFilter(code)
      },
      //窗口最大化切换
      toggleScreen() {
        if (this.modalToggleFlag) {
          this.modalWidth = window.innerWidth
        } else {
          this.modalWidth = 800
        }
        this.modalToggleFlag = !this.modalToggleFlag
      },
      // 根据屏幕变化,设置抽屉尺寸
      resetScreenSize() {
        let screenWidth = document.body.clientWidth
        if (screenWidth < 500) {
          this.drawerWidth = screenWidth
        if (screenWidth < 900) {
          this.modalWidth = screenWidth
        } else {
          this.drawerWidth = 700
          this.modalWidth = 900
        }
      },
      getUserDeparts(userid) {
@@ -477,10 +431,7 @@
            }
            that.model.selectedDeparts = selectDepartKeys.join(',')
            // that.model.selectedProduction = selectDepartKeys.join(",")
            that.nextDepartOptions = departOptions
            // console.log('that.nextDepartOptions=',that.nextDepartOptions)
          }
        })
@@ -502,13 +453,11 @@
            that.model.selectedProduction = selectProductKeys.join(',')
            that.nextProductionOptions = ProductionOptions
            // console.log('that.nextProductionOptions=',that.nextProductionOptions)
          }
        })
        //车间的url
      },
      backDepartInfo(info) {
        // console.log(info)
        this.model.departIds = this.model.selectedDeparts
        this.nextDepartOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
@@ -516,7 +465,6 @@
        })
      },
      backProductionInfo(info) {
        // console.log(info)
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
@@ -537,7 +485,6 @@
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
        // this.$refs.form.resetFields();
      },
      moment,
      handleSubmit() {
@@ -546,10 +493,6 @@
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            //如果是上级择传入departIds,否则为空
            // if(this.model.userIdentity!==2){
            //   this.model.departIds="";
            // }
            if (this.systemValue == null) {
              this.$message.warning('请选择系统类型!')
              return false
src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue
@@ -82,7 +82,7 @@
              <a-col :md="24" :sm="24" :xs="24"
                     style="display: flex;justify-content: space-between;align-items: flex-start">
                <div>
                  <a-space style="margin-right: 20px">
                  <a-space style="margin-right: 20px;margin-bottom: 20px">
                    <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                    <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                    <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
@@ -137,12 +137,14 @@
                <template v-for="(tableHead, index) in tableHeads">
                  <th v-if="checkedList.indexOf('lyl') > -1">利用率(%)</th>
                  <th v-if="checkedList.indexOf('kjl') > -1">开机率(%)</th>
                  <th v-if="checkedList.indexOf('gzl') > -1">故障率(%)</th>
                  <th v-if="checkedList.indexOf('kjsj') > -1">开机时间(小时)</th>
                  <th v-if="checkedList.indexOf('jgsj') > -1">加工时间(小时)</th>
                  <th v-if="checkedList.indexOf('qcgz') > -1">加工时间(小时)(去除故障时间)</th>
                  <th v-if="checkedList.indexOf('djsj') > -1">待机时间(小时)</th>
                  <th v-if="checkedList.indexOf('gjsj') > -1">关机时间(小时)</th>
                  <th v-if="checkedList.indexOf('gzsj') > -1">故障时间(小时)</th>
                </template>
              </tr>
              </thead>
              <tbody>
@@ -186,11 +188,17 @@
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjl') > -1">
                    {{tableHead.openRate | numFilter}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('gzl') > -1">
                    {{tableHead.faultRate | numFilter}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjsj') > -1">
                    {{tableHead.openLong | getFormattedTime}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('jgsj') > -1">
                    {{tableHead.processLong | getFormattedTime}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('qcgz') > -1">
                    {{tableHead.removeFaultRunLong | getFormattedTime}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('djsj') > -1">
                    {{tableHead.waitLong | getFormattedTime}}
@@ -198,13 +206,15 @@
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('gjsj') > -1">
                    {{tableHead.closeLong | getFormattedTime}}
                  </td>
                  <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('gzsj') > -1">
                    {{tableHead.faultLong | getFormattedTime}}
                  </td>
                </template>
              </tr>
              </tbody>
            </table>
          </div>
        </div>
      </a-spin>
@@ -228,8 +238,6 @@
        typeTree: '',
        typeParent: 1,
        typeEquipment: 1,
        TreeIDOne: 1,
        TreeIDTwo: 2,
        deviceTypeDict: '',
        dates: [],
        equipmentTypeList: [],
@@ -249,10 +257,13 @@
        efficiencyOptions: [
          { label: '利用率', value: 'lyl' },
          { label: '开机率', value: 'kjl' },
          { label: '故障率', value: 'gzl' },
          { label: '开机时间', value: 'kjsj' },
          { label: '加工时间', value: 'jgsj' },
          { label: '加工时间(去除故障时间)', value: 'qcgz' },
          { label: '待机时间', value: 'djsj' },
          { label: '关机时间', value: 'gjsj' }
          { label: '关机时间', value: 'gjsj' },
          { label: '故障时间', value: 'gzsj' }
        ],
        checkedList: ['lyl'],
        dataList: [],
@@ -263,12 +274,6 @@
        },
        tableHeads: [],
        distinguishColorList: [],
        utilizationRateRowAverage: '',
        openRateRowAverage: '',
        openLongRowAverage: '',
        processLongRowAverage: '',
        waitLongRowAverage: '',
        closeLongRowAverage: '',
        spinning: false
      }
    },
@@ -728,17 +733,10 @@
  .dataContent {
    white-space: nowrap;
    /*margin: 0;*/
    /*border: none;*/
    border-collapse: separate;
    border-spacing: 0;
    /*table-layout: fixed;*/
    border: 1px solid #ccc;
    /*border: 1px solid #ccc;*/
    width: 100%;
    /*height: 100%;*/
    /*overflow: hidden;*/
    /*overflow-y: auto;*/
    text-align: center;
  }