¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 :md="6" :sm="8"> |
| | | <a-form-item label="é¢ç¨åç¶æ"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©é¢ç¨åç¶æ" |
| | | v-model="queryParam.orderStatus" |
| | | dict="order_status" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="é¢ç¨äºº"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©é¢ç¨äºº" |
| | | v-model="queryParam.receiver" |
| | | dict="sys_user,realname,id,del_flag!=1" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <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> |
| | | </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> --> |
| | | </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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <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" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | |
| | | <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="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 @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>--> |
| | | <!-- </span>--> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" :disabled="record.orderStatus === '2' || record.orderStatus === '3'">ç¼è¾</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 @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '1'"> |
| | | <a @click="handleSubmit(record.id)" :disabled="record.orderStatus === '3'">æäº¤</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '1'"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '2'"> |
| | | <a @click="handleBack(record.id)">å½è¿</a> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·é¢ç¨æç»" key="1"> |
| | | <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <cutting-receive-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingReceiveModal from './modules/CuttingReceiveModal' |
| | | import CuttingReceiveDetailList from './CuttingReceiveDetailList' |
| | | import { httpAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'CuttingReceiveList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | CuttingReceiveModal, |
| | | CuttingReceiveDetailList |
| | | }, |
| | | 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: 'receiver_dictText' |
| | | }, |
| | | { |
| | | title: 'é¢ç¨æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'receiveTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'é¢ç¨è¯´æ', |
| | | align: 'center', |
| | | dataIndex: 'receiveComment' |
| | | }, |
| | | { |
| | | title: '确认人', |
| | | align: 'center', |
| | | dataIndex: 'confirmer_dictText' |
| | | }, |
| | | { |
| | | title: '确认æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'confirmTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: '确认æè§', |
| | | align: 'center', |
| | | dataIndex: 'confirmComment' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ä¼å½è¿', |
| | | align: 'center', |
| | | dataIndex: 'returnFlag' |
| | | }, |
| | | { |
| | | title: 'å½è¿æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'returnTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'å½è¿è¯´æ', |
| | | align: 'center', |
| | | dataIndex: 'returnComment' |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤äºº', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmer_dictText' |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤æè§', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmComment' |
| | | }, |
| | | { |
| | | title: 'é¢ç¨åç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'orderStatus_dictText' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/cms/cuttingReceive/list', |
| | | delete: '/cms/cuttingReceive/delete', |
| | | deleteBatch: '/cms/cuttingReceive/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingReceive/exportXls', |
| | | importExcelUrl: 'cms/cuttingReceive/importExcel', |
| | | submit: '/cms/cuttingReceive/submit', |
| | | returnBack: '/cms/cuttingReceive/handleBack' |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.$refs.cuttingReceiveDetailList.dataSource = [] |
| | | this.loadData(1) |
| | | }, |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleDetail: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = '详æ
' |
| | | this.$refs.modalForm.disableSubmit = true |
| | | }, |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getToolingStorageData', record) |
| | | //ç¹å»å½åè¡åè² |
| | | let oldList = document.querySelectorAll('.checked-td-of-add-table') |
| | | if (oldList) { |
| | | for (let j = 0; j < oldList.length; j++) { |
| | | oldList[j].classList.remove('checked-td-of-add-table') |
| | | } |
| | | } |
| | | let children = e.target.parentNode.children |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * åæ®æäº¤ |
| | | */ |
| | | handleSubmit: function(id) { |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit屿§!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | |
| | | const that = this |
| | | |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0) |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide() // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide() // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åæ®é¢ç¨ |
| | | */ |
| | | |
| | | handleBack: function(id) { |
| | | if (!this.url.returnBack) { |
| | | this.$message.error('请设置url.return屿§!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.returnBack + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | |
| | | const that = this |
| | | |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0) |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide() // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide() // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |