123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- var Request = new Object()
- Request = GetRequest()
- var param = JSON.parse(decodeURIComponent(Request.paramStr)),
- backToSynergy = Request.backToSynergy
- // param.key = ''
- // param.imgCaptcha = ''
- $(function () {
- // document.getElementById('referenceInformation').bsSuggest({
- // data: [{
- // code: '',
- // name: '全部'
- // }],
- // getDataMethod: 'data',
- // effectiveFields: ['name'],
- // idField: 'code',
- // keyField: 'name'
- // })
- $('#closeBtn').click(function () {
- closeLayer()
- })
-
- $('input:radio').click(function () {
- console.log($('input:radio:checked').val(), 'aaaaaaaaaaaaaaaaaaa')
- })
- $('input:checkbox').click(function () {
- var checkList = new Array()
- $('input[name="referInfo"]:checked').each(function () {
- checkList.push($(this).val()) //向数组中添加元素
- console.log('asxxsxsxs', checkList)
- })
- })
- })
- function closeLayer() {
- var index = top.layer.getFrameIndex(window.name)
- top.layer.close(index)
- }
- // 获取滑动验证码
- function createcode(id, callback,patient) {
- APIService.createPicCaptcha({
- patient: patient
- }).then(function(res){
- if (res.status == 200) {
- var data = res.data
- if (data != null) {
- $("#"+id)
- .imgcode(
- {
- frontimg : 'data:image/png;base64,'
- + data.slideImage,
- backimg : 'data:image/png;base64,'
- + data.backImage,
- yHeight : data.y,
- refreshcallback : function() {
- //刷新验证码
- createcode(id, callback);
- },
- callback : function(msg) {
- console.log(msg);
- callback({
- key: data.imageToken,
- imgCaptcha: JSON.stringify([{
- x: msg.xpos,
- y: data.y
- }])
- })
- }
- });
- } else {
- mui.toast(res.msg || "验证码获取失败")
- // reject()
- }
-
- } else {
- mui.toast("验证码获取失败");
- // reject()
- }
- })
- }
- new Vue({
- el: '#app',
- data: function () {
- return {
- param: param,
- imgCodeImg: '',
- radio: 0,
- referenceInfo: '已选0',
- EDUCATE_CONTENT:'',
- referenceShow:false,
- tablelist:[],
- pageNo:1,
- pagesize:10,
- pagetotal:'',
- checkList:[],
- placeholder:"请选择参考信息",
- }
- },
- mounted: function () {
- var vm = this
- this.getResultList()
- document.addEventListener('click',function(){
- // if(vm.referenceShow){
- // vm.referenceShow = false
- // }
- })
- },
- watch:{
- checkList() {
- this.placeholder = this.checkList.length!=0?"已选"+this.checkList.length+"项":"请选择参考信息"
- },
- },
- methods: {
-
- submitBtn:function() {
- var vm = this
- if (!param.patientPhone) {
- top.showErrorMessage('请填写病人手机号码')
- top.layer.close(loadingid)
- return
- }
- createcode('imgscode',function(content) {
- $('#imgscode').html('')
- vm.applyData(content)
- },param.patient)
-
- },
- applyData:function(imgscodeContent) {
- var vm = this
- var loadingid = top.layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- })
- var p = JSON.parse(JSON.stringify(param))
- var user = JSON.parse(localStorage.getItem('docInfo'))
- p.imgCaptcha = imgscodeContent.imgCaptcha
- p.key = imgscodeContent.key
- p.dcode = user.code
- p.dname = user.name
- p.relationCode = param.surveyCode
- p.reservationType = $('input:radio:checked').val()
- p.incidentalMsgType = '11' //筛查报告11
- p.incidentalMsg = '筛查报告' //参考信息
- p.reservationReason = vm.EDUCATE_CONTENT // 转诊原因
- var content = []
- vm.checkList.forEach(function(s){
- content.push({
- addinfoText:s.czrq+s.templateTitle,
- code:s.code,
- patient:s.patientCode,
- patientName:s.patientName,
- })
- })
- var para = {
- type:"11",
- content:content,
- }
- p.paramJson = encodeURIComponent(encodeURIComponent(JSON.stringify([para])))
-
- var arrangeDate = JSON.parse(p.arrangeDate)
- arrangeDate.sectionType = 'a'
- arrangeDate.clazz = 'div-time-enable'
- p.arrangeDate = JSON.stringify(arrangeDate)
- // "sectionType":"a","clazz":"div-time-enable"
- // p.arrangeDate = JSON.stringify(p.arrangeDate)
- // {"max":"1","startTime":"2020/4/17 8:00:00","used":"0","endTime":"2020/4/17 8:07:00","sectionType":"a","clazz":"div-time-enable"}
- APIService.createOrderByDoctor(p)
- .then(function (res) {
- top.layer.close(loadingid)
- if (res.status == 200) {
- parent.eventBuss.$emit('guan_results')
- top.showSuccessMessage('提交预约挂号成功!')
- if (backToSynergy) {
- top.setSynergyData(param)
- }
- closeLayer()
- } else {
- top.showErrorMessage(res.msg || '预约挂号提交失败!请稍后重试')
- }
- })
- .catch(function (e) {
- top.layer.close(loadingid)
- console && console.error(e)
- })
- },
- more:function() {
- this.pageNo++
- this.getResultList()
- },
- getResultList:function() {
- var vm = this
- var params = {
- diseaseType: '', //疾病类型
- dealType: '', //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
- patientName:vm.param.patientName, //搜索居民的姓名
- isDanger: 1, //是否高危预警(0否 1是)
- pageNo: this.pageNo,
- pageSize: vm.pagesize
- }
- jbscAPI.getResultList(params).then(function (res) {
- if (res.status == 200) {
- if(this.pageNo==1) {
- vm.tablelist = res.data.data
- }else{
- vm.tablelist = vm.tablelist.concat(res.data.data)
- }
- vm.pagetotal = Math.ceil(res.data.num / vm.pagesize)
- } else {
- showErrorMessage(res.msg)
- }
- })
- },
- }
- })
|