tb-shop-list.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <!-- <div class="c-item">
  25. <label class="c-label">互市区:</label>
  26. <el-select v-model="p.tradeAreaId" placeholder="请选择" filterable size="mini">
  27. <el-option label="请选择" :value="0" disabled></el-option>
  28. <el-option v-for="(item,index) in tradeAreaList" :key="index" :label="item.name" :value="item.id"> </el-option>
  29. </el-select>
  30. </div> -->
  31. <div class="c-item">
  32. <label class="c-label">商铺名称:</label>
  33. <el-input size="mini" v-model="p.shopName"></el-input>
  34. </div>
  35. <div class="c-item">
  36. <label class="c-label">铺主:</label>
  37. <el-input size="mini" v-model="p.ownerName"></el-input>
  38. </div>
  39. <div class="c-item" style="min-width: 0px;">
  40. <el-button size="mini" type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  41. <el-button size="mini" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  42. </div>
  43. <br />
  44. </el-form>
  45. <!-- ------------- 数据列表 ------------- -->
  46. <el-table class="data-table" ref="data-table" :data="dataList" size="small">
  47. <el-table-column align="center" label="序号" type="index" width="80px"></el-table-column>
  48. <el-table-column align="center" label="商铺名称" prop="shopName"></el-table-column>
  49. <el-table-column align="center" label="铺主姓名" prop="ownerName" width="340px"></el-table-column>
  50. <el-table-column align="center" label="国别" prop="shopType">
  51. <template slot-scope="s">
  52. <span v-if="s.row.nationality == 0006">柬埔寨</span>
  53. <span v-if="s.row.nationality == 0007">俄罗斯</span>
  54. <span v-if="s.row.nationality == 0004">老挝</span>
  55. <span v-if="s.row.nationality == 0001">中国</span>
  56. <span v-if="s.row.nationality == 0002">越南</span>
  57. <span v-if="s.row.nationality == 0003">缅甸</span>
  58. <span v-if="s.row.nationality == 0005">蒙古</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center" label="证件类型" prop="ownerName" width="180px">
  62. <template slot-scope="s">
  63. <span v-if="s.row.ownerIdtype == 0001">身份证(0001)</span>
  64. <span v-if="s.row.ownerIdtype == 0002">护照(0002)</span>
  65. <span v-if="s.row.ownerIdtype == 0003">军官证(0003)</span>
  66. <span v-if="s.row.ownerIdtype == 0004">港澳通行证(0004)</span>
  67. <span v-if="s.row.ownerIdtype == 0005">马帮丁(0005)</span>
  68. <span v-if="s.row.ownerIdtype == 0006">营业执照(0006)</span>
  69. <span v-if="s.row.ownerIdtype == 0008">社会统一信用代码(0008)</span>
  70. <span v-if="s.row.ownerIdtype == 0007">其他(0007)</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" label="银行" prop="bank" width="140px"></el-table-column>
  74. <el-table-column align="center" label="卡号" prop="bankAccount" width="140px"></el-table-column>
  75. <el-table-column align="center" label="铺主电话" prop="ownerTel" width="120px">
  76. <template slot-scope="s">
  77. <span v-if="s.row.ownerTel">{{maskPhone(s.row.ownerTel)}}</span>
  78. <span v-else>-</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="center" label="操作" fixed="right" width="200px">
  82. <template slot-scope="s">
  83. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  84. </el-button>
  85. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="bankInfo(s.row)">银行卡
  86. </el-button>
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. <!-- ------------- 分页 ------------- -->
  91. <div class="page-box">
  92. <el-pagination background layout="total, prev, pager, next, sizes, jumper"
  93. :current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
  94. :page-sizes="[1, 10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
  95. </el-pagination>
  96. </div>
  97. </div>
  98. </div>
  99. <script>
  100. var app = new Vue({
  101. el: '.vue-box',
  102. data: {
  103. p: { // 查询参数
  104. shopName: '', // 名称
  105. tradeAreaId:'',
  106. pageNo: 1, // 当前页
  107. pageSize: 10, // 页大小
  108. sortType: 0 // 排序方式
  109. },
  110. dataCount: 0,
  111. tradeAreaList:[],
  112. dataList: [], // 数据集合
  113. },
  114. methods: {
  115. peopleFn(data){
  116. sa.showIframe('边民列表', 'tb-sho-people-list.html?shopId=' + data.id, '80%', '90%');
  117. },
  118. getTradeArea() {
  119. sa.ajax('/level-one-server/TbTradeArea/getList', {
  120. pageSize: 100,
  121. pageNo: 1
  122. }, function(resp) {
  123. this.tradeAreaList = resp.data;
  124. }.bind(this));
  125. },
  126. maskPhone:function (phone) {
  127. return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  128. },
  129. // 刷新
  130. f5: function() {
  131. sa.ajax('/level-one-server/TbShop/getList', sa.removeNull(this.p), function(res) {
  132. this.dataList = res.data; // 数据
  133. this.dataCount = parseInt(res.dataCount); // 数据总数
  134. sa.f5TableHeight(); // 刷新表格高度
  135. }.bind(this));
  136. },
  137. // 查看
  138. get: function(data) {
  139. sa.showIframe('数据详情', 'tb-shop-info.html?id=' + data.id, '1150px', '95%');
  140. },
  141. bankInfo: function(data) {
  142. sa.showIframe('银行信息', 'tb-shop-bank.html?id=' + data.id, '700px', '75%');
  143. },
  144. // 查看 - 根据选中的
  145. getBySelect: function(data) {
  146. var selection = this.$refs['data-table'].selection;
  147. if (selection.length == 0) {
  148. return sa.msg('请选择一条数据')
  149. }
  150. this.get(selection[0]);
  151. },
  152. // 修改
  153. update: function(data) {
  154. sa.showIframe('修改数据', 'tb-shop-add.html?id=' + data.id, '700px', '70%');
  155. },
  156. // 新增
  157. add: function(data) {
  158. sa.showIframe('新增数据', 'tb-shop-add.html?id=-1', '700px', '70%');
  159. },
  160. // 删除
  161. del: function(data) {
  162. sa.confirm('是否删除,此操作不可撤销', function() {
  163. sa.ajax('/level-one-server/TbShop/delete?id=' + data.id, function(res) {
  164. sa.arrayDelete(this.dataList, data);
  165. sa.ok('删除成功');
  166. sa.f5TableHeight(); // 刷新表格高度
  167. }.bind(this))
  168. }.bind(this));
  169. },
  170. // 批量删除
  171. deleteByIds: function() {
  172. // 获取选中元素的id列表
  173. let selection = this.$refs['data-table'].selection;
  174. let ids = sa.getArrayField(selection, 'id');
  175. if (selection.length == 0) {
  176. return sa.msg('请至少选择一条数据')
  177. }
  178. // 提交删除
  179. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  180. sa.ajax('/level-one-server/TbShop/deleteByIds', {
  181. ids: ids.join(',')
  182. }, function(res) {
  183. sa.arrayDelete(this.dataList, selection);
  184. sa.ok('删除成功');
  185. sa.f5TableHeight(); // 刷新表格高度
  186. }.bind(this))
  187. }.bind(this));
  188. },
  189. // 改 - 是否可用(0=否,1=是)
  190. updateStatus: function(data) {
  191. // 声明变量记录是否成功
  192. var isOk = false;
  193. var oldValue = data.status;
  194. var ajax = sa.ajax('/level-one-server/TbShop/updateStatus', {
  195. id: data.id,
  196. value: data.status
  197. }, function(res) {
  198. isOk = true;
  199. sa.msg('修改成功');
  200. }.bind(this));
  201. // 如果未能修改成功, 则回滚
  202. $.when(ajax).done(function() {
  203. if (isOk == false) {
  204. data.status = oldValue;
  205. }
  206. })
  207. },
  208. },
  209. created: function() {
  210. this.f5();
  211. this.getTradeArea();
  212. sa.onInputEnter();
  213. }
  214. })
  215. </script>
  216. </body>
  217. </html>