| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postForm, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-cacheSite'; |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const searchParam = ref({ |
| | | siteNo: null, |
| | | siteStatus: null, |
| | | orderNo: null, |
| | | platformNo: null, |
| | | }) |
| | | const editChild = ref(null) |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | handleResizeColumn, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.man_cache_site.channel', '通道'), |
| | | dataIndex: 'channel', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('channel'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.site_no', '站点编号'), |
| | | dataIndex: 'siteNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('siteNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.site_status', '站点状态'), |
| | | dataIndex: 'siteStatus$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('siteStatus$'), |
| | | }, |
| | | // { |
| | | // title: formatMessage('db.man_cache_site.order_id', '订单ID'), |
| | | // dataIndex: 'orderId$', |
| | | // width: 140, |
| | | // ellipsis: true, |
| | | // ...getColumnSearchProps('orderId$'), |
| | | // }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.order_no', '订单编号'), |
| | | dataIndex: 'orderNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.platform_no', '集货编号'), |
| | | dataIndex: 'platformNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('platformNo'), |
| | | }, |
| | | // { |
| | | // title: formatMessage('db.man_cache_site.status', '状态'), |
| | | // dataIndex: 'status$', |
| | | // width: 140, |
| | | // ellipsis: true, |
| | | // ...getColumnSearchProps('status$'), |
| | | // }, |
| | | // { |
| | | // title: formatMessage('db.man_cache_site.create_time', '添加时间'), |
| | | // dataIndex: 'createTime$', |
| | | // width: 140, |
| | | // ellipsis: true, |
| | | // ...getColumnSearchProps('createTime$'), |
| | | // }, |
| | | // { |
| | | // title: formatMessage('db.man_cache_site.create_by', '添加人员'), |
| | | // dataIndex: 'createBy$', |
| | | // width: 140, |
| | | // ellipsis: true, |
| | | // ...getColumnSearchProps('createBy$'), |
| | | // }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_cache_site.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | | name: 'oper', |
| | | dataIndex: 'oper', |
| | | key: 'oper', |
| | | width: 340, |
| | | fixed: 'right', |
| | | }, |
| | | ]; |
| | | |
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0); |
| | | const start = () => { |
| | | state.loading = true; |
| | | // ajax request after empty completing |
| | | setTimeout(() => { |
| | | state.loading = false; |
| | | state.selectedRowKeys = []; |
| | | }, 1000); |
| | | }; |
| | | const onSelectChange = selectedRowKeys => { |
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys); |
| | | state.selectedRowKeys = selectedRowKeys; |
| | | }; |
| | | |
| | | function getPage() { |
| | | state.loading = true; |
| | | post('/api/cacheSite/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value, |
| | | _param: searchParam.value, |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | | let data = result.data; |
| | | tableData.value = data; |
| | | |
| | | state.loading = false; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleEdit = (item) => { |
| | | editChild.value.open = true; |
| | | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item)); |
| | | editChild.value.isSave = item == null; |
| | | } |
| | | |
| | | const handleDel = (rows) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.delete', '删除'), |
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/cacheSite/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleExport = async (intl) => { |
| | | postBlob('/api/cacheSite/export', {}).then(result => { |
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); |
| | | window.location.href = window.URL.createObjectURL(blob); |
| | | return true; |
| | | }) |
| | | }; |
| | | |
| | | const onSearch = () => { |
| | | // console.log('search'); |
| | | getPage() |
| | | } |
| | | |
| | | const onPageChange = (page, size) => { |
| | | currentPage = page; |
| | | pageSize = size; |
| | | getPage(); |
| | | } |
| | | |
| | | function handleTableReload(value) { |
| | | getPage() |
| | | } |
| | | |
| | | const openBindPlatform = ref(false); |
| | | const currentCacheSite = ref(null) |
| | | const platform = ref(null) |
| | | const platformQueryList = ref(null); |
| | | platformQuery(); |
| | | function platformQuery() { |
| | | postForm('/api/platform/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | platformQueryList.value = result.data; |
| | | |
| | | if (platformQueryList.value.length > 0) { |
| | | platform.value = platformQueryList.value[0]; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleBindPlatform = (item) => { |
| | | openBindPlatform.value = true; |
| | | currentCacheSite.value = item; |
| | | } |
| | | |
| | | const handleBindPlatformOk = (item) => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/cacheSite/bindPlatform', { |
| | | siteNo: currentCacheSite.value.siteNo, |
| | | platformId: platform.value.value, |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | console.log(result); |
| | | |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | openBindPlatform.value = false; |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | } |
| | | |
| | | function seedComplete(item) { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/cacheSite/seedComplete', { |
| | | siteNo: item.siteNo, |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | console.log(result); |
| | | |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | } |
| | | |
| | | const handleSeedComplete = (item) => { |
| | | if (item.platformId == null) { |
| | | message.error(formatMessage('page.cacheSite.bindPlatform.fail', '请先绑定集货区域编号')); |
| | | return; |
| | | } |
| | | |
| | | Modal.confirm({ |
| | | title: formatMessage('page.cacheSite.seedComplete', '播种完成'), |
| | | content: formatMessage('page.cacheSite.seedComplete.confirm', '确定播种完成吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | let resp = await post('/api/cacheSite/seedCompletePreview', { |
| | | siteNo: item.siteNo, |
| | | }) |
| | | let check = resp.data.data; |
| | | |
| | | if (check) { |
| | | seedComplete(item) |
| | | } else { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.notice', '通知'), |
| | | content: formatMessage('page.cacheSite.seedComplete.confirm', '订单未完成,是否继续?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | seedComplete(item) |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handlePlatformIn = (item) => { |
| | | if (item.platformId == null) { |
| | | message.error(formatMessage('page.cacheSite.bindPlatform.fail', '请先绑定集货区域编号')); |
| | | return; |
| | | } |
| | | |
| | | Modal.confirm({ |
| | | title: formatMessage('page.cacheSite.platformIn', '集货入库'), |
| | | content: formatMessage('page.cacheSite.platformIn.confirm', '确定集货入库吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/cacheSite/platformIn', { |
| | | siteNo: item.siteNo, |
| | | platformNo: 'A1' |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleEmptyIn = (item) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.cacheSite.emptyIn', '空托盘入站'), |
| | | content: formatMessage('page.cacheSite.emptyIn.confirm', '确定空托盘入站吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/cacheSite/emptyIn', { |
| | | siteNo: item.siteNo, |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '播种站点' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <EditView ref="editChild" @tableReload="handleTableReload" /> |
| | | <div class="table-header"> |
| | | <div> |
| | | <a-input v-model:value="searchParam.siteNo" |
| | | :placeholder="formatMessage('page.cacheSite.siteNo.input', '请输入站点编号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | <a-select v-model:value="searchParam.siteStatus" :options="[ |
| | | { label: '空站', value: 0 }, |
| | | { label: '满站', value: 1 }, |
| | | { label: '预约', value: 2 }, |
| | | ]" :placeholder="formatMessage('page.cacheSite.siteStatus.input', '请选择站点状态')" |
| | | style="width: 140px;margin-right: 10px;" allowClear> |
| | | </a-select> |
| | | <a-input v-model:value="searchParam.orderNo" |
| | | :placeholder="formatMessage('page.cacheSite.orderNo.input', '请输入订单号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | <a-input v-model:value="searchParam.platformNo" |
| | | :placeholder="formatMessage('page.cacheSite.platformNo.input', '请输入集货编号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | </div> |
| | | <div class="table-header-right"> |
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> |
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> |
| | | </div> |
| | | </div> |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" |
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :pagination="{ total: tableData.total, onChange: onPageChange }" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn" |
| | | :loading="state.loading"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'oper'"> |
| | | <div style="display: flex;justify-content: space-evenly;"> |
| | | <a-button v-if="record.platformId == null" type="link" primary @click="handleBindPlatform(record)">{{ |
| | | formatMessage('page.cacheSite.platform', '集货区域') }}</a-button> |
| | | <a-button type="link" primary @click="handleSeedComplete(record)">{{ |
| | | formatMessage('page.cacheSite.seedComplete', '播种完成') }}</a-button> |
| | | <a-button type="link" primary @click="handlePlatformIn(record)">{{ |
| | | formatMessage('page.cacheSite.platformIn', '集货入库') }}</a-button> |
| | | <a-button type="link" primary @click="handleEmptyIn(record)">{{ formatMessage('page.cacheSite.emptyIn', |
| | | '空托盘入站') }}</a-button> |
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button> |
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除') |
| | | }}</a-button> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <a-modal v-model:open="openBindPlatform" @ok="handleBindPlatformOk"> |
| | | <div style="display: flex;justify-content: center;align-items: center;"> |
| | | 绑定集货区域:<a-select v-model:value="platform" :options="platformQueryList" style="width: 100px;"></a-select> |
| | | </div> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
| | | <script setup>
|
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue';
|
| | | import { useRouter } from "vue-router";
|
| | | import { get, post, postForm, postBlob } from '@/utils/request.js'
|
| | | import { message, Modal } from 'ant-design-vue';
|
| | | import { logout } from '@/config.js';
|
| | | import EditView from './edit.vue'
|
| | | import { formatMessage } from '@/utils/localeUtils.js';
|
| | | import useTableSearch from '@/utils/tableUtils.jsx';
|
| | | const context = getCurrentInstance()?.appContext.config.globalProperties;
|
| | |
|
| | | const router = useRouter();
|
| | |
|
| | | const TABLE_KEY = 'table-cacheSite';
|
| | | let currentPage = 1;
|
| | | let pageSize = 10;
|
| | | const searchInput = ref("")
|
| | | const searchParam = ref({
|
| | | siteNo: null,
|
| | | siteStatus: null,
|
| | | orderNo: null,
|
| | | platformNo: null,
|
| | | })
|
| | | const editChild = ref(null)
|
| | |
|
| | | const state = reactive({
|
| | | selectedRowKeys: [],
|
| | | loading: false,
|
| | | });
|
| | |
|
| | | let tableData = ref([]);
|
| | | getPage();
|
| | |
|
| | | const {
|
| | | getColumnSearchProps,
|
| | | handleResizeColumn,
|
| | | } = useTableSearch();
|
| | |
|
| | | const columns = [
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.channel', '通道'),
|
| | | dataIndex: 'channel',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('channel'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.site_no', '站点编号'),
|
| | | dataIndex: 'siteNo',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('siteNo'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.site_status', '站点状态'),
|
| | | dataIndex: 'siteStatus$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('siteStatus$'),
|
| | | },
|
| | | // {
|
| | | // title: formatMessage('db.man_cache_site.order_id', '订单ID'),
|
| | | // dataIndex: 'orderId$',
|
| | | // width: 140,
|
| | | // ellipsis: true,
|
| | | // ...getColumnSearchProps('orderId$'),
|
| | | // },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.order_no', '订单编号'),
|
| | | dataIndex: 'orderNo',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('orderNo'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.platform_no', '集货编号'),
|
| | | dataIndex: 'platformNo',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('platformNo'),
|
| | | },
|
| | | // {
|
| | | // title: formatMessage('db.man_cache_site.status', '状态'),
|
| | | // dataIndex: 'status$',
|
| | | // width: 140,
|
| | | // ellipsis: true,
|
| | | // ...getColumnSearchProps('status$'),
|
| | | // },
|
| | | // {
|
| | | // title: formatMessage('db.man_cache_site.create_time', '添加时间'),
|
| | | // dataIndex: 'createTime$',
|
| | | // width: 140,
|
| | | // ellipsis: true,
|
| | | // ...getColumnSearchProps('createTime$'),
|
| | | // },
|
| | | // {
|
| | | // title: formatMessage('db.man_cache_site.create_by', '添加人员'),
|
| | | // dataIndex: 'createBy$',
|
| | | // width: 140,
|
| | | // ellipsis: true,
|
| | | // ...getColumnSearchProps('createBy$'),
|
| | | // },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.update_time', '修改时间'),
|
| | | dataIndex: 'updateTime$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('updateTime$'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.update_by', '修改人员'),
|
| | | dataIndex: 'updateBy$',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('updateBy$'),
|
| | | },
|
| | | {
|
| | | title: formatMessage('db.man_cache_site.memo', '备注'),
|
| | | dataIndex: 'memo',
|
| | | width: 140,
|
| | | ellipsis: true,
|
| | | ...getColumnSearchProps('memo'),
|
| | | },
|
| | |
|
| | | {
|
| | | title: formatMessage('common.operation', '操作'),
|
| | | name: 'oper',
|
| | | dataIndex: 'oper',
|
| | | key: 'oper',
|
| | | width: 340,
|
| | | fixed: 'right',
|
| | | },
|
| | | ];
|
| | |
|
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0);
|
| | | const start = () => {
|
| | | state.loading = true;
|
| | | // ajax request after empty completing
|
| | | setTimeout(() => {
|
| | | state.loading = false;
|
| | | state.selectedRowKeys = [];
|
| | | }, 1000);
|
| | | };
|
| | | const onSelectChange = selectedRowKeys => {
|
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys);
|
| | | state.selectedRowKeys = selectedRowKeys;
|
| | | };
|
| | |
|
| | | function getPage() {
|
| | | state.loading = true;
|
| | | post('/api/cacheSite/page', {
|
| | | current: currentPage,
|
| | | pageSize: pageSize,
|
| | | condition: searchInput.value,
|
| | | _param: searchParam.value,
|
| | | }).then((resp) => {
|
| | | let result = resp.data;
|
| | | if (result.code == 200) {
|
| | | let data = result.data;
|
| | | tableData.value = data;
|
| | |
|
| | | state.loading = false;
|
| | | } else if (result.code === 401) {
|
| | | message.error(result.msg);
|
| | | logout()
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | const handleEdit = (item) => {
|
| | | editChild.value.open = true;
|
| | | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
|
| | | editChild.value.isSave = item == null;
|
| | | }
|
| | |
|
| | | const handleDel = (rows) => {
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.delete', '删除'),
|
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/cacheSite/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
|
| | | let result = resp.data;
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | | const handleExport = async (intl) => {
|
| | | postBlob('/api/cacheSite/export', {}).then(result => {
|
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' });
|
| | | window.location.href = window.URL.createObjectURL(blob);
|
| | | return true;
|
| | | })
|
| | | };
|
| | |
|
| | | const onSearch = () => {
|
| | | // console.log('search');
|
| | | getPage()
|
| | | }
|
| | |
|
| | | const onPageChange = (page, size) => {
|
| | | currentPage = page;
|
| | | pageSize = size;
|
| | | getPage();
|
| | | }
|
| | |
|
| | | function handleTableReload(value) {
|
| | | getPage()
|
| | | }
|
| | |
|
| | | const openBindPlatform = ref(false);
|
| | | const currentCacheSite = ref(null)
|
| | | const platform = ref(null)
|
| | | const platformQueryList = ref(null);
|
| | | platformQuery();
|
| | | function platformQuery() {
|
| | | postForm('/api/platform/query', {}).then(resp => {
|
| | | let result = resp.data;
|
| | | platformQueryList.value = result.data;
|
| | |
|
| | | if (platformQueryList.value.length > 0) {
|
| | | platform.value = platformQueryList.value[0];
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | const handleBindPlatform = (item) => {
|
| | | openBindPlatform.value = true;
|
| | | currentCacheSite.value = item;
|
| | | }
|
| | |
|
| | | const handleBindPlatformOk = (item) => {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/cacheSite/bindPlatform', {
|
| | | siteNo: currentCacheSite.value.siteNo,
|
| | | platformId: platform.value.value,
|
| | | }).then(resp => {
|
| | | let result = resp.data;
|
| | | console.log(result);
|
| | |
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | openBindPlatform.value = false;
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | }
|
| | |
|
| | | function seedComplete(item) {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/cacheSite/seedComplete', {
|
| | | siteNo: item.siteNo,
|
| | | }).then(resp => {
|
| | | let result = resp.data;
|
| | | console.log(result);
|
| | |
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | }
|
| | |
|
| | | const handleSeedComplete = (item) => {
|
| | | if (item.platformId == null) {
|
| | | message.error(formatMessage('page.cacheSite.bindPlatform.fail', '请先绑定集货区域编号'));
|
| | | return;
|
| | | }
|
| | |
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.cacheSite.seedComplete', '播种完成'),
|
| | | content: formatMessage('page.cacheSite.seedComplete.confirm', '确定播种完成吗?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | let resp = await post('/api/cacheSite/seedCompletePreview', {
|
| | | siteNo: item.siteNo,
|
| | | })
|
| | | let check = resp.data.data;
|
| | |
|
| | | if (check) {
|
| | | seedComplete(item)
|
| | | } else {
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.notice', '通知'),
|
| | | content: formatMessage('page.cacheSite.seedComplete.confirm', '订单未完成,是否继续?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | seedComplete(item)
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | | const handlePlatformIn = (item) => {
|
| | | if (item.platformId == null) {
|
| | | message.error(formatMessage('page.cacheSite.bindPlatform.fail', '请先绑定集货区域编号'));
|
| | | return;
|
| | | }
|
| | |
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.cacheSite.platformIn', '集货入库'),
|
| | | content: formatMessage('page.cacheSite.platformIn.confirm', '确定集货入库吗?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/cacheSite/platformIn', {
|
| | | siteNo: item.siteNo,
|
| | | platformNo: 'A1'
|
| | | }).then(resp => {
|
| | | let result = resp.data;
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | | const handleEmptyIn = (item) => {
|
| | | Modal.confirm({
|
| | | title: formatMessage('page.cacheSite.emptyIn', '空托盘入站'),
|
| | | content: formatMessage('page.cacheSite.emptyIn.confirm', '确定空托盘入站吗?'),
|
| | | maskClosable: true,
|
| | | onOk: async () => {
|
| | | const hide = message.loading(formatMessage('common.loading', '请求中'));
|
| | | try {
|
| | | post('/api/cacheSite/emptyIn', {
|
| | | siteNo: item.siteNo,
|
| | | }).then(resp => {
|
| | | let result = resp.data;
|
| | | if (result.code === 200) {
|
| | | message.success(result.msg);
|
| | | } else {
|
| | | message.error(result.msg);
|
| | | }
|
| | | getPage()
|
| | | hide()
|
| | | })
|
| | | } catch (error) {
|
| | | message.error(formatMessage('common.fail', '请求失败'));
|
| | | }
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | | </script>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: '播种站点'
|
| | | }
|
| | | </script>
|
| | |
|
| | | <template>
|
| | | <div>
|
| | | <EditView ref="editChild" @tableReload="handleTableReload" />
|
| | | <div class="table-header">
|
| | | <div>
|
| | | <a-input v-model:value="searchParam.siteNo"
|
| | | :placeholder="formatMessage('page.cacheSite.siteNo.input', '请输入站点编号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-select v-model:value="searchParam.siteStatus" :options="[
|
| | | { label: '空站', value: 0 },
|
| | | { label: '满站', value: 1 },
|
| | | { label: '预约', value: 2 },
|
| | | ]" :placeholder="formatMessage('page.cacheSite.siteStatus.input', '请选择站点状态')"
|
| | | style="width: 140px;margin-right: 10px;" allowClear>
|
| | | </a-select>
|
| | | <a-input v-model:value="searchParam.orderNo"
|
| | | :placeholder="formatMessage('page.cacheSite.orderNo.input', '请输入订单号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | | <a-input v-model:value="searchParam.platformNo"
|
| | | :placeholder="formatMessage('page.cacheSite.platformNo.input', '请输入集货编号')"
|
| | | style="width: 140px;margin-right: 10px;" />
|
| | |
|
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
|
| | | style="width: 200px;" @search="onSearch" />
|
| | | </div>
|
| | | <div class="table-header-right">
|
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button>
|
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button>
|
| | | </div>
|
| | | </div>
|
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
|
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
|
| | | :pagination="{ total: tableData.total, onChange: onPageChange }"
|
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"
|
| | | :loading="state.loading">
|
| | | <template #bodyCell="{ column, text, record }">
|
| | | <template v-if="column.dataIndex === 'oper'">
|
| | | <div style="display: flex;justify-content: space-evenly;">
|
| | | <a-button v-if="record.platformId == null" type="link" primary @click="handleBindPlatform(record)">{{
|
| | | formatMessage('page.cacheSite.platform', '集货区域') }}</a-button>
|
| | | <a-button type="link" primary @click="handleSeedComplete(record)">{{
|
| | | formatMessage('page.cacheSite.seedComplete', '播种完成') }}</a-button>
|
| | | <a-button type="link" primary @click="handlePlatformIn(record)">{{
|
| | | formatMessage('page.cacheSite.platformIn', '集货入库') }}</a-button>
|
| | | <a-button type="link" primary @click="handleEmptyIn(record)">{{ formatMessage('page.cacheSite.emptyIn',
|
| | | '空托盘入站') }}</a-button>
|
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button>
|
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
|
| | | }}</a-button>
|
| | | </div>
|
| | | </template>
|
| | | </template>
|
| | | </a-table>
|
| | |
|
| | | <a-modal v-model:open="openBindPlatform" @ok="handleBindPlatformOk">
|
| | | <div style="display: flex;justify-content: center;align-items: center;">
|
| | | 绑定集货区域:<a-select v-model:value="platform" :options="platformQueryList" style="width: 100px;"></a-select>
|
| | | </div>
|
| | | </a-modal>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <style></style>
|