Browse Source

发票管理表单验证提示信息

yangc 8 years ago
parent
commit
410929b6d8

+ 9 - 9
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -411,42 +411,42 @@
                         <div class="col-md-6">
                             <input type="text" class="form-control" ng-model="bill.head" name="billHead" ng-maxlength="100" required="required" placeholder="请输入发票抬头">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.head||form.billHead.$touched)&&form.billHead.$invalid" ng-bind="(!bill.head || bill.head == '')?'请填写发票抬头':'请勿超过50个字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.head||form.billHead.$touched)&&form.billHead.$invalid" ng-bind="form.billHead.$error.required?'请填写发票抬头':'请勿超过50个字'"></div>
                     </div>
                     <div class="form-group" ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位地址:</label>
                         <div class="col-md-6">
                             <input type="text" class="form-control" ng-model="bill.companyAddress" name="companyAddr" ng-maxlength="100" required="required" placeholder="请输入单位地址">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.companyAddress||form.companyAddr.$touched)&&form.companyAddr.$invalid" ng-bind="(!bill.companyAddress || bill.companyAddress == '')?'请填写单位地址':'请勿超过50个字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.companyAddress||form.companyAddr.$touched)&&form.companyAddr.$invalid" ng-bind="form.companyAddr.$error.required?'请填写单位地址':'请勿超过50个字'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位电话:</label>
                         <div class="col-md-6">
                             <input type="text" class="form-control" placeholder="区号和号码使用 '-' 隔开,或者不填区号" name="companyPhone" ng-model="bill.companyPhone" ng-maxlength="20" ng-pattern="/^[0-9]*$/" required="required">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.companyPhone||form.companyPhone.$touched)&&form.companyPhone.$invalid" ng-bind="(!bill.companyPhone)?'请填写单位电话':'请勿超过20个字符'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.companyPhone||form.companyPhone.$touched)&&form.companyPhone.$invalid" ng-bind="form.companyPhone.$error.required?'请填写单位电话':'请勿超过20个字符'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>税务登记号:</label>
                         <div class="col-md-6">
                             <input type="text" class="form-control" ng-model="bill.companyTaxNumber" name="companyTaxNum" required="true" placeholder="请输入税务登记号">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.companyTaxNumber||form.companyTaxNum.$touched)&&(form.companyTaxNum.$error.required||form.companyTaxNum.$error.minlength)" ng-bind="(!bill.companyTaxNumber || bill.companyTaxNumber == '')?'请填写税务登记号':'请输入15-20位税务登记号'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.companyTaxNumber||form.companyTaxNum.$touched)&&(form.companyTaxNum.$error.required||form.companyTaxNum.$error.minlength)" ng-bind="form.companyTaxNum.$error.required?'请填写税务登记号':'请输入15-20位税务登记号'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行:</label>
                         <div class="col-md-6">
                             <input type="text" class="form-control" ng-model="bill.bankName" name="bankName" required="required" ng-maxlength="60" placeholder="请输入开户银行">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.bankName||form.bankName.$touched)&&form.bankName.$invalid" ng-bind="(!bill.bankName || bill.bankName == '')?'请填写开户银行':'请勿超过30个字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.bankName||form.bankName.$touched)&&form.bankName.$invalid" ng-bind="form.bankName.$error.required?'请填写开户银行':'请勿超过30个字'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行账户:</label>
                         <div class="col-md-6">
                             <input type="text" class="form-control" ng-model="bill.bankAccount" name="account" ng-pattern="/^[0-9]*$/" required ng-maxlength="30" placeholder="请输入开户银行账号">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.bankAccount||form.account.$touched)&&(form.account.$invalid)" ng-bind="(!bill.bankAccount || bill.bankAccount == '')?'请填写开户银行账号':'请勿超过30个字符'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.bankAccount||form.account.$touched)&&(form.account.$invalid)" ng-bind="form.account.$error.required?'请填写开户银行账号':'请勿超过30个字符'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>上传开户许可证:</label>
@@ -460,7 +460,7 @@
                         <div class="col-md-6">
                             <input id="mzbillname" type="text" class="form-control" ng-model="bill.name" name="billName" required="required" ng-maxlength="20" placeholder="请输入收票人">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.name||form.billName.$touched)&&(form.billName.$invalid)" ng-bind="(!bill.name || bill.name == '')?'请填写收票人姓名':'请勿超过10个字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.name||form.billName.$touched)&&(form.billName.$invalid)" ng-bind="form.billName.$error.required?'请填写收票人姓名':'请勿超过10个字'"></div>
                     </div>
                     <div class="form-group">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
@@ -468,7 +468,7 @@
                             <input type="text" class="form-control" ng-model="bill.telephone" name="billTel"
                                    ng-pattern="/^[0-9]*$/" ng-maxlength="11" ng-minlength="8" required="required" placeholder="请输入联系电话">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.telephone || form.billTel.$touched)&&form.billTel.$invalid" ng-bind="(!bill.telephone || bill.telephone == '')?'请填写联系电话':'输入8-11位数字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.telephone || form.billTel.$touched)&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'输入8-11位数字'"></div>
                     </div>
                     <div class="form-group address">
                         <label class="col-md-2 control-label" style="position: relative;top: 20px;"><b class="text-inverse">*</b>所在地区:</label>
@@ -502,7 +502,7 @@
                             <input id="mzaddress" type="text" class="form-control" required="required" name="billDetail" ng-model="bill.detailAddress" ng-maxlength="60"
                             placeholder="建议您填写详细发件地址,如街道名,门牌号,楼层和房间号等信息">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="(bill.detailAddress || form.billDetail.$touched)&&form.billDetail.$invalid" ng-bind="(!bill.detailAddress || bill.detailAddress == '')?'请填写详细地址':'请勿超过30个字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="(bill.detailAddress || form.billDetail.$touched)&&form.billDetail.$invalid" ng-bind="form.billDetail.$error.required?'请填写详细地址':'请勿超过30个字'"></div>
                     </div>
                     <div class="form-bottom">
                         <div class="form-group">