Vue.component('treatment-patient', {
template: '
就诊人信息
\
\
\
\
就诊居民 | \
{{appointinfo.name}} | \
\
\
身份证号 | \
{{handleIdcard(appointinfo.idcard)}} | \
\
\
社保卡号 | \
{{appointinfo.ssc}} | \
\
\
手机号码 | \
{{appointinfo.phone}} | \
\
\
\
\
\
\
\
',
props: ["appointinfo"],
data: function() {
return {
editable: false
}
},
mounted: function() {
},
methods: {
remove: function() {
var vm = this
var layerid = top.layer.confirm('请与居民确认:
一个月内连续取消预约三次,系统会自动将居民年列入黑名单,三个月后才 可再次预约。', {
title: '取消预约',
closeBtn: true,
btn: ['确定','取消'] //按钮
}, function(){
var loadingid = top.layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
});
APIService.cancelOrder(param).then(function(res) {
top.layer.close(loadingid)
if(res.status == 200) {
top.layer.close(layerid)
top.showSuccessMessage("取消预约成功!")
closeLayer()
EventBus.$emit('appointment-search',{
data: kwObj
})
} else {
top.showErrorMessage(res.msg || "取消预约失败!")
}
}).catch(function(e) {
top.layer.close(loadingid)
console && console.error(e)
})
}, function(){
});
},
goBack: function() {
var layerid = parent.layer.getFrameIndex(window.name)
parent.layer.close(layerid)
},
handleIdcard: function(str) {
var len = str.length
if (len == 18) {
return str.substr(0, 4) + '**********' + str.substr(14, 4)
} else if (len == 15) {
return str.substr(0, 4) + '*******' + str.substr(11, 4)
}
}
}
})