salesNew.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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/findBaseBySn/${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: `/sales/detail/sortPromoList`,
  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/validationSubmit/${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 salesWriteUpAuditReject = (params) => {
  246. return axios({
  247. url: '/sales/superiorAuditReject',
  248. data: params,
  249. method: 'post',
  250. headers: {
  251. 'module': encodeURIComponent('审核不通过,待上级审核')
  252. }
  253. })
  254. }
  255. // 销售 一键审核下推
  256. export const salesWriteAuditPush = (params) => {
  257. return axios({
  258. url: '/sales/auditPush',
  259. data: params,
  260. method: 'post',
  261. headers: {
  262. 'module': encodeURIComponent('一键审核')
  263. }
  264. })
  265. }
  266. // 销售 提交
  267. export const salesWriteSubmit = (params) => {
  268. return axios({
  269. url: '/sales/submit',
  270. data: params,
  271. method: 'post',
  272. headers: {
  273. 'module': encodeURIComponent('提交')
  274. }
  275. })
  276. }
  277. // 是否更新价格判断
  278. export const submitCheck = (params) => {
  279. return axios({
  280. url: '/sales/submitCheck',
  281. method: 'post',
  282. data: params
  283. })
  284. }
  285. // 改单弹窗价格列表
  286. export const changeBillCheck = (params) => {
  287. return axios({
  288. url: '/sales/changeBillCheck',
  289. method: 'post',
  290. data: params
  291. })
  292. }
  293. // 更新改单数据
  294. export const changeBillCheckUpdatePrice = (params) => {
  295. return axios({
  296. url: '/sales/changeBillCheckUpdatePrice',
  297. method: 'post',
  298. data: params
  299. })
  300. }
  301. // 当前价格 提交
  302. export const updateBatch = (params) => {
  303. return axios({
  304. url: '/sales/detail/updateBatch',
  305. method: 'post',
  306. data: params,
  307. headers: {
  308. 'module': encodeURIComponent('价格批量更新')
  309. }
  310. })
  311. }
  312. // 销售详情列表所有包括活动产品不分页
  313. export const salesDetailAllList = (params) => {
  314. const url = `/sales/detail/queryAll`
  315. return axios({
  316. url: url,
  317. data: params,
  318. method: 'post',
  319. headers: {
  320. 'module': encodeURIComponent('销售单明细列表查询')
  321. }
  322. })
  323. }
  324. // 查询可生成的费用报销单
  325. export const queryCreateBySalesBillSn = (params) => {
  326. return axios({
  327. url: `/expenseAccount/queryCreateBySalesBillSn/${params.salesBillSn}`,
  328. data: params,
  329. method: 'post'
  330. })
  331. }
  332. // 批量查询可生成的费用报销单
  333. export const queryBatchCreateBySalesBillSn = (params) => {
  334. return axios({
  335. url: `/expenseAccount/queryBatchCreateBySalesPromoSnList`,
  336. data: params,
  337. method: 'post'
  338. })
  339. }
  340. // 批量查询合并后的报销单
  341. export const queryBatchCreateBySalesPromoSnListGroupType = (params) => {
  342. return axios({
  343. url: `/expenseAccount/queryBatchCreateBySalesPromoSnListGroupType`,
  344. data: params,
  345. method: 'post',
  346. headers: {
  347. 'module': encodeURIComponent('销售单合并后转费用报销单')
  348. }
  349. })
  350. }
  351. // 保存合并选项
  352. export const expenseAccountSaveGroupType = (params) => {
  353. return axios({
  354. url: `/expenseAccount/saveCreateGroupType`,
  355. data: params,
  356. method: 'post',
  357. headers: {
  358. 'module': encodeURIComponent('销售单转费用报销单,确定合并')
  359. }
  360. })
  361. }
  362. // 保存费用报销单
  363. export const expenseAccountSave = (params) => {
  364. return axios({
  365. url: `/expenseAccount/saveCreate`,
  366. data: params,
  367. method: 'post',
  368. headers: {
  369. 'module': encodeURIComponent('转费用报销单')
  370. }
  371. })
  372. }
  373. // 销售 打印
  374. export const salesPrint = (params) => {
  375. return axios({
  376. url: '/sales/print',
  377. data: params,
  378. method: 'post',
  379. headers: {
  380. 'module': encodeURIComponent('销售打印')
  381. }
  382. })
  383. }
  384. // 销售 打印预览
  385. export const salesPrintPreview = (params) => {
  386. return axios({
  387. url: '/sales/printPreview',
  388. data: params,
  389. method: 'post',
  390. headers: {
  391. 'module': encodeURIComponent('销售打印预览')
  392. }
  393. })
  394. }
  395. // 销售 详情 该销售单的产品二级分类
  396. export const salesDetailProductType = (params) => {
  397. return axios({
  398. url: `/sales/detail/queryProductType/${params.sn}`,
  399. method: 'get'
  400. })
  401. }
  402. // 销售 详情 打印
  403. export const salesDetailPrint = params => {
  404. const url = `/sales/print/${params.priceType}`
  405. const id = params.priceType.indexOf('_TYPE') >= 0 ? '销售分类打印' : '销售打印'
  406. delete params.priceType
  407. return axios.request({
  408. url: url,
  409. data: params,
  410. method: 'post',
  411. responseType: 'blob',
  412. headers: {
  413. 'module': encodeURIComponent(id)
  414. }
  415. })
  416. }
  417. // 销售 详情 导出
  418. export const salesDetailExcel = params => {
  419. const url = `/sales/excel/${params.priceType}`
  420. delete params.priceType
  421. return axios.request({
  422. url: url,
  423. data: params,
  424. method: 'post',
  425. responseType: 'blob',
  426. headers: {
  427. 'module': encodeURIComponent('导出Excel')
  428. }
  429. })
  430. }
  431. // 销售 详情 分类导出
  432. export const salesDetailTypeExcel = params => {
  433. const url = `/sales/detail/typeExcel`
  434. return axios.request({
  435. url: url,
  436. data: params,
  437. method: 'post',
  438. responseType: 'blob',
  439. headers: {
  440. 'module': encodeURIComponent('销售分类导出')
  441. }
  442. })
  443. }
  444. // 仓库销售单
  445. // 按仓库查询销售单 列表 有分页
  446. export const queryPageForWarehouse = (params) => {
  447. const url = `/sales/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  448. delete params.pageNo
  449. delete params.pageSize
  450. return axios({
  451. url: url,
  452. data: params,
  453. method: 'post',
  454. headers: {
  455. 'module': encodeURIComponent('列表查询')
  456. }
  457. })
  458. }
  459. // 获取按仓库查询销售单数量
  460. export const queryCountForWarehouse = (params) => {
  461. return axios({
  462. url: '/sales/queryCountForWarehouse',
  463. method: 'post',
  464. data: params
  465. })
  466. }
  467. // 按仓库查询销售明细 列表
  468. export const queryPageForWarehouseDetail = (params) => {
  469. const url = `/sales/detail/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  470. delete params.pageNo
  471. delete params.pageSize
  472. return axios({
  473. url: url,
  474. data: params,
  475. method: 'post',
  476. headers: {
  477. 'module': encodeURIComponent('明细列表查询')
  478. }
  479. })
  480. }
  481. // 获取按仓库查询销售单明细数量
  482. export const queryCountForWarehouseDetail = (params) => {
  483. return axios({
  484. url: '/sales/detail/queryCountForWarehouse',
  485. method: 'post',
  486. data: params
  487. })
  488. }
  489. // 按仓库导出销售单
  490. export const exportForWarehouse = params => {
  491. const url = `/sales/exportForWarehouse`
  492. return axios.request({
  493. url: url,
  494. data: params,
  495. method: 'post',
  496. responseType: 'blob',
  497. headers: {
  498. 'module': encodeURIComponent('导出')
  499. }
  500. })
  501. }
  502. // 销售一览表 列表
  503. export const salesOverviewQueryPage = (params) => {
  504. const url = `/salesOverview/queryPage/${params.pageNo}/${params.pageSize}`
  505. delete params.pageNo
  506. delete params.pageSize
  507. return axios({
  508. url: url,
  509. data: params,
  510. method: 'post',
  511. headers: {
  512. 'module': encodeURIComponent('列表查询')
  513. }
  514. })
  515. }
  516. // 累计产品选择列表
  517. export const salesDetailQueryBorrowPageList = (params) => {
  518. const url = `/sales/detail/queryWaitBorrowPage/${params.pageNo}/${params.pageSize}`
  519. delete params.pageNo
  520. delete params.pageSize
  521. return axios({
  522. url: url,
  523. data: params,
  524. method: 'post',
  525. headers: {
  526. 'module': encodeURIComponent('选择累计产品列表')
  527. }
  528. })
  529. }
  530. // 导入累计产品
  531. export const salesDetailImportBorrow = (params) => {
  532. return axios.request({
  533. url: '/sales/detail/importBorrow',
  534. data: params,
  535. method: 'post',
  536. headers: {
  537. 'module': encodeURIComponent('导入累计产品')
  538. }
  539. })
  540. }
  541. //查看累计、同款产品 买赠产品列表
  542. export const queryRegularProductShortfallList = (params) => {
  543. return axios.request({
  544. url: '/salesPromo/queryRegularProductShortfallList',
  545. data: params,
  546. method: 'post',
  547. headers: {
  548. 'module': encodeURIComponent('买赠产品列表')
  549. }
  550. })
  551. }