WXL (wul)
6 天以前 5319d5b95497b5b546947ac340c14c71e5b54ca6
src/views/patient/patient/index.vue
@@ -73,19 +73,21 @@
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="患者范围" prop="tagId">
              <el-form-item label="患者性别" prop="tagId">
                <el-select
                  v-model="queryParams.searchscope"
                  placeholder="请选择患者范围"
                  v-model="queryParams.sex"
                  placeholder="请选择患者性别"
                >
                  <el-option
                    v-for="item in source"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                  <el-option label="男" :value="1"> </el-option>
                  <el-option label="女" :value="2"> </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="患者年龄" prop="telcode">
                <el-input
                  v-model="queryParams.age"
                  placeholder="请输入查询年龄"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="联系电话" prop="telcode">
                <el-input
@@ -183,13 +185,6 @@
              @selection-change="handleSelectionChange"
            >
              <el-table-column type="selection" width="50" align="center" />
              <!-- <el-table-column
                fixed
                label="序号"
                align="center"
                key="id"
                prop="id"
              /> -->
              <el-table-column
                fixed
                label="姓名"
@@ -197,6 +192,14 @@
                key="name"
                prop="name"
              />
              <el-table-column
                label="患者编号"
                align="center"
                key="patientno"
                prop="patientno"
                width="180"
              />
              <el-table-column label="性别" align="center" key="sex" prop="sex">
                <template slot-scope="scope">
                  <span>{{ scope.row.sex == 1 ? "男" : "女" }}</span>
@@ -207,8 +210,16 @@
                align="center"
                key="age"
                prop="age"
                width="60"
              />
                width="160"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.age"
                    >{{ scope.row.age }}{{ scope.row.ageUnit }}</span
                  ><span v-if="scope.row.age2"
                    >{{ scope.row.age2 }}{{ scope.row.ageUnit2 }}</span
                  >
                </template>
              </el-table-column>
              <el-table-column
                label="出生年月"
                align="center"
@@ -304,14 +315,14 @@
                      ><i class="el-icon-edit"></i>患者过滤</span
                    ></el-button
                  >
                  <!-- <el-button
                  <el-button
                    size="medium"
                    type="text"
                    @click="Distributionservice(scope.row)"
                    @click="openContractDialog(scope.row)"
                    ><span class="button-textxg"
                      ><i class="el-icon-menu"></i>服务</span
                      ><i class="el-icon-menu"></i>患者签约</span
                    ></el-button
                  > -->
                  >
                  <!-- <el-button
                    size="medium"
                    type="text"
@@ -729,20 +740,123 @@
      </div>
    </el-dialog>
    <!-- 跳转服务对话框 -->
    <el-dialog title="选择服务类型" :visible.sync="serviceVisible">
      <el-card class="box-card">
        <el-radio-group v-model="serviceradio">
          <el-radio :label="1">宣教随访</el-radio>
          <el-radio :label="2">门诊服务</el-radio>
          <el-radio :label="3">出院服务</el-radio>
          <el-radio :label="4">复诊服务</el-radio>
          <el-radio :label="5">体检通知</el-radio>
          <el-radio :label="6">问卷服务</el-radio>
    <!-- 简化版患者签约对话框 -->
    <el-dialog
      title="患者签约服务"
      :visible.sync="contractDialogVisible"
      width="600px"
    >
      <!-- 步骤指示器 -->
      <el-steps
        :active="contractStep"
        align-center
        simple
        style="margin-bottom: 20px"
      >
        <el-step title="选择服务" icon="el-icon-document"></el-step>
        <el-step title="确认签约" icon="el-icon-finished"></el-step>
      </el-steps>
      <!-- 步骤1: 服务选择 -->
      <div v-if="contractStep === 1" class="step-content">
        <h4>请为 {{ currentPatient.name }} 选择签约服务套餐:</h4>
        <el-radio-group
          v-model="tempContractData.servicePackage"
          style="width: 100%"
        >
          <el-row :gutter="16">
            <el-col :span="8" v-for="pkg in servicePackages" :key="pkg.id">
              <el-card
                :class="[
                  'package-card',
                  { active: tempContractData.servicePackage === pkg.id },
                ]"
                @click.native="tempContractData.servicePackage = pkg.id"
                shadow="hover"
                style="margin-bottom: 16px; cursor: pointer"
              >
                <div style="text-align: center">
                  <h4>{{ pkg.name }}</h4>
                  <p style="color: #666; font-size: 12px; margin: 8px 0">
                    {{ pkg.description }}
                  </p>
                  <p style="color: #e6a23c; font-weight: bold">
                    {{ pkg.price > 0 ? `¥${pkg.price}/年` : "免费" }}
                  </p>
                  <el-tag
                    v-for="feature in pkg.features"
                    :key="feature"
                    size="mini"
                    style="margin: 2px"
                    type="info"
                    >{{ feature }}</el-tag
                  >
                </div>
              </el-card>
            </el-col>
          </el-row>
        </el-radio-group>
      </el-card>
        <el-form label-width="80px" style="margin-top: 20px">
          <el-form-item label="签约周期">
            <el-select
              v-model="tempContractData.contractPeriod"
              placeholder="请选择"
            >
              <el-option label="1年" :value="1"></el-option>
              <el-option label="2年" :value="2"></el-option>
              <el-option label="3年" :value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="备注信息">
            <el-input
              type="textarea"
              :rows="2"
              v-model="tempContractData.remark"
              placeholder="可填写特殊健康需求或备注信息"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <!-- 步骤2: 签约确认 -->
      <div v-if="contractStep === 2" class="step-content">
        <el-card>
          <h4>签约信息确认</h4>
          <el-descriptions :column="1" border>
            <el-descriptions-item label="患者姓名">{{
              currentPatient.name
            }}</el-descriptions-item>
            <el-descriptions-item label="患者编号">{{
              currentPatient.patientno
            }}</el-descriptions-item>
            <el-descriptions-item label="服务套餐">
              {{ getSelectedPackage().name }}
            </el-descriptions-item>
            <el-descriptions-item label="签约周期"
              >{{ tempContractData.contractPeriod }}年</el-descriptions-item
            >
            <el-descriptions-item label="签约日期">{{
              new Date().toLocaleDateString()
            }}</el-descriptions-item>
            <el-descriptions-item label="备注信息">{{
              tempContractData.remark || "无"
            }}</el-descriptions-item>
          </el-descriptions>
        </el-card>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="serviceVisible = false">取 消</el-button>
        <el-button type="primary" @click="CreateService">创建服务</el-button>
        <el-button @click="prevStep" v-if="contractStep > 1">上一步</el-button>
        <el-button @click="closeContractDialog">取消</el-button>
        <el-button
          type="primary"
          @click="nextStep"
          :disabled="contractStep === 1 && !tempContractData.servicePackage"
        >
          {{ contractStep === 2 ? "确认签约" : "下一步" }}
        </el-button>
      </div>
    </el-dialog>
    <!-- 风险类型 -->
@@ -837,20 +951,87 @@
      serviceradio: 1,
      distributeVisible: false,
      RiskVisible: false,
      tasktopic: "5", //新增类型
      tasktopic: "2", //新增类型
      Riskradio: 1,
      RiskObj: {},
      // 查询参数
      topqueryParams: {
        pageNum: 1,
        pageSize: 10,
        type: 2,
        userName: undefined,
        tagid: undefined,
        topic: undefined,
      },
      // 日期范围
      dateRange: [],
      taskoptions: [],
      contractDialogVisible: false, // 控制签约对话框显示
      contractStep: 1, // 签约步骤:1-选择服务 2-确认信息
      currentPatient: {}, // 当前签约的患者信息
      tempContractData: {
        // 临时存储的签约数据
        servicePackage: null, // 选中的服务套餐
        contractPeriod: 1, // 签约周期(年)
        remark: "", // 备注信息
      },
      // 模拟数据:可选的签约服务套餐
      servicePackages: [
        {
          id: 1,
          name: "基础健康管理包",
          description: "包含定期健康评估、基本咨询",
          price: 0,
          features: ["年度健康评估", "在线咨询"],
        },
        {
          id: 2,
          name: "慢性病管理包",
          description: "专为慢性病患者设计",
          price: 299,
          features: ["专属医生", "用药提醒", "定期随访"],
        },
        {
          id: 3,
          name: "老年人健康包",
          description: "关注老年人健康问题",
          price: 499,
          features: ["跌倒风险评估", "康复指导", "紧急联系"],
        },
      ],
      taskoptions: [
        // {
        //   value: "1",
        //   label: "监测评估",
        // },
        {
          value: "2",
          label: "出院随访",
        },
        {
          value: "3",
          label: "门诊随访",
        },
        {
          value: "4",
          label: "宣教关怀",
        },
        {
          value: "5",
          label: "复诊管理",
        },
        // {
        //   value: "6",
        //   label: "满意度调查",
        // },
        {
          value: "7",
          label: "患者报告",
        },
        {
          value: "8",
          label: "其他通知",
        },
      ],
      paperstypes: [
        { papersname: "身份证" },
        { papersname: "护照" },
@@ -960,10 +1141,12 @@
      // 查询参数
      queryParams: {
        pageNum: 1,
        allhosp: "1",
        allhosp: "0",
        sex: 1,
        pageSize: 10,
        searchscope: 2,
        tagname:'',
        notrequiredFlag: 0,
        tagname: "",
        idcardno: undefined,
        name: undefined,
        status: undefined,
@@ -1021,8 +1204,12 @@
  created() {
    this.getList();
    this.gettabList();
    this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
      (obj) => obj.deptCode
    );
    this.topqueryParams.leavehospitaldistrictcodes =
      store.getters.belongWards.map((obj) => obj.districtCode);
    //获取已筛选后的可选任务类型
    this.taskoptions = store.getters.Serviceauthority;
  },
  methods: {
    /** 查询患者列表 */
@@ -1080,12 +1267,80 @@
        this.loading = false;
      });
    },
    Distributionservice(row) {
      this.serviceVisible = true;
    openContractDialog(row) {
      this.currentPatient = { ...row }; // 设置当前患者
      this.contractDialogVisible = true;
      this.contractStep = 1;
      // 重置表单数据
      this.tempContractData = {
        servicePackage: null,
        contractPeriod: 1,
        remark: "",
      };
    },
    // 下一步操作
    nextStep() {
      if (this.contractStep < 2) {
        this.contractStep++;
      } else {
        this.submitContract();
      }
    },
    // 上一步操作
    prevStep() {
      if (this.contractStep > 1) {
        this.contractStep--;
      }
    },
    // 获取选中的服务套餐信息
    getSelectedPackage() {
      return (
        this.servicePackages.find(
          (pkg) => pkg.id === this.tempContractData.servicePackage
        ) || {}
      );
    },
    // 模拟提交签约信息
    submitContract() {
      // 这里是前端模拟操作,实际开发中应通过API提交数据
      const contractInfo = {
        patientId: this.currentPatient.id,
        patientName: this.currentPatient.name,
        package: this.getSelectedPackage(),
        period: this.tempContractData.contractPeriod,
        signDate: new Date().toISOString().split("T")[0],
        remark: this.tempContractData.remark,
      };
      console.log("模拟签约数据:", contractInfo);
      // 模拟成功提示
      this.$message.success(
        `已成功为 ${this.currentPatient.name} 签约 ${
          this.getSelectedPackage().name
        }`
      );
      // 关闭对话框
      this.closeContractDialog();
      // 可以在这里触发其他操作,如刷新患者列表等
    },
    // 关闭对话框并重置状态
    closeContractDialog() {
      this.contractDialogVisible = false;
      this.contractStep = 1;
      this.tempContractData = {
        servicePackage: null,
        contractPeriod: 1,
        remark: "",
      };
    },
    RiskMarker(row) {
      this.RiskVisible = true;
      this.RiskObj=row;
      this.RiskObj = row;
    },
    // 取消按钮
@@ -1115,12 +1370,12 @@
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.queryParams= {
      this.queryParams = {
        pageNum: 1,
        allhosp: "1",
        allhosp: "0",
        pageSize: 10,
        searchscope: 2,
      },
      };
      this.handleQuery();
    },
    // 多选框选中数据
@@ -1138,13 +1393,12 @@
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const userIds = row.id || this.ids;
      particularpatient(userIds).then((response) => {
        console.log(response);
        this.form = response.data;
      });
      this.amendtag = true;
      this.Labelchange = true;
      // const userIds = row.id || this.ids;
      // particularpatient(userIds).then((response) => {
      //   this.form = response.data;
      // });
      // this.amendtag = true;
      // this.Labelchange = true;
    },
    //修改/新增患者
    submitForm() {
@@ -1201,37 +1455,33 @@
      });
    },
    RiskService() {
      this.RiskObj.visitFlag = this.Risklist.join(", ");
      this.RiskObj.visitType = this.Riskradio;
      alterpatient(this.RiskObj).then((res) => {
        if (res.code==200) {
        if (res.code == 200) {
          this.getList();
          this.Risklist=[];
          this.Riskradio=1;
          this.Risklist = [];
          this.Riskradio = 1;
          this.$modal.msgSuccess("异常记录成功");
        }
      });
    },
    distribute() {
      this.distributeVisible = true;
      if (this.tasktopic == 1) {
        this.topqueryParams.type = 3;
      } else if (this.tasktopic == 2) {
        this.topqueryParams.type = 1;
      } else if (this.tasktopic == 3) {
        this.topqueryParams.type = 1;
      } else if (this.tasktopic == 4) {
        this.topqueryParams.type = 1;
      if (
        this.tasktopic == 2 ||
        this.tasktopic == 3 ||
        this.tasktopic == 1 ||
        this.tasktopic == 7 ||
        this.tasktopic == 6
      ) {
        this.topqueryParams.type = "2";
      } else if (this.tasktopic == 4 || this.tasktopic == 8) {
        this.topqueryParams.type = "3";
      } else if (this.tasktopic == 5) {
        this.topqueryParams.type = 1;
      } else if (this.tasktopic == 6) {
        this.topqueryParams.type = 2;
        this.topqueryParams.type = "1";
      }
      this.topqueryParams.typename = this.findLabelByValue(
        this.taskoptions,
        this.tasktopic
      );
      this.topqueryParams.serviceType = Number(this.tasktopic);
      getTasklist(this.topqueryParams).then((response) => {
        this.taskuserList = response.rows;
        this.tasktotal = response.total;
@@ -1337,6 +1587,18 @@
    display: center !important;
  }
}
.package-card.active {
  border-color: #409EFF;
  background-color: #f0f9ff;
}
.step-content {
  min-height: 300px;
}
.dialog-footer {
  text-align: right;
}
.preview-left {
  margin: 20px;
  //   margin: 20px;