|
@@ -76,7 +76,7 @@
|
|
|
menuActive("qiyeku_info")
|
|
|
var ttable = {};
|
|
|
var editor_add = null;
|
|
|
- var editor_udapte = null;
|
|
|
+ var editor_update = null;
|
|
|
$(function () {
|
|
|
ttable = $('#dataTable').DataTable({
|
|
|
"paging": true,
|
|
@@ -299,6 +299,20 @@
|
|
|
var wechat_accounts = $("#s_wechat_accounts").val();//微信公众号
|
|
|
var website = $("#s_website").val();//网址
|
|
|
var contact = editor_add.getText();//联系人
|
|
|
+ if (typeof contact == 'string') {
|
|
|
+ try {
|
|
|
+ var obj=JSON.parse(contact);
|
|
|
+ if(typeof obj == 'object' && obj ){
|
|
|
+ // alert("格式正确");
|
|
|
+ }else{
|
|
|
+ alert("联系人的表单json格式不正确");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } catch(e) {
|
|
|
+ alert("联系人的表单json格式不正确");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
if (company_name === "") {
|
|
|
alert("红色标签的表单不能为空!");
|
|
|
return
|
|
@@ -322,7 +336,6 @@
|
|
|
"website": website,
|
|
|
"contact": contact
|
|
|
}, function (data) {
|
|
|
- console.log(data);
|
|
|
if (data && data.rep) {
|
|
|
alert("保存成功");
|
|
|
$("#info_data").modal("hide");
|
|
@@ -484,7 +497,6 @@
|
|
|
return
|
|
|
}
|
|
|
var params = $("#update-dataform").serialize();
|
|
|
- console.log(params)
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/admin/audit/query_qyk/UpdateTels",
|
|
@@ -514,7 +526,6 @@
|
|
|
"_id": _id,
|
|
|
"company_name": company_name,
|
|
|
}, function (data) {
|
|
|
- console.log(data);
|
|
|
if (data && data.rep) {
|
|
|
setTimeout(function () {
|
|
|
alert("删除成功");
|
|
@@ -538,7 +549,7 @@
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">别名:</label>" +
|
|
|
"<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_alias\" value='" + _obj.alias + "'></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">历史名称:</label>" +
|
|
|
- "<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_history_name\" placeholder=\"多个;隔开\" value='" + _obj.history_name + "'></div></div>" +
|
|
|
+ "<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_history_name\" placeholder=\"多个;隔开\" value='" + _obj.history_name.join(";") + "'></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">行政区划代码:</label>" +
|
|
|
"<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_area_code\" value='"+_obj.area_code+"' ></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">省份:</label>" +
|
|
@@ -554,7 +565,7 @@
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">经营范围:</label>" +
|
|
|
"<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_business_scope\" value='"+_obj.business_scope+"'></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">微信公众号:</label>" +
|
|
|
- "<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_wechat_accounts\" placeholder=\"多个;隔开\" value='"+_obj.wechat_accounts+"'></div></div>" +
|
|
|
+ "<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_wechat_accounts\" placeholder=\"多个;隔开\" value='"+_obj.wechat_accounts.join(";")+"'></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">网址:</label>" +
|
|
|
"<div class=\"col-sm-9\"><input type=\"text\" class=\"form-control\" id=\"s_website\" value='"+_obj.website+"'></div></div>" +
|
|
|
"<div class=\"row form-group\"><label for=\"lastname\" class=\"col-sm-3 control-label\">联系方式:</label>" +
|
|
@@ -564,7 +575,6 @@
|
|
|
"<button type='button' class='btn btn-sm btn-danger col-md-2' onclick='updatedate(\"" + _obj._id + "\")'>更新</button></div>";
|
|
|
$("#infos").html(com);
|
|
|
var container = document.getElementById('s_contact');
|
|
|
- console.log(_obj.contact)
|
|
|
showJson("update", _obj.contact, container);
|
|
|
$("#info_data").modal("show");
|
|
|
}
|
|
@@ -586,7 +596,21 @@
|
|
|
var business_scope = $("#s_business_scope").val();//经营范围
|
|
|
var wechat_accounts = $("#s_wechat_accounts").val();//微信公众号
|
|
|
var website = $("#s_website").val();//网址
|
|
|
- var contact = editor_udapte.getText();//联系人
|
|
|
+ var contact = editor_update.getText();//联系人
|
|
|
+ if (typeof contact == 'string') {
|
|
|
+ try {
|
|
|
+ var obj=JSON.parse(contact);
|
|
|
+ if(typeof obj == 'object' && obj ){
|
|
|
+ // alert("格式正确");
|
|
|
+ }else{
|
|
|
+ alert("联系人的表单json格式不正确");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } catch(e) {
|
|
|
+ alert("联系人的表单json格式不正确");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
if (company_name === "") {
|
|
|
alert("红色标签的表单不能为空!");
|
|
|
return
|
|
@@ -635,6 +659,5 @@
|
|
|
editor_update = new JSONEditor(container, options, content);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|