index.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-collection-code', __DIR__ . '/');
  4. ComponentHelper::loadComponentView('com-export-dialog-syn');
  5. ComponentHelper::loadComponentView('com-dialog-select-goods', __DIR__ . '/component');
  6. ?>
  7. <div id="app" v-cloak>
  8. <el-card v-loading="loading" style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;">
  9. <el-tabs v-model="activeName" @tab-click="handleClick">
  10. <el-tab-pane label="店铺收款码" name="collection-code">
  11. <?php ComponentHelper::loadComponentView('collection-code', __DIR__ . '/'); ?>
  12. </el-tab-pane>
  13. <el-tab-pane label="收款明细" name="collection-log">
  14. <?php ComponentHelper::loadComponentView('collection-log', __DIR__ . '/'); ?>
  15. </el-tab-pane>
  16. </el-tabs>
  17. </el-card>
  18. </div>
  19. <script>
  20. const app = new Vue({
  21. el: '#app',
  22. data() {
  23. return {
  24. activeName: 'collection-code',
  25. basicForm: {
  26. store_id: 0,
  27. cashier_url: '',
  28. },
  29. exportList: {},
  30. export_url: '/index.php?r=happiness/client/cash/cashier-log',
  31. basicFormRules: {},
  32. loading: false,
  33. listLoading: false,
  34. submitLoading: false,
  35. dialogFormVisible: false,
  36. store_bank_form: {},
  37. formLabelWidth: '120px',
  38. list: [],
  39. pageCount: 0,
  40. pagination: null,
  41. page: 1,
  42. searchData: {
  43. min: '',
  44. max: '',
  45. keyword: '',
  46. start: '',
  47. end: '',
  48. },
  49. datetime: '',
  50. dialogTableVisible_fenRun: false,
  51. activeNames: 'commission',
  52. user_level: {},
  53. dialogVisible: false,
  54. applet_url: '',
  55. get_can_set_give_goods_list: 'happiness/client/cash/search-goods-data',
  56. select_item: {},
  57. is_show_drawer: false,
  58. drawer_data: [],
  59. };
  60. },
  61. mounted: function () {
  62. this.loadData();
  63. },
  64. methods: {
  65. select(data){
  66. console.log('选择的订单');
  67. console.log(data);
  68. this.select_item = data;
  69. this.$refs.selectGoods.click();
  70. },
  71. goodsSelect(data) {
  72. console.log('选择的商品');
  73. console.log(data);
  74. if(data.length == 0)
  75. {
  76. this.$message.error('请选择商品');
  77. return;
  78. }
  79. request({
  80. params: {
  81. r: 'happiness/client/cash/confirm-goods',
  82. },
  83. method: 'post',
  84. data: {
  85. order_id: this.select_item.id,
  86. goods_list: data,
  87. }
  88. }).then(e => {
  89. this.loading = false;
  90. if (e.data.code === 0) {
  91. this.$message.success(e.data.msg);
  92. this.getCollectionLog();
  93. } else {
  94. this.$message.error(e.data.msg);
  95. }
  96. }).catch(e => {
  97. this.$message.error('网络错误');
  98. });
  99. },
  100. loadData() {
  101. let self = this;
  102. request({
  103. params: {
  104. r: 'happiness/client/cash/index',
  105. },
  106. }).then(e => {
  107. self.loading = false;
  108. if (e.data.code === 0) {
  109. self.basicForm.store_id = e.data.data.store_id;
  110. self.export_url = e.data.data.export_url;
  111. self.basicForm.cashier_url = e.data.data.cashier_url;
  112. } else {
  113. self.$message.error(e.data.msg);
  114. }
  115. }).catch(e => {
  116. self.$message.error('网络错误');
  117. });
  118. },
  119. submit() {
  120. request({
  121. params: {
  122. r: 'happiness/client/cash/index',
  123. },
  124. method: 'post',
  125. data: {
  126. form: this.basicForm
  127. }
  128. }).then(e => {
  129. this.loading = false;
  130. if (e.data.code === 0) {
  131. this.$message.success(e.data.msg);
  132. } else {
  133. this.$message.error(e.data.msg);
  134. }
  135. }).catch(e => {
  136. this.$message.error('网络错误');
  137. });
  138. },
  139. showPromotionCode(id, fun) {
  140. setTimeout(() => {
  141. fun();
  142. }, 300)
  143. },
  144. showMiniPromotionCode(type) {
  145. request({
  146. params: {
  147. r: 'happiness/client/cash/show-mini-promotion-code',
  148. },
  149. data: {
  150. type: type
  151. },
  152. method: 'post'
  153. }).then(e => {
  154. if (e.data.code == 0) {
  155. this.dialogVisible = true
  156. this.applet_url = e.data.data.applet_url;
  157. } else {
  158. this.$message.error('操作失败');
  159. }
  160. }).catch(e => {
  161. this.$message.error('网络错误');
  162. });
  163. },
  164. handleClick(tab, event) {
  165. if (tab.name == 'collection-log') {
  166. this.getCollectionLog();
  167. }
  168. },
  169. getCollectionLog() {
  170. request({
  171. params: {
  172. r: 'happiness/client/cash/cashier-log',
  173. page: this.page,
  174. withdraw_status: this.searchData.withdraw_status,
  175. start: this.searchData.start,
  176. end: this.searchData.end,
  177. min: this.searchData.min,
  178. max: this.searchData.max,
  179. keyword: this.searchData.keyword,
  180. },
  181. method: 'get',
  182. }).then(e => {
  183. this.loading = false;
  184. if (e.data.code === 0) {
  185. this.list = e.data.data.list;
  186. this.exportList = e.data.data.export_list;
  187. this.pagination = e.data.data.pagination;
  188. this.pageCount = e.data.data.page_count;
  189. } else {
  190. this.$message.error(e.data.msg);
  191. }
  192. }).catch(e => {
  193. this.$message.error('网络错误');
  194. });
  195. },
  196. handle(data = null) {
  197. let id = data ? parseInt(data.id) : '';
  198. this.dialogTableVisible_fenRun = true;
  199. this.orderId = id;
  200. this.getCapitalLog(id, this.activeNames)
  201. },
  202. pageChange(currentPage) {
  203. this.page = currentPage;
  204. this.getCollectionLog();
  205. },
  206. showDrawer(is_show, detail) {
  207. this.is_show_drawer = is_show
  208. this.drawer_data = detail
  209. },
  210. search() {
  211. this.page = 1;
  212. if (this.date == null) {
  213. this.date = ''
  214. }
  215. this.getCollectionLog();
  216. },
  217. changeTime(e) {
  218. this.searchData.start = e[0]
  219. this.searchData.end = e[1]
  220. },
  221. },
  222. computed: {}
  223. });
  224. </script>
  225. <style>
  226. .el-tabs__header {
  227. font-size: 16px;
  228. }
  229. .table-body {
  230. padding: 20px;
  231. background-color: #fff;
  232. }
  233. .table-body .el-button {
  234. padding: 0 !important;
  235. border: 0;
  236. margin: 0 5px;
  237. }
  238. .input-item {
  239. width: 250px;
  240. margin: 0 0 20px;
  241. display: inline-block;
  242. }
  243. /*.input-item .el-input__inner {*/
  244. /* border-right: 0;*/
  245. /*}*/
  246. .input-item .el-input__inner:hover {
  247. border: 1px solid #dcdfe6;
  248. /*border-right: 0;*/
  249. outline: 0;
  250. }
  251. .input-item .el-input__inner:focus {
  252. border: 1px solid #dcdfe6;
  253. /*border-right: 0;*/
  254. outline: 0;
  255. }
  256. .input-item .el-input-group__append {
  257. background-color: #fff;
  258. border-left: 0;
  259. width: 10%;
  260. padding: 0;
  261. }
  262. .input-item .el-input-group__append .el-button {
  263. padding: 0;
  264. }
  265. .input-item .el-input-group__append .el-button {
  266. margin: 0;
  267. }
  268. .batch {
  269. margin: 0 0 20px;
  270. display: inline-block;
  271. }
  272. .batch .el-button {
  273. padding: 9px 15px !important;
  274. }
  275. .el-table th > .cell {
  276. color: #333;
  277. font-weight: bold;
  278. font-size: 14px;
  279. }
  280. .el-table__footer-wrapper, .el-table__header-wrapper {
  281. border-bottom: 1.4px solid #D6D6D6;
  282. }
  283. .el-table th > .cell {
  284. color: #333;
  285. font-weight: bold;
  286. font-size: 14px;
  287. }
  288. .table1 .el-table__footer-wrapper,
  289. .table1 .el-table__header-wrapper {
  290. border-bottom: 1.4px solid #D6D6D6;
  291. }
  292. .user_img {
  293. position: relative;
  294. margin-right: 8px;
  295. /* height: 50px;
  296. width: 50px; */
  297. }
  298. .default-avatar {
  299. width: 50px;
  300. height: 50px;
  301. border-radius: 50%;
  302. margin-right: 8px;
  303. }
  304. .uer-nickname {
  305. flex: 1;
  306. }
  307. .value_input .el-form-item__content {
  308. display: flex;
  309. }
  310. .value_input .el-input-group input {
  311. width: 58px;
  312. border-right: 0;
  313. }
  314. .value_input .el-input-group {
  315. display: flex;
  316. width: 100px;
  317. }
  318. .value_input .el-input-group__append {
  319. display: flex;
  320. align-items: center;
  321. justify-content: center;
  322. background: #FFF;
  323. }
  324. </style>