From 40e8d61336a8bca0969c64907fd95e921f65d30d Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Thu, 5 Dec 2024 17:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/productWarehousePop/index.vue | 8 +- src/views/order/beforehand_order/add.vue | 102 ++++++++++++------- src/views/store_product_price/index.vue | 9 +- 3 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/components/productWarehousePop/index.vue b/src/components/productWarehousePop/index.vue index d57e5f048..6245c9c1e 100644 --- a/src/components/productWarehousePop/index.vue +++ b/src/components/productWarehousePop/index.vue @@ -73,12 +73,18 @@ import { useDictData } from '@/hooks/useDictOptions' import { apiStoreProductLists } from '@/api/store_product' import { ElMessage } from 'element-plus' +import { defineProps } from 'vue'; + +const props = defineProps({ + userId: Number +}); // 查询条件 const queryParams = reactive({ store_name: '', product_type: 0, - is_warehouse: 1 + is_warehouse: 1, + user_id: props.userId }) // 选中数据 diff --git a/src/views/order/beforehand_order/add.vue b/src/views/order/beforehand_order/add.vue index a5c77734c..13cfcbfc0 100644 --- a/src/views/order/beforehand_order/add.vue +++ b/src/views/order/beforehand_order/add.vue @@ -12,21 +12,25 @@ - - - - - - - - - - - + + + @@ -146,7 +150,7 @@
- 添加商品
@@ -311,7 +315,7 @@
- + @@ -347,6 +351,8 @@ import { useRouter, useRoute } from 'vue-router' import { apiBeforehandOrderAdd } from '@/api/beforehand_order' import { apiSystemStoreLists } from '@/api/system_store' import { apiStoreProductDetail, apiStoreProductLists } from '@/api/store_product' +import { apiUserLists } from '@/api/user' +import feedback from '@/utils/feedback' defineProps({ dictData: { @@ -364,9 +370,6 @@ const formData = reactive({ total_price: 0, order_type: 1, store_id: '', - nickname: '', - phone: '', - address: '', arrival_time: '', purpose: '', tables: 0, @@ -379,7 +382,8 @@ const formData = reactive({ transporter: '', system_store_name: '', regional_manager: '张波', - mark: '' + mark: '', + user_id: '' }) const enterProduct = async (e: any) => { const data = await apiStoreProductDetail({ id: e.id }) @@ -387,8 +391,6 @@ const enterProduct = async (e: any) => { } const setData = (e: any, data: any) => { - console.log(e) - console.log(data) e.id = data.id e.image = data.image e.marques = data.marques @@ -477,7 +479,11 @@ const dialogProductLists = ref([]) const dialogProductShow = ref(false) const dialogProductData = ref() const enterStoreName = (e: any) => { - apiStoreProductLists({ store_name: e.store_name, product_type: 0, is_warehouse: 1 }).then( + if (formData.user_id == '') { + feedback.alertError('请先选择用户') + return + } + apiStoreProductLists({ store_name: e.store_name, product_type: 0, is_warehouse: 1, user_id: formData.user_id }).then( (res) => { if (res.count == 1) { const data = res.lists[0] @@ -592,27 +598,13 @@ const moveFocus = (event: any, index: number, key: string) => { } // 表单验证 const formRules = reactive({ - nickname: [ + user_id: [ { required: true, message: '请输入采购用户', trigger: ['blur'] } ], - phone: [ - { - required: true, - message: '请输入采购用户手机号', - trigger: ['blur'] - } - ], - address: [ - { - required: true, - message: '请输入采购用户地址', - trigger: ['blur'] - } - ], arrival_time: [ { required: true, @@ -698,4 +690,36 @@ const formRules = reactive({ } ] }) +const userloading = ref(false) +const userList = ref([]) +const remoteMethodUser = (e = '') => { + userloading.value = true + apiUserLists({ + nickname: e, + page_size: 10 + }) + .then((res) => { + userList.value = res.lists + setTimeout(() => { + userloading.value = false + }, 300) + }) + .catch((err) => { + setTimeout(() => { + userloading.value = false + }, 300) + }) +} + +const showProductModal = () => { + if (formData.user_id == '') { + feedback.alertError('请先选择用户') + return + } + showProduct.value = true +} +const productModalKey = ref(0) +const resetUserId = (e) => { + productModalKey.value++ +} diff --git a/src/views/store_product_price/index.vue b/src/views/store_product_price/index.vue index df7f47353..6030a81e9 100644 --- a/src/views/store_product_price/index.vue +++ b/src/views/store_product_price/index.vue @@ -31,9 +31,14 @@ - - + + + +