| | |
| | | </el-form> |
| | | </template> |
| | | |
| | | <div style="text-align: center; margin-bottom: 10px"> |
| | | <div |
| | | style=" |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | width: 100%; |
| | | " |
| | | > |
| | | <div |
| | | style=" |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | margin-left: 46px; |
| | | font-size: 16px; |
| | | margin-right: 20px; |
| | | " |
| | | > |
| | | 已选项目条数:<span |
| | | style="font-weight: 700; color: red; margin-right: 5px" |
| | | >{{ this.tableData1.length || 0 }}</span |
| | | >条 |
| | | </div> |
| | | 已选项目列表 |
| | | </div> |
| | | <div |
| | | style=" |
| | | padding: 0px 6px; |
| | | border: 1px solid #e6ebf5; |
| | | max-height: 650%; |
| | | overflow: auto; |
| | | width: 916px; |
| | | margin-left: 35px; |
| | | " |
| | | > |
| | | <el-table :data="tableData1" border style="width: 100%"> |
| | | <el-table-column prop="proName" label="项目" width="180" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="proType" label="性别" width="50" align="center"> |
| | | <template slot-scope="scope"> |
| | | <template v-if="isAll(scope.row.proType)"> |
| | | 全部 |
| | | </template> |
| | | <template v-else> |
| | | <dict-tag |
| | | :options="dict.type.sys_user_sex" |
| | | :value="scope.row.proType" |
| | | /> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="ordPrice" label="应收金额" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="折扣" width="160px" align="center"> |
| | | <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" |
| | | :disabled="true" |
| | | > |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="nowPrice" label="实收金额" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="proCheckMethod" label="是否空腹" align="center"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_yes_no" |
| | | :value="scope.row.proCheckMethod" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete1(scope.row)" |
| | | title="删除" |
| | | > |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!-- <div style="text-align: center; margin-bottom: 10px"> |
| | | 已选项目列表 |
| | | </div> --> |
| | | <!-- <div |
| | | style=" |
| | | padding: 0px 6px; |
| | | border: 1px solid #e6ebf5; |
| | | max-height: 420px; |
| | | overflow: auto; |
| | | " |
| | | > |
| | | <el-collapse v-model="index" accordion v-if="list3"> |
| | | > --> |
| | | <!-- <el-collapse v-model="index" accordion v-if="list3"> |
| | | <div |
| | | class="info1" |
| | | v-for="(item, index) in tableData1" |
| | |
| | | item.nowPrice + |
| | | "元)" |
| | | }} |
| | | <div style="font-size: 16px; margin-left: 20px"> |
| | | 已选项目条数:<span |
| | | style=" |
| | | font-weight: 700 !important; |
| | | color: red; |
| | | margin-right: 5px; |
| | | " |
| | | >{{ item.list.length || 0 }}</span |
| | | >条 |
| | | </div> |
| | | </template> |
| | | <el-table |
| | | :data="item.list" |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="ordPrice" label="应收金额"> |
| | | </el-table-column> |
| | | <el-table-column label="折扣"> |
| | | <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" |
| | | > |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="nowPrice" label="实收金额"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="80px" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete1(scope.row)" |
| | | title="删除" |
| | | > |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-collapse-item> |
| | |
| | | </el-table> |
| | | </el-collapse-item> |
| | | </div> |
| | | </el-collapse> |
| | | </div> |
| | | </el-collapse> --> |
| | | <!-- </div> --> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- <div class="tab1"> --> |
| | | <!-- <el-form :inline="true" class="tab1"> --> |
| | | <el-form-item label="应收金额"> |
| | | <el-input |
| | | placeholder="应收金额" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="优惠折扣"> |
| | | <!-- <el-input style="width: 100px" type="number" v-model="discount" :value="discount"></el-input> --> |
| | | <el-input-number |
| | | ref="inputNumber" |
| | | style="width: 130px" |
| | |
| | | <div style="text-align: center; margin-bottom: 10px"> |
| | | 已选项目列表 |
| | | </div> |
| | | |
| | | <div |
| | | style=" |
| | | padding: 0px 6px; |
| | | border: 1px solid #e6ebf5; |
| | | max-height: 650%; |
| | | overflow: auto; |
| | | width: 916px; |
| | | margin-left: 35px; |
| | | " |
| | | > |
| | | <el-table :data="tableData1" border style="width: 100%"> |
| | | <el-table-column prop="proName" label="项目" width="180" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="proType" label="性别" width="50" align="center"> |
| | | <template slot-scope="scope"> |
| | | <template v-if="isAll(scope.row.proType)"> |
| | | 全部 |
| | | </template> |
| | | <template v-else> |
| | | <dict-tag |
| | | :options="dict.type.sys_user_sex" |
| | | :value="scope.row.proType" |
| | | /> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="ordPrice" label="应收金额" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="折扣" width="160px" align="center"> |
| | | <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" |
| | | :disabled="true" |
| | | > |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="nowPrice" label="实收金额" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="proCheckMethod" label="是否空腹" align="center"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_yes_no" |
| | | :value="scope.row.proCheckMethod" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete1(scope.row)" |
| | | title="删除" |
| | | > |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!-- <div |
| | | style=" |
| | | padding: 0px 6px; |
| | | border: 1px solid #e6ebf5; |
| | |
| | | overflow: auto; |
| | | " |
| | | > |
| | | <div |
| | | style=" |
| | | padding: 0px 6px; |
| | | border: 1px solid #e6ebf5; |
| | | max-height: 420px; |
| | | overflow: auto; |
| | | " |
| | | ></div> |
| | | <el-collapse v-model="index" accordion v-if="list3"> |
| | | <div |
| | | class="info1" |
| | |
| | | item.nowPrice + |
| | | ".00元)" |
| | | }} |
| | | <div style="font-size: 16px; margin-left: 20px"> |
| | | 已选项目条数:<span |
| | | style=" |
| | | font-weight: 700 !important; |
| | | color: red; |
| | | margin-right: 5px; |
| | | " |
| | | >{{ item.list.length || 0 }}</span |
| | | >条 |
| | | </div> |
| | | </template> |
| | | |
| | | <el-table |
| | | :data="item.list" |
| | | border |
| | |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="ordPrice" label="应收金额"> |
| | | </el-table-column> |
| | | <el-table-column label="折扣"> |
| | | <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" |
| | | > |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="nowPrice" label="实收金额"> |
| | | </el-table-column> |
| | |
| | | </el-collapse-item> |
| | | </div> |
| | | </el-collapse> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | <script> |
| | | import { addComp } from "@/api/system/comp"; |
| | | |
| | | import Big from "big.js"; |
| | | import { |
| | | listReservation, |
| | | gettjCancel, |
| | |
| | | getaddtTransition, |
| | | getTransitionList, |
| | | getconfigKey, |
| | | delTbBycusCardIdAndProId, |
| | | getTransitionList1, |
| | | } from "@/api/system/tijian"; |
| | | import { getCompany, queryCompany } from "@/api/team/tuanti"; |
| | | import user from "@/store/modules/user"; |
| | |
| | | return time.getTime() < Date.now() - 8.64e7; // 不可选历史天、不可选当前天、可选未来天 |
| | | }, |
| | | }, |
| | | discount: 10, |
| | | taocan: false, |
| | | defaultKeys: [], |
| | | value1: "", |
| | |
| | | cusNumber: null, |
| | | cusIsvip: null, |
| | | }, |
| | | formIn: {}, |
| | | formIn: { |
| | | name: "", |
| | | age: "", |
| | | idCard: "", |
| | | remark: null, |
| | | pacName: "", |
| | | cusaddr: null, |
| | | idType: null, |
| | | ageUnit: null, |
| | | sex: null, |
| | | phoe: "", |
| | | nation: null, |
| | | email: "", |
| | | marriage: null, |
| | | address: "", |
| | | tjCategory: null, |
| | | company: "", |
| | | career: null, |
| | | reservationTime: null, |
| | | timeRegion: null, |
| | | indexCard: "", |
| | | department: "", |
| | | }, |
| | | fmobj: {}, |
| | | // 表单校验 |
| | | form1: {}, |
| | |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | isAll(value) { |
| | | return value === "" || value === null; |
| | | }, |
| | | validateDiscount(row) { |
| | | if (row.discount == null || isNaN(row.discount)) { |
| | | row.discount = 10; |
| | | } |
| | | if (row.discount > 10) { |
| | | row.discount = 10; // 强制将值设置为最大值 |
| | | } else if (row.discount < 0) { |
| | | row.discount = 0; // 强制将值设置为最小值 |
| | | } |
| | | this.updateProPrice(row); // 更新价格或其他逻辑 |
| | | }, |
| | | updateProPrice(row) { |
| | | const ordPrice = new Big(row.ordPrice || 0); |
| | | const discount = new Big(row.discount || 0); |
| | | const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10) |
| | | row.nowPrice = result.toNumber(); |
| | | 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; |
| | | }, |
| | | |
| | | /** 删除按钮操作 */ |
| | | handleDelete1(row) { |
| | | // console.log(row); |
| | | let data = { |
| | | cusCardId: row.cusId, |
| | | proId: row.parentProId, |
| | | }; |
| | | this.$modal |
| | | .confirm("是否确认删除?") |
| | | .then(() => { |
| | | return delTbBycusCardIdAndProId(data); |
| | | }) |
| | | .then(() => { |
| | | this.TotalPrice1 = 0; |
| | | getTransitionList1(row.cusId).then((response) => { |
| | | this.tableData1 = response.data; |
| | | |
| | | this.tableData1.forEach((item) => { |
| | | this.TotalPrice1 += item.ordPrice; |
| | | this.TotalPrice += item.nowPrice; |
| | | }); |
| | | 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.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | getCompanyList() { |
| | | this.loading = true; |
| | | getconfigKey("team_reservation_default_day").then((res) => { |
| | |
| | | getReservation(id).then((response) => { |
| | | if (response.data) { |
| | | let cusId = response.data.idCard; |
| | | getTransitionList(cusId).then((response) => { |
| | | getTransitionList1(cusId).then((response) => { |
| | | if (response.data) { |
| | | this.tableData1 = response.data; |
| | | if (this.tableData1.length != 0) { |
| | |
| | | getReservation(id).then((response) => { |
| | | if (response.data) { |
| | | let cusId = response.data.idCard; |
| | | getTransitionList(cusId).then((response) => { |
| | | getTransitionList1(cusId).then((response) => { |
| | | if (response.data) { |
| | | this.tableData1 = response.data; |
| | | |
| | | if (this.tableData1.length != 0) { |
| | | this.TotalPrice1 = 0; |
| | | this.tableData1.forEach((item) => { |