voucher.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view v-if="show">
  3. <u-popup :show="show" round="15" mode="center" :closeable="true" :customStyle="{ width: '95%' }" @close="show = false">
  4. <view class="popup">
  5. <u-divider text="上传凭证(最多3张)"></u-divider>
  6. <view class="bbg">
  7. <images v-model="item.voucher" :read="item.audit == 2"></images>
  8. </view>
  9. <view class="tips" v-if="item.audit == 1">
  10. <text class="icon">&#xe600;</text>
  11. <text>等待企业方确认凭证</text>
  12. </view>
  13. <view class="tips" v-if="item.audit == 3">
  14. <text class="icon">&#xe600;</text>
  15. <text>审核不通过:{{ item.msg }}</text>
  16. </view>
  17. <button class="btn" @click="add()" v-if="item.audit != 2">{{ item.audit == 3 ? '重新上传' : '立即提交' }}</button>
  18. </view>
  19. </u-popup>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'voucher',
  25. data() {
  26. return {
  27. show: false,
  28. item: { voucher: [] }
  29. };
  30. },
  31. methods: {
  32. init(data) {
  33. this.show = true;
  34. this.item = data;
  35. this.item.voucher = this.item.voucher ? this.item.voucher.split(',') : [];
  36. },
  37. add() {
  38. this.http.request({
  39. url: '/app/packages/voucher',
  40. data: { id: this.item.id, voucher: this.item.voucher.toString() },
  41. method: 'POST',
  42. success: (res) => {
  43. uni.showModal({
  44. title: '提示',
  45. content: '提交成功',
  46. showCancel: false,
  47. success: (res) => {
  48. this.show = false;
  49. this.$emit('success');
  50. }
  51. });
  52. }
  53. });
  54. }
  55. }
  56. };
  57. </script>
  58. <style lang="scss">
  59. .tips {
  60. border-radius: 5px;
  61. margin-top: 15px;
  62. }
  63. .btn {
  64. margin-top: 20px;
  65. }
  66. </style>