qushaowei
2024-07-25 52190152691bc217844d4f87b700274c297b104e
设备管理修改
已添加1个文件
已修改33个文件
2590 ■■■■■ 文件已修改
src/views/eam/ABC/modules/EquipmentSelectModel.vue 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ABC/modules/StreamForm.vue 795 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ABC/modules/StreamModal.vue 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfAll.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfCrane.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfEnvProEquipment.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfFilesCarousel.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfMetrological.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfPressureVessel.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfProduct.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfRide.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfTester.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfTruck.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfWeldingMachine.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/FaultCauseChart.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/FaultCauseChartEquipment.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/MTBF.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue 230 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceOrder/ActualWorkHoursEditTable.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceStandard/JSelectMaintenanceStandardModal.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceStandard3/DailyMaintenanceStandardModal.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceStandard3/JSelectMaintenanceStandardModal.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/malfunctionRepair/EquipmentList.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairStandard/RepairStandardModel.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairStandard/RepairStandardRight.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/moudles/RepairOrderFaultAnalysisReport.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/UserModal.vue 1004 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ABC/modules/EquipmentSelectModel.vue
@@ -39,6 +39,22 @@
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="6"
            >
              <a-form-item label="中心">
                <!-- <a-input
                  placeholder="中心"
                  v-model="queryParam.useId"
                /> -->
                <j-dict-select-tag
                  placeholder='请选择所属中心'
                  dictCode="mom_base_area,name,id,del_flag!='1' and type='1'"
                  v-model="queryParam.workCenterId"
                />
              </a-form-item>
            </a-col>
            <a-col :md="3">
              <span
                style="float: left;overflow: hidden;"
@@ -72,10 +88,23 @@
        :loading="loading"
        @change="handleTableChange"
      >
       <template slot="equipmentPhoto" slot-scope="text,record">
         <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
         <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
       </template>
        <template
          slot="equipmentPhoto"
          slot-scope="text,record"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            :preview="record.id"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"
          />
        </template>
      </a-table>
    </a-card>
  </a-modal>
@@ -101,7 +130,7 @@
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function(t, r, index) {
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
@@ -109,49 +138,49 @@
          title: '统一编码',
          align: 'center',
          dataIndex: 'num',
          width:200
          width: 200
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'name',
          width:200
          width: 200
        },
        {
          title: '设备型号',
          align: 'center',
          dataIndex: 'model',
          width:200
          width: 200
        },
        {
          title: '设备规格',
          align: 'center',
          dataIndex: 'specification',
          width:200
          width: 200
        },
        {
          title: 'ABC标识',
          align: "center",
          dataIndex: 'equipmentImportanceId',
          width:100
          width: 100
        },
        {
          title: '关键设备标识',
          align: "center",
          dataIndex: 'specificEquipment_dictText',
          width:100
          width: 100
        },
        {
          title: '设备状态',
          align: 'center',
          dataIndex: 'equipmentStatus_dictText',
          width:100
          width: 100
        },
        {
          title: '技术状态',
          align: 'center',
          dataIndex: 'technologyStatus_dictText',
          width:100
          width: 100
        },
      ],
      selectedRowKeys: [],
@@ -159,6 +188,7 @@
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      selectionRowsNotClear: [],
      title: '选择设备',
      ipagination: {
        current: 1,
@@ -188,14 +218,29 @@
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
          this.selectionRows = selectedRows
          // debugger
          // this.selectionRowsNotClear.push(selectedRows)
          // this.onSelectChange(selectedRows)
        },
        onSelect: (record, selected, selectedRows) => {
          if (selected) {
            this.selectionRowsNotClear.push(record);
          }
          if (!selected) {
            let delIndex = this.selectionRowsNotClear.findIndex(val => {
              return val.id === record.id
            })
            this.selectionRowsNotClear.splice(delIndex, 1);
          }
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
          }
        }),
        selectedRowKeys: this.selectedRowKeys
        selectedRowKeys: this.selectedRowKeys,
        selectedRows: this.selectionRows
      }
    }
  },
@@ -230,6 +275,9 @@
    },
    showModals(oldSelectRows) {
      this.selectionRows = []
      this.selectedRowKeys = []
      this.selectionRowsNotClear = []
      this.oldSelectRows = oldSelectRows
      this.visible = true
      this.loadData(1)
@@ -273,7 +321,8 @@
      this.loadData()
    },
    handleSubmit() {
      this.$emit('selectionRows', this.selectionRows)
      debugger
      this.$emit('selectionRows', this.selectionRowsNotClear)
      this.searchReset(0)
      this.close()
    },
src/views/eam/ABC/modules/StreamForm.vue
@@ -2,11 +2,25 @@
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- ä¸»è¡¨å•区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
      <a-form-model
        ref="form"
        :model="model"
        :rules="validatorRules"
        slot="detail"
      >
        <a-row :gutter="24">
          <a-col :span="12" >
            <a-form-model-item label="单据号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
              <a-input v-model="model.num" placeholder="系统自动生成" :disabled="true" ></a-input>
          <a-col :span="12">
            <a-form-model-item
              label="单据号"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="num"
            >
              <a-input
                v-model="model.num"
                placeholder="系统自动生成"
                :disabled="true"
              ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -144,9 +158,16 @@
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="ABC评价" :key="refKeys[0]" :forceRender="true">
    <!-- å­è¡¨å•区域 -->
    <a-tabs
      v-model="activeKey"
      @change="handleChangeTabs"
    >
      <a-tab-pane
        tab="ABC评价"
        :key="refKeys[0]"
        :forceRender="true"
      >
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
@@ -161,325 +182,332 @@
          :alwaysEdit="true"
          @valueChange="changeDate"
          :toolbarConfig="toolbarConfig"
          >
              <template slot="toolbarPrefix">
                <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">选择设备
                </a-button>
              </template>
        >
          <template slot="toolbarPrefix">
            <a-button
              type="primary"
              @click="selectEquipmentList"
              :disabled="formDisabled"
            >选择设备
            </a-button>
          </template>
        </j-vxe-table>
      </a-tab-pane>
    </a-tabs>
    <equipment-select-model ref="EquipmentSelectModal" @selectionRows="addSelectedEquipments"></equipment-select-model>
    <equipment-select-model
      ref="EquipmentSelectModal"
      @selectionRows="addSelectedEquipments"
    ></equipment-select-model>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
  import EquipmentSelectModel from './EquipmentSelectModel'
import { getAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
import EquipmentSelectModel from './EquipmentSelectModel'
  export default {
    name: 'StreamForm',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
      EquipmentSelectModel
    },
    data() {
      return {
        toolbarConfig: {
export default {
  name: 'StreamForm',
  mixins: [JVxeTableModelMixin],
  components: {
    JFormContainer,
    EquipmentSelectModel
  },
  data() {
    return {
      toolbarConfig: {
        // prefix å‰ç¼€ï¼›suffix åŽç¼€
        slot: ['prefix', 'suffix'],
        // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
        btn: ['remove', 'clearSelection']
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
        addDefaultRowNum: 0,
        validatorRules: {
        },
        refKeys: ['aBCAssessment' ],
        tableKeys:[ 'aBCAssessment' ],
        activeKey: 'streamOperation',
        // ABC评价
        aBCAssessmentTable: {
          loading: false,
          dataSource: [],
          columns: [
             {
              title: '统一编码',
              key: 'num',
               type: JVXETypes.normal,
              width:"160px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备名称',
              key: 'name',
               type: JVXETypes.normal,
              width:"160px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备型号',
              key: 'model',
               type: JVXETypes.normal,
              width:"160px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备ID',
              key: 'equipmentId',
               type: JVXETypes.hidden,
              width:"250px",
              placeholder: '请输入${title}',
              defaultValue:'',
              align:'center',
            },
            {
              title: '平均使用率',
              key: 'standardA',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardA',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '可替换性',
              key: 'standardB',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardB',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '故障影响度',
              key: 'standardC',
              type: JVXETypes.select,
              width:"230px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardC',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '生产超差度',
              key: 'standardD',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardD',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '故障频率',
              key: 'standardE',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardE',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '设备价值',
              key: 'standardF',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standardF',
              options:[],
              align:'center',
              // validateRules: [
              //     {
              //       required: true, // å¿…å¡«
              //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              //     },
              // ]
            },
            {
              title: '旧标识',
              key: 'oldStandard',
              type: JVXETypes.select,
              width:"180px",
              disabled:true,
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standard-result',
              options:[],
              align:'center',
            },
            {
              title: '新标识',
              key: 'finalStandard',
              type: JVXETypes.select,
              width:"180px",
              placeholder: '请输入${title}',
              defaultValue:'',
              dictCode:'ABC-standard-result',
              options:[],
              align:'center',
              validateRules: [
                  {
                    required: true, // å¿…å¡«
                    message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
                  },
              ]
            },
          ]
        },
        url: {
          add: "/eam/stream/add",
          edit: "/eam/stream/edit",
          queryById: "/eam/stream/queryById",
          getNum:'/eam/sysIdentity/getNumNew',
          aBCAssessment: {
            list: '/eam/stream/queryABCAssessmentByMainId'
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      model: {
      },
      // æ–°å¢žæ—¶å­è¡¨é»˜è®¤æ·»åŠ å‡ è¡Œç©ºæ•°æ®
      addDefaultRowNum: 0,
      validatorRules: {
      },
      refKeys: ['aBCAssessment'],
      tableKeys: ['aBCAssessment'],
      activeKey: 'streamOperation',
      // ABC评价
      aBCAssessmentTable: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: '统一编码',
            key: 'num',
            type: JVXETypes.normal,
            width: "160px",
            placeholder: '请输入${title}',
            disabled: true,
            align: 'center',
            defaultValue: '',
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
          {
            title: '设备名称',
            key: 'name',
            type: JVXETypes.normal,
            width: "160px",
            placeholder: '请输入${title}',
            disabled: true,
            align: 'center',
            defaultValue: '',
          },
          {
            title: '设备型号',
            key: 'model',
            type: JVXETypes.normal,
            width: "160px",
            placeholder: '请输入${title}',
            disabled: true,
            align: 'center',
            defaultValue: '',
          },
          {
            title: '设备ID',
            key: 'equipmentId',
            type: JVXETypes.hidden,
            width: "250px",
            placeholder: '请输入${title}',
            defaultValue: '',
            align: 'center',
          },
          {
            title: '平均使用率',
            key: 'standardA',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardA',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '可替换性',
            key: 'standardB',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardB',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '故障影响度',
            key: 'standardC',
            type: JVXETypes.select,
            width: "230px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardC',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '生产超差度',
            key: 'standardD',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardD',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '故障频率',
            key: 'standardE',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardE',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '设备价值',
            key: 'standardF',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standardF',
            options: [],
            align: 'center',
            // validateRules: [
            //     {
            //       required: true, // å¿…å¡«
            //       message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
            //     },
            // ]
          },
          {
            title: '旧标识',
            key: 'oldStandard',
            type: JVXETypes.select,
            width: "180px",
            disabled: true,
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standard-result',
            options: [],
            align: 'center',
          },
          {
            title: '新标识',
            key: 'finalStandard',
            type: JVXETypes.select,
            width: "180px",
            placeholder: '请输入${title}',
            defaultValue: '',
            dictCode: 'ABC-standard-result',
            options: [],
            align: 'center',
            validateRules: [
              {
                required: true, // å¿…å¡«
                message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              },
            ]
          },
        ]
      },
    },
    created () {
    },
    methods: {
      addBefore(){
          let that = this;
          let param = {
              type: 'ABCAssement',
              length: 4
          };
          getAction(this.url.getNum,param).then(res=>{
              if(res.success){
                that.model.num = res.result;
              }
          })
          this.aBCAssessmentTable.dataSource=[]
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // åŠ è½½å­è¡¨æ•°æ®
        if (this.model.id) {
          let params = { id: this.model.id }
          this.requestSubTableData(this.url.aBCAssessment.list, params, this.aBCAssessmentTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
      url: {
        add: "/eam/stream/add",
        edit: "/eam/stream/edit",
        queryById: "/eam/stream/queryById",
        getNum: '/eam/sysIdentity/getNumNew',
        aBCAssessment: {
          list: '/eam/stream/queryABCAssessmentByMainId'
        },
      /** æ•´ç†æˆformData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // å±•å¼€
          assessmentList: allValues.tablesValue[0].tableData
      }
    }
  },
  props: {
    //表单禁用
    disabled: {
      type: Boolean,
      default: false,
      required: false
    }
  },
  computed: {
    formDisabled() {
      return this.disabled
    },
  },
  created() {
  },
  methods: {
    addBefore() {
      let that = this;
      let param = {
        type: 'ABCAssement',
        length: 4
      };
      getAction(this.url.getNum, param).then(res => {
        if (res.success) {
          that.model.num = res.result;
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
      standardResultCompute(e,index) {
      let keyIndex = 'standard'+index;
      let tableData =this.$refs.aBCAssessment.getTableData();
      for(var i = 0;i<tableData.length;i++){
            let row = this.$refs.aBCAssessment.getRowById(tableData[i].equipmentId);
            row[keyIndex]=e
            this.changeDateByRow(row);
      })
      this.aBCAssessmentTable.dataSource = []
    },
    getAllTable() {
      let values = this.tableKeys.map(key => getRefPromise(this, key))
      return Promise.all(values)
    },
    /** è°ƒç”¨å®Œedit()方法之后会自动调用此方法 */
    editAfter() {
      this.$nextTick(() => {
      })
      // åŠ è½½å­è¡¨æ•°æ®
      if (this.model.id) {
        let params = { id: this.model.id }
        this.requestSubTableData(this.url.aBCAssessment.list, params, this.aBCAssessmentTable)
      }
    },
    //校验所有一对一子表表单
    validateSubForm(allValues) {
      return new Promise((resolve, reject) => {
        Promise.all([
        ]).then(() => {
          resolve(allValues)
        }).catch(e => {
          if (e.error === VALIDATE_FAILED) {
            // å¦‚果有未通过表单验证的子表,就自动跳转到它所在的tab
            this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
          } else {
            console.error(e)
          }
        })
      })
    },
    /** æ•´ç†æˆformData */
    classifyIntoFormData(allValues) {
      let main = Object.assign(this.model, allValues.formValue)
      return {
        ...main, // å±•å¼€
        assessmentList: allValues.tablesValue[0].tableData
      }
    },
    validateError(msg) {
      this.$message.error(msg)
    },
    standardResultCompute(e, index) {
      let keyIndex = 'standard' + index;
      let tableData = this.$refs.aBCAssessment.getTableData();
      for (var i = 0; i < tableData.length; i++) {
        let row = this.$refs.aBCAssessment.getRowById(tableData[i].equipmentId);
        row[keyIndex] = e
        this.changeDateByRow(row);
      }
      var standardA = this.model.standardA == null || this.model.standardA == undefined || this.model.standardA == '' ? 0 : parseInt(this.model.standardA);
      var standardB = this.model.standardB == null || this.model.standardB == undefined || this.model.standardB == '' ? 0 : parseInt(this.model.standardB);
@@ -496,83 +524,84 @@
      } else {
        this.model.finalStandard = 'C'
      }
      this.model = Object.assign({}, this.model);
      },
        //选择设备
        selectEquipmentList() {
        let ids = []
        let tableData = this.$refs.aBCAssessment.getTableData()
        let deleteData = this.$refs.aBCAssessment.getDeleteData()
        for (let i = 0; i < tableData.length; i++) {
          ids.push(tableData[i].equipmentId)
        }
        this.$refs.EquipmentSelectModal.showModals(ids)
        this.$refs.EquipmentSelectModal.title = '选择设备'
        this.$refs.EquipmentSelectModal.disableSubmit = false
      },
      addSelectedEquipments(data) {
        let tableData = this.$refs.aBCAssessment.getTableData()
        // const seletedEquipmentIds = tableData.
        var tableStr = JSON.stringify(tableData)
        const addRows = []
        for (let i = 0; i < data.length; i++) {
          var equipment = {}
          if (tableStr.indexOf(data[i].id)==-1) {
            equipment = {
              id:data[i].id,
              equipmentId: data[i].id,
              num: data[i].num,
              name: data[i].name,
              model:data[i].model,
              standardA:data[i].standardA,
              standardB:data[i].standardB,
              standardC:data[i].standardC,
              standardD:data[i].standardD,
              standardE:data[i].standardE,
              standardF:data[i].standardF,
              oldStandard:data[i].equipmentImportanceId,
              finalStandard:'D',
            }
      this.model = Object.assign({}, this.model);
    },
    //选择设备
    selectEquipmentList() {
      let ids = []
      let tableData = this.$refs.aBCAssessment.getTableData()
      let deleteData = this.$refs.aBCAssessment.getDeleteData()
      for (let i = 0; i < tableData.length; i++) {
        ids.push(tableData[i].equipmentId)
      }
      this.$refs.EquipmentSelectModal.showModals(ids)
      this.$refs.EquipmentSelectModal.title = '选择设备'
      this.$refs.EquipmentSelectModal.disableSubmit = false
    },
    addSelectedEquipments(data) {
      let tableData = this.$refs.aBCAssessment.getTableData()
      debugger
      // const seletedEquipmentIds = tableData.
      var tableStr = JSON.stringify(tableData)
      const addRows = []
      for (let i = 0; i < data.length; i++) {
        var equipment = {}
        if (tableStr.indexOf(data[i].id) == -1) {
          equipment = {
            id: data[i].id,
            equipmentId: data[i].id,
            num: data[i].num,
            name: data[i].name,
            model: data[i].model,
            standardA: data[i].standardA,
            standardB: data[i].standardB,
            standardC: data[i].standardC,
            standardD: data[i].standardD,
            standardE: data[i].standardE,
            standardF: data[i].standardF,
            oldStandard: data[i].equipmentImportanceId,
            finalStandard: 'D',
          }
          addRows.push(equipment)
        }
        this.$refs.aBCAssessment.pushRows(addRows)
      },
      changeDate(target){
            var standardA = target.row.standardA == null || target.row.standardA == undefined || target.row.standardA == '' ? 0 : parseInt(target.row.standardA);
            var standardB = target.row.standardB == null || target.row.standardB == undefined || target.row.standardB == '' ? 0 : parseInt(target.row.standardB);
            var standardC = target.row.standardC == null || target.row.standardC == undefined || target.row.standardC == '' ? 0 : parseInt(target.row.standardC);
            var standardD = target.row.standardD == null || target.row.standardD == undefined || target.row.standardD == '' ? 0 : parseInt(target.row.standardD);
            var standardE = target.row.standardE == null || target.row.standardE == undefined || target.row.standardE == '' ? 0 : parseInt(target.row.standardE);
            var standardF = target.row.standardF == null || target.row.standardF == undefined || target.row.standardF == '' ? 0 : parseInt(target.row.standardF);
            var sum = standardA + standardB + standardC + standardD + standardE + standardF;
            console.log(target)
            if (sum >= 18) {
              target.row.finalStandard = 'A'
            } else if (sum >= 10 && sum <= 17) {
              target.row.finalStandard = 'B'
            } else {
              target.row.finalStandard = 'C'
            }
      },
      changeDateByRow(row){
            var standardA = row.standardA == null || row.standardA == undefined || row.standardA == '' ? 0 : parseInt(row.standardA);
            var standardB = row.standardB == null || row.standardB == undefined || row.standardB == '' ? 0 : parseInt(row.standardB);
            var standardC = row.standardC == null || row.standardC == undefined || row.standardC == '' ? 0 : parseInt(row.standardC);
            var standardD = row.standardD == null || row.standardD == undefined || row.standardD == '' ? 0 : parseInt(row.standardD);
            var standardE = row.standardE == null || row.standardE == undefined || row.standardE == '' ? 0 : parseInt(row.standardE);
            var standardF = row.standardF == null || row.standardF == undefined || row.standardF == '' ? 0 : parseInt(row.standardF);
            var sum = standardA + standardB + standardC + standardD + standardE + standardF;
            if (sum >= 18) {
              row.finalStandard = 'A'
            } else if (sum >= 10 && sum <= 17) {
              row.finalStandard = 'B'
            } else {
              row.finalStandard = 'C'
            }
        },
    }
        addRows.push(equipment)
      }
      this.$refs.aBCAssessment.pushRows(addRows)
    },
    changeDate(target) {
      var standardA = target.row.standardA == null || target.row.standardA == undefined || target.row.standardA == '' ? 0 : parseInt(target.row.standardA);
      var standardB = target.row.standardB == null || target.row.standardB == undefined || target.row.standardB == '' ? 0 : parseInt(target.row.standardB);
      var standardC = target.row.standardC == null || target.row.standardC == undefined || target.row.standardC == '' ? 0 : parseInt(target.row.standardC);
      var standardD = target.row.standardD == null || target.row.standardD == undefined || target.row.standardD == '' ? 0 : parseInt(target.row.standardD);
      var standardE = target.row.standardE == null || target.row.standardE == undefined || target.row.standardE == '' ? 0 : parseInt(target.row.standardE);
      var standardF = target.row.standardF == null || target.row.standardF == undefined || target.row.standardF == '' ? 0 : parseInt(target.row.standardF);
      var sum = standardA + standardB + standardC + standardD + standardE + standardF;
      console.log(target)
      if (sum >= 18) {
        target.row.finalStandard = 'A'
      } else if (sum >= 10 && sum <= 17) {
        target.row.finalStandard = 'B'
      } else {
        target.row.finalStandard = 'C'
      }
    },
    changeDateByRow(row) {
      var standardA = row.standardA == null || row.standardA == undefined || row.standardA == '' ? 0 : parseInt(row.standardA);
      var standardB = row.standardB == null || row.standardB == undefined || row.standardB == '' ? 0 : parseInt(row.standardB);
      var standardC = row.standardC == null || row.standardC == undefined || row.standardC == '' ? 0 : parseInt(row.standardC);
      var standardD = row.standardD == null || row.standardD == undefined || row.standardD == '' ? 0 : parseInt(row.standardD);
      var standardE = row.standardE == null || row.standardE == undefined || row.standardE == '' ? 0 : parseInt(row.standardE);
      var standardF = row.standardF == null || row.standardF == undefined || row.standardF == '' ? 0 : parseInt(row.standardF);
      var sum = standardA + standardB + standardC + standardD + standardE + standardF;
      if (sum >= 18) {
        row.finalStandard = 'A'
      } else if (sum >= 10 && sum <= 17) {
        row.finalStandard = 'B'
      } else {
        row.finalStandard = 'C'
      }
    },
  }
}
</script>
<style scoped>
src/views/eam/ABC/modules/StreamModal.vue
@@ -1,64 +1,69 @@
<template>
  <j-modal
    :title="title"
    :width="1200"
    :width="1500"
    :visible="visible"
    :maskClosable="false"
    switchFullscreen
    :fullscreen="true"
    :fullscreen="false"
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">
    <stream-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
    @cancel="handleCancel"
  >
    <stream-form
      ref="realForm"
      @ok="submitCallback"
      :disabled="disableSubmit"
    />
  </j-modal>
</template>
<script>
  import StreamForm from './StreamForm'
import StreamForm from './StreamForm'
  export default {
    name: 'StreamModal',
    components: {
      StreamForm
export default {
  name: 'StreamModal',
  components: {
    StreamForm
  },
  data() {
    return {
      title: '',
      width: 800,
      visible: false,
      disableSubmit: false
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add();
      })
    },
    data() {
      return {
        title:'',
        width:800,
        visible: false,
        disableSubmit: false
      }
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record);
      })
    },
    methods:{
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.add();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.handleOk();
      },
      submitCallback(){
        this.$emit('ok');
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      this.$refs.realForm.handleOk();
    },
    submitCallback() {
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>
<style scoped>
src/views/eam/EquipmentListOfAll.vue
@@ -89,7 +89,7 @@
                allow-clear
                placeholder="请选择工区"
                :triggerChange="true"
                dictCode="mom_base_area,name,id,del_flag!='1'"
                dictCode="mom_base_area,name,id,del_flag!='1' and type = '2'"
                v-model="queryParam.factoryModelId"
              />
            </a-form-item>
@@ -982,7 +982,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfCrane.vue
@@ -942,7 +942,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfEnvProEquipment.vue
@@ -963,7 +963,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfFilesCarousel.vue
@@ -956,7 +956,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfMetrological.vue
@@ -956,7 +956,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfPressureVessel.vue
@@ -952,7 +952,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfProduct.vue
@@ -952,7 +952,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfRide.vue
@@ -957,7 +957,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfTester.vue
@@ -956,7 +956,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfTruck.vue
@@ -951,7 +951,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/EquipmentListOfWeldingMachine.vue
@@ -952,7 +952,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
        delete: "/eam/equipment/delete",
        deleteBatch: "/eam/equipment/deleteBatch",
        active: "/eam/equipment/active",
src/views/eam/FaultCauseChart.vue
@@ -1,6 +1,6 @@
<template>
  <a-card
    title="设备故障原因"
    title="设备故障类型统计"
    :bordered="true"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
@@ -19,6 +19,20 @@
                placeholder="请输入统一编码"
                v-model="queryParam.equipmentNum"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="使用部门">
              <j-dict-select-tag
                allow-clear
                placeholder='请选择使用部门'
                :triggerChange='true'
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model='queryParam.useId'
              />
            </a-form-item>
          </a-col>
          <a-col
@@ -109,7 +123,7 @@
import moment from 'moment'
export default {
  name: 'TeamList',
  name: 'FaultCauseChart',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    Pie,
src/views/eam/FaultCauseChartEquipment.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,189 @@
<template>
  <a-card
    title="设备故障次数统计"
    :bordered="true"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="统一编码">
              <a-input
                placeholder="请输入统一编码"
                v-model="queryParam.equipmentNum"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="使用部门">
              <j-dict-select-tag
                allow-clear
                placeholder='请选择使用部门'
                :triggerChange='true'
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model='queryParam.useId'
              />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="维修时间">
              <a-range-picker
                style="width: 100%;"
                format="YYYY-MM-DD HH:mm:ss"
                v-model="faultTime"
                @change="timeChange"
              />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <a-row>
      <a-col :span="24">
        <a-card
          :loading="loading"
          :bordered="false"
          title="最近一月设备故障次数统计"
          :style="{ marginTop: '24px' }"
        >
          <!--<a-row>
            <a-col :span="6">
              <head-info title="今日IP" :content="loginfo.todayIp"></head-info>
            </a-col>
            <a-col :span="2">
              <a-spin class='circle-cust'>
                <a-icon slot="indicator" type="environment" style="font-size: 24px"  />
              </a-spin>
            </a-col>
            <a-col :span="6">
              <head-info title="今日访问" :content="loginfo.todayVisitCount"></head-info>
            </a-col>
            <a-col :span="2">
              <a-spin class='circle-cust'>
                <a-icon slot="indicator" type="team" style="font-size: 24px"  />
              </a-spin>
            </a-col>
            <a-col :span="6">
              <head-info title="总访问量" :content="loginfo.totalVisitCount"></head-info>
            </a-col>
            <a-col :span="2">
              <a-spin class='circle-cust'>
                <a-icon slot="indicator" type="rise" style="font-size: 24px"  />
              </a-spin>
            </a-col>
          </a-row> -->
          <line-chart-multid
            :dataSource="visitInfo"
            :fields="visitFields"
          ></line-chart-multid>
        </a-card>
      </a-col>
    </a-row>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, deleteAction, postAction } from '@/api/manage'
import LineChartMultid from '@/components/chart/LineChartMultid'
import moment from 'moment'
export default {
  name: 'FaultCauseChartEquipment',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    LineChartMultid
  },
  data() {
    return {
      description: 'FaultCauseChartEquipment',
      visitFields: ['设备故障次数'],
      // visitInfo: [{ '设备故障次数': '5', type: '07-28' }, { '设备故障次数': '6', type: '07-29' }],
      visitInfo: [],
      url: {
        list: "/eam/repairOrder/getEquipmentFaultCause",
      },
      // è¡¨å¤´
      faultTime: [],
      dictOptions: {},
      superFieldList: [],
      queryParam: {}
    }
  },
  // created() {
  //   this.loadData2(1);
  // },
  methods: {
    timeChange() {
      this.queryParam.faultStartTime = moment(this.faultTime[0]).format("YYYY-MM-DD HH:mm:ss")
      this.queryParam.faultEndTime = moment(this.faultTime[1]).format("YYYY-MM-DD HH:mm:ss")
    },
    searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.faultTime = []
      this.queryParam = {}
      this.loadData(1);
    },
    loadData(arg) {
      this.loading = true;
      getAction(this.url.list, this.queryParam).then((res) => {
        if (res.success) {
          this.visitInfo = res.result.records || res.result;
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/eam/MTBF.vue
@@ -1,7 +1,7 @@
<template>
  <a-card
    :bordered="false"
    title="MTBF"
    title="故障类型统计"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
@@ -25,6 +25,20 @@
            :md="6"
            :sm="8"
          >
            <a-form-item label="使用部门">
              <j-dict-select-tag
                allow-clear
                placeholder='请选择使用部门'
                :triggerChange='true'
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-model='queryParam.useId'
              />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="维修时间">
              <a-range-picker
                style="width: 100%;"
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
@@ -249,7 +249,7 @@
                <maintenance-standard-planning-material :maintenanceStandardId='maintenanceStandardId' />
              </div>
            </a-tab-pane>
            <a-tab-pane
           <a-tab-pane
              tab='危险防控'
              key="3"
            >
@@ -270,7 +270,7 @@
              >
                <maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
              </div>
            </a-tab-pane>
            </a-tab-pane>-->
            <a-tab-pane
              tab='实际用料'
              key="5"
@@ -285,7 +285,7 @@
                  :equipmentId="this.model.equipmentId"
                ></actual-material-edit-table>
              </div>
            </a-tab-pane>-->
            </a-tab-pane>
            <a-tab-pane
              tab='实际工时'
              key="6"
src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue
@@ -441,14 +441,15 @@
  mounted() {
    this.$bus.$on('selectionRows', (data) => {
      for (let i = 0; i < data.length; i++) {
        debugger
        this.dataSource.push({
          id: data[i][0].id,
          inspectionProjectId: data[i][0].id,
          name: data[i][0].name,
          detectionStandard: data[i][0].detectionStandard,
          acceptabilityLimit: data[i][0].acceptabilityLimit,
          inspectionMethodName: data[i][0].inspectionMethod_dictText,
          inspectionTool: data[i][0].inspectionTool,
          id: data[i].id,
          inspectionProjectId: data[i].id,
          name: data[i].name,
          detectionStandard: data[i].detectionStandard,
          acceptabilityLimit: data[i].acceptabilityLimit,
          inspectionMethodName: data[i].inspectionMethod_dictText,
          inspectionTool: data[i].inspectionTool,
          inspectionCycles: this.inspectionCycles,
        })
      }
src/views/eam/modules/dailyInspectionStandard/JSelectDailylnspectionStandardModal.vue
@@ -129,6 +129,7 @@
      ],
      selectedRowKeys: [],
      selectedRows: [],
      selectionRowsNotClear: [],
      oldSelectRows: [],
      scrollTrigger: {},
@@ -163,8 +164,17 @@
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.selectionRows = selectedRows
          this.selectionRowsNotClear.push(selectedRows)
        },
        onSelect: (record, selected, selectedRows) => {
          if (selected) {
            this.selectionRowsNotClear.push(record);
          }
          if (!selected) {
            let delIndex = this.selectionRowsNotClear.findIndex(val => {
              return val.id === record.id
            })
            this.selectionRowsNotClear.splice(delIndex, 1);
          }
        },
        getCheckboxProps: record => ({
          props: {
@@ -172,13 +182,11 @@
          }
        }),
        selectedRowKeys: this.selectedRowKeys,
        selectedRows: this.selectionRows
      }
    }
  },
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
@@ -234,7 +242,6 @@
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
@@ -256,9 +263,11 @@
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    onSelectionChange(selectedRowKeys, selectedRows) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRows = selectedRows;
    },
    searchQuery() {
      this.loadData(1)
    }
src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue
@@ -13,20 +13,35 @@
      @change="handleTableChange"
      :loading="loading"
    >
      <template
        v-for="col in columns"
        :slot="col.dataIndex"
        slot-scope='text, record, index'
      >
        <div :key="col.dataIndex">
          <a-input-search
            v-if="col.dataIndex == 'materialName'"
            enter-button
            @search="onSearchMaterial(index)"
          <a-input
            :value="text"
            :read-only="true"
            @change="(e) => handleChange(e, record.key, col, index)"
            v-if="col.dataIndex == 'sparePartId'"
            auto-size
            placeholder="请输入物料名称"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="dailyMaintenanceOrderStatus!='4'"
          />
          <a-input
            :value="text"
            v-if="col.dataIndex == 'smoamUda2'"
            auto-size
            placeholder="请输入单位"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="dailyMaintenanceOrderStatus!='4'"
          />
          <j-dict-select-tag
            :value='text'
            v-if="col.dataIndex == 'smoamUda1'"
            dictCode="material_type"
            style="width: 100%;"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="dailyMaintenanceOrderStatus!='4'"
          />
          <a-input-number
            :value="text"
@@ -34,47 +49,19 @@
            :min="1"
            :max="99999"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.isLock == 'yes'||dailyMaintenanceOrderStatus!='4'"
            :disabled="dailyMaintenanceOrderStatus!='4'"
          />
        </div>
      </template>
      <span
        slot='action'
        slot-scope='text, record'
        slot-scope='text, record,index'
      >
        <a-popconfirm
          title="确认锁料吗?"
          @confirm="() => handleLock(record)"
          dailyMaintenanceOrder:actualMaterialLock
        >
          <a
            v-has="'dailyMaintenanceOrder:actualMaterialLock'"
            v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'"
          >锁料</a>
        </a-popconfirm>
        <a-divider
          v-if="record.isLock=='no'"
          type="vertical"
        />
        <a-popconfirm
          title="解锁后会自动释放库存,确认解锁吗?"
          @confirm="() => handleUnLock(record)"
        >
          <a
            v-has="'dailyMaintenanceOrder:actualMaterialLock'"
            v-if="record.isLock=='yes'&&dailyMaintenanceOrderStatus=='4'"
          >解锁</a>
        </a-popconfirm>
        <a-popconfirm
          title="确定删除吗?"
          @confirm="() => handleDelete(record.id)"
        >
          <a
            v-has="'dailyMaintenanceOrder:actualMaterialDelete'"
            v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'"
          >删除</a>
        </a-popconfirm>
        <a
          :disabled="dailyMaintenanceOrderStatus!='4'"
          @click='handleDeleteFake(index)'
        >删除</a>
        <!-- :disabled="mainId.status=='4'" -->
      </span>
    </a-table>
    <a-button
@@ -98,19 +85,22 @@
          type="primary"
          :style="{marginRight: '8px'}"
          :disabled="specialyMaintenanceOrderStatus!='4'"
        >暂存</a-button>
        >暂存</a-button> -->
        <a-button
          @click="handleOk(0)"
          type="primary"
          :disabled="specialyMaintenanceOrderStatus!='4'"
        >保存</a-button> -->
          :disabled="dailyMaintenanceOrderStatus!='4'"
        >保存</a-button>
      </a-row>
      <!-- :disabled="false" -->
    </div>
    <actual-material-select ref="actualMaterialSelect">
      <!-- @sendMaterialRecord="sendMaterialRecord" -->
    </actual-material-select>
    <j-select-spare-part-modal ref='JSelectSparePartModal' @selection2Rows="getSelectRows"></j-select-spare-part-modal>
    <j-select-spare-part-modal
      ref='JSelectSparePartModal'
      @selection2Rows="getSelectRows"
    ></j-select-spare-part-modal>
  </a-card>
</template>
<script>
@@ -194,67 +184,50 @@
      dataSource: [],
      columns: [
        {
          title: '领料出库单',
          dataIndex: 'num',
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          width: 150,
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '备件编码',
          dataIndex: 'sparePartNum',
          title: '物料名称',
          dataIndex: 'sparePartId',
          scopedSlots: { customRender: 'sparePartId' },
          align: "center",
          // className: 'red',
          // width: 250,
        },
        {
          title: '备件名称',
          dataIndex: 'sparePartName',
          title: '物料种类',
          dataIndex: 'smoamUda1',
          scopedSlots: { customRender: 'smoamUda1' },
          align: "center",
        },
        {
          title: '规格',
          dataIndex: 'specification',
          align: "center",
        },
        {
          title: '型号',
          dataIndex: 'model',
          align: "center",
        },
        {
          title: '制造商',
          dataIndex: 'constructorName',
          align: "center",
        },
        {
          title: '主单位',
          dataIndex: 'mainUnitName',
          align: "center",
        },
        {
          title: '主数量',
          align: 'center',
          dataIndex: 'mainQuantity'
        },
        {
          title: '可用数量',
          align: 'center',
          dataIndex: 'availableQuantity'
          // width: 250,
        },
        {
          title: '使用数量',
          dataIndex: 'quantity',
          align: "center",
          scopedSlots: { customRender: 'quantity' },
          className: 'red',
          // className: 'red',
        },
        {
          title: '单位',
          dataIndex: 'smoamUda2',
          align: "center",
          scopedSlots: { customRender: 'smoamUda2' },
          // className: 'red',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          scopedSlots: { customRender: 'action' }
        }
      ],
@@ -267,7 +240,7 @@
        unLock: "/eam/maintenanceOrderActualMaterial/unLock"
      },
      changeIndex: 0,
      loading:false,
      loading: false,
    }
  },
  watch: {
@@ -290,20 +263,23 @@
    //   }
    // }
  },
  // created() {
  //   this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId;
  //   this.queryParam['equipmentId'] = this.equipmentId
  //   this.loadData(1);
  // },
  created() {
    this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId;
    this.queryParam['equipmentId'] = this.equipmentId
    this.loadData(1);
  },
  methods: {
    // addMaterial() {
    //   let ids = [];
    //   for (let i = 0; i < this.dataSource.length; i++) {
    //     ids.push(this.dataSource[i].outboundOrderDetailId);
    //   }
    //   this.$refs.JSelectSparePartModal.showModals(ids);
    //   this.$refs.JSelectSparePartModal.title = '选择备件信息'
    //   this.$refs.JSelectSparePartModal.disableSubmit = false
    // },
    addMaterial() {
      let ids = [];
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].outboundOrderDetailId);
      }
      this.$refs.JSelectSparePartModal.showModals(ids);
      this.$refs.JSelectSparePartModal.title = '选择备件信息'
      this.$refs.JSelectSparePartModal.disableSubmit = false
      this.dataSource.push({ sparePartId: '', smoamUda1: '', smoamUda2: '', quantity: '', repairOrderId: this.equipmentId })
    },
    handleCancel() {
      this.$bus.$emit('closeDrawer');
@@ -322,16 +298,16 @@
      if (saveStatus == 0) {
        let materialDataSource = that.dataSource;
        let indexIdList = [];
        for (let i = 0; i < materialDataSource.length; i++) {
          if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') {
            that.$message.warning("请选择第" + (i + 1) + "行物料!");
            return false;
          }
          if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
            that.$message.warning("请填写第" + (i + 1) + "行用料数!");
            return false;
          }
        }
        // for (let i = 0; i < materialDataSource.length; i++) {
        //   if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') {
        //     that.$message.warning("请选择第" + (i + 1) + "行物料!");
        //     return false;
        //   }
        //   if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
        //     that.$message.warning("请填写第" + (i + 1) + "行用料数!");
        //     return false;
        //   }
        // }
      }
      if (that.dataSource.length === 0) {
        that.$message.warning("请添加物料!")
@@ -364,14 +340,26 @@
      console.log(column)
      const temp = [...this.dataSource]
      const target = temp[index]
      let availableQuantity = target['availableQuantity']
      if (target) {
        if (value != undefined && value != null && value != '' && availableQuantity < value) {
          this.$message.error('使用数量不能大于可用数量!')
        } else {
        }
        target[column.dataIndex] = value
        this.dataSource = temp
      // let availableQuantity = target['availableQuantity']
      // if (target) {
      //   if (value != undefined && value != null && value != '' && availableQuantity < value) {
      //     this.$message.error('使用数量不能大于可用数量!')
      //   } else {
      //   }
      //   target[column.dataIndex] = value
      //   this.dataSource = temp
      // }
      if ('sparePartId' == column.dataIndex) {
        target['sparePartId'] = value.target.value
      }
      if ('smoamUda2' == column.dataIndex) {
        target['smoamUda2'] = value.target.value
      }
      if ('quantity' == column.dataIndex) {
        target['quantity'] = value
      }
      if ('smoamUda1' == column.dataIndex) {
        target['smoamUda1'] = value
      }
    },
    onSearchMaterial(index) {
@@ -474,7 +462,7 @@
          this.loading = false
        })
    },
    getSelectRows(data){
    getSelectRows(data) {
      let newActualMaterials = [];
      for (let i = 0; i < data.length; i++) {
        newActualMaterials.push({
src/views/eam/modules/dailyMaintenanceOrder/ActualWorkHoursEditTable.vue
@@ -43,6 +43,7 @@
      >
        <a
          v-has="'dailyMaintenanceOrder:actualWorkHoursDelete'"
          :disabled="dailyMaintenanceOrderStatus!='4'"
          @click="handleDeleteFake(index)"
        >删除</a>
      </span>
src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
@@ -594,16 +594,16 @@
      for (let i = 0; i < data.length; i++) {
        let id = this.getUuiD(15);
        this.dataSource.push({
          id: id,
          maintenanceProjectId: data[i][0].id,
          name: data[i][0].name,
          standard: data[i][0].standard,
          maintenanceMethodName: data[i][0].maintenanceMethod_dictText,
          maintenanceTool: data[i][0].maintenanceTool,
          location: data[i][0].location,
          maintenanceSpecialtyName: data[i][0].maintenanceSpecialtyId_dictText,
          maintenanceRequire: data[i][0].maintenanceRequire,
          workingHourQuota: data[i][0].workingHourQuota,
          id: data[i].id,
          maintenanceProjectId: data[i].id,
          name: data[i].name,
          standard: data[i].standard,
          maintenanceMethodName: data[i].maintenanceMethod_dictText,
          maintenanceTool: data[i].maintenanceTool,
          location: data[i].location,
          maintenanceSpecialtyName: data[i].maintenanceSpecialtyId_dictText,
          maintenanceRequire: data[i].maintenanceRequire,
          workingHourQuota: data[i].workingHourQuota,
          // upload: this.upload,
          // maintenanceCycles: this.maintenanceCycles,
        })
src/views/eam/modules/dailyMaintenanceStandard/JSelectMaintenanceStandardModal.vue
@@ -168,9 +168,20 @@
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.selectionRowsNotClear.push(selectedRows)
          // this.selectionRowsNotClear.push(selectedRows)
          this.onSelectChange(selectedRows)
        },
        onSelect: (record, selected, selectedRows) => {
          if (selected) {
            this.selectionRowsNotClear.push(record);
          }
          if (!selected) {
            let delIndex = this.selectionRowsNotClear.findIndex(val => {
              return val.id === record.id
            })
            this.selectionRowsNotClear.splice(delIndex, 1);
          }
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
src/views/eam/modules/dailyMaintenanceStandard3/DailyMaintenanceStandardModal.vue
@@ -595,15 +595,15 @@
        let id = this.getUuiD(15);
        this.dataSource.push({
          id: id,
          maintenanceProjectId: data[i][0].id,
          name: data[i][0].name,
          standard: data[i][0].standard,
          maintenanceMethodName: data[i][0].maintenanceMethod_dictText,
          maintenanceTool: data[i][0].maintenanceTool,
          location: data[i][0].location,
          maintenanceSpecialtyName: data[i][0].maintenanceSpecialtyId_dictText,
          maintenanceRequire: data[i][0].maintenanceRequire,
          workingHourQuota: data[i][0].workingHourQuota,
          maintenanceProjectId: data[i].id,
          name: data[i].name,
          standard: data[i].standard,
          maintenanceMethodName: data[i].maintenanceMethod_dictText,
          maintenanceTool: data[i].maintenanceTool,
          location: data[i].location,
          maintenanceSpecialtyName: data[i].maintenanceSpecialtyId_dictText,
          maintenanceRequire: data[i].maintenanceRequire,
          workingHourQuota: data[i].workingHourQuota,
          // upload: this.upload,
          // maintenanceCycles: this.maintenanceCycles,
        })
src/views/eam/modules/dailyMaintenanceStandard3/JSelectMaintenanceStandardModal.vue
@@ -168,9 +168,20 @@
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.selectionRowsNotClear.push(selectedRows)
          // this.selectionRowsNotClear.push(selectedRows)
          this.onSelectChange(selectedRows)
        },
        onSelect: (record, selected, selectedRows) => {
          if (selected) {
            this.selectionRowsNotClear.push(record);
          }
          if (!selected) {
            let delIndex = this.selectionRowsNotClear.findIndex(val => {
              return val.id === record.id
            })
            this.selectionRowsNotClear.splice(delIndex, 1);
          }
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
src/views/eam/modules/malfunctionRepair/EquipmentList.vue
@@ -163,7 +163,7 @@
        },
      ],
      url: {
        list: "/eam/equipment/getEquipmentList",
        list: "/eam/equipment/getEquipmentTZList",
      },
    }
  },
@@ -173,7 +173,7 @@
    list() {
      this.selectedRowKeys = [];
      this.selectedRowRecord = [];
      this.queryParam.equipmentStatus = "1"
      // this.queryParam.equipmentStatus = "1"
      this.visible = true;
      this.loadData(1);
    },
@@ -225,7 +225,7 @@
        this.ipagination.current = 1
      }
      this.onClearSelected()
      this.queryParam.equipmentStatus = '1';
      // this.queryParam.equipmentStatus = '1';
      var params = this.getQueryParams()//查询条件
      this.loading = true
      getAction(this.url.list, params).then((res) => {
src/views/eam/modules/operationCertificateApply/OperationCertificateApplyForm.vue
@@ -216,13 +216,14 @@
          {
            title: '用户',
            key: 'userId',
            type: JVXETypes.selectSearch,
            type: JVXETypes.select,
            dictCode: 'sys_user,realname,id ',
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: '',
            validateRules: [{ required: true, message: '${title}不能为空' }]
          },
          // type: JVXETypes.selectSearch,
          // {
          //   title: '设备统一编码',
          //   key: 'equipmentIds',
src/views/eam/modules/repairStandard/RepairStandardModel.vue
@@ -64,14 +64,14 @@
          </a-col>
          <a-col :span="12">
            <a-form-item
              label="维修标准名称"
              label="维修标准内容"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请输入维修标准名称'"
                :placeholder="disableSubmit?'':'请输入维修标准内容'"
                v-decorator="['name', validatorRules.name ]"
              />
            </a-form-item>
src/views/eam/modules/repairStandard/RepairStandardRight.vue
@@ -25,9 +25,9 @@
            :md="8"
            :sm="8"
          >
            <a-form-item label="维修标准名称">
            <a-form-item label="维修标准内容">
              <j-input
                placeholder="请输入维修标准名称"
                placeholder="请输入维修标准内容"
                v-model="queryParam.name"
              ></j-input>
            </a-form-item>
@@ -254,7 +254,7 @@
          // sorter: true,
        },
        {
          title: '维修标准名称',
          title: '维修标准内容',
          align: 'center',
          dataIndex: 'name',
          scopedSlots: {
src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue
@@ -246,7 +246,7 @@
          dataIndex: 'userId',
          align: 'center',
          scopedSlots: { customRender: 'userId' },
          className: 'red',
          // className: 'red',
          width: 200
        },
        {
@@ -254,14 +254,14 @@
          dataIndex: 'principalContractor',
          align: 'center',
          scopedSlots: { customRender: 'principalContractor' },
          className: 'red',
          // className: 'red',
          width: 150
        },
        {
          title: '*实际工时',
          dataIndex: 'actualHour',
          align: 'center',
          className: 'red',
          // className: 'red',
          scopedSlots: { customRender: 'actualHour' },
          width: 150
        },
src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
@@ -208,7 +208,7 @@
          dataIndex: 'sparePartId',
          scopedSlots: { customRender: 'sparePartId' },
          align: "center",
          className: 'red',
          // className: 'red',
          // width: 250,
        },
        {
@@ -223,14 +223,14 @@
          dataIndex: 'actualQuantity',
          align: "center",
          scopedSlots: { customRender: 'actualQuantity' },
          className: 'red',
          // className: 'red',
        },
        {
          title: '单位',
          dataIndex: 'repairOrderAmUda1',
          scopedSlots: { customRender: 'repairOrderAmUda1' },
          align: "center",
          className: 'red',
          // className: 'red',
        },
        {
src/views/eam/modules/repairorder/moudles/RepairOrderFaultAnalysisReport.vue
@@ -124,7 +124,7 @@
              <j-dict-select-tag
                allow-clear
                :disabled="disabledEdit"
                :placeholder="'请选择维修标准'"
                :placeholder="'请选择维修标准内容'"
                :triggerChange="true"
                dictCode="mom_eam_repair_standard,name,id, del_flag!='1'"
                v-decorator="['repairOrderFaultAnalysisUda5',validatorRules.repairOrderFaultAnalysisUda5]"
src/views/system/modules/UserModal.vue
@@ -156,12 +156,25 @@
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
        >
          <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button
                          placeholder="请选择设备" :disabled="!model.selectedProduction"/>
          <a-input-search
            :readOnly="true"
            v-model="model.equipmentIds"
            @search="deviceSearch"
            enter-button
            placeholder="请选择设备"
            :disabled="!model.selectedProduction"
          />
        </a-form-model-item>
        <a-form-model-item label="首页权限" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-radio-group v-model="model.userType" :defaultValue="0">
        <a-form-model-item
          label="首页权限"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-radio-group
            v-model="model.userType"
            :defaultValue="0"
          >
            <a-radio :value="4">公司级</a-radio>
            <a-radio :value="3">车间级</a-radio>
            <a-radio :value="2">工段级</a-radio>
@@ -189,12 +202,19 @@
          :wrapperCol="wrapperCol"
          prop="areaId"
        >
          <j-dict-select-tag
          <!-- <j-dict-select-tag
            v-model="model.areaId"
            :triggerChange="true"
            dictCode="mom_base_area,name,id,del_flag = 0"
            placeholder="请维护中心"
          ></j-dict-select-tag>
          ></j-dict-select-tag> -->
          <j-multi-select-tag
            :triggerChange="true"
            v-model="model.areaId"
            dictCode="mom_base_area,name,id,del_flag = 0 and type = 1"
            placeholder="请维护中心"
          >
          </j-multi-select-tag>
        </a-form-model-item>
        <a-form-model-item
          label="负责部门"
@@ -314,508 +334,512 @@
      </a-button>
    </div>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-modal
      ref="selectDeviceModal"
      @selectFinished="selectOK"
      :title="'选择设备'"
    />
  </a-drawer>
</template>
<script>
  import moment from 'moment'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import { getAction } from '@/api/manage'
  import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
  import { disabledAuthFilter } from '@/utils/authFilter'
  import { duplicateCheck } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import { mapActions } from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import SelectDeviceModal from './SelectDeviceModal'
import moment from 'moment'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
import { disabledAuthFilter } from '@/utils/authFilter'
import { duplicateCheck } from '@/api/api'
import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
import { mapActions } from 'vuex'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
import SelectDeviceModal from './SelectDeviceModal'
  export default {
    name: 'UserModal',
    components: {
      SelectDeviceModal,
      JSelectProduction
    },
    data() {
      return {
        departDisabled: false, //是否是我的部门调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth: 800,
        drawerWidth: 700,
        modaltoggleFlag: true,
        confirmDirty: false,
        userId: '', //保存用户id
        disableSubmit: false,
        dateFormat: 'YYYY-MM-DD',
        validatorRules: {
          username: [{ required: true, message: '请输入用户账号!' },
            { validator: this.validateUsername }],
          password: [{
            required: true,
            pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
            message: '密码由8位数字、大小写字母和特殊符号组成!'
          },
            { validator: this.validateToNextPassword, trigger: 'change' }],
          confirmpassword: [{ required: true, message: '请重新输入登录密码!' },
            { validator: this.compareToFirstPassword }],
          realname: [{ required: true, message: '请输入用户名称!' }],
          phone: [{ required: false, message: '请输入手机号!' }, { validator: this.validatePhone }],
          email: [{ validator: this.validateEmail }],
          roles: {},
          workNo: [{ required: true, message: '请输入工号' },
            { validator: this.validateWorkNo }],
          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
          teamId: [{ required: false, message: '请维护班组' }]
export default {
  name: 'UserModal',
  components: {
    SelectDeviceModal,
    JSelectProduction
  },
  data() {
    return {
      departDisabled: false, //是否是我的部门调用该页面
      productionDisabled: false, //是否是我的车间调用该页面
      roleDisabled: false, //是否是角色维护调用该页面
      modalWidth: 800,
      drawerWidth: 700,
      modaltoggleFlag: true,
      confirmDirty: false,
      userId: '', //保存用户id
      disableSubmit: false,
      dateFormat: 'YYYY-MM-DD',
      validatorRules: {
        username: [{ required: true, message: '请输入用户账号!' },
        { validator: this.validateUsername }],
        password: [{
          required: true,
          pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
          message: '密码由8位数字、大小写字母和特殊符号组成!'
        },
        departIdShow: false,
        title: '操作',
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        uploadLoading: false,
        confirmLoading: false,
        headers: {},
        url: {
          fileUpload: window._CONFIG['domianURL'] + 'sys/common/upload',
          userWithDepart: '/sys/user/userDepartList', // å¼•入为指定用户查看部门信息需要的url
          //引入为指定用户查看车间信息需要的url
          userProductionList: '/sys/user/userProductionList',
          userId: '/sys/user/generateUserId', // å¼•入生成添加用户情况下的url
          syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流
          queryTenantList: '/sys/tenant/queryList'
        },
        tenantsOptions: [],
        rolesOptions: [],
        nextDepartOptions: [],
        nextProductionOptions: [],
        isDepartType: '',
        model: {
          selectedProduction: ''
        }
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) this.initDictData('password_length')
        }
        { validator: this.validateToNextPassword, trigger: 'change' }],
        confirmpassword: [{ required: true, message: '请重新输入登录密码!' },
        { validator: this.compareToFirstPassword }],
        realname: [{ required: true, message: '请输入用户名称!' }],
        phone: [{ required: false, message: '请输入手机号!' }, { validator: this.validatePhone }],
        email: [{ validator: this.validateEmail }],
        roles: {},
        workNo: [{ required: true, message: '请输入工号' },
        { validator: this.validateWorkNo }],
        telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
        teamId: [{ required: false, message: '请维护班组' }]
      },
      'model.selectedProduction': {
        handler(newVal, oldVal) {
          if (newVal && this.$refs.selectDeviceModal) {
            // å¦‚果车间选择前后不一致则重置选择设备
            if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = ''
            this.$refs.selectDeviceModal.queryTreeData(newVal)
          }
          // å¦‚果清空车间值则重置选择设备
          if (newVal === '') this.model.equipmentIds = ''
        }
      }
    },
    created() {
      const token = Vue.ls.get(ACCESS_TOKEN)
      this.headers = { 'X-Access-Token': token }
      this.initRoleList()
      this.initTenantList()
      this.queryTreeData()
    },
    computed: {
      uploadAction: function() {
        return this.url.fileUpload
      }
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
        })
      departIdShow: false,
      title: '操作',
      visible: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      add() {
        this.refresh()
        this.edit({
          activitiSync: '1',
          userType: 0,
          userIdentity: 1,
          selectedroles: '',
          selecteddeparts: '',
          selectedProduction: ''
        })
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      edit(record) {
        let that = this
        that.visible = true
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize()
        that.userId = record.id
        console.log('record', record)
        that.model = Object.assign({}, record)
        //身份为上级显示负责部门,否则不显示
        if (this.model.userIdentity == 2) {
          this.departIdShow = true
        } else {
          this.departIdShow = false
        }
        if (record.hasOwnProperty('id')) {
          that.getUserRoles(record.id)
          that.getUserDeparts(record.id)
        }
      uploadLoading: false,
      confirmLoading: false,
      headers: {},
      url: {
        fileUpload: window._CONFIG['domianURL'] + 'sys/common/upload',
        userWithDepart: '/sys/user/userDepartList', // å¼•入为指定用户查看部门信息需要的url
        //引入为指定用户查看车间信息需要的url
        userProductionList: '/sys/user/userProductionList',
        userId: '/sys/user/generateUserId', // å¼•入生成添加用户情况下的url
        syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流
        queryTenantList: '/sys/tenant/queryList'
      },
      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
        } else {
          this.drawerWidth = 700
        }
      },
      //初始化租户字典
      initTenantList() {
        getAction(this.url.queryTenantList).then(res => {
          if (res.success) {
            this.tenantsOptions = res.result.map((item, index, arr) => {
              let c = { label: item.name, value: item.id + '' }
              return c
            })
          }
        })
      },
      //初始化角色字典
      initRoleList() {
        queryall().then((res) => {
          if (res.success) {
            this.rolesOptions = res.result.map((item, index, arr) => {
              let c = { label: item.roleName, value: item.id }
              return c
            })
          }
        })
      },
      getUserRoles(userid) {
        queryUserRole({ userid: userid }).then((res) => {
          if (res.success) {
            this.$set(this.model, 'selectedroles', res.result.join(','))
          }
        })
      },
      getUserDeparts(userid) {
        let that = this
        //部门的url èŽ·å–éƒ¨é—¨åˆ†é…
        getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
          if (res.success) {
            let departOptions = []
            let selectDepartKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectDepartKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              departOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(','))
            that.nextDepartOptions = departOptions
          }
        })
        // èŽ·å–è½¦é—´åˆ†é…
        getAction(that.url.userProductionList, { userId: userid }).then((res) => {
          if (res.success) {
            let ProductionOptions = []
            let selectProductKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectProductKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              ProductionOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selectedProduction', selectProductKeys.join(','))
            that.nextProductionOptions = ProductionOptions
          }
        })
        //车间的url
      },
      backDepartInfo(info) {
        this.model.departIds = this.model.selecteddeparts
        this.nextDepartOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      backProductionInfo(info) {
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      refresh() {
        this.userId = ''
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
        this.$refs.form.resetFields()
      },
      moment,
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            //如果是上级择传入departIds,否则为空
            if (this.model.userIdentity !== 2) {
              this.model.departIds = ''
            }
            let obj
            if (!this.model.id) {
              this.model.id = this.userId
              obj = addUser(this.model)
            } else {
              obj = editUser(this.model)
            }
            obj.then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok')
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = false
              that.close()
            })
          } else {
            return false
          }
        })
      },
      handleCancel() {
        this.close()
      },
      validateToNextPassword(rule, value, callback) {
        const confirmpassword = this.model.confirmpassword
        if (value && confirmpassword && value !== confirmpassword) {
          callback('两次输入的密码不一样!')
        }
        if (value && this.confirmDirty) {
          this.$refs.form.validateField(['confirmpassword'])
        }
        callback()
      },
      compareToFirstPassword(rule, value, callback) {
        if (value && value !== this.model.password) {
          callback('两次输入的密码不一样!')
        } else {
          callback()
        }
      },
      validatePhone(rule, value, callback) {
        if (!value) {
          callback()
        } else {
          if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
            var params = {
              tableName: 'sys_user',
              fieldName: 'phone',
              fieldVal: value,
              dataId: this.userId
            }
            duplicateCheck(params).then((res) => {
              if (res.success) {
                callback()
              } else {
                callback('手机号已存在!')
              }
            })
          } else {
            callback('请输入正确格式的手机号码!')
          }
        }
      },
      validateEmail(rule, value, callback) {
        if (!value) {
          callback()
        } else {
          if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
            var params = {
              tableName: 'sys_user',
              fieldName: 'email',
              fieldVal: value,
              dataId: this.userId
            }
            duplicateCheck(params).then((res) => {
              console.log(res)
              if (res.success) {
                callback()
              } else {
                callback('邮箱已存在!')
              }
            })
          } else {
            callback('请输入正确格式的邮箱!')
          }
        }
      },
      validateUsername(rule, value, callback) {
        var params = {
          tableName: 'sys_user',
          fieldName: 'username',
          fieldVal: value,
          dataId: this.userId
        }
        duplicateCheck(params).then((res) => {
          if (res.success) {
            callback()
          } else {
            callback('用户名已存在!')
          }
        })
      },
      validateWorkNo(rule, value, callback) {
        var params = {
          tableName: 'sys_user',
          fieldName: 'work_no',
          fieldVal: value,
          dataId: this.userId
        }
        duplicateCheck(params).then((res) => {
          if (res.success) {
            callback()
          } else {
            callback('工号已存在!')
          }
        })
      },
      handleConfirmBlur(e) {
        const value = e.target.value
        this.confirmDirty = this.confirmDirty || !!value
      },
      beforeUpload: function(file) {
        var fileType = file.type
        if (fileType.indexOf('image') < 0) {
          this.$message.warning('请上传图片')
          return false
        }
        //TODO éªŒè¯æ–‡ä»¶å¤§å°
      },
      identityChange(e) {
        if (e.target.value === 1) {
          this.departIdShow = false
        } else {
          this.departIdShow = true
        }
      },
      initDictData(dictCode) {
        //根据字典Code, åˆå§‹åŒ–字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            const regExp = new RegExp('^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:";\'<>?,./]).{' + Number(res.result[0].value) + ',}$')
            this.validatorRules.password[0] = {
              required: true,
              pattern: regExp,
              message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`
            }
          }
        })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      },
      /**
       * é€‰æ‹©å·²æœ‰è®¾å¤‡åŽç‚¹å‡»ç¡®å®šæ—¶è§¦å‘
       * @param data å·²é€‰æ‹©çš„设备数组
       */
      selectOK(data) {
        console.log('data=', data)
        this.$set(this.model, 'equipmentIds', data.join(','))
      tenantsOptions: [],
      rolesOptions: [],
      nextDepartOptions: [],
      nextProductionOptions: [],
      isDepartType: '',
      model: {
        selectedProduction: ''
      }
    }
  },
  watch: {
    visible: {
      handler(value) {
        if (value) this.initDictData('password_length')
      }
    },
    'model.selectedProduction': {
      handler(newVal, oldVal) {
        if (newVal && this.$refs.selectDeviceModal) {
          // å¦‚果车间选择前后不一致则重置选择设备
          if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = ''
          this.$refs.selectDeviceModal.queryTreeData(newVal)
        }
        // å¦‚果清空车间值则重置选择设备
        if (newVal === '') this.model.equipmentIds = ''
      }
    }
  },
  created() {
    const token = Vue.ls.get(ACCESS_TOKEN)
    this.headers = { 'X-Access-Token': token }
    this.initRoleList()
    this.initTenantList()
    this.queryTreeData()
  },
  computed: {
    uploadAction: function () {
      return this.url.fileUpload
    }
  },
  methods: {
    ...mapActions(['QueryDepartTree']),
    queryTreeData() {
      this.QueryDepartTree().then(res => {
        if (res.success) {
          this.isDepartType = res.result[0].value
        } else {
          // this.$message.warn(res.message)
          this.$notification.warning({
            message: '消息',
            description: res.message
          })
        }
      }).finally(() => {
      })
    },
    add() {
      this.refresh()
      this.edit({
        activitiSync: '1',
        userType: 0,
        userIdentity: 1,
        selectedroles: '',
        selecteddeparts: '',
        selectedProduction: ''
      })
    },
    edit(record) {
      let that = this
      that.visible = true
      //根据屏幕宽度自适应抽屉宽度
      this.resetScreenSize()
      that.userId = record.id
      console.log('record', record)
      that.model = Object.assign({}, record)
      //身份为上级显示负责部门,否则不显示
      if (this.model.userIdentity == 2) {
        this.departIdShow = true
      } else {
        this.departIdShow = false
      }
      if (record.hasOwnProperty('id')) {
        that.getUserRoles(record.id)
        that.getUserDeparts(record.id)
      }
    },
    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
      } else {
        this.drawerWidth = 700
      }
    },
    //初始化租户字典
    initTenantList() {
      getAction(this.url.queryTenantList).then(res => {
        if (res.success) {
          this.tenantsOptions = res.result.map((item, index, arr) => {
            let c = { label: item.name, value: item.id + '' }
            return c
          })
        }
      })
    },
    //初始化角色字典
    initRoleList() {
      queryall().then((res) => {
        if (res.success) {
          this.rolesOptions = res.result.map((item, index, arr) => {
            let c = { label: item.roleName, value: item.id }
            return c
          })
        }
      })
    },
    getUserRoles(userid) {
      queryUserRole({ userid: userid }).then((res) => {
        if (res.success) {
          this.$set(this.model, 'selectedroles', res.result.join(','))
        }
      })
    },
    getUserDeparts(userid) {
      let that = this
      //部门的url èŽ·å–éƒ¨é—¨åˆ†é…
      getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
        if (res.success) {
          let departOptions = []
          let selectDepartKeys = []
          for (let i = 0; i < res.result.length; i++) {
            selectDepartKeys.push(res.result[i].key)
            //新增负责部门选择下拉框
            departOptions.push({
              value: res.result[i].key,
              label: res.result[i].title
            })
          }
          this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(','))
          that.nextDepartOptions = departOptions
        }
      })
      // èŽ·å–è½¦é—´åˆ†é…
      getAction(that.url.userProductionList, { userId: userid }).then((res) => {
        if (res.success) {
          let ProductionOptions = []
          let selectProductKeys = []
          for (let i = 0; i < res.result.length; i++) {
            selectProductKeys.push(res.result[i].key)
            //新增负责部门选择下拉框
            ProductionOptions.push({
              value: res.result[i].key,
              label: res.result[i].title
            })
          }
          this.$set(this.model, 'selectedProduction', selectProductKeys.join(','))
          that.nextProductionOptions = ProductionOptions
        }
      })
      //车间的url
    },
    backDepartInfo(info) {
      this.model.departIds = this.model.selecteddeparts
      this.nextDepartOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + '' }
        return c
      })
    },
    backProductionInfo(info) {
      this.model.productionIds = this.model.selectedProduction
      this.nextProductionOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + '' }
        return c
      })
    },
    refresh() {
      this.userId = ''
      this.nextDepartOptions = []
      this.nextProductionOptions = []
      this.departIdShow = false
    },
    close() {
      this.$emit('close')
      this.visible = false
      this.disableSubmit = false
      this.nextDepartOptions = []
      this.nextProductionOptions = []
      this.departIdShow = false
      this.$refs.form.resetFields()
    },
    moment,
    handleSubmit() {
      const that = this
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true
          //如果是上级择传入departIds,否则为空
          if (this.model.userIdentity !== 2) {
            this.model.departIds = ''
          }
          let obj
          if (!this.model.id) {
            this.model.id = this.userId
            obj = addUser(this.model)
          } else {
            obj = editUser(this.model)
          }
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
            that.close()
          })
        } else {
          return false
        }
      })
    },
    handleCancel() {
      this.close()
    },
    validateToNextPassword(rule, value, callback) {
      const confirmpassword = this.model.confirmpassword
      if (value && confirmpassword && value !== confirmpassword) {
        callback('两次输入的密码不一样!')
      }
      if (value && this.confirmDirty) {
        this.$refs.form.validateField(['confirmpassword'])
      }
      callback()
    },
    compareToFirstPassword(rule, value, callback) {
      if (value && value !== this.model.password) {
        callback('两次输入的密码不一样!')
      } else {
        callback()
      }
    },
    validatePhone(rule, value, callback) {
      if (!value) {
        callback()
      } else {
        if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
          var params = {
            tableName: 'sys_user',
            fieldName: 'phone',
            fieldVal: value,
            dataId: this.userId
          }
          duplicateCheck(params).then((res) => {
            if (res.success) {
              callback()
            } else {
              callback('手机号已存在!')
            }
          })
        } else {
          callback('请输入正确格式的手机号码!')
        }
      }
    },
    validateEmail(rule, value, callback) {
      if (!value) {
        callback()
      } else {
        if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
          var params = {
            tableName: 'sys_user',
            fieldName: 'email',
            fieldVal: value,
            dataId: this.userId
          }
          duplicateCheck(params).then((res) => {
            console.log(res)
            if (res.success) {
              callback()
            } else {
              callback('邮箱已存在!')
            }
          })
        } else {
          callback('请输入正确格式的邮箱!')
        }
      }
    },
    validateUsername(rule, value, callback) {
      var params = {
        tableName: 'sys_user',
        fieldName: 'username',
        fieldVal: value,
        dataId: this.userId
      }
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback()
        } else {
          callback('用户名已存在!')
        }
      })
    },
    validateWorkNo(rule, value, callback) {
      var params = {
        tableName: 'sys_user',
        fieldName: 'work_no',
        fieldVal: value,
        dataId: this.userId
      }
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback()
        } else {
          callback('工号已存在!')
        }
      })
    },
    handleConfirmBlur(e) {
      const value = e.target.value
      this.confirmDirty = this.confirmDirty || !!value
    },
    beforeUpload: function (file) {
      var fileType = file.type
      if (fileType.indexOf('image') < 0) {
        this.$message.warning('请上传图片')
        return false
      }
      //TODO éªŒè¯æ–‡ä»¶å¤§å°
    },
    identityChange(e) {
      if (e.target.value === 1) {
        this.departIdShow = false
      } else {
        this.departIdShow = true
      }
    },
    initDictData(dictCode) {
      //根据字典Code, åˆå§‹åŒ–字典数组
      ajaxGetDictItems(dictCode, null).then((res) => {
        if (res.success) {
          const regExp = new RegExp('^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:";\'<>?,./]).{' + Number(res.result[0].value) + ',}$')
          this.validatorRules.password[0] = {
            required: true,
            pattern: regExp,
            message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`
          }
        }
      })
    },
    deviceSearch() {
      this.$refs.selectDeviceModal.visible = true
      this.$refs.selectDeviceModal.selectedRowKeys = []
      this.$refs.selectDeviceModal.selectedRows = []
      this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
    },
    /**
     * é€‰æ‹©å·²æœ‰è®¾å¤‡åŽç‚¹å‡»ç¡®å®šæ—¶è§¦å‘
     * @param data å·²é€‰æ‹©çš„设备数组
     */
    selectOK(data) {
      console.log('data=', data)
      this.$set(this.model, 'equipmentIds', data.join(','))
    }
  }
}
</script>
<style scoped>
  .avatar-uploader > .ant-upload {
    width: 104px;
    height: 104px;
  }
.avatar-uploader > .ant-upload {
  width: 104px;
  height: 104px;
}
  .ant-upload-select-picture-card i {
    font-size: 49px;
    color: #999;
  }
.ant-upload-select-picture-card i {
  font-size: 49px;
  color: #999;
}
  .ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
  }
.ant-upload-select-picture-card .ant-upload-text {
  margin-top: 8px;
  color: #666;
}
  .ant-table-tbody .ant-table-row td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
  .drawer-bottom-button {
    position: absolute;
    bottom: -8px;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
.drawer-bottom-button {
  position: absolute;
  bottom: -8px;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>