master
xy 3 years ago
parent 02dca4290c
commit 346d7e047f

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

@ -101,6 +101,7 @@
<timeSelect <timeSelect
ref="timeSelect" ref="timeSelect"
@refresh="()=>{getCustomer();$emit('refresh')}" @refresh="()=>{getCustomer();$emit('refresh')}"
:flag="flag"
:is-show.sync="isShowTime" :is-show.sync="isShowTime"
:skus="detail.product_type.product_skus" :skus="detail.product_type.product_skus"
:addresses="addresses" :addresses="addresses"
@ -137,6 +138,7 @@ export default {
}, },
data() { data() {
return { return {
flag:false,//
nurseId:'', nurseId:'',
productId: '', productId: '',
isShow: false, isShow: false,
@ -191,14 +193,18 @@ export default {
}, },
async getCustomer() { async getCustomer() {
const res = await customerDetail({ try{
id: this.id const res = await customerDetail({
}) id: this.id
console.log(res) })
this.detail = res.detail this.flag = true
this.detail = res.detail
if(this.detail.product?.service_rule === 2 && this.detail.schedule && this.detail.schedule.length > 0){ if(this.detail.product?.service_rule === 2 && this.detail.schedule && this.detail.schedule.length > 0){
this.nurseId = this.detail.schedule[0]?.nurse_id 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 { export default {
props: { props: {
flag:{
type:Boolean,
default:false
},//
customerId: [Number, String], customerId: [Number, String],
orderId: [Number, String], orderId: [Number, String],
productId: [Number, String], productId: [Number, String],
@ -244,24 +248,26 @@ export default {
}, },
submit() { submit() {
this.form.customer_id = this.customerId if(this.flag){
this.form.product_id = this.productId this.form.customer_id = this.customerId
this.form.order_id = this.orderId this.form.product_id = this.productId
let temp = this.form.schedule_list_skus.map(item => { this.form.order_id = this.orderId
return {sku_id: item} 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 => { this.form.schedule_list_skus = temp
if (valid) { this.$refs['elForm'].validate().then(valid => {
scheduleSave(this.form).then(res => { if (valid) {
this.$successMessage('add', '排班') scheduleSave(this.form).then(res => {
this.$emit('update:isShow', false) this.$successMessage('add', '排班')
this.$emit('refresh') this.$emit('update:isShow', false)
}).catch(err => { this.$emit('refresh')
this.$emit('update:isShow', false) }).catch(err => {
}) this.$emit('update:isShow', false)
} })
}) }
})
}
}, },
destroySchedule(){ destroySchedule(){
scheduleDelete({id:this.form.id}).then(res => { scheduleDelete({id:this.form.id}).then(res => {

Loading…
Cancel
Save