<div ng-controller="ProvinceCtrl">
<div class="panel panel-default mg">
<div class="panel-body">
	<div class="input-group col-sm-3">
		<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
		<input type="text" placeholder="省份" class="input-sm form-control" ng-model="provName" />
	</div>
<div cg-busy="{promise:loading,message:'正在处理...'}"></div>
<table class="table table-condensed table-striped table-hover">
    <thead>
    	<tr>
    		<th width="8%">名称</th>
    		<th width="9%">邮编</th>
    		<th width="13%">联系电话</th>
    		<th width="13%">单位名称</th>
    		<th>收件人地址</th>
    		<th>办公室</th>
    		<th width="8%">收件人</th>
    		<th width="8%">类型</th>
    		<th width="10%"></th>
    	</tr>
    </thead>
    <tr ng-repeat="row in provs | filter:{name : provName}">
    	<td>{{row.name}}</td>
      <td>
        <span editable-text="row.zipcode" e-name="zipcode" e-form="rowform" >
          {{ row.zipcode || '' }}
        </span>
      </td>
      <td>
        <span editable-text="row.phone" e-name="phone" e-form="rowform" >
          {{ row.phone || '' }}
        </span>
      </td>
      <td>
        <span editable-text="row.unit" e-name="unit" e-form="rowform" >
          {{ row.unit || '' }}
        </span>
      </td>
      <td>
        <span editable-text="row.address" e-name="address" e-form="rowform" placeholder="收件地址">
          {{ row.address || '' }}
        </span>
      </td>
      <td>
        <span editable-text="row.office" e-name="office" e-form="rowform" >
          {{ row.office || '' }}
        </span>
      </td>
      <td>
        <span editable-text="row.receiver" e-name="receiver" e-form="rowform" >
          {{ row.receiver || '' }}
        </span>
      </td>
       <td>
        <span editable-select="row.paperType" e-name="paperType" e-form="rowform" e-ng-options="g.name as g.value for g in groups">
          {{ row.paperTypeLabel }}
        </span>
      </td>
      <td style="white-space: nowrap">
        <!-- form -->
        <form editable-form name="rowform" onbeforesave="saveProv($data,$index)" ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == row">
          <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary btn-md">
            保存
          </button>
          <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default btn-md">
            取消
          </button>
        </form>
        <div class="buttons" ng-show="!rowform.$visible">
          <a  ng-click="rowform.$show()">
          	<i class="glyphicon glyphicon-pencil"></i>&nbsp;编辑
          </a>
        </div>  
      </td>
    </tr>
  </table>
  </div>
</div>
</div>

    
