complete.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view v-if="show">
  3. <u-popup :show="show" round="15" mode="center" :closeable="true" :customStyle="{ width: '90%' }" @close="show = false">
  4. <view class="popup">
  5. <u-divider text="确认完成任务" class="mt20 mb0"></u-divider>
  6. <view class="mbb">
  7. <view class="bz">1,同意即表示乙方完成了兼职工作,平台将会打款给乙方</view>
  8. <view class="bz">2,驳回即表示乙方尚未完成兼职工作,继续督促乙方完成</view>
  9. </view>
  10. <view class="xy">
  11. <u-checkbox-group class="checkbox" v-model="item.checked">
  12. <u-checkbox size="15" shape="circle" label="我已阅读并同意" labelSize="14" name="true"></u-checkbox>
  13. </u-checkbox-group>
  14. </view>
  15. <textarea rows="3" placeholder="请输入驳回原因" v-model="item.rejectMsg" v-if="item.isComplete == 3"></textarea>
  16. <view class="flex">
  17. <view class="f">
  18. <button class="btn" @click="add(2)">确定</button>
  19. </view>
  20. <view class="f">
  21. <button class="btn" @click="add(3)">驳回</button>
  22. </view>
  23. </view>
  24. </view>
  25. </u-popup>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'complete',
  31. data() {
  32. return {
  33. show: false,
  34. item: {}
  35. };
  36. },
  37. methods: {
  38. init(taskId) {
  39. this.show = true;
  40. this.item.id = taskId;
  41. },
  42. add(isComplete) {
  43. this.item.isComplete = isComplete;
  44. this.$forceUpdate();
  45. let rule = [{ name: 'checked', checkType: 'notnull', errorMsg: '请并勾选我已阅读并同意' }];
  46. if (isComplete == 3) {
  47. rule.push({ name: 'rejectMsg', checkType: 'notnull', errorMsg: '请输入驳回原因' });
  48. }
  49. if (!this.verify.check(this.item, rule)) {
  50. uni.showModal({ content: this.verify.error, showCancel: false });
  51. return false;
  52. }
  53. this.http.request({
  54. url: '/app/deliver/jTaskComplete',
  55. data: this.item,
  56. method: 'POST',
  57. success: (res) => {
  58. uni.showModal({
  59. title: '提示',
  60. content: '操作成功',
  61. showCancel: false,
  62. success: (res) => {
  63. this.$emit('confirm');
  64. this.show = false;
  65. }
  66. });
  67. }
  68. });
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="scss">
  74. .mbb {
  75. padding: 7px;
  76. background-color: aliceblue;
  77. border-radius: 5px;
  78. .bz {
  79. font-size: 14px;
  80. line-height: 21px;
  81. }
  82. }
  83. .xy {
  84. overflow: hidden;
  85. margin-top: 15px;
  86. margin-bottom: 10px;
  87. }
  88. textarea {
  89. height: 80px;
  90. width: 93%;
  91. padding: 10px;
  92. margin-top: 10px;
  93. background-color: #f1f1f1;
  94. border-radius: 5px;
  95. }
  96. .flex {
  97. .f {
  98. padding: 0px 5px 0px 5px;
  99. }
  100. }
  101. </style>