This commit is contained in:
2026-06-05 09:56:23 +08:00
@@ -585,7 +585,7 @@ layout("/layouts/platform.html"){
<courier-number-info ref="courierNumberInfo"></courier-number-info> <courier-number-info ref="courierNumberInfo"></courier-number-info>
<el-dialog :visible.sync="addWelfareListDialog" title="添加福利名单" width="50%"> <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-form-item label="福利项目名称">
<el-input :value="addWelfareListData.projectName" readonly></el-input> <el-input :value="addWelfareListData.projectName" readonly></el-input>
</el-form-item> </el-form-item>
@@ -621,6 +621,31 @@ layout("/layouts/platform.html"){
<script> <script>
<!--#include("/platform/welfare/include/common.js"){}#--> <!--#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({ const vue = new Vue({
el: "#app", el: "#app",
mixins: [initTableMixins, minixs], mixins: [initTableMixins, minixs],
@@ -671,7 +696,7 @@ layout("/layouts/platform.html"){
tableColumns: commonColumns.concat([ tableColumns: commonColumns.concat([
{ prop: "isChoose", label: "是否选择", width: "100px", sortable: true }, { prop: "isChoose", label: "是否选择", width: "100px", sortable: true },
{ prop: "gist_list", label: "所选福利"}, { prop: "gist_list", label: "所选福利"},
{ prop: "receiveAddress", label: "取货门店"}, // { prop: "receiveAddress", label: "取货门店"},
{ prop: "userSign", label: "签字", width: "100px", checked: 0 }, { prop: "userSign", label: "签字", width: "100px", checked: 0 },
{ prop: "isAudit", label: "是否核对" }, { prop: "isAudit", label: "是否核对" },
{ prop: "auditTime", label: "核对时间", checked: 0 } { prop: "auditTime", label: "核对时间", checked: 0 }
@@ -698,7 +723,7 @@ layout("/layouts/platform.html"){
addressOptions: [], addressOptions: [],
addressDialogVisible: false, addressDialogVisible: false,
dzOptions: chengShiList, dzOptions: getWelfareReceiveDzOptions(),
judgmentAuthority, judgmentAuthority,
@@ -890,9 +915,10 @@ layout("/layouts/platform.html"){
} }
}, },
openAddress() { openAddress() {
this.formData = { this.$set(this, "dzOptions", getWelfareReceiveDzOptions())
this.$set(this, "formData", {
userId: this.editWelfareData.userId userId: this.editWelfareData.userId
} })
this.addressDialogVisible = true this.addressDialogVisible = true
if (this.$refs["addForm"]) this.$refs["addForm"].resetFields() if (this.$refs["addForm"]) this.$refs["addForm"].resetFields()
}, },
@@ -1009,25 +1035,31 @@ layout("/layouts/platform.html"){
doEditWelfareData() { doEditWelfareData() {
this.$refs["editWelfareForm"].validate(async (valid) => { this.$refs["editWelfareForm"].validate(async (valid) => {
if (valid) { if (!valid) {
//获取用户当前选择的数量 if (this.ifReceiveAddress && !this.editWelfareData.receiveAddress) {
const selectNums = this.welfareOptions.map((v) => v.selectNum) this.notifyWarning("请选择收货地址")
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum === 0) {
this.notifyWarning("请先选择份数")
return return
} }
const resp = await $.post(loc() + "/doEditWelfareData", { this.notifyWarning("请完善福利选择信息")
editWelfareData: JSON.stringify(this.editWelfareData), return
welfareOptions: JSON.stringify(this.welfareOptions) }
}) //获取用户当前选择的数量
this.exportWelfareListDialog = false const selectNums = this.welfareOptions.map((v) => v.selectNum)
if (resp.code === 0) { const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
this.notifySuccess(resp.msg) if (sum === 0) {
this.pageData() this.notifyWarning("请先选择份数")
} else { return
this.notifyWarning(resp.msg) }
} 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)
} }
}) })
}, },