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

141 lines
2.6 KiB

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