Merge branch 'main' of https://dd3skj.picp.vip/zhengziru/zhgh_hrbnu
This commit is contained in:
@@ -585,7 +585,7 @@ layout("/layouts/platform.html"){
|
||||
<courier-number-info ref="courierNumberInfo"></courier-number-info>
|
||||
|
||||
<el-dialog :visible.sync="addWelfareListDialog" title="添加福利名单" width="50%">
|
||||
<el-form :model="addWelfareListData" label-width="120px" ref="editWelfareForm">
|
||||
<el-form :model="addWelfareListData" label-width="120px" ref="addWelfareListForm">
|
||||
<el-form-item label="福利项目名称">
|
||||
<el-input :value="addWelfareListData.projectName" readonly></el-input>
|
||||
</el-form-item>
|
||||
@@ -621,6 +621,31 @@ layout("/layouts/platform.html"){
|
||||
<script>
|
||||
<!--#include("/platform/welfare/include/common.js"){}#-->
|
||||
|
||||
const welfareReceiveAreaList = ["道里区", "南岗区", "道外区", "香坊区", "呼兰区", "松北区", "阿城区", "双城区", "平房区"]
|
||||
|
||||
// 添加收货地址时,地址信息选择范围与用户选择福利页面保持一致。
|
||||
function getWelfareReceiveDzOptions() {
|
||||
const province = chengShiList.find((c) => c.label === "黑龙江省")
|
||||
if (!province) {
|
||||
return []
|
||||
}
|
||||
const city = province.children.find((c) => c.label === "哈尔滨市")
|
||||
if (!city) {
|
||||
return []
|
||||
}
|
||||
return [
|
||||
{
|
||||
...province,
|
||||
children: [
|
||||
{
|
||||
...city,
|
||||
children: city.children.filter((county) => welfareReceiveAreaList.includes(county.label))
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins, minixs],
|
||||
@@ -671,7 +696,7 @@ layout("/layouts/platform.html"){
|
||||
tableColumns: commonColumns.concat([
|
||||
{ prop: "isChoose", label: "是否选择", width: "100px", sortable: true },
|
||||
{ prop: "gist_list", label: "所选福利"},
|
||||
{ prop: "receiveAddress", label: "取货门店"},
|
||||
// { prop: "receiveAddress", label: "取货门店"},
|
||||
{ prop: "userSign", label: "签字", width: "100px", checked: 0 },
|
||||
{ prop: "isAudit", label: "是否核对" },
|
||||
{ prop: "auditTime", label: "核对时间", checked: 0 }
|
||||
@@ -698,7 +723,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
addressOptions: [],
|
||||
addressDialogVisible: false,
|
||||
dzOptions: chengShiList,
|
||||
dzOptions: getWelfareReceiveDzOptions(),
|
||||
|
||||
judgmentAuthority,
|
||||
|
||||
@@ -890,9 +915,10 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
openAddress() {
|
||||
this.formData = {
|
||||
this.$set(this, "dzOptions", getWelfareReceiveDzOptions())
|
||||
this.$set(this, "formData", {
|
||||
userId: this.editWelfareData.userId
|
||||
}
|
||||
})
|
||||
this.addressDialogVisible = true
|
||||
if (this.$refs["addForm"]) this.$refs["addForm"].resetFields()
|
||||
},
|
||||
@@ -1009,25 +1035,31 @@ layout("/layouts/platform.html"){
|
||||
|
||||
doEditWelfareData() {
|
||||
this.$refs["editWelfareForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map((v) => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
if (sum === 0) {
|
||||
this.notifyWarning("请先选择份数")
|
||||
if (!valid) {
|
||||
if (this.ifReceiveAddress && !this.editWelfareData.receiveAddress) {
|
||||
this.notifyWarning("请选择收货地址")
|
||||
return
|
||||
}
|
||||
const resp = await $.post(loc() + "/doEditWelfareData", {
|
||||
editWelfareData: JSON.stringify(this.editWelfareData),
|
||||
welfareOptions: JSON.stringify(this.welfareOptions)
|
||||
})
|
||||
this.exportWelfareListDialog = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
this.notifyWarning("请完善福利选择信息")
|
||||
return
|
||||
}
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map((v) => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
if (sum === 0) {
|
||||
this.notifyWarning("请先选择份数")
|
||||
return
|
||||
}
|
||||
const resp = await $.post(loc() + "/doEditWelfareData", {
|
||||
editWelfareData: JSON.stringify(this.editWelfareData),
|
||||
welfareOptions: JSON.stringify(this.welfareOptions)
|
||||
})
|
||||
this.exportWelfareListDialog = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user