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')
}
export const bindPhoneOrEmail = (data) => {
return post('users/users/userAccount/bindPhoneOrEmail', data)
export const updateMyEmail = (data) => {
return post('nakadai/partner-team/updateMyEmail', data)
}
export const sendPhoneOrEmailCode = (data) => {
return post('users/users/userAccount/sendPhoneOrEmailCode', data)
export const mailCodeSend = (data) => {
return post('nakadai/partner-team/mailCodeSend', data)
}
export const changeAccount = account => {

@ -19,7 +19,7 @@ const request = options => {
const { url } = options
uni.request({
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
data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => {

@ -20,7 +20,7 @@
</view>
<view class="line req">
<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)">
<text>{{ units.find(e => e.value === item.options).text }}</text>
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image>
@ -40,7 +40,7 @@
<view class="line req">
<view class="name">数量</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 class="line">
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view>
@ -61,7 +61,7 @@
<view class="line req">
<view class="name">成交价</view>
<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>
@ -82,6 +82,7 @@
data() {
return {
customerId: '',
timer: null,
units: [{
text: '日',
value: 0
@ -154,7 +155,6 @@
} catch (e) {}
},
showUnit(i) {
console.log(333, this.$refs, this.$refs.unit[i].show)
this.$refs.unit[i].show()
},
//
@ -173,121 +173,139 @@
},
// 使
calcDate(row, fromData) {
const { periodOfUse, options } = row
let optionsData = 0
if (periodOfUse) {
if (options == 1){
optionsData = periodOfUse === '12' ? 31536000000 : periodOfUse*30*24*60*60*1000
} else if (options == 2){
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')
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { periodOfUse, options } = row
let optionsData = 0
if (periodOfUse) {
if (options == 1){
optionsData = periodOfUse === '12' ? 31536000000 : periodOfUse*30*24*60*60*1000
} else if (options == 2){
optionsData = periodOfUse*365*24*60*60*1000
} else {
optionsData = periodOfUse*24*60*60*1000
}
}).catch(res => {
this.repeatMsg = res.message
orderRepeat.includes(cId) || orderRepeat.push(cId)
})
}
//
this.calcDiscount(row)
}
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
orderRepeat.includes(cId) || orderRepeat.push(cId)
})
}
//
this.calcDiscount(row)
}, 500)
},
//
dealSettlePrice(row) {
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))
}
row.settlementPrice = this.$util.handleNaN(sPrice)
// *10%
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
console.log(33, row)
clearTimeout(this.timer)
this.timer = setTimeout(() => {
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))
}
row.settlementPrice = this.$util.handleNaN(sPrice)
// *10%
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
}, 500)
},
//
calcDiscount(row) {
const price = row.authority ? row.finalPrice : row.finalValue
const { marketValue } = row
// (-)÷ x100%
if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%'
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const price = row.authority ? row.finalPrice : row.finalValue
const { marketValue } = row
console.log(66, row)
// (-)÷ x100%
if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%'
}, 500)
},
// ////
calcFinalValue(row) {
const { authority, periodOfUse, options, accountNum, finalPrice } = row
if (!authority && periodOfUse && accountNum && finalPrice) {
row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2)
}
//
this.calcDiscount(row)
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { authority, periodOfUse, options, accountNum, finalPrice } = row
if (!authority && periodOfUse && accountNum && finalPrice) {
row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2)
}
//
this.calcDiscount(row)
this.dealSettlePrice(row)
}, 500)
},
// **//
calcFinalPrice(row) {
const { finalValue, accountNum, periodOfUse, finalPrice } = row
if (periodOfUse) {
if (accountNum) {
// =**
if (finalValue) {
row.finalPrice = Math.round(finalValue * periodOfUse * accountNum)
} else if (!finalValue && finalPrice) {
// =//
row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2)
this.calculateDiscount(e, row)
}
} else if (finalValue && finalValue && !row.authority) {
// =//
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue)
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { finalValue, accountNum, periodOfUse, finalPrice } = row
if (periodOfUse) {
if (accountNum) {
// =**
if (finalValue) {
row.finalPrice = Math.round(finalValue * periodOfUse * accountNum)
} else if (!finalValue && finalPrice) {
// =//
row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2)
this.calculateDiscount(e, row)
}
} else if (finalValue && finalValue && !row.authority) {
// =//
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue)
}
}
}
this.dealSettlePrice(row)
this.dealSettlePrice(row)
}, 500)
},
//
submit() {

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

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

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

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