提交 16b88d61 authored 作者: 袁伟伟's avatar 袁伟伟

fix: 批量订单权限设置

上级 664c9a46
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<span v-if="p.key === 'avatar'"> <span v-if="p.key === 'avatar'">
<ImagePreview :imageList="[p.value]" style="width: 120px" /> <ImagePreview :imageList="[p.value]" style="width: 120px" />
</span> </span>
<template v-else-if="p.key === 'logisticsMode'">
{{ logisticsLabelEnum[p.value] }}
</template>
<template v-else> <template v-else>
{{ p.value }} {{ p.value }}
</template> </template>
...@@ -83,6 +86,7 @@ ...@@ -83,6 +86,7 @@
import { toNumber } from 'lodash'; import { toNumber } from 'lodash';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { logisticsLabelEnum } from '/@/views/order/enum';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
......
...@@ -24,13 +24,16 @@ ...@@ -24,13 +24,16 @@
</template> </template>
</a-alert> </a-alert>
</template> </template>
<template #toolbar> <!-- <template #toolbar>
<a-button v-auth="'AUTH_BATCH_ORDER:ADD'" type="primary" @click="handleCreate"> 新增</a-button> <a-button v-auth="'AUTH_BATCH_ORDER:ADD'" type="primary" @click="handleCreate"> 新增</a-button>
</template> </template> -->
<template #bodyCell="{ column, record, text }"> <template #bodyCell="{ column, record, text }">
<template v-if="[].includes(column.dataIndex)"> <template v-if="[].includes(column.dataIndex)">
<img :src="text" class="photo" alt="图片" v-if="!!text" /> <img :src="text" class="photo" alt="图片" v-if="!!text" />
</template> </template>
<template v-if="column.dataIndex === 'logisticsMode'">
{{ logisticsLabelEnum[record.logisticsMode] }}
</template>
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
...@@ -48,7 +51,7 @@ ...@@ -48,7 +51,7 @@
title: '是否确认通过', title: '是否确认通过',
confirm: handleVerify.bind(null, record, 'PASSED'), confirm: handleVerify.bind(null, record, 'PASSED'),
}, },
ifShow: hasPermission('AUTH_BATCH_ORDER:CHECK') && record.status === 'PENDING_REVIEW' && isDistributor, ifShow: hasPermission('AUTH_BATCH_ORDER:CHECK') && record.status === 'PENDING_REVIEW',
}, },
{ {
label: '拒绝', label: '拒绝',
...@@ -57,7 +60,7 @@ ...@@ -57,7 +60,7 @@
title: '是否确认拒绝', title: '是否确认拒绝',
confirm: handleVerify.bind(null, record, 'REJECT'), confirm: handleVerify.bind(null, record, 'REJECT'),
}, },
ifShow: hasPermission('AUTH_BATCH_ORDER:CHECK') && record.status === 'PENDING_REVIEW' && isDistributor, ifShow: hasPermission('AUTH_BATCH_ORDER:CHECK') && record.status === 'PENDING_REVIEW',
}, },
{ {
tooltip: '详情', tooltip: '详情',
...@@ -86,13 +89,14 @@ ...@@ -86,13 +89,14 @@
import BatchOrderDrawer from './drawer.vue'; import BatchOrderDrawer from './drawer.vue';
import { columns, searchFormSchema } from './schema'; import { columns, searchFormSchema } from './schema';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { logisticsLabelEnum } from '/@/views/order/enum';
const { hasPermission } = usePermission(); const { hasPermission } = usePermission();
const go = useGo(); const go = useGo();
const userStore = useUserStore(); const userStore = useUserStore();
const { formConfig, showTableSetting, bordered, showIndexColumn } = componentSetting.table; const { formConfig, showTableSetting, bordered, showIndexColumn } = componentSetting.table;
const isDistributor = userStore.getIsDistributor; // const isDistributor = userStore.getIsDistributor;
const checkedKeys = ref<Array<string | number>>([]); const checkedKeys = ref<Array<string | number>>([]);
const onSelectChange = (selectedRowKeys: (string | number)[]) => { const onSelectChange = (selectedRowKeys: (string | number)[]) => {
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
<span v-if="p.key === 'avatar'"> <span v-if="p.key === 'avatar'">
<ImagePreview :imageList="[p.value]" style="width: 120px" /> <ImagePreview :imageList="[p.value]" style="width: 120px" />
</span> </span>
<template v-else-if="p.key === 'logisticsMode'">
{{ logisticsLabelEnum[p.value] }}
</template>
<template v-else> <template v-else>
{{ p.value }} {{ p.value }}
</template> </template>
...@@ -60,6 +63,7 @@ ...@@ -60,6 +63,7 @@
import { detailColumns } from '/@/views/order/batch-work-order/schema'; import { detailColumns } from '/@/views/order/batch-work-order/schema';
import { BatchOrderDetail } from '/@/api/model/batchOrderDetail'; import { BatchOrderDetail } from '/@/api/model/batchOrderDetail';
import { BatchWorkOrder } from '/@/api/model/batchWorkOrder'; import { BatchWorkOrder } from '/@/api/model/batchWorkOrder';
import { logisticsLabelEnum } from '/@/views/order/enum';
const route = useRoute(); const route = useRoute();
const id = ref(route.params?.id); const id = ref(route.params?.id);
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<div class="tableWrap"> <div class="tableWrap">
<div class="titleWrap"> <div class="titleWrap">
<span class="title">发货单列表</span> <span class="title">发货单列表</span>
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" v-if="hasPermission('AUTH_ORDER_BATCH_WORK_ORDER:ADD')" @click="handleAdd"
>新增</a-button
>
</div> </div>
<a-table <a-table
:dataSource="dataSource" :dataSource="dataSource"
...@@ -47,18 +49,21 @@ ...@@ -47,18 +49,21 @@
<template v-if="column.key === 'saleUserName'"> <template v-if="column.key === 'saleUserName'">
{{ record.batchOrder.saleUserName }} {{ record.batchOrder.saleUserName }}
</template> </template>
<template v-if="column.dataIndex === 'logisticsMode'">
{{ logisticsLabelEnum[record.logisticsMode] }}
</template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-button type="link" @click="handleView(record)">查看</a-button> <a-button type="link" @click="handleView(record)">查看</a-button>
<!-- <a-button type="link" @click="handleEdit(record.id)">编辑</a-button> <!-- <a-button type="link" @click="handleEdit(record.id)">编辑</a-button> -->
<a-popconfirm <a-popconfirm
title="是否确认删除?" title="是否确认收货?"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@confirm="handleDelete(record.id)" @confirm="handleReceipt(record.id)"
v-if="hasPermission('AUTH_PRODUCT_GOODS_CATEGORY:DELETE')" v-if="hasPermission('AUTH_ORDER_BATCH_WORK_ORDER:RECEIPT') && record.status == 'DELIVERED'"
> >
<a-button type="link">删除</a-button> <a-button type="link">确认收货</a-button>
</a-popconfirm> --> </a-popconfirm>
</template> </template>
</template> </template>
</a-table> </a-table>
...@@ -75,15 +80,23 @@ ...@@ -75,15 +80,23 @@
import Modal from './modal.vue'; import Modal from './modal.vue';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { StatusEnum } from '/@/views/order/batch-order/schema'; import { StatusEnum } from '/@/views/order/batch-order/schema';
import { usePermission } from '/@/hooks/web/usePermission';
import { useGo } from '/@/hooks/web/usePage'; import { useGo } from '/@/hooks/web/usePage';
import { logisticsLabelEnum } from '/@/views/order/enum';
interface FormStateType {
createTimeFrom: undefined | Date;
createTimeTo: undefined | Date;
}
const go = useGo(); const go = useGo();
const { hasPermission } = usePermission();
const formRef = ref(); const formRef = ref();
const modalRef = ref(); const modalRef = ref();
const tableLoading = ref(false); const tableLoading = ref(false);
const formState = reactive({ const formState = reactive<FormStateType>({
createTimeFrom: undefined, createTimeFrom: undefined,
createTimeTo: undefined, createTimeTo: undefined,
}); });
...@@ -119,10 +132,18 @@ ...@@ -119,10 +132,18 @@
go('/main/batch-work-order/detail/' + record.id + `?order=${record.batchOrderId}`); go('/main/batch-work-order/detail/' + record.id + `?order=${record.batchOrderId}`);
}; };
const onChangeTime = (data) => { const onChangeTime = (data: Date[] | undefined) => {
formState.createTimeFrom = data && data[0]; formState.createTimeFrom = data && data[0];
formState.createTimeTo = data && data[1]; formState.createTimeTo = data && data[1];
}; };
const handleReceipt = (id: number) => {
BatchWorkOrderApi.update({ id, status: 'CONFIRM' }).then((res) => {
message.success('确认成功');
getData();
});
};
// const handleEdit = (id) => { // const handleEdit = (id) => {
// editId.value = id; // editId.value = id;
// handleAdd(); // handleAdd();
......
<template> <template>
<a-modal <a-modal
v-model:visible="visible" v-model:visible="visible"
:title="props.editId ? '编辑' : '新增'" title="新增"
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
class="myModal" class="myModal"
...@@ -86,8 +86,7 @@ ...@@ -86,8 +86,7 @@
import { Distributor } from '/@/api/model/distributor'; import { Distributor } from '/@/api/model/distributor';
import { BatchOrderDetail } from '/@/api/model/batchOrderDetail'; import { BatchOrderDetail } from '/@/api/model/batchOrderDetail';
const props = defineProps(['editId']); const emits = defineEmits(['handleSuccess']);
const emits = defineEmits(['handleSuccess', 'update:editId']);
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const okLoading = ref(false); const okLoading = ref(false);
...@@ -119,6 +118,7 @@ ...@@ -119,6 +118,7 @@
BatchWorkOrderApi.addInvoice(orderClone) BatchWorkOrderApi.addInvoice(orderClone)
.then(() => { .then(() => {
message.success('新建成功'); message.success('新建成功');
emits('handleSuccess');
handleCancel(); handleCancel();
}) })
.finally(() => { .finally(() => {
......
...@@ -74,7 +74,7 @@ export const columns = [ ...@@ -74,7 +74,7 @@ export const columns = [
title: '操作', title: '操作',
key: 'action', key: 'action',
fixed: 'right', fixed: 'right',
width: 100, width: 180,
align: 'center', align: 'center',
}, },
]; ];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论