From 8b311e8310a5ff81068129f59e4e1c434a1e3a25 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 23 六月 2025 14:25:10 +0800
Subject: [PATCH] 新增流程处理,新增程序确认表处理
---
src/views/eam/spare/EamSparePartRequisitionList.vue | 1054 ++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 654 insertions(+), 400 deletions(-)
diff --git a/src/views/eam/spare/EamSparePartRequisitionList.vue b/src/views/eam/spare/EamSparePartRequisitionList.vue
index cdeeee5..4302e94 100644
--- a/src/views/eam/spare/EamSparePartRequisitionList.vue
+++ b/src/views/eam/spare/EamSparePartRequisitionList.vue
@@ -1,38 +1,91 @@
-<template>
+<template >
<a-row :gutter="10">
- <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
+ <a-col
+ :md="leftColMd"
+ :sm="24"
+ style="margin-bottom: 20px"
+ >
<a-card :bordered="false">
<!-- 鏌ヨ鍖哄煙 -->
<div class="table-page-search-wrapper">
<!-- 鎼滅储鍖哄煙 -->
- <a-form layout="inline" @keyup.enter.native="searchQuery">
+ <a-form
+ layout="inline"
+ @keyup.enter.native="searchQuery"
+ >
<a-row :gutter="24">
- <a-col :md="12" :sm="8">
+ <a-col
+ :md="12"
+ :sm="8"
+ >
<a-form-item label="璇疯喘鍗曞彿">
- <j-input placeholder="璇疯緭鍏ヨ璐崟鍙�" v-model="queryParam.requisitionCode"></j-input>
+ <j-input
+ placeholder="璇疯緭鍏ヨ璐崟鍙�"
+ v-model="queryParam.requisitionCode"
+ ></j-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+ <a-col
+ :xl="6"
+ :lg="7"
+ :md="8"
+ :sm="24"
+ >
<a-form-item label="鐢宠浜�">
- <a-input placeholder="璇疯緭鍏ョ敵璇蜂汉" v-model="queryParam.reportUser"></a-input>
+ <a-input
+ placeholder="璇疯緭鍏ョ敵璇蜂汉"
+ v-model="queryParam.reportUser"
+ ></a-input>
</a-form-item>
</a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+ <a-col
+ :xl="6"
+ :lg="7"
+ :md="8"
+ :sm="24"
+ >
<a-form-item label="璇疯喘鐘舵��">
- <a-input placeholder="璇疯緭鍏ヨ璐姸鎬�" v-model="queryParam.requisitionStatus"></a-input>
+ <a-input
+ placeholder="璇疯緭鍏ヨ璐姸鎬�"
+ v-model="queryParam.requisitionStatus"
+ ></a-input>
</a-form-item>
</a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+ <a-col
+ :xl="6"
+ :lg="7"
+ :md="8"
+ :sm="24"
+ >
<a-form-item label="瀹℃牳浜�">
- <a-input placeholder="璇疯緭鍏ュ鏍镐汉" v-model="queryParam.approvalUser"></a-input>
+ <a-input
+ placeholder="璇疯緭鍏ュ鏍镐汉"
+ v-model="queryParam.approvalUser"
+ ></a-input>
</a-form-item>
</a-col>
</template>
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-col :md="12" :sm="24">
- <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">鏌ヨ</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+ <span
+ style="float: left;overflow: hidden;"
+ class="table-page-search-submitButtons"
+ >
+ <a-col
+ :md="12"
+ :sm="24"
+ >
+ <a-button
+ type="primary"
+ @click="searchQuery"
+ icon="search"
+ style="margin-left: 21px"
+ >鏌ヨ</a-button>
+ <a-button
+ type="primary"
+ @click="searchReset"
+ icon="reload"
+ style="margin-left: 8px"
+ >閲嶇疆</a-button>
</a-col>
</span>
</a-row>
@@ -41,18 +94,42 @@
<!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
<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
+ @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> -->
</div>
<!-- table鍖哄煙-begin -->
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+ <div
+ class="ant-alert ant-alert-info"
+ style="margin-bottom: 16px;"
+ >
<i class="anticon anticon-info-circle ant-alert-icon">
</i> 宸查�夋嫨 <a><b>{{ selectedRowKeys1.length }}</b></a>椤�
- <a style="margin-left: 24px" @click="onClearSelected1">娓呯┖</a>
+ <a
+ style="margin-left: 24px"
+ @click="onClearSelected1"
+ >娓呯┖</a>
</div>
<div style="margin-top: 15px">
<a-table
@@ -67,103 +144,189 @@
:loading="loading"
:customRow="customRow"
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
- @change="handleTableChange">
+ @change="handleTableChange"
+ >
- <span slot="action" slot-scope="text, record">
- <a @click="handleOpen(record)">鏄庣粏</a>
- <a-divider v-if="record.requisitionStatus !== '3' && record.requisitionStatus !== '5'" type="vertical" />
- <a-dropdown v-if="record.requisitionStatus === '1' || record.requisitionStatus === '4'">
- <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
- <a-menu slot="overlay">
- <a-menu-item>
- <a @click="handleConfirm(record)">鎻愪氦</a>
- </a-menu-item>
- <a-menu-item>
- <a @click="handleEdit(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>
- <a v-if="record.requisitionStatus === '2'" @click="handleExamine(record)">瀹℃牳</a>
- </span>
+ <span
+ slot="action"
+ slot-scope="text, record"
+ >
+ <!-- <a @click="handleOpen(record)">鏄庣粏</a> -->
+ <!-- <a
+ v-if="record.requisitionStatus === '1'"
+ @click="handleConfirm(record)"
+ >鎻愪氦</a> -->
+ <a-popconfirm
+ v-if="record.requisitionStatus === '1'"
+ title="纭畾鎻愪氦鍚�?"
+ @confirm="() => handleConfirm(record)"
+ > <a>鎻愪氦</a>
+ </a-popconfirm>
+ <a-divider type="vertical" />
+ <a-dropdown v-if="record.requisitionStatus === '1'">
+ <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+ <a-menu slot="overlay">
+ <!-- <a-menu-item>
+ <a @click="handleConfirm(record)">鎻愪氦</a>
+ </a-menu-item> -->
+ <a-menu-item>
+ <a @click="handleEdit(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>
+ <!-- <a
+ v-if="record.requisitionStatus === '2'"
+ @click="handleExamine(record)"
+ >瀹℃牳</a> -->
+ </span>
</a-table>
</div>
<!-- table鍖哄煙-end -->
<!-- 琛ㄥ崟鍖哄煙 -->
- <eamSparePartRequisition-modal ref="modalForm" @ok="modalFormOk"></eamSparePartRequisition-modal>
+ <eamSparePartRequisition-modal
+ ref="modalForm"
+ @ok="modalFormOk"
+ ></eamSparePartRequisition-modal>
- <eamSparePartRequisitionExamine-modal ref="modalExamine" @ok="modalFormOk2"></eamSparePartRequisitionExamine-modal>
+ <!-- <eamSparePartRequisitionExamine-modal
+ ref="modalExamine"
+ @ok="modalFormOk2"
+ ></eamSparePartRequisitionExamine-modal> -->
</a-card>
</a-col>
- <a-col :md="rightColMd" :sm="24" v-if="this.rightColVal === 1">
- <a-card :bordered="false">
- <div style="text-align: right;">
- <a-icon type="close-circle" @click="hideSpareDetailList" />
+ <a-col
+ :md="rightColMd"
+ :sm="24"
+ v-if="this.rightColVal === 1"
+ >
+ <a-card
+ title="澶囦欢璇疯喘鏄庣粏"
+ :bordered="false"
+ >
+ <div style="text-align: left;">
+ <a-icon
+ type="close-circle"
+ @click="hideSpareDetailList"
+ />
</div>
<!-- 鏌ヨ鍖哄煙 -->
- <div class="table-page-search-wrapper">
+ <!-- <div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
- <a-col :md="9" :sm="24">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery2" icon="search">鏌ヨ</a-button>
- <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
- </span>
+ <a-col
+ :md="9"
+ :sm="24"
+ >
+ <span
+ style="float: left;overflow: hidden;"
+ class="table-page-search-submitButtons"
+ >
+ <a-button
+ type="primary"
+ @click="searchQuery2"
+ icon="search"
+ >鏌ヨ</a-button>
+ <a-button
+ type="primary"
+ @click="searchReset2"
+ icon="reload"
+ style="margin-left: 8px"
+ >閲嶇疆</a-button>
+ </span>
</a-col>
</a-row>
</a-form>
- </div>
+ </div> -->
<!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
- <div class="table-operator" :md="24" :sm="24">
- <a-button @click="handleAdd2" 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>
+ <!-- <div
+ class="table-operator"
+ :md="24"
+ :sm="24"
+ >
+ <a-button
+ @click="handleAdd2"
+ 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="selectedRowKeys2.length > 0">
<a-menu slot="overlay">
- <a-menu-item key="1" @click="batchDel2">
- <a-icon type="delete"/>
+ <a-menu-item
+ key="1"
+ @click="batchDel2"
+ >
+ <a-icon type="delete" />
鎵归噺鍒犻櫎
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
- <a-icon type="down"/>
+ <a-icon type="down" />
</a-button>
</a-dropdown>
- </div>
+ </div> -->
- <!-- table鍖哄煙-begin -->
+ <!-- table鍖哄煙-begin
<div>
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+ <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">{{ selectedRowKeys2.length }}</a>椤�
- <a style="margin-left: 24px" @click="onClearSelected2">娓呯┖</a>
- </div>
+ <a
+ style="margin-left: 24px"
+ @click="onClearSelected2"
+ >娓呯┖</a>
+ </div>-->
- <a-table
- style="height:500px"
- ref="table2"
- size="middle"
- bordered
- rowKey="id"
- :columns="columns2"
- :dataSource="dataSource2"
- :pagination="iPagination2"
- :loading="loading2"
- class="j-table-force-nowrap"
- :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
- @change="handleTableChange2">
+ <a-table
+ style="height:500px"
+ ref="table2"
+ size="middle"
+ bordered
+ rowKey="id"
+ :columns="columns2"
+ :dataSource="dataSource2"
+ :pagination="iPagination2"
+ :loading="loading2"
+ class="j-table-force-nowrap"
+ @change="handleTableChange2"
+ >
+ <!-- :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" -->
- <span slot="action" slot-scope="text, record">
+ <span
+ slot="action"
+ slot-scope="text, record"
+ >
<a-dropdown>
<a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
<a-menu slot="overlay">
@@ -171,7 +334,10 @@
<a-popconfirm @click="handleEdit2(record)">
<a>缂栬緫</a>
</a-popconfirm>
- <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete2(record.id)">
+ <a-popconfirm
+ title="纭畾鍒犻櫎鍚�?"
+ @confirm="() => handleDelete2(record.id)"
+ >
<a>鍒犻櫎</a>
</a-popconfirm>
</a-menu-item>
@@ -179,8 +345,8 @@
</a-dropdown>
</span>
- </a-table>
- </div>
+ </a-table>
+
<!-- table鍖哄煙-end -->
</a-card>
</a-col>
@@ -189,354 +355,442 @@
</template>
<script>
- import '@assets/less/TableExpand.less'
- import EamSparePartRequisitionModal from './modules/EamSparePartRequisitionModal.vue'
- import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisitionExamineModal.vue'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import { deleteAction, getAction, postAction } from '@api/manage'
- import { filterObj } from '@/utils/util'
+import '@assets/less/TableExpand.less'
+import EamSparePartRequisitionModal from './modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue'
+// import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { deleteAction, getAction, postAction } from '@api/manage'
+import { filterObj } from '@/utils/util'
- export default {
- name: "EamSparePartRequisitionList",
- mixins:[JeecgListMixin],
- components: {
- EamSparePartRequisitionModal,
- EamSparePartRequisitionExamineModal
- },
- data () {
- return {
- description: '澶囦欢璇疯喘鍗曠鐞嗛〉闈�',
- model1: {},
- model2: {},
- queryParam1: {},
- queryParam2: {},
- dataSource: [],
- dataSource2: [],
- spareRequisitionId: '',
- iPagination: {
- current: 1,
- pageSize: 10,
- pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0,
+export default {
+ name: "EamSparePartRequisitionList",
+ mixins: [JeecgListMixin],
+ components: {
+ EamSparePartRequisitionModal,
+ // EamSparePartRequisitionExamineModal
+ },
+ data() {
+ return {
+ description: '澶囦欢璇疯喘鍗曠鐞嗛〉闈�',
+ model1: {},
+ model2: {},
+ queryParam1: {},
+ queryParam2: {},
+ dataSource: [],
+ dataSource2: [],
+ spareRequisitionId: '',
+ iPagination: {
+ current: 1,
+ pageSize: 10,
+ pageSizeOptions: ['10', '20', '30'],
+ showTotal: (total, range) => {
+ return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
},
- iPagination2: {
- current: 1,
- pageSize: 10,
- pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ total: 0,
+ },
+ iPagination2: {
+ current: 1,
+ pageSize: 10,
+ pageSizeOptions: ['10', '20', '30'],
+ showTotal: (total, range) => {
+ return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
},
- iSorter1: {
- column: 'createTime',
- order: 'desc',
- },
- iSorter2: {
- column: 'createTime',
- order: 'desc',
- },
- filters1: {},
- filters2: {},
- loading: false,
- loading2: false,
- selectedRowKeys1: [],
- selectedRowKeys2: [],
- selectionRows1: [],
- selectionRows2: [],
- rightColVal: 0,
- // 楂樼骇鏌ヨ鍙傛暟
- superQueryParams2: '',
- // 楂樼骇鏌ヨ鎷兼帴鏉′欢
- superQueryMatchType2: 'and',
- // 琛ㄥご
- columns: [
- {
- title: '璇疯喘鍗曞彿',
- align:"center",
- dataIndex: 'requisitionCode'
- },
- {
- title: '鐘舵��',
- align:"center",
- dataIndex: 'requisitionStatus_dictText'
- },
- {
- title: '璇疯喘浜�',
- align:"center",
- dataIndex: 'reportUser'
- },
- {
- title: '璇疯喘鏃堕棿',
- align:"center",
- dataIndex: 'createTime'
- },
- {
- title: '瀹℃牳浜�',
- align:"center",
- dataIndex: 'approvalUser'
- },
- {
- title: '瀹℃牳鏃堕棿',
- align:"center",
- dataIndex: 'approvalTime'
- },
- {
- title: '鎿嶄綔',
- dataIndex: 'action',
- align:"center",
- scopedSlots: { customRender: 'action' },
+ showQuickJumper: true,
+ showSizeChanger: true,
+ total: 0,
+ },
+ iSorter1: {
+ column: 'createTime',
+ order: 'desc',
+ },
+ iSorter2: {
+ column: 'createTime',
+ order: 'desc',
+ },
+ filters1: {},
+ filters2: {},
+ loading: false,
+ loading2: false,
+ selectedRowKeys1: [],
+ selectedRowKeys2: [],
+ selectionRows1: [],
+ selectionRows2: [],
+ rightColVal: 0,
+ // 楂樼骇鏌ヨ鍙傛暟
+ superQueryParams2: '',
+ // 楂樼骇鏌ヨ鎷兼帴鏉′欢
+ superQueryMatchType2: 'and',
+ // 琛ㄥご
+ columns: [
+ {
+ title: '#',
+ dataIndex: '',
+ key: 'rowIndex',
+ width: 60,
+ align: 'center',
+ customRender: function (t, r, index) {
+ return parseInt(index) + 1
}
- ],
- // 瀛愯〃琛ㄥご
- columns2: [
- {
- title: '澶囧搧澶囦欢ID',
- align:"center",
- dataIndex: 'partId'
- },
- {
- title: '璇疯喘鏁伴噺',
- align:"center",
- dataIndex: 'requisitionNum'
- },
- {
- title: '鎿嶄綔',
- dataIndex: 'action',
- align:"center",
- scopedSlots: { customRender: 'action' },
+ },
+ {
+ title: '璇疯喘鍗曞彿',
+ align: "center",
+ dataIndex: 'requisitionCode'
+ },
+ {
+ title: '鐘舵��',
+ align: "center",
+ dataIndex: 'requisitionStatus_dictText'
+ },
+ {
+ title: '璇疯喘浜�',
+ align: "center",
+ dataIndex: 'reportUser'
+ },
+ {
+ title: '璇疯喘鏃堕棿',
+ align: "center",
+ dataIndex: 'createTime'
+ },
+ {
+ title: '瀹℃牳浜�',
+ align: "center",
+ dataIndex: 'approvalUser'
+ },
+ {
+ title: '瀹℃牳鏃堕棿',
+ align: "center",
+ dataIndex: 'approvalTime'
+ },
+ {
+ title: '鎿嶄綔',
+ dataIndex: 'action',
+ align: "center",
+ scopedSlots: { customRender: 'action' },
+ }
+ ],
+ // 瀛愯〃琛ㄥご
+ columns2: [
+ {
+ title: '#',
+ dataIndex: '',
+ key: 'rowIndex',
+ width: 60,
+ align: 'center',
+ customRender: function (t, r, index) {
+ return parseInt(index) + 1
}
- ],
- url: {
- list: "/eam/eamSparePartRequisition/list",
- list2: "/eam/eamSparePartRequisitionDetail/list",
- delete: "/eam/eamSparePartRequisition/delete",
- delete2: "/eam/eamSparePartRequisitionDetail/delete",
- deleteBatch: "/eam/eamSparePartRequisition/deleteBatch",
- deleteBatch2: "/eam/eamSparePartRequisitionDetail/deleteBatch",
- exportXlsUrl: "eam/eamSparePartRequisition/exportXls",
- exportXlsUrl2: "eam/eamSparePartRequisitionDetail/exportXls",
- importExcelUrl: "eam/eamSparePartRequisition/importExcel",
- importExcelUrl2: "eam/eamSparePartRequisitionDetail/importExcel",
- submit: "eam/eamSparePartRequisition/submitSpareRequisition"
- },
+ },
+ {
+ title: '澶囧搧缂栫爜',
+ align: "center",
+ dataIndex: 'partCode'
+ },
+ {
+ title: '鍚嶇О',
+ align: "center",
+ dataIndex: 'partName'
+ },
+ {
+ title: '鍨嬪彿',
+ align: "center",
+ dataIndex: 'partModel'
+ },
+ {
+ title: '璇疯喘鏁伴噺',
+ align: "center",
+ dataIndex: 'requisitionNum'
+ },
+ // {
+ // title: '鎿嶄綔',
+ // dataIndex: 'action',
+ // align: "center",
+ // scopedSlots: { customRender: 'action' },
+ // }
+ ],
+ url: {
+ list: "/eam/eamSparePartRequisition/list",
+ list2: "/eam/eamSparePartRequisitionDetail/list",
+ delete: "/eam/eamSparePartRequisition/delete",
+ delete2: "/eam/eamSparePartRequisitionDetail/delete",
+ deleteBatch: "/eam/eamSparePartRequisition/deleteBatch",
+ deleteBatch2: "/eam/eamSparePartRequisitionDetail/deleteBatch",
+ exportXlsUrl: "eam/eamSparePartRequisition/exportXls",
+ exportXlsUrl2: "eam/eamSparePartRequisitionDetail/exportXls",
+ importExcelUrl: "eam/eamSparePartRequisition/importExcel",
+ importExcelUrl2: "eam/eamSparePartRequisitionDetail/importExcel",
+ submit: "eam/eamSparePartRequisition/submitSpareRequisition"
+ },
}
},
computed: {
- importExcelUrl: function(){
+ importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
leftColMd() {
- return this.selectedRowKeys1.length === 0 ? 24 : 12
+ return this.selectedRowKeys1.length === 0 ? 24 : 14
},
rightColMd() {
- return this.selectedRowKeys1.length === 0 ? 0 : 12
+ return this.selectedRowKeys1.length === 0 ? 0 : 10
}
},
- methods: {
- customRow(record) {
- return {
- on: {
- dblclick:() => {
- this.handleOpen(record)
- }
+ methods: {
+ customRow(record) {
+ return {
+ on: {
+ click: () => {
+ this.handleOpen(record)
}
}
- },
- onSelectChange1(selectedRowKeys, selectionRows) {
- this.rightColVal = 1
- this.selectedRowKeys1 = selectedRowKeys
- this.selectionRows1 = selectionRows
- this.model1 = Object.assign({}, selectionRows[0])
- this.spareRequisitionId = selectedRowKeys[0]
- this.loadData2()
- },
- onSelectChange2(selectedRowKeys, selectionRows) {
- this.selectedRowKeys2 = selectedRowKeys
- this.selectionRows2 = selectionRows
- },
- /**
- * 鐐瑰嚮褰撳墠琛岃溅闂撮�夐」鍚庤Е鍙戜簨浠�
- * @param record 褰撳墠琛屾暟鎹�
- */
- handleOpen: function (record) {
- this.rightColVal = 1
- this.selectedRowKeys1 = [record.id]
- this.model1 = Object.assign({}, record)
- this.spareRequisitionId = record.id
- this.onClearSelected2()
- this.loadData2()
- },
- searchQuery2: function () {
- this.loadData2(1)
- },
- searchReset2: function () {
- this.queryParam2 = {}
- this.loadData2(1)
- },
- handleTableChange2: function (pagination, filters, sorter) {
- //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂
- if (Object.keys(sorter).length > 0) {
- this.iSorter2.column = sorter.field
- this.iSorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
- }
- this.iPagination2 = pagination
- this.loadData2()
- },
- onClearSelected2: function () {
- this.selectedRowKeys2 = []
- this.selectionRows2 = []
- },
- loadData2: function (arg) {
- if (!this.url.list2) {
- this.$message.error('璇疯缃畊rl.list2灞炴��!')
- return
- }
- //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
- if (arg === 1) {
- this.iPagination2.current = 1
- }
- if (this.currentWorkshopId === '') return
- let params = this.getQueryParams2() //鏌ヨ鏉′欢
- params.spareRequisitionId = this.spareRequisitionId
- this.loading2 = true
- getAction(this.url.list2, params).then((res) => {
- if (res.success) {
- this.dataSource2 = res.result.records
- this.iPagination2.total = res.result.total
- }else{
- this.dataSource2=[]
- }
- this.loading2 = false
- })
- },
- getQueryParams2() {
- //鑾峰彇鏌ヨ鏉′欢
- let sqp = {}
- if (this.superQueryParams2) {
- sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
- sqp['superQueryMatchType'] = this.superQueryMatchType2
- }
- var param = Object.assign(sqp, this.queryParam2, this.iSorter2, this.filters2)
- param.field = this.getQueryField2()
- param.pageNo = this.iPagination2.current
- param.pageSize = this.iPagination2.pageSize
- return filterObj(param)
- },
- getQueryField2() {
- var str = 'id,'
- this.columns2.forEach(function(value) {
- str += ',' + value.dataIndex
- })
- return str
- },
- hideSpareDetailList: function () {
- this.selectedRowKeys1 = []
- },
- handleEdit2: function(record) {
- this.$refs.modalForm2.title = '缂栬緫'
- // this.$refs.modalForm2.roleDisabled = true
- this.$refs.modalForm2.edit(record)
- },
- handleAdd2: function () {
- if (this.spareRequisitionId === '') {
- this.$message.error('璇烽�夋嫨涓�涓璐崟!')
- } else {
- // this.$refs.modalForm2.roleDisabled = true
- this.$refs.modalForm2.title = '鏂板'
- this.$refs.modalForm2.edit({selectedSpareRequisitions:this.spareRequisitionId})
- }
- },
- handleDelete2: function (id) {
- if (!this.url.delete2) {
- this.$message.error('璇疯缃畊rl.delete2灞炴��!')
- return
- }
- var that = this
- deleteAction(that.url.delete2, { spareRequisitionId: this.spareRequisitionId, spareRequisitionDetailId: id }).then((res) => {
- if (res.success) {
- that.$message.success(res.message)
- that.loadData2()
+ }
+ },
+ onSelectChange1(selectedRowKeys, selectionRows) {
+ this.rightColVal = 1
+ this.selectedRowKeys1 = selectedRowKeys
+ this.selectionRows1 = selectionRows
+ this.model1 = Object.assign({}, selectionRows[0])
+ this.spareRequisitionId = selectedRowKeys[0]
+ this.loadData2()
+ },
+ onSelectChange2(selectedRowKeys, selectionRows) {
+ this.selectedRowKeys2 = selectedRowKeys
+ this.selectionRows2 = selectionRows
+ },
+ /**
+ * 鐐瑰嚮褰撳墠琛岃溅闂撮�夐」鍚庤Е鍙戜簨浠�
+ * @param record 褰撳墠琛屾暟鎹�
+ */
+ handleOpen: function (record) {
+ this.rightColVal = 1
+ this.selectedRowKeys1 = [record.id]
+ this.model1 = Object.assign({}, record)
+ this.spareRequisitionId = record.id
+ this.onClearSelected2()
+ this.loadData2()
+ },
+
+ // handleAdd: function () {
+ // // if (this.spareRequisitionId === '') {
+ // // this.$message.error('璇烽�夋嫨涓�涓璐崟!')
+ // // } else {
+ // // this.$refs.modalForm2.roleDisabled = true
+ // this.$refs.sparePartRequisitionModalForm.title = '鏂板'
+ // this.$refs.sparePartRequisitionModalForm.add()
+ // // }
+ // },
+ searchQuery: function () {
+ this.loadData(1)
+ this.dataSource2 = []
+ },
+ searchReset: function () {
+ this.queryParam = {}
+ this.loadData(1)
+ this.dataSource2 = []
+ },
+ searchQuery2: function () {
+ this.loadData2(1)
+ },
+ searchReset2: function () {
+ this.queryParam2 = {}
+ this.loadData2(1)
+ },
+ handleTableChange2: function (pagination, filters, sorter) {
+ //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂
+ if (Object.keys(sorter).length > 0) {
+ this.iSorter2.column = sorter.field
+ this.iSorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+ }
+ this.iPagination2 = pagination
+ this.loadData2()
+ },
+ onClearSelected2: function () {
+ this.selectedRowKeys2 = []
+ this.selectionRows2 = []
+ },
+ loadData(arg) {
+ if (!this.url.list) {
+ this.$message.error("璇疯缃畊rl.list灞炴��!")
+ return
+ }
+ //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+ if (arg === 1) {
+ this.ipagination.current = 1;
+ }
+ var params = this.getQueryParams();//鏌ヨ鏉′欢
+ if (!params) {
+ return false;
+ }
+ this.loading = true;
+ getAction(this.url.list, params).then((res) => {
+ if (res.success) {
+ // console.log(res)
+ //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+ this.dataSource = res.result.records || res.result;
+ if (res.result.total) {
+ this.ipagination.total = res.result.total;
} else {
- that.$message.warning(res.message)
+ this.ipagination.total = 0;
}
- })
- },
- batchDel2: function() {
- if (!this.url.deleteBatch2) {
- this.$message.error('璇疯缃畊rl.deleteBatch2灞炴��!')
- return
- }
- if (this.selectedRowKeys2.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
- return
+ //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
} else {
- var ids = ''
- for (var a = 0; a < this.selectedRowKeys2.length; a++) {
- ids += this.selectedRowKeys2[a] + ','
- }
- var that = this
- this.$confirm({
- title: '纭鍒犻櫎',
- content: '鏄惁鍒犻櫎閫変腑鏁版嵁?',
- onOk: function() {
- deleteAction(that.url.deleteBatch2, { spareRequisitionId: that.spareRequisitionId, spareRequisitionDetailIds: ids }).then((res) => {
- if (res.success) {
- that.$message.success(res.message)
- that.loadData2()
- that.onClearSelected2()
- } else {
- that.$message.warning(res.message)
- }
- })
- }
- })
+ this.$message.warning(res.message)
}
- },
- onClearSelected1() {
- this.selectedRowKeys1 = []
- this.selectionRows1 = []
- },
- handleConfirm(record) {
- if (!this.url.submit) {
- this.$message.error('璇疯缃畊rl.submit灞炴��!')
- return
+ }).finally(() => {
+ this.loading = false
+ })
+ },
+ loadData2: function (arg) {
+ if (!this.url.list2) {
+ this.$message.error('璇疯缃畊rl.list2灞炴��!')
+ return
+ }
+ //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+ if (arg === 1) {
+ this.iPagination2.current = 1
+ }
+ if (this.currentWorkshopId === '') return
+ let params = this.getQueryParams2() //鏌ヨ鏉′欢
+ params.spareRequisitionId = this.spareRequisitionId
+ this.loading2 = true
+ getAction(this.url.list2, params).then((res) => {
+ if (res.success) {
+ this.dataSource2 = res.result.records
+ this.iPagination2.total = res.result.total
+ } else {
+ this.dataSource2 = []
+ }
+ this.loading2 = false
+ })
+ },
+ getQueryParams2() {
+ //鑾峰彇鏌ヨ鏉′欢
+ let sqp = {}
+ if (this.superQueryParams2) {
+ sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
+ sqp['superQueryMatchType'] = this.superQueryMatchType2
+ }
+ var param = Object.assign(sqp, this.queryParam2, this.iSorter2, this.filters2)
+ param.field = this.getQueryField2()
+ param.pageNo = this.iPagination2.current
+ param.pageSize = this.iPagination2.pageSize
+ return filterObj(param)
+ },
+ getQueryField2() {
+ var str = 'id,'
+ this.columns2.forEach(function (value) {
+ str += ',' + value.dataIndex
+ })
+ return str
+ },
+ hideSpareDetailList: function () {
+ this.selectedRowKeys1 = []
+ },
+ handleEdit2: function (record) {
+ this.$refs.modalForm2.title = '缂栬緫'
+ // this.$refs.modalForm2.roleDisabled = true
+ this.$refs.modalForm2.edit(record)
+ },
+ handleAdd2: function () {
+ if (this.spareRequisitionId === '') {
+ this.$message.error('璇烽�夋嫨涓�涓璐崟!')
+ } else {
+ // this.$refs.modalForm2.roleDisabled = true
+ this.$refs.modalForm2.title = '鏂板'
+ this.$refs.modalForm2.edit({ selectedSpareRequisitions: this.spareRequisitionId })
+ }
+ },
+ handleDelete2: function (id) {
+ if (!this.url.delete2) {
+ this.$message.error('璇疯缃畊rl.delete2灞炴��!')
+ return
+ }
+ var that = this
+ deleteAction(that.url.delete2, { spareRequisitionId: this.spareRequisitionId, spareRequisitionDetailId: id }).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData2()
+ } else {
+ that.$message.warning(res.message)
+ }
+ })
+ },
+ batchDel2: function () {
+ if (!this.url.deleteBatch2) {
+ this.$message.error('璇疯缃畊rl.deleteBatch2灞炴��!')
+ return
+ }
+ if (this.selectedRowKeys2.length <= 0) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+ return
+ } else {
+ var ids = ''
+ for (var a = 0; a < this.selectedRowKeys2.length; a++) {
+ ids += this.selectedRowKeys2[a] + ','
}
var that = this
this.$confirm({
- title: '纭鎻愪氦',
- content: '纭畾鎻愪氦鍚�?',
- onOk: function() {
- postAction(that.url.submit, record).then((res) => {
+ title: '纭鍒犻櫎',
+ content: '鏄惁鍒犻櫎閫変腑鏁版嵁?',
+ onOk: function () {
+ deleteAction(that.url.deleteBatch2, { spareRequisitionId: that.spareRequisitionId, spareRequisitionDetailIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
- that.loadData()
- // that.onClearSelected1()
+ that.loadData2()
+ that.onClearSelected2()
} else {
that.$message.warning(res.message)
}
})
}
})
- },
- handleExamine: function (record) {
- this.$refs.modalExamine.examine(record);
- this.$refs.modalExamine.title = "瀹℃牳";
- this.$refs.modalExamine.disableSubmit = false;
- },
- modalFormOk2: function () {
- this.loadData()
}
+ },
+ onClearSelected1() {
+ this.selectedRowKeys1 = []
+ this.selectionRows1 = []
+ },
+ handleConfirm(record) {
+ setTimeout(() => {
+ this.loading = true
+ }, 100);
+
+ if (!this.url.submit) {
+ this.$message.error('璇疯缃畊rl.submit灞炴��!')
+ return
+ }
+ var that = this
+ // this.$confirm({
+ // title: '纭鎻愪氦',
+ // content: '纭畾鎻愪氦鍚�?',
+ // onOk: function () {
+
+ postAction(that.url.submit, record).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData()
+ // that.onClearSelected1()
+ } else {
+ that.$message.warning(res.message)
+ }
+ that.loading = false
+ })
+ // }
+ // })
+ this.loading = false
+ },
+ handleExamine: function (record) {
+ this.$refs.modalExamine.examine(record);
+ this.$refs.modalExamine.title = "瀹℃牳";
+ this.$refs.modalExamine.disableSubmit = false;
+ },
+ modalFormOk2: function () {
+ this.loadData()
}
}
+}
</script>
<style scoped>
- @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
</style>
\ No newline at end of file
--
Gitblit v1.9.3