预测性维护工单
1.工单执行
2.子表:触发条件,维护内容,计划用料,危险防控,作业指导书,实际用料,实际工时
已添加14个文件
已修改1个文件
4347 ■■■■■ 文件已修改
src/views/eam/PredictiveWorkOrderList.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue 350 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue 301 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/DetailList.vue 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue 728 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue 368 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue 373 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue 315 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/PredictiveWorkOrderList.vue
@@ -219,23 +219,14 @@
      </a-table>
    </div>
    <maintenance-order-modal
    <predictive-work-order-model
      ref="modalForm"
      @ok="modalFormOk"
    ></maintenance-order-modal>
    <inspection-order-assign-modal
      ref="InspectionOrderAssignModal"
    ></predictive-work-order-model>
    <predictive-work-order-drawer
      ref="PredictiveWorkOrderDrawer"
      @ok="modalFormOk"
    ></inspection-order-assign-modal>
    <specialy-maintenance-order-exe-drawer
      ref="SpecialyMaintenanceOrderExeDrawer"
      @ok="modalFormOk"
    ></specialy-maintenance-order-exe-drawer>
    <specialty-maintenance-order-assign-modal
      ref="SpecialtyMaintenanceOrderAssignModal"
      @ok="modalFormOk"
    >
    </specialty-maintenance-order-assign-modal>
    ></predictive-work-order-drawer>
  </a-card>
</template>
@@ -244,22 +235,17 @@
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import MaintenanceOrderModal from './modules/specialtyMaintenanceOrder/MaintenanceOrderModal'
import InspectionOrderAssignModal from './modules/specialtyMaintenanceOrder/InspectionOrderAssignModal'
import SpecialyMaintenanceOrderExeDrawer from './modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer'
import { getAction, postAction, requestPut } from '@/api/manage'
import SpecialtyMaintenanceOrderAssignModal from './modules/specialtyMaintenanceOrder/SpecialtyMaintenanceOrderAssignModal.vue'
import SpecialtyInspectionOrderAssignModal from './modules/specialtyInspectionOrder/SpecialtyInspectionOrderAssignModal.vue'
import PredictiveWorkOrderModel from './modules/predictiveWorkOrder/PredictiveWorkOrderModel'
import PredictiveWorkOrderDrawer from './modules/predictiveWorkOrder/PredictiveWorkOrderDrawer'
export default {
  name: 'PredictiveWorkOrderList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    MaintenanceOrderModal,
    InspectionOrderAssignModal,
    SpecialyMaintenanceOrderExeDrawer,
    SpecialtyMaintenanceOrderAssignModal,
    SpecialtyInspectionOrderAssignModal
    PredictiveWorkOrderModel,
    PredictiveWorkOrderDrawer
  },
  data() {
    return {
@@ -279,7 +265,7 @@
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
          dataIndex: 'status_dictText'
        },
        {
          title: '单据号',
@@ -290,66 +276,66 @@
        {
          title: '监控类型',
          align: "center",
          dataIndex: 'maintenanceMode'
          dataIndex: 'monitorType_dictText'
        },
        {
          title: '设备编码',
          align: "center",
          dataIndex: 'departName',
          dataIndex: 'equipmentNum',
        },
        {
          title: '设备名称',
          align: "center",
          dataIndex: 'maintenanceTypeName',
          dataIndex: 'equipmentName',
        },
        {
          title: '型号',
          align: "center",
          dataIndex: 'maintenanceCycleName',
          dataIndex: 'model',
        },
        {
          title: '标准编码',
          align: 'center',
          dataIndex: 'assignModeName',
          dataIndex: 'planNum',
        },
        {
          title: '版本',
          align: "center",
          dataIndex: 'specialtyMaintenancePlanNum',
          dataIndex: 'version',
        },
        {
          title: '使用部门',
          align: "center",
          dataIndex: 'teamName',
          dataIndex: 'useId_dictText',
        },
        {
          title: '派工方式',
          align: "center",
          dataIndex: 'sumOfWorkingHourQuota',
          dataIndex: 'assignMode_dictText',
        },
        {
          title: '责任班组',
          align: "center",
          dataIndex: 'planStartTime',
          dataIndex: 'teamId_dictText',
          width: 170
        },
        {
          title: '责任人',
          align: "center",
          dataIndex: 'planEndTime',
          dataIndex: 'maintenanceUserId_dictText',
          width: 170
        },
        {
          title: '工时定额(小时)',
          align: "center",
          dataIndex: 'planEndTime',
          width: 170
        },
        // {
        //   title: '工时定额(小时)',
        //   align: "center",
        //   dataIndex: 'planEndTime',
        //   width: 170
        // },
        {
          title: '实际工时',
          align: "center",
          dataIndex: 'planEndTime',
          dataIndex: 'actualWorkingHourQuota',
          width: 170
        },
        {
@@ -418,38 +404,30 @@
  },
  methods: {
    batchAssign() {
      this.$refs.InspectionOrderAssignModal.visible = true
      this.$refs.InspectionOrderAssignModal.title = '工单派工'
      this.$refs.InspectionOrderAssignModal.selectionRows
      this.$refs.InspectionOrderAssignModal.handleShow()
      this.$bus.$emit('selectionRows', this.selectionRows);
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows;
    },
    handleOrderExe(record) {
      this.$refs.SpecialyMaintenanceOrderExeDrawer.visible = true
      this.$refs.SpecialyMaintenanceOrderExeDrawer.title = '专业保养工单执行'
      this.$refs.SpecialyMaintenanceOrderExeDrawer.handleShow(record)
      this.$refs. PredictiveWorkOrderDrawer.visible = true
      this.$refs. PredictiveWorkOrderDrawer.title = '专业保养工单执行'
      this.$refs. PredictiveWorkOrderDrawer.handleShow(record)
      if (record.status === '3') {
        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true//保存、暂存、报工
        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true//撤销按钮
        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = false//开工按钮
        this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true//保存、暂存、报工
        this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true//撤销按钮
        this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = false//开工按钮
      } else if (record.status === '4') {
        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = false
        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true
        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
        this.$refs. PredictiveWorkOrderDrawer.buttonDistable = false
        this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true
        this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true
      } else if (record.status === '5') {
        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true
        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = false
        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
        this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true
        this.$refs. PredictiveWorkOrderDrawer.revocationDistable = false
        this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true
      } else if (record.status === '7') {
        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true
        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true
        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
        this.$refs. PredictiveWorkOrderDrawer.buttonDistable = true
        this.$refs. PredictiveWorkOrderDrawer.revocationDistable = true
        this.$refs. PredictiveWorkOrderDrawer.SWbuttonDistable = true
      }
    },
src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,350 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <a-table
      ref="table"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      @change="handleTableChange"
    >
      <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)"
            :value="text"
            :read-only="true"
            @change="(e) => handleChange(e, record.key, col, index)"
          />
          <a-input-number
            :value="text"
            v-if="col.dataIndex == 'actualQuantity'"
            :min="1"
            :max="99999"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.disabled"
          />
        </div>
      </template>
      <span
        slot='action'
        slot-scope='text, record,index'
      >
        <a @click="handleDeleteFake(index)">删除</a>
      </span>
    </a-table>
    <a-button
      style="width: 100%; margin-top: 16px; margin-bottom: 8px"
      type="dashed"
      icon="plus"
      @click="addMaterial"
      :disabled="repairOrderStatus!='3'"
    >添加实际用料
    </a-button>
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :style="{textAlign:'right'}">
        <a-button
          :style="{marginRight: '8px'}"
          @click="handleCancel"
          :disabled="repairOrderStatus!='3'"
        >
          æ¸…空
        </a-button>
        <a-button
          @click="handleOk(1)"
          type="primary"
          :style="{marginRight: '8px'}"
          :disabled="repairOrderStatus!='3'"
        >暂存</a-button>
        <a-button
          @click="handleOk(0)"
          type="primary"
          :disabled="repairOrderStatus!='3'"
        >保存</a-button>
      </a-row>
      <!-- :disabled="false" -->
    </div>
    <actual-material-select
      ref="actualMaterialSelect"
      @sendMaterialRecord="sendMaterialRecord"
    >
    </actual-material-select>
  </a-card>
</template>
<script>
import { postAction, getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import pick from 'lodash.pick'
import JEllipsis from '@/components/jeecg/JEllipsis'
import ActualMaterialSelect from './select/ActualMaterialSelect.vue'
export default {
  name: 'ActualMaterialEditTable',
  mixins: [JeecgListMixin],
  components: {
    JEllipsis,
    ActualMaterialSelect
  },
  props: {
    repairOrderId: {
      type: String,
      required: false,
      default: '-1'
    },
    repairOrderStatus: {
      type: String,
      required: false,
      default: ''
    }
  },
  data() {
    return {
      title: "工艺确认",
      flag: false,//主页面的标记位  ç”¨äºŽåŒºåˆ†æ˜¯å¦ç¡®è®¤è¿‡å·¥å•工艺 æ¥åŒºåˆ†table页展示 å·¥å•工序 è¿˜æ˜¯äº§å“å·¥åº
      visible: false,
      model: {},
      obj: {},
      maskClosable: true,
      confirmLoading: false,
      form: this.$form.createForm(this),
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 99,
        pageSizeOptions: ['99', '199'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      validatorRules: {
        materialId: {
          rules: [
            { required: true, message: '请选择物料!' },
          ]
        },
        actualQuantity: {
          rules: [
            { required: false, message: '请填写数量!' },
          ]
        },
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      drawerWidth: "100%",
      visible: false,
      disableSubmit: false,
      disableSelect: false,
      loading: false,
      dataSource: [],
      columns: [
       {
          title: '领料出库单号',
          dataIndex: 'num',
          align: "center",
          width: 150,
        },
        {
          title: '备件编码',
          dataIndex: 'sparePartNum',
          align: "center",
        },
        {
          title: '备件名称',
          dataIndex: 'sparePartName',
          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'
        },
        {
          title: '使用数量',
          dataIndex: 'quantity',
          align: "center",
          scopedSlots: { customRender: 'quantity' },
          className: 'red',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: "/eam/repairOrder/listRepairOrderActualMaterialByMainId",
        confirmMaterial: "/eam/repairOrder/addRepairOrderActualMaterial"
      },
      changeIndex: 0
    }
  },
  created() {
    this.queryParam['repairOrderId'] = this.repairOrderId;
    this.loadData(1);
  },
  methods: {
    addMaterial() {
      this.dataSource.push({ materialId: '', repairOrderId: this.repairOrderId, actualQuantity: 1, materialNum: '', materialName: '', materialModel: '', materialSpecification: '', unitId_dictText: '' })
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close');
      this.dataSource = [];
      this.disableSubmit = false;
      this.visible = false;
    },
    handleDeleteFake(index) {
      this.dataSource.pop(index);
    },
    handleOk(saveStatus) {
      const that = this
      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].actualQuantity == undefined || materialDataSource[i].actualQuantity == null || materialDataSource[i].actualQuantity == '') {
            that.$message.warning("请填写第" + (i + 1) + "行用料数!");
            return false;
          }
        }
      }
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.repairOrderId = that.repairOrderId;
          formData.actualMaterialList = that.dataSource;
          let obj = obj = postAction(this.url.confirmMaterial, formData)
          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()
            that.loadData(1);
          })
        }
      })
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp[index];
      if (target) {
        target[column.dataIndex] = value;
        if ('materialId' == column.dataIndex) {
          target['materialId'] = value;
        }
        if ('actualQuantity' == column.dataIndex) {
          target['actualQuantity'] = value;
        }
        that.dataSource = temp;
      }
    },
    onSearchMaterial(index) {
      this.recordIndex = index
      this.$refs.actualMaterialSelect.list()
      this.$refs.actualMaterialSelect.title = '物料选择'
    },
    sendMaterialRecord(data, val) {
      let record = data.record
      const temp = [...this.dataSource]
      const target = temp[this.recordIndex]
      if (target) {
        console.log(target)
        target.materialId = record.id;
        target.materialName = record.name;
        target.materialNum = record.num;
        target.materialModel = record.model;
        target.materialSpecification = record.specification;
        target.unitId_dictText = record.unitId_dictText;
        this.dataSource = temp
      }
    },
    clearList() {
      this.dataSource = [];
      this.ipagination.current = 1
    }
  },
  watch: {
    repairOrderId: {
      immediate: true,
      handler(val) {
        this.clearList();
        this.queryParam['repairOrderId'] = val
        this.loadData(1);
      }
    }
  }
}
</script>
<style scoped>
/deep/ .red {
  color: red;
}
</style>
src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,301 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
  <a-table
         ref="table"
         bordered
         rowKey="id"
         :columns="columns"
         :dataSource="dataSource"
         :pagination="ipagination"
         @change="handleTableChange"
       >
         <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 == 'username'"
               enter-button
               @search="onSearchUser(index)"
               :value="text"
               :read-only="true"
               @change="(e) => handleChange(e, record.key, col, index)"
              />
             <a-input-number
               :value="text"
               v-if="col.dataIndex == 'actualHour'"
               :min="1"
               :max="99999"
               @change="(e)=>handleChange(e, record.key, col, index)"
               :disabled="record.disabled"
             />
           </div>
         </template>
         <span slot='action' slot-scope='text, record,index'>
                 <a @click="handleDeleteFake(index)">删除</a>
        </span>
       </a-table>
       <a-button
         style="width: 100%; margin-top: 16px; margin-bottom: 8px"
         type="dashed"
         icon="plus"
         @click="addHour"
         :disabled="repairOrderStatus!='3'"
       >添加实际工时
       </a-button>
       <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
       <a-row :style="{textAlign:'right'}">
         <a-button
           :style="{marginRight: '8px'}"
           @click="handleCancel"
           :disabled="repairOrderStatus!='3'"
         >
          æ¸…空
         </a-button>
         <a-button
            @click="handleOk(1)"
            type="primary"
            :style="{marginRight: '8px'}"
            :disabled="repairOrderStatus!='3'"
          >暂存</a-button>
          <a-button
          @click="handleOk(0)"
          type="primary"
          :disabled="repairOrderStatus!='3'"
          >保存</a-button>
       </a-row>
       <!-- :disabled="false" -->
     </div>
     <actual-hour-user-select
     ref="actualUserSelect"
     @sendUserRecord="sendUserRecord"
     >
     </actual-hour-user-select>
     </a-card>
</template>
<script>
import { postAction, getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import pick from 'lodash.pick'
import JEllipsis from '@/components/jeecg/JEllipsis'
import ActualHourUserSelect from './select/ActualHourUserSelect.vue'
export default {
 name: 'ActualWorkHoursEditTable',
 mixins: [JeecgListMixin],
  components: {
    JEllipsis,
    ActualHourUserSelect
  },
  props:{
    repairOrderId:{
      type:String,
      required:false,
      default:''
    },
    repairOrderStatus:{
      type:String,
      required:false,
      default:''
    }
  },
  data() {
    return {
      title: "工艺确认",
      flag: false,//主页面的标记位  ç”¨äºŽåŒºåˆ†æ˜¯å¦ç¡®è®¤è¿‡å·¥å•工艺 æ¥åŒºåˆ†table页展示 å·¥å•工序 è¿˜æ˜¯äº§å“å·¥åº
      visible: false,
      model: {},
      obj: {},
      maskClosable: true,
      confirmLoading: false,
      form: this.$form.createForm(this),
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 99,
        pageSizeOptions: ['99', '199'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      validatorRules: {
        userId: {
          rules: [
            { required: true, message: '请选择人员!' },
          ]
        },
        actual_hour: {
          rules: [
            { required: false, message: '请填写工时!'},
          ]
        },
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      drawerWidth: "100%",
      visible: false,
      disableSubmit: false,
      disableSelect: false,
      loading: false,
      dataSource: [],
      columns: [
          {
            title: '*人员编码',
            dataIndex: 'username',
            align: "center",
            scopedSlots: { customRender: 'username' },
            className: 'red',
            width: 250,
          },
          {
            title: '人员名称',
            dataIndex: 'realname',
            align: "center",
            width: 250,
          },
          {
            title: '*实际工时',
            dataIndex: 'actualHour',
            align: "center",
            className: 'red',
            scopedSlots: { customRender: 'actualHour' },
            width: 250,
          },
          {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          scopedSlots: { customRender: 'action' }
          }
        ],
      url: {
        list: "/eam/repairOrder/listRepairOrderActualWorkHoursByMainId",
        confirmHour:"/eam/repairOrder/addRepairOrderActualWorkHours"
      },
      changeIndex: 0
    }
  },
  created(){
    this.queryParam['repairOrderId'] = this.repairOrderId;
    this.loadData(1);
  },
  methods: {
    addHour() {
      this.dataSource.push({userId:'',repairOrderId:this.repairOrderId,actualHour:0,username:'',realname:''})
    },
    handleCancel() {
      this.close()
    },
    close() {
      this.$emit('close');
      this.dataSource = []
      this.disableSubmit = false;
      this.visible = false;
    },
    handleDeleteFake(index){
      this.dataSource.pop(index);
    },
    handleOk(saveStatus) {
      const that = this
      if(saveStatus==0){
        let workHoursDataSource = that.dataSource;
        for (let i = 0; i < workHoursDataSource.length; i++) {
          if (workHoursDataSource[i].userId == undefined || workHoursDataSource[i].userId == null || workHoursDataSource[i].userId == '') {
            that.$message.warning("请选择第"+(i+1)+"行维修人员!");
            return false;
          }
          if(workHoursDataSource[i].actualHour == undefined || workHoursDataSource[i].actualHour == null||workHoursDataSource[i].actualHour==''){
            that.$message.warning("请填写第"+(i+1)+"行实际工时!");
            return false;
          }
        }
      }
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.repairOrderId = that.repairOrderId;
          formData.actualHourList = that.dataSource;
          let obj = obj = postAction(this.url.confirmHour, formData)
          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()
            that.loadData(1);
          })
        }
      })
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp[index];
      if (target) {
        target[column.dataIndex] = value;
        if ('userId' == column.dataIndex) {
          target['userId'] = value;
        }
        if ('actualHour' == column.dataIndex) {
          target['actualHour'] = value;
        }
        that.dataSource = temp;
      }
    },
    onSearchUser(index) {
      this.recordIndex = index
      this.$refs.actualUserSelect.list()
      this.$refs.actualUserSelect.title = '人员选择'
    },
    sendUserRecord(data, val) {
      let record = data.record
      const temp = [...this.dataSource]
      const target = temp[this.recordIndex]
      if (target) {
        console.log(record)
        target.userId = record.id;
        target.username = record.username;
        target.realname = record.realname;
        this.dataSource = temp
      }
    },
    clearList(){
        this.dataSource=[];
        this.ipagination.current = 1
    }
  },
  watch:{
    repairOrderId:{
      immediate: true,
        handler(val) {
            this.clearList();
            this.queryParam['repairOrderId'] = val
            this.loadData(1);
        }
    }
  }
}
</script>
<style scoped>
/deep/ .red {
  color: red;
}
</style>
src/views/eam/modules/predictiveWorkOrder/DetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,220 @@
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="mainId">
      <a-button
      @click="handleAdd"
      type="primary"
      icon="plus"
      v-if="mainId !='' && isAdd "
      >新增</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" 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="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record" >
          <a @click="handleEdit(record)" v-if="addStatus" >编辑</a>
          <a-divider type="vertical"  v-if="addStatus" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" >
            <a v-if="addStatus">删除</a>
          </a-popconfirm>
          <a style="font-size: 12px;font-style: italic;" v-if="!addStatus">该状态不可操作</a>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  export default {
    name: "RepairOrderDetailList",
    mixins:[JeecgListMixin],
    components: { },
    props:{
      mainId:{
        type:String,
        default:'',
        required:false
      },
      maintenanceStandardId: {
        type: String,
        required: false
      },
      isEdit: {
        type: Boolean,
        default: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    watch:{
      mainId:{
        immediate: true,
        handler(val) {
          if(!this.mainId){
            this.clearList()
          }else{
            this.queryParam['repairOrderId'] = val
            this.loadData(1);
          }
        }
      }
    },
    data () {
      return {
        disableMixinCreated:true,
        repairOrderSelectionRows:[],
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'部位',
            align:"center",
            dataIndex: 'location',
            width:200
          },
          {
            title:'示意图',
            align:"center",
            scopedSlots: {customRender: 'imgSlot'},
            dataIndex: 'sketchMap',
            width:200
          },
          // {
          //   title:'维修项目',
          //   align:"center",
          //   dataIndex: 'maintenanceItem'
          // },
          {
            title:'维修要求',
            align:"center",
            dataIndex: 'maintenanceRequire',
            width:200
          },
          {
            title:'方法',
            align:"center",
            dataIndex: 'maintenanceWay',
            width:200
          },
          {
            title:'工具',
            align:"center",
            dataIndex: 'maintenanceTooling',
            width:200
          },
          {
            title:'安全要求',
            align:"center",
            dataIndex: 'safetyRequirement' ,
            width:200
          },
          {
            title:'工时定额',
            align:"center",
            dataIndex: 'timeQuota',
            width:200
          },
          {
            title:'维保专业',
            align:"center",
            dataIndex: 'mamaintenanceSpecialtyId_dictText',
            width:200
          },
        ],
        url: {
          list: "/eam/repairOrder/pageRepairOrderDetailByMainId",
          delete: "/eam/repairOrder/deleteRepairOrderDetail",
          deleteBatch: "/eam/repairOrder/deleteBatchRepairOrderDetail",
          exportXlsUrl: "/eam/repairOrder/exportRepairOrderDetail",
          importUrl: "/eam/repairOrder/importRepairOrderDetail",
        },
        dictOptions:{
        }
      }
    },
    created() {
    },
    computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
    },
    mounted() {
    this.$bus.$on('repairOrderSelectionRows', (data) => {
      this.repairOrderSelectionRows = data
    })
  },
    methods: {
      clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/eam/modules/predictiveWorkOrder/PlanMaterial.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,220 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
          >
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction, deleteAction } from '@/api/manage'
  import Tooltip from 'ant-design-vue/es/tooltip'
  export default {
    name: 'PlanningMaterial',
    components: {
      Tooltip,
    },
    mixins: [JeecgListMixin],
    props: {
      maintenanceStandardId: {
        type: String,
        required: false
      },
      isEdit: {
        type: Boolean,
        default: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    mounted() {
    },
    watch: {
      maintenanceStandardId: {
        immediate: true,
        handler(val) {
        if (this.maintenanceStandardId) {
          this.queryParam.maintenanceStandardId = val
          this.queryParam.delFlag = 0
          this.loadData(1)
        }else{
          this.clearList();
        }
      }
    },
  },
    data() {
      return {
        disableMixinCreated:true,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '备件编号',
            dataIndex: 'num',
            align: 'center',
            width:200
          },
          {
            title: '备件名称',
            dataIndex: 'name',
            align: 'center',
            width:200
          },
          {
            title: '备件规格',
            dataIndex: 'specification',
            align: 'center',
            width:200
          },
          {
            title: '备件型号',
            dataIndex: 'model',
            align: 'center',
            width:200
          },
          {
            title: '制造商',
            dataIndex: 'constructorName',
            align: 'center',
            width:200
          },
          {
            title: '数量',
            dataIndex: 'quantity',
            align: 'center',
            width:200
          },
          {
            title: '单位',
            dataIndex: 'unitName',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/maintenanceStandardPlanningMaterial/getMaintenanceStandardPlanningMaterialList',
          delete: '/eam/maintenanceStandardPlanningMaterial/delete'
        }
      }
    },
    methods: {
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '计划用料'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
          this.$message.error('请设置url.delete属性!')
          return
        }
        var that = this
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message)
            that.loadData()
            that.alterFlag = new Date()
          } else {
            that.$message.warning(res.message)
          }
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      },
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1
        }
        var params = this.getQueryParams()//查询条件
        this.loading = true
        // this.originTargetKeys = [];
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records || res.result
            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)
          }
        }).finally(() => {
          this.loading = false
        })
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,728 @@
<template>
  <a-drawer
    :title="title"
    :width="drawerWidth"
    :visible="visible"
    @close="handleCancel"
    :confirmLoading="confirmLoading"
    :maskClosable="maskClosable"
  >
    <a-card :style="getBackground()">
      <template>
        <a-card>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-row :style="{textAlign:'left'}">
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleSW"
                :disabled=SWbuttonDistable
                type="primary"
              >开工</a-button>
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleReport"
                :disabled="buttonDistable"
                type="primary"
              >报工</a-button>
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleReset"
                :disabled="revocationDistable"
                type="primary"
              >撤销</a-button>
            </a-row>
          </div>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="状态"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.statusName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="保养工单号"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.num }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="保养类型"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.maintenanceTypeName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="对象部门"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.departName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="维保方式"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hight"
                  >{{ this.model.maintenanceMode }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="责任班组"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.teamName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
          </div>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-row :gutter="24">
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="设备编号"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.equipmentNum }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="设备名称"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.equipmentName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="设备型号"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.equipmentModel }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
          </div>
          <a-tabs
            type="card"
            defaultActiveKey="1"
          >
            <a-tab-pane
              tab='触发条件'
              key="1"
              class="hightColor"
            >
            <div
            class="table-operator"
            style="margin:-16px"
            >
                <predictive-spare-parts :planId='workPlanId' v-show="model.monitorType == 'smkz'"/>
                <!--            v-if="selectionRows[0].monitorType == 'smkz'"-->
                <predictive-parameters  :planId='workPlanId' v-show="model.monitorType == 'cskz'"/>
                <!--            v-if="selectionRows[0].monitorType == 'cskz'" -->
                <predictive-warn :planId='workPlanId' v-show="model.monitorType == 'bjkz'"/>
                <!--            v-if="selectionRows[0].monitorType == 'bjkz'"-->
            </div>
            </a-tab-pane>
            <a-tab-pane
              tab='维护内容'
              key="2"
              class="hightColor"
            >
            <predictive-order-detail-list :mainId='workPlanId'></predictive-order-detail-list>
            </a-tab-pane>
            <a-tab-pane
              tab='计划用料'
              key="3"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <plan-material :maintenanceStandardId="workPlanId" />
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='危险防控'
              key="4"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <maintenance-standard-safety-requirement :maintenanceStandardId='workPlanId' />
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='作业指导书'
              key="5"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
              <predictive-work-instruction :maintenanceStandardId='workPlanId'></predictive-work-instruction>
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='实际用料'
              key="6"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <actual-material-edit-table
                  ref="actualMaterialTabel"
                  :specialyMaintenanceOrderId="this.model.id"
                  :specialyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                ></actual-material-edit-table>
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='实际工时'
              key="7"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <actual-work-hours-edit-table
                  :specialyMaintenanceOrderId="this.model.id"
                  :specialyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                  :teamId="this.model.teamId"
                ></actual-work-hours-edit-table>
              </div>
            </a-tab-pane>
          </a-tabs>
        </a-card>
      </template>
    </a-card>
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :style="{textAlign:'right'}">
        <a-button
          :style="{marginRight: '8px'}"
          @click="handleCancel"
        >
          å–消
        </a-button>
        <a-button
          :style="{marginRight: '8px'}"
          @click="handleTS"
          :disabled="buttonDistable"
          type="primary"
          v-if="false"
        >暂存</a-button>
        <a-button
          @click="handleOk"
          :disabled="buttonDistable"
          type="primary"
          v-if="false"
        >保存</a-button>
      </a-row>
    </div>
  </a-drawer>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { requestPut, getAction, downFile } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import { preview } from 'vue-photo-preview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
import PdfView from '@views/common/PdfView'
import { getFileAccessHttpUrl } from '@/api/manage';
import PlanMaterial from './PlanMaterial.vue'
import MaintenanceStandardSafetyRequirement from './SafetyRequirement'
import ActualMaterialEditTable from './ActualMaterialEditTable'
import ActualWorkHoursEditTable from './ActualWorkHoursEditTable'
//新东西
import PredictiveParameters from './boms/PredictiveParameters.vue'
import PredictiveSpareParts from './boms/PredictiveSpareParts.vue'
import PredictiveWarn from './boms/PredictiveWarn.vue'
import PredictiveOrderDetailList from './DetailList'
import PredictiveWorkInstruction from './WorkInstruction'
export default {
  name: 'PredictiveWorkOrderExeDrawer',
  mixins: [JeecgListMixin],
  components: {
    PdfView,
    Tooltip,
    PlanMaterial,
    MaintenanceStandardSafetyRequirement,
    ActualMaterialEditTable,
    ActualWorkHoursEditTable,
    PredictiveParameters,
    PredictiveSpareParts,
    PredictiveWarn,
    PredictiveOrderDetailList,
    PredictiveWorkInstruction
  },
  data() {
    return {
      pageSizeOptions: ['1'],
      currentPage: 1,
      pageSize: 1,
      total: 10,
      workPlanId:'',
      title: "专业工单执行",
      visible: false,
      maskClosable: true,
      confirmLoading: false,
      drawerWidth: "100%",
      buttonDistable: false,
      SWbuttonDistable: false,
      revocationDistable: false,
      currentNodeSelect: '',
      specialtyMaintenancePlanId: '',
      maintenanceStandardId: '-1',
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      url: {
        getEquipmentTotalByOrderId: "/eam/specialtyMaintenanceOrderDetail/getEquipmentTotalByOrderId",
        urlDownload: window._CONFIG['staticDomainURL'],
        download: '/sys/upload/downloadFile',
        editStatus: "/eam/specialtyMaintenanceOrder/editStatus",
        revocation: "/eam/specialtyMaintenanceOrder/revocation",
        report: "/eam/specialtyMaintenanceOrder/report",
      },
    }
  },
  mounted() {
    this.$bus.$on('closeDrawer', (data) => {
      this.visible = false;
    })
  },
  methods: {
    onChange(page, pageSize) {
      this.queryParam.specialtyMaintenanceOrderId = this.specialtyMaintenanceOrderId
      this.queryParam.pageSize = pageSize
      this.queryParam.pageNo = page
      this.getEquipmentTotal()
    },
    handleShow(record) {
      this.model = Object.assign({}, record);
      this.workPlanId = record.workPlanId;
      this.visible = true;
    },
    getEquipmentTotal() {
      var params = this.queryParam;//查询条件
      getAction(this.url.getEquipmentTotalByOrderId, params).then((res) => {
        if (res.success) {
          this.total = res.result.total
          this.model.equipmentNum = res.result.records[0].equipmentNum
          this.model.equipmentName = res.result.records[0].equipmentName
          this.model.equipmentModel = res.result.records[0].equipmentModel
          this.model.equipmentId = res.result.records[0].equipmentId
          this.queryParam.equipmentId = res.result.records[0].equipmentId
          this.loadData1(1)
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
      })
    },
    loadData1(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            this.maintenanceStandardId = res.result.records[i].maintenanceStandardId;
            let r = res.result.records[i].sketchPhoto;
            r.src = this.getSrc(res.result.records[i].sketchPhoto);
          }
          //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;
          }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
    modalFormOk() {
      this.getEquipmentTotal()
      //清空列表选中
      this.onClearSelected()
    },
    loadData() {
      // this.getEquipmentTotal()
    },
    getBackground() {
      return "background-color:rgba(127, 127, 127,0.08)";
    },
    handleCancel() {
      this.$emit('ok');
      this.alterFlag = new Date();
      this.close()
    },
    close() {
      this.visible = false;
    },
    //暂存
    handleTS() {
      const that = this;
      that.confirmLoading = true;
      let formData = Object.assign(this.model);
      formData.specialtyInspectionOrderDetails = that.dataSource
      requestPut(this.url.edit, formData).then((res) => {
        if (res.success) {
          that.$message.success("暂存成功!");
          that.getEquipmentTotal()
          that.$emit('ok');
          that.alterFlag = new Date();
        } else {
          that.$message.warning(res.message);
        }
      }).finally(() => {
        that.confirmLoading = false;
        // that.close();
      })
    },
    //开工
    handleSW() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '保养工单开工',
        content: '提示:开工后无法撤回,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.editStatus, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
            if (res.success) {
              that.model.status = '4'
              that.$message.success("工单开工成功!")
              that.getEquipmentTotal()
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
            } else {
              that.$message.warning("工单开工失败!")
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
    //报工
    handleReport() {
      var actualMaterials = this.$refs.actualMaterialTabel.dataSource;
      for (var i = 0; i < actualMaterials.length; i++) {
        if (actualMaterials[i].isLock == 'no') {
          this.$message.warn("实际用料第" + (i + 1) + "行尚未锁料,请锁料后再进行报工");
          return false;
        }
      }
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '保养工单报工',
        content: '提示:报工后点检完工,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.report, { id: that.specialtyMaintenanceOrderId, status: '5' }).then((res) => {
            if (res.success) {
              that.model.status = '5'
              that.$message.success(res.message)
              that.getEquipmentTotal()
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
              that.$emit('ok');
              that.alterFlag = new Date();
              that.close();
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
            //
          })
        },
      })
    },
    //撤销
    handleReset() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '完工撤销',
        content: '提示:完工撤销后可继续报工操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.revocation, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
            if (res.success) {
              that.model.status = '4'
              that.$message.success(res.message)
              that.getEquipmentTotal()
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
    //保存
    handleOk() {
      const that = this;
      that.confirmLoading = true;
      let formData = Object.assign(this.model);
      for (let i = 0; i < that.dataSource.length; i++) {
        let o = this.dataSource[i]
        if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') {
          that.$message.warning('请输入点检结果!')
          that.confirmLoading = false;
          return
        }
        if (o.treatmentMeasure == null || o.treatmentMeasure == '') {
          that.$message.warning('请选择异常处置!')
          that.confirmLoading = false;
          return
        }
      }
      formData.specialtyInspectionOrderDetails = that.dataSource
      requestPut(this.url.save, formData).then((res) => {
        if (res.success) {
          that.$message.success("保存成功!");
          that.getEquipmentTotal()
          that.$emit('ok');
          that.alterFlag = new Date();
        } else {
          that.$message.warning("保存失败!");
        }
      }).finally(() => {
        that.confirmLoading = false;
        // that.close();
      })
    },
    view(record) {
      this.$refs.pdfview.showPdf(record.src);
    },
    handleDownload(record) {
      downFile(this.url.download, { id: record.upload.id }).then((res) => {
        if (!res) {
          this.$message.warning('文件下载失败')
          return
        } else {
          let fileName = record.upload.name;
          if (typeof window.navigator.msSaveBlob !== 'undefined') {
            window.navigator.msSaveBlob(new Blob([res]), fileName);
          } else {
            let url = window.URL.createObjectURL(new Blob([res]));
            let link = document.createElement('a');
            link.style.display = 'none';
            link.href = url;
            link.setAttribute('download', fileName);
            document.body.appendChild(link);
            link.click()
            document.body.removeChild(link) //下载完成移除元素
            window.URL.revokeObjectURL(url) //释放掉blob对象
          }
        }
      })
    },
    getSrc(record) {
      if (!record.path) {
        return '';
      }
      //本地:local\Minio:minio\阿里云:alioss
      if (record.uploadType == 'local') {
        let ssoLoginFlag = Vue.ls.get("ssoLoginFlag");
        let deployMode = Vue.ls.get("deployMode");
        if (ssoLoginFlag && deployMode == "container") {
          var baseProject = Vue.ls.get("baseProject");
          console.log("baseProject==>" + baseProject)
          var hostname = window.location.protocol + "//" + window.location.host;
          var url = hostname + '/' + baseProject + '/sys/common/static';
          return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer'])
        } else {
          //根据发布状态修改https æˆ– http
          return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer'])
        }
      } else if (record.uploadType == 'alioss') {
        const OSS = require('ali-oss')
        const client = new OSS({
          // region以杭州为例(oss-cn-hangzhou),其他region按实际情况填写。
          region: window._CONFIG['region'],
          // é˜¿é‡Œäº‘主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
          accessKeyId: window._CONFIG['accessKeyId'],
          accessKeySecret: window._CONFIG['accessKeySecret'],
          bucket: window._CONFIG['bucket'],
        })
        // object-key表示从OSS下载文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
        return client.signatureUrl(record.path)
      }
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.hightColor {
  height: 10%;
  font-weight: bold;
  font-size: 20px;
  color: #1b1e1e;
}
.frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.hight {
  color: #f5222d;
}
.red {
  color: red;
}
</style>
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,368 @@
<template>
  <a-modal
    :title="title"
    :width="1250"
    :visible="visible"
    :maskClosable="false"
    @ok="handleOk"
    cancelText="关闭"
    @cancel="handleCancel"
    :confirmLoading="confirmLoading"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              label="统一编码"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'系统自动生成'"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              label="保养日期"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <j-date
                :disabled="disableSubmit"
                v-decorator="['planStartTime', validatorRules.planStartTime ]"
                placeholder="请选择维护时间"
                style="width: 100%"
                :showTime="true"
                dateFormat="YYYY-MM-DD HH:mm:ss"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              label="专业保养方案"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input-search
                :disabled="disableSubmit"
                :placeholder="disableSubmit?'':'请选择预测性维护方案'"
                enter-button
                @search="onPredictiveWorkPlanList()"
                :read-only="true"
                v-decorator="['planNum', validatorRules.planNum]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="派工方式"
            >
              <j-dict-select-tag
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请选择派工方式'"
                :triggerChange="true"
                dictCode="assign_mode"
                v-decorator="['assignMode', validatorRules.assignMode]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="责任班组"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入责任班组'"
                v-decorator="['teamId_dictText', validatorRules.teamId_dictText ]"
              />
            </a-form-item>
          </a-col>
          <a-col
            hidden
            :span="12"
          >
            <a-form-item
              label="专业点检方案Id"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'专业点检方案Id'"
                v-decorator="['workPlanId', validatorRules.workPlanId ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row
          v-if="!isHidden"
          :gutter="24"
        >
          <a-col :span="12">
            <a-form-item
              label="责任人"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input-search
                :disabled="disableSubmit"
                placeholder="责任人"
                enter-button
                @search="onDutyUserList()"
                :read-only="true"
                v-decorator="['maintenanceUserId_dictText', validatorRules.maintenanceUserId_dictText]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row
          hidden
          :gutter="24"
        >
          <a-col :span="12">
            <a-form-item
              label="责任班组Id"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入责任班组Id'"
                v-decorator="['teamId', validatorRules.teamId ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="12">
            <a-form-item
              label="责任人/维护人Id"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入责任人'"
                v-decorator="['maintenanceUserId', validatorRules.maintenanceUserId ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <template slot="footer">
      <a-button
        :style="{marginRight: '8px'}"
        @click="handleCancel()"
      >
        å…³é—­
      </a-button>
      <a-button
        @click="handleOk()"
        type="primary"
        :loading="confirmLoading"
        :disabled="disableSubmit || confirmLoading"
      >确定</a-button>
    </template>
    <predictive-work-plan-list
      ref="PredictiveWorkPlanList"
      @sendPlanRecord='sendPlanRecord'
    ></predictive-work-plan-list>
  </a-modal>
</template>
<script>
import { getAction, postAction, requestPut } from '@/api/manage'
import pick from 'lodash.pick'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import Tooltip from 'ant-design-vue/es/tooltip'
import PredictiveWorkPlanList from './PredictiveWorkPlanList.vue'
export default {
  name: "MaintenanceOrderModal",
  components: {
    JMultiSelectTag,
    Tooltip,
    PredictiveWorkPlanList
    // PdfView,
    // preview,
  },
  data() {
    return {
      isHidden: true,
      title: "操作",
      visible: false,
      disableSubmit: false,
      codeDisable: true,
      model: {},
      inspectionCycles: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            // { required: true, message: '请输入工单编码!' },
          ]
        },
        planNum: {
          rules: [
            { required: true, message: '请选择专业点检方案!' },
          ]
        },
        planStartTime: {
          rules: [
            { required: true, message: '请选择保养日期!' },
          ]
        },
        assignMode: {
          rules: [
            { required: true, message: '请选择派工方式!' },
          ]
        },
        maintenanceUserId_dictText: {
          rules: [
            { required: true, message: '请选择责任人!' },
          ]
        },
        teamId_dictText: {
          rules: [
            { required: true, message: '请选择责任班组!' },
          ]
        },
      },
      url: {
        add: "/eam/specialtyMaintenanceOrder/add",
        edit: "/eam/specialtyMaintenanceOrder/edit",
      },
    }
  },
  methods: {
    add() {
      this.edit({})
    },
    edit(record) {
      let that = this;
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.visible = true;
      that.$nextTick(() => {
        that.form.setFieldsValue(pick(that.model, 'num', 'planNum', 'assignMode', 'assignMode_dictText', 'teamId', 'teamId_dictText', 'workPlanId', 'planStartTime'));
      });
      if (record.id) {
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
      }
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleCancel() {
      this.close();
    },
    onPredictiveWorkPlanList() {
      this.$refs.PredictiveWorkPlanList.list();
      this.$refs.PredictiveWorkPlanList.title = "选择预测性维护方案";
    },
    sendPlanRecord(data) {
      let record = data.record;
      this.form.setFieldsValue({ assignMode: null, teamId_dictText: null, teamId: null, maintenanceUserName: null, maintenanceUserId: null });
      this.form.setFieldsValue({ workPlanId: record.id, planNum: record.num });
      this.form.setFieldsValue({ assignMode: record.assign_mode, teamId_dictText: record.teamName, teamId: record.teamId });
      if ("3" == record.assignMode) {
        this.isHidden = false
      } else {
        this.isHidden = true
      }
    },
    handleOk() {
      const that = this;
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          if (!this.model.id) {
            obj = postAction(this.url.add, formData);
          } else {
            obj = requestPut(this.url.edit, formData, { id: this.model.id });
          }
          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();
          })
        }
      })
    },
  },
}
</script>
<style lang="less" scoped>
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkPlanList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,392 @@
<template>
  <a-modal
    :title="title"
    :width="1250"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <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.num"
                  ></a-input>
                </a-form-item>
              </a-col>
              <!-- <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="人员编号">
                  <a-input
                    placeholder="请输入人员编号检索"
                    v-model="queryParam.username"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="人员名称">
                  <a-input
                    placeholder="请输入人员名称检索"
                    v-model="queryParam.realname"
                  ></a-input>
                </a-form-item>
              </a-col> -->
              <a-col
                :md="6"
                :sm="8"
              >
                <a-button
                  type="primary"
                  @click="searchQuery"
                  icon="search"
                >查询</a-button>
                <a-button
                  @click="searchReset"
                  icon="reload"
                  style="margin-left:8px;"
                >重置</a-button>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
              </a-col>
            </a-row>
          </a-form>
        </div>
        <div style="margin-top:8px;">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            @change="handleTableChange"
            :customRow="clickThenCheck"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
          >
          </a-table>
        </div>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import { postAction, getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import Tooltip from 'ant-design-vue/es/tooltip'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'//引入过长裁剪
import store from '@/store'
export default {
  name: "PredictiveWorkPlanList",
  mixins: [JeecgListMixin],
  components: {
    JDate,
    Tooltip,
    JEllipsis,
  },
  data() {
    return {
      title: "预测性维护方案",
      visible: false,
      model: {},
      dataSource: [],
      disableSubmit: false,
      type: "radio",
      params: "-1",
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      columns: [
      {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '版本状态',
            align: 'center',
            dataIndex: 'statusName'
          },
          {
            title: '版本',
            align: 'center',
            dataIndex: 'planVersion'
          },
          {
            title: '方案编码',
            align: 'center',
            dataIndex: 'num'
          },
          {
            title: '方案名称',
            align: 'center',
            dataIndex: 'name'
          },
          {
            title: '监控类型',
            align: 'center',
            dataIndex: 'monitorTypeName'
          },
          {
            title: '设备编码',
            align: 'center',
            dataIndex: 'deviceNum'
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'deviceName'
          },
          {
            title: '设备型号',
            align: 'center',
            dataIndex: 'deviceModel'
          },
          {
            title: '维保方式',
            align: 'center',
            dataIndex: 'maintenanceMethodName'
          },
          {
            title: '派工方式',
            align: 'center',
            dataIndex: 'assignModeName'
          },
          {
            title: '责任班组',
            align: 'center',
            dataIndex: 'teamName'
          },
          {
            title: '创建人',
            align: 'center',
            dataIndex: 'createBy'
          },
          {
            title: '创建日期',
            align: 'center',
            dataIndex: 'createTime'
          },
      ],
      url: {
        list: '/eam/predictiveworkplan/pagePredictiveWorkPlan',
      },
    }
  },
  methods: {
    searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {};
      this.loadData(1)
    },
    list() {
      this.selectedRowKeys = [];
      this.selectedRowRecord = [];
      this.visible = true;
      this.loadData(1);
    },
    clickThenCheck(record) {
      return {
        on: {
          click: (e) => {
            this.selectedRowRecord = record;
            this.onSelectChange(record.id.split(","), [record]);
          }
        }
      };
    },
    onSelectChange(selectedRowKeys, selectedRows) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRowRecord = selectedRows[0];
    },
    close() {
      this.queryParam = {};
      this.$emit('close');
      this.visible = false;
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1
      }
      this.queryParam.status = '1'
      var params = this.getQueryParams() //查询条件
      this.loading = true
      getAction(this.url.list, params)
        .then(res => {
          if (res.success) {
            //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
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          } else {
            this.$message.warning(res.message)
          }
        })
        .finally(() => {
          this.loading = false
        })
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      if (that.selectedRowKeys.length > 0) {
        if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
          that.$emit('sendPlanRecord', { record: that.selectedRowRecord });
          that.close();
        } else {
          that.$message.error("请选择预测性维护方案!")
        }
      } else {
        that.$message.error("请选择预测性维护方案!")
      }
    },
    handleCancel() {
      this.close();
    },
  },
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
.fontweight {
  font-weight: bold;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.anty-row-operator button {
  margin: 0 5px;
}
.ant-btn-danger {
  background-color: #ffffff;
}
.ant-modal-cust-warp {
  height: 100%;
}
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
.notshow {
  display: none;
}
.frozenRowClass {
  color: #c9c9c9;
}
.hight {
  color: #f5222d;
}
.middle {
  color: #fa8c16;
}
.low {
  color: #52c41a;
}
.dataUnKnow {
  color: #1890ff;
}
.frozenRowClass {
  color: #c9c9c9;
}
</style>
src/views/eam/modules/predictiveWorkOrder/SafetyRequirement.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,210 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <a-button
      @click="handleAdd"
      type="primary"
      icon="plus"
      v-if="maintenanceStandardId !='' && isAdd "
    >新增
    </a-button>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
          >
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction, deleteAction } from '@/api/manage'
  import Tooltip from 'ant-design-vue/es/tooltip'
  export default {
    name: 'MaintenanceStandardPlanningMaterial',
    components: {
      Tooltip,
    },
    mixins: [JeecgListMixin],
    props: {
      maintenanceStandardId: {
        type: String,
        required: false
      },
      isEdit: {
        type: Boolean,
        default: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    mounted() {
    },
    watch: {
      maintenanceStandardId: {
        immediate: true,
        handler(val) {
        if (this.maintenanceStandardId) {
          this.queryParam.maintenanceStandardId = val
          this.queryParam.delFlag = 0
          this.loadData(1)
        }else{
          this.clearList();
        }
      }
    },
  },
    data() {
      return {
        disableMixinCreated:true,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 100,
            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: 'description',
            width:200
          },
          {
            title: '防控措施',
            align: 'center',
            dataIndex: 'measure',
            width:200
          },
        ],
        url: {
          list: '/eam/maintenanceStandardSafetyRequirement/getMaintenanceStandardSafetyRequirementList',
          delete: '/eam/maintenanceStandardSafetyRequirement/delete'
        }
      }
    },
    methods: {
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '危险防控'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
          this.$message.error('请设置url.delete属性!')
          return
        }
        var that = this
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message)
            that.loadData()
            that.alterFlag = new Date()
          } else {
            that.$message.warning(res.message)
          }
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      },
      loadData(arg) {
        if (!this.url.list) {
          this.$message.error('请设置url.list属性!')
          return
        }
        //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1
        }
        var params = this.getQueryParams()//查询条件
        this.loading = true
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            this.dataSource = res.result.records || res.result
            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)
          }
        }).finally(() => {
          this.loading = false
        })
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/WorkInstruction.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,373 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <a-button
      @click="handleAdd"
      type="primary"
      icon="plus"
      v-if="maintenanceStandardId !='' && isAdd "
    >新增</a-button>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span
          slot="size"
          slot-scope="text"
          class="error"
        >
          {{sizeConvert(text)}}
        </span>
        <!-- <span
          slot="action"
          slot-scope="text, record"
        >
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
          >
            <a>删除</a>
          </a-popconfirm>
        </span> -->
        <span
          slot="action"
          slot-scope="text, record"
        >
          <Tooltip
            placement="top"
            title="预览图片"
          >
            <img
              v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')"
              width="30"
              height="14"
              border="1"
              draggable="false"
              preview="1"
              :preview-text="''"
              :src="record.upload.src"
            />
          </Tooltip>
          <a
            v-if="record.upload.path && record.upload.format.toLowerCase()=='pdf'"
            href="javascript:;"
            @click="view(record)"
          >
            é¢„览
          </a>
          <a-divider
            v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')"
            type="vertical"
          />
          <a
            href="javascript:;"
            @click="handleDownload(record)"
          >下载</a>
          <a-divider type="vertical" />
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
          >
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <pdf-view ref="pdfview"></pdf-view>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, deleteAction, downFile } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import JInput from '@/components/jeecg/JInput'
import JEllipsis from "@/components/jeecg/JEllipsis";
import { preview } from 'vue-photo-preview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
import PdfView from '@views/common/PdfView'
import { getFileAccessHttpUrl } from '@/api/manage';
import store from '@/store/'
export default {
  name: "MaintenanceStandardWorkInstruction",
  components: {
    Tooltip,
    JInput,
    JEllipsis,
    PdfView,
    preview,
  },
  mixins: [JeecgListMixin],
  props: {
    maintenanceStandardId: {
      type: String,
      required: false
    },
    isEdit: {
      type: Boolean,
      default: false
    },
    isAdd: {
      type: Boolean,
      default: false
    },
    isDel: {
      type: Boolean,
      default: false
    }
  },
  mounted() {
  },
  watch: {
      maintenanceStandardId: {
        immediate: true,
        handler(val) {
        if (this.maintenanceStandardId) {
          this.queryParam.maintenanceStandardId = val
          this.queryParam.delFlag = 0
          this.loadData(1)
        }else{
          this.clearList();
        }
      }
    },
  },
  data() {
    return {
      disableMixinCreated:true,
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 100,
          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: 'typeName',
          width:200
        },
        {
          title: '文档大小',
          align: 'center',
          dataIndex: 'size',
          scopedSlots: { customRender: 'size' },
          width:200
        },
      ],
      url: {
        list: "/eam/maintenanceStandardWorkInstruction/getMaintenanceStandardWorkInstructionList",
        delete: "/eam/maintenanceStandardWorkInstruction/delete",
        urlDownload: window._CONFIG['staticDomainURL'],
        download: '/sys/upload/downloadFile',
      },
    }
  },
  methods: {
    handleAdd: function () {
      this.$refs.modalForm.add();
      this.$refs.modalForm.title = "作业指导书";
      this.$refs.modalForm.disableSubmit = false;
      this.$refs.modalForm.maintenanceStandardId = this.maintenanceStandardId
    },
    handleDelete: function (id) {
      if (!this.url.delete) {
        this.$message.error("请设置url.delete属性!")
        return
      }
      var that = this;
      deleteAction(that.url.delete, { id: id }).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          that.$message.success(res.message);
          that.loadData();
          that.alterFlag = new Date();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            let r = res.result.records[i].upload;
            r.src = this.getSrc(res.result.records[i].upload);
          }
          this.dataSource = res.result.records || res.result;
          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)
        }
      }).finally(() => {
        this.loading = false
      })
    },
    handleDownload(record) {
      downFile(this.url.download, { id: record.upload.id }).then((res) => {
        if (!res) {
          this.$message.warning('文件下载失败')
          return
        } else {
          let fileName = record.name;
          if (typeof window.navigator.msSaveBlob !== 'undefined') {
            window.navigator.msSaveBlob(new Blob([res]), fileName);
          } else {
            let url = window.URL.createObjectURL(new Blob([res]));
            let link = document.createElement('a');
            link.style.display = 'none';
            link.href = url;
            link.setAttribute('download', fileName);
            document.body.appendChild(link);
            link.click()
            document.body.removeChild(link) //下载完成移除元素
            window.URL.revokeObjectURL(url) //释放掉blob对象
          }
        }
      })
    },
    //拼装src
    getSrc(record) {
      if (!record.path) {
        return '';
      }
      //本地:local\Minio:minio\阿里云:alioss
      if (record.uploadType == 'local') {
        let ssoLoginFlag = Vue.ls.get("ssoLoginFlag");
        let deployMode = Vue.ls.get("deployMode");
        if (ssoLoginFlag && deployMode == "container") {
          var baseProject = Vue.ls.get("baseProject");
          console.log("baseProject==>" + baseProject)
          var hostname = window.location.protocol + "//" + window.location.host;
          var url = hostname + '/' + baseProject + '/sys/common/static';
          return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer'])
        } else {
          //根据发布状态修改https æˆ– http
          return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer'])
        }
      } else if (record.uploadType == 'alioss') {
        const OSS = require('ali-oss')
        const client = new OSS({
          // region以杭州为例(oss-cn-hangzhou),其他region按实际情况填写。
          region: window._CONFIG['region'],
          // é˜¿é‡Œäº‘主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
          accessKeyId: window._CONFIG['accessKeyId'],
          accessKeySecret: window._CONFIG['accessKeySecret'],
          bucket: window._CONFIG['bucket'],
        })
        // object-key表示从OSS下载文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
        return client.signatureUrl(record.path)
      }
    },
    sizeConvert(limit) {
      var size = "";
      if (limit < 0.1 * 1024) {
        size = parseFloat(limit).toFixed(2) + "B";//小于0.1KB,则转化成B
      } else if (limit < 0.1 * 1024 * 1024) {
        size = (parseFloat(limit) / 1024).toFixed(2) + "KB";//小于0.1MB,则转化成KB
      } else if (limit < 0.1 * 1024 * 1024 * 1024) {
        size = (parseFloat(limit) / (1024 * 1024)).toFixed(2) + "MB";//小于0.1GB,则转化成MB
      } else {
        size = (parseFloat(limit) / (1024 * 1024 * 1024)).toFixed(2) + "GB";//其他转化成GB
      }
      var sizeStr = size + "";//转成字符串
      var index = sizeStr.indexOf(".");//获取小数点处的索引
      var dou = sizeStr.substr(index + 1, 2);//获取小数点后两位的值
      if (dou == "00") {//判断后两位是否为00,如果是则删除00
        return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2);
      }
      return size;
    },
    view(record) {
      this.$refs.pdfview.showPdf(record.upload.src);
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { deleteAction } from '@/api/manage'
  import Tooltip from 'ant-design-vue/es/tooltip'
  export default {
    name: 'PredictiveParameters',
    components: {
      Tooltip,
    },
    mixins: [JeecgListMixin],
    props: {
      planId: {
        type: String,
        default:'',
        required: false
      },
      equipmentId: {
        type: String,
        required: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    mounted() {
    },
    watch: {
      planId:{
        immediate:true,
          handler(val){
            if (this.planId) {
            this.queryParam.planId = val
            this.queryParam.delFlag = 0
            this.loadData(1)
          }
        }
      }
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '条件',
            dataIndex: 'conditionalRelationName',
            align: 'center',
            width:200
          },
          {
            title: '参数代码',
            dataIndex: 'parameterCode',
            align: 'center',
            width:200
          },
          {
            title: '参数名称',
            dataIndex: 'parameterName',
            align: 'center',
            width:200
          },
          {
            title: '参数单位',
            dataIndex: 'unitName',
            align: 'center',
            width:200
          },
          {
            title: '参数上限',
            dataIndex: 'upperLimitValue',
            align: 'center',
            width:200
          },
          {
            title: '参数下限',
            dataIndex: 'lowerLimitValue',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/predictiveworkplanparameter/pagePredictiveWorkPlanParameter',
          delete: '/eam/predictiveworkplanparameter/delete'
        }
      }
    },
    methods: {
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '参数控制'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.planId = this.planId
        this.$refs.modalForm.equipmentId = this.equipmentId
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
          this.$message.error('请设置url.delete属性!')
          return
        }
        var that = this
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message)
            that.loadData()
            that.alterFlag = new Date()
          } else {
            that.$message.warning(res.message)
          }
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveSpareParts.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,185 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction, deleteAction } from '@/api/manage'
  import Tooltip from 'ant-design-vue/es/tooltip'
  export default {
    name: 'PredictiveSpareParts',
    components: {
      Tooltip,
    },
    mixins: [JeecgListMixin],
    props: {
      planId: {
        type: String,
        required: false
      },
      isEdit: {
        type: Boolean,
        default: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    mounted() {
    },
    watch: {
      planId:{
        immediate:true,
          handler(val){
            if (this.planId) {
            this.queryParam.planId = val
            this.queryParam.delFlag = 0
            this.loadData(1)
          }
        }
      }
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '备件编号',
            dataIndex: 'sparePartNum',
            align: 'center',
            width:200
          },
          {
            title: '备件名称',
            dataIndex: 'sparePartName',
            align: 'center',
            width:200
          },
          {
            title: '备件规格',
            dataIndex: 'sparePartSpecification',
            align: 'center',
            width:200
          },
          {
            title: '备件型号',
            dataIndex: 'sparePartModel',
            align: 'center',
            width:200
          },
          {
            title: '单位',
            dataIndex: 'mainUnitName',
            align: 'center',
            width:200
          },
          {
            title: '配套数量',
            dataIndex: 'supportingQuantity',
            align: 'center',
            width:200
          },
          {
            title: '额定寿命/小时',
            dataIndex: 'ratedLife',
            align: 'center',
            width:200
          },
          {
            title: '寿命控制限',
            dataIndex: 'lifeWarning',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/predictiveworkplansparepart/pagePredictiveWorkPlanSparePart',
          delete: '/eam/predictiveworkplansparepart/delete'
        }
      }
    },
    methods: {
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '计划用料'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.planId = this.planId
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
          this.$message.error('请设置url.delete属性!')
          return
        }
        var that = this
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message)
            that.loadData()
            that.alterFlag = new Date()
          } else {
            that.$message.warning(res.message)
          }
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,173 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
      </a-table>
    </div>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { deleteAction } from '@/api/manage'
  import Tooltip from 'ant-design-vue/es/tooltip'
  export default {
    name: 'PredictiveWarn',
    components: {
      Tooltip,
    },
    mixins: [JeecgListMixin],
    props: {
      planId: {
        type: String,
        required: false
      },
      equipmentId: {
        type: String,
        required: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      isDel: {
        type: Boolean,
        default: false
      }
    },
    mounted() {
    },
    watch: {
      planId:{
        immediate:true,
          handler(val){
            if (this.planId) {
            this.queryParam.planId = val
            this.queryParam.delFlag = 0
            this.loadData(1)
          }
        }
      }
    },
    data() {
      return {
        disableMixinCreated: true,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '条件',
            dataIndex: 'conditionalRelationName',
            align: 'center',
            width:200
          },
          {
            title: '报警代码',
            dataIndex: 'warnCode',
            align: 'center',
            width:200
          },
          {
            title: '报警名称',
            dataIndex: 'warnName',
            align: 'center',
            width:200
          },
          {
            title: '报警周期',
            dataIndex: 'warnCycle',
            align: 'center',
            width:200
          },
          {
            title: '报警周期单位',
            dataIndex: 'cycleUnitName',
            align: 'center',
            width:200
          },
          {
            title: '报警次数',
            dataIndex: 'times',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/predictiveworkplanwarn/pagePredictiveWorkPlanWarn',
          delete: '/eam/predictiveworkplanwarn/delete'
        }
      }
    },
    methods: {
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '报警控制'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.planId = this.planId
        this.$refs.modalForm.equipmentId = this.equipmentId
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
          this.$message.error('请设置url.delete属性!')
          return
        }
        var that = this
        deleteAction(that.url.delete, { id: id }).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message)
            that.loadData()
            that.alterFlag = new Date()
          } else {
            that.$message.warning(res.message)
          }
        })
      },
      clearList() {
        this.dataSource = []
        this.selectedRowKeys = []
        this.ipagination.current = 1
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/eam/modules/predictiveWorkOrder/select/ActualHourUserSelect.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,315 @@
<template>
  <a-modal
    :title="title"
    :width="1250"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <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.num"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="人员编号">
                  <a-input
                    placeholder="请输入人员编号检索"
                    v-model="queryParam.username"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="人员名称">
                  <a-input
                    placeholder="请输入人员名称检索"
                    v-model="queryParam.realname"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-button
                  type="primary"
                  @click="searchQuery"
                  icon="search"
                >查询</a-button>
                <a-button
                  @click="searchReset"
                  icon="reload"
                  style="margin-left:8px;"
                >重置</a-button>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
              </a-col>
            </a-row>
          </a-form>
        </div>
        <div style="margin-top:8px;">
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            @change="handleTableChange"
            :customRow="clickThenCheck"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
          >
          </a-table>
        </div>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import { postAction, getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import Tooltip from 'ant-design-vue/es/tooltip'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'//引入过长裁剪
import store from '@/store'
export default {
  name: "EquipmentList",
  mixins: [JeecgListMixin],
  components: {
    JDate,
    Tooltip,
    JEllipsis,
  },
  data() {
    return {
      title: "人员信息",
      visible: false,
      model: {},
      dataSource: [],
      disableSubmit: false,
      type: "radio",
      params: "-1",
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '班组编码',
          align: 'center',
          dataIndex: 'teamName',
        },
        {
          title: '人员编号',
          align: 'center',
          dataIndex: 'username',
        },
        {
          title: '人员名称',
          align: 'center',
          dataIndex: 'realname',
        },
      ],
      url: {
        list: "/eam/inspectionOrder/findUserList",
      },
    }
  },
  methods: {
    searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = { teamId: this.params };
      this.loadData(1)
    },
    list(params) {
      this.selectedRowKeys = [];
      this.selectedRowRecord = [];
      this.visible = true;
      if (params == null || params == "") {
        this.queryParam.teamId = "-1"
      } else {
        this.queryParam.teamId = params
      }
      this.loadData(1);
    },
    clickThenCheck(record) {
      return {
        on: {
          click: (e) => {
            this.selectedRowRecord = record;
            this.onSelectChange(record.id.split(","), [record]);
          }
        }
      };
    },
    onSelectChange(selectedRowKeys, selectedRows) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRowRecord = selectedRows[0];
    },
    close() {
      this.queryParam = {};
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      if (that.selectedRowKeys.length > 0) {
        if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
          that.$emit('sendUserRecord', { record: that.selectedRowRecord });
          that.close();
        } else {
          that.$message.error("请选择人员!")
        }
      } else {
        that.$message.error("请选择人员!")
      }
    },
    handleCancel() {
      this.close();
    },
  },
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
.fontweight {
  font-weight: bold;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.anty-row-operator button {
  margin: 0 5px;
}
.ant-btn-danger {
  background-color: #ffffff;
}
.ant-modal-cust-warp {
  height: 100%;
}
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
/deep/ .notshow {
  display: none;
}
.frozenRowClass {
  color: #c9c9c9;
}
.hight {
  color: #f5222d;
}
.middle {
  color: #fa8c16;
}
.low {
  color: #52c41a;
}
.dataUnKnow {
  color: #1890ff;
}
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
</style>
src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,230 @@
<template>
  <a-modal
    :title="title"
    :width="1000"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <!-- æŸ¥è¯¢åŒºåŸŸ -->
        <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="物料编码">
                  <j-input
                    placeholder="请输入物料编码"
                    v-model="queryParam.num"
                  ></j-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="物料名称">
                  <j-input
                    placeholder="请输入物料名称"
                    v-model="queryParam.name"
                  ></j-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-button
                  type="primary"
                  @click="searchQuery"
                  icon="search"
                >查询</a-button>
                <a-button
                  @click="searchReset"
                  icon="reload"
                  style="margin-left:8px;"
                >重置</a-button>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
              </a-col>
            </a-row>
          </a-form>
        </div>
        <div style="margin-top:8px;">
          <a-table
            ref="table"
            bordered
            size="middle"
            rowKey="id"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
            @change="handleTableChange"
            :customRow="clickThenCheck"
          >
          </a-table>
        </div>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { httpAction, getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JInput from '@/components/jeecg/JInput'
export default {
  name: "MaterialSelectTable",
  mixins: [JeecgListMixin],
  components: {
    JInput
  },
  data() {
    return {
      title: "操作",
      visible: false,
      model: {},
      confirmLoading: false,
      form: this.$form.createForm(this),
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '物料编号',
          align: 'center',
          dataIndex: 'num',
          sorter: true,
        },
        {
          title: '物料名称',
          align: 'center',
          dataIndex: 'name',
          sorter: true,
        },
        {
          title: '物料规格',
          align: 'center',
          dataIndex: 'specification',
          sorter: true,
        },
        {
          title: '物料型号',
          align: 'center',
          dataIndex: 'model',
          sorter: true,
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'unitId_dictText',
          sorter: true,
        },
      ],
      url: {
        list: "/base/material/list",
      },
      index: '',
    }
  },
  methods: {
    searchQuery() {
      this.loadData(1);
    },
    list(index) {
      this.visible = true;
      this.index = index;
      this.loadData(1);
    },
    clickThenCheck(record) {
      return {
        on: {
          click: (e) => {
            this.selectedRowRecord = record;
            this.onSelectChange(record.id.split(","), [record]);
          }
        }
      };
    },
    onSelectChange(selectedRowKeys, selectedRows) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRowRecord = selectedRows[0];
    },
    close() {
      this.queryParam = {};
      this.$emit('close');
      this.visible = false;
      this.selectedRowKeys = [];
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      if (that.selectedRowKeys.length > 0) {
        if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
          that.$emit('sendMaterialRecord', { index: this.index, record: that.selectedRowRecord });
          that.close();
        } else {
          that.$message.error("请选择物料!")
        }
      } else {
        that.$message.error("请选择物料!")
      }
    },
    handleCancel() {
      this.close();
    },
  }
}
</script>
<style>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.fontweightfrozen {
  font-weight: bold;
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
</style>