|
|
|
@ -104,6 +104,33 @@ |
|
|
|
<check-password ref="checkPass" @on-success="resetPass" /> |
|
|
|
|
|
|
|
<withdraw-record-modal ref="withdrawRecordModal" :table-size="tableSize" /> |
|
|
|
<Modal :title="gateLocationTitle" v-model="gateLocationVisible" :mask-closable="false" :width="640"> |
|
|
|
<div style="display: flex; margin-bottom: 16px;"> |
|
|
|
<Input v-model="gateLocationName" clearable placeholder="请输入送达地点" style="width: 360px" |
|
|
|
@on-enter="saveGateLocation" /> |
|
|
|
<Button type="primary" style="margin-left: 8px" :loading="gateLocationSaving" @click="saveGateLocation">新增</Button> |
|
|
|
</div> |
|
|
|
<div v-if="gateLocationLoading" style="padding: 24px 0; text-align: center; color: #999;">加载中</div> |
|
|
|
<div v-else-if="!gateLocationList.length" style="padding: 24px 0; text-align: center; color: #999;">暂无送达地点</div> |
|
|
|
<div v-else> |
|
|
|
<div v-for="item in gateLocationList" :key="item.id" |
|
|
|
style="display: flex; align-items: center; margin-bottom: 10px;"> |
|
|
|
<Input v-if="gateLocationEditingId === item.id" v-model="gateLocationEditingName" style="flex: 1;" /> |
|
|
|
<span v-else style="flex: 1;">{{ item.locationName }}</span> |
|
|
|
<Button v-if="gateLocationEditingId === item.id" type="primary" size="small" style="margin-left: 8px" |
|
|
|
:loading="gateLocationSaving" @click="confirmEditGateLocation(item)">保存</Button> |
|
|
|
<Button v-if="gateLocationEditingId === item.id" size="small" style="margin-left: 8px" |
|
|
|
@click="cancelEditGateLocation">取消</Button> |
|
|
|
<Button v-if="gateLocationEditingId !== item.id" size="small" style="margin-left: 8px" |
|
|
|
@click="startEditGateLocation(item)">编辑</Button> |
|
|
|
<Button v-if="gateLocationEditingId !== item.id" type="error" size="small" style="margin-left: 8px" |
|
|
|
@click="removeGateLocation(item)">删除</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="footer"> |
|
|
|
<Button type="text" @click="gateLocationVisible = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
<addEdit :data="form" :type="showType" v-model="showUser" @on-submit="getDataList" /> |
|
|
|
|
|
|
|
<mernage :data="form" ref="dialog" :type="showTypeMe" v-model="showmernage" @on-submit="getDataList" /> |
|
|
|
@ -139,9 +166,13 @@ |
|
|
|
disableShop, |
|
|
|
enableShop, |
|
|
|
getAllShopData, |
|
|
|
getShopData |
|
|
|
getShopData, |
|
|
|
getShopGateLocationList, |
|
|
|
saveShopGateLocation, |
|
|
|
deleteShopGateLocation |
|
|
|
} from "@/api/app"; |
|
|
|
import { SEARCH_HISTORY_KEYS, getSearchHistory, saveSearchHistory } from "@/libs/searchHistory"; |
|
|
|
const TARGET_GATE_LOCATION_REGION_ID = "2110300467664916480"; |
|
|
|
export default { |
|
|
|
name: "user-manage", |
|
|
|
components: { |
|
|
|
@ -201,6 +232,15 @@ |
|
|
|
remark: "", |
|
|
|
}, |
|
|
|
form: {}, |
|
|
|
gateLocationVisible: false, |
|
|
|
gateLocationLoading: false, |
|
|
|
gateLocationSaving: false, |
|
|
|
gateLocationShopId: "", |
|
|
|
gateLocationShopName: "", |
|
|
|
gateLocationName: "", |
|
|
|
gateLocationList: [], |
|
|
|
gateLocationEditingId: "", |
|
|
|
gateLocationEditingName: "", |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
title: "排名", |
|
|
|
@ -293,7 +333,7 @@ |
|
|
|
{ |
|
|
|
title: "操作", |
|
|
|
key: "action", |
|
|
|
width: 280, |
|
|
|
width: String(JSON.parse(this.getStore("userInfo")).departmentId) === TARGET_GATE_LOCATION_REGION_ID ? 360 : 280, |
|
|
|
align: "center", |
|
|
|
fixed: "right", |
|
|
|
render: (h, params) => { |
|
|
|
@ -414,7 +454,23 @@ |
|
|
|
}, |
|
|
|
"提现记录" |
|
|
|
), |
|
|
|
]); |
|
|
|
].concat(String(this.searchForm.regionId) === TARGET_GATE_LOCATION_REGION_ID ? [ |
|
|
|
h("Divider", { |
|
|
|
props: { |
|
|
|
type: "vertical", |
|
|
|
}, |
|
|
|
}), |
|
|
|
h( |
|
|
|
"a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.openGateLocations(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"送达地点" |
|
|
|
), |
|
|
|
] : [])); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
@ -422,6 +478,11 @@ |
|
|
|
total: 0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
gateLocationTitle() { |
|
|
|
return this.gateLocationShopName ? "送达地点 - " + this.gateLocationShopName : "送达地点"; |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
this.getDataList(); |
|
|
|
@ -687,6 +748,107 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
openGateLocations(row) { |
|
|
|
if (String(this.searchForm.regionId) !== TARGET_GATE_LOCATION_REGION_ID) return; |
|
|
|
this.gateLocationShopId = row.id; |
|
|
|
this.gateLocationShopName = row.shopName || ""; |
|
|
|
this.gateLocationName = ""; |
|
|
|
this.gateLocationEditingId = ""; |
|
|
|
this.gateLocationEditingName = ""; |
|
|
|
this.gateLocationVisible = true; |
|
|
|
this.loadGateLocations(); |
|
|
|
}, |
|
|
|
loadGateLocations() { |
|
|
|
if (!this.gateLocationShopId) return; |
|
|
|
this.gateLocationLoading = true; |
|
|
|
getShopGateLocationList({ |
|
|
|
shopId: this.gateLocationShopId |
|
|
|
}).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.gateLocationList = res.result || []; |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.gateLocationLoading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
saveGateLocation() { |
|
|
|
const locationName = String(this.gateLocationName || "").trim(); |
|
|
|
if (!locationName) { |
|
|
|
this.$Message.warning("请输入送达地点"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (locationName.length > 50) { |
|
|
|
this.$Message.warning("送达地点不能超过50个字"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.gateLocationSaving = true; |
|
|
|
saveShopGateLocation({ |
|
|
|
shopId: this.gateLocationShopId, |
|
|
|
locationName: locationName |
|
|
|
}).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.gateLocationName = ""; |
|
|
|
this.$Message.success("保存成功"); |
|
|
|
this.loadGateLocations(); |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.gateLocationSaving = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
startEditGateLocation(item) { |
|
|
|
this.gateLocationEditingId = item.id; |
|
|
|
this.gateLocationEditingName = item.locationName || ""; |
|
|
|
}, |
|
|
|
cancelEditGateLocation() { |
|
|
|
this.gateLocationEditingId = ""; |
|
|
|
this.gateLocationEditingName = ""; |
|
|
|
}, |
|
|
|
confirmEditGateLocation(item) { |
|
|
|
const locationName = String(this.gateLocationEditingName || "").trim(); |
|
|
|
if (!locationName) { |
|
|
|
this.$Message.warning("请输入送达地点"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (locationName.length > 50) { |
|
|
|
this.$Message.warning("送达地点不能超过50个字"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.gateLocationSaving = true; |
|
|
|
saveShopGateLocation({ |
|
|
|
id: item.id, |
|
|
|
shopId: this.gateLocationShopId, |
|
|
|
locationName: locationName |
|
|
|
}).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.cancelEditGateLocation(); |
|
|
|
this.$Message.success("保存成功"); |
|
|
|
this.loadGateLocations(); |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.gateLocationSaving = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
removeGateLocation(item) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "确认删除", |
|
|
|
content: "确认删除送达地点「" + (item.locationName || "") + "」?", |
|
|
|
loading: true, |
|
|
|
onOk: () => { |
|
|
|
deleteShopGateLocation({ |
|
|
|
id: item.id |
|
|
|
}).then((res) => { |
|
|
|
this.$Modal.remove(); |
|
|
|
if (res.success) { |
|
|
|
if (this.gateLocationEditingId === item.id) { |
|
|
|
this.cancelEditGateLocation(); |
|
|
|
} |
|
|
|
this.$Message.success("删除成功"); |
|
|
|
this.loadGateLocations(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|