| | |
| | | :value="dict.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- <el-form-item prop="ageUnit"> |
| | | |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <el-form :inline="true" ref="form" :model="form" :rules="rules" :label-position="labelPosition" |
| | | label-width="106px" v-show="top"> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="proName" label="明细项目" width="260px"> |
| | | </el-table-column> |
| | | <el-table-column prop="sl" label="数量" width="56px"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="proPrice" label="原价" width="56px"> |
| | | </el-table-column> |
| | | |
| | |
| | | <el-table :data="DataList" border style="width: 100%" height="400" :span-method="objectSpanMethod"> |
| | | <el-table-column prop="propinName" label="检查项目"> |
| | | </el-table-column> |
| | | <el-table-column prop="sl" label="数量" width="56px"> |
| | | </el-table-column> |
| | | <el-table-column prop="proPrice" label="原价" width="56px"></el-table-column> |
| | | <el-table-column prop="proName" label="明细项目" width="260px"> |
| | | </el-table-column> |
| | |
| | | <el-form-item label="体检类型"> |
| | | <el-select v-model="form.tjType" placeholder="请选择体检类型"> |
| | | <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label" |
| | | :value="dict.value" :disabled="!form.firmId && dict.value === '1'"></el-option> |
| | | :value="dict.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="体检类别"> |
| | |
| | | <el-form-item label="应收金额"> |
| | | <el-input placeholder="应收金额" v-model="TotalPrice1" disabled style="width: 150px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="优惠"> |
| | | <el-form-item label="折扣"> |
| | | <!-- {{ discount }} --> |
| | | <el-input-number ref="inputNumber" style="width: 150px" v-model="discount" :precision="1" :step="0.1" |
| | | :max="10" :min="0" @change="debounceNumberChange" :disabled="isfalse"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="实收金额"> |
| | | <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 206px" |
| | | @input="changeXianjia" @blur="numberChangeXianPrice(discount, discount)"/> |
| | | <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 206px" @input="changeXianjia" |
| | | @blur="numberChangeXianPrice(discount, discount)" /> |
| | | </el-form-item> |
| | | <br /> |
| | | |
| | | <el-form-item style="margin-left: 149px"> |
| | | <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button> |
| | | <el-button type="primary" @click="resetpackage" size="mini" style="margin-right: 20px">重置套餐</el-button> |
| | | <el-button type="primary" @click="submitPrice" :loading="loadingSubmit" |
| | | :disabled="confirm || loadingSubmit" v-if="showHidden.has_charge == 'N'" size="mini">签到登记</el-button> |
| | | <el-button type="primary" @click="submitPrice" :loading="loadingSubmit" :disabled="loadingSubmit" |
| | | v-if="showHidden.has_charge == 'N'" size="mini">签到登记</el-button> |
| | | <el-button type="primary" @click="submitCheckinfee" :disabled="confirm" |
| | | v-if="showHidden.has_charge == 'Y'" size="mini">登记收费</el-button> |
| | | </el-form-item> |
| | |
| | | <template slot-scope="scope"> |
| | | <!-- 只输入纯数字折扣 --> |
| | | <el-input-number v-model.number="scope.row.discount" @input="validateDiscount(scope.row)" |
| | | placeholder="输入折扣" size="small" type="number" :precision="1" :step="0.1" :max="10" :min="0"> |
| | | @change="handleManualChange(scope.row)" placeholder="输入折扣" size="small" type="number" :precision="1" |
| | | :step="0.1" :max="10" :min="0"> |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isSubmitting: false, |
| | | open1: false, |
| | | filterage: "", |
| | | checkedkeys: [], |
| | |
| | | taocan: false, |
| | | top: true, |
| | | value: "2", |
| | | getInfodis: "", |
| | | srcUrl: "", |
| | | hides: false, |
| | | hide: true, |
| | |
| | | cusIsvip: null, |
| | | }, |
| | | // 添加 |
| | | |
| | | lastXianPrice: 0, |
| | | // 表单参数 |
| | | // 表单参数 |
| | | obj: {}, |
| | |
| | | firmId: "", |
| | | firmDeptName: "", |
| | | }, |
| | | form1: {}, |
| | | form1: { |
| | | cnName: "", |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | taxNumber: "", |
| | | legalPerson: "", |
| | | registerAddress: "", |
| | | mailingAddress: "", |
| | | bankAccount: "", |
| | | mailingAddress: "", |
| | | countNum: "", |
| | | bankAccount: "", |
| | | email: "", |
| | | principal: "", |
| | | url: "", |
| | | faxNumber: "", |
| | | areaName: "", |
| | | orderNum: "", |
| | | remark: "", |
| | | validTime: "", |
| | | }, |
| | | title: "", |
| | | // 表单校验 |
| | | rules: { |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val); |
| | | }, |
| | |
| | | // 原始折扣率计算 |
| | | if (this.TotalPrice1 !== 0) { |
| | | this.discount = |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; |
| | | } |
| | | |
| | | }, |
| | | clear() { |
| | | this.form.firmId = ""; |
| | |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | validateDiscount(row) { |
| | | if (row.discount > 10) { |
| | | row.discount = 10; // 强制将值设置为最大值 |
| | | } else if (row.discount < 0) { |
| | | row.discount = 0; // 强制将值设置为最小值 |
| | | } |
| | | this.updateProPrice(row); // 更新价格或其他逻辑 |
| | | handleManualChange(row) { |
| | | console.log("这是主动出发的"); |
| | | this.updateProPrice(row); |
| | | }, |
| | | validateDiscount(row) { |
| | | if (this.TotalPrice !== undefined && !isNaN(this.TotalPrice) && this.TotalPrice !== this.lastXianPrice) { |
| | | this.updateProPrice1(row); |
| | | this.lastXianPrice = this.TotalPrice; |
| | | } |
| | | }, |
| | | |
| | | isAll(value) { |
| | | return value === "" || value === null; |
| | | }, |
| | |
| | | this.discount = |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; |
| | | }, |
| | | updateProPrice1(row) { |
| | | console.log("进入了1") |
| | | const ordPrice = new Big(row.ordPrice); |
| | | const discount = new Big(row.discount); |
| | | const result = ordPrice.times(discount.div(10)); |
| | | row.nowPrice = result.toNumber(); |
| | | const totalYsPrice = this.tableData1.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.nowPrice || '0')); |
| | | }, new Big(0)); |
| | | const totalYsPriceNum = totalYsPrice.toNumber(); |
| | | if (this.TotalPrice !== undefined && !isNaN(this.TotalPrice)) { |
| | | const xianPrice = new Big(this.TotalPrice); |
| | | const diff = xianPrice.minus(totalYsPriceNum); |
| | | if (!diff.eq(0) && this.tableData1.length > 0) { |
| | | const lastItem = this.tableData1[this.tableData1.length - 1]; |
| | | const newYsPrice = new Big(lastItem.nowPrice).plus(diff).toNumber(); |
| | | this.$set(this.tableData1[this.tableData1.length - 1], 'nowPrice', newYsPrice); |
| | | } |
| | | } |
| | | |
| | | // Update youhui calculation |
| | | if (this.TotalPrice1 !== 0 && this.TotalPrice !== 0) { |
| | | this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; |
| | | } else { |
| | | this.discount = 0; |
| | | } |
| | | }, |
| | | openname() { |
| | | this.$refs.bbb.open = true; |
| | | this.$refs.bbb.title = "搜索姓名"; |
| | |
| | | }, |
| | | getList1() { |
| | | getInfo().then((response) => { |
| | | this.getInfodis = response.user.discount; |
| | | |
| | | this.hospName = response.hospName; |
| | | if (this.getInfodis === null) { |
| | | this.isfalse = true; |
| | | } |
| | | |
| | | }); |
| | | getIsRequired().then((response) => { |
| | | this.showHidden = response.data; |
| | |
| | | }); |
| | | }, |
| | | |
| | | |
| | | handleClose(done) { |
| | | this.$confirm("确认关闭?") |
| | | .then((_) => { |
| | |
| | | /** 查询信息列表 */ |
| | | getList() { |
| | | getInfo().then((response) => { |
| | | this.getInfodis = response.user.discount; |
| | | if (this.getInfodis === null) { |
| | | this.isfalse = true; |
| | | } |
| | | |
| | | |
| | | }); |
| | | let cusSex = this.form.cusSex; |
| | | //全部套餐 |
| | |
| | | }) |
| | | .then(() => { |
| | | this.discount = currentValue; |
| | | if (this.discount < this.getInfodis) { |
| | | this.discount = this.getInfodis; |
| | | // this.$modal.msgError(`该人员最高优惠权限为${this.getInfodis}折`); |
| | | } |
| | | |
| | | this.tableData1.forEach((item) => { |
| | | item.discount = this.discount; |
| | | const ordPrice = new Big(item.ordPrice); |
| | | const discount = new Big(item.discount); |
| | | const result = ordPrice.times(discount.div(10)) |
| | | const result = ordPrice.times(discount.div(10)); |
| | | item.nowPrice = result.toNumber(); |
| | | this.TotalPrice = this.tableData1.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.nowPrice || "0")); |
| | |
| | | }); |
| | | }, |
| | | numberChangeXianPrice(currentValue, oldValue) { |
| | | // 如果现价没有变化,直接返回 |
| | | if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { |
| | | return; |
| | | } |
| | | this.$confirm("确定修改所有子项的折扣吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | if (this.discount < this.getInfodis) { |
| | | this.discount = this.getInfodis; |
| | | } |
| | | let totalYsprice = new Big(0) |
| | | let totalYsprice = new Big(0); |
| | | this.tableData1.forEach((item) => { |
| | | item.discount = this.discount; |
| | | const ordPrice = new Big(item.ordPrice); |
| | | const discount = new Big(item.discount); |
| | | const result = ordPrice.times(discount.div(10)) |
| | | const result = ordPrice.times(discount.div(10)); |
| | | item.nowPrice = result.toNumber(); |
| | | totalYsprice = totalYsprice.plus(new Big(item.nowPrice)); |
| | | }) |
| | | }); |
| | | if (!totalYsprice.eq(this.TotalPrice)) { |
| | | const diff = new Big(this.TotalPrice).minus(totalYsprice); |
| | | if (this.tableData1.length > 0) { |
| | | const lastItem = this.tableData1[this.tableData1.length - 1] |
| | | const newYsPrice = new Big(lastItem.nowPrice).plus(diff).toNumber() |
| | | console.log("hhh", this.tableData1[this.tableData1.length - 1].nowPrice,newYsPrice) |
| | | this.$set(this.tableData1[this.tableData1.length - 1], 'nowPrice', newYsPrice) |
| | | const lastItem = this.tableData1[this.tableData1.length - 1]; |
| | | const newYsPrice = new Big(lastItem.nowPrice) |
| | | .plus(diff) |
| | | .toNumber(); |
| | | console.log( |
| | | "hhh", |
| | | this.tableData1[this.tableData1.length - 1].nowPrice, |
| | | newYsPrice |
| | | ); |
| | | this.$set( |
| | | this.tableData1[this.tableData1.length - 1], |
| | | "nowPrice", |
| | | newYsPrice |
| | | ); |
| | | } |
| | | } |
| | | this.lastXianPrice = this.TotalPrice; |
| | | }) |
| | | .catch(() => { |
| | | this.discount = oldValue; |
| | |
| | | let cusIdcard = this.form.cusIdcard; |
| | | if (cusIdcard) { |
| | | getCusIdcard(cusIdcard).then((response) => { |
| | | _this.top = false; |
| | | if (response.data) { |
| | | this.form = response.data; |
| | | if (this.form.discount === null) { |
| | |
| | | this.list1 = false; |
| | | this.list2 = true; |
| | | this.list3 = false; |
| | | this.top = false; |
| | | _this.top = false; |
| | | } else { |
| | | this.list1 = true; |
| | | this.TotalPrice = 0; |
| | | this.top = false; |
| | | _this.top = false; |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | alert("读卡器连接关闭"); |
| | | }; |
| | | } else if (res.msg == "Y") { |
| | | this.$refs.aaa.open = true; |
| | | /* this.$refs.aaa.open = true; |
| | | this.$refs.aaa.getAllList(); |
| | | this.$refs.aaa.title = "证件字典"; |
| | | this.$refs.aaa.title = "证件字典"; */ |
| | | |
| | | } else if (res.msg == "S") { |
| | | this.cardreader = true; |
| | | _this.cardreaderradio = 3; |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | resetpackage() { |
| | | this.discount = 10; |
| | | if (this.form.cusIdcard) { |
| | |
| | | _this.pacId = ""; |
| | | this.proIds = []; |
| | | this.tjCategory = "12"; |
| | | |
| | | this.DataList = []; // 清空已选项目列表 |
| | | this.checkedkey = []; // 清空树的选中状态 |
| | | this.checkedListkey = []; |
| | | this.TreedataList = [] |
| | | |
| | | let data = { |
| | | cusId, |
| | | pacId: _this.pacId, |
| | |
| | | dwId: this.form.firmId || "", |
| | | }; |
| | | if (this.form.tjType == 1) { |
| | | if (!this.form.firmId) { |
| | | if (!this.form.firmId && !this.form.firmName) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先维护单位!", |
| | | }); |
| | | } else { |
| | | } else if (!this.form.firmId && this.form.firmName) { |
| | | this.taocan = true; |
| | | this.loading = true; |
| | | deptTreeSelect(cusSex).then((response) => { |
| | | this.newpacName = response.rows; |
| | | try { |
| | | if (this.tableData1.length >= 1) { |
| | | this.newpacName.forEach((item3) => { |
| | | this.tableData1.forEach((item4) => { |
| | | item4.list.forEach((item6) => { |
| | | if (item6.pacName === item3.pacName) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tb.toggleRowSelection(item3, true); |
| | | }); |
| | | throw Error(); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | } catch (error) { } |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | |
| | | else { |
| | | this.taocan = true; |
| | | this.loading = true; |
| | | tuantiSelect(param).then((res) => { |
| | |
| | | this.loading = true; |
| | | getProParentIdDxList().then((response) => { |
| | | this.Treedata = response.data.list; |
| | | |
| | | if (this.tableData[0]) { |
| | | this.tableData[0].tjProjectList.forEach((selectionitem) => { |
| | | this.Treedata.forEach((item) => { |
| | |
| | | if (this.DataLists.length >= 1) { |
| | | this.marryalls = 0; |
| | | this.DataLists.forEach((item1) => { |
| | | this.marryalls += item1.proPrice; |
| | | this.marryalls += item1.proPrice * item1.sl; |
| | | |
| | | this.packagedataList.forEach((item3) => { |
| | | if (item1.proParentId == item3.proId) { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // 点击获取每个树节点 |
| | | handleCurrentChecked(data, checked, checkedNodes) { |
| | | this.dataObj = data; |
| | | if (checked.checkedNodes.length != 0) { |
| | | this.$refs.tree.setCheckedKeys([data.proId]); |
| | | if (checked.checkedNodes.length > 0) { |
| | | const promises = checked.checkedNodes.map(node => getProSonDxList(node.proId)); |
| | | Promise.all(promises).then(results => { |
| | | this.TreedataList = results.flatMap(res => res.data.list); |
| | | this.checkedListkey = []; |
| | | this.DataList = []; |
| | | |
| | | let proId = data.proId; |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | this.TreedataList.forEach((item) => { |
| | | this.checkedListkey.push(item.proId); |
| | | |
| | | this.DataList.push(item); |
| | | this.spliceData(); |
| | | this.DataList.forEach((item1) => { |
| | | if (item1.proParentId == data.proId) { |
| | | item1.propinName = data.proName; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | this.spliceData(); // 假设这个方法是你定义的其他地方处理数据的 |
| | | |
| | | // 更新名称和计算总价 |
| | | this.DataList.forEach((item1) => { |
| | | const parent = checked.checkedNodes.find(node => node.proId === item1.proParentId); |
| | | if (parent) { |
| | | item1.propinName = parent.proName; |
| | | } |
| | | }); |
| | | |
| | | this.TotalPrice1 = 0; |
| | | this.marryall = 0; |
| | | if (this.DataList.length != 0) { |
| | | this.list1 = false; |
| | | this.DataList.forEach((item) => { |
| | | this.marryall += item.proPrice; |
| | | this.marryall += Number(item.proPrice) * Number(item.sl); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | var cusId = this.form.cusIdcard; |
| | | } else { |
| | | this.$message.warning("请先填写信息,再选体检内容"); |
| | | return; // 如果没有身份证号码,停止执行 |
| | | } |
| | | |
| | | let _this = this; |
| | | |
| | | // 初始化变量 |
| | | this.isSubmitting = true; // 开始提交时设置标志 |
| | | this.TotalPrice1 = 0; // 初始化应收金额 |
| | | this.TotalPrice = 0; // 初始化实收金额 |
| | | this.discount = 10; // 初始化折扣为10(100%) |
| | | |
| | | // 判断是否有选中的套餐 |
| | | if (this.tableData.length != 0) { |
| | | this.tableData.forEach((item) => { |
| | | _this.pacId = item.pacId; |
| | | }); |
| | | _this.pacId = this.tableData[0].pacId; |
| | | } else { |
| | | _this.pacId = ""; |
| | | } |
| | | |
| | | this.proIds = []; |
| | | if (this.DataList.length != 0) { |
| | | this.DataList.forEach((item) => { |
| | | |
| | | // 处理选中的项目 |
| | | const newItemsToAdd = []; |
| | | const allItems = [...this.DataList, ...this.DataLists]; // 合并所有项目 |
| | | |
| | | allItems.forEach((item) => { |
| | | if (!this.proIds.includes(item.proId)) { |
| | | newItemsToAdd.push(item); |
| | | this.proIds.push(item.proId); |
| | | }); |
| | | } |
| | | if (this.DataLists.length != 0) { |
| | | this.DataLists.forEach((item) => { |
| | | this.proIds.push(item.proId); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 准备数据 |
| | | let data = { |
| | | cusId, |
| | | pacId: _this.pacId, |
| | | proIds: this.proIds, |
| | | }; |
| | | if (this.form.tjType == 1) { |
| | | // 根据体检类型选择不同的处理方法 |
| | | if (this.form.firmId) { |
| | | tuantiqueren(data).then((response) => { |
| | | if (response.code == 200) { |
| | | let cusId = this.form.cusIdcard; |
| | | this.proIds = []; |
| | | getTransitionList1(cusId).then((response) => { |
| | | this.tableData1 = response.data; |
| | | this.TotalPrice1 = 0; |
| | | if (this.tableData1) { |
| | | this.tableData1.forEach((item) => { |
| | | if (item.tjCategory != null) { |
| | | this.tjCategory = item.tjCategory; |
| | | } |
| | | if (item.pacName == "单项") { |
| | | item.list.forEach((item9) => { |
| | | this.treeList.push(item9.proId); |
| | | }); |
| | | } |
| | | this.TotalPrice = 0; |
| | | this.TotalPrice1 += item.ordPrice; |
| | | this.TotalPrice += item.nowPrice; |
| | | |
| | | this.pacName = item.pacName; |
| | | }); |
| | | |
| | | this.TotalPrice = this.tableData1.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.nowPrice || "0")); |
| | | }, new Big(0)); |
| | | this.discount = |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / |
| | | 100) * |
| | | 10; |
| | | this.list1 = false; |
| | | this.list3 = true; |
| | | this.list2 = false; |
| | | } else { |
| | | this.list1 = true; |
| | | this.TotalPrice = 0; |
| | | } |
| | | }); |
| | | } else { |
| | | this.processOrderItems(cusId); |
| | | } |
| | | this.isSubmitting = false; // 提交完成后重置标志 |
| | | }).catch(() => { |
| | | this.isSubmitting = false; // 确保在错误情况下也重置标志 |
| | | }); |
| | | } else { |
| | | getaddtTransition(data).then((response) => { |
| | | if (response.code == 200) { |
| | | let cusId = this.form.cusIdcard; |
| | | this.proIds = []; |
| | | getTransitionList1(cusId).then((response) => { |
| | | this.tableData1 = response.data; |
| | | this.TotalPrice1 = 0; |
| | | if (this.tableData1) { |
| | | this.tableData1.forEach((item) => { |
| | | if (item.tjCategory != null) { |
| | | this.tjCategory = item.tjCategory; |
| | | } |
| | | if (item.pacName == "单项") { |
| | | item.list.forEach((item9) => { |
| | | this.treeList.push(item9.proId); |
| | | }); |
| | | } |
| | | this.TotalPrice = 0; |
| | | this.TotalPrice1 += item.ordPrice; |
| | | this.TotalPrice += item.nowPrice; |
| | | |
| | | this.pacName = item.pacName; |
| | | }); |
| | | this.discount = |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / |
| | | 100) * |
| | | 10; |
| | | |
| | | this.list1 = false; |
| | | this.list3 = true; |
| | | this.list2 = false; |
| | | } else { |
| | | this.list1 = true; |
| | | this.TotalPrice = 0; |
| | | } |
| | | }); |
| | | } else { |
| | | this.processOrderItems(cusId); |
| | | } |
| | | this.isSubmitting = false; // 提交完成后重置标志 |
| | | }).catch(() => { |
| | | this.isSubmitting = false; // 确保在错误情况下也重置标志 |
| | | }); |
| | | } |
| | | |
| | | this.taocan = false; |
| | | this.defaultKeys = []; |
| | | this.DataLists = []; |
| | | }, |
| | | |
| | | // 处理订单项目 |
| | | processOrderItems(cusId) { |
| | | getTransitionList1(cusId).then((response) => { |
| | | this.tableData1 = response.data; |
| | | if (this.tableData1) { |
| | | this.tableData1.forEach((item) => { |
| | | if (item.tjCategory != null) { |
| | | this.tjCategory = item.tjCategory; |
| | | } |
| | | if (item.pacName == "单项") { |
| | | item.list.forEach((item9) => { |
| | | this.treeList.push(item9.proId); |
| | | }); |
| | | } |
| | | this.TotalPrice1 += item.ordPrice || 0; // 累加应收金额 |
| | | this.TotalPrice += item.nowPrice || 0; // 累加实收金额 |
| | | }); |
| | | // 计算折扣 |
| | | this.discount = this.TotalPrice1 > 0 ? |
| | | (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0; |
| | | |
| | | this.list1 = false; |
| | | this.list3 = true; |
| | | this.list2 = false; |
| | | } else { |
| | | this.list1 = true; |
| | | this.TotalPrice = 0; |
| | | } |
| | | }); |
| | | }, |
| | | submitCheckinfee() { |
| | | let _this = this; |
| | | if (_this.tjCategory !== "") { |
| | | let List = _this.tableData1; //单个项目信息 |
| | | let List = _this.tableData1; |
| | | if (this.responseList.cusId) { |
| | | var userId = this.responseList.cusId; |
| | | } else { |
| | |
| | | if (this.tableData[0]) { |
| | | var pacId = this.tableData[0].pacId; |
| | | } |
| | | |
| | | //tjOrderList//这个是处理完的每一项套餐信息 |
| | | List.forEach((item) => { |
| | | if (item.list) { |
| | | item.list.forEach((item1) => { |
| | |
| | | } |
| | | this.discount = |
| | | (this.formInline.paidIn / this.formInline.price) * 10; |
| | | if (this.discount <= this.getInfodis) { |
| | | this.discount = this.getInfodis; |
| | | } |
| | | |
| | | } else { |
| | | this.discount = 10; |
| | | this.formInline.paidIn = "0.00"; |
| | |
| | | // 最后提交按钮 |
| | | submitPrice() { |
| | | let _this = this; |
| | | this.loadingSubmit = true; |
| | | if (_this.tjCategory !== "") { |
| | | this.loadingSubmit = true; |
| | | let List = _this.tableData1; //单个项目信息 |
| | | if (this.responseList.cusId) { |
| | | var userId = this.responseList.cusId; |
| | |
| | | cusIdCard: item.cusId, |
| | | })); // 创建新的对象,包含 discount 和 id |
| | | gaibianzhekou(newArray).then((res) => { |
| | | this.loadingSubmit = false; |
| | | if (res.code === 200) { |
| | | this.loadingSubmit = false; |
| | | |
| | | let data; |
| | | |
| | | if (pacId || this.tjOrderList.length > 0) { |
| | |
| | | }; |
| | | this.listgetOrder(data); |
| | | } else { |
| | | this.loadingSubmit = false; |
| | | this.$message({ |
| | | type: "warning ", |
| | | message: "请选择套餐!", |