master
271556543@qq.com 3 years ago
parent bf8f74fd15
commit 907d8516c3

@ -123,6 +123,27 @@ export default {
} }
}, },
data() { data() {
let validateCategory = (rule, value, callback) => {
if(value.length > 0){
let flag = true
value.forEach(item => {
if(item.name){
}else{
flag = false
}
})
if(flag){
callback()
}else{
callback('请输入分类名称')
}
}else{
callback('请添加绑定服务分类')
}
}
return { return {
id: '', id: '',
isShow: false, isShow: false,
@ -154,6 +175,9 @@ export default {
], ],
cycle: [ cycle: [
{required: true, message: '请填写结算周期'} {required: true, message: '请填写结算周期'}
],
product_sku_category_list:[
{validator: validateCategory}
] ]
}, },

@ -270,7 +270,7 @@ export default {
unit_price: '', unit_price: '',
total_time: '', total_time: '',
total_money: '', total_money: '',
account_id: '', account_id:'',
status: 0, status: 0,
customer_id: '', customer_id: '',
} }
@ -415,8 +415,8 @@ export default {
this.pickedProduct = {} this.pickedProduct = {}
this.ageTemp = false this.ageTemp = false
this.products = [] this.products = []
this.$refs['dialog'].reset() //this.$refs['dialog'].reset()
//this.initForm() this.initForm()
} }
} }
}, },

@ -45,7 +45,7 @@
</template> </template>
</xy-table> </xy-table>
<addOrder ref="addOrder" :types="types" :accounts="accounts"></addOrder> <addOrder ref="addOrder" :types="types" :accounts="accounts" @refresh="getCustomers"></addOrder>
<add-customer ref="addCustomer" :level-types="levelTypes" :types="types" :accounts="accounts" :cities="cities" :disability-level="disabilityLevel" @refresh="getCustomers"></add-customer> <add-customer ref="addCustomer" :level-types="levelTypes" :types="types" :accounts="accounts" :cities="cities" :disability-level="disabilityLevel" @refresh="getCustomers"></add-customer>
</div> </div>
</template> </template>

@ -67,13 +67,15 @@
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<Poptip <template v-if="form.id">
:transfer="true" <Poptip
confirm :transfer="true"
title="确认要删除吗" confirm
@on-ok="destroySchedule"> title="确认要删除吗"
<Button type="primary" ghost>删除</Button> @on-ok="destroySchedule">
</Poptip> <Button type="primary" ghost>删除</Button>
</Poptip>
</template>
<Button @click="$emit('update:isShow',false)" style="margin-left: 8px">取消</Button> <Button @click="$emit('update:isShow',false)" style="margin-left: 8px">取消</Button>
<Button type="primary" @click="submit"></Button> <Button type="primary" @click="submit"></Button>
</template> </template>
@ -176,6 +178,20 @@ export default {
} }
}, },
methods: { methods: {
initForm(){
this.form = {
id:'',
customer_id: '',
product_id: '',
order_id: '',
nurse_id: '',
address_id:'',
start_time: '',
end_time: '',
schedule_list_skus: []
}
},
nurseLoad(){ nurseLoad(){
this.nurseSelect.page ++ this.nurseSelect.page ++
this.getNurses() this.getNurses()
@ -202,11 +218,9 @@ export default {
startTimePick(e){ startTimePick(e){
this.form.start_time = `${this.date} ${e}` this.form.start_time = `${this.date} ${e}`
console.log(this.form)
}, },
endTimePick(e){ endTimePick(e){
this.form.end_time = `${this.date} ${e}` this.form.end_time = `${this.date} ${e}`
console.log(this.form)
}, },
// handleCheckAllChange(val){ // handleCheckAllChange(val){
@ -246,8 +260,8 @@ export default {
}) })
this.form.schedule_list_skus = temp this.form.schedule_list_skus = temp
this.$refs['elForm'].validate().then(valid => { this.$refs['elForm'].validate().then(valid => {
console.log(valid)
if (valid) { if (valid) {
console.log(1111,this.form)
scheduleSave(this.form).then(res => { scheduleSave(this.form).then(res => {
this.$successMessage('add', '排班') this.$successMessage('add', '排班')
this.$emit('update:isShow', false) this.$emit('update:isShow', false)
@ -283,9 +297,8 @@ export default {
} else { } else {
this.$emit('update:date','') this.$emit('update:date','')
this.$refs['elForm'].resetFields()
this.$refs['table'].clearSelection() this.$refs['table'].clearSelection()
console.log(this.form) this.initForm()
} }
} }
}, },

Loading…
Cancel
Save