|
@@ -89,9 +89,12 @@
|
|
|
<!-- 预约 -->
|
|
<!-- 预约 -->
|
|
|
<its-calendar :sta_num="start_time" :end_num="end_time" :int_num="30" @getTime="getTime"></its-calendar>
|
|
<its-calendar :sta_num="start_time" :end_num="end_time" :int_num="30" @getTime="getTime"></its-calendar>
|
|
|
<!-- 指派 -->
|
|
<!-- 指派 -->
|
|
|
- <scroll-view scroll-x="true" class="zp-wrap" v-if="timed">
|
|
|
|
|
|
|
+ <!-- <scroll-view scroll-x="true" class="zp-wrap" v-if="timed"> -->
|
|
|
|
|
+ <scroll-view scroll-x="true" class="zp-wrap" @scrolltolower="">
|
|
|
|
|
+ <!-- <view class="zp-item" v-for="ygitem in yg.list" @click="choosYg(ygitem)"
|
|
|
|
|
+ :class="{'choose': ygitem.uid == choose_yg.uid}"> -->
|
|
|
<view class="zp-item" v-for="ygitem in yg.list" @click="choosYg(ygitem)"
|
|
<view class="zp-item" v-for="ygitem in yg.list" @click="choosYg(ygitem)"
|
|
|
- :class="{'choose': ygitem.uid == choose_yg.uid}">
|
|
|
|
|
|
|
+ :class="{'choose': ygitem.id == choose_yg.id}">
|
|
|
<image :src="ygitem.avatar || '../../static/img/avt.png'" mode="" class="zp-logo"></image>
|
|
<image :src="ygitem.avatar || '../../static/img/avt.png'" mode="" class="zp-logo"></image>
|
|
|
<view class="zp-name">{{ygitem.staffName}}</view>
|
|
<view class="zp-name">{{ygitem.staffName}}</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -222,11 +225,11 @@
|
|
|
}
|
|
}
|
|
|
if (this.choose_time != '') {
|
|
if (this.choose_time != '') {
|
|
|
console.log(this.choose_time, 'this.choose_time ')
|
|
console.log(this.choose_time, 'this.choose_time ')
|
|
|
- this.getYgList('reload')
|
|
|
|
|
|
|
+ // this.getYgList('reload')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
choose_time(newval, oldval) {
|
|
choose_time(newval, oldval) {
|
|
|
- this.getYgList('reload')
|
|
|
|
|
|
|
+ // this.getYgList('reload')
|
|
|
},
|
|
},
|
|
|
choose_yg(newval, oldval) {
|
|
choose_yg(newval, oldval) {
|
|
|
if (newval.staffName && newval.uid != 0) {
|
|
if (newval.staffName && newval.uid != 0) {
|
|
@@ -251,6 +254,7 @@
|
|
|
this.calculation()
|
|
this.calculation()
|
|
|
console.log(this.$store.state.locationObj, 'this.$store.state.locationObj')
|
|
console.log(this.$store.state.locationObj, 'this.$store.state.locationObj')
|
|
|
this.getStoreList()
|
|
this.getStoreList()
|
|
|
|
|
+ this.getAllygList()
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
console.log(this.customerData)
|
|
console.log(this.customerData)
|
|
@@ -262,6 +266,23 @@
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getAllygList() {
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ that.$u.api.getAllygList({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ pageSize: 100
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ let arr0 = res.data.filter(item => item.is_technician == 1)
|
|
|
|
|
+ let arr = [{
|
|
|
|
|
+ uid: 0,
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ staffName: '随机指派'
|
|
|
|
|
+ }]
|
|
|
|
|
+ that.yg.list = arr.concat(arr0)
|
|
|
|
|
+ // console.log();
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
close() {
|
|
close() {
|
|
|
this.store_choose_show = false
|
|
this.store_choose_show = false
|
|
|
},
|
|
},
|
|
@@ -352,11 +373,14 @@
|
|
|
}
|
|
}
|
|
|
item.loadingType = 'loading'
|
|
item.loadingType = 'loading'
|
|
|
this.$u.api.getTimeYgList({
|
|
this.$u.api.getTimeYgList({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ pageSize:100,
|
|
|
time: this.choose_time,
|
|
time: this.choose_time,
|
|
|
'SHOP-TOKEN': this.choose_store.token
|
|
'SHOP-TOKEN': this.choose_store.token
|
|
|
}).then(({
|
|
}).then(({
|
|
|
data
|
|
data
|
|
|
}) => {
|
|
}) => {
|
|
|
|
|
+ console.log(data,'data');
|
|
|
let arr = [{
|
|
let arr = [{
|
|
|
uid: 0,
|
|
uid: 0,
|
|
|
staffName: '随机指派'
|
|
staffName: '随机指派'
|
|
@@ -400,36 +424,37 @@
|
|
|
}).then(({
|
|
}).then(({
|
|
|
data
|
|
data
|
|
|
}) => {
|
|
}) => {
|
|
|
- console.log(data,'data')
|
|
|
|
|
- let choose_time = that.choose_time_detail.replace(/\:/g, '')
|
|
|
|
|
- if(this.isJson(data.time_slot)) {
|
|
|
|
|
- data.time_slot = JSON.parse(data.time_slot)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.canpay = true
|
|
|
|
|
+ // console.log(data,'data')
|
|
|
|
|
+ // let choose_time = that.choose_time_detail.replace(/\:/g, '')
|
|
|
|
|
+ // if(this.isJson(data.time_slot)) {
|
|
|
|
|
+ // data.time_slot = JSON.parse(data.time_slot)
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- for(let j = 0;j<data.time_slot.length;j++) {
|
|
|
|
|
- let worktime = [data.time_slot[j][0].replace(/\:/g, ''), data.time_slot[j][1].replace(/\:/g,
|
|
|
|
|
- '')]
|
|
|
|
|
- // 判断员工是否在工作时间
|
|
|
|
|
- console.log(choose_time, worktime)
|
|
|
|
|
- if (choose_time * 1 >= worktime[0] * 1 && choose_time * 1 <= worktime[1] * 1) {
|
|
|
|
|
- this.canpay = true
|
|
|
|
|
- console.log('可以预约');
|
|
|
|
|
- break
|
|
|
|
|
- } else {
|
|
|
|
|
- if(j == data.time_slot.length) {
|
|
|
|
|
- that.cannot()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // for(let j = 0;j<data.time_slot.length;j++) {
|
|
|
|
|
+ // let worktime = [data.time_slot[j][0].replace(/\:/g, ''), data.time_slot[j][1].replace(/\:/g,
|
|
|
|
|
+ // '')]
|
|
|
|
|
+ // // 判断员工是否在工作时间
|
|
|
|
|
+ // console.log(choose_time, worktime)
|
|
|
|
|
+ // if (choose_time * 1 >= worktime[0] * 1 && choose_time * 1 <= worktime[1] * 1) {
|
|
|
|
|
+ // this.canpay = true
|
|
|
|
|
+ // console.log('可以预约');
|
|
|
|
|
+ // break
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // if(j == data.time_slot.length) {
|
|
|
|
|
+ // that.cannot()
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- if (data.reserved && data.reserved.length > 0) {
|
|
|
|
|
- for (let i = 0; i < data.reserved.length; i++) {
|
|
|
|
|
- if (j== data.time_slot.length && that.choose_time_detail == data.reserved[i]) {
|
|
|
|
|
- that.cannot('该员工已有预约')
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (data.reserved && data.reserved.length > 0) {
|
|
|
|
|
+ // for (let i = 0; i < data.reserved.length; i++) {
|
|
|
|
|
+ // if (j== data.time_slot.length && that.choose_time_detail == data.reserved[i]) {
|
|
|
|
|
+ // that.cannot('该员工已有预约')
|
|
|
|
|
+ // break
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -453,7 +478,7 @@
|
|
|
that.$u.api.createItemOrder({
|
|
that.$u.api.createItemOrder({
|
|
|
"order_id": that.order_detail.order_id,
|
|
"order_id": that.order_detail.order_id,
|
|
|
"time": that.choose_time + ' ' + that.choose_time_detail, //预约时间
|
|
"time": that.choose_time + ' ' + that.choose_time_detail, //预约时间
|
|
|
- "staff_id": that.choose_yg.uid, //0随机排员工 指定员工传入员工id
|
|
|
|
|
|
|
+ "staff_id": that.choose_yg.id, //0随机排员工 指定员工传入员工id
|
|
|
"pay_type": 2, //1余额2微信3支付宝
|
|
"pay_type": 2, //1余额2微信3支付宝
|
|
|
"source": 3, //微信8h5支付3小程序支付0app支付
|
|
"source": 3, //微信8h5支付3小程序支付0app支付
|
|
|
"remarks": that.mjly, //备注
|
|
"remarks": that.mjly, //备注
|
|
@@ -474,7 +499,7 @@
|
|
|
that.$u.api.createItemOrder({
|
|
that.$u.api.createItemOrder({
|
|
|
"order_id": that.order_detail.order_id,
|
|
"order_id": that.order_detail.order_id,
|
|
|
"time": that.choose_time + ' ' + that.choose_time_detail, //预约时间
|
|
"time": that.choose_time + ' ' + that.choose_time_detail, //预约时间
|
|
|
- "staff_id": that.choose_yg.uid, //0随机排员工 指定员工传入员工id
|
|
|
|
|
|
|
+ "staff_id": that.choose_yg.id, //0随机排员工 指定员工传入员工id
|
|
|
"pay_type": that.pay_type, //1余额2微信3支付宝
|
|
"pay_type": that.pay_type, //1余额2微信3支付宝
|
|
|
"source": that.pay_type == 2 ? 3 : '',
|
|
"source": that.pay_type == 2 ? 3 : '',
|
|
|
"remarks": that.mjly, //备注
|
|
"remarks": that.mjly, //备注
|