index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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-export-dialog');
  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. scan_code_bind:0,
  28. cashier_url:'',
  29. score_give_setting:{
  30. type:0,
  31. coupon_id:'',
  32. score_give:{
  33. give_type:1,
  34. give_num:0,
  35. },
  36. },
  37. preferential_deduction:0,
  38. preferential_gift:0,
  39. score_deduct_setting:{
  40. type:0,
  41. coupon_id:'',
  42. score_deduct:{
  43. deduct_type:1,
  44. deduct_num:0,
  45. },
  46. },
  47. },
  48. exportList:{},
  49. export_url: '/index.php?r=store/client/cash/cashier-log',
  50. basicFormRules:{},
  51. loading:false,
  52. listLoading:false,
  53. submitLoading:false,
  54. dialogFormVisible:false,
  55. store_bank_form:{},
  56. formLabelWidth: '120px',
  57. list:[],
  58. pageCount: 0,
  59. pagination: null,
  60. page:1,
  61. searchData: {
  62. min: '',
  63. max: '',
  64. keyword: '',
  65. start: '',
  66. end: '',
  67. },
  68. datetime:'',
  69. dialogTableVisible_fenRun: false,
  70. activeNames: 'commission',
  71. fenRunData: [],
  72. coupon_list: [],
  73. user_level: {},
  74. preferential_deduction: 0,
  75. preferential_gift: 0,
  76. dialogVisible: false,
  77. applet_url:'',
  78. is_preferential_gift:0,
  79. };
  80. },
  81. mounted: function() {
  82. this.loadData();
  83. this.getCouponList();
  84. },
  85. methods: {
  86. loadData() {
  87. let self = this;
  88. request({
  89. params: {
  90. r: 'store/client/cash/index',
  91. },
  92. }).then(e => {
  93. self.loading = false;
  94. if (e.data.code === 0) {
  95. self.basicForm.store_id = e.data.data.store_id;
  96. self.basicForm.scan_code_bind = e.data.data.scan_code_bind;
  97. self.basicForm.preferential_deduction = e.data.data.preferential_deduction;
  98. self.basicForm.preferential_gift = e.data.data.preferential_gift;
  99. self.export_url = e.data.data.export_url;
  100. self.basicForm.cashier_url = e.data.data.cashier_url;
  101. self.is_preferential_gift = e.data.data.is_preferential_gift;
  102. if(e.data.data.score_give_setting) self.basicForm.score_give_setting = e.data.data.score_give_setting;
  103. if(e.data.data.score_deduct_setting) self.basicForm.score_deduct_setting = e.data.data.score_deduct_setting;
  104. } else {
  105. self.$message.error(e.data.msg);
  106. }
  107. }).catch(e => {
  108. self.$message.error('网络错误');
  109. });
  110. },
  111. submit(){
  112. request({
  113. params: {
  114. r: 'store/client/cash/index',
  115. },
  116. method: 'post',
  117. data: {
  118. form: this.basicForm
  119. }
  120. }).then(e => {
  121. this.loading = false;
  122. if (e.data.code === 0) {
  123. this.$message.success(e.data.msg);
  124. } else {
  125. this.$message.error(e.data.msg);
  126. }
  127. }).catch(e => {
  128. this.$message.error('网络错误');
  129. });
  130. },
  131. showPromotionCode(id, fun) {
  132. setTimeout(() => {
  133. fun();
  134. }, 300)
  135. },
  136. showMiniPromotionCode(type){
  137. request({
  138. params: {
  139. r: 'store/client/cash/show-mini-promotion-code',
  140. },
  141. data: {
  142. type:type
  143. },
  144. method: 'post'
  145. }).then(e => {
  146. if (e.data.code == 0) {
  147. this.dialogVisible = true
  148. this.applet_url = e.data.data.applet_url;
  149. } else {
  150. this.$message.error('操作失败');
  151. }
  152. }).catch(e => {
  153. this.$message.error('网络错误');
  154. });
  155. },
  156. handleClick(tab, event){
  157. if(tab.name=='collection-log'){
  158. this.getCollectionLog();
  159. }
  160. },
  161. getCollectionLog(){
  162. request({
  163. params: {
  164. r: 'store/client/cash/cashier-log',
  165. page: this.page,
  166. withdraw_status: this.searchData.withdraw_status,
  167. start: this.searchData.start,
  168. end: this.searchData.end,
  169. min: this.searchData.min,
  170. max: this.searchData.max,
  171. keyword: this.searchData.keyword,
  172. },
  173. method: 'get',
  174. }).then(e => {
  175. this.loading = false;
  176. if (e.data.code === 0) {
  177. this.list = e.data.data.list;
  178. this.exportList = e.data.data.export_list;
  179. this.pagination = e.data.data.pagination;
  180. this.pageCount = e.data.data.page_count;
  181. } else {
  182. this.$message.error(e.data.msg);
  183. }
  184. }).catch(e => {
  185. this.$message.error('网络错误');
  186. });
  187. },
  188. handle(data = null) {
  189. let id = data ? parseInt(data.id) : '';
  190. this.dialogTableVisible_fenRun = true;
  191. this.orderId = id;
  192. this.getCapitalLog(id, this.activeNames)
  193. },
  194. commissionHandleClick(tab, event) {
  195. console.log(this.activeNames);
  196. console.log(tab);
  197. console.log(event);
  198. this.getCapitalLog(this.orderId, this.activeNames)
  199. },
  200. getCapitalLog(orderId, wallet_type) {
  201. request({
  202. params: {
  203. r: 'store/client/cash/commission-and-score-list',
  204. order_id: orderId,
  205. wallet_type: wallet_type,
  206. },
  207. method: 'get',
  208. }).then(e => {
  209. if (e.data.code == 0) {
  210. this.fenRunData = e.data.data.list;
  211. this.user_level = e.data.data.user_level;
  212. } else {
  213. self.$message.error(e.data.msg);
  214. }
  215. }).catch(e => {
  216. console.log(e);
  217. });
  218. },
  219. getCouponList(type=null) {
  220. request({
  221. params: {
  222. r: 'store/client/cash/get-coupon-list',
  223. type: type,
  224. },
  225. method: 'get',
  226. }).then(e => {
  227. if (e.data.code == 0) {
  228. this.coupon_list = e.data.data.coupon_list;
  229. } else {
  230. self.$message.error(e.data.msg);
  231. }
  232. }).catch(e => {
  233. console.log(e);
  234. });
  235. },
  236. handleChange(){},
  237. deductTypeChange(arg){
  238. this.basicForm.score_deduct_setting.coupon_id = '';
  239. this.getCouponList(arg);
  240. },
  241. giveTypeChange(arg){
  242. this.basicForm.score_give_setting.coupon_id = '';
  243. this.getCouponList(arg);
  244. },
  245. handleCurrentChange(val) {
  246. this.basicForm.select_bank = val;
  247. },
  248. pageChange(currentPage) {
  249. this.page = currentPage;
  250. this.getCollectionLog();
  251. },
  252. search() {
  253. this.page = 1;
  254. if (this.date == null) {
  255. this.date = ''
  256. }
  257. this.getCollectionLog();
  258. },
  259. changeTime(e) {
  260. this.searchData.start = e[0]
  261. this.searchData.end = e[1]
  262. },
  263. },
  264. computed: {
  265. }
  266. });
  267. </script>
  268. <style>
  269. .el-tabs__header {
  270. font-size: 16px;
  271. }
  272. .table-body {
  273. padding: 20px;
  274. background-color: #fff;
  275. }
  276. .table-body .el-button {
  277. padding: 0 !important;
  278. border: 0;
  279. margin: 0 5px;
  280. }
  281. .input-item {
  282. width: 250px;
  283. margin: 0 0 20px;
  284. display: inline-block;
  285. }
  286. /*.input-item .el-input__inner {*/
  287. /* border-right: 0;*/
  288. /*}*/
  289. .input-item .el-input__inner:hover {
  290. border: 1px solid #dcdfe6;
  291. /*border-right: 0;*/
  292. outline: 0;
  293. }
  294. .input-item .el-input__inner:focus {
  295. border: 1px solid #dcdfe6;
  296. /*border-right: 0;*/
  297. outline: 0;
  298. }
  299. .input-item .el-input-group__append {
  300. background-color: #fff;
  301. border-left: 0;
  302. width: 10%;
  303. padding: 0;
  304. }
  305. .input-item .el-input-group__append .el-button {
  306. padding: 0;
  307. }
  308. .input-item .el-input-group__append .el-button {
  309. margin: 0;
  310. }
  311. .batch {
  312. margin: 0 0 20px;
  313. display: inline-block;
  314. }
  315. .batch .el-button {
  316. padding: 9px 15px !important;
  317. }
  318. .el-table th>.cell{
  319. color: #333;
  320. font-weight: bold;
  321. font-size: 14px;
  322. }
  323. .el-table__footer-wrapper, .el-table__header-wrapper{
  324. border-bottom: 1.4px solid #D6D6D6;
  325. }
  326. .el-table th>.cell {
  327. color: #333;
  328. font-weight: bold;
  329. font-size: 14px;
  330. }
  331. .table1 .el-table__footer-wrapper,
  332. .table1 .el-table__header-wrapper {
  333. border-bottom: 1.4px solid #D6D6D6;
  334. }
  335. .user_img{
  336. position: relative;
  337. margin-right: 8px;
  338. /* height: 50px;
  339. width: 50px; */
  340. }
  341. .default-avatar{
  342. width: 50px;
  343. height: 50px;
  344. border-radius: 50%;
  345. margin-right: 8px;
  346. }
  347. .uer-nickname {
  348. flex: 1;
  349. }
  350. .value_input .el-form-item__content{
  351. display: flex;
  352. }
  353. .value_input .el-input-group input{
  354. width: 58px;
  355. border-right: 0;
  356. }
  357. .value_input .el-input-group{
  358. display: flex;
  359. width: 100px;
  360. }
  361. .value_input .el-input-group__append{
  362. display: flex;
  363. align-items: center;
  364. justify-content: center;
  365. background: #FFF;
  366. }
  367. </style>