Browse Source

添加服务优化

pull/97/head
pengda 1 month ago
parent
commit
19b28d0fe4
  1. 138
      src/views/agent/siteServiceAdd.vue

138
src/views/agent/siteServiceAdd.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="serviceAdd-wrap"> <div class="serviceAdd-wrap">
<div class="ml12 mr12 overFlow-wrap"> <div class="ml12 mr12 overFlow-wrap">
<PromptText text="如何添加服务?" :type="1" class="add-info"> <PromptText text="如何添加服务?" :type="2" class="add-info">
<template #next_desc> <template #next_desc>
<div class="alert-more flex gap12" :class="alertShow ? '' : 'alert-more-hide'" @click="handleAlert"> <div class="alert-more flex gap12" :class="alertShow ? '' : 'alert-more-hide'" @click="handleAlert">
<div v-if="alertShow">收起</div> <div v-if="alertShow">收起</div>
@ -19,17 +19,27 @@
</template> </template>
</PromptText> </PromptText>
<div class="service-title flex-between" v-if="serviceAddInfo"> <div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type">
<div class="service-name flex gap12"> <div class="service-name flex gap12">
<img src="@/assets/site/step_success.png" alt=""> <img :src="require('@/assets/serviceIcon/ver_'+serviceAddInfo.ver_type+'.svg')" alt="">
<span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span> <span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span>
</div> </div>
<div class="service-status" v-if="serviceInfo.status"> <div class="service-status" v-if="service_status">
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span> <span class="service-status-close" @click="handleDelServiceClick">关闭服务</span>
<span class="service-status-desc">已开启</span> <span class="service-status-desc">已开启</span>
</div> </div>
</div> </div>
<PromptText v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1"
class="mb12">
<template #desc v-if="serviceAddInfo.prompt.content">
<div class="alert-more-info mt12">
<div class="flex mb10" v-for="item in serviceAddInfo.prompt.content" :key="item">
{{ item }}</div>
</div>
</template>
</PromptText>
<!-- 网页售价 --> <!-- 网页售价 -->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set"> <div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
@ -39,45 +49,33 @@
v-if="serviceAddInfo.supply_price">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> v-if="serviceAddInfo.supply_price">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span>
</div> </div>
<PromptText v-if="serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1"
class="mb12">
<template #desc v-if="serviceAddInfo.prompt.content">
<div class="alert-more-info mt12">
<div class="flex mb10" v-for="item in serviceAddInfo.prompt.content" :key="item">
{{ item }}</div>
</div>
</template>
</PromptText>
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<div class="flex-between mb12"> <div class="flex-between mb12">
<div>售价管理</div> <div>售价管理</div>
</div> </div>
<div class="flex-between"> <div class="flex-between">
<div class="short-width"> <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" <GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式"
:options="serviceAddInfo.set_units" /> :options="serviceAddInfo.set_units" @change="handleUnitName"/>
</div> </div>
<div class="short-width" v-if="serviceInfo.unit !== '0'"> <div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceInfo.price" width="100%" <GuipInput v-model="serviceInfo.price" width="100%"
ref="GuipInput" unit="元/篇"></GuipInput> ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput>
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceInfo.price" width="100%"
ref="GuipInput" unit="元/页"></GuipInput>
</div> </div>
</div> </div>
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'"> <div class="flex-between mt12" v-if="service_unit === '0'">
<div class="short-width"> <div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元"> <GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元">
</GuipInput> </GuipInput>
</div> </div>
<div class="short-width"> <div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"> <GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name">
</GuipInput> </GuipInput>
</div> </div>
</div> </div>
</div> </div>
<template v-if="serviceAddInfo.base_set"> <template v-if="serviceAddInfo.base_set && service_unit === '0'">
<div class="flex-line"></div> <div class="flex-line"></div>
<div class="flex-right"> <div class="flex-right">
<div class="flex-between mb12"> <div class="flex-between mb12">
@ -112,7 +110,8 @@
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top"> <div class="price-top">
<span class="title">{{ serviceAddInfo.shop_name }}支付管理</span> <span class="title">{{ serviceAddInfo.shop_name }}支付管理</span>
<span class="desc"></span> <span class="desc"
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span>
</div> </div>
<div class="flex-wrap"> <div class="flex-wrap">
@ -121,29 +120,27 @@
<div>售价管理</div> <div>售价管理</div>
</div> </div>
<div class="flex-between"> <div class="flex-between">
<div class="short-width"> <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" <GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式"
:options="serviceAddInfo.set_units" /> :options="serviceAddInfo.set_units" @change="handleUnitName"/>
</div> </div>
<div class="short-width" v-if="serviceInfo.unit > 0"> <div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceAddInfo.unit_piece" <GuipInput v-model="serviceInfo.unit_piece" width="100%"
width="100%" ref="GuipInput" unit="件/篇"></GuipInput> ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput>
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceAddInfo.unit_piece"
width="100%" ref="GuipInput" unit="件/页"></GuipInput>
</div> </div>
</div> </div>
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'"> <div class="flex-between mt12" v-if="service_unit === '0'">
<div class="short-width"> <div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_piece" ref="GuipInput" unit="件"> <GuipInput width="100%" v-model="serviceInfo.unit_piece" ref="GuipInput" unit="件">
</GuipInput> </GuipInput>
</div> </div>
<div class="short-width"> <div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"> <GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name">
</GuipInput> </GuipInput>
</div> </div>
</div> </div>
</div> </div>
<template v-if="serviceAddInfo.base_set"> <template v-if="serviceAddInfo.base_set && service_unit === '0'">
<div class="flex-line"></div> <div class="flex-line"></div>
<div class="flex-right"> <div class="flex-right">
<div class="flex-between mb12"> <div class="flex-between mb12">
@ -174,7 +171,7 @@
</div> </div>
<!-- 店铺商品绑定--> <!-- 店铺商品绑定-->
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.exists_shop_pay"> <div class="flex-common mb12 price-set" v-if="serviceAddInfo.shop_price_set">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
<div class="price-top"> <div class="price-top">
<span class="title">关联电商商品</span> <span class="title">关联电商商品</span>
@ -263,6 +260,8 @@ export default {
type: 0, type: 0,
prodid: 0, prodid: 0,
serviceAddInfo: {}, serviceAddInfo: {},
service_unit:'',
service_status: false,
serviceInfo: {}, serviceInfo: {},
bindList: [], bindList: [],
alertShow: true, alertShow: true,
@ -324,6 +323,7 @@ export default {
}, },
// //
getServiceAddInfo() { getServiceAddInfo() {
this.serviceAddInfo = {}
const that = this const that = this
that.$http('POST', '/agentnew/ajax_get_service_add_info', { that.$http('POST', '/agentnew/ajax_get_service_add_info', {
uid: that.uid, uid: that.uid,
@ -336,6 +336,7 @@ export default {
if (response.status) { if (response.status) {
that.$nextTick(() => { that.$nextTick(() => {
that.serviceAddInfo = response.data that.serviceAddInfo = response.data
that.service_unit = that.serviceAddInfo.unit
// //
if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid) if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid)
// //
@ -363,21 +364,15 @@ export default {
} }
}).then(response => { }).then(response => {
that.$nextTick(() => { that.$nextTick(() => {
//
that.serviceInfo.unit = that.serviceAddInfo.unit
// //
that.serviceInfo.status = false if (response.status && response.data) {
})
if (response.status && response.data) {
that.$nextTick(() => {
that.serviceInfo = response.data.service_info that.serviceInfo = response.data.service_info
that.serviceInfo.status = true that.service_status = true
that.getServiceBindGoods()
}
})
console.log(that.serviceInfo,'ccc')
})
that.getServiceBindGoods()
}
console.log(that.serviceInfo,'aaa')
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
@ -402,6 +397,9 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
handleUnitName(){
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit]
},
handleDelServiceClick() { handleDelServiceClick() {
this.dialogDelServiceConfim = true this.dialogDelServiceConfim = true
}, },
@ -423,6 +421,7 @@ export default {
that.$message.success('删除成功'); that.$message.success('删除成功');
this.$nextTick(() => { this.$nextTick(() => {
that.serviceInfo = {} that.serviceInfo = {}
that.service_status = false;
that.setMenuList(that.type, false) that.setMenuList(that.type, false)
}) })
return true; return true;
@ -440,9 +439,16 @@ export default {
}, },
savePrice() { savePrice() {
const that = this const that = this
//
if(that.service_unit !== '0') {
that.serviceInfo.unit_num = 1
that.serviceInfo.base_unit_num = ''
that.serviceInfo.base_unit_price = ''
}
this.$http('POST', "/agentnew/ajax_set_service_price", { this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid, uid: that.uid,
type: that.type, type: that.type,
unit: that.service_unit,
unit_num: that.serviceInfo.unit_num, unit_num: that.serviceInfo.unit_num,
unit_price: that.serviceInfo.price, unit_price: that.serviceInfo.price,
b_unit_num: that.serviceInfo.base_unit_num, b_unit_num: that.serviceInfo.base_unit_num,
@ -453,8 +459,8 @@ export default {
} }
}).then(response => { }).then(response => {
if (response.status) { if (response.status) {
if (that.serviceInfo.status === false) { if (that.service_status === false) {
that.serviceInfo.status = true that.service_status = true
that.setMenuList(that.type, true) that.setMenuList(that.type, true)
} }
that.$message.success('保存成功'); that.$message.success('保存成功');
@ -473,9 +479,18 @@ export default {
}, },
saveShopPrice() { saveShopPrice() {
const that = this const that = this
// 1
//
if(that.service_unit !== '0') {
that.serviceInfo.unit_num = 1
that.serviceInfo.base_unit_num = ''
that.serviceInfo.base_unit_piece = ''
}
console.log(that.serviceInfo,'ddd')
this.$http('POST', "/agentnew/ajax_set_service_price", { this.$http('POST', "/agentnew/ajax_set_service_price", {
uid: that.uid, uid: that.uid,
type: that.type, type: that.type,
unit: that.service_unit,
unit_num: that.serviceInfo.unit_num, unit_num: that.serviceInfo.unit_num,
unit_piece: that.serviceInfo.unit_piece, unit_piece: that.serviceInfo.unit_piece,
b_unit_num: that.serviceInfo.base_unit_num, b_unit_num: that.serviceInfo.base_unit_num,
@ -486,8 +501,8 @@ export default {
} }
}).then(response => { }).then(response => {
if (response.status) { if (response.status) {
if (that.serviceInfo.status === false) { if (that.service_status === false) {
that.serviceInfo.status = true that.service_status = true
that.setMenuList(that.type, true) that.setMenuList(that.type, true)
} }
that.$message.success('保存成功'); that.$message.success('保存成功');
@ -607,7 +622,20 @@ export default {
}, },
//------ end------ //------ end------
jumpStep() { jumpStep() {
this.$router.push(this.siteAddUrl + '?uid=' + this.uid) const that = this
this.$http('POST', '/agentnew/ajax_get_not_finished_site', {},{
headers:{
'Auth': this.token
}
}).then(response => {
if(Object.keys(response.data).length>0){
that.$router.push('/agent/siteAdd')
} else {
that.$router.push('/agent/siteServiceList?uid=' + that.uid)
}
}).catch(error => {
console.error(error, 'error')
})
}, },
} }
} }

Loading…
Cancel
Save