clerk-list.blade.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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-form-item>
  33. <el-input placeholder="会员信息" v-model="search_form.kwd"
  34. class="input-with-select">
  35. </el-input>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-select v-model="search_form.status" clearable placeholder="启用状态">
  39. <el-option
  40. v-for="(item,index) in status_arr"
  41. :key="index"
  42. :label="item.label"
  43. :value="item.value">
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button-group>
  49. <el-button type="primary" @click="changeForm()">搜索</el-button>
  50. <el-button type="" @click="showMemberModal()">添加</el-button>
  51. </el-button-group>
  52. </el-form-item>
  53. </el-form>
  54. </div>
  55. </div>
  56. <div class="vue-main">
  57. <div class="vue-main-form">
  58. <div class="vue-main-title" style="margin-top:-10px">
  59. <div class="title"><span
  60. style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>核销员管理</b>
  61. </div>
  62. </div>
  63. </div>
  64. <div style="margin-bottom:20px">
  65. <div style="margin-bottom:20px">
  66. </div>
  67. <el-table :data="list" style="width: 100%;" align="center" :fit="true">
  68. <el-table-column min-width="10%" prop="id" label="ID" align="center"></el-table-column>
  69. <el-table-column min-width="10%" prop="" label="会员" align="center">
  70. <template slot-scope="scope">
  71. <div class="block" v-if="scope.row.has_one_member">
  72. <el-link type="info" class="title"
  73. :href="memberDetail(scope.row.uid)"
  74. target="_blank">
  75. <el-avatar shape="circle" :size="40"
  76. :src="scope.row.has_one_member.avatar_image"></el-avatar>
  77. <br>
  78. ( [[scope.row.has_one_member.uid]] )[[scope.row.has_one_member.username]]
  79. </el-link>
  80. </div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column min-width="10%" prop="" label="状态" align="center">
  84. <template slot-scope="scope">
  85. <el-switch
  86. :active-value="1"
  87. :inactive-value="0"
  88. v-model="scope.row.status"
  89. active-color="#13ce66"
  90. inactive-color="#808080"
  91. @change="clerkStatus(scope.row)"
  92. >
  93. </el-switch>
  94. {{-- <el-button @click="storeOrder(scope.row)" type="" size="mini">门店订单</el-button>--}}
  95. {{-- <el-button @click="showBindModal(scope.row)" type="primary" size="mini">绑定商户</el-button>--}}
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </div>
  100. <div class="vue-page" v-if="total > 0">
  101. <el-row>
  102. <el-col align="right">
  103. <el-pagination layout="prev, pager, next,jumper" @current-change="getData" :total="total"
  104. :page-size="per_page" :current-page="current_page" background
  105. ></el-pagination>
  106. </el-col>
  107. </el-row>
  108. </div>
  109. <el-dialog :visible.sync="member_modal.show" width="800px" title="绑定商户">
  110. <div>
  111. <el-input v-model="member_modal.kwd" style="width:60%;" placeholder="会员信息"></el-input>
  112. <el-button @click="getMember">搜索</el-button>
  113. </div>
  114. <el-table :data="member_modal.list" index="uid" style="width: 100%;height:500px;overflow:auto"
  115. :fit="true">
  116. <el-table-column label="会员信息" min-width="50%">
  117. <template slot-scope="scope">
  118. <div style="display:flex;align-items: center;">
  119. <div v-if="scope.row.avatar_image" style="width:40px;">
  120. <el-image :src="scope.row.avatar_image" alt=""
  121. style="width:40px;height:40px;border-radius:50%"></el-image>
  122. </div>
  123. <div style="flex:1;">【id:[[scope.row.uid]]】[[scope.row.nickname]]</div>
  124. </div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="手机" prop="mobile" align="center" min-width="25%"></el-table-column>
  128. <el-table-column label="真实姓名" prop="realname" align="center" min-width="15%"
  129. ></el-table-column>
  130. <el-table-column label="操作" align="center" min-width="10%">
  131. <template slot-scope="scope">
  132. <el-button :disabled="scope.row.disabled" :loading="scope.row.submit_loading"
  133. @click="addClerk(scope.row)">
  134. 选择
  135. </el-button>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. <span slot="footer" class="dialog-footer">
  140. <el-button @click="member_modal.show = false">取 消</el-button>
  141. {{-- <el-button type="primary" :loading="member_modal.remindLoading"--}}
  142. {{-- @click="addClerk">确定 </el-button>--}}
  143. </span>
  144. </el-dialog>
  145. </div>
  146. <!-- 分页 -->
  147. </div>
  148. </div>
  149. <script>
  150. var app = new Vue({
  151. el: "#app",
  152. delimiters: ['[[', ']]'],
  153. name: 'test',
  154. data() {
  155. return {
  156. list: [],
  157. total: 1,
  158. per_page: 1,
  159. current_page: 1,
  160. member_modal: {
  161. list: [],
  162. show: false,
  163. kwd: '',
  164. remindLoading: false,
  165. },
  166. search_form: {
  167. 'status': '',
  168. 'kwd': '',
  169. },
  170. status_arr: [
  171. {value: '0', label: '关闭'},
  172. {value: '1', label: '启用'},
  173. ],
  174. search_data: {},
  175. }
  176. },
  177. created() {
  178. },
  179. mounted() {
  180. this.search();
  181. },
  182. methods: {
  183. getMember() {
  184. this.$http.post('{!! yzWebFullUrl('plugin.package-delivery.admin.clerk.getMember') !!}', {
  185. kwd: this.member_modal.kwd
  186. })
  187. .then(function (response) {
  188. if (response.data.result) {
  189. var list = response.data.data;
  190. this.member_modal.list = list.map(item => {
  191. item.submit_loading = false;
  192. item.disabled = false;
  193. return item
  194. })
  195. } else {
  196. this.$message({message: response.data.msg, type: 'error'});
  197. }
  198. this.search();
  199. }, function (response) {
  200. this.$message({message: response.data.msg, type: 'error'});
  201. })
  202. },
  203. showMemberModal() {
  204. this.member_modal.show = true;
  205. },
  206. addClerk(data) {
  207. data.submit_loading = true;
  208. this.$http.post('{!! yzWebFullUrl('plugin.package-delivery.admin.clerk.add') !!}', {
  209. uid: data.uid
  210. })
  211. .then(function (response) {
  212. data.submit_loading = false;
  213. if (response.data.result) {
  214. data.disabled = true;
  215. this.$message({message: '添加成功', type: 'success'});
  216. } else {
  217. this.$message({message: response.data.msg, type: 'error'});
  218. }
  219. this.search();
  220. }, function (response) {
  221. data.submit_loading = false;
  222. this.$message({message: response.data.msg, type: 'error'});
  223. })
  224. // this.member_modal.list[data.uid].submit_loading = true;
  225. // data.submit_loading = true;
  226. },
  227. memberDetail(id) {
  228. return "{!! yzWebFullUrl('member.member.detail') !!}" + '&id=' + id;
  229. },
  230. clerkStatus(data) {
  231. this.$http.post('{!! yzWebFullUrl('plugin.package-delivery.admin.clerk.status') !!}', {
  232. 'id': data.id, 'status': data.status,
  233. })
  234. .then(function (response) {
  235. if (response.data.result) {
  236. this.$message({message: response.data.msg, type: 'success'});
  237. } else {
  238. this.$message({
  239. message: response.data.msg,
  240. dangerouslyUseHTMLString: true,
  241. type: 'error'
  242. });
  243. }
  244. this.search();
  245. }, function (response) {
  246. this.$message({message: response.data.msg, type: 'error'});
  247. })
  248. },
  249. {{--bindManyStore: function () {--}}
  250. {{-- this.bind_many_store_button.remindLoading = true;--}}
  251. {{-- this.$http.post('{!! yzWebFullUrl('plugin.running-delivery.admin.store.bindManyStore') !!}', {})--}}
  252. {{-- .then(function (response) {--}}
  253. {{-- this.bind_many_store_button.remindLoading = false;--}}
  254. {{-- if (response.data.result) {--}}
  255. {{-- this.$message({message: response.data.msg, type: 'success'});--}}
  256. {{-- } else {--}}
  257. {{-- this.$message({--}}
  258. {{-- message: response.data.msg,--}}
  259. {{-- dangerouslyUseHTMLString: true,--}}
  260. {{-- type: 'error'--}}
  261. {{-- });--}}
  262. {{-- }--}}
  263. {{-- this.search();--}}
  264. {{-- }, function (response) {--}}
  265. {{-- this.bind_many_store_button.remindLoading = false;--}}
  266. {{-- this.$message({message: response.data.msg, type: 'error'});--}}
  267. {{-- })--}}
  268. {{--},--}}
  269. // showBindModal: function (scope) {
  270. // this.bind_modal.another_store_id = '';
  271. // console.log(scope.store_id);
  272. // this.bind_modal.store_id = scope.store_id;
  273. // this.bind_modal.bind_type = 1;
  274. // this.bind_modal.show = true;
  275. // },
  276. {{--bindRunningStore: function (scope) {--}}
  277. {{-- this.bind_modal.remindLoading = true;--}}
  278. {{-- this.$http.post('{!! yzWebFullUrl('plugin.running-delivery.admin.store.bindOneStore') !!}', {--}}
  279. {{-- 'another_store_id': this.bind_modal.another_store_id,--}}
  280. {{-- 'bind_type': this.bind_modal.bind_type,--}}
  281. {{-- 'store_id': this.bind_modal.store_id,--}}
  282. {{-- }).then(function (response) {--}}
  283. {{-- this.bind_modal.remindLoading = false;--}}
  284. {{-- if (response.data.result) {--}}
  285. {{-- this.$message({message: response.data.msg, type: 'success'});--}}
  286. {{-- this.bind_modal.show = false;--}}
  287. {{-- this.search();--}}
  288. {{-- } else {--}}
  289. {{-- this.$message({message: response.data.msg, type: 'error'});--}}
  290. {{-- }--}}
  291. {{-- }, function (response) {--}}
  292. {{-- this.bind_modal.remindLoading = false;--}}
  293. {{-- this.$message({message: response.data.msg, type: 'error'});--}}
  294. {{-- })--}}
  295. {{--},--}}
  296. {{--storeOrder: function (scope) {--}}
  297. {{-- window.open("{!! yzWebUrl('plugin.store-cashier.admin.store-order.store-list') !!}" + '&id=' + scope.store_id);--}}
  298. {{--},--}}
  299. search: function () {
  300. this.$http.post('{!! yzWebFullUrl('plugin.package-delivery.admin.clerk.index') !!}', {
  301. 'page': this.current_page,
  302. 'is_json': 1,
  303. 'search_data': this.search_data,
  304. }).then(function (response) {
  305. console.log(response);
  306. if (response.data.result) {
  307. let this_data = response.data.data.list;
  308. this.current_page = this_data.current_page;
  309. this.list = this_data.data;
  310. this.total = this_data.total;
  311. this.per_page = this_data.per_page;
  312. } else {
  313. this.$message({message: response.data.msg, type: 'error'});
  314. }
  315. }, function (response) {
  316. this.$message({message: response.data.msg, type: 'error'});
  317. })
  318. },
  319. getData: function (val) {
  320. this.current_page = val;
  321. this.search();
  322. },
  323. changeForm: function () {
  324. this.search_data.kwd = this.search_form.kwd;
  325. this.search_data.status = this.search_form.status;
  326. this.current_page = 1;
  327. this.search();
  328. }
  329. },
  330. })
  331. </script>
  332. @endsection