detail.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. const _Http = getApp().globalData.http;
  2. let figure = null; //免运费额度
  3. import currency from "../../utils/currency";
  4. Page({
  5. data: {
  6. loading: true,
  7. sa_orderid: null,
  8. tabsActive: 0,
  9. tabsList: [{
  10. label: "产品明细",
  11. icon: "icon-tabchanpin",
  12. model: "#Product"
  13. }, {
  14. label: "附件",
  15. icon: "icon-tabfujian1",
  16. model: "#Yl_Attachment"
  17. }, {
  18. label: "订单进度",
  19. icon: "icon-tabcaozuojilu1",
  20. model: "#Progress"
  21. }, {
  22. label: "发票",
  23. icon: "icon-tabkaipiaoxinxi",
  24. model: "#Invoice"
  25. }],
  26. saletypeList: null,
  27. },
  28. onLoad(options) {
  29. this.setData({
  30. sa_orderid: options.id,
  31. order_rebate_used: wx.getStorageSync('siteP').order_rebate_used,
  32. userrole: wx.getStorageSync('userrole'),
  33. isSubmit: wx.getStorageSync('auth').worderform.options.some(v => v == 'submit'),
  34. isDelete: wx.getStorageSync('auth').worderform.options.some(v => v == 'delete'),
  35. fixATime: wx.getStorageSync('auth').worderform.options.some(v => v == 'fixATime'),
  36. });
  37. this.getDetail(true);
  38. //销售分类
  39. _Http.basic({
  40. "classname": "sysmanage.develop.optiontype.optiontype",
  41. "method": "optiontypeselect",
  42. "content": {
  43. pageSize: "999",
  44. "typename": "saletype",
  45. "parameter": {
  46. "siteid": wx.getStorageSync('siteP').siteid
  47. }
  48. }
  49. }, false).then(res => {
  50. console.log("销售分类", res)
  51. if (res.msg != '成功') return wx.showToast({
  52. title: res.msg,
  53. icon: "none"
  54. })
  55. this.setData({
  56. saletypeList: res.data.map(v => {
  57. v.show = v.value + '-' + v.remarks
  58. return v
  59. })
  60. })
  61. })
  62. getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
  63. },
  64. /* 设置回签单 */
  65. changeSignbackstatus(e) {
  66. if (this.isEdit()) return this.setData({
  67. "detail.signbackstatus": this.data.detail.signbackstatus
  68. })
  69. this.data.detail.signbackstatus = e.detail;
  70. this.changeDetail();
  71. },
  72. /* 获取详情 */
  73. getDetail(init = false, show = true) {
  74. _Http.basic({
  75. "id": 20221108151302,
  76. "content": {
  77. nocache: true,
  78. "sa_orderid": this.data.sa_orderid
  79. }
  80. }, show).then(res => {
  81. console.log("订单详情", res)
  82. if (res.msg != '成功') return wx.showToast({
  83. title: res.msg,
  84. icon: "none"
  85. });
  86. let CNY = value => currency(value, {
  87. symbol: "¥",
  88. precision: 2
  89. }).format();
  90. let account = {
  91. name: "",
  92. text: ""
  93. };
  94. let accountclass = res.data.accountclass;
  95. if (accountclass.accountname) {
  96. account.name = accountclass.accountname
  97. account.text = `\n(${getApp().globalData.Language.getMapText('余额')}:${CNY(accountclass.balance)},${getApp().globalData.Language.getMapText('信用额度')}:${CNY(accountclass.creditquota)})`
  98. }
  99. this.setData({
  100. detail: res.data,
  101. loading: false,
  102. defaultamount: CNY(res.data.defaultamount),
  103. account
  104. });
  105. if (init) {
  106. this.partialRenewal(true)
  107. let content = wx.getStorageSync('userrole') == '业务员' ? {
  108. sys_enterpriseid: this.data.detail.sys_enterpriseid
  109. } : {};
  110. //业务员根据指定经销商的免运费
  111. _Http.basic({
  112. "id": 20220920084001,
  113. content
  114. }, false).then(res => {
  115. console.log("查询企业档案获取企业免邮额度", res)
  116. if (res.msg != '成功') return wx.showToast({
  117. title: res.msg,
  118. icon: "none"
  119. })
  120. figure = res.data.freefreightamount;
  121. this.setLogisticsMsg();
  122. })
  123. } else {
  124. this.setLogisticsMsg();
  125. }
  126. })
  127. },
  128. /* 免运费信息 */
  129. setLogisticsMsg() {
  130. let logistics = null;
  131. if (figure == -1) {
  132. logistics = '到付'
  133. } else if (figure == 0) {
  134. logistics = '预付'
  135. } else {
  136. let defaultamount = this.data.detail.defaultamount;
  137. logistics = defaultamount >= figure ? '免运费' : (getApp().globalData.Language.getMapText('差') + currency(figure).subtract(defaultamount).value + getApp().globalData.Language.getMapText('元免运费'));
  138. }
  139. this.setData({
  140. logistics
  141. })
  142. },
  143. /* 选择销售分类 */
  144. selectSaletype(e) {
  145. if (this.isEdit()) return;
  146. if (this.data.detail.type == '项目订单') return;
  147. },
  148. /* 设置销售分类 */
  149. setSaletype(e) {
  150. let {
  151. value,
  152. remarks
  153. } = this.data.saletypeList[e.detail.value];
  154. if (value == this.data.detail.saletype) return;
  155. this.setData({
  156. "detail.saletype": value,
  157. "detail.saletyperemarks": remarks
  158. })
  159. this.changeDetail();
  160. },
  161. /* 选择结算人 */
  162. selectAgent() {
  163. if (this.isEdit()) return;
  164. if (this.data.detail.type == '项目订单') return;
  165. wx.navigateTo({
  166. url: `/select/agent/index?params=${JSON.stringify({
  167. "id":20230104103702,
  168. "content": {
  169. "pageNumber": 1,
  170. "pageTotal": 1,
  171. "pageSize": 20,
  172. "where": {
  173. "condition": "",
  174. },
  175. }
  176. })}&radio=true`,
  177. });
  178. getApp().globalData.handleSelect = this.setAgeant.bind(this);
  179. },
  180. /* 设置结算人 */
  181. setAgeant({
  182. item
  183. }) {
  184. let that = this;
  185. console.log("选择经销商", item)
  186. wx.showModal({
  187. title: getApp().globalData.Language.getMapText('提示'),
  188. content: getApp().globalData.Language.modeBoxPrompts([{
  189. t: 1,
  190. v: '是否确认设置',
  191. r: " "
  192. }, {
  193. v: item.enterprisename,
  194. f: "“",
  195. r: "”"
  196. }, {
  197. t: 1,
  198. v: '为结算人',
  199. r: "?"
  200. }]),
  201. complete: (res) => {
  202. if (res.confirm) {
  203. let pay_enterpriseid = that.data.detail.pay_enterpriseid,
  204. sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid,
  205. sa_accountclassid = that.data.detail.accountclass.sa_accountclassid;
  206. that.setData({
  207. "detail.pay_enterpriseid": item.sys_enterpriseid,
  208. "detail.sys_enterprise_financeid": item.finance[0] ? item.finance[0].sys_enterprise_financeid : 0,
  209. "detail.accountclass.sa_accountclassid": item.accounts[0] ? item.accounts[0].sa_accountclassid : 0,
  210. });
  211. that.changeDetail().then(s => {
  212. if (s.msg == '成功') {
  213. wx.showToast({
  214. title: getApp().globalData.Language.getMapText('设置成功'),
  215. icon: "none"
  216. });
  217. setTimeout(() => {
  218. wx.navigateBack();
  219. that.getDetail();
  220. }, 500)
  221. } else {
  222. that.setData({
  223. "detail.pay_enterpriseid": pay_enterpriseid,
  224. "detail.sys_enterprise_financeid": sys_enterprise_financeid,
  225. "detail.sa_accountclassid": sa_accountclassid
  226. });
  227. }
  228. })
  229. }
  230. }
  231. })
  232. },
  233. /* 选择收货人 */
  234. selectConsignee() {
  235. if (this.isEdit()) return;
  236. wx.navigateTo({
  237. url: `/select/address/index?params=${JSON.stringify({
  238. "id":20221009155803,
  239. "content": {
  240. nocache:true,
  241. sys_enterpriseid:this.data.detail.sys_enterpriseid,
  242. "pageNumber": 1,
  243. "pageTotal": 1,
  244. "pageSize": 20,
  245. "where": {
  246. "condition": "",
  247. workaddress:1
  248. },
  249. }
  250. })}&radio=true`,
  251. });
  252. getApp().globalData.handleSelect = this.setConsignee.bind(this);
  253. },
  254. /* 设置收货人 */
  255. setConsignee({
  256. item
  257. }) {
  258. let that = this;
  259. console.log("设置收货人", item)
  260. wx.showModal({
  261. title: getApp().globalData.Language.getMapText('提示'),
  262. content: getApp().globalData.Language.modeBoxPrompts([{
  263. t: 1,
  264. v: '是否确认设置',
  265. r: " "
  266. }, {
  267. v: item.name,
  268. f: "“",
  269. r: "”"
  270. }, {
  271. t: 1,
  272. v: '为收货人',
  273. r: "?"
  274. }]),
  275. complete: (res) => {
  276. if (res.confirm) {
  277. let rec_contactsid = that.data.detail.rec_contactsid;
  278. that.setData({
  279. "detail.rec_contactsid": item.contactsid
  280. });
  281. that.changeDetail().then(s => {
  282. if (s.msg == '成功') {
  283. wx.showToast({
  284. title: getApp().globalData.Language.getMapText('设置成功'),
  285. icon: "none"
  286. });
  287. setTimeout(() => {
  288. wx.navigateBack();
  289. that.getDetail();
  290. }, 500)
  291. } else {
  292. that.setData({
  293. "detail.rec_contactsid": rec_contactsid
  294. });
  295. }
  296. })
  297. }
  298. }
  299. })
  300. },
  301. /* 选择财务信息 */
  302. selectFinance() {
  303. if (this.isEdit()) return;
  304. wx.navigateTo({
  305. url: `/select/finance/index?params=${JSON.stringify({
  306. "id":20221013160602,
  307. "content": {
  308. nocache:true,
  309. sys_enterpriseid:this.data.detail.sys_enterpriseid,
  310. "pageNumber": 1,
  311. "pageTotal": 1,
  312. "pageSize": 20,
  313. "where": {
  314. "condition": "",
  315. },
  316. }
  317. })}&radio=true`,
  318. });
  319. getApp().globalData.handleSelect = this.setFinance.bind(this);
  320. },
  321. /* 设置财务信息 */
  322. setFinance({
  323. item
  324. }) {
  325. let that = this;
  326. console.log("设置财务信息", item)
  327. wx.showModal({
  328. title: getApp().globalData.Language.getMapText('提示'),
  329. content: getApp().globalData.Language.modeBoxPrompts([{
  330. t: 1,
  331. v: '是否确认设置',
  332. r: " "
  333. }, {
  334. v: item.enterprisename,
  335. f: "“",
  336. r: "”"
  337. }, {
  338. t: 1,
  339. v: '为开票单位',
  340. r: "?"
  341. }]),
  342. complete: (res) => {
  343. if (res.confirm) {
  344. let sys_enterprise_financeid = that.data.detail.sys_enterprise_financeid;
  345. that.setData({
  346. "detail.sys_enterprise_financeid": item.sys_enterprise_financeid
  347. });
  348. that.changeDetail().then(s => {
  349. if (s.msg == '成功') {
  350. wx.showToast({
  351. title: getApp().globalData.Language.getMapText('设置成功'),
  352. icon: "none"
  353. });
  354. setTimeout(() => {
  355. wx.navigateBack();
  356. that.getDetail();
  357. }, 500)
  358. } else {
  359. that.setData({
  360. "detail.sys_enterprise_financeid": sys_enterprise_financeid
  361. });
  362. }
  363. })
  364. }
  365. }
  366. })
  367. },
  368. //tabs 切换
  369. tabsChange({
  370. detail
  371. }) {
  372. this.setData({
  373. tabsActive: detail
  374. });
  375. this.partialRenewal();
  376. },
  377. //局部数据更新 tabs
  378. partialRenewal(init = false) {
  379. let model = this.data.tabsList[this.data.tabsActive].model;
  380. if (model) {
  381. let Component = this.selectComponent(model),
  382. {
  383. total,
  384. pageNumber,
  385. pageTotal
  386. } = Component.data.content,
  387. id = this.data.detail.sa_orderid;
  388. if (total == null || init) {
  389. Component.getList(id, init);
  390. } else if (pageNumber <= pageTotal) {
  391. Component.getList(id, false);
  392. }
  393. }
  394. },
  395. onReachBottom() {
  396. this.partialRenewal();
  397. },
  398. /* 更新数据 */
  399. changeDetail() {
  400. let data = this.data.detail,
  401. content = {
  402. "sa_orderid": data.sa_orderid,
  403. "sys_enterpriseid": data.sys_enterpriseid, //订货企业id
  404. "sa_accountclassid": data.accountclass.sa_accountclassid || 0, //营销账户类型ID
  405. projectnote: data.projectnote || "", //项目备注
  406. "sa_brandid": data.sa_brandid, //品牌ID
  407. "sys_enterprise_financeid": data.sys_enterprise_financeid || 0, //合作企业财务信息ID(开票信息)
  408. //"sa_logiscompid": data.logiscomp.sa_logiscompid || 0, 物流公司档案ID
  409. "rec_contactsid": data.rec_contactsid || 0, //合作企业联系人表ID(收货信息)
  410. "type": data.type, //订单类型
  411. "typemx": data.typemx, // 明细分类,可选
  412. "remarks": data.remarks,
  413. "saler_hrid": data.saler_hrid, //销售人员hrid,业务员hrid
  414. "tradefield": data.tradefield, //必选
  415. "pay_enterpriseid": data.pay_enterpriseid, //结算单位
  416. "rebate_userate": data.accountclass.rebate_userate, //返利金使用比例
  417. signbackstatus: data.signbackstatus,
  418. saletype: data.saletype
  419. };
  420. if (content.type = '项目订单') {
  421. content.sa_contractid = data.sa_contractid,
  422. content.sa_projectid = data.sa_projectid;
  423. }
  424. return new Promise((resolve, reject) => {
  425. _Http.basic({
  426. "id": 20221108111402,
  427. content
  428. }).then(res => {
  429. console.log("修改订单数据", res);
  430. if (res.msg != '成功') wx.showToast({
  431. title: res.msg,
  432. icon: "none"
  433. });
  434. resolve(res)
  435. })
  436. })
  437. },
  438. /* 修改订单备注 */
  439. changeRemarks(e) {
  440. let name = e.currentTarget.dataset.name,
  441. value = e.detail.value,
  442. remarks = this.data.detail[name],
  443. that = this;
  444. if (value == remarks) return;
  445. wx.showModal({
  446. title: getApp().globalData.Language.getMapText('提示'),
  447. content: getApp().globalData.Language.modeBoxPrompts([{
  448. t: 1,
  449. v: '是否确定修改',
  450. r: " "
  451. }, {
  452. t: 1,
  453. v: name == 'remarks' ? '订单' : '项目',
  454. f: "“",
  455. r: "”"
  456. }, {
  457. t: 1,
  458. v: '备注',
  459. r: "?"
  460. }]),
  461. complete: async (res) => {
  462. if (res.cancel) that.setData({
  463. [`detail[${name}]`]: remarks
  464. })
  465. if (res.confirm) {
  466. this.data.detail[name] = value;
  467. let res = await that.changeDetail();
  468. that.setData({
  469. [`detail${name}`]: res.msg == '成功' ? value : remarks
  470. })
  471. }
  472. }
  473. })
  474. },
  475. /* 设置是否使用返利金 */
  476. changeRebateUsed() {
  477. if (this.isEdit()) return this.setData({
  478. detail: this.data.detail
  479. })
  480. let amount = (this.data.detail.order_rebate_userate * this.data.detail.defaultamount).toFixed(2); //最大可用金额
  481. let rebatebalance = this.data.detail.rebatebalance; //返利金账户余额
  482. _Http.basic({
  483. "id": 20230218225002,
  484. "content": {
  485. "sa_orderid": this.data.sa_orderid, //订单金额
  486. "isused": this.data.detail.rebate_used == 1 ? 0 : 1, //是否使用
  487. "rebateamount": rebatebalance > amount ? amount : rebatebalance //返利金使用金额
  488. }
  489. }, false).then(res => {
  490. console.log('设置启用返利金', res)
  491. if (res.msg != '成功') {
  492. wx.showToast({
  493. title: res.msg,
  494. icon: "none"
  495. });
  496. this.setData({
  497. "detail.rebate_used": this.data.detail.rebate_used
  498. })
  499. return;
  500. }
  501. this.getDetail(true, false)
  502. })
  503. },
  504. /* 修改返利金 */
  505. setRebate_amount(e = 0) {
  506. let value = e.detail.value;
  507. let rebatebalance = this.data.detail.rebatebalance; //返利金账户余额
  508. value = value > rebatebalance ? rebatebalance : value;
  509. let amount = (this.data.detail.order_rebate_userate * this.data.detail.defaultamount).toFixed(2); //最大可用金额
  510. _Http.basic({
  511. "id": 20230218225002,
  512. "content": {
  513. "sa_orderid": this.data.sa_orderid, //订单金额
  514. "isused": 1, //是否使用
  515. "rebateamount": value > amount ? amount : value
  516. }
  517. }, false).then(res => {
  518. console.log('设置返利金', res)
  519. if (res.msg != '成功') {
  520. wx.showToast({
  521. title: res.msg,
  522. icon: "none",
  523. mask: true
  524. });
  525. this.setData({
  526. "detail.accountclass.rebate_amount": this.data.detail.accountclass.rebate_amount
  527. })
  528. } else {
  529. this.setData({
  530. "detail.accountclass.rebate_amount": value
  531. })
  532. if (value > amount || amount == 0) getApp().globalData.Language.showToast(
  533. [{
  534. t: 1,
  535. v: '返利金最大可使用',
  536. r: " "
  537. }, {
  538. v: amount,
  539. f: "“",
  540. r: "”"
  541. }, {
  542. t: 1,
  543. v: '元'
  544. }])
  545. this.getDetail(true, false)
  546. }
  547. })
  548. },
  549. /* 删除订单 */
  550. deleteItem() {
  551. let that = this;
  552. wx.showModal({
  553. title: getApp().globalData.Language.getMapText('提示'),
  554. content: getApp().globalData.Language.getMapText('是否确认删除订单') + '?',
  555. complete: (res) => {
  556. if (res.confirm) _Http.basic({
  557. "id": 20221108152102,
  558. "content": {
  559. "sa_orderids": [
  560. that.data.sa_orderid
  561. ]
  562. }
  563. }).then(s => {
  564. console.log("删除订单", s)
  565. if (s.msg != '成功') return wx.showToast({
  566. title: s.msg,
  567. icon: "none"
  568. });
  569. getApp().globalData.Language.showToast('删除成功')
  570. setTimeout(() => {
  571. /* let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
  572. if (page) page.setData({
  573. list: page.data.list.filter(v => v.sa_orderid != that.data.sa_orderid),
  574. "content.total": page.data.content.total - 1,
  575. amount: (page.data.amount - that.data.detail.amount).toFixed(2)
  576. }); */
  577. wx.navigateBack()
  578. }, 500)
  579. })
  580. }
  581. })
  582. },
  583. /* 提交订单 */
  584. submit() {
  585. let that = this;
  586. wx.showModal({
  587. title: getApp().globalData.Language.getMapText('提示'),
  588. content: getApp().globalData.Language.getMapText('是否确认提交订单') + '?',
  589. complete: (res) => {
  590. if (res.confirm) _Http.basic({
  591. "id": 20221108153402,
  592. "content": {
  593. sa_orderid: that.data.sa_orderid
  594. },
  595. }).then(s => {
  596. console.log("提交订单", s)
  597. wx.showToast({
  598. title: s.msg != '成功' ? s.msg : getApp().globalData.Language.getMapText('提交成功'),
  599. icon: "none"
  600. });
  601. if (s.msg == '成功') that.setData({
  602. "detail.status": "提交"
  603. })
  604. })
  605. }
  606. })
  607. },
  608. /* 确认订单交期 */
  609. notarize() {
  610. let that = this;
  611. wx.showModal({
  612. title: getApp().globalData.Language.getMapText('提示'),
  613. content: getApp().globalData.Language.getMapText('是否确认交期') + '?',
  614. complete: (res) => {
  615. if (res.confirm) _Http.basic({
  616. "id": 20221230094802,
  617. "content": {
  618. sa_orderid: that.data.sa_orderid
  619. },
  620. }).then(s => {
  621. console.log("确认交期", s)
  622. wx.showToast({
  623. title: s.msg != '成功' ? s.msg : getApp().globalData.Language.getMapText('确认成功'),
  624. icon: "none"
  625. });
  626. if (s.msg == '成功') {
  627. that.setData({
  628. "detail.status": "交期确认"
  629. })
  630. }
  631. })
  632. }
  633. })
  634. },
  635. /* 判断是否可以编辑 */
  636. isEdit() {
  637. if (this.data.detail.status != '新建') getApp().globalData.Language.showToast('当前订单状态不可设置!')
  638. if (this.data.detail.type == '特殊订单') getApp().globalData.Language.showToast('特殊订单不可设置!')
  639. return this.data.detail.status != '新建' || this.data.detail.type == '特殊订单';
  640. },
  641. /* 拷贝订单 */
  642. copyItem() {
  643. let item = this.data.detail;
  644. wx.showModal({
  645. title: getApp().globalData.Language.getMapText('提示'),
  646. content: getApp().globalData.Language.getMapText('是否确认复制') + `${getApp().globalData.Language.showToast(item.type)}“${item.sonum}”`,
  647. complete: (res) => {
  648. if (res.confirm) _Http.basic({
  649. "id": 20230102144502,
  650. "content": {
  651. "sa_orderid": item.sa_orderid
  652. }
  653. }).then(res => {
  654. console.log("复制订单", res)
  655. if (res.msg != '成功') return wx.showToast({
  656. title: res.msg,
  657. icon: "none"
  658. });
  659. wx.showModal({
  660. title: getApp().globalData.Language.getMapText('提示'),
  661. content: getApp().globalData.Language.showToast(item.type) + ' ' + getApp().globalData.Language.showToast('复制成功 是否立即前往'),
  662. complete: (s) => {
  663. if (s.confirm) wx.redirectTo({
  664. url: '/packageA/orderForm/detail?id=' + res.data.sa_orderid,
  665. })
  666. }
  667. })
  668. })
  669. }
  670. })
  671. },
  672. /* 设置项目订单品牌领域 */
  673. setBraned() {
  674. wx.navigateTo({
  675. url: './modules/setBrand/index?id=' + this.data.sa_orderid,
  676. })
  677. },
  678. onUnload() {
  679. let page = getCurrentPages().find(v => v.__route__ == 'packageA/orderForm/index');
  680. let content = JSON.parse(JSON.stringify(page.data.content));
  681. content.pageNumber = 1;
  682. content.pageSize = (page.data.content.pageNumber - 1) * page.data.content.pageSize;
  683. _Http.basic({
  684. "id": this.data.userrole == '业务员' ? 20221111145202 : 20221224180302,
  685. content
  686. }).then(res => {
  687. console.log("订单列表", res)
  688. if (res.msg != '成功') return;
  689. /* 格式化价格 */
  690. if (res.data.length != 0) res.data = res.data.map(v => {
  691. v.defaultamount = currency(v.defaultamount, {
  692. symbol: "¥",
  693. precision: 2
  694. }).format();
  695. return v
  696. })
  697. page.setData({
  698. list: res.data,
  699. "content.total": res.total,
  700. amount: currency(res.tips.amount, {
  701. symbol: "¥",
  702. precision: 2
  703. }).format()
  704. })
  705. })
  706. },
  707. })