lkk
2024-12-31 b6a8dc4f0f93ba6628b41cf801e2a899672eecce
src/views/system/comp/index.vue
@@ -397,30 +397,6 @@
                  style="width: 130px"
                />
              </el-form-item> -->
              <el-form-item label="原价" prop="price">
                <el-input
                  v-model="forms.price"
                  placeholder="请输入原价"
                  style="width: 130px"
                />
              </el-form-item>
              <el-form-item label="折扣" prop="limits">
                <el-input
                  v-model="forms.limits"
                  placeholder="请输入折扣"
                  style="width: 130px"
                  @change="numberChange"
                />
                <!-- :disabled="isfalse" -->
              </el-form-item>
              <el-form-item label="优惠价" prop="ysPrice">
                <el-input
                  v-model="forms.ysPrice"
                  placeholder="请输入应收"
                  style="width: 120px"
                />
              </el-form-item>
              <el-form-item label="结算方式" prop="payType">
                <el-select
                  v-model="forms.payType"
@@ -445,6 +421,31 @@
                  <el-input v-model="forms.gtAge" style="width: 54px" />
                </el-col>
              </el-form-item>
              <el-form-item label="原价" prop="price">
                <el-input
                  v-model="forms.price"
                  placeholder="请输入原价"
                  style="width: 130px"
                />
              </el-form-item>
              <el-form-item label="折扣" prop="limits">
                <el-input
                  v-model="forms.limits"
                  placeholder="请输入折扣"
                  style="width: 130px"
                  @change="numberChange"
                />
                <!-- :disabled="isfalse" -->
              </el-form-item>
              <el-form-item label="优惠价" prop="ysPrice">
                <el-input
                  v-model="forms.ysPrice"
                  placeholder="请输入应收"
                  style="width: 120px"
                />
              </el-form-item>
            </el-form>
            <el-row :gutter="10" class="mb8">
@@ -462,6 +463,7 @@
                  type="primary"
                  icon="el-icon-edit"
                  size="mini"
                  :disabled="singlegg"
                  @click="xiangmuWh"
                  >项目维护</el-button
                >
@@ -643,6 +645,7 @@
                  {{ scope.row.proName + "/" + scope.row.proPrice }}
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" width="68">
                <template slot-scope="scope">
                  <el-button
@@ -828,10 +831,16 @@
                align="center"
                prop="proName"
              >
                <template slot-scope="scope">
                  {{ scope.row.proName + "/" + scope.row.proPrice }}
                </template>
              </el-table-column>
              <el-table-column
                label="原价"
                align="center"
                prop="proPrice"
              ></el-table-column>
              <el-table-column label="操作" align="center" width="68">
                <template slot-scope="scope">
                  <el-button
@@ -852,7 +861,7 @@
                size="medium "
                icon="el-icon-back"
                @click="resetright"
                >确 认</el-button
                ></el-button
              >
            </div>
          </el-col>
@@ -892,13 +901,15 @@
              :data="Treedata"
              @selection-change="handleChangesingle"
              height="478"
              style="width: 70%"
            >
              <el-table-column type="selection" width="40px" align="center" />
              <el-table-column label="项目名称" align="center" prop="proName" />
              <el-table-column label="项目名称" align="center" prop="proName" width="130" />
              <el-table-column
                label="项目价格/元"
                align="center"
                prop="proPrice"
                width="100"
              />
            </el-table>
          </el-col>
@@ -1271,6 +1282,7 @@
        (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 +
@@ -1424,9 +1436,6 @@
    },
    // 折扣
    numberChange(currentValue) {
      console.log(this.forms.limits, 888);
      console.log(currentValue, 666);
      this.forms.limits = currentValue;
      /* if (this.forms.limits > this.getInfodis) {
        this.forms.limits = this.getInfodis;
@@ -1537,6 +1546,7 @@
      }
      getProjectList().then((response) => {
        this.Treedata = response.data;
      });
    },
@@ -1642,7 +1652,51 @@
      ).toFixed(2);
      // console.log(this.groupingList, 555);
      this.handleGroup();
      let mapList = [];
      this.OnenewpacName.forEach((item) => {
        mapList.push({
          proName: item.proName,
          proId: item.proId,
          proPrice: item.proPrice,
        });
      });
      // 如果 selectionList 为空,使用 mapList 继续保存
      if (this.OnenewpacName.length === 0) {
        this.$modal.msgError("请先选中项目");
        return; // 提示用户选中项目
      }
      let data = {
        groupingName: this.forms.groupingName,
        gtAge: this.forms.gtAge,
        limits: this.forms.limits,
        ltAge: this.forms.ltAge,
        pacName: this.forms.pacName,
        payType: this.forms.payType,
        sex: this.forms.sex,
        dwDeptId: this.selectionList.length > 0 ? this.selectionList[0].id : "", // 如果没有选中部门,设置为空
        dwId: this.selectionList.length > 0 ? this.selectionList[0].dwId : "",
        mapList: mapList,
        price: this.forms.price,
        ysPrice: this.forms.ysPrice,
        id: this.groupList[0].id,
      };
      // 发送请求保存数据
      dwgrouping(data).then((res) => {
        if (res.code == 200) {
          this.beCurrent();
          this.forms.groupingName = "";
          this.forms.sex = "";
          this.forms.pacName = "";
          this.forms.price = "";
          this.forms.ysPrice = "";
          this.forms.payType = "";
        }
      });
      // this.handleGroup();
    },
    // 套餐单项获取
    handleChangeOne(selection) {
@@ -1757,6 +1811,12 @@
      getDetails(id).then((res) => {
        this.OnenewpacName = res.data.groupingProList;
        this.OnenewpacName.forEach((item, index) => {
          this.queryParams.price += item.proPrice;
        });
        // return this.OnenewpacName.forEach((item) => {
        //   this.queryParams.price += item.proPrice;
        // });
      });
      if (this.forms.sex) {
        deptTreeSelect(this.forms.sex).then((response) => {
@@ -1785,6 +1845,7 @@
      }
      getProjectList().then((response) => {
        this.Treedata = response.data;
        // console.log(this.Treedata,999888);
      });
    },
    //保存分组
@@ -1853,14 +1914,14 @@
    }, */
    handleGroup() {
      // 如果没有选中任何部门(即没有 selectionList),可以直接从 OnenewpacName 获取数据
      // let mapList = [];
      /*  this.OnenewpacName.forEach((item) => {
      let mapList = [];
      this.OnenewpacName.forEach((item) => {
        mapList.push({
          proName: item.proName,
          proId: item.proId,
          proPrice: item.proPrice,
        });
      }); */
      });
      // 如果 selectionList 为空,使用 mapList 继续保存
      /* if (this.OnenewpacName.length === 0) {
@@ -1883,7 +1944,7 @@
        sex: this.forms.sex,
        dwDeptId: this.selectionList.length > 0 ? this.selectionList[0].id : "", // 如果没有选中部门,设置为空
        dwId: this.selectionList.length > 0 ? this.selectionList[0].dwId : "",
        // mapList: mapList,
        mapList: mapList,
        price: this.forms.price,
        ysPrice: this.forms.ysPrice,
        id: this.groupList[0].id,