wwl
2025-05-23 cf5c251714eb8574518777063afa339f95dcbda6
src/views/system/zhiye/index.vue
@@ -222,22 +222,7 @@
            <el-form-item label="查体分类" prop="examCategory" label-width="99px">
              <el-input :disabled="isDisabled" v-model="form.examCategory" placeholder="请输入查体分类" />
            </el-form-item>
            <el-form-item label="接害工龄年" prop="hazardYears" label-width="104px">
              <el-input :disabled="isDisabled" v-model="form.hazardYears" placeholder="请输入接害工龄年" type="number" />
            </el-form-item>
            <el-form-item label="接害工龄月" prop="hazardMonths" label-width="106px">
              <el-input :disabled="isDisabled" v-model="form.hazardMonths" placeholder="请输入接害工龄月" type="number" />
            </el-form-item>
            <el-form-item label="开始接害日期" prop="hazardStartDate" label-width="100px">
              <el-date-picker :disabled="isDisabled" clearable v-model="form.hazardStartDate" type="date"
                value-format="yyyy-MM-dd" placeholder="请选择开始接害日期" style="width: 93%" />
            </el-form-item>
            <el-form-item label="工号" label-width="103px">
              <el-input :disabled="isDisabled" v-model="form.wenHua" placeholder="请输入工号" />
            </el-form-item>
            <el-form-item label="车间" label-width="106px">
              <el-input :disabled="isDisabled" v-model="form.wenHua" placeholder="请输入车间" />
            </el-form-item>
          </el-form>
          <el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="106px"
            v-show="top">
@@ -466,6 +451,7 @@
                <span slot="label"> 证件号码 </span>
                <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="请输入身份证号" @input="inputChange" />
              </el-form-item>
              <el-form-item label="单位名称" prop="firmName">
                <el-select v-model="form.firmName" remote default-first-option allow-create filterable
                  style="width: 200px" placeholder="请选择单位名称" clearable @change="idFn1" @clear="clear">
@@ -477,7 +463,7 @@
              </el-form-item>
              <el-form-item label="体检类型">
                <el-select v-model="form.tjType" placeholder="请选择体检类型">
                  <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label"
                  <el-option v-for="dict in filteredDictTeam" :key="dict.value" :label="dict.label"
                    :value="dict.value"></el-option>
                </el-select>
              </el-form-item>
@@ -500,6 +486,22 @@
              <el-form-item label="实收金额">
                <el-input placeholder="实收金额" v-model="TotalPrice" style="width: 206px" @input="changeXianjia"
                  @blur="numberChangeXianPrice(discount, discount)" />
              </el-form-item>
              <el-form-item label="接害工龄年" prop="zhiyeJhgln" label-width="84px">
                <el-input v-model="form.zhiyeJhgln" type="number" style="width: 140px" />
              </el-form-item>
              <el-form-item label="接害工龄月" prop="zhiyeJhgln" label-width="84px">
                <el-input v-model="form.zhiyeJhgly" style="width: 140px" type="number" />
              </el-form-item>
              <el-form-item label="开始接害日期" prop="zhiyeKsjhrq" label-width="100px">
                <el-date-picker clearable v-model="form.zhiyeKsjhrq" type="date" value-format="yyyy-MM-dd"
                  style="width: 200px" />
              </el-form-item>
              <el-form-item label="工号" label-width="50px">
                <el-input v-model="form.zhiyeGh" />
              </el-form-item>
              <el-form-item label="车间" label-width="106px">
                <el-input v-model="form.zhiyeCj" />
              </el-form-item>
              <br />
@@ -548,9 +550,6 @@
                font-size: 16px;
                margin-right: 20px;
              ">
              <span v-if="this.tableData1[0]">{{
                this.tableData1[0].pacName || ""
              }}</span>
              已选项目条数:<span style="font-weight: 700; color: red; margin-right: 5px">{{ this.tableData1.length || 0
                }}</span>条
            </div>
@@ -753,13 +752,13 @@
  getfindTj,
  getByTjNum,
} from "@/api/hosp/customer";
import { getPrintSetUp } from "@/api/system/examcharge";
import cnchar from 'cnchar';
import {
  tuantiSelect,
  deptTreeSelect,
  projectGetList,
  getOrder,
  getOrderzhiye,
  getProParentIdDxList,
  getProSonDxList,
  getCusIdcard,
@@ -804,6 +803,7 @@
  },
  data() {
    return {
      tjLei: [],
      isSubmitting: false,
      open1: false,
      filterage: "",
@@ -1013,9 +1013,11 @@
      form: {
        educationLevel: "", // 文化程度
        examCategory: "", // 查体分类
        hazardYears: "", // 接害工龄年
        hazardMonths: "", // 接害工龄月
        hazardStartDate: "", // 开始接害日期
        zhiyeJhgln: "", // 接害工龄年
        zhiyeJhgly: "", // 接害工龄月
        zhiyeKsjhrq: "", // 开始接害日期
        zhiyeGh: "", // 工号
        zhiyeCj: "", // 车间
        cusIdcard: "",
        tjType: "",
        cusSex: 1,
@@ -1083,6 +1085,14 @@
      this.$refs.treas.filter(val);
    },
  },
  computed: {
    filteredDictTeam() {
      // 过滤 dict.type.dict_team,只保留 value 在 tjLei 中的项
      return this.dict.type.dict_team.filter(dict =>
        this.tjLei.includes(dict.value.toString())
      );
    }
  },
  created() {
    this.getCompanyList();
@@ -1096,6 +1106,13 @@
    this.TreedataList = [];
    this.DataList = [];
    this.marryall = 0;
    getconfigKey("zhiye_tj_type").then((res) => {
      if (res.code === 200) {
        const values = res.msg.split(",");
        this.tjLei.push(...values);
      }
    });
  },
  methods: {
    handleIdCardInput(value) {
@@ -1266,9 +1283,9 @@
      }
      if (this.form.firmName) {
        this.form.tjType = this.dict.type.dict_team[1].value;
        this.form.tjType = "6";
      } else {
        this.form.tjType = this.dict.type.dict_team[0].value;
        this.form.tjType = "5";
      }
    },
@@ -1627,6 +1644,12 @@
        deleted: null,
        firmid: "",
        firmDeptName: "",
        examCategory: "", // 查体分类
        zhiyeJhgln: "", // 接害工龄年
        zhiyeJhgly: "", // 接害工龄月
        zhiyeKsjhrq: "", // 开始接害日期
        zhiyeGh: "", // 工号
        zhiyeCj: "", // 车间
      };
      this.resetForm("form");
    },
@@ -1754,14 +1777,11 @@
            if (formData.cusSex === "未知") {
              formData.cusSex = 2;
            }
            if (formData.tjType === "") {
              formData.tjType = this.dict.type.dict_team[0].value;
            }
            addCustomer(formData).then((response) => {
              this.responseList = response.data;
              this.form.tjType = this.dict.type.dict_team[0].value;
              this.form.tjType = '';
              this.$modal.msgSuccess("新增成功");
              _this.tcShow = true;
              _this.isDisabled = true;
@@ -1797,7 +1817,7 @@
              this.discount = this.form.discount;
            }
            if (this.form.tjType === null) {
              this.form.tjType = this.dict.type.dict_team[0].value;
              this.form.tjType = null;
            }
            if (this.form.cusMarryStatus === "null") {
              this.form.cusMarryStatus = "5";
@@ -1808,12 +1828,7 @@
            if (this.form.reservationId != null) {
              if (this.form.groupingId) {
                this.form.firmName = this.form.compName;
                this.dict.type.dict_team.forEach((item) => {
                  if (item.label == "团队") {
                    this.form.tjType = item.value;
                  }
                })
                // this.form.tjType = this.dict.type.dict_team[1].value;
                this.CompanyList.forEach((item) => {
                  if (item.cnName == this.form.firmName) {
                    this.form.firmId = item.drugManufacturerId;
@@ -2376,90 +2391,29 @@
      let cusSex = this.form.cusSex;
      this.datekey = Date.now();
      //全部套餐
      let param = {
        sex: cusSex,
        dwId: this.form.firmId || "",
      };
      if (this.form.tjType == 1) {
        if (!this.form.firmId && !this.form.firmName) {
          this.$message({
            type: "warning",
            message: "请先维护单位!",
          });
        } else if (!this.form.firmId && this.form.firmName) {
          this.taocan = true;
          this.loading = true;
          deptTreeSelect(cusSex).then((response) => {
            this.newpacName = response.rows;
            try {
              if (this.tableData1.length >= 1) {
                this.newpacName.forEach((item3) => {
                  this.tableData1.forEach((item4) => {
                    item4.list.forEach((item6) => {
                      if (item6.pacName === item3.pacName) {
                        this.$nextTick(() => {
                          this.$refs.tb.toggleRowSelection(item3, true);
                        });
                        throw Error();
                      }
      this.taocan = true;
      this.loading = true;
      deptTreeSelect(cusSex).then((response) => {
        this.newpacName = response.rows;
        try {
          if (this.tableData1.length >= 1) {
            this.newpacName.forEach((item3) => {
              this.tableData1.forEach((item4) => {
                item4.list.forEach((item6) => {
                  if (item6.pacName === item3.pacName) {
                    this.$nextTick(() => {
                      this.$refs.tb.toggleRowSelection(item3, true);
                    });
                  });
                });
              }
            } catch (error) { }
            this.loading = false;
          });
        }
        else {
          this.taocan = true;
          this.loading = true;
          tuantiSelect(param).then((res) => {
            this.newpacName = res.data;
            try {
              if (this.tableData1.length >= 1) {
                this.newpacName.forEach((item3) => {
                  this.tableData1.forEach((item4) => {
                    item4.list.forEach((item6) => {
                      if (item6.pacName === item3.pacName) {
                        this.$nextTick(() => {
                          this.$refs.tb.toggleRowSelection(item3, true);
                        });
                        throw Error();
                      }
                    });
                  });
                });
              }
            } catch (error) { }
            this.loading = false;
          });
        }
      } else {
        this.taocan = true;
        this.loading = true;
        deptTreeSelect(cusSex).then((response) => {
          this.newpacName = response.rows;
          try {
            if (this.tableData1.length >= 1) {
              this.newpacName.forEach((item3) => {
                this.tableData1.forEach((item4) => {
                  item4.list.forEach((item6) => {
                    if (item6.pacName === item3.pacName) {
                      this.$nextTick(() => {
                        this.$refs.tb.toggleRowSelection(item3, true);
                      });
                      throw Error();
                    }
                  });
                    throw Error();
                  }
                });
              });
            }
          } catch (error) { }
          this.loading = false;
        });
      }
            });
          }
        } catch (error) { }
        this.loading = false;
      });
    },
    // 点击多选框获取选中数据
@@ -2949,6 +2903,15 @@
        });
      }
      // 如果 tjCategory 为 "02",确保选中的套餐被添加到 tableData1
      if (this.tjCategory === "02" && this.tableData.length > 0) {
        this.tableData.forEach((item) => {
          if (!this.tableData1.some((existingItem) => existingItem.pacId === item.pacId)) {
            this.tableData1.push(item);
          }
        });
      }
      this.taocan = false;
      this.defaultKeys = [];
      this.DataLists = [];
@@ -3078,7 +3041,7 @@
          };
        }
        getOrder(data).then((res) => {
        getOrderzhiye(data).then((res) => {
          this.$modal.msgSuccess("提交成功");
          this.tjNumbers = res.msg;
          this.charge = true;
@@ -3128,14 +3091,17 @@
          cusPhone: item.tjPhone,
          cusSex: item.sex === "男" ? "0" : "1",
        };
        // 动态从filteredDictTeam获取tjType
        const dictItem = this.filteredDictTeam.find(dict => dict.label === item.tjType);
        const tjTypeValue = dictItem ? dictItem.value : (this.filteredDictTeam.length > 0 ? this.filteredDictTeam[0].value : "0"); // 回退到第一个值或默认"0"
        if (item.tjComp != null) {
          this.standard = {
            company: item.tjComp,
            tjType: item.tjType === "团队" ? "1" : "2",
            tjType: tjTypeValue,
          };
        } else {
          this.standard = {
            tjType: item.tjType === "团队" ? "1" : "2",
            tjType: tjTypeValue,
          };
        }
      });
@@ -3166,19 +3132,15 @@
                this.formInline.paidIn = item.proPrice;
              }
            });
            const r = /^\+?[0-9][0-9]*$/; //正整数(可以以打头)
            //const r=/^\+?[1-9][0-9]*$/;//正整数
            const r = /^\+?[0-9][0-9]*$/; // 正整数
            if (r.test(this.formInline.paidIn)) {
              this.formInline.paidIn = this.formInline.paidIn + ".00";
            }
            this.discount =
              (this.formInline.paidIn / this.formInline.price) * 10;
            this.discount = (this.formInline.paidIn / this.formInline.price) * 10;
          } else {
            this.discount = 10;
            this.formInline.paidIn = "0.00";
          }
          this.total = response.data.total;
        } else {
          this.tableList = [];
@@ -3252,7 +3214,7 @@
    },
    listgetOrder(data) {
      getOrder(data).then((res) => {
      getOrderzhiye(data).then((res) => {
        this.$modal.msgSuccess("提交成功");
        //调接口显示导检单
        const tjNumber = res.msg;
@@ -3336,6 +3298,10 @@
                firmId: this.form.firmId,
                firmName: this.form.firmName,
                firmDeptName: this.form.firmDeptName,
                zhiyeJhgly: this.form.zhiyeJhgly,
                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
                zhiyeGh: this.form.zhiyeGh,
                zhiyeCj: this.form.zhiyeCj
              };
              this.listgetOrder(data);
@@ -3350,6 +3316,12 @@
                firmId: this.form.firmId,
                firmName: this.form.firmName,
                firmDeptName: this.form.firmDeptName,
                zhiyeJhgly: this.form.zhiyeJhgly,
                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
                zhiyeGh: this.form.zhiyeGh,
                zhiyeCj: this.form.zhiyeCj
              };
              this.listgetOrder(data);
            } else {