|
|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select
|
|
|
|
|
clearable
|
|
|
|
|
:value="pickedProduct.name"
|
|
|
|
|
v-load-more="productLoad"
|
|
|
|
|
placeholder="请选择产品"
|
|
|
|
|
@ -299,7 +300,6 @@ export default {
|
|
|
|
|
this.pickedProduct = e
|
|
|
|
|
this.form.product_id = e.id
|
|
|
|
|
this.form.product_type_id = e.product_type_id
|
|
|
|
|
console.log(e)
|
|
|
|
|
if(this.form.product_id && this.form.date){
|
|
|
|
|
let times;
|
|
|
|
|
let t1= moment(this.form.date[0])
|
|
|
|
|
@ -317,13 +317,18 @@ export default {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
this.pickedProduct.cycle === 4 ? times = 1 : times = t2.diff(t1,unit) //几个周期
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = Number(this.pickedProduct.purchase_price) * this.form.service_times
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
if(this.pickedProduct.type === 1){
|
|
|
|
|
if(this.pickedProduct.service_rule === 1){
|
|
|
|
|
//单次计时
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = Number(this.pickedProduct.purchase_price) * this.form.service_times
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.total_time = Number(this.pickedProduct.time_lenth) * this.form.service_times
|
|
|
|
|
}else{
|
|
|
|
|
this.form.total_time = this.pickedProduct.total
|
|
|
|
|
//总计时
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = times * Number(this.pickedProduct.total) * Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.total_time = times * Number(this.pickedProduct.total)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
@ -344,17 +349,22 @@ export default {
|
|
|
|
|
unit = 'week'
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
let times = t2.diff(t1,unit) //几个周期
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = Number(this.pickedProduct.purchase_price) * this.form.service_times
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
if(this.pickedProduct.type === 1){
|
|
|
|
|
this.form.total_time = Number(this.pickedProduct.time_lenth) * this.form.service_times * times
|
|
|
|
|
let times ; //几个周期
|
|
|
|
|
this.pickedProduct.cycle === 4 ? times = 1 : times = t2.diff(t1,unit) //几个周期
|
|
|
|
|
if(this.pickedProduct.service_rule === 1){
|
|
|
|
|
//单次计时
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = Number(this.pickedProduct.purchase_price) * this.form.service_times
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.total_time = Number(this.pickedProduct.time_lenth) * this.form.service_times
|
|
|
|
|
}else{
|
|
|
|
|
this.form.total_time = this.pickedProduct.total * times
|
|
|
|
|
//总计时
|
|
|
|
|
this.form.service_times = this.pickedProduct.frequency * times
|
|
|
|
|
this.form.total_money = times * Number(this.pickedProduct.total) * Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.unit_price = Number(this.pickedProduct.purchase_price)
|
|
|
|
|
this.form.total_time = times * Number(this.pickedProduct.total)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|