特易招,招聘小程序
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.

150 lines
2.8 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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.workDate || '请选择选择日期'"
  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-number-box v-model="form.worktime"
  19. :step="0.5"
  20. :min="0.5"
  21. ></uv-number-box>
  22. </view> -->
  23. <view class="form-sheet-cell">
  24. <view class="label">
  25. 工作时间
  26. </view>
  27. <!-- <input placeholder="请输入上班时间"
  28. type="number"
  29. v-model="form.phone" /> -->
  30. <uv-number-box v-model="form.overtime"
  31. :step="0.5"
  32. :min="0"
  33. ></uv-number-box>
  34. </view>
  35. <view class="form-sheet-cell">
  36. <view class="label">
  37. 备注
  38. </view>
  39. <uv-textarea
  40. v-model="form.remarks"
  41. count
  42. :maxlength="300"
  43. autoHeight
  44. placeholder="请输入备注"></uv-textarea>
  45. </view>
  46. <view class="uni-color-btn"
  47. @click="submit">
  48. 确认
  49. </view>
  50. <uv-datetime-picker
  51. ref="datetimePicker"
  52. mode="date"
  53. v-model="dateValue"
  54. @confirm="datetimePickerConfim"/>
  55. </view>
  56. </template>
  57. <script>
  58. import mixinList from '@/mixins/list.js'
  59. export default {
  60. mixins : [mixinList],
  61. data() {
  62. return {
  63. form : {
  64. workDate : '',
  65. worktime : 0.5,
  66. remarks : '',
  67. overtime : 0,
  68. },
  69. id : 0,
  70. dateValue : new Date().getTime()
  71. }
  72. },
  73. onLoad({id}) {
  74. this.id = id
  75. this.form.notebookId = id;
  76. },
  77. onShow() {},
  78. methods: {
  79. datetimePickerConfim(e){
  80. this.form.workDate = this.$dayjs(e.value).format('YYYY-MM-DD')
  81. },
  82. submit(){
  83. // this.form.overtime = String(this.form.overtime)
  84. if(this.$utils.verificationAll(this.form, {
  85. workDate : '请选择记工日期',//
  86. // worktime : '请输入上班时长',//
  87. overtime : '请输入工作时长',
  88. })){
  89. return
  90. }
  91. this.$api('addWorkInfo', this.form, res => {
  92. if(res.code == 200){
  93. uni.showToast({
  94. title: res.message,
  95. icon: 'none'
  96. })
  97. setTimeout(uni.navigateBack,1000,-1)
  98. }
  99. })
  100. },
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .page {
  106. background-color: #fff;
  107. .form-sheet-cell{
  108. display: flex;
  109. background-color: #fff;
  110. padding: 20rpx 30rpx;
  111. align-items: center;
  112. .label{
  113. width: 160rpx;
  114. }
  115. .price{
  116. display: flex;
  117. text-align: center;
  118. input{
  119. width: 150rpx;
  120. border: 1px solid $uni-color;
  121. margin: 0 10rpx;
  122. }
  123. }
  124. input{
  125. flex: 1;
  126. background-color: rgba($uni-color, 0.1);
  127. padding: 10rpx 20rpx;
  128. border-radius: 10rpx;
  129. }
  130. .right-icon{
  131. margin-left: auto;
  132. }
  133. }
  134. /deep/ .uv-textarea{
  135. background-color: rgba($uni-color, 0.1) !important;
  136. min-height: 400rpx;
  137. }
  138. }
  139. </style>