From 2da740fb8ca0bfc2f6a6385c73bc98779d1d4442 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 11 八月 2025 16:23:23 +0800
Subject: [PATCH] 添加 通过单据类型获取源单类型 函数 添加 通过当前用户是否设置关联仓库获取关联仓库函数

---
 pages/zhijiediaobo/form.vue  |    1 -
 pages/caigouruku/form.vue    |   32 +++++++++++++++++++++++++++++---
 utils/userRelationManager.js |   18 ++++++++++++++++++
 3 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/pages/caigouruku/form.vue b/pages/caigouruku/form.vue
index 79d0a2f..5957db4 100644
--- a/pages/caigouruku/form.vue
+++ b/pages/caigouruku/form.vue
@@ -239,6 +239,9 @@
 	import {
 		CommonUtils
 	} from '../../utils/common';
+	import {
+		getUserStockRelation
+	} from "@/utils/userRelationManager.js"
 	export default {
 		data() {
 			return {
@@ -337,13 +340,36 @@
 				this.getNewData()
 				this.HSourceBillNoFocus = true
 			}
-			this.getHBaseList()
+
 			this.getHSupList()
 			this.getHEmpList()
 			this.getHDeptList()
 			this.GetSourceBillType()
+			this.getRelationStore()
 		},
 		methods: {
+			async getRelationStore() {
+				let {
+					data,
+					count
+				} = await getUserStockRelation()
+				if (count == 1) {
+					this.arrayHWHName = []
+					this.HWHNameList = []
+					Array.from(data).forEach(elem => {
+						console.log(elem.HItemID);
+						this.arrayHWHName.push(elem.HName)
+						this.HWHNameList.push({
+							HItemID: elem.HItemID,
+							HName: elem.HName,
+							HNumber: elem.HNumber,
+							"浠撳簱鍚嶇О": elem.HName
+						})
+					})
+				} else {
+					this.getHBaseList()
+				}
+			},
 			async refreshHSourceBillState() {
 				this.HSourceBillNoFocus = false
 				await this.$nextTick(() => {
@@ -559,7 +585,7 @@
 							Message
 						} = res.data
 						if (count == 1) {
-							console.log('data: ', data);
+							// console.log('data: ', data);
 							this.arrayHMainSourceBillType = []
 							this.arrayHMainSourceBillValue = []
 							Array.from(data).forEach(e => {
@@ -569,7 +595,7 @@
 
 							this.arrayHMainSourceBillType.push('鎵嬪伐褰曞叆')
 							this.arrayHMainSourceBillValue.push('-1')
-							
+
 							this.HMainSourceBillType = this.arrayHMainSourceBillType[0]
 							this.hform.HMainSourceBillType = this.arrayHMainSourceBillValue[0]
 						} else {
diff --git a/pages/zhijiediaobo/form.vue b/pages/zhijiediaobo/form.vue
index 415d69d..57704d5 100644
--- a/pages/zhijiediaobo/form.vue
+++ b/pages/zhijiediaobo/form.vue
@@ -791,7 +791,6 @@
 			},
 			// 閫氳繃鍗曟嵁绫诲瀷鑾峰彇婧愬崟绫诲瀷
 			async GetSourceBillType() {
-
 				CommonUtils.doRequest2({
 					url: '/Web/GetHSourceBillType',
 					data: {
diff --git a/utils/userRelationManager.js b/utils/userRelationManager.js
new file mode 100644
index 0000000..e2ba71f
--- /dev/null
+++ b/utils/userRelationManager.js
@@ -0,0 +1,18 @@
+import { getUserInfo } from "./auth";
+import { CommonUtils } from "./common";
+
+export async function getUserStockRelation(userBm =  getUserInfo()['Czybm']){
+	return new Promise((resolve, reject) => {
+		CommonUtils.doRequest2({
+			url: '/Xt_User/UserStocklistPlaylist',
+			data: {
+				HUserID: userBm
+			},
+			resFunction: (res) => {
+				console.log('getUserStockRelation res: ',res);
+				let {data, count, Message} = res.data
+				resolve({data:data, count: count})
+			}
+		})
+	})
+}
\ No newline at end of file

--
Gitblit v1.9.1