“linengliang”
2023-09-14 c887bb7836b82573c0bc7d11b8dd46b4d7e522e1
预测性维护工单
已添加1个文件
已修改8个文件
1585 ■■■■■ 文件已修改
src/views/eam/PredictiveWorkOrderList.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/PredictiveWorkPlanList.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue 277 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue 329 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue 319 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/PredictiveWorkOrderDrawer.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue 404 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/PredictiveWorkOrderList.vue
@@ -14,6 +14,20 @@
            :md="6"
            :sm="8"
          >
            <a-form-item label="工单状态">
              <j-dict-select-tag
                allow-clear
                placeholder="请选择工单状态"
                :triggerChange="true"
                dictCode="repair_order_status"
                v-model="queryParam.status"
              />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="维护工单编码">
              <a-input
                placeholder="请输入维护工单编码"
@@ -21,17 +35,28 @@
              ></a-input>
            </a-form-item>
          </a-col>
          <!-- <a-col
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="点检方法名称">
              <j-input
                placeholder="请输入点检方法名称"
                v-model="queryParam.name"
              ></j-input>
            <a-form-item label="设备编码">
              <a-input
                placeholder="请输入设备编码"
                v-model="queryParam.equipmentNum"
              ></a-input>
            </a-form-item>
          </a-col> -->
          </a-col>
          <a-col
            :md="6"
            :sm="8"
            >
              <a-form-item label="设备名称">
                <a-input
                  placeholder="请输入设备名称"
                  v-model="queryParam.equipmentName"
                ></a-input>
              </a-form-item>
            </a-col>
          <a-col
            :md="6"
            :sm="8"
@@ -60,7 +85,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button
      <!-- <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
@@ -70,7 +95,7 @@
        type="primary"
        @click="batchAssign"
        style="margin-left: 8px"
      >工单派工</a-button>
      >工单派工</a-button> -->
    </div>
    <!-- table区域-begin -->
@@ -227,6 +252,12 @@
      ref="PredictiveWorkOrderDrawer"
      @ok="modalFormOk"
    ></predictive-work-order-drawer>
    <order-assign-modal
    ref="OrderAssign"
    @ok="modalFormOk"
    >
    </order-assign-modal>
  </a-card>
</template>
@@ -238,14 +269,14 @@
import { getAction, postAction, requestPut } from '@/api/manage'
import PredictiveWorkOrderModel from './modules/predictiveWorkOrder/PredictiveWorkOrderModel'
import PredictiveWorkOrderDrawer from './modules/predictiveWorkOrder/PredictiveWorkOrderDrawer'
import OrderAssignModal from './modules/predictiveWorkOrder/OrderAssignModal.vue'
export default {
  name: 'PredictiveWorkOrderList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    PredictiveWorkOrderModel,
    PredictiveWorkOrderDrawer
    PredictiveWorkOrderDrawer,
    OrderAssignModal
  },
  data() {
    return {
@@ -376,8 +407,8 @@
        deleteBatch: "/eam/specialtyMaintenanceOrder/deleteBatch",
        exportXlsUrl: "/eam/specialtyMaintenanceOrder/exportXls",
        importExcelUrl: "eam/specialtyMaintenanceOrder/importExcel",
        edit: "/eam/specialtyMaintenanceOrder/editStatus",
        orderGet: "/eam/specialtyMaintenanceOrder/orderGet",
        edit: "/eam/predictiveworkorder/editStatus",
        orderGet: "/eam/predictiveworkorder/orderGet",
      },
    }
  },
@@ -491,9 +522,9 @@
      })
    },
    handleAssignOrder: function (record) {
      this.$refs.SpecialtyMaintenanceOrderAssignModal.edit(record)
      this.$refs.SpecialtyMaintenanceOrderAssignModal.title = '工单改派'
      this.$refs.SpecialtyMaintenanceOrderAssignModal.disableSubmit = false
      this.$refs.OrderAssign.edit(record)
      this.$refs.OrderAssign.title = '工单改派'
      this.$refs.OrderAssign.disableSubmit = false
    },
    // modalFormOk() {
    //   alert(0)
src/views/eam/PredictiveWorkPlanList.vue
@@ -393,7 +393,8 @@
        this.selectionRows = []
        this.planId = ''
        this.equipmentId = ''
        this.isAdd = false
        this.isAdd = falses
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
@@ -452,7 +453,7 @@
        const that = this
        that.confirmLoading = true
        this.$confirm({
          title: '日常保养标准版本生效!',
          title: '版本生效!',
          content: '提示:版本生效后上一版本将自动失效,请谨慎操作!',
          okText: '确认',
          cancelText: '取消',
@@ -474,10 +475,6 @@
          }
        })
      },
      searchReset() {
        this.loadData(1)
      }
    }
  }
</script>
src/views/eam/modules/predictiveWorkOrder/ActualMaterialEditTable.vue
@@ -29,20 +29,50 @@
          />
          <a-input-number
            :value="text"
            v-if="col.dataIndex == 'actualQuantity'"
            v-if="col.dataIndex == 'quantity'"
            :min="1"
            :max="99999"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.disabled"
            :disabled="record.isLock == 'yes'||orderStatus!='4'"
          />
        </div>
      </template>
      <span
        slot='action'
        slot-scope='text, record,index'
        slot-scope='text, record'
      >
        <a @click="handleDeleteFake(index)">删除</a>
        <a-popconfirm
          title="确认锁料吗?"
          @confirm="() => handleLock(record)"
        >
          <a
            v-has="'specialtyMaintenanceOrder:actualMaterialLock'"
            v-if="record.isLock=='no'&&orderStatus=='4'"
          >锁料</a>
        </a-popconfirm>
        <a-divider
          v-if="record.isLock=='no'"
          type="vertical"
        />
        <a-popconfirm
          title="解锁后会自动释放库存,确认解锁吗?"
          @confirm="() => handleUnLock(record)"
        >
          <a
            v-has="'specialtyMaintenanceOrder:actualMaterialLock'"
            v-if="record.isLock=='yes'&&orderStatus=='4'"
          >解锁</a>
        </a-popconfirm>
        <a-popconfirm
          title="确定删除吗?"
          @confirm="() => handleDelete(record.id)"
        >
          <a
            v-has="'specialtyMaintenanceOrder:actualMaterialDelete'"
            v-if="record.isLock=='no'&&orderStatus=='4'"
          >删除</a>
        </a-popconfirm>
      </span>
    </a-table>
    <a-button
@@ -50,37 +80,35 @@
      type="dashed"
      icon="plus"
      @click="addMaterial"
      :disabled="repairOrderStatus!='3'"
    >添加实际用料
    </a-button>
     :disabled="orderStatus!='4'"
      v-has="'specialtyMaintenanceOrder:actualMaterialAdd'"
    >添加实际用料</a-button>
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :style="{textAlign:'right'}">
        <a-button
        <!-- <a-button
          :style="{marginRight: '8px'}"
          @click="handleCancel"
          :disabled="repairOrderStatus!='3'"
        >
          æ¸…空
        </a-button>
        <a-button
          å–消
        </a-button> -->
        <!-- <a-button
          @click="handleOk(1)"
          type="primary"
          :style="{marginRight: '8px'}"
          :disabled="repairOrderStatus!='3'"
         :disabled="orderStatus!='4'"
        >暂存</a-button>
        <a-button
          @click="handleOk(0)"
          type="primary"
          :disabled="repairOrderStatus!='3'"
        >保存</a-button>
         :disabled="orderStatus!='4'"
        >保存</a-button> -->
      </a-row>
      <!-- :disabled="false" -->
    </div>
    <actual-material-select
      ref="actualMaterialSelect"
      @sendMaterialRecord="sendMaterialRecord"
    >
    <actual-material-select
    @getSelectRows="getSelectRows"
    ref='JSelectSparePartModal'>
      <!-- @sendMaterialRecord="sendMaterialRecord" -->
    </actual-material-select>
  </a-card>
</template>
@@ -95,29 +123,34 @@
  mixins: [JeecgListMixin],
  components: {
    JEllipsis,
    ActualMaterialSelect
    ActualMaterialSelect,
  },
  props: {
    repairOrderId: {
      type: String,
      required: false,
      default: '-1'
    },
    repairOrderStatus: {
    orderId: {
      type: String,
      required: false,
      default: ''
    }
    },
    orderStatus: {
      type: String,
      required: false,
      default: ''
    },
    equipmentId: {
      type: String,
      required: false,
      default: ''
    },
  },
  data() {
    return {
      title: "工艺确认",
      flag: false,//主页面的标记位  ç”¨äºŽåŒºåˆ†æ˜¯å¦ç¡®è®¤è¿‡å·¥å•工艺 æ¥åŒºåˆ†table页展示 å·¥å•工序 è¿˜æ˜¯äº§å“å·¥åº
      disableMixiCreated:true,
      title: "实际用料",
      visible: false,
      model: {},
      obj: {},
      maskClosable: true,
      confirmLoading: false,
      // specialyMaintenanceOrderStatus: '',
      form: this.$form.createForm(this),
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
@@ -137,7 +170,7 @@
            { required: true, message: '请选择物料!' },
          ]
        },
        actualQuantity: {
        quantity: {
          rules: [
            { required: false, message: '请填写数量!' },
          ]
@@ -158,8 +191,8 @@
      loading: false,
      dataSource: [],
      columns: [
       {
          title: '领料出库单号',
        {
          title: '领料出库单',
          dataIndex: 'num',
          align: "center",
          width: 150,
@@ -224,23 +257,44 @@
        }
      ],
      url: {
        list: "/eam/repairOrder/listRepairOrderActualMaterialByMainId",
        confirmMaterial: "/eam/repairOrder/addRepairOrderActualMaterial"
        list: "/eam/maintenanceOrderActualMaterial/getMaintenanceOrderActualMaterialList",
        confirmMaterial: "/eam/maintenanceOrderActualMaterial/add",
        delete: "/eam/maintenanceOrderActualMaterial/delete",
        addInit: "/eam/maintenanceOrderActualMaterial/addInit",
        lock: "/eam/maintenanceOrderActualMaterial/lock",
        unLock: "/eam/maintenanceOrderActualMaterial/unLock"
      },
      changeIndex: 0
    }
  },
  created() {
    this.queryParam['repairOrderId'] = this.repairOrderId;
    this.loadData(1);
  watch: {
    orderId: {
      immediate: true,
      handler(val) {
        if(this.orderId){
          alert
          this.queryParam['maintenanceOrderId'] = val
          this.queryParam['equipmentId'] = this.equipmentId
          this.queryParam['delFlag'] = 0
          this.loadData(1);
        }else{
          this.clearList();
        }
      }
    },
  },
  methods: {
    addMaterial() {
      this.dataSource.push({ materialId: '', repairOrderId: this.repairOrderId, actualQuantity: 1, materialNum: '', materialName: '', materialModel: '', materialSpecification: '', unitId_dictText: '' })
      let ids = [];
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].outboundOrderDetailId);
      }
      this.$refs.JSelectSparePartModal.showModals(ids);
      this.$refs.JSelectSparePartModal.title = '选择备件信息'
      this.$refs.JSelectSparePartModal.disableSubmit = false
    },
    handleCancel() {
      this.close()
      this.$bus.$emit('closeDrawer');
    },
    close() {
      this.$emit('close');
@@ -261,18 +315,23 @@
            that.$message.warning("请选择第" + (i + 1) + "行物料!");
            return false;
          }
          if (materialDataSource[i].actualQuantity == undefined || materialDataSource[i].actualQuantity == null || materialDataSource[i].actualQuantity == '') {
          if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
            that.$message.warning("请填写第" + (i + 1) + "行用料数!");
            return false;
          }
        }
      }
      if (that.dataSource.length === 0) {
        that.$message.warning("请添加物料!")
        return
      }
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.repairOrderId = that.repairOrderId;
          formData.actualMaterialList = that.dataSource;
          formData.maintenanceOrderId = that.specialyMaintenanceOrderId;
          formData.maintenanceOrderActualMaterials = that.dataSource;
          formData.equipmentId = that.equipmentId;
          let obj = obj = postAction(this.url.confirmMaterial, formData)
          obj.then((res) => {
            if (res.success) {
@@ -290,18 +349,17 @@
      })
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp[index];
      console.log(column)
      const temp = [...this.dataSource]
      const target = temp[index]
      let availableQuantity = target['availableQuantity']
      if (target) {
        target[column.dataIndex] = value;
        if ('materialId' == column.dataIndex) {
          target['materialId'] = value;
        if (value != undefined && value != null && value != '' && availableQuantity < value) {
          this.$message.error('使用数量不能大于可用数量!')
        } else {
        }
        if ('actualQuantity' == column.dataIndex) {
          target['actualQuantity'] = value;
        }
        that.dataSource = temp;
        target[column.dataIndex] = value
        this.dataSource = temp
      }
    },
    onSearchMaterial(index) {
@@ -309,37 +367,94 @@
      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
    },
    // getUuiD(randomLength) {
    //   return Number(
    //     Math.random()
    //       .toString()
    //       .substr(2, randomLength) + Date.now()
    //   ).toString(36)
    // },
    handleLock(record) {
      let that = this;
      if (record.quantity == null || record.quantity == undefined || record.quantity == '') {
        this.$message.error('请先填写数量!');
        return false
      }
      if (record.availableQuantity < record.quantity) {
        this.$message.error('使用数量不能大于可用数量!');
        return false;
      }
      this.confirmLoading = true;
      postAction(this.url.lock, record).then(res => {
        if (res.success) {
          this.$message.success("库存锁定成功!")
        } else {
          this.$message.error(res.message)
        }
      }).finally(res => {
        that.confirmLoading = false
        that.loadData();
      })
    },
    handleUnLock(record) {
      let that = this;
      this.confirmLoading = true;
      postAction(this.url.unLock, record).then(res => {
        if (res.success) {
          this.$message.success("库存解锁成功!")
        } else {
          this.$message.error(res.message)
        }
      }).finally(res => {
        that.confirmLoading = false
        that.loadData();
      })
    },
    getSelectRows(data){
      let newActualMaterials = [];
      for (let i = 0; i < data.length; i++) {
        newActualMaterials.push({
          // id: this.getUuiD(16),
          // num: data[i].num,
          outboundOrderDetailId: data[i].id,
          sparePartId: data[i].sparePartId,
          // sparePartNum: data[i].spareNum,
          // sparePartName: data[i].spareName,
          // specification: data[i].specification,
          // model: data[i].model,
          // constructorName: data[i].constructorName,
          // constructorId: data[i].constructorId,
          // mainUnitName: data[i].mainUnitName,
          // mainUnitId: data[i].mainUnitId,
          mainQuantity: data[i].mainQuantity,
          useQuantity: data[i].useQuantity,
          availableQuantity: data[i].availableQuantity,
          maintenanceOrderId: this.orderId,
          equipmentId: this.equipmentId,
          isLock: 'no'
        })
      }
      let that = this
      postAction(this.url.addInit, newActualMaterials).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          that.$emit('ok')
        } else {
          that.$message.warning(res.message)
        }
      }).finally(res => {
        newActualMaterials = []
        that.loadData();
      })
    }
  },
  watch: {
    repairOrderId: {
      immediate: true,
      handler(val) {
        this.clearList();
        this.queryParam['repairOrderId'] = val
        this.loadData(1);
      }
    }
  }
}
</script>
src/views/eam/modules/predictiveWorkOrder/ActualWorkHoursEditTable.vue
@@ -1,80 +1,92 @@
<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
  <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"
            :disabled="orderStatus!='4'"
            @change="(e) => handleChange(e, record.key, col, index)"
          />
          <a-input-number
            :value="text"
            v-if="col.dataIndex == 'actualWorkingHourQuota'"
            :min="0"
            :max="99999"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.disabled||orderStatus!='4'"
          />
        </div>
      </template>
      <span
        slot='action'
        slot-scope='text, record,index'
      >
        <a
          v-has="'specialtyMaintenanceOrder:actualWorkHoursDelete'"
          v-if="orderStatus=='4'"
          @click="handleDelete(index)"
        >删除</a>
      </span>
    </a-table>
    <a-button
      style="width: 100%; margin-top: 16px; margin-bottom: 8px"
      type="dashed"
      icon="plus"
      @click="addHour"
      :disabled="orderStatus!='4'"
    >添加实际工时
    </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"
        >
          å–消
        </a-button>
        <a-button
          @click="handleOk(1)"
          type="primary"
          :style="{marginRight: '8px'}"
          :disabled="orderStatus!='4'"
          v-has="'specialtyMaintenanceOrder:actualWorkHoursTS'"
        >暂存</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>
          :disabled="orderStatus!='4'"
          v-has="'specialtyMaintenanceOrder:actualWorkHoursSave'"
        >保存</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'
@@ -83,27 +95,37 @@
import JEllipsis from '@/components/jeecg/JEllipsis'
import ActualHourUserSelect from './select/ActualHourUserSelect.vue'
export default {
 name: 'ActualWorkHoursEditTable',
 mixins: [JeecgListMixin],
  name: 'ActualWorkHoursEditTable',
  mixins: [JeecgListMixin],
  components: {
    JEllipsis,
    ActualHourUserSelect
  },
  props:{
    repairOrderId:{
      type:String,
      required:false,
      default:''
  props: {
    orderId: {
      type: String,
      required: false,
      default: ''
    },
    repairOrderStatus:{
      type:String,
      required:false,
      default:''
    }
    orderStatus: {
      type: String,
      required: false,
      default: ''
    },
    equipmentId: {
      type: String,
      required: false,
      default: ''
    },
    teamId: {
      type: String,
      required: false,
      default: ''
    },
  },
  data() {
    return {
      title: "工艺确认",
      title: "实际工时",
      flag: false,//主页面的标记位  ç”¨äºŽåŒºåˆ†æ˜¯å¦ç¡®è®¤è¿‡å·¥å•工艺 æ¥åŒºåˆ†table页展示 å·¥å•工序 è¿˜æ˜¯äº§å“å·¥åº
      visible: false,
      model: {},
@@ -131,7 +153,7 @@
        },
        actual_hour: {
          rules: [
            { required: false, message: '请填写工时!'},
            { required: false, message: '请填写工时!' },
          ]
        },
      },
@@ -150,53 +172,65 @@
      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: 'username',
          align: "center",
          scopedSlots: { customRender: 'username' },
          className: 'red',
          width: 250,
        },
        {
          title: '人员名称',
          dataIndex: 'realname',
          align: "center",
          width: 250,
        },
        {
          title: '*实际工时',
          dataIndex: 'actualWorkingHourQuota',
          align: "center",
          className: 'red',
          scopedSlots: { customRender: 'actualWorkingHourQuota' },
          width: 250,
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          scopedSlots: { customRender: 'action' }
          }
        ],
        }
      ],
      url: {
        list: "/eam/repairOrder/listRepairOrderActualWorkHoursByMainId",
        confirmHour:"/eam/repairOrder/addRepairOrderActualWorkHours"
        list: "/eam/maintenanceOrderActualWorkingHour/getMaintenanceOrderActualWorkingHourList",
        confirmHour: "/eam/maintenanceOrderActualWorkingHour/add"
      },
      changeIndex: 0
    }
  },
  created(){
    this.queryParam['repairOrderId'] = this.repairOrderId;
  created() {
    this.queryParam['maintenanceOrderId'] = this.orderId;
    this.queryParam['equipmentId'] = this.equipmentId
    this.loadData(1);
  },
  watch: {
    orderId: {
      immediate: true,
      handler(val) {
        this.clearList();
        this.queryParam['maintenanceOrderId'] = val
        this.queryParam['equipmentId'] = this.equipmentId
        this.loadData(1);
      }
    },
  },
  methods: {
    addHour() {
      this.dataSource.push({userId:'',repairOrderId:this.repairOrderId,actualHour:0,username:'',realname:''})
      this.dataSource.push({ id: this.getUuiD(16), userId: '', maintenanceOrderId: this.dailyMaintenanceOrderId, actualWorkingHourQuota: 0, username: '', realname: '' })
    },
    handleCancel() {
      this.close()
      this.$bus.$emit('closeDrawer');
    },
    close() {
      this.$emit('close');
@@ -204,30 +238,39 @@
      this.disableSubmit = false;
      this.visible = false;
    },
    handleDeleteFake(index){
      this.dataSource.pop(index);
    // handleDeleteFake(index) {
    //   this.dataSource.splice(index,1);
    // },
    handleDelete(text, record, index) {
      this.dataSource.splice(index, 1);
    },
    handleOk(saveStatus) {
      const that = this
      if(saveStatus==0){
      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)+"行维修人员!");
            that.$message.warning("请选择第" + (i + 1) + "行维修人员!");
            return false;
          }
          if(workHoursDataSource[i].actualHour == undefined || workHoursDataSource[i].actualHour == null||workHoursDataSource[i].actualHour==''){
            that.$message.warning("请填写第"+(i+1)+"行实际工时!");
          if (workHoursDataSource[i].actualWorkingHourQuota == undefined || workHoursDataSource[i].actualWorkingHourQuota == null || workHoursDataSource[i].actualWorkingHourQuota == '') {
            that.$message.warning("请填写第" + (i + 1) + "行实际工时!");
            return false;
          }
        }
      }
      if (that.dataSource.length === 0) {
        that.$message.warning("请选择人员!")
        return
      }
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.repairOrderId = that.repairOrderId;
          formData.actualHourList = that.dataSource;
          formData.maintenanceOrderId = that.orderId;
          formData.maintenanceOrderActualWorkingHourList = that.dataSource;
          formData.equipmentId = that.equipmentId;
          let obj = obj = postAction(this.url.confirmHour, formData)
          obj.then((res) => {
            if (res.success) {
@@ -253,15 +296,15 @@
        if ('userId' == column.dataIndex) {
          target['userId'] = value;
        }
        if ('actualHour' == column.dataIndex) {
          target['actualHour'] = value;
        if ('actualWorkingHourQuota' == column.dataIndex) {
          target['actualWorkingHourQuota'] = value;
        }
        that.dataSource = temp;
      }
    },
    onSearchUser(index) {
      this.recordIndex = index
      this.$refs.actualUserSelect.list()
      this.$refs.actualUserSelect.list(this.teamId)
      this.$refs.actualUserSelect.title = '人员选择'
    },
    sendUserRecord(data, val) {
@@ -276,21 +319,19 @@
        this.dataSource = temp
      }
    },
    clearList(){
        this.dataSource=[];
        this.ipagination.current = 1
    }
    clearList() {
      this.dataSource = [];
      this.ipagination.current = 1
    },
    getUuiD(randomLength) {
      return Number(
        Math.random()
          .toString()
          .substr(2, randomLength) + Date.now()
      ).toString(36)
    },
  },
  watch:{
    repairOrderId:{
      immediate: true,
        handler(val) {
            this.clearList();
            this.queryParam['repairOrderId'] = val
            this.loadData(1);
        }
    }
  }
}
</script>
src/views/eam/modules/predictiveWorkOrder/OrderAssignModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,319 @@
<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
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请选择预测性维护方案'"
                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 :span="12">
            <a-form-item
              label="责任人"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input-search
                :disabled="false"
                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"
      >确定</a-button>
    </template>
    <user-list
      ref="UserList"
      @sendDutyUserRecord='sendDutyUserRecord'
    ></user-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 UserList from '../specialtyMaintenanceOrder/UserList.vue'
export default {
  name: "SpecialtyInspectionOrderModal",
  components: {
    JMultiSelectTag,
    Tooltip,
    UserList,
  },
  data() {
    return {
      title: "操作",
      visible: false,
      disableSubmit: false,
      codeDisable: true,
      model: {},
      inspectionCycles: [],
      // isHidden: true,
      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: '请输入编码!' },
          ]
        },
        planStartTime: {
          rules: [
            { required: true, message: '请选择日期!' },
          ]
        },
        maintenanceUserId_dictText: {
          rules: [
            { required: true, message: '请选择责任人!' },
          ]
        },
        assignMode: {
          rules: [
            { required: true, message: '请选择派工方式!' },
          ]
        },
        teamId_dictText: {
          rules: [
            { required: true, message: '请选择责任班组!' },
          ]
        },
      },
      url: {
        assign: "/eam/predictiveworkorder/assign",
      },
    }
  },
  methods: {
    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', 'teamId', 'teamId_dictText', 'maintenanceUserId', 'maintenanceUserId_dictText', 'planStartTime'));
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleCancel() {
      this.close();
    },
    handleOk() {
      const that = this;
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          obj = requestPut(this.url.assign, 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();
          })
        }
      })
    },
    onDutyUserList() {
      let data = this.form.getFieldsValue(['teamId']);
      if (data.teamId == null || data.teamId == "") {
        this.$message.warning("请先维护班组!");
        return
      }
      this.$refs.UserList.list(data.teamId);
      this.$refs.UserList.title = "选择人员";
    },
    sendDutyUserRecord(data) {
      let record = data.record;
      this.form.setFieldsValue({ maintenanceUserId: record.id, maintenanceUserId_dictText: record.username + "/" + record.realname });
    },
  },
}
</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/PredictiveWorkOrderDrawer.vue
@@ -44,7 +44,7 @@
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.statusName }}</span>
                  >{{ this.model.status_dictText }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -55,7 +55,7 @@
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="保养工单号"
                  label="工单统一编码"
                  class="hightColor"
                >
                  <span
@@ -72,13 +72,13 @@
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="保养类型"
                  label="监控类型"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.maintenanceTypeName }}</span>
                  >{{ this.model.monitorType_dictText }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -91,30 +91,13 @@
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="对象部门"
                  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>
                  >{{ this.model.planNum }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -131,7 +114,7 @@
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.teamName }}</span>
                  >{{ this.model.teamId_dictText }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -186,7 +169,7 @@
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.equipmentModel }}</span>
                  >{{ this.model.model }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -200,7 +183,7 @@
            defaultActiveKey="1"
          >
            <a-tab-pane
              tab='触发条件'
              tab='监控记录'
              key="1"
              class="hightColor"
            >
@@ -208,11 +191,9 @@
            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'"/>
                <predictive-parameters  :orderId='model.id' v-show="model.monitorType == 'cskz'"/>
                <!--            v-if="selectionRows[0].monitorType == 'cskz'" -->
                <predictive-warn :planId='workPlanId' v-show="model.monitorType == 'bjkz'"/>
                <predictive-warn :orderId='model.id' v-show="model.monitorType == 'bjkz'"/>
                <!--            v-if="selectionRows[0].monitorType == 'bjkz'"-->
            </div>
            </a-tab-pane>
@@ -267,9 +248,9 @@
              >
                <actual-material-edit-table
                  ref="actualMaterialTabel"
                  :specialyMaintenanceOrderId="this.model.id"
                  :specialyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                  :orderId="orderId"
                  :orderStatus="orderStatus"
                  :equipmentId="equipmentId"
                ></actual-material-edit-table>
              </div>
            </a-tab-pane>
@@ -282,10 +263,10 @@
                style="margin:-16px"
              >
                <actual-work-hours-edit-table
                  :specialyMaintenanceOrderId="this.model.id"
                  :specialyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                  :teamId="this.model.teamId"
                  :orderId="orderId"
                  :orderStatus="orderStatus"
                  :equipmentId="equipmentId"
                  :teamId = "teamId"
                ></actual-work-hours-edit-table>
              </div>
            </a-tab-pane>
@@ -365,7 +346,13 @@
      currentPage: 1,
      pageSize: 1,
      total: 10,
      //
      workPlanId:'',
      orderId:'',
      orderStatus:'',
      equipmentId:'',
      teamId:'',
      //
      title: "专业工单执行",
      visible: false,
      maskClosable: true,
@@ -387,12 +374,14 @@
        sm: { span: 18 },
      },
      url: {
        getEquipmentTotalByOrderId: "/eam/specialtyMaintenanceOrderDetail/getEquipmentTotalByOrderId",
        listMaterial: "/eam/maintenanceOrderActualMaterial/getMaintenanceOrderActualMaterialList",
        listHours: "/eam/maintenanceOrderActualWorkingHour/getMaintenanceOrderActualWorkingHourList",
        getEquipmentTotalByOrderId: "/eam/predictiveworkorder/getEquipmentTotalByOrderId",
        urlDownload: window._CONFIG['staticDomainURL'],
        download: '/sys/upload/downloadFile',
        editStatus: "/eam/specialtyMaintenanceOrder/editStatus",
        revocation: "/eam/specialtyMaintenanceOrder/revocation",
        report: "/eam/specialtyMaintenanceOrder/report",
        editStatus: "/eam/predictiveworkorder/editStatus",
        revocation: "/eam/predictiveworkorder/revocation",
        report: "/eam/predictiveworkorder/report",
      },
    }
  },
@@ -414,7 +403,15 @@
    handleShow(record) {
      this.model = Object.assign({}, record);
      this.workPlanId = record.workPlanId;
      this.orderId = record.id;
      this.orderStatus = record.status;
      this.equipmentId = record.equipmentId;
      this.teamId  = record.teamId;
      this.visible = true;
      if(record.status=='4'){
        this.$message.success("工单正在执行当中,请在此过程中录入实际用料和工时")
      }
    },
    getEquipmentTotal() {
      var params = this.queryParam;//查询条件
@@ -512,16 +509,15 @@
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '保养工单开工',
        title: '工单开工',
        content: '提示:开工后无法撤回,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.editStatus, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
          requestPut(that.url.editStatus, { id: that.model.id, 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
@@ -537,26 +533,18 @@
    },
    //报工
    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: '提示:报工后点检完工,请谨慎操作!',
      that.$confirm({
        title: '工单报工',
        content: '提示:如有未填写的必填项或导致报工失败,确认报工吗!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.report, { id: that.specialtyMaintenanceOrderId, status: '5' }).then((res) => {
          requestPut(that.url.report, { id: that.orderId, 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
@@ -583,14 +571,15 @@
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.revocation, { id: that.specialtyMaintenanceOrderId, status: '4' }).then((res) => {
          requestPut(that.url.revocation, { id: that.orderId, status: '4' }).then((res) => {
            if (res.success) {
              that.model.status = '4'
              that.orderStatus = '4'
              that.$message.success(res.message)
              that.getEquipmentTotal()
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
              that.$emit('ok');
            } else {
              that.$message.warning(res.message)
            }
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveParameters.vue
@@ -59,17 +59,22 @@
      isDel: {
        type: Boolean,
        default: false
      },
      orderId:{
        type: String,
        default:'',
        required: false
      }
    },
    mounted() {
    },
    watch: {
      planId:{
      orderId:{
        immediate:true,
          handler(val){
            if (this.planId) {
            this.queryParam.planId = val
            if (this.orderId) {
            this.queryParam.workOrderId = val
            this.queryParam.delFlag = 0
            this.loadData(1)
          }
@@ -92,7 +97,7 @@
          },
          {
            title: '条件',
            dataIndex: 'conditionalRelationName',
            dataIndex: 'parameterCondition_dictText',
            align: 'center',
            width:200
          },
@@ -109,27 +114,39 @@
            width:200
          },
          {
            title: '参数单位',
            dataIndex: 'unitName',
            align: 'center',
            width:200
          },
          {
            title: '参数上限',
            title: '上限值',
            dataIndex: 'upperLimitValue',
            align: 'center',
            width:200
          },
          {
            title: '参数下限',
            title: '下限值',
            dataIndex: 'lowerLimitValue',
            align: 'center',
            width:200
          },
          {
            title: '实际值',
            dataIndex: 'actualValue',
            align: 'center',
            width:200
          },
          {
            title: '单位',
            dataIndex: 'parameterUnit',
            align: 'center',
            width:200
          },
          {
            title: '检测时间',
            dataIndex: 'collectTime',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/predictiveworkplanparameter/pagePredictiveWorkPlanParameter',
          delete: '/eam/predictiveworkplanparameter/delete'
          list: '/eam/predictiveworkplanparameter/getHistoryPage',
        }
      }
    },
src/views/eam/modules/predictiveWorkOrder/boms/PredictiveWarn.vue
@@ -58,17 +58,22 @@
      isDel: {
        type: Boolean,
        default: false
      },
      orderId:{
        type: String,
        default:'',
        required: false
      }
    },
    mounted() {
    },
    watch: {
      planId:{
      orderId:{
        immediate:true,
          handler(val){
            if (this.planId) {
            this.queryParam.planId = val
            if (this.orderId) {
            this.queryParam.workOrderId = val
            this.queryParam.delFlag = 0
            this.loadData(1)
          }
@@ -91,7 +96,7 @@
          },
          {
            title: '条件',
            dataIndex: 'conditionalRelationName',
            dataIndex: 'parameterCondition_dictText',
            align: 'center',
            width:200
          },
@@ -108,27 +113,14 @@
            width:200
          },
          {
            title: '报警周期',
            dataIndex: 'warnCycle',
            align: 'center',
            width:200
          },
          {
            title: '报警周期单位',
            dataIndex: 'cycleUnitName',
            align: 'center',
            width:200
          },
          {
            title: '报警次数',
            dataIndex: 'times',
            title: '检测时间',
            dataIndex: 'collectTime',
            align: 'center',
            width:200
          },
        ],
        url: {
          list: '/eam/predictiveworkplanwarn/pagePredictiveWorkPlanWarn',
          delete: '/eam/predictiveworkplanwarn/delete'
          list: '/eam/predictiveworkplanwarn/getHistoryPage',
        }
      }
    },
src/views/eam/modules/predictiveWorkOrder/select/ActualMaterialSelect.vue
@@ -1,230 +1,292 @@
<template>
  <!--支持全屏缩放-->
  <a-modal
    :title="title"
    :width="1000"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
    :visible='visible'
    :title='title'
    switchFullscreen
    @ok='handleSubmit'
    @cancel='close'
    style='top:50px'
    cancelText='关闭'
    :width='1250'
  >
    <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-card :bordered='false'>
      <div class='table-page-search-wrapper'>
        <a-form
          layout='inline'
          @keyup.enter.native='searchQuery'
        >
          <a-row :gutter='24'>
            <a-col
              :md='8'
              :sm='6'
            >
              <a-form-item label='单据号'>
                <a-input
                  placeholder='请输入单据号'
                  v-model='queryParam.num'
                />
              </a-form-item>
            </a-col>
            <a-col :md='3'>
              <span
                style='float: left;overflow: hidden;'
                class='table-page-search-submitButtons'
              >
                <a-button
                  type="primary"
                  @click="searchQuery"
                  icon="search"
                  type='primary'
                  @click='searchQuery'
                  icon='search'
                >查询</a-button>
                <a-button
                  @click="searchReset"
                  icon="reload"
                  style="margin-left:8px;"
                  @click='searchReset'
                  icon='reload'
                  style='margin-left: 10px'
                >重置</a-button>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <a-table
        ref='table'
        size='middle'
        rowKey='id'
        bordered
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :rowSelection='rowSelection'
        :loading='loading'
        @change='handleTableChange'
        :scroll="{ x: 'calc(980px)', y: 900 }"
      >
              </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-table>
    </a-card>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { httpAction, getAction } from '@/api/manage'
import { filterObj } from '@/utils/util'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JInput from '@/components/jeecg/JInput'
export default {
  name: "MaterialSelectTable",
  name: 'JSelectSparePartModal',
  mixins: [JeecgListMixin],
  components: {
    JInput
  },
  components: {},
  props: {},
  data() {
    return {
      title: "操作",
      visible: false,
      model: {},
      confirmLoading: false,
      form: this.$form.createForm(this),
      queryParam: {},
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function (t, r, index) {
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
          },
          width: 50
        },
        {
          title: '物料编号',
          title: '单据号',
          align: 'center',
          dataIndex: 'num',
          sorter: true,
          dataIndex: 'num'
        },
        {
          title: '物料名称',
          title: '备件编码',
          align: 'center',
          dataIndex: 'name',
          sorter: true,
          dataIndex: 'spareNum'
        },
        {
          title: '物料规格',
          title: '备件名称',
          align: 'center',
          dataIndex: 'specification',
          sorter: true,
          dataIndex: 'spareName'
        },
        {
          title: '物料型号',
          title: '制造商',
          align: 'center',
          dataIndex: 'model',
          sorter: true,
          dataIndex: 'constructorName'
        },
        {
          title: '单位',
          title: '规格',
          align: 'center',
          dataIndex: 'unitId_dictText',
          sorter: true,
          dataIndex: 'specification'
        },
        {
          title: '型号',
          align: 'center',
          dataIndex: 'model'
        },
        {
          title: '主单位',
          align: 'center',
          dataIndex: 'mainUnitName'
        },
        {
          title: '主数量',
          align: 'center',
          dataIndex: 'mainQuantity'
        },
        {
          title: '可用数量',
          align: 'center',
          dataIndex: 'availableQuantity'
        },
      ],
      url: {
        list: "/base/material/list",
      selectedRowKeys: [],
      oldSelectRows: [],
      dataSource: [],
      selectionRows: [],
      title: '根据查询结果选择人员信息',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '30', '50', '100'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      index: '',
      isorter: {
        column: 'num',
        order: 'desc'
      },
      visible: false,
      loading: false,
      url: {
        list: '/eam/repairOrder/materialSpareList'
        // list:'/spare/sparePartOutbound/list',
      }
    }
  },
  methods: {
    searchQuery() {
      this.loadData(1);
    },
    list(index) {
      this.visible = true;
      this.index = index;
      this.loadData(1);
    },
    clickThenCheck(record) {
  computed: {
    rowSelection() {
      return {
        on: {
          click: (e) => {
            this.selectedRowRecord = record;
            this.onSelectChange(record.id.split(","), [record]);
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
          }
        }
      };
    },
    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("请选择物料!")
        }),
        selectedRowKeys: this.selectedRowKeys
      }
    }
  },
  methods: {
    async loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      const that = this
      //this.loading = true
      this.queryParam.status = '1'
      let params = this.getQueryParams()
      //查询条件
      await getAction(this.url.list, params).then((res) => {
        if (res.success) {
          for (let i = 0; i < res.result.records.length; i++) {
            if (that.oldSelectRows.indexOf(res.result.records[i].id) > -1) {
              res.result.records[i].distable = true
            } else {
              res.result.records[i].distable = false
            }
          }
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        //this.loading = false
      })
    },
    handleCancel() {
      this.close();
    showModals(oldSelectRows) {
      this.selectionRows = []
      this.oldSelectRows = oldSelectRows
      this.visible = true
      this.loadData(1)
    },
    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter)
      param.field = this.getQueryField()
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      return filterObj(param)
    },
    //查询条件处理
    getQueryField() {
      let str = 'id,'
      for (let a = 0; a < this.columns.length; a++) {
        str += ',' + this.columns[a].dataIndex
      }
      return str
    },
    searchReset(num) {
      let that = this
      this.queryParam = []
      if (num !== 0) {
        that.loadData(1)
      }
      that.selectborrowIds = []
    },
    close() {
      this.selectedRowKeys = []
      this.selectionRows = []
      this.visible = false
    },
    handleTableChange(pagination, filters, sorter) {
      //TODO ç­›é€‰
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      this.loadData()
    },
    handleSubmit() {
      if(this.selectionRows.length==0){
        this.$message.warn("请选择备件");
         return false;
      }
      this.$emit('getSelectRows', this.selectionRows)
      this.close()
    },
    onSelectChange(selectionRows) {
      this.selectionRows = selectionRows
    },
    searchQuery() {
      this.loadData(1)
    },
  }
}
</script>
<style>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
<style scoped>
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.fontweight {
  font-weight: bold;
}
.fontweightfrozen {
  font-weight: bold;
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}
</style>