|
@@ -3,15 +3,24 @@
|
|
|
<up-form class="p-rtv bg-#fff" labelPosition="top" :model="form" errorType="toast" :rules="rules" labelWidth="auto" ref="upFormUpRef">
|
|
<up-form class="p-rtv bg-#fff" labelPosition="top" :model="form" errorType="toast" :rules="rules" labelWidth="auto" ref="upFormUpRef">
|
|
|
<view class="f-s-24 c-#999">导出追溯码仅支持导出追溯码地址用于喷印或排版好追溯码PDF文件直接打印。如有疑问,请。如有疑问,请<span class="c-primary">点击此处联系客服</span>。</view>
|
|
<view class="f-s-24 c-#999">导出追溯码仅支持导出追溯码地址用于喷印或排版好追溯码PDF文件直接打印。如有疑问,请。如有疑问,请<span class="c-primary">点击此处联系客服</span>。</view>
|
|
|
<slot name="fileType"></slot>
|
|
<slot name="fileType"></slot>
|
|
|
- <ut-action-sheet v-model="form.extraInfo.fileType" :tabs="pt_code_export_type" @change="changeExtraFileType" mode="custom" title="请选择导出类型">
|
|
|
|
|
|
|
+ <template v-if="opts.id">
|
|
|
<up-form-item borderBottom label="导出类型" required prop="extraInfo.fileType">
|
|
<up-form-item borderBottom label="导出类型" required prop="extraInfo.fileType">
|
|
|
<view v-if="form.extraInfo?.fileType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_code_export_type, form.extraInfo.fileType) }}</view>
|
|
<view v-if="form.extraInfo?.fileType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_code_export_type, form.extraInfo.fileType) }}</view>
|
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择导出类型</view>
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择导出类型</view>
|
|
|
- <template #right>
|
|
|
|
|
- <up-icon size="22rpx" color="#37A954" name="arrow-down-fill"></up-icon>
|
|
|
|
|
- </template>
|
|
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
- </ut-action-sheet>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <ut-action-sheet v-model="form.extraInfo.fileType" :tabs="pt_code_export_type" @change="changeExtraFileType" mode="custom" title="请选择导出类型">
|
|
|
|
|
+ <up-form-item borderBottom label="导出类型" required prop="extraInfo.fileType">
|
|
|
|
|
+ <view v-if="form.extraInfo?.fileType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_code_export_type, form.extraInfo.fileType) }}</view>
|
|
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择导出类型</view>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ <up-icon size="22rpx" color="#37A954" name="arrow-down-fill"></up-icon>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-form-item>
|
|
|
|
|
+ </ut-action-sheet>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<template v-if="form.extraInfo.fileType == '2'">
|
|
<template v-if="form.extraInfo.fileType == '2'">
|
|
|
<slot name="logos"></slot>
|
|
<slot name="logos"></slot>
|
|
|
<up-form-item borderBottom prop="extraInfo.logos">
|
|
<up-form-item borderBottom prop="extraInfo.logos">
|
|
@@ -62,12 +71,22 @@
|
|
|
<!-- 导出数量 -->
|
|
<!-- 导出数量 -->
|
|
|
|
|
|
|
|
<slot name="printCount"></slot>
|
|
<slot name="printCount"></slot>
|
|
|
- <up-form-item :label="`导出数量`" prop="printCount" required borderBottom>
|
|
|
|
|
- <up-input v-model="form.printCount" placeholder="请输入导出数量" border="none" clearable></up-input>
|
|
|
|
|
- <template #right>
|
|
|
|
|
- <span class="f-s-30 f-w-5 c-#333">{{ opts?.unit || form?.unit || 'kg' }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </up-form-item>
|
|
|
|
|
|
|
+ <template v-if="opts.id">
|
|
|
|
|
+ <up-form-item :label="`导出数量`" prop="printCount" required borderBottom>
|
|
|
|
|
+ <up-input v-model="form.printCount" readonly placeholder="请输入导出数量" border="none" clearable></up-input>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ <span class="f-s-30 f-w-5 c-#333">{{ opts?.unit || form?.unit || 'kg' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <up-form-item :label="`导出数量`" prop="printCount" required borderBottom>
|
|
|
|
|
+ <up-input v-model="form.printCount" placeholder="请输入导出数量" border="none" clearable></up-input>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ <span class="f-s-30 f-w-5 c-#333">{{ opts?.unit || form?.unit || 'kg' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </up-form-item>
|
|
|
|
|
+ </template>
|
|
|
<!-- 邮箱 -->
|
|
<!-- 邮箱 -->
|
|
|
<slot name="email"></slot>
|
|
<slot name="email"></slot>
|
|
|
<up-form-item borderBottom required label="邮箱" prop="extraInfo.email">
|
|
<up-form-item borderBottom required label="邮箱" prop="extraInfo.email">
|
|
@@ -136,7 +155,7 @@ const emit = defineEmits(['next', 'prev', 'formdata']);
|
|
|
const form = ref<any>({
|
|
const form = ref<any>({
|
|
|
printCount: props.opts?.printedCount,
|
|
printCount: props.opts?.printedCount,
|
|
|
extraInfo: {
|
|
extraInfo: {
|
|
|
- fileType: '2',
|
|
|
|
|
|
|
+ fileType: '1',
|
|
|
fileFormat: '1',
|
|
fileFormat: '1',
|
|
|
logos: [], // 导出logo
|
|
logos: [], // 导出logo
|
|
|
// 只有禁用的默认有值,
|
|
// 只有禁用的默认有值,
|
|
@@ -236,18 +255,15 @@ const submitForm = async () => {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: '正在导出...',
|
|
title: '正在导出...',
|
|
|
});
|
|
});
|
|
|
- const payload = {
|
|
|
|
|
|
|
+ const payload = {
|
|
|
...props.opts,
|
|
...props.opts,
|
|
|
...form.value,
|
|
...form.value,
|
|
|
- printType: '2',
|
|
|
|
|
- printCount: form.value.extraInfo.fileType == '1' ? props.opts.printedCount : form.value.printCount,
|
|
|
|
|
- }
|
|
|
|
|
- const res = await useClientRequest.post('/plt-api/app/printLog/printNext', payload)
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ const res = props.opts?.id ? await useClientRequest.get(`/plt-api/app/printLog/update/${props.opts.id}`, payload?.extraInfo) : await useClientRequest.post('/plt-api/app/printLog/printNext', payload);
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
uni.$emit('refreshPackTaskList');
|
|
uni.$emit('refreshPackTaskList');
|
|
|
uni.$emit('refreshPackTaskDetail');
|
|
uni.$emit('refreshPackTaskDetail');
|
|
|
- await useClientRequest.get(`/plt-api/app/printLog/export/${res.data?.id}`)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ await useClientRequest.get(`/plt-api/app/printLog/export/${res.data?.id || props.opts?.id}`);
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '导出成功',
|
|
title: '导出成功',
|
|
@@ -266,16 +282,16 @@ const prevSteps = () => {
|
|
|
};
|
|
};
|
|
|
// getFormInfo
|
|
// getFormInfo
|
|
|
const getFormInfo = async () => {
|
|
const getFormInfo = async () => {
|
|
|
- if (!props.opts.id) return
|
|
|
|
|
- const res = await useClientRequest.get(`/plt-api/app/printLog/${props.opts.id}`);
|
|
|
|
|
|
|
+ if (!props.opts.id) return;
|
|
|
|
|
+ const res = await useClientRequest.get(`/plt-api/app/printLog/${props.opts.id}`);
|
|
|
if (res && res.code === 200) {
|
|
if (res && res.code === 200) {
|
|
|
form.value = {
|
|
form.value = {
|
|
|
...form.value,
|
|
...form.value,
|
|
|
...res.data,
|
|
...res.data,
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getFormInfo();
|
|
|
|
|
|
|
+ getFormInfo();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|