cuilei
2025-06-24 c7bbdaab4503cc0e470623e87cca3b8a1840bff0
src/views/eam/repair/EamMajorPartialRepairList.vue
@@ -1,35 +1,41 @@
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="删除标记">
              <a-input placeholder="请输入删除标记" v-model="queryParam.delFlag"></a-input>
            <a-form-item label="维修编码">
              <a-input placeholder="请输入维修编码" v-model="queryParam.repairCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备ID">
              <a-input placeholder="请输入设备ID" v-model="queryParam.equipmentId"></a-input>
            <a-form-item label="项目名称">
              <a-input placeholder="请输入项目名称" v-model="queryParam.repairName"></a-input>
            </a-form-item>
          </a-col>
        <template v-if="toggleSearchStatus">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="维修状态">
                <j-dict-select-tag placeholder="请选择维修状态" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="维修类型">
              <a-input placeholder="请输入维修类型" v-model="queryParam.repairType"></a-input>
                <a-select v-model="queryParam.repairType" placeholder="请选择维修类型">
                  <a-select-option value="大修">大修</a-select-option>
                  <a-select-option value="项修">项修</a-select-option>
                </a-select>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="计划开始时间">
              <a-input placeholder="请输入计划开始时间" v-model="queryParam.planStartTime"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="计划结束时间">
              <a-input placeholder="请输入计划结束时间" v-model="queryParam.planEndTime"></a-input>
              <a-form-item label="计划开始日期">
                <a-range-picker
                  v-model="planDateRange"
                  @change="selectDateChange"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                />
            </a-form-item>
          </a-col>
          </template>
@@ -43,21 +49,26 @@
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('大修项修')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
<!--      <a-button type="primary" icon="download" @click="handleExportXls('eam_major_partial_repair')">导出</a-button>-->
<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!--        <a-button type="primary" icon="import">导入</a-button>-->
<!--      </a-upload>-->
      <!-- 高级查询区域 -->
<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
          <a-menu-item key="1" @click="batchSubmit"><a-icon type="form"/>提交</a-menu-item>
          <a-menu-item key="2" @click="batchConfirm"><a-icon type="check"/>确认</a-menu-item>
          <a-menu-item key="3" @click="batchRepeal"><a-icon type="close"/>作废</a-menu-item>
          <a-menu-item key="4" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
@@ -73,23 +84,64 @@
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
        <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="handleDetail(record)">详情</a>
          <span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
            <a-divider type="vertical" />
            <a-popconfirm title="确定要提交吗?" @confirm="() => handleSubmit(record.id)">
              <a>提交</a>
            </a-popconfirm>
          </span>
          <span v-if="record.repairStatus === 'PENDING_CONFIRMATION'">
            <a-divider type="vertical" />
            <a-popconfirm title="要完成确认吗?" @confirm="() => handleConfirm(record.id)">
              <a>确认</a>
            </a-popconfirm>
          </span>
          <span v-if="record.repairStatus === 'CONFIRMED'">
            <a-divider type="vertical" />
            <a @click="handleFill(record)">填报</a>
          </span>
          <span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
                <a-menu-item>
                  <a @click="handleEdit(record)">编辑</a>
                </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
@@ -98,26 +150,31 @@
            </a-menu>
          </a-dropdown>
        </span>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <!-- 表单区域 -->
    <eamMajorPartialRepair-modal ref="modalForm" @ok="modalFormOk"></eamMajorPartialRepair-modal>
    <eam-major-partial-repair-modal ref="modalForm" @ok="modalFormOk"></eam-major-partial-repair-modal>
    <eam-major-partial-repair-detail-modal ref="modalDetailForm" @ok="modalFormOk"></eam-major-partial-repair-detail-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal'
  import EamMajorPartialRepairDetailModal from './modules/EamMajorPartialRepairDetailModal'
  import { getAction } from '../../../api/manage'
  export default {
    name: "EamMajorPartialRepairList",
    mixins:[JeecgListMixin],
    name: 'EamMajorPartialRepairList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      EamMajorPartialRepairModal
      EamMajorPartialRepairModal,
      EamMajorPartialRepairDetailModal
    },
    data () {
      return {
@@ -135,14 +192,19 @@
            }
           },
         {
            title: '删除标记',
            title:'维修编码',
            align:"center",
            dataIndex: 'delFlag'
            dataIndex: 'repairCode'
           },
         {
            title: '设备ID',
            title:'项目名称',
            align:"center",
            dataIndex: 'equipmentId'
            dataIndex: 'repairName'
          },
          {
            title:'维修状态',
            align:"center",
            dataIndex: 'repairStatus_dictText'
           },
         {
            title: '维修类型',
@@ -150,29 +212,24 @@
            dataIndex: 'repairType'
           },
         {
            title: '计划开始时间',
            title:'申请人',
            align:"center",
            dataIndex: 'planStartTime'
            dataIndex: 'applicant_dictText'
           },
         {
            title: '计划结束时间',
            title:'申请车间',
            align:"center",
            dataIndex: 'planEndTime'
            dataIndex: 'applicantProduction_dictText'
           },
         {
            title: '维修编码',
            title:'计划开始日期',
            align:"center",
            dataIndex: 'repairCode'
            dataIndex: 'planStartDate'
           },
         {
            title: '维修名称',
            title:'计划结束日期',
            align:"center",
            dataIndex: 'repairName'
           },
         {
            title: '维修状态',
            align:"center",
            dataIndex: 'repairStatus'
            dataIndex: 'planEndDate'
           },
         {
            title: '实际开始时间',
@@ -189,54 +246,248 @@
            align:"center",
            dataIndex: 'totalAmount'
           },
         {
            title: '附件',
            align:"center",
            dataIndex: 'attachment'
           },
         {
            title: '维修描述',
            align:"center",
            dataIndex: 'repairDescription'
           },
         {
            title: '维修方式',
            align:"center",
            dataIndex: 'repairMethod'
           },
         {
            title: '委外公司',
            align:"center",
            dataIndex: 'outsourcedCompany'
           },
          // {
          //   title:'故障描述',
          //   align:"center",
          //   dataIndex: 'faultDescription'
          // },
          // {
          //   title:'申请原因',
          //   align:"center",
          //   dataIndex: 'applicantReason'
          // },
         {
            title: '责任人',
            align:"center",
            dataIndex: 'responsiblePerson'
            dataIndex: 'responsiblePerson_dictText'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
      url: {
          list: "/eam/eamMajorPartialRepair/list",
          delete: "/eam/eamMajorPartialRepair/delete",
          deleteBatch: "/eam/eamMajorPartialRepair/deleteBatch",
          exportXlsUrl: "eam/eamMajorPartialRepair/exportXls",
          exportXlsUrl: "/eam/eamMajorPartialRepair/exportXls",
          importExcelUrl: "eam/eamMajorPartialRepair/importExcel",
          submit: "eam/eamMajorPartialRepair/submit",
          submitBatch: "eam/eamMajorPartialRepair/submitBatch",
          confirm: "eam/eamMajorPartialRepair/confirm",
          confirmBatch: "eam/eamMajorPartialRepair/confirmBatch",
          repeal: "eam/eamMajorPartialRepair/repeal",
          repealBatch: "eam/eamMajorPartialRepair/repealBatch"
       },
        planDateRange: [],
        dictOptions:{},
        superFieldList:[],
    }
    },
    created() {
    this.getSuperFieldList();
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
      },
  },
    methods: {
      searchReset() {
        this.planDateRange = []
        this.queryParam = {}
        this.loadData(1);
      },
      selectDateChange(value, dateString) {
        if (dateString && dateString.length === 2) {
          this.queryParam.planStartDate = dateString[0]
          this.queryParam.planEndDate = dateString[1]
        }
      },
      handleFill(record) {
        this.$refs.modalDetailForm.open(record);
        this.$refs.modalDetailForm.title = "填报";
        this.$refs.modalDetailForm.disableSubmit = false;
      },
      handleSubmit(id) {
        getAction(this.url.submit,{id:id}).then((res)=>{
          if(res.success){
            this.loadData();
            this.$message.success(res.message);
          } else {
            this.$message.warning(res.message);
          }
        })
      },
      handleConfirm(id) {
        getAction(this.url.confirm,{id:id}).then((res)=>{
          if(res.success){
            this.loadData();
            this.$message.success(res.message);
          } else {
            this.$message.warning(res.message);
          }
        })
      },
      batchSubmit() {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
          return
        } else {
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
          }
          var that = this
          this.$confirm({
            title: '确认提交',
            content: '是否提交选中数据,只有待提交状态的数据才可提交成功?',
            onOk: function () {
              that.loading = true
              getAction(that.url.submitBatch, { ids: ids }).then((res) => {
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.loadData()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.loading = false
              })
            }
          })
        }
      },
      batchConfirm() {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
          return
        } else {
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
          }
          var that = this
          this.$confirm({
            title: '是否确认',
            content: '是否确认选中数据,只有待确认状态的数据才可确认成功?',
            onOk: function () {
              that.loading = true
              getAction(that.url.confirmBatch, { ids: ids }).then((res) => {
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.loadData()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.loading = false
              })
            }
          })
        }
      },
      batchRepeal() {
        if (this.selectedRowKeys.length <= 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择一条记录'
          })
          return
        } else {
          var ids = ''
          for (var a = 0; a < this.selectedRowKeys.length; a++) {
            ids += this.selectedRowKeys[a] + ','
          }
          var that = this
          this.$confirm({
            title: '是否作废',
            content: '是否作废选中数据,只有待提交状态的数据才可作废成功?',
            onOk: function () {
              that.loading = true
              getAction(that.url.repealBatch, { ids: ids }).then((res) => {
                if (res.success) {
                  //重新计算分页问题
                  that.reCalculatePage(that.selectedRowKeys.length)
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.loadData()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.loading = false
              })
            }
          })
        }
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'repairCode',text:'维修编码',dictCode:''})
        fieldList.push({type:'string',value:'repairName',text:'项目名称',dictCode:''})
        fieldList.push({type:'string',value:'repairStatus',text:'维修状态',dictCode:''})
        fieldList.push({type:'string',value:'repairType',text:'维修类型',dictCode:''})
        fieldList.push({type:'string',value:'applicant',text:'申请人',dictCode:''})
        fieldList.push({type:'string',value:'applicantProduction',text:'申请车间',dictCode:''})
        fieldList.push({type:'date',value:'planStartDate',text:'计划开始日期'})
        fieldList.push({type:'date',value:'planEndDate',text:'计划结束日期'})
        fieldList.push({type:'date',value:'actualStartTime',text:'实际开始时间'})
        fieldList.push({type:'date',value:'actualEndTime',text:'实际结束时间'})
        fieldList.push({type:'BigDecimal',value:'totalAmount',text:'总金额',dictCode:''})
        fieldList.push({type:'string',value:'faultDescription',text:'故障描述',dictCode:''})
        fieldList.push({type:'string',value:'applicantReason',text:'申请原因',dictCode:''})
        fieldList.push({type:'string',value:'responsiblePerson',text:'责任人',dictCode:''})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>