¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | :class="'cust-erp-sub-tab'" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{ x: 'calc(1400px + 50%)', y: 900 }" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | <span |
| | | slot="status" |
| | | slot-scope="text, record" |
| | | > |
| | | <span v-if="record.status == '0'">æªåºåº</span> |
| | | <span |
| | | v-if="record.status == '1'" |
| | | style="color: red" |
| | | >å·²åºåº</span> |
| | | </span> |
| | | <span |
| | | slot='action' |
| | | slot-scope='text, record' |
| | | > |
| | | <a-popconfirm |
| | | title="ç¹å»ç¡®è®¤åï¼å°ç´æ¥åºåºä¿®æ¹åºå?" |
| | | @confirm="() => handleOutbound(record)" |
| | | > |
| | | <a v-if="record.outboundStatus === '2' && record.status ==='0'">åºåº</a> |
| | | </a-popconfirm> |
| | | |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction, requestPut } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import Vue from 'vue' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | |
| | | export default { |
| | | name: "SparePartOutboundDetail", |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | Tooltip, |
| | | }, |
| | | props: { |
| | | sparePartOutboundId: { |
| | | type: String, |
| | | default: '-1', |
| | | required: false |
| | | } |
| | | }, |
| | | watch: { |
| | | sparePartOutboundId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!this.sparePartOutboundId) { |
| | | this.clearList() |
| | | } else { |
| | | this.queryParam['sparePartOutboundId'] = val; |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: "center", |
| | | dataIndex: 'status', |
| | | scopedSlots: { customRender: 'status' }, |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'num', |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | align: "center", |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: "center", |
| | | dataIndex: 'model', |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: "center", |
| | | dataIndex: 'specification', |
| | | |
| | | }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: "center", |
| | | dataIndex: 'batchNum', |
| | | |
| | | }, |
| | | { |
| | | title: 'åºåæ¥æ', |
| | | align: "center", |
| | | dataIndex: 'manufactureDate', |
| | | customRender: function (text) { |
| | | return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | |
| | | }, |
| | | { |
| | | title: 'ä¾åºå', |
| | | align: "center", |
| | | dataIndex: 'supplierName', |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: "center", |
| | | dataIndex: 'mainUnitName', |
| | | }, |
| | | { |
| | | title: 'åºåºæ°é', |
| | | align: "center", |
| | | dataIndex: 'outboundMainQuantity', |
| | | }, |
| | | { |
| | | title: 'åºåº', |
| | | align: "center", |
| | | dataIndex: 'warehouseAreaName', |
| | | }, |
| | | { |
| | | title: 'åºä½', |
| | | align: "center", |
| | | dataIndex: 'warehouseLocationNum', |
| | | }, |
| | | // { |
| | | // title: 'è¾
åä½', |
| | | // align: "center", |
| | | // dataIndex: 'auxiliaryUnitName', |
| | | // }, |
| | | // { |
| | | // title: 'åºåºè¾
æ°é', |
| | | // align: "center", |
| | | // dataIndex: 'outboundAuxiliaryUnitName', |
| | | // }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | scopedSlots: { customRender: 'action' }, |
| | | width: 150, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/spare/sparePartOutboundDetail/getSparePartOutboundDetailsById", |
| | | outbound: "/spare/sparePartOutboundDetail/sparePartOutbound", |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: { |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | handleOutbound(record) { |
| | | const that = this; |
| | | requestPut(that.url.outbound, record).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("åºåºæå!") |
| | | that.$bus.$emit('outboundSuccess', 1) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning("åºåºå¤±è´¥!") |
| | | } |
| | | }) |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | 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 |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |