123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- var httpData=GetRequest(),
- doctorInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'));
- var refuseReason = null;
- function showSuccessMessage(msg) {
- layer.msg(msg, {
- icon: 1
- })
- }
- function showErrorMessage(msg) {
- layer.msg(msg, {
- icon: 5
- })
- }
- function showWarningMessage(msg) {
- layer.msg(msg, {
- icon: 2
- })
- }
- function showInfoMessage(msg) {
- layer.msg(msg, {
- icon: 6
- })
- }
- function getReason(ele) {
- if(ele.hasClass("active")) {
- ele.removeClass("active")
- refuseReason = null
- return false;
- }
- ele.addClass("active").siblings().removeClass("active");
- refuseReason = ele.html();
- }
- new Vue({
- el: "#app",
- data: {
- isShowList1: false,
- isShowList2: false,
- isShowList3: false,
- showTit3: "请选择补贴类型",
- showTit4: "请选择服务类型",
- showTit5: "请选择居民标签",
- patientInfo: null,
- teamList: null,
- memberList: null,
- dictList: null,
- fileList: null,
- signInfo: {
- signType: 1,
- majorDoctor: null,
- majorDoctorName: null,
- healthLabel: null,
- customLabel: null,
- disease: null,
- patientIDcard: null, // 必填
- adminTeamCode: null,
- msgid: httpData.msgId, // 消息id(必填)
- patient: httpData.patientCode,
- healthDoctor: null,
- healthDoctorName: null,
- type: 1,
- expenses: null,
- group: null,
- //添加服务类型数据
- sevId: null,
- // 拒绝参数
- // adminTeamCode:0,
- // type: 2,
- refuseReason: null
- },
- },
- mounted: function() {
- if (httpData.status == 0) {
- this.signing()
- } else {
- this.signOuttime();
- }
- this.getDictByDictName();
- this.teamLimit();
- this.findPatientSignServerBySignCode();
- },
- methods: {
- signing: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- patient: httpData.patientCode
- }
- signAPI.signing(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.patientInfo = res.data
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- signOuttime: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- patient: httpData.patientCode
- }
- signAPI.signOuttime(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.patientInfo = res.data
- vm.signInfo.adminTeamCode = vm.patientInfo.jtSign.adminTeamId
- vm.signInfo.healthDoctorName = vm.patientInfo.jtSign.doctorHealthName
- vm.signInfo.healthDoctor = vm.patientInfo.jtSign.doctorHealth
- vm.signInfo.expenses = vm.patientInfo.jtSign.expensesType
- vm.teamMember()
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- getDictByDictName: function() {
- var vm =this,
- loadding = layer.load(0, {shade: false}),
- params = {
- name: "SIGN_EXPENSES"
- }
- signAPI.getDictByDictName(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.dictList = res.list
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- teamLimit: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- doctorId: doctorInfo.uid
- }
- signAPI.teamLimit(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.teamList = res.data
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- findPatientSignServerBySignCode: function() {
- var vm =this,
- loadding = layer.load(0, {shade: false}),
- params = {
- signCode: httpData.signCode
- };
- signAPI.findPatientSignServerBySignCode(params).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
- vm.fileList = []
- $.each(res.data, function(i, v) {
- if(v.serverType == 8 || v.serverType == 9 || v.serverType == 11) {
- vm.fileList.push(v);
- }
- });
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- teamMember: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}),
- params = {
- teamId: vm.signInfo.adminTeamCode
- }
- signAPI.teamMember(params).then(function(res) {
- layer.close(loadding)
- vm.memberList = []
- if(res.status == 200) {
- $.each(res.data, function(i, v) {
- if(v.level == 3 || v.level == 2)
- vm.memberList.push(v);
- });
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- selectStatus: function(num) {
- if(num == 1) {
- this.isShowList2 = false;
- this.isShowList3 = false;
- this.isShowList1 = !this.isShowList1;
- } else if (num == 2) {
- if(!this.signInfo.adminTeamCode) {
- showWarningMessage("请先选择签约团队")
- }
- this.isShowList1 = false;
- this.isShowList3 = false;
- this.isShowList2 = !this.isShowList2;
- } else {
- this.isShowList1 = false;
- this.isShowList2 = false;
- this.isShowList3 = !this.isShowList3;
- }
-
- },
- selectLi: function(num, data) {
- if(num == 1) {
- this.isShowList1 = false;
- this.signInfo.adminTeamCode = data.id;
- if(!this.memberList) {
- this.teamMember()
- }
- }
- if(num == 2) {
- this.isShowList2 = false;
- this.signInfo.healthDoctorName = data.name
- this.signInfo.healthDoctor = data.code
- }
- if(num == 3) {
- this.isShowList3 = false;
- this.signInfo.expenses = data.code;
- }
- },
- showTeamName: function(teamCode) {
- var teamName;
- if(!this.teamList) {
- return "请选择签约团队";
- }
- for(var i = 0, len = this.teamList.length; i < len; i++) {
- if(teamCode == this.teamList[i].id) {
- teamName = this.teamList[i].name;
- }
- }
- return teamName
- },
- showExpensesName: function(code) {
- var expensesName;
- if(!this.dictList) {
- return "请选择补贴类型";
- }
- for(var i = 0, len = this.dictList.length; i < len; i++) {
- if(code == this.dictList[i].code) {
- expensesName = this.dictList[i].value;
- }
- }
- return expensesName
- },
- setPatImg: function(str) {
- var imgStr = httpRequest.getImgUrl(str);
- if (imgStr == "") {
- return '../../../images/p-female.png';
- } else {
- return imgStr;
- }
- },
- lookPhoto: function(data) {
- layer.open({
- type: 2,
- area: ['100%', '100%'],
- title: "凭证预览",
- shade: 0.5,
- shadeClose: true,
- shift: 2,
- content: '../html/photo_show.html?serverType=' + data.serverType + '&patientCode=' + httpData.patientCode
- })
- },
- refuse: function() {
- var vm = this;
- layer.open({
- type: 1,
- area: ['400px', '300px'],
- shade: 0.5,
- title: '拒绝签约原因',
- shift: 2,
- shadeClose: false, //点击遮罩关闭层
- content: '<div class="p20 pb0"><div class="reason_list clearfix"><span class="fl mr10 mb20" onclick="getReason($(this))">居民信息填写不详</span><span class="fl mr10 mb20" onclick="getReason($(this))">签约人数已满</span><span class="fl mb20" onclick="getReason($(this))">家庭医生变更</span></div><textarea id="reason" maxLength="200" placeholder="可选择填写其他拒签原因(限200字以内)"></textarea></div>',
- btn: ['提 交', '取 消'],
- yes:function(index, layero) {
- if(!refuseReason) {
- if(!$("#reason").val()) {
- showWarningMessage("请选择或输入拒绝理由!");
- layer.close(index);
- return false
- }
- vm.signInfo.refuseReason = $("#reason").val()
- vm.signInfo.adminTeamCode = 0
- vm.signInfo.type = 2
- vm.sign()
- }
- layer.close(index);
- },
- success: function(layero){
- layero.find('.layui-layer-btn').css('text-align', 'center')
- }
- });
- },
- sign: function() {// type:1签约 2拒签
- var vm = this,
- loadding = layer.load(0, {shade: false});
- signAPI.sign(vm.signInfo).then(function(res) {
- layer.close(loadding)
- if(res.status == 200) {
-
- } else {
- showErrorMessage(res.msg);
- }
- })
- }
- }
- })
|