info.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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="getDetail(s)" >
  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;font-size:28upx;">查看明细</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 big default" style="margin-right:60upx;" v-if="detailInfo.status == 1 && detailInfo.clearStyle==1" @click="cancelFn(detailInfo)">取消本单</button>
  97. <button class="admin-button-com big blue" 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. import { mapGetters } from "vuex";
  106. export default {
  107. name: "info",
  108. components: {
  109. TuiListCell
  110. },
  111. mixins: [productMins],
  112. data() {
  113. return {
  114. pageType: "order_change",
  115. autoLoad: false,
  116. stepActive: 0,
  117. form: {
  118. name: ""
  119. },
  120. detailInfo: {},
  121. loading: false
  122. };
  123. },
  124. computed: {
  125. ...mapGetters(["getLoginInfo"])
  126. },
  127. onShow(){
  128. this.init()
  129. },
  130. methods: {
  131. notLogin(){
  132. return false
  133. if(!this.$util.isEmpty(this.getLoginInfo.admin) && this.getLoginInfo.admin.currentShopId > 0){
  134. return false
  135. }
  136. return true
  137. },
  138. remindLogin(){
  139. let that = this
  140. this.$util.confirmModal({content:'您还没有登录,请先登录',okText:'去登录'},() => {
  141. that.pageTo({url:'/admin/home/login'})
  142. })
  143. },
  144. getDetail(s){
  145. if(this.notLogin()){
  146. this.remindLogin()
  147. return false
  148. }
  149. this.pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})
  150. },
  151. cancelFn(info){
  152. if(this.notLogin()){
  153. this.remindLogin()
  154. return false
  155. }
  156. let that = this
  157. that.$util.confirmModal({content:'确认取消?'},() => {
  158. cancel({id:info.id}).then(res=>{
  159. if(res.code == 1){
  160. that.$msg('取消成功')
  161. that.init()
  162. }
  163. })
  164. })
  165. },
  166. toClear(info){
  167. if(this.notLogin()){
  168. this.remindLogin()
  169. return false
  170. }
  171. let that = this
  172. detail({ id:info.id }).then(res => {
  173. if(res.code == 1) {
  174. that.pageTo({ url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond})
  175. }
  176. })
  177. },
  178. copy(val) {
  179. const self = this;
  180. uni.setClipboardData({
  181. data: val,
  182. success: function() {
  183. self.$msg("复制成功");
  184. }
  185. });
  186. },
  187. callUp(mobile) {
  188. uni.makePhoneCall({ phoneNumber: mobile })
  189. },
  190. init() {
  191. let id = 0
  192. if(this.option.id){
  193. id = this.option.id
  194. }else{
  195. //扫码打印结账单
  196. //https://api.shop.huaml.com/#/admin/clear/info?id=322
  197. if(this.option.q){
  198. let currentUrl = decodeURIComponent(this.option.q);
  199. id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
  200. }
  201. }
  202. if(Number(id)>0){
  203. this.getInfo(Number(id))
  204. }
  205. },
  206. getInfo(id){
  207. let that = this
  208. getDetail({id}).then(res=>{
  209. if(res.code == 1){
  210. that.detailInfo = res.data
  211. }
  212. })
  213. }
  214. }
  215. };
  216. </script>
  217. <style lang="scss" scoped>
  218. .info-content_box {
  219. padding: 0 20upx 100upx;
  220. & > .title {
  221. color: #666666;
  222. font-size: 28upx;
  223. font-weight: 600;
  224. padding: 30upx 3upx;
  225. }
  226. & .address-des_bx {
  227. display: flex;
  228. padding: 20upx 10upx 30upx 20upx;
  229. & > view:nth-child(1) {
  230. flex: 1;
  231. margin-top: 10upx;
  232. & > view:nth-child(1) {
  233. color: #333333;
  234. font-size: 32upx;
  235. font-weight: bold;
  236. }
  237. & > view:nth-child(2) {
  238. color: #666666;
  239. font-size: 28upx;
  240. font-weight: 400;
  241. margin-top: 20upx;
  242. }
  243. }
  244. & > view:nth-child(2) {
  245. display: flex;
  246. & .icondianhua1 {
  247. font-size: 50upx;
  248. color: #3385ff;
  249. margin-left: 0upx;
  250. }
  251. }
  252. }
  253. .bills-info_box {
  254. padding: 30upx 20upx 30upx;
  255. & > .order-info_box {
  256. display: flex;
  257. align-items: center;
  258. font-size: 26upx;
  259. font-weight: 400;
  260. margin-bottom: 5upx;
  261. & > view:nth-child(1) {
  262. color: #999999;
  263. width: 135upx;
  264. text-align: right;
  265. }
  266. & > view:nth-child(2) {
  267. color: #333333;
  268. }
  269. & > .price {
  270. flex: 1;
  271. font-size: 30upx;
  272. color: #333333;
  273. display: flex;
  274. align-items: center;
  275. justify-content: flex-end;
  276. & .iconxiangyou {
  277. color: #999999;
  278. font-size: 25upx;
  279. margin-left: 12upx;
  280. }
  281. }
  282. }
  283. }
  284. .content-box {
  285. background-color: #ffffff;
  286. border-radius: 10upx;
  287. }
  288. .commodity-view {
  289. display: flex;
  290. flex-direction: column;
  291. .commodity-list {
  292. padding: 20upx;
  293. .commodity-item {
  294. display: flex;
  295. margin-bottom: 20upx;
  296. .item-icon {
  297. flex-shrink: 0;
  298. width: 140upx;
  299. height: 140upx;
  300. }
  301. .item-info {
  302. display: flex;
  303. flex-direction: column;
  304. justify-content: center;
  305. flex: 1;
  306. margin-left: 20upx;
  307. .info-line {
  308. margin-bottom: 20upx;
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: flex-end;
  312. .item-name {
  313. color: #666;
  314. font-size: 28upx;
  315. }
  316. .item-price {
  317. color: #333;
  318. font-size: 22upx;
  319. .price {
  320. font-size: 32upx;
  321. font-weight: bold;
  322. }
  323. }
  324. .item-type {
  325. color: #999;
  326. font-size: 24upx;
  327. }
  328. .item-count {
  329. color: #666;
  330. font-size: 24upx;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. .summary-bar {
  337. padding: 0 20upx;
  338. height: 90upx;
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. border-top: 1px solid #eeeeee;
  343. .operate-view {
  344. display: flex;
  345. align-items: center;
  346. color: #3385ff;
  347. font-size: 26upx;
  348. .iconfont {
  349. margin-right: 20upx;
  350. font-size: 40upx;
  351. }
  352. }
  353. .describe-view {
  354. display: flex;
  355. align-items: center;
  356. color: #333;
  357. font-size: 24upx;
  358. .price {
  359. font-weight: bold;
  360. font-size: 36upx;
  361. }
  362. }
  363. }
  364. }
  365. .shipping-address {
  366. display: flex;
  367. align-items: center;
  368. margin-top: 20upx;
  369. & > view:nth-child(1) {
  370. color: #999999;
  371. font-size: 28upx;
  372. font-weight: 400;
  373. display: inline-block;
  374. padding: 30upx 0 30upx 20upx;
  375. flex: 1;
  376. & > text {
  377. color: #333333;
  378. font-weight: 600;
  379. }
  380. }
  381. & > view:nth-child(2) {
  382. font-size: 60upx;
  383. color: #d6e7ff;
  384. margin-right: 10upx;
  385. }
  386. }
  387. .price-detail {
  388. margin-top: 20upx;
  389. margin-bottom: 20upx;
  390. }
  391. .detail-price_box {
  392. color: #333333;
  393. font-size: 22upx;
  394. text-align: right;
  395. flex: 1;
  396. font-weight: 600;
  397. &.red {
  398. color: #ff2842;
  399. }
  400. }
  401. }
  402. .app-footer {
  403. display: flex;
  404. align-items: center;
  405. justify-content: flex-end;
  406. padding-right:40upx;
  407. }
  408. </style>