新增线下订单模块
This commit is contained in:
@@ -17,7 +17,11 @@
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"bundleId" : "io.douhuofalv.com",
|
||||
"certificateFile" : "/Users/tmoct5/Documents/App证书/抖火/抖火法律苹果证书/DevDouhuoApp.p12",
|
||||
"certificateProfileFile" : "/Users/tmoct5/Documents/App证书/抖火/抖火法律苹果证书/DevDouhuoApp.mobileprovision",
|
||||
"playground" : "custom",
|
||||
"runSignStatus" : 0,
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
|
||||
98
apis/interfaces/offline.js
Normal file
98
apis/interfaces/offline.js
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
* 碌碌无为枉半生,一朝惊醒万事空。
|
||||
* moduleName: 线下业务
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
|
||||
// 主业务类型
|
||||
const business = () =>{
|
||||
return request({
|
||||
url: "offline/index",
|
||||
})
|
||||
}
|
||||
|
||||
// 获取主业务机构
|
||||
const institution = id =>{
|
||||
return request({
|
||||
url: "offline/" + id + "/institution",
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
// 获取机构表单数据
|
||||
const institutionType = id => {
|
||||
return request({
|
||||
url: "offline/institution/" + id + "/type",
|
||||
})
|
||||
}
|
||||
|
||||
// 提交用户办理信息
|
||||
const submitStore = data => {
|
||||
console.log(data)
|
||||
return request({
|
||||
url : "offline/store",
|
||||
method : "POST",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 配置服务包
|
||||
const service = orderId => {
|
||||
return request({
|
||||
url : 'offline/' + orderId + '/service',
|
||||
method : 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
// 添加服务包
|
||||
const serviceAdd = (orderId, items) => {
|
||||
return request({
|
||||
url : 'offline/' + orderId + '/service/calculate',
|
||||
method : 'POST',
|
||||
data : {
|
||||
items
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除服务包
|
||||
const serviceRemove = (id, data) => {
|
||||
return request({
|
||||
url : 'offline/' + id + '/service/remove',
|
||||
method : 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 完成分配
|
||||
const serviceOver = orderId => {
|
||||
return request({
|
||||
url : 'offline/' + orderId + '/service/over',
|
||||
method : 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
// 订单列表
|
||||
const lists = data => {
|
||||
return request({
|
||||
url : 'offline/orders/lists',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
business,
|
||||
institution,
|
||||
institutionType,
|
||||
submitStore,
|
||||
service,
|
||||
serviceAdd,
|
||||
serviceRemove,
|
||||
serviceOver,
|
||||
lists
|
||||
}
|
||||
54
pages.json
54
pages.json
@@ -827,6 +827,60 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor" : "#FFFFFF"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/offline/create",
|
||||
"name" : "OfflineCreate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor" : "#FFFFFF"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/offline/generate",
|
||||
"name" : "OfflineGenerate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor" : "#FFFFFF"
|
||||
}
|
||||
},{
|
||||
"path" : "pages/offline/service",
|
||||
"name" : "OfflineService",
|
||||
"auth": true,
|
||||
"style": {
|
||||
"navigationBarTitleText": "分配服务包",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [{
|
||||
"text": "添加",
|
||||
"color": "#446EFE",
|
||||
"fontSize": "32rpx",
|
||||
"width": "120rpx"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
"path" : "pages/offline/orders",
|
||||
"name" : "OfflineOrders",
|
||||
"auth": true,
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单管理",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
}
|
||||
},{
|
||||
"path": "pages/offline/orderInfo",
|
||||
"auth": true,
|
||||
"name": "OfflineInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#446EFE",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
190
pages/offline/create.vue
Normal file
190
pages/offline/create.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<view class="create-page">
|
||||
<view class="create-title">创建新的订单</view>
|
||||
<view class="create-submit">完善创建订单用户与订单类型</view>
|
||||
<view class="create-from">
|
||||
<view class="create-type">
|
||||
<view class="create-type-title">选择业务类型</view>
|
||||
<block v-for="(item, index) in businessArr" :key="index">
|
||||
<view class="create-type-item" :class="{'active': (item.business_id == businessId || item.synthesis_id == businessId) && item.self_type == selfType}" @click="onBusiness(item.business_id || item.synthesis_id, item.self_type)">
|
||||
<image class="create-type-icon" :src="item.cover_url || item.cover" mode="aspectFill"></image>
|
||||
<view class="create-type-text">
|
||||
<view class="title nowrap">{{item.title || '-'}}</view>
|
||||
<view class="submit nowrap">{{item.self_type == 'synthesis' ? '相关个人法律咨询服务' : item.subtitle || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="create-btn">
|
||||
<button size="default" @click="onNext()">下一步</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { business } from '@/apis/interfaces/offline.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
businessArr: [],
|
||||
businessId : '',
|
||||
selfType : '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
business().then(res => {
|
||||
this.businessArr = res
|
||||
this.businessId = res[0].business_id
|
||||
this.selfType = res[0].self_type
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 选择业务类型
|
||||
onBusiness(id, type){
|
||||
this.selfType = type
|
||||
this.businessId = id
|
||||
},
|
||||
// 创建业务单
|
||||
onNext(){
|
||||
let busines = this.businessArr.find(val => val.business_id === this.businessId)
|
||||
this.$Router.replace({
|
||||
name : 'OfflineGenerate',
|
||||
params : {
|
||||
businessTitle : busines.title,
|
||||
businessId : busines.business_id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.create-page{
|
||||
padding: 50rpx;
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
.create-title{
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 44rpx;
|
||||
}
|
||||
.create-submit{
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: gray;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
.create-from{
|
||||
padding-top: 50rpx;
|
||||
}
|
||||
// 目标用户
|
||||
.create-user{
|
||||
background: #f8f8f8;
|
||||
border-radius: $radius;
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.cover{
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
background: white;
|
||||
border-radius: $radius;
|
||||
margin-right: 20rpx;
|
||||
border: dashed 1rpx #ddd;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
.cover-src{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.nickname{
|
||||
width: calc(100% - 188rpx);
|
||||
line-height: 70rpx;
|
||||
font-size: 32rpx;
|
||||
&.hide{
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
.icon{
|
||||
width: 80rpx;
|
||||
text-align: right;
|
||||
.icon-u{
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 选择业务类型
|
||||
.create-type{
|
||||
padding-top: 50rpx;
|
||||
.create-type-title{
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
color: gray;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.create-type-item{
|
||||
background: #f8f8f8;
|
||||
border-radius: $radius;
|
||||
padding: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
border:solid 1rpx #f8f8f8;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.create-type-icon{
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
margin-right: $margin;
|
||||
background-color: white;
|
||||
border-radius: $radius;
|
||||
}
|
||||
.create-type-text{
|
||||
line-height: 40rpx;
|
||||
.title{
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.submit{
|
||||
color: gray;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
&.active{
|
||||
border:solid 1rpx $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按钮
|
||||
.create-btn{
|
||||
margin-top: 90rpx;
|
||||
button[size="default"]{
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background: $main-color;
|
||||
font-size: 32rpx;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
554
pages/offline/generate.vue
Normal file
554
pages/offline/generate.vue
Normal file
@@ -0,0 +1,554 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="block">
|
||||
<view class="block-title">客户信息</view>
|
||||
<view class="block-item">
|
||||
<label class="block-item-label"><text>*</text>客户姓名</label>
|
||||
<view class="inputs-flex">
|
||||
<input
|
||||
class="text-input"
|
||||
v-model="user"
|
||||
placeholder="请输入客户姓名"
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="block-item">
|
||||
<label class="block-item-label"><text>*</text>手机号码</label>
|
||||
<view class="inputs-flex">
|
||||
<input
|
||||
class="text-input"
|
||||
v-model="phone"
|
||||
type="number"
|
||||
placeholder="请输入客户手机号码"
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="serviceArr.length > 0">
|
||||
<view class="block" v-for="(item, index) in serviceArr" :key="index">
|
||||
<view class="block-title">
|
||||
{{item.title}}
|
||||
<view class="block-remove" @click="onRemove(index)" v-if="serviceArr.length > 1">
|
||||
<u-icon class="block-remove-icon" size="15" color="#446EFE" name="minus-circle"></u-icon>移出
|
||||
</view>
|
||||
</view>
|
||||
<!-- 机构 -->
|
||||
<view class="block-item">
|
||||
<label class="block-item-label"><text>*</text>机构</label>
|
||||
<view class="institution-picker" @click="onShowInstitution(item.institution, item, index)">
|
||||
<view class="institution-picker-text nowrap">{{item.institution[item.institutionIndex].title}}</view>
|
||||
<u-icon size="12" color="#999" name="arrow-down-fill"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 业务咨询类型 -->
|
||||
<view class="block-item">
|
||||
<label class="block-item-label"><text>*</text>业务咨询类型</label>
|
||||
<picker :range="item.fromType" range-key="title" :value="item.fromIndex" @change="businessChange($event, item, index)">
|
||||
<view class="institution-picker">
|
||||
<view class="institution-picker-text nowrap">{{item.fromType[item.fromIndex].title}}</view>
|
||||
<u-icon size="12" color="#999" name="arrow-down-fill"></u-icon>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- 表单信 -->
|
||||
<view
|
||||
class="block-item"
|
||||
v-for="(formItem, formIndex) in item.froms"
|
||||
:key="formIndex"
|
||||
v-if="item.subVal[formItem.pre_key] == formItem.pre_value"
|
||||
>
|
||||
<block v-if="formItem.type == 'price' || formItem.type == 'number' || formItem.type == 'day'">
|
||||
<label class="block-item-label"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}</label>
|
||||
<view class="inputs-flex">
|
||||
<input
|
||||
class="input"
|
||||
v-model="item.subVal[formItem.key]"
|
||||
:type="formItem.type == 'price' ? 'digit': 'number'"
|
||||
:placeholder="'请输入' + formItem.title"
|
||||
>
|
||||
<text class="unit" v-if="formItem.type == 'price'">元</text>
|
||||
<text class="unit" v-if="formItem.type == 'number' || formItem.type == 'day'">天</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="formItem.type == 'radio'">
|
||||
<view class="radio-flex">
|
||||
<view class="radio-title"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}</view>
|
||||
<radio-group @change="item.subVal[formItem.key] = $event.detail.value">
|
||||
<label class="radio-label" v-for="(radioItem, radioIndex) in formItem.options" :key="radioIndex">
|
||||
<radio class="radio-input" color="#446EFE" :checked="radioIndex === item.subVal[formItem.key]" :value="radioIndex"/>{{radioItem}}
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="formItem.type == 'checkbox'">
|
||||
<label class="block-item-label"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}(可多选)</label>
|
||||
<checkbox-group @change="item.subVal[formItem.key] = $event.detail.value">
|
||||
<label class="checkbox-item" v-for="(checkboxItem, checkboxIndex) in formItem.options">
|
||||
<checkbox class="checkbox-input" :value="checkboxIndex" color="#446EFE"></checkbox>{{checkboxItem}}
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</block>
|
||||
<block v-if="formItem.type == 'select'">
|
||||
<label class="block-item-label"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}</label>
|
||||
<picker :range="formItem.options" :value="item.subVal[formItem.key]" @change="item.subVal[formItem.key] = $event.detail.value">
|
||||
<view class="institution-picker">
|
||||
<view class="institution-picker-text nowrap" :class="{'institution-picker-gray': item.subVal[formItem.key] == 0}">{{formItem.options[item.subVal[formItem.key]]}}</view>
|
||||
<u-icon size="12" color="#999" name="arrow-down-fill"></u-icon>
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<block v-if="formItem.type == 'textarea'">
|
||||
<label class="block-item-label"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}</label>
|
||||
<textarea
|
||||
class="textarea"
|
||||
:placeholder="'请输入' + formItem.title"
|
||||
v-model="item.subVal[formItem.key]"
|
||||
></textarea>
|
||||
</block>
|
||||
<block v-if="formItem.type == 'text'">
|
||||
<label class="block-item-label"><text v-if="formItem.is_required == 1">*</text>{{formItem.title}}</label>
|
||||
<view class="inputs-flex">
|
||||
<input
|
||||
class="text-input"
|
||||
v-model="item.subVal[formItem.key]"
|
||||
:placeholder="'请输入' + formItem.title"
|
||||
>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="footer">
|
||||
<view class="footer-text">温馨提示:为了匹配最准确方案,请如实填写信息</view>
|
||||
<view class="footer-flex">
|
||||
<button @click="onAdd">添加新信息</button>
|
||||
<button @click="onSubmit">下一步</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 机构弹出层 -->
|
||||
<oct-mechanism-picker
|
||||
ref="institutionPicker"
|
||||
title="选择办理机构"
|
||||
:columns="columns"
|
||||
@choose="institutionChange"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { institution, business, institutionType, submitStore } from '@/apis/interfaces/offline.js';
|
||||
import { octpicker } from '@/components/oct-picker.vue'
|
||||
export default {
|
||||
components: { octpicker },
|
||||
data() {
|
||||
return {
|
||||
user : '',
|
||||
phone : '',
|
||||
columns : [],
|
||||
businessArr: [],
|
||||
serviceArr : [],
|
||||
old : {},
|
||||
cIndex : 0
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let { businessId, businessTitle } = this.$Route.query
|
||||
this.getInstitution(businessId, businessTitle)
|
||||
this.getBusiness()
|
||||
},
|
||||
methods: {
|
||||
// 显示选择机构
|
||||
onShowInstitution(e, item, index){
|
||||
this.columns = e
|
||||
this.old = item
|
||||
this.cIndex = index
|
||||
this.$refs.institutionPicker.open()
|
||||
},
|
||||
// 移出选项
|
||||
onRemove(index){
|
||||
this.serviceArr.splice(index, 1)
|
||||
},
|
||||
// 获取主业务
|
||||
getBusiness(){
|
||||
business().then(res => {
|
||||
this.businessArr = res
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取主业务机构
|
||||
getInstitution(businessId, businessTitle){
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
institution(businessId).then(institutionArr => {
|
||||
let forms = this.getForms(institutionArr[0].institution_id)
|
||||
forms.then(val => {
|
||||
this.servicePush( val, institutionArr, businessTitle, businessId )
|
||||
})
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取业务类型
|
||||
async getForms(businessId){
|
||||
return await institutionType(businessId)
|
||||
},
|
||||
// 组织业务表单数据
|
||||
servicePush( vals, institutionArr, businessTitle, businessId ){
|
||||
let fromType = [],
|
||||
fromsVal = {},
|
||||
froms = vals[0].params
|
||||
|
||||
fromType = vals.map((val) => {
|
||||
return {
|
||||
type_id: val.type_id,
|
||||
title : val.title
|
||||
}
|
||||
})
|
||||
froms.map(val => {
|
||||
if(val.type === 'checkbox'){
|
||||
fromsVal[val.key] = []
|
||||
}else if(val.type === 'select'){
|
||||
fromsVal[val.key] = 0
|
||||
}else {
|
||||
fromsVal[val.key] = ''
|
||||
}
|
||||
})
|
||||
// 新增卡片
|
||||
this.serviceArr.push({
|
||||
title : businessTitle,
|
||||
institution : institutionArr,
|
||||
allInstitution : vals,
|
||||
institutionIndex: 0,
|
||||
fromType : fromType,
|
||||
fromIndex : 0,
|
||||
froms : froms,
|
||||
subVal : {
|
||||
business_id : Number(businessId),
|
||||
institution_id : institutionArr[0].institution_id,
|
||||
type_id : fromType[0].type_id,
|
||||
...fromsVal
|
||||
}
|
||||
})
|
||||
},
|
||||
// 机构变更更新业务
|
||||
institutionChange(e){
|
||||
let index = this.cIndex
|
||||
let old = this.old
|
||||
let value = old.institution.findIndex(val => val.institution_id === e.val.institution_id);
|
||||
let businessId = old.subVal.business_id
|
||||
|
||||
// 获取机构的子业务类型
|
||||
let forms = this.getForms(old.institution[value].institution_id)
|
||||
forms.then(institutionVal => {
|
||||
let newObj = old
|
||||
let fromType = []
|
||||
let params = institutionVal[0].params
|
||||
let paramsVal = []
|
||||
|
||||
// 业务类型
|
||||
fromType = institutionVal.map(val => {
|
||||
return {
|
||||
type_id: val.type_id,
|
||||
title : val.title
|
||||
}
|
||||
})
|
||||
// 提交字段
|
||||
params.map(val => {
|
||||
if(val.type === 'checkbox'){
|
||||
paramsVal[val.key] = []
|
||||
}else if(val.type === 'select'){
|
||||
paramsVal[val.key] = 0
|
||||
}else {
|
||||
paramsVal[val.key] = ''
|
||||
}
|
||||
})
|
||||
// 更新数据
|
||||
newObj.allInstitution = institutionVal;
|
||||
newObj.institutionIndex = value;
|
||||
newObj.fromType = fromType;
|
||||
newObj.fromIndex = 0;
|
||||
newObj.froms = params;
|
||||
newObj.subVal = {
|
||||
business_id : old.subVal.business_id,
|
||||
institution_id : old.institution[value].institution_id,
|
||||
type_id : fromType[0].type_id,
|
||||
...paramsVal
|
||||
}
|
||||
this.$set(this.serviceArr, index, newObj)
|
||||
})
|
||||
},
|
||||
// 业务变更
|
||||
businessChange(e, old, index){
|
||||
let { value } = e.detail;
|
||||
let businessId = old.subVal.business_id;
|
||||
let allInstitution = old.allInstitution
|
||||
let newObj = old
|
||||
let params = allInstitution[value].params
|
||||
let paramsVal = {}
|
||||
params.map(val => {
|
||||
if(val.type === 'checkbox'){
|
||||
paramsVal[val.key] = []
|
||||
}else if(val.type === 'select'){
|
||||
paramsVal[val.key] = 0
|
||||
}else {
|
||||
paramsVal[val.key] = ''
|
||||
}
|
||||
})
|
||||
newObj.fromIndex = value;
|
||||
newObj.froms = params;
|
||||
newObj.subVal = {
|
||||
business_id : old.subVal.business_id,
|
||||
institution_id : old.subVal.institution_id,
|
||||
type_id : allInstitution[value].type_id,
|
||||
...paramsVal
|
||||
}
|
||||
this.$set(this.serviceArr, index, newObj)
|
||||
},
|
||||
// 添加主业务
|
||||
onAdd(){
|
||||
let businessTitle = this.businessArr.map(val => {
|
||||
return val.title
|
||||
})
|
||||
uni.showActionSheet({
|
||||
itemList: businessTitle,
|
||||
success : res=> {
|
||||
let { tapIndex } = res;
|
||||
this.getInstitution(this.businessArr[tapIndex].business_id, businessTitle[tapIndex])
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交订单数据
|
||||
onSubmit(){
|
||||
let dataVal = this.serviceArr.map(val => {
|
||||
return val.subVal
|
||||
})
|
||||
if(this.name == ''){
|
||||
uni.showToast({
|
||||
title: '请输入客户姓名',
|
||||
icon : 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(this.phone == ''){
|
||||
uni.showToast({
|
||||
title: '请输入客户手机号码',
|
||||
icon : 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
mask : true
|
||||
})
|
||||
submitStore({
|
||||
username: this.user,
|
||||
mobileNo: this.phone,
|
||||
data : dataVal,
|
||||
channel : 'app'
|
||||
}).then(res => {
|
||||
let { offline_order_id } = res;
|
||||
uni.hideLoading()
|
||||
this.$Router.replace({name: 'OfflineService', params: { orderId: offline_order_id }})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 260rpx;
|
||||
}
|
||||
// 表单模块
|
||||
.block{
|
||||
background: white;
|
||||
border-radius: $radius;
|
||||
margin: 0 30rpx 20rpx;
|
||||
padding: 30rpx;
|
||||
.block-title{
|
||||
font-weight: bold;
|
||||
line-height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.block-remove{
|
||||
background: rgba(68, 110, 254, .1);
|
||||
color: #446EFE;
|
||||
font-size: 28rpx;
|
||||
font-weight: normal;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 25rpx;
|
||||
padding: 0 25rpx 0 20rpx;
|
||||
&-icon{
|
||||
display: inline-block;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 5rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
.block-item{
|
||||
padding: 15rpx 0;
|
||||
&-label{
|
||||
padding-bottom: 10rpx;
|
||||
display: block;
|
||||
font-size: 30rpx;
|
||||
color: #111111;
|
||||
text{
|
||||
color: #FF0000;
|
||||
font-size: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
// picker
|
||||
.institution-picker{
|
||||
background: #F6F6F6;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 30rpx 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
&-text{
|
||||
width: calc( 100% - 60rpx );
|
||||
}
|
||||
&-gray{
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
// input
|
||||
.inputs-flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.input{
|
||||
background: #F6F6F6;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 30rpx 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: calc( 100% - 64rpx );
|
||||
}
|
||||
.unit{
|
||||
width: 64rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.text-input{
|
||||
background: #F6F6F6;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 30rpx 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
// radio
|
||||
.radio-flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10rpx 0;
|
||||
.radio-title{
|
||||
font-size: 30rpx;
|
||||
color: #111111;
|
||||
text{
|
||||
color: #FF0000;
|
||||
font-size: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.radio-label{
|
||||
margin-left: 20rpx;
|
||||
color: #999999;
|
||||
.radio-input{
|
||||
transform:scale(0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
// checkbox
|
||||
.checkbox-item{
|
||||
display: block;
|
||||
color: #999999;
|
||||
line-height: 70rpx;
|
||||
.checkbox-input{
|
||||
transform:scale(0.7);
|
||||
vertical-align: middle;
|
||||
margin-top: -5rpx;
|
||||
}
|
||||
}
|
||||
// textarea
|
||||
.textarea{
|
||||
background: #F6F6F6;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
// footer
|
||||
.footer{
|
||||
box-shadow: 0 0 10rpx 0 rgba(0, 0, 0, .05);
|
||||
background-color: white;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
padding: 30rpx 30rpx 70rpx;
|
||||
.footer-text{
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #FEA044;
|
||||
line-height: 40rpx;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
.footer-flex{
|
||||
display: flex;
|
||||
margin: 0 -10rpx;
|
||||
button{
|
||||
width: calc(50% - 20rpx);
|
||||
margin: 0 10rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: $radius-lg;
|
||||
font-size: 32rpx;
|
||||
border:solid 1rpx $main-color;
|
||||
background-color: white;
|
||||
color: $main-color;
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
&:last-child{
|
||||
background-color: $main-color;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
337
pages/offline/orderInfo.vue
Normal file
337
pages/offline/orderInfo.vue
Normal file
@@ -0,0 +1,337 @@
|
||||
<template>
|
||||
<view class="content" v-if="order_no != ''">
|
||||
<view class="order-header"></view>
|
||||
<!-- 订单主要信息 -->
|
||||
<view class="order-back order-flex order-info">
|
||||
<view class="order-state">{{statusText.text}}</view>
|
||||
<view class="order-item">
|
||||
<label>服务类型</label>
|
||||
<view class="order-value nowrap">
|
||||
<text class="order-type" v-for="(item, index) in item_type" :key="index" v-if="item.number > 0">{{item.title}}×{{item.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-items">
|
||||
<view class="order-items-flex" v-for="(item, index) in items" :key="index" @click="$Router.push({ name: 'OrderSchemes', params: { id: item.business_order_item_id }})">
|
||||
<label class="nowrap">{{item.institution.title}}({{item.business_type.title}})</label>
|
||||
<view class="order-items-type nowrap">¥{{item.price}}<uni-icons type="right" color="gray" size="14px"></uni-icons></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>欠款总金额</label>
|
||||
<view class="order-value order-value-price nowrap">¥{{serviceTotal}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单服务包信息 -->
|
||||
<view class="order-back order-flex" v-if="services.length > 0">
|
||||
<view class="order-title">服务包</view>
|
||||
<view class="order-serve">
|
||||
<block v-for="(item, index) in services" :key="index">
|
||||
<view class="serve-header">
|
||||
{{item.title}}<text>¥{{item.price}}</text>
|
||||
</view>
|
||||
<view class="serve-item" v-for="(citem, cindex) in item.items" :key="cindex">
|
||||
<view class="services-flex">
|
||||
<label class="services-flex-label nowrap">服务类型</label>
|
||||
<view class="services-flex-val nowrap">{{citem.business}}({{citem.type}})</view>
|
||||
</view>
|
||||
<view class="services-flex">
|
||||
<label class="services-flex-title nowrap">{{citem.title}}</label>
|
||||
<view class="services-flex-price nowrap"><text>¥</text>{{citem.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 客户信息 -->
|
||||
<view class="order-back order-flex">
|
||||
<view class="order-title">客户信息</view>
|
||||
<view class="order-item">
|
||||
<label>客户姓名</label>
|
||||
<view class="order-value nowrap">{{user.nickname || '-'}}</view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>客户性别</label>
|
||||
<view class="order-value nowrap">{{user.sex || '-'}}</view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>客户电话</label>
|
||||
<view class="order-value nowrap">{{user.username || '-'}}</view>
|
||||
</view>
|
||||
<view class="order-btn" @click="onCallPhone(user.username)">联系客户</view>
|
||||
</view>
|
||||
<!-- 老师与助理 -->
|
||||
<view class="order-back order-flex" v-if="statusText.value > 5">
|
||||
<view class="order-title">法务老师与助理</view>
|
||||
<view class="order-item">
|
||||
<label>法务老师</label>
|
||||
<view class="order-value nowrap">{{teachers || '-'}}</view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>法务助理</label>
|
||||
<view class="order-value nowrap">{{tutor || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单其他信息 -->
|
||||
<view class="order-back order-flex">
|
||||
<view class="order-title">订单信息</view>
|
||||
<view class="order-item" @click="copyNo(order_no)">
|
||||
<label>订单编号</label>
|
||||
<view class="order-value nowrap">{{order_no || '-'}}<u-icon class="order-value-icon" name="file-text" color="gray" size="18"></u-icon></view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>创建时间</label>
|
||||
<view class="order-value nowrap">{{created_at || '-'}}</view>
|
||||
</view>
|
||||
<view class="order-item">
|
||||
<label>订单金额</label>
|
||||
<view class="order-value nowrap">{{total || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { info } from '@/apis/interfaces/order.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId : '',
|
||||
total : '0.00',
|
||||
order_no : '',
|
||||
statusText : '',
|
||||
created_at : '',
|
||||
user : {
|
||||
nickname : '',
|
||||
sex : '',
|
||||
username : ''
|
||||
},
|
||||
item_type : [],
|
||||
items : [],
|
||||
services : [],
|
||||
serviceTotal: '',
|
||||
tutor : '',
|
||||
teachers : ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.orderId = this.$Route.query.orderId
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
// 订单详情
|
||||
getInfo(){
|
||||
info(this.orderId).then(res => {
|
||||
let { status, created_at, total, order_no, user, item_type, items, services, service_prices, tutor, teachers } = res
|
||||
this.statusText = status
|
||||
this.created_at = created_at
|
||||
this.total = total
|
||||
this.order_no = order_no
|
||||
this.user = user
|
||||
this.item_type = item_type
|
||||
this.items = items
|
||||
this.services = services
|
||||
this.serviceTotal = service_prices
|
||||
this.tutor = tutor
|
||||
this.teachers = teachers
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 刷新列表订单
|
||||
onRefreshOrder(){
|
||||
this.$store.commit('setOrderId', this.$Route.query.orderId)
|
||||
},
|
||||
// 拨打电话
|
||||
onCallPhone(phone){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone,
|
||||
fail: err => {
|
||||
uni.showToast({
|
||||
title: '拨打电话失败,请检查您的应用权限[电话]保持允许状态',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 复制订单号码
|
||||
copyNo(no){
|
||||
uni.setClipboardData({
|
||||
data : no,
|
||||
success : res => {
|
||||
uni.showToast({
|
||||
title: '订单号已复制',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// header
|
||||
.order-header{
|
||||
background: #446EFE;
|
||||
height: 150rpx;
|
||||
}
|
||||
// 订单块
|
||||
.order-back{
|
||||
background: white;
|
||||
border-radius: 20rpx;
|
||||
margin: 0 30rpx 30rpx;
|
||||
}
|
||||
// 订单信息
|
||||
.order-info{
|
||||
margin: -100rpx 30rpx 30rpx;
|
||||
.order-state{
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
margin: 0 -30rpx;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: solid 1rpx #f6f6f6;
|
||||
padding-bottom: 20rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 48rpx;
|
||||
}
|
||||
}
|
||||
// 订单列表
|
||||
.order-flex{
|
||||
padding: 20rpx 30rpx;
|
||||
.order-title{
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
// 订单信息
|
||||
.order-item{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
label{
|
||||
width: 200rpx;
|
||||
}
|
||||
.order-value{
|
||||
color: gray;
|
||||
width: calc(100% - 200rpx);
|
||||
text-align: right;
|
||||
.order-type{
|
||||
margin-right: 30rpx;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
&::after{
|
||||
position: absolute;
|
||||
content: "/";
|
||||
width: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
top: 0;
|
||||
right: -30rpx;
|
||||
}
|
||||
&:last-child{
|
||||
margin-right: 0;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.order-value-icon{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
&.order-value-price{
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 服务包信息
|
||||
.order-serve{
|
||||
background-color: rgba(68, 110, 254, .03);
|
||||
border-radius: 10rpx;
|
||||
margin: 15rpx 0;
|
||||
padding: 0 25rpx;
|
||||
.serve-header{
|
||||
display: flex;
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
justify-content: space-between;
|
||||
font-weight: bold;
|
||||
border-bottom: solid 1rpx #f6f6f6;
|
||||
text{
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
.serve-item{
|
||||
border-bottom: solid 1rpx #f6f6f6;
|
||||
padding: 20rpx 0;
|
||||
&:last-child{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.services-flex{
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
line-height: 55rpx;
|
||||
.services-flex-label{
|
||||
width: 150rpx;
|
||||
color: #111111;
|
||||
}
|
||||
.services-flex-val{
|
||||
width: calc(100% - 150rpx);
|
||||
text-align: right;
|
||||
color: gray;
|
||||
}
|
||||
.services-flex-title{
|
||||
width: 50%;
|
||||
color: #111111;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.services-flex-price{
|
||||
font-size: 30rpx;
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
color: #111111;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 订单服务项目
|
||||
.order-items{
|
||||
background-color: rgba(68, 110, 254, .03);
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
.order-items-flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
line-height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
label{
|
||||
width: 340rpx;
|
||||
}
|
||||
.order-items-type{
|
||||
width: calc(100% - 340rpx);
|
||||
text-align: right;
|
||||
color: gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 订单按钮
|
||||
.order-btn{
|
||||
margin: 0 -30rpx;
|
||||
padding: 20rpx 30rpx 0;
|
||||
border-top: solid 1rpx #f6f6f6;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: $main-color;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
352
pages/offline/orders.vue
Normal file
352
pages/offline/orders.vue
Normal file
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- tabs -->
|
||||
<u-sticky bgColor="#FFF" zIndex="9" >
|
||||
<u-tabs
|
||||
:current="tabsCurrent"
|
||||
:list="tabs"
|
||||
keyName="title"
|
||||
lineColor="#446EFE"
|
||||
:activeStyle="{
|
||||
color: '#111',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '32rpx'
|
||||
}"
|
||||
:inactiveStyle="{
|
||||
color: '#606266',
|
||||
fontSize: '30rpx'
|
||||
}"
|
||||
@click="onTabs"
|
||||
></u-tabs>
|
||||
</u-sticky>
|
||||
<!-- 订单管理列表 -->
|
||||
<view class="orders" v-if="orders.length > 0">
|
||||
<view class="orders-item" v-for="(item, index) in orders" :key="index">
|
||||
<view class="orders-flex">
|
||||
<view class="no nowrap" @click="copyNo(item.order_no)">{{item.order_no}}</view>
|
||||
<view class="state">{{item.status.text}}</view>
|
||||
</view>
|
||||
<view class="orders-content">
|
||||
<view class="orders-content-item orders-content-bottom" @click="item.is_show_type = !item.is_show_type">
|
||||
<label>业务数量</label>
|
||||
<view class="nowrap orders-content-type">
|
||||
<!-- <text v-for="(itemType, indexType) in item.item_type" :key="indexType" v-if="itemType.number > 0">{{itemType.title}}x{{itemType.number}}</text> -->
|
||||
x{{item.items.length}}
|
||||
</view>
|
||||
<uni-icons class="orders-content-icon" :type="item.is_show_type ? 'top': 'bottom'" size="14" color="gray"></uni-icons>
|
||||
</view>
|
||||
<view class="orders-content-block" v-show="item.is_show_type">
|
||||
<view class="item-flex" v-for="(citem, cindex) in item.items" :key="cindex">
|
||||
<view class="item-flex-title">{{citem.institution.title}}({{citem.business_type.title}})</view>
|
||||
<view class="item-flex-value">¥{{citem.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orders-content-item">
|
||||
<label>客户姓名</label>
|
||||
<view class="nowrap">{{item.user.username}}</view>
|
||||
</view>
|
||||
<view class="orders-content-item">
|
||||
<label>客户手机号</label>
|
||||
<view class="nowrap">{{item.user.mobile}}</view>
|
||||
</view>
|
||||
<view class="orders-content-item" v-if="item.total > 0">
|
||||
<label>咨询服务费</label>
|
||||
<view class="nowrap">¥{{item.total}}</view>
|
||||
</view>
|
||||
<view class="orders-content-item" v-if="item.diff_prices_pays > 0">
|
||||
<label>补差价金额</label>
|
||||
<view class="nowrap">¥{{item.diff_prices_pays}}</view>
|
||||
</view>
|
||||
<view class="orders-content-item">
|
||||
<label>下单时间</label>
|
||||
<view class="nowrap">{{item.created_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orders-flex">
|
||||
<view class="btns">
|
||||
<view class="btns-item btns-border" v-if="item.can.service" @click="onOrdersService(item.business_order_id)">匹配服务包</view>
|
||||
<view class="btns-item" @click="$Router.push({name: 'OfflineInfo', params: {orderId: item.business_order_id}})">查看订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分页 -->
|
||||
<u-loadmore v-if="pagesShow" :status="status" />
|
||||
</view>
|
||||
<!-- 订单是空的 -->
|
||||
<view class="order-null" v-else>
|
||||
<u-empty
|
||||
mode="order"
|
||||
icon="http://cdn.uviewui.com/uview/empty/order.png"
|
||||
text="暂无相关订单"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { lists } from '@/apis/interfaces/offline.js'
|
||||
import modal from 'uview-ui/libs/config/props/modal';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabsCurrent : 0,
|
||||
tabType : 0,
|
||||
tabs : [
|
||||
{ key: 'all', title: '全部' }
|
||||
],
|
||||
orders : [],
|
||||
// 分页
|
||||
page : {
|
||||
current : 1,
|
||||
has_more: false,
|
||||
},
|
||||
pagesShow : false,
|
||||
status : ''
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.tabType = 'all';
|
||||
this.getList()
|
||||
},
|
||||
onShow() {
|
||||
// 是否处理当前列表状态
|
||||
let isOrderId = this.$store.getters.getOrderId
|
||||
if(isOrderId != null){
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 切换列表
|
||||
onTabs(e){
|
||||
this.tabsCurrent = e.index
|
||||
this.tabType = this.tabs[e.index].key
|
||||
this.page = { current: 1, has_more: false }
|
||||
this.orders = []
|
||||
this.getList()
|
||||
},
|
||||
// 变更当前列表状态
|
||||
removeListVal(id){
|
||||
let ListArr = this.orders
|
||||
let ListIndex = ListArr.findIndex(val => val.business_order_id == id)
|
||||
if(ListIndex >= 0){
|
||||
this.orders.splice(ListIndex, 1)
|
||||
}
|
||||
this.$store.commit('setOrderId', null)
|
||||
},
|
||||
// 获取列表
|
||||
getList(){
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask : true
|
||||
})
|
||||
if(this.$store.getters.getOrderId != null){
|
||||
this.page = { current: 1, has_more: false }
|
||||
this.$store.commit('setOrderId', null)
|
||||
}
|
||||
lists({
|
||||
status: this.tabType,
|
||||
page : this.page.current
|
||||
}).then(res => {
|
||||
let { status, lists } = res;
|
||||
lists.data.map(val => {
|
||||
val.is_show_type = false
|
||||
})
|
||||
if(this.tabs.length <= 1){
|
||||
this.tabs = status
|
||||
}
|
||||
let atList = lists.page.current == 1 ? [] : this.orders
|
||||
this.orders = atList.concat(lists.data)
|
||||
this.page = lists.page
|
||||
this.pagesShow = false
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 匹配服务包
|
||||
onOrdersService(id){
|
||||
this.$Router.push({
|
||||
name: 'OfflineService',
|
||||
params: {
|
||||
orderId: id,
|
||||
},
|
||||
});
|
||||
this.getNextTab = true;
|
||||
},
|
||||
// 复制订单号码
|
||||
copyNo(no){
|
||||
uni.setClipboardData({
|
||||
data : no,
|
||||
success : res => {
|
||||
uni.showToast({
|
||||
title: '订单号已复制',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pagesShow = true;
|
||||
if(this.page.has_more){
|
||||
this.status = 'loading';
|
||||
this.page.current++
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
this.status = 'nomore';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 订单为空
|
||||
.order-null{
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
// 订单列表
|
||||
.orders{
|
||||
padding: 30rpx 0 10rpx;
|
||||
.orders-item{
|
||||
margin: 0 30rpx 20rpx;
|
||||
background-color: white;
|
||||
border-radius: $radius;
|
||||
}
|
||||
.orders-content{
|
||||
padding: 20rpx 30rpx;
|
||||
&-item{
|
||||
line-height: 70rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
color: #111111;
|
||||
label{
|
||||
color: #999999;
|
||||
}
|
||||
.orders-content-btn{
|
||||
color: $main-color;
|
||||
}
|
||||
&.orders-content-bottom{
|
||||
padding-right: 40rpx;
|
||||
position: relative;
|
||||
.orders-content-icon{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-type{
|
||||
text{
|
||||
margin-right: 30rpx;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
&::after{
|
||||
position: absolute;
|
||||
content: "/";
|
||||
width: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
top: 0;
|
||||
right: -30rpx;
|
||||
}
|
||||
&:last-child{
|
||||
margin-right: 0;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-block{
|
||||
background: rgba(68, 110, 254, .03);
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 10rpx 0;
|
||||
.item-flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.orders-flex{
|
||||
border-bottom: solid 1rpx #F6F6F6;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding: 20rpx $padding;
|
||||
&:last-child{
|
||||
border-top: solid 1rpx #F6F6F6;
|
||||
border-bottom: none;
|
||||
}
|
||||
.no{
|
||||
font-size: 30rpx;
|
||||
color: #111;
|
||||
line-height: 60rpx;
|
||||
width: calc(100% - 200rpx);
|
||||
}
|
||||
.state{
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
line-height: 60rpx;
|
||||
width: 200rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.user{
|
||||
padding-left: 90rpx;
|
||||
position: relative;
|
||||
min-height: 70rpx;
|
||||
box-sizing: border-box;
|
||||
width: calc(100% - 400rpx);
|
||||
.user-cover{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 50%;
|
||||
background: #ddd;
|
||||
}
|
||||
.user-name{
|
||||
line-height: 70rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.btns{
|
||||
width: 400rpx;
|
||||
text-align: right;
|
||||
.btns-item{
|
||||
display: inline-block;
|
||||
height: 70rpx;
|
||||
|
||||
line-height: 70rpx;
|
||||
background: $main-color;
|
||||
color: white;
|
||||
border-radius: 35rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
&.btns-border{
|
||||
line-height: 68rpx;
|
||||
box-sizing: border-box;
|
||||
border:solid 1rpx $main-color;
|
||||
background: white;
|
||||
color: $main-color;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
468
pages/offline/service.vue
Normal file
468
pages/offline/service.vue
Normal file
@@ -0,0 +1,468 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- 服务包列表 -->
|
||||
<view class="services">
|
||||
<view class="services-null" v-if="services.length <= 0">
|
||||
<u-empty
|
||||
mode="data"
|
||||
icon="http://cdn.uviewui.com/uview/empty/data.png"
|
||||
text="暂无添加服务包"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
<view class="services-list" v-else>
|
||||
<view class="services-item" v-for="(item, index) in services" :key="index">
|
||||
<view class="services-header">
|
||||
<view class="title">{{item.title}}<text>{{item.tag}}</text></view>
|
||||
<view class="remove" @click="onRemove(item, index)">移出</view>
|
||||
</view>
|
||||
<view class="services-content">
|
||||
<block v-for="(citem, cindex) in item.items" :key="cindex">
|
||||
<view class="services-content-item">
|
||||
<view class="services-flex">
|
||||
<label class="services-flex-label nowrap">服务类型</label>
|
||||
<view class="services-flex-val nowrap">{{citem.business}}({{citem.type}})</view>
|
||||
</view>
|
||||
<view class="services-flex">
|
||||
<label class="services-flex-title nowrap">{{citem.title}}</label>
|
||||
<view class="services-flex-price nowrap"><text>¥</text>{{citem.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="services-price">服务包价格<text>¥{{item.price}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 选择业务 -->
|
||||
<u-popup :show="institutionsShow" round="20rpx" closeable @close="institutionsShow = false, itemsVal = []">
|
||||
<view class="institutions">
|
||||
<view class="institutions-title">选择业务</view>
|
||||
<scroll-view scroll-y class="institutions-scroll">
|
||||
<view class="institutions-lists" v-if="institutions.length > 0">
|
||||
<view class="institutions-block" :class="{ 'active': item.isChoose }" v-for="(item, index) in institutions" :key="index" @click="onInstitution(item, index)">
|
||||
<view class="institutions-block-item">
|
||||
<label>业务类型</label>
|
||||
<view class="val nowrap">{{item.business}}({{item.type}})</view>
|
||||
</view>
|
||||
<view class="institutions-block-item">
|
||||
<label>业务机构</label>
|
||||
<view class="val nowrap">{{item.title}}</view>
|
||||
</view>
|
||||
<view class="institutions-block-item">
|
||||
<label>金额</label>
|
||||
<view class="val price nowrap">¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="institutions-null">
|
||||
<u-empty
|
||||
mode="list"
|
||||
icon="http://cdn.uviewui.com/uview/empty/list.png"
|
||||
text="暂无可分配的业务"
|
||||
>
|
||||
</u-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="institutions-footer">
|
||||
<button class="btn" @click="onAddService" :disabled="itemsVal.length <= 0">选好了({{itemsVal.length}})</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- footer -->
|
||||
<view class="footer">
|
||||
<view class="footer-total">共{{services.length}}个服务包,总价格<text>{{total}}</text>元</view>
|
||||
<button class="footer-btn" :disabled="services.length <= 0" @click="onServiceOver">保存配置服务包</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { service, serviceAdd, serviceRemove, serviceOver } from '@/apis/interfaces/offline.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
total : '0.00',
|
||||
orderId : '',
|
||||
institutions : [],
|
||||
services : [],
|
||||
itemsVal : [],
|
||||
institutionsShow: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.orderId = this.$Route.query.orderId
|
||||
// 开始配置服务包
|
||||
this.getService()
|
||||
},
|
||||
methods: {
|
||||
// 获取业务
|
||||
getService(){
|
||||
service(this.orderId).then(res => {
|
||||
let { institutions, services, total } = res;
|
||||
this.institutions = institutions.map(val => {
|
||||
val.isChoose = false
|
||||
return val;
|
||||
})
|
||||
this.total = total;
|
||||
this.services = services;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 选择业务
|
||||
onInstitution(val, index){
|
||||
let idIndex = this.itemsVal.findIndex(e => e === val.item_id)
|
||||
if(idIndex >= 0){
|
||||
val.isChoose = !val.isChoose;
|
||||
this.itemsVal.splice(idIndex, 1)
|
||||
this.$set(this.institutions, index, val)
|
||||
return
|
||||
}
|
||||
if(idIndex < 0 && this.itemsVal.length <= 2){
|
||||
val.isChoose = !val.isChoose;
|
||||
this.itemsVal.push(val.item_id)
|
||||
this.$set(this.institutions, index, val)
|
||||
return
|
||||
}
|
||||
uni.showToast({
|
||||
title: '单一服务包业务数量不可以超过3项',
|
||||
icon : 'none'
|
||||
})
|
||||
},
|
||||
// 新增服务包
|
||||
onAddService(){
|
||||
serviceAdd(this.orderId, this.itemsVal).then(res => {
|
||||
let { institutions, services, total } = res;
|
||||
this.institutions = institutions.map(val => {
|
||||
val.isChoose = false
|
||||
return val;
|
||||
});
|
||||
this.total = total;
|
||||
this.services = services
|
||||
this.itemsVal = []
|
||||
this.institutionsShow = false
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 删除服务包
|
||||
onRemove(val, index){
|
||||
serviceRemove(this.orderId, {
|
||||
group_no: val.group_no
|
||||
} ).then(res => {
|
||||
let { institutions, services, total } = res;
|
||||
this.institutions = institutions.map(val => {
|
||||
val.isChoose = false
|
||||
return val;
|
||||
});
|
||||
this.total = total;
|
||||
this.services = services;
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存配置服务包
|
||||
onServiceOver(){
|
||||
if(this.institutions.length > 0){
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '当前还有' + this.institutions.length + '项业务未匹配服务包,是否放弃未匹配的业务继续保存服务包?',
|
||||
cancelText : '继续配置',
|
||||
cancelColor : '#FFAB3F',
|
||||
confirmText : '立即保存',
|
||||
confirmColor: '#446EFE',
|
||||
success : res => {
|
||||
if(res.confirm){
|
||||
this.onSubmitService()
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
this.onSubmitService()
|
||||
},
|
||||
// 提交保存服务
|
||||
onSubmitService(){
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '是否确认提交服务包配置给客户,提交后不可修改',
|
||||
cancelText : '稍后',
|
||||
confirmText : '提交',
|
||||
success : ModalRes => {
|
||||
if(ModalRes.confirm){
|
||||
wx.showLoading({
|
||||
title: '保存中...',
|
||||
mask : true
|
||||
})
|
||||
serviceOver(this.orderId).then(res => {
|
||||
uni.showModal({
|
||||
content : res.message,
|
||||
showCancel : false,
|
||||
confirmColor: '#446EFE',
|
||||
success : res => {
|
||||
if(res.confirm){
|
||||
this.$store.commit('setOrderId', this.orderId)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
this.institutionsShow = true
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 服务包列表
|
||||
.services{
|
||||
padding-bottom: 250rpx;
|
||||
box-sizing: border-box;
|
||||
.services-null{
|
||||
height: 70vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
// 服务包列表
|
||||
.services-list{
|
||||
padding: 10rpx 30rpx;
|
||||
.services-item{
|
||||
background: white;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
margin: 30rpx 0;
|
||||
.services-header{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 20rpx;
|
||||
.title{
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #111;
|
||||
width: calc(100% - 150rpx);
|
||||
text{
|
||||
background: $main-color;
|
||||
color: white;
|
||||
font-weight: normal;
|
||||
font-size: 26rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
margin-left: 10rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
.remove{
|
||||
background: rgba(68, 110, 254, .1);
|
||||
color: #446EFE;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
width: 100rpx;
|
||||
border-radius: 25rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.services-content{
|
||||
background-color: rgba(68, 110, 254, .03);
|
||||
border-radius: 10rpx;
|
||||
margin: 15rpx 0;
|
||||
padding: 0 25rpx;
|
||||
.services-content-item{
|
||||
border-bottom: solid 1rpx #f6f6f6;
|
||||
padding: 20rpx 0;
|
||||
&:last-child{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.services-flex{
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
line-height: 55rpx;
|
||||
.services-flex-label{
|
||||
width: 150rpx;
|
||||
color: #111111;
|
||||
}
|
||||
.services-flex-val{
|
||||
width: calc(100% - 150rpx);
|
||||
text-align: right;
|
||||
color: gray;
|
||||
}
|
||||
.services-flex-title{
|
||||
width: 50%;
|
||||
color: #111111;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.services-flex-price{
|
||||
font-size: 30rpx;
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
color: #111111;
|
||||
}
|
||||
}
|
||||
}
|
||||
.services-price{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
color: gray;
|
||||
line-height: 60rpx;
|
||||
text{
|
||||
color: $text-price;
|
||||
font-weight: bold;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 添加服务包
|
||||
.institutions{
|
||||
padding: 0 0 180rpx;
|
||||
position: relative;
|
||||
// 标题
|
||||
.institutions-title{
|
||||
padding: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
// 列表
|
||||
.institutions-scroll{
|
||||
height: 65vh;
|
||||
.institutions-null{
|
||||
height: 50vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.institutions-lists{
|
||||
padding: 15rpx 0;
|
||||
.institutions-block{
|
||||
margin: 15rpx 30rpx;
|
||||
background: #f8f8f8;
|
||||
padding: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
border:solid 1rpx #f8f8f8;
|
||||
box-sizing: border-box;
|
||||
.institutions-block-item{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 50rpx;
|
||||
font-size: 30rpx;
|
||||
label{
|
||||
color: gray;
|
||||
width: 200rpx;
|
||||
}
|
||||
.val{
|
||||
width: calc(100% - 200rpx);
|
||||
text-align: right;
|
||||
&.price{
|
||||
color: $text-price;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.active{
|
||||
background-color: #E4E8F7;
|
||||
border-color: $main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// footer
|
||||
.institutions-footer{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
.btn{
|
||||
background: $main-color;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
color: white;
|
||||
font-size: 32rpx;
|
||||
border-radius: $radius-lg;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
&[disabled]{
|
||||
background-color: $main-color;
|
||||
color: white;
|
||||
opacity: .7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// footer
|
||||
.footer{
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
background: white;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, .02);
|
||||
.footer-total{
|
||||
padding-bottom: 30rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: gray;
|
||||
line-height: 40rpx;
|
||||
text{
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
.footer-btn{
|
||||
background: $main-color;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
color: white;
|
||||
font-size: 32rpx;
|
||||
border-radius: $radius-lg;
|
||||
&::after{
|
||||
display: none;
|
||||
}
|
||||
.icon{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
&[disabled]{
|
||||
background-color: $main-color;
|
||||
color: white;
|
||||
opacity: .7;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -125,6 +125,10 @@
|
||||
<view class="number" v-if="orderCount.refund > 0">{{orderCount.refund}}</view>
|
||||
<view class="text">退款订单</view>
|
||||
</view>
|
||||
<view class="tool-flex-item" @click="onNav('OfflineOrders')">
|
||||
<image class="icon" src="@/static/icons/work_icon_28.png"></image>
|
||||
<view class="text">线下订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -65,8 +65,7 @@
|
||||
Promise.all([business(), synthList()]).then(res => {
|
||||
let businessData = res[0]
|
||||
let synthListData = res[1]
|
||||
|
||||
this.businessArr = this.createType === 'other' ? businessData : businessData.concat(synthListData)
|
||||
this.businessArr = this.createType === 'other' || this.createType === 'offline' ? businessData : businessData.concat(synthListData)
|
||||
this.businessId = this.businessArr[0].business_id
|
||||
this.selfType = this.businessArr[0].self_type
|
||||
}).catch(err => {
|
||||
@@ -128,8 +127,8 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
// 金法业务
|
||||
let busines = this.businessArr.find(val => val.business_id === this.businessId)
|
||||
// 金法业务
|
||||
this.$Router.replace({
|
||||
name : 'WorkGenerate',
|
||||
params : {
|
||||
|
||||
@@ -233,11 +233,21 @@
|
||||
// 创建订单
|
||||
onCreateOrder(){
|
||||
uni.showActionSheet({
|
||||
itemList: ['个人订单', '客户订单'],
|
||||
itemList: ['线下订单','个人订单', '客户订单'],
|
||||
success : res => {
|
||||
this.onNav('OrderCreate', {
|
||||
type: res.tapIndex === 0 ? 'self' : 'other'
|
||||
})
|
||||
switch (res.tapIndex){
|
||||
case 0:
|
||||
this.onNav('OfflineCreate')
|
||||
break;
|
||||
case 1:
|
||||
this.onNav('OrderCreate', { type: 'self' })
|
||||
break;
|
||||
case 2:
|
||||
this.onNav('OrderCreate', { type: 'other' })
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
BIN
static/icons/work_icon_28.png
Normal file
BIN
static/icons/work_icon_28.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Reference in New Issue
Block a user