| | |
| | | :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="proPrice" label="原价" width="56px"> |
| | | </el-table-column> |
| | | |
| | |
| | | </div> |
| | | <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-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 /> |
| | | |
| | |
| | | <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: { |
| | |
| | | // 原始折扣率计算 |
| | | 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")); |
| | |
| | | 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 |
| | | ); |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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 { |
| | |
| | | }); |
| | | } else { |
| | | let configKey = "getInfoFromSqlData"; |
| | | getconfigKey(configKey).then((res) => { |
| | | getconfigKey(configKey).then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.msg == "N") { |
| | | var websocket = null; |
| | |
| | | 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 = []; |
| | | this.$refs.tree.setCheckedKeys([]); // 重置树选中状态 |
| | | |
| | | 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) => { |
| | |
| | | if (this.DataList.length != 0) { |
| | | this.list1 = false; |
| | | this.DataList.forEach((item) => { |
| | | this.marryall += item.proPrice; |
| | | this.marryall = item.proPrice * 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) { |
| | | 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; |