|
|
@@ -1,639 +1,150 @@
|
|
1
|
|
-/**
|
|
2
|
|
- * 修改增加客户信息
|
|
3
|
|
- * */
|
|
4
|
|
-var indexNum = 0;
|
|
5
|
|
-$(function() {
|
|
6
|
|
-
|
|
7
|
|
- laydate.render({
|
|
8
|
|
- elem: '#customer_handoverDate',
|
|
9
|
|
- theme: '#1ab394',
|
|
10
|
|
- calendar: true
|
|
11
|
|
- });
|
|
12
|
|
-
|
|
13
|
|
- laydate.render({
|
|
14
|
|
- elem: '#customer_feeExpires',
|
|
15
|
|
- theme: '#1ab394',
|
|
16
|
|
- calendar: true
|
|
17
|
|
- });
|
|
18
|
|
-
|
|
19
|
|
- //获取所属部门
|
|
20
|
|
- getDepts('customerTreeView', 'customer_bedept')
|
|
21
|
|
- .then(function() {
|
|
22
|
|
- var edit_id = helper.request.queryString("edit_id");
|
|
23
|
|
- if (edit_id) {
|
|
24
|
|
- getCustomer(edit_id);
|
|
25
|
|
- }
|
|
26
|
|
- //绑定验证(所有 input.form-control)
|
|
27
|
|
- $('#tab_user_contents').find("input[class='form-control']").on('blur keyup', valideInput);
|
|
28
|
|
- });
|
|
29
|
|
-
|
|
30
|
|
-});
|
|
31
|
|
-
|
|
32
|
|
-//获取客户详情
|
|
33
|
|
-function getCustomer(ids) {
|
|
34
|
|
- $.getJSON(huayi.config.callcenter_url + "CustomerNew/GetCustomer", {
|
|
35
|
|
- cusid: ids, //客户id
|
|
36
|
|
- token: $.cookie("token")
|
|
37
|
|
- }, function(data) {
|
|
38
|
|
- if (data.state.toLowerCase() == "success") {
|
|
39
|
|
- $('#contactLists').hide();
|
|
40
|
|
- var cusBase = data.data.CustomerBase;
|
|
41
|
|
- $('#customer_bedept').val(data.data && data.data.BeDeptName); // int 客户归属部门
|
|
42
|
|
- if (cusBase) {
|
|
43
|
|
- // $('#customer_key').val(cusBase.F_KeyWords); //string 关键词
|
|
44
|
|
- $('#customer_code').val(cusBase.F_CustomerCode); //string 客户编号
|
|
45
|
|
- $('#customer_companyname').val(cusBase.F_CompanyName); //string 公司名称
|
|
46
|
|
- $('#customer_comaddress').val(cusBase.F_CompanyAddress); //string 公司地址
|
|
47
|
|
- $('#customer_legalName').val(cusBase.F_LegalName); //string 法人姓名
|
|
48
|
|
- $('#customer_lehalTel').val(cusBase.F_LegalTel); //string 法人电话
|
|
49
|
|
- $('#customer_subtrade').val(cusBase.F_SubTrade); // int 所属行业
|
|
50
|
|
- $('#customer_taxCategory').val(cusBase.F_TaxCategory); // int 税务类别
|
|
51
|
|
- $('#customer_taxPointDes').val(cusBase.F_TaxPointDes); //string 税点描述
|
|
52
|
|
- $('#customer_invoiceRange').val(cusBase.F_InvoiceRange); //string 开票范围
|
|
53
|
|
- $('#customer_layer').val(cusBase.F_Layer); // int 客户信誉等级
|
|
54
|
|
- $('#customer_bedept').attr('data-id', cusBase.F_BeDept); // int 客户归属部门
|
|
55
|
|
- $('#customer_berelatedAcc').val(cusBase.F_BeRelatedAcc); //string 客户归属涉税会计
|
|
56
|
|
- $('#customer_beauditAcc').val(cusBase.F_BeAuditAcc); //string 客户归属审核会计
|
|
57
|
|
- $('#customer_bemakeAcc').val(cusBase.F_BeMakeAcc); //string 客户归属做账会计
|
|
58
|
|
-
|
|
59
|
|
- $('#customer_RegisteredAddress').val(cusBase.F_RegisteredAddress); // string 注册地址
|
|
60
|
|
- $('#customer_LegalIDCards').val(cusBase.F_LegalIDCards); // string 法人身份证
|
|
61
|
|
- $('#customer_Qualification').val(cusBase.F_Qualification); // string 企业资质荣誉
|
|
62
|
|
- $('#customer_FinancialManager').val(cusBase.F_FinancialManager); // string 客户公司财务负责人
|
|
63
|
|
- $('#customer_BusinessOwner').val(cusBase.F_BusinessOwner); // string 客户归属业务负责人
|
|
64
|
|
- $('#customer_Remark1').val(cusBase.F_Remark1); // string 备注1(输入框即可)
|
|
65
|
|
- $('#customer_Remark2').val(cusBase.F_Remark2); // string 备注2(输入框即可)
|
|
66
|
|
- $('#customer_Remark3').val(cusBase.F_Remark3); // string 备注3(输入框即可)
|
|
67
|
|
-
|
|
68
|
|
- $('#customer_service').val(cusBase.F_CusService); // string 客服
|
|
69
|
|
- $('#customer_handoverDate').val(cusBase.F_HandoverDate); // string 交接日期
|
|
70
|
|
- $('#customer_isbankSlips').find('input[type="radio"][value="' + cusBase.F_ISBankSlips + '"]').prop('checked',
|
|
71
|
|
- true); // string 是否需要去银行拿回单(一般纳税人)
|
|
72
|
|
- $('#customer_address').val(cusBase.F_Address); // string 联系地址
|
|
73
|
|
- $('#customer_address1').val(cusBase.F_Address); // string 联系地址1
|
|
74
|
|
- $('#customer_address2').val(cusBase.F_Address1); // string 联系地址2
|
|
75
|
|
- $('#customer_address3').val(cusBase.F_Address2); // string 联系地址3
|
|
76
|
|
- $('#customer_address4').val(cusBase.F_Address3); // string 联系地址4
|
|
77
|
|
- $('#customer_feeExpires').val(cusBase.F_FeeExpires && cusBase.F_FeeExpires.split(' ')[0]); // datetime 代理费到期日期
|
|
78
|
|
-
|
|
79
|
|
-
|
|
80
|
|
- $('#customer_code').trigger('blur');
|
|
81
|
|
- }
|
|
82
|
|
- /* var cusLists = data.data.ContactList;
|
|
83
|
|
- if (cusLists && cusLists.length > 0) {
|
|
84
|
|
- for (var i = 0; i < cusLists.length; i++) {
|
|
85
|
|
- var tplstr = '';
|
|
86
|
|
- tplstr = '<div class="contactList_item col-md-offset-2 clearfix">' +
|
|
87
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
88
|
|
- '<div class="input-group">' +
|
|
89
|
|
- '<span class="input-group-addon">联系人姓名</span>' +
|
|
90
|
|
- '<input id="F_Name_' + i + '" type="text" class="form-control" value="' + cusLists[i].F_Name +
|
|
91
|
|
- '" placeholder="请输入联系人姓名" aria-describedby="联系人姓名">' +
|
|
92
|
|
- '</div>' +
|
|
93
|
|
- '</div>' +
|
|
94
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
95
|
|
- '<div class="input-group">' +
|
|
96
|
|
- '<span class="input-group-addon">联系人电话</span>' +
|
|
97
|
|
- '<input id="F_Telephone_' + i + '" value="' + cusLists[i].F_Telephone +
|
|
98
|
|
- '" type="text" class="form-control" placeholder="请输入联系人电话" aria-describedby="联系人电话">' +
|
|
99
|
|
- '</div>' +
|
|
100
|
|
- '</div>' +
|
|
101
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
102
|
|
- '<div class="input-group">' +
|
|
103
|
|
- '<span class="input-group-addon">联系人邮箱</span>' +
|
|
104
|
|
- '<input id="F_Email_' + i + '" value="' + cusLists[i].F_Email +
|
|
105
|
|
- '" type="text" class="form-control" placeholder="请输入联系人邮箱" aria-describedby="联系人邮箱">' +
|
|
106
|
|
- '</div>' +
|
|
107
|
|
- '</div>' +
|
|
108
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
109
|
|
- '<div class="input-group">' +
|
|
110
|
|
- '<span class="input-group-addon">联系人职务</span>' +
|
|
111
|
|
- '<input id="F_Duties_' + i + '" value="' + cusLists[i].F_Duties +
|
|
112
|
|
- '" type="text" class="form-control" placeholder="请输入联系人职务" aria-describedby="联系人职务">' +
|
|
113
|
|
- '</div>' +
|
|
114
|
|
- '</div>' +
|
|
115
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
116
|
|
- '<div class="input-group">' +
|
|
117
|
|
- '<span class="input-group-addon">联系人QQ</span>' +
|
|
118
|
|
- '<input id="F_QQ_' + i + '" value="' + cusLists[i].F_QQ +
|
|
119
|
|
- '" type="text" class="form-control" placeholder="请输入联系人QQ" aria-describedby="联系人QQ">' +
|
|
120
|
|
- '</div>' +
|
|
121
|
|
- '</div>' +
|
|
122
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
123
|
|
- '<div class="input-group">' +
|
|
124
|
|
- '<span class="input-group-addon">联系人MSN</span>' +
|
|
125
|
|
- '<input id="F_MSN_' + i + '" value="' + cusLists[i].F_MSN +
|
|
126
|
|
- '" type="text" class="form-control" placeholder="请输入联系人MSN" aria-describedby="联系人MSN">' +
|
|
127
|
|
- '</div>' +
|
|
128
|
|
- '</div>' +
|
|
129
|
|
- '<div class="form-group col-md-10 col-sm-10">' +
|
|
130
|
|
- '<div class="input-group">' +
|
|
131
|
|
- '<span class="input-group-addon">联系人备注</span>' +
|
|
132
|
|
- '<input id="F_Remark_' + i + '" value="' + cusLists[i].F_Remark +
|
|
133
|
|
- '" type="text" class="form-control" placeholder="请输入联系人备注" aria-describedby="联系人备注">' +
|
|
134
|
|
- '</div>' +
|
|
135
|
|
- '</div>' +
|
|
136
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
137
|
|
- '<div class="input-group">' +
|
|
138
|
|
- '<span class="input-group-addon">是否主要联系人</span>' +
|
|
139
|
|
- '<div class="isMain" id="F_IsMain_' + i + '">' +
|
|
140
|
|
- '<label class="radio-inline">' +
|
|
141
|
|
- '<input type="radio" name="inlineOptions_' + i + '" value="true"> 是' +
|
|
142
|
|
- '</label>' +
|
|
143
|
|
- '<label class="radio-inline">' +
|
|
144
|
|
- '<input type="radio" name="inlineOptions_' + i + '" value="false"> 否' +
|
|
145
|
|
- '</label>' +
|
|
146
|
|
- '</div>' +
|
|
147
|
|
- '</div>' +
|
|
148
|
|
- '</div>' +
|
|
149
|
|
- '<button class="form-control btn btn-default" style="width:60px;margin-left:15px" onclick="btn_delete($(this))">删除</button>' +
|
|
150
|
|
- '</div>';
|
|
151
|
|
- $('#contactList').prepend(tplstr);
|
|
152
|
|
- $('#F_IsMain_' + i).find('input[type="radio"][value="' + cusLists[i].F_IsMain +'"]').prop('checked', true);
|
|
153
|
|
-
|
|
154
|
|
- }
|
|
155
|
|
- indexNum = cusLists.length;
|
|
156
|
|
- } */
|
|
157
|
|
- }
|
|
158
|
|
- });
|
|
159
|
|
-}
|
|
160
|
|
-
|
|
161
|
|
-//保存
|
|
162
|
|
-function saveCustomer() {
|
|
163
|
|
- if (!$.trim($('#customer_code').val()) ||
|
|
164
|
|
- !$.trim($('#customer_companyname').val())
|
|
165
|
|
- ) {
|
|
166
|
|
- layer.msg('带红色星号的是必填项,请填写或选择后再保存!');
|
|
167
|
|
- return;
|
|
168
|
|
- }
|
|
169
|
|
- var contactList = $('#contactList').find('.contactList_item');
|
|
170
|
|
- for (var i = 0; i < contactList.length; i++) {
|
|
171
|
|
- var F_Name = $(contactList[i]).find('input[id*="F_Name_"]').val();
|
|
172
|
|
- var F_Telephone = $(contactList[i]).find('input[id*="F_Telephone_"]').val();
|
|
173
|
|
- var F_Email = $(contactList[i]).find('input[id*="F_Email_"]').val();
|
|
174
|
|
- var F_Duties = $(contactList[i]).find('input[id*="F_Duties_"]').val();
|
|
175
|
|
- var F_QQ = $(contactList[i]).find('input[id*="F_QQ_"]').val();
|
|
176
|
|
- var F_MSN = $(contactList[i]).find('input[id*="F_MSN_"]').val();
|
|
177
|
|
- if (!regexs.chOrenOrnum.test($.trim(F_Name))) {
|
|
178
|
|
- layer.confirm('您添加的联系人姓名格式不正确(只能输入中文、英文、数字)!', {
|
|
179
|
|
- icon: 2,
|
|
180
|
|
- btn: ['确定']
|
|
181
|
|
- });
|
|
182
|
|
- return;
|
|
183
|
|
- }
|
|
184
|
|
- if (!regexs.phone.test($.trim(F_Telephone))) {
|
|
185
|
|
- layer.confirm('您添加的联系人电话号码格式不正确!', {
|
|
186
|
|
- icon: 2,
|
|
187
|
|
- btn: ['确定']
|
|
188
|
|
- });
|
|
189
|
|
- return;
|
|
190
|
|
- }
|
|
191
|
|
- if (F_Email && !regexs.email.test($.trim(F_Email))) {
|
|
192
|
|
- layer.confirm('您添加的联系人邮箱格式不正确!', {
|
|
193
|
|
- icon: 2,
|
|
194
|
|
- btn: ['确定']
|
|
195
|
|
- });
|
|
196
|
|
- return;
|
|
197
|
|
- }
|
|
198
|
|
- if (F_Duties && !regexs.chOrenOrnum.test($.trim(F_Duties))) {
|
|
199
|
|
- layer.confirm('您添加的联系人职务格式不正确!', {
|
|
200
|
|
- icon: 2,
|
|
201
|
|
- btn: ['确定']
|
|
202
|
|
- });
|
|
203
|
|
- return;
|
|
204
|
|
- }
|
|
205
|
|
- if (F_QQ && !regexs.QQreg.test($.trim(F_QQ))) {
|
|
206
|
|
- layer.confirm('您添加的联系人QQ格式不正确!', {
|
|
207
|
|
- icon: 2,
|
|
208
|
|
- btn: ['确定']
|
|
|
1
|
+ $(document).ready(function () {
|
|
|
2
|
+ var wid = helper.request.queryString("wid");
|
|
|
3
|
+
|
|
|
4
|
+ if (wid) {
|
|
|
5
|
+ $('#tel').val(wid);
|
|
|
6
|
+ load();
|
|
|
7
|
+ }
|
|
|
8
|
+ load();
|
|
|
9
|
+ LY($("#source"));
|
|
|
10
|
+ LB($("#type"));
|
|
|
11
|
+ ZT($("#keyid"));
|
|
|
12
|
+
|
|
|
13
|
+ helper.getDropList.getOrderAreas($('#sourceAreas'))
|
|
|
14
|
+ tree();
|
|
|
15
|
+
|
|
|
16
|
+ laydate.render({
|
|
|
17
|
+ elem: '#starttime' //指定元素
|
|
|
18
|
+ ,range:'~'
|
|
209
|
19
|
});
|
|
210
|
|
- return;
|
|
211
|
|
- }
|
|
212
|
|
- if (F_MSN && !regexs.chOrenOrnum.test($.trim(F_MSN))) {
|
|
213
|
|
- layer.confirm('您添加的联系人MSN格式不正确!', {
|
|
214
|
|
- icon: 2,
|
|
215
|
|
- btn: ['确定']
|
|
216
|
|
- });
|
|
217
|
|
- return;
|
|
218
|
|
- }
|
|
219
|
|
- }
|
|
220
|
|
- var wURL, loadIndex, contactLists;
|
|
221
|
|
- var edit_id = helper.request.queryString("edit_id");
|
|
222
|
|
- if (edit_id) {
|
|
223
|
|
- wURL = "CustomerNew/Update";
|
|
224
|
|
- contactLists = null;
|
|
225
|
|
- } else {
|
|
226
|
|
- wURL = "CustomerNew/Add";
|
|
227
|
|
- contactLists = getFields();
|
|
228
|
|
- }
|
|
229
|
|
- $.ajax({
|
|
230
|
|
- type: 'post',
|
|
231
|
|
- url: huayi.config.callcenter_url + wURL,
|
|
232
|
|
- dataType: 'json',
|
|
233
|
|
- async: true,
|
|
234
|
|
- beforeSend: function() { //触发ajax请求开始时执行
|
|
235
|
|
- $('#save_btns').attr("disabled", true);
|
|
236
|
|
- $('#save_btns').text('保存中...');
|
|
237
|
|
- loadIndex = layer.load();
|
|
238
|
|
- },
|
|
239
|
|
- data: {
|
|
240
|
|
- F_CustomerId: edit_id, // 否 string id
|
|
241
|
|
- // F_KeyWords: $('#customer_key').val(), //string 关键词
|
|
242
|
|
- F_CustomerCode: $('#customer_code').val(), //string 客户编号
|
|
243
|
|
- F_CompanyName: $('#customer_companyname').val(), //string 公司名称
|
|
244
|
|
- F_CompanyAddress: $('#customer_comaddress').val(), //string 公司地址
|
|
245
|
|
- F_LegalName: $('#customer_legalName').val(), //string 法人姓名
|
|
246
|
|
- F_LegalTel: $('#customer_lehalTel').val(), //string 法人电话
|
|
247
|
|
- F_SubTrade: $('#customer_subtrade').val(), // int 所属行业
|
|
248
|
|
- F_TaxCategory: $('#customer_taxCategory').val(), // int 税务类别
|
|
249
|
|
- F_TaxPointDes: $('#customer_taxPointDes').val(), //string 税点描述
|
|
250
|
|
- F_InvoiceRange: $('#customer_invoiceRange').val(), //string 开票范围
|
|
251
|
|
- F_Layer: $('#customer_layer').val(), // int 客户信誉等级
|
|
252
|
|
- F_BeDept: $('#customer_bedept').attr('data-id'), // int 客户归属部门
|
|
253
|
|
- F_BeRelatedAcc: $('#customer_berelatedAcc').val(), //string 客户归属涉税会计
|
|
254
|
|
- F_BeAuditAcc: $('#customer_beauditAcc').val(), //string 客户归属审核会计
|
|
255
|
|
- F_BeMakeAcc: $('#customer_bemakeAcc').val(), //string 客户归属做账会计
|
|
256
|
|
- ContactList: contactLists, //List联系人列表
|
|
257
|
|
- F_RegisteredAddress: $('#customer_RegisteredAddress').val(), // string 注册地址
|
|
258
|
|
- F_LegalIDCards: $('#customer_LegalIDCards').val(), // string 法人身份证
|
|
259
|
|
- F_Qualification: $('#customer_Qualification').val(), // string 企业资质荣誉
|
|
260
|
|
- F_FinancialManager: $('#customer_FinancialManager').val(), // string 客户公司财务负责人
|
|
261
|
|
- F_BusinessOwner: $('#customer_BusinessOwner').val(), // string 客户归属业务负责人
|
|
262
|
|
- F_Remark1: $('#customer_Remark1').val(), // string 备注1(输入框即可)
|
|
263
|
|
- F_Remark2: $('#customer_Remark2').val(), // string 备注2(输入框即可)
|
|
264
|
|
- F_Remark3: $('#customer_Remark3').val(), // string 备注3(输入框即可)
|
|
265
|
|
-
|
|
266
|
|
- F_CusService: $('#customer_service').val(), // string 客服
|
|
267
|
|
- F_HandoverDate: $('#customer_handoverDate').val(), // string 交接日期
|
|
268
|
|
- F_ISBankSlips: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), // string 是否需要去银行拿回单(一般纳税人)
|
|
269
|
|
- F_Address: $('#customer_address').val(), // string 联系地址
|
|
270
|
|
- F_Address1: $('#customer_address1').val(), // string 联系地址1
|
|
271
|
|
- F_Address2: $('#customer_address2').val(), // string 联系地址2
|
|
272
|
|
- F_Address3: $('#customer_address3').val(), // string 联系地址3
|
|
273
|
|
- F_Address4: $('#customer_address4').val(), // string 联系地址4
|
|
274
|
|
- F_FeeExpires: $('#customer_feeExpires').val(), // datetime 代理费到期日期
|
|
275
|
|
-
|
|
276
|
|
- token: $.cookie("token")
|
|
277
|
|
- },
|
|
278
|
|
- success: function(data) {
|
|
279
|
|
- layer.close(loadIndex);
|
|
280
|
|
- if (data.state === "success") {
|
|
281
|
|
- var index = parent.layer.getFrameIndex(window.name);
|
|
282
|
|
- parent.layer.close(index);
|
|
283
|
|
- parent.$('#cusList').bootstrapTable('refresh');
|
|
284
|
|
- parent.layer.msg("保存成功");
|
|
285
|
|
- } else {
|
|
286
|
|
- $('#save_btns').attr("disabled", false);
|
|
287
|
|
- $('#save_btns').text('保存');
|
|
288
|
|
- }
|
|
289
|
|
- },
|
|
290
|
|
- error: function(textStatus) {
|
|
291
|
|
- layer.close(loadIndex);
|
|
292
|
|
- layer.confirm('网络繁忙,请稍后再试...', {
|
|
293
|
|
- icon: 7,
|
|
294
|
|
- closeBtn: 0,
|
|
295
|
|
- btn: ['确定'] //按钮
|
|
296
|
|
- });
|
|
297
|
|
- $('#save_btns').attr("disabled", false);
|
|
298
|
|
- $('#save_btns').text('保存');
|
|
299
|
|
- },
|
|
300
|
|
- complete: function(XMLHttpRequest, textStatus) {
|
|
301
|
|
- layer.close(loadIndex);
|
|
302
|
|
- if (textStatus == 'timeout') {
|
|
303
|
|
- var xmlhttp = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHttp");
|
|
304
|
|
- xmlhttp.abort();
|
|
305
|
|
- layer.confirm('网络超时,请稍后再试...', {
|
|
306
|
|
- icon: 7,
|
|
307
|
|
- closeBtn: 0,
|
|
308
|
|
- btn: ['确定'] //按钮
|
|
309
|
|
- });
|
|
310
|
|
- }
|
|
311
|
|
- $('#save_btns').attr("disabled", false);
|
|
312
|
|
- $('#save_btns').text('保存');
|
|
313
|
|
- },
|
|
314
|
|
- });
|
|
315
|
|
-}
|
|
316
|
|
-
|
|
317
|
|
-//添加联系人
|
|
318
|
|
-function btn_add() {
|
|
319
|
|
- var tplstr = '';
|
|
320
|
|
- tplstr = '<div class="contactList_item col-md-offset-2 clearfix">' +
|
|
321
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
322
|
|
- '<div class="input-group">' +
|
|
323
|
|
- '<span class="input-group-addon">联系人姓名</span>' +
|
|
324
|
|
- '<input id="F_Name_' + indexNum +
|
|
325
|
|
- '" type="text" class="form-control" placeholder="请输入联系人姓名" aria-describedby="联系人姓名">' +
|
|
326
|
|
- '</div>' +
|
|
327
|
|
- '</div>' +
|
|
328
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
329
|
|
- '<div class="input-group">' +
|
|
330
|
|
- '<span class="input-group-addon">联系人电话</span>' +
|
|
331
|
|
- '<input id="F_Telephone_' + indexNum +
|
|
332
|
|
- '" type="text" class="form-control" placeholder="请输入联系人电话" aria-describedby="联系人电话">' +
|
|
333
|
|
- '</div>' +
|
|
334
|
|
- '</div>' +
|
|
335
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
336
|
|
- '<div class="input-group">' +
|
|
337
|
|
- '<span class="input-group-addon">联系人邮箱</span>' +
|
|
338
|
|
- '<input id="F_Email_' + indexNum +
|
|
339
|
|
- '" type="text" class="form-control" placeholder="请输入联系人邮箱" aria-describedby="联系人邮箱">' +
|
|
340
|
|
- '</div>' +
|
|
341
|
|
- '</div>' +
|
|
342
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
343
|
|
- '<div class="input-group">' +
|
|
344
|
|
- '<span class="input-group-addon">联系人职务</span>' +
|
|
345
|
|
- '<input id="F_Duties_' + indexNum +
|
|
346
|
|
- '" type="text" class="form-control" placeholder="请输入联系人职务" aria-describedby="联系人职务">' +
|
|
347
|
|
- '</div>' +
|
|
348
|
|
- '</div>' +
|
|
349
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
350
|
|
- '<div class="input-group">' +
|
|
351
|
|
- '<span class="input-group-addon">联系人QQ</span>' +
|
|
352
|
|
- '<input id="F_QQ_' + indexNum + '" type="text" class="form-control" placeholder="请输入联系人QQ" aria-describedby="联系人QQ">' +
|
|
353
|
|
- '</div>' +
|
|
354
|
|
- '</div>' +
|
|
355
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
356
|
|
- '<div class="input-group">' +
|
|
357
|
|
- '<span class="input-group-addon">联系人MSN</span>' +
|
|
358
|
|
- '<input id="F_MSN_' + indexNum +
|
|
359
|
|
- '" type="text" class="form-control" placeholder="请输入联系人MSN" aria-describedby="联系人MSN">' +
|
|
360
|
|
- '</div>' +
|
|
361
|
|
- '</div>' +
|
|
362
|
|
- '<div class="form-group col-md-10 col-sm-10">' +
|
|
363
|
|
- '<div class="input-group">' +
|
|
364
|
|
- '<span class="input-group-addon">联系人备注</span>' +
|
|
365
|
|
- '<input id="F_Remark_' + indexNum +
|
|
366
|
|
- '" type="text" class="form-control" placeholder="请输入联系人备注" aria-describedby="联系人备注">' +
|
|
367
|
|
- '</div>' +
|
|
368
|
|
- '</div>' +
|
|
369
|
|
- '<div class="form-group col-md-5 col-sm-5">' +
|
|
370
|
|
- '<div class="input-group">' +
|
|
371
|
|
- '<span class="input-group-addon">是否主要联系人</span>' +
|
|
372
|
|
- '<div class="isMain" id="F_IsMain_' + indexNum + '">' +
|
|
373
|
|
- '<label class="radio-inline">' +
|
|
374
|
|
- '<input type="radio" name="inlineOptions_' + indexNum + '" value="true"> 是' +
|
|
375
|
|
- '</label>' +
|
|
376
|
|
- '<label class="radio-inline">' +
|
|
377
|
|
- '<input type="radio" name="inlineOptions_' + indexNum + '" value="false" checked="checked"> 否' +
|
|
378
|
|
- '</label>' +
|
|
379
|
|
- '</div>' +
|
|
380
|
|
- '</div>' +
|
|
381
|
|
- '</div>' +
|
|
382
|
|
- '<button class="form-control btn btn-default" style="width:60px;margin-left:15px" onclick="btn_delete($(this))">删除</button>' +
|
|
383
|
|
- '</div>';
|
|
384
|
|
- $('#contactList').prepend(tplstr);
|
|
385
|
|
- indexNum++;
|
|
386
|
|
-}
|
|
387
|
|
-
|
|
388
|
|
-//删除联系人
|
|
389
|
|
-function btn_delete(el) {
|
|
390
|
|
- el.parent().remove();
|
|
391
|
|
-}
|
|
392
|
|
-
|
|
393
|
|
-//获取联系人信息
|
|
394
|
|
-function getFields() {
|
|
395
|
|
- var goodslists = [];
|
|
396
|
|
- var goodsLists_items = $('#contactList').find('.contactList_item');
|
|
397
|
|
- $.each(goodsLists_items, function(i, v) {
|
|
398
|
|
- goodslists.push({
|
|
399
|
|
- "F_Name": $(v).find('input[id*="F_Name_"]').val(),
|
|
400
|
|
- "F_Telephone": $(v).find('input[id*="F_Telephone_"]').val(),
|
|
401
|
|
- "F_Email": $(v).find('input[id*="F_Email_"]').val(),
|
|
402
|
|
- "F_Duties": $(v).find('input[id*="F_Duties_"]').val(),
|
|
403
|
|
- "F_QQ": $(v).find('input[id*="F_QQ_"]').val(),
|
|
404
|
|
- "F_MSN": $(v).find('input[id*="F_MSN_"]').val(),
|
|
405
|
|
- "F_Remark": $(v).find('input[id*="F_Remark_"]').val(),
|
|
406
|
|
- "F_IsMain": $(v).find('div[id*="F_IsMain_"]').find('input[type="radio"]:checked').val(),
|
|
407
|
|
- });
|
|
408
|
|
- });
|
|
409
|
|
- //去重
|
|
410
|
|
- // helper.methods.uniqueObjArray(goodslists, 'F_Name');
|
|
411
|
|
- return goodslists;
|
|
|
20
|
+
|
|
|
21
|
+
|
|
|
22
|
+ //所属分类下拉
|
|
|
23
|
+ $('.inps').focus(function () {
|
|
|
24
|
+ $('.xlAdd').css('display', 'block')
|
|
|
25
|
+ })
|
|
|
26
|
+ $('.xl').click(function () {
|
|
|
27
|
+ if ($('.xlAdd').css('display') == 'block') {
|
|
|
28
|
+ $('.xlAdd').css('display', 'none')
|
|
|
29
|
+ } else {
|
|
|
30
|
+ $('.xlAdd').css('display', 'block')
|
|
|
31
|
+ }
|
|
|
32
|
+ })
|
|
|
33
|
+ $('.addTree').mouseleave(function () {
|
|
|
34
|
+ $(this).css('display', 'none')
|
|
|
35
|
+ })
|
|
|
36
|
+ })
|
|
|
37
|
+
|
|
|
38
|
+function addedit() {
|
|
|
39
|
+ // var mobileNumReg = /^\d{11}$/,
|
|
|
40
|
+ // if(!mobileNumReg.test($.trim($("#F_MaterialCode").val()))) {
|
|
|
41
|
+ // layer.confirm('号段长度11位,且必须是数字。', {
|
|
|
42
|
+ // icon: 2,
|
|
|
43
|
+ // btn: ['确定'] //按钮
|
|
|
44
|
+ // });
|
|
|
45
|
+ // return;
|
|
|
46
|
+ // }
|
|
|
47
|
+ $.post(huayi.config.callcenter_url + "CustomerNew/Add", {
|
|
|
48
|
+ F_CustomerCode: $("#customer_code").val(),//客户编码
|
|
|
49
|
+ F_CompanyName: $("#customer_companyname").val(),//公司名称
|
|
|
50
|
+ F_AreaID: $("#customer_comaddress").val(),//大区ID
|
|
|
51
|
+ F_BranchID: $("#customer_legalName").val(),//分公司ID
|
|
|
52
|
+ F_Salesman: $("#customer_lehalTel").val(),//业务员
|
|
|
53
|
+ F_SalesPhone: $("#customer_subtrade").val(),//业务员电话
|
|
|
54
|
+ F_CustomerNature: $("#customer_taxCategory").val(),//客户性质
|
|
|
55
|
+ F_Channel: $('#customer_taxPointDes').val(),//渠道类型
|
|
|
56
|
+ F_Credit: $("#customer_invoiceRange").val(),//信用等级
|
|
|
57
|
+ F_Legal: $("#customer_layer").val(),//法人
|
|
|
58
|
+ F_LegalPhone: $("#customer_bedept").val(),//法人电话
|
|
|
59
|
+ F_AddressProvince: $("#customer_berelatedAcc").val(),//省
|
|
|
60
|
+ F_AddressCity: $("#customer_beauditAcc").val(),//市
|
|
|
61
|
+ F_AddressCountry: $("#customer_bemakeAcc").val(),//县
|
|
|
62
|
+ F_AddressTownship: $("#customer_RegisteredAddress").val(),//乡
|
|
|
63
|
+ F_AddressFull: $("#customer_LegalIDCards").val(),//详细地址
|
|
|
64
|
+ F_Brands: $("#customer_Qualification").val(),//经营品牌
|
|
|
65
|
+ F_Product: $("#customer_FinancialManager").val(),//产品
|
|
|
66
|
+ F_FrozenFlag: $("#customer_BusinessOwner").val(),//冻结标志
|
|
|
67
|
+ F_IsOpenAccount: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(),//是否开户
|
|
|
68
|
+ F_LevelCode: $("#customer_Remark2").val(),//上级客户编码
|
|
|
69
|
+ F_LevelName: $("#customer_Remark3").val(),//上级客户名称
|
|
|
70
|
+ F_MnemonicCode: $("#customer_service").val(),//助记码
|
|
|
71
|
+ F_InvoiceBank: $("#customer_handoverDate").val(),//开票银行名称
|
|
|
72
|
+ F_InvoiceBankAccount: $("#customer_address").val(),//开票银行账户
|
|
|
73
|
+ F_TaxRegCode: $("#customer_address1").val(),//纳税人登记号
|
|
|
74
|
+ F_IsRunXLX: $('#customer').find('input[type="radio"]:checked').val(), //是否经营心连心
|
|
|
75
|
+ F_AnnualSales: $("#customer_address2").val(),//年销量
|
|
|
76
|
+ F_Formula : $("#customer_address3").val(),//配方
|
|
|
77
|
+ F_RaiseCrops: $("#customer_address4").val(),//种植作物
|
|
|
78
|
+ F_PlantingArea: $("#customer_feeExpires").val(),//种植面积
|
|
|
79
|
+ F_FertilizerBrand: $("#customer_feeEx").val(),//用肥品牌
|
|
|
80
|
+ F_Remark: $("#F_Remark").val(),//备注
|
|
|
81
|
+ token: $.cookie("token")
|
|
|
82
|
+ }, function(result) {
|
|
|
83
|
+ result = $.parseJSON(result);
|
|
|
84
|
+ if(result.state.toLowerCase() == "success") {
|
|
|
85
|
+ debugger
|
|
|
86
|
+ var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
|
87
|
+ parent.layer.close(index); //再执行关闭
|
|
|
88
|
+ parent.$('#cusList').bootstrapTable('refresh');
|
|
|
89
|
+ parent.layer.msg("添加客户成功");
|
|
|
90
|
+ top.workcount();
|
|
|
91
|
+ }
|
|
|
92
|
+ })
|
|
412
|
93
|
}
|
|
413
|
94
|
|
|
414
|
95
|
|
|
415
|
|
-/**
|
|
416
|
|
- * 获取客户归属部门
|
|
417
|
|
- * el1, 树形结构元素id名 customerTreeView
|
|
418
|
|
- * el2, 搜索框元素id名 customer_bedept
|
|
419
|
|
- * */
|
|
420
|
|
-function getDepts(el1, el2) {
|
|
421
|
|
- var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
|
|
422
|
|
- //初始化 样式
|
|
423
|
|
- $('#' + el2).on('focus click', function() {
|
|
424
|
|
- $('#' + el1).removeClass('hidden').addClass('show');
|
|
425
|
|
- });
|
|
426
|
|
- $('#' + el2).on('keyup', function() {
|
|
427
|
|
- if ($(this).val() == '') {
|
|
428
|
|
- $('#' + el1).treeview('uncheckAll', {
|
|
429
|
|
- silent: true
|
|
430
|
|
- });
|
|
431
|
|
- $(this).attr('data-id', '0');
|
|
432
|
|
- }
|
|
433
|
|
- });
|
|
434
|
|
- $('#' + el2 + ' .caret').on('click', function() {
|
|
435
|
|
- $('#' + el1).removeClass('hidden').addClass('show');
|
|
436
|
|
- });
|
|
437
|
|
- $('#' + el1).mouseleave(function() {
|
|
438
|
|
- $(this).removeClass('show').addClass('hidden');
|
|
439
|
|
- });
|
|
440
|
96
|
|
|
441
|
|
- $.getJSON(huayi.config.callcenter_url + 'Department/GetDeptList', {
|
|
442
|
|
- token: $.cookie("token")
|
|
443
|
|
- }, function(result) {
|
|
444
|
|
- if (result.state.toLowerCase() == "success") {
|
|
445
|
|
- var defaultDatas = helper.methods.buildTree(result.data);
|
|
446
|
|
- var sortChildrenArr = helper.methods.objToArray(defaultDatas[0].children);
|
|
447
|
|
- sortChildrenArr.sort(helper.methods.compare('sort'));
|
|
448
|
|
- var sortChildrenObj = helper.methods.arrayToObj(sortChildrenArr);
|
|
449
|
|
- defaultDatas[0].children = sortChildrenObj;
|
|
450
|
|
- if (defaultDatas) {
|
|
451
|
|
- var $sTree = $('#' + el1).treeview({
|
|
452
|
|
- color: "#1ab394",
|
|
453
|
|
- selectedBackColor: '#1ab394',
|
|
454
|
|
- expandIcon: 'glyphicon glyphicon-chevron-right',
|
|
455
|
|
- collapseIcon: 'glyphicon glyphicon-chevron-down',
|
|
456
|
|
- nodeIcon: 'fa fa-folder-o',
|
|
457
|
|
- //selectedIcon: "glyphicon glyphicon-stop",
|
|
458
|
|
- //icon: "glyphicon glyphicon-stop",
|
|
459
|
|
- //emptyIcon: 'glyphicon',
|
|
460
|
|
- //showCheckbox: true,
|
|
461
|
|
- selectable: true,
|
|
462
|
|
- state: {
|
|
463
|
|
- selected: true
|
|
464
|
|
- },
|
|
465
|
|
- data: defaultDatas,
|
|
466
|
|
- onNodeSelected: function(event, node) {
|
|
467
|
|
- $sTree.treeview('clearSearch');
|
|
468
|
|
- $('#' + el2).val(node.text);
|
|
469
|
|
- $('#' + el2).attr('data-id', node.id);
|
|
470
|
|
- $('#' + el1).removeClass('show').addClass('hidden');
|
|
471
|
|
- },
|
|
472
|
|
- onNodeUnselected: function(event, node) {
|
|
473
|
|
- $('#' + el2).attr('data-id', 0);
|
|
474
|
|
- $('#' + el2).attr('placeholder', '请选择客户归属部门');
|
|
475
|
|
- }
|
|
476
|
|
- });
|
|
477
|
|
- // $('#' + el1).treeview('collapseAll', {
|
|
478
|
|
- // silent: true
|
|
479
|
|
- // });
|
|
480
|
|
- $('#' + el1).treeview('expandAll', {
|
|
481
|
|
- levels: 2,
|
|
482
|
|
- silent: true
|
|
483
|
|
- });
|
|
484
|
|
- var findSNodes = function() {
|
|
485
|
|
- return $sTree.treeview('search', [$('#' + el2).val(), {
|
|
486
|
|
- ignoreCase: false,
|
|
487
|
|
- exactMatch: false
|
|
488
|
|
- }]);
|
|
489
|
|
- };
|
|
490
|
|
- $('#' + el2).on('keyup focus', function(e) {
|
|
491
|
|
- var selectableNodes = findSNodes();
|
|
492
|
|
- //var m = $('#' + el1).treeview('getParent', selectableNodes);
|
|
493
|
|
- //$('#' + el1).treeview('selectNode', [ m, { silent: true } ]);
|
|
494
|
|
- });
|
|
495
|
|
- }
|
|
496
|
|
- dtd.resolve(); // 改变Deferred对象的执行状态
|
|
497
|
|
- }
|
|
498
|
|
- })
|
|
499
|
|
- return dtd.promise(); // 返回promise对象
|
|
500
|
|
-}
|
|
501
|
97
|
|
|
502
|
|
-
|
|
503
|
|
-//验证(所有 input.form-control)的方法
|
|
504
|
|
-function valideInput() {
|
|
505
|
|
- var _that = $(this);
|
|
506
|
|
- //console.log($(this).attr('id'));
|
|
507
|
|
- switch ($(this).attr('id')) {
|
|
508
|
|
- case 'customer_code': //验证客户编号
|
|
509
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
|
|
510
|
|
- break;
|
|
511
|
|
- case 'customer_companyname': //验证公司名称
|
|
512
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
|
|
513
|
|
- break;
|
|
514
|
|
- case 'customer_legalName': //验证法人姓名
|
|
515
|
|
- valideMethods(_that, regexs.userNameReg, '格式不正确(只能输入2-20位汉字可以包含·•)!', true);
|
|
516
|
|
- break;
|
|
517
|
|
- case 'customer_lehalTel': //验证法人电话
|
|
518
|
|
- valideMethods(_that, regexs.phone, '您输入的电话号码格式不正确!', true);
|
|
519
|
|
- break;
|
|
520
|
|
- case 'customer_subtrade': //验证所属行业
|
|
521
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
522
|
|
- break;
|
|
523
|
|
- case 'customer_taxCategory': //验证 税务类别
|
|
524
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
525
|
|
- break;
|
|
526
|
|
- case 'customer_invoiceRange': //验证 开票范围
|
|
527
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
528
|
|
- break;
|
|
529
|
|
- case 'customer_layer': //验证 客户信誉等级
|
|
530
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
531
|
|
- break;
|
|
532
|
|
- case 'customer_berelatedAcc': //客户归属涉税会计
|
|
533
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
534
|
|
- break;
|
|
535
|
|
- case 'customer_beauditAcc': //客户归属审核会计
|
|
536
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
537
|
|
- break;
|
|
538
|
|
- case 'customer_bemakeAcc': //客户归属做账会计
|
|
539
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
540
|
|
- break;
|
|
541
|
|
- case 'customer_RegisteredAddress': //注册地址
|
|
542
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
543
|
|
- break;
|
|
544
|
|
- case 'customer_LegalIDCards': //法人身份证
|
|
545
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
546
|
|
- break;
|
|
547
|
|
- case 'customer_Qualification': //企业资质荣誉
|
|
548
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
549
|
|
- break;
|
|
550
|
|
- case 'customer_FinancialManager': //客户公司财务负责人
|
|
551
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
552
|
|
- break;
|
|
553
|
|
- case 'customer_BusinessOwner': //客户归属业务负责人
|
|
554
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
555
|
|
- break;
|
|
556
|
|
- case 'customer_Remark1': //备注1
|
|
557
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
558
|
|
- break;
|
|
559
|
|
- case 'customer_Remark2': //备注2
|
|
560
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
561
|
|
- break;
|
|
562
|
|
- case 'customer_Remark3': //备注3
|
|
563
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
564
|
|
- break;
|
|
565
|
|
- case 'customer_service': //客服
|
|
566
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
567
|
|
- break;
|
|
568
|
|
- case 'customer_address': //地址
|
|
569
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
570
|
|
- break;
|
|
571
|
|
- case 'customer_address1': //地址1
|
|
572
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
573
|
|
- break;
|
|
574
|
|
- case 'customer_address2': //地址2
|
|
575
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
576
|
|
- break;
|
|
577
|
|
- case 'customer_address3': //地址3
|
|
578
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
579
|
|
- break;
|
|
580
|
|
- case 'customer_address4': //地址4
|
|
581
|
|
- valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
|
|
582
|
|
- break;
|
|
583
|
|
- }
|
|
584
|
|
- if ($('#tab_user_contents').find('.has-error').length > 0) {
|
|
585
|
|
- $('.project_save').attr('disabled', true);
|
|
586
|
|
- $('#save_btns').off('click', saveCustomer);
|
|
587
|
|
- } else {
|
|
588
|
|
- $('.project_save').attr('disabled', false);
|
|
589
|
|
- $('#save_btns').off('click', saveCustomer);
|
|
590
|
|
- $('#save_btns').on('click', saveCustomer);
|
|
591
|
|
- }
|
|
592
|
|
-}
|
|
593
|
|
-/**
|
|
594
|
|
- * 验证方法
|
|
595
|
|
- * _this :传递的this
|
|
596
|
|
- * regRlues: 验证的规则
|
|
597
|
|
- * msg: 提示信息
|
|
598
|
|
- * isRes:boolean 是否允许验证的内容为空,true:允许为空,false:不允许为空
|
|
599
|
|
- * */
|
|
600
|
|
-function valideMethods(_this, regRlues, msg, isRes) {
|
|
601
|
|
- var txtTpips = _this.parent().parent().find('.text-tips');
|
|
602
|
|
- if (txtTpips) {
|
|
603
|
|
- txtTpips.parent().remove();
|
|
604
|
|
- }
|
|
605
|
|
- if (!isRes) {
|
|
606
|
|
- //不为空
|
|
607
|
|
- if (!regRlues.test($.trim(_this.val()))) {
|
|
608
|
|
- _this.parent().parent().removeClass('has-success has-feedback').addClass('has-error has-feedback');
|
|
609
|
|
- _this.parent().find('.glyphicon').remove();
|
|
610
|
|
- $('<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>').appendTo(_this.parent());
|
|
611
|
|
- $('<div class="col-md-10 col-md-offset-2"><span class="text-tips">' + msg + '</span></div>').appendTo(_this.parent()
|
|
612
|
|
- .parent());
|
|
613
|
|
- $('.project_save').attr('disabled', true);
|
|
614
|
|
- } else {
|
|
615
|
|
- _this.parent().parent().removeClass('has-error has-feedback').addClass('has-success has-feedback');
|
|
616
|
|
- _this.parent().find('.glyphicon').remove();
|
|
617
|
|
- $('<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>').appendTo(_this.parent());
|
|
618
|
|
- }
|
|
619
|
|
- } else {
|
|
620
|
|
- //为空不验证;但是有内容就验证;
|
|
621
|
|
- if ($.trim(_this.val())) {
|
|
622
|
|
- if (!regRlues.test($.trim(_this.val()))) {
|
|
623
|
|
- _this.parent().parent().removeClass('has-success has-feedback').addClass('has-error has-feedback');
|
|
624
|
|
- _this.parent().find('.glyphicon').remove();
|
|
625
|
|
- $('<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>').appendTo(_this.parent());
|
|
626
|
|
- $('<div class="col-md-10 col-md-offset-2"><span class="text-tips">' + msg + '</span></div>').appendTo(_this.parent()
|
|
627
|
|
- .parent());
|
|
628
|
|
- $('.project_save').attr('disabled', true);
|
|
629
|
|
- } else {
|
|
630
|
|
- _this.parent().parent().removeClass('has-error has-feedback').addClass('has-success has-feedback');
|
|
631
|
|
- _this.parent().find('.glyphicon').remove();
|
|
632
|
|
- $('<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>').appendTo(_this.parent());
|
|
633
|
|
- }
|
|
634
|
|
- } else {
|
|
635
|
|
- _this.parent().find('.glyphicon').remove();
|
|
636
|
|
- _this.parent().parent().removeClass('has-error has-success has-feedback');
|
|
637
|
|
- }
|
|
638
|
|
- }
|
|
639
|
|
-}
|
|
|
98
|
+//三级联动下拉
|
|
|
99
|
+
|
|
|
100
|
+function LY(obj) {
|
|
|
101
|
+ obj.empty();
|
|
|
102
|
+ obj.append('<option selected="selected" value="">请选择</option>');
|
|
|
103
|
+ $.getJSON(huayi.config.callcenter_url + "RegionCategory/GetAllList", {
|
|
|
104
|
+ "token": $.cookie("token"),
|
|
|
105
|
+ F_RegionId: 0
|
|
|
106
|
+ }, function (data) {
|
|
|
107
|
+ if (data.state.toLowerCase() == "success") {
|
|
|
108
|
+ var content = data;
|
|
|
109
|
+
|
|
|
110
|
+ $(content).each(function (i, n) {
|
|
|
111
|
+ $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
|
|
|
112
|
+
|
|
|
113
|
+ })
|
|
|
114
|
+ }
|
|
|
115
|
+ })
|
|
|
116
|
+ }
|
|
|
117
|
+ //类别
|
|
|
118
|
+ function LB(obj) {
|
|
|
119
|
+ obj.empty();
|
|
|
120
|
+ obj.append('<option selected="selected" value="">请选择</option>');
|
|
|
121
|
+ $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
|
|
|
122
|
+ "token": $.cookie("token"),
|
|
|
123
|
+ id: 2
|
|
|
124
|
+ }, function (data) {
|
|
|
125
|
+ if (data.state.toLowerCase() == "success") {
|
|
|
126
|
+ var content = data.data;
|
|
|
127
|
+ $(content).each(function (i, n) {
|
|
|
128
|
+ $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
|
|
|
129
|
+ })
|
|
|
130
|
+ }
|
|
|
131
|
+ })
|
|
|
132
|
+ }
|
|
|
133
|
+ // 主题
|
|
|
134
|
+ function ZT(obj) {
|
|
|
135
|
+ obj.empty();
|
|
|
136
|
+ obj.append('<option selected="selected" value="">请选择</option>');
|
|
|
137
|
+ $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
|
|
|
138
|
+ "token": $.cookie("token"),
|
|
|
139
|
+ id: 3
|
|
|
140
|
+ }, function (data) {
|
|
|
141
|
+ if (data.state.toLowerCase() == "success") {
|
|
|
142
|
+ var content = data.data;
|
|
|
143
|
+ $(content).each(function (i, n) {
|
|
|
144
|
+ $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
|
|
|
145
|
+ })
|
|
|
146
|
+ }
|
|
|
147
|
+ })
|
|
|
148
|
+ }
|
|
|
149
|
+
|
|
|
150
|
+
|