WXL
2024-02-04 cf9259c2ebee0e82c32864a1ee91d96c403b9099
src/views/patient/propaganda/particty.vue
@@ -14,6 +14,7 @@
            title="宣教对象"
            description="在本部选择宣教病人"
          ></el-step>
          <el-step icon="el-icon-user" title="模版确认"></el-step>
        </el-steps>
      </div>
    </div>
@@ -35,20 +36,41 @@
            </div>
            <div class="jic-value">
              <el-form ref="form" :model="form" label-width="105px">
                <el-form-item label="发送时间:" v-if="currenttype != 2">
                <el-form-item label="模版名称:">
                  <el-input
                    :disabled="true"
                    style="width: 220px"
                    v-model="form.preachname"
                    placeholder="请在下方选择"
                  />
                </el-form-item>
                <el-form-item label="发送设置:" v-if="currenttype != 2">
                  <el-radio-group v-model="radio">
                    <el-radio :label="1">时间段发送</el-radio>
                    <el-radio :label="2">时间点发送</el-radio>
                    <el-radio :label="3">即刻发送</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item
                  label="发送时间点:"
                  v-if="currenttype != 2 && radio == 2"
                >
                  <el-date-picker
                    v-model="form.name"
                    type="date"
                    placeholder="选择日期"
                    v-model="form.sendTime"
                    type="datetime"
                    placeholder="选择日期时间"
                    default-time="13:00:00"
                  >
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="发送时间段:" v-if="currenttype != 2">
                <el-form-item
                  label="发送时间段:"
                  v-if="currenttype != 2 && radio == 1"
                >
                  <el-checkbox-group v-model="checkList">
                    <el-checkbox label="上午(8:30-11:30)"></el-checkbox>
                    <el-checkbox label="下午(14:30-16:30)"></el-checkbox>
                    <el-checkbox label="夜间(18:30-20:30)"></el-checkbox>
                    <el-checkbox label="不定时"></el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
                <el-form-item label="服务形式">
@@ -60,18 +82,18 @@
                    ></el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
                <el-form-item label="组织形式">
                <!-- <el-form-item label="组织形式">
                  <el-radio-group v-model="form.radio">
                    <el-radio :label="3">单人宣教</el-radio>
                    <el-radio :label="6">多人集中宣教</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="语音模版" prop="region">
                </el-form-item> -->
                <!-- <el-form-item label="语音模版" prop="region">
                  <el-select v-model="form.region" placeholder="请选择模版">
                    <el-option label="一号模版" value="shanghai"></el-option>
                    <el-option label="二号模版" value="beijing"></el-option>
                  </el-select>
                </el-form-item>
                </el-form-item> -->
              </el-form>
            </div>
          </div>
@@ -242,9 +264,10 @@
                    @handleUpdate="handleUpdate"
                    @handleSelectionChange="handleSelectionChange"
                    :currentList="userList"
                    :tableLabel="tableLabelxj"
                    :tableLabel="tableLabel"
                    :controlsc="false"
                    :multiplechoice="false"
                    :typeinfo="1"
                  />
                  <pagination
                    v-show="total > 0"
@@ -258,7 +281,7 @@
            </div>
          </div>
        </div>
        <el-button type="success" @click="submitForm('ruleForm')">{{
        <el-button type="success" @click="nextstep('ruleForm')">{{
          quote ? "立即创建" : "任务详情设置"
        }}</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
@@ -269,6 +292,54 @@
        <el-alert title="在本阶段选择宣教病人" type="success" effect="dark">
        </el-alert>
        <div class="leftvlue-jbxx">
          <div class="examine-jic">
            <div class="headline">
              <div>变量匹配量参</div>
            </div>
            <div class="examine-jic">
              <div class="jic-value">
                <el-row :gutter="20">
                  <el-table :data="variableList" style="width: 100%">
                    <el-table-column
                      prop="variablename"
                      align="center"
                      label="变量名称"
                    >
                    </el-table-column>
                    <el-table-column
                      prop="character"
                      align="center"
                      label="匹配符"
                    >
                    </el-table-column>
                    <el-table-column label="替换值" align="center">
                      <template slot-scope="scope">
                        <el-input
                          v-model="scope.row.Replacementvalue"
                          placeholder="请输入内容"
                        ></el-input>
                      </template>
                    </el-table-column>
                    <el-table-column label="操作" align="center">
                      <template slot-scope="scope">
                        <el-button
                          size="mini"
                          @click="variableEdit(scope.$index, scope.row)"
                          >编辑</el-button
                        >
                        <el-button
                          size="mini"
                          type="danger"
                          @click="variableDelete(scope.$index, scope.row)"
                          >删除</el-button
                        >
                      </template>
                    </el-table-column>
                  </el-table>
                </el-row>
              </div>
            </div>
          </div>
          <div class="examine-jic">
            <div class="headline">
              <div>患者列表</div>
@@ -361,7 +432,7 @@
                  <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                      <el-select
                        v-model="tasktopic"
                        v-model="patientqueryParams.allhosp"
                        placeholder="请选择新增类型"
                      >
                        <el-option
@@ -379,7 +450,7 @@
                        plain
                        icon="el-icon-plus"
                        size="medium"
                        :disabled="!tasktopic"
                        :disabled="!patientqueryParams.allhosp"
                        @click="handleAddpatient"
                        >新增</el-button
                      >
@@ -406,6 +477,7 @@
                    :currentList="sonuserList"
                    :tableLabel="tableLabelhz"
                    :controlxz="false"
                    :typeinfo="2"
                  />
                  <pagination
                    v-show="total > 0"
@@ -513,7 +585,9 @@
              @handleSelectionChange="handleSelectionChange"
              :currentList="patientuserList"
              :tableLabel="tableLabelhz"
              :serialnumber="false"
              :controlsc="false"
              :typeinfo="3"
            />
          </el-row>
          <pagination
@@ -536,8 +610,19 @@
</template>
<script>
import { messagelistpatient } from "@/api/patient/homepage";
import store from "@/store";
import {
  getTaskpatient,
  getlibrarylist,
  getFollowuplist,
  getQtemplatelist,
  edithetask,
  addhetask,
  gethetaskinfo,
  delhetaskinfo,
  Editsingletask,
} from "@/api/AiCentre/index";
import SFtable from "@/components/SFtable"; //表格组件
export default {
@@ -546,57 +631,67 @@
    return {
      title: "宣教内容列表",
      currenttype: 1, //1宣教2门诊3出院4复诊5体检6问卷
      id: "",
      Editprogress: 1, //编辑进度
      loading: false, // 遮罩层
      patientloading: false, // 遮罩层
      dialogVisiblepatient: false, //添加患者弹框
      radio: 1,
      checkboxlist: [],
      tableLabel: [],
      // 患者表单
      tableLabelhz: [
        { label: "序号", width: "", prop: "patid" },
        { label: "患者名称", width: "", prop: "name" },
        { label: "性别", width: "", prop: "sex" },
        { label: "年龄", width: "", prop: "age" },
        { label: "就诊科室", width: "", prop: "impTemplate" },
        { label: "入院日期", width: "", prop: "create_time" },
        { label: "创建人", width: "", prop: "update_by" },
        { label: "入院日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelxj: [
        { label: "宣教名称", width: "", prop: "name" },
        { label: "宣教类型", width: "", prop: "nametype" },
        { label: "宣教模版", width: "", prop: "impTemplate" },
        { label: "创建日期", width: "", prop: "create_time" },
        { label: "创建人", width: "", prop: "update_by" },
        { label: "宣教名称", width: "", prop: "preachname" },
        { label: "宣教描述", width: "", prop: "note" },
        { label: "宣教形式", width: "", prop: "playType" },
        { label: "适用方式", width: "", prop: "suitway" },
        { label: "创建日期", width: "", prop: "uploadTime" },
        { label: "创建人(缺)", width: "", prop: "update_by" },
      ],
      tableLabelmz: [
        { label: "随访名称", width: "118", prop: "name" },
        { label: "随访名称", width: "118", prop: "templateName" },
        { label: "随访模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "create_time" },
        { label: "创建人", width: "130", prop: "update_by" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
      ],
      tableLabelcy: [
        { label: "随访名称", width: "118", prop: "name" },
        { label: "随访名称", width: "118", prop: "templateName" },
        { label: "随访计划", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "create_time" },
        { label: "创建人", width: "130", prop: "update_by" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
      ],
      tableLabelfz: [
        { label: "通知名称", width: "118", prop: "name" },
        { label: "通知名称", width: "118", prop: "templateName" },
        { label: "通知模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "create_time" },
        { label: "创建人", width: "130", prop: "update_by" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
      ],
      tableLabeltj: [
        { label: "通知名称", width: "118", prop: "name" },
        { label: "通知模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "create_time" },
        { label: "创建人", width: "130", prop: "update_by" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
      ],
      tableLabelwj: [
        { label: "问卷名称", width: "118", prop: "name" },
        { label: "问卷模版", width: "130", prop: "impTemplate" },
        { label: "创建日期", width: "136", prop: "create_time" },
        { label: "创建人", width: "130", prop: "update_by" },
        { label: "创建日期", width: "136", prop: "uploadTime" },
        { label: "创建人(缺)", width: "130", prop: "update_by" },
      ],
      // 变量
      tableLabelvariable: [
        { label: "变量名称", width: "", prop: "variablename" },
        { label: "匹配符", width: "", prop: "character" },
        { label: "替换值", width: "", prop: "Replacementvalue" },
      ],
      topqueryParams: {
        pageNum: 1, //
@@ -626,6 +721,23 @@
      userList: [], //模版列表
      patientuserList: [], //选择患者列表
      sonuserList: [], //选中患者列表
      variableList: [
        {
          variablename: "姓名",
          character: "${name}",
          Replacementvalue: "龙傲天",
        },
        {
          variablename: "地址",
          character: "${dzz}",
          Replacementvalue: "龙宫",
        },
        {
          variablename: "电话",
          character: "${dhh}",
          Replacementvalue: "八个八",
        },
      ], //变量列表
      tasktopic: null, //新增类型
      form: {
        name: "",
@@ -637,20 +749,6 @@
        resource: "",
        desc: "",
      },
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      taskoptions: [
        {
          value: "1",
@@ -671,16 +769,51 @@
  components: { SFtable },
  created() {
    this.id = this.$route.query.id;
    this.form.type = this.$route.query.type;
    this.Addsubtask();
    this.Getsubtask();
    this.Acquisitiontype();
  },
  methods: {
    // {
    //   姓名: { "${name}": "龙傲天" },
    //   地址: { "${dzz}": "龙宫" },
    //   电话: { "${dhh}": "八个八" },
    // }
    // 对象转数组
    convertFormat1ToFormat2(data) {
      let result = [];
      for (let key in data) {
        let innerKey = Object.keys(data[key])[0];
        result.push({
          name: key,
          value: innerKey,
          fill: data[key][innerKey],
        });
      }
      return result;
    },
    // 数组转对象
    convertFormat2ToFormat1(data) {
      let result = {};
      data.forEach((item) => {
        let innerObj = {};
        innerObj[item.value] = item.fill;
        result[item.name] = innerObj;
      });
      return result;
    },
    // 获取当前类型
    Acquisitiontype() {
      let queryParams = {
        pageNum: 1,
        pageSize: 10,
        isavailable: "",
      };
      this.currenttype = this.$route.query.type;
      console.log(this.currenttype);
      console.log(this.currenttype, "1");
      if (this.currenttype == 1) {
        this.title = "宣教内容列表";
        this.tableLabel = this.tableLabelxj;
@@ -696,22 +829,42 @@
          "智能小程序",
          "钉钉",
        ];
        getlibrarylist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      } else if (this.currenttype == 2) {
        this.title = "随访内容列表";
        this.tableLabel = this.tableLabelmz;
        this.checkboxlist = ["当面", "纸质", "电话", "短信", "微信公众号"];
        getFollowuplist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      } else if (this.currenttype == 3) {
        this.title = "随访计划列表";
        this.tableLabel = this.tableLabelcy;
        this.checkboxlist = ["当面", "纸质", "电话", "短信", "微信公众号"];
        getFollowuplist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      } else if (this.currenttype == 4) {
        this.title = "通知内容列表";
        this.tableLabel = this.tableLabelfz;
        this.checkboxlist = ["电话", "短信", "微信公众号"];
        getFollowuplist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      } else if (this.currenttype == 5) {
        this.title = "通知内容列表";
        this.tableLabel = this.tableLabeltj;
        this.checkboxlist = ["纸质", "电话", "短信", "微信公众号"];
        getFollowuplist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      } else if (this.currenttype == 6) {
        this.title = "问卷内容列表";
        this.tableLabel = this.tableLabelwj;
@@ -725,13 +878,24 @@
          "微信小程序",
          "钉钉",
        ];
        getQtemplatelist(queryParams).then((response) => {
          this.userList = response.rows;
          this.total = response.total;
        });
      }
    },
    nextstep() {
      if (this.Editprogress <= 3) {
        return this.Editprogress++;
      }
    },
    // 下一步
    submitForm(formName) {
      if (this.Editprogress <= 3) {
        return this.Editprogress++;
      }
      Editsingletask(this.form).then((response) => {
        if (res.code == 200) {
          this.$router.go(-1);
        }
      });
      // 提交
      // this.$refs[formName].validate((valid, object) => {
      //   if (valid) {
@@ -744,8 +908,7 @@
    },
    // 子任务二级弹框
    handleAddpatient(row) {
      console.log(row, "子组件数据");
      messagelistpatient(this.patientqueryParams).then((response) => {
      getTaskpatient(this.patientqueryParams).then((response) => {
        console.log(response);
        this.patientuserList = response.rows;
        this.patienttotal = response.total;
@@ -804,14 +967,20 @@
    // 查询子任务列表
    Getsubtask() {
      this.topqueryParams.pguid = 2;
      console.log(this.topqueryParams);
      console.log(this.topqueryParams, "aa");
      messagelistpatient(this.topqueryParams).then((res) => {
        this.userList = res.rows;
        this.total = res.total;
        console.log(this.userList);
        console.log(this.userList, "ss");
      });
    },
    /** 查询患者列表 */
    // 变量---------------
    variableEdit(index, row) {
      console.log(index, row);
    },
    variableDelete(index, row) {
      console.log(index, row);
    },
  },
};
</script>