| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="套餐分类" prop="categoryId"> |
| | | <el-form-item label="体检类别" prop="tjCategory"> |
| | | <el-select |
| | | v-model="queryParams.categoryId" |
| | | v-model="queryParams.tjCategory" |
| | | placeholder="请选择状态" |
| | | style="width: 200px" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="dict in categoryList" |
| | | v-for="dict in dict.type.dict_tjtype" |
| | | :key="dict.id" |
| | | :label="dict.name" |
| | | :value="dict.id" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | /> |
| | | <!-- <el-table-column label="编号" align="center" prop="pacId" /> --> |
| | | <el-table-column |
| | | label="套餐分类" |
| | | label="体检类别" |
| | | width="100px" |
| | | align="center" |
| | | prop="categoryNames" |
| | | fixed |
| | | ></el-table-column> |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.dict_tjtype" |
| | | :value="scope.row.tjCategory" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="套餐名称" |
| | | align="center" |
| | |
| | | align="center" |
| | | prop="retailPrice" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="原价" |
| | | width="90px" |
| | | align="center" |
| | | prop="counterPrice" |
| | | ></el-table-column> |
| | | ></el-table-column> --> |
| | | <el-table-column |
| | | label="已售数量" |
| | | width="90px" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="套餐类目" prop="categoryId"> |
| | | <!-- <el-input |
| | | v-model="form.createId" |
| | | placeholder="请输入商品类目" |
| | | style="width: 200px" |
| | | /> --> |
| | | <!-- <el-form-item label="套餐类目" prop="categoryId"> |
| | | <el-select |
| | | v-model="form.categoryId" |
| | | placeholder="请选择套餐类目" |
| | |
| | | :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="关键字" prop="keywords"> |
| | | </el-form-item> --> |
| | | <el-form-item label="体检类别" prop="tjCategory"> |
| | | <el-select |
| | | multiple |
| | | v-model="form.keywords" |
| | | placeholder="请选择关键字" |
| | | v-model="form.tjCategory" |
| | | placeholder="请选择体检类别" |
| | | style="width: 150px" |
| | | @change="sel" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in keywordList" |
| | | :key="item.id" |
| | | :label="item.keyword" |
| | | :value="item.id" |
| | | v-for="dict in dict.type.dict_tjtype" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="是否上架" prop="isOnSale"> |
| | | <!-- <el-radio-group v-model="form.pacStatus"> |
| | | <el-radio :label="0">启用</el-radio> |
| | |
| | | <el-select |
| | | v-model="form.isOnSale" |
| | | placeholder="请选择是否上架" |
| | | style="width: 150px" |
| | | style="width: 140px" |
| | | filterable |
| | | clearable |
| | | > |
| | |
| | | style="width: 140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="体检类别" prop="tjCategory"> |
| | | <el-form-item label="关键字" prop="keywords"> |
| | | <el-select |
| | | v-model="form.tjCategory" |
| | | placeholder="请选择体检类别" |
| | | style="width: 150px" |
| | | multiple |
| | | v-model="form.keywords" |
| | | placeholder="请选择关键字" |
| | | style="width: 160px" |
| | | @change="sel" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.dict_tjtype" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | v-for="item in keywordList" |
| | | :key="item.id" |
| | | :label="item.keyword" |
| | | :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | Seachopen: false, |
| | | checkedNodes: [], |
| | | pacId: "", |
| | | // 总条数 |
| | | total: 0, |
| | |
| | | pageSize: 10, |
| | | pacName: null, |
| | | pacRemark: null, |
| | | |
| | | }, |
| | | queryParams1: { |
| | | page: 1, |
| | |
| | | // categoryId: [ |
| | | // { required: true, validator: checkPhoneNum, trigger: "change" }, |
| | | // ], |
| | | keywords: [ |
| | | /* keywords: [ |
| | | { required: true, validator: checkPhoneNum, trigger: "change" }, |
| | | ], |
| | | ], */ |
| | | isOnSale: [ |
| | | { required: true, validator: checkPhoneNum, trigger: "change" }, |
| | | ], |
| | |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | ], |
| | | counterPrice: [ |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | ], |
| | | tjCategory: [ |
| | | { required: true, validator: checkPhoneNum, trigger: "blur" }, |
| | | ], |
| | | }, |
| | |
| | | this.loading = true; |
| | | listCategory(this.queryParams).then((response) => { |
| | | this.categoryList = response.rows; |
| | | console.log(this.categoryList, 9988); |
| | | }); |
| | | }, |
| | | shangpin(vals) {}, |
| | |
| | | // }); |
| | | getPacInFo(this.forms.pacId).then((response) => { |
| | | this.form = response.data; |
| | | console.log(this.form, 2233); |
| | | |
| | | this.form.keywords = this.form.keywords.slice(0, -1); |
| | | this.form.keywords = this.form.keywords.split(","); |
| | | // this.DataList = []; |
| | |
| | | this.open = true; |
| | | getPacInFo(row.pacId).then((response) => { |
| | | this.form = response.data; |
| | | console.log(this.form, 445); |
| | | |
| | | this.form.keywords = this.form.keywords.slice(0, -1); |
| | | this.form.keywords = this.form.keywords.split(","); |
| | | this.DataList = []; |
| | |
| | | /** 删除按钮操作 */ |
| | | 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); // 取消选中状态 |
| | | // 从 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) { |
| | |
| | | (total, item) => total + item.priceOrd, |
| | | 0 |
| | | ); |
| | | |
| | | // 确保在数据加载后保持选中状态 |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCheckedKeys(this.checkedNodes); |
| | | }); |
| | | }); |
| | | this.loading = false; |
| | | }, |
| | |
| | | // }); |
| | | // }, |
| | | handleFilterInput() { |
| | | this.queryParams.page = 1; // 搜索时重置为第一页 |
| | | this.queryParams1.page = 1; // 搜索时重置为第一页 |
| | | this.getDataList(); // 调用接口获取数据 |
| | | // 在过滤后,重新设置选中状态 |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCheckedKeys(this.checkedNodes); |
| | | }); |
| | | }, |
| | | |
| | | // 分页事件 |
| | |
| | | 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 |
| | | // 取消选中时,从DataList中移除 |
| | | this.DataList = this.DataList.filter( |
| | | (item) => item.proId !== data.proId |
| | | ); |
| | | if (index !== -1) { |
| | | this.DataList.splice(index, 1); |
| | | // 从 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++) { |
| | |
| | | if (this.keys) { |
| | | this.form.keywords = this.keys; // 如果有 this.keys,则直接赋值 |
| | | } else { |
| | | this.form.keywords = this.form.keywords.toString(); // 如果没有,则将 this.form.keywords 转成字符串 |
| | | // this.form.keywords = this.form.keywords; // 如果没有,则将 this.form.keywords 转成字符串 |
| | | } |
| | | |
| | | let packageProjects = []; // 定义一个空数组 |
| | |
| | | price: this.pics, |
| | | pacId: this.form.pacId || null, |
| | | isOnSale: this.form.isOnSale, |
| | | keywords: this.form.keywords, |
| | | // keywords: this.form.keywords, |
| | | sort: this.form.sort, |
| | | retailPrice: this.form.retailPrice, |
| | | tjCategory: this.form.tjCategory, |