|
|
@ -1,68 +1,72 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="page"> |
|
|
|
<view class="page"> |
|
|
|
<view class="block"> |
|
|
|
<template v-for="c in courses"> |
|
|
|
<view class="l-title">基本信息</view> |
|
|
|
<view v-if="c.list.length" class="block"> |
|
|
|
<uni-icons class="arrow" type="top" size="20" color="#007EFF"></uni-icons> |
|
|
|
<view class="l-title">{{ c.name }}</view> |
|
|
|
<view v-for="(item, i) in courses"> |
|
|
|
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons> |
|
|
|
<view class="pro-name"> |
|
|
|
<view v-show="!c.shrink"> |
|
|
|
<view class="left"> |
|
|
|
<view v-for="(item, i) in c.list"> |
|
|
|
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image> |
|
|
|
<view class="pro-name"> |
|
|
|
{{ item.productName }} |
|
|
|
<view class="left"> |
|
|
|
</view> |
|
|
|
<image v-if="item.miniProgramPictureAddress" class="icon" :src="item.miniProgramPictureAddress" mode="widthFix"></image> |
|
|
|
<uni-icons class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(i)"></uni-icons> |
|
|
|
{{ item.productName }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="form-list"> |
|
|
|
<uni-icons class="del" type="trash" size="25" color="#ADADAD" @click="delCourse(c, i)"></uni-icons> |
|
|
|
<view class="line"> |
|
|
|
</view> |
|
|
|
<view class="name">产品类型</view> |
|
|
|
<view class="form-list"> |
|
|
|
<view class="val">{{ item.provinceName }}</view> |
|
|
|
<view class="line"> |
|
|
|
</view> |
|
|
|
<view class="name">产品类型</view> |
|
|
|
<view class="line req"> |
|
|
|
<view class="val">{{ item.provinceName }}</view> |
|
|
|
<view class="name">使用期限</view> |
|
|
|
</view> |
|
|
|
<input type="text" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item, !item.authority)"> |
|
|
|
<view class="line req"> |
|
|
|
</view> |
|
|
|
<view class="name">使用期限</view> |
|
|
|
<view class="line"> |
|
|
|
<input type="text" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item, !item.authority)"> |
|
|
|
<view class="name">使用期限单位</view> |
|
|
|
</view> |
|
|
|
<uni-data-picker class="picker-input" placeholder="请选择" popup-title="请选择" preload :clear-icon="false" :localdata="units" v-model="item.options" @change="calcDate(item)"></uni-data-picker> |
|
|
|
<view class="line"> |
|
|
|
</view> |
|
|
|
<view class="name">使用期限单位</view> |
|
|
|
<view class="line req"> |
|
|
|
<uni-data-picker class="picker-input" placeholder="请选择" popup-title="请选择" preload :clear-icon="false" :localdata="units" v-model="item.options" @change="calcDate(item)"></uni-data-picker> |
|
|
|
<view class="name">起止日期</view> |
|
|
|
</view> |
|
|
|
<uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)"> |
|
|
|
<view class="line req"> |
|
|
|
<view :class="['ph', {val: item.startTime}]"> |
|
|
|
<view class="name">起止日期</view> |
|
|
|
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} |
|
|
|
<uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)"> |
|
|
|
|
|
|
|
<view :class="['ph', {val: item.startTime}]"> |
|
|
|
|
|
|
|
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line req"> |
|
|
|
|
|
|
|
<view class="name">数量</view> |
|
|
|
|
|
|
|
<view v-if="item.authority" class="val">1</view> |
|
|
|
|
|
|
|
<input v-else type="text" v-model="item.accountNum" placeholder="请输入" @change="calcFinalPrice(item)"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.marketValue }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">结算价</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.settlementPrice }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">折扣率</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.discountRate }}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">平台服务费</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.serviceFee }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line req"> |
|
|
|
|
|
|
|
<view class="name">成交价</view> |
|
|
|
|
|
|
|
<view class="inline"> |
|
|
|
|
|
|
|
<input type="text" v-model="item.finalPrice" placeholder="请输入" @change="calcFinalValue(item)"> |
|
|
|
|
|
|
|
元 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-datetime-picker> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line req"> |
|
|
|
|
|
|
|
<view class="name">数量</view> |
|
|
|
|
|
|
|
<view v-if="item.authority" class="val">1</view> |
|
|
|
|
|
|
|
<input v-else type="text" v-model="item.accountNum" placeholder="请输入" @change="calcFinalPrice(item)"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.marketValue }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">结算价</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.settlementPrice }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">折扣率</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.discountRate }}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line"> |
|
|
|
|
|
|
|
<view class="name">平台服务费</view> |
|
|
|
|
|
|
|
<view class="val">{{ item.serviceFee }}元</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="line req"> |
|
|
|
|
|
|
|
<view class="name">成交价</view> |
|
|
|
|
|
|
|
<view class="inline"> |
|
|
|
|
|
|
|
<input type="text" v-model="item.finalPrice" placeholder="请输入" @change="calcFinalValue(item)"> |
|
|
|
|
|
|
|
元 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view class="btn-wrap"> |
|
|
|
<view class="btn-wrap"> |
|
|
|
<view class="btn" @click="submit">确定</view> |
|
|
|
<view class="btn" @click="submit">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -85,7 +89,7 @@ |
|
|
|
text: '年', |
|
|
|
text: '年', |
|
|
|
value: 2 |
|
|
|
value: 2 |
|
|
|
}], |
|
|
|
}], |
|
|
|
courses: [], // 上一页缓存的产品 |
|
|
|
courses: {} , // 上一页缓存的产品 |
|
|
|
orderRepeat: [], |
|
|
|
orderRepeat: [], |
|
|
|
repeatMsg: '' |
|
|
|
repeatMsg: '' |
|
|
|
} |
|
|
|
} |
|
|
@ -94,23 +98,54 @@ |
|
|
|
const pages = getCurrentPages() |
|
|
|
const pages = getCurrentPages() |
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
this.customerId = options.customerId |
|
|
|
this.customerId = options.customerId |
|
|
|
const store = uni.getStorageSync('courses') |
|
|
|
this.handleProduct() |
|
|
|
if (store) { |
|
|
|
}, |
|
|
|
this.courses = store |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 转换产品列表 |
|
|
|
|
|
|
|
handleProduct() { |
|
|
|
|
|
|
|
const list = uni.getStorageSync('courses') |
|
|
|
|
|
|
|
const courses = { |
|
|
|
|
|
|
|
practice: { |
|
|
|
|
|
|
|
shrink: false, |
|
|
|
|
|
|
|
name: '实训课程产品', |
|
|
|
|
|
|
|
list: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
theory: { |
|
|
|
|
|
|
|
shrink: false, |
|
|
|
|
|
|
|
name: '理论课程产品', |
|
|
|
|
|
|
|
list: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
shrink: false, |
|
|
|
|
|
|
|
name: '数据产品', |
|
|
|
|
|
|
|
list: [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 3个分类的课程分别push到不同数组(0->理论 1-实训 2 数据产品) |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
const type = e.productType |
|
|
|
|
|
|
|
!type ? |
|
|
|
|
|
|
|
courses.theory.list.push(e) : |
|
|
|
|
|
|
|
type === 1 ? |
|
|
|
|
|
|
|
courses.practice.list.push(e) : |
|
|
|
|
|
|
|
courses.data.list.push(e) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.courses = courses |
|
|
|
try { |
|
|
|
try { |
|
|
|
uni.removeStorageSync('courses') |
|
|
|
uni.removeStorageSync('courses') |
|
|
|
} catch (e) {} |
|
|
|
} catch (e) {} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 收缩产品 |
|
|
|
methods: { |
|
|
|
toggle(c) { |
|
|
|
|
|
|
|
c.shrink = !c.shrink |
|
|
|
|
|
|
|
}, |
|
|
|
// 删除课程 |
|
|
|
// 删除课程 |
|
|
|
delCourse(i) { |
|
|
|
delCourse(c, i) { |
|
|
|
const that = this |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
title: '提示', |
|
|
|
content: '确定要删除吗?', |
|
|
|
content: '确定要删除吗?', |
|
|
|
success(res) { |
|
|
|
success(res) { |
|
|
|
res.confirm && that.courses.splice(i, 1) |
|
|
|
res.confirm && c.list.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -236,8 +271,13 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 确定 |
|
|
|
// 确定 |
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
const list = this.courses |
|
|
|
const courses = this.courses |
|
|
|
|
|
|
|
const list = [] |
|
|
|
let msg = '' |
|
|
|
let msg = '' |
|
|
|
|
|
|
|
// 全部产品push到一个数组,方便校验 |
|
|
|
|
|
|
|
for (const i in courses) { |
|
|
|
|
|
|
|
list.push(...courses[i].list) |
|
|
|
|
|
|
|
} |
|
|
|
// 必填校验 |
|
|
|
// 必填校验 |
|
|
|
for (const i in list) { |
|
|
|
for (const i in list) { |
|
|
|
const e = list[i] |
|
|
|
const e = list[i] |
|
|
|