|
|
@@ -20,9 +20,29 @@
|
|
|
</view>
|
|
|
</u-grid-item>
|
|
|
</u-grid>
|
|
|
-<!-- <view class="serobReminder">-->
|
|
|
-<!-- <text>同一服务对象在同一时间只能有一个服务订单</text>-->
|
|
|
-<!-- </view>-->
|
|
|
+ </view>
|
|
|
+ <view class="flex-col group" v-for="(item,index) in orderParam.childService">
|
|
|
+ <view class="flex-row ">
|
|
|
+ <image class="selectSerobImg" mode="aspectFill" :src="item.facePhotoUrl || '/static/me/ud4.png'"></image>
|
|
|
+ <text class="selectSerobName">{{item.nickName || '未填写'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="serob" >
|
|
|
+ <text>服务时段以及服务费用</text>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <u-grid :border="false" col="5">
|
|
|
+ <u-grid-item v-if="item2.total > 0" v-for="(item2,index2) in item.periodTimeList" :key="index2">
|
|
|
+ <view class="flex-col justify-center timeItem " :class="{selectBack: item2.select}" @click="selectServiceTime(item.periodTimeList,index,index2)">
|
|
|
+ <view class="flex-row justify-center">
|
|
|
+ <text class="time">{{item2.label}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex-row justify-center">
|
|
|
+ <text class="price">¥{{item2.price}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-grid-item>
|
|
|
+ </u-grid>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<view class="flex-col group ">
|
|
|
@@ -42,9 +62,9 @@
|
|
|
<text>4.服务费用到店享受相应服务以后在另行收取。</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
-<!-- <view class="tabBarLineHeight "></view>-->
|
|
|
+ <view class="tabBarLineHeight "></view>
|
|
|
<view class="tabBarView">
|
|
|
- <view class="submitButton " @click="commonGeneralOrder">提交</view>
|
|
|
+ <view class="submitButton " @click="openSetting">提交</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
@@ -57,6 +77,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ periodTimeList:[],
|
|
|
userInfo: {},
|
|
|
store: {},
|
|
|
serviceObjectList: [],
|
|
|
@@ -93,43 +114,56 @@
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
|
- // 服务对象
|
|
|
- this.listServiceObject()
|
|
|
+ this.getServicePersonTime()
|
|
|
+ this.getTemplateList()
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
+ selectServiceTime(items,index,index2){
|
|
|
+ items.forEach(e=>{
|
|
|
+ e.select=false
|
|
|
+ })
|
|
|
+ let oidTime = this.orderParam.childService[index].serviceStartTime
|
|
|
+ items[index2].select =true // 新选中的时间
|
|
|
+ this.orderParam.childService[index].serviceStartTime = items[index2].label
|
|
|
+ for (let i=0;i<this.orderParam.childService.length;i++){
|
|
|
+ if (index != i){
|
|
|
+ for (const time of this.orderParam.childService[i].periodTimeList) {
|
|
|
+ if (time.label == oidTime){
|
|
|
+ console.log('++++++++++++++++++++',oidTime)
|
|
|
+ time.total = time.total + 1
|
|
|
+ }
|
|
|
+ if (time.label == items[index2].label) {
|
|
|
+ console.log('------------------', items[index2].label)
|
|
|
+ time.total = time.total - 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+
|
|
|
// 查询服务对接信息列表
|
|
|
listServiceObject() {
|
|
|
this.$api.listServiceObject(this.reqParm).then((res) => {
|
|
|
console.log(res)
|
|
|
this.serviceObjectList = res.data.data
|
|
|
this.getImgUrlByBannerOssId(this.serviceObjectList);
|
|
|
-
|
|
|
- if (this.orderParam.childService.length === 0) {
|
|
|
- let selectServiceObject = this.serviceObjectList[0]
|
|
|
- this.serviceObjectList[0].select = true
|
|
|
-
|
|
|
- let childService = {
|
|
|
- periodDate: '',
|
|
|
- serviceObjectId: selectServiceObject.id,
|
|
|
- facePhotoUrl: selectServiceObject.facePhotoUrl,
|
|
|
- nickName: selectServiceObject.nickName,
|
|
|
- serviceUserId: -1,
|
|
|
- fee: '',
|
|
|
- serviceStartTime: '',
|
|
|
- }
|
|
|
- this.orderParam.childService.push(childService)
|
|
|
- } else {
|
|
|
- for (let selectServiceObject of this.orderParam.childService) {
|
|
|
- for (let serviceObject of this.serviceObjectList) {
|
|
|
- if (selectServiceObject.id === serviceObject.id) {
|
|
|
- serviceObject.select = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.orderParam.childService = [],
|
|
|
+ this.serviceObjectList[0].select = true
|
|
|
+ let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
|
|
|
+ let childService = {
|
|
|
+ periodDate: '',
|
|
|
+ serviceObjectId: this.serviceObjectList[0].id,
|
|
|
+ facePhotoUrl: this.serviceObjectList[0].facePhotoUrl,
|
|
|
+ nickName: this.serviceObjectList[0].nickName,
|
|
|
+ serviceUserId: -1,
|
|
|
+ fee: '',
|
|
|
+ serviceStartTime: periodTimeList[0].label,
|
|
|
+ periodTimeList:periodTimeList
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ periodTimeList[0].select = true
|
|
|
+ this.orderParam.childService.push(childService)
|
|
|
})
|
|
|
},
|
|
|
// 获取图片
|
|
|
@@ -155,12 +189,33 @@
|
|
|
url: '/myPages/ServiceObjectManagement/index'
|
|
|
})
|
|
|
},
|
|
|
+ getServicePersonTime(){
|
|
|
+ this.$api.getServicePersonTime({
|
|
|
+ personId: -1,
|
|
|
+ date: this.orderParam.serviceDate,
|
|
|
+ storeId:this.store.storeId
|
|
|
+ }).then(res=>{
|
|
|
+ console.log("++++++++++++++++++res++++++++++++++++++++",res)
|
|
|
+ this.periodTimeList = res.data.data
|
|
|
+ // 服务对象
|
|
|
+ this.listServiceObject()
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
selectServiceObject(item) {
|
|
|
if (item.select) {
|
|
|
this.orderParam.childService = this.orderParam.childService.filter(selectServiceObject =>
|
|
|
selectServiceObject.serviceObjectId !== item.id)
|
|
|
} else {
|
|
|
+ let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
|
|
|
+ periodTimeList.forEach(i=>{
|
|
|
+ this.orderParam.childService.forEach(i1=>{
|
|
|
+ if (i.label == i1.serviceStartTime){
|
|
|
+ i.total = i.total -1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
let childService = {
|
|
|
periodDate: '',
|
|
|
serviceObjectId: item.id,
|
|
|
@@ -169,9 +224,25 @@
|
|
|
serviceUserId: -1,
|
|
|
fee: '',
|
|
|
serviceStartTime: '',
|
|
|
+ periodTimeList:periodTimeList
|
|
|
+ }
|
|
|
+ for (const time of periodTimeList) {
|
|
|
+ if (time.total>0){
|
|
|
+ time.select = true
|
|
|
+ childService.serviceStartTime = time.label
|
|
|
+
|
|
|
+ for (const childService of this.orderParam.childService) {
|
|
|
+ for (const periodTime of childService.periodTimeList) {
|
|
|
+ if (time.label == periodTime.label) {
|
|
|
+ periodTime.total = periodTime.total - 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
- this.orderParam.childService.push(childService)
|
|
|
|
|
|
+ this.orderParam.childService.push(childService)
|
|
|
}
|
|
|
item.select = !item.select
|
|
|
this.price = 0
|
|
|
@@ -180,7 +251,33 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ getTemplateList(){
|
|
|
+ this.$api.getTemplateList().then(res=>{
|
|
|
+ this.templateId=res.data.data.data.map(item=>{
|
|
|
+ return item.priTmplId
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
+ openSetting(){
|
|
|
+ uni.requestSubscribeMessage({
|
|
|
+ tmplIds: this.templateId,
|
|
|
+ success: (res) =>{
|
|
|
+ let {errMsg,...param} = res
|
|
|
+ console.log('+++++++++++++success+++++++++++++',param)
|
|
|
+ this.$api.updateSubscribe(param).then(res=>{
|
|
|
+ console.log('+++++++++++++updateSubscribe+++++++++++++',res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail:(err)=>{
|
|
|
+ console.log('+++++++++++++fail+++++++++++++',err)
|
|
|
+ },
|
|
|
+ complete:(complete)=>{
|
|
|
+ console.log('+++++++++++++complete+++++++++++++',complete)
|
|
|
+ this.commonGeneralOrder()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
commonGeneralOrder() {
|
|
|
if (!this.orderParam.childService.length) {
|