已添加3个文件
已修改10个文件
908 ■■■■■ 文件已修改
src/views/eam/ABC/ABCAssessmentList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ABC/modules/StreamForm.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/EquipmentListOfAll.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/MalfunctionRepair.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/MaintenanceOrder3Modal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderModal.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/EquipmentSelectModel.vue 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/KeyEquipmentUpdateModel.vue 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/equipmentNew/edit/KeyEquipmentUpdateTable.vue 302 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/repairOrderExcuteDrawer.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/ABC/ABCAssessmentList.vue
@@ -174,7 +174,7 @@
          {
            title:'旧标识',
            align:"center",
            dataIndex: 'equipmentImportanceId_dictText',
            dataIndex: 'oldStandard_dictText',
            width:200
          },
          {
@@ -209,7 +209,7 @@
        this.ipagination.current = 1
      },
      tableRowClass(record, index) {
      if (record.equipmentImportanceId!==record.finalStandard) {
      if (record.oldStandard!==record.finalStandard) {
          return 'primary'
      }
      
src/views/eam/ABC/modules/StreamForm.vue
@@ -363,7 +363,7 @@
            },
            {
              title: '旧标识',
              key: 'equipmentImportanceId',
              key: 'oldStandard',
              type: JVXETypes.select,
              width:"180px",
              disabled:true,
@@ -530,7 +530,7 @@
              standardD:data[i].standardD,
              standardE:data[i].standardE,
              standardF:data[i].standardF,
              equipmentImportanceId:data[i].equipmentImportanceId,
              oldStandard:data[i].equipmentImportanceId,
              finalStandard:data[i].equipmentImportanceId,
            }
          }
src/views/eam/EquipmentListOfAll.vue
@@ -258,6 +258,7 @@
      </a-upload>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateABC" type="primary" icon="font-colors" v-has="'equipmentAccount:add&delete&import&Edit'">ABC标识变更</a-button>
      <a-button :disabled="selectedRowKeys.length==0" @click="handleUpdateWarranty" type="primary" icon="calendar" v-has="'equipmentAccount:add&delete&import&Edit'">质保期变更</a-button>
      <a-button  @click="handleUpdateKeyEquipment" type="primary" icon="calendar" v-has="'equipmentAccount:add&delete&import&Edit'">设置关键设备标识</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
@@ -481,6 +482,7 @@
    <aBC-update-edit-model @ok="modalFormOk" :updateList="selectionRows" ref="updateABC"></aBC-update-edit-model>
    <warranty-update-model  :updateList="selectionRows"  ref="updateWarranty"></warranty-update-model>
    <EquipmentSparePartsModal ref="modalFormSpareParts" @ok="modalFormOk" />
    <key-equipment-update-model @ok="modalFormOk" :updateList="selectionRows" ref="keyEquipmentUpdate"></key-equipment-update-model>
  </a-card>
</template>
@@ -501,7 +503,7 @@
  import EquipmentUpdateABCList from './modules/equipmentNew/EquipmentUpdateABCList'
  import EquipmentUpdateWarrantyList from './modules/equipmentNew/EquipmentUpdateWarrantyList.vue'
  import ABCUpdateEditModel from './modules/equipmentNew/edit/ABCUpdateEditModel'
  import WarrantyUpdateModel from './modules/equipmentNew/edit/WarrantyUpdateModel.vue'
  import WarrantyUpdateModel from './modules/equipmentNew/edit/WarrantyUpdateModel'
  import EquipmentSpareParts from './modules/equipmentNew/EquipmentSpareParts'
  import EquipmentSparePartsModal from './modules/equipmentNew/EquipmentSparePartsModal'
  import StandardOfInspection from './modules/equipmentNew/StandardOfInspection.vue'
@@ -509,6 +511,8 @@
  import DailyMaintenanceList from './modules/equipmentNew/DailyMaintenanceList.vue'
  import SecondMaintenanceList from './modules/equipmentNew/SecondMaintenanceList.vue'
  import ThirdMaintenanceList from './modules/equipmentNew/ThirdMaintenanceList.vue'
import KeyEquipmentUpdateModel from './modules/equipmentNew/edit/KeyEquipmentUpdateModel.vue'
  export default {
    name: "EquipmentList",
    mixins:[JeecgListMixin,mixinDevice],
@@ -532,6 +536,7 @@
        DailyMaintenanceList,
        SecondMaintenanceList,
        ThirdMaintenanceList,
        KeyEquipmentUpdateModel,
    },
    data () {
      return {
@@ -962,8 +967,10 @@
    },
    handleEditSpareParts(record){
      this.$refs.modalFormSpareParts.edit(record);
    }
    },
    handleUpdateKeyEquipment(){
      this.$refs.keyEquipmentUpdate.add();
    },
    }
  }
</script>
src/views/eam/MalfunctionRepair.vue
@@ -8,14 +8,17 @@
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      > <a-row :gutter="24" style="margin-bottom: 1%;">
      > <a-row
          :gutter="24"
          style="margin-bottom: 1%;"
        >
          <a-col
            :md="24"
            :sm="6"
          >
          <a-form-item label="统一编号群">
            <a-form-item label="统一编号群">
              <a-textarea
                placeholder="请输入所有统一编码,须用空格隔开,否则可能查询出错误信息"
                placeholder="请输入所有统一编码,须用换行隔开,否则可能查询出错误信息"
                v-model="queryParam.nums"
                :auto-size="{ minRows: 2, maxRows:2 }"
              ></a-textarea>
@@ -178,23 +181,28 @@
      </a-form>
    </div>
    <div class="table-operator">
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
      <a-button
        type="primary"
        @click="searchQuery"
        icon="search"
      >查询</a-button>
      <a-button
        type="primary"
        @click="searchReset"
        icon="reload"
        style="margin-left: 8px"
      >重置</a-button>
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
        v-has="'report:add&edit'"
      >新增</a-button>
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('故障报修')"
      >导出</a-button>
    </div>
    <div>
@@ -279,8 +287,14 @@
            </a-menu>
          </a-dropdown> -->
        </span>
        <span slot="jell" slot-scope="text">
            <j-ellipsis :value="text" :length="10" />
        <span
          slot="jell"
          slot-scope="text"
        >
          <j-ellipsis
            :value="text"
            :length="10"
          />
        </span>
      </a-table>
@@ -298,7 +312,10 @@
          class="table-operator"
          style="margin-top: 0px"
        >
          <FaultDescriptionList ref="FaultDescriptionList"   @ok="modalFormOk"/>
          <FaultDescriptionList
            ref="FaultDescriptionList"
            @ok="modalFormOk"
          />
        </div>
      </a-tab-pane>
@@ -314,8 +331,8 @@
      @cancel='approvalModalFormOk'
    ></approvel-modal>
    <accept-model
    ref="acceptModel"
    @ok="modalFormOk"
      ref="acceptModel"
      @ok="modalFormOk"
    ></accept-model>
  </a-card>
</template>
@@ -345,8 +362,8 @@
  },
  data() {
    return {
      treeData:[],
      faultTime:[],
      treeData: [],
      faultTime: [],
      description: '故障报修',
      queryParam: { delflag: 0 },
      selectedRowKeys: [],
@@ -363,14 +380,38 @@
          }
        },
        {
          title: '单据号',
          align: "center",
          dataIndex: 'num'
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName',
        },
        {
          title: '单据号',
          title: '类型',
          align: "center",
          dataIndex: 'num'
          dataIndex: 'type',
          customRender: (text) => {
            if (text == '1') {
              return "被动报修";
            } else if (text == '2') {
              return "主动报修";
            }
          },
        },
        {
          title: '来源',
          align: "center",
          dataIndex: 'source',
          customRender: (text) => {
            if (text == '1') {
              return "手动创建";
            } else if (text == '2') {
              return "点检报修";
            }
          },
        },
        {
          title: '统一编号',
@@ -406,8 +447,8 @@
          title: '故障描述',
          align: "center",
          dataIndex: 'faultDescription',
          scopedSlots: {
            customRender: 'faultDescription'
          scopedSlots: {
            customRender: 'faultDescription'
          }
        },
@@ -446,8 +487,8 @@
          title: '验收意见',
          align: "center",
          dataIndex: 'errUda5',
          scopedSlots: {
            customRender: 'jell'
          scopedSlots: {
            customRender: 'jell'
          }
        },
        {
@@ -488,7 +529,7 @@
    }
  },
  created() {
       this.initOptions();
    this.initOptions();
  },
  computed: {
    importExcelUrl: function () {
@@ -644,12 +685,12 @@
        }
      })
    },
    timeChange(){
    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")
    },
    handleAccept(record){
      this.$refs.acceptModel.title="验收"
    handleAccept(record) {
      this.$refs.acceptModel.title = "验收"
      this.$refs.acceptModel.edit(record)
    }
  }
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
@@ -385,6 +385,18 @@
        xs: { span: 24 },
        sm: { span: 18 },
      },
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 99,
        pageSizeOptions: ['99'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      validatorRules: {
        // description: {
        //   rules: [
@@ -513,11 +525,11 @@
          // }
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result;
          if (res.result.total) {
            this.ipagination.total = res.result.total;
          } else {
            this.ipagination.total = 0;
          }
          // if (res.result.total) {
          //   this.ipagination.total = res.result.total;
          // } else {
          //   this.ipagination.total = 0;
          // }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
src/views/eam/modules/daily3MaintenanceOrder/MaintenanceOrder3Modal.vue
@@ -646,7 +646,7 @@
    send3MaintenanceStandardRecord(data) {
      let record = data.record;
      this.form.setFieldsValue({ equipmentId: record.equipmentId, maintenanceStandardId: record.id, equipmentNum: record.equipmentNum, maintenanceStandardNum: record.num, maintenanceCycleId: null });
      this.form.setFieldsValue({ assignMode: record.assignMode, teamId: record.teamId, teamName: record.teamName });
      this.form.setFieldsValue({ assignMode: "1", teamId: record.teamId, teamName: record.teamName });
      this.getCycleByStandardId(record.id);
      if ("3" == record.assignMode) {
        this.isHidden = false
src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderExeDrawer.vue
@@ -336,6 +336,18 @@
        xs: { span: 24 },
        sm: { span: 18 },
      },
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 99,
        pageSizeOptions: ['99'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      columns: [
        {
          title: '#',
@@ -475,11 +487,11 @@
          // }
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result;
          if (res.result.total) {
            this.ipagination.total = res.result.total;
          } else {
            this.ipagination.total = 0;
          }
          // if (res.result.total) {
          //   this.ipagination.total = res.result.total;
          // } else {
          //   this.ipagination.total = 0;
          // }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
src/views/eam/modules/dailyInspectionOrder/DailyInspectionOrderModal.vue
@@ -291,10 +291,10 @@
      :scroll="{x:true}"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
      :pagination="false"
    >
      <!-- @change="handleTableChange" -->
      <template
        slot="photo"
        slot-scope="text,record"
@@ -633,7 +633,7 @@
      this.inspectionStandardId = record.id;
      this.form.setFieldsValue({ inspectionStandardId: record.id, inspectionStandardNum: record.num + "/" + record.version });
      this.form.setFieldsValue({ equipmentId: record.equipmentId, equipmentName: record.equipmentNum + "/" + record.equipmentName });
      this.form.setFieldsValue({ assignMode: record.assignMode, teamId: record.teamId, teamName: record.teamName });
      this.form.setFieldsValue({ assignMode: "1", teamId: record.teamId, teamName: record.teamName });
      this.form.setFieldsValue({ effectiveTime: null, inspectionCycleId: null, unit: null });
      this.getInspectionCycles(record.id)
      if ("3" == record.assignMode) {
src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
@@ -386,6 +386,18 @@
        xs: { span: 24 },
        sm: { span: 18 },
      },
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 99,
        pageSizeOptions: ['99'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      validatorRules: {
        // description: {
        //   rules: [
@@ -520,11 +532,11 @@
          // }
          //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          this.dataSource = res.result.records || res.result;
          if (res.result.total) {
            this.ipagination.total = res.result.total;
          } else {
            this.ipagination.total = 0;
          }
          // if (res.result.total) {
          //   this.ipagination.total = res.result.total;
          // } else {
          //   this.ipagination.total = 0;
          // }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
src/views/eam/modules/equipmentNew/edit/EquipmentSelectModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,320 @@
<template>
  <!--支持全屏缩放-->
  <a-modal
    :visible="visible"
    :title="title"
    switchFullscreen
    @ok="handleSubmit"
    @cancel="close"
    style="top:50px"
    cancelText="关闭"
    :width="1400"
  >
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form
          layout="inline"
          @keyup.enter.native="searchQuery"
        >
          <a-row :gutter="24">
            <a-col
              :md="8"
              :sm="6"
            >
              <a-form-item label="统一编码">
                <a-input
                  placeholder="请输入统一编码"
                  v-model="queryParam.num"
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="6"
            >
              <a-form-item label="设备名称">
                <a-input
                  placeholder="设备名称"
                  v-model="queryParam.name"
                />
              </a-form-item>
            </a-col>
            <a-col
            :md="8"
            :sm="6"
          >
          <a-form-item
          label="统一编号群"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          >
              <a-textarea
                placeholder="请输入所有统一编码,须用换行隔开,否则可能查询出错误信息"
                v-model="queryParam.nums"
                :auto-size="{ minRows: 2, maxRows:2 }"
              ></a-textarea>
            </a-form-item>
          </a-col>
            <a-col :md="3">
              <span
                style="float: left;overflow: hidden;"
                class="table-page-search-submitButtons"
              >
                <a-button
                  type="primary"
                  @click="searchQuery"
                  icon="search"
                >查询</a-button>
                <a-button
                  @click="searchReset"
                  icon="reload"
                  style="margin-left: 10px"
                >重置</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <a-table
        ref="table"
        :scroll="scrollTrigger"
        size="middle"
        rowKey="id"
        bordered
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :rowSelection="rowSelection"
        :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>
      </a-table>
    </a-card>
  </a-modal>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'EquipmentSelectModel',
  mixins: [JeecgListMixin],
  components: {},
  props: {},
  data() {
    return {
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: 'id',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '统一编码',
          align: 'center',
          dataIndex: 'num',
          width:200
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'name',
          width:200
        },
        {
          title: '设备型号',
          align: 'center',
          dataIndex: 'model',
          width:200
        },
        {
          title: '设备规格',
          align: 'center',
          dataIndex: 'specification',
          width:200
        },
        {
          title: 'ABC标识',
          align: "center",
          dataIndex: 'equipmentImportanceId',
          width:100
        },
        {
          title: '关键设备标识',
          align: "center",
          dataIndex: 'specificEquipment_dictText',
          width:100
        },
        {
          title: '设备状态',
          align: 'center',
          dataIndex: 'equipmentStatus_dictText',
          width:100
        },
        {
          title: '技术状态',
          align: 'center',
          dataIndex: 'technologyStatus_dictText',
          width:100
        },
      ],
      selectedRowKeys: [],
      oldSelectRows: [],
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      title: '选择设备',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '30', '50', '100'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      isorter: {
        column: 'num',
        order: 'desc'
      },
      visible: false,
      loading: false,
      url: {
        list: '/eam/equipment/getEquipmentList'
      }
    }
  },
  computed: {
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
          }
        }),
        selectedRowKeys: this.selectedRowKeys
      }
    }
  },
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      let that = this
      this.loading = true
      this.queryParam.equipmentImportanceId = 'A';
      let params = this.getQueryParams()//查询条件
      // params.equipmentStatus = '1'
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSelectRows.indexOf(res.result.records[i].id) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    showModals(oldSelectRows) {
      this.oldSelectRows = oldSelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      this.queryParam = []
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.searchReset(0)
      this.selectedRowKeys = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      this.$emit('selectionRows', this.selectionRows)
      this.searchReset(0)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    searchQuery() {
      this.loadData(1)
    }
  }
}
</script>
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>
src/views/eam/modules/equipmentNew/edit/KeyEquipmentUpdateModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
<template>
  <j-modal
    :title="'质保期变更'"
    :width="1515"
    :height="600"
    :visible="visible"
    :maskClosable="true"
    :fullscreen="true"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">
    <key-equipment-update-table
    ref="realForm"
    @ok="submitCallback"
    :disabled="disableSubmit"/>
  </j-modal>
</template>
<script>
import KeyEquipmentUpdateTable from './KeyEquipmentUpdateTable.vue'
  export default {
    name: 'KeyEquipmentUpdateModel',
    components: {
      KeyEquipmentUpdateTable
    },
    props:{
    },
    data() {
      return {
        title:'',
        width:1500,
        visible: false,
        disableSubmit: false
      }
    },
    methods:{
      add () {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.addBefore();
        })
      },
      edit (record) {
        this.visible=true
        this.$nextTick(()=>{
          this.$refs.realForm.edit(record);
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.realForm.warrantyUpdateTable.dataSource=[];
      },
      handleOk () {
        this.$refs.realForm.handleOk();
      },
      submitCallback(){
        this.$emit('ok');
        this.$bus.$emit('loadData')
        this.visible = false;
      },
      handleCancel () {
        this.close()
      }
    }
  }
</script>
<style scoped>
</style>
src/views/eam/modules/equipmentNew/edit/KeyEquipmentUpdateTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,302 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- ä¸»è¡¨å•区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item
              label="关键设备标识"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="specificEquipment"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择关键设备标识"
                :disabled="formDisabled"
                :triggerChange="true"
                dictCode="specific_equipment"
                v-model="model.specificEquipment"
                @change="(e) =>standardResultCompute(e)"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- å­è¡¨å•区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="变更设备列" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="keyEquipmentUpdateList.loading"
          :columns="keyEquipmentUpdateList.columns"
          :dataSource="keyEquipmentUpdateList.dataSource"
          :maxHeight="1000"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="true"
          :toolbar="true"
          :alwaysEdit="true"
          :toolbarConfig="toolbarConfig"
          >
              <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>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { duplicateCheck } from '@/api/api'
  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 dayjs from 'dayjs'
  import EquipmentSelectModel from './EquipmentSelectModel'
  export default {
    name: 'KeyEquipmentUpdateTable',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
      dayjs,
      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: ['keyEquipmentUpdateTable', ],
        tableKeys:['keyEquipmentUpdateTable', ],
        activeKey: 'keyEquipmentUpdateTable',
        keyEquipmentUpdateList: {
          loading: false,
          dataSource: [],
          columns: [
          {
              title: 'id',
              key: 'id',
               type: JVXETypes.hidden,
              disabled:true,
              align:'center',
            },
            {
              title: '统一编码',
              key: 'num',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备名称',
              key: 'name',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '设备型号',
              key: 'model',
               type: JVXETypes.normal,
              width:"200px",
              placeholder: '请输入${title}',
              disabled:true,
              align:'center',
              defaultValue:'',
            },
            {
              title: '关键设备标识(旧)',
              key: 'oldSpecificEquipment',
              type: JVXETypes.select,
              width:"200px",
              placeholder: '无旧标识',
              align:'center',
              disabled:true,
              dictCode:'specific_equipment',
              options:[],
            },
            {
              title: '关键设备标识(新)',
              key: 'specificEquipment',
              type: JVXETypes.select,
              width:"200px",
              dictCode:'specific_equipment',
              options:[],
              placeholder: '请输入新标识',
              align:'center',
              defaultValue:365,
              validateRules: [
              {
                required: true, // å¿…å¡«
                message: '请输入${title}' // æ˜¾ç¤ºçš„æ–‡æœ¬
              },
              { handler({ cellValue, row, column }, callback, target) {
                    if (cellValue==row.oldSpecificEquipment) {
                        callback(false, '${title}不能与旧数据雷同') // false = æœªé€šè¿‡ï¼Œå¯ä»¥è·Ÿè‡ªå®šä¹‰æç¤º
                    } else {
                        callback(true) // true = é€šè¿‡éªŒè¯
                    }
                },
                message: '${title}默认提示'
              },
              ]
            },
          ]
        },
        url: {
          // add: "/tooling/toolingMakeAccountMain/add",
          add: "/eam/equipment/updateKeyEquipment",
          // queryById: "/tooling/toolingMakeAccountMain/queryById",
          keyEquipmentUpdateList: {
            list: '/eam/equipment/list'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
    },
    methods: {
      addBefore(){
          this.keyEquipmentUpdateList.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 = { equipmentId: this.model.id }
          this.requestSubTableData(this.url.keyEquipmentUpdateList.list, params, this.keyEquipmentUpdateList)
        }
      },
      //校验所有一对一子表表单
        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, // å±•å¼€
          keyEquipmentUpdateList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
      changeDate(target){
        console.log(target)
        if(target.columnIndex==7){
             target.row.nextCheckDate=dayjs().add(target.value,'day').format('YYYY-MM-DD')
        }
      },
      //选择设备
      selectEquipmentList() {
        let ids = []
        let tableData = this.$refs.keyEquipmentUpdateTable.getTableData()
        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.keyEquipmentUpdateTable.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,
              oldSpecificEquipment:data[i].specificEquipment,
            }
          }
          addRows.push(equipment)
        }
        this.$refs.keyEquipmentUpdateTable.pushRows(addRows)
      },
      standardResultCompute(e){
      let tableData =this.$refs.keyEquipmentUpdateTable.getTableData();
      for(var i = 0;i<tableData.length;i++){
            let row = this.$refs.keyEquipmentUpdateTable.getRowById(tableData[i].equipmentId);
            row['specificEquipment']=e
      }
      }
    }
  }
</script>
<style scoped>
</style>
src/views/eam/modules/repairorder/repairOrderExcuteDrawer.vue
@@ -195,7 +195,7 @@
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="关键设备?"
                  label="关键设备"
                  class="hightColor"
                >
                  <span
@@ -642,13 +642,13 @@
    //开工
    handleStart() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '维修工单开工',
        content: '提示:开工后无法撤回,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.orderStart, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('开工成功');
@@ -689,13 +689,13 @@
    },
    handleReport() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '维修工单报工',
        content: '提示:报工后维修完工,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.orderReport, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('报工成功');
@@ -714,13 +714,13 @@
    //撤销
    handleRevoke() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '完工撤销',
        content: '提示:完工撤销后可继续报工操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.orderRevoke, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('撤销成功');
@@ -737,13 +737,13 @@
    },
    handleSpare(){
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '等采购件',
        content: '提示:该操作不可撤销,确认开始等采购件?',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.handleSpare, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('操作成功');
@@ -761,13 +761,13 @@
    },
    handleSpareStop(){
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '停止等采购件',
        content: '提示:该操作不可撤销,确认停止等采购件?',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.handleSpareStop, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('操作成功');
@@ -785,13 +785,13 @@
    },
    handlePart(){
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '等采购件',
        content: '提示:该操作不可撤销,确认等采购件?',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.handlePart, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('操作成功');
@@ -809,13 +809,13 @@
    },
    handlePartStop(){
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '停止等采购件',
        content: '提示:该操作不可撤销,确认停止等采购件?',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          that.confirmLoading = true;
          putAction(that.url.handlePartStop, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('操作成功');