提交 0d287641 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of http://192.168.110.53/com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
...@@ -54,6 +54,7 @@ export default { ...@@ -54,6 +54,7 @@ export default {
}, },
methods: { methods: {
...mapActions('reservationManage',['getUserName']),
// 解密token // 解密token
getToken() { getToken() {
let href = window.location.href let href = window.location.href
...@@ -103,6 +104,7 @@ export default { ...@@ -103,6 +104,7 @@ export default {
vm.userName = res.data.name vm.userName = res.data.name
vm.portrait = res.data.imageUrl vm.portrait = res.data.imageUrl
vm.authList = res.data.auth vm.authList = res.data.auth
vm.getUserName(vm.userName);
} else { } else {
vm.$message.info(res.message) vm.$message.info(res.message)
} }
......
...@@ -14,6 +14,7 @@ export default { ...@@ -14,6 +14,7 @@ export default {
checkRevervationData: {},//发送预约校验 checkRevervationData: {},//发送预约校验
constantsData: {},//获取常量 constantsData: {},//获取常量
getRevervationNum: null, //查看已预约人数 getRevervationNum: null, //查看已预约人数
userName: '',
}, },
mutations: { mutations: {
GET_RESERVATION_LIST(state, payload) { GET_RESERVATION_LIST(state, payload) {
...@@ -28,6 +29,9 @@ export default { ...@@ -28,6 +29,9 @@ export default {
GET_REVERVATION_NUM(state, payload) { GET_REVERVATION_NUM(state, payload) {
state.getRevervationNum = payload state.getRevervationNum = payload
}, },
GET_USER_NAME(state, payload) {
state.userName = payload
}
}, },
actions: { actions: {
getReservationList(context, payload) { getReservationList(context, payload) {
...@@ -61,6 +65,9 @@ export default { ...@@ -61,6 +65,9 @@ export default {
context.commit('GET_REVERVATION_NUM', data) context.commit('GET_REVERVATION_NUM', data)
}) })
}, },
getUserName(context, payload) {
context.commit('GET_USER_NAME', payload)
},
// getConstantsData({commit}) { // getConstantsData({commit}) {
// return new Promise(async (resolve, reject)=>{ // return new Promise(async (resolve, reject)=>{
// const res = await followApi.getBasicData({ // const res = await followApi.getBasicData({
......
...@@ -212,16 +212,16 @@ ...@@ -212,16 +212,16 @@
this.patientsData = res.data.patientList //接口获取的当页居民 this.patientsData = res.data.patientList //接口获取的当页居民
this.getSex() this.getSex()
this.paginationSet.total = res.data.totalRows this.paginationSet.total = res.data.totalRows
// // 设置所请求的当页人员是否成为选中状态 // 设置所请求的当页人员是否成为选中状态
// if(this.patientIdList.length > 0){ if(this.patientIdList.length > 0){
// this.patientsData.forEach((item)=>{ this.patientsData.forEach((item)=>{
// if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民 if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民
// this.$nextTick(()=>{ this.$nextTick(()=>{
// this.$refs.multipleTable.toggleRowSelection(item,true); this.$refs.multipleTable.toggleRowSelection(item,true);
// }) })
// } }
// }) })
// } }
} }
}) })
}, },
......
...@@ -130,7 +130,8 @@ ...@@ -130,7 +130,8 @@
}, },
props: { props: {
timeForm: Object, timeForm: Object,
valBegin: Boolean, valBegin: Boolean, // 设置新时间节点的校验开关
saveValiedBegin: Boolean, // 点击保存提交整个表单的校验开关
markOptions:Array, markOptions:Array,
followTypeList:Array, followTypeList:Array,
remindOptions:Array, remindOptions:Array,
...@@ -142,10 +143,17 @@ ...@@ -142,10 +143,17 @@
valBegin(val){ valBegin(val){
if(val){ if(val){
this.$refs[this.timeForm.formRef].validate((valid) => { this.$refs[this.timeForm.formRef].validate((valid) => {
this.$emit('checkValid',valid) this.$emit('checkValid',{valid: valid, type: 'normal'})
}); });
} }
} },
saveValiedBegin(val){
if(val){
this.$refs[this.timeForm.formRef].validate((valid) => {
this.$emit('checkValid',{valid: valid, type: 'save'})
});
}
}
}, },
methods: { methods: {
changeRemindDay(val){ changeRemindDay(val){
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<set-time-form <set-time-form
:timeForm="timeForm" :timeForm="timeForm"
:valBegin="valBegin" :valBegin="valBegin"
:saveValiedBegin="saveValiedBegin"
:markOptions="markOptions" :markOptions="markOptions"
:remindOptions="remindOptions" :remindOptions="remindOptions"
:pushTimeOptions="pushTimeOptions" :pushTimeOptions="pushTimeOptions"
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
data() { data() {
return { return {
valBegin: false, valBegin: false,
saveValiedBegin: false,
isSelectCartoon: false, isSelectCartoon: false,
activeTab: null, activeTab: null,
currentFormRef: 1, currentFormRef: 1,
...@@ -104,7 +106,8 @@ ...@@ -104,7 +106,8 @@
}, },
props: { props: {
setTimeNodeList: Array, setTimeNodeList: Array,
patientIdList: Array patientIdList: Array,
checkForm: Boolean,
}, },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
...@@ -137,6 +140,15 @@ ...@@ -137,6 +140,15 @@
} }
}, },
watch: { watch: {
checkForm(val){
// console.log(val)
if(val){
// 触发 保存 校验
this.saveValiedBegin = true
}else{
this.saveValiedBegin = false
}
},
valBegin(val){ valBegin(val){
this.valBegin = val this.valBegin = val
}, },
...@@ -181,9 +193,10 @@ ...@@ -181,9 +193,10 @@
this.getFormOptions() this.getFormOptions()
}, },
checkValid(val){ checkValid(obj){
this.valBegin = false this.valBegin = false
if (val) { console.log('校验结果',obj.valid)
if (obj.valid) {
if(this.timeForm.remindDay.length>0){ if(this.timeForm.remindDay.length>0){
this.timeForm.remindDay.forEach((item)=>{ this.timeForm.remindDay.forEach((item)=>{
this.timeForm.remindList.push({ this.timeForm.remindList.push({
...@@ -206,12 +219,26 @@ ...@@ -206,12 +219,26 @@
} }
this.setTimeNodeList.push(this.timeForm); this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',true)
}
// this.timeForm = _.cloneDeep(timeFormInit); // this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm = timeFormInit this.timeForm = timeFormInit
this.timeForm.formRef = this.getNowTime(); this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true; this.timeForm.isDisabled = true;
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
} else { } else {
// 告诉 保存 按钮, 校验没通过
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',false)
}
return return
} }
}, },
......
...@@ -82,17 +82,24 @@ ...@@ -82,17 +82,24 @@
:setTimeNodeList="setTimeNodeList" :setTimeNodeList="setTimeNodeList"
@setTimeNodeListOnCom="setTimeNodeListOnCom" @setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList" :patientIdList="baseInfo.patientIdList"
:checkForm="checkForm"
@addListenSave="addListenSave"
/> />
</div> </div>
</div> </div>
<select-patient <select-patient
:isShowSelectPatient="isShowSelectPatient" :isShowSelectPatient="isShowSelectPatient"
:patientIdList="hasSelectedList" :patientIdList="baseInfo.patientIdList"
@closeSelectPatient="closeSelectPatient" @closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)" @sureSelectPatient="sureSelectPatient(arguments)"
/> />
<has-selected-patient :isShowSelectedDialog="isShowSelectedDialog" :hasSelectedList="hasSelectedList" @closeSelectedDialog="closeSelectedDialog" @continueAdd="continueAdd"></has-selected-patient> <has-selected-patient
:isShowSelectedDialog="isShowSelectedDialog"
:hasSelectedList="hasSelectedList"
@closeSelectedDialog="closeSelectedDialog"
@continueAdd="continueAdd"
/>
</div> </div>
</template> </template>
...@@ -114,6 +121,7 @@ ...@@ -114,6 +121,7 @@
}, },
data() { data() {
return { return {
checkForm: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -152,6 +160,11 @@ ...@@ -152,6 +160,11 @@
//清理store中存的数据setTimeNodeList //清理store中存的数据setTimeNodeList
}, },
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList, setTimeNodeList: state => state.setTimeNodeList,
...@@ -161,6 +174,46 @@ ...@@ -161,6 +174,46 @@
}, },
methods: { methods: {
...mapActions('planManage', ['getTimeNodeList','getRemarkOption','getFollowupTemplate']), ...mapActions('planManage', ['getTimeNodeList','getRemarkOption','getFollowupTemplate']),
// 点击保存
saveEdit() {
console.log(this.checkForm)
// 点击保存,先进行校验,表单字段是否通过验证
this.checkForm = true
},
// 监听保存校验结果
addListenSave(val){
console.log('监听保存校验结果',val)
this.checkForm = false
if(val){
this.baseInfo.fPlanTimeReqList = this.setTimeNodeList
// 提交
createFollowPlan(this.baseInfo).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
setTimeout(()=>{
this.$router.push({
path: '/followup/plan-manage/plan-list'
})
},2000)
}else{
this.$notify.success({
title: '提交失败',
message: res.message,
showClose: false
});
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
}
},
setTimeNodeListOnCom(val){ setTimeNodeListOnCom(val){
this.getTimeNodeList(val) this.getTimeNodeList(val)
}, },
...@@ -207,7 +260,7 @@ ...@@ -207,7 +260,7 @@
nextClick(formName) { nextClick(formName) {
// this.getTimeNodeList([]); // this.getTimeNodeList([]);
//为方便调试,不做校验 //为方便调试,不做校验
this.activeTab = 'second'; // this.activeTab = 'second';
//用作校验 //用作校验
if(!this.baseInfo.hasSelectedNum) { if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true this.noChoice = true
...@@ -227,29 +280,7 @@ ...@@ -227,29 +280,7 @@
preClick() { preClick() {
this.activeTab = 'first'; this.activeTab = 'first';
}, },
saveEdit() {
this.baseInfo.fPlanTimeReqList = this.setTimeNodeList
// 提交
createFollowPlan(this.baseInfo).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
this.$router.push({
path: '/followup/plan-manage/plan-list'
})
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
},
}, },
watch: {
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<el-row type="flex" justify="end" class="margin-top20"> <el-row type="flex" justify="end" class="margin-top20">
<el-pagination <el-pagination
background background
v-if="recordList.enteringDtos" v-if="hasData"
@size-change="handleSizeChangePre" @size-change="handleSizeChangePre"
@current-change="handleCurrentChangePre" @current-change="handleCurrentChangePre"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
enteringRow: {}, enteringRow: {},
dialogDetailShow: false, dialogDetailShow: false,
isShowChangeDialog: false, isShowChangeDialog: false,
hasData: false,
} }
}, },
computed: { computed: {
...@@ -163,6 +164,11 @@ ...@@ -163,6 +164,11 @@
pageNo: currentPage || this.paginationSet.pageNo, pageNo: currentPage || this.paginationSet.pageNo,
pageSize: this.paginationSet.pageSize, pageSize: this.paginationSet.pageSize,
}); });
if(this.recordList.enteringDtos.length > 0) {
this.hasData = true;
}else {
this.hasData = false;
}
const {pageNo, pageSize, count, finishedCount, unfinishedCount} = this.recordList; const {pageNo, pageSize, count, finishedCount, unfinishedCount} = this.recordList;
if(this.activeName == ''){ if(this.activeName == ''){
this.paginationSet.total = count; this.paginationSet.total = count;
...@@ -212,7 +218,6 @@ ...@@ -212,7 +218,6 @@
}, },
sendRow(row){ sendRow(row){
// let saasUrl = getSaasDomain(`/pica-frontend/patientEduManage/pica_patient_edu_manage.html#/pageTab/message?patientId=${row.patientId}&token=D74A6C7C61564EB1B3DC83251F33D173`); // let saasUrl = getSaasDomain(`/pica-frontend/patientEduManage/pica_patient_edu_manage.html#/pageTab/message?patientId=${row.patientId}&token=D74A6C7C61564EB1B3DC83251F33D173`);
// console.log(saasUrl)
let saasUrl = getSaasDomain(`/pica-frontend/patientEduManage/pica_patient_edu_manage.html#/pageTab/message?patientId=${row.patientId}&token=${this._token}`); let saasUrl = getSaasDomain(`/pica-frontend/patientEduManage/pica_patient_edu_manage.html#/pageTab/message?patientId=${row.patientId}&token=${this._token}`);
window.open(saasUrl) window.open(saasUrl)
}, },
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="reservation-content content-list" v-if="reservationForm.appointmentDate && reservationForm.appointmentRange"> <div class="reservation-content content-list" v-if="reservationForm.appointmentDate && reservationForm.appointmentRange">
<div class="item"> <div class="item">
<span class="title">发送内容:</span> <span class="title">发送内容:</span>
<p>{{doctorName}}医生邀请您在{{reservationForm.appointmentDate}}{{reservationForm.appointmentRange}}进行随访,请确认是否参加。</p> <p>{{userName}}医生邀请您在{{reservationForm.appointmentDate}}{{reservationForm.appointmentRange}}进行随访,请确认是否参加。</p>
</div> </div>
<div class="item"> <div class="item">
<span class="title">本次推送:</span> <span class="title">本次推送:</span>
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
computed: { computed: {
...mapState('reservationManage',{ ...mapState('reservationManage',{
getRevervationNum: state => state.getRevervationNum, getRevervationNum: state => state.getRevervationNum,
userName: state => state.userName,
}) })
}, },
mounted(){ mounted(){
......
...@@ -338,6 +338,10 @@ ...@@ -338,6 +338,10 @@
}, },
closeSendReserve(val){ closeSendReserve(val){
this.isDialogShow = val; this.isDialogShow = val;
this.getReservationList({
...this.setSearchData(),
status: this.status,
})
}, },
closeTipsDialog(val){ closeTipsDialog(val){
this.isNoEnoughShow = val; this.isNoEnoughShow = val;
...@@ -346,31 +350,6 @@ ...@@ -346,31 +350,6 @@
this.isChangeReservation = val; this.isChangeReservation = val;
}, },
handleSelectionChange(val){ handleSelectionChange(val){
// let obj = {};
// for(let i=0; i<val.length; i++){
// const pObj = val[i];
// const id = pObj['patientId'];
// const oo = obj[id];
// if (oo) {
// obj[id] = oo + 1;
// } else {
// obj[id] = 1;
// }
// }
// let arrNew = [];
// let objToStrMap = (obj) => {
// let strMap = new Map();
// for (let k of Object.keys(obj)) {
// strMap.set(k, obj[k]);
// }
// arrNew = [...strMap];
// return arrNew;
// }
// objToStrMap(obj)
// console.log('新数组',objToStrMap(obj))
// this.validContents = objToStrMap(obj)
for(let i in val){ for(let i in val){
for(let j in val[i]) { for(let j in val[i]) {
if(j == 'fuPlanId') { if(j == 'fuPlanId') {
...@@ -389,6 +368,7 @@ ...@@ -389,6 +368,7 @@
} }
} }
this.selectionData = val; this.selectionData = val;
//统计选择的居民的patientId
let idsArray = []; let idsArray = [];
if (val.length > 0) { if (val.length > 0) {
for(let i=0; i<val.length; i++){ for(let i=0; i<val.length; i++){
...@@ -397,26 +377,25 @@ ...@@ -397,26 +377,25 @@
// this.ids = idsArray.join(",") // this.ids = idsArray.join(",")
this.ids = idsArray; this.ids = idsArray;
} }
let dedupeArr = Array.from(new Set(this.ids))
let count = 0;
let obj = {};//最终返回的数据
dedupeArr.forEach(i => {
count = 0;
this.ids.forEach(j => {
if(i === j){
count++;
}
})
obj[i] = count;
})
let i=0;
let aaa = [];
for(i in obj ){
aaa.push({patientId: i,size: obj[i]});
}
this.validContents = aaa;
// let dedupeArr = Array.from(new Set(this.ids))
// let count = 0;
// let obj = {};//最终返回的数据
// dedupeArr.forEach(i => {
// count = 0;
// this.ids.forEach(j => {
// if(i === j){
// count++;
// }
// })
// obj[i] = count;
// })
// let i=0;
// let aaa = [];
// for(i in obj ){
// console.log(i+ ':' + obj[i]);
// aaa.push({[i]: obj[i]});
// }
// this.validContents.push(aaa);
}, },
closeDetail(val){ closeDetail(val){
this.dialogDetailShow = val; this.dialogDetailShow = val;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册