| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- var id = helper.request.queryString("id");
- $(document).ready(function () {
- //保存
- $('.customerSubmit').click(function() {
- saveCustomer();
- });
- //重要级别
- getDealTimely();
- //重要级别原因
- getReason();
- })
- // 重要级别
- function getDealTimely() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "GDDJ"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#dealTimely"));
- })
- }
- });
- }
- // 重要级别原因
- function getReason() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "YJYY"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_DictionaryValueId + '">' + n.F_Name + '</option>').appendTo($("#reason"));
- })
- }
- });
- }
- // 重要级别为一级时显示原因
- $('#dealTimely').on('change',function(){
- console.log('1111',$('#dealTimely').val());
- if ($('#dealTimely').val() !== '506'){
- $('#reason').val('');
- $('#reason').attr("disabled", "disabled");
- } else {
- $('#reason').removeAttr("disabled");
- }
- })
- //保存
- function saveCustomer() {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "WorkOrder/Sing",
- dataType: 'json',
- async: true,
- beforeSend: function() { //触发ajax请求开始时执行
- $('.customerSubmit').attr("disabled", true);
- $('.customerSubmit').text('确定中...');
- },
- data: {
- token: $.cookie("token"),
- id: id,
- dealTimely: $('#dealTimely').val(), //重要级别内容
- reason: $('#reason').val(), //重要级别原因
- },
- success: function(data) {
- if (data.state.toLowerCase() == 'success') {
- $('.customerSubmit').attr("disabled", false);
- $('.customerSubmit').text('确定');
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.layer.msg("保存成功!");
- // parent.$('#workorderlist').bootstrapTable('refresh');
- // parent.$('#workorderlist_').bootstrapTable('refresh');
- // parent.$('#orderlist').bootstrapTable('refresh');
- parent.initTable();
- } else {
- $('.customerSubmit').attr("disabled", false);
- $('.customerSubmit').text('确定');
- }
- }
- });
- }
|