src/views/system/package/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/system/tijian/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
vue.config.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/views/system/package/index.vue
@@ -823,6 +823,7 @@ // 是否显示弹出层 open: false, Seachopen: false, checkedNodes: [], pacId: "", // 总条数 total: 0, @@ -1152,14 +1153,19 @@ /** 删除按钮操作 */ handleDelete1(row) { this.DataList = this.DataList.filter((item) => item.proId !== row.proId); const tree = this.$refs.tree; const node = tree.getNode(row.proId); // 根据节点的唯一标识获取节点对象 if (node) { node.setChecked(false); // 取消选中状态 this.DataList = this.DataList.filter(item => item.proId !== row.proId); // 从 checkedNodes 中移除 const index = this.checkedNodes.indexOf(row.proId); if (index > -1) { this.checkedNodes.splice(index, 1); } const tree = this.$refs.tree; const node = tree.getNode(row.proId); if (node) { node.setChecked(false); } this.updateTotalPrice(); }, getSelectValue(val) { this.form.tjProjectList.forEach((formitem) => { if (formitem.proName == val) { @@ -1274,17 +1280,12 @@ search(this.queryParams1).then((response) => { this.Treedata = response.data.list; // 更新树形数据 this.total1 = response.data.total; // 更新总条数 this.pics = this.DataList.reduce((total, item) => total + item.priceOrd, 0); const selectedIds = this.DataList.map((item) => item.proId); // 更新 checkedkey 使得选中的项目保持选中状态 this.checkedkey = selectedIds.filter((id) => this.Treedata.some((item) => item.proId === id) ); this.pics = this.DataList.reduce( (total, item) => total + item.priceOrd, 0 ); // 确保在数据加载后保持选中状态 this.$nextTick(() => { this.$refs.tree.setCheckedKeys(this.checkedNodes); }); }); this.loading = false; }, @@ -1351,8 +1352,12 @@ // }); // }, handleFilterInput() { this.queryParams.page = 1; // 搜索时重置为第一页 this.queryParams1.page = 1; // 搜索时重置为第一页 this.getDataList(); // 调用接口获取数据 // 在过滤后,重新设置选中状态 this.$nextTick(() => { this.$refs.tree.setCheckedKeys(this.checkedNodes); }); }, // 分页事件 @@ -1362,36 +1367,44 @@ this.getDataList(); // 调用接口获取数据 }, handleCurrentChecked(data, checked, checkedNodes) { this.dataObj = data; this.checkedObj = checked; handleCurrentChecked(data, checked, indeterminate) { if (checked) { // 检查是否已存在于 DataL this.DataList.push({ proId: data.proId, proName: data.proName, priceOrd: data.proPrice, // 原价,确保赋值正确 limits: 10, priceNow: data.proPrice, }); // 如果已选列表中不存在此项目,则添加 if (!this.DataList.some(item => item.proId === data.proId)) { this.DataList.push({ proId: data.proId, proName: data.proName, priceOrd: data.proPrice, limits: 10, priceNow: data.proPrice }); } // 添加到 checkedNodes 数组 if (!this.checkedNodes.includes(data.proId)) { this.checkedNodes.push(data.proId); } } else { let index = this.DataList.findIndex( (item) => item.proId === data.proId ); if (index !== -1) { this.DataList.splice(index, 1); // 取消选中时,从DataList中移除 this.DataList = this.DataList.filter(item => item.proId !== data.proId); // 从 checkedNodes 中移除 const index = this.checkedNodes.indexOf(data.proId); if (index > -1) { this.checkedNodes.splice(index, 1); } } this.pics = 0; this.TotalPrice1 = 0; this.DataList.forEach((item) => { this.pics += item.priceOrd; this.form.counterPrice += item.priceOrd; this.TotalPrice1 += item.priceOrd; // 可以根据需要改成优惠价 `priceNow` }); }, // 更新优惠价和总价 this.updateTotalPrice(); }, updateTotalPrice() { // 计算所有项目的总优惠价 this.form.xianprice = this.DataList.reduce((sum, item) => { return sum.plus(new Big(item.priceNow || "0")); }, new Big(0)).toNumber(); // 计算原价总和 this.pics = this.DataList.reduce((total, item) => total + item.priceOrd, 0); }, spliceData() { for (var i = 0; i < this.DataList.length; i++) { for (var j = i + 1; j < this.DataList.length; j++) { src/views/system/tijian/index.vue
@@ -477,7 +477,7 @@ <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="体检类别"> @@ -505,8 +505,8 @@ <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> @@ -1074,9 +1074,7 @@ }; }, watch: { filterText(val) { this.$refs.tree.filter(val); }, filterage(val) { this.$refs.treas.filter(val); }, @@ -1647,6 +1645,10 @@ }); }, numberChangeXianPrice(currentValue, oldValue) { // 如果现价没有变化,直接返回 if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { return; } this.$confirm("确定修改所有子项的折扣吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -1685,6 +1687,7 @@ ); } } this.lastXianPrice = this.TotalPrice; }) .catch(() => { this.discount = oldValue; @@ -1831,7 +1834,7 @@ }); } else { let configKey = "getInfoFromSqlData"; getconfigKey(configKey).then((res) => { getconfigKey(configKey).then((res) => { if (res.code == 200) { if (res.msg == "N") { var websocket = null; @@ -1882,7 +1885,7 @@ /* this.$refs.aaa.open = true; this.$refs.aaa.getAllList(); this.$refs.aaa.title = "证件字典"; */ } else if (res.msg == "S") { this.cardreader = true; _this.cardreaderradio = 3; @@ -2282,8 +2285,7 @@ this.DataList = []; // 清空已选项目列表 this.checkedkey = []; // 清空树的选中状态 this.checkedListkey = []; this.TreedataList = []; this.$refs.tree.setCheckedKeys([]); // 重置树选中状态 this.TreedataList = [] let data = { cusId, @@ -2628,8 +2630,6 @@ handleCurrentChecked(data, checked, checkedNodes) { this.dataObj = data; if (checked.checkedNodes.length != 0) { this.$refs.tree.setCheckedKeys([data.proId]); let proId = data.proId; getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; @@ -2804,9 +2804,8 @@ pacId: _this.pacId, proIds: this.proIds, }; // 根据体检类型选择不同的处理方法 if (this.form.tjType == 1) { if (this.form.firmId) { tuantiqueren(data).then((response) => { if (response.code == 200) { this.processOrderItems(cusId); @@ -2831,11 +2830,13 @@ this.DataLists = []; }, // 处理订单项目 processOrderItems(cusId) { getTransitionList1(cusId).then((response) => { this.tableData1 = response.data; if (this.tableData1) { let totalOrdPrice = new Big(0); let totalNowPrice = new Big(0); this.tableData1.forEach((item) => { if (item.tjCategory != null) { this.tjCategory = item.tjCategory; @@ -2845,9 +2846,18 @@ this.treeList.push(item9.proId); }); } this.TotalPrice1 += item.ordPrice || 0; // 累加应收金额 this.TotalPrice += item.nowPrice || 0; // 累加实收金额 // 使用Big.js进行加法以避免精度丢失 totalOrdPrice = totalOrdPrice.plus(new Big(item.ordPrice || 0)); totalNowPrice = totalNowPrice.plus(new Big(item.nowPrice || 0)); }); // 将Big数转换回数值并保留两位小数 this.TotalPrice1 = totalOrdPrice.toNumber().toFixed(2); this.TotalPrice = totalNowPrice.toNumber().toFixed(2); // 确保TotalPrice是一个字符串,防止后续操作导致精度丢失 this.TotalPrice = this.TotalPrice.toString(); // 计算折扣 this.discount = this.TotalPrice1 > 0 ? (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0; @@ -3168,8 +3178,9 @@ 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) { @@ -3201,6 +3212,7 @@ }; this.listgetOrder(data); } else { this.loadingSubmit = false; this.$message({ type: "warning ", message: "请选择套餐!", vue.config.js
@@ -53,8 +53,8 @@ // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { // target: `https://ltpeis.xaltjdkj.cn:5801/`, // target: `http://192.168.1.2:5011`, target: `http://192.168.1.113:5011`, target: `http://192.168.1.2:5011`, // target: `http://192.168.1.113:5011`, // // target: `http://192.168.0.99:8080/ltkj-admin`, // target: `https://ltpeis.xaltjdkj.cn:5011/ltkj-admin`, // target: `http://10.168.0.9:5011`,