Procházet zdrojové kódy

修改 开票信息

fanlongfei %!s(int64=6) %!d(string=před) roky
rodič
revize
db3838e04d

+ 5 - 1
CallCenterWeb.UI/Script/Common/regexs.js

@@ -163,8 +163,12 @@ var regexs = {
163 163
 	 * */
164 164
 	profitMoney: /^([-]?[0-9]*[.]?[0-9]+)?[A-Za-z\u4e00-\u9fa5]*$/,
165 165
 	/**
166
-	 * 金额: 匹配中文、英文、正数
166
+	 * 金额: 匹配中文、英文、正数 0次或多次
167 167
 	 * */
168 168
 	amountMoney: /^([0-9]*[.]?[0-9]+)?[A-Za-z\u4e00-\u9fa5]*$/,
169
+	/**
170
+	 * 金额: 匹配中文、英文、 (正数 一次或多次)
171
+	 * */
172
+	amountMoneys: /^([0-9]*[.]?[0-9]+)+[A-Za-z\u4e00-\u9fa5]*$/,
169 173
 
170 174
 }

+ 42 - 35
CallCenterWeb.UI/WorkOrder/js/addOrEditInvoice.js

@@ -8,18 +8,17 @@ $(function() {
8 8
 		calendar: true,
9 9
 		theme: '#1ab394'
10 10
 	});
11
-// 	//获取所属行业//获取税务类别//获取客户信誉等级
12
-// 	$.when(helper.getDropList.getlistDropByDic($('#customer_subtrade'), 'KHSSHY'),
13
-// 			helper.getDropList.getlistDropByDic($('#customer_taxCategory'), 'SWLB'),
14
-// 			helper.getDropList.getlistDropByDic($('#customer_layer'), 'KHLayer'))
15
-// 		.done(function() {
11
+// 	//获取发票类型 税率
12
+	$.when(helper.getDropList.getlistDropByDic($('#F_BillType'), 'FPLX'),
13
+			helper.getDropList.getlistDropByDic($('#F_TaxRate'), 'KPSL'))
14
+		.done(function() {
16 15
 			var edit_id = helper.request.queryString("edit_id");
17 16
 			if (edit_id) {
18 17
 				getCustomer(edit_id);
19 18
 			}
20 19
 			//绑定验证(所有 input.form-control)
21 20
 			$('#tab_user_contents').find("input[class='form-control']").on('blur keyup', valideInput);
22
-		// });
21
+		});
23 22
 
24 23
 });
25 24
 
@@ -32,11 +31,11 @@ function getCustomer(ids) {
32 31
 		if (data.state.toLowerCase() == "success") {
33 32
 			data = data.data;
34 33
 			if (data) {
35
-				$('#F_BillType').val(data.F_BillType);//	string 发票类型	
36
-				$('#F_CusName').val(data.F_CusName);//	string 客户名称	
34
+				$('#F_BillType').selectpicker('val', data.F_BillType);//	string 发票类型	
37 35
 				$('#F_TaxIDNum').val(data.F_TaxIDNum);//	string 纳税人识别号
38
-				$('#F_Address').val(data.F_Address);//	string 地址	
36
+				$('#F_CusName').val(data.F_CusName);//	string 客户名称	
39 37
 				$('#F_Phone').val(data.F_Phone);//	string 电话
38
+				$('#F_Address').val(data.F_Address);//	string 地址	
40 39
 				$('#F_Bank').val(data.F_Bank);//	string 开户行
41 40
 				$('#F_BankAccount').val(data.F_BankAccount);//	string 开户行账号	
42 41
 				$('#F_ProName').val(data.F_ProName);//	string 项目名称	
@@ -45,13 +44,13 @@ function getCustomer(ids) {
45 44
 				$('#F_Amount').val(data.F_Amount);//	string 数量	
46 45
 				$('#F_UnitPrice').val(data.F_UnitPrice);//	string 单价
47 46
 				$('#F_SumPrice').val(data.F_SumPrice);//	string 金额	
48
-				$('#F_TaxRate').val(data.F_TaxRate);//	string 税率	
47
+				$('#F_TaxRate').selectpicker('val', data.F_TaxRate);//	string 税率	
49 48
 				$('#F_TaxAmount').val(data.F_TaxAmount);//	string 税额
50 49
 				$('#F_BillingMethod').find('input[type="radio"][value="'+ data.F_BillingMethod  +'"]').prop('checked', true);//	string 开票方式:快递/自取	
51 50
 				$('#F_BillingTime').val(data.F_BillingTime);//string 开票时间
52 51
 				$('#F_Remark').val(data.F_Remark);//string 备注
53 52
 				// $('#F_CusCode').val(data.F_CusCode);//	string 登录的公司code
54
-				$('#F_BillType').trigger('blur');
53
+				$('#F_TaxIDNum').trigger('blur');
55 54
 			}
56 55
 		}
57 56
 	});
@@ -59,11 +58,25 @@ function getCustomer(ids) {
59 58
 
60 59
 //保存
61 60
 function saveCustomer() {
62
-// 	if (!$.trim($('#F_Name').val()) ||
63
-// 		!$.trim($('#F_Telephone').val())) {
64
-// 		layer.msg('带红色星号的是必填项,请填写或选择后再保存!');
65
-// 		return;
66
-// 	}
61
+	if (!$.trim($('#F_BillType').val()) ||
62
+			!$.trim($('#F_TaxIDNum').val()) ||
63
+			!$.trim($('#F_CusName').val()) ||
64
+			!$.trim($('#F_Phone').val()) ||
65
+			!$.trim($('#F_Address').val()) ||
66
+			!$.trim($('#F_Bank').val()) ||
67
+			!$.trim($('#F_BankAccount').val()) ||
68
+			!$.trim($('#F_ProName').val()) ||
69
+			!$.trim($('#F_Unit').val()) ||
70
+			!$.trim($('#F_Amount').val()) ||
71
+			!$.trim($('#F_UnitPrice').val()) ||
72
+			!$.trim($('#F_SumPrice').val()) ||
73
+			!$.trim($('#F_TaxRate').val()) ||
74
+			!$.trim($('#F_TaxAmount').val()) ||
75
+			!$.trim($('#F_BillingTime').val()) ||
76
+			!$.trim($('#F_Remark').val())) {
77
+		layer.msg('带红色星号的是必填项,请填写或选择后再保存!');
78
+		return;
79
+	}
67 80
 	var wURL, loadIndex;
68 81
 	var edit_id = helper.request.queryString("edit_id");
69 82
 	if (edit_id) {
@@ -149,50 +162,44 @@ function valideInput() {
149 162
 	var _that = $(this);
150 163
 	//console.log($(this).attr('id'));
151 164
 	switch ($(this).attr('id')) {
152
-		case 'F_BillType': //发票类型
153
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
165
+		case 'F_TaxIDNum': //纳税人识别号
166
+			valideMethods(_that, regexs.enOrnum, '格式不正确(只能输入英文、数字)!', false);
154 167
 			break;
155 168
 		case 'F_CusName': //客户名称
156
-			valideMethods(_that, regexs.userNameReg, '格式不正确(只能输入2-20位汉字可以包含·•)!', true);
157
-			break;
158
-		case 'F_TaxIDNum': //纳税人识别号
159
-			valideMethods(_that, regexs.enOrnum, '格式不正确(只能输入英文、数字)!', true);
169
+			valideMethods(_that, regexs.userNameReg, '格式不正确(只能输入2-20位汉字可以包含·•)!', false);
160 170
 			break;
161 171
 		case 'F_Phone': //验证电话
162
-			valideMethods(_that, regexs.phone, '您输入的电话号码格式不正确!', true);
172
+			valideMethods(_that, regexs.phone, '您输入的电话号码格式不正确!', false);
163 173
 			break;
164 174
 		case 'F_Bank': //开户行
165
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
175
+			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
166 176
 			break;
167 177
 		case 'F_Address': //地址
168
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
178
+			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
169 179
 			break;
170 180
 		case 'F_BankAccount': //开户行账号
171
-			valideMethods(_that, regexs.nums, '格式不正确(只能输入数字)!', true);
181
+			valideMethods(_that, regexs.num, '格式不正确(只能输入数字)!', false);
172 182
 			break;
173 183
 		case 'F_ProName': //项目名称
174
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
184
+			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
175 185
 			break;
176 186
 		case 'F_Models': //型号
177 187
 			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
178 188
 			break;
179 189
 		case 'F_Unit': //单位
180
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
190
+			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
181 191
 			break;
182 192
 		case 'F_Amount': //数量
183
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
193
+			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', false);
184 194
 			break;
185 195
 		case 'F_UnitPrice': //单价
186
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
196
+			valideMethods(_that, regexs.amountMoneys, '格式不正确(只能输入中文、英文、正数、必须包含正数)!', false);
187 197
 			break;
188 198
 		case 'F_SumPrice': //金额
189
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
190
-			break;
191
-		case 'F_TaxRate': //税率
192
-			valideMethods(_that, regexs.percentReg, '格式不正确(只能输入百分数如20%)!', true);
199
+			valideMethods(_that, regexs.amountMoneys, '格式不正确(只能输入中文、英文、正数、必须包含正数)!', false);
193 200
 			break;
194 201
 		case 'F_TaxAmount': //税额
195
-			valideMethods(_that, regexs.chOrenOrnum, '格式不正确(只能输入中文、英文、数字)!', true);
202
+			valideMethods(_that, regexs.amountMoneys, '格式不正确(只能输入中文、英文、正数、必须包含正数)!', false);
196 203
 			break;
197 204
 	}
198 205
 	if ($('#tab_user_contents').find('.has-error').length > 0) {

+ 27 - 19
CallCenterWeb.UI/WorkOrder/template/addOrEditInvoice.html

@@ -7,6 +7,7 @@
7 7
 		<meta name="viewport" content="width=device-width, initial-scale=1.0">
8 8
 		<script src="../../Script/Common/huayi.load.js"></script>
9 9
 		<script src="../../Script/Common/huayi.config.js"></script>
10
+		<link href="../../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
10 11
 		<link rel="stylesheet" href="../../css/customer.css" />
11 12
 
12 13
 	</head>
@@ -23,49 +24,52 @@
23 24
 					</li> -->
24 25
 					
25 26
 					<li class="form-group">
26
-						<label for="F_BillType" class="col-md-2">发票类型</label>
27
+						<label for="F_BillType" class="col-md-2"><b class="text_require">*</b>发票类型</label>
27 28
 						<div class="col-md-9">
28
-							<input id="F_BillType" class="form-control" type="text" placeholder="请输入发票类型" />
29
+							<select class="form-control input-sm selectpicker" id="F_BillType" data-live-search="true">
30
+								<option value="">请选择发票类型</option>
31
+							</select>
29 32
 						</div>
30 33
 					</li>
34
+					
31 35
 					<li class="form-group">
32
-						<label for="F_TaxIDNum" class="col-md-2">纳税人识别号</label>
36
+						<label for="F_TaxIDNum" class="col-md-2"><b class="text_require">*</b>纳税人识别号</label>
33 37
 						<div class="col-md-9">
34 38
 							<input id="F_TaxIDNum" class="form-control" type="text" placeholder="请输入纳税人识别号" />
35 39
 						</div>
36 40
 					</li>
37 41
 					<li class="form-group">
38
-						<label for="F_CusName" class="col-md-2">客户名称</label>
42
+						<label for="F_CusName" class="col-md-2"><b class="text_require">*</b>客户名称</label>
39 43
 						<div class="col-md-9">
40 44
 							<input id="F_CusName" class="form-control" type="text" placeholder="请输入客户名称" />
41 45
 						</div>
42 46
 					</li>
43 47
 					<li class="form-group">
44
-						<label for="F_Phone" class="col-md-2">电话</label>
48
+						<label for="F_Phone" class="col-md-2"><b class="text_require">*</b>电话</label>
45 49
 						<div class="col-md-9">
46 50
 							<input id="F_Phone" class="form-control" type="text" placeholder="请输入电话" />
47 51
 						</div>
48 52
 					</li>
49 53
 					<li class="form-group">
50
-						<label for="F_Address" class="col-md-2">地址</label>
54
+						<label for="F_Address" class="col-md-2"><b class="text_require">*</b>地址</label>
51 55
 						<div class="col-md-9">
52 56
 							<input id="F_Address" class="form-control" type="text" placeholder="请输入地址" />
53 57
 						</div>
54 58
 					</li>
55 59
 					<li class="form-group">
56
-						<label for="F_Bank" class="col-md-2">开户行</label>
60
+						<label for="F_Bank" class="col-md-2"><b class="text_require">*</b>开户行</label>
57 61
 						<div class="col-md-9">
58 62
 							<input id="F_Bank" class="form-control" type="text" placeholder="请输入开户行" />
59 63
 						</div>
60 64
 					</li>
61 65
 					<li class="form-group">
62
-						<label for="F_BankAccount" class="col-md-2">开户行账号</label>
66
+						<label for="F_BankAccount" class="col-md-2"><b class="text_require">*</b>开户行账号</label>
63 67
 						<div class="col-md-9">
64 68
 							<input id="F_BankAccount" class="form-control" type="text" placeholder="请输入开户行账号" />
65 69
 						</div>
66 70
 					</li>
67 71
 					<li class="form-group">
68
-						<label for="F_ProName" class="col-md-2">项目名称</label>
72
+						<label for="F_ProName" class="col-md-2"><b class="text_require">*</b>项目名称</label>
69 73
 						<div class="col-md-9">
70 74
 							<input id="F_ProName" class="form-control" type="text" placeholder="请输入项目名称" />
71 75
 						</div>
@@ -77,43 +81,45 @@
77 81
 						</div>
78 82
 					</li>
79 83
 					<li class="form-group">
80
-						<label for="F_Unit" class="col-md-2">单位</label>
84
+						<label for="F_Unit" class="col-md-2"><b class="text_require">*</b>单位</label>
81 85
 						<div class="col-md-9">
82 86
 							<input id="F_Unit" class="form-control" type="text" placeholder="请输入单位" />
83 87
 						</div>
84 88
 					</li>
85 89
 					<li class="form-group">
86
-						<label for="F_Amount" class="col-md-2">数量</label>
90
+						<label for="F_Amount" class="col-md-2"><b class="text_require">*</b>数量</label>
87 91
 						<div class="col-md-9">
88 92
 							<input id="F_Amount" class="form-control" type="text" placeholder="请输入数量" />
89 93
 						</div>
90 94
 					</li>
91 95
 					<li class="form-group">
92
-						<label for="F_UnitPrice" class="col-md-2">单价</label>
96
+						<label for="F_UnitPrice" class="col-md-2"><b class="text_require">*</b>单价</label>
93 97
 						<div class="col-md-9">
94 98
 							<input id="F_UnitPrice" class="form-control" type="text" placeholder="请输入单价" />
95 99
 						</div>
96 100
 					</li>
97 101
 					<li class="form-group">
98
-						<label for="F_SumPrice" class="col-md-2">金额</label>
102
+						<label for="F_SumPrice" class="col-md-2"><b class="text_require">*</b>金额</label>
99 103
 						<div class="col-md-9">
100 104
 							<input id="F_SumPrice" class="form-control" type="text" placeholder="请输入金额" />
101 105
 						</div>
102 106
 					</li>
103 107
 					<li class="form-group">
104
-						<label for="F_TaxRate" class="col-md-2">税率</label>
108
+						<label for="F_TaxRate" class="col-md-2"><b class="text_require">*</b>税率</label>
105 109
 						<div class="col-md-9">
106
-							<input id="F_TaxRate" class="form-control" type="text" placeholder="请输入税率" />
110
+							<select class="form-control input-sm selectpicker" id="F_TaxRate" data-live-search="true">
111
+								<option value="">请选择税率</option>
112
+							</select>
107 113
 						</div>
108 114
 					</li>
109 115
 					<li class="form-group">
110
-						<label for="F_TaxAmount" class="col-md-2">税额</label>
116
+						<label for="F_TaxAmount" class="col-md-2"><b class="text_require">*</b>税额</label>
111 117
 						<div class="col-md-9">
112 118
 							<input id="F_TaxAmount" class="form-control" type="text" placeholder="请输入税额" />
113 119
 						</div>
114 120
 					</li>
115 121
 					<li class="form-group">
116
-						<label for="F_BillingMethod" class="col-md-2">开票方式</label>
122
+						<label for="F_BillingMethod" class="col-md-2"><b class="text_require">*</b>开票方式</label>
117 123
 						<div class="col-md-4" id="F_BillingMethod">
118 124
 							<label class="radio-inline">
119 125
 								<input type="radio" name="billingMethodOptions" value="快递" checked="checked"> 快递
@@ -124,7 +130,7 @@
124 130
 						</div>
125 131
 					</li>
126 132
 					<li class="form-group">
127
-						<label for="F_BillingTime" class="col-md-2">开票时间</label>
133
+						<label for="F_BillingTime" class="col-md-2"><b class="text_require">*</b>开票时间</label>
128 134
 						<div class="col-md-9">
129 135
 							<input id="F_BillingTime" class="form-control" type="text" placeholder="请选择开票时间" />
130 136
 						</div>
@@ -136,7 +142,7 @@
136 142
 						</div>
137 143
 					</li> -->
138 144
 					<li class="form-group">
139
-						<label for="F_Remark" class="col-md-2">备注</label>
145
+						<label for="F_Remark" class="col-md-2"><b class="text_require">*</b>备注</label>
140 146
 						<div class="col-md-9">
141 147
 							<textarea id="F_Remark" class="form-control" rows="2" placeholder="请输入备注"></textarea>
142 148
 						</div>
@@ -149,6 +155,8 @@
149 155
 				</div>
150 156
 			</div>
151 157
 		</div>
158
+		<script src="../../js/bootstrap-select/js/bootstrap-select.js"></script>
159
+		<script src="../../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
152 160
 		<script src="../../js/autosize/autosize.min.js"></script>
153 161
 		<script src="../../js/laydate/laydate.js"></script>
154 162
 		<script src="../../Script/Common/regexs.js"></script>