diff --git a/src/views/wms/wmsShippingBill/index.vue b/src/views/wms/wmsShippingBill/index.vue
index 8b90100..05a6490 100644
--- a/src/views/wms/wmsShippingBill/index.vue
+++ b/src/views/wms/wmsShippingBill/index.vue
@@ -65,12 +65,26 @@
新增
- 修改
- 删除
@@ -125,32 +139,58 @@
-
+
+
+
+
+ 附件{{ index + 1 }}
+
+
+ 暂无附件
+
+
+
{{ proxy?.parseTime(scope.row.planArrivalTime, '{y}-{m}-{d}') }}
-
+
{{ proxy?.parseTime(scope.row.shippingTime, '{y}-{m}-{d}') }}
-
+
{{ proxy?.parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
-
+
-
-
-
-
+
-
+
+
+
+
+
+
+
+
@@ -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>([]);
+const selectedRows = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
@@ -333,9 +376,10 @@ const columns = ref([
{ 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>({
const { queryParams, form, rules } = toRefs(data);
const arrivalConfirmTimeRange = ref();
+const approvalRecordRef = ref>();
+
+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];