master
xy 3 years ago
parent 02dca4290c
commit 346d7e047f

@ -273,7 +273,7 @@ export default {
width: 180
},
{
prop:'customer_address.name',
prop:'customer_address.address',
label:'上门地址',
minWidth:220,
align:'left'

@ -101,6 +101,7 @@
<timeSelect
ref="timeSelect"
@refresh="()=>{getCustomer();$emit('refresh')}"
:flag="flag"
:is-show.sync="isShowTime"
:skus="detail.product_type.product_skus"
:addresses="addresses"
@ -137,6 +138,7 @@ export default {
},
data() {
return {
flag:false,//
nurseId:'',
productId: '',
isShow: false,
@ -191,14 +193,18 @@ export default {
},
async getCustomer() {
const res = await customerDetail({
id: this.id
})
console.log(res)
this.detail = res.detail
try{
const res = await customerDetail({
id: this.id
})
this.flag = true
this.detail = res.detail
if(this.detail.product?.service_rule === 2 && this.detail.schedule && this.detail.schedule.length > 0){
this.nurseId = this.detail.schedule[0]?.nurse_id
if(this.detail.product?.service_rule === 2 && this.detail.schedule && this.detail.schedule.length > 0){
this.nurseId = this.detail.schedule.at(-1)?.nurse_id
}
}catch (err){
this.flag = false
}
},

@ -85,6 +85,10 @@ import {scheduleDelete, scheduleSave} from '@/api/schedule'
export default {
props: {
flag:{
type:Boolean,
default:false
},//
customerId: [Number, String],
orderId: [Number, String],
productId: [Number, String],
@ -244,24 +248,26 @@ export default {
},
submit() {
this.form.customer_id = this.customerId
this.form.product_id = this.productId
this.form.order_id = this.orderId
let temp = this.form.schedule_list_skus.map(item => {
return {sku_id: item}
})
this.form.schedule_list_skus = temp
this.$refs['elForm'].validate().then(valid => {
if (valid) {
scheduleSave(this.form).then(res => {
this.$successMessage('add', '排班')
this.$emit('update:isShow', false)
this.$emit('refresh')
}).catch(err => {
this.$emit('update:isShow', false)
})
}
})
if(this.flag){
this.form.customer_id = this.customerId
this.form.product_id = this.productId
this.form.order_id = this.orderId
let temp = this.form.schedule_list_skus.map(item => {
return {sku_id: item}
})
this.form.schedule_list_skus = temp
this.$refs['elForm'].validate().then(valid => {
if (valid) {
scheduleSave(this.form).then(res => {
this.$successMessage('add', '排班')
this.$emit('update:isShow', false)
this.$emit('refresh')
}).catch(err => {
this.$emit('update:isShow', false)
})
}
})
}
},
destroySchedule(){
scheduleDelete({id:this.form.id}).then(res => {

Loading…
Cancel
Save