“linengliang”
2024-03-12 ddd7e6f6c57c2f39305e94a74650e28bbf31f9e7
src/views/eam/modules/repairorder/moudles/select/FaultReportRepair.vue
@@ -1,7 +1,7 @@
<template>
  <a-modal
    :title="title"
    :width="1250"
    :width="1600"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
@@ -22,10 +22,10 @@
                :sm="8"
              >
                <a-form-item label="单据号">
                  <j-input
                  <a-input
                    placeholder="请输入单据号检索"
                    v-model="queryParam.num"
                  ></j-input>
                  ></a-input>
                </a-form-item>
              </a-col>
@@ -34,10 +34,21 @@
                :sm="8"
              >
                <a-form-item label="设备名称">
                  <j-input
                  <a-input
                    placeholder="请输入设备名称检索"
                    v-model="queryParam.equipmentName"
                  ></j-input>
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
                :md="6"
                :sm="8"
              >
                <a-form-item label="统一编码">
                  <a-input
                    placeholder="请输入统一编码检索"
                    v-model="queryParam.equipmentNum"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col
@@ -72,12 +83,14 @@
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            :loading="confirmLoading"
            @change="handleTableChange"
            :customRow="clickThenCheck"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
          >
          <span slot="faultDescription" slot-scope="text">
            <j-ellipsis :value="text" :length="10" />
          </span>
          </a-table>
        </div>
      </a-form>
@@ -102,6 +115,7 @@
    JDate,
    Tooltip,
    JEllipsis,
    store
  },
  data() {
    return {
@@ -134,29 +148,59 @@
      confirmLoading: false,
      form: this.$form.createForm(this),
      columns: [
        {
      {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1
            return parseInt(index) + 1;
          }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName',
        },
        {
          title: '单据号',
          align: 'center',
          dataIndex: 'num',
          align: "center",
          dataIndex: 'num'
        },
        {
          title: '统一编码',
          align: "center",
          dataIndex: 'equipmentNum'
        },
        {
          title: '设备名称',
          align: 'center',
          align: "center",
          dataIndex: 'equipmentName',
        },
        {
          title: '设备型号',
          align: "center",
          dataIndex: 'equipmentModel',
        },
        {
          title: '规格',
          align: "center",
          dataIndex: 'equipmentSpecification',
        },
        {
          title: '使用部门',
          align: "center",
          dataIndex: 'departName',
        },
        {
          title: '故障描述',
          align: "center",
          dataIndex: 'faultDescription'
          dataIndex: 'faultDescription',
          scopedSlots: {
            customRender: 'faultDescription'
          }
        },
        {
          title: '故障时间',
@@ -164,17 +208,35 @@
          dataIndex: 'faultTime'
        },
        {
          title: '紧急程度',
          align: 'center',
          dataIndex: 'urgency_dictText',
          title: '是否停机待修',
          align: "center",
          dataIndex: 'isStopName',
        },
        {
          title: '创建人',
          align: "center",
          dataIndex: 'createBy'
        },
        {
          title: '创建时间',
          align: "center",
          dataIndex: 'createTime',
        },
        {
          title: '备注',
          align: "center",
          dataIndex: 'remark',
          scopedSlots: {
            customRender: 'faultDescription'
          }
        },
      ],
      url: {
        list: "/eam/equipmentReportRepair/list",
        list: "/eam/equipmentReportRepair/getReportRepairList",
        add:  "/eam/repairOrder/addBySelectReport"
      },
    }
  },
  methods: {
@@ -187,6 +249,8 @@
      if (arg === 1) {
        this.ipagination.current = 1
      }
      this.queryParam.status = '1';
      this.queryParam.userId = store.getters.userInfo.id
      var params = this.getQueryParams() //查询条件
      this.loading = true
      params.isCreateOrder = 0
@@ -207,19 +271,12 @@
          this.loading = false
        })
    },
    searchQuery() {
      this.loadData(1);
    },
    searchReset() {
      this.queryParam = {};
      this.loadData(1)
    },
    list(params) {
      this.selectedRowKeys = [];
      this.selectedRowRecord = [];
      this.visible = true;
      this.loadData(1);
    },
    clickThenCheck(record) {
      return {
@@ -231,30 +288,36 @@
        }
      };
    },
    onSelectChange(selectedRowKeys, selectedRows) {
    onSelectChange(selectedRowKeys, selectionRows) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRowRecord = selectedRows[0];
      this.selectionRows = selectionRows;
    },
    close() {
      this.queryParam = {};
      this.$emit('close');
      this.dataSource=[];
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // 触发表单验证
      if (that.selectedRowKeys.length > 0) {
        if (that.selectedRowRecord.id != null && that.selectedRowRecord.id != "") {
          that.$emit('sendFaultReportRepairRecord', { record: that.selectedRowRecord });
          that.close();
        } else {
          that.$message.error("请选择故障报修信息!")
        }
      } else {
        that.$message.error("请选择故障报修信息!")
      this.confirmLoading=true;
      if (that.selectedRowKeys.length === 0) {
        that.$message.error("请选择故障报修单后提交!")
        return false;
      }
      postAction(this.url.add,this.selectionRows).then(res=>{
        if(res.success){
          that.$message.success("领取成功!")
          that.$emit('ok');
        }else{
          that.$message.error("领取出现异常!")
        }
      }).finally(res=>{
        that.confirmLoading = false;
        that.close();
      });
    },
    handleCancel() {
      this.close();
    },
@@ -311,8 +374,7 @@
  height: 90% !important;
  overflow-y: hidden;
}
/deep/ .notshow {
 .notshow {
  display: none;
}
@@ -330,9 +392,7 @@
}
.dataUnKnow {
  color: #1890ff;
}
/deep/ .frozenRowClass {
} .frozenRowClass {
  color: #c9c9c9;
}
</style>