提交 41041799 编写于 作者: guangjun.yang's avatar guangjun.yang

new plan等

上级 ca2838cd
...@@ -34,11 +34,24 @@ ...@@ -34,11 +34,24 @@
<el-button class="button-green" @click="addPatient" size="small" type="primary">确 定</el-button> <el-button class="button-green" @click="addPatient" size="small" type="primary">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 敏感词及协议校验 -->
<el-dialog class="prot-dialog" title="" :visible.sync="isShowProtocolDialog" width="30%" center :show-close=false>
<p class="prot-dialog-tips-1">由于该居民尚未同意《云鹊平台隐私协议》,将导致履约量表部分信息无法录入,为了方便您的工作开展,请您发送短信提醒居民完成授权</p>
<p v-show="!isSentedProt" class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p>
<p v-show="isSentedProt" class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p>
<span v-show="!isSentedProt" slot="footer" class="dialog-footer">
<el-button size="small" @click="closeProtocolDialog"> 暂不发送 </el-button>
<el-button size="small" type="primary" @click="sendMsg"> 发送短信 </el-button>
</span>
<span v-show="isSentedProt" slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="closeProtocolDialog"> 我知道了 </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { createFollowPlan } from '../../../../utils/followup/followapis' import { createFollowPlan, uniteValidate, authMessage } from '../../../../utils/followup/followapis'
import { mapState, mapActions} from 'vuex'; import { mapState, mapActions} from 'vuex';
export default { export default {
name: "add-patient-time", name: "add-patient-time",
...@@ -64,7 +77,11 @@ ...@@ -64,7 +77,11 @@
joinTime: [ joinTime: [
{ required: true, message: '请选择履约开始时间', trigger: 'change' }, { required: true, message: '请选择履约开始时间', trigger: 'change' },
], ],
} },
isShowProtocolDialog: true,
isSentedProt: false,
patientIds: [],
sendMsgPatientIds: [],
} }
}, },
mounted() { mounted() {
...@@ -84,11 +101,101 @@ ...@@ -84,11 +101,101 @@
addPatient() { addPatient() {
// 创建/修改履约计划 // 创建/修改履约计划
// 4、校验居民/医生是否签署协议 // 4、校验居民/医生是否签署协议
alert('创建/修改履约计划') this.patientIds = this.addPatientData.patientIdList
// return
this.$refs['addPatientData'].validate(valid => { this.$refs['addPatientData'].validate(valid => {
if (valid) { if (valid) {
console.log(this.addPatientData)
// 4、校验居民/医生是否签署协议
// if(this.$route.name == 'planModify') {
// this.$emit('sendJoinTime',this.addPatientData.joinTime)
// this.$emit('closeAddPatientTime',false)
// } else {
// const { id, patientIdList, joinTime } = this.addPatientData;
// createFollowPlan({
// id,
// addPatients: true,
// patientIdList,
// joinTime
// }).then((data) => {
// if(data.code == '000000') {
// this.$message({
// message: '添加成功!',
// type: 'success'
// });
// this.getResidentList({
// planId: this.addPatientData.id,
// status: this.addPatientData.status
// })
// this.$emit('closeAddPatientTime',false)
// } else {
// this.$message({
// message: `${data.message}`,
// type: 'error'
// });
// }
// }).catch((err) => {
// this.$message({
// message: `${err.message}`,
// type: 'error'
// });
// });
// }
this.uniteValidateAction()
} else {
return false;
}
});
},
// Add by Anndy Yang
// 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
uniteValidateAction() {
let validParams = {
scaleNo: '',
patientIds: this.patientIds, // pc端只传这个字段
// planPatientsTimesId: planPatientsTimesId, // app端只传这个字段
protocolType: 5,
userType: 1,
validateType: 2
};
uniteValidate(validParams).then(res => {
let result = res;
// 请求成功
if (result.code === '000000') {
let levelType = result.data.levelType;
// 没有敏感字段或者居民已经签订过协议,则直接返回
if (levelType === 1 || levelType === 2) {
jumpToScale();
} else if (levelType === 3) {
this.isShowProtocolDialog = true;
this.isSentedProt = true;
} else if (levelType === 4) {
this.isShowProtocolDialog = true;
this.isSentedProt = false;
this.sendMsgPatientIds = result.data.ids;
}
}
});
},
// 发送协议授权短信给居民
sendMsgToPatients() {
authMessage({ patientIds: this.sendMsgPatientIds }).then(res => {
if (res.code === '000000') {
this.$message({
message: '已发送,请尽快联系居民同意授权',
type: 'success'
});
}
});
this.isShowDialog = false;
},
// 统一跳转到量表页面
jumpToScale() {
if(this.$route.name == 'planModify') { if(this.$route.name == 'planModify') {
this.$emit('sendJoinTime',this.addPatientData.joinTime) this.$emit('sendJoinTime',this.addPatientData.joinTime)
this.$emit('closeAddPatientTime',false) this.$emit('closeAddPatientTime',false)
...@@ -123,13 +230,19 @@ ...@@ -123,13 +230,19 @@
}); });
}); });
} }
},
} else { // 关闭协议确认窗口
return false; closeProtocolDialog() {
} this.isShowProtocolDialog = false
}); this.jumpToScale()
},
} // 发送短信通知
sendMsg() {
this.sendMsgToPatients();
this.closeProtocolDialog()
},
} }
} }
</script> </script>
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
return time.getTime() < Date.now() - 8.64e7 return time.getTime() < Date.now() - 8.64e7
} }
}, },
isShowProtocolDialog: true, isShowProtocolDialog: false,
isSentedProt: false, isSentedProt: false,
patientIds: [], patientIds: [],
sendMsgPatientIds: [] sendMsgPatientIds: []
...@@ -224,11 +224,11 @@ ...@@ -224,11 +224,11 @@
return 0; return 0;
} else if (levelType === 3) { } else if (levelType === 3) {
this.isShowProtocolDialog = true; this.isShowProtocolDialog = true;
this.isSentedProt = false; this.isSentedProt = true;
return 1; return 1;
} else if (levelType === 4) { } else if (levelType === 4) {
this.isShowProtocolDialog = true; this.isShowProtocolDialog = true;
this.isSentedProt = true; this.isSentedProt = false;
this.sendMsgPatientIds = result.data.ids; this.sendMsgPatientIds = result.data.ids;
return 1; return 1;
} }
...@@ -263,6 +263,7 @@ ...@@ -263,6 +263,7 @@
addListenSave(val){ addListenSave(val){
// console.log('监听保存校验结果',val) // console.log('监听保存校验结果',val)
this.checkForm = false this.checkForm = false
this.uniteValidateAction()
if(val.status){ if(val.status){
this.baseInfo.fPlanTimeReqList = val.setTimeNodeList this.baseInfo.fPlanTimeReqList = val.setTimeNodeList
// this.baseInfo.time = (new Date(this.baseInfo.time).getTime()) // this.baseInfo.time = (new Date(this.baseInfo.time).getTime())
...@@ -311,9 +312,9 @@ ...@@ -311,9 +312,9 @@
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人 const selectPatients = getArguments[1]; // 每次选中获取的人
this.hasSelectedList = selectPatients; this.hasSelectedList = selectPatients;
this.patientIds = selectPatients.map( item => { // this.patientIds = selectPatients.map( item => {
return item.patientId // return item.patientId
}) // })
// console.log('呵呵呵呵',arguments) // console.log('呵呵呵呵',arguments)
this.baseInfo.patientIdList = []; this.baseInfo.patientIdList = [];
selectPatients.forEach((item)=>{ selectPatients.forEach((item)=>{
...@@ -344,11 +345,13 @@ ...@@ -344,11 +345,13 @@
nextClick(formName) { nextClick(formName) {
// 创建/修改履约计划 // 创建/修改履约计划
// 4、校验居民/医生是否签署协议 // 4、校验居民/医生是否签署协议
alert('创建/修改履约计划') this.patientIds = this.hasSelectedList.map( item => {
console.log(this.hasSelectedList) return item.patientId
if(this.uniteValidateAction() == 1) { })
return; this.uniteValidateAction();
}; // if(this.uniteValidateAction() == 1) {
// return;
// };
// return // return
// 为方便调试,不做校验 // 为方便调试,不做校验
...@@ -366,9 +369,9 @@ ...@@ -366,9 +369,9 @@
this.resourceId = String(this.baseInfo.resourceId) this.resourceId = String(this.baseInfo.resourceId)
// console.log( this.baseInfo.resourceId) // console.log( this.baseInfo.resourceId)
if(this.baseInfo.resourceId){ if(this.baseInfo.resourceId){
if(this.uniteValidateAction() == 1) { // if(this.uniteValidateAction() == 1) {
return; // return;
}; // };
getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{ getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{
this.isStandedTemplate = true this.isStandedTemplate = true
this.standedTimeNodeList = res.data this.standedTimeNodeList = res.data
......
...@@ -418,6 +418,8 @@ ...@@ -418,6 +418,8 @@
patientIds.push(item.patientId) patientIds.push(item.patientId)
patientNames.push(item.nickname) patientNames.push(item.nickname)
}) })
// 将选择的patientIds存入Store中
if(patientNames.length>5) { if(patientNames.length>5) {
const le = patientNames.length const le = patientNames.length
patientNames = patientNames.slice(0,5) patientNames = patientNames.slice(0,5)
......
...@@ -338,71 +338,6 @@ export default { ...@@ -338,71 +338,6 @@ export default {
this.isShowChangeDialog = true; this.isShowChangeDialog = true;
}, },
// // Add by Anndy Yang
// // 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
// uniteValidateAction() {
// let validParams = {
// scaleNo: this.scaleNo,
// patientIds: this.patientIds, // pc端只传这个字段
// // planPatientsTimesId: planPatientsTimesId, // app端只传这个字段
// protocolType: 5,
// userType: 1,
// validateType: 1
// };
// uniteValidate(validParams).then(res => {
// let result = res;
// // 请求成功
// if (result.code === '000000') {
// let levelType = result.data.levelType;
// // 没有敏感字段或者居民已经签订过协议,则直接返回
// if (levelType === 1 || levelType === 2) {
// jumpToScale()
// } else if (levelType === 3) {
// this.isShowProtocolDialog = true;
// this.isSentedProt = false;
// } else if (levelType === 4) {
// this.isShowProtocolDialog = true;
// this.isSentedProt = true;
// this.sendMsgPatientIds = result.data.ids;
// }
// }
// });
// },
// // 发送协议授权短信给居民
// sendMsgToPatients() {
// authMessage({ patientIds: this.sendMsgPatientIds }).then(res => {
// if (res.code === '000000') {
// this.$message({
// message: '已发送,请尽快联系居民同意授权',
// type: 'success'
// });
// }
// });
// this.isShowDialog = false;
// },
// // 统一跳转到量表页面
// jumpToScale() {
// // this.$router.push({
// // path: "/followup/record-manage/form-template",
// // query: this.scaleQuery
// // });
// },
// // 关闭协议确认窗口
// closeProtocolDialog() {
// this.isShowProtocolDialog = false
// this.jumpToScale()
// },
// // 发送短信通知
// sendMsg() {
// this.sendMsgToPatients();
// this.closeProtocolDialog()
// },
// Add by Anndy Yang // Add by Anndy Yang
// 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信 // 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
uniteValidateAction() { uniteValidateAction() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册