salesNew.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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 getCreatePurchaseFlag = (params) => {
  26. return axios({
  27. url: `/sales/getCreatePurchaseFlag`,
  28. data: params,
  29. method: 'post'
  30. })
  31. }
  32. // 转采购单
  33. export const allCreatePurchase = (params) => {
  34. return axios({
  35. url: `/sales/allCreatePurchase`,
  36. data: params,
  37. method: 'post'
  38. })
  39. }
  40. // 销售 待转费用单列表 有分页
  41. export const salesConvertExpenseList = (params) => {
  42. const url = `/salesPromo/queryBatchConvertExpenseAccountPage/${params.pageNo}/${params.pageSize}`
  43. delete params.pageNo
  44. delete params.pageSize
  45. return axios({
  46. url: url,
  47. data: params,
  48. method: 'post',
  49. headers:{
  50. 'module': encodeURIComponent('待转费用报销单列表')
  51. }
  52. })
  53. }
  54. // 销售 新增
  55. export const salesSave = (params) => {
  56. return axios({
  57. url: '/sales/insert',
  58. data: params,
  59. method: 'post',
  60. headers:{
  61. 'module': encodeURIComponent('新增销售单')
  62. }
  63. })
  64. }
  65. // 销售 编辑
  66. export const salesModify = (params) => {
  67. return axios({
  68. url: '/sales/modifyWarehouse',
  69. data: params,
  70. method: 'post',
  71. headers:{
  72. 'module': encodeURIComponent('修改仓库')
  73. }
  74. })
  75. }
  76. // 销售 详情bysn
  77. export const salesDetailBySn = (params) => {
  78. return axios({
  79. url: `/sales/findBySn/${params.salesBillSn}`,
  80. method: 'get'
  81. })
  82. }
  83. // 查询客户名称
  84. export const salesDetailByNo = (params) => {
  85. return axios({
  86. url: `/sales/findBySaleBillNo/${params.salesBillNo}`,
  87. method: 'get',
  88. headers:{
  89. 'module': encodeURIComponent('查询客户信息')
  90. }
  91. })
  92. }
  93. // 销售 删除
  94. export const salesDel = (params) => {
  95. return axios({
  96. url: `/sales/delete/${params.salesBillSn}`,
  97. method: 'get',
  98. headers:{
  99. 'module': encodeURIComponent('删除')
  100. }
  101. })
  102. }
  103. // 销售 取消
  104. export const salesCancle = (params) => {
  105. return axios({
  106. url: `/sales/cancle/${params.salesBillSn}`,
  107. method: 'get',
  108. headers:{
  109. 'module': encodeURIComponent('取消')
  110. }
  111. })
  112. }
  113. // 根据销售单sn查询参加的活动
  114. export const salesPromoQueryList = (params) => {
  115. return axios({
  116. url: `/salesPromo/queryExtList`,
  117. data: params,
  118. method: 'post'
  119. })
  120. }
  121. // 更换促销,可更换活动列表
  122. export const salesPromoMatchProduct = (params) => {
  123. return axios({
  124. url: `/salesPromo/queryMatchProduct`,
  125. data: params,
  126. method: 'post'
  127. })
  128. }
  129. // 判断是否有新的活动
  130. export const salesQueryUnPartPromo = (params) => {
  131. return axios({
  132. url: `/salesPromo/queryUnPartPromo/${params.salesBillSn}`,
  133. data: params,
  134. method: 'post'
  135. })
  136. }
  137. // 活动优惠明细接口
  138. export const salesPromoQueryCount = (params) => {
  139. return axios({
  140. url: `/salesPromo/queryCount`,
  141. data: params,
  142. method: 'post'
  143. })
  144. }
  145. // 提交时活动规则校验
  146. export const salesPromoValidaSubmit = (params) => {
  147. return axios({
  148. url: `/salesPromo/validationSubmit/${params.salesBillSn}`,
  149. data: params,
  150. method: 'post',
  151. headers:{
  152. 'module': encodeURIComponent('提交前活动规则校验')
  153. }
  154. })
  155. }
  156. // 销售 审核通过
  157. export const salesWriteAuditPass = (params) => {
  158. return axios({
  159. url: '/sales/auditPass',
  160. data: params,
  161. method: 'post',
  162. headers:{
  163. 'module': encodeURIComponent('审核通过')
  164. }
  165. })
  166. }
  167. // 销售 审核驳回
  168. export const salesWriteAuditReject = (params) => {
  169. return axios({
  170. url: '/sales/auditReject',
  171. data: params,
  172. method: 'post',
  173. headers:{
  174. 'module': encodeURIComponent('审核驳回')
  175. }
  176. })
  177. }
  178. // 销售 一键审核下推
  179. export const salesWriteAuditPush = (params) => {
  180. return axios({
  181. url: '/sales/auditPush',
  182. data: params,
  183. method: 'post',
  184. headers:{
  185. 'module': encodeURIComponent('一键审核')
  186. }
  187. })
  188. }
  189. // 销售 提交
  190. export const salesWriteSubmit = (params) => {
  191. return axios({
  192. url: '/sales/submit',
  193. data: params,
  194. method: 'post',
  195. headers:{
  196. 'module': encodeURIComponent('提交')
  197. }
  198. })
  199. }
  200. // 是否更新价格判断
  201. export const submitCheck = (params) => {
  202. return axios({
  203. url: '/sales/submitCheck',
  204. method: 'post',
  205. data: params
  206. })
  207. }
  208. // 当前价格 提交
  209. export const updateBatch = (params) => {
  210. return axios({
  211. url: '/sales/detail/updateBatch',
  212. method: 'post',
  213. data: params,
  214. headers:{
  215. 'module': encodeURIComponent('价格批量更新')
  216. }
  217. })
  218. }
  219. // 销售详情列表所有包括活动产品不分页
  220. export const salesDetailAllList = (params) => {
  221. const url = `/sales/detail/queryAll`
  222. return axios({
  223. url: url,
  224. data: params,
  225. method: 'post',
  226. headers:{
  227. 'module': encodeURIComponent('销售单明细列表查询')
  228. }
  229. })
  230. }
  231. // 查询可生成的费用报销单
  232. export const queryCreateBySalesBillSn = (params) => {
  233. return axios({
  234. url: `/expenseAccount/queryCreateBySalesBillSn/${params.salesBillSn}`,
  235. data: params,
  236. method: 'post'
  237. })
  238. }
  239. // 批量查询可生成的费用报销单
  240. export const queryBatchCreateBySalesBillSn = (params) => {
  241. return axios({
  242. url: `/expenseAccount/queryBatchCreateBySalesPromoSnList`,
  243. data: params,
  244. method: 'post'
  245. })
  246. }
  247. // 保存费用报销单
  248. export const expenseAccountSave = (params) => {
  249. return axios({
  250. url: `/expenseAccount/saveCreate`,
  251. data: params,
  252. method: 'post',
  253. headers:{
  254. 'module': encodeURIComponent('转费用报销单')
  255. }
  256. })
  257. }
  258. // 销售 打印
  259. export const salesPrint = (params) => {
  260. return axios({
  261. url: '/sales/print',
  262. data: params,
  263. method: 'post',
  264. headers:{
  265. 'module': encodeURIComponent('销售打印')
  266. }
  267. })
  268. }
  269. // 销售 打印预览
  270. export const salesPrintPreview = (params) => {
  271. return axios({
  272. url: '/sales/printPreview',
  273. data: params,
  274. method: 'post',
  275. headers:{
  276. 'module': encodeURIComponent('销售打印预览')
  277. }
  278. })
  279. }
  280. // 销售 详情 该销售单的产品二级分类
  281. export const salesDetailProductType = (params) => {
  282. return axios({
  283. url: `/sales/detail/queryProductType/${params.sn}`,
  284. method: 'get'
  285. })
  286. }
  287. // 销售 详情 打印
  288. export const salesDetailPrint = params => {
  289. const url = `/sales/print/${params.priceType}`
  290. const id = params.priceType.indexOf('_TYPE')>=0 ? '销售分类打印' : '销售打印'
  291. delete params.priceType
  292. return axios.request({
  293. url: url,
  294. data: params,
  295. method: 'post',
  296. responseType: 'blob',
  297. headers:{
  298. 'module': encodeURIComponent(id)
  299. }
  300. })
  301. }
  302. // 销售 详情 导出
  303. export const salesDetailExcel = params => {
  304. const url = `/sales/excel/${params.priceType}`
  305. delete params.priceType
  306. return axios.request({
  307. url: url,
  308. data: params,
  309. method: 'post',
  310. responseType: 'blob',
  311. headers:{
  312. 'module': encodeURIComponent('导出Excel')
  313. }
  314. })
  315. }
  316. // 销售 详情 分类导出
  317. export const salesDetailTypeExcel = params => {
  318. const url = `/sales/detail/typeExcel`
  319. return axios.request({
  320. url: url,
  321. data: params,
  322. method: 'post',
  323. responseType: 'blob',
  324. headers:{
  325. 'module': encodeURIComponent('销售分类导出')
  326. }
  327. })
  328. }
  329. // 仓库销售单
  330. // 按仓库查询销售单 列表 有分页
  331. export const queryPageForWarehouse = (params) => {
  332. const url = `/sales/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  333. delete params.pageNo
  334. delete params.pageSize
  335. return axios({
  336. url: url,
  337. data: params,
  338. method: 'post',
  339. headers:{
  340. 'module': encodeURIComponent('列表查询')
  341. }
  342. })
  343. }
  344. // 获取按仓库查询销售单数量
  345. export const queryCountForWarehouse = (params) => {
  346. return axios({
  347. url: '/sales/queryCountForWarehouse',
  348. method: 'post',
  349. data: params
  350. })
  351. }
  352. // 按仓库查询销售明细 列表
  353. export const queryPageForWarehouseDetail = (params) => {
  354. const url = `/sales/detail/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
  355. delete params.pageNo
  356. delete params.pageSize
  357. return axios({
  358. url: url,
  359. data: params,
  360. method: 'post',
  361. headers:{
  362. 'module': encodeURIComponent('明细列表查询')
  363. }
  364. })
  365. }
  366. // 获取按仓库查询销售单明细数量
  367. export const queryCountForWarehouseDetail = (params) => {
  368. return axios({
  369. url: '/sales/detail/queryCountForWarehouse',
  370. method: 'post',
  371. data: params
  372. })
  373. }
  374. // 按仓库导出销售单
  375. export const exportForWarehouse = params => {
  376. const url = `/sales/exportForWarehouse`
  377. return axios.request({
  378. url: url,
  379. data: params,
  380. method: 'post',
  381. responseType: 'blob',
  382. headers:{
  383. 'module': encodeURIComponent('导出')
  384. }
  385. })
  386. }
  387. // 销售一览表 列表
  388. export const salesOverviewQueryPage = (params) => {
  389. const url = `/salesOverview/queryPage/${params.pageNo}/${params.pageSize}`
  390. delete params.pageNo
  391. delete params.pageSize
  392. return axios({
  393. url: url,
  394. data: params,
  395. method: 'post',
  396. headers:{
  397. 'module': encodeURIComponent('列表查询')
  398. }
  399. })
  400. }