supplier.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <?php
  2. use app\http\middleware\AllowOriginMiddleware;
  3. use app\http\middleware\InstallMiddleware;
  4. use app\http\middleware\supplier\AuthTokenMiddleware;
  5. use app\http\middleware\StationOpenMiddleware;
  6. use think\facade\Config;
  7. use think\facade\Route;
  8. use think\Response;
  9. /**
  10. * 供应商路由配置
  11. */
  12. Route::group('supplierapi', function () {
  13. /**
  14. * 不需要登录不验证权限
  15. */
  16. Route::group(function () {
  17. //图形验证码
  18. Route::get('ajcaptcha', 'Login/ajcaptcha')->name('ajcaptcha');
  19. //图形验证码
  20. Route::post('ajcheck', 'Login/ajcheck')->name('ajcheck');
  21. //是否需要滑块验证接口
  22. Route::post('is_captcha', 'Login/getAjCaptcha')->name('getAjCaptcha');
  23. Route::get('code', 'Test/code')->name('code')->option(['real_name' => '测试验证码']);
  24. Route::get('index', 'Test/index')->name('index')->option(['real_name' => '测试主页']);
  25. Route::post('login', 'Login/login')->name('login')->option(['real_name' => '账号密码登录']);
  26. Route::get('login/info', 'Login/info')->name('loginInfo')->option(['real_name' => '登录信息']);
  27. Route::get('captcha_store', 'Login/captcha')->name('captcha')->option(['real_name' => '图片验证码']);
  28. //获取版权
  29. Route::get('copyright', 'Common/getCopyright')->option(['real_name' => '获取版权']);
  30. });
  31. /**
  32. * 只需登录不验证权限
  33. */
  34. Route::group(function () {
  35. //获取logo
  36. Route::get('logo', 'Common/getLogo')->option(['real_name' => '获取logo']);
  37. //获取配置
  38. Route::get('config', 'Common/getConfig')->option(['real_name' => '获取配置']);
  39. //获取未读消息
  40. Route::get('jnotice', 'Common/jnotice')->option(['real_name' => '获取未读消息']);
  41. //获取省市区街道
  42. Route::get('city', 'Common/city')->option(['real_name' => '获取省市区街道']);
  43. //获取搜索菜单列表
  44. Route::get('menusList', 'Common/menusList')->option(['real_name' => '搜索菜单列表']);
  45. //退出登录
  46. Route::get('logout', 'Login/logOut')->option(['real_name' => '退出登录']);
  47. //修改密码
  48. Route::put('updatePwd', 'staff.StoreStaff/updateStaffPwd')->option(['real_name' => '修改密码']);
  49. //获取供应商信息
  50. Route::get('supplier', 'system.Supplier/read')->name('read')->option([['real_name' => '获取供应商信息']]);
  51. //更新供应商信息
  52. Route::put('supplier', 'system.Supplier/update')->name('update')->option([['real_name' => '更新供应商信息']]);
  53. //获取小票打印信息
  54. Route::get('printing', 'system.SupplierTicketPrint/read')->name('read')->option([['real_name' => '获取小票打印信息']]);
  55. //更新供应商信息
  56. Route::put('printing', 'system.SupplierTicketPrint/update')->name('update')->option([['real_name' => '更新小票打印']]);
  57. //管理员资源路由
  58. Route::resource('admin', 'system.SupplierAdmin')->option(['real_name' => [
  59. 'index' => '获取管理员列表',
  60. 'read' => '获取管理员详情',
  61. 'create' => '获取创建管理员表单',
  62. 'save' => '保存管理员',
  63. 'edit' => '获取修改管理员表单',
  64. 'update' => '修改管理员',
  65. 'delete' => '删除管理员'
  66. ]]);
  67. //修改管理员状态
  68. Route::put('admin/set_status/:id/:status', 'system.SupplierAdmin/set_status')->option(['real_name' => '修改管理员状态']);
  69. //首页统计数据
  70. Route::get('home/header', 'Common/homeStatics')->option(['real_name' => '首页统计数据']);
  71. //首页订单图表
  72. Route::get('home/order', 'Common/orderChart')->option(['real_name' => '首页订单图表']);
  73. //订单来源分析
  74. Route::get('home/order_channel', 'Common/orderChannel')->option(['real_name' => '订单来源分析']);
  75. //订单类型分析
  76. Route::get('home/order_type', 'Common/orderType')->option(['real_name' => '订单订单类型分析']);
  77. })->middleware(AuthTokenMiddleware::class);
  78. /**
  79. * 基础管理
  80. */
  81. Route::group('system', function () {
  82. //获取系统表单信息
  83. Route::get('form/info/:id', 'system.form.SystemForm/getInfo')->option(['real_name' => '获取系统表单信息']);
  84. //获取所有系统表单
  85. Route::get('form/all_system_form', 'system.form.SystemForm/allSystemForm')->option(['real_name' => '获取所有系统表单']);
  86. Route::get('config/edit_new_build/:type', 'system.Config/getFormBuild')->option(['real_name' => '供应商配置表单']);
  87. Route::post('config', 'system.Config/save')->option(['real_name' => '保存供应商配置']);
  88. })->middleware([
  89. AuthTokenMiddleware::class,
  90. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  91. \app\http\middleware\supplier\SupplierLogMiddleware::class
  92. ]);
  93. /**
  94. * 财务
  95. */
  96. Route::group('finance', function () {
  97. //获取供应商财务信息
  98. Route::get('info', 'system.Supplier/getFinanceInfo')->option(['real_name' => '获取供应商财务信息']);
  99. //设置供应商财务信息
  100. Route::post('info', 'system.Supplier/setFinanceInfo')->option(['real_name' => '设置供应商财务信息']);
  101. //供应商转账列表
  102. Route::get('supplier_extract/list', 'finance.SupplierExtract/index')->option(['real_name' => '供应商转账列表']);
  103. //供应商转账记录备注
  104. Route::post('supplier_extract/mark/:id', 'finance.SupplierExtract/mark')->option(['real_name' => '供应商转账记录备注']);
  105. //供应商申请转账
  106. Route::post('supplier_extract/cash', 'finance.SupplierExtract/cash')->option(['real_name' => '供应商申请转账']);
  107. //供应商流水列表
  108. Route::get('supplier_flowing_water/list', 'finance.SupplierFlowingWater/index')->option(['real_name' => '供应商流水列表']);
  109. //获取交易类型
  110. Route::get('supplier_flowing_water/type', 'finance.SupplierFlowingWater/getType')->option(['real_name' => '获取交易类型']);
  111. //供应商流水备注
  112. Route::post('supplier_flowing_water/mark/:id', 'finance.SupplierFlowingWater/mark')->option(['real_name' => '供应商流水备注']);
  113. //供应商账单记录
  114. Route::get('supplier_flowing_water/fund_record', 'finance.SupplierFlowingWater/fundRecord')->option(['real_name' => '供应商账单记录']);
  115. //供应商账单详情
  116. Route::get('supplier_flowing_water/fund_record_info', 'finance.SupplierFlowingWater/fundRecordInfo')->option(['real_name' => '供应商账单详情']);
  117. })->middleware([
  118. AuthTokenMiddleware::class,
  119. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  120. \app\http\middleware\supplier\SupplierLogMiddleware::class
  121. ]);
  122. /**
  123. * 运费模版
  124. */
  125. Route::group('setting', function () {
  126. //运费模板列表
  127. Route::get('shipping_templates/list', 'product.shipping.ShippingTemplates/temp_list')->option(['real_name' => '运费模板列表']);
  128. //修改运费模板数据
  129. Route::get('shipping_templates/:id/edit', 'product.shipping.ShippingTemplates/edit')->option(['real_name' => '修改运费模板数据']);
  130. //新增或修改运费模版
  131. Route::post('shipping_templates/save/:id', 'product.shipping.ShippingTemplates/save')->option(['real_name' => '新增或修改运费模版']);
  132. //删除运费模板
  133. Route::delete('shipping_templates/del/:id', 'product.shipping.ShippingTemplates/delete')->option(['real_name' => '删除运费模板']);
  134. //城市数据接口
  135. Route::get('shipping_templates/city_list', 'product.shipping.ShippingTemplates/city_list')->option(['real_name' => '城市数据接口']);
  136. })->middleware([
  137. AuthTokenMiddleware::class,
  138. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  139. \app\http\middleware\supplier\SupplierLogMiddleware::class
  140. ]);
  141. /**
  142. * 商品
  143. */
  144. Route::group('product', function () {
  145. //商品批量操作
  146. Route::post('batch_process', 'product.StoreProduct/batchProcess')->option(['real_name' => '商品批量操作']);
  147. //商品分类列表
  148. Route::get('category', 'product.StoreProductCategory/index')->option(['real_name' => '商品分类列表']);
  149. //商品标签(分类)树形列表
  150. Route::get('product_label', 'product.label.StoreProductLabel/tree_list')->option(['real_name' => '用户标签(分类)树形列表']);
  151. Route::get('all_label', 'product.label.StoreProductLabel/allLabel')->option(['real_name' => '所有的用户标签']);
  152. Route::get('all_ensure', 'product.ensure.StoreProductEnsure/allEnsure')->option(['real_name' => '所有的保障服务']);
  153. Route::get('all_specs', 'product.specs.StoreProductSpecs/allSpecs')->option(['real_name' => '所有的参数模版']);
  154. Route::get('get_all_unit', 'product.StoreProductUnit/getAllUnit')->option(['real_name' => '获取所有商品单位']);
  155. //商品分类树形列表
  156. Route::get('category/tree/:type', 'product.StoreProductCategory/tree_list')->option(['real_name' => '商品分类树形列表']);
  157. //商品分类cascader行列表
  158. Route::get('category/cascader_list/[:type]', 'product.StoreProductCategory/cascader_list')->option(['real_name' => '商品分类cascader行列表']);
  159. //商品分类新增表单
  160. Route::get('category/create', 'product.StoreProductCategory/create')->option(['real_name' => '商品分类新增表单']);
  161. //商品分类新增
  162. Route::post('category', 'product.StoreProductCategory/save')->option(['real_name' => '商品分类新增']);
  163. //商品分类编辑表单
  164. Route::get('category/:id', 'product.StoreProductCategory/edit')->option(['real_name' => '商品分类编辑表单']);
  165. //商品分类编辑
  166. Route::put('category/:id', 'product.StoreProductCategory/update')->option(['real_name' => '商品分类编辑']);
  167. //删除商品分类
  168. Route::delete('category/:id', 'product.StoreProductCategory/delete')->option(['real_name' => '删除商品分类']);
  169. //商品分类修改状态
  170. Route::put('category/set_show/:id/:is_show', 'product.StoreProductCategory/set_show')->option(['real_name' => '商品分类修改状态']);
  171. //商品分类快捷编辑
  172. Route::put('category/set_category/:id', 'product.StoreProductCategory/set_category')->option(['real_name' => '商品分类快捷编辑']);
  173. //获取运费模板
  174. Route::get('product/get_template', 'product.StoreProduct/get_template')->option(['real_name' => '获取运费模板']);
  175. //上传视频密钥接口
  176. Route::get('product/get_temp_keys', 'product.StoreProduct/getTempKeys')->option(['real_name' => '上传视频密钥接口']);
  177. //获取商品规则属性模板
  178. Route::get('product/get_rule', 'product.StoreProduct/get_rule')->option(['real_name' => '获取商品规则属性模板']);
  179. //获取所有商品列表
  180. Route::get('product/list', 'product.StoreProduct/search_list')->option(['real_name' => '获取所有商品列表']);
  181. //获取商品规格
  182. Route::get('product/attrs/:id', 'product.StoreProduct/getAttrs')->option(['real_name' => '获取商品规格']);
  183. //快速批量修改库存
  184. Route::put('product/saveStocks/:id', 'product.StoreProduct/saveProductAttrsStock')->option(['real_name' => '快速批量修改库存']);
  185. //商品列表
  186. Route::get('product', 'product.StoreProduct/index')->option(['real_name' => '商品列表']);
  187. //新建或修改商品
  188. Route::post('product/:id', 'product.StoreProduct/save')->option(['real_name' => '新建或修改商品']);
  189. //商品放入回收站
  190. Route::delete('product/:id', 'product.StoreProduct/delete')->option(['real_name' => '商品放入回收站']);
  191. //修改商品状态
  192. Route::put('product/set_show/:id/:is_show', 'product.StoreProduct/set_show')->option(['real_name' => '修改商品状态']);
  193. //设置批量商品上架
  194. Route::put('product/product_show', 'product.StoreProduct/product_show')->option(['real_name' => '设置批量商品上架']);
  195. //设置批量商品下架
  196. Route::put('product/product_unshow', 'product.StoreProduct/product_unshow')->option(['real_name' => '设置批量商品下架']);
  197. //获取关联用户标签
  198. Route::get('getUserLabel', 'product.StoreProduct/getUserLabel')->option(['real_name' => '获取关联用户标签']);
  199. //商品规则列表
  200. Route::get('product/rule', 'product.StoreProductRule/index')->option(['real_name' => '商品规则列表']);
  201. //新建或编辑商品规则
  202. Route::post('product/rule/:id', 'product.StoreProductRule/save')->option(['real_name' => '新建或编辑商品规则']);
  203. //商品规则详情
  204. Route::get('product/rule/:id', 'product.StoreProductRule/read')->option(['real_name' => '商品规则详情']);
  205. //删除商品规则
  206. Route::delete('product/rule/delete/:id', 'product.StoreProductRule/delete')->option(['real_name' => '删除商品规则']);
  207. //商品详情
  208. Route::get('product/:id', 'product.StoreProduct/get_product_info')->option(['real_name' => '商品详情']);
  209. //商品列表头部数据
  210. Route::get('type_header', 'product.StoreProduct/type_header')->option(['real_name' => '商品列表头部数据']);
  211. //修改商品状态
  212. Route::put('product/set_show/:id/:is_show', 'product.StoreProduct/set_show')->option(['real_name' => '修改商品状态']);
  213. //生成商品规格列表
  214. Route::post('generate_attr/:id/:type', 'product.StoreProduct/is_format_attr')->option(['real_name' => '生成商品规格列表']);
  215. //商品评价
  216. //商品评论列表
  217. Route::get('reply', 'product.StoreProductReply/index')->option(['real_name' => '商品评论列表']);
  218. //商品回复评论
  219. Route::put('reply/set_reply/:id', 'product.StoreProductReply/set_reply')->option(['real_name' => '商品回复评论']);
  220. //删除商品评论
  221. Route::delete('reply/:id', 'product.StoreProductReply/delete')->option(['real_name' => '删除商品评论']);
  222. //商品品牌cascader行列表
  223. Route::get('brand/cascader_list/[:type]', 'product.StoreBrand/cascader_list')->option(['real_name' => '商品品牌cascader行列表']);
  224. //商品标签
  225. Route::post('label/:id', 'product.label.StoreProductLabel/save')->option(['real_name' => '保存商品标签']);
  226. Route::delete('label/:id', 'product.label.StoreProductLabel/delete')->option(['real_name' => '删除商品标签']);
  227. Route::get('label/form', 'product.label.StoreProductLabel/getLabelForm')->option(['real_name' => '获取商品标签表单']);
  228. })->middleware([
  229. AuthTokenMiddleware::class,
  230. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  231. \app\http\middleware\supplier\SupplierLogMiddleware::class
  232. ]);
  233. /**
  234. * 附件相关路由
  235. */
  236. Route::group('file', function () {
  237. //图片附件列表
  238. Route::get('file', 'file.SystemAttachment/index')->option(['real_name' => '图片附件列表']);
  239. //删除图片
  240. Route::post('file/delete', 'file.SystemAttachment/delete')->option(['real_name' => '删除图片']);
  241. //移动图片分类表单
  242. Route::get('file/move', 'file.SystemAttachment/move')->option(['real_name' => '移动图片分类表单']);
  243. //移动图片分类
  244. Route::put('file/do_move', 'file.SystemAttachment/moveImageCate')->option(['real_name' => '移动图片分类']);
  245. //修改图片名称
  246. Route::put('file/update/:id', 'file.SystemAttachment/update')->option(['real_name' => '修改图片名称']);
  247. //上传图片
  248. Route::post('upload/[:upload_type]', 'file.SystemAttachment/upload')->option(['real_name' => '上传图片']);
  249. //获取上传类型
  250. Route::get('upload_type', 'file.SystemAttachment/uploadType')->option(['real_name' => '上传类型']);
  251. //分片上传本地视频
  252. Route::post('video_upload', 'file.SystemAttachment/videoUpload')->option(['real_name' => '分片上传本地视频']);
  253. //oss视频素材保存
  254. Route::post('video_attachment', 'file.SystemAttachment/saveVideoAttachment')->option(['real_name' => '视频素材保存']);
  255. //获取扫码上传页面链接以及参数
  256. Route::get('scan/qrcode', 'file.SystemAttachment/scanUploadQrcode')->option(['real_name' => '获取扫码上传页面链接以及参数']);
  257. //删除二维码
  258. Route::get('remove/qrcode', 'file.SystemAttachment/removeUploadQrcode')->option(['real_name' => '删除二维码']);
  259. //获取扫码上传的图片数据
  260. Route::get('scan/image/list/:scan_token', 'file.SystemAttachment/scanUploadImage')->option(['real_name' => '获取扫码上传的图片数据']);
  261. //网络图片上传
  262. Route::post('online/upload', 'file.SystemAttachment/onlineUpload')->option(['real_name' => '网络图片上传']);
  263. //获取上传信息
  264. Route::get('get/way_data', 'file.SystemAttachment/getAdminsData')->option(['real_name' => '获取上传信息']);
  265. //保存上传信息
  266. Route::get('set/way_data/:is_way', 'file.SystemAttachment/setAdminsData')->option(['real_name' => '保存上传信息']);
  267. //附件分类管理资源路由
  268. Route::resource('category', 'file.SystemAttachmentCategory')->option(['real_name' => [
  269. 'index' => '获取附件分类列表',
  270. 'read' => '获取附件分类详情',
  271. 'create' => '获取创建附件分类表单',
  272. 'save' => '保存附件分类',
  273. 'edit' => '获取修改附件分类表单',
  274. 'update' => '修改附件分类',
  275. 'delete' => '删除附件分类'
  276. ]]);
  277. })->middleware([AuthTokenMiddleware::class]);
  278. /**
  279. * 订单路由
  280. */
  281. Route::group('order', function () {
  282. //订单列表
  283. Route::get('list', 'Order/lst')->name('lst')->option(['real_name' => '订单列表']);
  284. //订单列表获取配送员
  285. Route::get('delivery/list', 'Order/get_delivery_list')->option(['real_name' => '订单列表获取配送员']);
  286. //获取物流公司
  287. Route::get('express_list', 'Order/express')->name('StoreOrdeRexpressList')->option(['real_name' => '获取物流公司']);
  288. //获取订单可拆分商品列表
  289. Route::get('split_cart_info/:id', 'Order/split_cart_info')->name('StoreOrderSplitCartInfo')->option(['real_name' => '获取订单可拆分商品列表']);
  290. //拆单发送货
  291. Route::put('split_delivery/:id', 'Order/split_delivery')->name('StoreOrderSplitDelivery')->option(['real_name' => '拆单发送货']);
  292. //面单默认配置信息
  293. Route::get('sheet_info', 'Order/getDeliveryInfo')->option(['real_name' => '面单默认配置信息']);
  294. //获取物流信息
  295. Route::get('express/:id', 'Order/get_express')->name('StoreOrderUpdateExpress')->option(['real_name' => '获取物流信息']);
  296. //快递公司电子面单模版
  297. Route::get('express/temp', 'Order/express_temp')->option(['real_name' => '快递公司电子面单模版']);
  298. //订单发送货
  299. Route::put('delivery/:id', 'Order/update_delivery')->name('StoreOrderUpdateDelivery')->option(['real_name' => '订单发送货']);
  300. //打印订单
  301. Route::get('print/:id', 'Order/order_print')->name('StoreOrderPrint')->option(['real_name' => '打印订单']);
  302. //确认收货
  303. Route::put('take/:id', 'Order/take_delivery')->name('StoreOrderTakeDelivery')->option(['real_name' => '确认收货']);
  304. //修改备注信息
  305. Route::put('remark/:id', 'Order/remark')->name('StoreOrderorRemark')->option(['real_name' => '修改备注信息']);
  306. //获取订单状态
  307. Route::get('status/:id', 'Order/status')->name('StoreOrderorStatus')->option(['real_name' => '获取订单状态']);
  308. //拆单发送货
  309. Route::put('split_delivery/:id', 'Order/split_delivery')->name('StoreOrderSplitDelivery')->option(['real_name' => '拆单发送货']);
  310. //获取订单拆分子订单列表
  311. Route::get('split_order/:id', 'Order/split_order')->name('StoreOrderSplitOrder')->option(['real_name' => '获取订单拆分子订单列表']);
  312. //订单退款表单
  313. Route::get('refund/:id', 'Order/refund')->name('StoreOrderRefund')->option(['real_name' => '订单退款表单']);
  314. //订单退款
  315. Route::put('refund/:id', 'Order/update_refund')->name('StoreOrderUpdateRefund')->option(['real_name' => '订单退款']);
  316. //订单详情
  317. Route::get('info/:id', 'Order/order_info')->name('SupplierOrderInfo')->option(['real_name' => '订单详情']);
  318. //批量发货
  319. Route::get('hand/batch_delivery', 'Order/hand_batch_delivery')->option(['real_name' => '批量发货']);
  320. //面单默认配置信息
  321. Route::get('sheet_info', 'Order/getDeliveryInfo')->option(['real_name' => '面单默认配置信息']);
  322. //获取不退款表单
  323. Route::get('no_refund/:id', 'Order/no_refund')->name('StoreOrderorNoRefund')->option(['real_name' => '获取不退款表单']);
  324. //修改不退款理由
  325. Route::put('no_refund/:id', 'Order/update_un_refund')->name('StoreOrderorUpdateNoRefund')->option(['real_name' => '修改不退款理由']);
  326. //线下支付
  327. Route::post('pay_offline/:id', 'Order/pay_offline')->name('StoreOrderorPayOffline')->option(['real_name' => '线下支付']);
  328. //获取退积分表单
  329. Route::get('refund_integral/:id', 'Order/refund_integral')->name('StoreOrderorRefundIntegral')->option(['real_name' => '获取退积分表单']);
  330. //修改退积分
  331. Route::put('refund_integral/:id', 'Order/update_refund_integral')->name('StoreOrderorUpdateRefundIntegral')->option(['real_name' => '修改退积分']);
  332. //更多操作打印电子面单
  333. Route::get('order_dump/:order_id', 'Order/order_dump')->option(['real_name' => '更多操作打印电子面单']);
  334. //删除单个订单
  335. Route::delete('del/:id', 'Order/del')->name('StoreOrderorDel')->option(['real_name' => '删除订单单个']);
  336. //批量删除订单
  337. Route::post('dels', 'Order/del_orders')->name('StoreOrderorDels')->option(['real_name' => '批量删除订单']);
  338. //获取订单编辑表单
  339. Route::get('edit/:id', 'Order/edit')->name('StoreOrderEdit')->option(['real_name' => '获取订单编辑表单']);
  340. //修改订单
  341. Route::put('update/:id', 'Order/update')->name('StoreOrderUpdate')->option(['real_name' => '修改订单']);
  342. //获取配送信息表单
  343. Route::get('distribution/:id', 'Order/distribution')->name('StoreOrderDistribution')->option(['real_name' => '获取配送信息表单']);
  344. //修改配送信息
  345. Route::put('distribution/:id', 'Order/update_distribution')->name('StoreOrderUpdateDistribution')->option(['real_name' => '修改配送信息']);
  346. // //订单核销 TODO:供应商暂时无需核销
  347. // Route::post('write', 'Order/write_order')->name('writeOrder')->option(['real_name' => '订单核销']);
  348. // //订单号核销
  349. // Route::put('write_update/:order_id', 'Order/write_update')->name('writeOrderUpdate')->option(['real_name' => '订单号核销']);
  350. //快递公司电子面单模版
  351. Route::get('express/temp', 'Order/express_temp')->option(['real_name' => '快递公司电子面单模版']);
  352. //打印配货单信息
  353. Route::get('distribution_info', 'Order/distributionInfo')->name('StoreOrderDistributionInfo')->option(['real_name' => '打印配货单信息']);
  354. //获取线下付款二维码
  355. Route::get('offline_scan', 'v1.order.OtherOrder/offline_scan')->name('OfflineScan')->option(['real_name' => '获取线下付款二维码']);
  356. //线下收银列表
  357. Route::get('scan_list', 'v1.order.OtherOrder/scan_list')->name('ScanList')->option(['real_name' => '线下收银列表']);
  358. //发票列表头部统计
  359. Route::get('invoice/chart', 'v1.order.StoreOrderInvoice/chart')->name('StoreOrderorInvoiceChart')->option(['real_name' => '发票列表头部统计']);
  360. //申请发票列表
  361. Route::get('invoice/list', 'v1.order.StoreOrderInvoice/list')->name('StoreOrderorInvoiceList')->option(['real_name' => '申请发票列表']);
  362. //设置发票状态
  363. Route::post('invoice/set/:id', 'v1.order.StoreOrderInvoice/set_invoice')->name('StoreOrderorInvoiceSet')->option(['real_name' => '设置发票状态']);
  364. //开票订单详情
  365. Route::get('invoice_order_info/:id', 'v1.order.StoreOrderInvoice/orderInfo')->name('StoreOrderorInvoiceOrderInfo')->option(['real_name' => '开票订单详情']);
  366. //电子面单模板列表
  367. Route::get('expr/temp', 'v1.order.StoreOrder/expr_temp')->option(['real_name' => '电子面单模板列表']);
  368. })->middleware([
  369. AuthTokenMiddleware::class,
  370. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  371. \app\http\middleware\supplier\SupplierLogMiddleware::class
  372. ]);
  373. /**
  374. * 导出excel相关路由
  375. */
  376. Route::group('export', function () {
  377. //订单
  378. Route::get('storeOrder', 'export.ExportExcel/storeOrder')->option(['real_name' => '订单导出']);
  379. //物流公司对照表导出
  380. Route::get('expressList', 'export.ExportExcel/expressList')->option(['real_name' => '物流公司对照表导出']);
  381. //导出批量发货记录
  382. Route::get('batchOrderDelivery/:id/:queueType/:cacheType', 'export.ExportExcel/batchOrderDelivery')->option(['real_name' => '批量发货记录导出']);
  383. //供应商账单导出
  384. Route::get('financeRecord', 'export.ExportExcel/financeRecord')->option(['real_name' => '供应商账单导出']);
  385. })->middleware([
  386. AuthTokenMiddleware::class,
  387. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  388. \app\http\middleware\supplier\SupplierLogMiddleware::class
  389. ]);
  390. /**
  391. * 用户模块 相关路由
  392. */
  393. Route::group('user', function () {
  394. //用户信息
  395. Route::get('user/:id', 'user.User/read')->name('read')->option(['real_name' => '用户信息']);
  396. //获取指定用户的信息
  397. Route::get('one_info/:id', 'user.User/oneUserInfo')->name('oneUserInfo')->option(['real_name' => '获取指定用户的信息']);
  398. //商品浏览列表
  399. Route::get('visit_list/:id', 'user.User/visitList')->name('visitList')->option(['real_name' => '商品浏览列表']);
  400. //推荐人记录列表
  401. Route::get('spread_list/:id', 'user.User/spreadList')->name('spreadList')->option(['real_name' => '推荐人记录列表']);
  402. })->middleware([
  403. AuthTokenMiddleware::class,
  404. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  405. \app\http\middleware\supplier\SupplierLogMiddleware::class
  406. ]);
  407. /**
  408. * 队列任务 相关路由
  409. */
  410. Route::group('queue', function () {
  411. //队列任务列表
  412. Route::get('index', 'queue.Queue/index')->name('index')->option(['real_name' => '队列任务列表']);
  413. //队列批量发货记录
  414. Route::get('delivery/log/:id/:type', 'queue.Queue/delivery_log')->option(['real_name' => '队列批量发货记录']);
  415. //再次执行批量队列任务
  416. Route::get('again/do_queue/:id/:type', 'queue.Queue/again_do_queue')->option(['real_name' => '再次执行批量队列任务']);
  417. //清除异常任务队列
  418. Route::get('del/wrong_queue/:id/:type', 'queue.Queue/del_wrong_queue')->option(['real_name' => '清除异常任务队列']);
  419. //停止队列任务
  420. Route::get('stop/wrong_queue/:id', 'queue.Queue/stop_wrong_queue')->option(['real_name' => '停止队列任务']);
  421. })->middleware([
  422. AuthTokenMiddleware::class,
  423. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  424. \app\http\middleware\supplier\SupplierLogMiddleware::class
  425. ]);
  426. /**
  427. * 售后 相关路由
  428. */
  429. Route::group('refund', function () {
  430. //售后列表
  431. Route::get('list', 'Refund/getRefundList')->option(['real_name' => '售后订单列表']);
  432. //商家同意退款,等待用户退货
  433. Route::get('agree/:order_id', 'Refund/agreeRefund')->option(['real_name' => '商家同意退款,等待用户退货']);
  434. //售后订单备注
  435. Route::put('remark/:id', 'Refund/remark')->option(['real_name' => '售后订单备注']);
  436. //售后订单退款表单
  437. Route::get('refund/:id', 'Refund/refund')->name('StoreOrderRefund')->option(['real_name' => '售后订单退款表单']);
  438. //售后订单退款
  439. Route::put('refund/:id', 'Refund/update_refund')->name('StoreOrderUpdateRefund')->option(['real_name' => '售后订单退款']);
  440. //售后详情
  441. Route::get('detail/:id', 'Refund/detail')->option(['real_name' => '售后订单详情']);
  442. })->middleware([
  443. AuthTokenMiddleware::class,
  444. \app\http\middleware\supplier\SupplierCheckRoleMiddleware::class,
  445. \app\http\middleware\supplier\SupplierLogMiddleware::class
  446. ]);
  447. /**
  448. * miss 路由
  449. */
  450. Route::miss(function () {
  451. if (app()->request->isOptions()) {
  452. $header = Config::get('cookie.header');
  453. $header['Access-Control-Allow-Origin'] = app()->request->header('origin');
  454. return Response::create('ok')->code(200)->header($header);
  455. } else
  456. return Response::create()->code(404);
  457. });
  458. })->prefix('supplier.')->middleware(InstallMiddleware::class)->middleware(AllowOriginMiddleware::class)->middleware(StationOpenMiddleware::class);