yujialong 4 months ago
parent d5146fab77
commit 05a9bc94bc
  1. 4
      order/addCourse/addCourse.vue
  2. 24
      order/editCourse/editCourse.vue
  3. 42
      order/orderDetail/orderDetail.vue
  4. 8
      pages/orders/orders.vue

@ -234,6 +234,7 @@
serviceFee: 0, // serviceFee: 0, //
mallNonAssociatedLinks: e.mallNonAssociatedLinks, // mallNonAssociatedLinks: e.mallNonAssociatedLinks, //
typeName: e.typeName, typeName: e.typeName,
classificationId: e.classificationId,
} }
}, },
// //
@ -262,6 +263,9 @@
if (list.length) { if (list.length) {
if (this.submiting) return false if (this.submiting) return false
this.submiting = true this.submiting = true
uni.showLoading({
title: '加载中'
})
const result = this.courses const result = this.courses
const list1 = [] // const list1 = [] //

@ -6,7 +6,7 @@
<view class="l-title">{{ c.name }}</view> <view class="l-title">{{ c.name }}</view>
<view class="batch"> <view class="batch">
<input class="deadline" type="number" v-model="c.deadline" placeholder="批量输入" @change="batchDeadlineChange(c)"> <input class="deadline" type="number" v-model="c.deadline" placeholder="批量输入" @change="batchDeadlineChange(c)">
<view class="unit" @click="batchUnitChange(c)">{{ units.find(e => e.id === c.unit).text }}</view> <view :class="['unit', {placeholder: c.unit === ''}]" @click="batchUnitChange(c)">{{ c.unit !== '' ? units.find(e => e.id === c.unit).text : '请选择' }}</view>
</view> </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>
</view> </view>
@ -134,16 +134,17 @@
// //
productCategoryList().then(res => { productCategoryList().then(res => {
res.classificationList.forEach(e => { res.classificationList.forEach(e => {
courses['list' + this.$util.getOrderType(e.classificationId)] = { courses['list' + e.classificationId] = {
shrink: false, shrink: false,
name: e.classificationName, name: e.classificationName,
deadline: '', deadline: '',
unit: 2, unit: '',
list: [] list: []
} }
}) })
const { provinceId, cityId } = this const { provinceId, cityId } = this
const isTrial = this.orderType == 2 const isTrial = this.orderType == 2
list.map(async e => { list.map(async e => {
// //
if (provinceId) { if (provinceId) {
@ -167,7 +168,7 @@
if (isTrial) { if (isTrial) {
this.calcDate(e, !e.authority) this.calcDate(e, !e.authority)
} }
courses['list' + e.authority].list.push(e) courses['list' + e.classificationId].list.push(e)
}) })
this.courses = courses this.courses = courses
}).catch(e => {}) }).catch(e => {})
@ -186,12 +187,14 @@
title: '标题', title: '标题',
itemList: that.unitText, itemList: that.unitText,
success: ({ tapIndex }) => { success: ({ tapIndex }) => {
if (tapIndex !== '') {
c.unit = tapIndex c.unit = tapIndex
c.list.map(e => { c.list.map(e => {
e.options = tapIndex e.options = tapIndex
that.calcDate(e, !e.authority) that.calcDate(e, !e.authority)
}) })
} }
}
}) })
}, },
// //
@ -201,9 +204,11 @@
title: '标题', title: '标题',
itemList: that.unitText, itemList: that.unitText,
success: ({ tapIndex }) => { success: ({ tapIndex }) => {
if (tapIndex !== '') {
item.options = tapIndex item.options = tapIndex
that.calcDate(item) that.calcDate(item)
} }
}
}) })
}, },
showUnit(i) { showUnit(i) {
@ -388,6 +393,11 @@
msg = '请输入使用期限!' msg = '请输入使用期限!'
break break
} }
if (e.options === '') {
this.err = 'accountNum' + suf
msg = '请选择期限!'
break
}
if (!e.startTime) { if (!e.startTime) {
this.err = 'startTime' + suf this.err = 'startTime' + suf
msg = '请选择起止日期!' msg = '请选择起止日期!'
@ -407,6 +417,9 @@
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) //
this.submiting = true this.submiting = true
uni.showLoading({
title: '加载中'
})
list.forEach(e => { list.forEach(e => {
e.edited = 1 // e.edited = 1 //
}) })
@ -449,6 +462,9 @@
.unit { .unit {
min-width: 80rpx; min-width: 80rpx;
text-align: center; text-align: center;
&.placeholder {
color: #797979;
}
} }
} }
} }

@ -35,11 +35,11 @@
<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', {err: err === 'orderType'}]"> <view :class="['line req', {err: err === 'orderType'}]">
<view class="name">订单类型</view> <view class="name">订单类型</view>
<view v-if="isDetail" class="val">{{ orderTypes.find(e => e.value === form.orderType).text }}</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(1)"></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(1)"></uni-data-picker>
</view> --> </view>
<template v-if="edited"> <template v-if="edited">
<view v-if="form.orderNumber" class="line"> <view v-if="form.orderNumber" class="line">
<view class="name">订单编号</view> <view class="name">订单编号</view>
@ -226,7 +226,7 @@
email: '', email: '',
customerId: '', // id customerId: '', // id
customerName: '', customerName: '',
orderType: 2, orderType: '',
cityId: '', cityId: '',
cityName: '', cityName: '',
phone: '', phone: '',
@ -297,6 +297,9 @@
if (this.orderId) { if (this.orderId) {
this.getInfo() this.getInfo()
} else if (options.edited && store) { // } else if (options.edited && store) { //
uni.showLoading({
title: '加载中'
})
// //
const list = [] const list = []
for (const i in store) { for (const i in store) {
@ -320,6 +323,9 @@
uni.removeStorageSync('courses') uni.removeStorageSync('courses')
} catch (e) {} } catch (e) {}
this.calcTotal() this.calcTotal()
this.$nextTick(() => {
uni.hideLoading()
})
} }
// id // id
@ -530,6 +536,16 @@
}, },
// //
toAdd(add) { toAdd(add) {
const { form } = this
if (!form.customerId) {
this.err = 'customerName'
return this.$util.errMsg('请选择客户!')
}
if (!form.orderType) {
this.err = 'orderType'
return this.$util.errMsg('请选择订单类型!')
}
add && uni.setStorageSync('courses', this.courses) add && uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form) uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form const { customerId, orderType } = this.form
@ -537,9 +553,7 @@
const url = this.shopCart ? const url = this.shopCart ?
`../editCourse/editCourse` : `../editCourse/editCourse` :
`../addCourse/addCourse` `../addCourse/addCourse`
customerId ? this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`)
this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) :
this.$util.errMsg('请先选择客户!')
}, },
// //
toClient() { toClient() {
@ -609,8 +623,8 @@
profit += +e.finalPrice - curPurchase profit += +e.finalPrice - curPurchase
} }
}) })
form.purchaseCost = purchase form.purchaseCost = purchase.toFixed(2)
form.profit = profit form.profit = profit.toFixed(2)
form.orderAmount = (+form.purchaseCost + +form.profit).toFixed(2) form.orderAmount = (+form.purchaseCost + +form.profit).toFixed(2)
}, },
// //
@ -1160,15 +1174,15 @@
.action { .action {
z-index: 2; z-index: 2;
position: fixed; position: fixed;
bottom: 0; bottom: 24rpx;
display: flex; display: flex;
justify-content: space-around; justify-content: flex-end;
width: 100%; width: 100%;
padding: 5px 10px; padding-right: 50rpx;
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
background-color: #fff; // background-color: #fff;
border-top: 1px solid #f3f3f3; // border-top: 1px solid #f3f3f3;
box-shadow: 0 -2px 2px #f5f5f5; // box-shadow: 0 -2px 2px #f5f5f5;
box-sizing: border-box; box-sizing: border-box;
&:empty { &:empty {
padding: 0 !important; padding: 0 !important;

@ -39,7 +39,7 @@
<text class="name">订单内容</text> <text class="name">订单内容</text>
<view class="val ell-wrap"> <view class="val ell-wrap">
<view :class="{ell: !item.toggle}">{{ item.orderContent }}</view> <view :class="{ell: !item.toggle}">{{ item.orderContent }}</view>
<view v-if="item.orderContent.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view> <view v-if="item.orderContent && item.orderContent.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view>
</view> </view>
</view> </view>
<view class="line"> <view class="line">
@ -92,6 +92,10 @@
title: "已完成", title: "已完成",
value: 1 value: 1
}, },
{
title: "已取消",
value: 2
},
], ],
} }
], ],
@ -232,7 +236,7 @@
// list // list
const list = data.records const list = data.records
list.map(e => { list.map(e => {
e.toggle = e.orderContent.length < 14 // 14 if (e.orderContent) e.toggle = e.orderContent.length < 14 // 14
}) })
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list this.list = this.reachBottom > 0 ? [...this.list, ...list] : list
this.page++ // page+1 this.page++ // page+1

Loading…
Cancel
Save