Browse Source

修改价格设置页面、及交互

pull/114/head
zq 1 week ago
parent
commit
2e4239b30b
  1. 4
      src/components/SliderScondThree.vue
  2. 357
      src/views/agent/siteServiceAdd.vue

4
src/components/SliderScondThree.vue

@ -15,8 +15,8 @@
:key="index1"> :key="index1">
<span class="l-menu-name">{{ item1[renderKeyNew.subtitle] }}</span> <span class="l-menu-name">{{ item1[renderKeyNew.subtitle] }}</span>
<span class="l-price-ing curActive_ing" v-if="!item1.unit_price && !item1.unit_num">设置价格中</span> <span class="l-price-ing curActive_ing" v-if="!item1.unit_price && !item1.unit_num">设置价格中</span>
<span class="l-price-ing" v-if="item1.unit_price && item1.unit_num">{{ item1.unit_price }}/{{ item1.unit_num }}</span> <span class="l-price-ing" v-if="item1.unit_price && item1.unit == '0'">{{ item1.unit_price }}/{{ item1.unit_num }}</span>
<span class="l-price-ing" v-if="item1.unit_price && !item1.unit_num">{{ item1.unit_price }}/</span> <span class="l-price-ing" v-if="item1.unit_price && item1.unit == '1'">{{ item1.unit_price }}/</span>
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>

357
src/views/agent/siteServiceAdd.vue

@ -9,7 +9,7 @@
<img src="@/assets/site/show_and_hide.png" alt=""> <img src="@/assets/site/show_and_hide.png" alt="">
</div> </div>
</template> </template>
<template #desc> <template #desc>
<div class="alert-more-info mt12" v-show="alertShow"> <div class="alert-more-info mt12" v-show="alertShow">
<div class="flex mb10 gap10">1.点击左侧导航进入设置页开启所需服务<img src="@/assets/site/open_success_menu.svg" <div class="flex mb10 gap10">1.点击左侧导航进入设置页开启所需服务<img src="@/assets/site/open_success_menu.svg"
alt="">图标表示已开启</div> alt="">图标表示已开启</div>
@ -17,7 +17,7 @@
<div class="flex gap10">3.全部开启后点击底部 [返回服务列表] </div> <div class="flex gap10">3.全部开启后点击底部 [返回服务列表] </div>
</div> </div>
</template> </template>
</PromptText> --> </PromptText> -->
<div class="flex-common service_info"> <div class="flex-common service_info">
<div class="service_info_wrap common_scss"> <div class="service_info_wrap common_scss">
<div class="title flex gap6"> <div class="title flex gap6">
@ -27,15 +27,16 @@
<div class="flex"> <div class="flex">
<label>品牌名称</label> <label>品牌名称</label>
<p> <p>
<b>{{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['name'] }}</b> <b>{{ siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['name']
{{siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['desc'] }} }}</b>
{{ siteInfo && currentMenuItem && siteInfo['ver2info'][currentMenuItem.parentType]['desc'] }}
</p> </p>
</div> </div>
<div class="flex"> <div class="flex">
<label>服务名称</label> <label>服务名称</label>
<p> <p>
<b>{{ serviceAddInfo.type_name }}</b> <b>{{ serviceAddInfo.type_name }}</b>
{{ siteInfo&&siteInfo['type2info'][currentMenuItem.type]['introduce'] }} {{ siteInfo && siteInfo['type2info'][currentMenuItem.type]['introduce'] }}
</p> </p>
</div> </div>
<!--需要 增加条件判断 --> <!--需要 增加条件判断 -->
@ -73,7 +74,7 @@
<div class="flex"> <div class="flex">
<label>利润率</label> <label>利润率</label>
<p v-if="service_unit == '1'"> <p v-if="service_unit == '1'">
因售卖单位设置为篇利率无法计算 因售卖单位设置为篇利率无法计算
</p> </p>
<p v-if="service_unit == '0'"> <p v-if="service_unit == '0'">
{{ calculation.profitRate }}%因单位进制差异利率为约数 {{ calculation.profitRate }}%因单位进制差异利率为约数
@ -90,43 +91,51 @@
</div> </div>
</div> </div>
<!-- 售卖单位 -->
<div class="flex-common mt12 mb12 price-set">
<el-form class="el-row demo-ruleForm" ref="formRef1" :model="form1" :rules="rules">
<div class="price-top">
<span class="title">售卖单位</span>
</div>
<div class="flex-wrap">
<div class="flex-left">
<GuipRadio v-model="service_unit" :options="serviceAddInfo.set_units" label="单位类型"
prop="language" class="column" />
</div>
<template v-if="service_unit === '0'">
<div class="flex-line"></div>
<div class="flex-right">
<GuipInput width="100%" class="column" prop="unit_num" label="设置单位数" desc="如售价XX元/1000字符,单位数设为1000"
v-model="serviceInfo.unit_num" @input="priceInput" @blur="priceBlur" unit="字符"></GuipInput>
</div>
</template>
</div>
</el-form>
</div>
<!-- 网页售价 --> <!-- 网页售价 -->
<div class="flex-common mt12 mb12 price-set" v-if="serviceAddInfo.web_price_set"> <div class="flex-common mt12 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">
<div class="price-top"> <div class="price-top">
<span class="title">网页端售价</span> <span class="title">网页端售价</span>
<!-- <span class="desc"
v-if="serviceAddInfo.supply_price">供货价{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> -->
</div> </div>
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<div class="column"> <GuipInput v-if="service_unit !== '0'" v-model="serviceInfo.price" width="100%"
<el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName"> ref="GuipInput" :unit="'元/篇'"></GuipInput>
<el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane> <GuipInput v-if="service_unit === '0'" width="100%" label="非电商支付的售价" class="column" ref="priceRef1"
</el-tabs> v-model="serviceInfo.price" @input="priceChange"
<div class="short-width" v-if="service_unit !== '0'"> :unit="'元/' + (serviceInfo.unit_num || '') + serviceAddInfo.unit_name"
<GuipInput v-model="serviceInfo.price" width="100%" @blur="priceBlur">
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput> </GuipInput>
</div>
</div>
<div class="flex-between" v-if="service_unit === '0'">
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元" @blur="priceBlur">
</GuipInput>
</div>
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name" @blur="priceBlur">
</GuipInput>
</div>
</div>
</div> </div>
<template v-if="serviceAddInfo.base_set && service_unit === '0'"> <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">
<div>起售价格选填</div> <div>最低售价选填</div>
<div>超过设定字符按照正常售价收取</div> <div class="desc">超过设定字符按照正常售价收取</div>
</div> </div>
<div class="flex-between"> <div class="flex-between">
<div class="third-width"> <div class="third-width">
@ -146,19 +155,21 @@
</div> </div>
<div class="flex service-opt mt12"> <div class="flex service-opt mt12">
<GuipButton type="ignore" @click="resetPrice">重置</GuipButton> <GuipButton type="ignore" @click="resetPrice">重置</GuipButton>
<syncPrice v-if="serviceAddInfo && serviceAddInfo.is_sync" :type="serviceAddInfo.type" :type_name="serviceAddInfo.type_name" <syncPrice v-if="serviceAddInfo && serviceAddInfo.is_sync" :type="serviceAddInfo.type"
:price="serviceInfo.price" :unit_num="serviceInfo.unit_num" :unit_name="serviceAddInfo.unit_name"></syncPrice> :type_name="serviceAddInfo.type_name" :price="serviceInfo.price"
:unit_num="serviceInfo.unit_num" :unit_name="serviceAddInfo.unit_name"></syncPrice>
<GuipButton type="primary" @click="savePrice" size="medium">保存</GuipButton> <GuipButton type="primary" @click="savePrice" size="medium">保存</GuipButton>
</div> </div>
</el-form> </el-form>
<template v-if="serviceAddInfo.value_added.length>0"> <template v-if="serviceAddInfo.value_added.length > 0">
<div class="price-top"> <div class="price-top">
<span class="title">增值服务</span> <span class="title">增值服务</span>
<span class="desc"></span> <span class="desc"></span>
</div> </div>
<valueAdded v-for="(added_type, index) in serviceAddInfo.value_added" :key="index" :uid="uid" :type="added_type"></valueAdded> <valueAdded v-for="(added_type, index) in serviceAddInfo.value_added" :key="index" :uid="uid"
:type="added_type"></valueAdded>
</template> </template>
</div> </div>
@ -167,45 +178,23 @@
<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"
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">
<div class="flex-left"> <div class="flex-left">
<div class="flex-between mb12"> <GuipInput v-if="service_unit !== '0'" v-model="serviceInfo.unit_piece" width="100%"
<div>售价设置</div> ref="GuipInput" :unit="'件/篇'"></GuipInput>
</div> <GuipInput v-if="service_unit === '0'" width="100%" class="column" label="电商平台售价,保存后需关联宝贝"
<div class="flex-between"> v-model="serviceInfo.unit_piece" ref="priceRef2" @input="priceChange1"
<el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName"> :unit="'件/' + (serviceInfo.unit_num || '') + serviceAddInfo.unit_name">
<el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane> </GuipInput>
</el-tabs>
<!-- <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1">
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式"
:options="serviceAddInfo.set_units" @change="handleUnitName"/>
</div> -->
<div class="short-width" v-if="service_unit !== '0'">
<GuipInput v-model="serviceInfo.unit_piece" width="100%"
ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput>
</div>
</div>
<div class="flex-between mt12" v-if="service_unit === '0'">
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_piece" ref="GuipInput" unit="件">
</GuipInput>
</div>
<div class="short-width">
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name">
</GuipInput>
</div>
</div>
</div> </div>
<template v-if="serviceAddInfo.base_set && service_unit === '0'"> <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">
<div>起售价格选填</div> <div>最低售价选填</div>
<div>超过设定字符按照正常售价收取</div> <div class="desc">超过设定字符按照正常售价收取</div>
</div> </div>
<div class="flex-between"> <div class="flex-between">
<div class="third-width"> <div class="third-width">
@ -247,8 +236,8 @@
<div class="bind-item" v-for="(row, key) in bindList" :key="key"> <div class="bind-item" v-for="(row, key) in bindList" :key="key">
<img :src="row.pic_url ? row.pic_url : require('@/assets/site/invalid.png')" alt=""> <img :src="row.pic_url ? row.pic_url : require('@/assets/site/invalid.png')" alt="">
<div class="bind-goods-info"> <div class="bind-goods-info">
<div class="bind-goods-title"><el-link :href="row.link" <div class="bind-goods-title"><el-link :href="row.link" target="_blank">{{ row.title
target="_blank">{{ row.title }}</el-link> }}</el-link>
</div> </div>
<div class="flex-between gap12"> <div class="flex-between gap12">
<div class="flex gap12"> <div class="flex gap12">
@ -268,8 +257,8 @@
</div> </div>
</el-form> </el-form>
<bindGoods :showBind="showBind" :uid="uid" :type="type" :pdd_pati="pdd_pati" :pdd_pagecode="pdd_pagecode" <bindGoods :showBind="showBind" :uid="uid" :type="type" :pdd_pati="pdd_pati"
@handleBind="handleBind"> :pdd_pagecode="pdd_pagecode" @handleBind="handleBind">
</bindGoods> </bindGoods>
<GuipDialog :dialogVisible="dialogDelBindConfim" title="提示" :show-close-button="false" <GuipDialog :dialogVisible="dialogDelBindConfim" title="提示" :show-close-button="false"
@ -277,17 +266,17 @@
您确定要删除吗删除后所有绑定都会删除 您确定要删除吗删除后所有绑定都会删除
</GuipDialog> </GuipDialog>
</div> </div>
<div class="register-btns flex gap12">
<!-- <span class="service-open-num">已开启 {{addNum}} 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton> -->
<GuipButton type="system" size="page" @click="jumpStep">取消</GuipButton>
<GuipButton type="primary" size="page" @click="jumpNextStep">设置下一项服务</GuipButton>
</div>
<GuipDialog :dialogVisible="dialogDelServiceConfim" title="提示" :show-close-button="false" <GuipDialog :dialogVisible="dialogDelServiceConfim" title="提示" :show-close-button="false"
@confirm="handleDelServiceConfirm" @cancel="handleDelServiceCancel"> @confirm="handleDelServiceConfirm" @cancel="handleDelServiceCancel">
确定要移除服务吗? 确定要移除服务吗?
</GuipDialog> </GuipDialog>
</div> </div>
<div class="register-btns flex gap12">
<!-- <span class="service-open-num">已开启 {{addNum}} 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton> -->
<GuipButton type="system" size="page" @click="jumpStep">取消</GuipButton>
<GuipButton type="primary" size="page" @click="jumpStep">设置下一项服务</GuipButton>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -299,6 +288,7 @@ import GuipButton from "@/components/GuipButton.vue";
import GuipInput from "@/components/GuipInput.vue"; import GuipInput from "@/components/GuipInput.vue";
import bindGoods from "@/components/bindGoods.vue"; import bindGoods from "@/components/bindGoods.vue";
import GuipDialog from "@/components/GuipDialog.vue"; import GuipDialog from "@/components/GuipDialog.vue";
import GuipRadio from "@/components/GuipRadio.vue";
import ValueAdded from "@/components/site/serviceSetting/valueAdded.vue"; import ValueAdded from "@/components/site/serviceSetting/valueAdded.vue";
import SyncPrice from "@/components/site/serviceSetting/syncPrice.vue"; import SyncPrice from "@/components/site/serviceSetting/syncPrice.vue";
@ -309,6 +299,7 @@ export default {
SyncPrice, SyncPrice,
ValueAdded, ValueAdded,
GuipDialog, GuipDialog,
GuipRadio,
GuipInput, GuipInput,
// GuipSelect, // GuipSelect,
// PromptText, // PromptText,
@ -329,9 +320,9 @@ export default {
type: 0, type: 0,
prodid: 0, prodid: 0,
serviceAddInfo: {}, serviceAddInfo: {},
service_unit:'', service_unit: '',
service_status: false, service_status: false,
relatedProducts:false, relatedProducts: false,
serviceInfo: {}, serviceInfo: {},
bindList: [], bindList: [],
alertShow: true, alertShow: true,
@ -344,7 +335,7 @@ export default {
delRow: {}, delRow: {},
dialogDelServiceConfim: false, dialogDelServiceConfim: false,
addNum: 0, addNum: 0,
rateNum:null, rateNum: null,
calculation: { calculation: {
profitRate: 0, profitRate: 0,
profitPerUnit: 0, profitPerUnit: 0,
@ -352,12 +343,20 @@ export default {
pricePerThousand: 0, pricePerThousand: 0,
isValid: false isValid: false
}, },
siteInfo:null siteInfo: null,
form1:{
unit_num:''
},
rules:{
unit_num: [
{ required: true, message: '请设置单位数', trigger: 'blur' }
],
},
} }
}, },
computed: { computed: {
...mapState(['pageTitle','secondMenu','currentMenuItem']), // VuexshowSidebar ...mapState(['pageTitle', 'secondMenu', 'currentMenuItem']), // VuexshowSidebar
// menuItem() { // menuItem() {
// return this.$store.state.currentMenuItem; // return this.$store.state.currentMenuItem;
// } // }
@ -373,6 +372,7 @@ export default {
// //
this.getServiceInfo() this.getServiceInfo()
this.getServiceAddInfo(); this.getServiceAddInfo();
this.relatedProducts = false;
}, },
deep: true // deep: true //
} }
@ -387,7 +387,7 @@ export default {
this.loadPddSDK() this.loadPddSDK()
}, },
mounted() { mounted() {
if(this.currentMenuItem){ if (this.currentMenuItem) {
this.type = this.currentMenuItem.type this.type = this.currentMenuItem.type
// //
this.getServiceInfo() this.getServiceInfo()
@ -403,7 +403,7 @@ export default {
this.$router.go(-1); this.$router.go(-1);
} }
} }
console.log(this.menuItem,'menuItem===',this.currentMenuItem); console.log(this.menuItem, 'menuItem===', this.currentMenuItem);
// store.commit('SET_PAGETITLE', ''); // store.commit('SET_PAGETITLE', '');
this.getAddServiceList(); this.getAddServiceList();
}, },
@ -413,11 +413,40 @@ export default {
const match = this.basePrice.match(/(\d+\.?\d*)/); const match = this.basePrice.match(/(\d+\.?\d*)/);
return match ? parseFloat(match[0]) : 0; return match ? parseFloat(match[0]) : 0;
}, },
priceBlur(){ priceInput(val){
this.form1.unit_num = val;
},
priceBlur() {
const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, ''); const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, '');
this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price)); this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price));
}, },
unitNameBlur(){ priceChange(){
if(this.service_unit == '0' && !this.serviceInfo.unit_num){
this.serviceInfo.price = ''
this.$refs.formRef1.validateField('unit_num')
// console.log(this.serviceInfo.unit_num);
this.$positionMessage({
type: 'error',
message: '请先设置单位数',
target: this.$refs.priceRef1, // DOM
position: 'top'
})
}
},
priceChange1(){
if(this.service_unit == '0' && !this.serviceInfo.unit_num){
this.serviceInfo.unit_piece = ''
this.$refs.formRef1.validateField('unit_num')
this.$positionMessage({
type: 'error',
message: '请先设置单位数',
target: this.$refs.priceRef2, // DOM
position: 'top'
})
}
},
unitNameBlur() {
}, },
handleAlert() { handleAlert() {
@ -449,12 +478,18 @@ export default {
}).then(response => { }).then(response => {
if (response.status) { if (response.status) {
that.$nextTick(() => { that.$nextTick(() => {
if(!response.data.web_price_set && !response.data.shop_price_set){ if (!response.data.web_price_set && !response.data.shop_price_set) {
that.$message.error('请先绑定收款方式'); that.$message.error('请先绑定收款方式');
that.$router.push('/agent/siteBaseSetting?uid='+that.uid) that.$router.push('/agent/siteBaseSetting?uid=' + that.uid)
} }
that.serviceAddInfo = response.data that.serviceAddInfo = response.data
const obj = that.serviceAddInfo.set_units
for (let key in obj) {
obj[key] = `${obj[key]}售卖`
}
// that.serviceAddInfo.set_units =
that.service_unit = that.serviceAddInfo.unit that.service_unit = that.serviceAddInfo.unit
// //
if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid) if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid)
@ -510,9 +545,9 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
handleUnitName(){ handleUnitName() {
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit]; this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit];
console.log(this.serviceAddInfo.unit_name,'this.serviceAddInfo.unit_name====---999'); console.log(this.serviceAddInfo.unit_name, 'this.serviceAddInfo.unit_name====---999');
}, },
handleDelServiceClick() { handleDelServiceClick() {
this.dialogDelServiceConfim = true this.dialogDelServiceConfim = true
@ -555,40 +590,41 @@ export default {
let secondMenu = JSON.parse(JSON.stringify(this.secondMenu)); let secondMenu = JSON.parse(JSON.stringify(this.secondMenu));
let parentType = this.currentMenuItem.parentType; let parentType = this.currentMenuItem.parentType;
secondMenu[parentType].list.forEach(item => { secondMenu[parentType].list.forEach(item => {
if(item.type == this.currentMenuItem.type){ if (item.type == this.currentMenuItem.type) {
item['unit_num'] = that.serviceInfo.unit_num item['unit_num'] = that.serviceInfo.unit_num
item['unit'] = that.service_unit
item['unit_price'] = that.serviceInfo.price item['unit_price'] = that.serviceInfo.price
} }
}) })
console.log(secondMenu,'secondMenu===='); console.log(secondMenu, 'secondMenu====');
store.commit('SET_SECOND_MENU', secondMenu); store.commit('SET_SECOND_MENU', secondMenu);
// // //
if(that.service_unit !== '0') { // if(that.service_unit !== '0') {
that.serviceInfo.unit_num = 1 // that.serviceInfo.unit_num = 1
that.serviceInfo.base_unit_num = '' // that.serviceInfo.base_unit_num = ''
that.serviceInfo.base_unit_price = '' // 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: 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,
b_unit_price: that.serviceInfo.base_unit_price, // b_unit_price: that.serviceInfo.base_unit_price,
}).then(response => { // }).then(response => {
if (response.status) { // if (response.status) {
// store.commit('SET_SECOND_MENU', secondMenu); // // store.commit('SET_SECOND_MENU', secondMenu);
that.service_status = true // that.service_status = true
// that.setMenuList(that.type, true) // // that.setMenuList(that.type, true)
that.$message.success('保存成功'); // that.$message.success('');
return true; // return true;
} // }
that.$message.error(response.info); // that.$message.error(response.info);
}).catch(error => { // }).catch(error => {
console.error(error, 'error') // console.error(error, 'error')
}) // })
}, },
resetShopPrice() { resetShopPrice() {
this.serviceInfo.unit_piece = '' this.serviceInfo.unit_piece = ''
@ -600,12 +636,12 @@ export default {
const that = this const that = this
// 1 // 1
// //
if(that.service_unit !== '0') { if (that.service_unit !== '0') {
that.serviceInfo.unit_num = 1 that.serviceInfo.unit_num = 1
that.serviceInfo.base_unit_num = '' that.serviceInfo.base_unit_num = ''
that.serviceInfo.base_unit_piece = '' that.serviceInfo.base_unit_piece = ''
} }
console.log(that.serviceInfo,'ddd') 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,
@ -732,7 +768,7 @@ export default {
jumpStep() { jumpStep() {
const that = this const that = this
this.$http('POST', '/agentnew/ajax_get_not_finished_site', {}).then(response => { this.$http('POST', '/agentnew/ajax_get_not_finished_site', {}).then(response => {
if(Object.keys(response.data).length>0){ if (Object.keys(response.data).length > 0) {
that.$router.push('/agent/siteAdd') that.$router.push('/agent/siteAdd')
} else { } else {
that.$router.push('/agent/siteServiceList?uid=' + that.uid) that.$router.push('/agent/siteServiceList?uid=' + that.uid)
@ -741,6 +777,9 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
jumpNextStep() {
//
},
calculateProfitRate(price, num, baseCost = 2.4) { calculateProfitRate(price, num, baseCost = 2.4) {
// //
if (!price || !num || price <= 0 || num <= 0) { if (!price || !num || price <= 0 || num <= 0) {
@ -756,33 +795,33 @@ export default {
try { try {
// 1000 // 1000
const pricePerThousand = (price / num) * 1000; const pricePerThousand = (price / num) * 1000;
console.log(pricePerThousand,'pricePerThousand=='); console.log(pricePerThousand, 'pricePerThousand==');
// //
const profitRate = ((pricePerThousand - baseCost) / baseCost) * 100; const profitRate = ((pricePerThousand - baseCost) / baseCost) * 100;
console.log(profitRate,'profitRate=='); console.log(profitRate, 'profitRate==');
// 1000 // 1000
const profitPerUnit = pricePerThousand - baseCost; const profitPerUnit = pricePerThousand - baseCost;
// //
const totalProfit = (profitPerUnit / 1000) * num; const totalProfit = (profitPerUnit / 1000) * num;
return { return {
profitRate: Number(profitRate.toFixed(2)), // profitRate: Number(profitRate.toFixed(2)), //
profitPerUnit: Number(profitPerUnit.toFixed(2)), // 1000 profitPerUnit: Number(profitPerUnit.toFixed(2)), // 1000
totalProfit: Number(totalProfit.toFixed(2)), // totalProfit: Number(totalProfit.toFixed(2)), //
pricePerThousand: Number(pricePerThousand.toFixed(2)), // 1000 pricePerThousand: Number(pricePerThousand.toFixed(2)), // 1000
isValid: true isValid: true
}; };
} catch (error) { } catch (error) {
console.error('计算利率时出错:', error); console.error('计算利率时出错:', error);
return { return {
profitRate: 0, profitRate: 0,
profitPerUnit: 0, profitPerUnit: 0,
totalProfit: 0, totalProfit: 0,
pricePerThousand: 0, pricePerThousand: 0,
isValid: false isValid: false
}; };
} }
} }
@ -790,25 +829,27 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.service_info{ .service_info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24px; gap: 24px;
} }
.gap6{
.gap6 {
gap: 6px; gap: 6px;
} }
.warn{
.warn {
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;
line-height: 17px; line-height: 17px;
letter-spacing: 0.03em; letter-spacing: 0.03em;
color: #FF4D4F !important; color: #FF4D4F !important;
} }
.service_info_wrap{
.service_info_wrap {}
}
.common_scss{ .common_scss {
width: 100%; width: 100%;
flex: 1; flex: 1;
color: #626573; color: #626573;
@ -820,40 +861,50 @@ export default {
padding: 14px 16px; padding: 14px 16px;
gap: 10px; gap: 10px;
box-sizing: border-box; box-sizing: border-box;
b{
b {
color: #23242B; color: #23242B;
} }
p{
p {
color: #23242B; color: #23242B;
text-align: left; text-align: left;
} }
.blue{
.blue {
color: #006AFF; color: #006AFF;
} }
.green{
.green {
color: #00C261; color: #00C261;
} }
label{
label {
white-space: nowrap; white-space: nowrap;
} }
} }
.gap24{
.gap24 {
gap: 24px; gap: 24px;
width: 100%; width: 100%;
align-items: stretch; align-items: stretch;
} }
.green_back{
.green_back {
background: #EFFFE0; background: #EFFFE0;
} }
.serviceAdd-wrap{
.serviceAdd-wrap {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.overFlow-wrap{
.overFlow-wrap {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
} }
} }
.pb80 { .pb80 {
padding-bottom: 80px; padding-bottom: 80px;
} }
@ -1080,10 +1131,10 @@ export default {
margin-right: 56px; margin-right: 56px;
} }
.service-open-num{ .service-open-num {
color: #006AFF; color: #006AFF;
letter-spacing: 0.08em; letter-spacing: 0.08em;
font-size: 12px; font-size: 12px;
} }
} }
</style> </style>
Loading…
Cancel
Save