hexiao.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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 addYwy(data){
  236. return request({
  237. url: `/jxs/jxsSaveRetail`,
  238. method: 'post',
  239. data: data
  240. })
  241. }
  242. export function updateYwy(data){
  243. return request({
  244. url: `/jxs/jxsUpdateYwy`,
  245. method: 'post',
  246. data: data
  247. })
  248. }
  249. export function delYwy(id){
  250. return request({
  251. url: `/jxs/deleteYwy`,
  252. method: 'post',
  253. params: {
  254. ywyId:id
  255. }
  256. })
  257. }
  258. export function getYwyByIdDetail(id){
  259. return request({
  260. url: `/jxs/getYwyByIdDetail`,
  261. method: 'post',
  262. params: {
  263. ywyId:id
  264. }
  265. })
  266. }
  267. export async function uploadImage(files){
  268. const arr = []
  269. for(let i=0;i<files.length;i++){
  270. let url = files[i].path;
  271. let res = await uploadImageToServer(url);
  272. arr.push(res);
  273. }
  274. return arr;
  275. }
  276. export function addPatrolRecord(data){
  277. return request({
  278. url: `/ywy/addXunStore`,
  279. method: 'post',
  280. data: data
  281. })
  282. }
  283. /**
  284. * 经销商销售总数查询
  285. * @param startDate
  286. * @param endDate
  287. * @returns {*}
  288. */
  289. export function getSalesTotal(startDate,endDate){
  290. return request({
  291. url: `/jxs/salesTotal`,
  292. method: 'post',
  293. params: {
  294. startDate:startDate,
  295. endDate:endDate
  296. }
  297. })
  298. }
  299. /**
  300. * 经销商销售趋势统计
  301. * @param startDate
  302. * @param endDate
  303. * @returns {*}
  304. */
  305. export function getSalesTrend(startDate,endDate){
  306. return request({
  307. url: `/jxs/salesTrend`,
  308. method: 'post',
  309. params: {
  310. startDate:startDate,
  311. endDate:endDate
  312. }
  313. })
  314. }
  315. //业务员
  316. export function getSalesmanSalesTotal(startDate,endDate,ywyId){
  317. return request({
  318. url: `/jxs/salesmanSalesTotal`,
  319. method: 'post',
  320. params: {
  321. startDate:startDate,
  322. endDate:endDate,
  323. ywyId:ywyId
  324. }
  325. })
  326. }
  327. export function getSalesmanSalesTrend(startDate,endDate,ywyId){
  328. return request({
  329. url: `/jxs/salesmanSalesTrend`,
  330. method: 'post',
  331. params: {
  332. startDate:startDate,
  333. endDate:endDate,
  334. ywyId:ywyId
  335. }
  336. })
  337. }
  338. export function getSalesmanVisitTrend(startDate,endDate,ywyId){
  339. return request({
  340. url: `/jxs/salesmanVisitTrend`,
  341. method: 'post',
  342. params: {
  343. startDate:startDate,
  344. endDate:endDate,
  345. ywyId:ywyId
  346. }
  347. })
  348. }