Browse Source

签约审核接口对接

linehang 6 years ago
parent
commit
791fde760a
3 changed files with 72 additions and 21 deletions
  1. 6 0
      api/sign_api.js
  2. 2 2
      app/sign/html/sign_manage.html
  3. 64 19
      app/sign/js/sign_handle.js

+ 6 - 0
api/sign_api.js

@ -52,6 +52,9 @@
		teamMember: function(data) {
			return httpRequest.get("doctor/admin-teams/" + data.teamId + "/members", {data: data})
		},
		signRenew: function(data) {
			return httpRequest.post("doctor/sign/agreeRenew", {data: data})
		},
		// 签约消息处理
		sign: function(data) {
			return httpRequest.post("doctor/family_contract/sign", {data: data})
@ -103,6 +106,9 @@
		addTeamLabel: function(data) {
			return httpRequest.post("doctor/patient_label/add/teams",{data:data})
		},
		findMsgId: function(data) {
			return httpRequest.post("/doctor/message/find", {data: data})
		}
	}
    exports.signAPI = signAPI;
})(window)

+ 2 - 2
app/sign/html/sign_manage.html

@ -256,7 +256,7 @@
							closeBtn: 1,
							shift: 5,
							shadeClose: false, //点击遮罩关闭层
							content: "sign_handle.html?patientCode="+list.patientCode+'&signCode='+list.code + '&msgId=' + list.id + '&status=' + status
							content: "sign_handle.html?patientCode="+list.patientCode+'&signCode='+list.code + '&status=' + status
						});
			        },
			        looking: function(list) {
@ -271,7 +271,7 @@
								closeBtn: 1,
								shift: 5,
								shadeClose: false, //点击遮罩关闭层
								content: "sign_detail.html?patientCode="+list.patientCode+'&signCode='+list.code + '&msgId=' + list.id
								content: "sign_detail.html?patientCode="+list.patientCode+'&signCode='+list.code
							});
			        	} else {
			        		// 居民信息页 

+ 64 - 19
app/sign/js/sign_handle.js

@ -60,6 +60,7 @@ top.handleVue=new Vue({
    	labelName: null,
    	signInfo: {
            signType: 1,
            signCode: httpData.signCode,
            majorDoctor: null,
            majorDoctorName: null,
            healthLabel: null,
@ -67,13 +68,14 @@ top.handleVue=new Vue({
            disease: null,
            patientIDcard: null, // 必填
            adminTeamCode: null,
            msgid: httpData.msgId, // 消息id(必填)
            msgid: null, // 消息id(必填)
            patient: httpData.patientCode,
            doctor: null,
            doctorName: null,
            healthDoctor: null,
            healthDoctorName: null,
            type: 1,
            state: 1,
            expenses: null,
            group: null,
            //添加服务类型数据
@ -87,6 +89,7 @@ top.handleVue=new Vue({
    mounted: function() {
    	this.getSigndict();
    	this.getDictByDictName();
    	this.findMsgId()
    	this.teamLimit();
    	this.findPatientSignServerBySignCode();
    },
@ -152,6 +155,22 @@ top.handleVue=new Vue({
				}
			})
    	},
    	findMsgId: function() {
    		var vm =this,
    			params = {
    				sender: httpData.patientCode,
    				signStatus: httpData.status == 0 ? 1 : 8
    			},
    			loadding = layer.load(0, {shade: false});
			signAPI.findMsgId(params).then(function(res) {
				layer.close(loadding)
				if(res.status == 200) {
					vm.signInfo.msgid = res.data.id
				} else {
					showErrorMessage(res.msg);
				}
			})
    	},
    	signing: function() {
    		var vm = this,
    			loadding = layer.load(0, {shade: false}),
@ -162,6 +181,7 @@ top.handleVue=new Vue({
				layer.close(loadding)
				if(res.status == 200) {
					vm.patientInfo = res.data
					vm.signInfo.patientIDcard = res.data.idCard
				} else {
					showErrorMessage(res.msg);
				}
@ -169,6 +189,10 @@ top.handleVue=new Vue({
    	},
    	selectServer:function(){
    		var vm=this
    		if(!this.signInfo.adminTeamCode) {
    			showWarningMessage("请先选择签约团队");
    			return false;
    		}
    		if(top.changeTypeIndex && top.$('#layui-layer-shade'+top.changeTypeIndex).length){
    			top.xgLabel.initPage();
    			(top.$('#layui-layer-shade'+top.changeTypeIndex).show(),top.$('#layui-layer'+top.changeTypeIndex).show());
@ -189,10 +213,10 @@ top.handleVue=new Vue({
    		var vm = this
    		this.serverName = "";
    		this.labelName = "";
    		this.signInfo.sevId = res.server.join(",");
    		this.signInfo.disease = res.disease.join(",");
    		this.signInfo.healthLabel = res.heath.join(",");
    		this.signInfo.customLabel = res.team.join(",");
    		if(res.server.length != 0) this.signInfo.sevId = res.server.join(",");
    		if(res.disease.length != 0) this.signInfo.disease = res.disease.join(",");
    		if(res.heath.length != 0) this.signInfo.healthLabel = res.heath.join(",");
    		if(res.team.length != 0) this.signInfo.customLabel = res.team.join(",");
    		$.each(res.server, function(i, v) {
    			$.each(vm.signdictList, function(j, u) {
    				if(v == u.code) {
@ -341,17 +365,17 @@ top.handleVue=new Vue({
		                if(v.available && (v.level == 3 || v.level == 2)) {vm.memberList.push(v);}
		                if(v.available && v.level == 2) {vm.doctorList.push(v);}
		            });
		            if(!judge) {
		            if(!judge && httpData.status == 1) {
		            	if(vm.doctorType == 3) {
		            		vm.warnMsg = "去年居民续签的全科医生" + vm.signInfo.doctorName + "已不在您的团队,请重新选择一位全科医生"
							vm.signInfo.doctor = null
		            		vm.signInfo.doctorName = null
		            		vm.warnMsg = "居民续签的全科医生已不在您的团队,请重新选择一位全科医生"
						}
		            	}
						if(vm.doctorType == 2) {
							vm.signInfo.healthDoctor = null
		            		vm.warnMsg = "去年居民续签的健管师" + vm.signInfo.healthDoctorName + "已不在您的团队,请重新选择一位健管师"
		            		vm.signInfo.healthDoctor = null
		            		vm.signInfo.healthDoctorName = null
		            		vm.warnMsg = "居民续签的健管师已不在您的团队,请重新选择一位健管师"
		            	}
						}
						top.changeTypeIndex=null
		            }
				} else {
@ -485,6 +509,7 @@ top.handleVue=new Vue({
					}
					vm.signInfo.adminTeamCode = 0
					vm.signInfo.type = 2
					vm.signInfo.state = 0
					vm.sign()
				},
				success: function(layero){
@ -493,16 +518,36 @@ top.handleVue=new Vue({
			});
        },
        sign: function() {// type:1签约 2拒签
        	if(this.signInfo.type == 1 && ((this.doctorType == 2 && !this.signInfo.healthDoctor) || (this.doctorType == 3 && !this.signInfo.doctor) || !this.signInfo.sevId || (!this.signInfo.disease && !this.signInfo.healthLabel && !this.signInfo.customLabel))) {
        		showWarningMessage("请将填写完整签约信息!");
        		return false;
        	}
        	var vm = this,
    			loadding = layer.load(0, {shade: false});
			signAPI.sign(vm.signInfo).then(function(res) {
				layer.close(loadding)
				if(res.status == 200) {
					top.layer.closeAll();
				} else {
					showErrorMessage(res.msg);
				}
			})
    		if (httpData.status == 0) {
				signAPI.sign(vm.signInfo).then(function(res) {
					layer.close(loadding)
					if(res.status == 200) {
//						top.layer.closeAll();
						var url = window.location.href + "?statusCode=1"
						window.location.href = url
					} else {
						showErrorMessage(res.msg);
					}
				})
			} else {
				signAPI.signRenew(vm.signInfo).then(function(res) {
					layer.close(loadding)
					if(res.status == 200) {
						showSuccessMessage(res.msg || "操作成功")
//						top.layer.closeAll();
						var url = window.location.href + "?statusCode=1"
						window.location.href = url
					} else {
						showErrorMessage(res.msg);
					}
				})
			}
        }
    }
})