zhangherong
2025-05-16 196f9692aa3a607b4d0edf10945004fbe728547d
src/views/eam/dispose/EamEquipmentLeanOutList.vue
@@ -5,45 +5,23 @@
    <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-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <lx-search-equipment-select placeholder="请输入设备编号或名称搜索"
                                          v-model="queryParam.equipmentId"></lx-search-equipment-select>
            </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>
          </a-col>
        <template v-if="toggleSearchStatus">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="单据号">
              <a-input placeholder="请输入单据号" v-model="queryParam.code"></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.leanDepartId"></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.leanPerson"></a-input>
            </a-form-item>
          </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -51,22 +29,24 @@
    <!-- 操作按钮区域 -->
    <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-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="batchDel">
            <a-icon type="delete" />
            删除
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down" />
        </a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
@@ -79,24 +59,35 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :scroll="{ x: 'max-content' }"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          <template v-if="record.leanStatus === 'WAIT_SUBMIT'">
            <a @click="handleEdit(record)">编辑</a>
            <a-divider type="vertical" />
            <a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record.id)">
              <a>提交</a>
            </a-popconfirm>
            <a-divider type="vertical" />
            <a-dropdown>
              <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
              <a-menu slot="overlay">
                 <a-menu-item>
                  <a href="javascript:;" @click="handleDetail(record)">详情</a>
                </a-menu-item>
                <a-menu-item>
                  <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                    <a>删除</a>
                  </a-popconfirm>
                </a-menu-item>
              </a-menu>
            </a-dropdown>
          </template>
           <template v-else>
              <a @click="handleDetail(record)">详情</a>
          </template>
        </span>
      </a-table>
@@ -109,112 +100,164 @@
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import '@/assets/less/TableExpand.less'
import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
import { getAction } from '@api/manage'
  export default {
    name: "EamEquipmentLeanOutList",
    mixins:[JeecgListMixin],
    components: {
      EamEquipmentLeanOutModal
    },
    data () {
      return {
        description: '设备借出归还管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
         {
            title: '删除标记',
            align:"center",
            dataIndex: 'delFlag'
           },
         {
            title: '设备ID',
            align:"center",
            dataIndex: 'equipmentId'
           },
         {
            title: '单据号',
            align:"center",
            dataIndex: 'code'
           },
         {
            title: '借入部门',
            align:"center",
            dataIndex: 'leanDepartId'
           },
         {
            title: '借入责任人',
            align:"center",
            dataIndex: 'leanPerson'
           },
         {
            title: '借出状态',
            align:"center",
            dataIndex: 'leanStatus'
           },
         {
            title: '借出开始时间',
            align:"center",
            dataIndex: 'leanStartTime'
           },
         {
            title: '借出归还时间',
            align:"center",
            dataIndex: 'leanEndTime'
           },
         {
            title: '审核人',
            align:"center",
            dataIndex: 'approvalUser'
           },
         {
            title: '审核时间',
            align:"center",
            dataIndex: 'approvalTime'
           },
         {
            title: '备注',
            align:"center",
            dataIndex: 'remark'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
export default {
  name: 'EamEquipmentLeanOutList',
  mixins: [JeecgListMixin],
  components: {
    LxSearchEquipmentSelect,
    EamEquipmentLeanOutModal
  },
  data() {
    return {
      description: '设备借出归还管理页面',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          fixed: 'left',
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        ],
      url: {
          list: "/eam/eamEquipmentLeanOut/list",
          delete: "/eam/eamEquipmentLeanOut/delete",
          deleteBatch: "/eam/eamEquipmentLeanOut/deleteBatch",
          exportXlsUrl: "eam/eamEquipmentLeanOut/exportXls",
          importExcelUrl: "eam/eamEquipmentLeanOut/importExcel",
       },
        },
        {
          title: '设备编号',
          align: 'center',
          dataIndex: 'equipmentCode',
          fixed: 'left',
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'equipmentName',
          fixed: 'left',
        },
        {
          title: '单据号',
          align: 'center',
          dataIndex: 'code'
        },
        {
          title: '借入车间',
          align: 'center',
          dataIndex: 'leanDepartId_dictText'
        },
        {
          title: '借入人',
          align: 'center',
          dataIndex: 'leanPerson_dictText'
        },
        {
          title: '借用原因',
          align: 'center',
          dataIndex: 'leanReason'
        },
        {
          title: '借用状态',
          align: 'center',
          dataIndex: 'leanStatus_dictText'
        },
        {
          title: '借用开始时间',
          align: 'center',
          dataIndex: 'leanStartTime'
        },
        {
          title: '借用归还时间',
          align: 'center',
          dataIndex: 'leanEndTime'
        },
        {
          title: '审核人',
          align: 'center',
          dataIndex: 'approvalUser_dictText'
        },
        {
          title: '审核意见',
          align: 'center',
          dataIndex: 'approvalComment'
        },
        {
          title: '审核时间',
          align: 'center',
          dataIndex: 'approvalTime'
        },
        {
          title: '归还确认人',
          align: 'center',
          dataIndex: 'confirmUser_dictText'
        },
        {
          title: '确认意见',
          align: 'center',
          dataIndex: 'confirmComment'
        },
        {
          title: '确认时间',
          align: 'center',
          dataIndex: 'confirmTime'
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 200,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/eam/eamEquipmentLeanOut/list',
        delete: '/eam/eamEquipmentLeanOut/delete',
        deleteBatch: '/eam/eamEquipmentLeanOut/deleteBatch',
        submit: '/eam/eamEquipmentLeanOut/submit',
      }
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {
  computed: {},
  methods: {
    handleSubmit(id) {
      if (!this.url.submit) {
        this.$message.error('请设置url.submit属性!')
        return
      }
      let that = this
      getAction(that.url.submit, { id: id }).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          // that.$message.success(res.message);
          that.$notification.success({
            message: '消息',
            description: res.message
          })
          that.loadData()
        } else {
          // that.$message.warning(res.message);
          that.$notification.warning({
            message: '消息',
            description: res.message
          })
        }
      })
    }
  }
}
</script>
<style scoped>
  @import '~@assets/less/common.less';
@import '~@assets/less/common.less';
</style>