|
|
|
|
@ -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 => {
|
|
|
|
|
|