tb-shop-list.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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" style="min-width: 0px;">
  36. <el-button size="mini" type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  37. <el-button size="mini" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  38. </div>
  39. <br />
  40. </el-form>
  41. <!-- ------------- 数据列表 ------------- -->
  42. <el-table class="data-table" ref="data-table" :data="dataList" size="small">
  43. <el-table-column align="center" label="" type="index" width="35px"></el-table-column>
  44. <el-table-column align="center" label="商铺名称" prop="shopName"></el-table-column>
  45. <el-table-column align="center" label="商铺编码" prop="shopNo"></el-table-column>
  46. <el-table-column align="center" label="商铺类型" prop="shopType">
  47. <template slot-scope="s">
  48. <span v-if="s.row.shopType == 1">中方商铺</span>
  49. <span v-else-if="s.row.shopType == 2">外国商铺</span>
  50. <span v-else>-</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column align="center" label="铺主姓名" prop="ownerName" width="340px"></el-table-column>
  54. <el-table-column align="center" label="铺主电话" prop="ownerTel">
  55. <template slot-scope="s">
  56. <span v-if="s.row.ownerTel">{{maskPhone(s.row.ownerTel)}}</span>
  57. <span v-else>-</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column align="center" label="状态" prop="edstatus">
  61. <template slot-scope="s">
  62. <span v-if="s.row.edstatus == 1">启用</span>
  63. <span v-else-if="s.row.edstatus == 2">停用</span>
  64. <span v-else-if="s.row.edstatus == 3">注销</span>
  65. <span v-else>-</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="center" label="互市区" prop="fieldName"></el-table-column>
  69. <el-table-column align="center" label="经营范围" prop="bnsScope"></el-table-column>
  70. <el-table-column align="center" label="操作" fixed="right" width="160px">
  71. <template slot-scope="s">
  72. <el-button class="c-btn" type="primary" icon="el-icon-s-custom" @click="peopleFn(s.row)">边民
  73. </el-button>
  74. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  75. </el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <!-- ------------- 分页 ------------- -->
  80. <div class="page-box">
  81. <el-pagination background layout="total, prev, pager, next, sizes, jumper"
  82. :current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
  83. :page-sizes="[1, 10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
  84. </el-pagination>
  85. </div>
  86. </div>
  87. </div>
  88. <script>
  89. var app = new Vue({
  90. el: '.vue-box',
  91. data: {
  92. p: { // 查询参数
  93. shopName: '', // 名称
  94. tradeAreaId:'',
  95. pageNo: 1, // 当前页
  96. pageSize: 10, // 页大小
  97. sortType: 0 // 排序方式
  98. },
  99. dataCount: 0,
  100. tradeAreaList:[],
  101. dataList: [], // 数据集合
  102. },
  103. methods: {
  104. peopleFn(data){
  105. sa.showIframe('边民列表', 'tb-sho-people-list.html?shopId=' + data.id, '80%', '90%');
  106. },
  107. getTradeArea() {
  108. sa.ajax('/level-one-server/TbTradeArea/getList', {
  109. pageSize: 100,
  110. pageNo: 1
  111. }, function(resp) {
  112. this.tradeAreaList = resp.data;
  113. }.bind(this));
  114. },
  115. maskPhone:function (phone) {
  116. return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  117. },
  118. // 刷新
  119. f5: function() {
  120. sa.ajax('/level-one-server/TbShop/getList', sa.removeNull(this.p), function(res) {
  121. this.dataList = res.data; // 数据
  122. this.dataCount = parseInt(res.dataCount); // 数据总数
  123. sa.f5TableHeight(); // 刷新表格高度
  124. }.bind(this));
  125. },
  126. // 查看
  127. get: function(data) {
  128. sa.showIframe('数据详情', 'tb-shop-info.html?id=' + data.id, '1150px', '95%');
  129. },
  130. // 查看 - 根据选中的
  131. getBySelect: function(data) {
  132. var selection = this.$refs['data-table'].selection;
  133. if (selection.length == 0) {
  134. return sa.msg('请选择一条数据')
  135. }
  136. this.get(selection[0]);
  137. },
  138. // 修改
  139. update: function(data) {
  140. sa.showIframe('修改数据', 'tb-shop-add.html?id=' + data.id, '700px', '70%');
  141. },
  142. // 新增
  143. add: function(data) {
  144. sa.showIframe('新增数据', 'tb-shop-add.html?id=-1', '700px', '70%');
  145. },
  146. // 删除
  147. del: function(data) {
  148. sa.confirm('是否删除,此操作不可撤销', function() {
  149. sa.ajax('/level-one-server/TbShop/delete?id=' + data.id, function(res) {
  150. sa.arrayDelete(this.dataList, data);
  151. sa.ok('删除成功');
  152. sa.f5TableHeight(); // 刷新表格高度
  153. }.bind(this))
  154. }.bind(this));
  155. },
  156. // 批量删除
  157. deleteByIds: function() {
  158. // 获取选中元素的id列表
  159. let selection = this.$refs['data-table'].selection;
  160. let ids = sa.getArrayField(selection, 'id');
  161. if (selection.length == 0) {
  162. return sa.msg('请至少选择一条数据')
  163. }
  164. // 提交删除
  165. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  166. sa.ajax('/level-one-server/TbShop/deleteByIds', {
  167. ids: ids.join(',')
  168. }, function(res) {
  169. sa.arrayDelete(this.dataList, selection);
  170. sa.ok('删除成功');
  171. sa.f5TableHeight(); // 刷新表格高度
  172. }.bind(this))
  173. }.bind(this));
  174. },
  175. // 改 - 是否可用(0=否,1=是)
  176. updateStatus: function(data) {
  177. // 声明变量记录是否成功
  178. var isOk = false;
  179. var oldValue = data.status;
  180. var ajax = sa.ajax('/level-one-server/TbShop/updateStatus', {
  181. id: data.id,
  182. value: data.status
  183. }, function(res) {
  184. isOk = true;
  185. sa.msg('修改成功');
  186. }.bind(this));
  187. // 如果未能修改成功, 则回滚
  188. $.when(ajax).done(function() {
  189. if (isOk == false) {
  190. data.status = oldValue;
  191. }
  192. })
  193. },
  194. },
  195. created: function() {
  196. this.f5();
  197. this.getTradeArea();
  198. sa.onInputEnter();
  199. }
  200. })
  201. </script>
  202. </body>
  203. </html>