|
|
@ -66,16 +66,19 @@ |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
{{ item.productName }} |
|
|
|
{{ item.productName }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="course-action"> |
|
|
|
<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> |
|
|
|
|
|
|
|
<button v-if="item.authority == 3 || item.authority == 4" class="info-btn" type="primary" @click.stop="showShip(item)">发货信息</button> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="info"> |
|
|
|
<view class="info"> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="label">使用期限</view> |
|
|
|
<view class="label">使用期限</view> |
|
|
|
<view class="val">{{ item.startTime + ' - ' + item.endTime }}</view> |
|
|
|
<view class="val">{{ item.startTime + (item.endTime ? ' - ' + item.endTime : '') }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="label">市场价(元)</view> |
|
|
|
<view class="label">市场价(元)</view> |
|
|
|
<view class="val">{{ item.marketValue }}元</view> |
|
|
|
<view class="val">{{ item.marketValue && item.marketValue + '元' }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="label">结算价</view> |
|
|
|
<view class="label">结算价</view> |
|
|
@ -135,12 +138,16 @@ |
|
|
|
<view class="item" v-for="item in customerList" @click="customerChange(item)">{{ item.customerName }}</view> |
|
|
|
<view class="item" v-for="item in customerList" @click="customerChange(item)">{{ item.customerName }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<uni-popup ref="info" type="bottom" background-color="#fff"> |
|
|
|
|
|
|
|
<view class="ship-info" v-html="shipInfo" @click="copy"></view> |
|
|
|
|
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import { productCategoryList, delCart } from '@/apis/modules/product.js' |
|
|
|
import { queryCustomer, queryCustomerDetails } from '@/apis/modules/client.js' |
|
|
|
import { queryCustomer, queryCustomerDetails } from '@/apis/modules/client.js' |
|
|
|
import { add, update, getDetail } from '@/apis/modules/order.js' |
|
|
|
import { add, update, getDetail, queryCitySettlementPrice } from '@/apis/modules/order.js' |
|
|
|
import { getPartnerTeamRates } from '@/apis/modules/parner.js' |
|
|
|
import { getPartnerTeamRates } from '@/apis/modules/parner.js' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
@ -191,7 +198,8 @@ |
|
|
|
customerList: [], |
|
|
|
customerList: [], |
|
|
|
customerListAll: [], |
|
|
|
customerListAll: [], |
|
|
|
err: '', |
|
|
|
err: '', |
|
|
|
rate: '' |
|
|
|
rate: '', |
|
|
|
|
|
|
|
shipInfo: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -212,6 +220,7 @@ |
|
|
|
if (this.orderId) { |
|
|
|
if (this.orderId) { |
|
|
|
this.getInfo() |
|
|
|
this.getInfo() |
|
|
|
} else if (store) { |
|
|
|
} else if (store) { |
|
|
|
|
|
|
|
console.log(33, store) |
|
|
|
// 新增取缓存,取了删除 |
|
|
|
// 新增取缓存,取了删除 |
|
|
|
const list = [] |
|
|
|
const list = [] |
|
|
|
for (const i in store) { |
|
|
|
for (const i in store) { |
|
|
@ -273,38 +282,24 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 转换产品列表 |
|
|
|
// 转换产品列表 |
|
|
|
handleProduct(list) { |
|
|
|
handleProduct(list) { |
|
|
|
const courses = { |
|
|
|
let courses = {} |
|
|
|
practice: { |
|
|
|
// 产品分类 |
|
|
|
shrink: false, |
|
|
|
productCategoryList().then(res => { |
|
|
|
name: '实训课程产品', |
|
|
|
res.classificationList.forEach(e => { |
|
|
|
list: [] |
|
|
|
courses['list' + this.$util.getOrderType(e.classificationId)] = { |
|
|
|
}, |
|
|
|
|
|
|
|
theory: { |
|
|
|
|
|
|
|
shrink: false, |
|
|
|
|
|
|
|
name: '理论课程产品', |
|
|
|
|
|
|
|
list: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
shrink: false, |
|
|
|
shrink: false, |
|
|
|
name: '数据产品', |
|
|
|
name: e.classificationName, |
|
|
|
list: [] |
|
|
|
list: [] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
// 3个分类的课程分别push到不同数组(0->理论 1-实训 2 数据产品) |
|
|
|
// 3个分类的课程分别push到不同数组(0->理论 1-实训 2 数据产品) |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
|
console.log('e.=>',e) |
|
|
|
|
|
|
|
console.log('this.rate=>',this.rate) |
|
|
|
|
|
|
|
e.serviceFee = (e.finalPrice * (this.rate / 100)).toFixed(2) // 服务费 != 0 && 才需要算 |
|
|
|
e.serviceFee = (e.finalPrice * (this.rate / 100)).toFixed(2) // 服务费 != 0 && 才需要算 |
|
|
|
|
|
|
|
courses['list' + e.authority].list.push(e) |
|
|
|
console.log('e.serviceFee=>',e.serviceFee) |
|
|
|
|
|
|
|
const type = e.productType |
|
|
|
|
|
|
|
!type ? |
|
|
|
|
|
|
|
courses.theory.list.push(e) : |
|
|
|
|
|
|
|
type === 1 ? |
|
|
|
|
|
|
|
courses.practice.list.push(e) : |
|
|
|
|
|
|
|
courses.data.list.push(e) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
console.log(123,courses) |
|
|
|
this.courseList = courses |
|
|
|
this.courseList = courses |
|
|
|
|
|
|
|
}).catch(e => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取客户列表 |
|
|
|
// 获取客户列表 |
|
|
|
getCustomer() { |
|
|
|
getCustomer() { |
|
|
@ -333,25 +328,44 @@ |
|
|
|
this.keyword = '' |
|
|
|
this.keyword = '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 客户名称选择回调 |
|
|
|
// 客户名称选择回调 |
|
|
|
customerChange(item) { |
|
|
|
async customerChange(item) { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
// 获取客户详情 |
|
|
|
// 获取客户详情 |
|
|
|
queryCustomerDetails({ |
|
|
|
const { result } = await queryCustomerDetails({ |
|
|
|
customerId: item.customerId |
|
|
|
customerId: item.customerId |
|
|
|
}).then(({ result }) => { |
|
|
|
}) |
|
|
|
this.handleErr('customerName') |
|
|
|
this.handleErr('customerName') |
|
|
|
const e = result.customer |
|
|
|
const e = result.customer |
|
|
|
|
|
|
|
const { provinceId, cityId } = e |
|
|
|
form.customerId = e.customerId |
|
|
|
form.customerId = e.customerId |
|
|
|
form.customerName = e.customerName |
|
|
|
form.customerName = e.customerName |
|
|
|
form.provinceId = e.provinceId |
|
|
|
form.provinceId = provinceId |
|
|
|
form.cityId = e.cityId |
|
|
|
form.cityId = cityId |
|
|
|
form.provinceName = e.provinceName |
|
|
|
form.provinceName = e.provinceName |
|
|
|
form.cityName = e.cityName |
|
|
|
form.cityName = e.cityName |
|
|
|
form.phone = e.phone |
|
|
|
form.phone = e.phone |
|
|
|
form.email = e.email |
|
|
|
form.email = e.email |
|
|
|
form.orderContact = e.name |
|
|
|
form.orderContact = e.name |
|
|
|
}).catch(e => {}) |
|
|
|
|
|
|
|
|
|
|
|
// 获取平台结算价重新计算课程的相关参数 |
|
|
|
|
|
|
|
const list = this.courseList |
|
|
|
|
|
|
|
const courses = [] |
|
|
|
|
|
|
|
const promises = [] |
|
|
|
|
|
|
|
for (const i in list) { |
|
|
|
|
|
|
|
list[i].list.forEach(n => { |
|
|
|
|
|
|
|
promises.push(new Promise(async (resolve, reject) => { |
|
|
|
|
|
|
|
const res = await queryCitySettlementPrice(n.mallId, provinceId, cityId) |
|
|
|
|
|
|
|
if (res.mallPrice) n.settlementPriceUnit = res.mallPrice.discountRate || 0 |
|
|
|
|
|
|
|
courses.push(n) |
|
|
|
|
|
|
|
resolve() |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
|
|
|
|
this.courses = courses |
|
|
|
|
|
|
|
this.calcTotal() |
|
|
|
this.closeCustomer() |
|
|
|
this.closeCustomer() |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询合伙人团队费率 |
|
|
|
// 查询合伙人团队费率 |
|
|
|
getRate() { |
|
|
|
getRate() { |
|
|
@ -469,7 +483,7 @@ |
|
|
|
1 : |
|
|
|
1 : |
|
|
|
row.accountNum)).toFixed((2)) |
|
|
|
row.accountNum)).toFixed((2)) |
|
|
|
row.settlementPrice = this.$util.handleNaN(sPrice) |
|
|
|
row.settlementPrice = this.$util.handleNaN(sPrice) |
|
|
|
// 平台服务费(结算价*10%) |
|
|
|
// 平台服务费 |
|
|
|
if (row.settlementPrice) { |
|
|
|
if (row.settlementPrice) { |
|
|
|
row.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2) |
|
|
|
row.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2) |
|
|
|
} |
|
|
|
} |
|
|
@ -498,6 +512,26 @@ |
|
|
|
this.dealSettlePrice(row) |
|
|
|
this.dealSettlePrice(row) |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示发货信息 |
|
|
|
|
|
|
|
showShip(row) { |
|
|
|
|
|
|
|
console.log(33) |
|
|
|
|
|
|
|
let val = '' |
|
|
|
|
|
|
|
row.mallNonAssociatedLinks && row.mallNonAssociatedLinks.forEach(e => { |
|
|
|
|
|
|
|
val += e.urlName + ':' + e.url + '\n' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.shipInfo = val |
|
|
|
|
|
|
|
this.$refs.info.open() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 复制发货信息 |
|
|
|
|
|
|
|
copy() { |
|
|
|
|
|
|
|
const that = this |
|
|
|
|
|
|
|
uni.setClipboardData({ |
|
|
|
|
|
|
|
data: this.shipInfo, |
|
|
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
that.$util.sucMsg('编辑成功') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 处理错误提示 |
|
|
|
// 处理错误提示 |
|
|
|
handleErr(val) { |
|
|
|
handleErr(val) { |
|
|
|
if (val === this.err) this.err = '' |
|
|
|
if (val === this.err) this.err = '' |
|
|
@ -507,7 +541,9 @@ |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
tmplIds: ['8pDVfWYqh9c-nn3CeA1NXJtBxdd1FYiCtrl5BeLvbgU'], |
|
|
|
tmplIds: ['8pDVfWYqh9c-nn3CeA1NXJtBxdd1FYiCtrl5BeLvbgU'], |
|
|
|
success: (res) => { |
|
|
|
success: (res) => { |
|
|
|
uni.navigateBack() |
|
|
|
uni.switchTab({ |
|
|
|
|
|
|
|
url: '/pages/orders/orders' |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
fail: function(err) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -519,6 +555,11 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 从购物车选择产品下单的,则提交订单后删除购物车相对应产品 |
|
|
|
|
|
|
|
async delShopCart(courses) { |
|
|
|
|
|
|
|
const list = courses.filter(e => e.shopCartId) |
|
|
|
|
|
|
|
list.length && await delCart(list.map(e => e.shopCartId)) |
|
|
|
|
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
const { form, courses } = this |
|
|
|
const { form, courses } = this |
|
|
@ -530,7 +571,7 @@ |
|
|
|
this.err = 'orderType' |
|
|
|
this.err = 'orderType' |
|
|
|
return this.$util.errMsg('请选择订单类型!') |
|
|
|
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') |
|
|
|
}) |
|
|
|
}) |
|
|
@ -547,13 +588,16 @@ |
|
|
|
uni.hideLoading() |
|
|
|
uni.hideLoading() |
|
|
|
this.$util.sucMsg('编辑成功') |
|
|
|
this.$util.sucMsg('编辑成功') |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
uni.navigateBack() |
|
|
|
uni.switchTab({ |
|
|
|
|
|
|
|
url: '/pages/orders/orders' |
|
|
|
|
|
|
|
}) |
|
|
|
}, 1500) |
|
|
|
}, 1500) |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
uni.hideLoading() |
|
|
|
uni.hideLoading() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
add(data).then(res => { |
|
|
|
add(data).then(res => { |
|
|
|
|
|
|
|
this.delShopCart(courses) |
|
|
|
uni.hideLoading() |
|
|
|
uni.hideLoading() |
|
|
|
this.$util.sucMsg('添加成功') |
|
|
|
this.$util.sucMsg('添加成功') |
|
|
|
this.publicNotice() |
|
|
|
this.publicNotice() |
|
|
@ -605,6 +649,15 @@ |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
background: linear-gradient(90deg, #FFF5E5 0%, #FFFFFF 100%); |
|
|
|
background: linear-gradient(90deg, #FFF5E5 0%, #FFFFFF 100%); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.course-action { |
|
|
|
|
|
|
|
display: inline-flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.info-btn { |
|
|
|
|
|
|
|
padding: 0 16rpx; |
|
|
|
|
|
|
|
margin-left: 10rpx; |
|
|
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
|
|
} |
|
|
|
.left { |
|
|
|
.left { |
|
|
|
display: inline-flex; |
|
|
|
display: inline-flex; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
@ -744,4 +797,9 @@ |
|
|
|
background-color: #007EFF; |
|
|
|
background-color: #007EFF; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.ship-info { |
|
|
|
|
|
|
|
padding: 20rpx; |
|
|
|
|
|
|
|
white-space: pre-wrap; |
|
|
|
|
|
|
|
font-size: 28rpx; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|