605 Commits

Author SHA1 Message Date
qianhy ac8d23bebc cost import 2023-01-18 11:42:35 +08:00
qianhy 6c4473c13d orderve orders export add srv 2023-01-16 16:18:30 +08:00
qianhy b5a7c2fd19 orderv2 orders detail display 2023-01-16 13:39:09 +08:00
qianhy 37b7f13d78 orderv2 orders export split of_title 2023-01-16 10:57:40 +08:00
qianhy 65dbf502cc orderv2 orders export 2023-01-13 17:19:23 +08:00
dengbw a51140c766 admin_stock_113_2 2023-01-13 16:40:12 +08:00
dengbw 707b918889 admin_stock_113 2023-01-13 14:53:52 +08:00
qianhy 775bb75180 cost display modify 2023-01-13 09:59:41 +08:00
qianhy 528b0e165e cost add biz_type in (2,3) spyw 2023-01-12 15:17:51 +08:00
dengbw 4c23e18b20 admin_stock_112 2023-01-12 14:36:25 +08:00
qianhy 36f42a33e8 cost query add biz_type 2023-01-11 17:35:30 +08:00
qianhy 4859f39d32 cost add quert,export excel,detail modify 2023-01-11 16:53:25 +08:00
dengbw 65c54deb86 market_statistics_111 2023-01-11 16:20:30 +08:00
dengbw 1e2ca4c0c3 liche_user_110 2023-01-10 14:48:17 +08:00
qianhy f2c5d12f87 cost detail fixbug: business_id 2023-01-10 11:25:31 +08:00
qianhy 81bff0f50e cost detail biaodian use cn 2023-01-10 10:59:41 +08:00
qianhy fb488701cf cost detail spyw can modify all 2023-01-10 10:38:40 +08:00
qianhy 3ffc35343a cost order plan add: status_pid=4 and status=1 2023-01-10 09:27:35 +08:00
qianhy 84d535a763 cost detail if_pay use checkbox operation 2023-01-09 17:15:46 +08:00
qianhy 095349fdf9 cost plan, add filter item_id > 0 2023-01-09 16:18:49 +08:00
lccsw bf233ef568 edit-admin-cost 2023-01-09 15:04:08 +08:00
lccsw e0df382080 edit-admin-const 2023-01-09 15:04:03 +08:00
dengbw c3fb975ead admin_store_109 2023-01-09 15:01:39 +08:00
qianhy 39a7b373dc orders aggs_biz_ding_piao_rpt, add export excel2 2023-01-09 14:43:29 +08:00
dengbw 9e0d0bfbdf market_groupswin_109_2 2023-01-09 10:42:38 +08:00
lccsw 71ae42ae1c edit-plan-cost 2023-01-09 10:25:36 +08:00
dengbw 0580ab059e market_groupswin_109 2023-01-09 10:10:04 +08:00
dengbw 73172f2bb1 market_live_105 2023-01-05 17:02:24 +08:00
lccsw ce2b0c1bf4 add-item-cost.sql 2023-01-03 14:32:56 +08:00
qianhy 0de1c4519f orders aggs_biz_ding_piao_rpt, fixbug no data to image 2023-01-01 23:40:51 +08:00
lccsw de91a9d520 edit-admin-cost 2022-12-26 17:07:48 +08:00
lccsw e7b401f210 edit-sylive-line_time 2022-12-23 17:47:47 +08:00
lccsw e8cf6ee246 edit-licheb-car_pdf 2022-12-23 17:47:38 +08:00
lccsw 7efc7134e3 edit-licheb-money_limit2 2022-12-23 17:47:25 +08:00
dengbw 4ea0f740b1 market_institution_1223 2022-12-23 14:18:28 +08:00
lccsw 068b7399c2 edit-licheb-money_limit 2022-12-23 14:12:28 +08:00
lccsw 29a3f89b41 edit-sylive-time 2022-12-23 11:11:08 +08:00
lccsw d98db6c872 edit-sylive-majia 2022-12-23 10:57:11 +08:00
lccsw f873b17c84 add-admin-cost 2022-12-23 10:40:49 +08:00
老叶 54b6685b40 图表修改 2022-12-23 10:39:49 +08:00
老叶 3fd4172e2a 修改图表-根据数组长度判断图表宽度 2022-12-23 10:26:01 +08:00
dengbw b97e317e3d market_statistics_1222 2022-12-22 14:10:39 +08:00
lccsw 24f96333ad edit-liche-money_limit 2022-12-22 09:29:04 +08:00
qianhy 63489aeb08 customer add export, orders adjust_fee fixbug 2022-12-22 09:22:50 +08:00
qianhy 79db0134be transfer status=2 can edit fees and transport 2022-12-21 10:49:44 +08:00
dengbw b8d47f9e4d market_groups_1220_2 2022-12-20 17:51:24 +08:00
dengbw 3651e82958 market_groups_1220 2022-12-20 17:33:47 +08:00
qianhy d201eb2132 order edit_price or edit_srv add order_status_check_after_adjust_fee 2022-12-20 15:23:11 +08:00
lccsw 98ccf9a0f3 add-plan-up_view_log 2022-12-20 14:53:06 +08:00
qianhy f2ca56e3e4 orders aggs_biz_ding_piao_rpt, ding search all 2022-12-20 14:52:20 +08:00
qianhy 65436186a6 orders aggs_biz_ding_piao_rpt, fixbug key_ding key_piao 2022-12-19 15:30:31 +08:00
dengbw 4d14ffd53c market_groups_1219 2022-12-19 15:21:17 +08:00
dengbw 089588d819 market_draw_1219 2022-12-19 10:30:47 +08:00
lccsw e5b692963d edit-sylive-plan 2022-12-19 09:43:39 +08:00
qianhy 3dd06352b8 orders aggs_biz_ding_piao_rpt, plan online 2022-12-19 00:20:09 +08:00
qianhy ca0eb36153 orders aggs_biz_ding_piao_rpt, plan fixbug lte 23.10 2022-12-16 23:55:34 +08:00
dengbw fb58935867 market_draw_1216_4 2022-12-16 17:37:27 +08:00
dengbw a8ff536406 market_draw_1216_3 2022-12-16 16:39:02 +08:00
dengbw 166c04d4a6 market_draw_1216_2 2022-12-16 16:31:12 +08:00
dengbw 52e1380293 market_draw_1216 2022-12-16 16:23:11 +08:00
lccsw 4c45bfd64d edit-sylive-kpi_order 2022-12-16 15:07:27 +08:00
lccsw 2d42f8dc38 edit-sylive-html 2022-12-16 13:48:52 +08:00
lccsw 1f583d1967 edit-sylive-group_list 2022-12-16 10:43:47 +08:00
qianhy 113a7d1864 orders aggs_biz_ding_piao_rpt, plan add redis control 2022-12-16 10:00:39 +08:00
lccsw 849895052f edit-sylive-item_user_info 2022-12-15 17:29:10 +08:00
dengbw 0dd8779612 market_draw_1215 2022-12-15 15:35:30 +08:00
lccsw 62bd5338ac edit-sylive-item_id 2022-12-15 11:55:39 +08:00
lccsw 3e1160ae0a edit-sylive-temp_kpi 2022-12-15 10:29:11 +08:00
dengbw 1d85744d64 market_groups_1215_2 2022-12-15 10:25:34 +08:00
dengbw 067bb9642f market_groups_1215 2022-12-15 09:53:06 +08:00
qianhy 66e2116a7a orders aggs_biz_ding_piao_rpt, city_name ext qudao_name 2022-12-15 09:44:12 +08:00
lccsw d6b95754e7 edit-sylive-live_limit 2022-12-14 18:00:13 +08:00
老叶 22075e5ea4 Revert "Merge branch 'dev' of http://git.haodian.cn:8081/lcc/liche into dev"
This reverts commit 2e83df471bcb35ac1aa9688201375e1fcf219e09, reversing
changes made to 41f84e04990376ab19e6fea2b26892e335f6466a.
2022-12-14 17:46:02 +08:00
lccsw 8b0665bbe0 edit-sylive-item_id 2022-12-14 17:46:02 +08:00
老叶 6cd55a0e21 图表样式 2022-12-14 17:45:58 +08:00
lccsw 8aa8bae804 add-sylive-item_limit 2022-12-14 17:05:50 +08:00
老叶 04b9b0a79a 顾问管理样式修改 2022-12-14 16:21:26 +08:00
qianhy 6f19305883 orderv2 list add date quick select 2022-12-14 15:59:07 +08:00
qianhy 47adbfe625 orders aggs_biz_ding_piao_rpt, modify font plantime 2022-12-14 15:35:49 +08:00
qianhy c3d64ae769 orders aggs_biz_ding_piao_rpt, del null column line 2022-12-14 10:58:22 +08:00
qianhy 09f3fe812b add orders aggs_biz_ding_piao_rpt about 2022-12-13 16:56:17 +08:00
lccsw 77d4bce21b edit-sylive-item_limit 2022-12-13 14:38:53 +08:00
qianhy 804bef8edd bsrv df_lists add 350300 2022-12-13 13:51:27 +08:00
lccsw 4282e37d74 edit-sylive-html 2022-12-13 10:15:53 +08:00
lccsw ce66514b08 edit-sylive-hidden_share 2022-12-12 17:58:16 +08:00
dengbw bbf379fb44 market_groups_1212 2022-12-12 17:30:11 +08:00
lccsw 66d905f8b9 edit-sylive-static 2022-12-12 16:18:11 +08:00
qianhy 545f1f2e73 ordersv2list add owner_cradid 2022-12-12 12:19:51 +08:00
lccsw 1e0570443f edit-sylive-hidden_wxshare 2022-12-12 09:41:58 +08:00
lccsw a40c58be11 edit-sylive-kpidata 2022-12-11 20:30:24 +08:00
dengbw 0bf3c31cbc market_groups_1211 2022-12-11 17:49:06 +08:00
lccsw 2e3ba09cbc edit-sylive-rank 2022-12-11 09:13:27 +08:00
dengbw 2b409860ce market_groups_1210_5
market_groups_1210_6

market_groups_1210_8
2022-12-11 09:13:24 +08:00
dengbw 8aadd39e79 market_groups_1210_4 2022-12-10 23:50:16 +08:00
dengbw 964bf7f26b market_groups_1210_3 2022-12-10 23:26:26 +08:00
dengbw d010bd864f market_groups_1210_2 2022-12-10 22:57:58 +08:00
dengbw 0205ee703e market_groups_1210 2022-12-10 15:45:42 +08:00
lccsw ab3d76486b edit-sylive-act 2022-12-09 17:48:20 +08:00
dengbw eb2058633d market_groups_1209_4 2022-12-09 17:39:29 +08:00
lccsw 483134edf9 edit-sylive-biz 2022-12-09 17:21:51 +08:00
dengbw c397ed6efd market_groups_1209_3 2022-12-09 14:12:02 +08:00
lccsw e4712f0f79 edit-sylive-org_select 2022-12-09 14:11:24 +08:00
dengbw 97dda9fc2e market_groups_1209_2 2022-12-09 13:58:58 +08:00
dengbw 0cdb594cb2 market_groups_1209 2022-12-09 13:46:59 +08:00
dengbw c0d46339ee market_groups_1208 2022-12-08 16:13:55 +08:00
lccsw 85bbbd6499 edit-sylive-2 2022-12-08 16:13:12 +08:00
lccsw da4ceecbd1 add-sylive-2 2022-12-08 16:02:30 +08:00
dengbw da9cf1c300 market_groups_1125 2022-12-07 17:36:12 +08:00
qianhy 09fde723a1 edit_bill_img img mode overide bill_ck_img 2022-12-07 10:54:36 +08:00
qianhy 66b75790db credit del ex-3.jpg 2022-12-01 17:28:09 +08:00
qianhy 5aa03aeea3 fixbug orders.notify_file_list, owners.biz_id, owners.admin_id 2022-12-01 16:42:07 +08:00
lccsw 4e8213a4db edit-sylive-order_kpi 2022-11-28 17:07:20 +08:00
lccsw 3812ca8ef0 edit-liche-show_btn 2022-11-28 17:06:24 +08:00
lccsw f04612598e edit-sylive-item_limit 2022-11-26 16:06:39 +08:00
lccsw 9e8ffc83ae edit-sylive-user 2022-11-26 14:31:47 +08:00
dengbw ec0097397d market_draw_1125 2022-11-25 17:56:47 +08:00
dengbw c078c7381a market_draw_1124 2022-11-24 16:50:01 +08:00
dengbw f907c6d1a9 market_user_1124 2022-11-24 09:51:16 +08:00
dengbw 4f392cb38d market_statistics_1123_3 2022-11-23 16:42:37 +08:00
dengbw 9c8b0a7e57 market_statistics_1123_2 2022-11-23 13:40:40 +08:00
dengbw 93ba721d6a market_statistics_1123 2022-11-23 09:55:17 +08:00
lccsw ba7d2103de edit-api-post_cus2 2022-11-22 17:46:17 +08:00
lccsw 2243de4922 edit-api-post_cus 2022-11-22 16:47:17 +08:00
lccsw fa46f794b0 edit-sylive-team_logo 2022-11-22 15:43:29 +08:00
lccsw 14f4f075c1 edit-admin-loan_img 2022-11-22 15:22:16 +08:00
dengbw 86ea9a3586 market_statistics_1122 2022-11-22 15:15:26 +08:00
lccsw 11c226ce88 edit-sylive-auth 2022-11-22 10:21:42 +08:00
lccsw 25bec471b4 edit-sylive-pay 2022-11-21 17:57:09 +08:00
dengbw c143031c98 market_activity_1121_3 2022-11-21 17:51:46 +08:00
lccsw a4d820107a edit-sylive-item_pay 2022-11-21 17:38:47 +08:00
dengbw e401352839 market_activity_1121_2 2022-11-21 17:07:20 +08:00
lccsw f95a884227 edit-liche-srv_info2 2022-11-21 16:26:21 +08:00
lccsw 89aa47f583 edit-sylive-hidden_con 2022-11-21 12:21:28 +08:00
lccsw 1154141c79 edit-liche-srv_info 2022-11-21 11:41:49 +08:00
dengbw 0b019660a4 market_activity_1121 2022-11-21 11:33:49 +08:00
lccsw 71a48ad040 edit-sylive-headimg 2022-11-20 19:30:44 +08:00
lccsw a316b55fbe edit-sylive-banner 2022-11-20 19:15:27 +08:00
dengbw a04518df3a market_1120_2 2022-11-20 18:47:13 +08:00
dengbw e89610c5bc market_1120 2022-11-20 18:28:22 +08:00
dengbw 2347125590 market_activity_1118 2022-11-18 22:53:14 +08:00
lccsw 3d98a62723 edit-sylive-logo 2022-11-18 17:25:08 +08:00
dengbw 62920f9f14 market_statistics_1118_2 2022-11-18 16:06:58 +08:00
lccsw 8aedcbf5d1 edit-plan-sylive_itemId 2022-11-18 15:54:49 +08:00
dengbw 8b8cdbbcfb market_statistics_1118 2022-11-18 15:15:38 +08:00
dengbw 962091996e market_statistics_1117_2 2022-11-17 17:14:50 +08:00
dengbw a16b19535a market_statistics_1117 2022-11-17 16:15:45 +08:00
lccsw ad19050604 edit-admin-order_list 2022-11-17 10:13:17 +08:00
lccsw 62e8b79218 edit-licheb-loan 2022-11-16 09:23:49 +08:00
dengbw cbbbb52c24 persona_1114 2022-11-14 17:17:23 +08:00
dengbw c653b48e4d bizLog_1114 2022-11-14 15:11:05 +08:00
lccsw b0a28b3d6b edit-plan-subscribemsg 2022-11-11 21:51:32 +08:00
dengbw 9ee601a805 market_order_1111_4 2022-11-11 20:34:32 +08:00
dengbw 31da1299b3 market_order_1111_3 2022-11-11 19:28:43 +08:00
lccsw 5000396893 add-sylive-plan 2022-11-11 18:17:45 +08:00
dengbw da6df4e67f market_order_1111_2 2022-11-11 17:48:51 +08:00
lccsw d2c0f24ccc fix-sylive-add-order 2022-11-11 17:09:36 +08:00
lccsw 3d0fab681d edit-sylive-plan 2022-11-11 17:08:25 +08:00
dengbw 505913f426 market_order_1111 2022-11-11 17:07:56 +08:00
dengbw 7f94e5cc89 market_draw_1111_2 2022-11-11 17:07:56 +08:00
dengbw cbead42b24 market_draw_1111 2022-11-11 17:07:56 +08:00
lccsw 1e2148c3ea fix api bug 2022-11-11 17:07:56 +08:00
dengbw 020690af54 market_draw_1110_3 2022-11-10 20:42:19 +08:00
lccsw 5a19da4c0d edit-sylive-notify 2022-11-10 20:06:22 +08:00
dengbw 5c6cb22989 market_draw_1110_2 2022-11-10 19:45:38 +08:00
lccsw a24500c883 edit-sylive-add_kpi 2022-11-10 19:28:18 +08:00
dengbw 0fbe65971e market_draw_1110 2022-11-10 16:59:43 +08:00
lccsw 225addec15 edit-sylive-item_detail 2022-11-10 16:59:07 +08:00
lccsw 53bd59d797 edit-plan-syt 2022-11-10 16:33:11 +08:00
lccsw 3f865f1fbf edit-sylive-item2 2022-11-10 09:08:33 +08:00
lccsw ea72ce7256 edit-sylive-item 2022-11-09 18:54:33 +08:00
dengbw 77927e93e1 market_activity_1109 2022-11-09 18:49:34 +08:00
lccsw 7a26c158c0 add-sylive-item 2022-11-09 16:47:51 +08:00
dengbw 35a3e718ac market_code_1109 2022-11-09 11:03:06 +08:00
dengbw cff48f852e market_goods_1109 2022-11-09 09:41:08 +08:00
dengbw 3a634e99d7 market_goods_1108 2022-11-08 19:28:22 +08:00
lccsw ca287f8ec8 edit-sylive-team 2022-11-08 18:08:38 +08:00
lccsw 5a25c48bdb edit-sylive-area 2022-11-08 10:48:37 +08:00
lccsw 344f7dc190 edit-sylive-rank_index 2022-11-08 10:02:33 +08:00
dengbw 6fbcc68f92 market_statistics_1107_2 2022-11-07 23:06:45 +08:00
lccsw 512e1525f9 add-sylive-team_rank 2022-11-07 17:55:19 +08:00
dengbw 759d842801 market_statistics_1107 2022-11-07 17:49:14 +08:00
lccsw cd342ae48c edit-sylive-rank_text 2022-11-07 12:35:14 +08:00
lccsw c6a2f8b4ec edit-sylive-area_rank 2022-11-07 09:42:30 +08:00
dengbw b9aab9d9af market_statistics_1106 2022-11-06 19:09:26 +08:00
lccsw 21b9b27787 edit-sylive-rank 2022-11-05 11:45:29 +08:00
dengbw f901ce5dbd market_statistics_1104_3 2022-11-04 16:56:23 +08:00
lccsw 260bb7d36f edit-sylive-area_rank 2022-11-04 16:49:26 +08:00
dengbw e69db7d48c h5_team_1104 2022-11-04 15:57:40 +08:00
lccsw 8d4762836e edit-sylive-rank 2022-11-04 15:13:58 +08:00
lccsw d7fb62cb69 edit-sylive-plan 2022-11-04 10:35:25 +08:00
lccsw 6e6970ef97 edit-sylive-plan 2022-11-04 10:28:18 +08:00
dengbw f4c2ab9939 market_statistics_1104_2 2022-11-04 10:23:52 +08:00
dengbw 04a4eae82f market_statistics_1104 2022-11-04 10:13:05 +08:00
lccsw f3ae9b45f9 edit-sylive-rank 2022-11-03 19:42:45 +08:00
dengbw 857b64e522 h5_market_user_1103_2 2022-11-03 18:58:54 +08:00
dengbw 36a2daabdb h5_market_user_1103 2022-11-03 15:51:18 +08:00
dengbw 5ca24bf88d edit-sql_fields_2 2022-11-02 17:28:41 +08:00
lccsw 80e6889256 edit-sql-fields 2022-11-02 15:46:45 +08:00
dengbw 033db943c5 viewer_1102 2022-11-02 14:08:30 +08:00
lccsw dd09a47f75 add-api-liche_img_type 2022-11-01 13:58:40 +08:00
dengbw e1dab648db Transfer_1101 2022-11-01 10:57:50 +08:00
lccsw 9aace089a9 edit-admin-add_paylog2 2022-10-31 17:57:18 +08:00
dengbw a4cef41ae2 market_statistics_1031_2 2022-10-31 17:49:50 +08:00
dengbw a54f57f6af market_statistics_1031 2022-10-31 16:37:41 +08:00
lccsw 06c0f071e3 edit-admin-add_paylog 2022-10-31 15:31:43 +08:00
lccsw 44a8767c46 edit-plan-sylive_vlog 2022-10-31 11:32:28 +08:00
dengbw b990d3af0f statistics_1030_2 2022-10-30 09:20:23 +08:00
dengbw cfa22ad792 statistics_1030 2022-10-30 01:01:48 +08:00
dengbw af14d7b7c2 market_statistics_1029_7 2022-10-29 18:11:13 +08:00
lccsw c1858fceca edit-sylive-kpidata 2022-10-29 16:41:47 +08:00
dengbw d03f8268e9 market_statistics_1029_6 2022-10-29 16:41:15 +08:00
dengbw b7983daa57 market_statistics_1029_5 2022-10-29 16:34:13 +08:00
dengbw 7658b253af market_statistics_1029_4 2022-10-29 16:19:42 +08:00
dengbw 8b2010012b market_statistics_1029_3 2022-10-29 15:59:45 +08:00
dengbw df59a7eb9a market_statistics_1029_2 2022-10-29 15:24:15 +08:00
dengbw 4278f811f5 market_statistics_1029 2022-10-29 14:22:41 +08:00
lccsw 412798a32e edit-sylive-under_order 2022-10-29 13:26:25 +08:00
dengbw ecbc256558 market_statistics_1028_3 2022-10-28 17:05:45 +08:00
dengbw e4fea001d4 market_statistics_1028_2 2022-10-28 16:54:44 +08:00
lccsw 111408d5b8 add-sylive-stic_title 2022-10-28 14:43:56 +08:00
dengbw 09c3e67674 market_statistics_1028 2022-10-28 14:01:52 +08:00
lccsw 9c65a70991 edit-sylive-stic_biz 2022-10-27 17:25:22 +08:00
dengbw 6bd260f904 market_statistics_1027 2022-10-27 17:17:10 +08:00
lccsw da45e3a48c edit-sylive-static_hidden_view 2022-10-27 11:31:41 +08:00
lccsw aa0a9050b6 edit-sylive-static 2022-10-26 17:07:24 +08:00
dengbw 0c0e4560ac market_team_1026 2022-10-26 15:28:37 +08:00
lccsw 3166695a61 edit-sylive-share_nickname 2022-10-26 11:58:27 +08:00
lccsw 567c77cff7 edit-sylive-html 2022-10-26 11:22:33 +08:00
lccsw 55ae54cad4 edit-sylive-team 2022-10-25 17:37:38 +08:00
dengbw 61a7186653 market_team_1025_3 2022-10-25 17:35:30 +08:00
lccsw c5cee4aa65 add-sylive-team 2022-10-25 16:21:12 +08:00
dengbw 8b29965bf4 market_team_1025_2 2022-10-25 16:09:21 +08:00
dengbw 2f1ebbbec1 market_team_1025 2022-10-25 14:31:02 +08:00
lccsw ddc3b5e390 edit-sylive-html_script 2022-10-25 09:54:58 +08:00
lccsw 7374a2cb21 edit-sylive-static 2022-10-24 18:00:32 +08:00
lccsw 06489b9ce6 edit-sylive-biz_header 2022-10-24 14:54:44 +08:00
lccsw 915edf165a edit-sylive-hidden_share 2022-10-24 13:54:14 +08:00
lccsw 1201bf7bd2 edit-sylive-page2 2022-10-24 12:34:48 +08:00
lccsw 41dca1f908 edit-sylive-page 2022-10-24 12:20:18 +08:00
lccsw 711c45e155 edit-sylive-template_id 2022-10-24 11:51:18 +08:00
lccsw a6b78b0bde edit-sylive-wx 2022-10-24 09:39:34 +08:00
lccsw ff05d9c314 edit-sylive-html 2022-10-21 16:24:42 +08:00
lccsw 851c75b370 edit-sylive-wxapp 2022-10-21 16:10:57 +08:00
lccsw 700a5263f7 edit-sylive-biz_pay 2022-10-21 11:11:05 +08:00
lccsw 7d455b045c add-sylive-act_pay 2022-10-20 19:57:07 +08:00
dengbw 4e735c6533 activity_1020 2022-10-20 17:47:29 +08:00
lccsw 5d7fa060ba add-sylive-hidden_wx_share 2022-10-20 16:03:16 +08:00
lccsw 20a023b784 edit-licheb-edit_order 2022-10-19 17:11:19 +08:00
dengbw cdfdf8ba71 organization_10119 2022-10-19 16:04:27 +08:00
dengbw f8d8e0f63b user_10118 2022-10-18 11:52:15 +08:00
dengbw e06d19bf6a user_10117 2022-10-17 17:50:12 +08:00
lccsw c2c3eae1e8 edit-sylive-view_top2 2022-10-17 17:48:01 +08:00
lccsw 9a49d718b8 edit-sylive-view_top 2022-10-17 17:43:23 +08:00
lccsw 35994d6ffd add-sylive-top_view 2022-10-17 17:23:41 +08:00
lccsw 94ea827baa edit-sylive-login 2022-10-17 14:47:55 +08:00
lccsw b6356904bf edit-sylive-user_list 2022-10-14 10:25:21 +08:00
dengbw 5a80e5b979 sylive_10114 2022-10-14 10:21:57 +08:00
lccsw 2e7d6e5805 edit-sylive-user_list 2022-10-13 17:34:27 +08:00
lccsw f457136e65 edit-licheb-limit 2022-10-13 15:52:14 +08:00
lccsw 8a49fb4916 add-sylive-biz_rank 2022-10-13 15:44:31 +08:00
dengbw 0363450584 user_10113 2022-10-13 11:24:32 +08:00
lccsw 44083f7ccd edit-sylive-list 2022-10-12 17:49:17 +08:00
dengbw 27fca64e88 user_10112_4 2022-10-12 17:42:59 +08:00
lccsw 6002fd44df add-sylive-hidden_wx_share 2022-10-12 17:33:33 +08:00
dengbw 3df36e22a9 user_10112_3 2022-10-12 17:22:46 +08:00
lccsw 9210fb2a00 add-sylive-wx_share 2022-10-12 16:46:06 +08:00
dengbw 8d54060656 user_10112_2 2022-10-12 16:21:23 +08:00
lccsw 8fcdf5b640 edit-sylive-admin_auth 2022-10-12 16:21:23 +08:00
lccsw 51e3fd272b edit-sylive-admin_auth 2022-10-12 16:12:52 +08:00
dengbw a6b6c4ebb2 user_10112 2022-10-12 16:12:39 +08:00
老叶 5a65bb5de2 样式修改 2022-10-12 15:32:27 +08:00
lccsw bea4c7423a edit-sylive 2022-10-12 14:02:15 +08:00
lccsw a1a4bd4c03 edit-item-pay 2022-10-12 11:11:23 +08:00
lccsw dd7da03a82 edit-sylive-html 2022-10-11 17:38:16 +08:00
dengbw 74dd2d10df transfer_10111 2022-10-11 17:21:53 +08:00
dengbw e25a08dbc1 sylive_10111 2022-10-11 15:40:04 +08:00
lccsw 6865016393 edit-sylive-admin_auth 2022-10-11 15:04:17 +08:00
lccsw 4961848b90 edit-sylive-wx_auth 2022-10-11 08:41:35 +08:00
dengbw 0c67382dcc sylive_1010_5 2022-10-10 19:18:15 +08:00
lccsw 3589efbd37 edit-sylive 2022-10-10 19:16:32 +08:00
lccsw 4aa3951f54 edit-sylive-html 2022-10-10 17:57:10 +08:00
dengbw fe5d6b1c48 sylive_1010_4 2022-10-10 16:37:05 +08:00
lccsw 5dba9b000a edit-sylive-text 2022-10-10 16:32:47 +08:00
lccsw 6ddafabcb5 edit-sylive-live_url 2022-10-10 14:45:10 +08:00
lccsw 4e3f039d27 edit-sylive-html 2022-10-10 14:42:23 +08:00
lccsw d5f7b860ab edit-sylive 2022-10-10 14:34:24 +08:00
dengbw ae8e8e1099 sylive_1010_3 2022-10-10 11:49:44 +08:00
dengbw ea97e919a6 sylive_1010_2 2022-10-10 11:37:46 +08:00
dengbw bd923e92bc sylive_1010 2022-10-10 11:26:31 +08:00
dengbw 92d14f62d7 sylive_1009_2 2022-10-09 17:53:52 +08:00
lccsw 148820a9e2 edit-market-sylive2 2022-10-09 17:43:17 +08:00
dengbw e9e2de3360 sylive_1009 2022-10-09 16:29:13 +08:00
dengbw c95526e955 sylive_1009 2022-10-09 16:17:39 +08:00
lccsw 52219b9a86 add-market-sylive-logout 2022-10-09 15:58:34 +08:00
lccsw 6bd6e7d501 edit-market-sylive 2022-10-09 14:59:34 +08:00
dengbw 94c3b935f2 sylive_1008 2022-10-08 21:07:09 +08:00
lccsw 6f422653a8 edit-market-sylive2 2022-10-08 18:49:35 +08:00
lccsw 62ad6fceab edit-market-sylive 2022-10-08 17:57:01 +08:00
老叶 1a4284b215 样式修改 2022-10-08 16:11:18 +08:00
dengbw a866842969 customers_1008 2022-10-08 14:24:30 +08:00
dengbw 5f94eb7cc6 market_930 2022-09-30 15:32:16 +08:00
lccsw f9efcb4cc6 edit-market-sylive_html 2022-09-30 13:50:18 +08:00
lccsw 39d5da091f edit-market-sylive1 2022-09-30 11:56:58 +08:00
lccsw 4aa3acc5ba edit-market-sylive 2022-09-30 10:49:53 +08:00
dengbw 9fadfc4837 market_930 2022-09-30 09:52:48 +08:00
lccsw af09a0b2e9 edit-market-sylive 2022-09-30 08:56:48 +08:00
lccsw d11f6a1186 edit-market-exclude 2022-09-29 14:35:37 +08:00
dengbw 97fd9e8d50 market_906 2022-09-29 14:32:58 +08:00
lccsw 828a6a8f29 edit-admin-order_admin_name 2022-09-28 17:04:22 +08:00
lccsw 205e880e2e add-admin-order_admin_name 2022-09-28 16:57:12 +08:00
lccsw 928b40a31a edit-admin-up_item 2022-09-23 17:52:44 +08:00
lccsw 755159b068 edit-robot 2022-09-22 18:16:14 +08:00
lccsw 6dc5550e8b edit-api-bsrv 2022-09-20 15:46:29 +08:00
lccsw 857aae6fc5 edit-api-up_order_price 2022-09-20 15:17:53 +08:00
lccsw 7ebba3c9d0 edit-api-bsrv 2022-09-20 10:43:02 +08:00
lccsw 310aaa01fe edit-liche-order 2022-09-19 21:09:29 +08:00
lccsw d219eff999 add-api-srv_center 2022-09-19 16:57:54 +08:00
lccsw dceee41c31 edit-biz-brand_static 2022-09-15 16:05:51 +08:00
lccsw 2b300d95e2 edit-common-finish_pdf 2022-09-15 14:40:05 +08:00
lccsw 9bc904cbce edit-admin-html 2022-09-15 09:49:46 +08:00
lccsw 6d1e96faee edit-admin-order_detail 2022-09-14 09:54:53 +08:00
dengbw 9830c82770 inventory_913_2 2022-09-13 15:44:02 +08:00
dengbw 1bd5871a20 inventory_913 2022-09-13 15:23:58 +08:00
lccsw 8d174859d8 edit-bug-admin_edit_srv 2022-09-10 20:22:57 +08:00
lccsw 9db0611a84 edit-admin-srv_price 2022-09-08 17:29:13 +08:00
lccsw 32b308f41e edit-common-finish-pdf 2022-09-08 14:01:35 +08:00
dengbw e827bdb450 customers_908 2022-09-08 09:21:01 +08:00
lccsw eeb9b205dc edit-common-finish_pdf 2022-09-07 17:20:41 +08:00
lccsw c427774cfd edit-api-order_list 2022-09-07 17:13:02 +08:00
lccsw c84ed523c9 fix admin add_paylog 2022-09-07 16:44:31 +08:00
lccsw abcd2d4767 edit-api-insure 2022-09-07 14:20:23 +08:00
dengbw f10588e946 CusorderV2_907 2022-09-07 13:59:57 +08:00
lccsw 0cc4fd3f3a edit-api-hidden_insure 2022-09-07 11:43:08 +08:00
lccsw eade31060a edit-api-mycar 2022-09-07 11:14:28 +08:00
dengbw a8927d5b5d owners_906_2 2022-09-06 17:44:04 +08:00
lccsw e900f4d603 add-admin-order_ck_time 2022-09-06 17:41:17 +08:00
dengbw 9ac612d62a owners_906 2022-09-06 17:26:51 +08:00
lccsw 215d40d38f add-admin-order_over_time 2022-09-06 16:37:32 +08:00
lccsw 9c1e3935f8 edit-liche-admin_list 2022-09-05 18:50:37 +08:00
dengbw 889cfde8b8 temp_905_2 2022-09-05 15:50:59 +08:00
dengbw 69b416f276 temp_905 2022-09-05 15:44:57 +08:00
lccsw 798b7b9fca edit-common-robot 2022-09-05 11:54:58 +08:00
dengbw 09713afb0e edit-biz_brand-settle 2022-09-05 09:55:44 +08:00
dengbw 142b660728 owners_903 2022-09-03 18:31:51 +08:00
dengbw 793ccc968c owners_902_2 2022-09-02 17:38:22 +08:00
lccsw adea94484a edit-robot-filter_brand=12 2022-09-02 15:02:53 +08:00
dengbw 851b4c22ed owners_902 2022-09-02 14:52:28 +08:00
lccsw 7d4fb0a10d edit-admin-export_order 2022-09-02 13:51:54 +08:00
lccsw b6f37af195 edit-liche-credit_img 2022-09-01 17:51:29 +08:00
lccsw 13fa5f1138 edit-liche-credit 2022-09-01 17:47:04 +08:00
lccsw f2ebf58d0a edit-admin-create_pdf 2022-09-01 17:14:48 +08:00
dengbw 3e7b2eee87 owners_901 2022-09-01 14:26:00 +08:00
lccsw 8f7f658544 add-finish-pdf 2022-09-01 09:26:02 +08:00
lccsw fe940dbf2d edit-common-mchid 2022-08-31 16:31:23 +08:00
dengbw f71c6e9fa8 cusorderV2_831_4 2022-08-31 14:37:41 +08:00
dengbw d23f06999b cusorderV2_831_3 2022-08-31 13:56:44 +08:00
dengbw ae05fae058 cusorderV2_831_2 2022-08-31 12:36:29 +08:00
dengbw b0726b6bef cusorderV2_831 2022-08-31 11:42:03 +08:00
lccsw 3e7e7555b5 edit-liche-add_pay_order 2022-08-31 10:32:07 +08:00
dengbw 6991fa5847 order_830_3 2022-08-30 17:32:55 +08:00
dengbw b65a4e3068 order_830_2 2022-08-30 16:55:12 +08:00
dengbw 4c4250883b order_830 2022-08-30 16:00:32 +08:00
lccsw 95e988aa1c add-common-jwt 2022-08-29 08:47:22 +08:00
lccsw f73099c0ef edit-admin-order_detail 2022-08-29 11:46:27 +08:00
dengbw 93f7a8e955 order_826_4 2022-08-26 17:58:34 +08:00
dengbw 49be457e6f order_826_3 2022-08-26 17:52:52 +08:00
dengbw 6d56878b75 order_826_2 2022-08-26 17:29:52 +08:00
dengbw a5ee2c060e order_826 2022-08-26 17:08:49 +08:00
lccsw a6fc743d77 edit-admin-order_img_show 2022-08-26 14:05:58 +08:00
lccsw 5cf46d0de5 edit-api-order_price 2022-08-25 16:01:24 +08:00
lccsw 679f54151b edit-api-order_list 2022-08-25 15:18:40 +08:00
lccsw 1acc172360 edit-entity-settle 2022-08-24 16:43:26 +08:00
lccsw 3d6b4d1b6d add-admin-re_settle 2022-08-24 16:10:41 +08:00
dengbw d58e1e5347 order_823_2 2022-08-23 17:17:45 +08:00
dengbw 4c9ba9c93f order_823 2022-08-23 17:08:04 +08:00
lccsw 0eb0d1f656 edit-plan-order_time_out 2022-08-23 10:07:02 +08:00
dengbw 4918a3685d order_822_2 2022-08-22 17:31:41 +08:00
lccsw e90c5e1b9b edit-admin-paylog 2022-08-22 15:14:59 +08:00
dengbw 636e2d8ff8 order_822 2022-08-22 11:18:54 +08:00
lccsw 26777c650c edit-admin-paylog_img 2022-08-19 17:15:15 +08:00
lccsw 1e77d682d3 add-api-–delivery_ck_img 2022-08-19 16:39:02 +08:00
dengbw 19e6759221 userslog_819_2 2022-08-19 16:37:22 +08:00
dengbw 32929f48ad userslog_819 2022-08-19 15:35:45 +08:00
lccsw f52de34685 edit-plan-settle_static 2022-08-18 18:04:39 +08:00
dengbw 6f855faad9 order_818_2 2022-08-18 17:53:43 +08:00
dengbw 639bce66bd order_818 2022-08-18 14:56:27 +08:00
lccsw edb036e1dc edit-admin-ckinfo 2022-08-18 13:57:45 +08:00
lccsw 534a86f644 edit-admin-srv_config 2022-08-17 13:47:19 +08:00
lccsw a11e41eb48 edit-plan-settle_brand 2022-08-17 13:41:06 +08:00
dengbw a60ebdf2a7 order_816_3 2022-08-16 17:46:11 +08:00
dengbw 30880ad1ca order_816_2 2022-08-16 16:52:42 +08:00
dengbw 764403f107 order_816 2022-08-16 16:40:17 +08:00
dengbw 6abfbfabc5 biz_816_2 2022-08-16 14:31:28 +08:00
dengbw 344dfacc02 biz_816 2022-08-16 09:25:35 +08:00
dengbw c9bc965f4a biz_815_2 2022-08-15 17:44:20 +08:00
lccsw 502b47be90 edit-admin-add_pay_log 2022-08-15 16:21:39 +08:00
dengbw 930f85ab3b persona_815_3 2022-08-15 15:25:55 +08:00
dengbw 0859a84b5f persona_815_2 2022-08-15 14:24:01 +08:00
dengbw 66f9303676 persona_815 2022-08-15 12:41:25 +08:00
lccsw 280cfbb3cc edit-admin-user_status2 2022-08-15 11:38:08 +08:00
lccsw 670e6a7aa2 edit-admin-user_status 2022-08-15 10:51:29 +08:00
dengbw 9cc15c55e6 biz_812 2022-08-12 17:59:13 +08:00
lccsw 0d4e88d482 edit-plan-settle 2022-08-12 17:53:27 +08:00
lccsw e9154ddd5a edit-plan-settle_type2 2022-08-12 15:11:25 +08:00
lccsw e83b3b156e edit-plan-settle_type 2022-08-12 15:01:13 +08:00
lccsw f72c7abe14 edit-plan-settle 2022-08-12 14:54:29 +08:00
lccsw 132f29f610 add-api-order_detail 2022-08-12 14:04:34 +08:00
lccsw 5179eb8772 edit-api-pdf2 2022-08-11 10:37:09 +08:00
lccsw 3e62791c7b edit-api-pdf 2022-08-10 17:31:52 +08:00
lccsw bf7d7fcb0f edit-admin-order_list 2022-08-10 16:57:22 +08:00
lccsw 35ea9a655c edit-admin-settle_brand 2022-08-10 16:36:02 +08:00
lccsw 029b1eac93 edit-api-ck_car 2022-08-10 11:42:46 +08:00
dengbw 0693ba8c55 login_810 2022-08-10 11:33:27 +08:00
lccsw 166216444a edit-admin-order_status 2022-08-09 17:18:14 +08:00
dengbw 14d380e99e stats_809_2 2022-08-09 16:42:33 +08:00
dengbw 0fb5b0c399 stats_809 2022-08-09 15:29:44 +08:00
lccsw 19f55ea06a edit-qyrobot4 2022-08-08 17:44:30 +08:00
lccsw b7a1c797f5 edit-qyrobot3 2022-08-08 17:39:32 +08:00
lccsw ffff07504f edit-qyrobot-test2 2022-08-08 17:38:27 +08:00
lccsw f46d285785 edit-qyrobot-test 2022-08-08 17:15:44 +08:00
lccsw b80ae5d22c edit-qyrobot2 2022-08-08 17:01:10 +08:00
lccsw 343f537167 edit-qyrobot 2022-08-08 16:58:25 +08:00
dengbw 51db1ae852 licheb_808 2022-08-08 10:42:58 +08:00
dengbw 26e84ea01e stats_805_3 2022-08-05 16:35:59 +08:00
dengbw 504cb7385a stats_805_2 2022-08-05 15:56:41 +08:00
dengbw a95267c9c7 stats_805 2022-08-05 15:49:39 +08:00
lccsw aed4fda7cc edit-order-srv 2022-08-05 11:19:28 +08:00
lccsw 9f3ddf0e3e edit-admin-order_img 2022-08-04 13:32:57 +08:00
lccsw a1e2640b5b add-plan-up_ins_img 2022-08-03 15:27:46 +08:00
lccsw f72c218dc0 edit-api-licheb_imgs 2022-08-02 17:32:47 +08:00
lccsw cbe9ff63bf edit-order-settle_brand 2022-08-01 14:18:47 +08:00
dengbw 25a188a4f4 Customer_728 2022-07-28 13:57:32 +08:00
lccsw 82cb12a9e1 edit-admin-pay_log 2022-07-27 13:57:59 +08:00
lccsw 5d578b0b81 edit-admin-order_loan 2022-07-27 10:23:53 +08:00
dengbw f4d461f36e Customer_727 2022-07-27 10:13:27 +08:00
dengbw 0983683942 Customer_726 2022-07-26 16:07:09 +08:00
dengbw 1361622d17 persona_726 2022-07-26 14:04:09 +08:00
lccsw c5cbe28f2a add-xz-log 2022-07-25 20:37:52 +08:00
lccsw 8f8bb5dfab edit-xz 2022-07-25 17:20:51 +08:00
lccsw 6ce9062075 add-api-freeze_expire_time 2022-07-25 15:12:13 +08:00
dengbw 45470f4a7d customer_725 2022-07-25 14:29:05 +08:00
lccsw b1362b9f34 edit-admin-srv2 2022-07-25 13:59:53 +08:00
lccsw 8c7c6eb116 edit-admin-svr 2022-07-25 13:52:27 +08:00
lccsw 82ab65912e edit-api-static2 2022-07-24 12:27:58 +08:00
lccsw ffbd56a580 edit-api-static 2022-07-24 12:02:44 +08:00
dengbw a48e5ecb07 owners_722 2022-07-22 17:31:05 +08:00
lccsw 1871b460e5 edit-admin-order_lists 2022-07-22 17:24:38 +08:00
lccsw dd05e086f7 edit-api-credit_rule 2022-07-22 14:16:10 +08:00
dengbw f0351ab79a blindbox_722_2 2022-07-22 10:47:02 +08:00
dengbw f8404557cd blindbox_722 2022-07-22 10:39:23 +08:00
lccsw 2f0865cd66 edit-api-credits 2022-07-22 09:38:03 +08:00
dengbw c9cc727c7b blindbox_721 2022-07-21 16:29:29 +08:00
lccsw 94b5647b6b add-liche-credit 2022-07-21 16:29:25 +08:00
lccsw 64419e1d6a edit-api-buniess2 2022-07-20 10:08:11 +08:00
lccsw 851cd92695 edit-api-buniess 2022-07-20 09:55:16 +08:00
lccsw 14511424e2 edit-admin-order_detail 2022-07-19 09:12:08 +08:00
dengbw 31c366e3b8 customers_718_2 2022-07-18 15:56:19 +08:00
lccsw f68dc8b40a edit-pay_log 2022-07-18 15:46:18 +08:00
dengbw 8e083c38d0 customers_718 2022-07-18 15:19:21 +08:00
lccsw 605f6fcedc edit-api-business2 2022-07-17 20:34:24 +08:00
lccsw bbf8ba77f8 edit-api-business 2022-07-17 20:15:42 +08:00
lccsw d05604c51f add-admin-pay_log_type 2022-07-17 20:14:40 +08:00
dengbw 2c26b65070 customers_714 2022-07-14 14:12:01 +08:00
lccsw 33c807e803 edit-api-business3 2022-07-14 10:35:53 +08:00
lccsw 36514e3760 edit-api-business2 2022-07-14 10:22:03 +08:00
lccsw 421499894c edit-api-business 2022-07-14 10:20:23 +08:00
dengbw cfa5299b15 userslog_713 2022-07-13 16:14:04 +08:00
lccsw 31b6efe082 edit-admin-exprot_order2 2022-07-13 14:25:38 +08:00
lccsw 0a8ec5a325 edit-admin-exprot_order 2022-07-13 14:15:56 +08:00
lccsw d6f9c9ae1d edit-api-bug_up_order_time 2022-07-13 10:46:45 +08:00
dengbw d9b94057d0 customers_713 2022-07-13 10:11:06 +08:00
dengbw 6785816d40 userslog_712_3 2022-07-12 16:32:14 +08:00
dengbw 3d52dcf044 userslog_712_2 2022-07-12 16:27:33 +08:00
dengbw 051ca7ddf2 Merge branch 'fea#dbw_userslog' into dev 2022-07-12 16:22:09 +08:00
dengbw 1674e94d50 userslog_712 2022-07-12 16:21:38 +08:00
dengbw bfc961ee5f goods_711 2022-07-11 13:42:52 +08:00
lccsw 4888f1bd38 edit-api-put_order 2022-07-11 10:27:20 +08:00
dengbw 344efcd220 goods_708_2 2022-07-08 16:30:12 +08:00
lccsw a8173f9f35 add-api-mycar_v2 2022-07-08 15:26:42 +08:00
dengbw c6a481ec7b goods_708 2022-07-08 15:05:41 +08:00
dengbw 6ec9081b1b Customers_708 2022-07-08 11:08:34 +08:00
lccsw 51b2e62ee7 edit-admin-info 2022-07-07 13:46:45 +08:00
lccsw bd9e409968 edit-admin-biz_fine 2022-07-07 10:22:11 +08:00
lccsw 3413f12b93 edit-api-hidden_dis 2022-07-06 15:57:00 +08:00
lccsw dbc4e0cbf8 edit-common-robot 2022-07-06 15:14:31 +08:00
lccsw f7569c0821 add-fbook-rebot 2022-07-06 14:52:18 +08:00
dengbw 13840acf3a Customers_705_2 2022-07-05 17:42:29 +08:00
dengbw a8fd83659d Customers_705 2022-07-05 16:22:20 +08:00
lccsw fbf7a67404 edit-plan-biz_settle 2022-07-05 15:59:45 +08:00
lccsw 7ea05c699d edit-biz_settle 2022-07-05 15:29:34 +08:00
lccsw 543e3dfd0d edit-api-attr_status 2022-07-04 15:06:21 +08:00
lccsw 0f79129d0f edit-api-buinuess 2022-07-04 10:49:03 +08:00
lccsw cc28ff85f1 edit-put-order 2022-07-04 09:48:00 +08:00
lccsw 66bc826f7a edit-api-put_order 2022-07-01 10:40:24 +08:00
dengbw 26b88210f5 different_630 2022-06-30 16:30:15 +08:00
dengbw 172faa058f different_629_2 2022-06-29 15:35:54 +08:00
dengbw 3b8e470c79 different_629 2022-06-29 14:05:20 +08:00
lccsw 87403485e3 edit-pdf-tpl 2022-06-29 10:51:15 +08:00
dengbw 0d90a41dd1 different_628 2022-06-28 16:47:26 +08:00
lccsw 710b4fc73e add-brand-settle 2022-06-28 16:39:53 +08:00
dengbw 428eebc00b different_627 2022-06-27 10:23:22 +08:00
lccsw 479a15f198 edit-api-price_finance 2022-06-27 10:01:17 +08:00
lccsw 5a4ec397b5 edit-api-pay_order 2022-06-23 17:36:20 +08:00
dengbw e3bf78a739 owners_623_2 2022-06-23 11:11:57 +08:00
dengbw 9cf1162fde owners_623 2022-06-23 10:01:22 +08:00
lccsw 758b4bb3b3 edit-api-changebusiness 2022-06-22 17:42:15 +08:00
dengbw 881848eb82 persona_622 2022-06-22 15:15:46 +08:00
lccsw 1d9519c64b edit-admin-modify_order 2022-06-22 09:46:29 +08:00
lccsw 190d1c5b4b edit-admin-show_price3 2022-06-21 17:36:48 +08:00
dengbw fbe3b6ad45 owners_621_2 2022-06-21 17:13:47 +08:00
dengbw 89b6bdd9f6 owners_621 2022-06-21 17:11:32 +08:00
lccsw 5bcf4605ff edit-api-order_table 2022-06-21 16:11:30 +08:00
lccsw f89be0cd97 edit-admin-show_price2 2022-06-21 15:57:10 +08:00
lccsw 4a25860a26 edit-admin-show_price 2022-06-21 15:53:44 +08:00
dengbw d60a123a46 owners_620_5 2022-06-20 17:49:57 +08:00
lccsw fb250b8205 edit-admin-filter_order 2022-06-20 17:24:00 +08:00
dengbw 474f0f0437 customers_620 2022-06-20 16:58:05 +08:00
dengbw 8208567b04 owners_620_4 2022-06-20 13:52:14 +08:00
dengbw 23ee1050bc owners_620_3 2022-06-20 11:56:46 +08:00
dengbw 65d6f2d81a owners_620_2 2022-06-20 11:22:37 +08:00
dengbw 8d969c5501 owners_620 2022-06-20 10:51:15 +08:00
lccsw f437825a90 edit-admin-add_price 2022-06-20 09:34:06 +08:00
dengbw 1b5a42bdd4 owners_617 2022-06-17 17:40:09 +08:00
lccsw 9f4f06a5cc edit-common-create_pdf 2022-06-17 15:13:05 +08:00
lccsw 6cab9464b3 edit-admin-logo 2022-06-16 17:26:17 +08:00
lccsw f9d7a54ea2 add-admin_biz_settle_list 2022-06-16 15:12:11 +08:00
lccsw 00148941b6 edit-admin-srv_price 2022-06-16 14:51:23 +08:00
lccsw 02adc4c941 edit-admin-price 2022-06-16 10:56:12 +08:00
lccsw 2b916c6582 edit-admin-list_price 2022-06-15 18:04:19 +08:00
lccsw c338a3a704 add-admin-edit_price 2022-06-15 17:50:51 +08:00
dengbw b7184dc34f Customers_610_2 2022-06-10 15:50:16 +08:00
dengbw 98be1d1d2b Customers_610 2022-06-10 15:04:39 +08:00
dengbw 14fb995468 owners_610 2022-06-10 09:51:25 +08:00
lccsw e2ee13c9a0 add-admin-export_order_address 2022-06-09 16:05:48 +08:00
lccsw a1dd4a9406 edit-plan-settle_static 2022-06-09 15:24:50 +08:00
lccsw fe95139663 edit-admin-reset_settle 2022-06-09 14:43:27 +08:00
lccsw 54cb413de1 edit-admin-export_biz_settle 2022-06-09 09:22:15 +08:00
dengbw f1ced873c0 channel_608 2022-06-08 17:10:52 +08:00
dengbw b1f9ac0d98 userslog_608 2022-06-08 14:37:17 +08:00
lccsw fbc8cf5201 add-api-idcard 2022-06-07 16:49:15 +08:00
dengbw 4fe20fe080 userslog_607 2022-06-07 15:45:37 +08:00
lccsw 8770c45e88 edit-admin-order_export 2022-06-07 14:14:06 +08:00
dengbw 5e75b4a25d licheb_607 2022-06-07 09:35:50 +08:00
dengbw 4ad70aa3e0 customers_606 2022-06-06 16:17:34 +08:00
lccsw 4e37d7c030 edit-api-add_over_time 2022-06-06 16:01:36 +08:00
dengbw b251602e23 temp_602_2 2022-06-02 17:29:06 +08:00
dengbw b0f72e8cbb temp_602 2022-06-02 17:22:48 +08:00
lccsw b9ca13112b edit-admin-export 2022-06-02 16:43:00 +08:00
lccsw 51bc96b533 edit-api-delivery_day 2022-06-02 16:31:17 +08:00
dengbw b2aa7e442b customers_602 2022-06-02 16:13:33 +08:00
lccsw c3f5bf517b edit-admin-filter_clues 2022-06-02 15:24:28 +08:00
lccsw 1ce223973a edit-admin-filter_clues 2022-06-02 14:37:11 +08:00
dengbw 0fa7ac6f9a user_602 2022-06-02 13:39:30 +08:00
lccsw efd7fa067b edit-admin-add_pay_log 2022-06-02 13:38:52 +08:00
lccsw e08d7ccc3b edit-api-pay_after 2022-06-01 16:02:01 +08:00
dengbw 318bae5479 clues_601 2022-06-01 14:42:49 +08:00
lccsw 9ff99fb6cb edit-api-order_show_contract 2022-06-01 13:47:59 +08:00
lccsw 447d1efade edit-api-car_order 2022-06-01 13:39:21 +08:00
lccsw c3ae0a96bf edit-admin-order_list 2022-06-01 10:48:49 +08:00
dengbw f109f6a301 persona_601 2022-06-01 10:29:40 +08:00
lccsw a61e877c9b edit-api-over_time 2022-06-01 10:27:37 +08:00
dengbw a5d8e735f1 attr_531 2022-05-31 16:16:06 +08:00
dengbw af45e7fb51 persona_531 2022-05-31 14:31:25 +08:00
dengbw 1c342eb2cc persona_530_2 2022-05-30 16:27:46 +08:00
lccsw 25ae328f5f edit-api-edit_order 2022-05-30 15:25:09 +08:00
dengbw 7c2a0e1ff9 persona_530 2022-05-30 15:11:41 +08:00
dengbw 83c8897821 customers_530 2022-05-30 10:40:04 +08:00
lccsw a0cde2aaf3 edit-admin-order_count 2022-05-30 10:07:13 +08:00
lccsw 392479cc3b edit-admin-order_list 2022-05-29 22:26:07 +08:00
lccsw 1de6600801 add-admin-down_file 2022-05-27 16:28:48 +08:00
dengbw e6a23fb412 customers_527_2 2022-05-27 14:44:40 +08:00
dengbw 5e719c1ddd customers_527 2022-05-27 14:34:45 +08:00
lccsw 0f486d34ad edit-admin-export_order 2022-05-27 13:45:40 +08:00
dengbw 7e7624befc customers_527_2 2022-05-27 09:55:08 +08:00
dengbw 0c06a3a337 customers_527 2022-05-27 09:49:54 +08:00
dengbw fec1514411 customers_526 2022-05-26 17:48:15 +08:00
dengbw 964cb2740a visit_526 2022-05-26 14:52:52 +08:00
dengbw 47b285a813 persona_526_3 2022-05-26 14:09:42 +08:00
dengbw 46b6114e31 persona_526_2 2022-05-26 14:04:00 +08:00
dengbw 2050a1af3c persona_526 2022-05-26 11:53:47 +08:00
lccsw c60df3a071 edit-api-get_mchid 2022-05-25 16:15:28 +08:00
lccsw 75984d8b8a add-api-order_filter 2022-05-25 15:16:36 +08:00
lccsw 229e288277 add-api-idnum_ck 2022-05-24 11:20:44 +08:00
lccsw 7ed7e90fb8 edit-admin-business 2022-05-23 13:57:07 +08:00
lccsw 3defc6963a add-admin-order_status2 2022-05-23 10:55:36 +08:00
lccsw 03c904e34f add-admin-order_status 2022-05-23 10:48:58 +08:00
lccsw 78230170fa edit-get_order_status2 2022-05-20 15:57:57 +08:00
lccsw e4d93cb9d2 edit-get_order_status 2022-05-20 15:56:00 +08:00
lccsw d2f9575b00 edit-down_contracts3 2022-05-20 15:45:59 +08:00
lccsw 84a91699c2 edit-down_contracts2 2022-05-20 15:42:29 +08:00
lccsw 4dadb81b12 edit-down_contracts 2022-05-20 15:28:40 +08:00
lccsw d72b5d998c add-admin-change_file_name 2022-05-20 14:52:25 +08:00
lccsw cbda16740b edit-down_img_size 2022-05-20 12:14:32 +08:00
lccsw 66e9b85252 add-admin-donw_img 2022-05-20 11:30:08 +08:00
lccsw 5e9f5579b7 edit-admin-pay_log 2022-05-20 09:35:53 +08:00
lccsw 740604a2bd edit-admin-order_lists_status 2022-05-20 09:34:45 +08:00
dengbw 430fb9519f stylive_519_5 2022-05-19 17:40:40 +08:00
dengbw ad42177a67 stylive_519_4 2022-05-19 17:23:02 +08:00
dengbw 29f11b4f50 stylive_519_3
stylive_519_4
2022-05-19 16:51:51 +08:00
dengbw 4ee2359830 stylive_519_2 2022-05-19 16:31:42 +08:00
dengbw 7db088250d stylive_519
stylive_519_2
2022-05-19 16:21:19 +08:00
lccsw 723215c34f edit-api-biz_company 2022-05-18 13:54:19 +08:00
lccsw 4b7825d2a2 edit-api-send_sms 2022-05-16 17:16:32 +08:00
lccsw 7e971cb3af edit-api-intention 2022-05-16 15:55:32 +08:00
lccsw e44b2d17d0 –edit-plan-zx_to_test 2022-05-14 12:41:43 +08:00
825 changed files with 73833 additions and 3706 deletions
+40 -9
View File
@@ -16,6 +16,19 @@ class Common extends CI_Controller
public $data = array();
//获取门店类型数组
public function biz_type_ary()
{
$this->load->model('biz/biz_model', 'mdBiz');
$list = [];
$type_ary = $this->mdBiz->type_ary();
foreach ($type_ary as $key => $value) {
$list[] = ['id' => $key, 'name' => $value];
}
$this->data = $list;
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* Notes:获取车系
* Created on: 2022/3/18 17:09
@@ -1061,9 +1074,12 @@ class Common extends CI_Controller
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
} else if ($type == 'owners') {
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$re = $this->mdOwners->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
return $this->show_json(SYS_CODE_FAIL, '手机不存在!');
}
$mobile = $re['mobile'];
$content = '';
@@ -1095,9 +1111,12 @@ class Common extends CI_Controller
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
} else if ($type == 'owners') {
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$re = $this->mdOwners->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
return $this->show_json(SYS_CODE_FAIL, '手机不存在!');
}
$mobile = $re['mobile'];
if (!$content) {
@@ -1140,6 +1159,9 @@ class Common extends CI_Controller
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customer_oplogs_model', 'mdOplogs');
$data['customer_id'] = $id;
} else if ($type == 'owners') {
$this->load->model('receiver/receiver_owners_oplogs_model', 'mdOplogs');
$data['own_id'] = $id;
}
$this->mdOplogs->add($data);//增加操作记录
}
@@ -1170,9 +1192,12 @@ class Common extends CI_Controller
} else if ($type == 'customer') {
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$re = $this->mdCustomers->get(array('id' => $id));
} else if ($type == 'owners') {
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$re = $this->mdOwners->get(array('id' => $id));
}
if (!$re['mobile']) {
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
return $this->show_json(SYS_CODE_FAIL, '手机不存在!');
}
$mobile = $re['mobile'];
$cache = &load_cache('redis');
@@ -1451,24 +1476,30 @@ class Common extends CI_Controller
$pid = intval($this->input->get('pid'));
$name = $this->input->get('name');
$tp = intval($this->input->get('tp'));//0搜索使用,1修改使用
$status = intval($this->input->get('status'));
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('auto/auto_series_model', 'mdAutoSeries');
$this->load->model('auto/auto_attr_model', 'mdAutoAttr');
$res = $lists = array();
$res = $lists = $where = [];
if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>'] = -1;
}
if ($type == 1) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择品牌');
$res = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoBrand->select($where, 'id desc', 0, 0, 'id,name');
} else if ($type == 2) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车系');
$res = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $pid), 'id desc', 0, 0, 'id,name');
$res = $this->mdAutoSeries->select(array_merge($where, ['brand_id' => $pid]), 'id desc', 0, 0, 'id,name');
} else if ($type == 3) {
$tp == 0 && $lists[] = array('id' => 0, 'name' => $name ? $name : '选择车型');
$res = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');
$res = $this->mdAutoAttr->select(array_merge($where, ['type' => 1, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');
}
if ($tp == 1 && $type == 3) {
$lists[3] = $res;//车型
$lists[4] = $this->mdAutoAttr->select(array('type' => 0, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//车身颜色
$lists[5] = $this->mdAutoAttr->select(array('type' => 2, 's_id' => $pid), 'id desc', 0, 0, 'id,title as name');//内饰颜色
$lists[4] = $this->mdAutoAttr->select(array_merge($where, ['type' => 0, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');//车身颜色
$lists[5] = $this->mdAutoAttr->select(array_merge($where, ['type' => 2, 's_id' => $pid]), 'id desc', 0, 0, 'id,title as name');//内饰颜色
} else {
foreach ($res as $key => $value) {
$lists[] = array('id' => $value['id'], 'name' => $value['name']);
+134
View File
@@ -28,4 +28,138 @@ class Img extends CI_Controller
$data = '/liche/0f48c61017285abc0cff63f59ea5a25f.jpg,/liche/be842659e04f9b5b7bf3f9ab1459c611.jpg';
echo base64_encode($data);
}
//下载合同图片
public function down_contracts(){
$this->load->library('Ordersv2List');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model('receiver/order/receiver_order_contracts_model', 'order_contracts_model');
require_once COMMPATH.'/third_party/TCPDF/tcpdf.php';
$brand_id = $this->input->get('brand_id');
$sid = $this->input->get('sid');
$page = $this->input->get('page');
$size = $this->input->get('size');
!$page && $page = 1;
!$size && $size = 5;
$params = [
'status_pid' => 0,
'status' => 1,
'brand_id' => $brand_id,
'page' => $page,
'size' => $size,
// 'order_time' => "2022-03-01 ~ 2022-05-22",
];
$sid && $params['sid'] = $sid;
$result = $this->ordersv2list->lists($params['status_pid'], $params);
$lists = $result['lists'];
$type_arr = [0=>'汽车购车协议',1=>'委托服务协议',2=>'车辆确定',3=>'车辆交付'];
$old_type_arr = [0=>'整车合同',1=>'委托服务协议',2=>'车辆确定',3=>'交车信息',4=>'车辆买卖合同补充协议',5=>'委托服务补充协议'];
if($lists){
foreach ($lists as $key => $val) {
echo "开始订单:{$val['o_id']}<br>";
$row = $this->receiver_orders_v2_model->get(['id'=>$val['o_id']],'sid,owner_mobile,owner_name');
$contract = $this->order_contracts_model->select(['o_id'=>$val['o_id'],"imgs <> ''",'type'=>0],'','','','id,o_id,file,imgs,type');
if($contract){
foreach ($contract as $v) {
$path = FCPATH."pdf/{$row['owner_name']}";
$row['owner_mobile'] && $path .= "({$row['owner_mobile']})";
if($val['o_id']>=10000){
$file_name = $type_arr[$v['type']] ? $type_arr[$v['type']].'.pdf' : '其它_'.time().'.pdf';
}else{
$file_name = $old_type_arr[$v['type']] ? $old_type_arr[$v['type']].'.pdf' : '其它_'.time().'.pdf';
}
if(file_exists($path.'/'.$file_name)){
echo "合同id:{$v['id']},已生成<br>";
continue;
}
$imgs = json_decode($v['imgs'],true);
if(is_array($imgs)){
if (!file_exists($path)) {
$oldumask = umask(0);
mkdir($path, 0777, true);
umask($oldumask);
}
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT,true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
//删除预定义的打印 页眉/页尾
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
//设置默认等宽字体
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->SetFont('stsongstdlight', '', 20);
$pdf->AddPage();
$options = array(
// 解决SSL证书验证失败的问题
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
)
);
//设置文件信息
foreach ($imgs as $item) {
$img_url = build_qiniu_image_url($item);
$res = file_get_contents($img_url,false, stream_context_create($options));
$pdf->Ln();
$pdf->Image('@'.$res, '', '', '', '', '', $img_url,'' , false, 300, '', false, false, 0.05, false, false, false);
}
$pdf->Output( $path.'/'.$file_name,'F');
echo "合同id:{$v['id']},保存成功{$path}/{$file_name}<br>";
}else{
file_get_contents("https://api.liche.cn/wxapp/licheb/protocol/pdf_img?id={$v['id']}");
echo "合同id:{$v['id']},没有图片<br>";
}
}
}else{
echo "订单:{$val['o_id']},没有合同<br>";
}
}
}else{
echo "执行结束";
}
}
//修改文件名
public function change_dir_name(){
$this->load->model('receiver/order/receiver_orders_v2_model');
$path = FCPATH."pdf/";
//PHP遍历所有文件夹
$handle=opendir($path.".");
$array_file = array();
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..") {
$array_file[] = $file; //输出文件名
}
}
closedir($handle);
if(is_array($array_file)){
foreach ($array_file as $item) {
if(is_numeric($item)){
$dir = $path.$item;
$arr = scandir($dir);
$len = count($arr)-2;
if($len>0){
$row = $this->receiver_orders_v2_model->get(['sid'=>$item],'owner_mobile,owner_name');
if($row){
$rename = $path.$row['owner_name'];
$row['owner_mobile'] && $rename.="({$row['owner_mobile']})";
if(rename($dir,$rename)){
echo "更名成功{$rename}<br>";
}else{
echo "更名失败{$item}<br>";
}
}else{
echo "订单不存在{$item}<br>";
}
}else{
@unlink($dir);
echo "删除文件夹:{$dir}<br>";
}
}else{
echo "无需改名:{$item}.<br>";
}
}
}
}
}
+14 -25
View File
@@ -18,7 +18,7 @@ class Login extends CI_Controller
header('Location:/welcome');
}
$this->load->view('login_sms');
$this->load->view('login');
}
public function post()
@@ -39,16 +39,13 @@ class Login extends CI_Controller
$cookie = $this->input->cookie(LOGIN_CODE_COOKIE);
$code_cookie = $this->encryption->decrypt($cookie);
if (!$code_cookie) {
return $this->show_json(0, '请输入正确验证码');
return $this->show_json(0, '验证码已过期');
}
if ($code_cookie != $code) {
return $this->show_json(0, '验证码错误');
}
$this->load->model('sys/sys_admin_model');
$admin_user = $this->sys_admin_model->get(array("mobile" => $mobile, 'status' => 1));
if(!$admin_user){
return $this->show_json(0, '用户不存在');
}
$admin_user = $this->sys_admin_model->get(array("mobile = '{$mobile}'" => null, 'status' => 1));
$log = 1;
} else {
if (!$username) {
@@ -69,16 +66,16 @@ class Login extends CI_Controller
if (false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")) {
//开发测试不校验IP
} elseif (filter_var($ip, FILTER_VALIDATE_IP)) {
$this->load->model('sys/sys_config_model');
$config_ip = $this->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL, "k" => "site"));
foreach ($config_ip as $key => $value) {
$ip_arr[] = json_decode($value['v'])->ip;
}
$ip_arr = array_merge($ip_arr, array_column($this->sys_admin_model->select(array(), '', '', '', 'login_ip'), 'login_ip'));
if (!in_array($ip, $ip_arr)) {
$check_view = true;
$log = 1;
}
// $this->load->model('sys/sys_config_model');
// $config_ip = $this->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL, "k" => "site"));
// foreach ($config_ip as $key => $value) {
// $ip_arr[] = json_decode($value['v'])->ip;
// }
// $ip_arr = array_merge($ip_arr, array_column($this->sys_admin_model->select(array(), '', '', '', 'login_ip'), 'login_ip'));
// if (!in_array($ip, $ip_arr)) {
// $check_view = true;
// $log = 1;
// }
}
}
}
@@ -119,11 +116,6 @@ class Login extends CI_Controller
{
if ($this->input->method() == 'post') {
$mobile = $this->input->post('mobile', true);
$this->load->model('sys/sys_admin_model');
$admin_user = $this->sys_admin_model->get(array("mobile" => $mobile, 'status' => 1));
if(!$admin_user){
return $this->show_json(SYS_CODE_FAIL, '请输入正确手机号');
}
$code = rand(100000, 999999);
$domain = explode('.', $_SERVER['HTTP_HOST']);
@@ -131,10 +123,7 @@ class Login extends CI_Controller
$domain = implode('.', $domain);
$this->input->set_cookie(LOGIN_CODE_COOKIE, $this->encryption->encrypt(json_encode($code)), 60 * 5, $domain);
// send_sms($mobile, $code);
$content = "【东创宝】您的验证码为:{$code},请勿泄露于他人!";
b2m_send_sms($mobile,$content);
return $this->show_json(SYS_CODE_SUCCESS, '验证码已发送');
send_sms($mobile, $code);
}
}
+268
View File
@@ -0,0 +1,268 @@
<?php
/**
* Notes:盲盒抽奖
* Created on: 2022/07/14 13:38
* Created by: dengbw
*/
class Blindbox extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('app/liche/app_liche_blind_box_model', 'mdBlindBox');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where = array('status>' => -1);
$count = $this->mdBlindBox->count($where);
if ($count) {
$this->load->library('MyEncryption');
$res = $this->mdBlindBox->select($where, 'id desc', $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['title'] = $value['title'];
$setValue['s_time'] = $value['s_time'];
$setValue['e_time'] = $value['e_time'];
$setValue['c_time'] = date('Y-m-d H:i', $value['c_time']);
$setValue['status_name'] = $this->mdBlindBox->statusAry($value['status']);
$url = http_host_com('home') . "/h5/syt/blindbox?skey=" . $this->myencryption->base64url_encode("id=" . $value['id']);
$setValue['url'] = urlencode($url);
$lists[] = $setValue;
}
}
$this->data['_title'] = '盲盒抽奖列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
return $this->show_view('/app/liche/blindbox/lists', true);
}
public function get()
{
$params = $this->input->get();
$id = intval($params['id']);
$title = $time = $rule = $prizes_content = $prizes_note = $prizes_winning_ins = $share_desc = $bottom_word =
$bg_color = $lottery_num = '';
$bg_img = $share_img = ['value' => '', 'src' => ''];
$prizes_list = [];
if ($id > 0) {
$re = $this->mdBlindBox->get(array('id' => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$_title = '编辑盲盒抽奖';
$dataInfo['editType'] = 0;
$dataInfo['edit_url'] = '/app/liche/blindbox/edit';
$dataInfo['status'] = $re['status'];
$title = $re['title'];
$re['s_time'] && $time = $re['s_time'] . " ~ " . $re['e_time'];
$lottery_num = $re['lottery_num'];
if ($re['jsondata']) {
$jsondata = json_decode($re['jsondata'], true);
if ($jsondata['bg_img']) {
$bg_img['value'] = $jsondata['bg_img'];
$bg_img['src'] = build_qiniu_image_url($jsondata['bg_img']);
}
$jsondata['bg_color'] && $bg_color = $jsondata['bg_color'];
$jsondata['share_desc'] && $share_desc = $jsondata['share_desc'];
if ($jsondata['share_img']) {
$share_img['value'] = $jsondata['share_img'];
$share_img['src'] = build_qiniu_image_url($jsondata['share_img']);
}
$jsondata['bottom_word'] && $bottom_word = $jsondata['bottom_word'];
$jsondata['rule'] && $rule = $jsondata['rule'];
}
if ($re['prizes']) {//奖品配置
$prizes = json_decode($re['prizes'], true);
$prizes_content = $prizes['content'];
$prizes_note = $prizes['note'];
$prizes_winning_ins = $prizes['winning_ins'];
foreach ($prizes['list'] as $key => $value) {
$value['img_src'] = $value['img_value'] ? build_qiniu_image_url($value['img_value']) : '';
$prizes_list[] = $value;
}
}
} else {
$_title = '新增盲盒抽奖';
$dataInfo['editType'] = 2;
$dataInfo['edit_url'] = '/app/liche/blindbox/add';
$dataInfo['status'] = 0;
}
$status_list = [];
foreach ($this->mdBlindBox->statusAry() as $key => $value) {
$status_list[] = array("id" => $key, "name" => $value);
}
$dataInfo['id'] = $id;
$dataInfo['title'] = $title;
$dataInfo['bg_img'] = $bg_img;
$dataInfo['bg_color'] = $bg_color;
$dataInfo['time'] = $time;
$dataInfo['lottery_num'] = $lottery_num;
$dataInfo['share_desc'] = $share_desc;
$dataInfo['share_img'] = $share_img;
$dataInfo['bottom_word'] = $bottom_word;
$dataInfo['rule'] = $rule;
$dataInfo['prizes_content'] = $prizes_content;
$dataInfo['prizes_note'] = $prizes_note;
$dataInfo['prizes_winning_ins'] = $prizes_winning_ins;
$this->data['info'] = $dataInfo;
$this->data['status_list'] = $status_list;
$this->data['prizes_list'] = $prizes_list;
$this->data['_title'] = $_title;
return $this->show_view('/app/liche/blindbox/edit', true);
}
public function add()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
$re = $this->mdBlindBox->get(array("title" => $info['title'], "status<>" => -1));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '该标题已存在!');
}
$json_data['bg_img'] = $info['bg_img']['value'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['share_desc'] = $info['share_desc'];
$json_data['share_img'] = $info['share_img']['value'];
$json_data['bottom_word'] = $info['bottom_word'];
$json_data['rule'] = $info['rule'];
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$prizes['content'] = $info['prizes_content'];
$prizes['note'] = $info['prizes_note'];
$prizes['winning_ins'] = $info['prizes_winning_ins'];
$prizes_list = [];
foreach ($info['prizes_list'] as $key => $value) {
unset($value['img_src']);
$prizes_list[] = $value;
}
$prizes['list'] = $prizes_list;
$prizes = json_encode($prizes, JSON_UNESCAPED_UNICODE);
$addData = ["title" => $info['title'], "lottery_num" => $info['lottery_num'], "jsondata" => $jsondata, "prizes" => $prizes
, "status" => $info['status'], "c_time" => time()];
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$addData['s_time'] = $time[0];
$addData['e_time'] = $time[1];
}
$id = $this->mdBlindBox->add($addData);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '新增失败!');
}
$this->data['type'] = 'add';
$this->data['id'] = $id;
return $this->show_json(SYS_CODE_SUCCESS, '新增成功!');
}
public function edit()
{
$info = $this->input->post('info');
$checkData = $this->checkData($info);
if (!$checkData['code']) {
return $this->show_json($checkData['code'], $checkData['msg']);
}
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$json_data['bg_img'] = $info['bg_img']['value'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['share_desc'] = $info['share_desc'];
$json_data['share_img'] = $info['share_img']['value'];
$json_data['bottom_word'] = $info['bottom_word'];
$json_data['rule'] = $info['rule'];
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$prizes['content'] = $info['prizes_content'];
$prizes['note'] = $info['prizes_note'];
$prizes['winning_ins'] = $info['prizes_winning_ins'];
$prizes_list = [];
foreach ($info['prizes_list'] as $key => $value) {
unset($value['img_src']);
$prizes_list[] = $value;
}
$prizes['list'] = $prizes_list;
$prizes = json_encode($prizes, JSON_UNESCAPED_UNICODE);
$updateData = ["title" => $info['title'], "lottery_num" => $info['lottery_num'], "jsondata" => $jsondata, "prizes" => $prizes];
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$updateData['s_time'] = $time[0];
$updateData['e_time'] = $time[1];
}
$this->mdBlindBox->update($updateData, ['id' => $info['id']]);
$this->data['type'] = 'edit';
return $this->show_json(SYS_CODE_SUCCESS, '修改成功!');
}
/**
* Notes:修改状态
* Created on: 2020/8/24 11:12
* Created by: dengbw
* @return bool|void
*/
public function edit_status()
{
$info = $this->input->post('info');
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$this->mdBlindBox->update(array("status" => intval($info['status'])), array('id' => $info['id']));
return $this->show_json(SYS_CODE_SUCCESS, '操作成功!');
}
/**
* Notes:检查新增/修改数据
* Created on: 2020/8/20 11:59
* Created by: dengbw
* @param $info
* @return array
*/
private function checkData($info)
{
$msg = '';
$code = SYS_CODE_FAIL;
if (!$info) {
$msg = '非法参数';
} else if (!$info['title']) {
$msg = '请输入标题';
} else if (!$info['bg_img']) {
$msg = '请上传背景图片';
} else if (!$info['bg_color']) {
$msg = '请上传背景颜色';
} else if (!$info['time']) {
$msg = '请选择活动时间';
} else if (!$info['rule']) {
$msg = '请输入其它事项';
} else {
$code = SYS_CODE_SUCCESS;
}
return array('code' => $code, 'msg' => $msg);
}
public function del()
{
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
}
}
+10
View File
@@ -21,6 +21,7 @@ class Main extends HD_Controller
$this->load->model('bobing/bobing_user_model', 'mdBobingUser');
$this->load->model('app/user_accountlog_model');
$this->load->model('app/liche/app_liche_luckybag_users_model', 'mdLuckyBagUsers');
$this->load->model('app/liche/app_liche_blind_box_model', 'mdBlindBox');
}
public function index()
@@ -57,6 +58,15 @@ class Main extends HD_Controller
),
);
$value = $this->mdBlindBox->count(['status>' => -1]);
$list[] = array(
'title' => '盲盒抽奖(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/liche/blindbox'),
),
);
$value = $this->mdTopics->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '专题(个)',
+132
View File
@@ -7,6 +7,8 @@ class Member extends HD_Controller{
{
parent::__construct();
$this->load->model('app/liche/App_liche_users_model', 'userM');
$this->load->model('app/liche/app_liche_credits_log_model');
$this->load->library('entity/credits_entity');
}
//首页信息
@@ -149,4 +151,134 @@ class Member extends HD_Controller{
{
}
//冻结资金
public function get_freeze(){
$uid = $this->input->get_post('uid');
$user = $this->userM->get(['id'=>$uid]);
if(!$user){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if($this->input->method() == 'post'){
$credit = abs(intval($this->input->post('credits')));
$result = $this->credits_entity->freeze($uid,$credit,1);
if($result['code']){
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
}
$this->data['uid'] = $uid;
$this->data['user'] = $user;
return $this->show_view('app/liche/member/get_freeze');
}
//增加积分
public function add_credit(){
$uid = $this->input->get_post('uid');
$user = $this->userM->get(['id'=>$uid]);
if(!$user){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if($this->input->method() == 'post'){
$credits = abs(intval($this->input->post('credits')));
$remark = $this->input->post('remark');
$type = $this->input->post('type');
$jsondata['admin_id'] = $this->uid;
$result = $this->credits_entity->change($uid,$credits,4,0,$remark,$jsondata);
if($result['code']){
if($type==2){
$this->credits_entity->freeze($uid,$credits);
}
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}else{
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
}
$this->data['uid'] = $uid;
$this->data['user'] = $user;
return $this->show_view('app/liche/member/add_credit');
}
public function get_credit_log(){
$params = $this->input->get();
$page = $params['page'];
$size = $params['size'];
!$page && $page = 1;
!$size && $size = 40;
$where = [];
if(strlen($params['type'])){
$where['type'] = $params['type'];
}else{
$params['type'] = '';
}
$params['uid'] && $where['uid'] = $params['uid'];
$type_arr = $this->app_liche_credits_log_model->get_type();
$count = $this->app_liche_credits_log_model->count($where);
$lists = [];
if($count){
$rows = $this->app_liche_credits_log_model->select($where,'id desc',$page,$size);
$uids_arr = array_unique(array_column($rows,'uid'));
$users = [];
if($uids_arr){
$uids_str = implode(',',$uids_arr);
$u_where = [
"id in ({$uids_str})" => null
];
$users = $this->userM->map('id','nickname',$u_where,'id desc',0,0,'id,nickname');
}
foreach($rows as $item){
$item['type_cn'] = $type_arr[$item['type']];
$item['nickname'] = $users[$item['uid']];
$lists[] = $item;
}
}
$this->data['params'] = $params;
$this->data['type_arr'] = $type_arr;
$this->data['lists'] = $lists;
$this->data['_title'] = '积分日志';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
return $this->show_view('app/liche/member/credit_log_lists',true);
}
//兑换积分
public function add_items(){
$uid = $this->input->get_post('uid');
$user = $this->userM->get(['id'=>$uid]);
if(!$user){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if(!$user['mobile']){
return $this->show_json(SYS_CODE_FAIL, '兑换失败,用户未授权手机号');
}
if($this->input->method() == 'post'){
$credits = -1 * abs(intval($this->input->post('credits')));
$remark = $this->input->post('remark');
$item_title = $this->input->post('item_title');
$item_code = $this->input->post('item_code');
$jsondata['admin_id'] = $this->uid;
$jsondata['item_title'] = $item_title;
$jsondata['item_code'] = $item_code;
$result = $this->credits_entity->change($uid,$credits,5,0,$remark,$jsondata);
if($result['code']){
//发短信通知
$params = [
'goods' => $item_title,
'code' => $item_code
];
send_alisms(array('mobile' => $user['mobile'], 'template' => 'SMS_246545017', 'param' => $params));
return $this->show_json(SYS_CODE_SUCCESS, '兑换成功');
}else{
return $this->show_json(SYS_CODE_FAIL, $result['msg']);
}
}
$this->data['uid'] = $uid;
$this->data['user'] = $user;
return $this->show_view('app/liche/member/add_items');
}
}
+12 -8
View File
@@ -26,9 +26,9 @@ class Channel extends HD_Controller
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['size'] = $params['size'] ? intval($params['size']) : 50;
$lists = [];
$where = ['group_id' => 4, 'status' => 1];
$where = ['group_id' => 4, 'status' => 1, 'biz_id<>' => 0];
if ($params['uname']) {
$where['uname like "%' . $params['uname'] . '%"'] = null;
}
@@ -45,12 +45,16 @@ class Channel extends HD_Controller
->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left')
->where(['lc_app_licheb_channel_biz.uid' => $value['id'], 'lc_biz.status' => 1])
->count_all_results('lc_app_licheb_channel_biz');
$setValue['id'] = $value['id'];
$setValue['uname'] = $value['uname'];
$setValue['mobile'] = $value['mobile'];
$setValue['bizs'] = $bizs;
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
if ($bizs > 0) {
$setValue['id'] = $value['id'];
$setValue['uname'] = $value['uname'];
$setValue['mobile'] = $value['mobile'];
$setValue['bizs'] = $bizs;
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
} else {
$count--;
}
}
}
$this->data['lists'] = $lists;
+13 -4
View File
@@ -20,7 +20,8 @@ class Main extends HD_Controller
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
$this->load->model('topics/topics_model', 'mdTopics');
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
$this->load->model('app/licheb/app_licheb_bizs_log_model', 'mdBizsLog');
$this->load->model('app/licheb/syt_live_model', 'mdSytLive');
}
public function index()
@@ -36,7 +37,7 @@ class Main extends HD_Controller
'title' => '用户(人)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/licheb/member/index'),
array('name' => '查看详情', 'url' => '/app/licheb/member/index?status=1'),
),
);
$value = $this->userM->count(['group_id' => 4, 'status' => 1]);
@@ -66,6 +67,14 @@ class Main extends HD_Controller
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
$list = array();
$value = $this->mdSytLive->count(['status>' => -1]);
$list[] = array(
'title' => '私域通-直播(个)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/licheb/sytlive'),
),
);
$value = $this->mdTopics->count(array('app_id' => $this->app_id));
$list[] = array(
'title' => '专题(个)',
@@ -90,9 +99,9 @@ class Main extends HD_Controller
array('name' => '查看详情', 'url' => '/live/polyv'),
),
);
$value = $this->mdUsersLog->count();
$value = $this->mdBizsLog->count();
$list[] = array(
'title' => '顾问日志',
'title' => '门店日志',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => 'app/licheb/userslog'),
+5 -2
View File
@@ -48,7 +48,9 @@ class Member extends HD_Controller
$params['county_id'] = '';
$params['biz_id'] = '';
}
if(strlen($params['status'])){
$where['status'] = $params['status'];
}
$count = $this->userM->count($where);
$lists = $this->userM->select($where, 'id desc', $page, $size);
foreach ($lists as $key => $val) {
@@ -56,7 +58,7 @@ class Member extends HD_Controller
if ($val['group_id'] == 4) {
$biz_name = ' <a href="javascript:void(0)" data-open="/app/licheb/channel/lists_biz?uid=' . $val['id'] . '">门店列表</a>';
} else if ($val['biz_id']) {
$re_biz = $this->biz_model->get(['id' => $val['biz_id'], 'status' => 1], 'biz_name');
$re_biz = $this->biz_model->get(['id' => $val['biz_id']], 'biz_name');
$re_biz && $biz_name = $re_biz['biz_name'];
}
$lists[$key]['biz_name'] = $biz_name;
@@ -120,6 +122,7 @@ class Member extends HD_Controller
$_title = '添加用户';
}
$show_info['cityList'] = $this->mdSysCity->select(['status' => 1], 'id desc', 0, 0, 'city_id,name');
$show_info['typeAry'] = $this->biz_model->type_ary();
$this->data['selectedBrands'] = $selectedBrands;
$this->data['show_info'] = $show_info;
$this->data['info'] = $info;
+47 -34
View File
@@ -57,7 +57,9 @@ class Sytlive extends HD_Controller
{
$params = $this->input->get();
$id = intval($params['id']);
$title = $session_id = $img = $img_url = $share_title = $share_img = $share_img_url = $time = $rule = '';
$title = $session_id = $img = $img_url = $share_title = $share_img = $share_img_url = $time = $rule = $prizes_note = '';
$img = $share_img = ['value' => '', 'src' => ''];
$prizes_list = [];
if ($id > 0) {
$re = $this->mdSytLive->get(array('id' => $id));
if (!$re || empty($re)) {
@@ -70,19 +72,27 @@ class Sytlive extends HD_Controller
$re['title'] && $title = $re['title'];
$re['session_id'] && $session_id = $re['session_id'];
if ($re['img']) {
$img = $re['img'];
$img_url = build_qiniu_image_url($re['img']);
$img['value'] = $re['img'];
$img['src'] = build_qiniu_image_url($re['img']);
}
$re['s_time'] && $time = $re['s_time'] . " ~ " . $re['e_time'];
if ($re['jsondata']) {
$jsondata = json_decode($re['jsondata'], true);
$jsondata['share_title'] && $share_title = $jsondata['share_title'];
$jsondata['share_desc'] && $share_desc = $jsondata['share_desc'];
if ($jsondata['share_img']) {
$share_img = $jsondata['share_img'];
$share_img_url = build_qiniu_image_url($jsondata['share_img']);
$share_img['value'] = $jsondata['share_img'];
$share_img['src'] = build_qiniu_image_url($jsondata['share_img']);
}
$jsondata['rule'] && $rule = $jsondata['rule'];
}
if ($re['prizes']) {//奖品配置
$prizes = json_decode($re['prizes'], true);
$prizes_note = $prizes['note'];
foreach ($prizes['list'] as $key => $value) {
$value['img_src'] = $value['img_value'] ? build_qiniu_image_url($value['img_value']) : '';
$prizes_list[] = $value;
}
}
} else {
$_title = '新增私域通-直播';
$dataInfo['editType'] = 2;
@@ -97,14 +107,14 @@ class Sytlive extends HD_Controller
$dataInfo['title'] = $title;
$dataInfo['session_id'] = $session_id;
$dataInfo['img'] = $img;
$dataInfo['img_url'] = $img_url;
$dataInfo['time'] = $time;
$dataInfo['share_title'] = $share_title;
$dataInfo['share_desc'] = $share_desc;
$dataInfo['share_img'] = $share_img;
$dataInfo['share_img_url'] = $share_img_url;
$dataInfo['rule'] = $rule;
$dataInfo['prizes_note'] = $prizes_note;
$this->data['info'] = $dataInfo;
$this->data['status_list'] = $status_list;
$this->data['prizes_list'] = $prizes_list;
$this->data['_title'] = $_title;
return $this->show_view('/app/licheb/syt/live_edit', true);
}
@@ -120,13 +130,20 @@ class Sytlive extends HD_Controller
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '该直播场次已存在!');
}
//$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['share_img'] = $info['share_img'];
$json_data['share_desc'] = $info['share_desc'];
$json_data['share_img'] = $info['share_img']['value'];
$json_data['rule'] = $info['rule'];
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$addData = array("title" => $info['title'], "session_id" => $info['session_id'], "img" => $info['img'],
"jsondata" => $jsondata, "status" => $info['status'], "c_time" => time());
$prizes['note'] = $info['prizes_note'];
$prizes_list = [];
foreach ($info['prizes_list'] as $key => $value) {
unset($value['img_src']);
$prizes_list[] = $value;
}
$prizes['list'] = $prizes_list;
$prizes = json_encode($prizes, JSON_UNESCAPED_UNICODE);
$addData = ["title" => $info['title'], "session_id" => $info['session_id'], "img" => $info['img']['value'],
"jsondata" => $jsondata, "prizes" => $prizes, "status" => $info['status'], "c_time" => time()];
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$addData['s_time'] = $time[0];
@@ -151,32 +168,28 @@ class Sytlive extends HD_Controller
if (!$info['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$jsonkpi = json_encode($info['kpi_list'], JSON_UNESCAPED_UNICODE);
$json_data['share_title'] = $info['share_title'];
$json_data['remark'] = $info['remark'];
$json_data['share_desc'] = $info['share_desc'];
$json_data['share_img'] = $info['share_img']['value'];
$json_data['rule'] = $info['rule'];
$json_data['bg_color'] = $info['bg_color'];
$json_data['btn_color'] = $info['btn_color'];
//海报
$posters = array();
if ($info['posters']) {
foreach ($info['posters'] as $key => $value) {
$posters[] = array('url' => $value['value'], 'width' => $value['width'], 'height' => $value['height']);
}
}
$json_data['posters'] = $posters;
$jsondata = json_encode($json_data, JSON_UNESCAPED_UNICODE);
$brand_id = $info['brand_id'] ? implode(',', $info['brand_id']) : 0;
$updateData = array("brand_id" => $brand_id, "title" => $info['title'], "z_id" => $info['z_id'], "img" => $info['img']
, "jsonkpi" => $jsonkpi, "jsondata" => $jsondata);
$prizes['note'] = $info['prizes_note'];
$prizes_list = [];
foreach ($info['prizes_list'] as $key => $value) {
unset($value['img_src']);
$prizes_list[] = $value;
}
$prizes['list'] = $prizes_list;
$prizes = json_encode($prizes, JSON_UNESCAPED_UNICODE);
$updateData = ["title" => $info['title'], "session_id" => $info['session_id'], "img" => $info['img']['value'],
"jsondata" => $jsondata, "prizes" => $prizes];
if ($info['time']) {
$time = explode(' ~ ', $info['time']);
$updateData['s_time'] = $time[0];
$updateData['e_time'] = $time[1];
}
$this->mdSytLive->update($updateData, array('id' => $info['id']));
$this->mdSytLive->update($updateData, ['id' => $info['id']]);
$this->data['type'] = 'edit';
return $this->show_json(SYS_CODE_SUCCESS, '修改活动成功!');
return $this->show_json(SYS_CODE_SUCCESS, '修改直播成功!');
}
/**
@@ -285,8 +298,8 @@ class Sytlive extends HD_Controller
$msg = '请输入活动标题';
} else if (!$info['img']) {
$msg = '请上传头部图片';
} else if (!$info['session_id']) {
$msg = '请输入直播场次';
// } else if (!$info['session_id']) {
// $msg = '请输入直播场次';
} else if (!$info['time']) {
$msg = '请选择直播时间';
} else if (!$info['rule']) {
+395 -83
View File
@@ -8,13 +8,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class Userslog extends HD_Controller
{
private $tabAry = [1 => '客户统计', 2 => '回访统计'];
public function __construct()
{
parent::__construct();
$this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
$this->load->model('app/licheb/app_licheb_bizs_log_model', 'mdBizsLog');
$this->load->model('receiver/receiver_customers_visit_sales_model', 'mdCustomerVisitSales');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model('app/app_lichene_qy_log_model', 'mdWechatqyLog');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('area_model', 'mdArea');
}
@@ -29,40 +33,227 @@ class Userslog extends HD_Controller
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$data = $this->dataSelect($params);
$data = $this->dataBizSelect($params);
$data['typeAry'] = $this->mdBiz->type_ary();
$this->data = $data;
$this->show_view('app/licheb/userslog/lists', true);
}
private function dataSelect($params)
public function lists_users()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['tab'] = $params['tab'] ? intval($params['tab']) : 1;
if ($params['tab'] == 2) {
$view = 'app/licheb/userslog/lists_visit';
$data = $this->visitSelect($params);
} else {
$view = 'app/licheb/userslog/lists_users';
$data = $this->dataUsersSelect($params);
}
$data['tabAry'] = $this->tabAry;
$this->data = $data;
$this->show_view($view, true);
}
private function dataBizSelect($params)
{
!$params['type'] && $params['type'] = '';
!$params['biz_id'] && $params['biz_id'] = '';
!$params['city_id'] && $params['city_id'] = '';
!$params['county_id'] && $params['county_id'] = '';
$lists = $where_c = $where_dt = $where = [];
$same_day = 0;
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] == $time[1] && $same_day = 1;
if ($time[0]) {
$where["log_date>="] = $time[0];
$where_c["c_time>="] = strtotime("{$time[0]} 00:00:00");
$where_dt["dt_time>="] = "{$time[0]} 00:00:00";
}
if ($time[1]) {
$where["log_date<="] = $time[1];
$where_c["c_time<="] = strtotime("{$time[1]} 23:59:59");
$where_dt["dt_time<="] = "{$time[1]} 23:59:59";
}
} else {
$where_c["c_time>="] = strtotime("2022-04-15 00:00:00");
$where_dt["dt_time>="] = "2022-04-15 00:00:00";
}
$where_qy = $where_c;//企微数
$where_qy['change_type'] = 'add_external_contact';
$where_user = $str_ids = '';
if ($params['type'] || $params['biz_id'] || $params['city_id'] || $params['county_id']) {
$where_cdt['status'] = 1;
if ($params['biz_id']) {
$where_cdt['id'] = $params['biz_id'];
} else {
$params['type'] && $where_cdt['type'] = $params['type'];
$params['city_id'] && $where_cdt['city_id'] = $params['city_id'];
$params['county_id'] && $where_cdt['county_id'] = $params['county_id'];
}
$res_biz = $this->mdBiz->select($where_cdt, 'id desc', 0, 0, 'id');
if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["biz_id in ({$str_ids})"] = null;
$where_user = "biz_id in ({$str_ids})";
if (!$same_day) {//不是搜索一天
$where_c["biz_id in ({$str_ids})"] = null;
$where_dt["biz_id in ({$str_ids})"] = null;
}
} else {
$where['biz_id'] = -2;
$where_user = "biz_id = -2";
if (!$same_day) {//不是搜索一天
$where_c['biz_id'] = -2;
$where_dt['biz_id'] = -2;
}
}
}
$total = $this->mdBizsLog->count($where);
$offlineSources = $this->mdCustomers->offlineSources();
if ($total) {
$res = $this->mdBizsLog->select($where, "id desc", $params['page'], $params['size']);
if ($res) {
$str_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_biz = $this->mdBiz->map('id', 'biz_name', ["id in ({$str_ids})" => null]);
foreach ($res as $v) {
$biz_name = $biz_type = $customer_info = $c_num_info = $order_info = '';
$customers = $c_num = $orders = 0;
$map_biz[$v['biz_id']] && $biz_name = $params['size'] == 10000 ? $map_biz[$v['biz_id']] : "<a href=\"javascript:void(0);\"
data-open=\"/app/licheb/userslog/lists_users?tab=1&biz_id={$v['biz_id']}&time={$v['log_date']} ~ {$v['log_date']}\">
{$map_biz[$v['biz_id']]}</a>";
$temp = ['biz_name' => $biz_name, 'defeats' => $v['defeats']
, 't_num' => $v['t_num'], 'orders' => $v['orders']
, 'bills' => $v['bills'], 'reassigns' => $v['reassigns'], 'receives' => $v['receives']
, 'qy_adds' => $v['qy_adds'], 'log_date' => $v['log_date']];
$customer_json = $v['customer_json'] ? json_decode($v['customer_json'], true) : [];
$c_num_json = $v['c_num_json'] ? json_decode($v['c_num_json'], true) : [];
$order_json = $v['order_json'] ? json_decode($v['order_json'], true) : [];
foreach ($offlineSources as $key1 => $value1) {
$nums = intval($v['customer_' . $key1]);
$nums_c_num = intval($v['c_num_' . $key1]);
$nums_orders = intval($v['order_' . $key1]);
if ($nums) {
$customers += $nums;
if ($params['size'] != 10000) {
if ($customer_info) {
$customer_info .= "<br>{$value1['name']}{$nums}";
} else {
$customer_info = "<br>{$value1['name']}{$nums}";
}
}
}
if ($nums_c_num) {
$c_num += $nums_c_num;
if ($params['size'] != 10000) {
if ($c_num_info) {
$c_num_info .= "<br>{$value1['name']}{$nums_c_num}";
} else {
$c_num_info = "<br>{$value1['name']}{$nums_c_num}";
}
}
}
if ($nums_orders) {
$orders += $nums_orders;
if ($params['size'] != 10000) {
if ($order_info) {
$order_info .= "<br>{$value1['name']}{$nums_orders}";
} else {
$order_info = "<br>{$value1['name']}{$nums_orders}";
}
}
}
if ($params['size'] == 10000) {//导出使用
$temp['customer_' . $key1] = $nums;
$temp['c_num_' . $key1] = $nums_c_num;
$temp['order_' . $key1] = $nums_orders;
foreach ($value1['list'] as $key2 => $value2) {
$temp['customer_' . $key2] = intval($customer_json[$key1]['list'][$key2]['num']);
$temp['c_num_' . $key2] = intval($c_num_json[$key1]['list'][$key2]['num']);
$temp['order_' . $key2] = intval($order_json[$key1]['list'][$key2]['num']);
}
}
}
$temp['customers'] = $customer_info ? "总数:{$customers}{$customer_info}" : $customers;
$temp['c_num'] = $c_num_info ? "总数:{$c_num}{$c_num_info}" : $c_num;
$temp['orders'] = $order_info ? "总数:{$orders}{$order_info}" : $orders;
$lists[] = $temp;
}
}
}
if ($params['size'] != 10000) {
$customers = $c_num = $orders = 0;
$customers_info = $c_num_info = $orders_info = '';
foreach ($offlineSources as $k => $v) {
if ($same_day) {
$sum2 = $this->mdUsersLog->sum("customer_{$k}", $where);//客户数
if ($sum2['customer_' . $k]) {//客户数
$customers += $sum2['customer_' . $k];
$customers_info .= "<br>{$v['name']}{$sum2['customer_'.$k]}";
}
$sum2 = $this->mdUsersLog->sum("c_num_{$k}", $where);//进店人数
if ($sum2['c_num_' . $k]) {
$c_num += $sum2['c_num_' . $k];
$c_num_info .= "<br>{$v['name']}{$sum2['c_num_'.$k]}";
}
} else {
$count2 = $this->mdCustomers->count(array_merge($where_c, ['of_id' => $k]));//客户数
if ($count2) {
$customers += $count2;
$customers_info .= "<br>{$v['name']}{$count2}";
}
$count2 = $this->mdCustomers->count(array_merge($where_dt, ['of_id' => $k]));//进店人数
if ($count2) {
$c_num += $count2;
$c_num_info .= "<br>{$v['name']}{$count2}";
}
}
$sum2 = $this->mdUsersLog->sum("order_{$k}", $where);//订单数
if ($sum2['order_' . $k]) {
$orders += $sum2['order_' . $k];
$orders_info .= "<br>{$v['name']}{$sum2['order_'.$k]}";
}
}
$menus[] = ['title' => "客户数", 'note' => $customers ? "总数:{$customers}{$customers_info}" : '0人'];
$menus[] = ['title' => "进店人数", 'note' => $c_num ? "总数:{$c_num}{$c_num_info}" : '0人'];
$menus[] = ['title' => "订单数", 'note' => $orders ? "总数:{$orders}{$orders_info}" : '0个'];
$sum = $this->mdUsersLog->sum('t_num', $where);
$menus[] = ['title' => "试驾数", 'value' => intval($sum['t_num']), 'tag' => '次'];
$sum = $this->mdUsersLog->sum('defeats', $where);
$menus[] = ['title' => "战败数", 'value' => intval($sum['defeats']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('bills', $where);
$menus[] = ['title' => "开票数", 'value' => intval($sum['bills']), 'tag' => '个'];
$where_user && $where_qy["userid in(select userid from lc_app_licheb_users where $where_user)"] = null;
$qy_adds = $this->mdWechatqyLog->count($where_qy);
$menus[] = ['title' => "企微数", 'value' => $qy_adds, 'tag' => '人'];
$sum = $this->mdUsersLog->sum('reassigns', $where);
$menus[] = ['title' => "改派数", 'value' => intval($sum['reassigns']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('receives', $where);
$menus[] = ['title' => "接收数", 'value' => intval($sum['receives']), 'tag' => '个'];
$data['menus'] = $menus;
}
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$data['lists'] = $lists;
$data['params'] = $params;
$data['_title'] = "门店日志";
return $data;
}
private function dataUsersSelect($params)
{
$_title = '顾问日志';
$lists = $where = [];
if ($params['uname']) {
$where["sale_id in(select id from lc_app_licheb_users where uname like '%{$params['uname']}%')"] = null;
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
if ($res_biz) {
$str_ids = implode(',', array_column($res_biz, 'id'));
$where["biz_id in ({$str_ids})"] = null;
} else {
$where['biz_id'] = -2;
}
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['biz_id'] = '';
}
if ($params['type']) {
$where["type"] = $params['type'];
} else {
$params['type'] = '';
$re_biz = $this->mdBiz->get(['id' => $params['biz_id']]);
$re_biz && $_title = $re_biz['biz_name'] . '_顾问日志';
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
@@ -71,54 +262,46 @@ class Userslog extends HD_Controller
}
$total = $this->mdUsersLog->count($where);
if ($total) {
$res = $this->mdUsersLog->select($where, "id desc", $params['page'], $params['size']);
$sale_ids = $biz_ids = [];
$res = $this->mdUsersLog->select($where, "log_date desc,id desc", $params['page'], $params['size']);
$sale_ids = [];
foreach ($res as $v) {
$v['sale_id'] && !in_array($v['sale_id'], $sale_ids) && $sale_ids[] = $v['sale_id'];
$v['biz_id'] && !in_array($v['biz_id'], $biz_ids) && $biz_ids[] = $v['biz_id'];
}
$map_sale = $map_biz = $map_city = [];
$map_sale = [];
if ($sale_ids) {
$str_ids = implode(',', $sale_ids);
$map_sale = $this->mdUsers->map('id', 'uname', ["id in ({$str_ids})" => null]);
}
if ($biz_ids) {
$str_ids = implode(',', $biz_ids);
$map_biz = $this->mdBiz->map('id', 'biz_name,type', ["id in ({$str_ids})" => null]);
}
$offlineSources = $this->mdCustomers->offlineSources();
$typeAry = $this->mdBiz->type_ary();
foreach ($res as $v) {
$uname = $biz_name = $biz_type = $customers_info = '';
$customers = 0;
$map_sale[$v['sale_id']] && $uname = $map_sale[$v['sale_id']];
$map_biz[$v['biz_id']]['biz_name'] && $biz_name = $map_biz[$v['biz_id']]['biz_name'];
$map_biz[$v['biz_id']]['type'] && $biz_type = $typeAry[$map_biz[$v['biz_id']]['type']];
$temp = ['uname' => $uname, 'biz_type' => $biz_type, 'biz_name' => $biz_name, 'defeats' => $v['defeats']
, 'c_num' => $v['c_num'], 'a_num' => $v['a_num'], 't_num' => $v['t_num'], 'orders' => $v['orders'], 'bills' => $v['bills']
, 'follows' => $v['follows'], 'qy_adds' => $v['qy_adds'], 'qy_dels' => $v['qy_dels'], 'log_date' => $v['log_date']];
$uname = $map_sale[$v['sale_id']] ? $map_sale[$v['sale_id']] : '';
$temp = ['uname' => $uname, 't_num' => $v['t_num'], 'defeats' => $v['defeats'], 'bills' => $v['bills']
, 'qy_adds' => $v['qy_adds'], 'qy_dels' => $v['qy_dels'], 'log_date' => $v['log_date']];
$customer_json = $v['customer_json'] ? json_decode($v['customer_json'], true) : [];
$c_num_json = $v['customer_json'] ? json_decode($v['c_num_json'], true) : [];
$order_json = $v['customer_json'] ? json_decode($v['order_json'], true) : [];
$customers = $c_num = $orders = 0;
foreach ($offlineSources as $key1 => $value1) {
$nums = intval($v['customer_' . $key1]);
$nums_c_num = intval($v['c_num_' . $key1]);
$nums_orders = intval($v['order_' . $key1]);
$nums && $customers += $nums;
$nums_c_num && $c_num += $nums_c_num;
$nums_orders && $orders += $nums_orders;
if ($params['size'] == 10000) {//导出使用
$temp['customer_' . $key1] = $nums;
$temp['c_num_' . $key1] = $nums_c_num;
$temp['order_' . $key1] = $nums_orders;
foreach ($value1['list'] as $key2 => $value2) {
$temp['customer_' . $key2] = intval($customer_json[$key1]['list'][$key2]['num']);
}
}
if ($nums) {
$customers += $nums;
if ($params['size'] != 10000) {
if ($customers_info) {
$customers_info = $customers_info . '+' . $value1['name'] . '(' . $nums . ')';
} else {
$customers_info = $value1['name'] . '(' . $nums . ')';
}
$temp['c_num_' . $key2] = intval($c_num_json[$key1]['list'][$key2]['num']);
$temp['order_' . $key2] = intval($order_json[$key1]['list'][$key2]['num']);
}
}
}
$customers_info && $customers = $customers . '=' . $customers_info;
$temp['customers'] = $customers;
$temp['c_num'] = $c_num;
$temp['orders'] = $orders;
$lists[] = $temp;
}
}
@@ -126,14 +309,11 @@ class Userslog extends HD_Controller
$sum = $this->mdUsersLog->sum('customers', $where);
$menus[] = ['title' => "客户数", 'value' => intval($sum['customers']), 'tag' => '人'];
$sum_c = $this->mdUsersLog->sum('c_num', $where);
$sum = $this->mdUsersLog->sum('a_num', $where);
$menus[] = ['title' => "进店人数/进店次数", 'value' => intval($sum_c['c_num']) . '人 / ' . intval($sum['a_num']), 'tag' => '人次'];
$sum = $this->mdUsersLog->sum('t_num', $where);
$menus[] = ['title' => "试驾数", 'value' => intval($sum['t_num']), 'tag' => '次'];
$sum = $this->mdUsersLog->sum('follows', $where);
$menus[] = ['title' => "跟进数", 'value' => intval($sum['follows']), 'tag' => '个'];
$menus[] = ['title' => "进店人数", 'value' => intval($sum_c['c_num']), 'tag' => '人'];
$sum = $this->mdUsersLog->sum('orders', $where);
$menus[] = ['title' => "订单数", 'value' => intval($sum['orders']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('t_num', $where);
$menus[] = ['title' => "试驾数", 'value' => intval($sum['t_num']), 'tag' => '次'];
$sum = $this->mdUsersLog->sum('defeats', $where);
$menus[] = ['title' => "战败数", 'value' => intval($sum['defeats']), 'tag' => '个'];
$sum = $this->mdUsersLog->sum('bills', $where);
@@ -147,7 +327,63 @@ class Userslog extends HD_Controller
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$data['lists'] = $lists;
$data['params'] = $params;
$data['_title'] = "顾问日志";
$data['_title'] = $_title;
return $data;
}
public function visitSelect($params)
{
$_title = '顾问日志';
$lists = $where = [];
if ($params['uname']) {
$where["sales_id in(select id from lc_app_licheb_users where uname like '%{$params['uname']}%')"] = null;
}
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
$re_biz = $this->mdBiz->get(['id' => $params['biz_id']]);
$re_biz && $_title = $re_biz['biz_name'] . '_顾问日志';
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["t_day>="] = $time[0];
$time[1] && $where["t_day<="] = $time[1];
}
$total = $this->mdCustomerVisitSales->count($where);
if ($total) {
$res = $this->mdCustomerVisitSales->select($where, "t_day desc,id desc", $params['page'], $params['size']);
$sales_ids = [];
foreach ($res as $v) {
$v['sales_id'] && !in_array($v['sales_id'], $sales_ids) && $sales_ids[] = $v['sales_id'];
}
$map_sale = [];
if ($sales_ids) {
$str_ids = implode(',', $sales_ids);
$map_sale = $this->mdUsers->map('id', 'uname', ["id in ({$str_ids})" => null]);
}
foreach ($res as $v) {
$uname = '';
$map_sale[$v['sales_id']] && $uname = $map_sale[$v['sales_id']];
$follows = $v['t_follows'] + $v['h_follows'] + $v['w_follows'];
$temp = ['uname' => $uname, 'follows' => $follows, 't_follows' => $v['t_follows']
, 'h_follows' => $v['h_follows'], 'w_follows' => $v['w_follows'], 't_day' => $v['t_day']];
$lists[] = $temp;
}
}
if ($params['size'] != 10000) {
$sum_h = $this->mdCustomerVisitSales->sum('h_follows', $where);
$sum_t = $this->mdCustomerVisitSales->sum('t_follows', $where);
$sum_w = $this->mdCustomerVisitSales->sum('w_follows', $where);
$sum = $sum_h['h_follows'] + $sum_t['t_follows'] + $sum_w['w_follows'];
$menus[] = ['title' => "计划跟进数", 'value' => intval($sum), 'tag' => '个'];
$menus[] = ['title' => "已跟进数", 'value' => intval($sum_h['h_follows']), 'tag' => '个'];
$menus[] = ['title' => "新增未跟进数", 'value' => intval($sum_t['t_follows']), 'tag' => '个'];
$menus[] = ['title' => "逾期未跟进数", 'value' => intval($sum_w['w_follows']), 'tag' => '个'];
$data['menus'] = $menus;
}
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$data['lists'] = $lists;
$data['params'] = $params;
$data['_title'] = $_title;
return $data;
}
@@ -177,32 +413,108 @@ class Userslog extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->dataSelect($params);
$fileName = $res['_title'];
$offlineSources = $this->mdCustomers->offlineSources();
foreach ($res['lists'] as $key => $value) {
$data[] = $value;
}
$indexs = ['biz_name' => '门店', 'uname' => '顾问', 'customers' => '客户数'];
foreach ($offlineSources as $key1 => $value1) {
$indexs['customer_' . $key1] = '【' . $value1['name'] . '】';
foreach ($value1['list'] as $key2 => $value2) {
$indexs['customer_' . $key2] = $value2;
}
}
$indexs['c_num'] = '进店人数';
$indexs['a_num'] = '进店次数';
$indexs['t_num'] = '试驾数';
$indexs['follows'] = '跟进数';
$indexs['orders'] = '订单数';
$indexs['defeats'] = '战败数';
$indexs['bills'] = '开票数';
$indexs['qy_adds'] = '新增企微';
$indexs['qy_dels'] = '删除企微';
$indexs['log_date'] = '日期';
array_unshift($data, $indexs);
$data = $indexs = [];
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
if ($params['tab'] == 1) {//客户统计
$res = $this->dataUsersSelect($params);
$offlineSources = $this->mdCustomers->offlineSources();
$fileName = $res['_title'] . '_' . $this->tabAry[$params['tab']] . "_" . date('YmdHis');
$list[1] = ['顾问', '日期', '客户数', '进店人数', '订单数', '试驾数', '战败数', '开票数', '新增企微', '删除企微'];
$list[2] = ['顾问', '日期', '客户数'];
$list[3] = ['顾问', '日期', '进店人数'];
$list[4] = ['顾问', '日期', '订单数'];
foreach ($offlineSources as $k1 => $v1) {
$list[2][] = "{$v1['name']}";
$list[3][] = "{$v1['name']}";
$list[4][] = "{$v1['name']}";
foreach ($v1['list'] as $k2 => $v2) {
$list[2][] = $v2;
$list[3][] = $v2;
$list[4][] = $v2;
}
}
//第一条标题
$sheet['总览'][] = $list[1];
$sheet['客户'][] = $list[2];
$sheet['进店'][] = $list[3];
$sheet['订单'][] = $list[4];
foreach ($res['lists'] as $k => $v) {
$list[1] = [$v['uname'], $v['log_date'], $v['customers'], $v['c_num'], $v['orders'], $v['t_num'], $v['defeats']
, $v['bills'], $v['qy_adds'], $v['qy_dels']];
$list[2] = [$v['uname'], $v['log_date'], $v['customers']];
$list[3] = [$v['uname'], $v['log_date'], $v['c_num']];
$list[4] = [$v['uname'], $v['log_date'], $v['orders']];
foreach ($offlineSources as $k2 => $v2) {
$list[2][] = $v['customer_' . $k2];
$list[3][] = $v['c_num_' . $k2];
$list[4][] = $v['order_' . $k2];
foreach ($v2['list'] as $k3 => $v3) {
$list[2][] = $v['customer_' . $k3];
$list[3][] = $v['c_num_' . $k3];
$list[4][] = $v['order_' . $k3];
}
}
$sheet['总览'][] = $list[1];
$sheet['客户'][] = $list[2];
$sheet['进店'][] = $list[3];
$sheet['订单'][] = $list[4];
}
$this->excel->exportExcel($sheet, $fileName);
} else if ($params['tab'] == 2) {//回访统计
$res = $this->visitSelect($params);
$indexs = ['biz_name' => '门店', 'uname' => '顾问', 'follows' => '计划跟进数', 'h_follows' => '已跟进数'
, 't_follows' => '今日新增未跟进数', 'w_follows' => '逾期未跟进数', 't_day' => '日期'];
$fileName = $res['_title'] . '_' . $this->tabAry[$params['tab']];
foreach ($res['lists'] as $key => $value) {
$data[] = $value;
}
array_unshift($data, $indexs);
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
} else {//门店统计
$res = $this->dataBizSelect($params);
$offlineSources = $this->mdCustomers->offlineSources();
$fileName = $res['_title'] . "_" . date('YmdHis');
$list[1] = ['门店', '日期', '客户数', '进店人数', '订单数', '试驾数', '战败数', '开票数', '企微数', '改派数', '接收数'];
$list[2] = ['门店', '日期', '客户数'];
$list[3] = ['门店', '日期', '进店人数'];
$list[4] = ['门店', '日期', '订单数'];
foreach ($offlineSources as $k1 => $v1) {
$list[2][] = "{$v1['name']}";
$list[3][] = "{$v1['name']}";
$list[4][] = "{$v1['name']}";
foreach ($v1['list'] as $k2 => $v2) {
$list[2][] = $v2;
$list[3][] = $v2;
$list[4][] = $v2;
}
}
//第一条标题
$sheet['总览'][] = $list[1];
$sheet['客户'][] = $list[2];
$sheet['进店'][] = $list[3];
$sheet['订单'][] = $list[4];
foreach ($res['lists'] as $k => $v) {
$list[1] = [$v['biz_name'], $v['log_date'], $v['customers'], $v['c_num'], $v['orders'], $v['t_num'], $v['defeats']
, $v['bills'], $v['qy_adds'], $v['reassigns'], $v['receives']];
$list[2] = [$v['biz_name'], $v['log_date'], $v['customers']];
$list[3] = [$v['biz_name'], $v['log_date'], $v['c_num']];
$list[4] = [$v['biz_name'], $v['log_date'], $v['orders']];
foreach ($offlineSources as $k2 => $v2) {
$list[2][] = $v['customer_' . $k2];
$list[3][] = $v['c_num_' . $k2];
$list[4][] = $v['order_' . $k2];
foreach ($v2['list'] as $k3 => $v3) {
$list[2][] = $v['customer_' . $k3];
$list[3][] = $v['c_num_' . $k3];
$list[4][] = $v['order_' . $k3];
}
}
$sheet['总览'][] = $list[1];
$sheet['客户'][] = $list[2];
$sheet['进店'][] = $list[3];
$sheet['订单'][] = $list[4];
}
$this->excel->exportExcel($sheet, $fileName);
}
}
}
+22 -1
View File
@@ -52,6 +52,7 @@ class Template extends HD_Controller
$setValue['title'] = $value['title'];
$setValue['type_name'] = $this->mdTemplate->typeAry()[$value['type']];
$setValue['status_name'] = $this->mdTemplate->statusAry()[$value['status']];
$setValue['status'] = $value['status'];
$brands = '';
if ($value['brand_ids']) {
$res_b = $this->mdAutoBrand->select(array("id in ({$value['brand_ids']})" => null, 'status' => 1), "id desc", 0, 0, 'name');
@@ -391,7 +392,27 @@ class Template extends HD_Controller
//批量操作(默认修改状态)
public function batch()
{
$field = $this->input->post('field');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
$ids = explode(',', $ids);
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$ids_str = implode(',', $ids);
$where = ["id in({$ids_str})" => null];
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
if (!$id) {
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
}
$data['status'] = $status;
$this->mdTemplate->update($data, $where);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//导出数据列表
+56 -40
View File
@@ -7,20 +7,24 @@
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Attr extends HD_Controller{
class Attr extends HD_Controller
{
public function __construct(){
public function __construct()
{
parent::__construct();
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_attr_model');
}
public function index(){
public function index()
{
$this->lists();
}
public function lists(){
public function lists()
{
$params = $this->input->get();
$page = $this->input->get('page');
!$page && $page = 1;
@@ -28,12 +32,13 @@ class Attr extends HD_Controller{
$where["status > -1"] = null;
$params['title'] && $where["title like '%{$params['title']}%'"] = null;
if($params['s_id']){
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
}if($params['brand_id']){
}
if ($params['brand_id']) {
$where_sery = array('status > -1' => null, 'brand_id' => $params['brand_id']);
$rows_sery = $this->auto_series_model->select($where_sery, 'id desc', 0, 0, 'id');
if($rows_sery){
if ($rows_sery) {
$sery_ids = array_column($rows_sery, 'id');
$str_ids = implode(',', $sery_ids);
$where["s_id in ({$str_ids})"] = null;
@@ -51,20 +56,21 @@ class Attr extends HD_Controller{
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0, 0, 'id, name');
$list = [];
if($rows){
$series_arr = array_column($rows,'s_id');
$series_rows = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
foreach($rows as $key=>$val){
if ($rows) {
$series_arr = array_column($rows, 's_id');
$series_rows = $this->auto_series_model->get_map_by_ids($series_arr, 'id,name');
foreach ($rows as $key => $val) {
$list[] = [
'id' => $val['id'],
'title' => $val['title'],
's_name' => $series_rows[$val['s_id']] ? $series_rows[$val['s_id']][0]['name'] : '',
'status_name' => $status_arr[$val['status']],
'status' => $val['status'],
'type_cn' => $type_arr[$val['type']],
'c_time' => date('Y-m-d H:i:s',$val['c_time'])
'c_time' => date('Y-m-d H:i:s', $val['c_time'])
];
}
}
@@ -76,7 +82,8 @@ class Attr extends HD_Controller{
$this->show_view('auto/attr/lists', true);
}
public function get(){
public function get()
{
$id = $this->input->get('id');
$info = [
@@ -87,11 +94,11 @@ class Attr extends HD_Controller{
if (!$info || empty($info)) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$info['jsondata'] = json_decode($info['jsondata'],true);
$info['jsondata'] = json_decode($info['jsondata'], true);
$info['jsondata']['img'] && $info['jsondata']['s_img'] = build_qiniu_image_url($info['jsondata']['img']);
}
$brand_id= '';
if($info['s_id']){
$brand_id = '';
if ($info['s_id']) {
$row_sery = $this->auto_series_model->get(array('id' => $info['s_id']));
$brand_id = $row_sery['brand_id'];
}
@@ -103,10 +110,11 @@ class Attr extends HD_Controller{
$this->data['type_arr'] = $type_arr;
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑' : '新增';
return $this->show_view('auto/attr/edit',true);
return $this->show_view('auto/attr/edit', true);
}
public function add(){
public function add()
{
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
@@ -120,7 +128,7 @@ class Attr extends HD_Controller{
'type' => $post['type'],
'c_time' => time()
];
$post['jsondata'] && $add_data['jsondata'] = json_encode($post['jsondata'],JSON_UNESCAPED_UNICODE);
$post['jsondata'] && $add_data['jsondata'] = json_encode($post['jsondata'], JSON_UNESCAPED_UNICODE);
$result = $this->auto_attr_model->add($add_data);
if (!$result) {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
@@ -128,13 +136,14 @@ class Attr extends HD_Controller{
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
}
public function edit(){
public function edit()
{
if (!$this->if_ajax) {
return $this->show_json(SYS_CODE_FAIL, '提交出错!');
}
$post = $this->input->post();
$row = $this->auto_attr_model->get(['id'=>$post['id']]);
if(!$row){
$row = $this->auto_attr_model->get(['id' => $post['id']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在');
}
if (!$post['title']) {
@@ -145,22 +154,33 @@ class Attr extends HD_Controller{
's_id' => $post['s_id'],
'type' => $post['type'],
];
$post['jsondata'] && $update['jsondata'] = json_encode($post['jsondata'],JSON_UNESCAPED_UNICODE);
$result = $this->auto_attr_model->update($update,['id'=>$row['id']]);
$post['jsondata'] && $update['jsondata'] = json_encode($post['jsondata'], JSON_UNESCAPED_UNICODE);
$result = $this->auto_attr_model->update($update, ['id' => $row['id']]);
if (!$result) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function del(){
public function del()
{
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$stauts = $this->input->post('status');
$where = ['id' => $id];
$this->auto_attr_model->update(['status' => $stauts], $where);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function batch(){
public function batch()
{
}
public function export(){
public function export()
{
}
@@ -168,39 +188,35 @@ class Attr extends HD_Controller{
* 属性选项列表
* @return bool
*/
function json_lists(){
function json_lists()
{
$s_id = $this->input->get_post('s_id');
$status = $this->input->get_post('status');
$type = $this->input->get_post('type');
$page = $this->input->get_post('page');
$size = $this->input->get_post('size');
$where = array();
$s_id && $where['s_id'] = $s_id;
strlen($type) > 0 && $where['type'] = $type;
if(strlen($status) > 0){
$where['status'] = $status;
if ($status == 3) {//搜索专用
$where['status'] = 1;
} else {
$where['status>-1'] = null;
$where['status>'] = -1;
}
$where['status>-1'] = null;
$total = $this->auto_attr_model->count($where);
$lists = array();
if($total){
if ($total) {
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->auto_attr_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
+8 -2
View File
@@ -20,6 +20,9 @@ class Business extends HD_Controller{
public function index()
{
$params = $this->input->get();
!isset($params['status']) && $params['status'] = 1;
!isset($params['if_effect']) && $params['if_effect'] = 1;
!isset($params['month']) && $params['month'] = '';
$where = array();
if($params['brand_id']){
@@ -60,8 +63,6 @@ class Business extends HD_Controller{
}
if($params['month']){
$where['month'] = $params['month'];
}elseif(!isset($params['month'])){
$where['month'] = $params['month'] = intval(date('m'));
}
$page = $params['page'];
$page = !$page ? 1 : $page;
@@ -124,6 +125,7 @@ class Business extends HD_Controller{
's_effect_time' => $v['s_effect_time'] ? date('Y-m-d',$v['s_effect_time']) : '',
'effect_status' => $v['if_effect'] ? '生效中' : '未生效',
'if_effect' => $v['if_effect'],
'delivery_day' => $v['delivery_day']
);
}
}
@@ -163,6 +165,7 @@ class Business extends HD_Controller{
'price_floor' => $row['price_floor'],
'price_color' => $row['price_color'],
'price_coplus' => $row['price_coplus'],
'proxy_profix_car' => $row['proxy_profix_car'],
'profix_car' => $row['profix_car'],
'profix_carno' => $row['profix_carno'],
'profix_insure' => $row['profix_insure'],
@@ -190,6 +193,7 @@ class Business extends HD_Controller{
'price_floor' => 0.00,
'price_color' => 0.00,
'price_coplus' => 0.00,
'proxy_profix_car' => 0.00,
'profix_car' => 0.00,
'profix_carno' => 0.00,
'profix_insure' => 0.00,
@@ -246,6 +250,7 @@ class Business extends HD_Controller{
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
$info['price_color'] && $data['price_color'] = $info['price_color'];
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
$info['profix_insure'] && $data['profix_insure'] = $info['profix_insure'];
@@ -297,6 +302,7 @@ class Business extends HD_Controller{
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
$info['price_color'] && $data['price_color'] = $info['price_color'];
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
$info['profix_insure'] && $data['profix_insure'] = $info['profix_insure'];
+150
View File
@@ -0,0 +1,150 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Fine extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('receiver/receiver_fine_model');
$this->load->model('biz/biz_model');
}
public function index()
{
$this->lists();
}
public function lists(){
$params = $this->input->get();
$params['id'] && $_SESSION['srv_biz_id'] = $params['id'];
!strlen($params['status']) && $params['status'] = '';
$page = $params['page'] ? $params['page'] : 1;
$pagesize = 20;
$where = [
'status>=' => 0,
'biz_id' => $_SESSION['srv_biz_id']
];
strlen($params['status']) && $where['status'] = $params['status'];
$params['title'] && $where['title'] = $params['title'];
$count = $this->receiver_fine_model->count($where);
$lists = [];
if($count){
$rows = $this->receiver_fine_model->select($where, 'id desc', $page, $pagesize);
$biz_ids = array_unique(array_column($rows,'biz_id'));
$map_biz = [];
if(is_array($biz_ids)){
$biz_ids = implode(',',array_filter($biz_ids));
$where_biz = ["id in ({$biz_ids})" => null];
$map_biz = $this->biz_model->map('id', 'biz_name', $where_biz, '', 0, 0, 'id,biz_name');
}
foreach ($rows as $val) {
$lists[] = [
'id' => $val['id'],
'biz_id' => $val['biz_id'],
'biz_name' => $map_biz[$val['biz_id']],
'title' => $val['title'],
'price' => $val['price'],
'status_cn' => $this->receiver_fine_model->get_status($val['status']),
'c_time' => date('Y-m-d H:i',$val['c_time']),
'status' => $val['status'],
];
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '门店精品成本列表';
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
$this->show_view('biz/fine/lists', true);
}
public function get(){
$biz_id = $_SESSION['srv_biz_id'];
$id = $this->input->get('id');
if(!$biz_id){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$row = $this->receiver_fine_model->get(['id'=>$id]);
$info = [
'biz_id' => $biz_id,
'title' => '',
'price' => '',
'action' => 'biz/fine/add',
];
if($row){
$info['id'] = $row['id'];
$info['title'] = $row['title'];
$info['price'] = $row['price'];
$info['action'] = 'biz/fine/edit';
}
$this->data['info'] = $info;
$this->show_view('biz/fine/get');
}
public function add(){
$info = $this->input->post('info');
$data = [
'biz_id' => $info['biz_id'],
'title' => $info['title'],
'price' => $info['price'],
'status' => 1,
'c_time' => time(),
];
$res = $this->receiver_fine_model->add($data);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function edit(){
$info = $this->input->post('info');
$row = $this->receiver_fine_model->get(['id'=>$info['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$data = [
'title' => $info['title'],
'price' => $info['price'],
];
$res = $this->receiver_fine_model->update($data,['id'=>$info['id']]);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function del()
{
}
public function batch()
{
$field = $this->input->post('field');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
$ids = explode(',', $ids);
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$ids_str = implode(',', $ids);
$where = ["id in({$ids_str})" => null];
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
if (!$id) {
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
}
$data['status'] = $status;
$this->receiver_fine_model->update($data, $where);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function export(){
}
}
+182
View File
@@ -0,0 +1,182 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Seprice extends HD_Controller
{
private $employee_price_arr = ['3000.00','4000.00','5000.00'];
public function __construct()
{
parent::__construct();
$this->load->model('biz/biz_model');
$this->load->model("biz/biz_info_model");
$this->load->model('biz/biz_settle_price_model');
$this->load->model('auto/auto_business_model');
}
public function index()
{
$this->lists();
}
public function lists()
{
$params = $this->input->get();
$page = $params['page'] ? $params['page'] : 1;
$size = $params['size'] ? $params['size'] : 50;
!strlen($params['status']) && $params['status'] = '';
!strlen($params['year']) && $params['year'] = date('Y');
!strlen($params['month']) && $params['month'] = '';
$biz_row = $this->biz_model->get(['id'=>$params['biz_id']]);
if(!$biz_row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$where = [
'biz_id' => $biz_row['id'],
'status>=' => 0,
'year' => date('Y')
];
strlen($params['status']) && $where['status'] = $params['status'];
strlen($params['year']) && $where['year'] = $params['year'];
strlen($params['month']) && $where['month'] = $params['month'];
$lists = [];
$total = $this->biz_settle_price_model->count($where);
if($total){
$rows = $this->biz_settle_price_model->select($where,'id desc',$page,$size);
foreach ($rows as $item) {
$temp = [
'id' => $item['id'],
'money_json' => $this->biz_settle_price_model->get_jsondata($item['money_json']),
'show_time' => "{$item['year']}-{$item['month']}",
'status' => $item['status'],
'status_cn' => $item['status'] ? '正常' : '禁用',
'c_time' => date('Y-m-d H:i',$item['c_time'])
];
$lists[] = $temp;
}
}
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
$this->data['_title'] = "{$biz_row['biz_name']}-费用管理";
$this->show_view('biz/seprice/lists',true);
}
public function get(){
$params = $this->input->get();
$row = $this->biz_settle_price_model->get(['id'=>$params['id']]);
$info = [];
if($row){
$info['id'] = $row['id'];
$info['money_json'] = json_decode($row['money_json'],true);
$info['year'] = $row['year'];
$info['month'] = $row['month'];
$info['action'] = '/biz/seprice/edit';
$biz_id = $params['biz_id'];
}else{
$biz_row = $this->biz_model->get(['id'=>$params['biz_id']]);
if(!$biz_row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$biz_id = $biz_row['id'];
$biz_info_row = $this->biz_info_model->get(['biz_id'=>$biz_id]);
$jsondata = json_decode($biz_info_row['jsondata'],true);
$info['money_json'] = [
'rent' => $biz_info_row['rent'] ? $biz_info_row['rent'] : '',
'base_manager' => $biz_info_row['manager_wage'] ? $biz_info_row['manager_wage'] : '',
'employee_wage' => $biz_info_row['employee_wage'] ? $biz_info_row['employee_wage'] : '',
'wat_ele' => $biz_info_row['wat_ele'] ? $biz_info_row['wat_ele'] : '',
'media' => $biz_info_row['margin'] ? $biz_info_row['margin'] : '',
'commission' => $biz_info_row['commission'] ? $biz_info_row['commission'] : '',
'num' => $biz_info_row['num'],
'trucking' => '',
'drive' => $jsondata['car_rent'] ? $jsondata['car_rent'] : '',
'marketing' => $jsondata['marketing'] ? $jsondata['marketing'] : '',
'door_step' => $jsondata['door_step'] ? $jsondata['door_step'] : '',
];
$info['year'] = date('Y');
$info['month'] = intval(date('m'));
$info['action'] = '/biz/seprice/add';
}
$info['biz_id'] = $biz_id;
$this->data['info'] = $info;
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['employee_price_arr'] = $this->employee_price_arr;
$this->show_view('biz/seprice/get');
}
public function add(){
$info = $this->input->post('info');
$employee_price_list = $this->input->post('employee_price_list');
$biz_row = $this->biz_model->get(['id'=>$info['biz_id']]);
if(!$biz_row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$data = [
'money_json' => json_encode($info['money_json'],JSON_UNESCAPED_UNICODE),
'biz_id' => $info['biz_id'],
'year' => $info['year'],
'month' => $info['month'],
'c_time' => time()
];
$res = $this->biz_settle_price_model->add($data);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function edit(){
$info = $this->input->post('info');
$row = $this->biz_settle_price_model->get(['id'=>$info['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$data = [
'money_json' => json_encode($info['money_json'],JSON_UNESCAPED_UNICODE),
'year' => $info['year'],
'month' => $info['month'],
];
$res = $this->biz_settle_price_model->update($data,['id'=>$info['id']]);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function edit_status(){
$id = $this->input->post('id');
$value = $this->input->post('value');
$row = $this->biz_settle_price_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$update = [
'status' => $value ? 0 : 1
];
$res = $this->biz_settle_price_model->update($update,['id'=>$id]);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function del()
{
}
public function batch()
{
}
public function export(){
}
}
+301 -65
View File
@@ -5,11 +5,6 @@ require_once COMMPATH.'third_party/PHPExcel.php';
class Settle extends HD_Controller
{
private $biz_type = [
1 => ['liche' => 0.25 , 'partner' => 0.75],
2 => ['liche' => 0.35 , 'partner' => 0.65],
];
public function __construct()
{
parent::__construct();
@@ -20,12 +15,18 @@ class Settle extends HD_Controller
$this->load->model('items/items_model');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model('receiver/order/receiver_order_datas_model');
$this->load->model('receiver/order/receiver_order_loans_model','order_loans_model');
$this->load->model('receiver/receiver_fine_model');
$this->load->model('biz/biz_model');
$this->load->model('biz/biz_settle_model');
$this->load->model('biz/biz_settle_srv_model');
$this->load->model('biz/biz_settle_static_model');
$this->load->model('biz/biz_info_model');
$this->load->model('biz/biz_trucking_model');
$this->load->library('receiver/orders_v2_entity');
$this->load->library('receiver/settle_entity');
}
public function index()
@@ -36,7 +37,6 @@ class Settle extends HD_Controller
public function lists()
{
$params = $this->input->get();
$where = array();
$t1 = 'lc_biz_settle';
$t2 = 'lc_receiver_orders_v2';
@@ -86,7 +86,7 @@ class Settle extends HD_Controller
$lists = array();
if($total){
$orderby = "$t1.id desc";
$select = "$t1.*,$t2.sid,$t2.name,$t2.mobile,$t2.s_id,$t2.v_id,$t2.brand_id,$t2.cor_id,$t2.item_id";
$select = "$t1.*,$t2.sid,$t2.name,$t2.mobile,$t2.s_id,$t2.v_id,$t2.brand_id,$t2.cor_id,$t2.item_id,$t2.money_json as o_money_json,$t2.srv_ids";
$rows = $this->biz_settle_model->selectOrders($where, $orderby, $page, $size,0, $select);
if($rows){
$s_ids = array_unique(array_filter(array_column($rows,'s_id')));
@@ -123,26 +123,45 @@ class Settle extends HD_Controller
foreach($rows as $v){
$title = "{$map_brand[$v['brand_id']]} {$map_sery[$v['s_id']]} {$map_attr[$v['v_id']]} {$map_attr[$v['cor_id']]}";
$month = date('Y-m',strtotime("{$v['year']}-{$v['month']}"));
$money_json = json_decode($v['money_json'],true);
$o_money_json = json_decode($v['o_money_json'],true);
$sum_srv = $v['profix_insure']+$v['profix_carno']+$v['profix_loan']+$v['profix_fine'];
$srv_json = json_decode($v['srv_ids'],true);
$srv_loan = 0;
if($v['profix_loan']>0 && $srv_json){
foreach ($srv_json as $v2) {
if($v2['key']=='price_finance'){
$srv_loan = $v2['price'];
break;
}
}
}
$lists[] = array(
'id' => $v['id'],
'o_id' => $v['o_id'],
'title' => $title,
'biz_name' => $map_biz[$v['biz_id']],
'profix_car' => $v['profix_car'],
'profix_car_after' => sprintf("%.2f",$v['profix_car']/1.13),
'profix_insure' => $v['profix_insure'],
'profix_carno' => $v['profix_carno'],
'profix_loan' => $v['profix_loan'],
'srv_json' => $srv_loan,
'profix_fine' => $v['profix_fine'],
'sum_srv' => $sum_srv,
'sum_srv_after' => $params['_biz_type']==1 ? sprintf("%.2f",$sum_srv/1.13) : sprintf("%.2f",$sum_srv/1.06),
'price_trucking' => $v['price_trucking'],
'name' => $v['name'],
'mobile' => $v['mobile'],
'sid' => $v['sid'],
'month' => $month,
'vin' => $map_item[$v['item_id']]
'vin' => $map_item[$v['item_id']],
'money_json' => is_array($money_json) ? $money_json : [],
'o_money_json' => $o_money_json
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['brandAry'] = $map_brand;
@@ -150,7 +169,8 @@ class Settle extends HD_Controller
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
$this->data['_title'] = '商家结算管理';
$this->show_view('biz/settle/lists',true);
$view = $params['_biz_type']==1 ? 'biz/settle/lists_brand' : 'biz/settle/lists';
$this->show_view($view,true);
}
public function get(){
@@ -178,7 +198,7 @@ class Settle extends HD_Controller
$biz_id = $this->input->get('id');
$month = $this->input->get('month');
$year = date('Y');
!$month && $month = intval(date('m'));
!$month && $month = intval(date('m',strtotime("-1 month")));;
$where = [
'biz_id' => $biz_id,
'year' => $year,
@@ -235,12 +255,15 @@ class Settle extends HD_Controller
$all_rows = $this->biz_settle_model->selectOrders($where, $orderby, 0, 0,0, $select);
$sheet_data2 = [];
if($all_rows){
$sheet_data2[] = ['门店','订单信息','品牌车型','车架号','单车利润','保险利润','贷款利润','挂牌利润','拖车费','时间'];
$sheet_data2[] = ['门店','订单信息','品牌车型','车架号','单车利润','保险利润','贷款利润','挂牌利润','水平业务合计','拖车费','时间'];
$s_ids = array_unique(array_filter(array_column($all_rows,'s_id')));
$cor_ids = array_unique(array_filter(array_column($all_rows,'cor_id')));
$v_ids = array_unique(array_filter(array_column($all_rows,'v_id')));
$attr_ids = array_merge($cor_ids,$v_ids);
$item_ids = array_unique(array_filter(array_column($all_rows,'item_id')));
//获取品牌map
$where_brand = array('status > -1' => null);
$map_brand = $this->auto_brand_model->map('id', 'name', $where_brand, 'id desc', 0 , 0, 'id, name');
//获取车系列表
$map_sery = array();
if($s_ids){
@@ -273,6 +296,7 @@ class Settle extends HD_Controller
$v['profix_insure'],
$v['profix_loan'],
$v['profix_carno'],
$v['profix_insure']+$v['profix_loan']+$v['profix_carno'],
$v['price_trucking'],
$month_str,
);
@@ -364,6 +388,8 @@ class Settle extends HD_Controller
$temp['total_need'] = $v['rent'] + $v['wat_ele'] + $v['manager_wage'] + $v['employee_wage'] + $v['commission'] + $v['price_trucking'];
$temp['price_ml'] = $v['price_total'] - $temp['total_need'];
$temp['profix_partner'] = $v['profix_partner'] + $v['profix_partner_oflow'];
$temp['money_json'] = json_decode($v['money_json'],true);
$temp['price_all_after'] = sprintf("%.2f",$v['price_all']/1.13);
$lists[] = $temp;
}
}
@@ -375,71 +401,34 @@ class Settle extends HD_Controller
$this->data['type_arr'] = $this->biz_settle_static_model->other_price_type();
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page,'totle'=>$total);
$this->data['_title'] = '商家结算管理';
$this->show_view('biz/settle/lists_static',true);
$view = $params['_biz_type']==1 ? 'biz/settle/lists_static_brand' : 'biz/settle/lists_static';
$this->show_view($view,true);
}
//重新统计
public function edit_static(){
$id = $this->input->post('id');
$type = $this->input->post('type');
$row = $this->biz_settle_static_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$all_other = 0; //共同承担其它费用
$liche_other = 0; //狸车承担其它费用
$partner_other = 0; //合伙人承担其它费用
$price_other = json_decode($row['price_other'],true);
if($price_other){
foreach($price_other as $item){
if($item['type']==2){
$partner_other += $item['money'];
}elseif($item['type']==1){
$liche_other += $item['money'];
}else{
$all_other += $item['money'];
}
if($type){ //品牌
$res = $this->settle_entity->brand_static($row['id']);
if($res['code']){
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
}else{ //合伙人
$res = $this->settle_entity->re_static($row['id']);
if($res['code']){
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '操作失败');
}
}
$car_total = $this->biz_settle_model->count(['stic_id'=>$row['id']]);
$biz_info = $this->biz_info_model->get(['biz_id'=>$row['biz_id']]);
$type_config = $this->biz_type[$biz_info['type']];
$update = [
'rent' => $biz_info['rent'],
'wat_ele' => $biz_info['wat_ele'],
'manager_wage' => $biz_info['manager_wage'],
'commission' => $biz_info['commission']*$car_total,
];
$employee_wage = $biz_info['num'] ? ceil($car_total/$biz_info['num']) : 0;
$update['employee_wage'] = $employee_wage;
$settle_rows = $this->biz_settle_model->select(['stic_id'=>$row['id']],'id asc',0,0,'id,o_id');
if(is_array($settle_rows)){
$o_id_str = implode(',',array_column($settle_rows,'o_id'));
$order_rows = [];
if($o_id_str){
$where = [
"id in ($o_id_str)" => null
];
$order_rows = $this->receiver_orders_v2_model->map('id','brand_id',$where,0,0,'id,brand_id');
}
foreach($settle_rows as $val){
$auto_b_id = $order_rows[$val['o_id']] ? $order_rows[$val['o_id']] : 0;
$truck_row = $this->biz_trucking_model->get(['biz_id'=>$row['biz_id'],'auto_b_id'=>$auto_b_id,'status'=>1]);
$price = $truck_row ? $truck_row['money'] : 0;
$this->biz_settle_model->update(['price_trucking'=>$price],['id'=>$val['id']]);
}
}
$truck_sum = $this->biz_settle_model->sum('price_trucking',['stic_id' => $row['id']]);
$update['price_trucking'] = $truck_sum['price_trucking'];
$price_need = $update['rent'] + $update['wat_ele'] + $update['employee_wage'] + $update['manager_wage'] + $update['commission'] + $update['price_trucking'];
$price_ml = $row['price_total'] - $price_need - $all_other;
$update['profix_liche'] = $price_ml*$type_config['liche']-$liche_other;
$update['profix_partner'] = $price_ml*$type_config['partner']-$partner_other;
$this->biz_settle_static_model->update($update,['id'=>$row['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function add_price(){
@@ -473,4 +462,251 @@ class Settle extends HD_Controller
$this->data['type_arr'] = $this->biz_settle_static_model->other_price_type();
$this->show_view('biz/settle/add');
}
//更新品牌结算
public function edit_js(){
$params = $this->input->post();
$where = [
'biz_id' => $params['biz_id'],
'year' => $params['year'],
'month' => $params['month']
];
$rows = $this->biz_settle_model->select($where,'id desc');
if($rows){
$order_ids = implode(',',array_column($rows,'o_id'));
$order_rows = [];
if($order_ids){
$o_where = [
"id in ({$order_ids})" => null
];
$order_rows = $this->receiver_orders_v2_model->map('id','',$o_where,'','','');
}
foreach ($rows as $key => $val) {
$order = $order_rows[$val['o_id']][0];
if(!$order){
continue;
}
$info_json = json_decode($order['info_json'],true);
$money_json = json_decode($order['money_json'],true);
$bill_time_month = date('Y-m-d',strtotime($order['bill_time']));
$settle_money_json = [];
$settle_money_json['in'] = [ //收入
'profix_car' => 0, //整车
'srv_price' => $this->orders_v2_entity->order_srv_money($order['id']), //服务费
'commission' => 0, //佣金
];
$settle_money_json['out'] = [ //成本
'apply_price' => 0, //申请成本
'fine_price' => 0, //赠送精品成本
];
//获取创建订单时商务政策
$where = [
'id' => $info_json['business_id'],
];
$b_row_one = $this->auto_business_model->get($where);
$settle_money_json['in']['profix_car'] = $b_row_one['profix_car'] ? $b_row_one['profix_car']-$money_json['price_discount'] : 0;
//挂牌利润 = 实收 - 成本
$profix_carno = 0;
if($money_json['fee_carno']>0){
$where = [
'biz_id' => $order['biz_id'],
'type' => 1,
'status' => 1,
's_effect_time>=' => date('Y-m-01',strtotime($order['bill_time'])),
's_effect_time<=' => date('Y-m-t',strtotime($order['bill_time'])),
];
$free_row = $this->biz_settle_srv_model->get($where);
if(!$free_row){
$free_row = $this->biz_settle_srv_model->get(['biz_id'=>$order['biz_id'],'is_def'=>1,'status'=>1,'type'=>1]);
}
$free_jsondata = json_decode($free_row['jsondata'],true);
$cb_fee_carno = $free_jsondata['price'] ? $free_jsondata['price'] : 0;
$profix_carno = $money_json['fee_carno'] - $cb_fee_carno;
}
//保险利润 = 金额(是否含税) * 返点百分比(保险类型):保险生效日
$data_row = $this->receiver_order_datas_model->get(['o_id'=>$order['id']]);
$insurance_img = json_decode($data_row['insurance_img'],true);
$business_img = json_decode($data_row['business_img'],true);
$profix_insuer_ins = 0;
if($insurance_img){
//强险
$time = strtotime($insurance_img['date']);
$where = [
'biz_id' => $order['biz_id'],
'title' => $insurance_img['product'],
'type' => 2,
"json_extract(jsondata, '$.type') = '2'" => null,
"json_extract(jsondata, '$.s_time') >= '{$time}'" => null,
"json_extract(jsondata, '$.e_time') <= '{$time}'" => null
];
$fd_row = $this->biz_settle_srv_model->get($where);
if(!$fd_row){
$where = [
'biz_id' => $order['biz_id'],
'title' => $insurance_img['product'],
'type' => 2,
'is_def' => 1,
"json_extract(jsondata, '$.type') = '2'" => null,
];
$fd_row = $this->biz_settle_srv_model->get($where);
}
$fd_jsondata = json_decode($fd_row['jsondata'],true);
$qx_fd = $fd_jsondata['rebate']/100;
$profix_insuer_ins = floatval($insurance_img['price']) * $qx_fd;
}
$profix_insuer_bis = 0;
if($business_img){
//商业险
$time = strtotime($business_img['date']);
$where = [
'biz_id' => $order['biz_id'],
'title' => $business_img['product'],
'type' => 2,
"json_extract(jsondata, '$.type') = '1'" => null,
"json_extract(jsondata, '$.s_time') >= '{$time}'" => null,
"json_extract(jsondata, '$.e_time') <= '{$time}'" => null
];
$bis_fd_row = $this->biz_settle_srv_model->get($where);
if(!$bis_fd_row){
$where = [
'biz_id' => $order['biz_id'],
'title' => $business_img['product'],
'type' => 2,
'is_def' => 1,
"json_extract(jsondata, '$.type') = '1'" => null,
];
$bis_fd_row = $this->biz_settle_srv_model->get($where);
}
$bis_fd_jsondata = json_decode($bis_fd_row['jsondata'],true);
$bis_fd = $bis_fd_jsondata['rebate']/100;
$profix_insuer_bis = floatval($business_img['price'])*$bis_fd;
}
$profix_insuer = $profix_insuer_ins + $profix_insuer_bis;
//贷款利润 = 手续费 + 贷款金额 * 返点(对应产品)
// $profix_loan = floatval($money_json['price_finance']);
//贷款佣金 = 贷款金额 * 返点(对应产品)
$profix_loan = 0;
if($money_json['price_loan']>=0){
$loan_row = $this->order_loans_model->get(['o_id'=>$order['id']]);
$finance_id = $order['finance_id'];
$finance_num = $loan_row['num'] ? $loan_row['num'] : 0;
$where = [
'biz_id' => $order['biz_id'],
'type' => 3,
's_effect_time' => $bill_time_month,
"json_extract(jsondata, '$.finance_id') = '{$finance_id}'" => null,
"json_extract(jsondata, '$.finance_num') = '{$finance_num}'" => null,
];
$fd_row = $this->biz_settle_srv_model->get($where);
if(!$fd_row){
$fd_row = $this->biz_settle_srv_model->get(['biz_id'=>$order['biz_id'],'is_def'=>1,'status'=>1,'type'=>3]);
}
$fd_jsondata = json_decode($fd_row['jsondata'],true);
$loan_fd = $fd_jsondata['rebate'] ? $fd_jsondata['rebate']/100:0;
$profix_loan = $money_json['price_loan']*$loan_fd;
//获取贷款手续费
$srv_loan = 0;
$srv_json = json_decode($order['srv_ids'],true);
if($srv_json){
foreach ($srv_json as $v2) {
if($v2['key']=='price_finance'){
$srv_loan = $v2['price'];
break;
}
}
}
$profix_loan += $srv_loan;
}
$settle_money_json['profix_insuer_ins'] = $profix_insuer_ins;
$settle_money_json['profix_insuer_bis'] = $profix_insuer_bis;
$settle_money_json['in']['commission'] = $profix_loan+$profix_insuer;
//精品成本(赠送的也要算)
$profix_fine = 0;
$fines = json_decode($order['fines'],true);
$fines_ids = array_column($fines,'id');
if($fines){
$fines_ids = implode(',',$fines_ids);
$where = [
"id in ({$fines_ids})" => null
];
$fines_ids && $cb_sum = $this->receiver_fine_model->sum('price',$where);
$cb = $cb_sum['price'] ? $cb_sum['price'] : 0; //成本
$profix_fine = $cb;
}
$settle_money_json['out']['biz_price'] = $profix_fine;
$add_data = [
'profix_car' => $settle_money_json['in']['profix_car'],
'profix_insure' => $profix_insuer,
'profix_loan' => $profix_loan,
'profix_carno' => $profix_carno,
'profix_fine' => $money_json['price_fine_select'] - $profix_fine,
'money_json' => json_encode($settle_money_json,JSON_UNESCAPED_UNICODE),
];
if($money_json['price_car']>$b_row_one['price_floor']){
$add_data['oflow_profix_car'] = $money_json['price_car'] - $b_row_one['price_floor'];
}
$this->biz_settle_model->update($add_data,['id'=>$val['id']]);
}
$this->settle_entity->brand_static('',$params['biz_id'],$params['year'],$params['month']);
}
return $this->show_json(SYS_CODE_SUCCESS, '更新完成!');
}
//更新合伙结算列表
public function edit_settle(){
$params = $this->input->post();
$where = [
'biz_id' => $params['biz_id'],
'year' => $params['year'],
'month' => $params['month']
];
$rows = $this->biz_settle_model->select($where,'id desc');
if($rows){
$order_ids = implode(',',array_column($rows,'o_id'));
$order_rows = [];
if($order_ids){
$o_where = [
"id in ({$order_ids})" => null
];
$order_rows = $this->receiver_orders_v2_model->map('id','',$o_where,'','','');
}
foreach ($rows as $key => $val) {
$order = $order_rows[$val['o_id']][0];
if(!$order){
continue;
}
$info_json = json_decode($order['info_json'],true);
$money_json = json_decode($order['money_json'],true);
//获取创建订单时商务政策
$where = [
'id' => $info_json['business_id'],
];
$b_row_one = $this->auto_business_model->get($where);
//获取开票日期商务政策
$b_where = [
'city_id' => $order['city_id'],
'brand_id' => $order['brand_id'],
's_id' => $order['s_id'],
'v_id' => $order['v_id'],
'if_effect' => 1,
];
$b_row_two = $this->auto_business_model->select($b_where,'id desc',1,1);
$b_row_two = $b_row_two[0];
$truck_row = $this->biz_trucking_model->get(['auto_b_id'=>$order['brand_id'],'biz_id'=>$order['biz_id'],'status'=>1]);
$price_trucking = $truck_row['money'] ? $truck_row['money'] : 0;
$add_data = [
'profix_car' => $b_row_one['profix_car'] ? $b_row_one['profix_car'] : 0,
'profix_insure' => $b_row_two['profix_insure'] ? $b_row_two['profix_insure'] : 0,
'profix_loan' => $b_row_two['profix_loan'] ? $b_row_two['profix_loan'] : 0,
'profix_carno' => $b_row_two['profix_carno'] ? $b_row_two['profix_carno'] : 0,
'price_trucking' => $price_trucking,
];
if($money_json['price_car']>$b_row_one['price_floor']){
$add_data['oflow_profix_car'] = $money_json['price_car'] - $b_row_one['price_floor'];
}
$this->biz_settle_model->update($add_data,['id'=>$val['id']]);
}
$this->settle_entity->re_static('',$params['biz_id'],$params['year'],$params['month']);
}
return $this->show_json(SYS_CODE_SUCCESS, '更新完成!');
}
}
+253
View File
@@ -0,0 +1,253 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Srv extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('auto/auto_business_model');
$this->load->model('biz/biz_model');
$this->load->model('biz/biz_settle_srv_model');
$this->load->model('sys/sys_finance_model');
}
public function index()
{
$this->lists();
}
public function lists(){
$params = $this->input->get();
$params['id'] && $_SESSION['srv_biz_id'] = $params['id'];
!$params['type'] && $params['type'] = '';
!$params['title'] && $params['title'] = '';
!strlen($params['status']) && $params['status'] = '';
$page = $params['page'] ? $params['page'] : 1;
$pagesize = 20;
$where = [
'status>=' => 0,
'biz_id' => $_SESSION['srv_biz_id']
];
strlen($params['status']) && $where['status'] = $params['status'];
$params['type'] && $where['type'] = $params['type'];
$params['title'] && $where['title'] = $params['title'];
$count = $this->biz_settle_srv_model->count($where);
$lists = [];
if($count){
$rows = $this->biz_settle_srv_model->select($where, 'is_def desc,id desc', $page, $pagesize);
$biz_ids = array_unique(array_column($rows,'biz_id'));
$map_biz = [];
if(is_array($biz_ids)){
$biz_ids = implode(',',array_filter($biz_ids));
$where_biz = ["id in ({$biz_ids})" => null];
$map_biz = $this->biz_model->map('id', 'biz_name', $where_biz, '', 0, 0, 'id,biz_name');
}
foreach ($rows as $val) {
$other_data = $this->biz_settle_srv_model->get_jsondata($val['type'],$val['jsondata']);
$lists[] = [
'id' => $val['id'],
'biz_id' => $val['biz_id'],
'biz_name' => $map_biz[$val['biz_id']],
'title' => $val['title'],
'other_data' => $other_data,
's_effect_time' =>$val['s_effect_time'],
'is_def' => $val['is_def'] ? '是':'否',
'type_cn' => $this->biz_settle_srv_model->get_type($val['type']),
'status_cn' => $this->biz_settle_srv_model->get_status($val['status']),
'c_time' => date('Y-m-d H:i',$val['c_time']),
'status' => $val['status'],
];
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['typeAry'] = $this->biz_settle_srv_model->get_type();
$this->data['_title'] = '门店列表';
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
$this->show_view('biz/srv/lists', true);
}
public function get(){
$biz_id = $_SESSION['srv_biz_id'];
$id = $this->input->get('id');
$type = $this->input->get('type');
!$type && $type = 1;
if(!$biz_id){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$row = $this->biz_settle_srv_model->get(['id'=>$id]);
$finances = $this->sys_finance_model->select(['status' => 1], '', 0, 0, 'id,title');
$info = [
'biz_id' => $biz_id,
'type' => $type,
'is_def' => 0,
's_effect_time' => date('Y-m-d'),
'action' => 'biz/srv/add',
'jsondata' => ['price'=>300,'type'=>1,'finance_id'=>$finances[0]['id'],'finance_num'=>12]
];
if($row){
$info['title'] = $row['title'];
$info['id'] = $row['id'];
$info['type'] = $row['type'];
$info['is_def'] = $row['is_def'];
$info['s_effect_time'] = $row['s_effect_time'];
$info['action'] = 'biz/srv/edit';
$jsondata = json_decode($row['jsondata'],true);
$jsondata['s_time'] && $jsondata['s_time'] = date('Y-m-d H:i:s',$jsondata['s_time']);
$jsondata['e_time'] && $jsondata['e_time'] = date('Y-m-d H:i:s',$jsondata['e_time']);
$info['jsondata'] = $jsondata;
}
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['finances'] = $finances;
$this->data['finances_num'] = $this->sys_finance_model->get_nums();
$this->data['info'] = $info;
$this->data['typeAry'] = $this->biz_settle_srv_model->get_type();
$this->show_view('biz/srv/get');
}
public function add(){
$info = $this->input->post('info');
$data = [
'biz_id' => $info['biz_id'],
'c_time' => time(),
'type' => $info['type'],
'is_def' => $info['is_def'] ? 1 : 0,
];
$info['title'] && $data['title'] = $info['title'];
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
$jsondata = [];
if($info['type']==1){
$jsondata['price'] = floatval($info['jsondata']['price']);
}elseif($info['type']==2){
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
$jsondata['rebate'] = $info['jsondata']['rebate'];
$jsondata['type'] = $info['jsondata']['type'];
}else{
$jsondata['rebate'] = $info['jsondata']['rebate'];
$jsondata['finance_id'] = $info['jsondata']['finance_id'];
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
$finance = $this->sys_finance_model->get(['id'=>intval($jsondata['finance_id'])],'title');
$jsondata['finance_title'] = $finance['title'];
$data['title'] = $jsondata['finance_title'];
}
//只能有一条默认
if($info['is_def']){
$where = [
'biz_id' => $info['biz_id'],
'title' => $info['title'],
'type' => $info['type'],
'is_def' => 1
];
if($info['type']==2){
$where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null;
}
$this->biz_settle_srv_model->update(['is_def'=>0],$where);
}
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$res = $this->biz_settle_srv_model->add($data);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function edit(){
$info = $this->input->post('info');
$row = $this->biz_settle_srv_model->get(['id'=>$info['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$jsondata = json_decode($row['jsondata'],true);
$data = [
'type' => $info['type'],
'is_def' => $info['is_def'] ? 1 : 0,
];
$info['title'] && $data['title'] = $info['title'];
$info['s_effect_time'] && $data['s_effect_time'] = date('Y-m-d',strtotime($info['s_effect_time']));
if($info['type']==1){
$jsondata['price'] = floatval($info['jsondata']['price']);
}elseif($info['type']==2){
$info['s_time'] && $jsondata['s_time'] = strtotime($info['s_time']);
$info['e_time'] && $jsondata['e_time'] = strtotime($info['e_time']);
$jsondata['rebate'] = $info['jsondata']['rebate'];
$jsondata['type'] = $info['jsondata']['type'];
}else{
$jsondata['rebate'] = $info['jsondata']['rebate'];
$jsondata['finance_id'] = $info['jsondata']['finance_id'];
$jsondata['finance_num'] = $info['jsondata']['finance_num'];
$finance = $this->sys_finance_model->get(['id'=>intval($jsondata['finance_id'])],'title');
$jsondata['finance_title'] = $finance['title'];
$data['title'] = $jsondata['finance_title'];
}
//只能有一条默认
if($info['is_def']){
$where = [
'biz_id' => $info['biz_id'],
'title' => $info['title'],
'type' => $info['type'],
'is_def' => 1,
];
if($info['type']==2){
$where["json_extract(jsondata, '$.type') = '{$info['jsondata']['type']}'"] = null;
}
$this->biz_settle_srv_model->update(['is_def'=>0],$where);
}
$data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$res = $this->biz_settle_srv_model->update($data,['id'=>$info['id']]);
if($res){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function del()
{
}
public function batch()
{
$field = $this->input->post('field');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
$ids = explode(',', $ids);
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$ids_str = implode(',', $ids);
$where = ["id in({$ids_str})" => null];
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
if (!$id) {
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
}
$data['status'] = $status;
$this->biz_settle_srv_model->update($data, $where);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
public function export(){
}
public function get_title(){
$biz_id = intval($_SESSION['srv_biz_id']);
$type = $this->input->get('type');
!$type && $type=1;
$where = [
'type' => $type,
'biz_id' => $biz_id,
'status' => 1
];
$rows = $this->biz_settle_srv_model->select_groupby('title', $where, '', 0, 20, 'id,title');
$this->data['lists'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
}
+37 -13
View File
@@ -65,13 +65,17 @@ class Store extends HD_Controller
if ($city_id) {
$this->data['countys'] = $this->area_model->select(array('city_id' => $city_id));
}
if (isset($status_arr[$status])) {
if (isset($status)) {
$this->data['status'] = $status;
$where['status'] = $status_arr[$status];
if(strlen($status_arr[$status])){
$where['status'] = $status_arr[$status];
}else{
$where['status > -1'] = null;
}
} else {
$where['status > -1'] = null;
$this->data['status'] = 'on';
$where['status'] = 1;
}
$company_id && $where['company_id'] = $company_id;
!$page && $page = 1;
@@ -405,6 +409,7 @@ class Store extends HD_Controller
public function batch()
{
$field = $this->input->post('field');
$this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
@@ -412,7 +417,9 @@ class Store extends HD_Controller
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$where = array('id in(' . implode(',', $ids) . ')' => null);
$ids_str = implode(',', $ids);
$where = ["id in({$ids_str})" => null];
$this->mdUsers->update(['status' => $status], ["biz_id in({$ids_str})" => null, 'group_id < 4' => null]);//更新用户下架
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
@@ -420,6 +427,7 @@ class Store extends HD_Controller
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
$this->mdUsers->update(['status' => $status], ['biz_id' => $id, 'group_id < 4' => null]);//更新用户下架
}
$data['status'] = $status;
$this->biz_model->update($data, $where);
@@ -1018,7 +1026,8 @@ class Store extends HD_Controller
public function get_info()
{
$biz_id = $this->input->get('id');
if (!$this->biz_model->get(['id' => $biz_id])) {
$biz = $this->biz_model->get(array('id' => $biz_id));
if (!$biz) {
return $this->show_json(SYS_CODE_FAIL, '店铺不存在!');
}
$base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
@@ -1026,23 +1035,28 @@ class Store extends HD_Controller
$this->biz_info_model->add(['biz_id' => $biz_id, 'c_time' => time()]);
$base_info = $this->biz_info_model->get(['biz_id' => $biz_id]);
}
$jsondata = json_decode($base_info['jsondata'],true);
$info = [
'id' => $base_info['id'],
'biz_id' => $base_info['biz_id'],
'name' => $base_info['name'],
'mobile' => $base_info['mobile'],
'margin' => $base_info['margin'],
'margin' => $base_info['margin']>0 ? $base_info['margin'] : '',
'area' => $base_info['area'],
'rent' => $base_info['rent'],
'wat_ele' => $base_info['wat_ele'],
'rent' => $base_info['rent']>0 ? $base_info['rent'] : '',
'wat_ele' => $base_info['wat_ele']>0 ? $base_info['wat_ele'] : '',
'employee_wage' => $base_info['employee_wage'],
'manager_wage' => $base_info['manager_wage'],
'commission' => $base_info['commission'],
'manager_wage' => $base_info['manager_wage']>0 ? intval($base_info['manager_wage']) : 8000,
'commission' => $base_info['commission']>0 ? $base_info['commission'] : '',
'num' => $base_info['num'],
's_time' => $base_info['s_time'] ? date('Y-m-d', $base_info['s_time']) : '',
'e_time' => $base_info['e_time'] ? date('Y-m-d', $base_info['e_time']) : '',
'type' => $base_info['type'],
'rate' => strlen($base_info['rate']) ? $base_info['rate'] : 0,
'biz_type' => $biz['type'],
'car_rent' => $jsondata['car_rent'] ? $jsondata['car_rent'] : '',
'marketing' => $jsondata['marketing'] ? $jsondata['marketing'] : '',
'door_step' => $jsondata['door_step'] ? $jsondata['door_step'] : '',
];
$brands = [];
$b_rows = $this->biz_trucking_model->select(['biz_id' => $base_info['biz_id'], 'status' => 1], '', '', '', 'auto_b_id,money');
@@ -1070,13 +1084,14 @@ class Store extends HD_Controller
{
$info = $this->input->post('info');
$brands = $this->input->post('brands');
if (!$this->biz_info_model->get(['id' => $info['id']])) {
$row = $this->biz_info_model->get(['id' => $info['id']]);
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '错数错误!');
}
if ($info['rate'] < 0 || $info['rate'] > 100) {
return $this->show_json(SYS_CODE_FAIL, '分佣比例请填写0~100');
}
$jsondata = json_decode($row['jsondata'],true);
$up_data = [
'name' => $info['name'],
'mobile' => $info['mobile'],
@@ -1093,6 +1108,10 @@ class Store extends HD_Controller
'rate' => $info['rate'],
'num' => $info['num']
];
$jsondata['car_rent'] = $info['car_rent'] ? $info['car_rent'] : '';
$jsondata['marketing'] = $info['marketing'] ? $info['marketing'] : '';
$jsondata['door_step'] = $info['door_step'] ? $info['door_step'] : '';
$up_data['jsondata'] = json_encode($jsondata,JSON_UNESCAPED_UNICODE);
$this->biz_info_model->update($up_data, ['id' => $info['id']]);
$b_ids = array_column($brands, 'id');
if ($b_ids) {
@@ -1116,4 +1135,9 @@ class Store extends HD_Controller
}
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
public function lists_srv(){
$biz_id = $this->input->get('id');
echo $biz_id;
}
}
+809
View File
@@ -0,0 +1,809 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Cost extends HD_Controller{
public function __construct(){
parent::__construct();
$this->load->model('items/items_cost_model');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->load->model('items/items_model');
$this->load->model("biz/biz_model");
$this->load->model('app/licheb/app_licheb_users_model');
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('sys/sys_company_model');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
$this->load->library('receiver/orders_v2_entity');
}
public function index(){
$this->lists();
}
private function get_where(&$params){
$where = [];
# ref \libraries\Ordersv2List.php private function orders($params = array()), 非lc_items_cost相关组装为in查询
//lc_items
//品牌 车系 车型
$where_items = $where_items_default = '1 = 1';
if ($params['brand_id']) {//品牌
//$where["brand_id"] = $params['brand_id'];
$where_items = $where_items." and brand_id = ".$params['brand_id'];
} else {
if (is_product()) {
//$where["brand_id<>"] = 3;//狸车品牌不显示
$where_items = $where_items." and brand_id <> 3";
}
$params['brand_id'] = '';
}
if ($params['s_id']) {//车系
//$where["s_id"] = $params['s_id'];
$where_items = $where_items." and s_id = ".$params['s_id'];
} else {
$params['s_id'] = '';
}
if ($params['v_id']) {//车型
$where["v_id"] = $params['v_id'];
$where_items = $where_items." and v_id = ".$params['v_id'];
} else {
$params['v_id'] = '';
}
if ($params['vin']) {
//$where["item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
$where_items = $where_items." and vin like '%{$params['vin']}%'";
}
if ($where_items != $where_items_default){
$where["item_id in (select id from lc_items where $where_items)"] = null;
}
# lc_receiver_orders_v2
$where_orders = $where_orders_default = '1 = 1';
//门店类型
!$params['biz_type'] && $params['biz_type'] = '';
if ($params['biz_type']) {
//$where["biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ')'] = null;
$where_orders = $where_orders." and biz_id in (select id from lc_biz where type = {$params['biz_type']})";
}
//销售员筛选
if ($params['admin_id']) {
//$where["sale_id"] = $params['admin_id'];
$where_orders = $where_orders.' and sale_id = '.$params['admin_id'];
}
else {
if ($params['biz_id_admin']) {//指定店铺所有销售员
//$where["biz_id"] = $params['biz_id_admin'];
$where_orders = $where_orders.' and biz_id = '.$params['biz_id_admin'];
}
else {
//指定城市的所有门店
$where_biz = array();
if ($params['county_id_admin']) {
$where_biz['county_id'] = $params['county_id_admin'];
}
else if ($params['city_id_admin']) {
$where_biz['city_id'] = $params['city_id_admin'];
}
if ($where_biz) {
$where_biz['status>-1'] = null;
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($rows_biz) {
$str_ids = implode(',', array_column($rows_biz, 'id'));
//$where["biz_id in({$str_ids})"] = null;
$where_orders = $where_orders." and biz_id in ({$str_ids})";
}
else {
//$where["biz_id"] = -1;
$where_orders = $where_orders.' and biz_id = -1';
}
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
if ($where_orders != $where_orders_default){
$where["o_id in (select id from lc_receiver_orders_v2 where $where_orders)"] = null;
}
//开票时间
if ($params['bill_time']) {
$bill_time = explode(' ~ ', $params['bill_time']);
if ($bill_time[0]) {
$where["bill_time >="] = $bill_time[0] . ' 00:00:00';
}
if ($bill_time[1]) {
$where["bill_time <="] = $bill_time[1] . ' 23:59:59';
}
}
return $where;
}
public function lists(){
$params = $this->input->get();
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$autoList = array();
$where = $this->get_where($params);
$count = $this->items_cost_model->count($where);
$lists = [];
if($count){
$rows = $this->items_cost_model->select($where,'id desc',$page,$size);
$item_ids = implode(',',array_column($rows,'item_id'));
$map_item = $item_rows = [];
if($item_ids){
$where = ["id in ($item_ids)" => null];
$item_rows = $this->items_model->select($where,'','','','id,brand_id,s_id,v_id,vin');
foreach ($item_rows as $item) {
$map_item[$item['id']] = $item;
}
}
//订单(ref export
$o_ids = implode(',',array_column($rows,'o_id'));
$map_order = [];
if($o_ids){
$where = ["id in ($o_ids)" => null];
$fields = "id, (select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name";
$order_rows = $this->receiver_orders_v2_model->select($where,'','','',$fields);
foreach ($order_rows as $item) {
$map_order[$item['id']] = $item;
}
}
//品牌车型
$brand_arr = array_unique(array_column($item_rows, 'brand_id'));
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
$series_arr = array_unique(array_column($item_rows, 's_id'));
$series = $this->auto_series_model->get_map_by_ids($series_arr, 'id,name');
//获取属性
$v_arr = array_unique(array_column($item_rows, 'v_id'));
$cor_arr = array_unique(array_column($item_rows, 'cor_id'));
$incor_arr = array_unique(array_column($item_rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$item = $map_item[$val['item_id']];
$brand_name = isset($brands[$item['brand_id']]) ? $brands[$item['brand_id']][0]['name'] : '';
$series_name = isset($series[$item['s_id']]) ? $series[$item['s_id']][0]['name'] : '';
$v_name = isset($attr[$item['v_id']]) ? $attr[$item['v_id']][0]['title'] : '';
$srv_json = json_decode($val['srv_json'],true);
$order = $map_order[$val['o_id']];
$lists[] = [
'id' => $val['id'],
'biz_name' => $order['biz_name'],
'title' => "{$brand_name} {$series_name} {$v_name}",
'vin' => $item['vin'],
'sale_price' => $val['sale_price'],
'buy_price' => $val['buy_price'],
'promotion_price' => $val['promotion_price'],
'car_buy_price' => $val['car_buy_price'],
'car_profit_price' => $val['car_profit_price'],
'insurance_price' => $val['insurance_price'],
'fee_carno_price' => $val['fee_carno_price'],
'loan_price' => $val['loan_price'],
'srv_price' => $val['srv_price'],
'car_price' => $val['car_price'],
'dl_car_price' => $val['dl_car_price'],
'brand_car_price' => $val['brand_car_price'],
'if_pay' => $srv_json['if_pay'] ? intval($srv_json['if_pay']) : 0,
'if_pay_name' => $srv_json['if_pay'] == 1 ? '是' : '',
];
}
}
$show_info['bizTypeAry'] = $this->biz_model->type_ary();//门店类型
$this->data['show_info'] = $show_info;
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$this->data['lists'] = $lists;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['autoList'] = $autoList;
$this->data['params'] = $params;
$this->data['_title'] = '整车成本';
return $this->show_view('items/cost/lists', true);
}
public function get(){
$id = $this->input->get('id');
$row = $this->items_cost_model->get(['id'=>$id]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$order_row = $this->receiver_orders_v2_model->get(['id'=>$row['o_id']]);
$info_json = json_decode($order_row['info_json'],true);
$item_row = $this->items_model->get(['id'=>$row['item_id']]);
$biz = $this->biz_model->get(['id'=>$order_row['biz_id']]);
$admin = $this->app_licheb_users_model->get(['id'=>$order_row['admin_id']]);
$company = $this->sys_company_model->get(['id'=>$item_row['company_id']]);
$promotion_json = json_decode($row['promotion_json'],true);
!$promotion_json['sale_price'] && $promotion_json['sale_price'] = 0;
!$promotion_json['other'] && $promotion_json['other'] = 0;
!$promotion_json['factory_price'] && $promotion_json['factory_price'] = 0;
$cost_json = json_decode($row['cost_json'],true);
!$cost_json['select_price'] && $cost_json['select_price'] = 0;
!$cost_json['labor_price'] && $cost_json['labor_price'] = 0;
$srv_json = json_decode($row['srv_json'],true);
!$srv_json['commission_price'] && $srv_json['commission_price'] = 0;
!$srv_json['back_price'] && $srv_json['back_price'] = 0;
!$srv_json['loan_offset_price'] && $srv_json['loan_offset_price'] = 0;
!$srv_json['loan_subsidy_price'] && $srv_json['loan_subsidy_price'] = 0;
!$srv_json['loan_in_price'] && $srv_json['loan_in_price'] = 0;
!$srv_json['loan_out_price'] && $srv_json['loan_out_price'] = 0;
!$srv_json['other_out_price'] && $srv_json['other_out_price'] = 0;
!$srv_json['other_in_price'] && $srv_json['other_in_price'] = 0;
!$srv_json['ori_price'] && $srv_json['ori_price'] = 0;
$info = [
'bill_name' => $row['bill_name'],
'bill_time' => date('Y-m-d',strtotime($row['bill_time'])),
'price' => $row['price'],
'bill_price' => $row['bill_price'],
'vin' => $item_row['vin'],
'ori_price' => $item_row['ori_price'],
'buy_price' => $item_row['buy_price'],
'company_name' => $company['short'],
'name' => $order_row['owner_name']."({$order_row['owner_mobile']})", // 'name' => $order_row['name']."({$order_row['mobile']})",
'payway' => $order_row['payway'],
'biz_type' => $biz['type'],
'biz_type_name' => $this->biz_model->type_ary($biz['type']),
'biz_name' => $biz['biz_name'],
'admin_name' => $admin['uname'],
'order_time' => date('Y-m-d',$order_row['c_time']),
'promotion_json' => $promotion_json,
'cost_json' => $cost_json,
'srv_json' => $srv_json,
'row' => $row,
'business_id' => $info_json['business_id'] ? $info_json['business_id'] : 0
];
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$row['o_id'],'status'=>1,'pay_price <>'=>0]);
$info['pay_price'] = $sum['total_price'] ? $sum['total_price'] : 0;
$info['need_price'] = $this->orders_v2_entity->recevable_price($row['o_id']);
//获取车信息
$brand = $this->auto_brand_model->get(['id' => $item_row['brand_id']], 'name');
$serie = $this->auto_series_model->get(['id' => $item_row['s_id']], 'name');
$attr = $this->auto_attr_model->get(['id'=>$item_row['v_id']], 'title');
$info['brand_name'] = $brand['name'];
$info['s_name'] = $serie['name'];
$info['v_name'] = $attr['title'];
$this->data['info'] = $info;
$this->data['_title'] = '编辑整车成本';
return $this->show_view('items/cost/get', true);
}
public function add(){
}
public function edit(){
$post_data = $this->input->post();
$row = $this->items_cost_model->get(['id'=>$post_data['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$item_row = $this->items_model->get(['id'=>$row['item_id']]);
$buy_price = $post_data['buy_price'] ? $post_data['buy_price'] : 0;
$res_item = 0;
if ($item_row && $item_row['buy_price'] != $buy_price){
$res_item = $this->items_model->update(array('buy_price'=>$buy_price),['id'=>$row['item_id']]);
}
$data = [
'price' => $post_data['price'] ? $post_data['price'] : 0,
'cost_json' => json_encode($post_data['cost_json'],JSON_UNESCAPED_UNICODE),
'promotion_json' => json_encode($post_data['promotion_json'],JSON_UNESCAPED_UNICODE),
'srv_json' => json_encode($post_data['srv_json'],JSON_UNESCAPED_UNICODE),
];
/*
水平
品牌店按现有逻辑 (1)
合伙店取商务政策的固定值 (2)
代理店没有水平业务 (3)
*/
$order_row = $this->receiver_orders_v2_model->get(['id'=>$row['o_id']], 'id, (select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type');
$biz_type = $order_row['biz_type'];
if ($biz_type == 2){
$insurance_price = $post_data['insurance_price'] ? $post_data['insurance_price'] : 0;
$insurance_price != $row['insurance_price'] && $data['insurance_price'] = $insurance_price;
$fee_carno_price = $post_data['fee_carno_price'] ? $post_data['fee_carno_price'] : 0;
$fee_carno_price != $row['fee_carno_price'] && $data['fee_carno_price'] = $fee_carno_price;
$loan_price = $post_data['loan_price'] ? $post_data['loan_price'] : 0;
$loan_price != $row['loan_price'] && $data['loan_price'] = $loan_price;
}
$res = $this->items_cost_model->update($data,['id'=>$row['id']]);
if(is_numeric($res_item) || is_numeric($res)){
$this->items_cost_model->update_total($row['id']);
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function edit_pay(){
$post_data = $this->input->post();
$row = $this->items_cost_model->get(['id'=>$post_data['id']]);
if(!$row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$srv_json = json_decode($row['srv_json'],true);
$srv_json['if_pay'] = $post_data['status'] == 1 ? 1 : 0;
$data = [
'srv_json' => json_encode($srv_json,JSON_UNESCAPED_UNICODE),
];
$res = $this->items_cost_model->update($data,['id'=>$row['id']]);
if(is_numeric($res)){
return $this->show_json(SYS_CODE_SUCCESS,'保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL,'保存失败');
}
}
public function del(){
}
public function batch(){
}
public function add_excel()
{
require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php';
$res = $this->upload();
if (!$res['code']) {
return $this->show_json(0, $res['message']);
}
$file = $res['path'];
if ($res['file_ext'] == '.xls') {
$reader = \PHPExcel_IOFactory::createReader('Excel5'); // 读取 excel 文档
} elseif ($res['file_ext'] == '.xlsx') {
$reader = \PHPExcel_IOFactory::createReader('Excel2007'); // 读取 excel 文档
}
$PHPExcel = $reader->load($file); // 文档名称
$objWorksheet = $PHPExcel->getActiveSheet();
$rowCnt = $objWorksheet->getHighestRow(); //获取总行数
if ($rowCnt > 10000) {
@unlink($file);
return $this->show_json(0, '数据大于一万请拆分多个表格导入');
}
$s = $f = $ignore_vin = $ignore_item = $ignore_cost = 0;
@unlink($file);
for ($_row = 2; $_row <= $rowCnt; $_row++) { //读取内容
$vin = $objWorksheet->getCell('A' . $_row)->getValue(); //vin码
if (!$vin){
$ignore_vin++;
continue;
}
$item = $this->items_model->get(array('vin' => $vin));
if (!$item){
$ignore_item++;
continue;
}
$cost = $this->items_cost_model->get(array('item_id' => $item['id']));
if (!$cost){
$ignore_cost++;
continue;
}
$id = $cost['id'];
$promotion_json = json_decode($cost['promotion_json'],true);
$cost_json = json_decode($cost['cost_json'],true);
$srv_json = json_decode($cost['srv_json'],true);
# 读取需要更新的列,生成需更新的数据
# 参考 edit* 更新
$buy_price = floatval($objWorksheet->getCell('B' . $_row)->getValue()); //采购成本
$select_price = floatval($objWorksheet->getCell('C' . $_row)->getValue()); //选装成本
$labor_price = floatval($objWorksheet->getCell('D' . $_row)->getValue()); //选装工时费
$sale_price = floatval($objWorksheet->getCell('E' . $_row)->getValue()); //销售佣金
$other = floatval($objWorksheet->getCell('F' . $_row)->getValue()); //其他促销成本
$factory_price = floatval($objWorksheet->getCell('G' . $_row)->getValue()); //厂家补贴
$other_in_price = floatval($objWorksheet->getCell('H' . $_row)->getValue()); //其他收入
$other_out_price = floatval($objWorksheet->getCell('I' . $_row)->getValue()); //其他支出
$res_item = 0;
if ($item['buy_price'] != $buy_price){
$res_item = $this->items_model->update(array('buy_price'=>$buy_price),['id'=>$item['id']]);
}
$cost_json['select_price'] = $select_price ? $select_price : 0;
$cost_json['labor_price'] = $labor_price ? $labor_price : 0;
$promotion_json['sale_price'] = $sale_price ? $sale_price : 0;
$promotion_json['other'] = $other ? $other : 0;
$promotion_json['factory_price'] = $factory_price ? $factory_price : 0;
$srv_json['other_in_price'] = $other_in_price ? $other_in_price : 0;
$srv_json['other_out_price'] = $other_out_price ? $other_out_price : 0;
$data = [
'cost_json' => json_encode($cost_json,JSON_UNESCAPED_UNICODE),
'promotion_json' => json_encode($promotion_json,JSON_UNESCAPED_UNICODE),
'srv_json' => json_encode($srv_json,JSON_UNESCAPED_UNICODE),
];
$res = $this->items_cost_model->update($data,['id'=>$cost['id']]);
if(is_numeric($res_item) || is_numeric($res)){
$this->items_cost_model->update_total($cost['id']);
}else{
$f++;
}
$s++;
}
// @unlink($file);
$ignore = $ignore_vin + $ignore_item + $ignore_cost;
$msg = "导入完成,导入总条数为:" . $s;
$f && $msg = $msg . '; 失败条数:'. $f;
$ignore && $msg = $msg . '; 忽略条数:'. $ignore;
return $this->show_json(SYS_CODE_SUCCESS, $msg);
}
public function export(){
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$fileName = '整车成本';
$where = $this->get_where($params);
$count = $this->items_cost_model->count($where);
if($count){
$rows = $this->items_cost_model->select($where,'id desc',$params['page'],$params['size']);
//车辆
$item_ids = implode(',',array_column($rows,'item_id'));
$map_item = $item_rows = [];
if($item_ids){
$where = ["id in ($item_ids)" => null];
$item_rows = $this->items_model->select($where,'','','','id,brand_id,s_id,v_id,vin,ori_price,buy_price,(select short from lc_sys_company where id = lc_items.company_id) as cpmpany_name');
foreach ($item_rows as $item) {
$map_item[$item['id']] = $item;
}
}
//订单
$o_ids = implode(',',array_column($rows,'o_id'));
$map_order = [];
if($o_ids){
$where = ["id in ($o_ids)" => null];
$fields = "id, name, mobile, owner_name, owner_mobile, c_time, biz_id, admin_id, payway,
if(payway=1,'贷款','全款') as payway_name,
(select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type,
(select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name,
(select uname from lc_app_licheb_users where id = lc_receiver_orders_v2.admin_id) as admin_name";
$order_rows = $this->receiver_orders_v2_model->select($where,'','','',$fields);
foreach ($order_rows as $item) {
$map_order[$item['id']] = $item;
}
}
//品牌车型
$brand_arr = array_unique(array_column($item_rows, 'brand_id'));
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
$series_arr = array_unique(array_column($item_rows, 's_id'));
$series = $this->auto_series_model->get_map_by_ids($series_arr, 'id,name');
//获取属性
$v_arr = array_unique(array_column($item_rows, 'v_id'));
$cor_arr = array_unique(array_column($item_rows, 'cor_id'));
$incor_arr = array_unique(array_column($item_rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$item = $map_item[$val['item_id']];
$brand_name = isset($brands[$item['brand_id']]) ? $brands[$item['brand_id']][0]['name'] : '';
$series_name = isset($series[$item['s_id']]) ? $series[$item['s_id']][0]['name'] : '';
$v_name = isset($attr[$item['v_id']]) ? $attr[$item['v_id']][0]['title'] : '';
$order = $map_order[$val['o_id']];
// json字段防止为空
$promotion_json = json_decode($val['promotion_json'],true);
!$promotion_json['sale_price'] && $promotion_json['sale_price'] = 0;
!$promotion_json['other'] && $promotion_json['other'] = 0;
!$promotion_json['factory_price'] && $promotion_json['factory_price'] = 0;
$cost_json = json_decode($val['cost_json'],true);
!$cost_json['select_price'] && $cost_json['select_price'] = 0;
!$cost_json['labor_price'] && $cost_json['labor_price'] = 0;
$srv_json = json_decode($val['srv_json'],true);
!$srv_json['commission_price'] && $srv_json['commission_price'] = 0;
!$srv_json['back_price'] && $srv_json['back_price'] = 0;
!$srv_json['loan_offset_price'] && $srv_json['loan_offset_price'] = 0;
!$srv_json['loan_subsidy_price'] && $srv_json['loan_subsidy_price'] = 0;
!$srv_json['loan_in_price'] && $srv_json['loan_in_price'] = 0;
!$srv_json['loan_out_price'] && $srv_json['loan_out_price'] = 0;
!$srv_json['other_out_price'] && $srv_json['other_out_price'] = 0;
!$srv_json['other_in_price'] && $srv_json['other_in_price'] = 0;
!$srv_json['ori_price'] && $srv_json['ori_price'] = 0;
$sum = $this->app_liche_orders_model->sum('total_price', ['o_id'=>$val['o_id'],'status'=>1,'pay_price <>'=>0]);
$pay_price = $sum['total_price'] ? $sum['total_price'] : 0;
$need_price = $this->orders_v2_entity->recevable_price($val['o_id']);
$data[] = [
'id' => $val['id'],
'bill_name' => $val['bill_name'],
'biz_type' => $order['biz_type'],
'biz_type_name' => $this->biz_model->type_ary($order['biz_type']),
'vin' => $item['vin'],
'brand_name' => $brand_name,
'series_name' => "{$series_name} {$v_name}",
'ori_price' => $srv_json['ori_price'],
'owner_name' => $order['owner_name']."({$order['owner_mobile']})",
'admin_name' => $order['admin_name'],
'biz_name' => $order['biz_name'],
'bill_time' => date('Y-m-d',strtotime($val['bill_time'])),
'bill_price' => $val['bill_price'],
'bill_price_diff' => $val['price'] - $val['bill_price'],
'price' => $val['price'],
'price_fine_select' => $srv_json['price_fine_select'],
'sale_price' => $val['sale_price'], // $val['price'] + $srv_json['price_fine_select']
'order_time' => date('Y-m-d',$order['c_time']),
'price_floor' => $srv_json['price_floor'],
'profix_car_1' => $order['biz_type'] == 1 ? $srv_json['profix_car'] : 0,
'profix_car_1_not' => $order['biz_type'] != 1 ? $srv_json['profix_car'] : 0,
'company_name' => $item['cpmpany_name'],
'buy_price' => $item['buy_price'],
'select_price' => $cost_json['select_price'],
'labor_price' => $cost_json['labor_price'],
'buy_price_total' => $val['buy_price'],
'promotion_sale_price' => $promotion_json['sale_price'],
'promotion_other' => $promotion_json['other'],
'promotion_price' => $val['promotion_price'],
'factory_price' => $promotion_json['factory_price'],
'car_buy_price' => $val['car_buy_price'],
'car_profit_price' => $val['car_profit_price'],
"business_product" => $srv_json['business_product'],
"business_price" => $srv_json['business_price'],
"business_fd" => $srv_json['business_fd'],
"business_ins_price" => $srv_json['business_ins_price'],
"insurance_price" => $srv_json['insurance_price'],
"insurance_fd" => $srv_json['insurance_fd'],
"insurance_ins_price" => $srv_json['insurance_ins_price'],
"back_price" => $srv_json['back_price'],
"insurance_price_pure" => $val['insurance_price'],
'fee_carno' => $srv_json['fee_carno'],
'cb_fee_carno' => $srv_json['cb_fee_carno'],
"fee_carno_price" => $val['fee_carno_price'],
'payway_name' => $order['payway_name'],
'loan_product' => $srv_json['loan_product'],
'loan_price' => $srv_json['loan_price'],
'loan_num' => $srv_json['loan_num'],
'loan_srv_price' => $srv_json['loan_srv_price'],
'loan_offset_price' => $srv_json['loan_offset_price'],
'loan_subsidy_price' => $srv_json['loan_subsidy_price'],
'commission_price' => $srv_json['commission_price'],
'loan_in_price' => $srv_json['loan_in_price'],
'loan_out_price' => $srv_json['loan_out_price'],
'loan_price_pure' => $val['loan_price'],
'other_in_price' => $srv_json['other_in_price'],
'other_out_price' => $srv_json['other_out_price'],
'other_price' => $srv_json['other_in_price'] - $srv_json['other_out_price'],
'srv_price' => $val['srv_price'],
'car_price' => $val['car_price'],
'dl_car_price' => $val['dl_car_price'],
'brand_car_price' => $val['brand_car_price'],
'need_price' => $need_price,
'pay_price' => $pay_price,
'if_pay' => $srv_json['if_pay'] == 1 ? '是' : '',
];
}
}
$headers = [
'owner_name' => array('title'=>'销售信息', 'column_num'=>10), // 从该indexs.key开始合并第一行的单元格数及显示标题
'price_floor' => array('title'=>'销售政策', 'column_num'=>3),
'company_name' => array('title'=>'采购成本', 'column_num'=>5),
'promotion_sale_price' => array('title'=>'促销成本', 'column_num'=>3),
'business_product' => array('title'=>'保险收入', 'column_num'=>9),
'fee_carno' => array('title'=>'挂牌收入', 'column_num'=>3),
'loan_product' => array('title'=>'分期付款业务', 'column_num'=>10),
'other_in_price' => array('title'=>'其他收入及成本', 'column_num'=>3),
'need_price' => array('title'=>'收款核对', 'column_num'=>3),
];
$indexs = [
'id' => '序号',
'bill_name' => '开票方',
//'biz_type' => 'biz_type',
'biz_type_name' => '门店类型',
'vin' => '车架号',
'brand_name' => '品牌',
'series_name' => '车型',
'ori_price' => '指导价',
'owner_name' => '车主', // 客户名称
'admin_name' => '销售顾问',
'biz_name' => '门店名称', // 销售归属地
'bill_time' => '开票日期',
'bill_price' => '开票价', // 开票金额
'bill_price_diff' => '实际售价与开票差额',
'price' => '实际售价',
'price_fine_select' => '选装实收',
'sale_price' => '销售收入合计',
'order_time' => '订单日期',
'price_floor' => '商务政策低价', // 商务政策销售价
'profix_car_1' => '品牌店分润',
'profix_car_1_not' => '渠道分润',
'company_name' => '车辆归属', // 进货地(车辆归属)
'buy_price' => '采购成本',
'select_price' => '选装成本', // 选装单金额
'labor_price' => '选装工时费',
'buy_price_total' => '采购及加装成本合计',
'promotion_sale_price' => '销售佣金',
'promotion_other' => '其他',
'promotion_price' => '促销成本合计',
'factory_price' => '厂家补贴',
"car_buy_price" => "整车采购成本",
"car_profit_price" => "整车采购毛利",
"business_product" => "保险公司",
"business_price" => "商业险金额",
"business_fd" => "商业险返点",
"business_ins_price" => "商业险佣金",
"insurance_price" => "交强险金额",
"insurance_fd" => "交强险返点",
"insurance_ins_price" => "交强险佣金",
"back_price" => "客户退点金额", // 退客户保险退点
"insurance_price_pure" => "保险收入合计", // 保险净收入
'fee_carno' => '挂牌收入',
'cb_fee_carno' => '挂牌成本',
"fee_carno_price" => "挂牌收入合计",
'payway_name' => '购车方式',
'loan_product' => '按揭银行',
'loan_price' => '按揭金额',
'loan_num' => '期数',
'loan_srv_price' => '按揭服务费',
'loan_offset_price' => '解抵服务费',
'loan_subsidy_price' => '利息补贴收入',
'commission_price' => '按揭手续费收入',
'loan_in_price' => '其他收入金额',
'loan_out_price' => '其他支出金额',
'loan_price_pure' => '按揭收入合计',
'other_in_price' => '其他收入',
'other_out_price' => '其他支出',
'other_price' => '其他合计',
'srv_price' => '水平业务总毛利',
'car_price' => '单车总毛利',
'dl_car_price' => '门店单车毛利',
'brand_car_price' => '品牌单车总毛利',
'need_price' => '应收款金额',
'pay_price' => '已收款金额',
'if_pay' => '是否齐款',
];
array_unshift($data, $indexs);
$this->load->library('excel');
#$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
$sheet_title = $fileName;
$filename = $fileName.'_' . date('YmdHis');
$this->excel->excel2($data, $indexs, $headers, $sheet_title, $filename);
}
// export old
public function export_(){
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$fileName = '整车成本';
$where = [];
$count = $this->items_cost_model->count($where);
if($count){
$rows = $this->items_cost_model->select($where,'id desc',$params['page'],$params['size']);
$item_ids = implode(',',array_column($rows,'item_id'));
$map_item = $item_rows = [];
if($item_ids){
$where = ["id in ($item_ids)" => null];
$item_rows = $this->items_model->select($where,'','','','id,brand_id,s_id,v_id,vin');
foreach ($item_rows as $item) {
$map_item[$item['id']] = $item;
}
}
//品牌车型
$brand_arr = array_unique(array_column($item_rows, 'brand_id'));
$brands = $this->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
//车系车型
$series_arr = array_unique(array_column($item_rows, 's_id'));
$series = $this->auto_series_model->get_map_by_ids($series_arr, 'id,name');
//获取属性
$v_arr = array_unique(array_column($item_rows, 'v_id'));
$cor_arr = array_unique(array_column($item_rows, 'cor_id'));
$incor_arr = array_unique(array_column($item_rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
foreach ($rows as $key => $val) {
$item = $map_item[$val['item_id']];
$brand_name = isset($brands[$item['brand_id']]) ? $brands[$item['brand_id']][0]['name'] : '';
$series_name = isset($series[$item['s_id']]) ? $series[$item['s_id']][0]['name'] : '';
$v_name = isset($attr[$item['v_id']]) ? $attr[$item['v_id']][0]['title'] : '';
$data[] = [
'id' => $val['id'],
'title' => "{$brand_name} {$series_name} {$v_name}",
'vin' => $item['vin'],
'sale_price' => $val['sale_price'],
'buy_price' => $val['buy_price'],
'promotion_price' => $val['promotion_price'],
'car_buy_price' => $val['car_buy_price'],
'car_profit_price' => $val['car_profit_price'],
'insurance_price' => $val['insurance_price'],
'fee_carno_price' => $val['fee_carno_price'],
'loan_price' => $val['loan_price'],
'srv_price' => $val['srv_price'],
'car_price' => $val['car_price'],
];
}
}
$indexs = [
'title' => '车辆',
'vin' => '车架号',
'sale_price' => '销售收入合计',
'buy_price' => '采购及加装成本合计',
"promotion_price" => "促销成本合计",
"car_buy_price" => "整车采购成本",
"car_profit_price" => "整车采购毛利",
"insurance_price" => "保险收入合计",
"fee_carno_price" => "挂牌收入合计",
"loan_price" => "按揭收入合计",
"srv_price" => "水平业务总毛利 ",
"car_price" => "单车总毛利",
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
/**
* Notes:上传excel
* Created on: 2021/7/14 15:06
* Created by: dengbw
* @return array
*/
private function upload()
{
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
$config['allowed_types'] = '*';//xls|xlsx
$config['max_size'] = 5 * 1024;
$config['file_name'] = 'items_' . time() . rand(1, 99999);
$this->load->library('upload', $config);
if (!$this->upload->do_upload('file')) {
return array('code' => SYS_CODE_FAIL, 'message' => $this->upload->display_errors('', ''));
} else {
$data = $this->upload->data();
return array('code' => SYS_CODE_SUCCESS, 'path' => $data['full_path'], 'file_ext' => $data['file_ext']);
}
}
}
+11 -7
View File
@@ -69,21 +69,21 @@ class Inventory extends HD_Controller
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '车辆盘点不存在!');
}
$lists = $where = [];
$lists = [];
$where['lc_items_inventory_log.inve_id'] = $params['inve_id'];
if (strlen($params['status'])) {
$where['lc_items_inventory_log.status'] = $params['status'];
} else {
$params['lc_items_inventory_log.status in(0,1)'] = null;
$where['lc_items_inventory_log.status in(0,1)'] = null;
$params['status'] = '-99';
}
if ($params['biz_id']) {
if ($params['biz_id'] > 0) {
$where['lc_items_inventory_log.biz_id'] = $params['biz_id'];
}
if ($params['biz_id'] == -1 && $params['addr_id']) {
} else if ($params['biz_id'] == -1 && $params['addr_id']) {
$where['lc_items_inventory_log.addr_id'] = $params['addr_id'];
} else if ($params['city_id']) {
$where_biz['status'] = 1;
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id');
$res_addr = $this->addr_model->select($where_biz, 'id desc', 0, 0, 'id');
@@ -106,6 +106,10 @@ class Inventory extends HD_Controller
$params['addr_id'] = '';
$params['biz_id'] = '';
}
$params['brand_id'] && $where['lc_items.brand_id'] = $params['brand_id'];
$params['s_id'] && $where['lc_items.s_id'] = $params['s_id'];
$params['v_id'] && $where['lc_items.v_id'] = $params['v_id'];
$params['cor_id'] && $where['lc_items.cor_id'] = $params['cor_id'];
if ($params['item_status']) {
if ($params['item_status'] == 3) {
$where["lc_items.bill_time<>"] = '0000-00-00 00:00:00';
@@ -121,7 +125,7 @@ class Inventory extends HD_Controller
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$statusAry = $this->mdInventoryLog->statusAry();
$carImgAry = $this->mdInventoryLog->carImgAry();
+167
View File
@@ -125,6 +125,173 @@ class Stock extends HD_Controller
$this->show_view('items/stock/lists', true);
}
public function get_month()
{
$params = $this->input->get();
$this->data = $this->monthSelect($params);
$this->show_view('items/stock/get_month', true);
}
public function export_month()
{
$params = $this->input->get();
$params['export'] = 1;
$data = $indexs = array();
$res = $this->monthSelect($params);
$fileName = $res['_title'];
foreach ($res['biz'] as $k => $v) {
$data[] = $v;
}
$indexs = ['biz_name' => '门店'];
foreach ($res['date_months'] as $v) {
$month = date('Y年m月', strtotime($v));
$indexs[$v] = $month;
}
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
private function monthSelect($params)
{
$type_ary = $this->mdBiz->type_ary();
$params['type'] = $params['type'] ? $params['type'] : '';
$typeStr = '1,2,3';//品牌 合伙 代理
$typeAry = [];
foreach ($type_ary as $k => $v) {
if (strstr($typeStr . ',', $k . ',')) {
$typeAry[$k] = $v;
}
}
$biz = $res_biz = $date_months = $dateMonths = [];
if ($params['type'] || $params['biz_id'] || $params['city_id']) {
$start_date = date('Y-m', strtotime("-11 month"));//取最近12个月
$end_date = date('Y-m');
$date_months = $this->dateMonths($start_date, $end_date);
rsort($date_months);
foreach ($date_months as $v) {
$firstDay = $v . '-01' . ' 00:00:00';
$lastDay = date('Y-m-d', strtotime("$firstDay +1 month -1 day"));
$dateMonths[] = ['name' => $v, 'firstDay' => $v . '-01', 'lastDay' => $lastDay];
}
$type = $params['type'] ? $params['type'] : $typeStr;
$where_biz['status'] = 1;
$where_biz["type in({$type})"] = null;
if ($params['biz_id']) {
$where_biz['id'] = $params['biz_id'];
} else {
$params['city_id'] && $where_biz['city_id'] = $params['city_id'];
$params['county_id'] && $where_biz['county_id'] = $params['county_id'];
}
$res_biz = $this->mdBiz->select($where_biz, 'id desc', 0, 0, 'id,biz_name');
foreach ($res_biz as $v) {
$months = [];
if ($params['export'] == 1) {
$months['biz_name'] = $v['biz_name'];
}
foreach ($dateMonths as $v2) {
$where2 = $where3 = ['biz_id' => $v['id'], 'log_date>=' => $v2['firstDay'], 'log_date<=' => $v2['lastDay']];
$res_log = $this->mdStockLog->select_groupby('s_id', $where2, 'id desc', 0, 0, 'brand_id,s_id');
$data = '';
if ($res_log) {
$str_ids = implode(',', array_unique(array_column($res_log, 'brand_id')));
$map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]);
$str_ids = implode(',', array_unique(array_column($res_log, 's_id')));
$map_sery = $this->mdAutoSeries->map('id', 'name', ["id in ({$str_ids})" => null]);
foreach ($res_log as $v3) {
$where3['s_id'] = $v3['s_id'];
$res_log2 = $this->mdStockLog->select_groupby('item_id', $where3, "total desc,id desc", 1, 1
, "count(id) as total");
$count = $res_log2 ? $res_log2[0]['total'] : 0;
$title = "{$map_brand[$v3['brand_id']]}-{$map_sery[$v3['s_id']]} {$count}";
$data = $data ? $data . '' . $title : $title;
}
}
if ($params['export'] == 1) {
$months[$v2['name']] = $data;
} else {
$months[] = ['name' => $v2['name'], 'data' => $data];
}
}
if ($params['export'] == 1) {
$biz[] = $months;
} else {
$biz[] = ['biz_name' => $v['biz_name'], 'months' => $months];
}
}
}
!$params['city_id'] && $params['city_id'] = '';
!$params['county_id'] && $params['county_id'] = '';
!$params['biz_id'] && $params['biz_id'] = '';
$showData['typeAry'] = $typeAry;
$showData['typeStr'] = $typeStr;
$data['showData'] = $showData;
$data['biz'] = $biz;
$data['date_months'] = $date_months;
$data['params'] = $params;
$data['_title'] = '库存统计';
return $data;
}
/**
* Notes:计算出两个日期之间的月份
* Created on: 2022/8/9 14:38
* Created by: dengbw
* @param $start_date [开始日期,如2022-03]
* @param $end_date [结束日期,如2022-12]
* @param string $explode [年份和月份之间分隔符,此例为 - ]
* @param bool $addOne [算取完之后最后是否加一月,用于算取时间戳用]
* @return array [返回是两个月份之间所有月份字符串]
*/
private function dateMonths($start_date, $end_date, $explode = '-', $addOne = false)
{
//判断两个时间是不是需要调换顺序
$start_int = strtotime($start_date);
$end_int = strtotime($end_date);
if ($start_int > $end_int) {
$tmp = $start_date;
$start_date = $end_date;
$end_date = $tmp;
}
//结束时间月份+1,如果是13则为新年的一月份
$start_arr = explode($explode, $start_date);
$start_year = intval($start_arr[0]);
$start_month = intval($start_arr[1]);
$end_arr = explode($explode, $end_date);
$end_year = intval($end_arr[0]);
$end_month = intval($end_arr[1]);
$data = array();
$data[] = $start_date;
$tmp_month = $start_month;
$tmp_year = $start_year;
//如果起止不相等,一直循环
while (!(($tmp_month == $end_month) && ($tmp_year == $end_year))) {
$tmp_month++;
//超过十二月份,到新年的一月份
if ($tmp_month > 12) {
$tmp_month = 1;
$tmp_year++;
}
$data[] = $tmp_year . $explode . str_pad($tmp_month, 2, '0', STR_PAD_LEFT);
}
if ($addOne == true) {
$tmp_month++;
//超过十二月份,到新年的一月份
if ($tmp_month > 12) {
$tmp_month = 1;
$tmp_year++;
}
$data[] = $tmp_year . $explode . str_pad($tmp_month, 2, '0', STR_PAD_LEFT);
}
return $data;
}
public function get()
{
+42 -29
View File
@@ -44,7 +44,7 @@ class Transfer extends HD_Controller
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $params['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($params['s_id']) {
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$total = $re['total'];
$this->data['params'] = $re['params'];
@@ -89,15 +89,15 @@ class Transfer extends HD_Controller
if ($params['out_type'] == 2) {
$params['out_admin_id'] && $where['out_uid'] = $params['out_admin_id'];
if ($params['out_addr_id']) {
$where['addr_id'] = $params['out_addr_id'];
$where['out_type'] = $params['out_type'];
$where["id in (select distinct(tran_id) from lc_items_transfer_admin where type in(1,2) and addr_id={$params['out_addr_id']})"] = null;
} else {
$params['out_addr_id'] = '';
}
} else {
if ($params['out_uid']) {
$where['out_uid'] = $params['out_uid'];
$where['out_type'] = $params['out_type'];
} else if ($params['out_biz_id']) {
$where["id in (select distinct(tran_id) from lc_items_transfer_remind where type in(1,2) and biz_id={$params['out_biz_id']})"] = null;
} else {
$params['out_uid'] = '';
}
@@ -114,14 +114,14 @@ class Transfer extends HD_Controller
$params['in_admin_id'] && $where['in_uid'] = $params['in_admin_id'];
if ($params['in_addr_id']) {
$where['addr_id'] = $params['in_addr_id'];
$where['in_type'] = $params['in_type'];
} else {
$params['in_addr_id'] = '';
}
} else {
if ($params['in_uid']) {
$where['in_uid'] = $params['in_uid'];
$where['in_type'] = $params['in_type'];
} else if ($params['in_biz_id']) {
$where['biz_id'] = $params['in_biz_id'];
} else {
$params['in_uid'] = '';
}
@@ -151,6 +151,11 @@ class Transfer extends HD_Controller
$in_time[0] && $where["in_time >="] = $in_time[0] . ' 00:00:00';
$in_time[1] && $where["in_time <="] = $in_time[1] . ' 23:59:59';
}
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
$total = $this->mdTransfer->count($where);
$lists = array();
if ($total) {
@@ -408,9 +413,10 @@ class Transfer extends HD_Controller
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '车辆调拨不存在!');
}
if ($re['status'] == 2) {
// 2022.12.20 原来 确认接车 的状态 不能再修改调拨单,现在需要把这个限制去掉,所有状态都允许修改
/*if ($re['status'] == 2) {
return $this->show_json(SYS_CODE_FAIL, '车辆已调拨完成,不能修改!');
}
}*/
$item_id = $re['item_id'] ? $re['item_id'] : 0;
$re_items = $this->mdItems->get(['id' => $item_id]);
$jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : [];
@@ -524,6 +530,7 @@ class Transfer extends HD_Controller
$trailer_fees = intval($info['trailer_fees']);
$remind = $info['remind'];//1提交
$db_status = -1;
$db_status_not2_flag = true;
if ($info['id']) {//修改调拨
$re_t = $this->mdTransfer->get(array('id' => $info['id']));
if (!$re_t || empty($re_t)) {
@@ -531,12 +538,14 @@ class Transfer extends HD_Controller
}
$db_status = $re_t['status'];
if ($db_status == 2) {
return $this->show_json(SYS_CODE_FAIL, '车辆已完成调拨,不能修改!');
$db_status_not2_flag = false; // 2022.12.20 “确认接车”状态的数据,修改提交后:不改状态,不发短信
#return $this->show_json(SYS_CODE_FAIL, '车辆已完成调拨,不能修改!');
}
}
if ($remind && $db_status == -1) {//提交且状态为-1时,状态设为0调拨
$db_status = 0;
}
!$db_status_not2_flag && $db_status = 2; // 2022.12.20 “确认接车”状态的数据,修改提交后:不改状态,不发短信
if ($remind == 1) {//提交时加判断
if (!$info['arti_id']) {
return $this->show_json(SYS_CODE_FAIL, '请选择随车物品');
@@ -676,22 +685,13 @@ class Transfer extends HD_Controller
$this->mdTransferRemind->delete(['tran_id' => $id, 'type' => 2]);//删除已有备用提车人
}
}
//接车人
$results = $this->edit_remind_admin(['type' => 3, 'tran_id' => $id, 'c_time' => $c_time, 'db_status' => $db_status], $takeCar[3]);
if ($results['add'] == 1) {
if ($takeCar[3]['type'] == 2) {
$results['uid'] && $send_admins[] = $results['uid'];
$addAdmin[] = $results['addDate'];
} else {
$results['uid'] && $send_uids[] = $results['uid'];
$addRemind[] = $results['addDate'];
}
}
//备用接车人
if ($info['in_bak'] == 1) {
$results = $this->edit_remind_admin(['type' => 4, 'tran_id' => $id, 'c_time' => $c_time, 'db_status' => $db_status], $takeCar[4]);
// 2022.12.20 “确认接车”状态的数据,修改提交后:不改状态,不发短信
if ($db_status_not2_flag){
//接车人
$results = $this->edit_remind_admin(['type' => 3, 'tran_id' => $id, 'c_time' => $c_time, 'db_status' => $db_status], $takeCar[3]);
if ($results['add'] == 1) {
if ($takeCar[4]['type'] == 2) {
if ($takeCar[3]['type'] == 2) {
$results['uid'] && $send_admins[] = $results['uid'];
$addAdmin[] = $results['addDate'];
} else {
@@ -699,9 +699,22 @@ class Transfer extends HD_Controller
$addRemind[] = $results['addDate'];
}
}
} else {
$this->mdTransferAdmin->delete(['tran_id' => $id, 'type' => 4]);//删除已有备用接车人
$this->mdTransferRemind->delete(['tran_id' => $id, 'type' => 4]);//删除已有备用接车人
//备用接车人
if ($info['in_bak'] == 1) {
$results = $this->edit_remind_admin(['type' => 4, 'tran_id' => $id, 'c_time' => $c_time, 'db_status' => $db_status], $takeCar[4]);
if ($results['add'] == 1) {
if ($takeCar[4]['type'] == 2) {
$results['uid'] && $send_admins[] = $results['uid'];
$addAdmin[] = $results['addDate'];
} else {
$results['uid'] && $send_uids[] = $results['uid'];
$addRemind[] = $results['addDate'];
}
}
} else {
$this->mdTransferAdmin->delete(['tran_id' => $id, 'type' => 4]);//删除已有备用接车人
$this->mdTransferRemind->delete(['tran_id' => $id, 'type' => 4]);//删除已有备用接车人
}
}
} else {//新增提车人/接车人
//提车人
@@ -745,9 +758,9 @@ class Transfer extends HD_Controller
}
$item_info = $this->input->post('items_info');
//门店调拨短信提醒
$this->send_alisms(['uids' => $send_uids, 'type' => 1, 'item_info' => $item_info, 'tran_id' => $id]);
$db_status_not2_flag && $this->send_alisms(['uids' => $send_uids, 'type' => 1, 'item_info' => $item_info, 'tran_id' => $id]);
//信息员调拨短信提醒
$this->send_alisms(['uids' => $send_admins, 'type' => 2, 'item_info' => $item_info]);
$db_status_not2_flag && $this->send_alisms(['uids' => $send_admins, 'type' => 2, 'item_info' => $item_info]);
return $this->show_json(SYS_CODE_SUCCESS, '提交成功', "/items/transfer");
}
+14 -9
View File
@@ -65,7 +65,7 @@ class Goods extends HD_Controller
$where_1['s_id'] = $params['s_id'];
$where_2['m.s_id'] = $params['s_id'];
$where_3['m.s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
@@ -410,12 +410,12 @@ class Goods extends HD_Controller
$info['out_time'] = $re['out_time'] != '0000-00-00 00:00:00' ? $re['out_time'] : '';
$info['bill_time'] = $re['bill_time'] != '0000-00-00 00:00:00' ? $re['bill_time'] : '';
if ($re['brand_id']) {
$autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name');
$autoList[2] = $this->mdAutoSeries->select(array('status>' => -1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name');
}
if ($re['s_id']) {
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[4] = $this->mdAutoAttr->select(array('type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[5] = $this->mdAutoAttr->select(array('type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 1, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[4] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 0, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[5] = $this->mdAutoAttr->select(array('status>' => -1, 'type' => 2, 's_id' => $re['s_id']), 'id desc', 0, 0, 'id,title as name');
}
$info['city_id'] = '';
$info['county_id'] = '';
@@ -439,13 +439,15 @@ class Goods extends HD_Controller
$_title = '编辑商品';
$edit_url = '/items/goods/goods/edit';
$where_auto = ['status>' => -1];
} else {
$info['fine_ids'] = array();
$info['in_time'] = date('Y-m-d H:i:s');
$_title = '新增商品';
$edit_url = '/items/goods/goods/add';
$where_auto = ['status' => 1];
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$autoList[1] = $this->mdAutoBrand->select($where_auto, 'id desc', 0, 0, 'id,name');
$showInfo['autoList'] = $autoList;
$showInfo['comList'] = $comList;
$showInfo['statusAry'] = $this->statusAry;
@@ -653,14 +655,17 @@ class Goods extends HD_Controller
}
if (!$re_i) {
$brand_id = $objWorksheet->getCell('A' . $_row)->getValue(); //品牌id
$re_b = $this->mdAutoBrand->get(array('name' => $brand_id));
$brand_id = $re_b ? $re_b['id'] : 0;
if (!$brand_id && !$vin) {
continue;
}
$s_id = $objWorksheet->getCell('B' . $_row)->getValue(); //车系id
$v_id = $objWorksheet->getCell('C' . $_row)->getValue(); //车型id
$cor_id = $objWorksheet->getCell('D' . $_row)->getValue(); //车身颜色id
$incor_id = $objWorksheet->getCell('E' . $_row)->getValue(); //内饰颜色id
$addr_name = $objWorksheet->getCell('G' . $_row)->getValue(); //存放地
$company_name = $objWorksheet->getCell('H' . $_row)->getValue(); //归属公司
$re_b = $this->mdAutoBrand->get(array('name' => $brand_id));
$brand_id = $re_b ? $re_b['id'] : 0;
$re_s = $this->mdAutoSeries->get(array('brand_id' => $brand_id, 'name' => $s_id));
$s_id = $re_s ? $re_s['id'] : 0;
$re_a1 = $this->mdAutoAttr->get(array('s_id' => $s_id, 'type' => 1, 'title' => $v_id));
@@ -860,7 +865,7 @@ class Goods extends HD_Controller
$where_1['s_id'] = $params['s_id'];
$where_2['m.s_id'] = $params['s_id'];
$where_3['m.s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1, 'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
+1 -1
View File
@@ -49,7 +49,7 @@ class Logs extends HD_Controller
}
if ($params['s_id']) {
$where['s_id'] = $params['s_id'];
$autoList[3] = $this->mdAutoAttr->select(array('type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
$autoList[3] = $this->mdAutoAttr->select(array('status' => 1,'type' => 1, 's_id' => $params['s_id']), 'id desc', 0, 0, 'id,title as name');
}
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
+1 -1
View File
@@ -55,7 +55,7 @@ class Polyv extends HD_Controller
$this->data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = "保利威频道({$this->channelId})_场次报表";
$this->data['_title'] = "频道({$this->channelId})_场次报表";
$this->show_view('live/polyv/lists', true);
}
+49 -8
View File
@@ -6,6 +6,7 @@ class Clues extends HD_Controller
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
private $cacheKeyPhone = 'xz_admin_phone';
protected $log_dir;
private $maintainAry = ['0-0' => '待处理', '1-10' => '已加企微', '3-7' => '明确拒绝', '2-4' => '未接通', '2-5' => '未完整触碰'];//保养客户专用
public function __construct()
{
@@ -72,6 +73,10 @@ class Clues extends HD_Controller
strlen($params['status2']) && $where["status2"] = $params['status2'];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
if ($this->role == 37) { //特殊处理,丰田店只能看到丰田保养数据
$params['cfrom_id2'] = 37;
$where['admin_id'] = $this->uid;
}
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
@@ -88,24 +93,39 @@ class Clues extends HD_Controller
if ($count) {
$fileds = 'id,name,mobile,cf_id,c_time,admin_id,status,status2,en_time';
$rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds);
$map_admin = $map_cf_pid = $cf_title_arr = [];
//获取来源
$cf_id_arr = array_unique(array_column($rows, 'cf_id'));
$cf_rows = $this->clues_cfrom_model->get_map_by_ids($cf_id_arr, 'id,title');
if ($cf_id_arr) {
$cf_id_str = implode(',', $cf_id_arr);
$res_cfrom = $this->clues_cfrom_model->select(["id in({$cf_id_str})" => null], 'id desc', 0, 0, 'id,title,pid');
$cf_pid_arr = array_unique(array_column($res_cfrom, 'pid'));
if ($cf_pid_arr) {
$cf_pid_str = implode(',', $cf_pid_arr);
$map_cf_pid = $this->clues_cfrom_model->map('id', 'title', ["id in({$cf_pid_str})" => null]);
}
foreach ($res_cfrom as $key => $val) {
$title = $val['title'];
if ($val['pid']) {//一级分类
$map_cf_pid[$val['pid']] && $title = $map_cf_pid[$val['pid']] . '-' . $title;
}
$cf_title_arr[$val['id']] = $title;
}
}
//获取管理员
$this->load->model('sys/sys_admin_model', 'admin_model');
$admin_id_arr = array_unique(array_column($rows, 'admin_id'));
if ($admin_id_arr) {
$str_ids = implode(',', $admin_id_arr);
$where = array("id in ({$str_ids})" => null);
$map_admin = $this->admin_model->map('id', 'username', $where);
$map_admin = $this->admin_model->map('id', 'username', ["id in ({$str_ids})" => null]);
}
foreach ($rows as $key => $val) {
$val['cf_title'] = isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : '';
$val['cf_title'] = $cf_title_arr[$val['cf_id']] ? $cf_title_arr[$val['cf_id']] : '';
$status_name = $statusAry[$val['status']]['name'];
$val['status2'] && $status_name .= '' . $statusAry[$val['status']]['list'][$val['status2']];
$val['status_name'] = $status_name;
$val['admin_name'] = isset($map_admin[$val['admin_id']]) ? $map_admin[$val['admin_id']] : '';
if (SUPER_ADMIN == $this->role) {
$val['admin_name'] = $map_admin[$val['admin_id']] ? $map_admin[$val['admin_id']] : '';
if (SUPER_ADMIN == $this->role || $this->role == 37) {
$val['mobile_sub'] = $val['mobile'];
} else {
$val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
@@ -117,6 +137,11 @@ class Clues extends HD_Controller
foreach ($this->clues_model->statusAry() as $key => $value) {
$cate = array();
$where = array("status" => $key);
if ($this->role == 37) {
$where['cf_id'] = 37;
$where['admin_id'] = $this->uid;
}
$this->role == 37 && $where['cf_id'] = 37;
$count1 = $this->clues_model->count($where);
if ($value['list']) {
foreach ($value['list'] as $key2 => $value2) {
@@ -132,6 +157,7 @@ class Clues extends HD_Controller
$this->data['searchTpAry'] = $this->searchTpAry;
$this->data['params'] = $params;
$this->data['statusList'] = $statusList;
$this->data['maintainAry'] = $this->maintainAry;
$this->data['_title'] = '线索池列表';
return $this->show_view('receiver/clues/lists', true);
}
@@ -507,7 +533,16 @@ class Clues extends HD_Controller
//批量操作(默认修改状态)
public function batch()
{
$id = intval($this->input->post('id'));
$status = $this->input->post('value');
if (!$id || !$status) {
$this->show_json(0, '参数错误');
}
$status_ary = explode('-', $status);
$up_data['status'] = intval($status_ary[0]);
$up_data['status2'] = intval($status_ary[1]);
$this->clues_model->update($up_data, ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//导出数据列表
@@ -568,7 +603,7 @@ class Clues extends HD_Controller
'biz_id' => $biz_id,
'city_id' => $biz['city_id'],
'county_id' => $biz['county_id'],
'brand_id' => $clues_row['brand_id'],
'brand_id' => 0,
's_id' => $clues_row['s_id'],
'if_driver' => $clues_row['if_driver'],
'cf_title' => '平台分配',
@@ -578,6 +613,9 @@ class Clues extends HD_Controller
'p_time' => date('Y-m-d H:i:s'),
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time'])
];
if ($biz['type'] == 5) {//异业店
$add_data['cf_clues'] = '异业店';
}
if ($jsondata['car']) {
isset($jsondata['car']['version']) && $add_data['v_id'] = $jsondata['car']['version']['id'];
$add_data['car_json'] = json_encode($jsondata['car'], JSON_UNESCAPED_UNICODE);
@@ -808,6 +846,9 @@ class Clues extends HD_Controller
'pid' => 0
];
$id && $where['pid'] = $id;
if ($this->role == 37) {
!$id && $where['id'] = 36;
}
$rows = $this->clues_cfrom_model->select($where, 'id desc', '', '', 'id,title');
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
+188 -135
View File
@@ -41,141 +41,11 @@ class Customer extends HD_Controller
{
$status_arr = $this->customers_model->get_status();
unset($status_arr['-1']);
$params = $this->input->get();
!$params['biz_id'] && $params['biz_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['level'] && $params['level'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!$params['wxqy'] && $params['wxqy'] = '';
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
$where = array('status>=0' => null);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["biz_id in ($biz_ids)"] = null;
}
if (false == strpos($_SERVER['HTTP_HOST'], 'dev')) {//dev时不限制
$where['biz_id<>'] = 1;
$where['brand_id<>'] = 3;
}
if ($params['title']) {
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
if ($params['level']) {
$where['level'] = $params['level'];
}
if ($params['of_id']) {
$where['of_id'] = $params['of_id'];
}
if ($params['of2_id']) {
$where['of2_id'] = $params['of2_id'];
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['wxqy']) && $where["wxqy"] = $params['wxqy'];
if ($params['qdjl_id']) {
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
//销售员筛选
if ($params['admin_id']) {
$where['admin_id'] = $params['admin_id'];
} else {
$where_lcb = array();
$str_ids = '';
if ($params['biz_id_admin']) {//指定店铺所有销售员
$where_lcb['biz_id'] = $params['biz_id_admin'];
$str_ids = $params['biz_id_admin'];
} else {
//指定城市的所有销售员
$where_biz = array();
if ($params['county_id_admin']) {
$where_biz['county_id'] = $params['county_id_admin'];
} else if ($params['city_id_admin']) {
$where_biz['city_id'] = $params['city_id_admin'];
}
if ($where_biz) {
$where_biz['status>-1'] = null;
$rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id');
if ($rows_biz) {
$str_ids = implode(',', array_column($rows_biz, 'id'));
$where_lcb["biz_id in({$str_ids})"] = null;
} else {
$where_lcb['biz_id'] = -1;
}
}
}
//获取目标销售员列表
if ($where_lcb) {
$params['city_id_admin'] && $where['city_id'] = $params['city_id_admin'];
$params['county_id_admin'] && $where['county_id'] = $params['county_id_admin'];
$params['biz_id_admin'] && $where['biz_id'] = $params['biz_id_admin'];
$where_lcb['status>-1'] = null;
$rows_lcb = $this->app_licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id');
if ($rows_lcb) {
$str_ids = implode(',', array_column($rows_lcb, 'id'));
$str_ids = $str_ids . ',0';
$where["admin_id in({$str_ids})"] = null;
} else {
if (!$str_ids) {
$where['admin_id'] = -1;
}
}
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
$params['admin_id'] = '';
}
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
if ($params['p_time']) {
$p_time = explode(' ~ ', $params['p_time']);
$p_time[0] && $where["p_time >="] = $p_time[0] . ' 00:00:00';
$p_time[1] && $where["p_time <="] = $p_time[1] . ' 23:59:59';
}
if ($params['cont_time']) {
$cont_time = explode(' ~ ', $params['cont_time']);
$cont_time[0] && $where["cont_time >="] = $cont_time[0] . ' 00:00:00';
$cont_time[1] && $where["cont_time <="] = $cont_time[1] . ' 23:59:59';
}
if ($params['u_time']) {
$u_time = explode(' ~ ', $params['u_time']);
$u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00';
$u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59';
}
if ($params['dt_time']) {
$dt_time = explode(' ~ ', $params['dt_time']);
$dt_time[0] && $where["dt_time >="] = $dt_time[0] . ' 00:00:00';
$dt_time[1] && $where["dt_time <="] = $dt_time[1] . ' 23:59:59';
}
if ($params['order_time']) {
$order_time = explode(' ~ ', $params['order_time']);
$order_time[0] && $where["order_time >="] = $order_time[0] . ' 00:00:00';
$order_time[1] && $where["order_time <="] = $order_time[1] . ' 23:59:59';
}
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id'] == 24) {
$where['cf_id'] = 24;
$params['cfrom_id2'] && $where['t_id'] = $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
} else {
$cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
}
}
}
$where = $this->get_where($params);
$count = $this->customers_model->count($where);
$lists = [];
$offlineSources = $this->customers_model->offlineSources();
@@ -230,10 +100,119 @@ class Customer extends HD_Controller
$this->data['params'] = $params;
$this->data['status_arr'] = $status_arr;
$this->data['qdjl_lists'] = $qdjl_lists;
$this->data['export_button'] = $this->uid == 1 ? 1 : 0;
$this->data['_title'] = '客户列表';
return $this->show_view('receiver/customer/lists', true);
}
private function get_where(&$params){
!$params['biz_id'] && $params['biz_id'] = '';
!$params['cf_title'] && $params['cf_title'] = '';
!$params['qdjl_id'] && $params['qdjl_id'] = '';
!$params['level'] && $params['level'] = '';
!$params['of_id'] && $params['of_id'] = '';
!$params['of2_id'] && $params['of2_id'] = '';
!$params['biz_type'] && $params['biz_type'] = '';
$where = array('status>=0' => null);
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
if ($params['biz_type']) {
$where["biz_id in(select id from lc_biz where type={$params['biz_type']} and id in({$biz_ids}))"] = null;
} else {
$where["biz_id in ($biz_ids)"] = null;
}
} else if ($params['biz_type']) {
$where["biz_id in(select id from lc_biz where type={$params['biz_type']})"] = null;
}
if (false == strpos($_SERVER['HTTP_HOST'], 'dev')) {//dev时不限制
$where['biz_id<>'] = 1;
$where['brand_id<>'] = 3;
}
if ($params['title']) {
$where["{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
if ($params['level']) {
$where['level'] = $params['level'];
}
if ($params['of_id']) {
$where['of_id'] = $params['of_id'];
}
if ($params['of2_id']) {
$where['of2_id'] = $params['of2_id'];
}
if (strlen($params['wxqy'])) {
$where["wxqy"] = $params['wxqy'];
} else {
$params['wxqy'] = '';
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
strlen($params['status']) && $where["status"] = $params['status'];
if ($params['qdjl_id']) {
$where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null;
}
//销售员筛选
if ($params['admin_id']) {
$where['admin_id'] = $params['admin_id'];
} else if ($params['biz_id_admin']) {
$where['biz_id'] = $params['biz_id_admin'];
} else if ($params['county_id_admin']) {
$where["biz_id in(select id from lc_biz where county_id={$params['county_id_admin']})"] = null;
} else if ($params['city_id_admin']) {
$where["biz_id in(select id from lc_biz where city_id={$params['city_id_admin']})"] = null;
}
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
!$params['admin_id'] && $params['admin_id'] = '';
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
if ($params['p_time']) {
$p_time = explode(' ~ ', $params['p_time']);
$p_time[0] && $where["p_time >="] = $p_time[0] . ' 00:00:00';
$p_time[1] && $where["p_time <="] = $p_time[1] . ' 23:59:59';
}
if ($params['cont_time']) {
$cont_time = explode(' ~ ', $params['cont_time']);
$cont_time[0] && $where["cont_time >="] = $cont_time[0] . ' 00:00:00';
$cont_time[1] && $where["cont_time <="] = $cont_time[1] . ' 23:59:59';
}
if ($params['u_time']) {
$u_time = explode(' ~ ', $params['u_time']);
$u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00';
$u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59';
}
if ($params['dt_time']) {
$dt_time = explode(' ~ ', $params['dt_time']);
$dt_time[0] && $where["dt_time >="] = $dt_time[0] . ' 00:00:00';
$dt_time[1] && $where["dt_time <="] = $dt_time[1] . ' 23:59:59';
}
if ($params['order_time']) {
$order_time = explode(' ~ ', $params['order_time']);
$order_time[0] && $where["order_time >="] = $order_time[0] . ' 00:00:00';
$order_time[1] && $where["order_time <="] = $order_time[1] . ' 23:59:59';
}
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id'] == 24) {
$where['cf_id'] = 24;
$params['cfrom_id2'] && $where['t_id'] = $params['cfrom_id2'];
} else {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
} else {
$cf_rows = $this->clues_cfrom_model->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
}
}
}
return $where;
}
public function get()
{
$id = $this->input->get('id');
@@ -283,17 +262,34 @@ class Customer extends HD_Controller
$of_title = $of_ary['name'];
$row['of2_id'] && $of_title .= '-' . $of_ary['list'][$row['of2_id']];
}
$tag = $tag_group = [];
$biz_type = intval($row_biz['type']);
if ($biz_type == 5) {
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : [];
$jsondata['tag_group'] && $tag_group = $jsondata['tag_group'];
} else {
$tag = $this->get_tag($row['id']);
}
$to_send = '';
if ($row['cs_biz_id'] == -1) {
$to_send = '已改派';
} else if ($row['cs_biz_id'] > 0) {
$to_send = '接收线索';
}
$info = array(
'id' => $row['id'],
'name' => $row['name'],
'level' => $row['level'],
'mobile' => $mobile_sub,
'of_title' => $of_title,
'wxqy_name' => $this->customers_model->wxqyAry($row['wxqy']),
'cf_user' => $cf_user,
'to_send' => $to_send,
'c_time' => date('Y-m-d H:i:s', $row['c_time']),
'status' => $row['status'],
'tag' => $this->get_tag($row['id']),
'tag' => $tag,
'tag_group' => $tag_group,
'biz_type' => $biz_type,
);
//到店信息
@@ -518,7 +514,64 @@ class Customer extends HD_Controller
public function export()
{
// TODO: Implement export() method.
if ($this->uid != 1){
return $this->show_json(SYS_CODE_FAIL, '无权限导出');
}
$params = $this->input->get();
$where = $this->get_where($params);
$where["cs_biz_id >= 0"] = null;
$page = 1;
$size = 10000;
$count = $this->customers_model->count($where);
$data = [];
$offlineSources = $this->customers_model->offlineSources();
$status_arr = $this->customers_model->get_status();
unset($status_arr['-1']);
if ($count) {
$fileds = "id, name, mobile, level, status, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id";
$rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds);
foreach ($rows as $key => $val) {
$of_title = '';
if ($val['of_id']) {
$of_ary = $offlineSources[$val['of_id']];
$of_title = $of_ary['name'];
$val['of2_id'] && $of_title .= '-' . $of_ary['list'][$val['of2_id']];
}
$data[] = array(
'id' => 'ID',
'name' => $val['name'],
'mobile' => $val['mobile'],
'level' => $val['level'],
'status_name' => $status_arr[$val['status']],
'c_time' => $val['c_time'],
'dt_time' => $val['dt_time'],
'order_time' => $val['order_time'],
'cont_time' => $val['cont_time'],
'of_title' => $of_title,
'biz_name' => $val['biz_name'],
'admin_name' => $val['admin_name'],
);
}
}
$indexs = [
'name' => '客户姓名',
'mobile' => '手机',
'level' => '客户等级',
'status_name' => '客户类型',
'c_time' => '建档时间',
"dt_time" => "到店时间",
"order_time" => "下单时间",
"cont_time" => "最后联系时间",
"of_title" => "来源",
"biz_name" => "归属门店",
"admin_name" => "归属顾问",
];
$fileName = '客户列表';
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
//改派
+561
View File
@@ -0,0 +1,561 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:车主
* Created on: 2022/6/15 17:15
* Created by: dengbw
*/
class Owners extends HD_Controller
{
private $searchTpAry = array('mobile' => '车主电话', 'name' => '车主姓名', 'car_num' => '车牌号');
private $searchTimeAry = array('c_time' => '创建时间', 'order_time' => '购车时间', 'ck_time' => '交付时间', 'u_time' => '最后操作时间');
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$this->load->model('receiver/receiver_owners_oplogs_model', 'mdOwnersOplogs');
$this->load->model('receiver/receiver_owners_tag_model', 'mdOwnersTag');
$this->load->model('receiver/receiver_owners_tagdata_model', 'mdOwnersTagdata');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('receiver/order/receiver_orders_v2_model', 'mdOrders');
$this->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->load->model('receiver/receiver_xz_model', 'mdXz');
$this->load->model('auto/auto_brand_model', 'mdBrand');
$this->load->model('auto/auto_series_model', 'mdSeries');
$this->load->model('auto/auto_attr_model', 'mdAttr');
$this->load->model('area_model', 'mdArea');
}
public function index()
{
return $this->lists();
}
public function lists()
{
$params = $this->input->get();
$this->data = $this->dataSelect($params);
return $this->show_view('receiver/owners/lists', true);
}
private function dataSelect($params)
{
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
!$params['city_id_admin'] && $params['city_id_admin'] = '';
!$params['county_id_admin'] && $params['county_id_admin'] = '';
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
!$params['admin_id'] && $params['admin_id'] = '';
!$params['city_id'] && $params['city_id'] = '';
!$params['county_id'] && $params['county_id'] = '';
!$params['sex'] && $params['sex'] = '';
!$params['brand_id'] && $params['brand_id'] = '';
!$params['s_id'] && $params['s_id'] = '';
!$params['v_id'] && $params['v_id'] = '';
if (strlen($params['status'])) {
$where["a.status"] = $params['status'];
} else {
$where["a.status>=0"] = null;
}
if ($params['title']) {
$where["a.{$params['search_tp']} like '%{$params['title']}%'"] = null;
}
!$params['search_tp'] && $params['search_tp'] = 'mobile';
if ($params['c_time']) {
$c_time = explode(' ~ ', $params['c_time']);
$c_time[0] && $where["a.c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["a.c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
if ($params['order_time']) {
$order_time = explode(' ~ ', $params['order_time']);
$order_time[0] && $where["a.order_time >="] = $order_time[0] . ' 00:00:00';
$order_time[1] && $where["a.order_time <="] = $order_time[1] . ' 23:59:59';
}
if ($params['ck_time']) {
$ck_time = explode(' ~ ', $params['ck_time']);
$ck_time[0] && $where["a.ck_time >="] = $ck_time[0] . ' 00:00:00';
$ck_time[1] && $where["a.ck_time <="] = $ck_time[1] . ' 23:59:59';
}
if ($params['u_time']) {
$u_time = explode(' ~ ', $params['u_time']);
$u_time[0] && $where["a.u_time >="] = $u_time[0] . ' 00:00:00';
$u_time[1] && $where["a.u_time <="] = $u_time[1] . ' 23:59:59';
}
if (strlen($params['wxqy'])) {
$where["a.wxqy"] = $params['wxqy'];
} else {
$params['wxqy'] = '';
}
if ($params['city_id']) {
$where["a.city_id"] = $params['city_id'];
}
if ($params['county_id']) {
$where["a.county_id"] = $params['county_id'];
}
if ($params['sex']) {
$where["a.sex"] = $params['sex'];
}
if ($params['brand_id']) {
$where["a.brand_id"] = $params['brand_id'];
}
if ($params['s_id']) {
$where["a.s_id"] = $params['s_id'];
}
if ($params['v_id']) {
$where["a.v_id"] = $params['v_id'];
}
//销售员筛选
if ($params['admin_id']) {
$where['b.admin_id'] = $params['admin_id'];
} else if ($params['biz_id_admin']) {
$where['b.biz_id'] = $params['biz_id_admin'];
} else if ($params['county_id_admin']) {
$where["b.biz_id in(select id from lc_biz where county_id={$params['county_id_admin']})"] = null;
} else if ($params['city_id_admin']) {
$where["b.biz_id in(select id from lc_biz where city_id={$params['city_id_admin']})"] = null;
}
$lists = [];
$wxqyAry = $this->mdOwners->wxqyAry();
$statusAry = $this->mdOwners->statusAry();
$count = $this->db->select('a.id')
->from('lc_receiver_owners as a')
->join('lc_receiver_orders_v2 as b', "b.id=a.o_id", 'left')
->where($where)
->count_all_results();
if ($count) {
$offset = ($page - 1) * $size;
$res = $this->db->select('a.*,b.admin_id,b.biz_id')
->from('lc_receiver_owners as a')
->join('lc_receiver_orders_v2 as b', "b.id=a.o_id", 'left')
->where($where)
->order_by('a.id Desc')
->limit($size, $offset)
->get()->result_array();
$str_brand_ids = implode(',', array_unique(array_column($res, 'brand_id')));
$map_brands = $this->mdBrand->map('id', 'name', ["id in({$str_brand_ids})" => null]);
$str_s_ids = implode(',', array_unique(array_column($res, 's_id')));
$map_series = $this->mdSeries->map('id', 'name', ["id in({$str_s_ids})" => null]);
$str_v_ids = implode(',', array_unique(array_column($res, 'v_id')));
$map_attrs = $this->mdAttr->map('id', 'title', ["id in({$str_v_ids})" => null]);
$str_county_ids = implode(',', array_unique(array_column($res, 'county_id')));
$map_countys = $this->mdArea->map('county_id', 'city_name,county_name', ["county_id in({$str_county_ids})" => null]);
#$str_biz_ids = implode(',', array_unique(array_column($res, 'biz_id')));
#$map_bizs = $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]);
$arr_biz_id = array_unique(array_column($res, 'biz_id'));
foreach ($arr_biz_id as $k => $v){
if ($v == null || $v == ''){
unset($arr_biz_id[$k]);
}
}
$str_biz_ids = implode(',', $arr_biz_id);
$map_bizs = $arr_biz_id ? $this->mdBiz->map('id', 'biz_name', ["id in({$str_biz_ids})" => null]) : array();
#$str_admin_ids = implode(',', array_unique(array_column($res, 'admin_id')));
#$map_admins = $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]);
$arr_admin_id = array_unique(array_column($res, 'admin_id'));
foreach ($arr_admin_id as $k => $v){
if ($v == null || $v == ''){
unset($arr_admin_id[$k]);
}
}
$str_admin_ids = implode(',', $arr_admin_id);
$map_admins = $arr_admin_id ? $this->mdLichebUsers->map('id', 'uname', ["id in({$str_admin_ids})" => null]) : array();
foreach ($res as $key => $val) {
$mobile_sub = $val['mobile'];
$sex = $car_name = $city_name = '';
$map_brands[$val['brand_id']] && $car_name = $map_brands[$val['brand_id']];
$map_series[$val['s_id']] && $car_name = $car_name ? $car_name . '-' . $map_series[$val['s_id']] : $map_series[$val['s_id']];
$map_attrs[$val['v_id']] && $car_name = $car_name ? $car_name . '-' . $map_attrs[$val['v_id']] : $map_attrs[$val['v_id']];
$map_countys[$val['county_id']] && $city_name = $map_countys[$val['county_id']]['city_name'] . '-' . $map_countys[$val['county_id']]['county_name'];
if (!$city_name && $val['city_id']) {
$re_are = $this->mdArea->get(['city_id' => $val['city_id']]);
$re_are && $city_name = $re_are['city_name'];
}
$val['sex'] && $sex = $val['sex'] == 1 ? '男' : '女';
$biz_name = $map_bizs[$val['biz_id']] ? $map_bizs[$val['biz_id']] : '';
$admin_name = $map_admins[$val['admin_id']] ? $map_admins[$val['admin_id']] : '';
$lists[] = [
'id' => $val['id'],
'name' => $val['name'],
'mobile' => $val['mobile'],
'mobile_sub' => $mobile_sub,
'sex' => $sex,
'age' => $this->getAgeByBirth($val['birth_day']),
'car_name' => $car_name,
'city_name' => $city_name,
'biz_name' => $biz_name,
'admin_name' => $admin_name,
'wxqy' => $wxqyAry[$val['wxqy']],
'car_num' => $val['car_num'],
'order_time' => $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '',
'ck_time' => $val['ck_time'] != '0000-00-00 00:00:00' ? $val['ck_time'] : '',
'u_time' => $val['u_time'] != '0000-00-00 00:00:00' ? $val['u_time'] : '',
'status_name' => $statusAry[$val['status']]
];
}
}
$show_info['searchTpAry'] = $this->searchTpAry;
$show_info['wxqyAry'] = $wxqyAry;
$show_info['statusAry'] = $statusAry;
$data['show_info'] = $show_info;
$data['lists'] = $lists;
$data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$data['searchTimeAry'] = $this->searchTimeAry;
$data['params'] = $params;
$data['_title'] = '车主列表';
return $data;
}
public function get()
{
$id = $this->input->get('id');
$row = $this->mdOwners->get(array('id' => $id));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '车主不存在!');
}
//用户信息
// if (SUPER_ADMIN == $this->role || 35 == $this->role) {
// $mobile_sub = $row['mobile'];
// } else {
// $mobile_sub = $row['mobile'] ? substr_replace($row['mobile'], '*****', 0, 5) : '';
// }
$mobile_sub = $row['mobile'];
$info = $row;
$info['mobile'] = $mobile_sub;
$info['edit_type'] = 0;
$info['order_time'] = $row['order_time'] != '0000-00-00 00:00:00' ? $row['order_time'] : '';
$info['ck_time'] = $row['ck_time'] != '0000-00-00 00:00:00' ? $row['ck_time'] : '';
$info['c_time'] = date('Y-m-d H:i:s', $row['c_time']);
$info['birth_day'] = $row['birth_day'] != '0000-00-00' ? $row['birth_day'] : '';
$info['tag'] = $this->get_tag($row['id']);
$biz_name = $admin_name = '';
if ($row['o_id']) {
$re_o = $this->mdOrders->get(array('id' => $row['o_id']), 'biz_id,admin_id');
if ($re_o['biz_id']) {
$re_b = $this->mdBiz->get(array('id' => $re_o['biz_id']), 'biz_name');
$re_b && $biz_name = $re_b['biz_name'];
}
if ($re_o['admin_id']) {
$re_u = $this->mdLichebUsers->get(array('id' => $re_o['admin_id']), 'uname');
$re_u && $admin_name = $re_u['uname'];
}
}
$info['biz_name'] = $biz_name;
$info['admin_name'] = $admin_name;
//操作日志
$rows_log = $this->mdOwnersOplogs->select(['own_id' => $id], 'id desc', 0, 0);
$logs = [];
if ($rows_log) {
foreach ($rows_log as $key => $value) {
$rec_text = $rec_url = '';
if ($value['type'] == 2) {
$rec_row = $this->mdXz->get(['id' => $value['log']], 'rec_url,duration');
if ($rec_row['duration']) {
$rec_row['rec_url'] && $rec_url = $rec_row['rec_url'];
!$rec_row['rec_url'] && $rec_text = '录音暂未生成';
} else {
$rec_text = '未接通';
}
}
$imgs = [];
if ($value['imgs']) {
$json_imgs = json_decode($value['imgs'], true);
foreach ($json_imgs as $key1 => $value1) {
$imgs[] = build_qiniu_image_url($value1);
}
}
$logs[] = array(
'uname' => $value['uname'],
'log' => $value['log'],
'imgs' => $imgs,
'rec_url' => $rec_url,
'rec_text' => $rec_text,
'type_name' => $this->mdOwnersOplogs->typeAry($value['type']),
'c_time' => date('Y-m-d H:i', $value['c_time'])
);
}
}
$show_info['wxqyAry'] = $this->mdOwners->wxqyAry();
$show_info['statusAry'] = $this->mdOwners->statusAry();
$this->data['show_info'] = $show_info;
$this->data['info'] = $info;
$this->data['logs'] = $logs;
$this->data['_title'] = '车主户详情';
return $this->show_view('receiver/owners/get', true);
}
public function add()
{
// TODO: Implement add() method.
}
/**
* 新增日志
* @return bool
*/
function add_log()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
if (!$params['log']) {
return $this->show_json(SYS_CODE_FAIL, '请输入内容!');
}
$addData = array(
'own_id' => $params['id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($params['type']),
'log' => $params['log'],
'c_time' => time()
);
$id = $this->mdOwnersOplogs->add($addData);
if ($id) {
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
}
/**
* 编辑
* @return bool
*/
public function edit()
{
$info = $this->input->post('info');
if (!$info) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$row = $this->mdOwners->get(array('id' => $info['id']));
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '车主信息不存在!');
}
$msg = '修改成功';
$code = SYS_CODE_SUCCESS;
if ($info['edit_type'] == 1) {//更新状态
if ($row['status'] == $info['status']) {
return $this->show_json(SYS_CODE_FAIL, '未修改状态!');
}
$statuAry = $this->mdOwners->statusAry();
$status_name = $statuAry[$row['status']];
$status_name_up = $statuAry[$info['status']];
$log = '更新状态(' . $status_name . ')为(' . $status_name_up . ')';
$up_data['status'] = $info['status'];
$ret = $this->mdOwners->update($up_data, array('id' => $info['id']));
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改状态失败';
} else {
$msg = '修改状态成功';
$this->addLog(array('own_id' => $info['id'], 'type' => 0, 'log' => $log));
}
} else if ($info['edit_type'] == 2) {
//更新车主信息
$ret = $this->mdOwners->update(['name' => $info['name'], 'mobile' => $info['mobile'], 'birth_day' => $info['birth_day'], 'sex' => $info['sex'],
'brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'v_id' => $info['v_id'], 'car_num' => $info['car_num'],
'order_time' => $info['order_time'], 'ck_time' => $info['ck_time'], 'wxqy' => $info['wxqy']
, 'city_id' => $info['city_id'], 'county_id' => $info['county_id']], ['id' => $info['id']]);
if (!$ret) {
$code = SYS_CODE_FAIL;
$msg = '修改车主信息失败';
} else {
$msg = '修改车主信息成功';
$this->addLog(array('own_id' => $info['id'], 'type' => 0, 'log' => '更新车主信息'));
}
} else if ($info['edit_type'] == 3) {
$id = $info['id'];
//客户标签
if (!$info['tag']) {
return $this->show_json(SYS_CODE_FAIL, '客户画像不存在!');
}
$add_tag = [];
//查找已加入标签
$res_td = $this->mdOwnersTagdata->select(['o_id' => $id], 'id desc', 0, 0, 't_id');
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
foreach ($info['tag'] as $key => $val) {
foreach ($val['list'] as $key2 => $val2) {
if ($val['type'] == 'checkbox') {
if ($val2['checked'] == 'true') {
if (!$tag_data || !in_array($val2['id'], $tag_data)) {//未加标签,新增
$add_tag[] = ['o_id' => $id, 't_id' => $val2['id'], 'c_time' => time()];
}
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {//删除标签
$this->mdOwnersTagdata->delete(['o_id' => $id, 't_id' => $val2['id']]);
}
}
} else {
if ($val['value'] == $val2['id']) {
if (!$tag_data || !in_array($val2['id'], $tag_data)) {//未加标签,新增
$add_tag[] = ['o_id' => $id, 't_id' => $val2['id'], 'c_time' => time()];
}
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {//删除标签
$this->mdOwnersTagdata->delete(['o_id' => $id, 't_id' => $val2['id']]);
}
}
}
}
}
if ($add_tag && count($add_tag)) {
$this->mdOwnersTagdata->add_batch($add_tag);
}
$this->addLog(array('own_id' => $info['id'], 'type' => 0, 'log' => '修改车主画像'));
}
return $this->show_json($code, $msg);
}
public function del()
{
}
public function batch()
{
// TODO: Implement batch() method.
}
public function export()
{
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$data = $indexs = array();
$res = $this->dataSelect($params);
$fileName = $res['_title'];
foreach ($res['lists'] as $key => $value) {
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['car_name'] = $value['car_name'];
$temp['city_name'] = $value['city_name'];
$temp['car_num'] = $value['car_num'];
$temp['sex'] = $value['sex'];
$temp['age'] = $value['age'];
$temp['wxqy'] = $value['wxqy'];
$temp['status_name'] = $value['status_name'];
$temp['order_time'] = $value['order_time'];
$temp['ck_time'] = $value['ck_time'];
$temp['city_name'] = $value['city_name'];
$temp['biz_name'] = $value['biz_name'];
$temp['admin_name'] = $value['admin_name'];
$temp['u_time'] = $value['u_time'];
$data[] = $value;
}
$indexs = [
'name' => '车主',
'mobile' => '手机号',
'car_name' => '车辆',
'city_name' => '所在城市',
'car_num' => '车牌号',
"sex" => "性别",
"age" => "年龄",
"wxqy" => "企微好友",
"status_name" => "状态",
"order_time" => "购车时间",
"ck_time" => "交付时间",
"biz_name" => "所属门店",
"admin_name" => "销售员",
"u_time" => "最后操作时间",
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
}
/**
* Notes:增加日志
* Created on: 2021/7/23 10:48
* Created by: dengbw
* @param array $ary
* @return mixed
*/
private function addLog($ary = array())
{
$id = 0;
if ($ary['log']) {
$addData = array(
'own_id' => $ary['own_id'],
'uid' => $this->uid,
'uname' => $this->username,
'type' => intval($ary['type']),
'log' => $ary['log'],
'c_time' => time()
);
$id = $this->mdOwnersOplogs->add($addData);
}
return $id;
}
/**
* Notes:车主标签
* Created on: 2022/6/16 14:47
* Created by: dengbw
* @param $id
* @return array
*/
private function get_tag($id)
{
$show = $res_td = [];
$res = $this->mdOwnersTag->select(['status' => 1, 'pid' => 0], 'sort desc,id desc', 0, 0, 'id,name,type');
if ($res) {
$id && $res_td = $this->mdOwnersTagdata->select(['o_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择
$tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : '';
foreach ($res as $key => $val) {
$list = [];
$value = '';
$res2 = $this->mdOwnersTag->select(['status' => 1, 'pid' => $val['id']], 'sort desc,id desc', 0, 0, 'id,name');
foreach ($res2 as $key2 => $val2) {
//检查是否选中标签
$setValue = ['id' => $val2['id'], 'name' => $val2['name']];
if ($val['type'] == 'checkbox') {
$setValue['checked'] = $tag_data && in_array($val2['id'], $tag_data) ? true : false;
} else {
if ($tag_data && in_array($val2['id'], $tag_data)) {
$value = $val2['id'];
}
}
$list[] = $setValue;
}
$show[] = ['id' => $val['id'], 'name' => $val['name'], 'type' => $val['type'], 'value' => $value, 'list' => $list];
}
}
return $show;
}
/**
* Notes:根据生日计算年龄,年龄的格式是:2018-01-22
* Created on: 2022/6/16 14:47
* Created by: dengbw
* @param $birthday
* @return false|int|string
*/
private function getAgeByBirth($birthday)
{
$birth_year = date('Y', strtotime($birthday));
$birth_month = date('m', strtotime($birthday));
$birth_day = date('d', strtotime($birthday));
if (!$birthday || $birthday == '0000-00-00') {
return '';
}
if (empty($birth_year) || empty($birth_month) || empty($birth_day)) {
return '';
}
$current_year = date('Y', time());
$current_month = date('m', time());
$current_day = date('d', time());
if ($birth_year >= $current_year) {
return 0;
}
$age = $current_year - $birth_year - 1;
if ($current_month > $birth_month) {
return $age + 1;
} else if ($current_month == $birth_month && $current_day >= $birth_day) {
return $age + 1;
} else {
return $age;
}
}
}
+202
View File
@@ -0,0 +1,202 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class OwnersTag extends HD_Controller
{
private $tabAry = [1 => ['title' => '客户标签', 'url' => '/receiver/tag'], 2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag']];
public function __construct()
{
parent::__construct();
$this->load->model('receiver/receiver_owners_tag_model', 'mdOwnersTag');
}
//首页信息
public function index()
{
return $this->lists();
}
//数据列表
public function lists()
{
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['tab'] = 2;
$statusAry = $this->mdOwnersTag->statusAry();
$typeAry = $this->mdOwnersTag->typeAry();
$lists = array();
$where = ["status<>-1" => null, 'pid' => 0];
if (strlen($params['status'])) {
$where['status'] = $params['status'];
}
if ($params['type']) {
$where['type'] = $params['type'];
}
$count = $this->mdOwnersTag->count($where);
if ($count) {
$res = $this->mdOwnersTag->select($where, "sort desc,id desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['name'] = $value['name'];
$setValue['sort'] = $value['sort'];
$setValue['type_name'] = $typeAry[$value['type']];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $statusAry[$value['status']];
$options = '';
$res_tag = $this->mdOwnersTag->select(["status" => 1, 'pid' => $value['id']], "sort desc,id desc", 0, 0, 'id,name,sort');
$res_tag && $options = implode(',', array_column($res_tag, 'name'));
$setValue['options'] = $options;
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry, 'tabAry' => $this->tabAry];
$this->data['_title'] = '车主标签列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('receiver/ownerstag/lists', true);
}
public function get_options()
{
$id = intval($this->input->post('id'));
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$res_tag = $this->mdOwnersTag->select(["status" => 1, 'pid' => $id], "sort desc,id desc", 0, 0, 'id,name,sort,status');
$this->data['lists'] = $res_tag;
return $this->show_json(SYS_CODE_SUCCESS);
}
//展示单条数据
public function get()
{
$id = intval($this->input->get('id'));
if ($id) {
$url = "receiver/ownersTag/edit";
$re = $this->mdOwnersTag->get(['id' => $id]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '车主标签不存在!');
}
$name = $re['name'];
$sort = $re['sort'];
$type = $re['type'];
} else {
$url = "receiver/ownersTag/add";
$name = '';
$sort = 0;
$type = 'checkbox';
}
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'type' => $type,
'typeAry' => $this->mdOwnersTag->typeAry(), 'url' => $url];
return $this->show_view('receiver/ownerstag/edit');
}
//添加单条数据
public function add()
{
$params = $this->input->post();
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '标签名称不能为空!');
}
$re = $this->mdOwnersTag->get(array('name' => $params['name']));
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!');
}
$id = $this->mdOwnersTag->add(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']]);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//编辑单条数据
public function edit()
{
$params = $this->input->post();
if (!$params['id']) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '请输入标签名称');
}
$re = $this->mdOwnersTag->get(array('name' => $params['name'], 'status' => 1));
if ($re && $re['id'] != $params['id']) {
return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!');
}
$this->mdOwnersTag->update(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']],
['id' => $params['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//删除单条数据
public function del()
{
$id = $this->input->post('id');
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re = $this->mdOwnersTag->get(['id' => $id]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '标签不存在!');
}
$this->mdOwnersTag->update(['status' => '-1'], ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//修改标签选项
function edit_options()
{
$pid = $this->input->post('id');
$options = $this->input->post('options');
if (!$pid || !$options) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdOwnersTag->get(['id' => $pid]);
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '车主标签不存在!');
}
$add_tag = $edit_tag = [];
foreach ($options as $key => $value) {
$sort = intval($value['sort']);
$data = ['name' => $value['name'], 'status' => $value['status'], 'sort' => $sort];
if ($value['name']) {
if ($value['id']) {//修改
$this->mdOwnersTag->update($data, ['id' => $value['id']]);
} else {//新增
$add_tag[] = ['name' => $value['name'], 'order' => $sort];
$data['pid'] = $pid;
$this->mdOwnersTag->add($data);
}
}
}
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
function edit_status()
{
$id = $this->input->post('id');
$stauts = intval($this->input->post('status'));
if (!$id) {
$this->show_json(SYS_CODE_FAIL, '参数错误');
}
$this->mdOwnersTag->update(['status' => $stauts], ['id' => $id]);
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
}
+3 -1
View File
@@ -4,6 +4,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Tag extends HD_Controller
{
private $tabAry = [1 => ['title' => '客户标签', 'url' => '/receiver/tag'], 2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag']];
public function __construct()
{
@@ -23,6 +24,7 @@ class Tag extends HD_Controller
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['tab'] = 1;
$statusAry = $this->mdCustomerTag->statusAry();
$typeAry = $this->mdCustomerTag->typeAry();
$showAry = $this->mdCustomerTag->showAry();
@@ -58,7 +60,7 @@ class Tag extends HD_Controller
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry, 'showAry' => $showAry];
$this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry, 'showAry' => $showAry, 'tabAry' => $this->tabAry];
$this->data['_title'] = '客户标签列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/receiver/tag/lists', true);
File diff suppressed because it is too large Load Diff
+669
View File
@@ -0,0 +1,669 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class order extends HD_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('receiver/order/receiver_orders_v2_model', 'mdOrders');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
$this->load->model('biz/biz_model', 'mdBiz');
}
//首页信息
public function index()
{
return $this->get_dfdq();
}
/**
* Notes:东风
* Created on: 2022/8/22 15:04
* Created by: dengbw
* @return bool|void
*/
public function get_dfmc()
{
$params = $this->input->get();
$config['brand_id'] = 1;
$config['bizs'] = [
1 => ['biz_name' => '厦门品牌店', 'ids' => '20', 'rowspan' => 1],
2 => ['biz_name' => '泉州品牌店', 'ids' => '99'], 3 => ['biz_name' => '福州品牌店', 'ids' => '55'],
4 => ['biz_name' => '厦门合伙店', 'type' => 2, 'city_id' => '350200'],
5 => ['biz_name' => '泉州代理店', 'not_ids' => '99', 'city_id' => '350500'],
6 => ['biz_name' => '福州代理店', 'type' => 3, 'city_id' => '350100'],
7 => ['biz_name' => '龙岩代理店', 'type' => 3, 'city_id' => '350800'],
8 => ['biz_name' => '宁德代理店', 'city_id' => '350900'],
9 => ['biz_name' => '莆田代理店', 'type' => 3, 'city_id' => '350300'],
10 => ['biz_name' => '三明代理店', 'type' => 3, 'city_id' => '350400'],
11 => ['biz_name' => '漳州代理店', 'type' => 3, 'city_id' => '350600'],
12 => ['biz_name' => '南平代理店', 'type' => 3, 'city_id' => '350700'],
];
$res = $this->commonSelect($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/get_dfmc';
$this->data['_title'] = '东风';
return $this->show_view('stats/order/common', true);
}
/**
* Notes:零跑
* Created on: 2022/8/22 14:19
* Created by: dengbw
*/
public function get_leapmotor()
{
$params = $this->input->get();
$config['brand_id'] = 5;
$config['bizs'] = [
1 => ['biz_name' => '泉州零跑品牌店', 'ids' => '63', 'rowspan' => 1],
2 => ['biz_name' => '泉州渠道', 'not_ids' => '63', 'city_id' => '350500', 'show' => 'order'],
3 => ['biz_name' => '厦门渠道', 'city_id' => '350200', 'show' => 'order']];
$res = $this->commonSelect($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/get_leapmotor';
$this->data['_title'] = '零跑';
return $this->show_view('stats/order/common', true);
}
/**
* Notes:哪吒
* Created on: 2022/8/17 14:19
* Created by: dengbw
*/
public function get_hozonauto()
{
$params = $this->input->get();
$config['brand_id'] = 4;
$config['bizs'] = [
1 => ['biz_name' => '宁德哪吒品牌店', 'ids' => '70', 'rowspan' => 1],
2 => ['biz_name' => '宁德哪吒代理店', 'type' => 3, 'city_id' => '350900', 'show' => 'order'],
3 => ['biz_name' => '厦门哪吒订单中心', 'city_id' => '350200', 'show' => 'order'],
4 => ['biz_name' => '泉州哪吒订单中心', 'city_id' => '350500', 'show' => 'order'],
5 => ['biz_name' => '福州哪吒订单中心', 'city_id' => '350100', 'show' => 'order']];
$res = $this->commonSelect($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/get_hozonauto';
$this->data['_title'] = '哪吒';
return $this->show_view('stats/order/common', true);
}
/**
* Notes:代理店
* Created on: 2022/8/23 14:17
* Created by: dengbw
* @return bool|void
*/
public function get_agent()
{
$params = $this->input->get();
$config['brands'] = [1 => '东风ev', 4 => '哪吒', 5 => '零跑'];
$config['bizs'] = [
1 => ['biz_name' => '泉州代理店', 'type' => 3, 'city_id' => '350500', 'rowspan' => 1],
2 => ['biz_name' => '福州代理店', 'type' => 3, 'city_id' => '350100'],
3 => ['biz_name' => '龙岩代理店', 'type' => 3, 'city_id' => '350800'],
4 => ['biz_name' => '宁德代理店', 'type' => 3, 'city_id' => '350900'],
5 => ['biz_name' => '莆田代理店', 'type' => 3, 'city_id' => '350300'],
6 => ['biz_name' => '三明代理店', 'type' => 3, 'city_id' => '350400'],
7 => ['biz_name' => '南平代理店', 'type' => 3, 'city_id' => '350700'],
8 => ['biz_name' => '漳州代理店', 'type' => 3, 'city_id' => '350600'],
];
$res = $this->common2Select($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/get_agent';
$this->data['type_name'] = '代理店';
$this->data['_title'] = '代理店品牌店群';
return $this->show_view('stats/order/common2', true);
}
/**
* Notes:合伙店
* Created on: 2022/8/23 14:17
* Created by: dengbw
* @return bool|void
*/
public function get_partner()
{
$params = $this->input->get();
$config['brands'] = [1 => '东风ev', 4 => '哪吒', 5 => '零跑'];
$config['bizs'] = [1 => ['biz_name' => '厦门合伙店', 'type' => 2, 'city_id' => '350200', 'rowspan' => 1]];
$res = $this->common2Select($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/get_partner';
$this->data['type_name'] = '合伙店';
$this->data['_title'] = '合伙店品牌店群';
return $this->show_view('stats/order/common2', true);
}
/**
* Notes:东风品牌店群
* Created on: 2022/8/17 14:17
* Created by: dengbw
* @return bool|void
*/
public function get_dfdq()
{
$params = $this->input->get();
$config['brands'] = [1 => '东风ev', 4 => '哪吒', 5 => '零跑'];
$config['bizs'] = [
1 => ['biz_name' => '厦门东风', 'ids' => '20', 'rowspan' => 1],
2 => ['biz_name' => '晋江东风', 'ids' => '99'],
3 => ['biz_name' => '福州东风', 'ids' => '55']];
$res = $this->common2Select($params, $config);
$this->data['info'] = $res['info'];
$this->data['params'] = $res['params'];
$this->data['url'] = '/stats/order/';
$this->data['type_name'] = '品牌店';
$this->data['_title'] = '东风品牌店群';
return $this->show_view('stats/order/common2', true);
}
private function common2Select($params, $config)
{
!$params['type'] && $params['type'] = 1;
$start_date = date('Y-m', strtotime("-2 month"));//取最近3个月
$end_date = date('Y-m');
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $start_date = $time[0];
$time[1] && $end_date = $time[1];
} else {
$params['time'] = $start_date . ' ~ ' . $end_date;
}
$date_months = $this->dateMonths($start_date, $end_date);
rsort($date_months);
$days = [];
foreach ($date_months as $k => $v) {
$month = date('n', strtotime($v . '-01'));
$days[$v] = ['month' => $month, 'num' => 0];
}
$brands = $config['brands'];
$bizs = $config['bizs'];
foreach ($bizs as $k => $v) {
$str_ids = $v['ids'] ? $v['ids'] : '';
if (!$str_ids) {
$where_b = ['city_id' => $v['city_id']];
$v['type'] && $where_b['type'] = $v['type'];
$v['not_ids'] && $where_b["id not in({$v['not_ids']})"] = null;
$res = $this->mdBiz->select($where_b, 'id desc', 0, 0, 'id');
if ($res) {
$str_ids = implode(',', array_unique(array_column($res, 'id')));
$str_ids = $str_ids ? $str_ids : '-2';
}
}
$list = [];
foreach ($days as $k2 => $v2) {
$order_time = $this->getTime($k2);
$c_time = $this->getTime($k2, 1);
if ($params['type'] == 2) {
$num = $this->mdOrders->count(["biz_id in({$str_ids})" => null, 'status in(0,1)' => null, 'order_time>=' => $order_time['s_time'], 'order_time<=' => $order_time['e_time']]);
} else {
$num = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$str_ids})" => null, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time'], 'a.order_time<=' => $order_time['e_time']
, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
$list[$k2] = $num;
$days[$k2]['num'] = $v2['num'] + $num;
}
$v['list'] = $list;
$v['ids'] = $str_ids;
$bizs[$k] = $v;
}
$brands_stats = $customers_stats = $process = [];
foreach ($bizs as $k => $v) {
$list = [];
foreach ($brands as $k2 => $v2) {
$stats_per = $stats = [];
foreach ($days as $k3 => $v3) {
$order_time = $this->getTime($k3);
$c_time = $this->getTime($k3, 1);
if ($params['type'] == 2) {
$num = $this->mdOrders->count(["biz_id in({$v['ids']})" => null, 'brand_id' => $k2, 'status in(0,1)' => null, 'order_time>=' => $order_time['s_time'], 'order_time<=' => $order_time['e_time']]);
} else {
$num = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.brand_id' => $k2, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time'], 'a.order_time<=' => $order_time['e_time']
, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
$stats_per[] = $this->getPercentage(['num' => $num, 'sum' => $v['list'][$k3]]);
$stats[] = $num;
}
$list[] = ['brand_name' => $v2, 'stats_per' => $stats_per, 'stats' => $stats];
}
$brands_stats[] = ['biz_name' => $v['biz_name'], 'list' => $list];
}
$offlineSources = $this->mdCustomers->offlineSources();
$offlineSources_count = count($offlineSources);
//线索成交情况
foreach ($bizs as $k => $v) {
$list = $cus_sum = $ord_sum = $cus_per = [];
$cus_1 = $ord_1 = [];//自然到店
foreach ($offlineSources as $k2 => $v2) {
$stats_per_cus = $stats_cus = $stats_per_ord = $stats_ord = [];
foreach ($days as $k3 => $v3) {
$c_time = $this->getTime($k3, 1);
$order_time = $this->getTime($k3);
$num_cus = $this->mdCustomers->count(["biz_id in({$v['ids']})" => null, 'of_id' => $k2, 'status>=' => 0, 'c_time>=' => $c_time['s_time'], 'c_time<=' => $c_time['e_time']]);
if ($params['type'] == 2) {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time']
, 'a.order_time<=' => $order_time['e_time'], 'b.of_id' => $k2])
->count_all_results();
} else {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time'], 'a.order_time<=' => $order_time['e_time']
, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
$cus_sum[$k3] += $num_cus;
$ord_sum[$k3] += $num_ord;
$stats_cus[] = $num_cus;
$stats_ord[$k3] = $num_ord;
$stats_per_cus[] = $this->getPercentage(['num' => $num_ord, 'sum' => $num_cus]);
$stats_per_ord[$k3] = '0.00';
if ($k2 == 1) {//自然到店
$cus_1[$k3] = $num_cus;
$ord_1[$k3] = $num_ord;
}
}
$list[] = ['name' => "{$v2['name']}(转化率)", 'type' => 1, 'stats_per' => $stats_per_cus, 'stats' => $stats_cus];
$list[] = ['name' => "{$v2['name']}(订单占比)", 'type' => 2, 'stats_per' => $stats_per_ord, 'stats' => $stats_ord];
}
foreach ($days as $k3 => $v3) {
$ord = $ord_1[$k3] ? $ord_sum[$k3] - $ord_1[$k3] : $ord_sum[$k3];
$cus = $cus_1[$k3] ? $cus_sum[$k3] - $cus_1[$k3] : $cus_sum[$k3];
$cus_per[] = $this->getPercentage(['num' => $ord, 'sum' => $cus]);
}
$customers_stats[] = ['biz_name' => $v['biz_name'], 'cus_sum' => $cus_sum, 'ord_sum' => $ord_sum, 'cus_per' => $cus_per, 'list' => $list];
}
//过程数据
$process_cus = $process_into = $process_ord = [];
foreach ($bizs as $k => $v) {
$list_cus = $cus_sum = $list_into = $ord_into = $into_sum = $list_ord = $ord_sum = [];
foreach ($offlineSources as $k2 => $v2) {
$stats_per_cus = $stats_cus = $stats_per_into = $stats_into = $stats_per_ord = $stats_ord = [];
foreach ($days as $k3 => $v3) {
$order_time = $this->getTime($k3);
$c_time = $this->getTime($k3, 1);
//线索数
$num_cus = 0;
if ($k2 != 1) {//不包括自然到店
$num_cus = $this->mdCustomers->count(["biz_id in({$v['ids']})" => null, 'of_id' => $k2, 'status>=' => 0, 'c_time>=' => $c_time['s_time'], 'c_time<=' => $c_time['e_time']]);
$cus_sum[$k3] += $num_cus;
$stats_cus[] = $num_cus;
$stats_per_cus[$k3] = $num_cus;
}
//进店数
if ($params['type'] == 2) {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'],
'b.status>=' => 0, "b.biz_id in({$v['ids']})" => null, 'b.of_id' => $k2])
->count_all_results();
} else {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'],
'b.status>=' => 0, "b.biz_id in({$v['ids']})" => null, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
$into_sum[$k3] += $num_into;
$stats_into[] = $num_into;
$num_into_per = '';
if ($k2 != 1) {//转化率=进店数/客户数
$num_into_per = $this->getPercentage(['num' => $num_into, 'sum' => $num_cus]);
}
$stats_per_into[$k3] = $num_into_per;
//成交数
if ($params['type'] == 2) {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time']
, 'a.order_time<=' => $order_time['e_time'], 'b.of_id' => $k2])
->count_all_results();
} else {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time'], 'a.order_time<=' => $order_time['e_time']
, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
$ord_sum[$k3] += $num_ord;
$stats_ord[] = $num_ord;
//转化率=订单数/进店数
$stats_per_ord[$k3] = $this->getPercentage(['num' => $num_ord, 'sum' => $num_into]);
}
if ($k2 != 1) {//不包括自然到店
$list_cus[] = ['name' => $v2['name'], 'stats_per' => $stats_per_cus, 'stats' => $stats_cus];
}
$list_into[] = ['name' => $v2['name'], 'stats_per' => $stats_per_into, 'stats' => $stats_into];
$list_ord[] = ['name' => $v2['name'], 'stats_per' => $stats_per_ord, 'stats' => $stats_ord];
}
$process_cus[] = ['biz_name' => $v['biz_name'], 'num_sum' => $cus_sum, 'list' => $list_cus];
$process_into[] = ['biz_name' => $v['biz_name'], 'num_sum' => $into_sum, 'list' => $list_into];
$process_ord[] = ['biz_name' => $v['biz_name'], 'num_sum' => $ord_sum, 'list' => $list_ord];
}
$process = ['customers' => $process_cus, 'into_shop' => $process_into, 'orders' => $process_ord];
$data['info'] = ['days' => $days, 'bizs' => $bizs, 'bizs_count' => count($bizs), 'days_count' => count($days)
, 'brands_count' => count($brands), 'offlineSources_count' => $offlineSources_count, 'brands_stats' => $brands_stats
, 'customers_stats' => $customers_stats, 'process' => $process, 'type_ary' => [1 => '月销售模型(当月线索)', 2 => '月销售模型']];
$data['params'] = $params;
return $data;
}
private function commonSelect($params, $config)
{
$brand_id = $config['brand_id'];//品牌id
!$params['type'] && $params['type'] = 1;
$start_date = date('Y-m', strtotime("-2 month"));//取最近3个月
$end_date = date('Y-m');
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $start_date = $time[0];
$time[1] && $end_date = $time[1];
} else {
$params['time'] = $start_date . ' ~ ' . $end_date;
}
$date_months = $this->dateMonths($start_date, $end_date);
rsort($date_months);
$days = [];
foreach ($date_months as $k => $v) {
$month = date('n', strtotime($v . '-01'));
$days[$v] = ['month' => $month, 'num' => 0];
}
$bizs = $config['bizs'];
foreach ($bizs as $k => $v) {
$str_ids = $v['ids'] ? $v['ids'] : '';
if (!$str_ids) {
$where_b = ['city_id' => $v['city_id']];
$v['type'] && $where_b['type'] = $v['type'];
$v['not_ids'] && $where_b["id not in({$v['not_ids']})"] = null;
$res = $this->mdBiz->select($where_b, 'id desc', 0, 0, 'id');
if ($res) {
$str_ids = implode(',', array_unique(array_column($res, 'id')));
$str_ids = $str_ids ? $str_ids : '-2';
}
}
$list = $customer_ids = [];
foreach ($days as $k2 => $v2) {
$order_time = $this->getTime($k2);
$c_time = $this->getTime($k2, 1);
if ($params['type'] == 2) {
$where_o = ["biz_id in({$str_ids})" => null, 'brand_id' => $brand_id,
'status in(0,1)' => null, 'order_time>=' => $order_time['s_time'], 'order_time<=' => $order_time['e_time']];
$num = $this->mdOrders->count($where_o);
if ($num && $v['show'] == 'order') {//按订单数来匹配
$res_o = $this->mdOrders->select($where_o, 'id desc', 0, 0, 'customer_id');
$customer_ids[$k2] = implode(',', array_unique(array_column($res_o, 'customer_id')));
}
} else {
$where_o = ["a.biz_id in({$str_ids})" => null, 'a.brand_id' => $brand_id, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time']
, 'a.order_time<=' => $order_time['e_time'], 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']];
$num = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where($where_o)
->count_all_results();
if ($num && $v['show'] == 'order') {//按订单数来匹配
$res_o = $this->mdOrders->db->select('a.customer_id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where($where_o)
->get()->result_array();
$customer_ids[$k2] = implode(',', array_unique(array_column($res_o, 'customer_id')));
}
}
$list[$k2] = $num;
$days[$k2]['num'] = $v2['num'] + $num;
}
$v['list'] = $list;
$v['ids'] = $str_ids;
$v['customer_ids'] = $customer_ids;
$bizs[$k] = $v;
}
//echo json_encode($bizs,JSON_UNESCAPED_UNICODE);
$offlineSources = $this->mdCustomers->offlineSources();
$offlineSources_count = count($offlineSources);
//过程数据
$process_cus = $process_into = $process_ord = [];
foreach ($bizs as $k => $v) {
$list_cus = $cus_sum = $list_into = $ord_into = $into_sum = $list_ord = $ord_sum = [];
foreach ($offlineSources as $k2 => $v2) {
$stats_per_cus = $stats_cus = $stats_per_into = $stats_into = $stats_per_ord = $stats_ord = [];
foreach ($days as $k3 => $v3) {
$order_time = $this->getTime($k3);
$c_time = $this->getTime($k3, 1);
//成交数
if ($params['type'] == 2) {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.brand_id' => $brand_id, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time']
, 'a.order_time<=' => $order_time['e_time'], 'b.of_id' => $k2])
->count_all_results();
} else {
$num_ord = $this->mdOrders->db->select('a.id')
->from('lc_receiver_orders_v2 as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(["a.biz_id in({$v['ids']})" => null, 'a.brand_id' => $brand_id, 'a.status in(0,1)' => null, 'a.order_time>=' => $order_time['s_time'], 'a.order_time<=' => $order_time['e_time']
, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']])
->count_all_results();
}
//线索数
$num_cus = 0;
if ($k2 != 1) {//不包括自然到店
if ($v['show'] == 'order') {
$num_cus = $num_ord;
} else {
$num_cus = $this->mdCustomers->count(["biz_id in({$v['ids']})" => null, 'of_id' => $k2, 'status>=' => 0, 'c_time>=' => $c_time['s_time'], 'c_time<=' => $c_time['e_time']]);
}
$cus_sum[$k3] += $num_cus;
$stats_cus[] = $num_cus;
$stats_per_cus[$k3] = $num_cus;
}
//进店数
$num_into = 0;
if ($params['type'] == 2) {
$where_into = ['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'],
'b.status>=' => 0, 'b.of_id' => $k2];
if ($v['show'] == 'order') {
if ($v['customer_ids'][$k3]) {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(array_merge($where_into, ["b.id in({$v['customer_ids'][$k3]})" => null]))
->count_all_results();
}
} else {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(array_merge($where_into, ["b.biz_id in({$v['ids']})" => null]))
->count_all_results();
}
} else {
$where_into = ['a.type' => 4, 'a.log' => '客户到店', 'a.c_time>=' => $c_time['s_time'], 'a.c_time<=' => $c_time['e_time'],
'b.status>=' => 0, 'b.of_id' => $k2, 'b.c_time>=' => $c_time['s_time'], 'b.c_time<=' => $c_time['e_time']];
if ($v['show'] == 'order') {
if ($v['customer_ids'][$k3]) {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(array_merge($where_into, ["b.id in({$v['customer_ids'][$k3]})" => null]))
->count_all_results();
}
} else {
$num_into = $this->mdUsersLog->db->select('a.id')
->from('lc_receiver_customer_oplogs as a')
->join('lc_receiver_customers as b', "b.id=a.customer_id", 'left')
->where(array_merge($where_into, ["b.biz_id in({$v['ids']})" => null]))
->count_all_results();
}
}
$into_sum[$k3] += $num_into;
$stats_into[] = $num_into;
$num_into_per = '';
if ($k2 != 1) {//转化率=进店数/客户数
$num_into_per = $this->getPercentage(['num' => $num_into, 'sum' => $num_cus]);
}
$stats_per_into[$k3] = $num_into_per;
//成交数
$ord_sum[$k3] += $num_ord;
$stats_ord[] = $num_ord;
//转化率=订单数/进店数
$stats_per_ord[$k3] = $this->getPercentage(['num' => $num_ord, 'sum' => $num_into]);
}
if ($k2 != 1) {//不包括自然到店
$list_cus[] = ['name' => $v2['name'], 'stats_per' => $stats_per_cus, 'stats' => $stats_cus];
}
$list_into[] = ['name' => $v2['name'], 'stats_per' => $stats_per_into, 'stats' => $stats_into];
$list_ord[] = ['name' => $v2['name'], 'stats_per' => $stats_per_ord, 'stats' => $stats_ord];
}
$process_cus[] = ['biz_name' => $v['biz_name'], 'num_sum' => $cus_sum, 'list' => $list_cus];
$process_into[] = ['biz_name' => $v['biz_name'], 'num_sum' => $into_sum, 'list' => $list_into];
$process_ord[] = ['biz_name' => $v['biz_name'], 'num_sum' => $ord_sum, 'list' => $list_ord];
}
$process = ['customers' => $process_cus, 'into_shop' => $process_into, 'orders' => $process_ord];
$data['info'] = ['days' => $days, 'bizs' => $bizs, 'bizs_count' => count($bizs), 'days_count' => count($days)
, 'brands_count' => 1, 'offlineSources_count' => $offlineSources_count, 'process' => $process,
'type_ary' => [1 => '月销售模型(当月线索)', 2 => '月销售模型']];
$data['params'] = $params;
return $data;
}
/**
* Notes:计算出两个日期之间的月份
* Created on: 2022/8/9 14:38
* Created by: dengbw
* @param $start_date [开始日期,如2022-03]
* @param $end_date [结束日期,如2022-12]
* @param string $explode [年份和月份之间分隔符,此例为 - ]
* @param bool $addOne [算取完之后最后是否加一月,用于算取时间戳用]
* @return array [返回是两个月份之间所有月份字符串]
*/
private function dateMonths($start_date, $end_date, $explode = '-', $addOne = false)
{
//判断两个时间是不是需要调换顺序
$start_int = strtotime($start_date);
$end_int = strtotime($end_date);
if ($start_int > $end_int) {
$tmp = $start_date;
$start_date = $end_date;
$end_date = $tmp;
}
//结束时间月份+1,如果是13则为新年的一月份
$start_arr = explode($explode, $start_date);
$start_year = intval($start_arr[0]);
$start_month = intval($start_arr[1]);
$end_arr = explode($explode, $end_date);
$end_year = intval($end_arr[0]);
$end_month = intval($end_arr[1]);
$data = array();
$data[] = $start_date;
$tmp_month = $start_month;
$tmp_year = $start_year;
//如果起止不相等,一直循环
while (!(($tmp_month == $end_month) && ($tmp_year == $end_year))) {
$tmp_month++;
//超过十二月份,到新年的一月份
if ($tmp_month > 12) {
$tmp_month = 1;
$tmp_year++;
}
$data[] = $tmp_year . $explode . str_pad($tmp_month, 2, '0', STR_PAD_LEFT);
}
if ($addOne == true) {
$tmp_month++;
//超过十二月份,到新年的一月份
if ($tmp_month > 12) {
$tmp_month = 1;
$tmp_year++;
}
$data[] = $tmp_year . $explode . str_pad($tmp_month, 2, '0', STR_PAD_LEFT);
}
return $data;
}
private function getPercentage($params)
{
return number_format_com($params['num'] / $params['sum'] * 100, 2, '') . "";
}
private function getTime($day, $type = 0)
{
$s_time = "{$day}-01 00:00:00";//本月一日
$e_time = date('Y-m-d', strtotime("$s_time +1 month -1 day")) . ' 23:59:59';//本月最后一日
if ($type == 1) {
$s_time = strtotime($s_time);
$e_time = strtotime($e_time);
} else if ($type == 2) {
$s_time = "{$day}-01";
$e_time = date('Y-m-d', strtotime("$s_time +1 month -1 day"));
}
return ['s_time' => $s_time, 'e_time' => $e_time];
}
//数据列表
public function lists()
{
}
//展示单条数据
public function get()
{
}
//添加单条数据
public function add()
{
}
//编辑单条数据
public function edit()
{
}
//删除单条数据
public function del()
{
}
//批量操作(默认修改状态)
public function batch()
{
}
//导出数据列表
public function export()
{
}
}
+11 -12
View File
@@ -33,7 +33,7 @@ class HD_Model extends CI_Model {
$this->set_table_name($table_name);
}
public function __call($func,$args)
public function __call($func,$args)
{
if($func) {
if($args) {
@@ -42,7 +42,7 @@ class HD_Model extends CI_Model {
return $this->db->$func();
}
}
public function set_db($db_group = 'default')
{
if(!isset(self::$dbs[$db_group]))
@@ -126,13 +126,13 @@ class HD_Model extends CI_Model {
$result = $this->db->update($this->table_name, $data, $where);
return $this->db->affected_rows() ? $this->db->affected_rows() : $result;
}
/**
* 更新或插入数据
* @param $data
* @return mixed
*/
public function replace($data)
public function replace($data)
{
if($data)
{
@@ -178,7 +178,7 @@ class HD_Model extends CI_Model {
return $this->db->query($sql);
}
}
/**
* 获取单条数据
* @param $where
@@ -244,19 +244,18 @@ class HD_Model extends CI_Model {
$offset = null;
$limit = null;
}
$result = $this->db->get($this->table_name, $limit, $offset)->result_array();
$this->db->from($this->table_name);
$this->db->limit($limit, $offset);
$query = $this->db->get();
$result = $query ? $query->result_array() : [];
if($obj && file_exists($class = APPPATH.'libraries/entity/'.ucfirst($obj).'.php'))
{
require_once $class;
if(class_exists($obj))
{
$result = $this->db->get($this->table_name, $limit, $offset)->custom_result_object($obj);
}
}
return $result;
}
@@ -555,7 +554,7 @@ class HD_Model extends CI_Model {
* @param array $param
* @return mixed
*/
public function un_file_cache($func, $param =array())
public function un_file_cache($func, $param =array())
{
if(IF_FILE_CACHE)
{
@@ -571,7 +570,7 @@ class HD_Model extends CI_Model {
* @param $type
* @return bool
*/
public function del_cache($method, $type, $skey = '')
public function del_cache($method, $type, $skey = '')
{
$cache = & load_cache($type);
$db = $this->load->database('default', true);
+21 -22
View File
@@ -47,28 +47,27 @@ class Auth {
} elseif(false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")){
//开发测试免检
} elseif(filter_var($ip, FILTER_VALIDATE_IP) && $ip != $admin_user['login_ip']) {
$CI->load->model('sys/sys_config_model');
$config_ip = $CI->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL,"k" => "site"));
$ip_arr = array();
foreach ($config_ip as $key => $value)
{
$ip_arr[] = json_decode($value['v'])->ip;
}
$ip_arr = array_merge($ip_arr, array_column($CI->sys_admin_model->select(array(),'','','','login_ip'), 'login_ip'));
if(!in_array($ip, $ip_arr) && $dir)
{
if($admin_user['id'] > 10){//管理员id>10去掉验证码登录
$admin_info = array(
'id' => $admin_user['id'],
);
$domain = explode('.', $_SERVER['HTTP_HOST']);
array_shift($domain);
$domain = implode('.', $domain);
$CI->input->set_cookie(LOGIN_COOKIE, $CI->encryption->encrypt(json_encode($admin_info)), time() + 86400, $domain);
$this->returnMsg('访问IP发生变化,请重新登录', '/login/check_view');
}
}
// $CI->load->model('sys/sys_config_model');
// $config_ip = $CI->sys_config_model->select(array("v LIKE '%\"status\":\"1\"%'" => NULL,"k" => "site"));
// $ip_arr = array();
// foreach ($config_ip as $key => $value)
// {
// $ip_arr[] = json_decode($value['v'])->ip;
// }
// $ip_arr = array_merge($ip_arr, array_column($CI->sys_admin_model->select(array(),'','','','login_ip'), 'login_ip'));
// if(!in_array($ip, $ip_arr) && $dir)
// {
// if($admin_user['id'] > 10){//管理员id>10去掉验证码登录
// $admin_info = array(
// 'id' => $admin_user['id'],
// );
// $domain = explode('.', $_SERVER['HTTP_HOST']);
// array_shift($domain);
// $domain = implode('.', $domain);
// $CI->input->set_cookie(LOGIN_COOKIE, $CI->encryption->encrypt(json_encode($admin_info)), time() + 86400, $domain);
// $this->returnMsg('访问IP发生变化,请重新登录', '/login/check_view');
// }
// }
}
//权限分类筛选
+216 -26
View File
@@ -19,6 +19,7 @@ class Ordersv2List
$this->ci->load->model('receiver/order/receiver_order_status_model');
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->ci->load->model('app/licheb/app_licheb_users_model', 'mdLichebUsers');
$this->ci->load->model('app/licheb/app_licheb_channel_biz_model');
$this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
$this->ci->load->model("biz/biz_model");
@@ -26,6 +27,8 @@ class Ordersv2List
$this->ci->load->model('auto/auto_brand_model');
$this->ci->load->model('auto/auto_attr_model');
$this->ci->load->model('items/items_model', 'mdItems');
$this->ci->load->model('area_model');
$this->ci->load->model('sys/sys_finance_model');
$this->ci->load->library('receiver/orders_v2_entity');
$this->ci->load->library('receiver/orders_status_entity');
@@ -40,7 +43,8 @@ class Ordersv2List
!strlen($params['payway']) && $params['payway'] = '';
!$params['biz_type'] && $params['biz_type'] = '';
!strlen($params['over_id']) && $params['over_id'] = '';
$fieldAry = $this->get_fields($status_pid);
!strlen($params['is_bill']) && $params['is_bill'] = '';
$fieldAry = $this->get_fields($status_pid,0,$params['status']);
$show_info['offlineSourcesAry'] = $this->ci->mdCustomers->offlineSources();//客户来源
$show_info['paywayAry'] = $this->paywayAry;//付款方式
$show_info['overAry'] = $this->overAry;
@@ -58,6 +62,47 @@ class Ordersv2List
return $result;
}
//获取车辆服务费, 参考 \orderv2\Orders.php public function get()
private function get_srv_info($row){
//获取车辆服务费
$srv_info = $this->ci->orders_v2_entity->order_srv_money($row['id'], 2);
$fine_title = '';
if($row['fines']){
$fines = json_decode($row['fines'],true);
$split = $fine_title = '';
foreach($fines as $key=>$val){
$price = $val['price']>0 ? number_format(floatval($val['price']),2) : '赠送';
$fine_title .= $split."{$val['txt']}:{$price}";
$split = ' ';
}
}
$srv_info['total'] = number_format($srv_info['total'], 2);
$srv_detail = "";
if ($srv_info['list']) {
foreach ($srv_info['list'] as $key => $val) {
$d = $srv_detail ? ',' : '';
if($val['key']=='price_fine_select' && $fine_title){
#$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2)."<span class='text-success'>[$fine_title]</span>";
if ($val['money'] > 0){
$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2)."<span class='text-success'>[$fine_title]</span>";
$srv_info[$val['key']] = number_format(floatval($val['money']), 2);
}
else{
$srv_detail .= $d . $val['title'] ."<span class='text-success'>[$fine_title]</span>";
$srv_info[$val['key']] = '';
}
$srv_info[$val['key'].'_detail'] = $fine_title;
}else{
$srv_detail .= $d . $val['title'] . ":" . number_format(floatval($val['money']), 2);
$srv_info[$val['key']] = $val['money'] > 0 ? number_format(floatval($val['money']), 2) : '';
}
}
}
$srv_info['fine_title'] = $fine_title;
$srv_info['detail'] = $srv_detail;
return $srv_info;
}
/**
* Notes:全部订单
* Created on: 2021/9/18 15:13
@@ -86,7 +131,7 @@ class Ordersv2List
$where["{$this->t1}.biz_id in ($biz_ids)"] = null;
}
if ($params['biz_type']) {
$where["{$this->t1}.biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ' and status=1)'] = null;
$where["{$this->t1}.biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ')'] = null;
}
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
@@ -133,6 +178,23 @@ class Ordersv2List
$where["{$this->t1}.bill_time <="] = $bill_time[1] . ' 23:59:59';
}
}
//交付时间
if ($params['ck_time']) {
$ck_time = explode(' ~ ', $params['ck_time']);
if ($ck_time[0]) {
$where["{$this->t1}.ck_time >="] = $ck_time[0] . ' 00:00:00';
}
if ($ck_time[1]) {
$where["{$this->t1}.ck_time <="] = $ck_time[1] . ' 23:59:59';
}
}
if(strlen($params['is_bill'])){
if($params['is_bill']){
$where["{$this->t1}.bill_time <> '0000-00-00 00:00:00'"] = null;
}else{
$where["{$this->t1}.bill_time"] = '0000-00-00 00:00:00';
}
}
//交付时长
if(strlen($params['over_id'])){
if($params['over_id']==3){
@@ -206,30 +268,34 @@ class Ordersv2List
$where["{$this->t1}.item_id in(select id from lc_items where vin like '%{$params['vin']}%')"] = null;
}
$fileds = "{$this->t1}.id,{$this->t1}.name,{$this->t1}.mobile,{$this->t1}.brand_id,{$this->t1}.s_id,{$this->t1}.v_id,
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,
{$this->t1}.cor_id,{$this->t1}.incor_id,{$this->t1}.money_json,{$this->t1}.payway,{$this->t1}.status,{$this->t1}.c_time,{$this->t1}.fines,
{$this->t1}.biz_id,{$this->t1}.bill_time,{$this->t1}.customer_id,{$this->t1}.owner_name,{$this->t1}.owner_mobile,{$this->t1}.main_type,{$this->t1}.info_json,
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time";
{$this->t1}.order_time,{$this->t1}.bill_time,{$this->t1}.item_id,{$this->t1}.over_time,{$this->t1}.sale_id,{$this->t1}.finance_id,{$this->t1}.refund_time,
{$this->t1}.ck_time,{$this->t1}.admin_id";
if(strlen($params['status_pid'])){
$where["{$this->t1}.brand_id>"] = 0;
}
if (strlen($params['status_pid']) && $params['status'] == 1) { //付款-已下定
if (strlen($params['status_pid']) && $params['status_pid'] != 21) { //付款-已下定
$where["{$this->t1}.status <> 2"] = null;
}
if ($params['status_pid'] == 4) { //交付需要开票后才显示
$where["{$this->t1}.id in (select o_id from lc_receiver_order_status where pid_status=3 and status=1)"] = null;
}
if (strlen($params['status_pid']) && $params['status_pid'] && $params['status_pid']!=21) {
if (strlen($params['status_pid']) && $params['status_pid'] && !in_array($params['status_pid'],[21,5,3])) {
$where["{$this->t1}.id>="] = Orders_v2_entity::V2_START_ID;
}
if (strlen($params['status_pid']) && !$params['status_pid']) { //付款列表 下定时间排序
$orderby = "{$this->t1}.order_time desc";
} elseif ($params['status_pid'] == 3) { // 开票列表 开票时间排序
$orderby = "{$this->t1}.bill_time desc";
}elseif($params['status_pid'] == 21){ //退款时间排序
$orderby = "{$this->t1}.refund_time desc";
}elseif($params['status_pid']==5 || ($params['status']==2&&$params['status_pid']==4)){ //交付时间排序
$orderby = "{$this->t1}.ck_time desc,{$this->t1}.c_time desc";
} else {
$orderby = "{$this->t1}.c_time desc";
}
if (strlen($params['status_pid']) && $params['status'] && $params['status_pid']!=21) {
if (strlen($params['status_pid']) && $params['status'] && $params['status_pid']!=21 &&$params['status']<21) {
$where["{$this->t2}.pid_status"] = $params['status_pid'];
$up_key = $params['status'] + 1;
$where["{$this->t2}.status in ({$params['status']},{$up_key})"] = null;
@@ -240,7 +306,7 @@ class Ordersv2List
$count = $this->ci->mdOrders->selectOrders($where, '', '', '', 1, '', $having);
$rows = $this->ci->mdOrders->selectOrders($where, $orderby, $page, $size, '', $fileds, $having);
} else {
if (strlen($params['status'])) {
if (strlen($params['status']) && $params['status']<21) {
$where["id not in (select o_id from lc_receiver_order_status where pid_status={$params['status_pid']} and status=1)"] = null;
}
if ($params['status_pid'] == 3) { //开票
@@ -251,6 +317,10 @@ class Ordersv2List
}
}
$params['status_pid'] == 21 && $where['status'] = 2; //退款
if($params['status']==21){ //特殊需求
$where["id in (select o_id from lc_receiver_order_status where pid_status=0 and status=1)"] = null; //已付定金
$where["id not in (select o_id from lc_receiver_order_status where pid_status=0 and status=2)"] = null; //尾款未支付
}
$count = $this->ci->mdOrders->count($where);
$rows = $this->ci->mdOrders->select($where, $orderby, $page, $size, $fileds);
}
@@ -268,7 +338,17 @@ class Ordersv2List
//门店
$str_biz_ids = implode(',', array_unique(array_column($rows, 'biz_id')));
!$str_biz_ids && $str_biz_ids = 0;
$bizs = $this->ci->biz_model->map('id', 'biz_name', array("id in({$str_biz_ids})" => null));
$bizs_rows = $this->ci->biz_model->select(array("id in({$str_biz_ids})" => null),'','','','id,biz_name,city_id,county_id,type');
$bizs = [];
if($bizs_rows){ //获取城市
$ids = array_unique(array_column($bizs_rows, 'county_id'));
$city_rows = $this->ci->area_model->get_map_by_county_ids($ids,'id,city_name,city_id','city_id');
foreach ($bizs_rows as $val) {
$val['city_name'] = $city_rows[$val['city_id']] ? $city_rows[$val['city_id']][0]['city_name'] : '';
$bizs[$val['id']] = $val;
}
}
//品牌车型
$brand_arr = array_unique(array_column($rows, 'brand_id'));
$brands = $this->ci->auto_brand_model->get_map_by_ids($brand_arr, 'id,name');
@@ -281,14 +361,23 @@ class Ordersv2List
$incor_arr = array_unique(array_column($rows, 'incor_id'));
$attr_arr = array_merge($v_arr, $cor_arr, $incor_arr);
$attr = $this->ci->auto_attr_model->get_map_by_ids($attr_arr, 'id,title');
$admin_ids = array_unique(array_column($rows,'admin_id'));
$admin_ids_str = implode(',',$admin_ids);
$admins = [];
if($admin_ids_str){
$where = [
"id in ($admin_ids_str)" => null
];
$admins = $this->ci->mdLichebUsers->map('id','uname',$where,'id desc',0,0,'id,uname'); //顾问
}
foreach ($rows as $key => $val) {
$money_json = json_decode($val['money_json'], true);
$info_json = json_decode($val['info_json'], true);
$fields = array();
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$series_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$v_name = isset($attr[$val['v_id']]) ? $attr[$val['v_id']][0]['title'] : '';
$cor_name = isset($attr[$val['cor_id']]) ? $attr[$val['cor_id']][0]['title'] : '';
$money_json = json_decode($val['money_json'],true);
$fields['o_id'] = $val['id'];
if (Orders_v2_entity::V2_START_ID < $val['id']) {
if ($val['main_type']) {
@@ -299,40 +388,101 @@ class Ordersv2List
$mobile = $val['owner_mobile'];
}
$open_url = '/receiver/orderv2/orders/get?id=';
$id_card_append = $info_json['c_owner_cardid'] ? '<br>'.$info_json['c_owner_cardid'] : '';
$fields['name'] = $size > 1000 ? $name
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . $id_card_append . '</a>';
} else {
$open_url = '/receiver/orders/get?id=';
$mobile = $val['mobile'];
$o_tp = '(旧订单)';
$id_card_append = $info_json['c_cardid'] ? '<br>'.$info_json['c_cardid'] : '';
$fields['name'] = $size > 1000 ? $val['name']
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $val['name'] . $o_tp . '<br>' . $val['mobile'] . '</a>';
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $val['name'] . $o_tp . '<br>' . $val['mobile'] . $id_card_append .'</a>';
}
$fields['mobile'] = $mobile;
$fields['id_card'] = $info_json['c_owner_cardid'] ? '="'.$info_json['c_owner_cardid'].'"' : '';
$fields['mobile'] = $size > 1000 ? '="'.$mobile.'"' : $mobile;
$fields['car_name'] = "{$brand_name}-{$series_name}-{$v_name}-{$cor_name}";
$fields['price'] = $this->paywayAry[$val['payway']]."<br>".number_format($money_json['price_car'], 2);
$fields['price_car'] = number_format($this->ci->orders_v2_entity->total_price($val['id'],$val['money_json']),2);
$fields['payway_name'] = $this->paywayAry[$val['payway']];
$fields['price'] = $fields['payway_name']."<br>".$fields['price_car'];
$fields['brand_name'] = $brand_name;
$fields['series_name'] = $series_name;
$fields['v_name'] = $v_name;
$fields['cor_name'] = $cor_name;
$fields['incor_name'] = isset($attr[$val['incor_id']]) ? $attr[$val['incor_id']][0]['title'] : '';
if (strlen($params['status_pid']) && $params['status_pid'] != 5 && $val['status'] != 2) {
$fields['status_name'] = $this->ci->orders_status_entity->last_status_cn($val['id'], $params['status_pid']);
} else {
$fields['status_name'] = $order_status_cn[$val['status']];
if($val['status']==2 || $val['id']<= Orders_v2_entity::V2_START_ID){
$status_name = $order_status_cn[$val['status']];
}else{
$params['status_pid'] == 6 && $params['status_pid']='';
$status_name = $this->ci->orders_status_entity->last_status_cn($val['id'], $params['status_pid']);
!$status_name && $status_name = '未下定';
}
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['status_name'] = $status_name;
$fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'].'<br>'.$admins[$val['admin_id']] : '';
$size > 1000 && $fields['biz_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['biz_name'] : '';
$fields['city_name'] = $bizs[$val['biz_id']] ? $bizs[$val['biz_id']]['city_name'] : '';
$fields['biz_type'] = $bizs[$val['biz_id']] ? $this->ci->biz_model->type_ary($bizs[$val['biz_id']]['type']) : '';
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$of_title = '-';
$of_title_1 = $of_title_2 = '';
$of_id = $customers[$val['customer_id']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of_ary['name'] && $of_title_1 = $of_ary['name'];
$of2_id = $customers[$val['customer_id']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
$of2_id && $of_ary['list'][$of2_id] && $of_title_2 = $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['of_title_1'] = $of_title_1;
$fields['of_title_2'] = $of_title_2;
$fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '';
$fields['bill_time'] = $val['bill_time'] != '0000-00-00 00:00:00' ? $val['bill_time'] : '';
$fields['over_time'] = $val['over_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($val['over_time'])) : '';
$fields['refund_time'] = $val['refund_time'] != '0000-00-00 00:00:00' ? date('Y-m-d',strtotime($val['refund_time'])) : '';
$fields['vin'] = $items[$val['item_id']] ? $items[$val['item_id']] : '';
$fields['vin'] && $fields['car_name'] = $fields['car_name']."<br>".$fields['vin'];
$fields['ck_time'] = $val['ck_time'];
if($size>1000){
$user_info = '';
if($bizs[$val['biz_id']]['type']==3){ //代理店显示渠道经理的姓名
$channel_users = $this->ci->app_licheb_channel_biz_model->select(['biz_id'=>$val['biz_id']],'','','','uid');
$user_ids = array_column($channel_users,'uid');
$user_ids_str = implode(',',$user_ids);
if($user_ids_str && $user_ids){
$where = [
'group_id' => 4,
'status' => 1,
"id in ($user_ids_str)" => null
];
$users = $this->ci->mdLichebUsers->select($where,'id desc',1,10,'uname,biz_id'); //渠道经理
$users && $user_info = implode(' ',array_column($users,'uname'));
}
$fields['admin_name'] = $user_info;
}
if(!$user_info){
$sale = $this->ci->mdLichebUsers->get(['id'=>$val['sale_id']],'uname');
$fields['admin_name'] = $sale['uname'];
}
$fields['address'] = $info_json['c_address'];
}
if(!$val['payway']){ //分期
$finance_row = $this->ci->sys_finance_model->get(['id' => $val['finance_id']], 'id,title');
$is_sure = $this->ci->receiver_order_status_model->count(['o_id'=>$val['id'],'pid_status'=>1,'status'=>2]);
$finance_row && $fields['price'] = "{$fields['payway_name']}({$finance_row['title']})<br>{$fields['price_car']}";
$fields['pro_loan'] = $finance_row['title'];
$fields['price_loan'] = $money_json['price_loan'];
$fields['is_sure'] = $is_sure ? '是':'否';
}
$srv_info = $this->get_srv_info($val);
$fields['srv_info_total'] = $srv_info['total'] > 0 ? $srv_info['total'] : '';
$fields['srv_info_fee_carno'] = $srv_info['fee_carno'] ? $srv_info['fee_carno'] : '';
$fields['srv_info_price_finance'] = $srv_info['price_finance'] ? $srv_info['price_finance'] : '';
$fields['srv_info_price_fine_select'] = $srv_info['price_fine_select'] ? $srv_info['price_fine_select'] : '';
$fields['srv_info_price_fine_select_detail'] = $srv_info['price_fine_select_detail'] ? $srv_info['price_fine_select_detail'] : '';
$lists[] = $fields;
}
}
@@ -370,7 +520,7 @@ class Ordersv2List
$where["biz_id in ($biz_ids)"] = null;
}
if ($params['biz_type']) {
$where["biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ' and status=1)'] = null;
$where["biz_id in (select id from lc_biz where type = " . $params['biz_type'] . ')'] = null;
}
if ($params['of_id'] || $params['of2_id']) {
$where_c = 'status>=0';
@@ -445,7 +595,6 @@ class Ordersv2List
!$str_biz_ids && $str_biz_ids = 0;
$bizs = $this->ci->biz_model->map('id', 'biz_name', array("id in({$str_biz_ids})" => null));
foreach ($rows as $key => $val) {
$money_json = json_decode($val['money_json'], true);
$info_json = json_decode($val['info_json'], true);
$fields = array();
$fields['o_id'] = $val['id'];
@@ -457,20 +606,26 @@ class Ordersv2List
$mobile = $val['owner_mobile'];
}
$open_url = '/receiver/orderv2/orders/get?id=';
$id_card_append = $info_json['c_owner_cardid'] ? '<br>'.$info_json['c_owner_cardid'] : '';
$fields['name'] = $size > 1000 ? $name
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . '</a>';
: '<a href="javascript:;" data-open="' . $open_url . $val['id'] . '">' . $name . '<br>' . $mobile . $id_card_append .'</a>';
$fields['mobile'] = $mobile;
$fields['biz_name'] = $bizs[$val['biz_id']];
$fields['c_time'] = date('Y-m-d H:i:s', $val['c_time']);
$of_title = '-';
$of_title_1 = $of_title_2 = '';
$of_id = $customers[$val['customer_id']]['of_id'];
if ($of_id) {
$of_ary = $offlineSources[$of_id];
$of_title = $of_ary['name'];
$of_ary['name'] && $of_title_1 = $of_ary['name'];
$of2_id = $customers[$val['customer_id']]['of2_id'];
$of2_id && $of_title .= '-' . $of_ary['list'][$of2_id];
$of2_id && $of_ary['list'][$of2_id] && $of_title_2 = $of_ary['list'][$of2_id];
}
$fields['of_title'] = $of_title;
$fields['of_title_1'] = $of_title_1;
$fields['of_title_2'] = $of_title_2;
$lists[] = $fields;
}
}
@@ -489,12 +644,24 @@ class Ordersv2List
* @param int $export
* @return array
*/
public function get_fields($status_pid, $export = 0)
public function get_fields($status_pid, $export = 0, $status)
{
$fields1 = $fields2 = [];
if ($export) {
$fields1['name'] = ['title' => '客户姓名'];
$fields1['mobile'] = ['title' => '客户电话'];
$fields1['id_card'] = ['title' => '证件号码'];
$fields1['brand_name'] = ['title' => '品牌'];
$fields1['series_name'] = ['title' => '车系'];
$fields1['v_name'] = ['title' => '车型'];
$fields1['cor_name'] = ['title' => '车身颜色'];
$fields1['vin'] = ['title' => 'vin码'];
$fields1['city_name'] = ['title'=>'城市'];
$fields1['biz_type'] = ['title'=>'门店类型'];
$fields1['biz_name'] = ['title' => '门店'];
$fields1['admin_name'] = ['title' => '销售人员'];
$fields1['of_title_1'] = ['title' => '来源1'];
$fields1['of_title_2'] = ['title' => '来源2'];
} else {
$fields1['name'] = ['title' => '客户', 'width' => '14%'];
}
@@ -521,12 +688,35 @@ class Ordersv2List
'price' => ['title' => '最终售价', 'width' => '9%'],
// 'payway_name' => ['title' => '付款方式', 'width' => '8%'],
'of_title' => ['title' => '客户来源', 'width' => '10%'], 'status_name' => ['title' => '状态', 'width' => '9%'],
'over_time' => ['title' => '交付截止', 'width' => '9%'],'order_time' => ['title' => '下定时间', 'width' => '9%']
'order_time' => ['title' => '下定时间', 'width' => '9%'],'over_time' => ['title' => '交付截止', 'width' => '9%']
];
if($status_pid==21){
unset($fields2['over_time']);
$fields2['refund_time'] = ['title' => '退款时间', 'width' => '9%'];
}
if($status_pid==5 || ($status_pid==4 && $status==2)){
unset($fields2['over_time']);
$fields2['ck_time'] = ['title' => '交付时间', 'width' => '9%'];
}
}
$fields = array_merge($fields1, $fields2);
if ($export) {
$fields['vin'] = ['title' => 'vin'];
unset($fields['price'],$fields['c_time'],$fields['car_name'],$fields['vin'],$fields['of_title']);
$fields['payway_name'] = ['title'=>'付款方式'];
$fields['pro_loan'] = ['title'=>'金融机构'];
$fields['price_loan'] = ['title'=>'贷款金额'];
$fields['is_sure'] = ['title'=>'确认到款(是/否)'];
$fields['price_car'] = ['title'=>'最终售价'];
$fields['srv_info_total'] = ['title'=>'服务费'];
$fields['srv_info_fee_carno'] = ['title'=>'服务-上牌'];
$fields['srv_info_price_finance'] = ['title'=>'服务-金融'];
$fields['srv_info_price_fine_select'] = ['title'=>'服务-精品选装'];
$fields['srv_info_price_fine_select_detail'] = ['title'=>'精品选装内容'];
!$fields['c_time'] && $fields['c_time'] = ['title' => '订单时间'];
!$fields['over_time'] && $fields['over_time'] = ['title' => '止交付时间'];
!$fields['order_time'] && $fields['order_time'] = ['title' => '下定时间'];
!$fields['bill_time'] && $fields['bill_time'] = ['title' => '开票时间'];
$fields['address'] = ['title' => '联系人地址'];
}
return $fields;
}
+461
View File
@@ -0,0 +1,461 @@
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div id="vue-edit">
<div class="am-g">
<div class="col-sm-12" style="margin-bottom: 20px;">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select v-if="info.id==0" id="status" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
<select v-else id="status" disabled="disabled" v-model="info.status">
<template v-for="(v,i) in status_list">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div v-if="info.id>0" class="am-form-inline"
style="text-align:right;padding-right: 10px;padding-top: 35px;">
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-if="info.editType==1">取消编辑</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-else>编辑状态</a>
</div>
<div class="am-form-group ml10" v-if="info.editType==1">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveStatus()">保存状态</a>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">活动信息</span>
</div>
<div class="am-panel-bd am-g">
<div class="am-form-group">
<label class="am-para-label">标题:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">背景图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.info.bg_img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
:src="vue_obj.info.bg_img.src"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">背景颜色:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.bg_color">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">活动时间:</label>
<div class="am-para-input" style="width: 30%">
<input id="time_id" value="<?= $info['time'] ?>" type="text" placeholder="开始日期 ~ 结束日期"
autocomplete="off"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">抽奖次数:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.lottery_num">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">其它事项:</label>
<div class="am-para-input" style="width: 80%">
<textarea rows="4" v-model="info.rule"></textarea>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">底部文字:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.bottom_word">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分享描述:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.share_desc">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分享图片:</label>
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.info.share_img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
:src="vue_obj.info.share_img.src"/>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">礼品说明:</label>
<div class="am-para-input" style="width: 80%">
<textarea rows="4" v-model="info.prizes_content"></textarea>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">礼品备注:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.prizes_note">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">中奖说明:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" v-model="info.prizes_winning_ins">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">礼品配置:</label>
<div class="am-para-input">
<div class="col-sm-10">
<table class="table table-hover table-middle" style="table-layout:fixed">
<colgroup>
<col width="80px"/>
<col width="30%">
<col width="15%">
<col width="30%"/>
<col width="">
</colgroup>
<thead>
<tr>
<th class="text-center">图片</th>
<th class="text-center">标题</th>
<th class="text-center">积分</th>
<th class="text-center">排序</th>
<th class="text-right">
<a href="javascript:" style="margin-top: 2px;"
class="btn btn-primary btn-sm"
@click='adModal()'>添加</a>
</th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in prizes_list">
<tr>
<td><img data-tips-image :src="item.img_src"></td>
<td class="text-center">{{item.title}}</td>
<td class="text-center">{{item.credit}}</td>
<td class="text-center">
<div :id="'group_name_txt_'+index">{{item.order_view}} <a
href="javascript:"
@click="showGroupEditForm(index)"><i
class="fa fa-edit"></i></a></div>
<input :id="'group_name_'+index" @blur="editGroupName(index,item.id)"
style="display: none;" type="number" class="form-control"
v-model="item.order_view" placeholder="请输入排序值">
</td>
<td class="text-right">
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-default btn-sm" @click='adModal(item)'>编辑</a>
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-danger btn-sm" @click='removeAd(index)'>删除</a>
</td>
</tr>
</template>
</tbody>
</table>
<template v-if="prizes_list.length <=0">
<div style="text-align: center;">无数据</div>
</template>
</div>
<div id="ad-modal" style="display: none;">
<div class="form-horizontal" style="padding-top: 20px;">
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">标题</label>
<div class="col-sm-8">
<input type="text" class="form-control" v-model="prizes_item.title"
placeholder="请输入标题">
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">图片</label>
<div class="col-sm-8">
<div class="input-group" style="width: 100%">
<input :value="vue_obj.prizes_img.value" type="text"
style="width: 60%;margin-right: 5px;"
class="form-control">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.prizes_img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<img data-tips-image
style="height:auto;max-height:32px;min-width:32px;margin-left: 5px;"
:src="vue_obj.prizes_img.src"/>
</div>
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">积分</label>
<div class="col-sm-8">
<input type="text" class="form-control" v-model="prizes_item.credit"
placeholder="请输入积分">
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">排序值</label>
<div class="col-sm-4">
<input type="number" class="form-control" v-model="prizes_item.order_view"
placeholder="请输入排序">
</div>
<div style="padding-top:7px;">
<small class="text-muted">越大越靠前</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label"></label>
<div class="am-para-input" style="width: 60%">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">保存活动信息</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#time_id', range: '~', type: 'datetime'
, done: function (value, date, endDate) {
if (endDate.hours == "0" && endDate.minutes == "0" && endDate.seconds == "0") {
// 改变结束时间默认值
$(".layui-laydate-footer [lay-type='datetime'].laydate-btns-time").click();
$(".laydate-main-list-1 .layui-laydate-content li ol li:last-child").click();
$(".layui-laydate-footer [lay-type='date'].laydate-btns-time").click();
}
}
});
});
var layer_open;
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
status_list: [],
prizes_list: [],
prizes_item: {},
prizes_img: {value: '', src: ''},
},
mounted() {
var that = this;
that.info = <?=json_encode($info)?>;
that.status_list = <?=json_encode($status_list)?>;
that.prizes_list = <?=json_encode($prizes_list)?>;
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
// 修改排序
showGroupEditForm: function (index) {
$("#group_name_" + index).show();
$("#group_name_txt_" + index).hide();
$('#group_name_' + index).focus();
},
// 排序
editGroupName: function (index, group_id) {
var order_view = $("#group_name_" + index).val();
if (order_view == '') {
layer.msg("排序值不能为空!", {icon: 2});
return false;
}
this.prizes_list.sort(function (a, b) {
return b.order_view - a.order_view;
});
$("#group_name_" + index).hide();
$("#group_name_txt_" + index).show();
},
adModal: function (item) {
var that = this;
var _title = '新增礼品';
that.prizes_item = {};
if (item) {
that.prizes_item = item;
_title = '编辑礼品';
that.prizes_img = {value: item.img_value, src: item.img_src};
} else {
that.prizes_item = {"order_view": 50};
that.prizes_img = {value: '', src: ''};
}
layer.open({
type: 1,
area: ['50%'], //宽高
content: $('#ad-modal'),
title: _title,
shade: false,
btn: ['确定', '取消'],
yes: function (index) {
if (!item) {
let timestamp = Date.parse(new Date());
let rand = parseInt(Math.random() * 1000);
let id = timestamp + rand;
that.prizes_list.push({
id: id,
title: that.prizes_item.title,
img_value: that.prizes_img.value,
img_src: that.prizes_img.src,
credit: that.prizes_item.credit,
order_view: that.prizes_item.order_view
});
}
that.prizes_list.sort(function (a, b) {
return b.order_view - a.order_view;
});
layer.close(index);
}
});
},
removeAd: function (index) {
var vm = this;
vm.prizes_list.splice(index, 1);
},
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.editType == 1) {
$("#status").attr("disabled", "disabled");
vm.info.editType = 0;
} else {
$("#status").removeAttr("disabled");
vm.info.editType = 1;
}
} else if (index == 2) {
if (vm.info.editType == 2) {
vm.info.editType = 0;
} else {
vm.info.editType = 2;
}
} else {
vm.info.editType = 0;
}
},
saveEdit: function () {
var vm = this;
vm.info.time = $('#time_id').val();
vm.info.prizes_list = vm.prizes_list;
$.ajax({
url: vm.info.edit_url,
type: 'post',
dataType: 'json',
data: {
info: vm.info,
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
if (data['data']['type'] == 'add') {
window.location.href = "#/app/liche/blindbox/get?id=" + data['data']['id'] + "?spm=<?= $_GET['spm'] ?>";
} else {
$.form.reload();
}
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
saveStatus: function () {
var vm = this;
$.ajax({
url: '/app/liche/blindbox/edit_status',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
},
}
});
});
</script>
<style type="text/css">
.my-ul ul li {
padding: 10px;
}
.my-panel {
padding: 10px;
border: 1px solid #ddd;
height: 90px;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/hd.css?v=1581252500">
+68
View File
@@ -0,0 +1,68 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/liche/blindbox">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">活动标题:</label>
<div class="am-para-inline w200">
<input type="text" name="title" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml100">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" data-open="/app/liche/blindbox/get"
class="am-btn am-btn-success am-btn-sm w100">新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="4%"><span>ID</span></th>
<th width="15%"><span>标题</span></th>
<th width="10%"><span>开始时间</span></th>
<th width="10%"><span>结束时间</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="8%"><span>状态</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['s_time'] ?></td>
<td><?= $v['e_time'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><?= $v['status_name'] ?></td>
</tr>
<tr>
<td colspan="6" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_link?id=<?= $v['id'] ?>&app_id=1&pages=lantushijia"
data-title="分享链接">分享链接</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/liche/blindbox/get?id=<?= $v['id'] ?>">编辑</a>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
@@ -0,0 +1,39 @@
<form class="am-form am-form-horizontal" action="/app/liche/member/add_credit" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">总积分:</label>
<div class="am-para-input">
<span class="f12 lh-default ml5 text-danger"><?=$user['credits']+$user['freeze_credits']?></span>
(<span class="f12 clr999 lh-default ml5 text-danger">可用积分:<?=$user['credits']?>,冻结:<?=$user['freeze_credits']?></span>)
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">积分:</label>
<div class="am-para-input">
<input type="number" placeholder="输入积分" name="credits" style="width: 150px; display: inline;">
<!-- <span class="f12 clr999 lh-default ml5">小于0扣除积分,大于0增加积分</span>-->
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">积分类型:</label>
<div class="am-para-input w140">
<select name="type">
<option value="1">可用</option>
<option value="2">冻结</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">备注:</label>
<div class="am-para-input">
<textarea name="remark"></textarea>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<input name="uid" value="<?=$uid?>" type="hidden">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="submit">保存</button>
</div>
</div>
</form>
@@ -0,0 +1,41 @@
<form class="am-form am-form-horizontal" action="/app/liche/member/add_items" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">总积分:</label>
<div class="am-para-input">
<span class="f12 lh-default ml5 text-danger"><?=$user['credits']+$user['freeze_credits']?></span>
(<span class="f12 clr999 lh-default ml5 text-danger">可用积分:<?=$user['credits']?>,冻结:<?=$user['freeze_credits']?></span>)
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">消耗积分:</label>
<div class="am-para-input">
<input type="number" placeholder="输入积分" name="credits" style="width: 150px; display: inline;">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">商品名称:</label>
<div class="am-para-input">
<input type="text" placeholder="输入商品名称" name="item_title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">兑换码:</label>
<div class="am-para-input">
<input type="text" placeholder="输入兑换码" name="item_code">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">备注:</label>
<div class="am-para-input">
<textarea name="remark"></textarea>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<input name="uid" value="<?=$uid?>" type="hidden">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="submit">保存</button>
</div>
</div>
</form>
+79
View File
@@ -0,0 +1,79 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/liche/member/get_credit_log">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">用户id</label>
<div class="am-para-inline w150">
<input type="text" name="uid" value="" v-model="params.uid"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">积分类型:</label>
<div class="am-para-inline w150">
<select name="type" v-model="params.type">
<option value="">全部</option>
<option v-for="(value,key) in type_arr" :value="key">{{value}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>ID</span></th>
<th width="15%"><span>用户</span></th>
<th width="10%"><span>收入积分</span></th>
<th width="10%"><span>支出积分</span></th>
<th width="10%"><span>剩余积分</span></th>
<th width="10%"><span>类型</span></th>
<th width=""><span>备注</span></th>
<th width="12%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['nickname'] ?></td>
<td><?= $v['credit_in'] ?></td>
<td><?= $v['credit_out'] ?></td>
<td><?= $v['credit_left'] ?></td>
<td><?= $v['type_cn'] ?></td>
<td><?= $v['remark'] ?></td>
<td><?= date('Y-m-d H:i',$v['c_time']) ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
lists: [],
params: <?=json_encode($params,JSON_UNESCAPED_UNICODE)?>,
type_arr : <?=json_encode($type_arr,JSON_UNESCAPED_UNICODE)?>,
},
mounted() {
var that = this;
that.lists = <?=json_encode($lists,JSON_UNESCAPED_UNICODE)?>;
},
created: function () {
},
methods: {}
})
</script>
@@ -0,0 +1,22 @@
<form class="am-form am-form-horizontal" action="/app/liche/member/get_freeze" data-auto="true" method="post" style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">总积分:</label>
<div class="am-para-input">
<span class="f12 lh-default ml5 text-danger"><?=$user['credits']+$user['freeze_credits']?></span>
(<span class="f12 clr999 lh-default ml5 text-danger">可用积分:<?=$user['credits']?>,冻结:<?=$user['freeze_credits']?></span>)
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">积分:</label>
<div class="am-para-input">
<input type="number" placeholder="输入积分" name="credits" style="width: 150px; display: inline;">
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<input name="uid" value="<?=$uid?>" type="hidden">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="submit">保存</button>
</div>
</div>
</form>
+27 -14
View File
@@ -24,13 +24,15 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>ID</span></th>
<th width="20%"><span>用户名称</span></th>
<th width="20%"><span>手机号码</span></th>
<th width="5%"><span>是否分销</span></th>
<th width="5%"><span>销管理</span></th>
<th width="20%"><span>创建时间</span></th>
<th>操作</th>
<th width="8%"><span>ID</span></th>
<th width="15%"><span>用户名称</span></th>
<th width="15%"><span>手机号码</span></th>
<th width="10%"><span>剩余积分</span></th>
<th width="10%"><span>冻结积</span></th>
<th width="8%"><span>是否分销</span></th>
<th width="8%"><span>分销管理</span></th>
<th width="10%"><span>积分过期时间</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
@@ -39,14 +41,31 @@
<td><?= $v['id'] ?></td>
<td><?= $v['nickname'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['credits'] ?></td>
<td><?= $v['freeze_credits'] ?></td>
<td>
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$v['dealer']&&!$v['up_uid']?'checked':''?> onchange="set_publish(this,<?=$v['id']?>)"/>
</td>
<td>
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$v['manage']?'checked':''?> onchange="set_publish(this,<?=$v['id']?>,'manage')"/>
</td>
<td><?= $v['expire_time'] ? date('Y-m-d H:i',$v['expire_time']) : '' ?></td>
<td><?= date('Y-m-d H:i:s',$v['c_time']) ?></td>
<td>
</tr>
<tr>
<td colspan="9" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs" data-modal="/app/liche/member/add_items?uid=<?=$v['id']?>" data-title="兑换商品">
兑换商品
</a>
<a class="am-btn am-btn-primary am-btn-xs" data-modal="/app/liche/member/add_credit?uid=<?=$v['id']?>" data-title="增加减少积分">
增加积分
</a>
<a class="am-btn am-btn-primary am-btn-xs" data-modal="/app/liche/member/get_freeze?uid=<?=$v['id']?>" data-title="解冻积分">
解冻积分
</a>
<a class="am-btn am-btn-primary am-btn-xs" data-open="/app/liche/member/get_credit_log?uid=<?=$v['id']?>">
积分日志
</a>
<?if($v['umajia']){?>
<a class="am-btn am-btn-primary am-btn-xs" data-open="/app/appusual/umajia/get?uid=<?=$v['id']?>&app_id=<?=$app_id?>" data-title="编辑马甲">编辑马甲</a>
<a href="javascript:void(0)" data-ajax="post" data-action="/app/appusual/umajia/del?app_id=<?=$app_id?>"
@@ -56,12 +75,6 @@
<?}?>
</td>
</tr>
<!--
<tr>
<td colspan="3" class="align-r">
</td>
</tr>
-->
<?php } ?>
</tbody>
</table>
+11 -2
View File
@@ -69,6 +69,14 @@
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="类型" v-model="search_info.type">
<option value="0">类型</option>
<template v-for="(v,i) in show_info.typeAry">
<option :value="i">{{v}}</option>
</template>
</select>
</div>
<div class="am-form-group fl ml10">
<a class="am-btn am-btn-success am-btn-sm w100" @click="search()">搜索</a>
</div>
@@ -144,8 +152,8 @@
selectedBrands: [],
cityAry: [],
countyAry: [],
show_info: {cityList: []},
search_info: {city_id: 0, county_id: 0}
show_info: {cityList: [], typeAry: []},
search_info: {city_id: 0, county_id: 0, type: 0}
},
computed: {},
created: function () {
@@ -246,6 +254,7 @@
dataType: 'json',
data: {
page: that.brandsThPage,
type: that.search_info.type,
city_id: that.search_info.city_id,
county_id: that.search_info.county_id
},
+13 -3
View File
@@ -14,7 +14,7 @@
<input type="text" name="mobile" value="<?= $mobile ?>"/>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group fl">
<label class="am-para-label w100">角色:</label>
<div class="am-para-inline w150">
<select name="group_id">
@@ -26,6 +26,16 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">状态:</label>
<div class="am-para-inline w150">
<select name="status">
<option value="">全部</option>
<option value="1" <?= 1 == $params['status'] ? 'selected' : '' ?>>正常</option>
<option value="0" <?= strlen($params['status']) && 0 == $params['status'] ? 'selected' : '' ?>>禁用</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group am-para-inline w150">
@@ -86,8 +96,8 @@
<select data-update-group="" data-list-target=".id-<?= $v['id'] ?>"
data-action="/app/licheb/member/batch" data-field=""
style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>下架</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>上架</option>
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>禁用</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>正常</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
<a data-open="/app/licheb/member/get?id=<?= $v['id'] ?>"
+64 -124
View File
@@ -55,15 +55,13 @@
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cover"><i class="am-icon-cloud-upload"></i> 上传封面
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.info.img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<input type="hidden" name="cover" id="cover_id"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $info['img'] ?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $info['img_url'] ?>"/>
:src="vue_obj.info.img.src"/>
</div>
</div>
</div>
@@ -89,7 +87,7 @@
<div class="am-form-group">
<label class="am-para-label">分享描述:</label>
<div class="am-para-input" style="width: 80%">
<input type="text" v-model="info.share_title">
<input type="text" v-model="info.share_desc">
</div>
</div>
<div class="am-form-group">
@@ -97,15 +95,12 @@
<div class="am-para-input">
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="share_img"><i class="am-icon-cloud-upload"></i> 上传封面
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.info.share_img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<span class="f12 clr999 lh-default ml5">建议尺寸宽度690</span>
<input type="hidden" name="share_img" id="share_img_id"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
value="<?= $info['share_img'] ?>" class="layui-input">
<img data-tips-image style="height:auto;max-height:32px;min-width:32px"
src="<?= $info['share_img_url'] ?>"/>
:src="vue_obj.info.share_img.src"/>
</div>
</div>
</div>
@@ -132,28 +127,29 @@
<th class="text-center">图片</th>
<th class="text-center">标题</th>
<th class="text-center">排序</th>
<th class="text-center">链接</th>
<th class="text-center">价格</th>
<th class="text-right">
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
<a href="javascript:" style="margin-top: 2px;"
class="btn btn-primary btn-sm"
@click='adModal()'>添加</a>
</th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in ad_list">
<template v-for="(item,index) in prizes_list">
<tr>
<td><img data-tips-image :src="item.img_url"></td>
<td><img data-tips-image :src="item.img_src"></td>
<td class="text-center">{{item.title}}</td>
<td class="text-center">
<div :id="'group_name_txt_'+index">{{item.order_view}} <a href="javascript:"
@click="showGroupEditForm(index)"><i
class="fa fa-edit"></i></a></div>
<div :id="'group_name_txt_'+index">{{item.order_view}} <a
href="javascript:"
@click="showGroupEditForm(index)"><i
class="fa fa-edit"></i></a></div>
<input :id="'group_name_'+index" @blur="editGroupName(index,item.id)"
style="display: none;" type="number" class="form-control"
v-model="item.order_view" placeholder="请输入排序值">
</td>
<td class="text-center" v-if="item.jump_type==1">报名弹窗</td>
<td class="text-center" v-else>{{item.link}}</td>
<td class="text-center">{{item.price}}</td>
<td class="text-right">
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-default btn-sm" @click='adModal(item)'>编辑</a>
@@ -164,7 +160,7 @@
</template>
</tbody>
</table>
<template v-if="ad_list.length <=0">
<template v-if="prizes_list.length <=0">
<div style="text-align: center;">无数据</div>
</template>
</div>
@@ -173,7 +169,7 @@
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">标题</label>
<div class="col-sm-8">
<input type="text" class="form-control" v-model="ad_item.title"
<input type="text" class="form-control" v-model="prizes_item.title"
placeholder="请输入标题">
</div>
</div>
@@ -181,23 +177,31 @@
<label class="col-sm-2 control-label">图片</label>
<div class="col-sm-8">
<div class="input-group" style="width: 100%">
<input type="text" style="width: 60%" name="ad_img" id="ad_img"
onchange="$(this).next('img').attr('src', $(this).data('srcs') || this.value)"
<input :value="vue_obj.prizes_img.value" type="text"
style="width: 60%;margin-right: 5px;"
class="form-control">
<img data-tips-image name="ad_img_url" id="ad_img_url"
style="height:auto;max-height:31px;min-width:31px;margin-left: 5px;margin-right: 5px;"
/>
<button type="button" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="ad_img">上传图片
data-file="1" data-mark="" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-params-source="vue_obj.prizes_img">
<i class="am-icon-cloud-upload"></i> 上传图片
</button>
<img data-tips-image
style="height:auto;max-height:32px;min-width:32px;margin-left: 5px;"
:src="vue_obj.prizes_img.src"/>
</div>
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">价格</label>
<div class="col-sm-8">
<input type="text" class="form-control" v-model="prizes_item.price"
placeholder="请输入价格">
</div>
</div>
<div class="form-group" style="margin-left: 0px;margin-right: 0px;">
<label class="col-sm-2 control-label">排序值</label>
<div class="col-sm-4">
<input type="number" class="form-control" v-model="ad_item.order_view"
<input type="number" class="form-control" v-model="prizes_item.order_view"
placeholder="请输入排序">
</div>
<div style="padding-top:7px;">
@@ -243,13 +247,15 @@
data: {
info: {},
status_list: [],
ad_list: [],
ad_item: {},
prizes_list: [],
prizes_item: {},
prizes_img: {value: '', src: ''},
},
mounted() {
var that = this;
that.info = <?=json_encode($info)?>;
that.status_list = <?=json_encode($status_list)?>;
that.prizes_list = <?=json_encode($prizes_list)?>;
},
computed: {},
created: function () {
@@ -270,7 +276,7 @@
layer.msg("排序值不能为空!", {icon: 2});
return false;
}
this.ad_list.sort(function (a, b) {
this.prizes_list.sort(function (a, b) {
return b.order_view - a.order_view;
});
$("#group_name_" + index).hide();
@@ -279,52 +285,46 @@
adModal: function (item) {
var that = this;
var _title = '新增广告';
that.ad_item = {};
var _img = '';
var _img_url = '';
that.prizes_item = {};
if (item) {
that.ad_item = item;
that.prizes_item = item;
_title = '编辑广告';
_img = item.img;
_img_url = item.img_url;
that.prizes_img = {value: item.img_value, src: item.img_src};
} else {
that.ad_item = {"order_view": 50, "jump_type": 0};
that.prizes_item = {"order_view": 50};
that.prizes_img = {value: '', src: ''};
}
$('#ad_img').val(_img);
$("#ad_img_url").attr('src', _img_url);
layer.open({
type: 1,
area: ['50%', '38%'], //宽高
area: ['50%'], //宽高
content: $('#ad-modal'),
title: _title,
shade: false,
btn: ['确定', '取消'],
yes: function (index) {
_img = $('#ad_img').val();
_img_url = $("#ad_img_url")[0].src;
if (!item) {
that.ad_list.push({
title: that.ad_item.title,
img: _img,
img_url: _img_url,
link: that.ad_item.link,
order_view: that.ad_item.order_view,
jump_type: that.ad_item.jump_type
let timestamp = Date.parse(new Date());
let rand = parseInt(Math.random() * 1000);
let id = timestamp + rand;
that.prizes_list.push({
id: id,
title: that.prizes_item.title,
img_value: that.prizes_img.value,
img_src: that.prizes_img.src,
price: that.prizes_item.price,
order_view: that.prizes_item.order_view
});
} else {
item.img = _img;
item.img_url = _img_url;
}
that.ad_list.sort(function (a, b) {
that.prizes_list.sort(function (a, b) {
return b.order_view - a.order_view;
})
});
layer.close(index);
}
});
},
removeAd: function (index) {
var vm = this;
vm.ad_list.splice(index, 1);
vm.prizes_list.splice(index, 1);
},
editType: function (index) {
var vm = this;
@@ -348,15 +348,14 @@
},
saveEdit: function () {
var vm = this;
vm.info.img = $('#cover_id').val();
vm.info.time = $('#time_id').val();
vm.info.share_img = $('#share_img_id').val();
vm.info.prizes_list = vm.prizes_list;
$.ajax({
url: vm.info.edit_url,
type: 'post',
dataType: 'json',
data: {
info: vm.info
info: vm.info,
},
beforeSend: function () {
layer.load(1, {
@@ -387,7 +386,7 @@
saveStatus: function () {
var vm = this;
$.ajax({
url: '/app/licheb/sytactivity/edit_status',
url: '/app/licheb/sytlive/edit_status',
type: 'post',
dataType: 'json',
data: {
@@ -420,11 +419,6 @@
});
</script>
<style type="text/css">
.label-width {
width: 150px
}
.my-ul ul li {
padding: 10px;
}
@@ -435,64 +429,10 @@
height: 90px;
}
.auto-content {
width: min-content;
min-width: 50%;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
.photo-upload {
position: relative;
font-size: 0;
}
.photo-upload:after {
content: "";
display: table;
clear: both;
}
.photo-upload-item {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
font-size: 12px; /*display:inline-block;width:120px;*/
}
.photo-upload-item > img {
}
.photo-upload-item-check,
.photo-upload-item-remove {
opacity: 0;
position: absolute;
top: -8px;
right: -8px;
width: 24px;
height: 24px;
line-height: 24px;
border: 1px solid #fff;
background-color: #eee;
border-radius: 50%;
text-align: center;
cursor: pointer;
}
.photo-upload-item:hover .photo-upload-item-remove {
opacity: 1;
transition: all .4s ease
}
.photo-upload-item-check {
opacity: 1;
background-color: #36f;
color: #fff;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css?v=1581252500">
+6 -6
View File
@@ -48,12 +48,12 @@
</tr>
<tr>
<td colspan="7" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/receiver/customer?cfrom_id=35&t_id=<?= $v['id'] ?>">报名</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/lists?a_id=<?= $v['id'] ?>">门店</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-open="/app/licheb/sytbiz/get_achievement?a_id=<?= $v['id'] ?>">业绩报告</a>
<!-- <a class="am-btn am-btn-primary am-btn-xs"-->
<!-- data-open="/receiver/customer?cfrom_id=35&t_id=--><?//= $v['id'] ?><!--">报名</a>-->
<!-- <a class="am-btn am-btn-primary am-btn-xs"-->
<!-- data-open="/app/licheb/sytbiz/lists?a_id=--><?//= $v['id'] ?><!--">门店</a>-->
<!-- <a class="am-btn am-btn-primary am-btn-xs"-->
<!-- data-open="/app/licheb/sytbiz/get_achievement?a_id=--><?//= $v['id'] ?><!--">业绩报告</a>-->
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_qrcode?url=<?= $v['url'] ?>"
data-title="分享二维码">分享二维码</a>
+26 -25
View File
@@ -2,7 +2,12 @@
<tr>
<? foreach ($menus as $key => $value) { ?>
<td class="my-panel text-center">
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
<strong><?= $value['title'] ?></strong><br>
<? if ($value['note']) { ?>
<?= $value['note'] ?>
<? } else { ?>
<?= $value['value'] ?><?= $value['tag'] ?>
<? } ?>
</td>
<? } ?>
</tr>
@@ -11,16 +16,10 @@
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="app/licheb/userslog">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">顾问名字:</label>
<div class="am-para-inline w200">
<input type="text" name="uname" placeholder="顾问名字关键字" v-model="params.uname"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">门店:</label>
<div class="am-para-inline w120">
<select title="类型" name="type" v-model="params.type">
<select title="类型" name="type" v-model="params.type" @change="set_type">
<option value="">选择类型</option>
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
</select>
@@ -54,7 +53,7 @@
<div class="am-form-group fl">
<label class="am-para-label w80">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w250">
<div class="am-para-inline w200">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="开始时间 ~ 结束时间" autocomplete="off"/>
</div>
@@ -87,17 +86,16 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="17%"><span>门店</span></th>
<th width="10%"><span>顾问</span></th>
<th width="20%"><span>客户</span></th>
<th width="13%"><span>进店人数/进店次</span></th>
<th width="20%"><span>门店</span></th>
<th width="12%"><span>客户数</span></th>
<th width="12%"><span>进店人</span></th>
<th width="12%"><span>订单</span></th>
<th width="9%"><span>试驾数</span></th>
<th width="9%"><span>跟进数</span></th>
<th width="9%"><span>订单数</span></th>
<th width="9%"><span>战败数</span></th>
<th width="9%"><span>开票数</span></th>
<th width="9%"><span>新增企微</span></th>
<th width="9%"><span>删除企微</span></th>
<th width="9%"><span>企微</span></th>
<th width="9%"><span>改派数</span></th>
<th width="9%"><span>接收数</span></th>
<th width="10%"><span>日期</span></th>
</tr>
</thead>
@@ -106,16 +104,15 @@
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['uname'] ?></td>
<td><?= $v['customers'] ?></td>
<td><?= $v['c_num'] ?>/<?= $v['a_num'] ?></td>
<td><?= $v['t_num'] ?></td>
<td><?= $v['follows'] ?></td>
<td><?= $v['c_num'] ?></td>
<td><?= $v['orders'] ?></td>
<td><?= $v['t_num'] ?></td>
<td><?= $v['defeats'] ?></td>
<td><?= $v['bills'] ?></td>
<td><?= $v['qy_adds'] ?></td>
<td><?= $v['qy_dels'] ?></td>
<td><?= $v['reassigns'] ?></td>
<td><?= $v['receives'] ?></td>
<td><?= $v['log_date'] ?></td>
</tr>
<? }
@@ -196,15 +193,18 @@
}
});
},
set_type: function () {
var that = this;
that.params.city_id = '';
},
set_county: function () {
var that = this;
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
that.params.biz_id = '';
},
reset: function () {
var that = this;
that.params.city_id = '';
that.params.uname = '';
that.params.type = '';
$('#id-time').val('');
}
@@ -240,7 +240,7 @@
var that = this;
if (nv == '') {
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
that.params.biz_id = '';
} else {
$.ajax({
type: 'post',
@@ -249,6 +249,7 @@
data: {
city_id: that.params.city_id,
county_id: that.params.county_id,
type: that.params.type,
status: 1
},
success: function (response) {
@@ -0,0 +1,183 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($tabAry as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['tab']) && $params['tab'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/app/licheb/userslog/lists_users?tab=<?= $key ?>&biz_id=<?= $params['biz_id'] ?>&time=<?= $params['time'] ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<table width="100%">
<tr>
<? foreach ($menus as $key => $value) { ?>
<td class="my-panel text-center">
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
</td>
<? } ?>
</tr>
</table>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="app/licheb/userslog/lists_users">
<input type="hidden" name="tab" v-model="params.tab"/>
<input type="hidden" name="biz_id" v-model="params.biz_id"/>
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">顾问名字:</label>
<div class="am-para-inline w200">
<input type="text" name="uname" placeholder="顾问名字关键字" v-model="params.uname"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="开始时间 ~ 结束时间" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fl"></div>
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>顾问</span></th>
<th width="9%"><span>客户数</span></th>
<th width="9%"><span>进店人数</span></th>
<th width="9%"><span>订单数</span></th>
<th width="9%"><span>试驾数</span></th>
<th width="9%"><span>战败数</span></th>
<th width="9%"><span>开票数</span></th>
<th width="9%"><span>新增企微</span></th>
<th width="9%"><span>删除企微</span></th>
<th width="10%"><span>日期</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['uname'] ?></td>
<td><?= $v['customers'] ?></td>
<td><?= $v['c_num'] ?></td>
<td><?= $v['orders'] ?></td>
<td><?= $v['t_num'] ?></td>
<td><?= $v['defeats'] ?></td>
<td><?= $v['bills'] ?></td>
<td><?= $v['qy_adds'] ?></td>
<td><?= $v['qy_dels'] ?></td>
<td><?= $v['log_date'] ?></td>
</tr>
<? }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-time';
var beginDate = '';
var endDate = '';
switch (type) {
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
},
methods: {
reset: function () {
var that = this;
that.params.uname = '';
$('#id-time').val('');
}
},
watch: {}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/app/licheb/userslog/export?' + arr[1];
window.location.href = href;
});
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.my-panel span {
font-size: 20px;
}
</style>
@@ -0,0 +1,175 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($tabAry as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['tab']) && $params['tab'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/app/licheb/userslog/lists_users?tab=<?= $key ?>&biz_id=<?= $params['biz_id'] ?>&time=<?= $params['time'] ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<table width="100%">
<tr>
<? foreach ($menus as $key => $value) { ?>
<td class="my-panel text-center">
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
</td>
<? } ?>
</tr>
</table>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="app/licheb/userslog">
<input type="hidden" name="tab" v-model="params.tab"/>
<input type="hidden" name="biz_id" v-model="params.biz_id"/>
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">顾问名字:</label>
<div class="am-para-inline w200">
<input type="text" name="uname" placeholder="顾问名字关键字" v-model="params.uname"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="开始时间 ~ 结束时间" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fl"></div>
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>顾问</span></th>
<th width="10%"><span>计划跟进数</span></th>
<th width="10%"><span>已跟进数</span></th>
<th width="10%"><span>今日新增未跟进数</span></th>
<th width="10%"><span>逾期未跟进数</span></th>
<th width="10%"><span>日期</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['uname'] ?></td>
<td><?= $v['follows'] ?></td>
<td><?= $v['h_follows'] ?></td>
<td><?= $v['t_follows'] ?></td>
<td><?= $v['w_follows'] ?></td>
<td><?= $v['t_day'] ?></td>
</tr>
<? }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-time';
var beginDate = '';
var endDate = '';
switch (type) {
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
},
methods: {
reset: function () {
var that = this;
that.params.uname = '';
$('#id-time').val('');
}
},
watch: {}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/app/licheb/userslog/export?' + arr[1];
window.location.href = href;
});
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.my-panel span {
font-size: 20px;
}
</style>
+29 -5
View File
@@ -48,17 +48,21 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="3%"><span>id</span></th>
<th width="15%"><span>模板名称</span></th>
<th width="10%"><span>模板分类</span></th>
<th width="25%"><span>适用品牌</span></th>
<th width="50"></th>
<th width="50"><span>id</span></th>
<th width="17%"><span>模板名称</span></th>
<th width="13%"><span>模板分类</span></th>
<th width=""><span>适用品牌</span></th>
<th width="7%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="12%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td rowspan="2">
<input type="checkbox" name="ids[]" class="biz-ids" value="<?= $v['id'] ?>"/>
</td>
<td><?= $v['id'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['type_name'] ?></td>
@@ -79,6 +83,13 @@
data-title="分享连接">分享链接</a>
<a data-open="/app/material/template/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
<input type="hidden" class="biz-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".biz-id-<?= $v['id'] ?>"
data-action="/app/material/template/batch" data-field="" style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>下架</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>上架</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
</div>
</td>
</tr>
@@ -87,6 +98,19 @@
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
<label class="checkall">
<input type="checkbox" data-check-target=".biz-ids"> 全选</label>
<div class="am-para-inline w120">
<select data-update-group="" data-list-target=".biz-ids" data-action="/app/material/template/batch"
data-field="ifcheck">
<option value="">批量操作</option>
<option value="0">下架</option>
<option value="1">上架</option>
<option value="-1">删除</option>
</select>
</div>
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
+27 -16
View File
@@ -4,7 +4,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">标题:</label>
<div class="am-para-inline w200">
<input type="text" name="title" value="<?=$params['title'] ?>"/>
<input type="text" name="title" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
@@ -29,7 +29,9 @@
<button type="submit" class="am-btn am-btn-success w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" data-title="新增车系" data-open="/auto/attr/get" class="am-btn am-btn-success w100">新增</button>
<button type="button" data-title="新增车系" data-open="/auto/attr/get" class="am-btn am-btn-success w100">
新增
</button>
</div>
<div class="am-form-group fr" style="font-size: 15px;padding-right: 20px;padding-top: 6px;">
共有<?= $pager['totle'] ?>条数据
@@ -60,7 +62,15 @@
<td><?= $v['c_time'] ?></td>
<td>
<a href="javascript:void (0);" data-title="编辑车系" data-open="/auto/attr/get?id=<?= $v['id'] ?>"
class="am-text-primary"><?= '编辑' ?></a>
class="am-text-primary"><?= '编辑' ?></a> |
<?php if ($v['status'] == 1) { ?>
<a href="javascript:void (0);" data-ajax="post" data-action="/auto/attr/del"
data-params-id="<?= $v['id'] ?>" data-params-status="0">禁用</a>
<?php } else { ?>
<a style="color: red" href="javascript:void (0);" data-ajax="post"
data-action="/auto/attr/del"
data-params-id="<?= $v['id'] ?>" data-params-status="1">恢复</a>
<?php } ?>
</td>
</tr>
<?php } ?>
@@ -76,41 +86,42 @@
<script>
var vue_obj;
var loading = 0;
$(function(){
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params:[],
brandAry:[],
seryAry:[]
params: [],
brandAry: [],
seryAry: []
},
mounted:function() {
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.brandAry = <?=json_encode($brandAry)?>;
},
methods:{},
watch:{
'params.brand_id':function(nv, ov){
methods: {},
watch: {
'params.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
if(nv > 0){
if (nv > 0) {
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id:nv},
beforeSend: function () {},
data: {brand_id: nv},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
for (var i in lists){
for (var i in lists) {
var row = lists[i];
seryAry[row.id] = row.name;
}
vm.seryAry = seryAry;
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
vm.params.s_id = '';
}
}
+14 -7
View File
@@ -10,7 +10,7 @@
</a>
</li>
</ul>
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
<form id="vue-edit-business" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
<div class="tab-pane fade in active" id="swzc">
<div class="am-form-group wp50">
<label class="am-para-label">车型:</label>
@@ -103,28 +103,35 @@
</div>
<div class="tab-pane fade" id="jszc">
<div class="am-form-group wp50">
<label class="am-para-label">单车毛利:</label>
<label class="am-para-label w140">代理店单车毛利:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入单车毛利" name="profix_car" v-model="info.profix_car" style="display: inline;width: 60%"/>
<input type="text" placeholder="请输入代理店单车毛利" name="proxy_profix_car" v-model="info.proxy_profix_car" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">上牌毛利:</label>
<label class="am-para-label w140">品牌店单车毛利:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入品牌店单车毛利" name="profix_car" v-model="info.profix_car" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label w140">上牌毛利:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入上牌毛利" name="profix_carno" v-model="info.profix_carno" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">保险毛利:</label>
<label class="am-para-label w140">保险毛利:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入保险毛利" name="profix_insure" v-model="info.profix_insure" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">贷款毛利:</label>
<label class="am-para-label w140">贷款毛利:</label>
<div class="am-para-input">
<input type="text" placeholder="请输入贷款毛利" name="profix_loan" v-model="info.profix_loan" style="display: inline;width: 60%"/>
<span></span>
@@ -146,7 +153,7 @@
var vue_obj;
$(function(){
vue_obj = new Vue({
el: '#vue-edit',
el: '#vue-edit-business',
data: {
info:{'brand_id':'','s_id':'','v_id':''},
statusAry:[],
+3 -1
View File
@@ -96,6 +96,7 @@
<th width="10%"><span>颜色加价</span></th>
-->
<th width="7%"><span>城市</span></th>
<th width="7%"><span>交车时长</span></th>
<th width="7%"><span>时间</span></th>
<th width="10%"><span>生效时间</span></th>
<th width="7%"><span>是否生效</span></th>
@@ -105,7 +106,7 @@
<tbody>
<template v-for="(v,i) in lists">
<tr class="tl">
<td colspan="12">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
<td colspan="13">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
</tr>
<tr >
<td>
@@ -123,6 +124,7 @@
<td>{{v.price_color}}</td>
-->
<td>{{v.city_cn}}</td>
<td>{{v.delivery_day}}</td>
<td>{{v.month}}</td>
<td>{{v.s_effect_time}}</td>
<td>{{v.effect_status}}</td>
+81
View File
@@ -0,0 +1,81 @@
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
<div class="tab-pane fade in active">
<div class="am-form-group wp50">
<label class="am-para-label">名称:</label>
<div class="am-para-input">
<input type="text" placeholder="名称" v-model="info.title">
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">成本价:</label>
<div class="am-para-input">
<input type="number" placeholder="成本价" v-model="info.price"/>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="saveEdit">提交</button></div>
</div>
</form>
<script>
var loading = 0;
var vue_obj;
$(function(){
vue_obj = new Vue({
el: '#vue-edit',
data: {
info : [],
action:''
},
mounted:function(){
var vm = this;
vm.info = <?=json_encode($info)?>;
vm.action = '<?=$info['action']?>';
},
methods:{
saveEdit:function(){
var vm = this;
if(1 == loading){
return 0;
}
loading = 1;
$.ajax({
url: vm.action,
type: 'post',
dataType: 'json',
data: {info:vm.info},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = 0;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
layer.closeAll();
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
}
},
watch:{
}
});
});
</script>
+93
View File
@@ -0,0 +1,93 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/biz/fine/lists">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">名称:</label>
<div class="am-para-inline">
<input type="text" name="title" v-model="params.title"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">状态:</label>
<div class="am-para-inline w100">
<select name="status" v-model="params.status">
<option value="">请选择</option>
<option value="1">正常</option>
<option value="0">禁用</option>
</select>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml20">
<button data-title="新增" type="button" data-modal="/biz/fine/get" class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="8%"><span>ID</span></th>
<th width="20%"><span>名称</span></th>
<th width="20%"><span>成本价</span></th>
<th width="8%"><span>状态</span></th>
<th width="15%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['price'] ?></td>
<td><?= $v['status_cn'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<tr>
<td colspan="5" class="align-r">
<a data-title="修改-<?=$v['title']?>" data-modal="/biz/fine/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
<input type="hidden" class="fine-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".fine-id-<?= $v['id'] ?>"
data-action="/biz/fine/batch" data-field="" style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>禁用</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>正常</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
typeAry:<?=$typeAry ? json_encode($typeAry) : '[]'?>
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
},
methods: {
},
watch: {
}
});
$(function () {
<?php page_script($pager) ?>
});
</script>
+168
View File
@@ -0,0 +1,168 @@
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/biz/seprice/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
<div class="tab-pane fade in active">
<div class="am-form-group wp50 fl">
<label class="am-para-label">房租:</label>
<div class="am-para-input">
<input type="number" placeholder="房租" v-model="info.money_json.rent">
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">水电物业:</label>
<div class="am-para-input">
<input type="number" placeholder="水电物业" v-model="info.money_json.wat_ele"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">垂直媒体:</label>
<div class="am-para-input">
<input type="number" placeholder="垂直媒体" v-model="info.money_json.media"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">试驾车租金:</label>
<div class="am-para-input">
<input type="number" placeholder="试驾车租金" v-model="info.money_json.drive"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">市场营销费:</label>
<div class="am-para-input">
<input type="number" placeholder="市场营销费" v-model="info.money_json.marketing"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">门头营销:</label>
<div class="am-para-input">
<input type="number" placeholder="门头营销" v-model="info.money_json.door_step"/>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">店长底薪:</label>
<div class="am-para-input">
<select v-model="info.money_json.base_manager">
<option value="8000.00">8000</option>
<option value="10000.00">10000</option>
<option value="12000.00">12000</option>
</select>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">销售人数:</label>
<div class="am-para-input">
<input type="number" placeholder="销售人数" v-model="info.money_json.num"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">销售底薪:</label>
<div class="am-para-input">
<input type="number" placeholder="销售底薪" v-model="info.money_json.employee_wage"/>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">销售提成:</label>
<div class="am-para-input">
<input type="number" placeholder="销售提成" v-model="info.money_json.commission"/>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">日期:</label>
<div class="am-para-input">
<select name="year" style="display: inline; width: 100px;" v-model="info.year">
<option value=""></option>
<option :value="v" v-for="(v,i) in yearAry">{{v}}</option>
</select>
<select name="month" style="display: inline; width: 100px;" v-model="info.month">
<option value="">月份</option>
<option :value="v" v-for="(v,i) in monthAry">{{v}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="saveEdit">保存</button></div>
</div>
</form>
<script>
var loading = 0;
var vue_obj;
$(function(){
vue_obj = new Vue({
el: '#vue-edit',
data: {
info : [],
action:'',
yearAry:[],
monthAry:[],
employee_price_arr:[],
employee_price_list:[]
},
mounted:function(){
var vm = this;
vm.info = <?=json_encode($info)?>;
vm.action = '<?=$info['action']?>';
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
vm.employee_price_arr = <?=json_encode($employee_price_arr)?>;
},
methods:{
del_employee_price:function (index){
this.employee_price_list.splice(index, 1);
this.up_employee_price()
},
add_employee_price:function (){
this.employee_price_list.push('3000.00');
this.up_employee_price()
},
up_employee_price:function (){
var price = 0
this.employee_price_list.forEach((elem, index) => {
price = price+Number.parseInt(elem)
});
this.info.money_json.base_employees = price
},
saveEdit:function(){
var vm = this;
if(1 == loading){
return 0;
}
loading = 1;
$.ajax({
url: vm.action,
type: 'post',
dataType: 'json',
data: {info:vm.info,employee_price_list:vm.employee_price_list},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = 0;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
layer.closeAll();
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
}
},
watch:{
}
});
});
</script>
+111
View File
@@ -0,0 +1,111 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/biz/seprice/lists">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">状态:</label>
<div class="am-para-inline w100">
<select name="status" v-model="params.status">
<option value="">请选择</option>
<option value="1">正常</option>
<option value="0">禁用</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label">年月:</label>
<div class="am-para-inline">
<div class="am-para-inline w70">
<select name="year" v-model="params.year">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in yearAry">{{v}}</option>
</select>
</div>
<div class="am-para-inline w60">
<select name="month" v-model="params.month">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in monthAry">{{v}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml20">
<input type="hidden" name="biz_id" v-model="params.biz_id">
<button data-title="新增" type="button" :data-modal="'/biz/seprice/get?biz_id='+params.biz_id" class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="8%"><span>ID</span></th>
<th width="20%"><span>费用明细</span></th>
<th width="10%"><span>有效月份</span></th>
<th width="8%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="15%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<tr v-for="item in lists">
<td>{{item.id}}</td>
<td>
<template v-for="(val,key) in item.money_json">{{key}}:{{val}}<br></template>
</td>
<td>{{item.show_time}}</td>
<td>{{item.status_cn}}</td>
<td>{{item.c_time}}</td>
<td>
<a href="javascript:void(0);" :data-modal="'/biz/seprice/get?id='+item.id" class="am-btn am-btn-primary am-btn-xs">编辑</a>
<template v-if="item.status==1">
<a :data-update="item.id" data-action="/biz/seprice/edit_status" :data-value="item.status" class="am-btn am-btn-danger am-btn-xs">禁用</a>
</template>
<template v-else>
<a :data-update="item.id" data-action="/biz/seprice/edit_status" :data-value="item.status" class="am-btn am-btn-success am-btn-xs">启用</a>
</template>
</td>
</tr>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
lists:[],
yearAry:[],
monthAry:[],
},
mounted: function () {
var vm = this
vm.params = <?=json_encode($params,JSON_UNESCAPED_UNICODE)?>;
vm.lists = <?=json_encode($lists,JSON_UNESCAPED_UNICODE)?>;
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
},
methods: {
},
watch: {
'params.type': function (nv, ov) {
}
}
});
$(function () {
<?php page_script($pager) ?>
});
</script>
+9
View File
@@ -43,6 +43,11 @@
<div class="am-form-group fl ml20">
<input type="hidden" value="<?=$params['biz_id']?>" name="biz_id">
<button type="submit" class="am-btn am-btn-sm am-btn-success w100">搜索</button>
<a href="javascript:;" class="am-btn am-btn-sm am-btn-success w100" data-ajax="post"
:data-action="'/biz/settle/edit_brand?biz_id='+params.biz_id" :data-params-year="params.year" :data-params-month="params.month"
:data-params-biz_id="params.biz_id" >
更新结算
</a>
</div>
</div>
</form>
@@ -60,6 +65,8 @@
<th width="10%"><span>保险利润</span></th>
<th width="6%"><span>贷款利润</span></th>
<th width="6%"><span>挂牌利润</span></th>
<th width="6%"><span>精品利润</span></th>
<th width="6%"><span>水平业务合计</span></th>
<th width="6%"><span>拖车费</span></th>
<th width="6%"><span>时间</span></th>
</tr>
@@ -81,6 +88,8 @@
<td>{{v.profix_insure}}</td>
<td>{{v.profix_loan}}</td>
<td>{{v.profix_carno}}</td>
<td>{{v.profix_fine}}</td>
<td>{{v.sum_srv}}</td>
<td>{{v.price_trucking}}</td>
<td>{{v.month}}</td>
</tr>
+286
View File
@@ -0,0 +1,286 @@
<div class="coms-table-wrap">
<div class="coms-table-hd clearfix no-border">
<form action="/biz/settle" class="form-search" onsubmit="return false">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label">车辆属性:</label>
<div class="am-para-inline w150">
<select name="brand_id" v-model="params.brand_id">
<option value="">选择品牌</option>
<option :value="i" v-for="(v,i) in brandAry">{{v}}</option>
</select>
</div>
<div class="am-para-inline w150">
<select name="s_id" v-model="params.s_id">
<option value="">选择车系</option>
<option :value="i" v-for="(v,i) in seryAry">{{v}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="v_id" v-model="params.v_id">
<option value="">选择车型</option>
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label">年月:</label>
<div class="am-para-inline">
<div class="am-para-inline w70">
<select name="year" v-model="params.year">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in yearAry">{{v}}</option>
</select>
</div>
<div class="am-para-inline w60">
<select name="month" v-model="params.month">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in monthAry">{{v}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<input type="hidden" value="<?=$params['biz_id']?>" name="biz_id">
<input type="hidden" value="<?=$params['_biz_type']?>" name="_biz_type">
<button type="submit" class="am-btn am-btn-sm am-btn-success w100">搜索</button>
<a href="javascript:;" class="am-btn am-btn-sm am-btn-success w100" data-ajax="post"
:data-action="'/biz/settle/edit_js?biz_id='+params.biz_id" :data-params-year="params.year" :data-params-month="params.month"
:data-params-biz_id="params.biz_id" >
更新结算
</a>
</div>
</div>
</form>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%">
<span>ID</span>
</th>
<th width="10%"><span>门店</span></th>
<th width="20%"><span>订单信息</span></th>
<th width="10%"><span>单车毛利</span></th>
<th width="10%"><span>单车毛利税后</span></th>
<th width="10%"><span>保险利润</span></th>
<th width="10%"><span>贷款利润</span></th>
<th width="10%"><span>挂牌利润</span></th>
<th width="10%"><span>精品利润</span></th>
<th width="10%"><span>水平业务总毛利</span></th>
<th width="10%"><span>水平业务税后毛利</span></th>
<th width="6%"><span>时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr >
<td>
<span>{{v.id}}</span>
</td>
<td>{{v.biz_name}}</td>
<td>
<a href="javascript:;" :data-open="'/receiver/orderv2/orders/get?id='+v.o_id">
{{v.name}} {{v.mobile}}<br>
{{v.title}} {{v.vin}}
</a>
</td>
<td>
{{v.profix_car}}<br>
优惠金额:{{v.o_money_json.price_discount}}
</td>
<td>{{v.profix_car_after}}</td>
<td>
{{v.profix_insure}}<br>
强险佣金:
<span v-if="v.money_json.profix_insuer_ins">{{v.money_json.profix_insuer_ins}}</span>
<span v-else>0</span><br>
商业险佣金:
<span v-if="v.money_json.profix_insuer_bis">{{v.money_json.profix_insuer_bis}}</span>
<span v-else>0</span><br>
</td>
<td>
{{v.profix_loan}}<br>
<template v-if="v.profix_loan>0">
手续费:
<span v-if="v.srv_json">{{v.srv_json}}</span>
<span v-else>0</span><br>
利润:{{v.profix_loan-v.srv_json}}
</template>
</td>
<td>
{{v.profix_carno}}<br>
<template v-if="v.profix_carno">
挂牌:{{v.o_money_json.fee_carno}}<br>
手续费:{{v.o_money_json.fee_carno-v.profix_carno}}
</template>
</td>
<td>{{v.profix_fine}}</td>
<td>{{v.sum_srv}}</td>
<td>{{v.sum_srv_after}}</td>
<td>{{v.month}}</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
laydate.render({
elem: '#id-time',
format:'yyyy-MM'
});
});
var vue_obj;
var loading = 0;
$(function(){
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params:[],
lists:[],
brandAry:[],
seryAry:[],
attrvAry:[],
yearAry :[],
monthAry :[],
info_edit:{}
},
mounted:function() {
var vm = this;
var lists = [];
lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.brandAry = <?=json_encode($brandAry)?>;
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
vm.lists = lists;
},
methods:{
set_edit:function(index, type){
var vm = this;
var row = vm.lists[index];
if(1 == type){
if(undefined != vm.info_edit.index){
//旧的编辑取消
vm.lists[vm.info_edit.index].edit = 0;
}
row.edit = 1;
vm.info_edit = JSON.parse(JSON.stringify(row));
vm.info_edit.index = index;
} else {
row.edit = 0;
vm.info_edit = {};
}
},
save_edit:function(){
var vm = this;
if(1 == loading){
return 0;
}
loading = 1;
$.ajax({
url: 'auto/cars/edit',
type: 'post',
dataType: 'json',
data: {info:vm.info_edit},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = 0;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
}
},
watch:{
'params.brand_id':function(nv, ov){
var vm = this;
vm.seryAry = {};
if(nv > 0){
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id:nv},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
for (var i in lists){
var row = lists[i];
seryAry[row.id] = row.name;
}
vm.seryAry = seryAry;
if(vm.params.s_id>0 && undefined == seryAry[vm.params.s_id]){
vm.params.s_id = '';
}
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
} else {
vm.params.s_id = '';
}
},
'params.s_id':function(nv, ov){
var vm = this;
if (nv > 0) {
//型号
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: nv,
status: 1,
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.attrvAry = response.data.list;
}
}
});
} else {
vm.attrvAry = [];
vm.params.v_id = '';
}
}
}
});
<?php page_script($pager) ?>
});
</script>
@@ -0,0 +1,141 @@
<div class="coms-table-wrap">
<div class="coms-table-hd clearfix no-border">
<form action="/biz/settle/lists_static" class="form-search" onsubmit="return false">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label">年月:</label>
<div class="am-para-inline">
<div class="am-para-inline w70">
<select name="year" v-model="params.year">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in yearAry">{{v}}</option>
</select>
</div>
<div class="am-para-inline w60">
<select name="month" v-model="params.month">
<option value="">全部</option>
<option :value="v" v-for="(v,i) in monthAry">{{v}}</option>
</select>
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<input type="hidden" value="<?=$params['id']?>" name="id">
<input type="hidden" value="<?=$params['_biz_type']?>" name="_biz_type">
<button type="submit" class="am-btn am-btn-sm am-btn-success w100">搜索</button>
</div>
<div class="am-form-group fl ml20">
<button type="button" id="export" class="am-btn am-btn-sm am-btn-success w100">导出</button>
</div>
</div>
</form> </div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%">
<span>ID</span>
</th>
<th width="8%"><span>门店</span></th>
<th width="6%"><span>单车总毛利</span></th>
<th width="6%"><span>税后单车总毛利</span></th>
<th width="6%"><span>水平业务总毛利</span></th>
<th width="6%"><span>税后水平业务总毛利</span></th>
<th width="6%"><span>门店费用</span></th>
<th width="6%"><span>其它费用</span></th>
<th width="6%"><span>总利润</span></th>
<th width="6%"><span>分润</span></th>
<th width="6%"><span>时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td>
<span>{{v.id}}</span>
</td>
<td>{{v.biz_name}}</td>
<td>{{v.profix_car}}</td>
<td>{{v.profix_car_after}}</td>
<td>{{v.price_all}}</td>
<td>{{v.price_all_after}}</td>
<td>
<template v-if="v.money_json && v.money_json.biz_price">
<template v-for="(v2,i2) in v.money_json.biz_price_list">
{{i2}}:{{v2}}<br>
</template>
总费用:{{v.money_json.biz_price}}
</template>
</td>
<td>
<template v-for="item in v.price_other">
{{item.name}}:{{item.money}}({{type_arr[item.type]}})<br>
</template>
</td>
<td>{{v.price_ml}}</td>
<td>
狸车分润:{{v.profix_liche}}<br>
合伙人分润:{{v.profix_partner}}
</td>
<td>{{v.month_str}}</td>
</tr>
<tr>
<td colspan="11" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs" :data-open="'/biz/settle?_biz_type=1&biz_id='+v.biz_id+'&month='+v.month" href="javascript:;">查看明细</a>
<a class="am-btn am-btn-primary am-btn-xs" :data-modal="'/biz/settle/add_price?id='+v.id" data-title="新增费用" href="javascript:;">新增费用</a>
<a class="am-btn am-btn-primary am-btn-xs" data-ajax="post" data-action="biz/settle/edit_static" :data-params-id="v.id" data-params-type="1" href="javascript:;">重新结算</a>
</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate'], function (laydate) {
laydate.render({
elem: '#id-time',
format:'yyyy-MM'
});
});
var vue_obj;
var loading = 0;
$(function(){
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params:[],
lists:[],
yearAry :[],
monthAry :[],
type_arr : [],
},
mounted:function() {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
vm.type_arr = <?=json_encode($type_arr)?>;
},
methods:{
},
watch:{
}
});
$('#export').on('click', function () {
var href = $.menu.parseUri(window.location.href);
var count = <?=$pager['totle']?>;
layer.msg('导出中请耐心等待几秒钟......');
href = href.replace("lists_static?", "export?");
window.location.href = href;
});
<?php page_script($pager) ?>
});
</script>
+191
View File
@@ -0,0 +1,191 @@
<form id="vue-edit" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
<div class="tab-pane fade in active" id="swzc">
<div class="am-form-group wp50" v-if="info.type!=3">
<label class="am-para-label">供应商:</label>
<div class="am-para-input">
<input type="text" placeholder="供应商" v-model="info.title">
</div>
</div>
<div class="am-form-group wp50" v-if="info.type!=2">
<label class="am-para-label">生效时间:</label>
<div class="am-para-input">
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">类型:</label>
<div class="am-para-input">
<select name="type" v-model="info.type">
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">是否默认:</label>
<div class="am-para-input">
<input type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" v-model="info.is_def"/>
</div>
</div>
<template v-if="info.type==1">
<div class="am-form-group wp50" >
<label class="am-para-label">结算价:</label>
<div class="am-para-input">
<input type="number" placeholder="请输入结算价" name="price_insure" v-model="info.jsondata.price" style="display: inline;width: 60%"/>
<span></span>
</div>
</div>
</template>
<template v-if="info.type==2 || info.type==3">
<div class="am-form-group fl">
<label class="am-para-label">返点:</label>
<div class="input-group am-para-input w150">
<input type="number" placeholder="输入返点" v-model="info.jsondata.rebate">
<div class="input-group-addon">%</div>
</div>
</div>
<div class="am-form-group">
<div class="input-group am-para-input">
<span class="f12 clr999 lh-default ml5">百分比</span>
</div>
</div>
</template>
<template v-if="info.type==2">
<div class="am-form-group">
<label class="am-para-label">保险类型:</label>
<div class="input-group am-para-input w150">
<select v-model="info.jsondata.type">
<option value="1">商业险</option>
<option value="2">交强险</option>
</select>
</div>
</div>
</template>
<div class="am-form-group" :style="{'display':info.type==2 ? 'block':'none'}" v-if="info.is_def==0">
<label class="am-para-label">时间区间:</label>
<div class="am-para-input wp60">
<div class="am-para-inline w200">
<input type="text" placeholder="开始时间" autocomplete="off" value="<?=$info['jsondata']['s_time']?>" name="s_time" id="s-time">
</div>
<div class="am-para-inline w200">
<input type="text" placeholder="结束时间" autocomplete="off" value="<?=$info['jsondata']['e_time']?>" name="e_time" id="e-time">
</div>
</div>
</div>
<template v-if="info.type==3">
<div class="am-form-group wp50">
<label class="am-para-label">产品:</label>
<div class="am-para-input">
<select v-model="info.jsondata.finance_id">
<option v-for="(item,key) in finances" :value="item.id">{{item.title}}</option>
</select>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">期数:</label>
<div class="am-para-input">
<select v-model="info.jsondata.finance_num">
<option v-for="item in finances_num" :value="item">{{item}}</option>
</select>
</div>
</div>
</template>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input"><button class="am-btn am-btn-secondary" type="button" @click="saveEdit">提交</button></div>
</div>
</form>
<script>
require(['laydate'], function (laydate) {
laydate.render({
elem: '#id-time'
});
//日期范围
laydate.render({
elem: '#s-time'
,type: 'datetime'
});
laydate.render({
elem: '#e-time'
,type: 'datetime'
});
});
var loading = 0;
var vue_obj;
$(function(){
vue_obj = new Vue({
el: '#vue-edit',
data: {
info : [],
typeAry:[],
yearAry:[],
monthAry:[],
finances:[],
finances_num:[],
action:''
},
mounted:function(){
var vm = this;
vm.info = <?=json_encode($info)?>;
vm.typeAry = <?=$typeAry ? json_encode($typeAry) : '[]'?>;
vm.action = '<?=$info['action']?>';
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
vm.finances = <?=json_encode($finances)?>;
vm.finances_num = <?=json_encode($finances_num)?>;
},
methods:{
saveEdit:function(){
var vm = this;
vm.info.s_effect_time = $("#id-time").val();
if(vm.info.type==2){
vm.info.s_time = $("#s-time").val();
vm.info.e_time = $("#e-time").val();
}
if(1 == loading){
return 0;
}
loading = 1;
$.ajax({
url: vm.action,
type: 'post',
dataType: 'json',
data: {info:vm.info},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = 0;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
layer.closeAll();
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
}
},
watch:{
}
});
});
</script>
+126
View File
@@ -0,0 +1,126 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
<?foreach ($typeAry as $key=>$val){?>
<li role="presentation" class="<?=$params['type']==$key ? 'active' : ''?>">
<a href="javascript:void (0);" data-open="/biz/srv/lists?id=<?=$params['id']?>&type=<?=$key?>">
<?=$val?>
</a>
</li>
<?}?>
</ul>
</div>
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/biz/srv/lists">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">状态:</label>
<div class="am-para-inline w100">
<select name="status" v-model="params.status">
<option value="">请选择</option>
<option value="1">正常</option>
<option value="0">禁用</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">供应商:</label>
<div class="am-para-inline w100">
<select name="title" v-model="params.title">
<option value="">请选择</option>
<option v-for="(v,i) in titleAry" :value="v.title">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml20">
<input type="hidden" :value="params.type" name="type">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml20">
<button data-title="新增" type="button" :data-modal="'/biz/srv/get?type='+params.type" class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="8%"><span>ID</span></th>
<th width="20%"><span>商家</span></th>
<th width="20%"><span>供应商</span></th>
<th width="20%"><span>其它参数</span></th>
<th width="15%"><span>生效日期</span></th>
<th width="8%"><span>类型</span></th>
<th width="8%"><span>是否默认</span></th>
<th width="8%"><span>状态</span></th>
<th width="15%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['title'] ?></td>
<td>
<?foreach ($v['other_data'] as $k2 => $v2){?>
<?=$k2?>:<?= $v2 ?><br>
<?}?>
</td>
<td><?= $v['s_effect_time'] ?></td>
<td><?= $v['type_cn'] ?></td>
<td><?= $v['is_def'] ?></td>
<td><?= $v['status_cn'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<tr>
<td colspan="9" class="align-r">
<a data-title="修改-<?=$v['title']?>" data-modal="/biz/srv/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
<input type="hidden" class="srv-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".srv-id-<?= $v['id'] ?>"
data-action="/biz/srv/batch" data-field="" style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>禁用</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>正常</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '#vue-app',
data: {
params: [],
titleAry:[]
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
$.get('/biz/srv/get_title', {"type":<?=$params['type']?>},function(result){
if(result.code && result.data.lists){
vm.titleAry = result.data.lists
}
},'json')
},
methods: {
},
watch: {
}
});
$(function () {
<?php page_script($pager) ?>
});
</script>
+70 -16
View File
@@ -1,5 +1,15 @@
<form id="vue-edit" class="am-form am-form-horizontal" :action="action" data-auto="true" method="post"
style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">分佣比例:</label>
<div class="am-para-input">
<template v-if="info.biz_type==2">合伙人</template>
<template v-else>品牌店</template>
<input type="text" style="width:90px;display:inline" placeholder="0~100" name="" v-model="info.rate"/>%&nbsp;&nbsp;&nbsp;&nbsp;
狸车:<span>{{100-info.rate}}%</span> (说明:有效值0~100,输入数值的百分比)
</div>
</div>
<template v-if="info.biz_type==2">
<div class="am-form-group">
<label class="am-para-label">联系人:</label>
<div class="am-para-input w300">
@@ -20,13 +30,6 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">分佣比例:</label>
<div class="am-para-input">
合伙人:<input type="text" style="width:90px;display:inline" placeholder="0~100" name="" v-model="info.rate"/>%&nbsp;&nbsp;&nbsp;&nbsp;
狸车:<span>{{100-info.rate}}%</span> (说明:有效值0~100,输入数值的百分比)
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">保证金:</label>
<div class="am-para-input w150">
@@ -39,6 +42,7 @@
<input type="text" placeholder="输入面积" name="" type="number" v-model="info.area"/>
</div>
</div>
</template>
<div class="am-form-group">
<label class="am-para-label">租金()</label>
<div class="am-para-input w150">
@@ -51,12 +55,61 @@
<input type="text" placeholder="输入水电" name="" type="number" v-model="info.wat_ele"/>
</div>
</div>
<template v-if="info.biz_type==1">
<div class="am-form-group">
<label class="am-para-label">试驾车租金:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入试驾车租金" name="" type="number" v-model="info.car_rent"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">市场活动营:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入市场活动营" name="" type="number" v-model="info.marketing"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">门头营销:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入门头营销" name="" type="number" v-model="info.door_step"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">垂媒:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入垂媒" name="" type="number" v-model="info.margin"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">销售提成:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入销售提成" name="" type="number" v-model="info.commission"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">店长底薪:</label>
<div class="am-para-input w150">
<select v-model="info.manager_wage">
<option value="8000">8000</option>
<option value="10000">10000</option>
<option value="12000">12000</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">销售人数:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入销售提成" name="" type="number" v-model="info.num"/>
</div>
</div>
</template>
<div class="am-form-group">
<label class="am-para-label">销售底薪:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入人工工资" name="" type="number" v-model="info.employee_wage"/>
</div>
</div>
<template v-if="info.biz_type==2">
<div class="am-form-group">
<label class="am-para-label">人员核定:</label>
<div class="am-para-input">
@@ -76,6 +129,16 @@
<input type="text" placeholder="输入裸车抽成" name="" type="number" v-model="info.commission"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">合作时间:</label>
<div class="am-para-input">
<input type="text" id="s_time" style="width:200px;display:inline" placeholder="开始时间" name=""
autocomplete="off" v-model="info.s_time"/>
<input type="text" id="e_time" style="width:200px;display:inline" placeholder="结束时间" name=""
autocomplete="off" v-model="info.e_time"/>
</div>
</div>
</template>
<div class="am-form-group">
<label class="am-para-label">拖车费:</label>
<div class="am-para-input w150">
@@ -92,15 +155,6 @@
</template>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">合作时间:</label>
<div class="am-para-input">
<input type="text" id="s_time" style="width:200px;display:inline" placeholder="开始时间" name=""
autocomplete="off" v-model="info.s_time"/>
<input type="text" id="e_time" style="width:200px;display:inline" placeholder="结束时间" name=""
autocomplete="off" v-model="info.e_time"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="button" @click="saveEdit">保存</button>
+17 -2
View File
@@ -78,6 +78,7 @@
</select>
</div>
</div>
<!--
<div class="am-form-group fl">
<label class="am-para-label w80">公司:</label>
<div class="am-para-input w150">
@@ -87,6 +88,7 @@
</select>
</div>
</div>
-->
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<div class="am-para-inline w100">
@@ -153,10 +155,23 @@
</tr>
<tr>
<td colspan="6" class="align-r">
<?if($v['type']==2){?>
<?if($v['type']==1){?>
<a data-open="/biz/fine/lists?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">精品配置
</a>
<a data-open="/biz/seprice/lists?biz_id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">费用管理
</a>
<a data-open="/biz/srv/lists?id=<?= $v['id'] ?>&type=1"
class="am-btn am-btn-primary am-btn-xs">水平业务配置
</a>
<?}?>
<?if(in_array($v['type'],[1,2])){?>
<a data-open="/biz/store/store/get_info?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">基本信息</a>
<a data-open="/biz/settle/lists_static?id=<?= $v['id'] ?>"
<?}?>
<?if(in_array($v['type'],[1,2,3])){?>
<a data-open="/biz/settle/lists_static?id=<?= $v['id'] ?>&_biz_type=<?=$v['type']?>"
class="am-btn am-btn-primary am-btn-xs">结算统计</a>
<?}?>
<a data-open="/biz/situation/get?id=<?= $v['id'] ?>"
+8 -2
View File
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>东风EV</title>
<title>狸车</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
@@ -18,6 +18,7 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<!-- 滑动按钮css -->
<link rel="stylesheet" type="text/css" href="/static/css/switch.css">
<link rel="stylesheet" type="text/css" href="/static/js/plugin/viewer/viewer.css?t=3">
<script type="text/javascript" src="/static/js/common/jquery-3.0.0.js"></script>
<script type="text/javascript" src="/static/js/common/vue.min.js"></script>
@@ -32,6 +33,7 @@
<script type="text/javascript" src="/static/js/common/Sortable.min.js?t=2020221"></script>
<script type="text/javascript" src="/static/js/common/vuedraggable.umd.min.js?t=2020221"></script>
<script type="text/javascript" src="/static/js/common/jquery.form.js?t=2020410"></script>
<script type="text/javascript" src="/static/js/plugin/viewer/viewer.js?t=4"></script>
<script>window.ROOT_URL = '';</script>
</head>
<body>
@@ -39,7 +41,7 @@
<div class="coms-layout-header">
<div class="bars-nav"><i class="am-icon-bars"></i>导航</div>
<a href="" class="logo" style="">
<img src="/static/images/common/logo.png?v2" style="height:40px">
<img src="/static/images/common/logo.png?v=1" style="height:40px">
</a>
<?php if ($menus) { ?>
<ul class="header-nav">
@@ -154,6 +156,10 @@
<script type="text/javascript" src="/static/js/plugin/require/require.js"></script>
<script type="text/javascript" src="/static/js/common/app.js"></script>
<script type="text/javascript">
//查看图片控件
function showViewer(obj){
new Viewer(document.getElementById(obj));
}
var log_data = {};
(function ($) {
$(".coms-layout-header .bars-nav").on("click",function(event){
+683
View File
@@ -0,0 +1,683 @@
<style type="text/css">
.span-bold {
font-weight: bold;
}
.am-para-label-con {
font-weight: 400;
line-height: 37px;
text-align: left;
font-size: 1.6rem;
}
.label-width{
width: 150px;
}
.am-para-input{
margin-left: 150px;
}
</style>
<div id="vue-edit" class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div class="am-u-lg-12">
<!-- 基本信息 -->
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">基本信息</span>
<span class="ml10">{{info.sid}}</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">开票方:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.bill_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">车架号:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.vin}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">指导价:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.srv_json.ori_price}}</label>
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">品牌:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.brand_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">车型:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.s_name}} {{info.v_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
</div>
</div>
</div>
</div>
<!-- 销售信息 -->
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px" title="【销售收入合计】(实际售价+选装实收)">销售信息(销售收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:{{info.row.sale_price}})</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">车主:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">
<a href="javascript:void(0);" :data-open="'/receiver/orderv2/orders/get?id='+info.row.o_id">
{{info.name}}
</a>
</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">开票价:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.bill_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">开票日期:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.bill_time}}</label>
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">门店类型:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.biz_type_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">门店名称:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.biz_name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">销售顾问:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.admin_name}}</label>
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">实际售价:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">选装实收:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.price_fine_select" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">&nbsp;</span></label>
<div class="am-para-input">
<label class="am-para-label-con"></label>
</div>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">销售政策</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">订单日期:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.order_time}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">商务政策底价:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.srv_json.price_floor}}</label>
<a v-if="info.business_id > 0" :data-modal="'/auto/business/get?id='+info.business_id" data-title="商务政策详情" class="am-btn am-btn-default am-btn-xs">
商务政策
</a>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">商务政策分润:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.srv_json.profix_car}}</label>
</div>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px" title="【采购及加装成本合计】(采购成本 + 选装成本 + 选装工时费)">采购成本(采购及加装成本合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a>:{{info.row.buy_price}})</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">采购成本:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.buy_price}}</label>-->
<input type="number" v-model="info.buy_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">选装成本:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.cost_json.select_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">选装工时费:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.cost_json.labor_price" style="width: 150px;">
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">车辆归属:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.company_name}}</label>
</div>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">促销成本(促销成本合计:{{info.row.promotion_price}})</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">销售佣金:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.promotion_json.sale_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">其他:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.promotion_json.other" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">厂家补贴:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.promotion_json.factory_price" style="width: 150px;">
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【促销成本合计】(销售佣金+其他)">促销成本合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.promotion_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【整车采购成本】(采购成本-厂家补贴)">整车采购成本<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.car_buy_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【整车采购毛利】(销售收入合计(实际售价+选装实收) - 整车采购成本 - 促销成本合计 - 选装金额 -选装工时费">整车采购毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.car_profit_price}}</label>
</div>
</div>
</div>
</div>
</div>
<div v-if="info.biz_type == '1'" class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">水平业务</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">保险公司:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.business_product}}</label>-->
<input type="text" v-model="info.srv_json.business_product" style="width: 200px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">商业险金额:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.business_price}}</label>-->
<input type="number" v-model="info.srv_json.business_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">商业险返点:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.business_fd}}</label>-->
<input type="number" v-model="info.srv_json.business_fd" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">商业险佣金:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.business_ins_price}}</label>-->
<input type="number" v-model="info.srv_json.business_ins_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">交强险金额:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.insurance_price}}</label>-->
<input type="number" v-model="info.srv_json.insurance_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">交强险返点:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.insurance_fd}}</label>-->
<input type="number" v-model="info.srv_json.insurance_fd" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">交强险佣金:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.insurance_ins_price}}</label>-->
<input type="number" v-model="info.srv_json.insurance_ins_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">客户退点金额:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.back_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【保险收入合计】(商业险佣金+交强险佣金-客户退点金额">保险收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.insurance_price}}</label>
</div>
</div>
</div>
<hr class="am-u-lg-12 wp90" style="margin: 10px">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">挂牌收入:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.fee_carno}}</label>-->
<input type="number" v-model="info.srv_json.fee_carno" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">挂牌成本:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.cb_fee_carno}}</label>-->
<input type="number" v-model="info.srv_json.cb_fee_carno" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【挂牌收入合计】(挂牌收入-挂牌成本)">挂牌收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.fee_carno_price}}</label>
</div>
</div>
</div>
<hr v-if="info.payway=='1'" class="am-u-lg-12 wp90" style="margin: 10px">
<div v-if="info.payway=='1'" class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭银行:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.loan_product}}</label>-->
<input type="text" v-model="info.srv_json.loan_product" style="width: 200px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭金额:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.loan_price}}</label>-->
<input type="number" v-model="info.srv_json.loan_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭期数:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.loan_num}}</label>-->
<input type="number" v-model="info.srv_json.loan_num" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭服务费:</span></label>
<div class="am-para-input">
<!-- <label class="am-para-label-con">{{info.srv_json.loan_srv_price}}</label>-->
<input type="number" v-model="info.srv_json.loan_srv_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">解抵服务费:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.loan_offset_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">利息补贴收入:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.loan_subsidy_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">其他收入金额:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.loan_in_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">其他支出金额:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.loan_out_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">&nbsp;</span></label>
<div class="am-para-input">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭手续费收入:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.commission_price" style="width: 150px;">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【按揭收入合计】(按揭服务费+解抵服务费+利息补贴收入+按揭手续费收入+其他收入金额-其他支出金额)">按揭收入合计<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.loan_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">&nbsp;</span></label>
<div class="am-para-input">
<label class="am-para-label-con"></label>
</div>
</div>
</div>
<hr class="am-u-lg-12 wp90" style="margin: 10px">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">其他收入:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.other_in_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">其他支出:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.srv_json.other_out_price" style="width: 150px">
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">&nbsp;</span></label>
<div class="am-para-input">
</div>
</div>
</div>
</div>
</div>
<div v-if="info.biz_type == '2'" class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">水平业务</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">保险收入合计</a></span></label>
<div class="am-para-input">
<input type="number" v-model="info.row.insurance_price" style="width: 150px;">
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">挂牌收入合计:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.row.fee_carno_price" style="width: 150px;">
</div>
</div>
</div>
<!-- <div v-if="info.payway=='1'" class="am-form-inline">-->
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">按揭收入合计:</span></label>
<div class="am-para-input">
<input type="number" v-model="info.row.loan_price" style="width: 150px;">
</div>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">整车合计</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width" title="【整车采购成本】(采购成本-厂家补贴)"><span class="span-bold">整车采购成本<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.car_buy_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【整车采购毛利】(销售收入合计(实际售价+选装实收) - 整车采购成本 - 促销成本合计 - 选装金额 -选装工时费">整车采购毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.car_profit_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【水平业务总毛利】(保险收入合计+挂牌收入合计+按揭收入合计+其他收入-其他支出">水平业务总毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.srv_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【单车总毛利】(整车采购毛利+水平业务总毛利)">单车总毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.car_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【门店采购毛利】(根据门店类型取, 商务政策分润 - 选装金额 - 选装工时费 - 促销成本 + 水平业务总毛利 + (实际售价入 - 商务政策底价))">门店单车毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.dl_car_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold" title="【品牌单车总毛利】(单车总毛利 - 品牌店单车毛利/代理店单车毛利/合伙店采购毛利)">品牌单车总毛利<a href="javascript:void(0)" class="fa fa-info-circle ml5"></a></span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.row.brand_car_price}}</label>
</div>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span style="font-size: 20px">收款核对</span>
<span style="float:right;margin-top:5px">
</span>
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">应收款金额:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.need_price}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">已收款金额:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.pay_price}}</label>
<a :data-modal="'/receiver/orderv2/orders/get_paylog?id='+info.row.o_id" data-title="收款记录" class="am-btn am-btn-default am-btn-xs">
收款记录
</a>
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">是否齐款:</span></label>
<div class="am-para-input">
<label class="am-para-label-con" style="display: none">
<a v-if="info['srv_json']['if_pay'] == '1'" type="button" class="am-btn am-btn-xs am-btn-success"
data-ajax="post" data-action="/items/cost/edit_pay" :data-params-id="info.row.id"
data-params-status="0">
</a>
<a v-else type="button" class="am-btn am-btn-xs am-btn-danger"
data-ajax="post" data-action="/items/cost/edit_pay" :data-params-id="info.row.id"
data-params-status="1">
</a>
</label>
<input id="if_pay" type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" <?=$info['srv_json']['if_pay'] == '1'?'checked':''?> onchange="edit_pay(this,<?=$info['row']['id']?>)"/>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<a href="javascript:void(0);" @click='saveEdit();' class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem; margin-top: 4rem;">保存</a>
</div>
</div>
</div>
</div>
<script>
function edit_pay(obj,id){
var value = '';
if($(obj).get(0).checked) {
value = 1;
}else{
value = 0;
}
var data = {'id':id,'status':value};
$.post('/items/cost/edit_pay',data,function(result){
if(result.code){
layer.msg(result.msg, {time: 2000,icon:1 }, function () {
$.form.reload();
});
}else{
layer.msg(result.msg,{icon:2});
}
},'json')
}
</script>
<script>
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#loan_time'
, type: 'date'
});
laydate.render({
elem: '#ins_time'
, type: 'date'
});
});
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>,
},
mounted: function () {
},
computed: {},
created: function () {
},
methods: {
saveEdit: function () {
var vm = this;
var post_data = {};
post_data['id'] = vm.info.row.id;
post_data['promotion_json'] = vm.info.promotion_json;
post_data['cost_json'] = vm.info.cost_json;
post_data['srv_json'] = vm.info.srv_json;
post_data['price'] = vm.info.price;
post_data['buy_price'] = vm.info.buy_price;
post_data['insurance_price'] = vm.info.row.insurance_price;
post_data['fee_carno_price'] = vm.info.row.fee_carno_price;
post_data['loan_price'] = vm.info.row.loan_price;
$.ajax({
url: '/items/cost/edit',
type: 'post',
dataType: 'json',
data: post_data,
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = false;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
if (data.url != '') {
$.form.href(data.url);
} else {
$.form.reload();
}
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
},
});
},
}
});
});
</script>
+510
View File
@@ -0,0 +1,510 @@
<div class="coms-table-wrap mt10">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/items/cost">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
foreach ($autoList[1] as $v) { ?>
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['brand_id'] ? 'selected' : '' ?>
><?= $v['name'] ?></option>
<? }
} ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
foreach ($autoList[2] as $v) { ?>
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['s_id'] ? 'selected' : '' ?>
><?= $v['name'] ?></option>
<?php }
} ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w220">
<select id="bd-auto3-id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
foreach ($autoList[3] as $v) { ?>
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['v_id'] ? 'selected' : '' ?>
><?= $v['name'] ?></option>
<?php }
} ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">车架号:</label>
<div class="am-para-inline w200">
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">开票时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-bill-time" name="bill_time" type="text" value="<?= $params['bill_time'] ?>"
placeholder="开票时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="bill">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="bill">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="bill">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="bill">本月</a>
</div>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店类型:</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">归属门店:</label>
<div class="am-para-inline w120">
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="biz_id_admin" v-model="params.biz_id_admin">
<option value="">门店</option>
<template v-for="(v,i) in admins.bizAry">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-para-inline w120" style="display: none">
<select name="admin_id" v-model="params.admin_id">
<option value="">销售员</option>
<template v-for="(v,i) in admins.list">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl ml50">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th>门店</th>
<th width="15%">车辆</th>
<th>销售收入合计</th>
<th>采购及加装成本合计</th>
<th>促销成本合计</th>
<th>整车采购成本</th>
<th>整车采购毛利</th>
<th>保险收入合计</th>
<th>挂牌收入合计</th>
<th>按揭收入合计</th>
<th>水平业务总毛利</th>
<th>单车总毛利</th>
<th>门店单车毛利</th>
<th>品牌单车总毛利</th>
<th>齐款</th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td>{{v.biz_name}}</td>
<td>
<a href="javascript:void(0);" :data-open="'/items/cost/get?id='+v.id">
{{v.vin}}<br>{{v.title}}
</a>
</td>
<td>{{v.sale_price}}</td>
<td>{{v.buy_price}}</td>
<td>{{v.promotion_price}}</td>
<td>{{v.car_buy_price}}</td>
<td>{{v.car_profit_price}}</td>
<td>{{v.insurance_price}}</td>
<td>{{v.fee_carno_price}}</td>
<td>{{v.loan_price}}</td>
<td>{{v.srv_price}}</td>
<td>{{v.car_price}}</td>
<td>{{v.dl_car_price}}</td>
<td>{{v.brand_car_price}}</td>
<td>
<input v-if="v.if_pay == '1'" id="if_pay" type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" :data-id="v.id" checked onchange="edit_pay(this)"/>
<input v-if="v.if_pay != '1'" id="if_pay" type="checkbox" class="mui-switch mui-switch-anim va-mid" true-value="1" false-value="0" :data-id="v.id" onchange="edit_pay(this)"/>
</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
<div id="cost-modal" style="display: none;padding: 10px">
<div class="modal-body">
<div class="text-center">
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
<div class="form-group-action">
<a href="/temp/cost.xlsx" target="_blank" class="btn btn-default">查看模板</a>
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
<form id="import-form">
<input type="file" id="cost-file" name="file" accept=".xls,.xlsx"
style="left:-9999px;position:absolute;" onchange="load_cost()">
</form>
<span>上传Excel文件</span>
</label>
</div>
</div>
</div>
</div>
</div>
<script>
function edit_pay(obj){
// alert($(obj).get(0).dataset.id);
// alert($(obj).get(0).getAttribute('data-id'));
id = $(obj).get(0).dataset.id;
var value = '';
if($(obj).get(0).checked) {
value = 1;
}else{
value = 0;
}
var data = {'id':id,'status':value};
$.post('/items/cost/edit_pay',data,function(result){
if(result.code){
layer.msg(result.msg, {time: 2000,icon:1 }, function () {
$.form.reload();
});
}else{
layer.msg(result.msg,{icon:2});
}
},'json')
}
function load_cost() {
var file = $("#cost-file");
if (file.val() == '') {
layer.msg('文件是空的');
return 0;
}
var loading = layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
var options = {
url: "/items/cost/add_excel",
type: "post",
dataType: "json",
data: {},
success: function (res) {
if (res['code']) {
layer.msg(res.msg, {
icon: 1,
time: 2000
}, function () {
location.reload();
});
} else {
layer.msg(res.msg, {icon: 2});
}
},
complete: function () {
file.val('');
layer.closeAll('loading');
}
};
$("#import-form").ajaxSubmit(options);
}
</script>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#order-time', range: '~'
});
laydate.render({
elem: '#id-bill-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
endDate = beginDate = nowDate.Format('yyyy-MM-dd');
break;
case 'yesterday':
endDate = beginDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
// $('#id-create-time').val(date);
switch ($(this).data('btn')) {
case 'bill':
$('#id-bill-time').val(date);
break;
case 'order':
$('#order-time').val(date);
break;
}
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: [],
lists: [],
show_info: [],
// modal_fine: {title: '', lists: [], selected: [], page: 1, size: 10, total: 0},
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.lists = <?=json_encode($lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.set_sery();
vm.init_citys();
},
methods: {
set_sery: function () {
var vm = this;
var s_id = $('#bd-auto2-id').val();
if (s_id > 0) {
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: s_id,
status: 3,
type: 0
},
success: function (response) {
if (response.code == 1) {
vm.attrs_cor = response.data.list;
}
}
});
} else {
vm.attrs_cor = [];
vm.params.cor_id = '';
}
},
init_citys: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: '350',
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
vm.admins.cityAry = JSON.parse(JSON.stringify(response.data));
}
}
});
},
reset: function () {
var that = this;
$("#vin").val('');
$("#id-bill-time").val('');
that.params.brand_id = '';
that.params.city_id_admin = '';
}
},
watch: {
'params.city_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.countyAry = [];
that.params.county_id_admin = '';
} else {
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
that.params.county_id_admin = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.countyAry = response.data;
}
}
});
}
},
'params.county_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.bizAry = [];
that.params.biz_id_admin = '';
} else {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
city_id: that.params.city_id_admin,
county_id: that.params.county_id_admin,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.bizAry = response.data.list;
if (that.params.biz_id_admin > 0) {
var biz_id = '';
for (var i in that.admins.bizAry) {
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
biz_id = that.params.biz_id_admin;
break;
}
}
that.params.biz_id_admin = biz_id;
}
}
}
});
}
},
// 不虚线显示销售 biz_id_admin -> biz_id_admin_ 禁用
'params.biz_id_admin_': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.list = [];
that.params.admin_id = '';
} else {
$.ajax({
type: 'post',
url: '/app/licheb/member/json_lists',
dataType: 'json',
data: {
biz_id: nv,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.list = response.data.list;
if (that.params.admin_id > 0) {
var admin_id = '';
for (var i in that.admins.list) {
if (that.params.admin_id == that.admins.list[i].id) {
admin_id = that.params.admin_id;
break;
}
}
that.params.admin_id = admin_id;
}
}
}
});
}
}
}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/items/cost/export?' + arr[1];
window.location.href = href;
});
$("#import").click(function () {
$("#cost-file").val('');
layer.open({
type: 1,
area: ['40%'], //宽高
content: $('#cost-modal'),
title: '导入整车成本',
shade: false,
btn: ['完成'],
yes: function (index) {
layer.close(index);
}
});
});
$('#bd-auto1-id').change(function () {
$('#bd-auto2-id').empty();
$('#bd-auto3-id').empty();
$("#bd-auto3-id").prepend("<option value='0'>选择车型</option>");
});
$('#bd-auto2-id').change(function () {
$('#bd-auto3-id').empty();
});
});
</script>
+54 -47
View File
@@ -151,15 +151,15 @@
</div>
</td>
</tr>
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发动机号</div>-->
<!-- <input type="text" v-model="info.engine_num" placeholder="请输入发动机号">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发动机号</div>-->
<!-- <input type="text" v-model="info.engine_num" placeholder="请输入发动机号">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td"></td>-->
<!-- </tr>-->
</table>
<table width="100%" style="padding:10px 10px 10px 10px;">
<tr>
@@ -197,45 +197,51 @@
<input type="text" v-model="info.ori_price" placeholder="请输入指导价">
</div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">采购成本</div>
<input type="text" v-model="info.buy_price" placeholder="请输入采购成本">
</div>
</td>
</tr>
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">折扣%</div>-->
<!-- <input type="text" v-model="info.discount" placeholder="请输入折扣%">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">折扣金额</div>-->
<!-- <input type="text" v-model="info.dis_price" placeholder="请输入折扣金额">-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发票号</div>-->
<!-- <input type="text" v-model="info.bill_num" placeholder="请输入发票号">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发票金额</div>-->
<!-- <input type="text" v-model="info.bill_price" placeholder="请输入发票金额">-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">采购成本</div>-->
<!-- <input type="text" v-model="info.buy_price" placeholder="请输入采购成本">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td" colspan="2"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">折扣%</div>-->
<!-- <input type="text" v-model="info.discount" placeholder="请输入折扣%">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">折扣金额</div>-->
<!-- <input type="text" v-model="info.dis_price" placeholder="请输入折扣金额">-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发票号</div>-->
<!-- <input type="text" v-model="info.bill_num" placeholder="请输入发票号">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">发票金额</div>-->
<!-- <input type="text" v-model="info.bill_price" placeholder="请输入发票金额">-->
<!-- </div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="table-td">-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-addon">采购成本</div>-->
<!-- <input type="text" v-model="info.buy_price" placeholder="请输入采购成本">-->
<!-- </div>-->
<!-- </td>-->
<!-- <td class="table-td" colspan="2"></td>-->
<!-- </tr>-->
</table>
<div class="am-form-group">
<a href="javascript:void(0);" @click='saveEdit();'
@@ -368,6 +374,7 @@
type: type,
pid: pid,
tp: 1,
status: !vm.info.id ? 3 : 0,
},
success: function (data) {
if (data.data) {
+4 -8
View File
@@ -9,7 +9,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -24,7 +24,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -37,7 +37,7 @@
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<div class="am-para-inline w220">
<select id="bd-auto3-id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
@@ -184,7 +184,6 @@
</a>
</span>
</th>
<!--
<th width="17%">
<span :class="'order'+('addr_id'==params.order?' order-on':' order-none')">
<a href="javascript:void(0)" @click="set_order('addr_id')">
@@ -194,7 +193,6 @@
</a>
</span>
</th>
-->
<th width="10%">
<span :class="'order'+('in_time'==params.order?' order-on':' order-none')">
<a href="javascript:void(0)" @click="set_order('in_time')">
@@ -227,9 +225,7 @@
<a href="javascript:void(0);" :data-modal="'/items/goods/goods/get_info?id='+v.id"
data-title="详情">{{v.vin}}</a>
</td>
<!--
<td>{{v.address}}</td>
-->
<td>{{v.in_time}}</td>
<td style="display: none">{{v.auto_fine}}</td>
<td>{{v.company_name}}</td>
@@ -615,7 +611,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
type: 0
},
success: function (response) {
+4 -4
View File
@@ -104,7 +104,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -119,7 +119,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -132,7 +132,7 @@
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<div class="am-para-inline w220">
<select id="bd-auto3-id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
@@ -694,7 +694,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
type: 0
},
success: function (response) {
+4 -4
View File
@@ -7,7 +7,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -22,7 +22,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -35,7 +35,7 @@
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<div class="am-para-inline w220">
<select id="bd-auto3-id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
@@ -209,7 +209,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
type: 0
},
success: function (response) {
+4 -4
View File
@@ -31,7 +31,7 @@
<label class="am-para-label w100">车型:</label>
<div class="am-para-inline w120">
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=2"
data-refurl="/common/auto?pid={value}&type=2&status=3"
data-next="#bd-auto2-id">
<option value="0">选择品牌</option>
<? if ($autoList[1]) {
@@ -46,7 +46,7 @@
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3"
data-refurl="/common/auto?pid={value}&type=3&status=3"
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
@@ -59,7 +59,7 @@
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<div class="am-para-inline w220">
<select id="bd-auto3-id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
@@ -235,7 +235,7 @@
dataType: 'json',
data: {
s_id: s_id,
status: 1,
status: 3,
type: 0
},
success: function (response) {
+207
View File
@@ -0,0 +1,207 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="items/stock/get_month">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w60">门店:</label>
<div class="am-para-inline w120">
<select title="类型" name="type" v-model="params.type" @change="setType">
<option value="">选择类型</option>
<option v-for="(v,i) in showData.typeAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select title="城市" name="city_id" v-model="params.city_id">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select title="行政区" name="county_id" v-model="params.county_id" @change="set_county">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<select title="门店" name="biz_id" v-model="params.biz_id">
<option value="">选择门店</option>
<option :value="v.id" v-for="(v,i) in bizAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<? if ($biz) {
foreach ($biz as $v) { ?>
<table class="am-table am-table-bordered" style="margin-top: 10px;">
<thead>
<tr>
<th colspan="10"><?= $v['biz_name'] ?></th>
</tr>
</thead>
<tbody>
<? foreach ($v['months'] as $v2) { ?>
<tr>
<td><?= $v2['name'] ?></td>
<td colspan="9" style="text-align:left;padding-left:15px;padding-right:15px;">
<?= $v2['data'] ?>
</td>
</tr>
<? } ?>
</tbody>
</table>
<? }
} ?>
</div>
</div>
<script>
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
cityAry: [],//城市
countyAry: [],//行政区
bizAry: [],//门店
showData: {typeAry: [''], typeStr: ''},//显示数据
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.showData = <?=json_encode($showData)?>;
vm.init_citys();
},
methods: {
init_citys: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: '350',
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
set_county: function () {
var that = this;
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
},
setType: function () {
var that = this;
that.params.city_id = '';
},
reset: function () {
var that = this;
that.params.city_id = '';
that.params.type = '';
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
},
'params.county_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.bizAry = [];
that.params.biz_id = that.params.addr_id = '';
} else {
let type = that.params.type ? that.params.type : that.showData.typeStr;
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
type: type,
city_id: that.params.city_id,
county_id: that.params.county_id,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.bizAry = response.data.list;
var biz_id = '';
if (that.params.biz_id > 0 || that.params.biz_id == -1) {
for (var i in that.bizAry) {
if (that.params.biz_id == that.bizAry[i].id) {
biz_id = that.params.biz_id;
break;
}
}
}
that.params.biz_id = biz_id;
}
}
});
}
},
}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/items/stock/export_month?' + arr[1];
window.location.href = href;
});
});
</script>
<style>
.td-left {
display: none;
position: absolute;
text-align: left;
margin-left: 15px;
margin-right: 15px;
}
</style>
+31 -31
View File
@@ -46,7 +46,7 @@
<div class="am-para-input">
<div class="am-g">
<label class="mr10" style="margin-top: 7px" v-for="(v,i) in auto_article">
<input type="checkbox" :value="v.id" v-model="info.arti_id"/> {{v.title}}
<input type="checkbox" :value="v.id" v-model="info.arti_id" v-bind:disabled="info.status==2"/> {{v.title}}
</label>
</div>
</div>
@@ -63,25 +63,25 @@
<div class="am-form-group">
<label class="am-para-label w100">提车人:</label>
<div class="am-para-inline w120">
<select v-model="takeCar1.city_id">
<select v-model="takeCar1.city_id" :disabled="info.status==2">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in takeCar1.cityList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar1.county_id">
<select v-model="takeCar1.county_id" :disabled="info.status==2">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in takeCar1.countyList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar1.type">
<select v-model="takeCar1.type" :disabled="info.status==2">
<option :value="i" v-for="(v,i) in showInfo.uidTypeAry">{{v}}</option>
</select>
</div>
<div v-if="takeCar1.type==2">
<div class="am-para-inline w210">
<select v-model="takeCar1.admin_id">
<select v-model="takeCar1.admin_id" :disabled="info.status==2">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar1.adminList">
<option :value="v.id">{{v.title}}</option>
@@ -89,7 +89,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar1.addr_id">
<select v-model="takeCar1.addr_id" :disabled="info.status==2">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar1.addrList">
<option :value="v.id">{{v.title}}</option>
@@ -99,7 +99,7 @@
</div>
<div v-else>
<div class="am-para-inline w210">
<select v-model="takeCar1.biz_id">
<select v-model="takeCar1.biz_id" :disabled="info.status==2">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar1.bizList">
<option :value="v.id">{{v.title}}</option>
@@ -107,7 +107,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar1.uid">
<select v-model="takeCar1.uid" :disabled="info.status==2">
<option value="">提车人</option>
<template v-for="(v,i) in takeCar1.uidList">
<option :value="v.id">{{v.title}}</option>
@@ -116,7 +116,7 @@
</div>
</div>
<div class="am-para-inline ml20" style="padding-top: 3px;">
<button type="button" class="am-btn am-btn-default am-btn-sm" @click='addBak("out");'>
<button type="button" class="am-btn am-btn-default am-btn-sm" @click='addBak("out");' :disabled="info.status==2">
{{info.out_bak?'删除备用提车人':'添加备用提车人'}}
</button>
</div>
@@ -124,25 +124,25 @@
<div class="am-form-group" v-if="info.out_bak">
<label class="am-para-label w100">备用提车人:</label>
<div class="am-para-inline w120">
<select v-model="takeCar2.city_id">
<select v-model="takeCar2.city_id" :disabled="info.status==2">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in takeCar2.cityList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar2.county_id">
<select v-model="takeCar2.county_id" :disabled="info.status==2">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in takeCar2.countyList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar2.type">
<select v-model="takeCar2.type" :disabled="info.status==2">
<option :value="i" v-for="(v,i) in showInfo.uidTypeAry">{{v}}</option>
</select>
</div>
<div v-if="takeCar2.type==2">
<div class="am-para-inline w210">
<select v-model="takeCar2.admin_id">
<select v-model="takeCar2.admin_id" :disabled="info.status==2">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar2.adminList">
<option :value="v.id">{{v.title}}</option>
@@ -150,7 +150,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar2.addr_id">
<select v-model="takeCar2.addr_id" :disabled="info.status==2">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar2.addrList">
<option :value="v.id">{{v.title}}</option>
@@ -160,7 +160,7 @@
</div>
<div v-else>
<div class="am-para-inline w210">
<select v-model="takeCar2.biz_id">
<select v-model="takeCar2.biz_id" :disabled="info.status==2">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar2.bizList">
<option :value="v.id">{{v.title}}</option>
@@ -168,7 +168,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar2.uid">
<select v-model="takeCar2.uid" :disabled="info.status==2">
<option value="">备用提车人</option>
<template v-for="(v,i) in takeCar2.uidList">
<option :value="v.id">{{v.title}}</option>
@@ -181,25 +181,25 @@
<div class="am-form-group">
<label class="am-para-label w100">接车人:</label>
<div class="am-para-inline w120">
<select v-model="takeCar3.city_id">
<select v-model="takeCar3.city_id" :disabled="info.status==2">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in takeCar3.cityList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar3.county_id">
<select v-model="takeCar3.county_id" :disabled="info.status==2">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in takeCar3.countyList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar3.type">
<select v-model="takeCar3.type" :disabled="info.status==2">
<option :value="i" v-for="(v,i) in showInfo.uidTypeAry">{{v}}</option>
</select>
</div>
<div v-if="takeCar3.type==2">
<div class="am-para-inline w210">
<select v-model="takeCar3.admin_id">
<select v-model="takeCar3.admin_id" :disabled="info.status==2">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar3.adminList">
<option :value="v.id">{{v.title}}</option>
@@ -207,7 +207,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar3.addr_id">
<select v-model="takeCar3.addr_id" :disabled="info.status==2">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar3.addrList">
<option :value="v.id">{{v.title}}</option>
@@ -217,7 +217,7 @@
</div>
<div v-else>
<div class="am-para-inline w210">
<select v-model="takeCar3.biz_id">
<select v-model="takeCar3.biz_id" :disabled="info.status==2">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar3.bizList">
<option :value="v.id">{{v.title}}</option>
@@ -225,7 +225,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar3.uid">
<select v-model="takeCar3.uid" :disabled="info.status==2">
<option value="">接车人</option>
<template v-for="(v,i) in takeCar3.uidList">
<option :value="v.id">{{v.title}}</option>
@@ -234,7 +234,7 @@
</div>
</div>
<div class="am-para-inline ml20" style="padding-top: 3px;">
<button type="button" class="am-btn am-btn-default am-btn-sm" @click='addBak("in");'>
<button type="button" class="am-btn am-btn-default am-btn-sm" @click='addBak("in");' :disabled="info.status==2">
{{info.in_bak?'删除备用接车人':'添加备用接车人'}}
</button>
</div>
@@ -242,25 +242,25 @@
<div class="am-form-group" v-if="info.in_bak">
<label class="am-para-label w100">备用接车人:</label>
<div class="am-para-inline w120">
<select v-model="takeCar4.city_id">
<select v-model="takeCar4.city_id" :disabled="info.status==2">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in takeCar4.cityList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar4.county_id">
<select v-model="takeCar4.county_id" :disabled="info.status==2">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in takeCar4.countyList">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="takeCar4.type">
<select v-model="takeCar4.type" :disabled="info.status==2">
<option :value="i" v-for="(v,i) in showInfo.uidTypeAry">{{v}}</option>
</select>
</div>
<div v-if="takeCar4.type==2">
<div class="am-para-inline w210">
<select v-model="takeCar4.admin_id">
<select v-model="takeCar4.admin_id" :disabled="info.status==2">
<option value="">选择信息员</option>
<template v-for="(v,i) in takeCar4.adminList">
<option :value="v.id">{{v.title}}</option>
@@ -268,7 +268,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar4.addr_id">
<select v-model="takeCar4.addr_id" :disabled="info.status==2">
<option value="">选择存放地</option>
<template v-for="(v,i) in takeCar4.addrList">
<option :value="v.id">{{v.title}}</option>
@@ -278,7 +278,7 @@
</div>
<div v-else>
<div class="am-para-inline w210">
<select v-model="takeCar4.biz_id">
<select v-model="takeCar4.biz_id" :disabled="info.status==2">
<option value="">选择门店</option>
<template v-for="(v,i) in takeCar4.bizList">
<option :value="v.id">{{v.title}}</option>
@@ -286,7 +286,7 @@
</select>
</div>
<div class="am-para-inline w210">
<select v-model="takeCar4.uid">
<select v-model="takeCar4.uid" :disabled="info.status==2">
<option value="">备用接车人</option>
<template v-for="(v,i) in takeCar4.uidList">
<option :value="v.id">{{v.title}}</option>
+15 -24
View File
@@ -68,7 +68,7 @@
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w220">
<div class="am-para-inline w260">
<select id="v_id" name="v_id">
<option value="0">选择车型</option>
<?php if ($autoList[3]) {
@@ -80,6 +80,13 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w70">调拨人:</label>
<div class="am-para-inline w200">
<input id="admin_name" name="admin_name" type="text" placeholder="输入调拨人"
value="<?= $params['admin_name'] ?>"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w70">提车时间:</label>
@@ -96,10 +103,10 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w70">调拨</label>
<label class="am-para-label w90">调拨时间</label>
<div class="am-para-inline w200">
<input id="admin_name" name="admin_name" type="text" placeholder="输入调拨人"
value="<?= $params['admin_name'] ?>"/>
<input id="c_time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
placeholder="调拨时间范围" autocomplete="off"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
@@ -267,6 +274,8 @@
<? if ($v['status'] == 2) { ?>
<a href="javascript:void(0);" data-open="items/transfer/get?id=<?= $v['id'] ?>"
>详情</a>
<a href="javascript:void(0);" data-open="items/transfer/get_edit?id=<?= $v['id'] ?>"
>修改</a>
<? } else { ?>
<? if ($v['status'] != -1) { ?>
<a href="javascript:void(0);" data-open="items/transfer/get?id=<?= $v['id'] ?>"
@@ -656,26 +665,8 @@
laydate.render({
elem: '#in_time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
var source_id = $(this).data('source') || 'out_time';
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
}
$('#' + source_id).val(date);
laydate.render({
elem: '#c_time', range: '~'
});
});
});
-144
View File
@@ -1,144 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>东风EV</title>
<link rel="stylesheet" href="/static/css/login.css">
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/jquery.3.4.1.min.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vue.2.6.10.min.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/mDialog.js"></script>
</head>
<body>
<div id="app" class="login relative">
<div class="absolute login-con">
<div class="inpu-bg">
<input class="wp100 int-sty font-16" type="tel" v-model="telPhone" placeholder="请输入手机号" />
</div>
<div class="mt20 inpu-bg pr120 relative">
<input class="wp100 int-sty font-16" type="number" v-model="vCode" placeholder="请输入验证码" />
<button class="absolute right-0 box-middle mr15 bg-none border-none font-16 color-00e9ff" :disabled="!codeState" @click="getcode()">{{codeTx}}</button>
</div>
<button class="mt30 lgbtn font-36 color-00e9ff" @click="submit()"> </button>
</div>
</div>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
telPhone:'',
vCode:'',
codeState:true,
codeTx:'获取验证码',
isSubmiting: false,
},
computed: {
},
mounted() {
var Timer;
},
beforeDestroy() {
},
methods: {
countDownTime(time) {
let that = this;
if (time > 1) {
time--;
this.codeState = false;
this.codeTx = time + "s后重新获取";
Timer = setTimeout(function() {
that.countDownTime(time);
}, 1000)
} else {
clearTimeout(Timer);
that.codeState = true;
that.codeTx = "获取验证码";
}
},
getcode() {
var that = this
if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
//alert('请输入正确手机号')
mDialog.msg({
duration: 250,
pause: 2000,
content: "请输入正确手机号"
});
} else {
$.ajax({
'url': '/login/get_code',
'method': 'post',
'type': 'json',
'data': {mobile: this.telPhone},
success: function (data) {
//按钮倒计时
mDialog.msg({
duration: 250,
pause: 2000,
content: data.msg
});
if(data.code){
that.countDownTime(61)
}
}
})
}
},
submit() {
if (this.isSubmiting) return;
if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
mDialog.msg({
duration: 250,
pause: 2000,
content: "请输入正确手机号"
});
}else if (!this.vCode) {
mDialog.msg({
duration: 250,
pause: 2000,
content: "请输入验证码"
});
}else{
this.isSubmiting = true
var that = this;
$.ajax({
'url': '/login/post',
'method': 'post',
'type': 'json',
'data': {'mobile': this.telPhone,'code':that.vCode,'need_code':'login'},
success: function (data) {
if(data.code){
window.location.href = '/';
}else{
mDialog.msg({
duration: 250,
pause: 2000,
content: data.msg
});
}
that.isSubmiting = false;
}
})
}
},
},
})
</script>
</body>
</html>
+14 -1
View File
@@ -197,7 +197,20 @@
<td><?= $v['name'] ?></td>
<td><?= $v['mobile_sub'] ?></td>
<td><?= $v['cf_title'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><? if ($v['cf_id'] == 36 || $v['cf_id'] == 37) { ?>
<input type="hidden" class="clues-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>"
checked>
<select data-update-group="" data-list-target=".clues-id-<?= $v['id'] ?>"
data-action="/receiver/clues/batch" data-field=""
style="height: 26px;width: 100px;">
<? foreach ($maintainAry as $key => $val) { ?>
<option value="<?= $key ?>" <?= $key == $v['status'] . '-' . $v['status2'] ? 'selected' : '' ?>><?= $val ?></option>
<? } ?>
</select>
<? } else { ?>
<?= $v['status_name'] ?>
<? } ?>
</td>
<td><?= $v['admin_name'] ?></td>
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
<td><?= $v['en_time'] ?></td>
+21 -5
View File
@@ -60,9 +60,13 @@
<tr>
<td class="table-td"><span class="mr5">客户来源:</span>{{info.of_title}}</td>
<td class="table-td"><span class="mr5">企微好友:</span>{{info.wxqy_name}}</td>
<td class="table-td">
<template v-if="info.cf_user"><span class="mr5">分销来源:</span>{{info.cf_user}}</template>
</td>
<td class="table-td"><span class="mr5">客户等级:</span>{{info.level}}</td>
</tr>
<tr v-if="info.to_send || info.cf_user">
<td class="table-td" v-if="info.to_send"><span class="mr5">改派:</span>{{info.to_send}}</td>
<td class="table-td" v-if="info.cf_user"><span class="mr5">分销来源:</span>{{info.cf_user}}</td>
<td class="table-td" v-if="info.to_send && info.cf_user"></td>
<td class="table-td" v-else colspan="2"></td>
</tr>
<tr>
<td>
@@ -122,12 +126,24 @@
<span href="javascript:void(0)" style="font-size: 20px">
用户画像
</span>
<span style="float:right;margin-top:5px;">
<span style="float:right;margin-top:5px;" v-if="info.biz_type!=5">
<a href="javascript:" @click="editType(3)"><i class="fa fa-edit"></i></a>
</span>
</div>
<div class="am-panel-bd am-g">
<table width="100%" style="margin-left: 10px;margin-right: 10px;">
<table v-if="info.biz_type==5" width="100%" style="margin-left: 10px;margin-right: 10px;">
<tr template v-for="(v,i) in info.tag_group">
<td class="table-td" style="width: 80%">
{{v.name}}:
<template v-for="(v2,i2) in v.tag">
<button class="am-btn am-btn-sm am-btn-default ml5">
{{v2}}
</button>
</template>
</td>
</tr>
</table>
<table v-else width="100%" style="margin-left: 10px;margin-right: 10px;">
<template v-for="(v,i) in info.tag">
<tr>
<td class="table-td" style="width: 80%">
+56 -11
View File
@@ -22,7 +22,7 @@
<input type="hidden" id="id_tag" name="tag" value="<?= $params['tag'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<label class="am-para-label w80">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp" v-model="params.search_tp">
<option :value="i" v-for="(v,i) in searchTpAry">{{v}}</option>
@@ -35,7 +35,7 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">客户等级:</label>
<label class="am-para-label w80">客户等级:</label>
<div class="am-para-inline w100">
<select name="level" v-model="params.level">
<option value=''>请选择</option>
@@ -44,7 +44,7 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">渠道经理:</label>
<label class="am-para-label w80">渠道经理:</label>
<div class="am-para-inline w100">
<select name="qdjl_id" v-model="params.qdjl_id">
<option value=''>请选择</option>
@@ -53,7 +53,7 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">企微好友:</label>
<label class="am-para-label w80">企微好友:</label>
<div class="am-para-inline w100">
<select name="wxqy" v-model="params.wxqy">
<option value=''>请选择</option>
@@ -63,7 +63,7 @@
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">客户来源:</label>
<label class="am-para-label w80">客户来源:</label>
<div class="am-form-group am-para-inline w120">
<select name="of_id" v-model="params.of_id">
<option value="">请选择</option>
@@ -78,20 +78,29 @@
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">销售员</label>
<div class="am-para-inline w120">
<label class="am-para-label w90">门店类型</label>
<div class="am-para-inline w100">
<select name="biz_type" v-model="params.biz_type">
<option value="">请选择</option>
<option :value="v.id" v-for="(v,i) in bizTypeAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">销售员:</label>
<div class="am-para-inline w100">
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<div class="am-para-inline w100">
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w160">
<div class="am-para-inline w180">
<select name="biz_id_admin" v-model="params.biz_id_admin">
<option value="">门店</option>
<template v-for="(v,i) in admins.bizAry">
@@ -99,7 +108,7 @@
</template>
</select>
</div>
<div class="am-para-inline w120">
<div class="am-para-inline w100">
<select name="admin_id" v-model="params.admin_id">
<option value="">销售员</option>
<template v-for="(v,i) in admins.list">
@@ -140,6 +149,9 @@
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10" v-if="export_button==1">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="export_out">导出</button>
</div>
</div>
</div>
</form>
@@ -273,6 +285,8 @@
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
show_info: {levelAry: [], offlineSourcesAry: [], wxqyAry: []},
of2Ary: [],
bizTypeAry: [],
export_button: 0,
},
mounted: function () {
var vm = this;
@@ -281,9 +295,25 @@
vm.lists = <?=json_encode($lists)?>;
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.export_button = <?=$export_button?>;
vm.init_citys();
vm.initBizType();
},
methods: {
initBizType: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/biz_type_ary',
dataType: 'json',
data: {},
success: function (response) {
if (response.code == 1) {
vm.bizTypeAry = response.data;
}
}
});
},
btnTimes: function () {
layer.open({
type: 1,
@@ -353,7 +383,22 @@
$('#show-' + id).hide();
});
$("#times_checkbox").prop("checked", false);
}
},
export_out: function () {
var that = this;
if (that.export_button == 0){
layer.msg('无权限导出');
return false;
}
let count = <?=$pager['totle']?>;
if (count == 0) {
layer.msg('没有数据可导出');
return false;
}
let href = $.menu.parseUri(window.location.href);
href = href.replace("customer?", "customer/export?");
window.location.href = href;
},
},
watch: {
'params.of_id': function (nv, ov) {
+9 -81
View File
@@ -77,11 +77,10 @@
v-if="info.bill.business_licence"
@click="save_edit(2)">保存营业执照
</button>
<div id="layer-photos-demo-3" class="layer-photos-demo fl ml10">
<div id="viewer-business_licence" class="fl ml10">
<img v-if="info.bill.business_licence && info.bill.business_licence.src"
:layer-src="info.bill.business_licence.src"
:src="info.bill.business_licence.src" class="w100" alt="营业执照"
@click="show_carimg(3)"
:src="info.bill.business_licence.src" class="w100" alt="营业执照" onclick="showViewer('viewer-business_licence')"
style="height:auto;max-height:32px;max-width:50px;">
</div>
</div>
@@ -157,14 +156,14 @@
v-if="info.bill && (info.bill.cardidA || info.bill.cardidB)"
@click="save_cardID">保存身份证
</button>
<div id="layer-photos-demo-1" class="layer-photos-demo fl ml10">
<img v-if="info.bill && info.bill.cardidA && info.bill.cardidA.src"
<div id="viewer-bill_cardid" class="fl ml10">
<img v-if="info.bill && info.bill.cardidA && info.bill.cardidA.src"
:layer-src="info.bill.cardidA.src"
:src="info.bill.cardidA.src" class="w100" alt="身份证正面" @click="show_carimg(1)"
:src="info.bill.cardidA.src" class="w100" alt="身份证正面" onclick="showViewer('viewer-bill_cardid')"
style="height:auto;max-height:32px;max-width:50px;">
<img v-if="info.bill && info.bill.cardidB && info.bill.cardidB.src"
:layer-src="info.bill.cardidB.src"
:src="info.bill.cardidB.src" class="w100" alt="身份证反面" @click="show_carimg(1)"
:src="info.bill.cardidB.src" class="w100" alt="身份证反面" onclick="showViewer('viewer-bill_cardid')"
style="height:auto;max-height:32px;max-width:50px;margin-left: 5px">
</div>
</div>
@@ -283,10 +282,10 @@
</label>
</div>
<div class="am-form-group" v-if="info.bill && info.bill.file">
<div v-if="info.bill.file_type=='img'" id="layer-photos-demo-2"
class="layer-photos-demo fl ml10">
<div v-if="info.bill.file_type=='img'" id="viewer-bill_file"
class="fl ml10">
<img :layer-src="info.bill.file"
:src="info.bill.file" class="w100" alt="查看发票" @click="show_carimg(2)"
:src="info.bill.file" class="w100" alt="发票" onclick="showViewer('viewer-bill_file')"
style="height:auto;max-height:32px;max-width:50px;margin-left: 5px">
</div>
<a v-else :href="info.bill.file" target="_blank" class="mt5"
@@ -612,18 +611,6 @@
});
});
},
show_carimg: function (type) {
layer.photos({
photos: '#layer-photos-demo-' + type,
anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
tab: function () {
xz_num = 0;
$("#layui-layer-photos").parent().append('<div style="position:relative;width:100%;text-align:center;cursor:pointer;">\n' +
'\t\t<img id="' + xz_name + '" src="/img/xuanzhuan.png" style="width:30px;height:30px;">\n' +
'\t</div>');
}
});
},
//保存身份证
save_cardID: function () {
var that = this;
@@ -681,65 +668,6 @@
}
});
});
//旋转图片
$(document).on("click", "#" + xz_name, function (e) {
console.log("xz_num=" + xz_num);
xz_num = (xz_num + 90) % 360;
$(".layui-layer.layui-layer-page.layui-layer-photos").css('background', 'black');//旋转之后背景色设置为黑色,不然在旋转长方形图片时会留下白色空白
$("#layui-layer-photos").css('transform', 'rotate(' + xz_num + 'deg)');
});
//图片放大缩小
$(document).on("mousewheel DOMMouseScroll", ".layui-layer-phimg", function (e) {
var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
(e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox
var imagep = $(".layui-layer-phimg").parent().parent();
var image = $(".layui-layer-phimg").parent();
var h = image.height();
var w = image.width();
var img_url = $("#imglayer").attr("src");
// 创建对象
var img = new Image();
// 改变图片的src
img.src = img_url;
var width = img.width;
var height = img.height;
debugger;
if (delta > 0) {
if (h < (window.innerHeight)) {
h = h * 1.05;
w = w * 1.05;
width = width * 1.05;
height = height * 1.05;
}
} else if (delta < 0) {
if (h > 100) {
h = h * 0.95;
w = w * 0.95;
width = width * 0.95;
height = height * 0.95;
}
}
imagep.css("top", (window.innerHeight - h) / 2);
imagep.css("left", (window.innerWidth - w) / 2);
image.height(h);
image.width(w);
imagep.height(h);
imagep.width(w);
var current = $("#current").val();
if ((current / 90) % 2 == 1) {
$('#imglayer').css("width", h);
$('#imglayer').css("margin-top", -(w - h) / 2);
if (height < width) {
$('#imglayer').css("margin-left", (w - h) / 2);
}
} else {
$('#imglayer').css("width", w);
$('#imglayer').css("margin-top", 0);
if (height < width) {
$('#imglayer').css("margin-left", 0);
}
}
});
</script>
<style type="text/css">
.span-bold {
@@ -0,0 +1,16 @@
<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/edit_price" data-auto="true" method="post"
style="width: 90%;padding-top: 10px">
<div class="am-form-group">
<label class="am-para-label">优惠金额:</label>
<div class="am-para-input">
<input type="text" value="<?=$price_discount?>" name="price_discount"/>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<input type="hidden" name="id" value="<?=$id?>">
<button class="am-btn am-btn-secondary" type="submit">确定</button>
</div>
</div>
</form>
+22
View File
@@ -0,0 +1,22 @@
<form class="am-form am-form-horizontal" action="/receiver/orderv2/orders/edit_srv" data-auto="true" method="post"
style="width: 90%;padding-top: 10px">
<? foreach ($srv_info as $key=>$value) {?>
<div class="am-form-group">
<input type="hidden" value="<?=$value['id']?>" name="money[<?=$key?>][id]"/>
<input type="hidden" value="<?=$value['key']?>" name="money[<?=$key?>][key]"/>
<label class="am-para-label">
<input type="checkbox" name="money[<?=$key?>][checkbox]" <?=$value['checked']?> value="1">
<?=$value['title']?>
</label>
<div class="am-para-input">
<input type="text" value="<?=$value['money']?>" name="money[<?=$key?>][price]" <?=$value['key']=='price_insure' ? 'readonly' : ''?>/>
</div>
</div>
<?}?>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<input type="hidden" name="id" value="<?=$id?>">
<button class="am-btn am-btn-secondary" type="submit">确定</button>
</div>
</div>
</form>
@@ -45,13 +45,14 @@
src=""/>
</div>
</div>
<!--
<div class="am-form-group">
<label class="am-para-label">支付时间:</label>
<div class="am-para-input">
<input type="text" value="" id="pay_time" name="pay_time" autocomplete="off">
</div>
</div>
-->
<div class="am-form-group">
<label class="am-para-label">备注:</label>
+319 -155
View File
@@ -11,15 +11,15 @@
<label class="am-para-label label-width"><span class="span-bold">车牌号:</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="text" name="car_num" v-model="info.agent.car_num">
<input type="text" name="car_num" v-model="info['agent']['car_num']">
</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">险公司:</span></label>
<label class="am-para-label label-width"><span class="span-bold">强制险公司:</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="text" name="company" v-model="info.agent.company">
<input type="text" name="insurance_product" v-model="info.agent.insurance_product">
</label>
</div>
</div>
@@ -31,8 +31,13 @@
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">保险到期时间:</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="text" name="ins_time" id="ins_time" value="<?= $info['agent']['ins_time'] ?>">
<label class="am-para-label" style="width: 90%;text-align: left">
<? if ($info['agent']['business_time']) { ?>
<?= $info['agent']['business_time'] ?>
<? } else { ?>
<input type="text" name="ins_time" id="ins_time"
value="<?= $info['agent']['ins_time'] ?>">
<? } ?>
</label>
</div>
</div>
@@ -40,7 +45,7 @@
<label class="am-para-label label-width"><span class="span-bold">交强险费用:</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="text" name="ins_risk" v-model="info.agent.ins_risk"></label>
<input type="number" name="insurance_price" v-model="info.agent.insurance_price"></label>
</div>
</div>
</div>
@@ -50,14 +55,19 @@
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">商业险费用</span></label>
<label class="am-para-label label-width"><span class="span-bold">商业险公司</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="text" name="business_risk" v-model="info.agent.business_risk"></label>
<input type="text" name="business_product" v-model="info.agent.business_product"></label>
</div>
</div>
<div class="am-form-inline am-u-lg-6">
<div class="am-form-group am-u-lg-6" style="margin-top: 15px;">
<label class="am-para-label label-width"><span class="span-bold">商业险费用:</span></label>
<div class="am-para-input">
<label class="am-para-label" style="width: 50%">
<input type="number" name="business_price" v-model="info.agent.business_price"></label>
</div>
<div class="">
<input type="hidden" name="oid" v-model="info.id">
<a href='javascript:;' class='am-btn am-btn-primary am-btn-xs' @click="save_agent">
保存
@@ -67,242 +77,376 @@
</div>
</form>
</div>
<div class="am-form-group clearfix" >
<div class="am-form-group clearfix">
<div class="" v-if="info.main_type==1">
<p class="am-text-default mb10 ml30 pt15 pb10">
营业执照:
</p>
<ul class="photopic-list ml30 clearfix">
<?if($info['imgs_status']['business_licence']['imgs'][0]){?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-21">
<img src="<?=$info['imgs_status']['business_licence']['imgs'][0]?>" @click="show_carimg(21)"/>
<ul id="viewer-business_licence" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['business_licence']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','business_licence','')">x
</div>
<a target="_blank" class="pic">
<img alt="营业执照" onclick="showViewer('viewer-business_licence')"
src="<?= $info['imgs_status']['business_licence']['imgs'][0] ?>"/>
</a>
<div class="f12 tc"></div>
</li>
<?}else{?>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="business_licence" data-mark="compalbum">
<input type="hidden" class="" name="business_licence" data-type="1" value="" onchange="upImg('business_licence',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
<input type="hidden" class="" name="business_licence" data-type="1" value=""
onchange="upImg('business_licence',this)">
<div></div>
</a>
<div class="tc f12"></div>
</li>
<?}?>
<? } ?>
</ul>
</div>
<div class="" v-else>
<p class="am-text-default mb10 ml30 pt15 pb10">
身份证:
<!--
<?if($info['imgs_status']['cardida']['status']==0 && $info['imgs_status']['cardida']['imgs']){?>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="1" data-params-type="1" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-primary">审核通过</button>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="0" data-params-type="1" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-danger">审核不通过</button>
<?}?>
-->
</p>
<ul class="photopic-list ml30 clearfix">
<?if($info['imgs_status']['cardida']['imgs'][0]){?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-21">
<img src="<?=$info['imgs_status']['cardida']['imgs'][0]?>" @click="show_carimg(21)"/>
<ul id="viewer-cardida" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['cardida']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','cardida','')">x
</div>
<a target="_blank" class="pic">
<img alt="身份证正面" onclick="showViewer('viewer-cardida')"
src="<?= $info['imgs_status']['cardida']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">身份证正面</div>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['cardida']['status_cls']?>"><?=$info['imgs_status']['cardida']['status_cn']?></span>
</div>
-->
</li>
<?}else{?>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cardida" data-mark="compalbum">
<input type="hidden" class="cardida" name="cardida" data-type="1" value="" onchange="upImg('cardida',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
<input type="hidden" class="cardida" name="cardida" data-type="1" value=""
onchange="upImg('cardida',this)">
<div></div>
</a>
<div class="tc f12">身份证正面</div>
</li>
<?}?>
<?if($info['imgs_status']['cardida']['imgs'][1]){?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-22">
<img src="<?=$info['imgs_status']['cardida']['imgs'][1]?>" @click="show_carimg(22)"/>
<? } ?>
<? if ($info['imgs_status']['cardida']['imgs'][1]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','cardidb','')">x
</div>
<a target="_blank" class="pic">
<img alt="身份证反面" onclick="showViewer('viewer-cardida')"
src="<?= $info['imgs_status']['cardida']['imgs'][1] ?>"/>
</a>
<div class="f12 tc">身份证反面</div>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['cardida']['status_cls']?>"><?=$info['imgs_status']['cardida']['status_cn']?></span>
</div>
-->
</li>
<?}else{?>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="cardidb" data-mark="compalbum">
<input type="hidden" class="cardidb" name="cardidb" data-type="1" value="" onchange="upImg('cardidb',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
<input type="hidden" class="cardidb" name="cardidb" data-type="1" value=""
onchange="upImg('cardidb',this)">
<div></div>
</a>
<div class="tc f12">身份证反面</div>
</li>
<?}?>
<? } ?>
</ul>
</div>
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">国补资料:</p>
<ul class="photopic-list ml30 clearfix">
<?if($info['imgs_status']['register_img']['imgs'][0]){?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-31">
<img src="<?=$info['imgs_status']['register_img']['imgs'][0]?>" @click="show_carimg(31)"/>
<ul id="viewer-register_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['register_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','register_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="登记证" onclick="showViewer('viewer-register_img')"
src="<?= $info['imgs_status']['register_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">登记证</div>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['register_img']['status_cls']?>"><?=$info['imgs_status']['register_img']['status_cn']?></span>
</div>
<?if($info['imgs_status']['register_img']['status']==0){?>
<div class="mt20">
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="1" data-params-type="2" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-primary">审核通过</button>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="0" data-params-type="2" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-danger">审核不通过</button>
</div>
<?}?>
-->
</li>
<?}else{?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="register_img" data-mark="compalbum">
<input type="hidden" class="register_img" name="register_img" data-type="1" value="" onchange="upImg('register_img',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
</a>
<div class="tc f12">登记证</div>
</li>
<?}?>
<?if($info['imgs_status']['car_img']['imgs'][0]){?>
<? } else { ?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-32">
<img src="<?=$info['imgs_status']['car_img']['imgs'][0]?>" @click="show_carimg(32)"/>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="register_img" data-mark="compalbum">
<input type="hidden" class="register_img" name="register_img" data-type="1" value=""
onchange="upImg('register_img',this)">
<div></div>
</a>
<div class="tc f12">登记证</div>
</li>
<? } ?>
<? if ($info['imgs_status']['car_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','car_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="行驶证" onclick="showViewer('viewer-register_img')"
src="<?= $info['imgs_status']['car_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">行驶证</div>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['car_img']['status_cls']?>"><?=$info['imgs_status']['car_img']['status_cn']?></span>
</div>
<?if($info['imgs_status']['car_img']['status']==0){?>
<div class="mt20">
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="1" data-params-type="3" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-primary">审核通过</button>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="0" data-params-type="3" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-danger">审核不通过</button>
</div>
<?}?>
-->
</li>
<?}else{?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="car_img" data-mark="compalbum">
<input type="hidden" class="car_img" name="car_img" data-type="1" value="" onchange="upImg('car_img',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
</a>
<div class="tc f12">行驶证</div>
</li>
<?}?>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="car_img" data-mark="compalbum">
<input type="hidden" class="car_img" name="car_img" data-type="1" value=""
onchange="upImg('car_img',this)">
<div></div>
</a>
<div class="tc f12">行驶证</div>
</li>
<? } ?>
</ul>
</div>
<div class="am-form-group clearfix" >
<div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
保单:
<!--
<?if($info['imgs_status']['ins_img']['status']==0 && $info['imgs_status']['ins_img']['imgs']){?>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="1" data-params-type="4" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-primary">审核通过</button>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="0" data-params-type="4" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-danger">审核不通过</button>
<?}?>
-->
</p>
<ul class="photopic-list ml30 clearfix">
<?if($info['imgs_status']['ins_img']['imgs']){?>
<? foreach ($info['imgs_status']['ins_img']['imgs'] as $key=>$val) {?>
<li>
<?if(strpos($val,'.pdf') !== false){?>
<a href="<?=$val?>" target="_blank" class="pic">
<ul id="viewer-insurance_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['insurance_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','insurance_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="交强险" onclick="showViewer('viewer-insurance_img')"
src="<?= $info['imgs_status']['insurance_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">交强险</div>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="insurance_img" data-mark="compalbum">
<input type="hidden" class="insurance_img" name="insurance_img" data-type="1" value=""
onchange="upImg('insurance_img',this)">
<div></div>
</a>
<div class="tc f12">交强险</div>
</li>
<? } ?>
<? if ($info['imgs_status']['business_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','business_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="商业险" onclick="showViewer('viewer-insurance_img')"
src="<?= $info['imgs_status']['business_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">商业险</div>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="business_img" data-mark="compalbum">
<input type="hidden" class="business_img" name="business_img" data-type="1" value=""
onchange="upImg('business_img',this)">
<div></div>
</a>
<div class="tc f12">商业险</div>
</li>
<? } ?>
</ul>
</div>
</div>
<div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
其它保单:
</p>
<ul id="viewer-ins_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['ins_img']['imgs']) { ?>
<? foreach ($info['imgs_status']['ins_img']['imgs'] as $key => $val) { ?>
<li style="position:relative;">
<? if (strpos($val, '.pdf') !== false) { ?>
<a href="<?= $val ?>" target="_blank" class="pic">
</a>
<?}else{?>
<a target="_blank" class="pic" id="layer-photos-demo-4<?=$key?>">
<img src="<?=$val?>" @click="show_carimg(4<?=$key?>)"/>
<? } else { ?>
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','ins_img','<?= $val ?>')">x
</div>
<a target="_blank" class="pic">
<img alt="其它保单<?= $key + 1 ?>" onclick="showViewer('viewer-ins_img')"
src="<?= $val ?>"/>
</a>
<?}?>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['ins_img']['status_cls']?>"><?=$info['imgs_status']['ins_img']['status_cn']?></span>
</div>
-->
<? } ?>
</li>
<?}?>
<?}?>
<? } ?>
<? } ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-mark="file" data-type="jpg,png,gif,png,jpeg,pdf"
<a href="javascript:void(0);" class="pic" data-file="1" data-mark="file"
data-type="jpg,png,gif,png,jpeg,pdf"
data-uptype="qiniu" data-field="ins_img">
<input type="hidden" class="ins_img" name="ins_img" data-type="1" value="" onchange="upImg('ins_img',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
<input type="hidden" class="ins_img" name="ins_img" data-type="1" value=""
onchange="upImg('ins_img',this)">
<div></div>
</a>
</li>
</ul>
</div>
</div>
<div class="am-form-group clearfix" >
<div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
交车合照:
<!--
<?if($info['imgs_status']['other_img']['status']==0 && $info['imgs_status']['other_img']['imgs']){?>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="1" data-params-type="5" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-primary">审核通过</button>
<button data-ajax="post" data-action="/receiver/orderv2/orders/edit_ckimg" data-params-ifcheck="0" data-params-type="5" data-params-id="<?=$info['id']?>" class="am-btn am-btn-xs am-btn-danger">审核不通过</button>
<?}?>
-->
</p>
<ul class="photopic-list ml30 clearfix">
<?if($info['imgs_status']['other_img']['imgs']){?>
<? foreach ($info['imgs_status']['other_img']['imgs'] as $key=>$val) {?>
<li>
<a target="_blank" class="pic" id="layer-photos-demo-5<?=$key?>">
<img src="<?=$val?>" @click="show_carimg(5<?=$key?>)"/>
</a>
<!--
<div class="f16">审核结果:
<span class="am-text-<?=$info['imgs_status']['other_img']['status_cls']?>"><?=$info['imgs_status']['other_img']['status_cn']?></span>
<ul id="viewer-other_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['other_img']['imgs']) { ?>
<? foreach ($info['imgs_status']['other_img']['imgs'] as $key => $val) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','other_img','<?= $val ?>')">x
</div>
-->
<a target="_blank" class="pic">
<img alt="交车合照<?= $key + 1 ?>" onclick="showViewer('viewer-other_img')"
src="<?= $val ?>"/>
</a>
</li>
<?}?>
<?}?>
<? } ?>
<? } ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="other_img" data-mark="compalbum">
<input type="hidden" class="other_img" name="other_img" data-type="1" value="" onchange="upImg('other_img',this)">
<img src="/static/images/webuploader/add_img_pic.png" />
<input type="hidden" class="other_img" name="other_img" data-type="1" value=""
onchange="upImg('other_img',this)">
<div></div>
</a>
</li>
</ul>
</div>
</div>
<div class="am-form-group clearfix">
<p class="am-text-default mb10 ml30 pt15 pb10">新车交付确认书:</p>
<ul id="viewer-delivery_ck_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['delivery_ck_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','delivery_ck_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="新车交付确认书" onclick="showViewer('viewer-delivery_ck_img')" src="<?= $info['imgs_status']['delivery_ck_img']['imgs'][0] ?>"/>
</a>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="delivery_ck_img" data-mark="compalbum">
<input type="hidden" class="delivery_ck_img" name="delivery_ck_img" data-type="1" value=""
onchange="upImg('delivery_ck_img',this)">
<div></div>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="am-form-group clearfix">
<div class="">
<p class="am-text-default mb10 ml30 pt15 pb10">
交付信息:
</p>
<ul id="viewer-wx_img" class="photopic-list ml30 clearfix">
<? if ($info['imgs_status']['wx_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','wx_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="企业微" onclick="showViewer('viewer-wx_img')"
src="<?= $info['imgs_status']['wx_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">企业微</div>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="wx_img" data-mark="compalbum">
<input type="hidden" class="wx_img" name="wx_img" data-type="1" value=""
onchange="upImg('wx_img',this)">
<div></div>
</a>
<div class="tc f12">企业微</div>
</li>
<? } ?>
<? if ($info['imgs_status']['mut_wx_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','mut_wx_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="企业微多对一" onclick="showViewer('viewer-wx_img')"
src="<?= $info['imgs_status']['mut_wx_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">企业微多对一</div>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="mut_wx_img" data-mark="compalbum">
<input type="hidden" class="mut_wx_img" name="mut_wx_img" data-type="1" value=""
onchange="upImg('mut_wx_img',this)">
<div></div>
</a>
<div class="tc f12">企业微多对一</div>
</li>
<? } ?>
<? if ($info['imgs_status']['destory_img']['imgs'][0]) { ?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('data','destory_img','')">x
</div>
<a target="_blank" class="pic">
<img alt="实名认证资料" onclick="showViewer('viewer-wx_img')"
src="<?= $info['imgs_status']['destory_img']['imgs'][0] ?>"/>
</a>
<div class="f12 tc">实名认证资料</div>
</li>
<? } else { ?>
<li>
<a href="javascript:void(0);" class="pic" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="destory_img" data-mark="compalbum">
<input type="hidden" class="destory_img" name="destory_img" data-type="1" value=""
onchange="upImg('destory_img',this)">
<div></div>
</a>
<div class="tc f12">实名认证资料</div>
</li>
<? } ?>
</ul>
</div>
</div>
</div>
</div>
<script>
function upImg(field,obj) {
function upImg(field, obj) {
var value;
if(field=='ins_img' || field=='other_img'){
if (field == 'ins_img' || field == 'other_img') {
value = $(obj).val();
}else{
} else {
value = $(obj).val();
}
var loading = layer.msg('图片上传中..', {
icon: 16
, shade: 0.3
, time: false
});
$.post("/receiver/orderv2/orders/edit_imgs", {
'id': <?=$info['id']?>,
'filed': field,
'value': value,
}, function (data) {
layer.closeAll()
if (data.code) {
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
@@ -312,4 +456,24 @@
}
}, 'json');
}
</script>
function del_img(type, field, value) {
layer.confirm('您确定要删除?', {icon: 3, title: '提示'}, function (index) {
layer.close(index);
$.post("/receiver/orderv2/orders/del_img", {
'id': <?=$info['id']?>,
'type': type,
'field': field,
'value': value,
}, function (data) {
if (data.code) {
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
}, 'json');
});
}
</script>
+131 -118
View File
@@ -62,34 +62,42 @@
background-color: #eee;
opacity: 1;
}
.hidden{
.hidden {
display: none;
}
.photopic-list li{
.photopic-list li {
float: left;
margin-right:20px ;
margin-right: 20px;
}
.photopic-list .pic{
.photopic-list .pic {
width: 150px;
height: 150px;
line-height: 150px;
border: 1px solid #e5e5e5;
overflow: hidden;
display: block;
margin:5px 0 10px;
padding:0;
margin: 5px 0 10px;
padding: 0;
font-size: 0;
text-align: center;
}
.photopic-list .pic img{
.photopic-list .pic img {
max-width: 100%;
max-height: 100%;
border:none;
padding:0 ;
border: none;
padding: 0;
display: inline-block;
vertical-align: middle;
}
.photopic-list .pic div {
background: url(/static/images/webuploader/add_img_pic.png) center no-repeat;
height: 100%;
}
</style>
<div id="vue-edit" class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div class="am-u-lg-12">
@@ -109,14 +117,12 @@
<label class="am-para-label-con">{{info.c_time}}</label>
</div>
</div>
<!--
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">订单状态:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.sign_status_name}}</label>
<label class="am-para-label-con">{{info.status_name}}</label>
</div>
</div>
-->
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">客户来源:</span></label>
<div class="am-para-input">
@@ -135,20 +141,6 @@
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户姓名:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户手机号:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.mobile}}</label>
</div>
</div>
</div>
<!--车主信息-->
<template v-if="info.main_type==1"> <!--公司-->
<div class="am-form-inline">
@@ -166,7 +158,34 @@
</div>
</div>
</template>
<template v-else> <!--个人-->
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户姓名:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.name}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户手机号:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.mobile}}</label>
</div>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">客户身份证:</span></label>
<div class="am-para-input">
<label class="am-para-label-con">{{info.cardid}}</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">&nbsp;</span></label>
<div class="am-para-input">
</div>
</div>
</div>
<template v-if="info.main_type!=1"> <!--个人-->
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">车主姓名:</span></label>
@@ -214,20 +233,29 @@
<label class="am-para-label label-width"><span class="span-bold">合同信息:</span></label>
<div class="am-form am-form-inline" v-if="info.contract_data">
<div class="am-form-group" v-if="info.contract_data[0]">
<a :href="info.contract_data[0]['src']" target="_blank" class="am-btn am-btn-default am-btn-sm">
<a :href="info.contract_data[0]['src']" target="_blank"
class="am-btn am-btn-default am-btn-sm">
汽车购车协议
</a><br>
</div>
<div class="am-form-group ml10" v-if="info.contract_data[1]">
<a :href="info.contract_data[1]['src']" target="_blank" class="am-btn am-btn-default am-btn-sm">
<a :href="info.contract_data[1]['src']" target="_blank"
class="am-btn am-btn-default am-btn-sm">
委托服务协议
</a><br>
</div>
<div class="am-form-group ml10" v-if="info.contract_data[3]">
<a :href="info.contract_data[3]['src']" target="_blank" class="am-btn am-btn-default am-btn-sm">
<a :href="info.contract_data[3]['src']" target="_blank"
class="am-btn am-btn-default am-btn-sm">
车辆交付
</a><br>
</div>
<div class="am-form-group" v-if="info.contract_data[0]">
<a :href="'/receiver/orderv2/orders/get_down?id='+info.id" target="_blank"
class="am-btn am-btn-primary am-btn-sm">
下载汽车购车协议
</a><br>
</div>
</div>
</div>
</div>
@@ -242,7 +270,8 @@
</div>
<div class="am-panel-bd am-g" style="margin-top: 10px;margin-bottom: 10px;">
<div class="am-form-inline">
<div class="am-form-group am-u-lg-12" style="margin-bottom:15px;" v-if="info.bill && info.bill.warning">
<div class="am-form-group am-u-lg-12" style="margin-bottom:15px;"
v-if="info.bill && info.bill.warning">
<span class="ml70 f18" v-html="info.bill.warning"></span>
</div>
<div class="am-form-group am-u-lg-12">
@@ -261,17 +290,19 @@
</div>
-->
<div class="am-form-group">
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1" data-type="jpg,png,gif,png,jpeg"
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm" data-file="1"
data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="bill_file">
<input type="hidden" class="bill_file" name="bill_file" data-type="1" value="" onchange="upBill(this)">
<input type="hidden" class="bill_file" name="bill_file" data-type="1" value=""
onchange="upBill(this)">
<i class="am-icon-cloud-upload"></i> 选择要上传的文件
</a>
</div>
<div class="am-form-group" v-if="info.bill && info.bill.file">
<div v-if="info.bill.file_type=='img'" id="layer-photos-demo-1"
class="layer-photos-demo fl ml10">
<img :layer-src="info.bill.file"
:src="info.bill.file" class="w100" alt="查看发票" @click="show_carimg(1)"
<div v-if="info.bill.file_type=='img'" class="fl ml10">
<img id="viewer-bill_file_img" :layer-src="info.bill.file"
:src="info.bill.file" class="w100" alt="发票"
onclick="showViewer('viewer-bill_file_img')"
style="height:auto;max-height:32px;max-width:50px;margin-left: 5px">
</div>
<a v-else :href="info.bill.file" target="_blank" class="mt5"
@@ -287,13 +318,42 @@
<span class='am-btn am-btn-default am-active am-btn-xs' v-else>已确认开票</span>
</template>
<a class='am-btn am-btn-default am-btn-xs'
data-modal="/receiver/orderv2/orders/get_paylog?id=<?= $info['id'] ?>" data-title="收款记录">
data-modal="/receiver/orderv2/orders/get_paylog?id=<?= $info['id'] ?>"
data-title="收款记录">
收款记录
</a>
</div>
</div>
</div>
</div>
<div class="am-form-group am-u-lg-12">
<label class="am-para-label label-width">合格证:</label>
<div class="am-para-input">
<a href="javascript:void(0);" data-file="1" data-type="jpg,png,gif,png,jpeg"
data-uptype="qiniu" data-field="bill_img_file" class="am-btn am-btn-default am-btn-sm">
<input type="hidden" name="bill_img_file" data-type="1" value=""
onchange="edit_bill_img(this)">
<i class="am-icon-cloud-upload"></i>上传图片
</a>
<a href="javascript:void(0);" class="am-btn am-btn-default am-btn-sm"
data-file="1" data-mark="file" data-type="pdf"
data-uptype="qiniu" data-field="bill_pdf_file">
<input type="hidden" name="bill_pdf_file" data-type="1" value=""
onchange="edit_bill_img(this)">
<i class="am-icon-cloud-upload"></i>上传pdf
</a>
<ul id="viewer-bill_ck_img" class="photopic-list clearfix mt10"
v-if="info.bill && info.bill.bill_ck_img">
<li v-for="(item,key) in info.bill.bill_ck_img">
<a target="_blank" class="pic">
<img :src="item" :alt="'合格证'+(key+1)"
onclick="showViewer('viewer-bill_ck_img')"/>
</a>
<div class="f12 tc"></div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
@@ -324,7 +384,7 @@
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: [],
info: <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>,
carslist: [],
page: [],
bx_imgs: [],
@@ -344,7 +404,6 @@
},
mounted: function () {
var that = this;
that.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
that.brand_id = <?=$info['brand_id']?>,
that.s_id = <?=$info['s_id']?>,
that.v_id = <?=$info['v_id']?>,
@@ -475,7 +534,10 @@
// }
this.info.loan_info.loan_time = loan_time;
}
$.post("/receiver/orderv2/orders/edit_loan", {'info': this.info, 'status': status}, function (data) {
$.post("/receiver/orderv2/orders/edit_loan", {
'info': this.info,
'status': status
}, function (data) {
console.dir(data);
if (data.code) {
layer.msg(data.msg, function () {
@@ -525,18 +587,6 @@
})
},
show_carimg: function (type) {
layer.photos({
photos: '#layer-photos-demo-' + type,
anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
tab: function () {
xz_num = 0;
$("#layui-layer-photos").parent().append('<div style="position:relative;width:100%;text-align:center;cursor:pointer;">\n' +
'\t\t<img id="' + xz_name + '" src="/img/xuanzhuan.png" style="width:30px;height:30px;">\n' +
'\t</div>');
}
});
},
//保存身份证
save_cardID: function () {
var that = this;
@@ -577,10 +627,10 @@
}
}, 'json');
},
cancelItem:function(){
cancelItem: function () {
var that = this;
layer.confirm('你确定取消分配吗?', {icon: 3, title:'提示'}, function(index){
$.post("/receiver/orderv2/orders/edit_ckcar", {id:that.info.id}, function (data) {
layer.confirm('你确定取消分配吗?', {icon: 3, title: '提示'}, function (index) {
$.post("/receiver/orderv2/orders/edit_ckcar", {id: that.info.id}, function (data) {
if (data.code) {
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
@@ -606,71 +656,12 @@
}
});
});
//旋转图片
$(document).on("click", "#" + xz_name, function (e) {
console.log("xz_num=" + xz_num);
xz_num = (xz_num + 90) % 360;
$(".layui-layer.layui-layer-page.layui-layer-photos").css('background', 'black');//旋转之后背景色设置为黑色,不然在旋转长方形图片时会留下白色空白
$("#layui-layer-photos").css('transform', 'rotate(' + xz_num + 'deg)');
});
//图片放大缩小
$(document).on("mousewheel DOMMouseScroll", ".layui-layer-phimg", function (e) {
var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
(e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox
var imagep = $(".layui-layer-phimg").parent().parent();
var image = $(".layui-layer-phimg").parent();
var h = image.height();
var w = image.width();
var img_url = $("#imglayer").attr("src");
// 创建对象
var img = new Image();
// 改变图片的src
img.src = img_url;
var width = img.width;
var height = img.height;
debugger;
if (delta > 0) {
if (h < (window.innerHeight)) {
h = h * 1.05;
w = w * 1.05;
width = width * 1.05;
height = height * 1.05;
}
} else if (delta < 0) {
if (h > 100) {
h = h * 0.95;
w = w * 0.95;
width = width * 0.95;
height = height * 0.95;
}
}
imagep.css("top", (window.innerHeight - h) / 2);
imagep.css("left", (window.innerWidth - w) / 2);
image.height(h);
image.width(w);
imagep.height(h);
imagep.width(w);
var current = $("#current").val();
if ((current / 90) % 2 == 1) {
$('#imglayer').css("width", h);
$('#imglayer').css("margin-top", -(w - h) / 2);
if (height < width) {
$('#imglayer').css("margin-left", (w - h) / 2);
}
} else {
$('#imglayer').css("width", w);
$('#imglayer').css("margin-top", 0);
if (height < width) {
$('#imglayer').css("margin-left", 0);
}
}
});
function upBill(obj) {
var loading = layer.msg('图片识别中..', {
icon: 16
,shade: 0.3
,time: false
, shade: 0.3
, time: false
});
var value = $(obj).val();
var that = this;
@@ -688,4 +679,26 @@
}
}, 'json');
}
</script>
function edit_bill_img(obj) {
var loading = layer.msg('上传中', {
icon: 16
, shade: 0.3
, time: false
});
var value = $(obj).val();
$.post("/receiver/orderv2/orders/edit_bill_img", {
'id': <?=$info['id']?>,
'value': value,
}, function (data) {
layer.closeAll()
if (data.code) {
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
}, 'json');
}
</script>
+142 -44
View File
@@ -21,6 +21,15 @@
<input type="text" v-model="info.loan_info.price_loan">
</label>
</div>
<label class="am-para-label label-width"><span class="span-bold">收款公司:</span></label>
<div class="am-para-input">
<label class="am-para-label w130">
<select v-model="info.loan_info.company_id">
<option value="0">请选择</option>
<option v-for="item in info.companys" :value="item.id">{{item.short}}</option>
</select>
</label>
</div>
</div>
</div>
<div class="am-form-inline">
@@ -32,75 +41,164 @@
</div>
<div class="am-form-group am-u-lg-6">
<?if ($info['loan_info']['status_array'] && in_array(1,$info['loan_info']['status_array'])){?>
<? if ($info['loan_info']['status_array'] && in_array(1, $info['loan_info']['status_array'])) { ?>
<label class="am-para-label label-width"><span class="span-bold">放款时间:</span></label>
<div class="am-para-input">
<label class="am-para-label">
<input type="text" id="loan_time" v-model="info.loan_info.loan_time" autocomplete="off">
</label>
</div>
<?}?>
<? } ?>
</div>
</div>
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<div class="am-form-group am-u-lg-12">
<label class="am-para-label label-width"><span class="span-bold">按揭通知函:</span></label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group">
<label class="input-group-btn" style="width: 50px;"><span
class="am-btn am-btn-default am-btn-sm">
<label class="input-group-btn" style="width: 50px;">
<span class="am-btn am-btn-default am-btn-sm">
<i class="am-icon-cloud-upload"></i> 选择文件
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg" @change="upTz(0,$event)"></span>
</label>
</div>
<div class="am-form-group ml10" v-if="info.loan_info.notify_file">
<a :href="info.loan_info.notify_file" target="_blank" class='mt5' title="查看文件">
{{info.loan_info.notify_file_name}}
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg" @change="upTz(0,$event)">
</span>
</label>
<ul id="viewer-notify_file" class="photopic-list clearfix mt10" v-if="info.loan_info && info.loan_info.notify_file_list">
<? foreach ($info['loan_info']['notify_file_list'] as $key=>$val) {?>
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;" onclick="del_img('load_info','notify_file','<?=$key?>')">x
</div>
<a target="_blank" class="pic">
<img alt="按揭通知函" onclick="showViewer('viewer-notify_file')" src="<?=$val?>"/>
</a>
</div>
<div class="f12 tc"></div>
</li>
<?}?>
</ul>
<!--
<div class="am-form-inline">
<? if (is_img($info['loan_info']['notify_file_name'])) { ?>
<ul id="viewer-notify_file" class="photopic-list ml30 clearfix">
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('load_info','notify_file','')">x
</div>
<a target="_blank" class="pic">
<img alt="按揭通知函" onclick="showViewer('viewer-notify_file')"
:src="info.loan_info.notify_file"/>
</a>
<div class="f12 tc"></div>
</li>
</ul>
<? } else { ?>
<div class="am-form-group">
<label class="input-group-btn" style="width: 50px;">
<span class="am-btn am-btn-default am-btn-sm">
<i class="am-icon-cloud-upload"></i> 选择文件
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg"
@change="upTz(0,$event)"></span>
</label>
</div>
<div class="am-form-group ml10" v-if="info.loan_info.notify_file">
<a :href="info.loan_info.notify_file" target="_blank" class='mt5' title="查看文件">
{{info.loan_info.notify_file_name}}
</a>
</div>
<? } ?>
</div>
-->
</div>
</div>
<div class="am-form-group am-u-lg-6">
<div class="am-form-group am-u-lg-6">
<?if ($info['loan_info']['status_array'] && in_array(1,$info['loan_info']['status_array'])){?>
<? if ($info['loan_info']['status_array'] && in_array(1, $info['loan_info']['status_array'])) { ?>
<label class="am-para-label label-width"><span class="span-bold">按揭放款函:</span></label>
<div class="am-para-input">
<div class="am-form-inline">
<template>
<div class="am-form-group">
<label class="input-group-btn" style="width: 50px;"><span
class="am-btn am-btn-default am-btn-sm">
<? if (is_img($info['loan_info']['lend_file_name'])) { ?>
<ul id="viewer-lend_file" class="photopic-list ml30 clearfix">
<li style="position:relative;">
<div style="position:absolute;top:5px;right:0;padding:0 8px 2px 8px;line-height:22px; background-color:rgba(0,0,0,.5);font-size:14px;color:#fff;"
onclick="del_img('load_info','lend_file','')">x
</div>
<a target="_blank" class="pic">
<img alt="按揭放款函" onclick="showViewer('viewer-lend_file')"
:src="info.loan_info.lend_file"/>
</a>
<div class="f12 tc"></div>
</li>
</ul>
<? } else { ?>
<div class="am-form-group">
<label class="input-group-btn" style="width: 50px;">
<span class="am-btn am-btn-default am-btn-sm">
<i class="am-icon-cloud-upload"></i> 选择文件
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg" @change="upTz(1,$event)"></span>
</label>
</div>
</template>
<div class="am-form-group ml10" v-if="info.loan_info.lend_file">
<a :href="info.loan_info.lend_file" target="_blank" class='mt5' title="查看文件">
{{info.loan_info.lend_file_name}}
</a>
</div>
<input type="file" style="display: none;" accept="jpg,png,gif,png,jpeg"
@change="upTz(1,$event)"></span>
</label>
</div>
<div class="am-form-group ml10" v-if="info.loan_info.lend_file">
<a :href="info.loan_info.lend_file" target="_blank" class='mt5' title="查看文件">
{{info.loan_info.lend_file_name}}
</a>
</div>
<? } ?>
</div>
</div>
<?}?>
</div>
<div class="am-form-group am-u-lg-6">
<div class="am-form-group ml10">
<?if(!$info['loan_info']['status_array']){?>
<a href='javascript:;' @click="finish_loan(1)"
class='am-btn am-btn-primary am-btn-xs'>等待放款</a>
<?}elseif ($info['loan_info']['status_array'] && in_array(1,$info['loan_info']['status_array']) && !in_array(2,$info['loan_info']['status_array'])){?>
<a href='javascript:;' @click="finish_loan(2)"
class='am-btn am-btn-primary am-btn-xs'>按揭完成</a>
<?}else{?>
<a href="javascript:"
class="am-btn am-btn-default am-active am-btn-xs">已完成按揭</a>
<?}?>
</div>
<? } ?>
</div>
<div class="am-form-group am-u-lg-12">
<div class="am-form-group ml10">
<? if (!$info['loan_info']['status_array']) { ?>
<a href='javascript:;' @click="finish_loan(1)"
class='am-btn am-btn-primary am-btn-xs'>等待放款</a>
<? } elseif ($info['loan_info']['status_array'] && in_array(1, $info['loan_info']['status_array']) && !in_array(2, $info['loan_info']['status_array'])) { ?>
<a href='javascript:;' @click="finish_loan(2)"
class='am-btn am-btn-primary am-btn-xs'>按揭完成</a>
<? } else { ?>
<a href="javascript:"
class="am-btn am-btn-default am-active am-btn-xs">已完成按揭</a>
<? } ?>
</div>
</div>
</div>
</div>
</div>
<script>
function upLoan(type, obj) {
var that = this;
var formData = new FormData();
formData.append("file", $(obj).val()); //上传一个files对象
formData.append('id', <?=$info['id']?>);
formData.append('type', type);
if (type) {
var loan_time = $('#loan_time').val();
if (!loan_time) {
layer.msg("请填写放款时间");
return;
}
formData.append('loan_time', loan_time);
}
$.ajax({//jQuery方法,此处可以换成其它请求方式
url: '/receiver/orderv2/orders/edit_loan',
dataType: "json",
type: "post",
data: formData,
processData: false,//不去处理发送的数据
contentType: false,//不去设置Content-Type请求头
error: function (res) {
layer.msg('上传失败')
return;
},
success: function (res) {
console.dir(res)
if (res.code) {
layer.msg(res.msg, function () {
$.form.reload();
});
} else {
layer.msg(res.msg);
}
return;
}
})
}
</script>
+9 -1
View File
@@ -28,8 +28,10 @@
<span class="text-danger" v-if="info.sale_detail">
({{info.sale_detail}})
</span>
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改优惠金额" :data-modal="'/receiver/orderv2/orders/edit_price?id='+info.id">修改优惠</span>
</label>
</div>
</div>
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">车身颜色:</span></label>
@@ -56,7 +58,13 @@
<div class="am-form-group am-u-lg-6">
<label class="am-para-label label-width"><span class="span-bold">服务费:</span></label>
<div class="am-para-input" style="margin-left:120px">
<label class="am-para-label-con" v-if="info.srv_info">{{info.srv_info.total}}<template v-if="info.srv_info.detail">({{info.srv_info.detail}})</template></label>
<label class="am-para-label-con" v-if="info.srv_info">
{{info.srv_info.total}}
<template v-if="info.srv_info.detail">
(<span class="text-danger" v-html="info.srv_info.detail"></span>)
</template>
</label>
<span v-if="info.is_admin" class="am-btn am-btn-primary am-btn-xs" data-title="修改服务费" :data-modal="'/receiver/orderv2/orders/edit_srv?id='+info.id">修改</span>
</div>
</div>
<div class="am-form-group am-u-lg-6">
+38 -3
View File
@@ -1,4 +1,9 @@
<div class="coms-table-wrap mt10" id="paylog_content" style="min-height:400px;overflow:hidden">
<div class="align-l ml10">
车主: {{car_info.name}} &nbsp;&nbsp;
车型: {{car_info.car}} &nbsp;&nbsp;
<span v-if="car_info.vin">车架号: {{car_info.vin}}<span>
</div>
<div class="align-r">
<a class="am-btn am-btn-primary am-btn-xs mr10" data-modal="/receiver/orderv2/orders/add_paylog?id=<?=$id?>">添加收款记录</a>
</div>
@@ -16,14 +21,25 @@
</tr>
</thead>
<tbody>
<tr v-for="item in list">
<tr v-for="(item,index) in list">
<td>{{item.money}}</td>
<td>{{item.type_cn}}</td>
<td>{{item.company}}</td>
<td>{{item.opt_name}}</td>
<td>{{item.descrip}}</td>
<td>
<a :href="item.img" target="_blank" v-if="item.img"><img :src="item.img" class="w100 layui-layer-phimg"></a>
<template v-if="item.img">
<a class="am-btn am-btn-primary am-btn-xs" @click="show_img(index)">
<span v-if="item.show_img==1">收起</span>
<span v-else>查看</span>
</a>
<template v-if="item.show_img==1">
<a href="javascript:;" class="pic">
<img class="w100 layui-layer-phimg" :src="item.img" @click="show_img_detail(item.img)"/>
</a>
</template>
</template>
</td>
<td>{{item.pay_time}}</td>
</tr>
@@ -46,11 +62,16 @@
</ul>
</nav>
</div>
<div class="align-r ml15" v-if="pay_price">应收总额:{{need_price}},已收总额:{{pay_price}}&nbsp&nbsp</div>
<div class="align-r ml15" v-if="need_price">
应收总额:{{need_price}},已收总额:{{pay_price}}
<template v-if="price_loan">,贷款金额:{{price_loan}}</template>&nbsp&nbsp
</div>
</div>
</div>
<script>
var xz_num = 0;
var xz_name = "xuan_zhuan_<?=time()?>";
$(function () {
vue_obj = new Vue({
el: '#paylog_content',
@@ -60,6 +81,8 @@
list:[],
pay_price: '',
need_price: '',
price_loan: '',
car_info : [],
},
mounted: function () {
this.getData(1);
@@ -73,6 +96,8 @@
that.page = result.data.commonPage;
that.pay_price = result.data.pay_price;
that.need_price = result.data.need_price;
that.price_loan = result.data.price_loan;
that.car_info = result.data.car_info;
}
});
},
@@ -90,6 +115,16 @@
vm.page.page++;
vm.getData(vm.page.page);
},
show_img: function (index) {
if(this.list[index]['show_img']==1){
this.list[index]['show_img'] = 0;
}else{
this.list[index]['show_img'] = 1;
}
},
show_img_detail: function (src) {
layer.photos({photos: {"data": [{"src": src}]}});
},
}
})
})
+67 -15
View File
@@ -78,10 +78,10 @@
placeholder="下定时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="create">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="create">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="create">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="create">本月</a>
</div>
</div>
</div>
@@ -119,6 +119,16 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">是否开票:</label>
<div class="am-para-inline w100">
<select name="is_bill" v-model="params.is_bill">
<option value="">请选择</option>
<option value="0"></option>
<option value="1"></option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">车型:</label>
@@ -211,7 +221,30 @@
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-bill-time" name="bill_time" type="text" value="<?= $params['bill_time'] ?>"
placeholder="订单时间范围" autocomplete="off"/>
placeholder="开票时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="bill">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="bill">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="bill">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="bill">本月</a>
</div>
</div>
</div>
<?}?>
<?if($params['status_pid']==5 || ($params['status']==2&&$params['status_pid']==4)){?>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<label class="am-para-label w100">交付时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-ck-time" name="ck_time" type="text" value="<?= $params['ck_time'] ?>"
placeholder="交付时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today" data-btn="ck">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-btn="ck">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks" data-btn="ck">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month" data-btn="ck">本月</a>
</div>
</div>
</div>
@@ -295,25 +328,44 @@
laydate.render({
elem: '#id-bill-time', range: '~'
});
laydate.render({
elem: '#id-ck-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
endDate = beginDate = nowDate.Format('yyyy-MM-dd');
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
endDate = beginDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
// $('#id-create-time').val(date);
switch ($(this).data('btn')) {
case 'create':
$('#id-create-time').val(date);
break;
case 'bill':
$('#id-bill-time').val(date);
break;
case 'ck':
$('#id-ck-time').val(date);
break;
}
$('#id-create-time').val(date);
});
});
@@ -0,0 +1,96 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="coms-table-wrap mt10">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false" action="/receiver/orderv2/orders/lists_aggs">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10" style="display: none">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out('csv')" class="am-btn am-btn-success am-btn-sm w100">导出csv</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out('excel')" class="am-btn am-btn-success am-btn-sm w100">导出Excel</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out('excel2')" class="am-btn am-btn-success am-btn-sm w100">导出Excel2</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out('image')" class="am-btn am-btn-success am-btn-sm w100">导出Image</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<? foreach ($fieldAry as $k => $v) { ?>
<th <?php if ($k == 'biz_name') { ?> style="width: 200px"<? } ?> ><span><?= str_replace('_', ' ', $v) ?></span></th>
<? } ?>
</tr>
</thead>
<tbody>
<? foreach ($lists as $v) { ?>
<tr <?php if ($v['biz_name'] == '小计' || strpos($v['biz_name'],'小计') !== false) { ?> style="background-color: #8a6d3b"<? } ?>
<?php if ($v['biz_name'] == '合计') { ?> style="background-color: #abd8f2"<? } ?>
>
<? foreach ($fieldAry as $key => $val) { ?>
<td <?php if ($key == 'doc_ding') { ?> style="background-color: #9b1a0e"<? } ?>
<?php if ($key == 'doc_piao') { ?> style="background-color: #9b1a0e"<? } ?>
><?= $v[$key] ?></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
<? if ($img_path) { ?>
<img src="<?= $img_path ?>" style="width: 100%"/><br>
<? } ?>
<? if ($img_path_ding || $img_path_piao) { ?>
<table style="border: hidden">
<tr>
<td>
<? if ($img_path_ding) { ?>
<img src="<?= $img_path_ding ?>" style="width: 100%"/>
<? } ?>
</td>
<td>
<? if ($img_path_piao) { ?>
<img src="<?= $img_path_piao ?>" style="width: 100%"/>
<? } ?>
</td>
</tr>
</table>
<? } ?>
</div>
</div>
<script>
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: [],
lists: [],
},
mounted: function () {
var vm = this;
vm.lists = <?=json_encode($lists)?>;
vm.fieldAry = <?=json_encode($fieldAry)?>;
},
methods: {
export_out: function (type) {
var href = $.menu.parseUri(window.location.href);
href = href.replace("lists_aggs?", "lists_aggs?export="+type+"&");
window.location.href = href;
},
},
watch: {
}
});
});
</script>
+717
View File
@@ -0,0 +1,717 @@
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div id="vue-edit">
<div class="am-g">
<div class="col-sm-12" style="margin-bottom: 20px;">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select id="status" v-model="info.status" disabled="disabled">
<template v-for="(v,i) in show_info.statusAry">
<option :value="i">{{v}}</option>
</template>
</select>
</div>
</div>
</div>
<div class="am-form-inline" style="padding-right: 10px;padding-top: 12px;">
<div class="text-right">
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-if="info.edit_type==1">取消编辑</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-else>编辑状态</a>
</div>
<div class="am-form-group ml10" v-if="info.edit_type==1">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">修改状态</a>
</div>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
车主信息
</span>
<span style="float:right;margin-top:5px;">
<a href="javascript:" @click="editType(2)"><i class="fa fa-edit"></i></a>
</span>
</div>
<div class="am-panel-bd am-g">
<table width="100%" style="margin-left: 10px;margin-right: 10px;">
<tr>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">车主姓名:</span></td>
<td><input type="text" v-model="info.name" placeholder="请输入车主姓名"
style="width: 220px;"></td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">车主电话:</span></td>
<td><input type="text" v-model="info.mobile" placeholder="请输入车主电话"
style="width: 220px;"></td>
</tr>
</table>
</td>
<td class="table-td"><span class="mr5">加入时间:</span>{{info.c_time}}</td>
</tr>
<tr>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">车主生日:</span></td>
<td><input id="birth_day" type="text" v-model="info.birth_day"
autocomplete="off"
placeholder="请输入车主生日"
style="width: 220px;"></td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">车主性别:</span></td>
<td>&nbsp;<input type="radio" :value='1' v-model="info.sex"> &nbsp;
<input type="radio" :value='2' v-model="info.sex"> &nbsp;
</td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">品牌车型:</span></td>
<td>
<div class="am-para-inline w100">
<select name="brand_id" v-model="info.brand_id">
<option value="">选择品牌</option>
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w100">
<select name="s_id" v-model="info.s_id">
<option value="">选择车系</option>
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w170">
<select name="v_id" v-model="info.v_id">
<option value="">选择车型</option>
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
</select>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">车牌号码:</span></td>
<td><input type="text" v-model="info.car_num" placeholder="请输入车牌号码"
style="width: 220px;"></td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">购车时间:</span></td>
<td><input id="order_time" type="text" v-model="info.order_time"
autocomplete="off"
placeholder="请输入购车时间"
style="width: 220px;"></td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">交付时间:</span></td>
<td><input id="ck_time" type="text" v-model="info.ck_time"
autocomplete="off"
placeholder="请输入交付时间"
style="width: 220px;"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">所在城市:</span></td>
<td>
<div class="am-para-inline w100">
<select v-model="info.city_id">
<option value="0">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select v-model="info.county_id">
<option value="0">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</td>
</tr>
</table>
</td>
<td class="table-td">
<table>
<tr>
<td><span class="mr5">企微好友:</span></td>
<td>
<div class="am-para-inline w120">
<select v-model="info.wxqy">
<option :value="i" v-for="(v,i) in show_info.wxqyAry">{{v}}</option>
</select></div>
</td>
</tr>
</table>
</td>
<td class="table-td"></td>
</tr>
<tr>
<td class="table-td"><span class="mr5">所属门店:</span>{{info.biz_name}}</td>
<td class="table-td"><span class="mr5">销售人员:</span>{{info.admin_name}}</td>
<td class="table-td"></td>
</tr>
<tr>
<td>
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-left pt10" v-if="info.edit_type==2">
<div class="am-form-group ml10">
<a href="javascript:void(0)"
class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">修改车主信息</a>
</div>
</div>
</div>
</td>
<td colspan="3">
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-right pt10">
<div class="am-form-group ml10">
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=owners"
data-title="发送短信"
class="am-btn am-btn-sm am-btn-success">短信</a>
</div>
<div class="am-form-group ml10">
<a href="javascript:void(0);"
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=owners"
class="am-btn am-btn-sm am-btn-success" data-title="获取手机号">
拨打电话
</a>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
车主画像
</span>
<span style="float:right;margin-top:5px;">
<a href="javascript:" @click="editType(3)"><i class="fa fa-edit"></i></a>
</span>
</div>
<div class="am-panel-bd am-g">
<table width="100%" style="margin-left: 10px;margin-right: 10px;">
<template v-for="(v,i) in info.tag">
<tr>
<td class="table-td" style="width: 80%">
<table>
<tr v-if="v.type=='checkbox'">
<td style="min-width: 80px">{{v.name}}:</td>
<td>
<template v-for="(v2,i2) in v.list">
<input type="checkbox" :value='v2.checked'
v-model="v2.checked"> {{v2.name}}&nbsp;
</template>
</td>
</tr>
<tr v-else>
<td style="min-width: 80px">{{v.name}}:</td>
<td>
<template v-for="(v2,i2) in v.list">
<input type="radio" :value='v2.id'
v-model="v.value"> {{v2.name}}&nbsp;
</template>
</td>
</tr>
</table>
</td>
</tr>
</template>
<tr v-if="info.edit_type==3">
<td>
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-left pt10">
<div class="am-form-group ml10">
<a href="javascript:void(0)"
class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">保存车主画像</a>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
操作日志
</span>
<span style="float:right;margin-top:5px">
<a href="javascript:void(0)" @click="logModal()">新增小记</a>
</span>
</div>
<div class="am-panel-bd">
<div class="am-tabs" data-am-tabs>
<div class="am-tab-panel am-active">
<table class="am-table">
<thead>
<tr>
<th width="15%"><span>操作人员</span></th>
<th width=""><span>内容</span></th>
<th width="13%"><span>类型</span></th>
<th width="15%"><span>操作时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($logs as $key => $val) { ?>
<tr>
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['uname'] ?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<? if ($val['rec_url']) { ?>
<audio controls="controls">
<source src="<?= $val['rec_url'] ?>"/>
</audio>
<? } else if ($val['rec_text']) { ?>
<?= $val['rec_text'] ?>
<? } else { ?>
<?= $val['log'] ?>
<? } ?>
<? if ($val['imgs']) { ?>
<div class="photo-upload" style="padding-top: 10px;">
<?php foreach ($val['imgs'] as $key1 => $val1) { ?>
<div class="photo-upload-item">
<a href="javascript:void (0);">
<img src="<?= $val1 ?>"
class="img-thumbnail" data-tips-image
style="height:auto;max-height:100px;min-width:100px">
</a>
</div>
<? } ?>
</div>
<? } ?>
</td>
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['type_name'] ?></td>
<td style="vertical-align:middle;word-wrap:break-word;"><?= $val['c_time'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="log-modal" style="display: none;">
<div style="padding-top: 20px;">
<div class="am-form-group">
<label class="am-para-label label-width">内容:</label>
<div class="am-para-input" style="width: 80%">
<textarea name="log" rows="5" placeholder="请输入内容" v-model="goods.log"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
show_info: {},
logs: [],
brandAry: [],
seryAry: [],
attrvAry: [],
goods: {"imgs_url": [], "imgs": [], "log": ''},
cityAry: [],
countyAry: []
},
mounted: function () {
var that = this;
that.info = <?=json_encode($info)?>;
that.show_info = <?=json_encode($show_info)?>;
that.logs = <?=json_encode($logs)?>;
that.init_brands();
that.init_citys();
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
if (vm.info.city_id > 0) {
$.get('common/area', {id: vm.info.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
}
},
init_brands: function () {
var vm = this;
$.ajax({
url: '/auto/brand/json_lists',
type: 'post',
dataType: 'json',
data: {status: 1},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
vm.brandAry = data.data.list;
}
},
complete: function () {
}
});
},
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.edit_type == 1) {
$("#status").attr("disabled", "disabled");
vm.info.edit_type = 0;
} else {
$("#status").removeAttr("disabled");
vm.info.edit_type = 1;
}
} else {
if (vm.info.edit_type == index) {
vm.info.edit_type = 0;
} else {
vm.info.edit_type = index;
}
}
},
logModal: function () {
var vm = this;
layer.open({
type: 1,
area: ['50%'], //宽高
content: $('#log-modal'),
title: '新增小记',
shade: false,
btn: ['保存', '取消'],
yes: function (index) {
$.ajax({
url: '/receiver/owners/add_log',
type: 'post',
dataType: 'json',
data: {
act_type: 1, id: <?= $info['id'] ?>, type: 0, log: vm.goods.log, imgs: vm.goods.imgs
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
}
});
},
saveEdit: function () {
var vm = this;
$.ajax({
url: '/receiver/owners/edit',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = false;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
},
});
},
},
watch: {
'info.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.info.county_id = '0';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.info.county_id > 0) {
var county_id = '0';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.info.county_id) {
county_id = county.id;
break;
}
}
that.info.county_id = county_id;
}
}
});
}
},
'info.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
if (nv > 0) {
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id: nv},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
for (var i in lists) {
var row = lists[i];
seryAry[row.id] = row.name;
}
vm.seryAry = lists;
if (vm.info.s_id > 0 && undefined == seryAry[vm.info.s_id]) {
vm.info.s_id = '';
}
}
},
complete: function () {
layer.closeAll('loading');
}
});
} else {
vm.info.s_id = '';
}
},
'info.s_id': function (nv, ov) {
var vm = this;
if (nv > 0) {
//型号
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: nv,
status: 1,
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.attrvAry = response.data.list;
}
}
});
} else {
vm.attrvAry = [];
vm.info.v_id = '';
}
},
},
});
});
require(['laydate'], function (laydate) {
//日期范围
laydate.render({
elem: '#birth_day'
, type: 'date'
, done: function (value, date) {
vue_obj.info.birth_day = value;
}
});
laydate.render({
elem: '#order_time'
, type: 'datetime'
, done: function (value, date) {
vue_obj.info.order_time = value;
}
});
laydate.render({
elem: '#ck_time'
, type: 'datetime'
, done: function (value, date) {
vue_obj.info.ck_time = value;
}
});
});
</script>
<style type="text/css">
.input-group {
width: 100%;
padding-right: 30px;
}
.input-group-addon {
padding: 0px 10px 0px 0px;
font-size: 1.6rem;
font-weight: normal;
line-height: 0px;
color: #333;
text-align: right;
background-color: #fff;
border: 0px solid #fff;
border-radius: 0px;
width: 120px;
}
.table-td {
width: 20%;
padding-top: 15px;
line-height: 37px;
font-size: 1.6rem;
}
.my-ul ul li {
padding: 10px;
}
.my-panel {
padding: 10px;
border: 1px solid #ddd;
height: 90px;
}
.auto-content {
width: min-content;
min-width: 50%;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
.photo-upload {
position: relative;
font-size: 0;
}
.photo-upload:after {
content: "";
display: table;
clear: both;
}
.photo-upload-item {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
font-size: 12px; /*display:inline-block;width:120px;*/
}
.photo-upload-item > img {
}
.photo-upload-item-check,
.photo-upload-item-remove {
opacity: 0;
position: absolute;
top: -8px;
right: -8px;
width: 24px;
height: 24px;
line-height: 24px;
border: 1px solid #fff;
background-color: #eee;
border-radius: 50%;
text-align: center;
cursor: pointer;
}
.photo-upload-item:hover .photo-upload-item-remove {
opacity: 1;
transition: all .4s ease
}
.photo-upload-item-check {
opacity: 1;
background-color: #36f;
color: #fff;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
+564
View File
@@ -0,0 +1,564 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?= !strlen($params['status']) ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/owners">全部</a>
</li>
<? foreach ($show_info['statusAry'] as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/owners?status=<?= $key ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/receiver/owners">
<input name="status" type='hidden' value="<?=$params['status']?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp" v-model="params.search_tp">
<option :value="i" v-for="(v,i) in show_info.searchTpAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w200">
<input id="title" name="title" type="text" v-model="params.title"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w60">性别:</label>
<div class="am-para-inline w100">
<select name="sex" v-model="params.sex">
<option value="">请选择</option>
<option value="1"></option>
<option value="2"></option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">企微好友:</label>
<div class="am-para-inline w100">
<select name="wxqy" v-model="params.wxqy">
<option value=''>请选择</option>
<option :value="i" v-for="(v,i) in show_info.wxqyAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">所在城市:</label>
<div class="am-para-inline w100">
<select name="city_id" v-model="params.city_id">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w120">
<select name="county_id" v-model="params.county_id">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl">
<label class="am-para-label w100">品牌车型:</label>
<div class="am-para-inline w100">
<select name="brand_id" v-model="params.brand_id">
<option value="">选择品牌</option>
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w100">
<select name="s_id" v-model="params.s_id">
<option value="">选择车系</option>
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w200">
<select name="v_id" v-model="params.v_id">
<option value="">选择车型</option>
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">销售员:</label>
<div class="am-para-inline w100">
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
<option value="">选择城市</option>
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w100">
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
<option value="">选择行政区</option>
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-para-inline w180">
<select name="biz_id_admin" v-model="params.biz_id_admin">
<option value="">门店</option>
<template v-for="(v,i) in admins.bizAry">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-para-inline w100">
<select name="admin_id" v-model="params.admin_id">
<option value="">销售员</option>
<template v-for="(v,i) in admins.list">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<? foreach ($searchTimeAry as $key => $value) { ?>
<div id="show-<?= $key ?>" style="display:<?= $params[$key] ? 'block' : 'none' ?>">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100"><?= $value ?></label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-<?= $key ?>" name="<?= $key ?>" type="text" value="<?= $params[$key] ?>"
placeholder="<?= $value ?>范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="today">今日</a>
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="weeks">本周</a>
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="month">本月</a>
</div>
</div>
</div>
<? } ?>
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
<input type="button" @click="btnTimes" value="选择筛选时间" class="am-btn am-btn-success am-btn-sm">
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" id="export">导出</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="am-form-group fr mr10">
<span><?= intval($pager['totle']) ?>个客户</span>
</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="3%">ID</th>
<th width="7%"><span>车主</span></th>
<th width="15%"><span>车辆</span></th>
<th width="6%"><span>车牌号</span></th>
<th width="4%"><span>性别</span></th>
<th width="4%"><span>年龄</span></th>
<th width="5%"><span>企微好友</span></th>
<th width="5%"><span>状态</span></th>
<th width="9%"><span>购车时间</span></th>
<th width="9%"><span>交付时间</span></th>
<th width="9%"><span>所属门店</span></th>
<th width="6%"><span>销售员</span></th>
<th width="9%"><span>最后操作时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td>{{v.id}}</td>
<td>{{v.name}}<br>{{v.mobile_sub}}</td>
<td>{{v.car_name}}<br>{{v.city_name}}</td>
<td>{{v.car_num}}</td>
<td>{{v.sex}}</td>
<td>{{v.age}}</td>
<td>{{v.wxqy}}</td>
<td>{{v.status_name}}</td>
<td>{{v.order_time}}</td>
<td>{{v.ck_time}}</td>
<td>{{v.biz_name}}</td>
<td>{{v.admin_name}}</td>
<td>{{v.u_time}}</td>
</tr>
<tr>
<td colspan="13">
<div class="row">
<div class="col-md-4 align-l">
</div>
<div class="col-md-8 align-r" style="padding-right: 30px;">
<a :data-modal="'/common/bind_mobile?id='+v.id+'&type=owners'"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="获取手机号">拨打电话</a>
<a :data-modal="'/common/show_sms?id='+v.id+'&type=owners'"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="发送短信">短信</a>
<a href="javascript:void(0);" :data-open="'/receiver/owners/get?id='+v.id"
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
</div>
</td>
</tr>
</template>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
<div id="times-modal" style="display: none;">
<div class="modal-body">
<label class="checkall" style="margin-left: 30px;">
<input id="times_checkbox" type="checkbox" data-check-target=".order-times"> 全选</label>
<div style="margin-left: 40px;">
<?php foreach ($searchTimeAry as $key => $value) { ?>
<label class="am-checkbox" style="padding-bottom: 8px;">
<input type="checkbox" class="order-times" <?= $params[$key] ? 'checked' : '' ?>
value='<?= $key ?>'><?= $value ?></label>
<? } ?>
</div>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
<? foreach ($searchTimeAry as $key => $value) { ?>
laydate.render({
elem: '#id-<?=$key?>', range: '~'
});
$('.id-<?=$key?>-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#id-<?=$key?>').val(date);
});
<?}?>
});
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
lists: [],
brandAry: [],
seryAry: [],
attrvAry: [],
cityAry: [],
countyAry: [],
show_info: {searchTpAry: [], wxqyAry: []},
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.lists = <?=json_encode($lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
vm.init_brands();
vm.init_citys();
},
methods: {
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
vm.admins.cityAry = JSON.parse(JSON.stringify(response.data));
}
});
if (vm.params.city_id) {
$.get('common/area', {id: vm.params.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
});
}
},
init_brands: function () {
var vm = this;
$.ajax({
url: '/auto/brand/json_lists',
type: 'post',
dataType: 'json',
data: {status: 1},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
vm.brandAry = data.data.list;
}
},
complete: function () {
}
});
},
btnTimes: function () {
layer.open({
type: 1,
area: ['25%'], //宽高
content: $('#times-modal'),
title: '选择筛选时间',
shade: false,
btn: ['确定', '取消'],
yes: function (index) {
layer.close(index);
$(".order-times").map(function () {
var id = this.value;
if (this.checked) {
$('#show-' + id).show();
} else {
$('#id-' + id).val('');
$('#show-' + id).hide();
}
});
}
});
},
saveEdit: function () {
$("form").submit();
},
reset: function () {
var that = this;
that.params.search_tp = 'mobile';
that.params.title = '';
that.params.sex = '';
that.params.city_id_admin = '';
that.params.brand_id = '';
that.params.wxqy = '';
that.params.city_id = '';
$(".order-times").map(function () {
var id = this.value;
this.checked = false;
$('#id-' + id).val('');
$('#show-' + id).hide();
});
$("#times_checkbox").prop("checked", false);
}
},
watch: {
'params.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.params.county_id = '';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.params.county_id) {
var county_id = '';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.params.county_id) {
county_id = county.id;
break;
}
}
that.params.county_id = county_id;
}
}
});
}
},
'params.brand_id': function (nv, ov) {
var vm = this;
vm.seryAry = {};
if (nv > 0) {
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id: nv},
beforeSend: function () {
},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
var seryAry = {};
for (var i in lists) {
var row = lists[i];
seryAry[row.id] = row.name;
}
vm.seryAry = lists;
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
vm.params.s_id = '';
}
}
},
complete: function () {
layer.closeAll('loading');
}
});
} else {
vm.params.s_id = '';
}
},
'params.s_id': function (nv, ov) {
var vm = this;
if (nv > 0) {
//型号
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: nv,
status: 1,
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.attrvAry = response.data.list;
}
}
});
} else {
vm.attrvAry = [];
vm.params.v_id = '';
}
},
'params.city_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.countyAry = [];
that.params.county_id_admin = '';
} else {
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
that.params.county_id_admin = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.countyAry = response.data;
}
}
});
}
},
'params.county_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.bizAry = [];
that.params.biz_id_admin = '';
} else {
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
city_id: that.params.city_id_admin,
county_id: that.params.county_id_admin,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.bizAry = response.data.list;
if (that.params.biz_id_admin > 0) {
var biz_id = '';
for (var i in that.admins.bizAry) {
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
biz_id = that.params.biz_id_admin;
break;
}
}
that.params.biz_id_admin = biz_id;
}
}
}
});
}
},
'params.biz_id_admin': function (nv, ov) {
var that = this;
if (nv == '') {
that.admins.list = [];
that.params.admin_id = '';
} else {
$.ajax({
type: 'post',
url: '/app/licheb/member/json_lists',
dataType: 'json',
data: {
biz_id: nv,
status: 1
},
success: function (response) {
if (response.code == 1) {
that.admins.list = response.data.list;
if (that.params.admin_id > 0) {
var admin_id = '';
for (var i in that.admins.list) {
if (that.params.admin_id == that.admins.list[i].id) {
admin_id = that.params.admin_id;
break;
}
}
that.params.admin_id = admin_id;
}
}
}
});
}
}
}
});
<?php page_script($pager) ?>
$('#export').click(function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
var arr = href.split('?');
href = '/receiver/owners/export?' + arr[1];
window.location.href = href;
});
});
</script>
+31
View File
@@ -0,0 +1,31 @@
<form id="vue-edit" class="am-form am-form-horizontal" action="<?= $showInfo['url'] ?>" data-auto="true"
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
<input type="hidden" value="<?= $showInfo['id'] ?>" name="id"/>
<div class="am-form-group">
<label class="am-para-label">名称:</label>
<div class="am-para-input">
<input type="text" placeholder="输入名称" value="<?= $showInfo['name'] ?>" name="name"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">选项类型:</label>
<div class="am-para-input" style="width: 30%">
<select name="type">
<? foreach ($showInfo['typeAry'] as $key => $value) { ?>
<option value="<?= $key ?>" <?= $key == $showInfo['type'] ? 'selected' : '' ?>
><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">排序:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" placeholder="输入排序" value="<?= $showInfo['sort'] ?>" name="sort"/>
<small class="text-muted">越大越靠前</small>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<button class="am-btn ml20 am-btn-sm am-btn-success w100" style="margin-left: 3.5rem" type="submit">保存</button>
</div>
</form>
+249
View File
@@ -0,0 +1,249 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($showInfo['tabAry'] as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['tab']) && $params['tab'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="<?= $val['url'] ?>">
<?= $val['title'] ?>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="receiver/ownersTag">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">类型:</label>
<div class="am-para-inline w100">
<select name="type">
<option value="">选择类型</option>
<? foreach ($showInfo['typeAry'] as $key => $value) { ?>
<option value="<?= $key ?>" <?= $key == $params['type'] ? 'selected' : '' ?>
><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">状态:</label>
<div class="am-para-inline w100">
<select name="status">
<option value="">选择状态</option>
<? foreach ($showInfo['statusAry'] as $key => $value) { ?>
<option value="<?= $key ?>" <?= strlen($params['status']) && $key == $params['status'] ? 'selected' : '' ?>
><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button data-modal="/receiver/ownersTag/get" type="button" data-title="新增标签"
class="am-btn am-btn-success am-btn-sm w100">
新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd" id="vue-show">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="25%"><span>名称</span></th>
<th width="45%"><span>标签选项</span></th>
<th width="7%"><span>类型</span></th>
<th width="5%"><span>排序</span></th>
<th width="5%"><span>状态</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['name'] ?></td>
<td><?= $v['options'] ?></td>
<td><?= $v['type_name'] ?></td>
<td><?= $v['sort'] ?></td>
<td><?= $v['status_name'] ?></td>
</tr>
<tr>
<td colspan="5" class="align-r">
<a href="javascript:void(0);" @click="optionsModal(<?= $v['id'] ?>,'<?= $v['name'] ?>')"
class="am-btn am-btn-primary am-btn-xs">编辑选项</a>
<a href="javascript:void(0);" data-modal="/receiver/ownersTag/get?id=<?= $v['id'] ?>"
data-title="编辑标签" class="am-btn am-btn-primary am-btn-xs">编辑标签</a>
<? if ($v['status'] == 1) { ?>
<a data-ajax="post" data-action="/receiver/ownersTag/edit_status"
class="am-btn am-btn-danger am-btn-xs"
data-params-id="<?= $v['id'] ?>" data-params-status="0">关闭</a>
<?
} ?>
<? if ($v['status'] == 0) { ?>
<a data-ajax="post" data-action="/receiver/ownersTag/edit_status"
class="am-btn am-btn-success am-btn-xs"
data-params-id="<?= $v['id'] ?>" data-params-status="1">开启</a>
<? } ?>
<a data-ajax="post" data-action="/receiver/ownersTag/del"
class="am-btn am-btn-danger am-btn-xs"
data-params-id="<?= $v['id'] ?>">删除</a>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
<div id="options-modal" style="display: none;">
<table class="table table-hover table-middle" style="table-layout:fixed">
<colgroup>
<col width="65%">
<col width="15%">
<col width="">
</colgroup>
<thead>
<tr>
<th class="text-center">标题</th>
<th class="text-center">排序</th>
<th class="text-right">
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
@click='addOptions()'>添加</a>
</th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in optionsList">
<tr v-if="item.status==1">
<td class="text-center">
<input :id="'name_'+index" @blur="editName(index)" class="form-control"
v-model="item.name" placeholder="请输入标题"></td>
<td class="text-center">
<input :id="'group_name_'+index" @blur="editGroupName(index)" class="form-control"
v-model="item.sort" type="number" placeholder="请输入排序值">
</td>
<td class="text-right">
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-danger btn-sm" @click='delOptions(index)'>删除</a>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-show',
data: {
optionsList: [],
},
mounted: function () {
},
methods: {
optionsModal: function (id, name) {
layer.open({
type: 1,
area: ['50%', '50%'], //宽高
content: $('#options-modal'),
title: '编辑【' + name + '】选项',
shade: false,
btn: ['保存', '取消'],
yes: function (index) {
$.ajax({
url: '/receiver/ownersTag/edit_options',
type: 'post',
dataType: 'json',
data: {id: id, options: that.optionsList},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
}
});
}
});
var that = this;
$.ajax({
url: '/receiver/ownersTag/get_options',
type: 'post',
dataType: 'json',
data: {id: id},
beforeSend: function () {
},
success: function (re) {
if (re.code) {
that.optionsList = re.data.lists;
} else {
layer.msg(re.msg, {icon: 2});
}
},
complete: function () {
}
});
},
addOptions: function () {
var that = this;
that.optionsList.push({id: 0, name: '', status: 1, qy_id: '', sort: 50});
},
delOptions: function (index) {
var that = this;
if (that.optionsList[index]['id'] > 0) {
that.optionsList[index]['status'] = -1;
} else {
that.optionsList.splice(index, 1);
}
},
editName: function (index) {
var name = $("#name_" + index).val();
if (name == '') {
layer.msg("标题不能为空!", {icon: 2});
return false;
}
},
// 修改排序
editGroupName: function (index) {
var order_view = $("#group_name_" + index).val();
if (order_view == '') {
layer.msg("排序值不能为空!", {icon: 2});
return false;
}
this.optionsList.sort(function (a, b) {
return b.sort - a.sort;
})
},
},
watch: {}
});
<?php page_script($pager) ?>
});
</script>
+12
View File
@@ -1,3 +1,15 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;margin-bottom: 20px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($showInfo['tabAry'] as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['tab']) && $params['tab'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="<?= $val['url'] ?>">
<?= $val['title'] ?>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="receiver/tag">
+184
View File
@@ -0,0 +1,184 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="<?= $url ?>">
<input name="type" value="<?= $params['type'] ?>" type="hidden">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">统计月份:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="统计月份范围" autocomplete="off"/>
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($info['type_ary'] as $key => $val) { ?>
<li role="presentation"
class="<?= $params['type'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="<?= $url ?>?type=<?= $key ?>&time=<?= $params['time'] ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th colspan="<?= $info['days_count'] + 3 ?>" width="50%" style="text-align: left;">目标完成情况</th>
<? foreach ($info['days'] as $v) { ?>
<th width="10%"><?= $v['month'] ?>月完成</th>
<? } ?>
</tr>
</thead>
<tbody>
<tr>
<td colspan="<?= $info['days_count'] + 3 ?>" align="left"><strong>本期的完成情况(订单台数)</strong></td>
<? foreach ($info['days'] as $v) { ?>
<td><strong><?= $v['num'] ?></strong></td>
<? } ?>
</tr>
<? foreach ($info['bizs'] as $v) { ?>
<tr>
<? if ($v['rowspan'] == 1) { ?>
<td rowspan="<?= $info['bizs_count'] ?>" class="td-middle">渠道</td>
<? } ?>
<td colspan="<?= $info['days_count'] + 2 ?>"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $v2) { ?>
<td><?= $v2 ?></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
<table class="am-table am-table-bordered" style="margin-top: 10px;">
<thead>
<tr>
<th colspan="<?= $info['days_count'] * 2 + 3 ?>">过程数据</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="<?= $info['offlineSources_count'] * $info['bizs_count'] + 2 ?>" class="td-middle">线索数</td>
<td colspan="2" rowspan="2"></td>
<td colspan="<?= $info['days_count'] ?>">转化率</td>
<td colspan="<?= $info['days_count'] ?>">数据</td>
</tr>
<tr>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
</tr>
<? foreach ($info['process']['customers'] as $v) { ?>
<tr>
<td rowspan="<?= $info['offlineSources_count'] ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= number_format_com($v3 / $v['num_sum'][$k3] * 100, 2, '') . "" ?></strong>
</td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
<? foreach ($info['process']['into_shop'] as $k => $v) { ?>
<tr>
<? if ($k == 0) { ?>
<td rowspan="<?= ($info['offlineSources_count'] + 1) * $info['bizs_count'] ?>"
class="td-middle">进店数
</td>
<? } ?>
<td rowspan="<?= $info['offlineSources_count'] + 1 ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
<? foreach ($info['process']['orders'] as $k => $v) { ?>
<tr>
<? if ($k == 0) { ?>
<td rowspan="<?= ($info['offlineSources_count'] + 1) * $info['bizs_count'] ?>"
class="td-middle">成交数
</td>
<? } ?>
<td rowspan="<?= $info['offlineSources_count'] + 1 ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-time', range: '~', format: 'yyyy-MM', type: 'month',
});
});
</script>
<style>
.td-middle {
vertical-align: middle !important;
}
</style>
+280
View File
@@ -0,0 +1,280 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="<?= $url ?>">
<input name="type" value="<?= $params['type'] ?>" type="hidden">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">统计月份:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-time" name="time" type="text" value="<?= $params['time'] ?>"
placeholder="统计月份范围" autocomplete="off"/>
</div>
</div>
</div>
<div class="am-form-group fl ml20">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<ul class="nav nav-tabs" role="tablist">
<? foreach ($info['type_ary'] as $key => $val) { ?>
<li role="presentation"
class="<?= $params['type'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="<?= $url ?>?type=<?= $key ?>&time=<?= $params['time'] ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th colspan="<?= $info['days_count'] + 3 ?>" width="50%" style="text-align: left;">目标完成情况</th>
<? foreach ($info['days'] as $v) { ?>
<th width="10%"><?= $v['month'] ?>月完成</th>
<? } ?>
</tr>
</thead>
<tbody>
<tr>
<td colspan="<?= $info['days_count'] + 3 ?>" align="left"><strong>本期的完成情况(订单台数)</strong></td>
<? foreach ($info['days'] as $v) { ?>
<td><strong><?= $v['num'] ?></strong></td>
<? } ?>
</tr>
<? foreach ($info['bizs'] as $v) { ?>
<tr>
<? if ($v['rowspan'] == 1) { ?>
<td rowspan="<?= $info['bizs_count'] ?>" class="td-middle"><?= $type_name ?></td>
<? } ?>
<td colspan="<?= $info['days_count'] + 2 ?>"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $v2) { ?>
<td><?= $v2 ?></td>
<? } ?>
</tr>
<? } ?>
<tr>
<td rowspan="<?= $info['bizs_count'] * $info['brands_count'] + 1 ?>" class="td-middle">销售车型</td>
<td colspan="2">项目</td>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
</tr>
<? foreach ($info['brands_stats'] as $v) { ?>
<tr>
<td rowspan="<?= $info['brands_count'] ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td><?= $v2['brand_name'] ?></td>
<? foreach ($v2['stats_per'] as $v3) { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
<table class="am-table am-table-bordered" style="margin-top: 10px;">
<thead>
<tr>
<th colspan="<?= $info['days_count'] * 2 + 3 ?>">线索成交情况</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3" rowspan="2"></td>
<td colspan="<?= $info['days_count'] ?>">成交率</td>
<td colspan="<?= $info['days_count'] ?>">线索数/订单数</td>
</tr>
<tr>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
</tr>
<? foreach ($info['customers_stats'] as $k => $v) { ?>
<tr>
<? if ($k == 0) { ?>
<td rowspan="<?= ($info['offlineSources_count'] * 2 + 3) * $info['bizs_count'] ?>"
class="td-middle">线索成交率
</td>
<? } ?>
<td rowspan="<?= $info['offlineSources_count'] * 2 + 3 ?>"
class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<? if ($v2['type'] == 2) { ?>
<td>
<strong><?= number_format_com($v2['stats'][$k3] / $v['ord_sum'][$k3] * 100, 2, '') . "" ?></strong>
</td>
<? } else { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">线索数合计</td>
<? foreach ($v['cus_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">订单数合计</td>
<? foreach ($v['ord_sum'] as $v6) { ?>
<td><strong><?= $v6 ?></strong></td>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">线索成交率(不含自然到店)</td>
<? foreach ($v['cus_per'] as $v7) { ?>
<td><strong><?= $v7 ?></strong></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
<table class="am-table am-table-bordered" style="margin-top: 10px;">
<thead>
<tr>
<th colspan="<?= $info['days_count'] * 2 + 3 ?>">过程数据</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="<?= $info['offlineSources_count'] * $info['bizs_count'] + 2 ?>" class="td-middle">线索数</td>
<td colspan="2" rowspan="2"></td>
<td colspan="<?= $info['days_count'] ?>">转化率</td>
<td colspan="<?= $info['days_count'] ?>">数据</td>
</tr>
<tr>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
<? foreach ($info['days'] as $v) { ?>
<td><?= $v['month'] ?>月</td>
<? } ?>
</tr>
<? foreach ($info['process']['customers'] as $v) { ?>
<tr>
<td rowspan="<?= $info['offlineSources_count'] ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= number_format_com($v3 / $v['num_sum'][$k3] * 100, 2, '') . "" ?></strong>
</td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
<? foreach ($info['process']['into_shop'] as $k => $v) { ?>
<tr>
<? if ($k == 0) { ?>
<td rowspan="<?= ($info['offlineSources_count'] + 1) * $info['bizs_count'] ?>"
class="td-middle">进店数
</td>
<? } ?>
<td rowspan="<?= $info['offlineSources_count'] + 1 ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
<? foreach ($info['process']['orders'] as $k => $v) { ?>
<tr>
<? if ($k == 0) { ?>
<td rowspan="<?= ($info['offlineSources_count'] + 1) * $info['bizs_count'] ?>"
class="td-middle">成交数
</td>
<? } ?>
<td rowspan="<?= $info['offlineSources_count'] + 1 ?>" class="td-middle"><?= $v['biz_name'] ?></td>
<? foreach ($v['list'] as $k2 => $v2) { ?>
<?= $k2 != 0 ? '<tr>' : '' ?>
<td align="left"><?= $v2['name'] ?></td>
<? foreach ($v2['stats_per'] as $k3 => $v3) { ?>
<td><strong><?= $v3 ?></strong></td>
<? } ?>
<? foreach ($v2['stats'] as $v4) { ?>
<td><?= $v4 ?></td>
<? } ?>
<?= $k2 != 0 ? '</tr>' : '' ?>
<? } ?>
</tr>
<tr>
<td colspan="<?= $info['days_count'] + 1 ?>">合计</td>
<? foreach ($v['num_sum'] as $v5) { ?>
<td><strong><?= $v5 ?></strong></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-time', range: '~', format: 'yyyy-MM', type: 'month',
});
});
</script>
<style>
.td-middle {
vertical-align: middle !important;
}
</style>
+321 -5
View File
@@ -7,12 +7,19 @@ class Biz extends HD_Controller
{
parent::__construct();
$this->load->model('receiver/order/receiver_orders_v2_model','orders_model');
$this->load->model('receiver/order/receiver_order_loans_model','order_loans_model');
$this->load->model('receiver/order/receiver_order_agents_model', 'order_agents_model');
$this->load->model('receiver/order/receiver_order_datas_model');
$this->load->model('receiver/receiver_fine_model');
$this->load->model('auto/auto_business_model');
$this->load->model('biz/biz_model');
$this->load->model('biz/biz_info_model');
$this->load->model('biz/biz_settle_model');
$this->load->model('biz/biz_settle_static_model');
$this->load->model('biz/biz_settle_srv_model');
$this->load->model('biz/biz_trucking_model');
$this->load->model('biz/biz_settle_price_model');
$this->load->model('sys/sys_finance_model');
$this->load->library('receiver/orders_v2_entity');
}
@@ -99,7 +106,8 @@ class Biz extends HD_Controller
$where = [
"year" => date('Y',strtotime("last month")),
"month" => intval(date('m',strtotime('last day of - 1 months'))),
"stic_id" => 0
"stic_id" => 0,
"type" => 0
];
$rows = $this->biz_settle_model->select($where,'id asc',$page,$size);
if($rows){
@@ -155,12 +163,11 @@ class Biz extends HD_Controller
'commission' => $biz_info['commission']*$car_total,
];
$employee_wage = $biz_info['num'] ? ceil($car_total/$biz_info['num']) : 0;
$data['employee_wage'] = $employee_wage;
$data['employee_wage'] = $employee_wage * $biz_info['employee_wage'];
$data['price_total'] = $val['price_all']+$data['profix_car_after'];
$price_need = $data['price_total'] - $data['rent'] - $data['wat_ele'] - $data['employee_wage'] - $data['manager_wage'] - $data['commission'] - $data['price_trucking'];
$price_need = $data['price_total'] - $data['rent'] - $data['wat_ele'] - $data['employee_wage'] - $data['manager_wage'] - $data['commission'] - $val['price_trucking'];
$partner_rate = $biz_info['rate']/100;
$liche_rate = (100-$biz_info['rate'])/100;
$data['profix_liche'] = $price_need*$liche_rate;
$data['profix_partner'] = $price_need*$partner_rate;
@@ -169,7 +176,6 @@ class Biz extends HD_Controller
if($overflow['oflow_profix_car']){
$data['profix_partner_oflow'] = sprintf("%.2f",$overflow['oflow_profix_car']/1.13);
}
$this->biz_settle_static_model->update($data,['id'=>$val['id']]);
}
}else{
@@ -177,4 +183,314 @@ class Biz extends HD_Controller
}
}
}
//品牌店统计
public function settle_brand(){
$biz_id = $this->input->get('biz_id');
$id = $this->input->get('id');
$size = $this->input->get('size');
!$size && $size = 5;
$t1 = 'lc_receiver_order_status';
$t2 = 'lc_receiver_orders_v2';
$t3 = 'lc_biz_settle';
$t4 = 'lc_biz';
$fields = "$t2.*,$t4.city_id";
$where = [
"$t1.pid_status" => 3,
"$t1.status" => 1,
"$t2.status in (0,1)" => null,
"$t2.id>=" => Orders_v2_entity::V2_START_ID,
"$t2.bill_time !='0000-00-00 00:00:00'" => null,
"$t2.bill_time>=" => "2022-07-01 00:00:00",
"$t3.id is null" => null,
"$t4.type" => 1,
];
$id && $where["$t2.id"] = $id;
$biz_id && $where["$t4.id"] = $biz_id;
$this->db->from("$t1");
$this->db->join("$t2", "$t2.id=$t1.o_id",'left');
$this->db->join("$t3", "$t3.o_id=$t1.o_id",'left');
$this->db->join("$t4", "$t4.id=$t2.biz_id",'left');
$this->db->select($fields);
$this->db->where($where);
$this->db->order_by("$t2.id ASC");
$this->db->limit($size);
$rows = $this->db->get()->result_array();
if($rows){
foreach($rows as $key=>$val){
$info_json = json_decode($val['info_json'],true);
$money_json = json_decode($val['money_json'],true);
$bill_time_month = date('Y-m-d',strtotime($val['bill_time']));
$settle_money_json = [];
$settle_money_json['in'] = [ //收入
'profix_car' => 0, //整车
'srv_price' => $this->orders_v2_entity->order_srv_money($val['id']), //服务费
'commission' => 0, //佣金
];
$settle_money_json['out'] = [ //成本
// 'biz_price' => 0', //门店成本
'apply_price' => 0, //申请成本
'fine_price' => 0, //赠送精品成本
];
//获取创建订单时商务政策
$where = [
'id' => $info_json['business_id'],
];
$b_row_one = $this->auto_business_model->get($where);
$settle_money_json['in']['profix_car'] = $b_row_one['profix_car'] ? $b_row_one['profix_car']-$money_json['price_discount'] : 0;
//挂牌利润 = 实收 - 成本
$profix_carno = 0;
if($money_json['fee_carno']>0){
$where = [
'biz_id' => $val['biz_id'],
'type' => 1,
'status' => 1,
's_effect_time>=' => date('Y-m-01',strtotime($val['bill_time'])),
's_effect_time<=' => date('Y-m-t',strtotime($val['bill_time'])),
];
$free_row = $this->biz_settle_srv_model->get($where);
if(!$free_row){
$free_row = $this->biz_settle_srv_model->get(['biz_id'=>$val['biz_id'],'is_def'=>1,'status'=>1,'type'=>1]);
}
$free_jsondata = json_decode($free_row['jsondata'],true);
$cb_fee_carno = $free_jsondata['price'] ? $free_jsondata['price'] : 0;
$profix_carno = $money_json['fee_carno'] - $cb_fee_carno;
}
//保险利润 = 金额(是否含税) * 返点百分比(保险类型):保险生效日
$data_row = $this->receiver_order_datas_model->get(['o_id'=>$val['id']]);
$insurance_img = json_decode($data_row['insurance_img'],true);
$business_img = json_decode($data_row['business_img'],true);
$profix_insuer_ins = 0;
if($insurance_img){
//强险
$time = strtotime($insurance_img['date']);
$where = [
'biz_id' => $val['biz_id'],
'title' => $insurance_img['product'],
'type' => 2,
"json_extract(jsondata, '$.type') = '2'" => null,
"json_extract(jsondata, '$.s_time') >= '{$time}'" => null,
"json_extract(jsondata, '$.e_time') <= '{$time}'" => null
];
$fd_row = $this->biz_settle_srv_model->get($where);
if(!$fd_row){
$where = [
'biz_id' => $val['biz_id'],
'title' => $insurance_img['product'],
'type' => 2,
'is_def' => 1,
"json_extract(jsondata, '$.type') = '2'" => null,
];
$fd_row = $this->biz_settle_srv_model->get($where);
}
$fd_jsondata = json_decode($fd_row['jsondata'],true);
$qx_fd = $fd_jsondata['rebate']/100;
$profix_insuer_ins = floatval($insurance_img['price']) * $qx_fd;
}
$profix_insuer_bis = 0;
if($business_img){
//商业险
$time = strtotime($business_img['date']);
$where = [
'biz_id' => $val['biz_id'],
'title' => $business_img['product'],
'type' => 2,
"json_extract(jsondata, '$.type') = '1'" => null,
"json_extract(jsondata, '$.s_time') >= '{$time}'" => null,
"json_extract(jsondata, '$.e_time') <= '{$time}'" => null
];
$bis_fd_row = $this->biz_settle_srv_model->get($where);
if(!$bis_fd_row){
$where = [
'biz_id' => $val['biz_id'],
'title' => $business_img['product'],
'type' => 2,
'is_def' => 1,
"json_extract(jsondata, '$.type') = '1'" => null,
];
$bis_fd_row = $this->biz_settle_srv_model->get($where);
}
$bis_fd_jsondata = json_decode($bis_fd_row['jsondata'],true);
$bis_fd = $bis_fd_jsondata['rebate']/100;
$profix_insuer_bis = floatval($business_img['price'])*$bis_fd;
}
$profix_insuer = $profix_insuer_ins + $profix_insuer_bis;
//贷款利润 = 手续费 + 贷款金额 * 返点(对应产品)
// $profix_loan = floatval($money_json['price_finance']);
//贷款佣金 = 贷款金额 * 返点(对应产品)
$profix_loan = 0;
if($money_json['price_loan']>=0){
$loan_row = $this->order_loans_model->get(['o_id'=>$val['id']]);
$finance_id = $val['finance_id'];
$finance_num = $loan_row['num'] ? $loan_row['num'] : 0;
$where = [
'biz_id' => $val['biz_id'],
'type' => 3,
's_effect_time' => $bill_time_month,
"json_extract(jsondata, '$.finance_id') = '{$finance_id}'" => null,
"json_extract(jsondata, '$.finance_num') = '{$finance_num}'" => null,
];
$fd_row = $this->biz_settle_srv_model->get($where);
if(!$fd_row){
$fd_row = $this->biz_settle_srv_model->get(['biz_id'=>$val['biz_id'],'is_def'=>1,'status'=>1,'type'=>3]);
}
$fd_jsondata = json_decode($fd_row['jsondata'],true);
$loan_fd = $fd_jsondata['rebate'] ? $fd_jsondata['rebate']/100:0;
$profix_loan = $money_json['price_loan']*$loan_fd;
//获取贷款手续费
$srv_loan = 0;
$srv_json = json_decode($val['srv_ids'],true);
if($srv_json){
foreach ($srv_json as $v2) {
if($v2['key']=='price_finance'){
$srv_loan = $v2['price'];
break;
}
}
}
$profix_loan += $srv_loan;
}
$settle_money_json['profix_insuer_ins'] = $profix_insuer_ins;
$settle_money_json['profix_insuer_bis'] = $profix_insuer_bis;
$settle_money_json['in']['commission'] = $profix_loan+$profix_insuer;
//精品成本(赠送的也要算)
$profix_fine = 0;
$fines = json_decode($val['fines'],true);
$fines_ids = array_column($fines,'id');
if($fines){
$fines_ids = implode(',',$fines_ids);
$where = [
"id in ({$fines_ids})" => null
];
$fines_ids && $cb_sum = $this->receiver_fine_model->sum('price',$where);
$cb = $cb_sum['price'] ? $cb_sum['price'] : 0; //成本
$profix_fine = $cb;
}
$settle_money_json['out']['biz_price'] = $profix_fine;
//拖车费
$truck_row = $this->biz_trucking_model->get(['auto_b_id'=>$val['brand_id'],'biz_id'=>$val['biz_id'],'status'=>1]);
$price_trucking = $truck_row['money'] ? $truck_row['money'] : 0;
$add_data = [
'biz_id' => $val['biz_id'],
'o_id' => $val['id'],
'profix_car' => $settle_money_json['in']['profix_car'],
'profix_insure' => $profix_insuer,
'profix_loan' => $profix_loan,
'profix_carno' => $profix_carno,
'price_trucking' => $price_trucking,
'profix_fine' => $money_json['price_fine_select'] - $profix_fine,
'money_json' => json_encode($settle_money_json,JSON_UNESCAPED_UNICODE),
'year' => date('Y',strtotime($val['bill_time'])),
'month' => intval(date('m',strtotime($val['bill_time']))),
'type' => 1,
'c_time' => time()
];
if($money_json['price_car']>$b_row_one['price_floor']){
$add_data['oflow_profix_car'] = $money_json['price_car'] - $b_row_one['price_floor'];
}
$this->biz_settle_model->add($add_data);
}
}else{
echo 'finish';
}
}
//统计前一个月利润
public function merge_brand(){
$size = $this->input->get('size');
$page = 1;
!$size && $size = 5;
$where = [
"year" => date('Y',strtotime("last month")),
"month" => intval(date('m',strtotime('last day of - 1 months'))),
"stic_id" => 0,
"type" => 1
];
$rows = $this->biz_settle_model->select($where,'id asc',$page,$size);
if($rows){
foreach($rows as $key=>$val){
$where = [
'biz_id' => $val['biz_id'],
'year' => $val['year'],
'month' => $val['month']
];
$static_row = $this->biz_settle_static_model->get($where);
$price_all = $val['profix_insure']+$val['profix_loan']+$val['profix_carno']+$val['profix_fine'];
if(!$static_row){
$data = [
'biz_id' => $val['biz_id'],
'profix_car' => $val['profix_car'],
'price_all' => $price_all,
'price_trucking' => $val['price_trucking'],
'year' => $val['year'],
'month' => $val['month'],
'c_time' => time()
];
$biz_price = 0;//门店成本
$biz_price_list = [];
$p_where = [
'biz_id' => $val['biz_id'],
'status' => 1,
'year' => $val['year'],
'month' => $val['month'],
];
$price_row = $this->biz_settle_price_model->get($p_where);
if($price_row){
$biz_price = $this->biz_settle_price_model->sum_jsondata($price_row['money_json']);
$biz_price_list = $this->biz_settle_price_model->get_jsondata($price_row['money_json']);
}
$add_money_json = [ //成本
'biz_price' => $biz_price, //门店成本
'biz_price_list' => $biz_price_list
];
$data['money_json'] = json_encode($add_money_json,JSON_UNESCAPED_UNICODE);
$stic_id = $this->biz_settle_static_model->add($data);
if($stic_id){
$this->biz_settle_model->update(['stic_id'=>$stic_id],['id'=>$val['id']]);
}
}else{
$data = [
'profix_car' => $static_row['profix_car'] + $val['profix_car'],
'price_all' => $static_row['price_all'] + $price_all,
'price_trucking' => $static_row['price_trucking'] + $val['price_trucking'],
];
$res = $this->biz_settle_static_model->update($data,['id'=>$static_row['id']]);
if($res){
$this->biz_settle_model->update(['stic_id'=>$static_row['id']],['id'=>$val['id']]);
}
}
}
}else{
//计算分润
$where = [
'price_total' => 0.00
];
$rows = $this->biz_settle_static_model->select($where,'id asc',$page,$size);
if($rows){
foreach($rows as $val){
$money_json = json_decode($val['money_json'],true);
$data = [
'profix_car_after' => sprintf("%.2f",$val['profix_car']/1.13),
];
$data['price_total'] = sprintf("%.2f",$val['price_all']/1.13)+$data['profix_car_after'];
$biz_info = $this->biz_info_model->get(['biz_id'=>$val['biz_id']]);
$price_need = $data['price_total'] - $money_json['biz_price'];
$partner_rate = $biz_info['rate']/100;
$liche_rate = (100-$biz_info['rate'])/100;
$data['profix_liche'] = $price_need*$liche_rate;
$data['profix_partner'] = $price_need*$partner_rate;
$this->biz_settle_static_model->update($data,['id'=>$val['id']]);
}
}else{
echo 'finish';
}
}
}
}
+223 -23
View File
@@ -1,4 +1,5 @@
<?php
/**
* Notes:博饼任务
* Created on: 2021/8/20 17:15
@@ -6,31 +7,228 @@
*/
class Liche extends HD_Controller
{
public function __construct(){
public function __construct()
{
parent::__construct();
$this->load->model('receiver/order/receiver_order_contracts_model');
$this->load->model('receiver/order/receiver_orders_v2_model');
}
$this->load->library('receiver/orders_v2_entity');
/**
* Notes:更新车主企业微信
* Created on: 2022/9/06 16:00
* Created by: dengbw
* https://liche-api-dev.xiaoyu.com/plan/liche/owners_wxqy?sd=1
* https://api.liche.cn/plan/liche/owners_wxqy
*/
public function owners_wxqy()
{
$params = $this->input->get();
$hour = date('H.i');
if (($hour > 22.00 && $hour < 23.55) || $params['sd']) {
if ($params['sd']) {
echo "开始执行车主[{$hour}]";
}
} else {
echo '[22.00-23.55]执行车主[' . $hour . ']';
return;
}
$size = 200;//每次最多处理多少条
$rds = intval($this->input->get('rds'));
$redis = &load_cache('redis');
$log_date = date('Y-m-d');
$redisKey = 'lc_receiver_owners_id_' . $log_date;
if ($rds) {
$redis->delete($redisKey);
}
$id = $redis->get($redisKey);
!$id && $id = 0;
$log = [];
$where = ['a.id>' => $id, 'a.wxqy' => 0];
$res = $this->db->select('a.id,a.mobile,a.u_time,b.admin_id,b.biz_id')
->from('lc_receiver_owners as a')
->join('lc_receiver_orders_v2 as b', "b.id=a.o_id", 'left')
->where($where)
->order_by('a.id asc')
->limit($size, 0)
->get()->result_array();
if (!$res) {
echo '执行到车主id' . $id . '暂无数据';
return;
}
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$this->load->model("biz/biz_model", 'mdBiz');
$this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');
$this->load->model('app/app_lichene_qy_model', 'mdWechatqy');
$this->load->model('app/app_different_qy_model', 'mdDifferentQy');
$str_biz_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_biz = $this->mdBiz->map('id', 'city_id,type,status', ["id in({$str_biz_ids})" => null]);
$str_user_ids = implode(',', array_unique(array_column($res, 'admin_id')));
$map_user = $this->mdUsers->map('id', 'userid', ["id in({$str_user_ids})" => null]);
foreach ($res as $key => $value) {
$id = $value['id'];
$biz_type = intval($map_biz[$value['biz_id']]['type']);
$userid = $map_user[$value['admin_id']];
if ($userid) {
if ($biz_type == 5) {//异业店
$re = $this->mdDifferentQy->get(['userid' => $userid, 'mobile' => $value['mobile']]);
} else {
$re = $this->mdWechatqy->get(['userid' => $userid, 'mobile' => $value['mobile']]);
}
if ($re) {//更新企微好友
$this->mdOwners->update(['wxqy' => 1, 'u_time' => $value['u_time']], ['id' => $id]);
$params['sd'] && $log[] = ['id' => $id, 'mobile' => $value['mobile']];
}
}
}
$redis->save($redisKey, $id, 24 * 3600);//保存最后id
if ($params['sd']) {
echo '<br>执行到当前车主id' . $redis->get($redisKey);
echo '<br>成功新增:<br>';
if ($log) {
echo json_encode($log, JSON_UNESCAPED_UNICODE);
echo '<br>';
}
echo '数据库获取:<br>';
echo json_encode($res, JSON_UNESCAPED_UNICODE);
}
}
/**
* Notes:新增车主信息
* Created on: 2022/6/14 17:15
* Created by: dengbw
* https://liche-api-dev.xiaoyu.com/plan/liche/add_owners?rds=1
* https://api.liche.cn/plan/liche/add_owners
*/
public function add_owners()
{
$params = $this->input->get();
$size = 5000;//每次最多处理多少条
$rds = intval($this->input->get('rds'));
$redis = &load_cache('redis');
$redisKey = 'receiver_owners_c_time';
if ($rds) {
$redis->delete($redisKey);
}
$c_time = $redis->get($redisKey);
!$c_time && $c_time = strtotime(date('Y-m-d') . ' 00:00:00');
$log = array();
$this->load->model('receiver/order/receiver_orders_v2_model', 'mdOrders');
$this->load->model('receiver/order/receiver_order_agents_model', 'mdOrdersAgents');
$this->load->model('app/liche/app_liche_users_model', 'mdUsers');
$this->load->model('receiver/receiver_owners_model', 'mdOwners');
$this->load->model('app/app_lichene_qy_model', 'mdWechatqy');
$this->load->model('app/app_different_qy_model', 'mdDifferentQy');
$this->load->model("biz/biz_model", 'mdBiz');
$t1 = 'lc_receiver_orders_v2';
$t2 = 'lc_receiver_order_status';
$where = ["{$t2}.c_time>=" => $c_time, "{$t1}.status>=" => 0, "{$t1}.owner_name<>" => '', "{$t1}.owner_mobile<>" => '',
"{$t2}.pid_status" => 5, "{$t2}.status" => 1];
$having = "total >= 1";
$orderby = "{$t2}.c_time asc";
$fileds = "{$t1}.id,{$t1}.brand_id,{$t1}.s_id,{$t1}.v_id,{$t1}.owner_name,{$t1}.owner_mobile,{$t1}.order_time,{$t1}.ck_time
,{$t1}.info_json,{$t1}.biz_id,{$t2}.c_time";
$res = $this->mdOrders->selectOrders($where, $orderby, 1, $size, '', $fileds, $having);
if (!$res) {
if ($params['rds']) {
echo '1执行到当前c_time' . date('Y-m-d H:i:s', $c_time) . '暂无数据';
}
return;
}
$str_o_ids = implode(',', array_unique(array_column($res, 'id')));
$map_agents = $this->mdOrdersAgents->map('o_id', 'car_num', ["o_id in({$str_o_ids})" => null]);
$str_mobiles = implode(',', array_unique(array_column($res, 'owner_mobile')));
$map_users = $this->mdUsers->map('mobile', 'id', ["mobile in({$str_mobiles})" => null]);
foreach ($res as $key => $value) {
$c_time = $value['c_time'];
$birth_day = '0000-00-00';
$sex = 0;
if ($value['info_json']) {
$info_json = json_decode($value['info_json'], true);
if ($info_json['c_owner_cardid']) {
$cardid = $info_json['c_owner_cardid'];
$birth_day = date('Y-m-d', strtotime(substr($cardid, 6, 8)));
$sex = substr($cardid, -2, 1) % 2 == 0 ? 2 : 1; //1为男 2为女
}
}
$uid = intval($map_users[$value['owner_mobile']]);
$car_num = $map_agents[$value['id']] ? $map_agents[$value['id']] : '';
$data = ['o_id' => $value['id'], 'uid' => $uid, 'name' => $value['owner_name'], 'mobile' => $value['owner_mobile'],
'birth_day' => $birth_day, 'sex' => $sex, 'brand_id' => $value['brand_id'], 's_id' => $value['s_id'],
'v_id' => $value['v_id'], 'order_time' => $value['order_time'], 'ck_time' => $value['ck_time'], 'car_num' => $car_num];
$biz_type = 0;
if ($value['biz_id']) {
$re_biz = $this->mdBiz->get(['id' => $value['biz_id']]);
if ($re_biz) {
$biz_type = $re_biz['type'];
$data['province_id'] = $re_biz['province_id'];
$data['city_id'] = $re_biz['city_id'];
$data['county_id'] = $re_biz['county_id'];
}
}
if ($value['owner_mobile']) {//查找企微
if ($biz_type == 5) {//异业店
$re_qy = $this->mdDifferentQy->get(['mobile' => $value['owner_mobile']]);
$re_qy && $data['wxqy'] = 1;
} else {
$re_qy = $this->mdWechatqy->get(['mobile' => $value['owner_mobile']]);
if ($re_qy) {
$data['wxqy'] = 1;
} else {
$re_use = $this->mdUsers->get(['mobile' => $value['owner_mobile'], 'status<>' => -1]);
if ($re_use['unionid']) {
$re_qy = $this->mdWechatqy->get(['unionid' => $re_use['unionid']]);
$re_qy && $data['wxqy'] = 1;
}
}
}
}
$re = $this->mdOwners->get(['o_id' => $value['id']]);
if ($re) {
$data['u_time'] = $re['u_time'];
$this->mdOwners->update($data, ['id' => $re['id']]);
} else {
$data['c_time'] = time();
$data['u_time'] = '0000-00-00 00:00:00';
$id = $this->mdOwners->add($data);
if ($id && $params['rds']) {
$log[] = ['id' => $id, 'name' => $data['name'], 'mobile' => $data['mobile']];
}
}
}
$redis->save($redisKey, $c_time);
if ($params['rds']) {
echo '<br>2执行到当前c_time' . date('Y-m-d H:i:s', $c_time);
echo '<br>成功新增:<br>';
if ($log) {
echo json_encode($log, JSON_UNESCAPED_UNICODE);
echo '<br>';
}
echo '数据库获取:<br>';
echo json_encode($res, JSON_UNESCAPED_UNICODE);
}
}
//获取未签名pdf
public function un_sign_pdf(){
$row = $this->receiver_order_contracts_model->get(['o_id>='=>Orders_v2_entity::V2_START_ID,'flag'=>0,'file !='=>'','status'=>1]);
public function un_sign_pdf()
{
$this->load->model('receiver/order/receiver_order_contracts_model');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->library('receiver/orders_v2_entity');
$row = $this->receiver_order_contracts_model->get(['o_id>=' => Orders_v2_entity::V2_START_ID, 'flag' => 0, 'file !=' => '', 'status' => 1]);
$receiver = $this->receiver_orders_v2_model->get(['id' => $row['o_id']]);
if(file_exists(FCPATH.$row['file']) && $receiver){
$companys = $this->orders_v2_entity->get_biz_mchid($receiver['biz_id'],$receiver['brand_id']);
if (file_exists(FCPATH . $row['file']) && $receiver) {
$companys = $this->orders_v2_entity->get_biz_mchid($receiver['biz_id'], $receiver['brand_id']);
$url = http_host_com();
$width = 130;
$s_img = build_qiniu_image_url($companys['company']['img_seal']);
if($row['type']==1){
if ($row['type'] == 1) {
$page = 2;
$height = 380;
$s_img = build_qiniu_image_url($companys['srv_company']['img_seal']);
}elseif ($row['type']==3){
} elseif ($row['type'] == 3) {
$page = 1;
$height = 620;
} else{
} else {
$page = 3;
$height = 160;
}
@@ -41,32 +239,34 @@ class Liche extends HD_Controller
'width' => $width,
'height' => $height,
's_img' => $s_img,
'file_url' => $url.'/'.$row['file']
'file_url' => $url . '/' . $row['file']
];
die(json_encode($data,JSON_UNESCAPED_UNICODE));
}else{
$this->receiver_order_contracts_model->update(['flag'=>1],['id'=>$row['id']]);
die(json_encode($data, JSON_UNESCAPED_UNICODE));
} else {
$this->receiver_order_contracts_model->update(['flag' => 1], ['id' => $row['id']]);
}
}
//覆盖pdf文件
public function up_pdf(){
public function up_pdf()
{
$this->load->model('receiver/order/receiver_order_contracts_model');
$id = $this->input->post('id');
$row = $this->receiver_order_contracts_model->get(['id'=>$id,'flag'=>0]);
if($row){
$file_path_arr = explode('/',$row['file']);
$row = $this->receiver_order_contracts_model->get(['id' => $id, 'flag' => 0]);
if ($row) {
$file_path_arr = explode('/', $row['file']);
// $file_name = array_pop($file_path_arr);
// $file_name = 'test.pdf';
// $file_path = implode('/',$file_path_arr);
// $res = move_uploaded_file($_FILES['file']['tmp_name'],FCPATH.$file_path.'/'.$file_name);
move_uploaded_file($_FILES['file']['tmp_name'],FCPATH.$row['file']);
$res = $this->receiver_order_contracts_model->update(['flag'=>1],['id'=>$row['id']]);
if($res){
move_uploaded_file($_FILES['file']['tmp_name'], FCPATH . $row['file']);
$res = $this->receiver_order_contracts_model->update(['flag' => 1], ['id' => $row['id']]);
if ($res) {
$data = [
'code' => 1,
'msg' => '保存成功'
];
die(json_encode($data,JSON_UNESCAPED_UNICODE));
die(json_encode($data, JSON_UNESCAPED_UNICODE));
}
}
}

Some files were not shown because too many files have changed in this diff Show More