master
yujialong 2 years ago
parent 04d60abd06
commit 2be807f0ee
  1. 8
      apis/modules/client.js
  2. 2
      apis/modules/order.js
  3. 12
      apis/modules/parner.js
  4. 14
      apis/modules/user.js
  5. 2
      apis/request.js
  6. 2
      config/request.js
  7. 16
      order/addCourse/addCourse.vue
  8. 49
      order/editCourse/editCourse.vue
  9. 20
      order/orderDetail/orderDetail.vue
  10. 2
      order/orders/orders.vue
  11. 16
      pages/clientDetail/clientDetail.vue
  12. 2
      pages/clients/clients.vue
  13. 1
      pages/index/index.vue
  14. 2
      pages/products/products.vue
  15. 1
      styles/common.scss

@ -6,11 +6,11 @@ export const queryCustomer = (data) => {
} }
export const list = (data) => { export const list = (data) => {
return post('nakadai/applets/customer/getCustomerListBasedOnBusinessManagerId', data) return post('nakadai/nakadai/applets/customer/getCustomerListBasedOnBusinessManagerId', data)
} }
export const all = (data) => { export const all = (data) => {
return post('nakadai/applets/customer/customerList', data) return post('nakadai/nakadai/applets/customer/customerList', data)
} }
export const queryCustomerDetails = (data) => { export const queryCustomerDetails = (data) => {
@ -46,9 +46,9 @@ export const getProductsSubscribedByCustomers = (data) => {
} }
export const getTeamsByAccountId = (data) => { export const getTeamsByAccountId = (data) => {
return post('nakadai/applets/customer/getTeamsByAccountId', data) return post('nakadai/nakadai/applets/customer/getTeamsByAccountId', data)
} }
export const getTheBusinessManagerIdsUnderTheTeam = id => { export const getTheBusinessManagerIdsUnderTheTeam = id => {
return post(`nakadai/applets/customer/getTheBusinessManagerIdsUnderTheTeam?id=${id}`) return post(`nakadai/nakadai/applets/customer/getTheBusinessManagerIdsUnderTheTeam?id=${id}`)
} }

@ -22,7 +22,7 @@ export const renew = (data) => {
} }
export const list = (data) => { export const list = (data) => {
return post('nakadai/applets/order/orderList', data) return post('nakadai/nakadai/applets/order/orderList', data)
} }
export const orderList = (data) => { export const orderList = (data) => {

@ -2,25 +2,25 @@ import request from '@/apis/request.js'
const { get, post } = request const { get, post } = request
export const savePartnerAccount = (data) => { export const savePartnerAccount = (data) => {
return post('nakadai/partnerAccount/savePartnerAccount', data) return post('nakadai/nakadai/partnerAccount/savePartnerAccount', data)
} }
export const teamList = (data) => { export const teamList = (data) => {
return post('nakadai/partnerAccount/partnerAccountList', data) return post('nakadai/nakadai/partnerAccount/partnerAccountList', data)
} }
export const generateInvitationCode = accountId => { export const generateInvitationCode = accountId => {
return post(`nakadai/partnerAccount/generateInvitationCode?accountId=${accountId}`) return post(`nakadai/nakadai/partnerAccount/generateInvitationCode?accountId=${accountId}`)
} }
export const treeList = (data) => { export const treeList = (data) => {
return post('nakadai/partnerClassification/treeList', data) return post('nakadai/nakadai/partnerClassification/treeList', data)
} }
export const my = (data) => { export const my = (data) => {
return get('nakadai/partner-team/my', data) return get('nakadai/nakadai/partner-team/my', data)
} }
export const mailFileSend = (data) => { export const mailFileSend = (data) => {
return post('nakadai/partnerAccount/mailFileSend', data) return post('nakadai/nakadai/partnerAccount/mailFileSend', data)
} }

@ -14,7 +14,7 @@ export const examinePassword = (data) => {
} }
export const getUserRolesPermissionMenu = (data) => { export const getUserRolesPermissionMenu = (data) => {
return get('users/user-role/getUserRolesPermissionMenu', data) return get('users/users/user-role/getUserRolesPermissionMenu', data)
} }
export const updatePersonCenter = (data) => { export const updatePersonCenter = (data) => {
@ -26,27 +26,27 @@ export const queryUserInfoDetails = () => {
} }
export const updateMyEmail = (data) => { export const updateMyEmail = (data) => {
return post('nakadai/partner-team/updateMyEmail', data) return post('nakadai/nakadai/partner-team/updateMyEmail', data)
} }
export const mailCodeSend = (data) => { export const mailCodeSend = (data) => {
return post('nakadai/partner-team/mailCodeSend', data) return post('nakadai/nakadai/partner-team/mailCodeSend', data)
} }
export const changeAccount = account => { export const changeAccount = account => {
return post(`users/applets/mine/changeAccount?account=${account}`) return post(`users/users/applets/mine/changeAccount?account=${account}`)
} }
export const changePhoneNumber = (phone, code) => { export const changePhoneNumber = (phone, code) => {
return post(`users/applets/mine/changePhoneNumber?phone=${phone}&code=${code}`) return post(`users/users/applets/mine/changePhoneNumber?phone=${phone}&code=${code}`)
} }
export const checkIfAnAccountExists = account => { export const checkIfAnAccountExists = account => {
return post(`users/applets/mine/checkIfAnAccountExists?account=${account}`) return post(`users/users/applets/mine/checkIfAnAccountExists?account=${account}`)
} }
export const checkIfThePhoneNumberExists = phone => { export const checkIfThePhoneNumberExists = phone => {
return post(`users/applets/mine/checkIfThePhoneNumberExists?phone=${phone}`) return post(`users/users/applets/mine/checkIfThePhoneNumberExists?phone=${phone}`)
} }
export const updateUserAvatars = `http://39.108.250.202:9000/users/users/userAccount/updateUserAvatars` export const updateUserAvatars = `http://39.108.250.202:9000/users/users/userAccount/updateUserAvatars`

@ -19,7 +19,7 @@ const request = options => {
const { url } = options const { url } = options
uni.request({ uni.request({
header, header,
url: (otherUrl.find(e => url.includes(e)) ? 'http://192.168.31.151:9000/' : config.baseURL) + url, url: config.baseURL + url,
method: options.method || 'GET', // 请求类型,默认为GET method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象 data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => { success: ({ data }) => {

@ -5,7 +5,7 @@
*/ */
export default { export default {
baseURL: 'http://192.168.31.151:9000/', baseURL: 'https://huorantech.cn/',
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'
}, },

@ -10,7 +10,8 @@
<ul class="list"> <ul class="list">
<li v-for="(item, i) in list"> <li v-for="(item, i) in list">
<uni-data-checkbox class="check" multiple v-model="item.check" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox> <uni-data-checkbox v-if="item.check" class="check" multiple :value="[1]" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox>
<uni-data-checkbox v-else class="check" multiple v-model="item.check" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox>
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> <image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }} {{ item.productName }}
</li> </li>
@ -30,7 +31,7 @@
export default { export default {
data() { data() {
return { return {
orderType: 0, orderType: 1,
customerId: '', customerId: '',
curTab: '', curTab: '',
tabs: [ tabs: [
@ -61,6 +62,8 @@
listAll: [], listAll: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
check: [1],
noCheck: [],
checkData: [{ checkData: [{
text: '', text: '',
value: 1 value: 1
@ -108,7 +111,7 @@
// //
getList() { getList() {
AppletsDataProductList({ AppletsDataProductList({
sort: '', sort: 'desc',
keywords: this.keyword, keywords: this.keyword,
productType: this.curTab, productType: this.curTab,
pageNum: this.page, pageNum: this.page,
@ -125,12 +128,12 @@
text: '', text: '',
value: 1 value: 1
} }
e.check = (all && pageChange) || checked.find(n => n.id === e.id && n.productType === e.productType) ? [1] : [] e.check = (all && pageChange) || checked.find(n => n.id === e.id && n.productType === e.productType) ? 1 : 0
// //
if (list.find(n => n.dataOrCourseId == e.id && n.productType == e.productType)) { if (list.find(n => n.dataOrCourseId == e.id && n.productType == e.productType)) {
// //
checkData.disable = true checkData.disable = true
e.check = [1] e.check = 1
} }
e.checkData = [checkData] e.checkData = [checkData]
}) })
@ -159,6 +162,7 @@
const item = this.list[i] const item = this.list[i]
const { id, productType } = item const { id, productType } = item
const include = checked.findIndex(e => e.id === id && e.productType === productType) const include = checked.findIndex(e => e.id === id && e.productType === productType)
console.log(11, this.list, e, i)
// pushpush // pushpush
if (e.detail.value.length) { if (e.detail.value.length) {
include === -1 && checked.push(item) include === -1 && checked.push(item)
@ -249,7 +253,7 @@
Promise.all(promises).then(_ => { Promise.all(promises).then(_ => {
uni.setStorageSync('courses', result) // uni.setStorageSync('courses', result) //
uni.redirectTo({ uni.redirectTo({
url: `../editCourse/editCourse?customerId=${customerId}` url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}`
}) })
}) })
} else { } else {

@ -78,6 +78,7 @@
export default { export default {
data() { data() {
return { return {
orderType: 1,
customerId: '', customerId: '',
timer: null, timer: null,
units: [{ units: [{
@ -114,6 +115,7 @@
onShow() { onShow() {
const pages = getCurrentPages() const pages = getCurrentPages()
const { options } = pages[pages.length - 1] const { options } = pages[pages.length - 1]
this.orderType = options.orderType
this.customerId = options.customerId this.customerId = options.customerId
this.handleProduct() this.handleProduct()
}, },
@ -160,6 +162,7 @@
itemList: that.unitText, itemList: that.unitText,
success: ({ tapIndex }) => { success: ({ tapIndex }) => {
item.options = tapIndex item.options = tapIndex
that.calcDate(item)
} }
}) })
}, },
@ -242,27 +245,33 @@
}, },
// //
dealSettlePrice(row) { dealSettlePrice(row) {
const unit = row.options // 使 // 0
const useUnit = row.periodOfUse // 使 if (this.orderType == 2) {
let sPrice = '' row.settlementPrice = 0
if (row.settlementMethod == 0) { row.serviceFee = 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 { } else {
// * const unit = row.options // 使
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2)) const useUnit = row.periodOfUse // 使
} let sPrice = ''
row.settlementPrice = this.$util.handleNaN(sPrice) if (row.settlementMethod == 0) {
// *10% // **/**(1)
if (row.settlementPrice) { const priceUnit = row.settlementPriceUnit
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2) 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))
}
row.settlementPrice = this.$util.handleNaN(sPrice)
// *10%
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
} }
}, },
// //

@ -76,7 +76,7 @@
</view> </view>
<view class="line"> <view class="line">
<view class="label">结算价</view> <view class="label">结算价</view>
<view class="val">{{ item.settlementPrice }}</view> <view class="val">{{ form.orderType === 2 ? 0 : item.settlementPrice }}</view>
</view> </view>
<view class="line"> <view class="line">
<view class="label">折扣率</view> <view class="label">折扣率</view>
@ -84,7 +84,7 @@
</view> </view>
<view class="line"> <view class="line">
<view class="label">平台服务费</view> <view class="label">平台服务费</view>
<view class="val">{{ item.serviceFee }}</view> <view class="val">{{ form.orderType === 2 ? 0 :item.serviceFee }}</view>
</view> </view>
<view class="line done"> <view class="line done">
<view class="val">成交价格</view> <view class="val">成交价格</view>
@ -167,7 +167,7 @@
customerName: '', customerName: '',
profit: 0, // profit: 0, //
purchaseCost: 0, // purchaseCost: 0, //
teamId: uni.getStorageSync('team').teamId, teamId: uni.getStorageSync('team').id,
businessManagerId: this.$util.getBmId() businessManagerId: this.$util.getBmId()
}, },
courseList: {}, courseList: {},
@ -389,9 +389,17 @@
总成本和总利润为单个产品的采购成本价和利润的和 总成本和总利润为单个产品的采购成本价和利润的和
*/ */
list.map(e => { list.map(e => {
const curPurchase = +e.settlementPrice + +e.serviceFee if (isTrial) {
purchase += curPurchase e.settlementPrice = 0
profit += +e.finalPrice - curPurchase e.serviceFee = 0
e.finalPrice = 0
e.finalValue = 0
e.discountRate = '0%'
} else {
const curPurchase = +e.settlementPrice + +e.serviceFee
purchase += curPurchase
profit += +e.finalPrice - curPurchase
}
}) })
form.purchaseCost = isTrial ? 0 : Math.round(purchase) form.purchaseCost = isTrial ? 0 : Math.round(purchase)
form.profit = isTrial ? 0 : Math.round(profit) form.profit = isTrial ? 0 : Math.round(profit)

@ -174,7 +174,7 @@
getList() { getList() {
const data = { const data = {
businessManagerId: this.$util.getBmId(), businessManagerId: this.$util.getBmId(),
teamId: uni.getStorageSync('team').partnerClassificationId, teamId: uni.getStorageSync('team').id,
keywords: this.keyword, keywords: this.keyword,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,

@ -159,11 +159,13 @@
}, 500) }, 500)
} }
}, },
onLoad(option) { onShow() {
this.customerId = option.customerId const pages = getCurrentPages()
this.isDetail = !!option.show const { options } = pages[pages.length - 1]
this.customerId = options.customerId
this.isDetail = !!options.show
option.customerId && this.getInfo() options.customerId && this.getInfo()
// //
if (!this.isDetail) { if (!this.isDetail) {
this.getSchool() this.getSchool()
@ -171,8 +173,8 @@
} }
// //
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.customerId ? title: options.customerId ?
(option.show ? (options.show ?
'客户详情' : '客户详情' :
'编辑客户') : '编辑客户') :
'新增客户' '新增客户'
@ -294,7 +296,7 @@
uni.hideLoading() uni.hideLoading()
this.$util.sucMsg('编辑成功') this.$util.sucMsg('编辑成功')
setTimeout(() => { setTimeout(() => {
this.$util.to('../clients/clients') uni.navigateBack()
}, 1500) }, 1500)
}).catch(res => {}) }).catch(res => {})
} else { } else {

@ -142,7 +142,7 @@
getList() { getList() {
const data = { const data = {
businessManagerId: this.$util.getBmId(), businessManagerId: this.$util.getBmId(),
teamId: uni.getStorageSync('team').teamId, teamId: uni.getStorageSync('team').id,
customerType: this.customerType, customerType: this.customerType,
keywords: this.keyword, keywords: this.keyword,
pageNum: this.page, pageNum: this.page,

@ -155,6 +155,7 @@
getTeamsByAccountId().then(({ data }) => { getTeamsByAccountId().then(({ data }) => {
data.map(e => { data.map(e => {
const n = e.partnerClassificationList const n = e.partnerClassificationList
e.id = n.id
e.teamId = e.partnerClassificationId e.teamId = e.partnerClassificationId
e.partnerClassificationName = n.partnerClassificationName e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList delete e.partnerClassificationList

@ -73,7 +73,7 @@
reachBottom: 0, // 0->,1->,-1-> reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore status: 'more', // more|loading|noMore
searchTimer: null, searchTimer: null,
sort: '', sort: 'desc',
keyword: '', keyword: '',
list: [], list: [],
page: 1, page: 1,

@ -100,7 +100,6 @@ ul {
} }
} }
.err { .err {
border-bottom-color: #f00;
.name { .name {
color: #f00; color: #f00;
} }

Loading…
Cancel
Save