WXL (wul)
4 天以前 bc9538a9e071259ca8bbb6de52c60c9d7a55a03b
src/views/followvisit/record/detailpage/index.vue
@@ -127,6 +127,29 @@
              </el-tooltip>
            </template>
          </el-table-column>
                <el-table-column
            v-if="
              orgname == '景宁畲族自治县人民医院' ||
              orgname == '丽水市中医院'
            "
            label="拨号状态"
            width="120"
            align="center"
            key="isManuallyCalled"
            prop="isManuallyCalled"
          >
            <template slot-scope="scope">
              <el-tag
                v-if="Number(scope.row.isManuallyCalled) > 0"
                type="success"
                :disable-transitions="false"
                >拨通{{ scope.row.isManuallyCalled }}次</el-tag
              >
              <el-tag v-else type="info" :disable-transitions="false"
                >未拨通</el-tag
              >
            </template>
          </el-table-column>
          <el-table-column
            prop="finishtime"
            align="center"
@@ -282,6 +305,8 @@
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="bankcardno"
@@ -1312,7 +1337,11 @@
        :visible.sync="CaldialogVisible"
        width="60%"
      >
        <CallCenterLs ref="CallCenterLs" :initial-phone="currentPhoneNumber" />
        <CallCenterLs
          ref="CallCenterLs"
          :initial-phone="currentPhoneNumber"
          @call-connected="recordCallConnected"
        />
      </el-dialog>
    </div>
  </div>
@@ -2349,7 +2378,7 @@
        this.CaldialogVisible = true;
        return;
      }
      // 下方是中医院呼叫
      // 下方是丽水市中医院
      if (this.isSipRegistering) {
        this.$message.warning("系统正在初始化,请稍候...");
        return;
@@ -2379,11 +2408,15 @@
      this.callStatus = status.type;
      if (status.type === "connected") {
        this.currentCall = {
          phone: this.currentPhoneNumber,
          type: this.callType,
          startTime: new Date(),
        };
        if (!this.currentCall) {
          this.currentCall = {
            phone: this.currentPhoneNumber,
            type: this.callType,
            startTime: new Date(),
          };
          // 丽水市中医院:电话接通后记录拨打成功次数
          this.recordCallConnected();
        }
      } else if (status.type === "ended" || status.type === "failed") {
        this.currentCall = null;
      }
@@ -2393,6 +2426,39 @@
        this.$message.error(`呼叫失败: ${status.text}`);
      }
    },
    // 电话拨打成功后(接通)次数 +1,并通过 Editsingletaskson 更新服务数据
    // 仅限景宁畲族自治县人民医院与丽水市中医院
    recordCallConnected() {
      const allowedOrgs = ["景宁畲族自治县人民医院", "丽水市中医院"];
      if (!allowedOrgs.includes(this.orgname)) return;
      getTaskservelist({
        patid: this.patid,
        subId: this.id,
      }).then((res) => {
        if (res.code == 200) {
          const objson = res.rows[0].serviceSubtaskList.find(
            (item) => item.id == this.id
          );
          if (!objson) return;
          objson.isManuallyCalled = (Number(objson.isManuallyCalled) || 0) + 1;
          Editsingletaskson(objson).then((r) => {
            if (r.code == 200) {
              // 及时更新顶部服务列表与表单中的拨号状态
              const localRow = (this.logsheetlist || []).find(
                (item) => item.id == this.id
              );
              if (localRow) {
                localRow.isManuallyCalled = objson.isManuallyCalled;
              }
              if (this.form && this.form.id == this.id) {
                this.form.isManuallyCalled = objson.isManuallyCalled;
              }
            }
          });
        }
      });
    },
    // 结束当前通话
    endCurrentCall() {
      if (!this.currentCall) return;