hexiao.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. import request from '@/utils/requestAdmin'
  2. import {uploadImageToServer} from "../utils/requestAdmin";
  3. //返送验证码
  4. export function getVerificationCode(tel,userType){
  5. return request({
  6. url: `/miniapp/sendYzm?tel=`+ tel+"&userType="+userType,
  7. method: 'post',
  8. })
  9. }
  10. //登录
  11. export function login(tel,code,userType,jsCode){
  12. return request({
  13. url: `/miniapp/login`,
  14. method: 'post',
  15. params: {
  16. phone:tel,
  17. userType:userType,
  18. code:code,
  19. jsCode
  20. }
  21. })
  22. }
  23. export function getAdminUserInfo(){
  24. return request({
  25. url: `/miniapp/getAdminUserInfo`,
  26. method: 'post',
  27. })
  28. }
  29. export function getQrcodeNum(code,type){
  30. return request({
  31. url: `/ywy/getQrcodeNum`,
  32. method: 'post',
  33. params: {
  34. qrCode:code,
  35. operationType:type
  36. }
  37. })
  38. }
  39. export function doCommitToJxs(id){
  40. return request({
  41. url: `/ywy/writeOffSubmit`,
  42. method: 'post',
  43. params: {
  44. orderId:id
  45. }
  46. })
  47. }
  48. export function parseLocation(latitute,longitute){
  49. return request({
  50. url: `/miniapp/getLocation`,
  51. method: 'post',
  52. data: {
  53. latitute: latitute,
  54. longitute: longitute
  55. }
  56. })
  57. }
  58. export function xundianRecord(pageIndex,pageSize,storeName){
  59. return request({
  60. url: `/ywy/queryXunJi`,
  61. method: 'post',
  62. params: {
  63. pageIndex:pageIndex,
  64. pageSize:pageSize,
  65. storeName:storeName
  66. }
  67. })
  68. }
  69. export function doCommitToChang(id){
  70. return request({
  71. url: `/jxs/writeOffSubmit`,
  72. method: 'post',
  73. params: {
  74. orderId:id
  75. }
  76. })
  77. }
  78. export function active(data){
  79. return request({
  80. url: `/ywy/active`,
  81. method: 'post',
  82. data: data
  83. })
  84. }
  85. export function writeOff(data){
  86. return request({
  87. url: `/ywy/writeOff`,
  88. method: 'post',
  89. data: data
  90. })
  91. }
  92. export function getRetailDetail(id){
  93. return request({
  94. url: `/store/show`,
  95. method: 'post',
  96. params: {
  97. id:id
  98. }
  99. })
  100. }
  101. export function removeRetail(id){
  102. return request({
  103. url: `/store/delete`,
  104. method: 'post',
  105. params: {
  106. id:id
  107. }
  108. })
  109. }
  110. export function getStoreList(pageIndex,pageSize,storeName){
  111. return request({
  112. url: `/store/queryPage`,
  113. method: 'post',
  114. params: {
  115. pageIndex:pageIndex,
  116. pageSize:pageSize,
  117. storeName:storeName
  118. }
  119. })
  120. }
  121. export function addStore(store_name,contact_name,contact_phone,address,store_photo){
  122. return request({
  123. url: `/store/save`,
  124. method: 'post',
  125. params: {
  126. store_name:store_name,
  127. contact_name:contact_name,
  128. contact_phone:contact_phone,
  129. address:address,
  130. store_photo:store_photo
  131. }
  132. })
  133. }
  134. export function updateStore(id,store_name,contact_name,contact_phone,address, store_photo){
  135. return request({
  136. url: `/store/update`,
  137. method: 'post',
  138. params: {
  139. id:id,
  140. store_name:store_name,
  141. contact_name:contact_name,
  142. contact_phone:contact_phone,
  143. address:address,
  144. store_photo:store_photo
  145. }
  146. })
  147. }
  148. /**
  149. * 查询上货记录
  150. * @param pageIndex
  151. * @param pageSize
  152. * @returns {*}
  153. */
  154. export function queryActiveRecord(pageIndex,pageSize,storeName,startTime,endTime){
  155. return request({
  156. url: `/ywy/queryActiveRecord`,
  157. method: 'post',
  158. params: {
  159. pageIndex:pageIndex,
  160. pageSize:pageSize,
  161. storeName,
  162. startTime,
  163. endTime
  164. }
  165. })
  166. }
  167. /**
  168. * 查询上货记录
  169. * @param pageIndex
  170. * @param pageSize
  171. * @returns {*}
  172. */
  173. export function queryAddRecord(data){
  174. return request({
  175. url: `/ywy/writeOffRecord`,
  176. method: 'post',
  177. data: data
  178. });
  179. }
  180. /**
  181. * 核销记录的明细
  182. * @param id
  183. * @returns {*}
  184. */
  185. export function queryAddRecordDetail(id){
  186. return request({
  187. url: `/ywy/queryWriteOffDetail`,
  188. method: 'post',
  189. params: {
  190. orderNo:id
  191. }
  192. })
  193. }
  194. /**
  195. * 经销商核销记录
  196. * @param id
  197. * @returns {*}
  198. */
  199. export function queryJxsAddRecord(data){
  200. return request({
  201. url: `/jxs/writeOffRecord`,
  202. method: 'post',
  203. data: data
  204. });
  205. }
  206. /**
  207. * 经销商核销记录
  208. * @param id
  209. * @returns {*}
  210. */
  211. export function queryJxsAddRecordDetail(id){
  212. return request({
  213. url: `/jxs/queryWriteOffDetail`,
  214. method: 'post',
  215. params: {
  216. orderNo:id
  217. }
  218. })
  219. }
  220. export function ywyList(keyword){
  221. return request({
  222. url: `/jxs/jxsRetailListQuery`,
  223. method: 'post',
  224. params: {
  225. keyword:keyword
  226. }
  227. })
  228. }
  229. export function areaList(keyword){
  230. return request({
  231. url: `/jxs/jxsAreaList`,
  232. method: 'post',
  233. })
  234. }
  235. export function getStoreSalesSummary(startDate,endDate,storeId){
  236. return request({
  237. url: `/ywy/storeSalesSummary`,
  238. method: 'post',
  239. params: {
  240. startDate:startDate,
  241. endDate:endDate,
  242. storeId:storeId
  243. }
  244. })
  245. }
  246. export function getStoreSalesTrend(startDate,endDate,storeId){
  247. return request({
  248. url: `/ywy/storeSalesTrend`,
  249. method: 'post',
  250. params: {
  251. startDate:startDate,
  252. endDate:endDate,
  253. storeId:storeId
  254. }
  255. })
  256. }
  257. export function addYwy(data){
  258. return request({
  259. url: `/jxs/jxsSaveRetail`,
  260. method: 'post',
  261. data: data
  262. })
  263. }
  264. export function updateYwy(data){
  265. return request({
  266. url: `/jxs/jxsUpdateYwy`,
  267. method: 'post',
  268. data: data
  269. })
  270. }
  271. export function delYwy(id){
  272. return request({
  273. url: `/jxs/deleteYwy`,
  274. method: 'post',
  275. params: {
  276. ywyId:id
  277. }
  278. })
  279. }
  280. export function getYwyByIdDetail(id){
  281. return request({
  282. url: `/jxs/getYwyByIdDetail`,
  283. method: 'post',
  284. params: {
  285. ywyId:id
  286. }
  287. })
  288. }
  289. export async function uploadImage(files){
  290. const arr = []
  291. for(let i=0;i<files.length;i++){
  292. let url = files[i].path;
  293. let res = await uploadImageToServer(url);
  294. arr.push(res);
  295. }
  296. return arr;
  297. }
  298. export function addPatrolRecord(data){
  299. return request({
  300. url: `/ywy/addXunStore`,
  301. method: 'post',
  302. data: data
  303. })
  304. }
  305. /**
  306. * 经销商销售总数查询
  307. * @param startDate
  308. * @param endDate
  309. * @returns {*}
  310. */
  311. export function getSalesTotal(startDate,endDate){
  312. return request({
  313. url: `/jxs/salesTotal`,
  314. method: 'post',
  315. params: {
  316. startDate:startDate,
  317. endDate:endDate
  318. }
  319. })
  320. }
  321. /**
  322. * 经销商销售趋势统计
  323. * @param startDate
  324. * @param endDate
  325. * @returns {*}
  326. */
  327. export function getSalesTrend(startDate,endDate){
  328. return request({
  329. url: `/jxs/salesTrend`,
  330. method: 'post',
  331. params: {
  332. startDate:startDate,
  333. endDate:endDate
  334. }
  335. })
  336. }
  337. //业务员
  338. export function getSalesmanSalesTotal(startDate,endDate,ywyId){
  339. return request({
  340. url: `/jxs/salesmanSalesTotal`,
  341. method: 'post',
  342. params: {
  343. startDate:startDate,
  344. endDate:endDate,
  345. ywyId:ywyId
  346. }
  347. })
  348. }
  349. export function getSalesmanSalesTrend(startDate,endDate,ywyId){
  350. return request({
  351. url: `/jxs/salesmanSalesTrend`,
  352. method: 'post',
  353. params: {
  354. startDate:startDate,
  355. endDate:endDate,
  356. ywyId:ywyId
  357. }
  358. })
  359. }
  360. export function getSalesmanVisitTrend(startDate,endDate,ywyId){
  361. return request({
  362. url: `/jxs/salesmanVisitTrend`,
  363. method: 'post',
  364. params: {
  365. startDate:startDate,
  366. endDate:endDate,
  367. ywyId:ywyId
  368. }
  369. })
  370. }