|
|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
- <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom
|
|
|
- scroll-with-animation>
|
|
|
+ <z-paging class="" ref="paging" bgColor="#f7f7f7" paging-class="paging-btm-shadow" safe-area-inset-bottom scroll-with-animation>
|
|
|
<template #top>
|
|
|
<ut-navbar :title="'新增农资入库'" :fixed="false" border></ut-navbar>
|
|
|
</template>
|
|
|
@@ -17,13 +16,11 @@
|
|
|
<view class="bg-#FBFDFB card-info-block pd-24 p-rtv mb-12">
|
|
|
<view class="d-flex flex1 mb-10">
|
|
|
<view class="flex1">
|
|
|
- <span class="f-s-34 c-#333 f-w-500 mr-10">{{ uidMapData[item]?.materialName
|
|
|
- }}</span>
|
|
|
+ <span class="f-s-34 c-#333 f-w-500 mr-10">{{ uidMapData[item]?.materialName }}</span>
|
|
|
<span class="f-s-24 c-#666">{{ selectDictLabel(pt_material_type, uidMapData[item]?.materialType) }}</span>
|
|
|
</view>
|
|
|
<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>
|
|
|
</view>
|
|
|
@@ -33,17 +30,13 @@
|
|
|
</view>
|
|
|
<view class="d-flex">
|
|
|
<view class="d-flex flex1 ov-hd mr-10">
|
|
|
-
|
|
|
<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>
|
|
|
+ <span class="c-#333 f-w-500">{{ uidMapData[item]?.capacity }}{{ uidMapData[item]?.unit }}</span>
|
|
|
</view>
|
|
|
- <view v-if="!['kg', 'L'].includes(uidMapData[item]?.unit)"
|
|
|
- class="flex1 f-s-28 pr-10 pd2-4-0">
|
|
|
+ <view v-if="!['kg', 'L'].includes(uidMapData[item]?.unit)" class="flex1 f-s-28 pr-10 pd2-4-0">
|
|
|
<span class="c-#666">规格:</span>
|
|
|
- <span class="c-#333 f-w-500">{{ uidMapData[item]?.spec }} {{
|
|
|
- uidMapData[item]?.specUnit }}/{{ uidMapData[item]?.unit }}</span>
|
|
|
+ <span class="c-#333 f-w-500">{{ uidMapData[item]?.spec }} {{ uidMapData[item]?.specUnit }}/{{ uidMapData[item]?.unit }}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="d-flex a-ed" @click="navigateToAddAgroProduct(item, 'edit')">
|
|
|
@@ -69,17 +62,14 @@
|
|
|
<view class="pd-24 bg-#fff">
|
|
|
<!-- 入库类型 -->
|
|
|
<up-form-item borderBottom label="入库类型" required prop="instoreType">
|
|
|
- <view v-if="form.instoreType" class="f-s-30 c-333 f-w-5 flex1">{{
|
|
|
- selectDictLabel(pt_seed_instore_type,
|
|
|
- form.instoreType) }}</view>
|
|
|
+ <view v-if="form.instoreType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_seed_instore_type, form.instoreType) }}</view>
|
|
|
<view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择入库类型</view>
|
|
|
</up-form-item>
|
|
|
<!-- 入库日期 -->
|
|
|
<view class="h-1" id="instoreDatepppp"></view>
|
|
|
<ut-datetime-picker v-model="form.instoreBizInfo.instoreDate" :maxDate="new Date()" mode="date">
|
|
|
<up-form-item borderBottom label="入库日期" required prop="instoreDate">
|
|
|
- <up-input v-model="form.instoreBizInfo.instoreDate" readonly placeholder="请选择入库日期" border="none"
|
|
|
- clearable></up-input>
|
|
|
+ <up-input v-model="form.instoreBizInfo.instoreDate" readonly placeholder="请选择入库日期" border="none" clearable></up-input>
|
|
|
<template #right>
|
|
|
<up-icon size="22rpx" color="#37A954" name="arrow-down-fill"></up-icon>
|
|
|
</template>
|
|
|
@@ -89,24 +79,21 @@
|
|
|
<up-form-item borderBottom label="入库批号" required prop="batchCode">
|
|
|
<up-input v-model="form.batchCode" placeholder="请输入入库批号" border="none" clearable></up-input>
|
|
|
<template #right>
|
|
|
- <up-button @click="generateBatchCode" type="primary"
|
|
|
- :customStyle="formItemBtnStyle">随机生成</up-button>
|
|
|
+ <up-button @click="generateBatchCode" type="primary" :customStyle="formItemBtnStyle">随机生成</up-button>
|
|
|
</template>
|
|
|
</up-form-item>
|
|
|
<!-- 库房类型 -->
|
|
|
<up-form-item borderBottom label="库房类型" prop="storageType" required>
|
|
|
- <view v-if="form.storageType" class="f-s-30 c-999 f-w-5 flex1">{{ selectDictLabel(pt_warehouse_type,
|
|
|
- form.storageType) }}</view>
|
|
|
+ <view v-if="form.storageType" class="f-s-30 c-999 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>
|
|
|
</up-form-item>
|
|
|
- <!-- 存放库房(具体库房/货架信息稍后补充为选择器) -->
|
|
|
+ <!-- 存放库房(具体库房/货架信息稍后补充为选择器) -->
|
|
|
<up-form-item borderBottom label="存放库房" prop="warehouses">
|
|
|
<select-warehouse-input v-model="form.warehouses" title="添加农资存放库房" :params="{ type: '1' }"></select-warehouse-input>
|
|
|
</up-form-item>
|
|
|
<!-- 入库人 -->
|
|
|
<up-form-item borderBottom label="入库人" required prop="instoreMg">
|
|
|
- <up-input v-model="form.instoreBizInfo.instoreMg" placeholder="请输入入库人" border="none"
|
|
|
- clearable></up-input>
|
|
|
+ <up-input v-model="form.instoreBizInfo.instoreMg" placeholder="请输入入库人" border="none" clearable></up-input>
|
|
|
</up-form-item>
|
|
|
<!-- 入库备注 -->
|
|
|
<up-form-item borderBottom label="入库备注" prop="remark">
|
|
|
@@ -132,9 +119,7 @@ import { useInfoStore } from '@/store';
|
|
|
const infoStore = useInfoStore();
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
// 仅使用到的字典:入库类型、库房类型、显示农资卡片中的种类和来源
|
|
|
-const { pt_seed_instore_type, pt_warehouse_type, pt_material_type, pt_source_type } = toRefs<any>(
|
|
|
- proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_material_type', 'pt_source_type'),
|
|
|
-);
|
|
|
+const { pt_seed_instore_type, pt_warehouse_type, pt_material_type, pt_source_type } = toRefs<any>(proxy?.useDict('pt_seed_instore_type', 'pt_warehouse_type', 'pt_material_type', 'pt_source_type'));
|
|
|
// 表单与分页等基础状态(参考 base-edit 风格)
|
|
|
const paging = ref<any>(null);
|
|
|
const upFormRef = ref<any>(null);
|
|
|
@@ -151,7 +136,6 @@ const form = ref<AgroProductInstoreAddTypeEnum>({
|
|
|
},
|
|
|
});
|
|
|
const rules = reactive({
|
|
|
-
|
|
|
instoreType: [{ required: true, message: '请选择入库类型' }],
|
|
|
'instoreBizInfo.instoreDate': [{ required: true, message: '请选择入库日期' }],
|
|
|
batchCode: [{ required: true, message: '请输入入库批号' }],
|
|
|
@@ -183,9 +167,9 @@ const submitForm = async () => {
|
|
|
instoreBizInfo: {
|
|
|
...form.value.instoreBizInfo,
|
|
|
...uidMapData.value[uid]?.instoreBizInfo,
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
- })
|
|
|
+ });
|
|
|
try {
|
|
|
const res = await useClientRequest.post('/plt-api/app/material/batchInstore', params);
|
|
|
if (!res || res.code !== 200) return;
|
|
|
@@ -196,11 +180,10 @@ const submitForm = async () => {
|
|
|
});
|
|
|
uni.$emit('refreshStorageRoomList');
|
|
|
// 返回上一页
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1,
|
|
|
- });
|
|
|
- }, 1500);
|
|
|
+ await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1,
|
|
|
+ });
|
|
|
} catch (error) {
|
|
|
// uni.hideLoading();
|
|
|
}
|
|
|
@@ -244,9 +227,9 @@ const navigateToAddAgroProduct = (uid = '', mode = 'add') => {
|
|
|
res.eventChannel.emit('optionsParam', {
|
|
|
uid: uid || generateUniqueId(),
|
|
|
mode: mode,
|
|
|
- form: uid ? uidMapData.value[uid] : {}
|
|
|
+ form: uid ? uidMapData.value[uid] : {},
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
};
|
|
|
const deleteRow = (index: number, uid: string) => {
|
|
|
@@ -254,9 +237,7 @@ const deleteRow = (index: number, uid: string) => {
|
|
|
delete uidMapData.value[uid];
|
|
|
};
|
|
|
// 编辑时加载详情
|
|
|
-onLoad((optins: any) => {
|
|
|
-
|
|
|
-});
|
|
|
+onLoad((optins: any) => {});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.card-info-block {
|