info.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <view class="app-content">
  3. <view v-if="!$util.isEmpty(detailInfo)" class="info-content_box">
  4. <view class="title">
  5. 单据信息
  6. </view>
  7. <view class="bills-info_box content-box">
  8. <view class="order-info_box">
  9. <view>订单日期:</view>
  10. <view>{{ detailInfo.addTime.substr(5,11) }}</view>
  11. </view>
  12. <view class="order-info_box">
  13. <view>订单编码:</view>
  14. <view>{{ detailInfo.orderSn }}</view>
  15. <view class="price">
  16. <button @click="copy(detailInfo.orderSn)" class="admin-button-com default" > 复制 </button>
  17. </view>
  18. </view>
  19. <view class="order-info_box" v-if="detailInfo.status==2">
  20. <view>支付方式:</view>
  21. <view>{{ detailInfo.payWay==0?'微信':detailInfo.payWay==1?'支付宝':detailInfo.payWay==4?'现金':detailInfo.payWay==5?'银行卡':'其它' }}</view>
  22. </view>
  23. <view class="order-info_box">
  24. <view>操作人员:</view>
  25. <view>{{ detailInfo.operator }}</view>
  26. </view>
  27. <view class="order-info_box" v-if="detailInfo.status == 1">
  28. <view>过期时间:</view>
  29. <view>{{ detailInfo.deadline.substr(5,11) }}</view>
  30. </view>
  31. <view class="order-info_box">
  32. <view>订单状态:</view>
  33. <view style="color:red;font-weight:bold;">{{detailInfo.status == 1 ?'待结账':detailInfo.status==2?'已结账':detailInfo.status==3?'已取消':'待结账'}}</view>
  34. </view>
  35. </view>
  36. <view class="title">
  37. 订单列表
  38. </view>
  39. <view class="module-com content-box">
  40. <view class="commodity-view">
  41. <view class="commodity-list">
  42. <view v-for="(s, idx) in detailInfo.orderList" :key="idx" class="commodity-item" >
  43. <view class="item-info" @click="pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})" >
  44. <view class="info-line">
  45. <text class="item-name">{{ s.orderSn }} 时间 {{s.addTime.substr(5,11)}}</text>
  46. <text class="item-price">
  47. <text class="unit">¥</text>
  48. <text class="price">{{ s.orderPrice?parseFloat(s.orderPrice):0 }}</text>
  49. </text>
  50. </view>
  51. <view class="info-line">
  52. <text class="item-type">
  53. <text v-if="Number(s.bigNum)>0">{{s.bigNum}}扎</text>
  54. <text v-if="Number(s.smallNum)>0">{{s.smallNum}}支</text>
  55. <text style="margin-left:20upx;color:red;font-weight:bold;" v-if="Number(s.tkPrice)>0">退款¥{{parseFloat(s.tkPrice)}} 实付¥{{parseFloat(s.actPrice)}}</text>
  56. </text>
  57. <text class="item-count" style="color: #3385ff;">查看明细</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="summary-bar">
  63. <view class="operate-view" ></view>
  64. <view class="describe-view">
  65. 共{{ detailInfo.orderNum || 0 }}个订单
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="content-box price-detail">
  71. <div class="module-com input-line-wrap">
  72. <tui-list-cell class="line-cell" :hover="false">
  73. <div class="tui-title">总金额</div>
  74. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.prePrice ? parseFloat(detailInfo.prePrice) : 0 }}</div>
  75. </tui-list-cell>
  76. <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.discountAmount > 0">
  77. <div class="tui-title">扣除</div>
  78. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.discountAmount ? parseFloat(detailInfo.discountAmount) : 0 }}</div>
  79. </tui-list-cell>
  80. <tui-list-cell class="line-cell" :hover="false">
  81. <div class="tui-title">实际金额</div>
  82. <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.realPrice ? parseFloat(detailInfo.realPrice) : 0 }}</div>
  83. </tui-list-cell>
  84. </div>
  85. </view>
  86. <view class="content-box price-detail" v-if="detailInfo.remark && detailInfo.remark.length > 0">
  87. <div class="module-com input-line-wrap">
  88. <tui-list-cell class="line-cell" :hover="false">
  89. <div class="tui-title">备注</div>
  90. <input :disabled="true" v-model="detailInfo.remark" placeholder-class="phcolor" class="tui-input" name="name" maxlength="50" type="text" />
  91. </tui-list-cell>
  92. </div>
  93. </view>
  94. </view>
  95. <view class="app-footer">
  96. <button class="admin-button-com default" v-if="detailInfo.status == 1 && detailInfo.clearStyle==1" @click="cancelFn(detailInfo)">取消</button>
  97. <button class="admin-button-com default" v-if="detailInfo.status == 1" @click="toClear(detailInfo)">付款结清</button>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import { getDetail,detail,cancel } from "@/api/clear/index";
  103. import productMins from "@/mixins/product";
  104. import TuiListCell from "@/components/plugin/list-cell";
  105. export default {
  106. name: "info",
  107. components: {
  108. TuiListCell
  109. },
  110. mixins: [productMins],
  111. data() {
  112. return {
  113. pageType: "order_change",
  114. autoLoad: false,
  115. stepActive: 0,
  116. form: {
  117. name: ""
  118. },
  119. detailInfo: {},
  120. loading: false
  121. };
  122. },
  123. methods: {
  124. cancelFn(info){
  125. let that = this
  126. that.$util.confirmModal({content:'确认取消?'},() => {
  127. cancel({id:info.id}).then(res=>{
  128. if(res.code == 1){
  129. that.$msg('取消成功')
  130. that.init()
  131. }
  132. })
  133. })
  134. },
  135. toClear(info){
  136. let that = this
  137. detail({ id:info.id }).then(res => {
  138. if(res.code == 1) {
  139. that.pageTo({ url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond})
  140. }
  141. })
  142. },
  143. copy(val) {
  144. const self = this;
  145. uni.setClipboardData({
  146. data: val,
  147. success: function() {
  148. self.$msg("复制成功");
  149. }
  150. });
  151. },
  152. callUp(mobile) {
  153. uni.makePhoneCall({
  154. phoneNumber: mobile
  155. });
  156. },
  157. init() {
  158. let id = 0
  159. if(this.option.id){
  160. id = this.option.id
  161. }else{
  162. //扫码打印结账单
  163. //https://api.shop.huaml.com/#/admin/clear/info?id=322
  164. if(this.option.q){
  165. let currentUrl = decodeURIComponent(this.option.q);
  166. id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
  167. }
  168. }
  169. if(Number(id)>0){
  170. this.getInfo(Number(id))
  171. }
  172. },
  173. getInfo(id){
  174. let that = this
  175. getDetail({id}).then(res=>{
  176. if(res.code == 1){
  177. that.detailInfo = res.data
  178. }
  179. })
  180. }
  181. }
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. .info-content_box {
  186. padding: 0 20upx 100upx;
  187. & > .title {
  188. color: #666666;
  189. font-size: 28upx;
  190. font-weight: 600;
  191. padding: 30upx 3upx;
  192. }
  193. & .address-des_bx {
  194. display: flex;
  195. padding: 20upx 10upx 30upx 20upx;
  196. & > view:nth-child(1) {
  197. flex: 1;
  198. margin-top: 10upx;
  199. & > view:nth-child(1) {
  200. color: #333333;
  201. font-size: 32upx;
  202. font-weight: bold;
  203. }
  204. & > view:nth-child(2) {
  205. color: #666666;
  206. font-size: 28upx;
  207. font-weight: 400;
  208. margin-top: 20upx;
  209. }
  210. }
  211. & > view:nth-child(2) {
  212. display: flex;
  213. & .icondianhua1 {
  214. font-size: 50upx;
  215. color: #3385ff;
  216. margin-left: 0upx;
  217. }
  218. }
  219. }
  220. .bills-info_box {
  221. padding: 30upx 20upx 30upx;
  222. & > .order-info_box {
  223. display: flex;
  224. align-items: center;
  225. font-size: 26upx;
  226. font-weight: 400;
  227. margin-bottom: 5upx;
  228. & > view:nth-child(1) {
  229. color: #999999;
  230. width: 135upx;
  231. text-align: right;
  232. }
  233. & > view:nth-child(2) {
  234. color: #333333;
  235. }
  236. & > .price {
  237. flex: 1;
  238. font-size: 30upx;
  239. color: #333333;
  240. display: flex;
  241. align-items: center;
  242. justify-content: flex-end;
  243. & .iconxiangyou {
  244. color: #999999;
  245. font-size: 25upx;
  246. margin-left: 12upx;
  247. }
  248. }
  249. }
  250. }
  251. .content-box {
  252. background-color: #ffffff;
  253. border-radius: 10upx;
  254. }
  255. .commodity-view {
  256. display: flex;
  257. flex-direction: column;
  258. .commodity-list {
  259. padding: 20upx;
  260. .commodity-item {
  261. display: flex;
  262. margin-bottom: 20upx;
  263. .item-icon {
  264. flex-shrink: 0;
  265. width: 140upx;
  266. height: 140upx;
  267. }
  268. .item-info {
  269. display: flex;
  270. flex-direction: column;
  271. justify-content: center;
  272. flex: 1;
  273. margin-left: 20upx;
  274. .info-line {
  275. margin-bottom: 20upx;
  276. display: flex;
  277. justify-content: space-between;
  278. align-items: flex-end;
  279. .item-name {
  280. color: #666;
  281. font-size: 28upx;
  282. }
  283. .item-price {
  284. color: #333;
  285. font-size: 22upx;
  286. .price {
  287. font-size: 32upx;
  288. font-weight: bold;
  289. }
  290. }
  291. .item-type {
  292. color: #999;
  293. font-size: 24upx;
  294. }
  295. .item-count {
  296. color: #666;
  297. font-size: 24upx;
  298. }
  299. }
  300. }
  301. }
  302. }
  303. .summary-bar {
  304. padding: 0 20upx;
  305. height: 90upx;
  306. display: flex;
  307. align-items: center;
  308. justify-content: space-between;
  309. border-top: 1px solid #eeeeee;
  310. .operate-view {
  311. display: flex;
  312. align-items: center;
  313. color: #3385ff;
  314. font-size: 26upx;
  315. .iconfont {
  316. margin-right: 20upx;
  317. font-size: 40upx;
  318. }
  319. }
  320. .describe-view {
  321. display: flex;
  322. align-items: center;
  323. color: #333;
  324. font-size: 24upx;
  325. .price {
  326. font-weight: bold;
  327. font-size: 36upx;
  328. }
  329. }
  330. }
  331. }
  332. .shipping-address {
  333. display: flex;
  334. align-items: center;
  335. margin-top: 20upx;
  336. & > view:nth-child(1) {
  337. color: #999999;
  338. font-size: 28upx;
  339. font-weight: 400;
  340. display: inline-block;
  341. padding: 30upx 0 30upx 20upx;
  342. flex: 1;
  343. & > text {
  344. color: #333333;
  345. font-weight: 600;
  346. }
  347. }
  348. & > view:nth-child(2) {
  349. font-size: 60upx;
  350. color: #d6e7ff;
  351. margin-right: 10upx;
  352. }
  353. }
  354. .price-detail {
  355. margin-top: 20upx;
  356. margin-bottom: 20upx;
  357. }
  358. .detail-price_box {
  359. color: #333333;
  360. font-size: 22upx;
  361. text-align: right;
  362. flex: 1;
  363. font-weight: 600;
  364. &.red {
  365. color: #ff2842;
  366. }
  367. }
  368. }
  369. .app-footer {
  370. display: flex;
  371. align-items: center;
  372. justify-content: flex-end;
  373. & .admin-button-com {
  374. padding: 0;
  375. margin-right: 15upx;
  376. width: 140upx;
  377. height: 70upx;
  378. line-height: 70upx;
  379. text-align: center;
  380. color: #3385ff;
  381. border: 1px solid #3385ff;
  382. &.active{
  383. color: #666666;
  384. border: 1px solid #ccc;
  385. }
  386. }
  387. }
  388. </style>