bug整改
This commit is contained in:
+2
@@ -194,6 +194,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
|||||||
user.setCreateAt(System.currentTimeMillis());
|
user.setCreateAt(System.currentTimeMillis());
|
||||||
user.setLoginCount(0);
|
user.setLoginCount(0);
|
||||||
user.setDisabled(false);
|
user.setDisabled(false);
|
||||||
|
user.setMember(true);
|
||||||
|
|
||||||
if (user.getMember() == null) {
|
if (user.getMember() == null) {
|
||||||
user.setMember(true);
|
user.setMember(true);
|
||||||
@@ -315,6 +316,7 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
|||||||
user.setCreateAt(oldUser.getCreateAt());
|
user.setCreateAt(oldUser.getCreateAt());
|
||||||
user.setLoginCount(oldUser.getLoginCount());
|
user.setLoginCount(oldUser.getLoginCount());
|
||||||
user.setDisabled(false);
|
user.setDisabled(false);
|
||||||
|
user.setMember(true);
|
||||||
if (user.getMember() == null) {
|
if (user.getMember() == null) {
|
||||||
user.setMember(oldUser.getMember());
|
user.setMember(oldUser.getMember());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ layout("/layouts/platform.html"){
|
|||||||
<search-item label="姓名/工号">
|
<search-item label="姓名/工号">
|
||||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="模糊查询">
|
<!-- <search-item label="模糊查询">-->
|
||||||
<member-cnd @cnd="(v)=>pageForm={...pageForm,...v}"></member-cnd>
|
<!-- <member-cnd @cnd="(v)=>pageForm={...pageForm,...v}"></member-cnd>-->
|
||||||
</search-item>
|
<!-- </search-item>-->
|
||||||
<search-item label="所属工会">
|
<search-item label="所属工会">
|
||||||
<el-select
|
<el-select
|
||||||
@change="flushUnits"
|
@change="flushUnits"
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.personType" placeholder="教职工类别" @change="doSearch"
|
<dict-select v-model="pageForm.personType" placeholder="教职工类别" @change="doSearch"
|
||||||
code="USER_PERSON_TYPE"></dict-select>
|
code="USER_PERSON_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="编制类别">
|
<!-- <search-item label="编制类别">-->
|
||||||
<dict-select v-model="pageForm.preparedBy" placeholder="编制类别" @change="doSearch"
|
<!-- <dict-select v-model="pageForm.preparedBy" placeholder="编制类别" @change="doSearch"-->
|
||||||
code="USER_PREPARED_BY_TYPE"></dict-select>
|
<!-- code="USER_PREPARED_BY_TYPE"></dict-select>-->
|
||||||
</search-item>
|
<!-- </search-item>-->
|
||||||
<!-- <search-item label="变更类型">-->
|
<!-- <search-item label="变更类型">-->
|
||||||
<!-- <dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"-->
|
<!-- <dict-select v-model="pageForm.changeType" placeholder="变更类型" @change="doSearch"-->
|
||||||
<!-- code="MEMBER_CHANGE_TYPE"></dict-select>-->
|
<!-- code="MEMBER_CHANGE_TYPE"></dict-select>-->
|
||||||
@@ -200,7 +200,7 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "sex", label: "性别", sortable: true, width: "100px" },
|
{ prop: "sex", label: "性别", sortable: true, width: "100px" },
|
||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
// { prop: "preparedBy", label: "编制类别", sortable: true },
|
||||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||||
{ prop: "changeTypes", label: "变更类型", sortable: true },
|
{ prop: "changeTypes", label: "变更类型", sortable: true },
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ let ADDRESS_DIALOG = {
|
|||||||
title="收货地址"
|
title="收货地址"
|
||||||
width="30%">
|
width="30%">
|
||||||
|
|
||||||
<el-form :model="formData" label-position="right" label-suffix=":" label-width="120px" ref="addForm">
|
<el-form :model="formData" label-position="right" label-suffix=":" label-width="120px" ref="addForm" :rules="contactRules">
|
||||||
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
|
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
|
||||||
label="地址信息"
|
label="地址信息"
|
||||||
prop="addressList">
|
prop="addressList">
|
||||||
@@ -41,7 +41,6 @@ let ADDRESS_DIALOG = {
|
|||||||
v-model="formData.userName"></el-input>
|
v-model="formData.userName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:rules="{required:true,message: '请填写手机号码', trigger: 'blur'}"
|
|
||||||
label="手机号码"
|
label="手机号码"
|
||||||
prop="tel">
|
prop="tel">
|
||||||
<el-input maxlength="11" placeholder="请填写手机号码"
|
<el-input maxlength="11" placeholder="请填写手机号码"
|
||||||
@@ -60,7 +59,17 @@ let ADDRESS_DIALOG = {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dzOptions: chengShiList,
|
dzOptions: chengShiList,
|
||||||
dialogVisible: false
|
dialogVisible: false,
|
||||||
|
contactRules: {
|
||||||
|
tel: [
|
||||||
|
{required: true, message: "请输入联系电话", trigger: "blur"},
|
||||||
|
{
|
||||||
|
pattern: /^1[3456789]\d{9}$/,
|
||||||
|
message: "请输入正确的手机号码",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -88,19 +97,22 @@ let ADDRESS_DIALOG = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
doSaveUserAddress() {
|
doSaveUserAddress() {
|
||||||
this.$refs["addForm"].validate(async (valid) => {
|
this.$refs["addForm"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", { data: JSON.stringify(this.formData) })
|
const savedAddress = Object.assign({}, this.formData)
|
||||||
if (resp.code === 0) {
|
this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", { data: JSON.stringify(this.formData) }).then((resp) => {
|
||||||
this.$message({
|
if (resp.code === 0) {
|
||||||
message: resp.msg,
|
this.$message({
|
||||||
type: "success"
|
message: resp.msg,
|
||||||
})
|
type: "success"
|
||||||
this.$emit("select_user_address")
|
})
|
||||||
this.dialogVisible = false
|
// 保存成功后把最新地址信息回传给父组件,便于父组件刷新后自动选中。
|
||||||
} else {
|
this.$emit("select_user_address", savedAddress)
|
||||||
this.$message.error(resp.msg)
|
this.dialogVisible = false
|
||||||
}
|
} else {
|
||||||
|
this.$message.error(resp.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -375,6 +375,25 @@ const optionSelect = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 统一带出地址、收货人和联系电话,避免多个入口重复拼装地址逻辑。
|
||||||
|
applyAddressSelection(selectedAddress) {
|
||||||
|
if (!selectedAddress) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const addressValue = selectedAddress.province + selectedAddress.city + selectedAddress.county + selectedAddress.addressDetail
|
||||||
|
this.$set(this.contactForm, "receiveAddress", addressValue)
|
||||||
|
this.onAddressChange(addressValue)
|
||||||
|
},
|
||||||
|
// 首次确认选择时,如果存在默认地址,则自动带出默认地址及联系人信息。
|
||||||
|
applyDefaultAddressIfNeeded() {
|
||||||
|
if (this.hasSubmittedBefore || this.contactForm.receiveAddress || !this.addressOptions || this.addressOptions.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const defaultAddress = this.addressOptions.find((item) => item.isDefault)
|
||||||
|
if (defaultAddress) {
|
||||||
|
this.applyAddressSelection(defaultAddress)
|
||||||
|
}
|
||||||
|
},
|
||||||
openAddress() {
|
openAddress() {
|
||||||
this.$refs.addressDialog.dialogVisible = true
|
this.$refs.addressDialog.dialogVisible = true
|
||||||
this.$refs.addressDialog.formData = {userId: this.userId}
|
this.$refs.addressDialog.formData = {userId: this.userId}
|
||||||
@@ -387,7 +406,9 @@ const optionSelect = {
|
|||||||
this.selectedRadioId = null
|
this.selectedRadioId = null
|
||||||
this.contactForm = {
|
this.contactForm = {
|
||||||
mobile: "",
|
mobile: "",
|
||||||
receiveAddress: ""
|
receiveAddress: "",
|
||||||
|
userName: "",
|
||||||
|
userSign: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getProjectInfo()
|
this.getProjectInfo()
|
||||||
@@ -448,6 +469,10 @@ const optionSelect = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 首次确认选择且没有历史记录时,尝试自动带出默认收货地址。
|
||||||
|
if (this.projectInfo.provideMode === 3) {
|
||||||
|
this.applyDefaultAddressIfNeeded()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 地址回显
|
// 地址回显
|
||||||
@@ -606,11 +631,32 @@ const optionSelect = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 获取收货地址
|
// 获取收货地址
|
||||||
async getAddress() {
|
getAddress(savedAddress) {
|
||||||
const resp = await this.$axios.post("/platform/welfare/addressManage/selectUserAddress",{userId:this.userId})
|
const hasAddressOptions = this.addressOptions && this.addressOptions.length > 0
|
||||||
if (resp.code === 0) {
|
this.$axios.post("/platform/welfare/addressManage/selectUserAddress", {userId: this.userId}).then((resp) => {
|
||||||
this.addressOptions = resp.data
|
if (resp.code === 0) {
|
||||||
}
|
this.addressOptions = resp.data
|
||||||
|
// 新增地址后,如果原来没有地址或当前未选择地址,则默认带入最新地址并自动回填联系人信息。
|
||||||
|
if (savedAddress && (!hasAddressOptions || !this.contactForm.receiveAddress)) {
|
||||||
|
const selectedAddress = this.addressOptions.find((item) => {
|
||||||
|
return item.id === savedAddress.id ||
|
||||||
|
(item.province === savedAddress.province &&
|
||||||
|
item.city === savedAddress.city &&
|
||||||
|
item.county === savedAddress.county &&
|
||||||
|
item.addressDetail === savedAddress.addressDetail &&
|
||||||
|
item.userName === savedAddress.userName &&
|
||||||
|
item.tel === savedAddress.tel)
|
||||||
|
})
|
||||||
|
if (selectedAddress) {
|
||||||
|
this.applyAddressSelection(selectedAddress)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.applyDefaultAddressIfNeeded()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(resp.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
selectNumChange(index, newValue) {
|
selectNumChange(index, newValue) {
|
||||||
const option = this.projectInfo.options[index];
|
const option = this.projectInfo.options[index];
|
||||||
|
|||||||
Reference in New Issue
Block a user