| | |
| | | </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-input v-model="forms.gtAge" style="width: 54px" /> |
| | | </el-col> |
| | | </el-form-item> |
| | | |
| | | |
| | | |
| | | |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" :xs="24"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
| | | <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
| | | label-width="68px" @submit.native.prevent> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称" prop="proName"> |
| | | <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable |
| | | <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable |
| | | @keyup.enter.native="handleSearchFor" style="width: 140px" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | }}</span>条</div> |
| | | |
| | | </el-col> |
| | | <el-col :span="2" :xs="24"> |
| | | <!-- <el-col :span="2" :xs="24"> |
| | | <div style="margin: 240% 16%" class="btntoleft"> |
| | | <el-button type="primary" size="medium" |
| | | style="writing-mode: vertical-rl; text-align: center; letter-spacing: 5px;" @click="resetright"> |
| | |
| | | <i class="el-icon-back"></i> |
| | | </el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="7" :xs="24"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
| | | <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
| | | label-width="68px" @submit.native.prevent> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="项目名称" prop="proName"> |
| | | <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable |
| | | <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable |
| | | @keyup.enter.native="handleSearchFor" style="width: 140px" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" :xs="24"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
| | | <el-form :model="queryParams" ref="queryForm1" size="small" :inline="true" v-show="showSearch" |
| | | label-width="68px" @submit.native.prevent> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">选择套餐</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称" prop="proName"> |
| | | <el-input ref="inputName" v-model="queryParams.proName" placeholder="请输入项目名称" clearable |
| | | <el-input ref="inputName" v-model="queryParams1.proName" placeholder="请输入项目名称" clearable |
| | | @keyup.enter.native="handleSearchFor" style="width: 140px" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | xianprice: null, |
| | | limits: null |
| | | }, |
| | | queryParams1: { |
| | | proName: null, |
| | | pym: null, |
| | | }, |
| | | id: "", |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | 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)); |
| | |
| | | }, |
| | | changeXianjia() { |
| | | // 原始折扣率计算 |
| | | |
| | | |
| | | if (this.queryParams.price !== 0) { |
| | | this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; |
| | | } |
| | | |
| | | }, |
| | | |
| | | getList() { |
| | |
| | | (this.loading = true); |
| | | listComp(this.queryParams).then((response) => { |
| | | this.compList = response.rows; |
| | | |
| | | response.rows.forEach((item, index) => { |
| | | item.newID = |
| | | (this.queryParams.pageNum - 1) * this.queryParams.pageSize + |
| | |
| | | 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(); |
| | | }) |
| | | // ---------------------------------------------------------- |
| | | |
| | |
| | | }); |
| | | } else { |
| | | deptTreeSelect().then((response) => { |
| | | console.log('222', response.rows); |
| | | |
| | | this.newpacName = response.rows; |
| | | this.loading = false; |
| | | response.rows.forEach((item, index) => { |
| | |
| | | } |
| | | }, |
| | | handleSearchFor() { |
| | | getProjectList(this.queryParams.proName).then((response) => { |
| | | |
| | | response.data.forEach((item, index) => { |
| | | item.newID = |
| | | (this.queryParams.pageNum - 1) * this.queryParams.pageSize + |
| | | index + |
| | | 1; |
| | | // 判断是否为汉字 |
| | | const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char) |
| | | if (isChineseChar(this.queryParams1.proName)) { |
| | | this.queryParams1.pym = null |
| | | getProjectList(this.queryParams1).then((response) => { |
| | | this.Treedata = response.data; |
| | | }); |
| | | this.Treedata = response.data; |
| | | }); |
| | | } else { |
| | | this.queryParams1.pym = this.queryParams1.proName |
| | | this.queryParams1.proName = null |
| | | getProjectList(this.queryParams1).then((response) => { |
| | | this.Treedata = response.data; |
| | | }); |
| | | } |
| | | }, |
| | | // 单项数据获取 |
| | | handleChangesingle(selection) { |
| | | console.log(selection,22222222) |
| | | if (selection) { |
| | | this.dataList = selection; |
| | | this.resetright() |
| | | } |
| | | }, |
| | | resetright() { |
| | |
| | | const newItemsToAdd = []; // 用于存储新需要添加的项目 |
| | | |
| | | this.dataList.forEach((item) => { |
| | | this.$refs.tre.toggleRowSelection(item, false); // 取消选中状态 |
| | | |
| | | // 使用 $set 确保响应性 |
| | | this.$set(item, 'limits', 10); // 设置限制数量 |
| | | this.$set(item, 'ysPrice', item.proPrice); // 设置现价为原价 |
| | |
| | | newItemsToAdd.push(item); // 如果不存在相同项目,则添加到新数组 |
| | | this.updateProPrice(item); |
| | | } |
| | | this.$refs.tre.toggleRowSelection(item, false); // 取消选中状态 |
| | | }); |
| | | |
| | | // 添加新项目到 OnenewpacName |
| | | this.OnenewpacName.push(...newItemsToAdd); |
| | | |
| | | console.log( this.OnenewpacName,2121) |
| | | // 删除重复项目,这里我们只需处理新添加的项目和原有项目之间的重复 |
| | | for (let i = this.OnenewpacName.length - newItemsToAdd.length; i < this.OnenewpacName.length - 1; i++) { |
| | | for (let j = i + 1; j < this.OnenewpacName.length; j++) { |
| | |
| | | // 重新计算总价和现价 |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | } |
| | | getProjectList().then((response) => { |
| | | this.Treedata = response.data; |
| | | // console.log(this.Treedata,999888); |
| | | }); |
| | | }, |
| | | |