hexiao.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. import request from '@/utils/requestAdmin'
  2. import {uploadImageToServer} from "../utils/requestAdmin";
  3. //返送验证码
  4. export function getVerificationCode(tel,userType,tenantId){
  5. return request({
  6. url: `/miniapp/sendYzm`,
  7. method: 'post',
  8. params: {
  9. tel:tel,
  10. userType:userType,
  11. tenantId:tenantId
  12. }
  13. })
  14. }
  15. //登录
  16. export function login(tel,code,userType,jsCode,tenantId){
  17. return request({
  18. url: `/miniapp/login`,
  19. method: 'post',
  20. params: {
  21. phone:tel,
  22. userType:userType,
  23. code:code,
  24. jsCode,
  25. tenantId
  26. }
  27. })
  28. }
  29. export function getAdminUserInfo(){
  30. return request({
  31. url: `/miniapp/getAdminUserInfo`,
  32. method: 'post',
  33. })
  34. }
  35. export function getQrcodeNum(code,type){
  36. return request({
  37. url: `/ywy/getQrcodeNum`,
  38. method: 'post',
  39. params: {
  40. qrCode:code,
  41. operationType:type
  42. }
  43. })
  44. }
  45. export function doCommitToJxs(id){
  46. return request({
  47. url: `/ywy/writeOffSubmit`,
  48. method: 'post',
  49. params: {
  50. orderId:id
  51. }
  52. })
  53. }
  54. /**
  55. * 获取产品列表
  56. */
  57. export function getProductList(){
  58. return request({
  59. url: `/dealer/getProductList`,
  60. method: 'post',
  61. })
  62. }
  63. /**
  64. * 添加订单
  65. */
  66. export function addDealerOrder(data){
  67. return request({
  68. url: `/dealer/save`,
  69. method: 'post',
  70. data: data
  71. })
  72. }
  73. /**
  74. * 修改订单
  75. */
  76. export function editDealerOrder(data){
  77. return request({
  78. url: `/dealer/edit`,
  79. method: 'post',
  80. data: data
  81. })
  82. }
  83. /**
  84. * 确定订单
  85. */
  86. export function confirmDealerOrder(id){
  87. return request({
  88. url: `/dealer/confirmReceipt`,
  89. method: 'post',
  90. params: {
  91. id:id
  92. }
  93. })
  94. }
  95. export function parseLocation(latitute,longitute){
  96. return request({
  97. url: `/miniapp/getLocation`,
  98. method: 'post',
  99. data: {
  100. latitute: latitute,
  101. longitute: longitute
  102. }
  103. })
  104. }
  105. /**
  106. * 积分明细
  107. * @param pageIndex
  108. * @param pageSize
  109. */
  110. export function scoreRecord(pageIndex,pageSize){
  111. return request({
  112. url: `/ywy/queryPointRecord`,
  113. method: 'post',
  114. params: {
  115. pageIndex:pageIndex,
  116. pageSize:pageSize,
  117. }
  118. })
  119. }
  120. export function xundianRecord(data){
  121. return request({
  122. url: `/ywy/queryXunJi`,
  123. method: 'post',
  124. data
  125. })
  126. }
  127. /**
  128. * 获取巡店明细的详情
  129. * @param id
  130. */
  131. export function getXundianDetail(id){
  132. return request({
  133. url: `/ywy/queryXunJiDetail`,
  134. method: 'post',
  135. params: {
  136. recordId:id
  137. }
  138. })
  139. }
  140. export function doCommitToChang(id){
  141. let url = '/jxs/writeOffSubmit';
  142. if(id != -1){
  143. url = url + "?id="+id
  144. }
  145. return request({
  146. url: url,
  147. method: 'post',
  148. })
  149. }
  150. export function active(data){
  151. return request({
  152. url: `/ywy/active`,
  153. method: 'post',
  154. data: data
  155. })
  156. }
  157. /**
  158. * 上货详情
  159. * @param data
  160. * @returns {*}
  161. */
  162. export function queryActiveDetail(id){
  163. return request({
  164. url: `/ywy/queryActiveRecordDetail`,
  165. method: 'post',
  166. params: {
  167. recordId:id
  168. }
  169. })
  170. }
  171. export function writeOff(data){
  172. return request({
  173. url: `/ywy/writeOff`,
  174. method: 'post',
  175. data: data
  176. })
  177. }
  178. export function getRetailDetail(id){
  179. return request({
  180. url: `/store/show`,
  181. method: 'post',
  182. params: {
  183. id:id
  184. }
  185. })
  186. }
  187. export function removeRetail(id){
  188. return request({
  189. url: `/store/delete`,
  190. method: 'post',
  191. params: {
  192. id:id
  193. }
  194. })
  195. }
  196. export function getStoreList(pageIndex,pageSize,storeName,ywyId){
  197. let data = {
  198. pageIndex:pageIndex,
  199. pageSize:pageSize,
  200. storeName:storeName,
  201. }
  202. if(ywyId>0){
  203. data.ywyId = ywyId;
  204. }
  205. return request({
  206. url: `/store/queryPage`,
  207. method: 'post',
  208. params: data
  209. })
  210. }
  211. export function addStore(store_name,contact_name,contact_phone,address,store_photo){
  212. return request({
  213. url: `/store/save`,
  214. method: 'post',
  215. params: {
  216. store_name:store_name,
  217. contact_name:contact_name,
  218. contact_phone:contact_phone,
  219. address:address,
  220. store_photo:store_photo
  221. }
  222. })
  223. }
  224. export function updateStore(id,store_name,contact_name,contact_phone,address, store_photo){
  225. return request({
  226. url: `/store/update`,
  227. method: 'post',
  228. params: {
  229. id:id,
  230. store_name:store_name,
  231. contact_name:contact_name,
  232. contact_phone:contact_phone,
  233. address:address,
  234. store_photo:store_photo
  235. }
  236. })
  237. }
  238. /**
  239. * 查询上货记录
  240. * @param pageIndex
  241. * @param pageSize
  242. * @returns {*}
  243. */
  244. export function queryActiveRecord(pageIndex,pageSize,storeName,startTime,endTime){
  245. return request({
  246. url: `/ywy/queryActiveRecord`,
  247. method: 'post',
  248. params: {
  249. pageIndex:pageIndex,
  250. pageSize:pageSize,
  251. storeName,
  252. startTime,
  253. endTime
  254. }
  255. })
  256. }
  257. /**
  258. * 查询上货记录
  259. * @param pageIndex
  260. * @param pageSize
  261. * @returns {*}
  262. */
  263. export function queryAddRecord(data){
  264. return request({
  265. url: `/ywy/writeOffRecord`,
  266. method: 'post',
  267. data: data
  268. });
  269. }
  270. /**
  271. * 经销商核销订单id
  272. * @param data
  273. * @returns {*}
  274. */
  275. export function queryAddJxsRecordDetail(data){
  276. return request({
  277. url: `/jxs/queryWriteOffDetail`,
  278. method: 'post',
  279. data: data
  280. });
  281. }
  282. /**
  283. * 核销记录的明细
  284. * @param id
  285. * @returns {*}
  286. */
  287. export function queryAddRecordDetail(id){
  288. return request({
  289. url: `/ywy/queryWriteOffDetail`,
  290. method: 'post',
  291. params: {
  292. orderNo:id
  293. }
  294. })
  295. }
  296. /**
  297. * 经销商核销记录的明细
  298. * @param id
  299. * @returns {*}
  300. */
  301. export function queryPendingWriteOffDetail(data){
  302. return request({
  303. url: `/jxs/queryPendingWriteOffDetail`,
  304. method: 'post',
  305. data:data
  306. })
  307. }
  308. /**
  309. * 经销商查询核销记录
  310. * @param data
  311. * @returns {*}
  312. */
  313. export function queryHexiaoRecord(data){
  314. return request({
  315. url: `/jxs/writeOffRecord`,
  316. method: 'post',
  317. data: data
  318. });
  319. }
  320. /**
  321. * 经销商订货记录
  322. * @param id
  323. * @returns {*}
  324. */
  325. export function queryJxsAddRecord(data){
  326. return request({
  327. url: `/dealer/list`,
  328. method: 'post',
  329. data: data
  330. });
  331. }
  332. /**
  333. * 获取订单详情
  334. * @param id
  335. */
  336. export function getOrderDetail(id){
  337. return request({
  338. url: `/dealer/getOrderDetail`,
  339. method: 'post',
  340. params: {
  341. id:id
  342. }
  343. });
  344. }
  345. /**
  346. * 经销商核销记录
  347. * @param id
  348. * @returns {*}
  349. */
  350. export function queryJxsAddRecordDetail(id){
  351. return request({
  352. url: `/jxs/queryWriteOffDetail`,
  353. method: 'post',
  354. params: {
  355. orderNo:id
  356. }
  357. })
  358. }
  359. export function ywyList(keyword){
  360. return request({
  361. url: `/jxs/jxsRetailListQuery`,
  362. method: 'post',
  363. params: {
  364. keyword:keyword
  365. }
  366. })
  367. }
  368. export function areaList(keyword){
  369. return request({
  370. url: `/jxs/jxsAreaList`,
  371. method: 'post',
  372. })
  373. }
  374. export function getStoreSalesSummary(startDate,endDate,storeId){
  375. return request({
  376. url: `/ywy/storeSalesSummary`,
  377. method: 'post',
  378. params: {
  379. startDate:startDate,
  380. endDate:endDate,
  381. storeId:storeId
  382. }
  383. })
  384. }
  385. export function getStoreSalesTrend(startDate,endDate,storeId){
  386. return request({
  387. url: `/ywy/storeSalesTrend`,
  388. method: 'post',
  389. params: {
  390. startDate:startDate,
  391. endDate:endDate,
  392. storeId:storeId
  393. }
  394. })
  395. }
  396. export function addYwy(data){
  397. return request({
  398. url: `/jxs/jxsSaveRetail`,
  399. method: 'post',
  400. data: data
  401. })
  402. }
  403. export function updateYwy(data){
  404. return request({
  405. url: `/jxs/jxsUpdateYwy`,
  406. method: 'post',
  407. data: data
  408. })
  409. }
  410. export function delYwy(id){
  411. return request({
  412. url: `/jxs/deleteYwy`,
  413. method: 'post',
  414. params: {
  415. ywyId:id
  416. }
  417. })
  418. }
  419. export function getYwyByIdDetail(id){
  420. return request({
  421. url: `/jxs/getYwyByIdDetail`,
  422. method: 'post',
  423. params: {
  424. ywyId:id
  425. }
  426. })
  427. }
  428. export async function uploadImage(files){
  429. const arr = []
  430. for(let i=0;i<files.length;i++){
  431. let url = files[i].path;
  432. if(url.indexOf("https") != -1){
  433. arr.push(url)
  434. continue;
  435. }
  436. let res = await uploadImageToServer(url);
  437. arr.push(res);
  438. }
  439. return arr;
  440. }
  441. export function addPatrolRecord(data){
  442. return request({
  443. url: `/ywy/addXunStore`,
  444. method: 'post',
  445. data: data
  446. })
  447. }
  448. /**
  449. * 查询经销商待审核数据
  450. * @returns {*}
  451. */
  452. export function queryPendingWriteOffRecord(data){
  453. return request({
  454. url: `/jxs/queryPendingWriteOffRecord`,
  455. method: 'post',
  456. data: data
  457. })
  458. }
  459. /**
  460. * 查询经销商待审核数据
  461. * @returns {*}
  462. */
  463. export function queryPendingWriteOffRecordDetail(data){
  464. return request({
  465. url: `/jxs/queryPendingWriteOffDetail`,
  466. method: 'post',
  467. data: data
  468. })
  469. }
  470. /**
  471. * 经销商销售总数查询
  472. * @param startDate
  473. * @param endDate
  474. * @returns {*}
  475. */
  476. export function getSalesTotal(startDate,endDate){
  477. return request({
  478. url: `/jxs/salesTotal`,
  479. method: 'post',
  480. params: {
  481. startDate:startDate,
  482. endDate:endDate
  483. }
  484. })
  485. }
  486. /**
  487. * 经销商销售趋势统计
  488. * @param startDate
  489. * @param endDate
  490. * @returns {*}
  491. */
  492. export function getSalesTrend(startDate,endDate){
  493. return request({
  494. url: `/jxs/salesTrend`,
  495. method: 'post',
  496. params: {
  497. startDate:startDate,
  498. endDate:endDate
  499. }
  500. })
  501. }
  502. //业务员
  503. export function getSalesmanSalesTotal(startDate,endDate,ywyId){
  504. return request({
  505. url: `/jxs/salesmanSalesTotal`,
  506. method: 'post',
  507. params: {
  508. startDate:startDate,
  509. endDate:endDate,
  510. ywyId:ywyId
  511. }
  512. })
  513. }
  514. export function getSalesmanSalesTrend(startDate,endDate,ywyId){
  515. return request({
  516. url: `/jxs/salesmanSalesTrend`,
  517. method: 'post',
  518. params: {
  519. startDate:startDate,
  520. endDate:endDate,
  521. ywyId:ywyId
  522. }
  523. })
  524. }
  525. export function getSalesmanVisitTrend(startDate,endDate,ywyId){
  526. return request({
  527. url: `/jxs/salesmanVisitTrend`,
  528. method: 'post',
  529. params: {
  530. startDate:startDate,
  531. endDate:endDate,
  532. ywyId:ywyId
  533. }
  534. })
  535. }