| | |
| | | <template> |
| | | <template > |
| | | <a-row :gutter="10"> |
| | | <a-col |
| | | :md="leftColMd" |
| | |
| | | type="primary" |
| | | icon="plus" |
| | | >新增</a-button> |
| | | <a-button |
| | | <!-- <a-button |
| | | type="primary" |
| | | icon="download" |
| | | @click="handleExportXls('备件请购单')" |
| | |
| | | type="primary" |
| | | icon="import" |
| | | >导入</a-button> |
| | | </a-upload> |
| | | </a-upload> --> |
| | | </div> |
| | | |
| | | <!-- table区域-begin --> |
| | |
| | | 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 @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-menu-item> |
| | | <a @click="handleConfirm(record)">提交</a> |
| | | </a-menu-item> |
| | | </a-menu-item> --> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | </a-menu-item> |
| | |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | <a |
| | | <!-- <a |
| | | v-if="record.requisitionStatus === '2'" |
| | | @click="handleExamine(record)" |
| | | >审核</a> |
| | | >审核</a> --> |
| | | </span> |
| | | |
| | | </a-table> |
| | |
| | | @ok="modalFormOk" |
| | | ></eamSparePartRequisition-modal> |
| | | |
| | | <eamSparePartRequisitionExamine-modal |
| | | <!-- <eamSparePartRequisitionExamine-modal |
| | | ref="modalExamine" |
| | | @ok="modalFormOk2" |
| | | ></eamSparePartRequisitionExamine-modal> |
| | | ></eamSparePartRequisitionExamine-modal> --> |
| | | |
| | | </a-card> |
| | | </a-col> |
| | |
| | | :sm="24" |
| | | v-if="this.rightColVal === 1" |
| | | > |
| | | <a-card :bordered="false"> |
| | | <div style="text-align: right;"> |
| | | <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 |
| | |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <div |
| | | <!-- <div |
| | | class="table-operator" |
| | | :md="24" |
| | | :sm="24" |
| | |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <!-- table区域-begin --> |
| | | <!-- table区域-begin |
| | | <div> |
| | | <div |
| | | class="ant-alert ant-alert-info" |
| | |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected2" |
| | | >清空</a> |
| | | </div> |
| | | </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" |
| | | > |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm @click="handleEdit2(record)"> |
| | | <a>编辑</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | title="确定删除吗?" |
| | | @confirm="() => handleDelete2(record.id)" |
| | | > |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm @click="handleEdit2(record)"> |
| | | <a>编辑</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | title="确定删除吗?" |
| | | @confirm="() => handleDelete2(record.id)" |
| | | > |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- table区域-end --> |
| | | </a-card> |
| | | </a-col> |
| | |
| | | <script> |
| | | import '@assets/less/TableExpand.less' |
| | | import EamSparePartRequisitionModal from './modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue' |
| | | import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.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' |
| | |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamSparePartRequisitionModal, |
| | | EamSparePartRequisitionExamineModal |
| | | // EamSparePartRequisitionExamineModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '请购单号', |
| | | align: "center", |
| | | dataIndex: 'requisitionCode' |
| | |
| | | // 子表表头 |
| | | columns2: [ |
| | | { |
| | | title: '备品备件ID', |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '备品编码', |
| | | align: "center", |
| | | dataIndex: 'partId' |
| | | 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' }, |
| | | } |
| | | // { |
| | | // title: '操作', |
| | | // dataIndex: 'action', |
| | | // align: "center", |
| | | // scopedSlots: { customRender: 'action' }, |
| | | // } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSparePartRequisition/list", |
| | |
| | | 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: () => { |
| | | click: () => { |
| | | this.handleOpen(record) |
| | | } |
| | | } |
| | |
| | | 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) |
| | | }, |
| | |
| | | onClearSelected2: function () { |
| | | this.selectedRowKeys2 = [] |
| | | this.selectionRows2 = [] |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.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 { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | loadData2: function (arg) { |
| | | if (!this.url.list2) { |
| | |
| | | this.selectionRows1 = [] |
| | | }, |
| | | handleConfirm(record) { |
| | | setTimeout(() => { |
| | | this.loading = true |
| | | }, 100); |
| | | |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.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) |
| | | } |
| | | }) |
| | | // 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); |