|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="delivery-content">
|
|
<div class="delivery-content">
|
|
<div>
|
|
<div>
|
|
- <el-button type="primary">保存操作</el-button>
|
|
|
|
|
|
+ <!-- <el-button type="primary">保存操作</el-button> -->
|
|
</div>
|
|
</div>
|
|
<div class="recommend">
|
|
<div class="recommend">
|
|
<div class="title">
|
|
<div class="title">
|
|
@@ -10,12 +10,24 @@
|
|
<span>用户选择非聚合配送发单时,优先选中的运力置顶显示,提高您的下单效率</span>
|
|
<span>用户选择非聚合配送发单时,优先选中的运力置顶显示,提高您的下单效率</span>
|
|
</div>
|
|
</div>
|
|
<div class="delivery-list">
|
|
<div class="delivery-list">
|
|
- <div class="item" v-for="(v,i) in list" :key="i">
|
|
|
|
|
|
+ <div @click="changeStatus(v.deliveryId)" class="item" v-for="(v,i) in list" :key="i">
|
|
<img :src="v.pcLogo" class="icon" />
|
|
<img :src="v.pcLogo" class="icon" />
|
|
- <div class="mantle"></div>
|
|
|
|
|
|
+ <div v-if="shieldDeliveryIds.includes(String(v.deliveryId))" class="mask mantle">
|
|
|
|
+ {{v.name}}已屏蔽
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="billDeliveryIds.includes(String(v.deliveryId))" class="mask recommend-delivery">
|
|
|
|
+ {{v.name}}已推荐
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-dialog title="请选择对当前运力的操作!" :visible.sync="centerDialogVisible" width="600px" center>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="success" @click="changeDelivery(1)">推荐该运力</el-button>
|
|
|
|
+ <el-button type="danger" @click="changeDelivery(2)">屏蔽该运力</el-button>
|
|
|
|
+ <el-button type="primary" @click="changeDelivery(3)">恢复普通运力</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
<!-- <div class="recommend">
|
|
<!-- <div class="recommend">
|
|
<div class="title">
|
|
<div class="title">
|
|
<span>屏蔽运力</span>
|
|
<span>屏蔽运力</span>
|
|
@@ -43,6 +55,7 @@ export default {
|
|
list: [],
|
|
list: [],
|
|
billDeliveryIds: "", // 推荐运力ID
|
|
billDeliveryIds: "", // 推荐运力ID
|
|
shieldDeliveryIds: "", // 屏蔽运力ID
|
|
shieldDeliveryIds: "", // 屏蔽运力ID
|
|
|
|
+ centerDialogVisible: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -51,6 +64,39 @@ export default {
|
|
},
|
|
},
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ changeStatus(id) {
|
|
|
|
+ this.id = id;
|
|
|
|
+ this.centerDialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+ changeDelivery(type) {
|
|
|
|
+ console.log(2222);
|
|
|
|
+ // 推荐该运力
|
|
|
|
+ if (type === 1) {
|
|
|
|
+ this.shieldDeliveryIds = this.shieldDeliveryIds.filter((v) => {
|
|
|
|
+ return v !== String(this.id);
|
|
|
|
+ });
|
|
|
|
+ this.billDeliveryIds.push(String(this.id));
|
|
|
|
+ this.billDeliveryIds = [...new Set(this.billDeliveryIds)];
|
|
|
|
+ }
|
|
|
|
+ // 屏蔽该运力
|
|
|
|
+ if (type === 2) {
|
|
|
|
+ this.billDeliveryIds = this.billDeliveryIds.filter((v) => {
|
|
|
|
+ return v !== String(this.id);
|
|
|
|
+ });
|
|
|
|
+ this.shieldDeliveryIds.push(String(this.id));
|
|
|
|
+ this.shieldDeliveryIds = [...new Set(this.shieldDeliveryIds)];
|
|
|
|
+ }
|
|
|
|
+ // 恢复为普通运力
|
|
|
|
+ if (type === 3) {
|
|
|
|
+ this.billDeliveryIds = this.billDeliveryIds.filter((v) => {
|
|
|
|
+ return v !== String(this.id);
|
|
|
|
+ });
|
|
|
|
+ this.shieldDeliveryIds = this.shieldDeliveryIds.filter((v) => {
|
|
|
|
+ return v !== String(this.id);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.updateConfig();
|
|
|
|
+ },
|
|
getDeliveryFloorList() {
|
|
getDeliveryFloorList() {
|
|
getDeliveryFloorList().then((res) => {
|
|
getDeliveryFloorList().then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -66,8 +112,31 @@ export default {
|
|
getConfig() {
|
|
getConfig() {
|
|
getConfig().then((res) => {
|
|
getConfig().then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.billDeliveryIds = res.data.billDeliveryIds;
|
|
|
|
- this.shieldDeliveryIds = res.data.shieldDeliveryIds;
|
|
|
|
|
|
+ this.billDeliveryIds = res.data.billDeliveryIds.split(",");
|
|
|
|
+ this.shieldDeliveryIds = res.data.shieldDeliveryIds.split(",");
|
|
|
|
+ let a = new Set(this.shieldDeliveryIds);
|
|
|
|
+ let b = new Set(this.billDeliveryIds);
|
|
|
|
+ let difference = new Set([...a].filter((x) => !b.has(x)));
|
|
|
|
+ this.shieldDeliveryIds = [...difference];
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.centerDialogVisible = false
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ updateConfig() {
|
|
|
|
+ let billDeliveryIds = this.billDeliveryIds.toString();
|
|
|
|
+ let shieldDeliveryIds = this.shieldDeliveryIds.toString();
|
|
|
|
+ updateConfig({ billDeliveryIds, shieldDeliveryIds }).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "修改成功!",
|
|
|
|
+ });
|
|
|
|
+ this.getConfig();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
type: "error",
|
|
type: "error",
|
|
@@ -76,22 +145,6 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- },
|
|
|
|
- updateConfig() {
|
|
|
|
- updateConfig().then((res) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "修改成功!",
|
|
|
|
- });
|
|
|
|
- this.getConfig();
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- type: "error",
|
|
|
|
- message: res.msg,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -124,25 +177,33 @@ export default {
|
|
padding: 30px 18px 0;
|
|
padding: 30px 18px 0;
|
|
.item {
|
|
.item {
|
|
position: relative;
|
|
position: relative;
|
|
- font-size: 0;
|
|
|
|
- width: 166px;
|
|
|
|
- height: 50px;
|
|
|
|
- border-radius: 25px;
|
|
|
|
- overflow: hidden;
|
|
|
|
- margin-right: 50px;
|
|
|
|
- margin-bottom: 30px;
|
|
|
|
- .mantle{
|
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin: 0 30px 30px 0;
|
|
|
|
+ .mask {
|
|
position: absolute;
|
|
position: absolute;
|
|
-
|
|
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 129px;
|
|
|
|
+ height: 40px;
|
|
|
|
+ background: #999;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ border-radius: 25px;
|
|
|
|
+ opacity: 0.8;
|
|
|
|
+ }
|
|
|
|
+ .mantle {
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ .recommend-delivery {
|
|
|
|
+ color: red;
|
|
}
|
|
}
|
|
.icon {
|
|
.icon {
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
|
|
+ width: 129px;
|
|
|
|
+ height: 40px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .item-opcity {
|
|
|
|
- opacity: 0.4;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|