订单修改

master
yujialong 1 year ago
parent bb1ed11a1d
commit 045748284c
  1. 3
      order/addCourse/addCourse.vue
  2. 5
      order/curClient/curClient.vue
  3. 128
      order/editCourse/editCourse.vue
  4. 141
      order/orderDetail/orderDetail.vue
  5. 3
      order/orders/orders.vue
  6. 4
      team/qrcode/qrcode.vue

@ -234,7 +234,8 @@
settlementPrice: trial ? 0 : '', // settlementPrice: trial ? 0 : '', //
settlementPriceUnit: e.settlementPrice || 0, // settlementPriceUnit: e.settlementPrice || 0, //
serviceFee: 0, // serviceFee: 0, //
mallNonAssociatedLinks: e.mallNonAssociatedLinks // mallNonAssociatedLinks: e.mallNonAssociatedLinks, //
typeName: e.typeName
} }
}, },
// //

@ -134,6 +134,11 @@
this.customerId = options.customerId this.customerId = options.customerId
this.customerName = options.name this.customerName = options.name
this.initList() this.initList()
//
try {
uni.removeStorageSync('courses')
uni.removeStorageSync('orderEdited')
} catch (e) {}
}, },
methods: { methods: {
getList() { getList() {

@ -1,79 +1,81 @@
<template> <template>
<view class="page"> <view class="page">
<template v-for="c in courses"> <template v-for="c in courses">
<view v-if="c.list.length" class="block"> <view v-if="c.list.length && c.list.filter(e => !e.edited).length" class="block">
<view class="l-title">{{ c.name }}</view> <view class="l-title">{{ c.name }}</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 v-show="!c.shrink"> <view v-show="!c.shrink">
<view v-for="(item, i) in c.list"> <template v-for="(item, i) in c.list">
<view class="pro-name"> <view v-if="!item.edited" :key="i">
<view class="left"> <view class="pro-name">
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> <view class="left">
{{ item.productName }} <image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
</view> {{ item.productName }}
<uni-icons v-if="isAdd || isRenew" class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons> </view>
</view> <uni-icons v-if="isAdd || isRenew" class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons>
<view class="form-list">
<view class="line">
<view class="name">产品类型</view>
<view class="val">{{ item.typeName }}</view>
</view> </view>
<view :class="['line', {err: err === 'periodOfUse' + item.dataOrCourseId + item.authority}]"> <view class="form-list">
<view class="name">使用期限</view> <view class="line">
<view class="period-wrap"> <view class="name">产品类型</view>
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" :disabled="isEdit" @input="calcDate(item, !item.authority)" @change="handleErr(item, 'periodOfUse')"> <view class="val">{{ item.typeName }}</view>
</view> </view>
<view v-if="isEdit">{{ units.find(e => e.id === item.options).text }}</view> <view :class="['line', {err: err === 'periodOfUse' + item.dataOrCourseId + item.authority}]">
<view v-else class="val unit" @click="selectUnit(item)"> <view class="name">使用期限</view>
<text>{{ units.find(e => e.id === item.options).text }}</text> <view class="period-wrap">
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> <input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" :disabled="isEdit" @input="calcDate(item, !item.authority)" @change="handleErr(item, 'periodOfUse')">
</view>
<view v-if="isEdit">{{ units.find(e => e.id === item.options).text }}</view>
<view v-else 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>
</view> </view>
</view> <view :class="['line req', {err: err === 'startTime' + item.dataOrCourseId + item.authority}]">
<view :class="['line req', {err: err === 'startTime' + item.dataOrCourseId + item.authority}]"> <view class="name">起止日期</view>
<view class="name">起止日期</view> <view v-if="isEdit">{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}</view>
<view v-if="isEdit">{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}</view> <view v-else class="val unit">
<view v-else class="val unit"> <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}]"> {{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} </view>
</view> </uni-datetime-picker>
</uni-datetime-picker> <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> </view>
</view> <view :class="['line req', {err: err === 'accountNum' + item.dataOrCourseId + item.authority}]">
<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="ph">1</view>
<view v-if="item.authority" class="ph">1</view> <input v-else type="number" v-model="item.accountNum" placeholder="请输入账号数量" @input="calcFinalPrice(item)" @change="handleErr(item, 'accountNum')">
<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>
<view class="ph">{{ item.marketValue }}</view>
</view>
<view class="line">
<view class="name">结算价</view>
<view class="inline">
<input type="number" v-model="item.settlementPrice" placeholder="请输入" @change="handleErr(item, 'settlementPrice')">
</view> </view>
</view> <view class="line">
<view class="line"> <view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view>
<view class="name">折扣率</view> <view class="ph">{{ item.marketValue }}</view>
<view class="ph">{{ item.discountRate }}</view> </view>
</view> <view class="line">
<view class="line"> <view class="name">结算价</view>
<view class="name">平台服务费</view> <view class="inline">
<view class="ph">{{ item.serviceFee }}</view> <input type="number" v-model="item.settlementPrice" placeholder="请输入" @change="handleErr(item, 'settlementPrice')">
</view>
<view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]"> </view>
<view class="name">成交价</view> </view>
<view class="inline"> <view class="line">
<input type="number" v-model="item.finalPrice" placeholder="请输入" :disabled="isEdit && !item.authority" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')"> <view class="name">折扣率</view>
<view class="ph">{{ item.discountRate }}</view>
</view>
<view class="line">
<view class="name">平台服务费</view>
<view class="ph">{{ item.serviceFee }}</view>
</view>
<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="请输入" :disabled="isEdit && !item.authority" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')">
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </template>
</view> </view>
</view> </view>
</template> </template>
@ -364,10 +366,12 @@
msg = '请输入成交价!' msg = '请输入成交价!'
break break
} }
e.edited = 1 //
} }
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)
uni.setStorageSync('orderEdited', 1)
uni.navigateBack() uni.navigateBack()
}, },
} }

@ -45,18 +45,20 @@
<view v-if="isDetail" class="val">{{ form.businessManagerName }}</view> <view v-if="isDetail" class="val">{{ form.businessManagerName }}</view>
<uni-data-picker v-else class="picker-input" placeholder="请选择商务经理" popup-title="请选择商务经理" preload :localdata="bms" :map="{text: 'userName', value: 'partnerId'}" v-model="form.businessManagerId" :readonly="form.teamId ? false : true"></uni-data-picker> <uni-data-picker v-else class="picker-input" placeholder="请选择商务经理" popup-title="请选择商务经理" preload :localdata="bms" :map="{text: 'userName', value: 'partnerId'}" v-model="form.businessManagerId" :readonly="form.teamId ? false : true"></uni-data-picker>
</view> </view>
<view class="line"> <template v-if="edited">
<view class="name">订单编号</view> <view class="line">
<view class="val">{{ form.orderNumber }}</view> <view class="name">订单编号</view>
</view> <view class="val">{{ form.orderNumber }}</view>
<view class="line"> </view>
<view class="name">订单时间</view> <view class="line">
<view class="val">{{ form.createTime }}</view> <view class="name">订单时间</view>
</view> <view class="val">{{ form.createTime }}</view>
<view class="line"> </view>
<view class="name">订单金额</view> <view class="line">
<view class="val">{{ form.orderAmount }}</view> <view class="name">订单金额</view>
</view> <view class="val">{{ form.orderAmount }}</view>
</view>
</template>
</view> </view>
</view> </view>
@ -80,7 +82,7 @@
<button v-if="auth('订单管理:发货')" class="course-btn" type="primary" @click.stop="handleDeliver(n, i)">{{ item.ship ? '取消' : ''}}发货</button> <button v-if="auth('订单管理:发货')" class="course-btn" type="primary" @click.stop="handleDeliver(n, i)">{{ item.ship ? '取消' : ''}}发货</button>
</template> </template>
<button v-else-if="!isDetail && auth('订单管理:启用')" class="course-btn" type="primary" @click.stop="handleEnable(n, i)">{{ item.isEnable ? '禁用' : '启用'}}</button> <button v-else-if="!isDetail && auth('订单管理:启用')" class="course-btn" type="primary" @click.stop="handleEnable(n, i)">{{ item.isEnable ? '禁用' : '启用'}}</button>
<button v-if="auth('订单管理:发货') && (item.authority == 3 || item.authority == 4) && (!isDetail || (isDetail && item.shipContent))" class="course-btn mg" type="primary" @click.stop="showShip(item)">发货信息</button> <button v-if="auth('订单管理:发货') && (item.authority == 0 || item.authority == 3 || item.authority == 4) && (!isDetail || (isDetail && item.shipContent))" class="course-btn mg" type="primary" @click.stop="showShip(item)">发货信息</button>
<image v-if="!orderId || isRenew || isHandle" class="del" src="@/static/image/trash.png" mode="widthFix" @click.stop="delCourse(c, i)"></image> <image v-if="!orderId || isRenew || isHandle" class="del" src="@/static/image/trash.png" mode="widthFix" @click.stop="delCourse(c, i)"></image>
</view> </view>
</view> </view>
@ -136,7 +138,7 @@
</view> </view>
<view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]"> <view :class="['line req', {err: err === 'finalPrice' + item.dataOrCourseId + item.authority}]">
<view class="label">成交价</view> <view class="label">成交价</view>
<view v-if="isDetail || (isEdit && !item.authority)" class="ph">{{ item.finalPrice }}</view> <view v-if="isDetail" class="ph">{{ item.finalPrice }}</view>
<view class="inline" v-else> <view class="inline" v-else>
<input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')"> <input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)" @change="handleErr(item, 'finalPrice')">
@ -149,33 +151,40 @@
</template> </template>
<view class="bottom"> <view class="bottom">
<view v-if="!orderId || isHandle" class="add-wrap"> <template v-if="!edited && !orderId">
<view class="add-btn" @click="toAdd"> <view class="next-wrap">
<uni-icons class="icon" type="plus" color="#007FFF"></uni-icons> <view class="lg-btn next" @click="toAdd(0)">下一步</view>
添加产品
</view> </view>
</view> </template>
<template v-else>
<view :class="['product', isDetail ? 'show' : 'edit']"> <view v-if="!orderId || isHandle" class="add-wrap">
<view class="text"> <view class="lg-btn" @click="toAdd">
<view class="total"> <uni-icons class="icon" type="plus" color="#007FFF"></uni-icons>
<view v-if="isDetail">共选<text class="num">{{ courses.length }}</text>个产品</view> 添加产品
<view class="column">总成交价合计<text class="num">{{ form.orderAmount }}</text></view>
</view> </view>
<view class="info"> </view>
<view class="line">
总采购成本:<text class="num">{{ form.purchaseCost }}</text> <view :class="['product', isDetail ? 'show' : 'edit']">
<view class="text">
<view class="total">
<view v-if="isDetail">共选<text class="num">{{ courses.length }}</text>个产品</view>
<view class="column">总成交价合计<text class="num">{{ form.orderAmount }}</text></view>
</view> </view>
<view class="line"> <view class="info">
总产品利润:<text class="num"> {{ form.profit }}</text> <view class="line">
总采购成本:<text class="num">{{ form.purchaseCost }}</text>
</view>
<view class="line">
总产品利润:<text class="num"> {{ form.profit }}</text>
</view>
</view> </view>
</view> </view>
<view class="product-btns">
<view v-if="!isDetail" class="btn" @click="submit">提交({{ courses.length }})</view>
<view v-if="auth('订单管理:发货') && (isHandle || (!orderId && courses.length))" class="btn" @click="batchDeliver">{{ courses.find(e => !e.ship) ? '一键发货' : '取消全部发货' }}</view>
</view>
</view> </view>
<view class="product-btns"> </template>
<view v-if="!isDetail" class="btn" @click="submit">提交({{ courses.length }})</view>
<view v-if="auth('订单管理:发货') && (isHandle || (!orderId && courses.length))" class="btn" @click="batchDeliver">{{ courses.find(e => !e.ship) ? '一键发货' : '取消全部发货' }}</view>
</view>
</view>
</view> </view>
<view v-if="isDetail" class="action"> <view v-if="isDetail" class="action">
@ -242,6 +251,7 @@
isEdit: 0, // isEdit: 0, //
isHandle: 0, // isHandle: 0, //
isRenew: 0, // isRenew: 0, //
edited: false,
orderId: '', orderId: '',
orderTypes: [{ orderTypes: [{
text: '正式', text: '正式',
@ -328,6 +338,7 @@
this.isEdit = action === 'edit' this.isEdit = action === 'edit'
this.isHandle = action === 'handle' this.isHandle = action === 'handle'
this.isRenew = action === 'renew' this.isRenew = action === 'renew'
this.edited = uni.getStorageSync('orderEdited')
const store = uni.getStorageSync('courses') const store = uni.getStorageSync('courses')
this.getTeam(!store) this.getTeam(!store)
if (store) { if (store) {
@ -1060,13 +1071,16 @@
.line { .line {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 12rpx 0; padding: 28rpx 0;
margin: 5px 0;
font-size: 12px; font-size: 12px;
border-bottom: 1px solid #E6E8ED;
&:last-child {
border-bottom: 0;
}
} }
.label { .label {
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #333;
} }
.ph { .ph {
font-size: 28rpx; font-size: 28rpx;
@ -1097,26 +1111,33 @@
background-color: #fff; background-color: #fff;
box-shadow: 0 -2px 2px #f5f5f5; box-shadow: 0 -2px 2px #f5f5f5;
box-sizing: border-box; box-sizing: border-box;
} .add-wrap {
.add-wrap { padding: 16rpx 24rpx 40rpx;
padding: 16rpx 24rpx 40rpx; background-color: #f5f5f5;
background-color: #f5f5f5;
}
/deep/.add-btn {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
line-height: 88rpx;
color: #007EFF;
background-color: #fff;
border: 1px solid #007EFF;
border-radius: 16rpx;
.icon {
margin-right: 10rpx;
} }
.uni-icons { .next-wrap {
font-size: 38rpx !important; padding: 24rpx 24rpx 0;
}
/deep/.lg-btn {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
line-height: 88rpx;
color: #007EFF;
background-color: #fff;
border: 1px solid #007EFF;
border-radius: 16rpx;
.icon {
margin-right: 10rpx;
}
.uni-icons {
font-size: 38rpx !important;
}
&.next {
color: #fff;
background-color: #007EFF;
}
} }
} }
.product { .product {
@ -1221,12 +1242,6 @@
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
.period {
flex: none;
width: 100rpx;
font-size: 28rpx;
text-align: center;
}
.ship-info { .ship-info {
height: 400rpx; height: 400rpx;
padding: 30rpx; padding: 30rpx;

@ -145,9 +145,10 @@
} }
}, },
onShow() { onShow() {
// //
try { try {
uni.removeStorageSync('courses') uni.removeStorageSync('courses')
uni.removeStorageSync('orderEdited')
} catch (e) {} } catch (e) {}
this.initList() this.initList()
}, },

@ -59,8 +59,8 @@
generateInvitationCode(accountId).then(({ expireTime }) => { generateInvitationCode(accountId).then(({ expireTime }) => {
const date = new Date(Date.now() + expireTime * 1000) // *1000 const date = new Date(Date.now() + expireTime * 1000) // *1000
this.expireTime = `${date.getFullYear()}-${this.$util.preZero(date.getMonth() + 1)}-${this.$util.preZero(date.getDate())} ${this.$util.preZero(date.getHours())}:${this.$util.preZero(date.getMinutes())}:${this.$util.preZero(date.getMinutes())}` this.expireTime = `${date.getFullYear()}-${this.$util.preZero(date.getMonth() + 1)}-${this.$util.preZero(date.getDate())} ${this.$util.preZero(date.getHours())}:${this.$util.preZero(date.getMinutes())}:${this.$util.preZero(date.getMinutes())}`
this.link = `https://huorantech.cn/#/join?accountId=${accountId}&id=${this.id}&isTeam=1` // this.link = `https://huorantech.cn/#/join?accountId=${accountId}&id=${this.id}&isTeam=1`
// this.link = `http://121.37.12.51/backstage/#/join?accountId=${accountId}&id=${this.id}&isTeam=1` this.link = `http://121.37.12.51/backstage/#/join?accountId=${accountId}&id=${this.id}&isTeam=1`
}).catch(e => {}) }).catch(e => {})
}, },
// imageimage // imageimage

Loading…
Cancel
Save