|
|
|
|
@ -65,12 +65,26 @@
|
|
|
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['wms:wmsShippingBill:add']">新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['wms:wmsShippingBill:edit']"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="!hideBatchEditDeleteButtons"
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="Edit"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate()"
|
|
|
|
|
v-hasPermi="['wms:wmsShippingBill:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['wms:wmsShippingBill:remove']"
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="!hideBatchEditDeleteButtons"
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="Delete"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete()"
|
|
|
|
|
v-hasPermi="['wms:wmsShippingBill:remove']"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -125,32 +139,58 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="到货确认人" align="center" prop="arrivalConfirmByName" width="110" show-overflow-tooltip v-if="columns[12].visible" />
|
|
|
|
|
<el-table-column label="计划到货时间" align="center" prop="planArrivalTime" width="110" v-if="columns[13].visible">
|
|
|
|
|
<el-table-column label="收货单附件" align="center" min-width="160" v-if="columns[13].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<template v-if="getArrivalReceiptOssIds(scope.row).length > 0">
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(ossId, index) in getArrivalReceiptOssIds(scope.row)"
|
|
|
|
|
:key="`${scope.row.shippingBillId}-${ossId}`"
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="Download"
|
|
|
|
|
@click="downloadArrivalReceipt(ossId)"
|
|
|
|
|
>
|
|
|
|
|
附件{{ index + 1 }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<span v-else style="color: #999">暂无附件</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划到货时间" align="center" prop="planArrivalTime" width="110" v-if="columns[14].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ proxy?.parseTime(scope.row.planArrivalTime, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="实际发货时间" align="center" prop="shippingTime" width="110" v-if="columns[14].visible">
|
|
|
|
|
<el-table-column label="实际发货时间" align="center" prop="shippingTime" width="110" v-if="columns[15].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ proxy?.parseTime(scope.row.shippingTime, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="110" v-if="columns[15].visible">
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="110" v-if="columns[16].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ proxy?.parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="220" class-name="small-padding fixed-width">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tooltip content="查看" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['wms:wmsShippingBill:query']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="修改" placement="top">
|
|
|
|
|
<el-tooltip v-if="isEditableFlowStatus(scope.row)" content="修改" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['wms:wmsShippingBill:edit']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-tooltip v-if="shouldShowViewButton(scope.row)" content="查看" placement="top">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="info"
|
|
|
|
|
icon="DocumentChecked"
|
|
|
|
|
@click="handleView(scope.row)"
|
|
|
|
|
v-hasPermi="['wms:wmsShippingBill:query']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip v-if="isEditableFlowStatus(scope.row)" content="删除" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['wms:wmsShippingBill:remove']"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip v-if="shouldShowApprovalRecord(scope.row)" content="审批记录" placement="top">
|
|
|
|
|
<el-button link type="warning" icon="Histogram" @click="handleApprovalRecord(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="打印" placement="top">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
@ -166,6 +206,7 @@
|
|
|
|
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
</el-card>
|
|
|
|
|
<ApprovalRecord ref="approvalRecordRef" />
|
|
|
|
|
<!-- 添加或修改发货单对话框 -->
|
|
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="wmsShippingBillFormRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
@ -292,6 +333,7 @@ import {
|
|
|
|
|
updateWmsShippingBill
|
|
|
|
|
} from '@/api/wms/wmsShippingBill';
|
|
|
|
|
import { WmsShippingBillForm, WmsShippingBillQuery, WmsShippingBillVO } from '@/api/wms/wmsShippingBill/types';
|
|
|
|
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
@ -306,6 +348,7 @@ const buttonLoading = ref(false);
|
|
|
|
|
const loading = ref(true);
|
|
|
|
|
const showSearch = ref(true);
|
|
|
|
|
const ids = ref<Array<string | number>>([]);
|
|
|
|
|
const selectedRows = ref<WmsShippingBillVO[]>([]);
|
|
|
|
|
const single = ref(true);
|
|
|
|
|
const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
@ -333,9 +376,10 @@ const columns = ref<FieldOption[]>([
|
|
|
|
|
{ key: 10, label: '到货标识', visible: true },
|
|
|
|
|
{ key: 11, label: '到货确认时间', visible: true },
|
|
|
|
|
{ key: 12, label: '到货确认人', visible: false },
|
|
|
|
|
{ key: 13, label: '计划到货时间', visible: true },
|
|
|
|
|
{ key: 14, label: '实际发货时间', visible: true },
|
|
|
|
|
{ key: 15, label: '创建时间', visible: false }
|
|
|
|
|
{ key: 13, label: '收货单附件', visible: true },
|
|
|
|
|
{ key: 14, label: '计划到货时间', visible: true },
|
|
|
|
|
{ key: 15, label: '实际发货时间', visible: true },
|
|
|
|
|
{ key: 16, label: '创建时间', visible: false }
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const initFormData: WmsShippingBillForm = {
|
|
|
|
|
@ -428,6 +472,33 @@ const data = reactive<PageData<WmsShippingBillForm, WmsShippingBillQuery>>({
|
|
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
const arrivalConfirmTimeRange = ref<string[]>();
|
|
|
|
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
|
|
|
|
|
|
|
|
|
const isEditableFlowStatus = (row?: WmsShippingBillVO) => {
|
|
|
|
|
const flowStatus = String(row?.flowStatus || '').trim();
|
|
|
|
|
return !flowStatus || flowStatus === 'draft' || flowStatus === 'back' || flowStatus === 'cancel';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const shouldShowViewButton = (row?: WmsShippingBillVO) => !isEditableFlowStatus(row);
|
|
|
|
|
|
|
|
|
|
const shouldShowApprovalRecord = (row?: WmsShippingBillVO) => {
|
|
|
|
|
const flowStatus = String(row?.flowStatus || '').trim();
|
|
|
|
|
return !!flowStatus && flowStatus !== 'draft';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getArrivalReceiptOssIds = (row?: WmsShippingBillVO) => {
|
|
|
|
|
const ossIds = String(row?.arrivalReceiptOssId || '')
|
|
|
|
|
.split(',')
|
|
|
|
|
.map((item) => item.trim())
|
|
|
|
|
.filter((item) => item.length > 0);
|
|
|
|
|
return Array.from(new Set(ossIds));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const downloadArrivalReceipt = (ossId: string) => {
|
|
|
|
|
proxy?.$download.oss(ossId as any);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const hideBatchEditDeleteButtons = computed(() => selectedRows.value.some((item) => !isEditableFlowStatus(item)));
|
|
|
|
|
|
|
|
|
|
/** 查询发货单列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -475,6 +546,7 @@ const resetQuery = () => {
|
|
|
|
|
|
|
|
|
|
/** 多选框选中数据 */
|
|
|
|
|
const handleSelectionChange = (selection: WmsShippingBillVO[]) => {
|
|
|
|
|
selectedRows.value = selection;
|
|
|
|
|
ids.value = selection.map((item) => item.shippingBillId);
|
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
|
@ -490,6 +562,12 @@ const handleView = (row: WmsShippingBillVO) => {
|
|
|
|
|
router.push({ path: '/shipping/wmsShippingBill/edit', query: { type: 'view', id: row.shippingBillId } });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 审批记录 */
|
|
|
|
|
const handleApprovalRecord = (row: WmsShippingBillVO) => {
|
|
|
|
|
// 为什么这样做:审批记录只依赖业务单ID,列表页直接打开记录弹窗能减少用户在详情页来回跳转
|
|
|
|
|
approvalRecordRef.value?.init(row.shippingBillId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
const handleUpdate = async (row?: WmsShippingBillVO) => {
|
|
|
|
|
const _shippingBillId = row?.shippingBillId || ids.value[0];
|
|
|
|
|
|