index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view class="invoice">
  3. <view class="invoice__tabs">
  4. <u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF"></u-tabs>
  5. </view>
  6. <view class="invoice__content">
  7. <view class="open" v-if="current == 0">
  8. <view class="form">
  9. <u-form :model="form" ref="uForm">
  10. <u-form-item label="发票类型" label-width="130" required >
  11. <u-radio-group v-model="form.type" prop="type">
  12. <u-radio v-for="(item, index) in typeList" :key="index" :name="item.value">
  13. {{ item.name }}
  14. </u-radio>
  15. </u-radio-group>
  16. </u-form-item>
  17. <u-form-item label="申请主体" label-width="130" required >
  18. <u-radio-group v-model="form.main" prop="main">
  19. <u-radio v-for="(item, index) in mainList" :key="index" :name="item.value">
  20. {{ item.name }}
  21. </u-radio>
  22. </u-radio-group>
  23. </u-form-item>
  24. <u-form-item label="发票抬头" label-width="130" required prop="header" >
  25. <u-input placeholder="请输入" v-model="form.header" />
  26. </u-form-item>
  27. <u-form-item label="选择订单" label-width="130" required prop="orderId" right-icon="arrow-right">
  28. <view class="form-item" @click="selectOrderModal = true">
  29. <u-input v-if="false" v-model="form.orderId" />
  30. <view class="content">
  31. {{ form.orderId || '请选择' }}
  32. </view>
  33. </view>
  34. </u-form-item>
  35. <view>
  36. <view class="check-order" v-for="(item,index) in orderList" :key="index" v-if="item.disabled">
  37. <view class="close" @click="deleteOrder(index)">
  38. <u-icon name="close-circle-fill" color="#FF2D55" size="40"></u-icon>
  39. </view>
  40. <view class="title">商品名称</view>
  41. <view class="number">订单编号</view>
  42. <view class="price">¥ 100元</view>
  43. </view>
  44. </view>
  45. </u-form>
  46. </view>
  47. <view class="order-text">
  48. <view class="order-text__label">本次申请开票金额:</view>
  49. <view class="order-text__price">¥ 999.00</view>
  50. </view>
  51. <view class="submit">
  52. 提交申请
  53. </view>
  54. </view>
  55. <view class="record" v-if="current == 1">
  56. record
  57. </view>
  58. </view>
  59. <u-popup class="modal" v-model="selectOrderModal" mode="bottom" border-radius="40">
  60. <view class="popup_box">
  61. <view class="line"></view>
  62. <view class="title">选择订单</view>
  63. <u-line color="#D6D6DB" />
  64. <view>
  65. <scroll-view scroll-y="true" style="height: 500rpx;">
  66. <view>
  67. <u-checkbox-group>
  68. <view v-for="(item, index) in orderList" :key="index" >
  69. <view class="order-item">
  70. <view>
  71. <u-checkbox
  72. :disabled="item.disabled"
  73. shape="circle"
  74. :name="item.name"
  75. v-model="item.checked"
  76. >
  77. <view class="order-item__bg" :class="item.checked?'active':''" >
  78. <view>
  79. <view class="order-title">商品名称</view>
  80. <view class="order-number">订单编号</view>
  81. <view class="order-price">¥ 100元</view>
  82. </view>
  83. </view>
  84. </u-checkbox >
  85. </view>
  86. </view>
  87. </view>
  88. </u-checkbox-group>
  89. </view>
  90. </scroll-view>
  91. </view>
  92. <view class="confrim-btn">
  93. <view class="okBtn" @click="okPopup(1)">确定</view>
  94. </view>
  95. </view>
  96. </u-popup>
  97. </view>
  98. </template>
  99. <script>
  100. import { mapGetters } from 'vuex';
  101. export default {
  102. components: {},
  103. data() {
  104. return {
  105. checkOrderList:[],
  106. list: [
  107. {
  108. name: '发票申请'
  109. },
  110. {
  111. name: '发票记录'
  112. }
  113. ],
  114. form:{
  115. type:'',
  116. main:'',
  117. header:'',
  118. orderId:'',
  119. },
  120. orderValue:'',
  121. orderList:[{checked:false,name:'1'},{checked:false,name:'2'},{checked:false,name:'3'},{checked:false,name:'4'}],
  122. selectOrderModal:false,
  123. current: 0,
  124. order: [],
  125. typeList:[{
  126. name:'普通发票',
  127. value:'1'
  128. },{
  129. name:'增值税专用发票',
  130. value:'2'
  131. }],
  132. mainList:[{
  133. name:'个人',
  134. value:'1'
  135. },{
  136. name:'企业',
  137. value:'2'
  138. }]
  139. };
  140. },
  141. // onPullDownRefresh() {},
  142. onLoad(option) {
  143. },
  144. onShow() {
  145. },
  146. methods: {
  147. change(e) {
  148. console.log(e)
  149. this.current = e;
  150. },
  151. radioGroupChange(e) {
  152. console.log(e)
  153. },
  154. okPopup() {
  155. this.selectOrderModal = false;
  156. this.orderList.forEach((item,index) => {
  157. if(item.checked) {
  158. this.$set(this.orderList[index],'disabled',true)
  159. }
  160. })
  161. console.log(this.checkOrderList)
  162. },
  163. deleteOrder(index) {
  164. this.$set(this.orderList[index],'disabled',false)
  165. this.$set(this.orderList[index],'checked',false)
  166. }
  167. },
  168. computed: { ...mapGetters(['userInfo']) }
  169. };
  170. </script>
  171. <style>
  172. page {
  173. background: #eaeef1;
  174. }
  175. </style>
  176. <style scoped lang="scss">
  177. .invoice {
  178. &__tabs {
  179. width: 100%;
  180. text-align: center;
  181. position: fixed;
  182. height: 96rpx;
  183. z-index: 999;
  184. }
  185. &__content {
  186. padding-top:96rpx;
  187. .open {
  188. margin:8rpx 24rpx 0;
  189. .form {
  190. padding:24rpx;
  191. width: 702rpx;
  192. background: #FFFFFF;
  193. border-radius: 24rpx;
  194. // /deep/ .u-input__input {
  195. // text-align: right;
  196. // }
  197. .form-item {
  198. height:78rpx;
  199. display: flex;
  200. align-items: center;
  201. .text {
  202. font-size: 28rpx;
  203. width:120rpx;
  204. // color: #999999;
  205. }
  206. .content {
  207. flex:1;
  208. text-align: left;
  209. color:#bbb;
  210. }
  211. }
  212. .check-order {
  213. margin-top:20rpx;
  214. width: 654rpx;
  215. height: 168rpx;
  216. background: #F5F5F5;
  217. border: 2px solid #F5F5F5;
  218. padding:20rpx;
  219. position:relative;
  220. .close {
  221. position:absolute;
  222. right:0;
  223. top:0;
  224. }
  225. .title,.number,.price {
  226. color:#333333;
  227. margin-top:10rpx;
  228. line-height: 30rpx;
  229. font-size: 30rpx;
  230. }
  231. .number {
  232. color:#999;
  233. }
  234. }
  235. }
  236. .order-text {
  237. margin-top:16rpx;
  238. padding:0 30rpx;
  239. width: 702rpx;
  240. height: 80rpx;
  241. background: #FFFFFF;
  242. border-radius: 24rpx;
  243. display: flex;
  244. align-items: center;
  245. &__label {
  246. font-size: 24rpx;
  247. }
  248. &__price {
  249. font-size: 30rpx;
  250. margin-left:20rpx;
  251. color:#FF2D55;
  252. }
  253. }
  254. .submit {
  255. text-align: center;
  256. line-height: 80rpx;
  257. color:#fff;
  258. font-size: 30rpx;
  259. width: 526rpx;
  260. height: 80rpx;
  261. background: #007AFF;
  262. box-shadow: 0rpx 8rpx 7rpx 1rpx rgba(0, 122, 255, 0.1);
  263. border-radius: 40rpx;
  264. position:fixed;
  265. left:50%;
  266. bottom:40rpx;
  267. transform: translateX(-50%);
  268. }
  269. }
  270. }
  271. .modal {
  272. .line {
  273. width: 80rpx;
  274. height: 8rpx;
  275. background: #999999;
  276. border-radius: 4rpx;
  277. margin:8rpx auto 0;
  278. }
  279. .title {
  280. margin:20rpx 0 15rpx;
  281. text-align: center;
  282. font-size: 24rpx;
  283. color: #999999;
  284. }
  285. .order-item {
  286. display: flex;
  287. align-items: center;
  288. padding: 20rpx;
  289. &__bg {
  290. width: 654rpx;
  291. height: 168rpx;
  292. background: #F5F5F5;
  293. border: 2px solid #F5F5F5;
  294. border-radius: 16rpx;
  295. padding:20rpx;
  296. &.active {
  297. background: #EBF5FF;
  298. border: 2px solid #007AFF;
  299. }
  300. .order-title,.order-number,.order-price {
  301. color:#333333;
  302. margin-top:10rpx;
  303. line-height: 30rpx;
  304. font-size: 30rpx;
  305. }
  306. .order-number {
  307. color:#999;
  308. }
  309. }
  310. }
  311. .confrim-btn {
  312. width: 750rpx;
  313. height: 98rpx;
  314. background: rgba(255, 255, 255, 0.98);
  315. display: flex;
  316. align-items: center;
  317. justify-content: center;
  318. .okBtn {
  319. text-align: center;
  320. line-height: 64rpx;
  321. color:#fff;
  322. font-size: 30rpx;
  323. width: 200rpx;
  324. height: 64rpx;
  325. background: linear-gradient(0deg, #015EEA, #00C0FA);
  326. border-radius: 32rpx;
  327. }
  328. }
  329. }
  330. }
  331. </style>