order.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. export default {
  2. data(){
  3. return {
  4. }
  5. },
  6. computed:{
  7. },
  8. mounted () {
  9. },
  10. watch:{
  11. },
  12. methods: {
  13. toConfrim(params,title){
  14. let that = this
  15. that.$util.confirmModal({title: '订单完成',content:title},() => {
  16. that.toConfirmRequest(params)
  17. })
  18. },
  19. toConfirmRequest(params){
  20. let that = this
  21. confirmFinish(params).then((res) => {
  22. uni.showToast({title:res.msg,icon:'none'})
  23. if(res.code == 1){
  24. //订单变成完成
  25. that.list.data.forEach((item, index,array) => {
  26. if(item.id == params.id){
  27. array[index].status = '4'
  28. array[index].buttonList.forEach((it,ind,arr)=>{
  29. if(it.type == 'confirm'){
  30. arr[ind].disable = 1
  31. }
  32. })
  33. }
  34. });
  35. }
  36. })
  37. },
  38. // 免发货
  39. freeShipModalClick(e) {
  40. freeShipping({ id: this.operateData.id }).then((res) => {
  41. this._list();
  42. this.$msg("操作成功!");
  43. });
  44. },
  45. // 查看配送
  46. seeSendFn(item) {
  47. this.$util.pageTo({
  48. url: "/admin/order/ship",
  49. query: {
  50. id: item.id,
  51. pageStatus: 5,
  52. },
  53. });
  54. },
  55. orderEventBtn(s, item) {
  56. let that = this
  57. this.orderId=item.id;
  58. if (s.type === "selfGet") {
  59. this.operateData = item;
  60. let that = this;
  61. that.$util.confirmModal({content:'确认客户已自取?'},() => {
  62. that.freeShipModalClick();
  63. })
  64. //发货
  65. } else if (s.type === "send") {
  66. this.pageTo({
  67. url: "/pagesOrder/ship",
  68. query: {
  69. id: item.id,
  70. },
  71. });
  72. }else if (s.type === "print") {
  73. }else if(s.type == 'confirm'){
  74. let self = this;
  75. uni.showActionSheet({
  76. itemList: ['请选择结算方式:', '欠款', '已收款'],
  77. success: function (res) {
  78. if(res.tapIndex == 0){
  79. return false
  80. }
  81. let payWay = 0
  82. let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
  83. //1欠款 2已收款
  84. let clearType = res.tapIndex == 1 ? 1 : 2;
  85. //选择的已收款,还需要选择收款方式
  86. if(clearType == 2){
  87. uni.showActionSheet({
  88. itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
  89. success: function (respond) {
  90. let currentIndex = respond.tapIndex
  91. let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
  92. if(currentIndex == 0){
  93. return false
  94. }
  95. payWay = inWay[currentIndex].id
  96. let params = {id:item.id,clearType:clearType,payWay:payWay}
  97. self.toConfrim(params,title)
  98. }
  99. })
  100. }else{
  101. let params = {id:item.id,clearType:clearType,payWay:payWay}
  102. self.toConfrim(params,title)
  103. }
  104. }
  105. });
  106. }else if(s.type == 'cancel'){
  107. let that = this;
  108. that.$util.confirmModal({content:'确认取消?'},() => {
  109. cancel({id:item.id}).then((res) => {
  110. uni.showToast({title:res.msg,icon:'none'})
  111. that._list();
  112. })
  113. })
  114. }
  115. },
  116. }
  117. }