|
@ -98,6 +98,11 @@ var TemplateItems = {
|
|
dialogVisible:false,
|
|
dialogVisible:false,
|
|
item: null,
|
|
item: null,
|
|
seletc:'',
|
|
seletc:'',
|
|
|
|
frequencysList1:[{"code":"qd_10-week1","name":"1周/次","type":1,mode:"week"},
|
|
|
|
{"code":"qd_10-week1","name":"2周/次","type":2,mode:"week"},
|
|
|
|
{"code":"qd_10-month1","name":"1月/次","type":1,mode:"month"},
|
|
|
|
{"code":"qd_10-month1","name":"2月/次","type":2,mode:"month"},
|
|
|
|
{"code":"qd_10-month1","name":"3月/次","type":3,mode:"month"}], //频次列表-multiple
|
|
options:[{label:'0',value:'0'}]
|
|
options:[{label:'0',value:'0'}]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@ -121,6 +126,37 @@ var TemplateItems = {
|
|
var vm = this
|
|
var vm = this
|
|
EventBus.$on("add-template-item", function(o) {
|
|
EventBus.$on("add-template-item", function(o) {
|
|
vm.items.push(o)
|
|
vm.items.push(o)
|
|
|
|
_.map(vm.items, function (item) {
|
|
|
|
item.plan=[]
|
|
|
|
// 过滤有执行时间的数组
|
|
|
|
var arr=[]
|
|
|
|
arr=_.filter(item.list,function(ee){
|
|
|
|
return ee.executeTimes
|
|
|
|
})
|
|
|
|
item.num=arr.length
|
|
|
|
if(item.num){
|
|
|
|
item.plan =item.list||[]
|
|
|
|
item.remark=item.list[0].remark
|
|
|
|
_.map(item.plan,function(item2){
|
|
|
|
item2.executeTimes?item2.executeTimesArr=item2.executeTimes.split(','):''
|
|
|
|
item2.mode='multiple' //模板
|
|
|
|
item2.show=false
|
|
|
|
item2.doctorName=item2.type==1?'家庭医生':'专科医生'
|
|
|
|
item2.doctor=item2.type
|
|
|
|
_.map(vm.frequencysList1,function(it){
|
|
|
|
if(it.name==item2.frequencyName){
|
|
|
|
item2.frequencyName?item2.frequencyCode=it.code:''
|
|
|
|
}
|
|
|
|
})
|
|
|
|
item2.date=_.map(item2.executeTimesArr,function(item3){
|
|
|
|
return item3.substring(0,item3.length-6)
|
|
|
|
|
|
|
|
})
|
|
|
|
return item2
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return item
|
|
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
mounted: function() {
|
|
mounted: function() {
|
|
@ -138,18 +174,50 @@ var TemplateItems = {
|
|
|
|
|
|
},
|
|
},
|
|
saveTemplate: function() {
|
|
saveTemplate: function() {
|
|
var vm = this
|
|
|
|
|
|
var vm = this
|
|
if(this.name=='系统模板'){
|
|
if(this.name=='系统模板'){
|
|
showErrorMessage('不能编辑系统模板!')
|
|
showErrorMessage('不能编辑系统模板!')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
var params = []
|
|
|
|
_.each(vm.items, function (item, index) {
|
|
|
|
if (item.plan && item.plan.length) {
|
|
|
|
_.each(item.plan, function (citem, cindex) {
|
|
|
|
var param = {
|
|
|
|
'templateId': vm.templateId,
|
|
|
|
"hospitalServiceItemId": item.code,
|
|
|
|
"type": citem.type, //1家医2专医
|
|
|
|
"executeTimes": citem.executeTimes,
|
|
|
|
"frequencyCode": citem.frequencyCode.split("-")[0],
|
|
|
|
'frequencyName':citem.frequencyName,
|
|
|
|
'dateName':citem.dateName,
|
|
|
|
'dateCode':citem.dateCode,
|
|
|
|
"timeType": 0, //1白天2晚上0全天
|
|
|
|
"remark": item.remark,
|
|
|
|
}
|
|
|
|
params.push(param)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
var param = {
|
|
|
|
'templateId': vm.templateId,
|
|
|
|
"hospitalServiceItemId": item.code,
|
|
|
|
"type": '', //1家医2专医
|
|
|
|
"executeTimes": "",
|
|
|
|
"frequencyCode": "",
|
|
|
|
"timeType": 0, //1白天2晚上0全天
|
|
|
|
"remark": ""
|
|
|
|
}
|
|
|
|
params.push(param)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if (params.length == 0) {
|
|
|
|
mui.toast("请选择配置康复服务项");
|
|
|
|
return false
|
|
|
|
}
|
|
vm.loading.showModal()
|
|
vm.loading.showModal()
|
|
rehaAPI.createTemplateDetail({
|
|
rehaAPI.createTemplateDetail({
|
|
doctor: docInfo.uid,
|
|
doctor: docInfo.uid,
|
|
json: JSON.stringify({
|
|
|
|
templateId: vm.templateId,
|
|
|
|
hospitalServiceItemId: _.pluck(vm.items, 'code').join(',')
|
|
|
|
}),
|
|
|
|
|
|
json:JSON.stringify(params),
|
|
type: vm.isNew?"create":"edit"
|
|
type: vm.isNew?"create":"edit"
|
|
}).then(function(res) {
|
|
}).then(function(res) {
|
|
if(res.status == 200) {
|
|
if(res.status == 200) {
|