| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767 |
- var typeSmall;
- var id = helper.request.queryString("id");
- var CallId = "";
- var callRecordType = helper.request.queryString("callRecordType");
- $(document).ready(function () {
- /*
- 1 通话记录 修改工单
- else 工单管理修改工单
- */
- if (callRecordType === "1") {
- CallId = helper.request.queryString("CallId");
- getWorkOrderCallRecordId();
- } else {
- getWorkOrderDetails();
- }
- // 产品代码
- getProductType();
- // 问题代码
- getProblemCode();
- // 重要级别
- getDealTimely();
- //产品厂家
- getProductFactory();
- // 省 办事处
- LAISHENG($("#source"));//省
- CHOUDQ($("#customer_comaddress")); //办事处
- //普通工单禁止选择原因
- $('#reason').attr("disabled", "disabled");
-
- //保存
- $('.customerSubmit').click(function() {
- saveCustomer();
- });
- $.ajaxSettings.async = true;
- //获取专员手机号
- $("#vipName").change(function() {
- $("#vipTel").val($("#vipName option:selected").attr("index"));
- //$("#areaInps").val($("#vipName option:selected").attr("areaText"));
- $("#typeclass").val($("#vipName option:selected").attr("province") + "/" + $("#vipName option:selected").attr("city"));
- $(".inps2").val($("#vipName option:selected").attr("province"));
- $(".inps3").val($("#vipName option:selected").attr("city"));
- });
- })
- // 获取工单详情
- function getWorkOrderDetails() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WorkOrder/GetDetails",
- dataType: 'json',
- async: true,
- cache: false,
- data: {
- id: id,
- token: $.cookie("token")
- },
- success: function(result) {
- if (result.rows.length > 0) {
- var data = result.rows[0];
- CallId = data.F_CallId;
- $("#workOrderId").val(data.F_WorkOrderId); //工单编号
- $("#name").val(data.F_CusName); // 姓名
- $("#tel").val(data.F_CusPhone); // 电话
- $("#productName").val(data.F_ProductName); // 产品名称
- $('#specification').val(data.F_Specifications); // 规格
- $("#productDate").val(data.F_ProductDate); // 生产日期
- $("#productNumber").val(data.F_BatchNumber); // 产品编码
- $("#productFactory").val(data.F_Manufacturer); // 产品厂家
- $("#problemCode option:selected").text(data.F_ProblemCode); // 问题代码
- $("#problemCode option:selected").val(data.F_ProblemCode); // 问题代码
- $("#productType option:selected").text(data.F_ProductType) //产品代码
- $("#productType option:selected").val(data.F_ProductType); // 产品代码
- $("#qualityProblem").val(data.F_QualityProblem); // 质量问题
- $("#remark").val(data.F_Content); // 备注
- $("#dealTimely option:selected").text(data.F_DealTimely); //重要级别
- $("#dealTimely option:selected").val(data.F_DealTimely); //重要级别
- $("#reason option:selected").text(data.F_Reason); //原因
- $("#reason option:selected").val(data.F_Reason); //原因
- //工单类型
- $("#order_isover input[type=radio][name=type][value="+data.F_Type+"]").attr("checked",'checked');
- if (data.F_ComplaintType) $("#complainType input[type=radio][name=complainType][value="+data.F_ComplaintType+"]").attr("checked",'checked');
- console.log(data.F_ComplaintType, 'data.F_ComplaintType')
- if (data.F_Type === 1){
- $(".isOverWrapper").show();
- $(".complaintWorkOrderRequired").hide();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if(data.F_Type === 2) {
- // 工单类型(投诉) 隐藏立即办理
- $(".isOverWrapper").hide();
- $(".complaintWorkOrderRequired").show();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if(data.F_Type === 3) {
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if (data.F_Type === 4) {
- $(".workOrderTypeForm").hide();
- $(".workOrderTypeSpotCheck").show();
- $("#workOrderRadioAdvisory").attr("disabled", "disabled");
- $("#workOrderRadioComplaint").attr("disabled", "disabled");
- $("#workOrderRadioRepeat").attr("disabled", "disabled");
- }
- $("#spotCheckDate").val(data.F_Datecheck); //抽检日期
- $("#spotCheckCompany").val(data.F_Company); //抽检单位
- $("#spotCheckSamplingtype").val(data.F_Samplingtype); //抽检类型
- $("#spotCheckSalesroom").val(data.F_Salesroom); //抽样客户/门店
- $("#spotCheckSamplingproducts").val(data.F_Samplingproducts); //抽检产品
- $("#spotCheckProductDate").val(data.F_ProductDate); //生产日期
- $("#spotCheckFactories").val(data.F_Factories); //涉及工厂
- $("#spotCheckCusPhone").val(data.F_CusPhone); //电话
- $("#spotCheckRemark").val(data.F_Remark); //备注
- //重复工单
- $("#duplicate input[type=radio][name=duplicate][value="+data.F_Duplicate+"]").attr("checked",'checked');
- // 工单来源
- workOrderSourceDisplay(data);
- // 省市县
- provinceCity(data)
- }
- }
- });
- }
- // 通话记录获取工单详情
- function getWorkOrderCallRecordId() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "WorkOrder/GetCallidDetails",
- dataType: 'json',
- async: true,
- cache: false,
- data: {
- callid: CallId,
- token: $.cookie("token")
- },
- success: function(result) {
- if (result.rows.length > 0) {
- var data = result.rows[0];
- $("#workOrderId").val(data.F_WorkOrderId); //工单编号
- $("#name").val(data.F_CusName); // 姓名
- $("#tel").val(data.F_CusPhone); // 电话
- $("#productName").val(data.F_ProductName); // 产品名称
- $('#specification').val(data.F_Specifications); // 规格
- $("#productDate").val(data.F_ProductDate); // 生产日期
- $("#productNumber").val(data.F_BatchNumber); // 产品编码
- $("#productFactory").val(data.F_Manufacturer); // 产品厂家
- $("#problemCode option:selected").text(data.F_ProblemCode); // 问题代码
- $("#problemCode option:selected").val(data.F_ProblemCode); // 问题代码
- $("#productType option:selected").text(data.F_ProductType) //产品代码
- $("#productType option:selected").val(data.F_ProductType); // 产品代码
- $("#qualityProblem").val(data.F_QualityProblem); // 质量问题
- $("#remark").val(data.F_Content); // 备注
- $("#dealTimely option:selected").text(data.F_DealTimely); //重要级别
- $("#dealTimely option:selected").val(data.F_DealTimely); //重要级别
- $("#reason option:selected").text(data.F_Reason); //原因
- $("#reason option:selected").val(data.F_Reason); //原因
- //工单类型
- $("#order_isover input[type=radio][name=type][value="+data.F_Type+"]").attr("checked",'checked');
- if (data.F_Type === 1){
- $(".isOverWrapper").show();
- $(".complaintWorkOrderRequired").hide();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if(data.F_Type === 2) {
- // 工单类型(投诉) 隐藏立即办理
- $(".isOverWrapper").hide();
- $(".complaintWorkOrderRequired").show();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if(data.F_Type === 3) {
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- $("#workOrderSpotCheck").attr("disabled", "disabled");
- } else if (data.F_Type === 4) {
- $(".workOrderTypeForm").hide();
- $(".workOrderTypeSpotCheck").show();
- $("#workOrderRadioAdvisory").attr("disabled", "disabled");
- $("#workOrderRadioComplaint").attr("disabled", "disabled");
- $("#workOrderRadioRepeat").attr("disabled", "disabled");
- }
- $("#spotCheckDate").val(data.F_Datecheck); //抽检日期
- $("#spotCheckCompany").val(data.F_Company); //抽检单位
- $("#spotCheckSamplingtype").val(data.F_Samplingtype); //抽检类型
- $("#spotCheckSalesroom").val(data.F_Salesroom); //抽样客户/门店
- $("#spotCheckSamplingproducts").val(data.F_Samplingproducts); //抽检产品
- $("#spotCheckProductDate").val(data.F_ProductDate); //生产日期
- $("#spotCheckFactories").val(data.F_Factories); //涉及工厂
- $("#spotCheckCusPhone").val(data.F_CusPhone); //电话
- $("#spotCheckRemark").val(data.F_Remark); //备注
- //重复工单
- $("#duplicate input[type=radio][name=duplicate][value="+data.F_Duplicate+"]").attr("checked",'checked');
- // 工单来源
- workOrderSourceDisplay(data);
- // 省市县
- provinceCity(data)
- //获取工单id
- id = data.F_Id;
- } else {
- layer.msg('没有查询到工单');
- }
- }
- });
- }
- // 工单来源显示
- function workOrderSourceDisplay(data) {
- if (data.F_Source === 1) {
- $("#workOrderSource").val("PC")
- } else if (data.F_Source === 2){
- $("#workOrderSource").val("APP")
- } else if (data.F_Source === 3) {
- $("#workOrderSource").val("微信")
- } else {
- $("#workOrderSource").val("")
- }
- }
- //省市县回显
- function provinceCity(data){
- var provinceCityArr = data.F_AddRess.split("-");
- $("#source option:selected").text(provinceCityArr[0]); //省
- $("#source option:selected").val(provinceCityArr[0]);
- $("#type option:selected").text(provinceCityArr[1]); //市
- $("#type option:selected").val(provinceCityArr[1]);
- $("#keyid").val(provinceCityArr[2]); //区\县
- $("#addressDescription").val(provinceCityArr[3]); //详细地址描述
- }
- //省 市 区/县
- //省
- function LAISHENG(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
- "token": $.cookie("token"),
- pid: 0,
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- //市
- function LAISHI(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
- "token": $.cookie("token"),
- pid:$('#source').val(),
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
-
- })
- }
- // 区/县
- function LAIQU() {
- $("#keyidDataList").empty();
- $("#keyidDataList").append('<option value="请选择"></option>');
- $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetCountyList", {
- "token": $.cookie("token"),
- pid:$('#type').val(),
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("#keyidDataList").append('<option value="'+ n.F_RegionName + '">');
- // $("<option value='" + n.F_RegionId + "'>" + n.F_RegionName + "</option>").appendTo(obj);
- })
- }
- })
- }
- $('#source').on('change',function(){
- LAISHI($("#type"));
- });
- $('#type').on('change',function(){
- LAIQU();
- });
- //办事处 提交人
- function CHOUDQ(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
- "token": $.cookie("token"),
- pid: 1,
- F_Layer: 1,
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- //办事处
- function CHOUFEN(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Department/GetCusAreaList", {
- "token": $.cookie("token"),
- F_Layer:2,
- pid:$("#customer_comaddress").val(),
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(obj);
- })
- }
- })
- }
- // 提交人
- function getSubmitter(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="" deptId="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "UserAccount/GetList", {
- "token": $.cookie("token"),
- type: 1,
- dptid: $("#customer_comaddress").val(),
- }, function (data) {
- var content = data.rows;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_UserId + "'deptId='" + n.F_DeptId + "'>" + n.F_UserName + "</option>").appendTo(obj);
- })
- })
- }
- // 获取提交人
- $('#customer_comaddress').on('change',function(){
- getSubmitter($('#customer_submitter'));
- });
- //产品代码
- function getProductType() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "CPDM"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#productType"));
- })
- }
- });
- }
- // 问题代码
- function getProblemCode() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "WTDM"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#problemCode"));
- })
- }
- });
- }
- // 重要级别
- 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_Name + '">' + n.F_Name + '</option>').appendTo($("#dealTimely"));
- })
- }
- });
- }
- // 重要级别原因(Ⅰ级)
- function getReasonOne() {
- $("#reason").empty();
- $("#reason").append("<option value='' selected='selected'>请选择</option>");
- $.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_Name + '">' + n.F_Name + '</option>').appendTo($("#reason"));
- })
- }
- });
- }
- // 重要级别原因(Ⅱ级)
- function getReasonTwo() {
- $("#reason").empty();
- $("#reason").append("<option value='' selected='selected'>请选择</option>");
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
- dataType: 'json',
- async: true,
- data: {
- token: $.cookie("token"),
- flag: "EJYY"
- },
- success: function(data) {
- var Count = data.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_Name + '">' + n.F_Name + '</option>').appendTo($("#reason"));
- })
- }
- });
- }
- //产品厂家
- function getProductFactory() {
- $("#productFactoryDataList").empty();
- $("#productFactoryDataList").append('<option value="请选择"></option>');
- $("#productFactoryDataList").append('<option value="不清"></option>');
- $("#spotCheckFactoriesDataList").empty();
- $("#spotCheckFactoriesDataList").append('<option value="请选择"></option>');
- $("#spotCheckFactoriesDataList").append('<option value="不清"></option>');
- $.getJSON(huayi.config.callcenter_url + "EquipmentNumber/GetList", {
- "token": $.cookie("token"),
- keywords: "",
- pageindex: "1",
- pagesize: "200",
- }, function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.rows;
- $(content).each(function (i, n) {
- $("#productFactoryDataList").append('<option value="'+ n.F_Production + '">');
- $("#spotCheckFactoriesDataList").append('<option value="'+ n.F_Production + '">');
- })
- }
- })
- }
- // 重要级别显示原因
- $('#dealTimely').on('change',function(){
- if ($('#dealTimely').val() === 'Ⅰ级' || $('#dealTimely').val() === '1类问题'){
- $('#reason').val('');
- $('#reason').removeAttr("disabled");
- getReasonOne();
- } else if ($('#dealTimely').val() === 'Ⅱ级' || $('#dealTimely').val() === '2类问题'){
- $('#reason').val('');
- $('#reason').removeAttr("disabled");
- getReasonTwo();
- } else {
- $('#reason').val('');
- $('#reason').attr("disabled", "disabled");
- }
- })
- /*
- 工单类型
- 1:咨询
- 2:投诉
- 3:重复
- 4:抽查
- */
- $("#order_isover").find('input[type="radio"]').on("change", function() {
- if ($(this).val() === "1"){
- $(".isOverWrapper").show();
- $(".complaintWorkOrderRequired").hide();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- } else if($(this).val() === "2") {
- // 工单类型(投诉) 隐藏立即办理
- $(".isOverWrapper").hide();
- $(".complaintWorkOrderRequired").show();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- } else if ($(this).val() === "3") {
- $(".complaintWorkOrderRequired").hide();
- $(".workOrderTypeForm").show();
- $(".workOrderTypeSpotCheck").hide();
- } else if ($(this).val() === "4") {
- $(".complaintWorkOrderRequired").hide();
- $(".workOrderTypeForm").hide();
- $(".workOrderTypeSpotCheck").show();
- }
- });
- // 指派事件
- $('#isAssign').on('change', function(){
- if($('#isAssign input[name="isAssign"]:checked').val() === '1'){
- $('.comaddressTitle').show();
- $('.comaddressSelect').show();
- $('.submitterTitle').show();
- $('.submitterSelect').show();
- } else if ($('#isAssign input[name="isAssign"]:checked').val() === '2'){
- $('.comaddressTitle').hide();
- $('.comaddressSelect').hide();
- $('.submitterTitle').hide();
- $('.submitterSelect').hide();
- }
- })
- // 地址(省+市+区/县)
- function detailedAddress() {
- if($('#source').val() === ""){
- var province = '';
- } else {
- var province = $('#source').find("option:selected").text()
- }
- if($('#type').val() === ""){
- var city = '';
- } else {
- var city = "-" + $('#type').find("option:selected").text()
- }
- if($('#keyid').val() === ""){
- var county = '';
- } else {
- var county = "-" + $('#keyid').val();
- }
- if($('#addressDescription').val() === ""){
- var addressDescription = '';
- } else {
- var addressDescription = "-" + $('#addressDescription').val();
- }
- var address = province + city + county + addressDescription;
- return address;
- }
- //保存
- function saveCustomer() {
- if($('#order_isover input[name="type"]:checked').val() === "4") {
- if(!$("#spotCheckCusPhone").val()) {
- layer.confirm('请输入电话!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckDate").val()) {
- layer.confirm('请输入抽检日期!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckCompany").val()) {
- layer.confirm('请输入抽检单位!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckSamplingtype").val()) {
- layer.confirm('请输入抽检类型!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckSalesroom").val()) {
- layer.confirm('请输入抽样客户/门店!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckSamplingproducts").val()) {
- layer.confirm('请输入抽检产品!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckProductDate").val()) {
- layer.confirm('请输入生产日期!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckFactories").val()) {
- layer.confirm('请输入涉及工厂!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if(!$("#spotCheckRemark").val()) {
- layer.confirm('请输入备注!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- var cusPhone = $("#spotCheckCusPhone").val();
- var productDate = $("#spotCheckProductDate").val();
- } else {
- if (!$('#name').val()) {
- layer.confirm('请输入姓名!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if (!$('#tel').val()) {
- layer.confirm('请输入电话!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- if (!$('#qualityProblem').val()) {
- layer.confirm('请输入质量问题!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- var cusPhone = $('#tel').val();
- var productDate = $('#productDate').val();
- }
- if ($('#order_isover input[name="type"]:checked').val() === "2") {
- if (detailedAddress() === "---") {
- layer.confirm('请输入地址!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#productType').val()) {
- layer.confirm('请输入产品代码!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#productName').val()) {
- layer.confirm('请输入产品名称!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#specification').val()) {
- layer.confirm('请输入规格!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#productDate').val()) {
- layer.confirm('请输入生产日期!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#productFactory').val()) {
- layer.confirm('请输入生产厂家!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- } else if (!$('#problemCode').val()) {
- layer.confirm('请输入问题代码!', {
- icon: 2,
- btn: ['确定']
- });
- return;
- }
- }
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "WorkOrder/UpdateWorkOrder",
- dataType: 'json',
- async: true,
- beforeSend: function() { //触发ajax请求开始时执行
- $('.customerSubmit').attr("disabled", true);
- $('.customerSubmit').text('保存中...');
- },
- data: {
- token: $.cookie("token"),
- F_Id: id,
- F_Type: $('#order_isover input[name="type"]:checked').val(), //工单类型
- F_ComplaintType: $('#complainType input[name="complainType"]:checked').val(), //投诉分类
- F_DealTimely: $('#dealTimely').val(), //重要级别
- F_Reason: $('#reason').val(), //原因
- F_CusName: $('#name').val(), //姓名
- F_CusPhone: $('#tel').val(), //号码
- F_CusPhone: cusPhone, //号码
- F_AddRess: detailedAddress(),//地址
- F_ProductType: $('#productType').val(), //产品代码
- F_ProductName: $('#productName').val(), //产品名称
- F_Specifications: $('#specification').val(), //规格
- F_ProductDate: productDate, //生产日期
- F_BatchNumber: $('#productNumber').val(), //产品编码
- F_Manufacturer: $('#productFactory').val(), //产品厂家
- F_ProblemCode: $('#problemCode').val(), //问题代码
- F_QualityProblem: $('#qualityProblem').val(), //质量问题
- F_Content: $('#remark').val(), //备注
- F_Duplicate: $('#duplicate input[name="duplicate"]:checked').val(), //重复工单
- F_CallId: CallId,
- F_Datecheck: $("#spotCheckDate").val(), //抽检日期
- F_Company: $("#spotCheckCompany").val(), //抽检单位
- F_Samplingtype: $("#spotCheckSamplingtype").val(), //抽检类型
- F_Salesroom: $("#spotCheckSalesroom").val(), //抽样客户/门店
- F_Samplingproducts: $("#spotCheckSamplingproducts").val(), //抽检产品
- F_Factories: $("#spotCheckFactories").val(), //涉及工厂
- F_Remark: $("#spotCheckRemark").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.$('#orderlist').bootstrapTable('refresh');
- } else {
- $('.customerSubmit').attr("disabled", false);
- $('.customerSubmit').text('保存');
- }
- }
- });
- }
|