|
|
@@ -0,0 +1,140 @@
|
|
|
+<template>
|
|
|
+ <view class="pd-24 bg-fff">
|
|
|
+ <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="h-1" id="fileTypepppp"></view>
|
|
|
+ <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>
|
|
|
+ <!-- 导出格式 -->
|
|
|
+ <view class="h-1" id="fileFormatpppp"></view>
|
|
|
+ <up-form-item borderBottom label="导出格式" required prop="extraInfo.fileFormat">
|
|
|
+ <view v-if="form.extraInfo?.fileFormat" class="f-s-30 c-333 f-w-5 flex1">
|
|
|
+ {{ selectDictLabel(pt_code_export_format, form.extraInfo?.fileFormat) }}
|
|
|
+ </view>
|
|
|
+ <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择导出格式</view>
|
|
|
+ </up-form-item>
|
|
|
+ <view class="h-1" id="fieldspppp"></view>
|
|
|
+ <up-form-item prop="extraInfo.fields" borderBottom>
|
|
|
+ <view class="flex1">
|
|
|
+ <view class="p-rtv mb-20">
|
|
|
+ <span class="form-item-label_required">*</span>
|
|
|
+ <span class="f-s-30 c-#333">导出信息</span>
|
|
|
+ <span class="f-s-24 c-#999">(已默认勾选必打字段,如需其他字段可自行选择)</span>
|
|
|
+ </view>
|
|
|
+ <up-checkbox-group v-model="form.extraInfo.fields">
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="品名" name="proName"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" label="基原" name="genusName"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="批号" name="batchSn"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="规格等级" name="proSpecn"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="产地" name="proAdcodeDesc"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="数量(重量)" name="specn"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" label="采收日期" name="harvestDate"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" label="包装日期" name="packagingDate"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" label="保质期" name="expireDate"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="企业名称" name="cpyName"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" label="溯源码码值" name="code"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ width: '33%', marginBottom: '8px' }" disabled label="溯源码图" name="qrcode"></up-checkbox>
|
|
|
+ <up-checkbox :customStyle="{ marginBottom: '8px' }" label="是否符合GAP要求" name="gapFlag"></up-checkbox>
|
|
|
+ </up-checkbox-group>
|
|
|
+ </view>
|
|
|
+ </up-form-item>
|
|
|
+ <up-form-item props="extraInfo.layoutType" label="排版类型" required borderBottom>
|
|
|
+ <view class="flex1">
|
|
|
+ <ut-radio v-model="form.extraInfo.layoutType" :options="pt_code_export_layout_type"></ut-radio>
|
|
|
+ <view class="d-flex j-c a-c pd-24">
|
|
|
+ <codeStyleTem :fields="form.extraInfo.fields" :info="infoData" :layoutType="form.extraInfo.layoutType"></codeStyleTem>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </up-form-item>
|
|
|
+ <up-form-item :label="`导出人`" required borderBottom>
|
|
|
+ <up-input v-model="form.printPerson" placeholder="请输入导出人" readonly border="none" clearable></up-input>
|
|
|
+ </up-form-item>
|
|
|
+ </up-form>
|
|
|
+ </view>
|
|
|
+ <view class="pd3-40-24-30 d-flex">
|
|
|
+ <up-button class="mr-30" type="primary" plain @click="prevSteps">上一步</up-button>
|
|
|
+ <up-button type="primary" @click="submitForm">下一步</up-button>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script setup lang="ts">
|
|
|
+import { useInfoStore } from '@/store';
|
|
|
+import codeStyleTem from './code-style-tem.vue';
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { pt_code_export_type, pt_code_export_format, pt_code_export_layout_type } = toRefs<any>(proxy?.useDict('pt_code_export_type', 'pt_code_export_format', 'pt_code_export_layout_type'));
|
|
|
+const infoStore = useInfoStore();
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ infoData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => null,
|
|
|
+ },
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: () => null,
|
|
|
+ },
|
|
|
+ nextStepValue: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+ prevStepValue: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+ item: {
|
|
|
+ type: Object,
|
|
|
+ default: () => null,
|
|
|
+ },
|
|
|
+ opts: {
|
|
|
+ type: Object,
|
|
|
+ default: () => null,
|
|
|
+ },
|
|
|
+});
|
|
|
+const upFormUpRef = ref();
|
|
|
+const emit = defineEmits(['next', 'prev', 'formdata']);
|
|
|
+const form = ref({
|
|
|
+ extraInfo: {
|
|
|
+ fileType: '1',
|
|
|
+ fileFormat: '1',
|
|
|
+ logos: [], // 导出logo
|
|
|
+ // 只有禁用的默认有值,
|
|
|
+ fields: ['proName', 'batchSn', 'proSpecn', 'proAdcodeDesc', 'specn', 'cpyName', 'qrcode'], // 导出字段
|
|
|
+ layoutType: '2', // 排版类型
|
|
|
+ },
|
|
|
+ printPerson: infoStore.userInfo?.name, // 导出人
|
|
|
+});
|
|
|
+const rules = reactive({});
|
|
|
+const changeExtraFileType = (val: any) => {
|
|
|
+ console.log(val);
|
|
|
+ form.value.extraInfo.fileFormat = val;
|
|
|
+};
|
|
|
+const submitForm = async () => {
|
|
|
+ try {
|
|
|
+ await upFormUpRef.value?.validate();
|
|
|
+ } catch (error: any) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ emit('formdata', {
|
|
|
+ ...form.value,
|
|
|
+ });
|
|
|
+ emit('next', {
|
|
|
+ info: {
|
|
|
+ ...props.info,
|
|
|
+ status: 'completed',
|
|
|
+ },
|
|
|
+ nextStepValue: props.nextStepValue || 'print',
|
|
|
+ });
|
|
|
+};
|
|
|
+const prevSteps = () => {
|
|
|
+ emit('prev', {
|
|
|
+ prevStepValue: props.prevStepValue || 'confirm',
|
|
|
+ });
|
|
|
+};
|
|
|
+onMounted(() => {});
|
|
|
+</script>
|