订单修改成产品维度(renew接口有传mallId,这里先暂存,提交完后会注释掉)

master
yujialong 1 year ago
parent 60e10283cd
commit fc2fc8bb17
  1. 4
      apis/modules/order.js
  2. 4
      libs/util.js
  3. 214
      order/addCourse/addCourse.vue
  4. 124
      order/editCourse/editCourse.vue
  5. 222
      order/orderDetail/orderDetail.vue

@ -48,3 +48,7 @@ export const publicConfiguration = (data) => {
export const bulkShipping = (data) => {
return post('nakadai/nakadai/orderOther/bulkShipping', data)
}
export const queryCitySettlementPrice = (mallId, provinceId, cityId) => {
return post(`nakadai/mallPrice/queryCitySettlementPrice?mallId=${mallId}&provinceId=${provinceId}&cityId=${cityId}`)
}

@ -67,9 +67,9 @@ export default {
getBmName(val) {
return uni.getStorageSync('team').partnerClassificationName
},
// 返回图标。如果有图标,则直接返回,否则判断是否是数据产品,即productType=2,如果是,则取数据图标,否则则显示通用图标,这两个图标都在config/product.js里有配置
// 返回图标。如果有图标,则直接返回
getIcon(e) {
return e.miniProgramPictureAddress || (e.productType === 2 ? Product.dataIcon : Product.normalIcon)
return e.appletIcon || Product.normalIcon
},
// 预览文档
openFile(id) {

@ -4,8 +4,14 @@
<uni-search-bar class="search" radius="5" placeholder="请输入产品名称" clearButton="auto" cancelButton="none" v-model="keyword" />
</uni-card>
<ul class="tab">
<li v-for="(tab, i) in tabs" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
<ul class="tab-wrap">
<view class="tab">
<li :class="{active: curTab === ''}" @click="tabChange('')">全部</li>
</view>
<scroll-view scroll-x :scroll-left="scrollLeft" class="tab tab-scroll">
<li v-for="(tab, i) in tabs" :key="i" :class="{active: curTab === tab.id}" @click="tabChange(tab.id)">{{ tab.name }}</li>
</scroll-view>
</ul>
<ul class="list">
@ -26,32 +32,19 @@
</template>
<script>
import { AppletsDataProductList } from '@/apis/modules/product.js'
import { renew } from '@/apis/modules/order.js'
import { productCategoryList, listOfGoods } from '@/apis/modules/product.js'
import { renew, queryCitySettlementPrice } from '@/apis/modules/order.js'
export default {
data() {
return {
// authority: 01234
orderType: 1,
customerId: '',
provinceId: '',
cityId: '',
teamId: '',
curTab: '',
tabs: [
{
name: '全部',
id: ''
},
{
name: '实训课程',
id: 1
},
{
name: '理论课程',
id: 0
},
{
name: '数据产品',
id: 2
}
],
tabs: [],
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
searchTimer: null,
@ -105,22 +98,38 @@
const { options } = pages[pages.length - 1]
this.orderType = options.orderType
this.customerId = options.customerId
this.provinceId = options.provinceId
this.cityId = options.cityId
this.teamId = options.teamId
this.getTypes()
this.getList()
},
methods: {
//
getTypes() {
productCategoryList().then(res => {
res.classificationList.forEach(e => {
e.id = e.classificationId
e.name = e.classificationName
})
this.tabs.push(...res.classificationList)
}).catch(e => {})
},
//
getList() {
uni.showLoading({
title: '加载中'
})
AppletsDataProductList({
sort: 'desc',
keywords: this.keyword,
productType: this.curTab,
listOfGoods({
pageNum: this.page,
pageSize: this.pageSize
}).then(({ data }) => {
const { records } = data
pageSize: this.pageSize,
sort: 0,
isShelves: 0,
hotTag: 1,
productName: this.keyword,
productType: this.curTab,
}).then(({ page }) => {
const { records } = page
const list = this.courses
const all = this.checkAll.length //
const pageChange = this.reachBottom > 0 //
@ -131,9 +140,9 @@
text: '',
value: 1
}
e.check = (all && pageChange) || checked.find(n => n.id === e.id && n.productType === e.productType) ? 1 : 0
e.check = (all && pageChange) || checked.find(n => n.mallId === e.mallId) ? 1 : 0
//
if (list.find(n => n.dataOrCourseId == e.id && n.productType == e.productType)) {
if (list.find(n => n.mallId == e.mallId)) {
//
checkData.disable = true
e.check = 1
@ -144,7 +153,7 @@
// list
this.list = pageChange ? [...this.list, ...records] : records
this.page++ // page+1
const noMore = this.list.length === data.total //
const noMore = this.list.length === page.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
uni.hideLoading()
@ -166,8 +175,8 @@
checkChange(e, i) {
const { checked } = this
const item = this.list[i]
const { id, productType } = item
const include = checked.findIndex(e => e.id === id && e.productType === productType)
const { mallId } = item
const include = checked.findIndex(e => e.mallId === mallId)
// pushpush
if (e.detail.value.length) {
include === -1 && checked.push(item)
@ -185,8 +194,8 @@
const { checked, list } = this
list.map(e => {
e.check = isCheck ? 1 : 0
const { id, productType } = e
const include = checked.findIndex(n => n.id === id && n.productType === productType)
const { mallId } = e
const include = checked.findIndex(n => n.mallId === mallId)
// pushpush
if (isCheck) {
include === -1 && checked.push(e)
@ -196,51 +205,50 @@
}
})
},
//
createParam(e) {
createParam(e, authority) {
const { orderType } = this
const trial = orderType == 2 //
return {
dataOrCourseId: e.id, // id
dataOrCourseId: e.associatedProduct, // id
mallId: e.mallId,
productName: e.productName, //
periodOfUse: '', // 使
startTime: this.$util.formatDate(new Date(), 'yyyy-MM-dd'), //
endTime: '', //
remainingPeriod: '', //
marketValue: '', //
marketPrice: e.marketPrice, //
marketPrice: e.marketUnitPrice, //
finalPrice: trial ? 0 : '', //
finalValue: trial ? 0 : '', //
discountRate: trial ? '0%' : '', //
accountNum: e.productType === 2 ? '' : 1, //
accountNum: authority ? 1 : '', //
totalAmount: '', //
isEnable: 1, // 10
isEnable: 0, // 10
ship: 0, // 01
authority: e.productType === 2 ? 0 : 1, // 01
productType: e.productType, // (0-> 1- 2 )
authority, // 01
options: 2,
miniProgramPictureAddress: e.miniProgramPictureAddress, //
miniProgramPictureAddress: e.appletIcon || '', //
settlementPrice: trial ? 0 : '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
settlementPriceUnit: e.settlementPrice || 0, //
serviceFee: 0 //
}
},
//
handleRenew(authority, customerId, productId, result, resolve, reject) {
handleRenew(authority, customerId, productId, mallId, result, resolve, reject) {
renew({
authority,
customerId,
productId
productId,
mallId
}).then(({ orderOthers }) => {
result.map(e => {
const item = orderOthers.find(n => n.dataOrCourseId == e.dataOrCourseId && n.authority == authority == e.authority)
const item = orderOthers.find(n => n.dataOrCourseId == e.dataOrCourseId && n.authority == authority && e.authority == authority)
if (item) {
let date = new Date(item.endTime)
date = new Date(date.setDate(date.getDate() + 1))
e.startTime = this.$util.formatDate(date, 'yyyy-MM-dd')
e.renew = 1
}
})
resolve()
@ -253,29 +261,81 @@
const list = this.checked //
if (list.length) {
const result = this.courses
const courseIds = []
const dataIds = []
console.log(123, result)
const list1 = [] //
const list0 = [] //
const list2 = [] //
const list3 = [] //
const list4 = [] //
const mallId1 = [] //
const mallId0 = [] //
const mallId2 = [] //
const mallId3 = [] //
const mallId4 = [] //
const { customerId } = this
list.map(e => {
// id
if (!result.find(n => (n.dataOrCourseId == e.id || n.dataOrCourseId == e.dataOrCourseId) && ((n.authority && e.productType != 2) || (!n.authority && e.productType == 2)))) {
e.productType === 2 ? dataIds.push(e.id) : courseIds.push(e.id)
result.push(this.createParam(e))
}
const listPromise = []
list.forEach(async e => {
listPromise.push(new Promise(async (resolve, reject) => {
// id
if (!result.find(n => (n.dataOrCourseId == e.associatedProduct || n.dataOrCourseId == e.dataOrCourseId) && n.authority == e.authority)) {
//
if (this.provinceId) {
const res = await queryCitySettlementPrice(e.mallId, this.provinceId, this.cityId)
if (res.mallPrice) e.settlementPrice = res.mallPrice.discountRate
}
console.log(44, e)
const classId = e.classificationId
const pid = +e.associatedProduct
const mallId = e.mallId
if (classId == 1 || classId == 2) {
list1.push(pid)
mallId1.push(mallId)
} else if (classId == 3) {
list2.push(pid)
mallId2.push(mallId)
} else if (classId == 4) {
list3.push(pid)
mallId3.push(mallId)
} else if (classId == 5) {
list0.push(pid)
mallId0.push(mallId)
} else if (classId == 6) {
list4.push(pid)
mallId4.push(mallId)
}
result.push(this.createParam(e, this.$util.getOrderType(classId)))
resolve()
} else {
resolve()
}
}))
})
const promises = []
//
dataIds.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(0, customerId, dataIds, result, resolve, reject)
}))
courseIds.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(1, customerId, courseIds, result, resolve, reject)
}))
Promise.all(promises).then(_ => {
uni.setStorageSync('courses', result) //
uni.redirectTo({
url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}&action=add`
})
Promise.all(listPromise).then(_ => {
const promises = []
// 5authorityrenew
list0.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(0, customerId, list0, mallId0, result, resolve, reject)
}))
list1.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(1, customerId, list1, mallId1, result, resolve, reject)
}))
list2.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(2, customerId, list2, mallId2, result, resolve, reject)
}))
list3.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(3, customerId, list3, mallId3, result, resolve, reject)
}))
list4.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(4, customerId, list4, mallId4, result, resolve, reject)
}))
Promise.all(promises).then(_ => {
uni.setStorageSync('courses', result) //
uni.redirectTo({
url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}&teamId=${this.teamId}`
})
})
})
} else {
this.$util.errMsg('请选择产品!')
@ -289,6 +349,16 @@
.page {
padding-bottom: 130rpx;
}
.tab-wrap {
display: flex;
.tab-scroll {
width: calc(100% - 100rpx);
white-space: nowrap;
li {
display: inline-block;
}
}
}
.list {
li {
display: flex;

@ -88,6 +88,8 @@
<script>
import { getOrderOtherTime } from '@/apis/modules/order.js'
import { getPartnerTeamRates } from '@/apis/modules/parner.js'
import { productCategoryList } from '@/apis/modules/product.js'
export default {
data() {
return {
@ -97,6 +99,7 @@
isRenew: 0, //
orderType: 1,
customerId: '',
teamId: '',
timer: null,
units: [{
text: '日',
@ -109,24 +112,12 @@
id: 2
}],
unitText: ['日', '月', '年'],
productTypes: [
{
name: '实训课程',
id: 1
},
{
name: '理论课程',
id: 0
},
{
name: '数据产品',
id: 2
}
],
productTypes: [],
courses: {} , //
orderRepeat: [],
repeatMsg: '',
err: '',
rate: ''
}
},
onShow() {
@ -138,55 +129,35 @@
this.isHandle = options.action === 'handle'
this.isRenew = options.action === 'renew'
this.isAdd = options.action === 'add'
this.teamId = options.teamId
this.handleProduct()
this.teamId && this.getRate()
},
methods: {
//
handleProduct() {
const list = uni.getStorageSync('courses')
const courses = {
practice: {
shrink: false,
name: '实训课程产品',
list: []
},
theory: {
shrink: false,
name: '理论课程产品',
list: []
},
data: {
shrink: false,
name: '数据产品',
list: []
}
}
// 3push(0-> 1- 2 )
list.map(e => {
const type = e.productType
!type ?
courses.theory.list.push(e) :
type === 1 ?
courses.practice.list.push(e) :
courses.data.list.push(e)
})
// let selectData= []
// let itemIndex = ''
// for (let item in courses) {
// if(courses[item].list.length) {
// const data = courses[item].list.find(options=>{
// if(options.id == this.editId) {
// itemIndex = item
// }
// return options.id == this.editId
// })
// selectData.push(data)
// break
// }
// }
// courses[itemIndex].list = selectData
this.courses = courses
let courses = {}
//
productCategoryList().then(res => {
const typeList = []
res.classificationList.forEach(e => {
typeList.push({
id: e.classificationId,
name: e.classificationName
})
courses['list' + this.$util.getOrderType(e.classificationId)] = {
shrink: false,
name: e.classificationName,
list: []
}
})
this.productTypes = typeList
list.map(e => {
courses['list' + e.authority].list.push(e)
})
this.courses = courses
}).catch(e => {})
try {
uni.removeStorageSync('courses')
} catch (e) {}
@ -282,6 +253,7 @@
//
dealSettlePrice(row) {
// 0
console.log('dealSettlePrice=>', row, this.orderType)
if (this.orderType == 2) {
row.settlementPrice = 0
row.serviceFee = 0
@ -289,27 +261,29 @@
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
let sPrice = ''
if (row.settlementMethod == 0) {
// **/**(1)
const priceUnit = row.settlementPriceUnit
sPrice = ((!unit ?
priceUnit / 365 * useUnit :
unit === 1 ?
priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed((2))
} else {
// *
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
}
// **/**(1)
const priceUnit = row.settlementPriceUnit
sPrice = ((!unit ?
priceUnit / 365 * useUnit :
unit === 1 ?
priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed((2))
row.settlementPrice = this.$util.handleNaN(sPrice)
// *10%
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
//
row.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2)
}
},
//
getRate() {
getPartnerTeamRates({
teamId: this.teamId
}).then(({ teamRates }) => {
console.log('teamRates=>',teamRates)
this.rate = teamRates.annualMarketingFee || 0
}).catch(res => {})
},
//
calcDiscount(row) {
const price = row.authority ? row.finalPrice : row.finalValue

@ -80,6 +80,7 @@
<button v-if="item.status === 1 || isHandle || !orderId && auth('订单管理:发货')" class="course-btn" type="primary" @click.stop="handleDeliver(n, i)">{{ item.ship ? '取消' : ''}}发货</button>
<button v-else-if="!isDetail && auth('订单管理:启用')" class="course-btn" type="primary" @click.stop="handleEnable(n, i)">{{ item.isEnable ? '禁用' : '启用'}}</button>
<image v-if="!orderId || isRenew" class="del" src="@/static/image/trash.png" mode="widthFix" @click.stop="delCourse(c, i)"></image>
<button v-if="(item.authority == 3 || item.authority == 4) && ((item.mallNonAssociatedLinks && item.mallNonAssociatedLinks.length) || item.shipContent)" class="course-btn" type="primary" @click.stop="showShip(item)">发货信息</button>
</view>
</view>
@ -111,7 +112,7 @@
</view>
<view class="line">
<view class="label">{{ item.authority ? '市场价' : '市场单价' }}</view>
<view class="val">{{ item.marketValue || 0 }}</view>
<view class="val">{{ item.marketValue && item.marketValue + '元' }}</view>
</view>
<view class="line">
<view class="label">结算价</view>
@ -205,14 +206,20 @@
<view class="item" v-for="item in customerList" @click="customerChange(item)">{{ item.customerName }}</view>
</view>
</view>
<uni-popup ref="info" type="bottom" background-color="#fff">
<view class="ship-info">
<view class="ship-text" v-html="shipInfo" @click="copy"></view>
<uni-easyinput type="textarea" v-model="shipContent" placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)" :disabled="isDetail"></uni-easyinput>
</view>
</uni-popup>
</view>
</template>
<script>
import { queryCustomer, queryCustomerDetails } from '@/apis/modules/client.js'
import { add, update, del, getDetail, renew, ship, miniProgramOrderRecord, bulkShipping } from '@/apis/modules/order.js'
import { teamList, getAllTeam } from '@/apis/modules/parner.js'
import { getOrderOtherTime } from '@/apis/modules/order.js'
import { add, update, del, getDetail, renew, ship, miniProgramOrderRecord, bulkShipping, getOrderOtherTime, queryCitySettlementPrice } from '@/apis/modules/order.js'
import { teamList, getAllTeam, getPartnerTeamRates } from '@/apis/modules/parner.js'
import { productCategoryList } from '@/apis/modules/product.js'
export default {
data() {
return {
@ -282,6 +289,10 @@
id: 2
}],
unitText: ['日', '月', '年'],
rate: '',
shipInfo: '',
shipContent: ''
}
},
watch: {
@ -361,9 +372,9 @@
}
}
this.courses = order.orderOther
this.handleRenew(0)
this.handleRenew(1)
this.handleRenew(2)
for (let i = 0; i < 5; i++) {
this.handleRenew(i)
}
Promise.all(this.promises).then(_ => {
this.handleProduct(this.courses)
this.calcTotal()
@ -375,43 +386,36 @@
},
//
handleProduct(list) {
const courses = {
practice: {
shrink: false,
name: '实训课程产品',
list: []
},
theory: {
shrink: false,
name: '理论课程产品',
list: []
},
data: {
shrink: false,
name: '数据产品',
list: []
}
}
// 3push(0-> 1- 2 )
list.map(e => {
e.serviceFee = (e.settlementPrice * 0.1).toFixed(2)
const type = e.productType
!type ?
courses.theory.list.push(e) :
type === 1 ?
courses.practice.list.push(e) :
courses.data.list.push(e)
})
this.courseList = courses
let courses = {}
//
productCategoryList().then(res => {
res.classificationList.forEach(e => {
courses['list' + this.$util.getOrderType(e.classificationId)] = {
shrink: false,
name: e.classificationName,
list: []
}
})
list.map(e => {
e.serviceFee = (e.finalPrice * (this.rate / 100)).toFixed(2) // != 0 &&
courses['list' + e.authority].list.push(e)
})
console.log(123,courses)
this.courseList = courses
}).catch(e => {})
},
// pc
handleRenew(authority) {
const productId = this.courses.filter(e => e.authority == authority).map(e => e.dataOrCourseId)
const list = this.courses.filter(e => e.authority == authority)
const productId = list.map(e => e.dataOrCourseId)
const mallId = list.map(e => e.mallId)
productId.length && this.promises.push(new Promise((resolve, reject) => {
renew({
authority,
customerId: this.form.customerId,
productId
productId,
mallId
}).then(({ orderOthers }) => {
const { courses } = this
const now = new Date()
@ -502,25 +506,53 @@
this.keyword = ''
},
//
customerChange(item) {
async customerChange(item) {
const { form } = this
//
queryCustomerDetails({
const { result } = await queryCustomerDetails({
customerId: item.customerId
}).then(({ result }) => {
this.handleErr('customerName')
const e = result.customer
form.customerId = e.customerId
form.customerName = e.customerName
form.provinceId = e.provinceId
form.cityId = e.cityId
form.provinceName = e.provinceName
form.cityName = e.cityName
form.phone = e.phone
form.email = e.email
form.orderContact = e.name
}).catch(e => {})
this.closeCustomer()
})
this.handleErr('customerName')
const e = result.customer
const { provinceId, cityId } = e
form.customerId = e.customerId
form.customerName = e.customerName
form.provinceId = provinceId
form.cityId = cityId
form.provinceName = e.provinceName
form.cityName = e.cityName
form.phone = e.phone
form.email = e.email
form.orderContact = e.name
//
const list = this.courseList
const courses = []
const promises = []
for (const i in list) {
list[i].list.forEach(n => {
promises.push(new Promise(async (resolve, reject) => {
const res = await queryCitySettlementPrice(n.mallId, provinceId, cityId)
n.settlementPriceUnit = res.mallPrice ? res.mallPrice.discountRate : 0
courses.push(n)
resolve()
}))
})
}
Promise.all(promises).then(_ => {
this.courses = courses
this.calcTotal()
this.closeCustomer()
})
},
//
getRate() {
getPartnerTeamRates({
teamId: this.form.teamId
}).then(({ teamRates }) => {
this.rate = teamRates.annualMarketingFee || 0
this.calcTotal()
}).catch(res => {})
},
//
getTeam(getInfo) {
@ -531,6 +563,7 @@
},
//
getBm() {
this.getRate()
teamList({
pageNum: 1,
pageSize: 1000,
@ -543,17 +576,19 @@
//
toAdd() {
uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form
customerId ?
this.$util.to(`../addCourse/addCourse?orderType=${orderType}&customerId=${customerId}`) :
this.$util.to(`../addCourse/addCourse?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}&teamId=${this.form.teamId || ''}`) :
this.$util.errMsg('请先选择客户!')
},
//
editCourse(c, i) {
if (this.isDetail) return false
uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form
this.$util.to(`../editCourse/editCourse?orderType=${orderType}&customerId=${customerId}&action=${this.isEdit ? 'edit' : this.isRenew ? 'renew' : this.isHandle ? 'handle' : !this.orderId ? 'add' : ''}`)
this.$util.to(`../editCourse/editCourse?orderType=${orderType}&customerId=${customerId}&action=${this.isEdit ? 'edit' : this.isRenew ? 'renew' : this.isHandle ? 'handle' : !this.orderId ? 'add' : ''}&teamId=${this.form.teamId || ''}`)
},
//
toClient() {
@ -625,6 +660,10 @@
e.finalValue = 0
e.discountRate = '0%'
} else {
console.log(111, e)
this.calcDiscount(e)
this.dealSettlePrice(e)
this.calcFinalPrice(e)
const curPurchase = +e.settlementPrice + +e.serviceFee
purchase += curPurchase
profit += +e.finalPrice - curPurchase
@ -632,7 +671,28 @@
})
form.purchaseCost = Math.round(purchase)
form.profit = Math.round(profit)
form.orderAmount = +form.purchaseCost + +form.profit
form.orderAmount = (+form.purchaseCost + +form.profit).toFixed(2)
},
//
showShip(row) {
console.log(33)
let val = ''
row.mallNonAssociatedLinks && row.mallNonAssociatedLinks.forEach(e => {
val += e.urlName + ':' + e.url + '\n'
})
this.shipInfo = val
this.shipContent = row.shipContent || val
this.$refs.info.open()
},
//
copy() {
const that = this
uni.setClipboardData({
data: this.shipInfo,
success() {
that.$util.sucMsg('复制成功')
}
})
},
//
handleErr(val) {
@ -717,7 +777,6 @@
})
} else {
add(data).then(res => {
// form.orderOther.find(e => !e.ship) || this.publicNotice(form, orderId) //
uni.hideLoading()
this.$util.sucMsg('添加成功')
setTimeout(() => {
@ -789,6 +848,7 @@
}, 500)
},
dealSettlePrice(row) {
console.log('dealSettlePrice', row)
// 0
if (this.orderType == 2) {
row.settlementPrice = 0
@ -797,30 +857,19 @@
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
let sPrice = ''
if (row.settlementMethod == 0) {
// **/**(1)
const priceUnit = row.settlementPriceUnit
sPrice = ((!unit ?
priceUnit / 365 * useUnit :
unit === 1 ?
priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed((2))
} else {
// *
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
}
// **/**(1)
const priceUnit = row.settlementPriceUnit
sPrice = ((!unit ?
priceUnit / 365 * useUnit :
unit === 1 ?
priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed((2))
row.settlementPrice = this.$util.handleNaN(sPrice)
// *10%
console.log('row.settlementPrice =>' ,row.settlementPrice)
if (row.settlementPrice) {
console.log(2222)
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}else {
console.log(1111111)
row.serviceFee = 0
}
//
row.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2)
console.log('row.settlementPrice =>' ,this.rate,row.serviceFee)
}
},
calcDiscount(row) {
@ -877,9 +926,8 @@
}, 500)
},
//
updateServiceFee(options) {
options.serviceFee = (options.settlementPrice * 0.1).toFixed(2)
console.log('options===>',options)
updateServiceFee(row) {
options.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2)
}
}
}
@ -1119,4 +1167,12 @@
.defaultBox {
font-size: 28rpx;
}
.ship-info {
padding: 30rpx;
white-space: pre-wrap;
font-size: 28rpx;
.ship-text {
margin-bottom: 20rpx;
}
}
</style>

Loading…
Cancel
Save