|
|
@@ -0,0 +1,97 @@
|
|
|
+<template>
|
|
|
+ <z-paging ref="paging" bgColor="#f7f7f7" safe-area-inset-bottom scroll-with-animation>
|
|
|
+ <template #top>
|
|
|
+ <ut-navbar :title="'销售登记'" :fixed="false" border></ut-navbar>
|
|
|
+ </template>
|
|
|
+ <up-form class="p-rtv bg-#fff" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
|
|
|
+ <view class="pd-24 bg-#fff mb-10">
|
|
|
+ <view class="h-1" id="inputStorageIdpppp"></view>
|
|
|
+ <up-form-item borderBottom label="选择包装对象" prop="inputStorageId" required>
|
|
|
+ <view class="flex1">
|
|
|
+ <up-button v-if="!form.inputStorageId" @click="selectStorage" type="primary" plain>
|
|
|
+ <image class="w-36 h-36 mr-10" src="https://yujin-szyy.oss-cn-chengdu.aliyuncs.com/szyy/images-plt/common/select_push_icon.png" mode="widthFix" />
|
|
|
+ <span>请选择您要包装的对象</span>
|
|
|
+ </up-button>
|
|
|
+ </view>
|
|
|
+ </up-form-item>
|
|
|
+ <view class="h-1" id="storageUseAmountpppp"></view>
|
|
|
+ <up-form-item borderBottom label="本次包装用量" prop="storageUseAmount" required>
|
|
|
+ <up-input v-model="form.storageUseAmount" placeholder="请输入本次包装用量" border="none" clearable></up-input>
|
|
|
+ <template #right>
|
|
|
+ <span class="f-s-30 f-w-5 c-#333">{{ form?.storageUseUnit || 'kg' }}</span>
|
|
|
+ </template>
|
|
|
+ </up-form-item>
|
|
|
+ </view>
|
|
|
+ </up-form>
|
|
|
+ </z-paging>
|
|
|
+</template>
|
|
|
+<script setup lang="ts">
|
|
|
+import { useClientRequest } from '@/utils/request';
|
|
|
+import { formItemBtnStyle } from '@/assets/styles/uview-plus';
|
|
|
+import NP from 'number-precision';
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { pt_pack_ref_type, pt_pack_spec_unit, pt_expire_date_unit } = toRefs<any>(proxy?.useDict('pt_pack_ref_type', 'pt_pack_spec_unit', 'pt_expire_date_unit'));
|
|
|
+const upFormRef = ref();
|
|
|
+const paging = ref();
|
|
|
+const form = ref({
|
|
|
+
|
|
|
+});
|
|
|
+
|
|
|
+const rules = reactive<Record<string, any>>({
|
|
|
+
|
|
|
+});
|
|
|
+
|
|
|
+const submit = () => {
|
|
|
+ uni.$u.debounce(async () => {
|
|
|
+ try {
|
|
|
+ await upFormRef.value?.validate();
|
|
|
+ } catch (error: any) {
|
|
|
+ const firstErrorField = error && error[0].field + 'pppp';
|
|
|
+ paging.value?.scrollIntoViewById(firstErrorField, 30, true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ } catch (e) {
|
|
|
+ console.error('销售登记失败:', e);
|
|
|
+ }
|
|
|
+ }, 500, true);
|
|
|
+};
|
|
|
+// 点击随机生成服务端生成唯一的批号
|
|
|
+const generateBatchCode = async () => {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '生成中...',
|
|
|
+ });
|
|
|
+ const res = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', {
|
|
|
+ plType: 'Z',
|
|
|
+ linkType: 'I',
|
|
|
+ });
|
|
|
+ if (res && res.code === 200) {
|
|
|
+ uni.hideLoading();
|
|
|
+ form.value.packSn = res.data;
|
|
|
+ uni.showToast({
|
|
|
+ title: '批号生成成功',
|
|
|
+ icon: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+// 去选择包装对象页选择包装对象,选择后返回并赋值
|
|
|
+const selectStorage = () => {
|
|
|
+ uni.$on('selectStorageObject', (data: any) => {
|
|
|
+
|
|
|
+ });
|
|
|
+};
|
|
|
+const deleteStorage = () => {
|
|
|
+
|
|
|
+};
|
|
|
+onLoad((options: any) => {});
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.close-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ z-index: 1;
|
|
|
+}
|
|
|
+</style>
|