store-list.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. @extends('layouts.base')
  2. @section('title', '门店管理')
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
  6. <style>
  7. .edit-i {
  8. display: none;
  9. }
  10. .el-table_1_column_2:hover .edit-i {
  11. font-weight: 900;
  12. padding: 0;
  13. margin: 0;
  14. display: inline-block;
  15. }
  16. .el-tabs__item, .is-top {
  17. font-size: 16px
  18. }
  19. .el-tabs__active-bar {
  20. height: 3px;
  21. }
  22. .input-with-select .el-input-group__prepend {
  23. background-color: #fff;
  24. }
  25. </style>
  26. <div class="all">
  27. <div id="app" v-cloak>
  28. <div class="vue-head">
  29. <div class="vue-search">
  30. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  31. <el-row :gutter="15">
  32. <el-col :span="5">
  33. <el-input placeholder="门店id/门店名称" v-model="search_input_value1"
  34. class="input-with-select">
  35. <el-select style="width: 120px" class="search_input_select"
  36. v-model="search_input_key1" slot="prepend" placeholder="请选择">
  37. <el-option label="门店id" value="store_id">门店id
  38. </el-option>
  39. <el-option label="门店名称" value="store_name">门店名称
  40. </el-option>
  41. </el-select>
  42. </el-input>
  43. </el-col>
  44. <el-form-item>
  45. <el-input placeholder="跑腿系统门店id" v-model="search_form.another_store_id"
  46. class="input-with-select">
  47. </el-input>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-select v-model="search_form.connect_status" placeholder="同步状态">
  51. <el-option
  52. v-for="(item,index) in connect_status_arr"
  53. :key="index"
  54. :label="item.label"
  55. :value="item.value">
  56. </el-option>
  57. </el-select>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button-group>
  61. <el-button type="primary" @click="changeForm()">搜索</el-button>
  62. <el-button type="" :loading="bind_many_store_button.remindLoading"
  63. @click="bindManyStore()">自动绑定
  64. </el-button>
  65. </el-button-group>
  66. </el-form-item>
  67. </el-form>
  68. </div>
  69. </div>
  70. <div class="vue-main">
  71. <div class="vue-main-form">
  72. <div class="vue-main-title" style="margin-top:-10px">
  73. <div class="title"><span
  74. style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>门店管理</b>
  75. </div>
  76. </div>
  77. </div>
  78. <div style="margin-bottom:20px">
  79. <div style="margin-bottom:20px">
  80. </div>
  81. <el-table :data="list" style="width: 100%;" align="center" :fit="true">
  82. <el-table-column min-width="10%" prop="store_id" label="门店ID" align="center"></el-table-column>
  83. <el-table-column min-width="10%" prop="" label="门店" align="center">
  84. <template slot-scope="scope">
  85. <div class="block">
  86. <el-link type="info" class="title" :href="scope.row.store_url" target="_blank">
  87. <el-avatar shape="circle" :size="40" :src="scope.row.store_thumb"></el-avatar>
  88. <br>
  89. [[scope.row.store_name]]
  90. </el-link>
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column min-width="10%" prop="address" label="门店地址" align="center"></el-table-column>
  95. <el-table-column min-width="10%" prop="" label="门店店长" align="center">
  96. <template slot-scope="scope">
  97. <div class="block">
  98. <el-link type="info" class="title" :href="scope.row.member_url" target="_blank">
  99. <el-avatar shape="circle" :size="40" :src="scope.row.avatar"></el-avatar>
  100. <br>
  101. [[scope.row.username]]
  102. </el-link>
  103. </div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column min-width="10%" prop="connect_staus_name" label="同步状态"
  107. align="center"></el-table-column>
  108. <el-table-column min-width="10%" prop="another_store_id" label="跑腿商户id"
  109. align="center"></el-table-column>
  110. <el-table-column min-width="10%" prop="" label="操作" align="center">
  111. <template slot-scope="scope">
  112. <el-button @click="storeOrder(scope.row)" type="" size="mini">门店订单</el-button>
  113. <el-button @click="showBindModal(scope.row)" type="primary" size="mini">绑定商户</el-button>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. <div class="vue-page" v-if="total > 0">
  119. <el-row>
  120. <el-col align="right">
  121. <el-pagination layout="prev, pager, next,jumper" @current-change="getData" :total="total"
  122. :page-size="per_page" :current-page="current_page" background
  123. ></el-pagination>
  124. </el-col>
  125. </el-row>
  126. </div>
  127. <el-dialog :visible.sync="bind_modal.show" width="600px" title="绑定商户">
  128. <div style="height:150px;overflow:auto;margin-left: 50px;margin-top: 50px;" id="cancel-send">
  129. <el-form :inline="true" :model="bind_modal" class="demo-form-inline">
  130. <el-form-item label="绑定方式">
  131. <el-radio-group v-model="bind_modal.bind_type">
  132. <el-radio-button label="1">自动创建跑腿系统商户</el-radio-button>
  133. <el-radio-button label="2">绑定已有跑腿系统商户</el-radio-button>
  134. </el-radio-group>
  135. </el-form-item>
  136. <el-form-item label="跑腿商户id" v-if="bind_modal.bind_type==2">
  137. <el-input v-model="bind_modal.another_store_id"></el-input>
  138. </el-form-item>
  139. <div class="tip" v-if="bind_modal.bind_type==2">设置为0视为取消商城的绑定关系,跑腿系统的绑定关系需要自行编辑或删除</div>
  140. </el-form>
  141. </div>
  142. <span slot="footer" class="dialog-footer">
  143. <el-button @click="bind_modal.show = false">取 消</el-button>
  144. <el-button type="primary" :loading="bind_modal.remindLoading" @click="bindRunningStore">绑定 </el-button>
  145. </span>
  146. </el-dialog>
  147. </div>
  148. <!-- 分页 -->
  149. </div>
  150. </div>
  151. <script>
  152. var app = new Vue({
  153. el: "#app",
  154. delimiters: ['[[', ']]'],
  155. name: 'test',
  156. data() {
  157. return {
  158. list: [],
  159. total: 1,
  160. per_page: 1,
  161. current_page: 1,
  162. connect_button: {
  163. remindLoading: false
  164. },
  165. bind_many_store_button: {
  166. remindLoading: false
  167. },
  168. bind_modal: {
  169. show: false,
  170. store_id: 0,
  171. another_store_id: '',
  172. bind_type: 1,
  173. remindLoading: false
  174. },
  175. search_form: {
  176. 'connect_status': "-1",
  177. 'another_store_id': '',
  178. },
  179. connect_status_arr: [
  180. {value: '-1', label: '同步状态'},
  181. {value: '0', label: '未同步'},
  182. {value: '1', label: '已同步'},
  183. ],
  184. search_input_key1: 'store_id',
  185. search_input_value1: '',
  186. search_data: {},
  187. }
  188. },
  189. created() {
  190. },
  191. mounted() {
  192. this.search();
  193. },
  194. methods: {
  195. bindManyStore: function () {
  196. this.bind_many_store_button.remindLoading = true;
  197. this.$http.post('{!! yzWebFullUrl('plugin.running-delivery.admin.store.bindManyStore') !!}', {})
  198. .then(function (response) {
  199. this.bind_many_store_button.remindLoading = false;
  200. if (response.data.result) {
  201. this.$message({message: response.data.msg, type: 'success'});
  202. } else {
  203. this.$message({
  204. message: response.data.msg,
  205. dangerouslyUseHTMLString: true,
  206. type: 'error'
  207. });
  208. }
  209. this.search();
  210. }, function (response) {
  211. this.bind_many_store_button.remindLoading = false;
  212. this.$message({message: response.data.msg, type: 'error'});
  213. })
  214. },
  215. showBindModal: function (scope) {
  216. this.bind_modal.another_store_id = '';
  217. console.log(scope.store_id);
  218. this.bind_modal.store_id = scope.store_id;
  219. this.bind_modal.bind_type = 1;
  220. this.bind_modal.show = true;
  221. },
  222. bindRunningStore: function (scope) {
  223. this.bind_modal.remindLoading = true;
  224. this.$http.post('{!! yzWebFullUrl('plugin.running-delivery.admin.store.bindOneStore') !!}', {
  225. 'another_store_id': this.bind_modal.another_store_id,
  226. 'bind_type': this.bind_modal.bind_type,
  227. 'store_id': this.bind_modal.store_id,
  228. }).then(function (response) {
  229. this.bind_modal.remindLoading = false;
  230. if (response.data.result) {
  231. this.$message({message: response.data.msg, type: 'success'});
  232. this.bind_modal.show = false;
  233. this.search();
  234. } else {
  235. this.$message({message: response.data.msg, type: 'error'});
  236. }
  237. }, function (response) {
  238. this.bind_modal.remindLoading = false;
  239. this.$message({message: response.data.msg, type: 'error'});
  240. })
  241. },
  242. storeOrder: function (scope) {
  243. window.open("{!! yzWebUrl('plugin.store-cashier.admin.store-order.store-list') !!}" + '&id=' + scope.store_id);
  244. },
  245. search: function () {
  246. this.$http.post('{!! yzWebFullUrl('plugin.running-delivery.admin.store.index') !!}', {
  247. 'page': this.current_page,
  248. 'is_json': 1,
  249. 'search_data': this.search_data,
  250. }).then(function (response) {
  251. console.log(response);
  252. if (response.data.result) {
  253. let this_data = response.data.data.list;
  254. this.current_page = this_data.current_page;
  255. this.list = this_data.data;
  256. this.total = this_data.total;
  257. this.per_page = this_data.per_page;
  258. } else {
  259. this.$message({message: response.data.msg, type: 'error'});
  260. }
  261. }, function (response) {
  262. this.$message({message: response.data.msg, type: 'error'});
  263. })
  264. },
  265. getData: function (val) {
  266. this.current_page = val;
  267. this.search();
  268. },
  269. changeForm: function () {
  270. this.search_data.store_id = 0;
  271. this.search_data.store_name = '';
  272. this.search_data = this.search_form;
  273. this.search_data[this.search_input_key1] = this.search_input_value1;
  274. this.current_page = 1;
  275. this.search();
  276. }
  277. },
  278. })
  279. </script>
  280. @endsection