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