addpunish.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="content">
  3. <view class="main-box">
  4. <view class="main-item">
  5. <view class="main-font">
  6. 扣款类型
  7. </view>
  8. <picker @change="bindPickerType" :range="typelist" class="input">
  9. <text>{{ type }}</text>
  10. </picker>
  11. </view>
  12. <view class="main-item">
  13. <view class="main-font">
  14. 扣款人
  15. </view>
  16. <input class="input" type="text" v-model="name" placeholder="请填写姓名">
  17. </view>
  18. <view class="main-item">
  19. <view class="main-font">
  20. 处罚日期
  21. </view>
  22. <view class="input">
  23. <view class="uni-list-cell">
  24. <picker mode="date" :value="date" @change="bindDateChange">
  25. <view class="uni-input">{{date}}</view>
  26. </picker>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="main-item">
  31. <view class="main-font">
  32. 扣款金额
  33. </view>
  34. <input class="input" type="text" v-model="money" placeholder="请填写金额">
  35. </view>
  36. <view class="main-item">
  37. <view class="main-font">
  38. 是否征求员工意见
  39. </view>
  40. <picker class="input" @change="bindPickerSf" :range="array">
  41. <text>{{ sex }}</text>
  42. </picker>
  43. </view>
  44. <view class="info-box">
  45. <view class="info-title">
  46. 处罚说明<text class="info-tip">(限XX字)</text>
  47. </view>
  48. <textarea class="info-box" placeholder="请填写处罚说明..." v-model="info" id="" cols="30" rows="10"></textarea>
  49. </view>
  50. </view>
  51. <view class="btn">
  52. 确认添加
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. name: '',
  61. money: '',
  62. type: '请选择扣款类型',
  63. typelist: ['迟到', '早退', '旷工'],
  64. date: '请选择日期',
  65. array: ['是', '否'],
  66. sex: '请选择是否',
  67. info: ''
  68. };
  69. },
  70. onLoad() {},
  71. onShow() {},
  72. onReachBottom() {},
  73. onReady() {},
  74. methods: {
  75. // 选择类型
  76. bindPickerType: function(e) {
  77. this.type = this.typelist[e.target.value];
  78. },
  79. bindDateChange: function(e) {
  80. this.date = e.detail.value;
  81. console.log(e);
  82. },
  83. bindPickerSf: function(e) {
  84. this.sex = this.array[e.target.value];
  85. },
  86. }
  87. };
  88. </script>
  89. <style lang="scss">
  90. page,
  91. .content {
  92. min-height: 100%;
  93. height: auto;
  94. }
  95. .main-box {
  96. margin-top: 20rpx;
  97. padding: 0 30rpx 20rpx;
  98. background: #ffffff;
  99. .main-item {
  100. padding: 35rpx 18rpx;
  101. border-bottom: 1px solid #f5f5f5;
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. .main-font {
  106. font-size: 30rpx;
  107. font-family: PingFang SC;
  108. font-weight: 500;
  109. color: #222222;
  110. }
  111. .input {
  112. text-align: right;
  113. padding: 0 20rpx;
  114. font-size: 30rpx;
  115. font-family: PingFang SC;
  116. font-weight: 400;
  117. color: #999999;
  118. }
  119. }
  120. }
  121. .info-box {
  122. margin-top: 20rpx;
  123. .info-title {
  124. font-size: 30rpx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #222222;
  128. .info-tip {
  129. font-size: 24rpx;
  130. color: #666666;
  131. }
  132. }
  133. .info-box {
  134. width: 100%;
  135. margin-top: 20rpx;
  136. font-size: 28rpx;
  137. font-family: PingFang SC;
  138. font-weight: 500;
  139. color: #999999;
  140. }
  141. }
  142. .btn {
  143. margin: 100rpx auto 0;
  144. width: 622rpx;
  145. height: 85rpx;
  146. background: #069CFA;
  147. border-radius: 15rpx;
  148. text-align: center;
  149. line-height: 85rpx;
  150. font-size: 32rpx;
  151. font-family: PingFang SC;
  152. font-weight: bold;
  153. color: #FFFFFF;
  154. }
  155. </style>