| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- /**
- * 修改工单
- * */
- $(function() {
- //获取 id
- var oid = helper.request.queryString("oid");
- autosize($('textarea'));
- //获取工单来源 获取业务办理 获取工单类型
- $.when(helper.getDropList.getlistDropByDic($('#order_source'), 'GDLY'),
- helper.getDropList.getlistDropByDic($('#order_handle'), 'YWLX'),
- helper.getDropList.getOrderRadios($('#order_typ'), 'GDLX', 'inlineRadioOptions'))
- .then(function(){
- $('#order_source').selectpicker('val', '468');
- $('#order_typ').find('input[type="radio"]').on('change', function() {
- $('#order_type').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "107") { // 业务办理
- $('#order_handles').show();
- }else{
- $('#order_handles').hide();
- }
- });
- });
- if(oid) {
- getWorkOrder(oid); //获取工单信息
- }
- });
-
- $('#order_type').find('input[type="radio"]').on('change', function() {
- if($(this).val() === "1") { //业务办理 dispatch
- $('#order_pointment').hide();
- $('#Tousik').hide();
- $('#Tojon').hide();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").hide();
- $("#tration").hide();
- }else if($(this).val() === "2"){
- $('#order_pointment').show();
- $('#Tousik').hide();
- $('#Tojon').hide();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").hide();
- $("#tration").hide();
- }else if($(this).val() === "3"){
- $('#order_pointment').hide();
- $('#Tousik').show();
- $('#Tojon').show();
- $("#dispatch").hide();
- $("#insurance").hide();
-
- $("#zhujkeshi").show(); //tration insurance yubzhu
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#tration").hide();
- }else if($(this).val() === "4"){
- $('#order_pointment').hide();
- $('#Tousik').hide();
- $('#Tojon').show();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#tration").hide();
- }
- });
- //预约类别 显示内容
- $("#order_category").change(function(){
- if($("#order_category").find("option:selected").val()=="预约挂号"){
- $("#tration").show();
- $("#insurance").hide();
- $("#bunk").hide();
- $("#dispatch").hide();
-
- $("#yukshi").show();
- $("#yusjian").show();
- $("#yubzhu").show();
- $("#zhujkeshi").hide();
- }else if($("#order_category").find("option:selected").text()=="预约检查"){
- $("#tration").hide();
- $("#insurance").show();
- $("#bunk").hide();
- $("#dispatch").hide();
-
-
- $("#zhujkeshi").show();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- }else if($("#order_category").find("option:selected").text()=="预约床位"){
- $("#tration").hide(); //bunk dispatch zhujkeshi
- $("#insurance").hide();
- $("#bunk").show();
- $("#dispatch").hide();
-
-
- $("#yukshi").show();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#zhujkeshi").show();
- }else if($("#order_category").find("option:selected").text()=="预约车辆"){
- $("#tration").hide();
- $("#insurance").hide();
- $("#bunk").hide();
- $("#dispatch").show();
-
-
- $("#yukshi").show();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#zhujkeshi").hide();
-
- }
-
- })
-
-
- //工单有效性
- $('#order_iseffective').find('input[type="radio"]').on('change', function() {
- //是否有效工单项(0有效,1无效)
- if($(this).val() === "1") { //无效
- $('.order_note').show();
- } else {
- $('.order_note').hide();
- }
- });
-
- //新增工单创建
- $('#save_order').on('click', orderSave);
- });
- //新建工单 保存
- function orderSave() {
- var wURL = '';
- var oid = '';
- oid = helper.request.queryString("oid");
- var isDetail = helper.request.queryString("isDetail");
- if(oid) {
- wURL = 'WorkOrderNew/Update';
- } else {
- wURL = 'CallInScreen/AddWorkOrder';
- }
-
- var order_handle = $('#order_handles').is(':visible') ? $('#order_handle').val() : 0;
- $.post(huayi.config.callcenter_url + wURL, {
- ID: oid, //int 工单id;
- TypeClass:$('#order_type').find('input[type="radio"]:checked').val(), //反馈类型
- CustomerName:$('#order_name').val(), //客户姓名
- CustomerTel:$('#order_tel').val(), //客户电话
- Gender:$('#order_sexte').find('input[type="radio"]:checked').val(), //性别
- Location:$('#order_company').val(), //客户地址
- IsOver:$('#order_isover').find('input[type="radio"]:checked').val(), //是否处理
- DealContents:$('#order_conduct').val(), //处理内容
- Problem:$('#order_reception').val(), //问题描述
- Reservation:$('#order_category').val(), //预约类型
- IDnumber:$('#order_number').val(), //身份证
- Expert:$('#order_expert').val(), //预约专家
- IsMedical:$('#order_advice').find('input[type="radio"]:checked').val(), //是否来院就医
- Project:$('#order_utilities').val(), //预约项目
- AboutcarMan:$('#order_About').val(), //约车人
- CarTel:$('#order_lephone').val(), //约车电话
- TreatmentAddress:$('#order_ocation').val(), //接诊地址
- IsCar:$('#order_chuch').find('input[type="radio"]:checked').val(), //是否出车
- Condition:$('#order_Huebig').val(), //患者病情
- Department:$('#order_office').val(), //预约科室 1111111111111111111111111111111111111
- TranDepartment:$('#order_strtil').val(), //转接科室 222222222222222222222222222
- Remarks:$('#order_strative').val(),//备注
- AppointmentTime:$('#order_time').val(),//预约时间
- DriveoutTime:$('#order_chucetime').val(),//出车时间
- ComplaintDepartment:$('#order_Betou').val(), //被投诉科室
- ComplaintTarget:$('#order_Betxia').val(), //被投诉对象
- IsRelevant:$('#order_xibum').find('input[type="radio"]:checked').val(), //是否转相关部门
- // isover: $('#order_isover').find('input[type="radio"]:checked').val(), //int 是否立即处理(默认为0,立即处理为1,立即处理的工单无法指派接收人和接受部门)
- token: $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- if(isDetail === "true") {
- parent.parent.layer.closeAll();
- parent.parent.$('#orderlist').bootstrapTable('refresh');
- parent.parent.layer.msg("修改成功");
- } else {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.$('#workorderlist').bootstrapTable('refresh');
- parent.$('.Closed').trigger('click');
- parent.layer.msg("保存成功");
- }
- top.workcount();
- }
- })
- }
- //获取 工单信息
- function getWorkOrder(oid) {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrderNew/GetDetails', {
- "id": oid,
- "token": $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- if(result.rows && result.rows.length > 0) {
- var data = result.rows[0];
- $('#order_type').find('input[type="radio"]:checked').val(data.TypeClass); //反馈类型
- $('#order_name').val(data.CustomerName); //客户姓名
- $('#order_tel').val(data.CustomerTel); //客户电话
- $('#order_company').val(data.Location); //客户地址
- $('#order_isover').find('input[type="radio"]:checked').val(data.IsOver); //是否处理
- $('#order_conduct').val(data.DealContents); //处理内容
- $('#order_reception').val(data.Problem); //问题描述
- $('#order_category').val(data.Reservation); //预约类型
- $('#order_number').val(data.IDnumber); //身份证
- $('#order_expert').val(data.Expert); //预约专家
- $('#order_utilities').val(data.Project); //预约项目
- $('#order_About').val(data.AboutcarMan); //约车人
- $('#order_lephone').val(data.CarTel); //约车电话
- $('#order_ocation').val(data.TreatmentAddress); //接诊地址
- $('#order_Huebig').val(data.Condition); //患者病情
- $('#order_office').val(data.Department); //预约科室 1111111111111111111111111111111111111
- $('#order_strtil').val(data.TranDepartment); //转接科室 222222222222222222222222222
- $('#order_strative').val(data.Remarks);//备注
- $('#order_time').val(data.AppointmentTime);//预约时间
- $('#order_chucetime').val(data.DriveoutTime);//出车时间
- $('#order_Betou').val(data.ComplaintDepartment); //被投诉科室
- $('#order_Betxia').val(data.ComplaintTarget); //被投诉对象
-
- //性别
- if (data.Gender === "男") {
- $("#order_sexte input[name='tions'][value='1']").prop("checked","checked");
- } else if (data.Gender === "女") {
- $("#order_sexte input[name='tions'][value='2']").prop("checked","checked");
- }
-
- //是否来医院就医
- if (data.IsMedical === "是") {
- $("#order_advice input[name='advice'][value='1']").prop("checked","checked");
- } else if (data.IsMedical === "否") {
- $("#order_advice input[name='advice'][value='0']").prop("checked","checked");
- }
-
- //是否出车
- if (data.IsCar === "是") {
- $("#order_chuch input[name='chuch'][value='1']").prop("checked","checked");
- } else if (data.IsCar === "否") {
- $("#order_chuch input[name='chuch'][value='0']").prop("checked","checked");
- }
-
- //是否转相关部门
- if (data.IsRelevant === "是") {
- $("#order_xibum input[name='xibum'][value='1']").prop("checked","checked");
- } else if (data.IsRelevant === "否") {
- $("#order_xibum input[name='xibum'][value='0']").prop("checked","checked");
- }
-
- if(data.TypeClass === "就医咨询") { //业务办理 dispatch
- $("#order_type input[type=radio][value='1']").prop("checked", true);
- $('#order_pointment').hide();
- $('#Tousik').hide();
- $('#Tojon').hide();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").hide();
- $("#tration").hide();
- }else if(data.TypeClass === "预约诊疗"){
- $("#order_type input[type=radio][value='2']").prop("checked", true);
- $('#order_pointment').show();
- $('#Tousik').hide();
- $('#Tojon').hide();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").hide();
- $("#tration").hide();
- }else if(data.TypeClass === "投诉"){
- $("#order_type input[type=radio][value='3']").prop("checked", true);
- $('#order_pointment').hide();
- $('#Tousik').show();
- $('#Tojon').show();
- $("#dispatch").hide();
- $("#insurance").hide();
-
- $("#zhujkeshi").show(); //tration insurance yubzhu
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#tration").hide();
- }else if(data.TypeClass === "建议"){
- $("#order_type input[type=radio][value='4']").prop("checked", true);
- $('#order_pointment').hide();
- $('#Tousik').hide();
- $('#Tojon').show();
- $("#insurance").hide();
- $("#dispatch").hide();
-
- $("#zhujkeshi").hide();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#tration").hide();
- }
-
- if(data.Reservation=="预约挂号"){
- $("#tration").show();
- $("#insurance").hide();
- $("#bunk").hide();
- $("#dispatch").hide();
-
- $("#yukshi").show();
- $("#yusjian").show();
- $("#yubzhu").show();
- $("#zhujkeshi").hide();
- }else if(data.Reservation=="预约检查"){
- $("#tration").hide();
- $("#insurance").show();
- $("#bunk").hide();
- $("#dispatch").hide();
-
-
- $("#zhujkeshi").show();
- $("#yukshi").hide();
- $("#yusjian").hide();
- $("#yubzhu").show();
- }else if(data.Reservation=="预约床位"){
- $("#tration").hide(); //bunk dispatch zhujkeshi
- $("#insurance").hide();
- $("#bunk").show();
- $("#dispatch").hide();
-
-
- $("#yukshi").show();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#zhujkeshi").show();
- }else if(data.Reservation=="预约车辆"){
- $("#tration").hide();
- $("#insurance").hide();
- $("#bunk").hide();
- $("#dispatch").show();
-
-
- $("#yukshi").show();
- $("#yusjian").hide();
- $("#yubzhu").show();
- $("#zhujkeshi").hide();
-
- }
-
-
- if(data.Province) {
- $('#order_note').val(decodeURIComponent(data.Province)); //否 string 无效原因
- }
- if(data.F_IsOver != null){
- $('#order_isover').find('input[type="radio"][value="'+ data.F_IsOver +'"]').prop('checked', true); //int 是否立即处理(默认为0,立即处理为1,立即处理的工单无法指派接收人和接受部门)
- }
- }
- }
- });
- }
|