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

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

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

@ -39,7 +39,7 @@
<text class="name">订单内容</text>
<view class="val ell-wrap">
<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 class="line">
@ -92,6 +92,10 @@
title: "已完成",
value: 1
},
{
title: "已取消",
value: 2
},
],
}
],
@ -232,7 +236,7 @@
// list
const list = data.records
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.page++ // page+1

Loading…
Cancel
Save