wangfukang 3 weeks ago
parent
commit
3bfa70b3e1
  1. 8
      src/api/index.js
  2. 127
      src/views/app/business/lineManage/addEdit.vue
  3. 143
      src/views/app/business/lineManage/lineManage.vue
  4. 51
      src/views/app/business/logistics/logistics.vue

8
src/api/index.js

@ -832,6 +832,14 @@ export const getBaseDeliveryFeeSetting = (params) => {
export const saveBaseDeliveryFeeSetting = (params) => { export const saveBaseDeliveryFeeSetting = (params) => {
return postBodyRequest('/mall/admin/seckillGroup/baseDeliveryFee/save', params) return postBodyRequest('/mall/admin/seckillGroup/baseDeliveryFee/save', params)
} }
// 查询校区配送开关
export const getShopAreaDeliverySwitch = (params) => {
return getRequest('/app/shopArea/deliverySwitch/get', params)
}
// 保存校区配送开关
export const saveShopAreaDeliverySwitch = (params) => {
return postRequest('/app/shopArea/deliverySwitch/update', params)
}
// 查询i/e审核管理配置 // 查询i/e审核管理配置
export const getIeAuditSetting = (params) => { export const getIeAuditSetting = (params) => {
return getRequest('/app/ie/admin/audit-setting', params) return getRequest('/app/ie/admin/audit-setting', params)

127
src/views/app/business/lineManage/addEdit.vue

@ -10,14 +10,15 @@
<Row :gutter="32"> <Row :gutter="32">
<Col span="24"> <Col span="24">
<FormItem label="广告位置" prop="position"> <FormItem label="广告位置" prop="position">
<Select v-model="form.position" style="width:200px"> <Input v-if="isHomePopup" value="首页弹窗" disabled />
<Select v-else v-model="form.position" style="width:200px">
<Option v-for="item in dictData" :value="item.value" :key="item.value">{{ item.title }} <Option v-for="item in dictData" :value="item.value" :key="item.value">{{ item.title }}
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="32"> <Row :gutter="32" v-if="!isHomePopup">
<Col span="12"> <Col span="12">
<FormItem label="商家名" prop="value"> <FormItem label="商家名" prop="value">
<Select v-model="form.merchantId" filterable @on-change="checkShop" <Select v-model="form.merchantId" filterable @on-change="checkShop"
@ -31,16 +32,16 @@
<Row :gutter="32"> <Row :gutter="32">
<Col span="24"> <Col span="24">
<FormItem label="广告图" prop="adImage"> <FormItem :label="isHomePopup ? '弹窗图片' : '广告图'" prop="adImage">
<div v-for="(item,index) in adList" :key="index" style="display: flex;line-height: 30px;"> <div v-for="(item,index) in adList" :key="index" style="display: flex;line-height: 30px;">
<upload-pic-input v-model="item.pic"></upload-pic-input> <upload-pic-input v-model="item.pic"></upload-pic-input>
<Icon @click="delOne(index)" type="ios-trash-outline" v-if="adList.length>1" size="30" <Icon @click="delOne(index)" type="ios-trash-outline" v-if="!isHomePopup && adList.length>1" size="30"
color="red" /> color="red" />
</div> </div>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="32" v-if="form.position != 'home_top'"> <Row :gutter="32" v-if="!isHomePopup && form.position != 'home_top'">
<Col span="24"> <Col span="24">
<FormItem label="广告标题" prop="title"> <FormItem label="广告标题" prop="title">
<Input v-model="form.title" placeholder="请输入广告标题" /> <Input v-model="form.title" placeholder="请输入广告标题" />
@ -54,7 +55,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="32" v-if="form.position != 'home_top'"> <Row :gutter="32" v-if="!isHomePopup && form.position != 'home_top'">
<Col span="24"> <Col span="24">
<FormItem label="广告关联商品" prop="productList1"> <FormItem label="广告关联商品" prop="productList1">
<div @click="checkGoods" <div @click="checkGoods"
@ -65,7 +66,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="32" v-if="form.productList1.productName != ''"> <Row :gutter="32" v-if="!isHomePopup && form.productList1.productName != ''">
<Col span="12"> <Col span="12">
<FormItem label="商品原价" prop="originalPrice"> <FormItem label="商品原价" prop="originalPrice">
<Input v-model="form.productList1.originalPrice" placeholder="请输入商品原价" /> <Input v-model="form.productList1.originalPrice" placeholder="请输入商品原价" />
@ -124,6 +125,14 @@
type: String, type: String,
default: "0", default: "0",
}, },
scene: {
type: String,
default: "homeAd",
},
homeCenterAdCount: {
type: Number,
default: 0,
},
}, },
data() { data() {
return { return {
@ -136,28 +145,20 @@
roleList: [], roleList: [],
visible: this.value, visible: this.value,
title: "", title: "",
originalPosition: "",
data: [], data: [],
dictData: [{ dictData: [{
title: "首页顶部大广告位", title: "首页顶部大广告位",
value: 'home_top' value: 'home_top'
}, { }, {
title: "首页中位左上", title: "首页广告位",
value: 'home_center_left_top' value: 'home_center'
}, {
title: "首页中位左下",
value: 'home_center_left_bottom'
}, {
title: "首页中位右上",
value: 'home_center_right_top'
}, {
title: "首页中位右下",
value: 'home_center_right_bottom'
}], }],
passColor: "", passColor: "",
submitLoading: false, submitLoading: false,
maxHeight: 510, maxHeight: 510,
form: { form: {
position: '', position: 'home_center',
sortOrder: "", sortOrder: "",
title: '', title: '',
adImage: '', adImage: '',
@ -196,9 +197,38 @@
}, },
}; };
}, },
computed: {
isHomePopup() {
return this.scene == "homePopup" || this.form.position == "home_popup";
},
},
methods: { methods: {
init() { init() {
},
getDefaultForm() {
return {
position: this.scene == "homePopup" ? "home_popup" : 'home_center',
sortOrder: "",
title: this.scene == "homePopup" ? "首页弹窗" : '',
adImage: '',
status: 1,
regionId: JSON.parse(this.getStore("user")).departmentId,
merchantName: '',
merchantId: '',
merchantImage: '',
linkUrl: this.scene == "homePopup" ? '' : '/package2/group/groupBuySingle?type=shop&item=',
linkParams: '',
productList1: {
adId: "",
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
groupMembers: ""
},
productList: []
}
}, },
addOne() { addOne() {
let data = { let data = {
@ -209,13 +239,40 @@
delOne(i) { delOne(i) {
this.adList.splice(i, 1); this.adList.splice(i, 1);
}, },
isHomeCenterPosition(position) {
return !!position && position != 'home_top' && position != 'home_popup';
},
submit() { submit() {
this.form.productList = [] this.form.adImage = this.adList
this.form.productList.push(this.form.productList1) .map(item => item.pic)
this.form.linkUrl = '/package2/group/groupBuySingle?type=shop&item=' .filter(item => item != null && String(item).trim() != '')
this.form.adImage = '' .map(item => String(item).trim())
for (let i = 0; i < this.adList.length; i++) { .join(',')
this.form.adImage += this.adList[i].pic + ',' if (this.isHomePopup) {
this.form.position = 'home_popup'
this.form.title = this.form.title || '首页弹窗'
this.form.merchantName = ''
this.form.merchantId = ''
this.form.merchantImage = ''
this.form.linkUrl = ''
this.form.linkParams = ''
this.form.productList = []
} else {
if (this.isHomeCenterPosition(this.form.position)) {
const isNewHomeCenterAd = !this.isHomeCenterPosition(this.originalPosition)
if (isNewHomeCenterAd && this.homeCenterAdCount >= 10) {
this.$Message.warning("首页广告位最多添加10个");
return;
}
this.form.position = 'home_center'
}
this.form.productList = []
this.form.productList.push(this.form.productList1)
this.form.linkUrl = '/package2/group/groupBuySingle?type=shop&item='
}
if (this.isHomePopup && !this.form.adImage) {
this.$Message.warning("请上传弹窗图片");
return;
} }
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
@ -405,16 +462,26 @@
} }
// //
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.originalPosition = "";
this.form = this.getDefaultForm();
this.adList = [{
pic: ''
}];
if (this.type == "0" || this.type == "1") { if (this.type == "0" || this.type == "1") {
// //
let data = this.data; let data = this.data;
this.originalPosition = data.position || "";
// //
this.form = data; this.form = Object.assign(this.getDefaultForm(), data);
if (this.isHomeCenterPosition(this.form.position)) {
this.form.position = 'home_center';
}
// //
if (this.form.adImage.indexOf(',') !== -1) { const adImage = this.form.adImage || '';
if (adImage.indexOf(',') !== -1) {
// {pic: url} // {pic: url}
this.adList = this.form.adImage this.adList = adImage
.split(',') .split(',')
.filter(item => item.trim() !== '') // .filter(item => item.trim() !== '') //
.map(url => ({ .map(url => ({
@ -423,7 +490,7 @@
} else { } else {
// //
this.adList = [{ this.adList = [{
pic: this.form.adImage.trim() pic: adImage.trim()
}]; }];
} }
getShopData(this.searchForm).then((res) => { getShopData(this.searchForm).then((res) => {
@ -436,7 +503,7 @@
} }
} }
}); });
if (data.productList.length > 0) { if (data.productList && data.productList.length > 0) {
this.form.productList1 = { this.form.productList1 = {
adId: data.id, adId: data.id,
productImage: data.productList[0].productImage, productImage: data.productList[0].productImage,

143
src/views/app/business/lineManage/lineManage.vue

@ -5,10 +5,15 @@
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Tabs v-model="activeTab" @on-click="changeAdTab">
<TabPane label="首页广告位" name="homeAd"></TabPane>
<TabPane label="首页弹窗" name="homePopup"></TabPane>
</Tabs>
<Row align="middle" justify="space-between" class="operation"> <Row align="middle" justify="space-between" class="operation">
<div> <div>
<Button @click="add" type="primary" icon="md-add">添加</Button> <Button v-if="activeTab != 'homePopup' || data.length == 0" @click="add" type="primary" icon="md-add">
{{ activeTab == 'homePopup' ? '添加弹窗图片' : '添加' }}
</Button>
</div> </div>
<div class="icons"> <div class="icons">
<Tooltip content="刷新" placement="top" transfer> <Tooltip content="刷新" placement="top" transfer>
@ -32,7 +37,7 @@
</Tooltip> </Tooltip>
</div> </div>
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" <Table :loading="loading" border :columns="activeTab == 'homePopup' ? popupColumns : columns" :data="data" :size="tableSize"
ref="table"></Table> ref="table"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
@ -44,7 +49,7 @@
<Button type="text" @click="Visiable = false">关闭</Button> <Button type="text" @click="Visiable = false">关闭</Button>
</div> </div>
</Modal> </Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" /> <addEdit :data="form" :type="showType" :scene="activeTab" :home-center-ad-count="homeCenterAdCount" v-model="showCompany" @on-submit="getDataList" />
</div> </div>
</template> </template>
@ -66,6 +71,7 @@
data() { data() {
return { return {
tableSize: "default", tableSize: "default",
activeTab: "homeAd",
message: "", message: "",
selectIndex: "", selectIndex: "",
currentRow: {}, currentRow: {},
@ -105,14 +111,10 @@
let re = "" let re = ""
if (params.row.position == 'home_top') { if (params.row.position == 'home_top') {
re = "首页顶部大广告位"; re = "首页顶部大广告位";
} else if (params.row.position == 'home_center_left_top') { } else if (params.row.position == 'home_popup') {
re = "首页中位左上"; re = "首页弹窗";
} else if (params.row.position == 'home_center_left_bottom') { } else {
re = "首页中位左下"; re = "首页广告位";
} else if (params.row.position == 'home_center_right_top') {
re = "首页中位右上";
} else if (params.row.position == 'home_center_right_bottom') {
re = "首页中位右下";
} }
return h( return h(
"div", "div",
@ -234,7 +236,7 @@
width: 150, width: 150,
render: (h, params) => { render: (h, params) => {
let re = "" let re = ""
if(params.row.productList != ''){ if(params.row.productList && params.row.productList.length > 0){
re = params.row.productList[0].productName re = params.row.productList[0].productName
} }
return h( return h(
@ -279,7 +281,100 @@
}, },
}, },
], ],
popupColumns: [
{
type: "index",
width: 60,
align: "center",
fixed: "left",
},
{
title: "弹窗图片",
key: "adImage",
minWidth: 180,
render: (h, params) => {
const imageUrl = (params.row.adImage || '').split(',').filter(item => item.trim() !== '').map(url => url.trim())[0];
if (!imageUrl) {
return h('span', '无图片');
}
return h("img", {
attrs: {
src: imageUrl,
},
style: {
cursor: "zoom-in",
width: "120px",
height: "80px",
margin: "10px 0",
"object-fit": "contain",
"border-radius": "6px",
background: "#f5f5f5"
},
on: {
click: () => {
this.showPic(imageUrl);
},
},
});
},
},
{
title: "排序值",
key: "sortOrder",
width: 100,
},
{
title: "状态",
key: "status",
width: 100,
render: (h, params) => {
let re = ""
if (params.row.status == 0) {
re = "下架";
} else if (params.row.status == 1) {
re = "上架";
}
return h("div", re);
}
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", [
h(
"a", {
on: {
click: () => {
this.edit(params.row);
},
},
},
"编辑"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.del(params.row);
},
},
},
"删除"
),
]);
},
},
],
chooseColumns: [], chooseColumns: [],
rawData: [],
data: [], data: [],
exportData: [], exportData: [],
total: 0, total: 0,
@ -287,6 +382,11 @@
rechargeVisiable: false, rechargeVisiable: false,
}; };
}, },
computed: {
homeCenterAdCount() {
return (this.rawData || []).filter(item => this.isHomeCenterAd(item)).length;
},
},
methods: { methods: {
init() { init() {
this.getDataList(); this.getDataList();
@ -299,17 +399,31 @@
changeTableSize(v) { changeTableSize(v) {
this.tableSize = v; this.tableSize = v;
}, },
changeAdTab() {
this.data = this.filterAdData(this.rawData);
},
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
filterAdData(list) {
const records = list || [];
if (this.activeTab == "homePopup") {
return records.filter(item => item.position == "home_popup");
}
return records.filter(item => item.position != "home_popup");
},
isHomeCenterAd(item) {
return item && item.position != "home_top" && item.position != "home_popup";
},
getDataList() { getDataList() {
// 线 // 线
this.loading = true; this.loading = true;
getADList(this.searchForm).then((res) => { getADList(this.searchForm).then((res) => {
this.loading = false; this.loading = false;
if (res.code == 200) { if (res.code == 200) {
this.data = res.result.records; this.rawData = res.result.records || [];
this.data = this.filterAdData(this.rawData);
} }
}); });
}, },
@ -344,6 +458,7 @@
this.showCompany = true; this.showCompany = true;
}, },
add() { add() {
this.form = {};
this.showType = "2"; this.showType = "2";
this.showCompany = true; this.showCompany = true;
}, },

51
src/views/app/business/logistics/logistics.vue

@ -79,6 +79,7 @@
<TabPane label="配送时长设置" name="setting"></TabPane> <TabPane label="配送时长设置" name="setting"></TabPane>
<TabPane label="客服设置" name="service"></TabPane> <TabPane label="客服设置" name="service"></TabPane>
<TabPane label="基础配送费" name="baseDeliveryFee"></TabPane> <TabPane label="基础配送费" name="baseDeliveryFee"></TabPane>
<TabPane label="开启关闭配送" name="deliverySwitch"></TabPane>
</Tabs> </Tabs>
<div v-if="isOrderTab"> <div v-if="isOrderTab">
<Tabs v-if="tabName === 'hall'" v-model="hallTab" :animated="false" @on-click="changeHallTab"> <Tabs v-if="tabName === 'hall'" v-model="hallTab" :animated="false" @on-click="changeHallTab">
@ -125,6 +126,22 @@
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<div v-else-if="tabName === 'deliverySwitch'" style="padding: 20px 0;">
<Form ref="deliverySwitchForm" :model="deliverySwitchForm" :label-width="130" style="width: 520px;">
<FormItem label="是否开启配送">
<i-switch v-model="deliverySwitchForm.deliveryEnabled" size="large" :true-value="1" :false-value="0">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
<div style="color: #999; font-size: 12px; line-height: 22px; margin-top: 8px;">
关闭后用户在该校区外卖商家下单时只能选择到店消费
</div>
</FormItem>
<FormItem>
<Button type="primary" :loading="deliverySwitchLoading" @click="saveDeliverySwitch">保存</Button>
</FormItem>
</Form>
</div>
<Row v-if="isOrderTab" v-show="openSearch" @keydown.enter.native="handleSearch"> <Row v-if="isOrderTab" v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="activeSearchForm" inline :label-width="90"> <Form ref="searchForm" :model="activeSearchForm" inline :label-width="90">
<FormItem label="配送类型" v-if="tabName === 'delivery'"> <FormItem label="配送类型" v-if="tabName === 'delivery'">
@ -248,6 +265,8 @@
saveCustomerPhoneSetting, saveCustomerPhoneSetting,
getBaseDeliveryFeeSetting as getBaseDeliveryFeeSettingApi, getBaseDeliveryFeeSetting as getBaseDeliveryFeeSettingApi,
saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi, saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi,
getShopAreaDeliverySwitch,
saveShopAreaDeliverySwitch,
} from "@/api/index"; } from "@/api/index";
import addEdit from "./addEdit.vue"; import addEdit from "./addEdit.vue";
import logisticsAddress from "@/views/app/business/logistics/logisticsAddress"; import logisticsAddress from "@/views/app/business/logistics/logisticsAddress";
@ -288,6 +307,7 @@
settingLoading: false, settingLoading: false,
customerServiceLoading: false, customerServiceLoading: false,
baseDeliveryFeeLoading: false, baseDeliveryFeeLoading: false,
deliverySwitchLoading: false,
transferOrder: false, transferOrder: false,
workerOrderVisible: false, workerOrderVisible: false,
workerOrderTab: "daiqu", workerOrderTab: "daiqu",
@ -343,6 +363,10 @@
regionId: regionId, regionId: regionId,
baseDeliveryFee: 0 baseDeliveryFee: 0
}, },
deliverySwitchForm: {
regionId: regionId,
deliveryEnabled: 1
},
workerOrderForm: { workerOrderForm: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
@ -414,6 +438,7 @@
this.getSetting(); this.getSetting();
this.getCustomerServiceSetting(); this.getCustomerServiceSetting();
this.getBaseDeliveryFeeSetting(); this.getBaseDeliveryFeeSetting();
this.getDeliverySwitch();
}, },
buildWorkerColumns() { buildWorkerColumns() {
return [ { return [ {
@ -555,6 +580,10 @@
this.getBaseDeliveryFeeSetting(); this.getBaseDeliveryFeeSetting();
return; return;
} }
if (v === "deliverySwitch") {
this.getDeliverySwitch();
return;
}
this.total = 0; this.total = 0;
this.data = []; this.data = [];
const form = v === "hall" ? this.hallSearchForm : this.deliverySearchForm; const form = v === "hall" ? this.hallSearchForm : this.deliverySearchForm;
@ -1005,6 +1034,28 @@
this.baseDeliveryFeeLoading = false; this.baseDeliveryFeeLoading = false;
}); });
}, },
getDeliverySwitch() {
getShopAreaDeliverySwitch({
regionId: this.deliverySwitchForm.regionId
}).then((res) => {
if (res.success) {
this.deliverySwitchForm.deliveryEnabled = res.result == null ? 1 : Number(res.result);
}
});
},
saveDeliverySwitch() {
this.deliverySwitchLoading = true;
saveShopAreaDeliverySwitch({
regionId: this.deliverySwitchForm.regionId,
deliveryEnabled: this.deliverySwitchForm.deliveryEnabled
}).then((res) => {
if (res.success) {
this.$Message.success("保存成功");
}
}).finally(() => {
this.deliverySwitchLoading = false;
});
},
goTransferOrder(item) { goTransferOrder(item) {
if (!item || !item.workerId) { if (!item || !item.workerId) {
this.$Message.warning("请选择配送员"); this.$Message.warning("请选择配送员");

Loading…
Cancel
Save