From 80e68aeae4c9ab711c9117c4578aab277f0c0e0d Mon Sep 17 00:00:00 2001 From: haha Date: Tue, 7 Jan 2025 00:34:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=90=88=E5=B9=B6=20"dev=5Fxd"=20?= =?UTF-8?q?=E5=92=8C=20"origin/dev=5Fxd"=20=E5=89=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AD=98=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../proProjectInfoSubdeptsUsers/index.vue | 103 ++++++++++-------- .../src/views/system/user/index.vue | 4 +- yanzhu-ui-vue3/vite.config.js | 7 +- 3 files changed, 63 insertions(+), 51 deletions(-) diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue index 9e2b1265..6235d512 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue @@ -70,13 +70,16 @@ + - + + + @@ -492,7 +495,6 @@ function doSubDeptChange(type) { data.deptGroups = d.rows || []; if (data.deptGroups.length > 0) { let dg = data.deptGroups[0]; - form.value.groupName = dg.groupName; form.value.craftTypeName = getCraftType(dg.craftType); form.value.craftPostName = getCraftPost(dg.craftPost).label; @@ -521,12 +523,14 @@ function doDeptGroupChange() { return; } let tmps = data.deptGroups.filter(d => d.id == form.value.subDeptGroup); - if (tmps.length > 0) { + if (tmps.length > 0 ) { let dg = tmps[0]; form.value.groupName = dg.groupName; form.value.craftTypeName = getCraftType(dg.craftType); form.value.craftPostName = getCraftPost(dg.craftPost); - form.value.craftPost = dg.craftPost + if(data.mode != 'edit'){ + form.value.craftPost = dg.craftPost + } form.value.craftType = dg.craftType; data.isManager = !dg.craftPost; } @@ -564,16 +568,16 @@ function loadSubDepts(cb) { listProProjectInfoSubdepts({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(d => { data.subdepts = d.rows || []; if (data.subdepts.length > 0) { - setTimeout(()=>{ + setTimeout(() => { let sd = data.subdepts[0]; - form.value.subDeptId = sd.id; + form.value.subDeptId = sd.id; doSubDeptChange(); cb && cb(); - },400); - }else{ + }, 400); + } else { cb && cb(); } - + }); } @@ -586,7 +590,7 @@ function handleAdd() { open.value = true; title.value = "添加劳务人员信息"; reset(); - loadSubDepts(()=> { + loadSubDepts(() => { data.editData = null; data.mode = 'add'; form.value.certificateType = ""; @@ -594,7 +598,7 @@ function handleAdd() { form.value.comId = userStore.currentComId; form.value.projectName = userStore.currentProName; form.value.nation = data.nationOpts[0]; - form.value.sex = data.sexOpts[0]; + form.value.sex = data.sexOpts[0]; }); } @@ -605,44 +609,47 @@ function handleUpdate(row) { data.mode = 'edit' data.editData = row; open.value = true; - title.value = "修改劳务人员信息"; - loadSubDepts(()=>{ - getProProjectInfoSubdeptsUsers(_id).then(response => { - let obj = JSON.parse(JSON.stringify(response.data)); - obj.info = tryToJson(obj.userInfos || "{}"); - obj.certificateType = obj.cardType; - obj.certificateCode = obj.cardCode; - obj.sex = obj.userSex; - obj.nation = obj.info.nation; - obj.birthDay = obj.info.birthDay; - obj.nativePlace = obj.info.nativePlace; - obj.address = obj.info.address; - obj.emergencyContact = obj.info.emergencyContact; - obj.contactPhone = obj.info.contactPhone; - obj.bankName = obj.info.bankName; - obj.bankCardNo = obj.info.bankCardNo; - obj.bankOffice = obj.info.bankOffice; - obj.certificatePhoto1 = obj.info.certificatePhoto1; - obj.certificatePhoto2 = obj.info.certificatePhoto2; - obj.faceImage = obj.userPicture; - obj.educationalType = obj.degreeGrade - form.value = obj; - form.value.userId = obj.userId; + title.value = "修改劳务人员信息"; + loadSubDepts(() => { + getProProjectInfoSubdeptsUsers(_id).then(response => { + let obj = JSON.parse(JSON.stringify(response.data)); + obj.info = tryToJson(obj.userInfos || "{}"); + obj.certificateType = obj.cardType; + obj.certificateCode = obj.cardCode; + obj.sex = obj.userSex; + obj.nation = obj.info.nation; + obj.birthDay = obj.info.birthDay; + obj.nativePlace = obj.info.nativePlace; + obj.address = obj.info.address; + obj.emergencyContact = obj.info.emergencyContact; + obj.contactPhone = obj.info.contactPhone; + obj.bankName = obj.info.bankName; + obj.bankCardNo = obj.info.bankCardNo; + obj.bankOffice = obj.info.bankOffice; + obj.certificatePhoto1 = obj.info.certificatePhoto1; + obj.certificatePhoto2 = obj.info.certificatePhoto2; + obj.faceImage = obj.userPicture; + obj.educationalType = obj.degreeGrade + form.value = obj; + form.value.userId = obj.userId; + form.value.projectId = row.projectId; + form.value.projectName = row.projectName; + //showEditUser(obj.user); + data.phoneState = "edit"; - form.value.projectId = row.projectId; - form.value.projectName = row.projectName; - //showEditUser(obj.user); - data.phoneState = "edit"; - - doImageUpload(); + doImageUpload(); - //doDeptGroupChange(); - setTimeout(() => { - doSubDeptChange(); - form.value.craftPost = response.data.craftPost; - }, 400); + //doDeptGroupChange(); + setTimeout(() => { + doSubDeptChange(); + setTimeout(() => { + form.value.craftPost = response.data.craftPost; + console.log("++++++>",form.value.craftPost) + }, 400) + + }, 400); + }); }); -}); } function showEditUser(user) { diff --git a/yanzhu-ui-vue3/src/views/system/user/index.vue b/yanzhu-ui-vue3/src/views/system/user/index.vue index 19dc1912..24729003 100644 --- a/yanzhu-ui-vue3/src/views/system/user/index.vue +++ b/yanzhu-ui-vue3/src/views/system/user/index.vue @@ -307,7 +307,9 @@ const data = reactive({ avatar: [{ required: true, message: "入场近照不能为空", trigger: "change" }], roleIds: [{ required: true, message: "用户角色不能为空", trigger: "change" }], password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }], - phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }] + phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }], + cardCode: [{ required: true, message: "用户名称不能为空", trigger: "blur" }], + avatar: [{ required: true, message: "入场近照不能为空", trigger: "change" }], } }); diff --git a/yanzhu-ui-vue3/vite.config.js b/yanzhu-ui-vue3/vite.config.js index e5564473..f90127df 100644 --- a/yanzhu-ui-vue3/vite.config.js +++ b/yanzhu-ui-vue3/vite.config.js @@ -44,9 +44,12 @@ export default defineConfig(({ mode, command }) => { rewrite: (p) => p.replace(/^\/dev-api/, '') }, '/statics': { - target: `http://localhost:9300/statics/`, + //target: `http://localhost:9300`, + target: 'http://62.234.3.186', changeOrigin: true, - rewrite: (p) => p.replace(/^\/statics/, '') + pathRewrite: { + "^/statics": "/", + }, }, }