特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
3.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <!-- 记工记账 -->
  3. <view class="page">
  4. <navbar title="记账"
  5. bgColor="#F9FEFE"
  6. leftClick @leftClick="$utils.navigateBack" />
  7. <uv-cell
  8. title="选择日期"
  9. rightIconStyle="fontSize: 30rpx;"
  10. :value="form.billDate || '请选择选择日期'"
  11. @click="$refs.datetimePicker.open()"
  12. isLink
  13. ></uv-cell>
  14. <view class="form-sheet-cell">
  15. <view class="label">
  16. 类型
  17. </view>
  18. <uv-radio-group v-model="form.type">
  19. <view class="price">
  20. <uv-radio
  21. :customStyle="{margin: '8px'}"
  22. v-for="(item, index) in typeList"
  23. :key="index"
  24. iconSize="30rpx"
  25. size="40rpx"
  26. labelSize="26rpx"
  27. :label="item.name"
  28. :name="item.index">
  29. </uv-radio>
  30. </view>
  31. </uv-radio-group>
  32. </view>
  33. <view class="form-sheet-cell">
  34. <view class="label">
  35. 金额
  36. </view>
  37. <input placeholder="请输入金额"
  38. type="number"
  39. v-model="form.amount" />
  40. </view>
  41. <view class="form-sheet-cell">
  42. <view class="label">
  43. 备注
  44. </view>
  45. <uv-textarea
  46. v-model="form.remarks"
  47. count
  48. :maxlength="300"
  49. autoHeight
  50. placeholder="请输入备注"></uv-textarea>
  51. </view>
  52. <view class="uni-color-btn"
  53. @click="submit">
  54. 确认
  55. </view>
  56. <uv-datetime-picker
  57. ref="datetimePicker"
  58. mode="date"
  59. v-model="dateValue"
  60. @confirm="datetimePickerConfim"/>
  61. </view>
  62. </template>
  63. <script>
  64. import mixinList from '@/mixins/list.js'
  65. export default {
  66. mixins : [mixinList],
  67. data() {
  68. return {
  69. form : {
  70. billDate : '',
  71. amount : '',
  72. type : 0,
  73. remarks:''
  74. },
  75. id : 0,
  76. dateValue : new Date().getTime(),
  77. typeList : [
  78. {
  79. name : '收入',
  80. index:0
  81. },
  82. {
  83. name : '支出',
  84. index:1
  85. },
  86. ],
  87. }
  88. },
  89. onLoad({id}) {
  90. this.id = id
  91. this.form.notebookId = id;
  92. },
  93. onShow() {},
  94. methods: {
  95. datetimePickerConfim(e){
  96. this.form.billDate = this.$dayjs(e.value).format('YYYY-MM-DD')
  97. },
  98. submit(){
  99. if(this.$utils.verificationAll(this.form, {
  100. billDate : '请输入记工日期',//
  101. amount:'请输入金额',
  102. })){
  103. return
  104. }
  105. this.$api('addBillInfo', this.form, res => {
  106. if(res.code == 200){
  107. uni.showToast({
  108. title: res.message,
  109. icon: 'none'
  110. })
  111. setTimeout(uni.navigateBack,1000,-1)
  112. }
  113. })
  114. },
  115. }
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .page {
  120. background-color: #fff;
  121. .form-sheet-cell{
  122. display: flex;
  123. background-color: #fff;
  124. padding: 20rpx 30rpx;
  125. align-items: center;
  126. .label{
  127. width: 160rpx;
  128. }
  129. .price{
  130. display: flex;
  131. text-align: center;
  132. input{
  133. width: 150rpx;
  134. border: 1px solid $uni-color;
  135. margin: 0 10rpx;
  136. }
  137. }
  138. input{
  139. flex: 1;
  140. background-color: rgba($uni-color, 0.1);
  141. padding: 10rpx 20rpx;
  142. border-radius: 10rpx;
  143. }
  144. .right-icon{
  145. margin-left: auto;
  146. }
  147. }
  148. /deep/ .uv-textarea{
  149. background-color: rgba($uni-color, 0.1) !important;
  150. min-height: 400rpx;
  151. }
  152. }
  153. </style>