master
yujialong 2 years ago
parent 2451d46666
commit 623291a197
  1. 8
      apis/modules/user.js
  2. 2
      apis/request.js
  3. 228
      order/editCourse/editCourse.vue
  4. 19
      order/orderDetail/orderDetail.vue
  5. 2
      pages/clientDetail/clientDetail.vue
  6. 31
      pages/email/email.vue
  7. 30
      pages/index/index.vue
  8. BIN
      static/image/tab1-1.png
  9. BIN
      static/image/tab1.png
  10. BIN
      static/image/tab2-1.png
  11. BIN
      static/image/tab2.png
  12. BIN
      static/image/tab3-1.png
  13. BIN
      static/image/tab3.png

@ -25,12 +25,12 @@ export const queryUserInfoDetails = () => {
return get('users/users/userAccount/queryUserInfoDetails') return get('users/users/userAccount/queryUserInfoDetails')
} }
export const bindPhoneOrEmail = (data) => { export const updateMyEmail = (data) => {
return post('users/users/userAccount/bindPhoneOrEmail', data) return post('nakadai/partner-team/updateMyEmail', data)
} }
export const sendPhoneOrEmailCode = (data) => { export const mailCodeSend = (data) => {
return post('users/users/userAccount/sendPhoneOrEmailCode', data) return post('nakadai/partner-team/mailCodeSend', data)
} }
export const changeAccount = account => { export const changeAccount = account => {

@ -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: (otherUrl.find(e => url.includes(e)) ? 'http://192.168.31.137:9000/' : config.baseURL) + url,
method: options.method || 'GET', // 请求类型,默认为GET method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象 data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => { success: ({ data }) => {

@ -20,7 +20,7 @@
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">使用期限</view> <view class="name">使用期限</view>
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item, !item.authority)"> <input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" @input="calcDate(item, !item.authority)">
<view class="val unit" @click="showUnit(i)"> <view class="val unit" @click="showUnit(i)">
<text>{{ units.find(e => e.value === item.options).text }}</text> <text>{{ units.find(e => e.value === item.options).text }}</text>
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> <image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image>
@ -40,7 +40,7 @@
<view class="line req"> <view class="line req">
<view class="name">数量</view> <view class="name">数量</view>
<view v-if="item.authority" class="val">1</view> <view v-if="item.authority" class="val">1</view>
<input v-else type="number" v-model="item.accountNum" placeholder="请输入" @change="calcFinalPrice(item)"> <input v-else type="number" v-model="item.accountNum" placeholder="请输入" @input="calcFinalPrice(item)">
</view> </view>
<view class="line"> <view class="line">
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> <view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view>
@ -61,7 +61,7 @@
<view class="line req"> <view class="line req">
<view class="name">成交价</view> <view class="name">成交价</view>
<view class="inline"> <view class="inline">
<input type="number" v-model="item.finalPrice" placeholder="请输入" @change="calcFinalValue(item)"> <input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)">
</view> </view>
</view> </view>
@ -82,6 +82,7 @@
data() { data() {
return { return {
customerId: '', customerId: '',
timer: null,
units: [{ units: [{
text: '日', text: '日',
value: 0 value: 0
@ -154,7 +155,6 @@
} catch (e) {} } catch (e) {}
}, },
showUnit(i) { showUnit(i) {
console.log(333, this.$refs, this.$refs.unit[i].show)
this.$refs.unit[i].show() this.$refs.unit[i].show()
}, },
// //
@ -173,121 +173,139 @@
}, },
// 使 // 使
calcDate(row, fromData) { calcDate(row, fromData) {
const { periodOfUse, options } = row clearTimeout(this.timer)
let optionsData = 0 this.timer = setTimeout(() => {
if (periodOfUse) { const { periodOfUse, options } = row
if (options == 1){ let optionsData = 0
optionsData = periodOfUse === '12' ? 31536000000 : periodOfUse*30*24*60*60*1000 if (periodOfUse) {
} else if (options == 2){ if (options == 1){
optionsData = periodOfUse*365*24*60*60*1000 optionsData = periodOfUse === '12' ? 31536000000 : periodOfUse*30*24*60*60*1000
} else { } else if (options == 2){
optionsData = periodOfUse*24*60*60*1000 optionsData = periodOfUse*365*24*60*60*1000
} } else {
} optionsData = periodOfUse*24*60*60*1000
let time = new Date(row.startTime).getTime()
let endTime = time + optionsData
row.endTime = time + optionsData
let dt = new Date(endTime)
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate())
let endYear = endTime - time
let endYears = endYear/1000/60/60/24
row.remainingPeriod = endYears
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
//
const price = row.marketPrice //
// //365,/12)
row.marketValue = (!unit ?
price / 365 * useUnit :
unit === 1 ?
price / 12 * useUnit :
price * useUnit).toFixed(2)
this.dealSettlePrice(row)
// +1
if (!fromData) {
const cId = row.dataOrCourseId
const date = new Date(row.startTime)
const orderRepeat = this.orderRepeat
getOrderOtherTime({
customerId: this.customerId,
id: cId,
startTime: this.$util.formatDate(date, 'yyyy-MM-dd'),
endTime: row.endTime
}).then(res => {
orderRepeat.includes(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1)
if (res.endTime) {
let time = new Date(res.endTime)
time = new Date(time.setDate(time.getDate() + 1))
row.startTime = this.$util.formatDate(time, 'yyyy-MM-dd')
} }
}).catch(res => { }
this.repeatMsg = res.message let time = new Date(row.startTime).getTime()
orderRepeat.includes(cId) || orderRepeat.push(cId) let endTime = time + optionsData
}) row.endTime = time + optionsData
} let dt = new Date(endTime)
// row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate())
this.calcDiscount(row) let endYear = endTime - time
let endYears = endYear/1000/60/60/24
row.remainingPeriod = endYears
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
//
const price = row.marketPrice //
// //365,/12)
row.marketValue = (!unit ?
price / 365 * useUnit :
unit === 1 ?
price / 12 * useUnit :
price * useUnit).toFixed(2)
this.dealSettlePrice(row)
// +1
if (!fromData) {
const cId = row.dataOrCourseId
const date = new Date(row.startTime)
const orderRepeat = this.orderRepeat
getOrderOtherTime({
customerId: this.customerId,
id: cId,
startTime: this.$util.formatDate(date, 'yyyy-MM-dd'),
endTime: row.endTime
}).then(res => {
orderRepeat.includes(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1)
if (res.endTime) {
let time = new Date(res.endTime)
time = new Date(time.setDate(time.getDate() + 1))
row.startTime = this.$util.formatDate(time, 'yyyy-MM-dd')
}
}).catch(res => {
this.repeatMsg = res.message
orderRepeat.includes(cId) || orderRepeat.push(cId)
})
}
//
this.calcDiscount(row)
}, 500)
}, },
// //
dealSettlePrice(row) { dealSettlePrice(row) {
const unit = row.options // 使 console.log(33, row)
const useUnit = row.periodOfUse // 使 clearTimeout(this.timer)
let sPrice = '' this.timer = setTimeout(() => {
if (row.settlementMethod == 0) { const unit = row.options // 使
// **/**(1) const useUnit = row.periodOfUse // 使
const priceUnit = row.settlementPriceUnit let sPrice = ''
sPrice = ((!unit ? if (row.settlementMethod == 0) {
priceUnit / 365 * useUnit : // **/**(1)
unit === 1 ? const priceUnit = row.settlementPriceUnit
priceUnit / 12 * useUnit : sPrice = ((!unit ?
priceUnit * useUnit) * (row.authority ? priceUnit / 365 * useUnit :
1 : unit === 1 ?
row.accountNum)).toFixed((2)) priceUnit / 12 * useUnit :
} else { priceUnit * useUnit) * (row.authority ?
// * 1 :
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2)) row.accountNum)).toFixed((2))
} } else {
row.settlementPrice = this.$util.handleNaN(sPrice) // *
// *10% sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
if (row.settlementPrice) { }
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2) row.settlementPrice = this.$util.handleNaN(sPrice)
} // *10%
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
}, 500)
}, },
// //
calcDiscount(row) { calcDiscount(row) {
const price = row.authority ? row.finalPrice : row.finalValue clearTimeout(this.timer)
const { marketValue } = row this.timer = setTimeout(() => {
// (-)÷ x100% const price = row.authority ? row.finalPrice : row.finalValue
if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%' const { marketValue } = row
console.log(66, row)
// (-)÷ x100%
if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%'
}, 500)
}, },
// //// // ////
calcFinalValue(row) { calcFinalValue(row) {
const { authority, periodOfUse, options, accountNum, finalPrice } = row clearTimeout(this.timer)
if (!authority && periodOfUse && accountNum && finalPrice) { this.timer = setTimeout(() => {
row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2) const { authority, periodOfUse, options, accountNum, finalPrice } = row
} if (!authority && periodOfUse && accountNum && finalPrice) {
// row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2)
this.calcDiscount(row) }
//
this.calcDiscount(row)
this.dealSettlePrice(row)
}, 500)
}, },
// **// // **//
calcFinalPrice(row) { calcFinalPrice(row) {
const { finalValue, accountNum, periodOfUse, finalPrice } = row clearTimeout(this.timer)
if (periodOfUse) { this.timer = setTimeout(() => {
if (accountNum) { const { finalValue, accountNum, periodOfUse, finalPrice } = row
// =** if (periodOfUse) {
if (finalValue) { if (accountNum) {
row.finalPrice = Math.round(finalValue * periodOfUse * accountNum) // =**
} else if (!finalValue && finalPrice) { if (finalValue) {
// =// row.finalPrice = Math.round(finalValue * periodOfUse * accountNum)
row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2) } else if (!finalValue && finalPrice) {
this.calculateDiscount(e, row) // =//
} row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2)
} else if (finalValue && finalValue && !row.authority) { this.calculateDiscount(e, row)
// =// }
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue) } else if (finalValue && finalValue && !row.authority) {
// =//
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue)
}
} }
} this.dealSettlePrice(row)
this.dealSettlePrice(row) }, 500)
}, },
// //
submit() { submit() {

@ -5,7 +5,7 @@
<view class="form-list"> <view class="form-list">
<view class="line"> <view class="line">
<view class="name">商务经理</view> <view class="name">商务经理</view>
<view class="val">{{ $util.getBmName() }}</view> <view class="val">{{ userName }}</view>
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">客户名称</view> <view class="name">客户名称</view>
@ -53,7 +53,7 @@
</view> </view>
<template v-for="c in courseList"> <template v-for="c in courseList">
<view v-if="c.list.length" class="block pro-wrap"> <view v-if="c.list.length" class="block pro-wrap" id="products">
<view class="l-title">{{ c.name }}</view> <view class="l-title">{{ c.name }}</view>
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons> <uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons>
<ul class="pro-list" v-show="!c.shrink"> <ul class="pro-list" v-show="!c.shrink">
@ -142,6 +142,7 @@
data() { data() {
return { return {
isDetail: false, isDetail: false,
userName: uni.getStorageSync('team').userName,
orderId: '', orderId: '',
orderTypes: [{ orderTypes: [{
text: '正式', text: '正式',
@ -203,6 +204,12 @@
} }
this.courseList = store this.courseList = store
this.courses = list this.courses = list
this.$nextTick(() => {
uni.pageScrollTo({
selector: '#products',
})
})
try { try {
uni.removeStorageSync('courses') uni.removeStorageSync('courses')
} catch (e) {} } catch (e) {}
@ -525,7 +532,7 @@
} }
.product { .product {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
align-items: center; align-items: center;
padding: 24rpx; padding: 24rpx;
background-color: #fff; background-color: #fff;
@ -533,7 +540,6 @@
white-space: nowrap; white-space: nowrap;
} }
.line { .line {
text-align: right;
&:first-child { &:first-child {
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -561,15 +567,16 @@
.total { .total {
margin-bottom: 10rpx; margin-bottom: 10rpx;
text-align: right; text-align: right;
font-size: 24rpx; font-size: 30rpx;
color: #666; color: #666;
.num { .num {
font-weight: 600; font-weight: 600;
font-size: 34rpx;
} }
} }
.num { .num {
margin: 0 5rpx; margin: 0 5rpx;
font-size: 34rpx; font-size: 30rpx;
color: #007EFF; color: #007EFF;
} }
} }

@ -269,7 +269,7 @@
}).catch(res => {}) }).catch(res => {})
} else { } else {
addCustomer(form).then(res => { addCustomer(form).then(res => {
this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。') this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。', 2000)
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1500) }, 1500)

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import { queryUserInfoDetails, bindPhoneOrEmail, sendPhoneOrEmailCode } from '@/apis/modules/user.js' import { updateMyEmail, mailCodeSend } from '@/apis/modules/user.js'
export default { export default {
data() { data() {
return { return {
@ -23,36 +23,23 @@
}, },
codeDisabled: false, codeDisabled: false,
phoneTimer: null, phoneTimer: null,
phoneOpener: '',
btnText: '发送验证码', btnText: '发送验证码',
} }
}, },
onShow() { onShow() {
this.getInfo()
}, },
methods: { methods: {
//
getInfo() {
queryUserInfoDetails().then(({ result }) => {
this.userId = result.hrUserInfo.userId
}).catch(e => {})
},
// //
sendCode() { sendCode() {
const { email } = this.form const { email } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱') if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱')
sendPhoneOrEmailCode({ mailCodeSend({
userId: this.userId,
email, email,
types: 1 platformId: 4
}).then(({ message }) => { }).then(res => {
if (message.opener) { this.phoneCountdown()
this.phoneCountdown()
this.phoneOpener = message.opener
} else {
this.$util.errMsg(message)
}
}).catch(res => {}) }).catch(res => {})
}, },
// //
@ -78,12 +65,10 @@
const { email, code } = this.form const { email, code } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!code) return this.$util.errMsg('请输入验证码') if (!code) return this.$util.errMsg('请输入验证码')
bindPhoneOrEmail({ updateMyEmail({
userId: this.userId,
email, email,
types: 1,
code, code,
opener: this.phoneOpener platformId: 4
}).then(res => { }).then(res => {
this.$util.sucMsg('修改成功!') this.$util.sucMsg('修改成功!')
setTimeout(() => { setTimeout(() => {

@ -142,12 +142,12 @@
} }
generateAuth(permissionMenu[0].children, '') generateAuth(permissionMenu[0].children, '')
uni.setStorageSync('auth', auth) uni.setStorageSync('auth', auth)
uni.setStorageSync('reloadAuth', 1) this.$forceUpdate()
uni.reLaunch({
url: '../index/index'
})
this.initRole() this.initRole()
}).catch(e => {}) }).catch(e => {
uni.setStorageSync('auth', [])
this.initRole()
})
}, },
// //
getInfo() { getInfo() {
@ -158,14 +158,22 @@
e.partnerClassificationName = n.partnerClassificationName e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList delete e.partnerClassificationList
}) })
// if (data.length) {
if (data.length && !this.teamId) { //
this.teamId = data[0].teamId if (!this.teamId) {
uni.setStorageSync('team', data[0]) this.teamId = data[0].teamId
uni.setStorageSync('team', data[0])
}
} else {
// 退
uni.clearStorageSync()
uni.navigateTo({
url: '../login/login'
})
} }
this.list = data this.list = data
// reloadAuth this.getAuth()
uni.getStorageSync('reloadAuth') ? this.initRole() : this.getAuth()
}).catch(e => {}) }).catch(e => {})
}, },
// //

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 627 B

Loading…
Cancel
Save