qinxianzhangyao
2024-07-12 f169a06cea16bc6215743a7be07febdb1d4fdc38
src/views/system/comp/index.vue
@@ -453,7 +453,6 @@
                  icon="el-icon-plus"
                  size="mini"
                  @click="handleGroup"
                  v-hasPermi="['system:comp:add']"
                  >保存</el-button
                >
              </el-col>
@@ -464,7 +463,6 @@
                  size="mini"
                  :disabled="singlegg"
                  @click="GroupUpdate"
                  v-hasPermi="['system:comp:edit']"
                  >重置</el-button
                >
                <el-button
@@ -473,7 +471,6 @@
                  size="mini"
                  :disabled="singlegg"
                  @click="deleteGroup"
                  v-hasPermi="['system:comp:edit']"
                  >删除</el-button
                >
              </el-col>
@@ -606,16 +603,19 @@
                  style="width: 140px"
                />
              </el-form-item>
              <el-form-item>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">重置</el-button>
      </el-form-item>
            </el-form>
            <div style="color: red; font-size: 8px">
            <!-- <div style="color: red; font-size: 8px">
              注释:鼠标左键双击选中行可删除
            </div>
            </div> -->
            <!--       @row-dblclick="dbclick" -->
            <el-table
              border
              v-loading="loading"
              :data="OnenewpacName"
              :row-class-name="tableRowClassName"
              @row-dblclick="dbclick"
              height="478"
            >
              <el-table-column
@@ -625,6 +625,17 @@
              >
                <template slot-scope="scope">
                  {{ scope.row.proName + "/" + scope.row.proPrice }}
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" width="68">
                <template slot-scope="scope">
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-delete"
                    @click="handledbelete(scope.row)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
@@ -1011,31 +1022,31 @@
        contactPhone: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        taxNumber: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        legalPerson: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        registerAddress: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        bankAccount: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        countNum: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        principal: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        faxNumber: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        mailingAddress: [
          { required: true, validator: checkPhoneNum, trigger: "blur" },
        ],
        email: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
        // taxNumber: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // legalPerson: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // registerAddress: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // bankAccount: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // countNum: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // principal: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // faxNumber: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // mailingAddress: [
        //   { required: true, validator: checkPhoneNum, trigger: "blur" },
        // ],
        // email: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
      },
    };
  },
@@ -1126,6 +1137,11 @@
      this.resetForm("queryForm");
      this.handleQuery();
    },
    resetQuerys(){
      this.OnenewpacName = [],
      this.queryParams.price = 0,
       this.$refs.tbone.toggleRowSelection(this.pacList[0], false);
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      selection.forEach((item) => {
@@ -1212,36 +1228,36 @@
              index +
              1;
          });
          if (this.groupList.length >= 1) {
            if (this.groupList[0].id) {
              getfzgrouping(this.groupList[0].id).then((response) => {
                this.OnenewpacName = response.data.groupingProList;
                this.queryParams.price = 0;
                this.OnenewpacName.forEach((item) => {
                  this.queryParams.price += item.proPrice;
                });
              });
            }
          }
          // if (this.groupList.length >= 1) {
          //   if (this.groupList[0].id) {
          //     getfzgrouping(this.groupList[0].id).then((response) => {
          //       this.OnenewpacName = response.data.groupingProList;
          //       this.queryParams.price = 0;
          //       this.OnenewpacName.forEach((item) => {
          //         this.queryParams.price += item.proPrice;
          //       });
          //     });
          //   }
          // }
          if (this.newpacName.length != 0) {
            this.$nextTick(() => {
              if (this.forms.pacName) {
                this.newpacName.forEach((item, index) => {
                  if (this.forms.pacName == item.pacName) {
                    this.$refs.tbone.toggleRowSelection(
                      this.newpacName[index],
                      true
                    );
                  }
                });
              } else {
                this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
              }
            });
          } else {
            this.$refs.tbone.clearSelection();
          }
          // if (this.newpacName.length != 0) {
          //   this.$nextTick(() => {
          //     if (this.forms.pacName) {
          //       this.newpacName.forEach((item, index) => {
          //         if (this.forms.pacName == item.pacName) {
          //           this.$refs.tbone.toggleRowSelection(
          //             this.newpacName[index],
          //             true
          //           );
          //         }
          //       });
          //     } else {
          //       this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
          //     }
          //   });
          // } else {
          //   this.$refs.tbone.clearSelection();
          // }
        });
      } else {
        deptTreeSelect().then((response) => {
@@ -1253,35 +1269,35 @@
              index +
              1;
          });
          if (this.groupList.length >= 1) {
            if (this.groupList[0].id) {
              getfzgrouping(this.groupList[0].id).then((response) => {
                this.OnenewpacName = response.data.groupingProList;
                this.queryParams.price = 0;
                this.OnenewpacName.forEach((item) => {
                  this.queryParams.price += item.proPrice;
                });
              });
            }
          }
          if (this.newpacName.length != 0) {
            this.$nextTick(() => {
              if (this.forms.pacName) {
                this.newpacName.forEach((item, index) => {
                  if (this.forms.pacName == item.pacName) {
                    this.$refs.tbone.toggleRowSelection(
                      this.newpacName[index],
                      true
                    );
                  }
                });
              } else {
                this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
              }
            });
          } else {
            this.$refs.tbone.clearSelection();
          }
          // if (this.groupList.length >= 1) {
          //   if (this.groupList[0].id) {
          //     getfzgrouping(this.groupList[0].id).then((response) => {
          //       this.OnenewpacName = response.data.groupingProList;
          //       this.queryParams.price = 0;
          //       this.OnenewpacName.forEach((item) => {
          //         this.queryParams.price += item.proPrice;
          //       });
          //     });
          //   }
          // }
          // if (this.newpacName.length != 0) {
          //   this.$nextTick(() => {
          //     if (this.forms.pacName) {
          //       this.newpacName.forEach((item, index) => {
          //         if (this.forms.pacName == item.pacName) {
          //           this.$refs.tbone.toggleRowSelection(
          //             this.newpacName[index],
          //             true
          //           );
          //         }
          //       });
          //     } else {
          //       this.$refs.tbone.toggleRowSelection(this.newpacName[0], true);
          //     }
          //   });
          // } else {
          //   this.$refs.tbone.clearSelection();
          // }
        });
      }
      getProjectList().then((response) => {
@@ -1357,6 +1373,17 @@
        this.queryParams.price += item.proPrice;
      });
    },
    handledbelete(row){
      this.queryParams.price = 0;
      this.OnenewpacName.forEach((item,index) => {
        if(item.proId == row.proId){
          this.OnenewpacName.splice(index, 1);
        }
      });
      return this.OnenewpacName.forEach((item) => {
        this.queryParams.price += item.proPrice;
      });
    },
    submitrighr() {
      if (this.pacList.length >= 1) {
        this.openss = false;
@@ -1372,30 +1399,22 @@
    },
    // 套餐单项获取
    handleChangeOne(selection) {
      this.pacList = selection;
      this.OnenewpacName.forEach((item,index) => {
        this.dataLists.forEach(item1 => {
          if(item.proId == item1.proId){
            this.OnenewpacName.splice(index,1)
          }
        })
      })
      this.dataLists = [];
      this.queryParams.price = 0;
      this.pacList.forEach((item) => {
        this.dataLists = item.tjProjectList;
      });
      this.dataLists.forEach((item2) => {
        this.OnenewpacName.push(item2);
      });
      this.OnenewpacName.forEach((item) => {
        this.queryParams.price += item.proPrice;
      });
      if (selection.length > 1) {
        let del_row = selection.shift();
        this.$refs.tbone.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      this.pacList = selection;
      this.dataLists = [];
      this.queryParams.price = 0;
      this.pacList.forEach((item) => {
        this.OnenewpacName = item.tjProjectList;
      });
      // this.dataLists.forEach((item2) => {
      //   this.OnenewpacName.push(item2);
      // });
      this.OnenewpacName.forEach((item) => {
        this.queryParams.price += item.proPrice;
      });
    },
    beCurrentDept() {
      Deptlist(this.form.drugManufacturerId).then((response) => {
@@ -1582,6 +1601,7 @@
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.drugManufacturerId != null) {
@@ -1591,11 +1611,16 @@
              this.getList();
            });
          } else {
            addComp(this.form).then((response) => {
            if(this.form.cnName && this.form.contactPerson && this.form.contactPhone){
              addComp(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
            }else{
              this.$modal.msgError("请填写必传项");
            }
          }
        }
      });