master
yujialong 2 years ago
parent 623291a197
commit 04d60abd06
  1. 2
      apis/request.js
  2. 3
      config/product.js
  3. 2
      config/request.js
  4. 10
      libs/util.js
  5. 3
      order/addCourse/addCourse.vue
  6. 66
      order/editCourse/editCourse.vue
  7. 46
      order/orderDetail/orderDetail.vue
  8. 82
      pages/clientDetail/clientDetail.vue
  9. 1
      pages/index/index.vue
  10. 1
      pages/person/person.vue
  11. 6
      pages/qrcode/qrcode.vue
  12. 1
      pages/teams/teams.vue
  13. BIN
      static/image/school.png
  14. 6
      styles/common.scss

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

@ -5,5 +5,6 @@
*/
export default {
normalIcon: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220609/png/1534733700683030528.png' // 通用图标
normalIcon: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220609/png/1534733700683030528.png', // 通用图标
dataIcon: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220627/png/1541256164447641600.png' // 数据图标
}

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

@ -1,6 +1,8 @@
import Product from '@/config/product'
const files = [
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531155187057057792.docx',
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531156166884220928.docx',
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531155187057057792.docx', // 用户服务协议
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531156166884220928.docx', // 用户隐私协议
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531930503312596992.docx', // 人工智能
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531930756791164928.docx', // 大数据
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531929864150999040.docx', // 金融科技
@ -65,6 +67,10 @@ 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)
},
// 预览文档
openFile(id) {
uni.showLoading({

@ -11,7 +11,7 @@
<ul class="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>
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image>
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }}
</li>
</ul>
@ -186,6 +186,7 @@
marketValue: '', //
marketPrice: e.marketPrice, //
finalPrice: trial ? 0 : '', //
finalValue: trial ? 0 : '', //
discountRate: trial ? '0%' : '', //
accountNum: e.productType === 2 ? '' : 1, //
totalAmount: '', //

@ -8,7 +8,7 @@
<view v-for="(item, i) in c.list">
<view class="pro-name">
<view class="left">
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image>
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }}
</view>
<uni-icons class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons>
@ -18,18 +18,15 @@
<view class="name">产品类型</view>
<view class="val">{{ productTypes.find(e => e.id === item.productType).name }}</view>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'periodOfUse' + item.dataOrCourseId + item.authority}]">
<view class="name">使用期限</view>
<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>
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" @input="calcDate(item, !item.authority)" @change="handleErr(item, 'periodOfUse')">
<view class="val unit" @click="selectUnit(item)">
<text>{{ units.find(e => e.id === item.options).text }}</text>
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image>
</view>
<uni-data-picker class="unit-picker" ref="unit" popup-title="请选择" :clear-icon="false" :localdata="units" v-model="item.options" @change="calcDate(item)">
<text></text>
</uni-data-picker>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'startTime' + item.dataOrCourseId + item.authority}]">
<view class="name">起止日期</view>
<uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)">
<view :class="['ph', {val: item.startTime}]">
@ -37,10 +34,10 @@
</view>
</uni-datetime-picker>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'accountNum' + item.dataOrCourseId + item.authority}]">
<view class="name">数量</view>
<view v-if="item.authority" class="val">1</view>
<input v-else type="number" v-model="item.accountNum" placeholder="请输入" @input="calcFinalPrice(item)">
<input v-else type="number" v-model="item.accountNum" placeholder="请输入账号数量" @input="calcFinalPrice(item)" @change="handleErr(item, 'accountNum')">
</view>
<view class="line">
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view>
@ -58,10 +55,10 @@
<view class="name">平台服务费</view>
<view class="val">{{ item.serviceFee }}</view>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]">
<view class="name">成交价</view>
<view class="inline">
<input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)">
<input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')">
</view>
</view>
@ -85,14 +82,15 @@
timer: null,
units: [{
text: '日',
value: 0
id: 0
}, {
text: '月',
value: 1
id: 1
}, {
text: '年',
value: 2
id: 2
}],
unitText: ['日', '月', '年'],
productTypes: [
{
name: '实训课程',
@ -109,7 +107,8 @@
],
courses: {} , //
orderRepeat: [],
repeatMsg: ''
repeatMsg: '',
err: ''
}
},
onShow() {
@ -154,6 +153,16 @@
uni.removeStorageSync('courses')
} catch (e) {}
},
selectUnit(item) {
const that = this
uni.showActionSheet({
title: '标题',
itemList: that.unitText,
success: ({ tapIndex }) => {
item.options = tapIndex
}
})
},
showUnit(i) {
this.$refs.unit[i].show()
},
@ -233,9 +242,6 @@
},
//
dealSettlePrice(row) {
console.log(33, row)
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
let sPrice = ''
@ -258,18 +264,13 @@
if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
}
}, 500)
},
//
calcDiscount(row) {
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) {
@ -297,9 +298,9 @@
} else if (!finalValue && finalPrice) {
// =//
row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2)
this.calculateDiscount(e, row)
this.calcDiscount(row)
}
} else if (finalValue && finalValue && !row.authority) {
} else if (finalValue && finalPrice && !row.authority) {
// =//
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue)
}
@ -307,6 +308,10 @@
this.dealSettlePrice(row)
}, 500)
},
//
handleErr(e, val) {
if (val + e.dataOrCourseId + e.authority === this.err) this.err = ''
},
//
submit() {
const courses = this.courses
@ -316,26 +321,33 @@
for (const i in courses) {
list.push(...courses[i].list)
}
console.log(11, list)
//
for (const i in list) {
const e = list[i]
const suf = e.dataOrCourseId + '' + e.authority
if (e.periodOfUse === '') {
this.err = 'periodOfUse' + suf
msg = '请输入使用期限!'
break
}
if (!e.startTime) {
this.err = 'startTime' + suf
msg = '请选择起止日期!'
break
}
if (e.accountNum === '') {
this.err = 'accountNum' + suf
msg = '请输入数量!'
break
}
if (e.finalPrice === '') {
this.err = 'finalPrice' + suf
msg = '请输入成交价!'
break
}
}
console.log(33, this.err)
if (msg) return this.$util.errMsg(msg)
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) //
uni.setStorageSync('courses', this.courses)

@ -5,9 +5,9 @@
<view class="form-list">
<view class="line">
<view class="name">商务经理</view>
<view class="val">{{ userName }}</view>
<view class="val">{{ form.businessManagerName }}</view>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'customerName'}]">
<view class="name">客户名称</view>
<view v-if="isDetail" class="val">{{ form.customerName }}</view>
<view v-else :class="['ph', {val: form.customerName}]" @click="customerVisible = true">{{ form.customerName || '请选择客户' }}</view>
@ -32,9 +32,9 @@
<view class="name">邮箱</view>
<view class="val">{{ form.email }}</view>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'orderType'}]">
<view class="name">订单类型</view>
<view v-if="isDetail" class="val">{{ form.industryClassName }}</view>
<view v-if="isDetail" class="val">{{ orderTypes.find(e => e.value === form.orderType).text }}</view>
<uni-data-picker v-else class="picker-input" placeholder="请选择订单类型" popup-title="请选择订单类型" preload :clear-icon="false" :localdata="orderTypes" v-model="form.orderType" @change="calcTotal"></uni-data-picker>
</view>
<view class="line">
@ -60,7 +60,7 @@
<li v-for="(item, i) in c.list" @click.stop="editCourse(c, i)">
<view class="name">
<view class="left">
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image>
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }}
</view>
<image v-if="!isDetail" class="del" src="@/static/image/trash.png" mode="widthFix" @click.stop="delCourse(c, i)"></image>
@ -142,7 +142,6 @@
data() {
return {
isDetail: false,
userName: uni.getStorageSync('team').userName,
orderId: '',
orderTypes: [{
text: '正式',
@ -152,6 +151,7 @@
value: 2
}],
form: {
businessManagerName: uni.getStorageSync('team').userName,
// orderNumber: '', //
provinceId: '', // id
provinceName: '',
@ -186,6 +186,7 @@
searchTimer: null,
customerList: [],
customerListAll: [],
err: ''
}
},
onShow() {
@ -312,6 +313,7 @@
queryCustomerDetails({
customerId: item.customerId
}).then(({ result }) => {
this.handleErr('customerName')
const e = result.customer
form.customerId = e.customerId
form.customerName = e.customerName
@ -368,6 +370,7 @@
},
//
calcTotal() {
this.handleErr('orderType')
const { form } = this
const isTrial = form.orderType === 2 //
let total = 0
@ -394,15 +397,28 @@
form.profit = isTrial ? 0 : Math.round(profit)
form.orderAmount = isTrial ? 0 : +form.purchaseCost + +form.profit
},
//
handleErr(val) {
if (val === this.err) this.err = ''
},
//
submit() {
const { form, courses } = this
if (!form.customerId) return this.$util.errMsg('请选择客户!')
if (!form.orderType) return this.$util.errMsg('请选择订单类型!')
if (!form.customerId) {
this.err = 'customerName'
return this.$util.errMsg('请选择客户!')
}
if (!form.orderType) {
this.err = 'orderType'
return this.$util.errMsg('请选择订单类型!')
}
if (!courses.length) return this.$util.errMsg('请选择课程权限或数据权限后再确认订单!')
courses.map(e => {
e.startTime = this.$util.formatDate(new Date(e.startTime), 'yyyy-MM-dd')
})
uni.showLoading({
title: '提交中'
})
const data = {
contractInformation: this.contract, //
order: form, //
@ -410,18 +426,24 @@
}
if (this.orderId) {
update(data).then(res => {
uni.hideLoading()
this.$util.sucMsg('编辑成功')
setTimeout(() => {
uni.navigateBack()
}, 1500)
}).catch(res => {})
}).catch(res => {
uni.hideLoading()
})
} else {
add(data).then(res => {
uni.hideLoading()
this.$util.sucMsg('添加成功')
setTimeout(() => {
uni.navigateBack()
}, 1500)
}).catch(res => {})
}).catch(res => {
uni.hideLoading()
})
}
}
}
@ -430,10 +452,10 @@
<style scoped lang="scss">
.page {
padding-bottom: 400rpx;
padding-bottom: 420rpx;
}
.show {
padding-bottom: 260rpx;
padding-bottom: 280rpx;
}
.pro-wrap {
position: relative;

@ -2,7 +2,7 @@
<view class="page">
<uni-card v-if="customerId" :is-shadow="false" :border="false" is-full>
<view class="info">
<view class="name">{{ form.customerName }}</view>
<view class="name"><image class="school" src="@/static/image/school.png" mode="widthFix"></image>{{ form.customerName }}</view>
<view class="text">客户类型{{ customerType }}</view>
<view class="text">产品到期时间{{ form.expireDate || '' }}</view>
</view>
@ -11,7 +11,7 @@
<view class="block">
<view class="l-title">基本信息</view>
<view class="form-list">
<view class="line req">
<view :class="['line req', {err: err === 'customerName'}]">
<view class="name">客户名称</view>
<view v-if="isDetail" class="val">{{ form.customerName }}</view>
<view v-else :class="['ph', {val: form.customerName}]" @click="schoolVisible = true">{{ form.customerName || '请选择学校' }}</view>
@ -24,30 +24,30 @@
<view class="name">城市</view>
<view class="val">{{ form.cityName }}</view>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'industryClass'}]">
<view class="name">行业类型</view>
<view v-if="isDetail" class="val">{{ form.industryClassName }}</view>
<uni-data-picker v-else class="picker-input" placeholder="请选择行业类型" popup-title="请选择行业类型" preload :clear-icon="false" :localdata="industryClassList" :map="{text: 'industryClassName', value: 'industryClassId'}" v-model="form.industryClassId" @change="industryClassChange"></uni-data-picker>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'industry'}]">
<view class="name">行业</view>
<view v-if="isDetail" class="val">{{ form.industryName }}</view>
<uni-data-picker v-else class="picker-input" placeholder="请选择行业" popup-title="请选择行业" preload :clear-icon="false" :localdata="industryList" :map="{text: 'industryName', value: 'industryId'}" v-model="form.industryId" :readonly="form.industryClassId ? false : true"></uni-data-picker>
<uni-data-picker v-else class="picker-input" placeholder="请选择行业" popup-title="请选择行业" preload :clear-icon="false" :localdata="industryList" :map="{text: 'industryName', value: 'industryId'}" v-model="form.industryId" :readonly="form.industryClassId ? false : true" @change="handleErr('industry')"></uni-data-picker>
</view>
<view class="line req">
<view :class="['line req', {err: err === 'name'}]">
<view class="name">联系人姓名</view>
<view v-if="isDetail" class="val">{{ form.name }}</view>
<input v-else type="text" placeholder="请输入" v-model="form.name">
<input v-else type="text" placeholder="请输入" v-model="form.name" @change="handleErr('name')">
</view>
<view class="line">
<view class="name">手机</view>
<view v-if="isDetail" class="val">{{ form.phone }}</view>
<input v-else type="number" maxlength="11" placeholder="请输入" v-model="form.phone">
</view>
<view class="line req">
<view :class="['line req', {err: err === 'account'}]">
<view class="name">账号</view>
<view v-if="isDetail" class="val">{{ form.account }}</view>
<input v-else type="text" placeholder="请以院校首字母+admin的格式来设置" v-model="form.account">
<input v-else type="text" placeholder="请以院校首字母+admin的格式来设置" v-model="form.account" @change="handleErr('account')">
</view>
<view class="line">
<view class="name">职务</view>
@ -72,15 +72,15 @@
<view v-if="isDetail" class="action">
<view class="item" @click="toPage(`../clientDetail/clientDetail?customerId=${customerId}`)">
<uni-icons class="icon" custom-prefix="iconfont" type="icon-edit" size="20" color="#959595"></uni-icons>
<uni-icons class="icon" custom-prefix="iconfont" type="icon-edit" size="30" color="#959595"></uni-icons>
<view class="text">编辑</view>
</view>
<view class="item" @click="toPage(`/order/ordered/ordered?customerId=${customerId}`)">
<uni-icons class="icon" custom-prefix="iconfont" type="icon-product" size="20" color="#959595"></uni-icons>
<uni-icons class="icon" custom-prefix="iconfont" type="icon-product" size="30" color="#959595"></uni-icons>
<view class="text">已订阅产品</view>
</view>
<view class="item" @click="toPage(`/order/curClient/curClient?customerId=${customerId}&name=${form.customerName}`)">
<uni-icons class="icon" custom-prefix="iconfont" type="icon-dingdan" size="20" color="#959595"></uni-icons>
<uni-icons class="icon" custom-prefix="iconfont" type="icon-dingdan" size="30" color="#959595"></uni-icons>
<view class="text">订单</view>
</view>
</view>
@ -148,6 +148,7 @@
schoolId: ''
},
customerType: '',
err: ''
}
},
watch: {
@ -228,10 +229,16 @@
schoolId
}).then(res => {
this.nameRepeat = false
this.handleErr('customerName')
}).catch(res => {
this.nameRepeat = true
this.err = 'customerName'
})
},
//
handleErr(val) {
if (val === this.err) this.err = ''
},
//
getIndustryClass() {
queryIndustryClass().then(({ list }) => {
@ -240,6 +247,7 @@
},
//
industryClassChange() {
this.handleErr('industryClass')
this.getIndustry()
},
//
@ -259,20 +267,54 @@
const refs = this.$refs
const { form } = this
const { schoolId, industryClassId, industryId, name, account } = form
if (!schoolId) return this.$util.errMsg('请选择客户!') if (this.nameRepeat) return this.$util.errMsg('客户已存在!') if (!industryClassId) return this.$util.errMsg('请选择行业类型!') if (!industryId) return this.$util.errMsg('请选择行业!') if (!name) return this.$util.errMsg('请输入联系人姓名!') if (!account) return this.$util.errMsg('请输入账号!')
if (!schoolId) {
this.err = 'customerName'
return this.$util.errMsg('请选择客户!')
} if (this.nameRepeat) {
this.err = 'customerName'
return this.$util.errMsg('客户已存在!')
} if (!industryClassId) {
this.err = 'industryClass'
return this.$util.errMsg('请选择行业类型!')
} if (!industryId) {
this.err = 'industry'
return this.$util.errMsg('请选择行业!')
} if (!name) {
this.err = 'name'
return this.$util.errMsg('请输入联系人姓名!')
} if (!account) {
this.err = 'account'
return this.$util.errMsg('请输入账号!')
}
uni.showLoading({
title: '提交中'
})
if (this.customerId) {
updateCustomer(form).then(res => {
uni.hideLoading()
this.$util.sucMsg('编辑成功')
setTimeout(() => {
this.$util.to('../clients/clients')
}, 1500)
}).catch(res => {})
} else {
addCustomer(form).then(res => {
this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。', 2000)
setTimeout(() => {
addCustomer(form).then(({ customerId }) => {
uni.hideLoading()
const that = this
uni.showModal({
title: '提示',
content: '创建客户成功,是否马上为该客户创建订单?',
success: function (res) {
if (res.confirm) {
//
uni.redirectTo({
url: `/order/orderDetail/orderDetail?customerId=${customerId}`
})
} else if (res.cancel) {
uni.navigateBack()
}, 1500)
}
}
})
}).catch(res => {})
}
},
@ -287,10 +329,16 @@
}
.info {
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 16px;
color: #333;
}
.school {
width: 48rpx;
margin-right: 10rpx;
}
}
.action {
z-index: 2;

@ -117,6 +117,7 @@
}
},
onShow() {
this.per = true
this.getInfo()
},
methods: {

@ -60,6 +60,7 @@
}
},
onShow() {
this.per = true
this.initRole()
},
methods: {

@ -8,9 +8,9 @@
<view class="invite">
<text class="name">{{ userName }}</text> 邀请你加入城市合伙人计划
</view>
<view class="com">{{ team.partnerClassificationName }}</view>
</view>
</view>
<view class="com">{{ team.partnerClassificationName }}</view>
<u-qrcode ref="qrcode" canvas-id="qrcode" :size="size" :value="link"></u-qrcode>
<view class="tips">扫一扫加入我们吧</view>
</view>
@ -75,7 +75,6 @@
.info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
text-align: left;
}
.avatar {
@ -93,11 +92,12 @@
color: $uni-primary;
}
.com {
margin: 20rpx 0;
font-size: 30rpx;
}
.tips {
margin: 30rpx 0 20rpx;
font-size: 12px;
font-size: 24rpx;
color: #333;
}
.warn {

@ -69,6 +69,7 @@
}
},
onShow() {
this.per = true
this.initRole()
},
methods: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

@ -99,6 +99,12 @@ ul {
vertical-align: middle;
}
}
.err {
border-bottom-color: #f00;
.name {
color: #f00;
}
}
.inline {
display: inline-flex;
align-items: center;

Loading…
Cancel
Save