|
@@ -9,41 +9,28 @@
|
|
|
<view class="startline-title">鲜货信息</view>
|
|
<view class="startline-title">鲜货信息</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="pd-24 bg-#fff">
|
|
<view class="pd-24 bg-#fff">
|
|
|
- <!-- TODO: 后续按 seedInfoList 设计鲜货信息明细,此处先留空结构避免表单错误 -->
|
|
|
|
|
- <up-form-item borderBottom label="添加鲜货信息" required prop="seedInfoList">
|
|
|
|
|
|
|
+ <!-- TODO: 后续按 goodsInfoList 设计鲜货信息明细,此处先留空结构避免表单错误 -->
|
|
|
|
|
+ <up-form-item borderBottom label="添加鲜货信息" required prop="goodsInfoList">
|
|
|
<view class="flex1">
|
|
<view class="flex1">
|
|
|
- <template v-for="(item, index) in form.seedInfoList" :key="index">
|
|
|
|
|
|
|
+ <template v-for="(item, index) in form.goodsInfoList" :key="index">
|
|
|
<view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-12">
|
|
<view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-12">
|
|
|
<view class="d-flex flex1 mb-10">
|
|
<view class="d-flex flex1 mb-10">
|
|
|
- <view class="flex1">
|
|
|
|
|
- <span class="f-s-34 c-#333 f-w-500 mr-10">{{ uidMapData[item]?.varietyInfo?.varietyName }}</span>
|
|
|
|
|
- <span class="f-s-24 c-#666">{{ selectDictLabel(pt_seed_type, uidMapData[item]?.seedType) }}</span>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="f-s-34 c-#333 f-w-500 mr-10 flex1">{{ uidMapData[item]?.varietyInfo?.varietyName }}</view>
|
|
|
<view class="pr-60">
|
|
<view class="pr-60">
|
|
|
<view v-if="uidMapData[item]?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检</view>
|
|
<view v-if="uidMapData[item]?.examinReport?.length" class="tag-span c-primary bg-#EBF6EE">已检</view>
|
|
|
<view v-else class="tag-span c-danger bg-#F9ECEA">未检</view>
|
|
<view v-else class="tag-span c-danger bg-#F9ECEA">未检</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="d-flex">
|
|
<view class="d-flex">
|
|
|
- <view class="flex1 f-s-28 pr-10 pd2-4-0">
|
|
|
|
|
- <span class="c-#666">来源:</span>
|
|
|
|
|
- <span class="c-#333 f-w-500">{{ selectDictLabel(pt_seed_source, uidMapData[item]?.seedSource) }}</span>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex1 f-s-28 pd2-4-0">
|
|
|
|
|
- <span class="c-#666">入库量:</span>
|
|
|
|
|
- <span class="c-#333 f-w-500">{{ uidMapData[item]?.capacity }}{{ uidMapData[item]?.unit }}</span>
|
|
|
|
|
|
|
+ <view class="f-s-28 pr-10 pd2-4-0">
|
|
|
|
|
+ <span class="c-#666">供应商:</span>
|
|
|
|
|
+ <span class="c-#333 f-w-500">{{ uidMapData[item]?.supplierInfo?.cusName }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="d-flex">
|
|
<view class="d-flex">
|
|
|
- <view class="flex1 ov-hd">
|
|
|
|
|
- <view class="f-s-28 pr-10 pd2-4-0">
|
|
|
|
|
- <span class="c-#666">供应商:</span>
|
|
|
|
|
- <span class="c-#333 f-w-500">{{ uidMapData[item]?.supplierInfo?.cusName }}</span>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="f-s-28 pr-10 pd2-4-0">
|
|
|
|
|
- <span class="c-#666">受托单位:</span>
|
|
|
|
|
- <span class="c-#333 f-w-500">{{ uidMapData[item]?.entrustInfo?.cusName }}</span>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="flex1 f-s-28 pd2-4-0 ov-hd">
|
|
|
|
|
+ <span class="c-#666">入库量:</span>
|
|
|
|
|
+ <span class="c-#333 f-w-500">{{ uidMapData[item]?.capacity }}{{ uidMapData[item]?.unit }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="d-flex a-ed" @click="navigateToAddSeedSource(item, 'edit')">
|
|
<view class="d-flex a-ed" @click="navigateToAddSeedSource(item, 'edit')">
|
|
|
<view class="pd-10 c-primary f-s-20">去编辑{{ '>' }}</view>
|
|
<view class="pd-10 c-primary f-s-20">去编辑{{ '>' }}</view>
|
|
@@ -89,8 +76,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
<!-- 库房类型 -->
|
|
<!-- 库房类型 -->
|
|
|
- <up-form-item borderBottom label="库房类型" prop="storeType" required>
|
|
|
|
|
- <view v-if="form.storeType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storeType) }}</view>
|
|
|
|
|
|
|
+ <up-form-item borderBottom label="库房类型" prop="storageType" required>
|
|
|
|
|
+ <view v-if="form.storageType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type, form.storageType) }}</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>
|
|
|
</up-form-item>
|
|
</up-form-item>
|
|
|
<up-form-item borderBottom label="存放库房" prop="warehouses">
|
|
<up-form-item borderBottom label="存放库房" prop="warehouses">
|
|
@@ -115,22 +102,22 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { useClientRequest } from '@/utils/request';
|
|
import { useClientRequest } from '@/utils/request';
|
|
|
-import { SeedSourceAddTypeEnum } from '../models/type';
|
|
|
|
|
|
|
+import { FreshGoodsInstoreEnum } from '../models/type';
|
|
|
import { formItemBtnStyle } from '@/assets/styles/uview-plus';
|
|
import { formItemBtnStyle } from '@/assets/styles/uview-plus';
|
|
|
import { generateUniqueId } from '@/utils/public';
|
|
import { generateUniqueId } from '@/utils/public';
|
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
|
import SelectWarehouseInput from '@/models/select-warehouse-input/select-warehouse-input.vue';
|
|
import SelectWarehouseInput from '@/models/select-warehouse-input/select-warehouse-input.vue';
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { pt_seed_instore_type, pt_warehouse_type, pt_seed_type, pt_seed_source, pt_materail_unit, pt_mother_father_flag, pt_op_method, pt_seed_unit, pt_fungus_code_type, pt_breeding_materials, yes_no, pt_cus_type, pt_cpy_type, pt_gen_unit } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_seed_type', 'pt_seed_source', 'pt_materail_unit', 'pt_mother_father_flag', 'pt_op_method', 'pt_seed_unit', 'pt_fungus_code_type', 'pt_breeding_materials', 'yes_no', 'pt_cus_type', 'pt_cpy_type', 'pt_gen_unit'));
|
|
|
|
|
|
|
+const { pt_seed_instore_type, pt_warehouse_type, pt_seed_type, pt_seed_source } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_seed_type', 'pt_seed_source'));
|
|
|
// 表单与分页等基础状态(参考 base-edit 风格)
|
|
// 表单与分页等基础状态(参考 base-edit 风格)
|
|
|
const paging = ref<any>(null);
|
|
const paging = ref<any>(null);
|
|
|
const upFormRef = ref<any>(null);
|
|
const upFormRef = ref<any>(null);
|
|
|
const showArea = ref(false);
|
|
const showArea = ref(false);
|
|
|
-const form = ref<SeedSourceAddTypeEnum>({
|
|
|
|
|
|
|
+const form = ref<FreshGoodsInstoreEnum>({
|
|
|
instoreType: '2',
|
|
instoreType: '2',
|
|
|
- storeType: '4',
|
|
|
|
|
- seedInfoList: [],
|
|
|
|
|
|
|
+ storageType: '4',
|
|
|
|
|
+ goodsInfoList: [],
|
|
|
warehouses: [],
|
|
warehouses: [],
|
|
|
instoreBizInfo: {
|
|
instoreBizInfo: {
|
|
|
instoreDate: parseTime(new Date(), '{y}-{m}-{d}'),
|
|
instoreDate: parseTime(new Date(), '{y}-{m}-{d}'),
|
|
@@ -139,7 +126,7 @@ const form = ref<SeedSourceAddTypeEnum>({
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
|
- seedInfoList: [{ required: true, message: '请添加鲜货信息', type: 'array', min: 1 }],
|
|
|
|
|
|
|
+ goodsInfoList: [{ required: true, message: '请添加鲜货信息', type: 'array', min: 1 }],
|
|
|
instoreType: [{ required: true, message: '请选择入库类型' }],
|
|
instoreType: [{ required: true, message: '请选择入库类型' }],
|
|
|
'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
|
|
'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
|
|
|
batchCode: [{ required: true, message: '请输入入库批号' }],
|
|
batchCode: [{ required: true, message: '请输入入库批号' }],
|
|
@@ -147,8 +134,6 @@ const rules = reactive({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const submitForm = async () => {
|
|
const submitForm = async () => {
|
|
|
- console.log(form.value);
|
|
|
|
|
-
|
|
|
|
|
uni.$u.debounce(
|
|
uni.$u.debounce(
|
|
|
async () => {
|
|
async () => {
|
|
|
try {
|
|
try {
|
|
@@ -163,7 +148,7 @@ const submitForm = async () => {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: '提交中...',
|
|
title: '提交中...',
|
|
|
});
|
|
});
|
|
|
- const params = form.value.seedInfoList.map((uid) => {
|
|
|
|
|
|
|
+ const params = form.value.goodsInfoList.map((uid) => {
|
|
|
return {
|
|
return {
|
|
|
...uidMapData.value[uid],
|
|
...uidMapData.value[uid],
|
|
|
...form.value,
|
|
...form.value,
|
|
@@ -174,7 +159,7 @@ const submitForm = async () => {
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
try {
|
|
try {
|
|
|
- const res = await useClientRequest.post('/plt-api/app/storageSeed/batchInstore', params);
|
|
|
|
|
|
|
+ const res = await useClientRequest.post('/plt-api/app/storage/batchInstore', params);
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -221,7 +206,7 @@ const navigateToAddSeedSource = (uid = '', mode = 'add') => {
|
|
|
uni.$on('submitForm', (data: any) => {
|
|
uni.$on('submitForm', (data: any) => {
|
|
|
uidMapData.value[data.uid] = data.form;
|
|
uidMapData.value[data.uid] = data.form;
|
|
|
if (data?.mode == 'add') {
|
|
if (data?.mode == 'add') {
|
|
|
- form.value.seedInfoList.push(data.uid);
|
|
|
|
|
|
|
+ form.value.goodsInfoList.push(data.uid);
|
|
|
}
|
|
}
|
|
|
uni.$off('submitForm');
|
|
uni.$off('submitForm');
|
|
|
});
|
|
});
|
|
@@ -237,7 +222,7 @@ const navigateToAddSeedSource = (uid = '', mode = 'add') => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
const deleteRow = (index: number, uid: string) => {
|
|
const deleteRow = (index: number, uid: string) => {
|
|
|
- form.value.seedInfoList.splice(index, 1);
|
|
|
|
|
|
|
+ form.value.goodsInfoList.splice(index, 1);
|
|
|
delete uidMapData.value[uid];
|
|
delete uidMapData.value[uid];
|
|
|
};
|
|
};
|
|
|
// 编辑时加载详情
|
|
// 编辑时加载详情
|