Commit ef113548 authored by gengshaojing's avatar gengshaojing

add: 配送管理

parent 21fdcb9c
...@@ -39,20 +39,6 @@ ...@@ -39,20 +39,6 @@
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)" element-loading-background="rgba(0, 0, 0, 0.8)"
> >
<!-- 自提点表单 -->
<!-- <div class="search_form_wrapper">-->
<!-- <p class="title">自提点设置</p>-->
<!-- <el-form ref="form" label-width="80px" inline @submit.prevent>-->
<!-- <el-form-item>-->
<!-- <el-input style="width: 250px" class="set" v-model="selfLiftingPoint" placeholder="自提点名称/自提点联系人"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" @click="getPlaceList">搜索</el-button>-->
<!-- <el-button type="primary" @click="dialogFormVisible = true">添加自提点</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- 自提点列表 -->
<div class="tabla-wrapper"> <div class="tabla-wrapper">
<p class="checked">{{ `已选 ${checkedNum}` }}</p> <p class="checked">{{ `已选 ${checkedNum}` }}</p>
<el-table <el-table
...@@ -63,10 +49,10 @@ ...@@ -63,10 +49,10 @@
border border
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@select-all="selectall" :row-key="getRowKeys"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column align="center" type="selection" width="80"></el-table-column> <el-table-column align="center" type="selection" :reserve-selection="true" width="80"></el-table-column>
<el-table-column prop="name" label="自提点名称" align="center" width="width"></el-table-column> <el-table-column prop="name" label="自提点名称" align="center" width="width"></el-table-column>
<el-table-column align="center" prop="business_circle_name" label="商圈"></el-table-column> <el-table-column align="center" prop="business_circle_name" label="商圈"></el-table-column>
<el-table-column prop="location" align="center" label="位置" width="width"></el-table-column> <el-table-column prop="location" align="center" label="位置" width="width"></el-table-column>
...@@ -91,50 +77,6 @@ ...@@ -91,50 +77,6 @@
></el-pagination> ></el-pagination>
</div> </div>
</div> </div>
<!-- 添加自提点dialog -->
<el-dialog
:close-on-click-modal="false"
:center="true"
title="添加自提点"
v-model="dialogFormVisible"
:show-close="false"
custom-class="add_takePlace_dialog"
>
<el-form :model="form" :rules="rules" ref="ruleForm" :inline="true" label-position="left" label-width="120px">
<el-form-item label="自提点名称" prop="name">
<el-input class="dialog-input" v-model="form.name" maxlength="30" show-word-limit autocomplete="off"></el-input>
</el-form-item>
<br />
<el-form-item label="位置" prop="location" class="location_wrapper" style="width: 100%">
<div class="location_input_wrapper">
<el-input class="dialog-input" v-model="form.location" placeholder="" :disabled="true"></el-input>
</div>
<div class="location_text_wrapper">
<el-button type="primary" @click="mapDialogVisible = true">从高德获取坐标</el-button>
</div>
</el-form-item>
<br />
<p class="location">{{ form.location }}</p>
<el-form-item prop="address" label="详细地址">
<el-input class="dialog-input" v-model="form.address"></el-input>
</el-form-item>
<br />
<el-form-item label="自提点联系人" prop="contactor">
<el-input class="dialog-input" v-model="form.contactor" maxlength="30" show-word-limit></el-input>
</el-form-item>
<br />
<el-form-item prop="phone" type="tel" label="联系电话">
<el-input class="dialog-input" v-model="form.phone"></el-input>
</el-form-item>
<br />
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="saveTakePlace"> </el-button>
<el-button @click="cancelSaveTakePlace"> </el-button>
</span>
</template>
</el-dialog>
<!-- 地图 dialog --> <!-- 地图 dialog -->
<el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%"> <el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%">
<my-map class="my-map" @getMapInfo="getMapInfo" @hideMapDialog="mapDialogVisible = false" /> <my-map class="my-map" @getMapInfo="getMapInfo" @hideMapDialog="mapDialogVisible = false" />
...@@ -215,6 +157,7 @@ ...@@ -215,6 +157,7 @@
searchParams: {}, searchParams: {},
stagSpellOrderSetArr: [], stagSpellOrderSetArr: [],
searchFlag: false, searchFlag: false,
multipleSelection: [],
}; };
}, },
computed: { computed: {
...@@ -251,8 +194,6 @@ ...@@ -251,8 +194,6 @@
spellOrderSetArr: { spellOrderSetArr: {
// 监听props属性 展示自提点列表(APi默认勾选的) // 监听props属性 展示自提点列表(APi默认勾选的)
handler: async function (newList) { handler: async function (newList) {
// this.stagSpellOrderSetArr = this.setTableListData(newList);
// this.checkedTakePlacelist = this.setTableListData(newList);
this.currentCheckedTakePlacelist = this.setTableListData(newList); this.currentCheckedTakePlacelist = this.setTableListData(newList);
this.checkedNum = newList.length; this.checkedNum = newList.length;
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
...@@ -260,10 +201,10 @@ ...@@ -260,10 +201,10 @@
// 时间赋值 // 时间赋值
this.startDate = this.startTime; this.startDate = this.startTime;
this.endDate = this.endTime; this.endDate = this.endTime;
// this.checkedTakePlacelist = this.setTableListData(this.spellOrderSetArr);
// 选中的自提点列表 const currentIds = this.currentCheckedTakePlacelist.map((item) => item.id);
// this.mergeCheckedList(this.checkedTakePlacelist); const currentItem = this.takePlacelist.filter((item) => currentIds.includes(item.id));
// this.signal = true; this.toggleSelection(currentItem);
} }
}, },
deep: true, deep: true,
...@@ -271,12 +212,6 @@ ...@@ -271,12 +212,6 @@
}, },
}, },
methods: { methods: {
selectall() {
console.log("selectall");
if (this.currentCheckedTakePlacelist.length === 0) {
this.checkedTakePlacelist = [];
}
},
/* API */ /* API */
// 获取自提点 // 获取自提点
async getPlaceList(params = {}) { async getPlaceList(params = {}) {
...@@ -290,39 +225,21 @@ ...@@ -290,39 +225,21 @@
this.pageLoading = false; this.pageLoading = false;
this.takePlacelist = this.setTableListData(data.result.list); this.takePlacelist = this.setTableListData(data.result.list);
this.pageCount = data.result.total; this.pageCount = data.result.total;
} catch (e) {
console.log("this.stagSpellOrderSetArrthis.checkedTakePlacelist", this.checkedTakePlacelist);
this.searchFlag = true;
// this.mergeCheckedList();
let currentIdList = this.currentCheckedTakePlacelist.map((item) => {
return item.id;
});
let list = this.takePlacelist.filter((item) => {
return currentIdList.includes(item.id);
});
this.checkedNum = list.length;
list.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row);
});
this.$nextTick(() => {
this.searchFlag = false;
});
} catch {
this.pageLoading = false; this.pageLoading = false;
ElMessage.error("加载失败"); ElMessage.error("加载失败");
console.log(e);
} }
}, },
getRowKeys(row) {
return row.id;
},
// 复选框(提供给父组件)
handleSelectionChange(val) { handleSelectionChange(val) {
if (this.searchFlag) { console.log("handleSelectionChange");
return; console.log(val);
} this.multipleSelection = val;
console.log("手动选中手动选中手动选中手动选中手动选中手动选中手动选中");
this.currentCheckedTakePlacelist = val; // 当前勾选的列表
this.checkedNum = val.length; this.checkedNum = val.length;
let takePlaceIds = ""; let takePlaceIds = "";
val.forEach((item) => { val.forEach((item) => {
...@@ -335,6 +252,16 @@ ...@@ -335,6 +252,16 @@
this.$emit("getTakeTakePlaceListFromChild", takePlaceIds); this.$emit("getTakeTakePlaceListFromChild", takePlaceIds);
}, },
toggleSelection(rows) {
if (rows) {
rows.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
/* API */ /* API */
// 删除自提点 // 删除自提点
async deletePlace() { async deletePlace() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment