| | |
| | | </div> |
| | | |
| | | <div> |
| | | <el-dialog :title="title" :visible.sync="opens" width="1350px" append-to-body :close-on-click-modal="false"> |
| | | <el-dialog :title="title" :visible.sync="opens" width="1350px" append-to-body :close-on-click-modal="true"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="7" :xs="24"> |
| | | <div style="padding: 0 20px"> |
| | |
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleGroup">保存</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-edit" size="mini" @click="xiangmuWh">项目维护</el-button> |
| | | <el-button type="primary" icon="el-icon-edit" size="mini" @click="xiangmuWh" >项目维护</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="singlegg" |
| | |
| | | </div> |
| | | |
| | | <div> |
| | | <el-dialog :title="title" :visible.sync="openOne" width="1400px" append-to-body :close-on-click-modal="false"> |
| | | <el-dialog :title="title" :visible.sync="openOne" width="1400px" append-to-body :close-on-click-modal="false" > |
| | | <el-row :gutter="24" v-if="!isTableVisible"> |
| | | |
| | | <el-col :span="15" :xs="24"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="折扣"> |
| | | <el-input-number ref="inputNumber" style="width: 150px" v-model="youhui" :precision="1" :step="0.1" |
| | | :min="0" :max="20" @change="debounceNumberChange" :debounce="3000"></el-input-number> |
| | | :min="0" :max="10" @change="debounceNumberChange" :debounce="3000"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="现价"> |
| | | <el-input ref="inputName" v-model="queryParams.xianprice" placeholder="合计" clearable |
| | |
| | | <el-table-column label="原价" align="center" prop="proPrice" width="85"></el-table-column> |
| | | <el-table-column label="折扣" width="151"> |
| | | <template slot-scope="scope"> |
| | | <!-- 只输入纯数字折扣 --> |
| | | <el-input-number v-model.number="scope.row.limits" @input="validateDiscount(scope.row)" |
| | | <!-- 只输入纯数字折扣 @input="validateDiscount(scope.row)"--> |
| | | <el-input-number v-model="scope.row.limits" |
| | | @change="handleManualChange(scope.row)" placeholder="输入折扣" size="mini" type="number" :min="0" |
| | | :step="0.1" :precision="1" :max="20"> |
| | | :step="0.1" :precision="1" :max="10"> |
| | | </el-input-number> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | updateProPrice(row) { |
| | | const proPrice = new Big(row.proPrice); |
| | | const limits = new Big(row.limits); |
| | | const result = proPrice.times(limits.div(10)); // ordPrice * (discount / 10) |
| | | row.ysPrice = result.toNumber(); |
| | | const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10) |
| | | row.ysPrice = result.toFixed(2); |
| | | this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || '0')); |
| | | }, new Big(0)).toNumber(); |
| | |
| | | updateProPrice1(row) { |
| | | const proPrice = new Big(row.proPrice); |
| | | const limits = new Big(row.limits); |
| | | const result = proPrice.times(limits.div(10)); |
| | | row.ysPrice = result.toNumber(); |
| | | const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10) |
| | | row.ysPrice = result.toFixed(2); |
| | | const totalYsPrice = this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || '0')); |
| | | }, new Big(0)); |
| | |
| | | } |
| | | |
| | | // Update youhui calculation |
| | | |
| | | if (this.queryParams.price !== 0 && this.queryParams.xianprice !== 0) { |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; |
| | | } else { |
| | | this.youhui = 0; |
| | | this.youhui = 10; |
| | | } |
| | | }, |
| | | debounceNumberChange(currentValue, oldValue) { |
| | |
| | | }, |
| | | changeXianjia() { |
| | | // 原始折扣率计算 |
| | | |
| | | |
| | | if (this.queryParams.price !== 0) { |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; |
| | | } |
| | | |
| | | }, |
| | | |
| | | getList() { |
| | |
| | | cancell() { |
| | | this.openss = false; |
| | | this.openOne = false; |
| | | this.youhui = 10 |
| | | // this.reset(); |
| | | }, |
| | | // 表单重置 |
| | |
| | | item.ysPrice = result.toNumber(); |
| | | this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || '0')); |
| | | }, new Big(0)); |
| | | }, new Big(0)).toNumber(); |
| | | }) |
| | | // ---------------------------------------------------------- |
| | | |
| | |
| | | this.loading = true; |
| | | if (this.forms.sex) { |
| | | deptTreeSelect(this.forms.sex).then((response) => { |
| | | console.log('111', response.rows); |
| | | |
| | | this.newpacName = response.rows; |
| | | this.loading = false; |
| | | response.rows.forEach((item, index) => { |
| | |
| | | }); |
| | | } else { |
| | | deptTreeSelect().then((response) => { |
| | | console.log('222', response.rows); |
| | | this.newpacName = response.rows; |
| | | this.loading = false; |
| | | response.rows.forEach((item, index) => { |
| | |
| | | handleSearch() { |
| | | if (this.queryParams.pacName) { |
| | | getPackageList(this.queryParams.pacName).then((response) => { |
| | | console.log('333', response.data); |
| | | this.newpacName = response.data; |
| | | response.data.forEach((item, index) => { |
| | | item.newID = |
| | |
| | | }); |
| | | } else { |
| | | deptTreeSelect().then((response) => { |
| | | console.log('44', response.rows); |
| | | this.newpacName = response.rows; |
| | | response.rows.forEach((item, index) => { |
| | | item.newID = |
| | |
| | | // 重新计算总价和现价 |
| | | this.OnenewpacName.forEach((item) => { |
| | | this.queryParams.price += item.proPrice; // 累加原价 |
| | | this.queryParams.xianprice += item.ysPrice || 0; // 累加现价,如果ysPrice为undefined则累加0 |
| | | //this.queryParams.xianprice += item.ysPrice || 0; 累加现价,如果ysPrice为undefined则累加0 |
| | | }); |
| | | |
| | | // 计算优惠,这里假设优惠是现价与原价的差额百分比 |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; |
| | | this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || '0')); |
| | | }, new Big(0)).toNumber(); |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 |
| | | } |
| | | }, |
| | | handledbelete(row) { |
| | |
| | | // 然后更新总价和现价 |
| | | this.OnenewpacName.forEach((item) => { |
| | | this.queryParams.price += item.proPrice; |
| | | this.queryParams.xianprice += item.ysPrice || 0; // 确保ysPrice存在 |
| | | this.queryParams.xianprice =this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || "0")); |
| | | }, new Big(0)).toNumber(); |
| | | }); |
| | | |
| | | // 计算优惠 |
| | | if (this.queryParams.price > 0) { |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; |
| | | } else { |
| | | this.youhui = 0; |
| | | this.youhui = 10; |
| | | } |
| | | }, |
| | | |
| | |
| | | this.forms.groupingName = item.groupingName; |
| | | this.forms.gtAge = item.gtAge; |
| | | this.forms.limits = item.limits; |
| | | this.youhui =item.limits |
| | | this.forms.ltAge = item.ltAge; |
| | | this.forms.pacName = item.pacName; |
| | | this.forms.payType = item.payType; |
| | |
| | | this.groupIds = selection.map((item) => item.id); |
| | | this.singlegg = !selection.length; |
| | | }, |
| | | handleBeforeClose(done) { |
| | | this.$confirm('确认关闭?') |
| | | .then(() => done()) |
| | | .catch(() => { /* 取消关闭 */ }); |
| | | }, |
| | | xiangmuWh() { |
| | | if (!this.forms.groupingName || |
| | | !this.forms.sex || |
| | |
| | | return; // Stop execution if any required field is empty |
| | | } |
| | | this.openOne = true; |
| | | |
| | | this.title = "分组项目维护"; |
| | | this.OnenewpacName = []; |
| | | this.queryParams.price = 0; |
| | |
| | | let id = this.groupList[0].id || ''; |
| | | getDetails(id).then((res) => { |
| | | this.OnenewpacName = res.data.groupingProList; |
| | | this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { |
| | | return sum.plus(new Big(item.ysPrice || '0')); |
| | | }, new Big(0)); |
| | | this.OnenewpacName.forEach((item, index) => { |
| | | this.queryParams.price += item.proPrice; |
| | | }); |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 |
| | | // this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { |
| | | // return sum.plus(new Big(item.ysPrice || '0')); |
| | | // }, new Big(0)).toNumber(); |
| | | |
| | | // this.OnenewpacName.forEach((item, index) => { |
| | | // this.queryParams.price += item.proPrice; |
| | | // }); |
| | | // |
| | | |
| | | // this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 |
| | | this.queryParams.xianprice = res.data.ysPrice |
| | | this.queryParams.price= res.data.price |
| | | this.youhui= res.data.limits |
| | | }); |
| | | } |
| | | // console.log(this.groupList[0].id, 9966); |
| | |
| | | deptTreeSelect(this.forms.sex).then((response) => { |
| | | // 套餐名称 |
| | | this.newpacName = response.rows; |
| | | console.log('5', response.rows); |
| | | this.loading = false; |
| | | response.rows.forEach((item, index) => { |
| | | item.newID = |
| | |
| | | |
| | | deptTreeSelect().then((response) => { |
| | | this.newpacName = response.rows; |
| | | console.log('6', response.rows); |
| | | this.loading = false; |
| | | response.rows.forEach((item, index) => { |
| | | item.newID = |
| | |
| | | } |
| | | getProjectList().then((response) => { |
| | | this.Treedata = response.data; |
| | | // console.log(this.Treedata,999888); |
| | | }); |
| | | }, |
| | | |
| | |
| | | proPrice: item.proPrice, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | let data = { |
| | | groupingName: this.forms.groupingName, |
| | |
| | | }, |
| | | // 修改分组 |
| | | GroupUpdate() { |
| | | console.log(this.$refs.elTable) |
| | | this.$refs.tbs.clearSelection(); |
| | | this.forms = { |
| | | groupingName: "", |