index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view>
  3. <z-navbar :title="type==0?'预定结算详情':'婚庆预定结算详情'" back diyBack @goBack="goBack">
  4. <view slot="right" class="iconfont iconjuxing13" @click="gotoPage(0)"></view>
  5. </z-navbar>
  6. <z-tabs v-if="type==1" shadow :tabs="['预定详情','婚庆预定详情']" v-model="stateTab" bgcolor="white" textselectedcolor="#333333"
  7. @change="changeTabInfo"></z-tabs>
  8. <template v-if="stateTab==0">
  9. <z-cell label="客户姓名" :content="info.customName"></z-cell>
  10. <z-cell label="客户电话" :content="info.phone||'无'"></z-cell>
  11. <z-cell label="预定时间" :content="info.orderDate+' '+info.activityBeginTime+'~'+info.activityEndTime"></z-cell>
  12. <z-cell label="预定场地" :content="info.houseName"></z-cell>
  13. <z-cell label="收费方式" :contentStyle="{'text-align':'right'}" :content="(info.mainPayTypeText||'无')+(info.paytypeContent||'')"></z-cell>
  14. <z-cell label="套餐内容" :content="(info.packageName||'无')+(info.packageContent&&info.packageContent.length?('('+info.packageContent+')'):'')"></z-cell>
  15. <z-cell label="增加项目" :content="info.extraRealMoney+'元'+(info.orderExtraContent&&info.orderExtraContent.length?('('+info.orderExtraContent+')'):'')"></z-cell>
  16. <z-cell label="已收订金" :content="info.downPayment+'元'"></z-cell>
  17. <z-cell label="总计应收" :content="(info.orderMoney||0)+'元'"></z-cell>
  18. <z-cell label="提醒日期" :content="info.alertDate||'无'"></z-cell>
  19. <z-cell label="预定类型" :content="info.orderTypeText"></z-cell>
  20. <z-cell label="预定状态" :content="info.orderStateText"></z-cell>
  21. <z-cell label="顾客来源" :content="info.customFromText" :hideline="type==0?false:true"></z-cell>
  22. <!-- 没有婚庆时这里有备注 -->
  23. <template v-if="type==0">
  24. <z-cell label="备注信息" hideline></z-cell>
  25. <view class="plr-30 remark">
  26. {{info.remark||''}}
  27. </view>
  28. </template>
  29. </template>
  30. <template v-else>
  31. <z-cell label="新郎姓名" :content="wedinfo.maleName"></z-cell>
  32. <z-cell label="新娘姓名" :content="wedinfo.femaleName"></z-cell>
  33. <z-cell label="手机号码" :content="wedinfo.phoneMale||'无'"></z-cell>
  34. <z-cell label="其他手机号码" :content="wedinfo.phoneFemale||'无'"></z-cell>
  35. <z-cell label="典礼开始时间" :content="wedinfo.weddingBeginTime"></z-cell>
  36. <z-cell label="婚庆价格" :content="(wedinfo.orderMoney||0)+'元'"></z-cell>
  37. <z-cell label="套餐内容" :content="(wedinfo.weddingPackageName||'无')+ (wedinfo.packageContent?wedinfo.packageContent:'')"></z-cell>
  38. <z-cell label="增加项目" :content="wedinfo.exItemMoney+'元'+(wedinfo.orderExtraContent?wedinfo.orderExtraContent:'')"></z-cell>
  39. <z-cell label="已收婚庆订金" :content="wedinfo.downPayment+'元'"></z-cell>
  40. <z-cell label="下单日期" :content="wedinfo.createTime"></z-cell>
  41. <z-cell label="备注信息" hideline></z-cell>
  42. <view class="plr-30 remark">
  43. {{wedinfo.remark}}
  44. </view>
  45. </template>
  46. <template v-if="(type==0&&info.confirmState!='01'&&info.confirmState!='02')||(type==1&&wedinfo.confirmState!='01'&&wedinfo.confirmState!='02')">
  47. <view class="common_handle_style_zw"></view>
  48. <view class="common_handle_style shadow-2 flex-n fac fja">
  49. <view class="common_handle_style_item " @click="gotoPage(1)">
  50. <view class="common_handle_style_img iconfont iconjuxing26"></view>
  51. <view class="common_handle_style_text">确认收款</view>
  52. </view>
  53. <view class="common_handle_style_item " @click="gotoPage(2)">
  54. <view class="common_handle_style_img iconfont iconjuxing27"></view>
  55. <view class="common_handle_style_text">结算订单</view>
  56. </view>
  57. <view class="common_handle_style_item " @click="gotoPage(3)" v-if="type==0">
  58. <view class="common_handle_style_img iconfont iconjuxing27kaobei"></view>
  59. <view class="common_handle_style_text">取消</view>
  60. </view>
  61. <view class="common_handle_style_item " @click="gotoPage(4)" v-else>
  62. <view class="common_handle_style_img iconfont iconjuxing27kaobei"></view>
  63. <view class="common_handle_style_text">取消</view>
  64. </view>
  65. </view>
  66. </template>
  67. <template v-if="(type==0&&info.confirmState=='02')||(type==1&&wedinfo.confirmState=='02')">
  68. <view class="common_handle_style_zw"></view>
  69. <view class="common_handle_style shadow-2 flex-n fac fja">
  70. <view class="common_handle_style_item " @click="gotoPage(5)">
  71. <view class="common_handle_style_img iconfont iconjuxing26"></view>
  72. <view class="common_handle_style_text">补账</view>
  73. </view>
  74. </view>
  75. </template>
  76. <u-toast ref="uToast"></u-toast>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. stateTab: 0,
  84. isWedding: 0,
  85. hasWedding: 0,
  86. type: 0,
  87. id: '',
  88. info: {},
  89. wedinfo: {},
  90. tabidx:0,
  91. }
  92. },
  93. mounted() {
  94. },
  95. onLoad(option) {
  96. this.type = option.type;
  97. this.id = option.id;
  98. this.tabidx=option.idx;
  99. },
  100. onShow() {
  101. this.getData(this.id);
  102. },
  103. methods: {
  104. goBack(){
  105. var pages = getCurrentPages();
  106. var prevPage = pages[pages.length - 2]; //上一个页面
  107. prevPage.$vm.chooseState=Number(this.tabidx);
  108. console.warn(prevPage.$vm)
  109. prevPage.$vm.changeTab(Number(this.type));//重点$vm
  110. uni.navigateBack({
  111. delta:1
  112. })
  113. },
  114. changeTabInfo(data) {
  115. this.stateTab = data;
  116. },
  117. getData(orderId) {
  118. this.$axios.get('app/order/orderDetailById/' + orderId).then(res => {
  119. console.log(res)
  120. this.info = res.data;
  121. this.wedinfo = res.data.orderWedding[0] || [];
  122. uni.setStorage({
  123. key: 'orderFollowList',
  124. data: res.data.orderFollowList
  125. })
  126. var packageContent = '',
  127. orderExtraContent = '',
  128. paytypeContent = '';
  129. //普通套餐内容
  130. for (var i in this.info.orderPackage.itemsExs) {
  131. packageContent += this.info.orderPackage.itemsExs[i].itemName + '、';
  132. }
  133. for (var i in this.info.orderPackage.itemsFoods) {
  134. packageContent += this.info.orderPackage.itemsFoods[i].foodName + '、';
  135. }
  136. if (packageContent.substring(packageContent.length - 1, packageContent.length) == '、') {
  137. this.info.packageContent = packageContent.substring(0, packageContent.length - 1)||''
  138. }
  139. //增加项目内容
  140. for (var i in this.info.orderExtra.itemsExs) {
  141. orderExtraContent += this.info.orderExtra.itemsExs[i].itemName + ':' + this.info.orderExtra.itemsExs[i].itemPrice +
  142. '*' +
  143. this.info.orderExtra.itemsExs[i].itemCount + '、';
  144. }
  145. for (var i in this.info.orderExtra.itemsFoods) {
  146. orderExtraContent += this.info.orderExtra.itemsFoods[i].foodName + ':' + this.info.orderExtra.itemsFoods[i].foodPrice +
  147. '*' + this.info.orderExtra.itemsFoods[i].foodCount + '、';
  148. }
  149. if (orderExtraContent.substring(orderExtraContent.length - 1, orderExtraContent.length) == '、') {
  150. this.info.orderExtraContent = orderExtraContent.substring(0, orderExtraContent.length - 1)
  151. }
  152. for (var i in this.info.payTypes) {
  153. if (this.info.payTypes[i].payTypeCode == '03') {
  154. paytypeContent += '<br/>' + (this.info.payTypes[i].housePrice||0 )+ '元/场'
  155. }
  156. if (this.info.payTypes[i].payTypeCode == '01') {
  157. paytypeContent += '<br/>' + (this.info.payTypes[i].onePrice||0) + '元*' + (this.info.payTypes[i].orderCount||0) + '人=' +
  158. ((this.info.payTypes[i].onePrice||0) * (this.info.payTypes[i].orderCount||0)) + '元';
  159. }
  160. if (this.info.payTypes[i].payTypeCode == '02') {
  161. paytypeContent += '<br/>' + (this.info.payTypes[i].onePrice||0) + '元*' + (this.info.payTypes[i].orderCount||0) + '桌=' +
  162. ((this.info.payTypes[i].onePrice||0) * (this.info.payTypes[i].orderCount||0)) + '元' + (this.info.payTypes[i].bakOrderCount ?
  163. ('(备桌' + this.info.payTypes[i].bakOrderCount + '桌)') : '');
  164. }
  165. }
  166. this.info.paytypeContent = paytypeContent
  167. if (this.type) {
  168. var wedpackageContent = '',
  169. wedorderExtraContent = '';
  170. for (var i in this.wedinfo.weddingItemsExs) {
  171. wedpackageContent += this.wedinfo.weddingItemsExs[i].itemName + '、';
  172. }
  173. if (wedpackageContent.substring(wedpackageContent.length - 1, wedpackageContent.length) == '、') {
  174. wedpackageContent = wedpackageContent.substring(0, wedpackageContent.length - 1)
  175. }
  176. for (var i in this.wedinfo.extra) {
  177. wedorderExtraContent += this.wedinfo.extra[i].itemName + ':' + this.wedinfo.extra[i].itemPrice + '*' + this.wedinfo
  178. .extra[i].itemCount + '、';
  179. }
  180. if (wedorderExtraContent.substring(wedorderExtraContent.length - 1, wedorderExtraContent.length) == '、') {
  181. wedorderExtraContent = wedorderExtraContent.substring(0, wedorderExtraContent.length - 1)
  182. }
  183. this.wedinfo.packageContent = wedpackageContent;
  184. this.wedinfo.orderExtraContent = wedorderExtraContent;
  185. }
  186. }).catch(err => {
  187. console.log(err)
  188. this.$refs.uToast.error(err.msg);
  189. })
  190. },
  191. look() {
  192. },
  193. gotoPage(page) {
  194. console.log(page)
  195. switch (page) {
  196. case 0://历史记录
  197. uni.navigateTo({
  198. url: '../history/index?id=' + (this.type == 0 ? this.id : this.info.weddingId) + '&type=' + this.type,
  199. success: res => {},
  200. fail: () => {},
  201. complete: () => {}
  202. });
  203. break;
  204. case 1://确认收款
  205. uni.navigateTo({
  206. url: '../collection/index?id=' + (this.type == 0 ? this.id : this.info.weddingId) + '&type=' + this.type,
  207. success: res => {},
  208. fail: () => {},
  209. complete: () => {}
  210. });
  211. break;
  212. case 2://结算
  213. uni.navigateTo({
  214. url: '../settlement/index?id=' + this.id + (this.type == 0 ? '' : ('&wedId=' + this.info.weddingId)) +
  215. '&type=' + this.type,
  216. success: res => {},
  217. fail: () => {},
  218. complete: () => {}
  219. });
  220. break;
  221. case 3://取消
  222. if (this.info.hasWedding == '0') {
  223. uni.navigateTo({
  224. url: '../cancel/index?id=' + this.id+ '&type=' + this.type,
  225. success: res => {},
  226. fail: () => {},
  227. complete: () => {}
  228. });
  229. } else {
  230. this.$refs.uToast.error('此订单存在婚庆订单,请先将婚庆订单取消,再进行取消操作');
  231. }
  232. break;
  233. case 4://取消
  234. uni.navigateTo({
  235. url: '../cancel/index?id=' + this.info.weddingId + '&type=' + this.type,
  236. success: res => {},
  237. fail: () => {},
  238. complete: () => {}
  239. });
  240. break;
  241. case 5://补账
  242. uni.navigateTo({
  243. url: '../supplement/index?id=' + (this.type == 0 ? this.id : this.info.weddingId) + '&type=' + this.type,
  244. success: res => {},
  245. fail: () => {},
  246. complete: () => {}
  247. });
  248. break;
  249. }
  250. }
  251. },
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. .remark {
  256. font-size: 28rpx;
  257. color: #555555;
  258. }
  259. .common_handle_style_zw {
  260. height: 139rpx;
  261. }
  262. .iconjuxing13 {
  263. font-size: 38rpx;
  264. }
  265. .common_handle_style {
  266. position: fixed;
  267. background: white;
  268. bottom: 0;
  269. left: 0;
  270. width: 100%;
  271. height: 119rpx;
  272. .common_handle_style_item {
  273. text-align: center;
  274. width: 200rpx;
  275. .common_handle_style_img {
  276. width: 53rpx;
  277. height: 50rpx;
  278. font-size: 50rpx;
  279. color: #007AFF;
  280. margin: 0 auto;
  281. }
  282. .common_handle_style_text {
  283. color: #007AFF;
  284. font-size: 24rpx;
  285. line-height: 24rpx;
  286. margin-top: 10rpx;
  287. }
  288. }
  289. }
  290. </style>