salesNew.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. import { axios } from '@/utils/request'
  2. // 销售 统计查询
  3. export const salesCount = (params) => {
  4. return axios({
  5. url: `/sales/queryCount`,
  6. data: params,
  7. method: 'post'
  8. })
  9. }
  10. // 销售 列表 有分页
  11. export const salesList = (params) => {
  12. const url = `/sales/queryPage/${params.pageNo}/${params.pageSize}`
  13. delete params.pageNo
  14. delete params.pageSize
  15. return axios({
  16. url: url,
  17. data: params,
  18. method: 'post',
  19. headers: {
  20. 'module': encodeURIComponent('列表查询')
  21. }
  22. })
  23. }
  24. // 第三方库存
  25. export const getThirdStockQty = (params) => {
  26. return axios({
  27. url: `/sunFulcess/getStockQty`,
  28. data: params,
  29. method: 'post'
  30. })
  31. }
  32. // 是否已转采购单
  33. export const getCreatePurchaseFlag = (params) => {
  34. return axios({
  35. url: `/sales/getCreatePurchaseFlag`,
  36. data: params,
  37. method: 'post'
  38. })
  39. }
  40. // 转采购单
  41. export const allCreatePurchase = (params) => {
  42. return axios({
  43. url: `/sales/allCreatePurchase`,
  44. data: params,
  45. method: 'post'
  46. })
  47. }
  48. // 销售 待转费用单列表 有分页
  49. export const salesConvertExpenseList = (params) => {
  50. const url = `/salesPromo/queryBatchConvertExpenseAccountPage/${params.pageNo}/${params.pageSize}`
  51. delete params.pageNo
  52. delete params.pageSize
  53. return axios({
  54. url: url,
  55. data: params,
  56. method: 'post',
  57. headers: {
  58. 'module': encodeURIComponent('待转费用报销单列表')
  59. }
  60. })
  61. }
  62. // 销售 新增
  63. export const salesSave = (params) => {
  64. return axios({
  65. url: '/sales/insert',
  66. data: params,
  67. method: 'post',
  68. headers: {
  69. 'module': encodeURIComponent('新增销售单')
  70. }
  71. })
  72. }
  73. // 销售 编辑
  74. export const salesModify = (params) => {
  75. return axios({
  76. url: '/sales/modifyWarehouse',
  77. data: params,
  78. method: 'post',
  79. headers: {
  80. 'module': encodeURIComponent('修改仓库')
  81. }
  82. })
  83. }
  84. // 销售 详情bysn
  85. export const salesDetailBySn = (params) => {
  86. return axios({
  87. url: `/sales/findBySn/${params.salesBillSn}`,
  88. method: 'get'
  89. })
  90. }
  91. // 查询客户名称
  92. export const salesDetailByNo = (params) => {
  93. return axios({
  94. url: `/sales/findBySaleBillNo/${params.salesBillNo}`,
  95. method: 'get',
  96. headers: {
  97. 'module': encodeURIComponent('查询客户信息')
  98. }
  99. })
  100. }
  101. // 销售 删除
  102. export const salesDel = (params) => {
  103. return axios({
  104. url: `/sales/delete/${params.salesBillSn}`,
  105. method: 'get',
  106. headers: {
  107. 'module': encodeURIComponent('删除')
  108. }
  109. })
  110. }
  111. // 销售 取消
  112. export const salesCancle = (params) => {
  113. return axios({
  114. url: `/sales/cancle/${params.salesBillSn}`,
  115. method: 'get',
  116. headers: {
  117. 'module': encodeURIComponent('取消')
  118. }
  119. })
  120. }
  121. // 根据销售单sn查询参加的活动
  122. export const salesPromoQueryList = (params) => {
  123. return axios({
  124. url: `/salesPromo/queryExtList`,
  125. data: params,
  126. method: 'post',
  127. headers: {
  128. 'module': encodeURIComponent('查询销售单参加的活动统计信息')
  129. }
  130. })
  131. }
  132. // 销售单活动统计列表-新
  133. export const salesPromoQueryStatisticsList = (params) => {
  134. return axios({
  135. url: `/salesPromo/querySortListBySalesBillSn`,
  136. data: params,
  137. method: 'post',
  138. headers: {
  139. 'module': encodeURIComponent('查询销售单参加的活动统计信息')
  140. }
  141. })
  142. }
  143. // 特价规则优先级-新
  144. export const salesPromoDiscountSort = (params) => {
  145. return axios({
  146. url: `/salesPromo/queryStackDiscountPromo/${params.salesBillSn}`,
  147. data: params,
  148. method: 'post',
  149. headers: {
  150. 'module': encodeURIComponent('特价规则优先级排序')
  151. }
  152. })
  153. }
  154. // 保存特价排序-新
  155. export const salesPromoSaveSort = (params) => {
  156. return axios({
  157. url: `/salesPromo/updateBatchById`,
  158. data: params,
  159. method: 'post',
  160. headers: {
  161. 'module': encodeURIComponent('保存特价活动排序')
  162. }
  163. })
  164. }
  165. // 更换促销,可更换活动列表
  166. export const salesPromoMatchProduct = (params) => {
  167. return axios({
  168. url: `/salesPromo/queryMatchProduct`,
  169. data: params,
  170. method: 'post'
  171. })
  172. }
  173. // 判断是否有新的活动
  174. export const salesQueryUnPartPromo = (params) => {
  175. return axios({
  176. url: `/salesPromo/queryUnPartPromo/${params.salesBillSn}`,
  177. data: params,
  178. method: 'post'
  179. })
  180. }
  181. // 活动优惠明细接口
  182. export const salesPromoQueryCount = (params) => {
  183. return axios({
  184. url: `/salesPromo/queryCount`,
  185. data: params,
  186. method: 'post'
  187. })
  188. }
  189. // 提交时活动规则校验
  190. export const salesPromoValidaSubmit = (params) => {
  191. return axios({
  192. url: `/salesPromo/validationSubmit/${params.salesBillSn}`,
  193. data: params,
  194. method: 'post',
  195. headers: {
  196. 'module': encodeURIComponent('提交前活动规则校验')
  197. }
  198. })
  199. }
  200. // 审核时活动规则校验
  201. export const salesPromoValidaAudit = (params) => {
  202. return axios({
  203. url: `/salesPromo/validationAudit/${params.salesBillSn}`,
  204. data: params,
  205. method: 'post',
  206. headers: {
  207. 'module': encodeURIComponent('审核前活动规则校验')
  208. }
  209. })
  210. }
  211. // 销售 审核通过
  212. export const salesWriteAuditPass = (params) => {
  213. return axios({
  214. url: '/sales/auditPass',
  215. data: params,
  216. method: 'post',
  217. headers: {
  218. 'module': encodeURIComponent('审核通过')
  219. }
  220. })
  221. }
  222. // 销售 审核驳回
  223. export const salesWriteAuditReject = (params) => {
  224. return axios({
  225. url: '/sales/auditReject',
  226. data: params,
  227. method: 'post',
  228. headers: {
  229. 'module': encodeURIComponent('审核驳回')
  230. }
  231. })
  232. }
  233. // 销售 审核通过 待上级审核
  234. export const salesWriteUpAuditPass = (params) => {
  235. return axios({
  236. url: '/sales/upAuditPass',
  237. data: params,
  238. method: 'post',
  239. headers: {
  240. 'module': encodeURIComponent('审核通过,待上级审核')
  241. }
  242. })
  243. }
  244. // 销售 一键审核下推
  245. export const salesWriteAuditPush = (params) => {
  246. return axios({
  247. url: '/sales/auditPush',
  248. data: params,
  249. method: 'post',
  250. headers: {
  251. 'module': encodeURIComponent('一键审核')
  252. }
  253. })
  254. }
  255. // 销售 提交
  256. export const salesWriteSubmit = (params) => {
  257. return axios({
  258. url: '/sales/submit',
  259. data: params,
  260. method: 'post',
  261. headers: {
  262. 'module': encodeURIComponent('提交')
  263. }
  264. })
  265. }
  266. // 是否更新价格判断
  267. export const submitCheck = (params) => {
  268. return axios({
  269. url: '/sales/submitCheck',
  270. method: 'post',
  271. data: params
  272. })
  273. }
  274. // 改单弹窗价格列表
  275. export const changeBillCheck = (params) => {
  276. return axios({
  277. url: '/sales/changeBillCheck',
  278. method: 'post',
  279. data: params
  280. })
  281. }
  282. // 更新改单数据
  283. export const changeBillCheckUpdatePrice = (params) => {
  284. return axios({
  285. url: '/sales/changeBillCheckUpdatePrice',
  286. method: 'post',
  287. data: params
  288. })
  289. }
  290. // 当前价格 提交
  291. export const updateBatch = (params) => {
  292. return axios({
  293. url: '/sales/detail/updateBatch',
  294. method: 'post',
  295. data: params,
  296. headers: {
  297. 'module': encodeURIComponent('价格批量更新')
  298. }
  299. })
  300. }
  301. // 销售详情列表所有包括活动产品不分页
  302. export const salesDetailAllList = (params) => {
  303. const url = `/sales/detail/queryAll`
  304. return axios({
  305. url: url,
  306. data: params,
  307. method: 'post',
  308. headers: {
  309. 'module': encodeURIComponent('销售单明细列表查询')
  310. }
  311. })
  312. }
  313. // 查询可生成的费用报销单
  314. export const queryCreateBySalesBillSn = (params) => {
  315. return axios({
  316. url: `/expenseAccount/queryCreateBySalesBillSn/${params.salesBillSn}`,
  317. data: params,
  318. method: 'post'
  319. })
  320. }
  321. // 批量查询可生成的费用报销单
  322. export const queryBatchCreateBySalesBillSn = (params) => {
  323. return axios({
  324. url: `/expenseAccount/queryBatchCreateBySalesPromoSnList`,
  325. data: params,
  326. method: 'post'
  327. })
  328. }
  329. // 批量查询合并后的报销单
  330. export const queryBatchCreateBySalesPromoSnListGroupType = (params) => {
  331. return axios({
  332. url: `/expenseAccount/queryBatchCreateBySalesPromoSnListGroupType`,
  333. data: params,
  334. method: 'post',
  335. headers: {
  336. 'module': encodeURIComponent('销售单合并后转费用报销单')
  337. }
  338. })
  339. }
  340. // 保存合并选项
  341. export const expenseAccountSaveGroupType = (params) => {
  342. return axios({
  343. url: `/expenseAccount/saveCreateGroupType`,
  344. data: params,
  345. method: 'post',
  346. headers: {
  347. 'module': encodeURIComponent('销售单转费用报销单,确定合并')
  348. }
  349. })
  350. }
  351. // 保存费用报销单
  352. export const expenseAccountSave = (params) => {
  353. return axios({
  354. url: `/expenseAccount/saveCreate`,
  355. data: params,
  356. method: 'post',
  357. headers: {
  358. 'module': encodeURIComponent('转费用报销单')
  359. }
  360. })
  361. }
  362. // 销售 打印
  363. export const salesPrint = (params) => {
  364. return axios({
  365. url: '/sales/print',
  366. data: params,
  367. method: 'post',
  368. headers: {
  369. 'module': encodeURIComponent('销售打印')
  370. }
  371. })
  372. }
  373. // 销售 打印预览
  374. export const salesPrintPreview = (params) => {
  375. return axios({
  376. url: '/sales/printPreview',
  377. data: params,
  378. method: 'post',
  379. headers: {
  380. 'module': encodeURIComponent('销售打印预览')
  381. }
  382. })
  383. }
  384. // 销售 详情 该销售单的产品二级分类
  385. export const salesDetailProductType = (params) => {
  386. return axios({
  387. url: `/sales/detail/queryProductType/${params.sn}`,
  388. method: 'get'
  389. })
  390. }
  391. // 销售 详情 打印
  392. export const salesDetailPrint = params => {
  393. const url = `/sales/print/${params.priceType}`
  394. const id = params.priceType.indexOf('_TYPE') >= 0 ? '销售分类打印' : '销售打印'
  395. delete params.priceType
  396. return axios.request({
  397. url: url,
  398. data: params,
  399. method: 'post',
  400. responseType: 'blob',
  401. headers: {
  402. 'module': encodeURIComponent(id)
  403. }
  404. })
  405. }
  406. // 销售 详情 导出
  407. export const salesDetailExcel = params => {
  408. const url = `/sales/excel/${params.priceType}`
  409. delete params.priceType
  410. return axios.request({
  411. url: url,
  412. data: params,
  413. method: 'post',
  414. responseType: 'blob',
  415. headers: {
  416. 'module': encodeURIComponent('导出Excel')
  417. }
  418. })
  419. }
  420. // 销售 详情 分类导出
  421. export const salesDetailTypeExcel = params => {
  422. const url = `/sales/detail/typeExcel`
  423. return axios.request({
  424. url: url,
  425. data: params,
  426. method: 'post',
  427. responseType: 'blob',
  428. headers: {
  429. 'module': encodeURIComponent('销售分类导出')
  430. }
  431. })
  432. }
  433. // 仓库销售单
  434. // 按仓库查询销售单 列表 有分页
  435. export const queryPageForWarehouse = (params) => {
  436. const url = `/sales/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  437. delete params.pageNo
  438. delete params.pageSize
  439. return axios({
  440. url: url,
  441. data: params,
  442. method: 'post',
  443. headers: {
  444. 'module': encodeURIComponent('列表查询')
  445. }
  446. })
  447. }
  448. // 获取按仓库查询销售单数量
  449. export const queryCountForWarehouse = (params) => {
  450. return axios({
  451. url: '/sales/queryCountForWarehouse',
  452. method: 'post',
  453. data: params
  454. })
  455. }
  456. // 按仓库查询销售明细 列表
  457. export const queryPageForWarehouseDetail = (params) => {
  458. const url = `/sales/detail/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  459. delete params.pageNo
  460. delete params.pageSize
  461. return axios({
  462. url: url,
  463. data: params,
  464. method: 'post',
  465. headers: {
  466. 'module': encodeURIComponent('明细列表查询')
  467. }
  468. })
  469. }
  470. // 获取按仓库查询销售单明细数量
  471. export const queryCountForWarehouseDetail = (params) => {
  472. return axios({
  473. url: '/sales/detail/queryCountForWarehouse',
  474. method: 'post',
  475. data: params
  476. })
  477. }
  478. // 按仓库导出销售单
  479. export const exportForWarehouse = params => {
  480. const url = `/sales/exportForWarehouse`
  481. return axios.request({
  482. url: url,
  483. data: params,
  484. method: 'post',
  485. responseType: 'blob',
  486. headers: {
  487. 'module': encodeURIComponent('导出')
  488. }
  489. })
  490. }
  491. // 销售一览表 列表
  492. export const salesOverviewQueryPage = (params) => {
  493. const url = `/salesOverview/queryPage/${params.pageNo}/${params.pageSize}`
  494. delete params.pageNo
  495. delete params.pageSize
  496. return axios({
  497. url: url,
  498. data: params,
  499. method: 'post',
  500. headers: {
  501. 'module': encodeURIComponent('列表查询')
  502. }
  503. })
  504. }
  505. // 累计产品选择列表
  506. export const salesDetailQueryBorrowPageList = (params) => {
  507. const url = `/sales/detail/queryWaitBorrowPage/${params.pageNo}/${params.pageSize}`
  508. delete params.pageNo
  509. delete params.pageSize
  510. return axios({
  511. url: url,
  512. data: params,
  513. method: 'post',
  514. headers: {
  515. 'module': encodeURIComponent('选择累计产品列表')
  516. }
  517. })
  518. }
  519. // 导入累计产品
  520. export const salesDetailImportBorrow = (params) => {
  521. return axios.request({
  522. url: '/sales/detail/importBorrow',
  523. data: params,
  524. method: 'post',
  525. headers: {
  526. 'module': encodeURIComponent('导入累计产品')
  527. }
  528. })
  529. }
  530. //查看累计、同款产品 买赠产品列表
  531. export const queryRegularProductShortfallList = (params) => {
  532. return axios.request({
  533. url: '/salesPromo/queryRegularProductShortfallList',
  534. data: params,
  535. method: 'post',
  536. headers: {
  537. 'module': encodeURIComponent('买赠产品列表')
  538. }
  539. })
  540. }