qx
2024-06-20 772d8df8a3ee02a6fe2dbd6ba7216e3e3ee0ec63
src/views/system/package/index.vue
@@ -301,8 +301,9 @@
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1100px"
      width="1500px"
      append-to-body
      :close-on-click-modal="false"
    >
      <el-form
        ref="form"
@@ -499,7 +500,7 @@
      </el-table> -->
      <el-row :gutter="20">
        <el-col :span="6">
        <el-col :span="7">
          <div
            style="text-align: center; margin-bottom: 10px; margin-top: 10px"
          >
@@ -519,6 +520,7 @@
              :default-checked-keys="checkedkey"
              :filter-node-method="filterNode"
              ref="tree"
              :render-content="renderContent"
            >
            </el-tree>
          </div>
@@ -541,6 +543,7 @@
              @check-change="handleCurrentChecked1"
              :default-checked-keys="checkedListkey"
              ref="trees"
              :render-content="renderContent"
            >
            </el-tree>
          </div>
@@ -561,9 +564,9 @@
            >
              <el-table-column prop="propinName" label="检查项目">
              </el-table-column>
              <el-table-column prop="proName" label="明细项目" width="260px">
              </el-table-column>
              <el-table-column prop="proPrice" label="原价" width="56px">
              </el-table-column>
              <el-table-column prop="proName" label="明细项目" width="260px">
              </el-table-column>
              <!-- <el-table-column
@@ -584,6 +587,7 @@
                </template> 
              </el-table-column>-->
            </el-table>
            <div>合计:{{ pics }}元</div>
          </div>
        </el-col>
      </el-row>
@@ -640,7 +644,6 @@
  components: { Packages },
  data() {
    let checkPhoneNum = (rule, value, callback) => {
      console.log(value);
      let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
      if (value == "" && value == undefined && !value) {
        return callback("");
@@ -651,6 +654,7 @@
      }
    };
    return {
      pics: 0,
      filterText: "",
      DataList: [],
      list1: true,
@@ -696,6 +700,7 @@
      newproName: [],
      // 所有体检项目·
      allList: [],
      treeList: [],
      // 所有套餐数据
      // allpackage:[],
      // 弹出层标题
@@ -794,7 +799,6 @@
      });
    },
    sel(val) {
      console.log(val);
      let id = val;
      this.keys = "";
      id.forEach((item) => {
@@ -808,9 +812,7 @@
        this.categoryList = response.rows;
      });
    },
    shangpin(vals) {
      console.log(vals);
    },
    shangpin(vals) {},
    // 取消按钮
    cancel() {
      this.open = false;
@@ -876,6 +878,8 @@
      this.open = true;
      this.title = "体检套餐信息维护";
      this.DataList = [];
      this.checkedkey = [];
      this.checkedListkey = [];
      this.getDataList();
      // getAllList().then((response) => {
      //   this.allList = response.data;
@@ -928,7 +932,7 @@
      // });
      getPacInFo(this.forms.pacId).then((response) => {
        this.form = response.data;
        this.form.keywords=this.form.keywords.slice(0, -1);
        this.form.keywords = this.form.keywords.slice(0, -1);
        this.form.keywords = this.form.keywords.split(",");
        this.DataList = [];
        this.checkedkey = [];
@@ -942,7 +946,7 @@
      this.open = true;
      getPacInFo(row.pacId).then((response) => {
        this.form = response.data;
        this.form.keywords=this.form.keywords.slice(0, -1);
        this.form.keywords = this.form.keywords.slice(0, -1);
        this.form.keywords = this.form.keywords.split(",");
        this.DataList = [];
        this.checkedkey = [];
@@ -1031,7 +1035,6 @@
    },
    //  // 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 }
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      // console.log(row, column, rowIndex, columnIndex);
      let fields = ["propinName"];
      let cellValue = row[column.property];
      if (cellValue && fields.includes(column.property)) {
@@ -1050,7 +1053,14 @@
        }
      }
    },
    renderContent(h, { node, data, store }) {
      return (
        <span class="custom-tree-node">
          <span>{node.label}</span>
          <span>({data.proPrice}元)</span>
        </span>
      );
    },
    getDataList() {
      this.loading = true;
      getProParentIdDxList().then((response) => {
@@ -1067,12 +1077,17 @@
                    item2.disabled = true;
                    this.checkedListkey.push(item2.proId);
                    this.DataList.push(item2);
                    this.pics = 0;
                    if (this.DataList.length != 0) {
                      this.DataList.forEach((item) => {
                        this.pics += item.proPrice;
                        if (item.proParentId == item1.proId) {
                          item.propinName = item1.proName;
                          item.propinPrice = item1.proPrice;
                        }
                      });
                      this.DataList.forEach((item) => {
                        this.pics += item.proPrice;
                      });
                    }
                  });
@@ -1093,6 +1108,9 @@
                item.propinName = this.Treedata[0].proName;
                item.propinPrice = this.Treedata[0].proPrice;
              });
              this.DataList.forEach((item) => {
                this.pics += item.proPrice;
              });
            });
          });
        }
@@ -1100,7 +1118,6 @@
      });
    },
    handleCurrentChecked(data, checked, checkedNodes) {
      console.log(data, checked);
      this.dataObj = data;
      this.checkedObj = checked;
      if (checked == true) {
@@ -1113,7 +1130,9 @@
            this.checkedListkey.push(item.proId);
            this.DataList.push(item);
            this.spliceData();
            this.pics = 0;
            this.DataList.forEach((item1) => {
              this.pics += item1.proPrice;
              if (item1.proParentId == data.proId) {
                item1.propinName = data.proName;
                item1.propinPrice = this.dataObj.proPrice;
@@ -1121,10 +1140,12 @@
            });
          });
          this.TotalPrice1 = 0;
          this.pics = 0;
          if (this.DataList.length != 0) {
            this.list1 = false;
            this.DataList.forEach((item) => {
              this.TotalPrice1 = item.proPrice + this.TotalPrice1;
              this.pics += item.proPrice;
            });
          }
        });
@@ -1136,11 +1157,14 @@
            item.disabled = true;
          });
          this.checkedListkey = [];
          console.log(this.TreedataList.length);
          this.DataList.forEach((item, index) => {
            if (item.proParentId == this.dataObj.proId) {
              this.DataList.splice(index, this.TreedataList.length);
            }
          });
          this.pics = 0;
          this.DataList.forEach((item, index) => {
            this.pics += item.proPrice;
          });
        });
      }
@@ -1166,14 +1190,18 @@
          if (item.proId == data.proId) {
            this.DataList.splice(index, 1);
            this.TotalPrice1 = 0;
            this.pics = 0;
            this.DataList.forEach((item1) => {
              this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
              this.pics += item1.proPrice;
              // this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
            });
          }
        });
      } else if (checked == true) {
        this.DataList.push(data);
        this.pics = 0;
        this.DataList.forEach((item1) => {
          this.pics += item1.proPrice;
          if (item1.proParentId == this.dataObj.proId) {
            item1.propinName = this.dataObj.proName;
            item1.propinPrice = this.dataObj.proPrice;
@@ -1181,8 +1209,10 @@
        });
        this.spliceData();
        this.TotalPrice1 = 0;
        this.pics = 0;
        this.DataList.forEach((item1) => {
          this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
          // this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
          this.pics += item1.proPrice;
        });
      }
    },
@@ -1207,7 +1237,18 @@
      if (this.form.pacName) {
        this.form.tjProjectList = [];
        if (this.DataList.length != 0) {
          this.DataList.forEach((item) => {
          this.treeList = JSON.parse(JSON.stringify(this.DataList));
          for (var i = 0; i < this.treeList.length; i++) {
            for (var j = i + 1; j < this.treeList.length; j++) {
              if (
                this.treeList[i].proParentId == this.treeList[j].proParentId
              ) {
                this.treeList.splice(j, 1);
                j--;
              }
            }
          }
          this.treeList.forEach((item) => {
            this.form.tjProjectList.push({
              // id: 0,
              proName: item.propinName,
@@ -1226,12 +1267,12 @@
              // } else {
              //   this.form.pacStatus = 1;
              // }
              if(this.keys){
              if (this.keys) {
                this.form.keywords = this.keys;
              }else{
              } else {
                this.form.keywords = this.form.keywords.toString();
              }
              updatePackage(this.form).then((response) => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
@@ -1244,7 +1285,6 @@
              // } else {
              //   this.form.pacStatus = 1;
              // }
              // console.log(this.form.tjProjectList);
              // return;
              addPackage(this.form).then((response) => {
                this.$modal.msgSuccess("新增成功");
@@ -1385,4 +1425,12 @@
  overflow-y: auto;
  border: 1px solid #d9d9d9;
}
/* .custom-tree-node {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    padding-right: 8px;
  } */
</style>