audit.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="body">
  3. <van-nav-bar title="导入日报审核" left-text="返回" @click-left="back" fixed left-arrow/>
  4. <div style="height: 46px"></div>
  5. <div class="lis" v-for="item in list" :key="item.id">
  6. <div class="lis_til">
  7. <p>{{item.name}}<span style="margin-left:30px;">{{item.date}}</span></p>
  8. <p style="color: #C03131">待审核</p>
  9. </div>
  10. <div class="lis_con">
  11. <div>项目: {{item.project}}</div>
  12. <div v-if="item.subProjectName">子项目: {{item.subProjectName}}</div>
  13. <div>工作时长: {{item.time}}h</div>
  14. </div>
  15. <div class="lis_boot">
  16. <div style="background: #1989FA" @click="approve(item, item.id)">通过</div>
  17. <div style="background: #C03131" @click="showDenyDialog(item)">驳回</div>
  18. </div>
  19. </div>
  20. <van-popup v-model="denyReasonDialog" position="bottom" closeable >
  21. <van-cell>请输入原因</van-cell>
  22. <van-field class="form_input"
  23. v-model="denyForm.reason" name="reason" type="textarea" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'"
  24. rows="3" autosize />
  25. <van-button style="width:100%;" type="info" @click="deny()">提交</van-button>
  26. </van-popup>
  27. </div>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. search: {
  34. date: null,
  35. projectId: null
  36. },
  37. list: [],
  38. denyReasonDialog: false,
  39. denyForm: {
  40. id: null,
  41. i: null,
  42. date: null,
  43. reportIds: '',
  44. reason: ''
  45. }
  46. }
  47. },
  48. created() {},
  49. mounted() {
  50. this.obtain()
  51. },
  52. methods: {
  53. // 返回
  54. back() {
  55. history.back();
  56. },
  57. // 获取日报
  58. obtain() {
  59. const toast = this.$toast.loading({
  60. forbidClick: true,
  61. duration: 0
  62. });
  63. this.$axios.get('/report/listImportByState', this.search)
  64. .then(res => {
  65. toast.clear();
  66. this.list = res.data
  67. }).catch(err=> {
  68. toast.clear();
  69. alert('err=' + err);
  70. });
  71. },
  72. // 通过日报
  73. approve(item, id) {
  74. const toast = this.$toast.loading({
  75. forbidClick: true,
  76. duration: 0
  77. });
  78. var ids = id;
  79. this.$axios.get('/report/approve', {params:{id: id, reportIds: ids}})
  80. .then(res => {
  81. this.obtain()
  82. toast.clear();
  83. this.$toast.success('审核成功');
  84. }).catch(err=> {
  85. toast.clear();
  86. alert('err=' + err);
  87. });
  88. },
  89. // 驳回
  90. showDenyDialog(item) {
  91. this.denyReasonDialog = true
  92. var ids = item.id;
  93. this.denyForm = {id: item.id ,i:0, date: item.date, reportIds: ids, reason:null};
  94. },
  95. // 驳回提交
  96. deny() {
  97. const toast = this.$toast.loading({
  98. forbidClick: true,
  99. duration: 0
  100. });
  101. this.$axios.post('/report/deny', this.denyForm)
  102. .then(res => {
  103. this.obtain()
  104. toast.clear();
  105. this.$toast.success('提交成功');
  106. this.denyReasonDialog = false
  107. }).catch(err=> {
  108. toast.clear();
  109. alert('err=' + err);
  110. });
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="less" scoped>
  116. .lis {
  117. background: #fff;
  118. padding: 10px;
  119. box-sizing: border-box;
  120. color: #333333;
  121. margin-bottom: 30px;
  122. font-size: 14px;
  123. .lis_til {
  124. display: flex;
  125. justify-content: space-between;
  126. padding: 0 6px 10px 6px;
  127. border-bottom: 1px solid #ebedf0;
  128. }
  129. .lis_con {
  130. padding: 0 6px;
  131. border-bottom: 1px solid #ebedf0;
  132. div {
  133. line-height: 30px;
  134. }
  135. }
  136. .lis_boot {
  137. padding: 10px 6px 0 6px;
  138. display: flex;
  139. align-items: flex-end;
  140. justify-content: flex-end;
  141. div {
  142. width: 40px;
  143. line-height: 28px;
  144. text-align: center;
  145. margin-left: 20px;
  146. color: #fff;
  147. font-size: 12px;
  148. border-radius: 2px;
  149. }
  150. }
  151. }
  152. </style>