|
@@ -1,13 +1,6 @@
|
|
|
<template>
|
|
|
<el-dialog :visible="innerVisible" :title="title" center :close-on-click-modal="false" @close="handleClose">
|
|
|
<el-form ref="ruleForm" label-width="110px" size="mini" :rules="rules" :model="ruleForm">
|
|
|
- <!-- <el-form-item label="服务名称" prop="name">
|
|
|
- <el-input placeholder="服务名称" v-model="ruleForm.name" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="服务分类" prop="service_cat">
|
|
|
- <search-category :value.sync="ruleForm.service_cat" style="width:100%" ref="category" />
|
|
|
- </el-form-item> -->
|
|
|
-
|
|
|
<el-form-item label="服务分类" prop="service_cat">
|
|
|
<search-sort ref="sort" :value="service_cat" size="mini" placeholder="服务分类" @handleChange="handleCategoryChange" />
|
|
|
</el-form-item>
|
|
@@ -120,6 +113,7 @@
|
|
|
<script>
|
|
|
import { ModalTypes } from "./_template"
|
|
|
import asyncRequest from "@/apis/service/customerService/workbench";
|
|
|
+import { accMul, add_sum } from '../../../utils/validate';
|
|
|
|
|
|
export default {
|
|
|
props:['visible','sitem', 'type', "storeId"],
|
|
@@ -250,7 +244,20 @@ export default {
|
|
|
this.$refs.ruleForm.validate(async isValid => {
|
|
|
if(!isValid) return
|
|
|
|
|
|
- const { id,name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee } = this.ruleForm;
|
|
|
+ const { id, name, service_cat, unit, price, num, remark, total_fee, tax, pay_fee, tax_fee } = this.ruleForm;
|
|
|
+
|
|
|
+ const includeTaxTotal = accMul(num, price)
|
|
|
+ const total = add_sum(pay_fee, tax_fee)
|
|
|
+
|
|
|
+ if(Number(includeTaxTotal) !== Number(total_fee)) {
|
|
|
+ this.$message.warning('单价*数量 必须等于必须等于含税报价!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(Number(total) !== Number(total_fee)){
|
|
|
+ this.$message.warning('非税报价+税额 必须等于含税报价!')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
const params = {
|
|
|
id,
|
|
@@ -268,6 +275,8 @@ export default {
|
|
|
tax_fee
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
if(this.type === ModalTypes.copy){
|
|
|
delete params.id
|
|
|
}
|