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 const { url } = options
uni.request({ uni.request({
header, 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 method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象 data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => { success: ({ data }) => {

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

@ -1,6 +1,8 @@
import Product from '@/config/product'
const files = [ const files = [
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220530/docx/1531155187057057792.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/20220530/docx/1531156166884220928.docx', // 用户隐私协议
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531930503312596992.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/1531930756791164928.docx', // 大数据
'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531929864150999040.docx', // 金融科技 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220601/docx/1531929864150999040.docx', // 金融科技
@ -65,6 +67,10 @@ export default {
getBmName(val) { getBmName(val) {
return uni.getStorageSync('team').partnerClassificationName return uni.getStorageSync('team').partnerClassificationName
}, },
// 返回图标。如果有图标,则直接返回,否则判断是否是数据产品,即productType=2,如果是,则取数据图标,否则则显示通用图标,这两个图标都在config/product.js里有配置
getIcon(e) {
return e.miniProgramPictureAddress || (e.productType === 2 ? Product.dataIcon : Product.normalIcon)
},
// 预览文档 // 预览文档
openFile(id) { openFile(id) {
uni.showLoading({ uni.showLoading({

@ -11,7 +11,7 @@
<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 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 }} {{ item.productName }}
</li> </li>
</ul> </ul>
@ -186,6 +186,7 @@
marketValue: '', // marketValue: '', //
marketPrice: e.marketPrice, // marketPrice: e.marketPrice, //
finalPrice: trial ? 0 : '', // finalPrice: trial ? 0 : '', //
finalValue: trial ? 0 : '', //
discountRate: trial ? '0%' : '', // discountRate: trial ? '0%' : '', //
accountNum: e.productType === 2 ? '' : 1, // accountNum: e.productType === 2 ? '' : 1, //
totalAmount: '', // totalAmount: '', //

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

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

@ -2,7 +2,7 @@
<view class="page"> <view class="page">
<uni-card v-if="customerId" :is-shadow="false" :border="false" is-full> <uni-card v-if="customerId" :is-shadow="false" :border="false" is-full>
<view class="info"> <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">客户类型{{ customerType }}</view>
<view class="text">产品到期时间{{ form.expireDate || '' }}</view> <view class="text">产品到期时间{{ form.expireDate || '' }}</view>
</view> </view>
@ -11,7 +11,7 @@
<view class="block"> <view class="block">
<view class="l-title">基本信息</view> <view class="l-title">基本信息</view>
<view class="form-list"> <view class="form-list">
<view class="line req"> <view :class="['line req', {err: err === 'customerName'}]">
<view class="name">客户名称</view> <view class="name">客户名称</view>
<view v-if="isDetail" class="val">{{ form.customerName }}</view> <view v-if="isDetail" class="val">{{ form.customerName }}</view>
<view v-else :class="['ph', {val: form.customerName}]" @click="schoolVisible = true">{{ 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="name">城市</view>
<view class="val">{{ form.cityName }}</view> <view class="val">{{ form.cityName }}</view>
</view> </view>
<view class="line req"> <view :class="['line req', {err: err === 'industryClass'}]">
<view class="name">行业类型</view> <view class="name">行业类型</view>
<view v-if="isDetail" class="val">{{ form.industryClassName }}</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> <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>
<view class="line req"> <view :class="['line req', {err: err === 'industry'}]">
<view class="name">行业</view> <view class="name">行业</view>
<view v-if="isDetail" class="val">{{ form.industryName }}</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>
<view class="line req"> <view :class="['line req', {err: err === 'name'}]">
<view class="name">联系人姓名</view> <view class="name">联系人姓名</view>
<view v-if="isDetail" class="val">{{ form.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>
<view class="line"> <view class="line">
<view class="name">手机</view> <view class="name">手机</view>
<view v-if="isDetail" class="val">{{ form.phone }}</view> <view v-if="isDetail" class="val">{{ form.phone }}</view>
<input v-else type="number" maxlength="11" placeholder="请输入" v-model="form.phone"> <input v-else type="number" maxlength="11" placeholder="请输入" v-model="form.phone">
</view> </view>
<view class="line req"> <view :class="['line req', {err: err === 'account'}]">
<view class="name">账号</view> <view class="name">账号</view>
<view v-if="isDetail" class="val">{{ form.account }}</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>
<view class="line"> <view class="line">
<view class="name">职务</view> <view class="name">职务</view>
@ -72,15 +72,15 @@
<view v-if="isDetail" class="action"> <view v-if="isDetail" class="action">
<view class="item" @click="toPage(`../clientDetail/clientDetail?customerId=${customerId}`)"> <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 class="text">编辑</view>
</view> </view>
<view class="item" @click="toPage(`/order/ordered/ordered?customerId=${customerId}`)"> <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 class="text">已订阅产品</view>
</view> </view>
<view class="item" @click="toPage(`/order/curClient/curClient?customerId=${customerId}&name=${form.customerName}`)"> <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 class="text">订单</view>
</view> </view>
</view> </view>
@ -148,6 +148,7 @@
schoolId: '' schoolId: ''
}, },
customerType: '', customerType: '',
err: ''
} }
}, },
watch: { watch: {
@ -228,10 +229,16 @@
schoolId schoolId
}).then(res => { }).then(res => {
this.nameRepeat = false this.nameRepeat = false
this.handleErr('customerName')
}).catch(res => { }).catch(res => {
this.nameRepeat = true this.nameRepeat = true
this.err = 'customerName'
}) })
}, },
//
handleErr(val) {
if (val === this.err) this.err = ''
},
// //
getIndustryClass() { getIndustryClass() {
queryIndustryClass().then(({ list }) => { queryIndustryClass().then(({ list }) => {
@ -240,6 +247,7 @@
}, },
// //
industryClassChange() { industryClassChange() {
this.handleErr('industryClass')
this.getIndustry() this.getIndustry()
}, },
// //
@ -259,20 +267,54 @@
const refs = this.$refs const refs = this.$refs
const { form } = this const { form } = this
const { schoolId, industryClassId, industryId, name, account } = form 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) { if (this.customerId) {
updateCustomer(form).then(res => { updateCustomer(form).then(res => {
uni.hideLoading()
this.$util.sucMsg('编辑成功') this.$util.sucMsg('编辑成功')
setTimeout(() => { setTimeout(() => {
this.$util.to('../clients/clients') this.$util.to('../clients/clients')
}, 1500) }, 1500)
}).catch(res => {}) }).catch(res => {})
} else { } else {
addCustomer(form).then(res => { addCustomer(form).then(({ customerId }) => {
this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。', 2000) uni.hideLoading()
setTimeout(() => { 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() uni.navigateBack()
}, 1500) }
}
})
}).catch(res => {}) }).catch(res => {})
} }
}, },
@ -287,10 +329,16 @@
} }
.info { .info {
.name { .name {
display: flex;
align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.school {
width: 48rpx;
margin-right: 10rpx;
}
} }
.action { .action {
z-index: 2; z-index: 2;

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

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

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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

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

Loading…
Cancel
Save