djhjTask.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="djhjTask">
  3. <!-- 任务进度 -->
  4. <view class="djhjTask_progress">
  5. <text class="djhjTask_progress_title">任务进度:<text class="djhjTask_progress_text">4/10</text></text>
  6. <text class="djhjTask_progress_title">不合格数<text class="djhjTask_progress_text">1</text></text>
  7. </view>
  8. <!-- 检查结果 -->
  9. <uni-card padding="0" spacing="0" v-for="(item,index) in pageData.djhjList" class="djhjList">
  10. <view class="djhjList_title">
  11. <view class="djhjList_text">检查项目</view>
  12. <view class="djhjList_righttext">{{item.item}}</view>
  13. </view>
  14. <view class="djhjList_title">
  15. <view class="djhjList_text">检查方式</view>
  16. <view class="djhjList_righttext">{{item.mean}}</view>
  17. </view>
  18. <view class="djhjList_title">
  19. <view class="djhjList_text">检查内容</view>
  20. <view class="djhjList_righttext">{{item.content}}</view>
  21. </view>
  22. <view class="djhjList_title">
  23. <view class="djhjList_text">检查结果</view>
  24. <view :class="item.result=='不合格'? 'djhjList_redtext' : 'djhjList_righttext'">{{item.result}}</view>
  25. </view>
  26. <view class="djhjList_title" v-if="item.result=='不合格'">
  27. <view class="djhjList_text">原因</view>
  28. <view class="djhjList_righttext">{{item.reason}}</view>
  29. </view>
  30. <view class="button_group">
  31. <view class="bhg_button" @click="bhgCheck()">不合格</view>
  32. <view class="hg_button" @click="hgCheck()">合格</view>
  33. </view>
  34. </uni-card>
  35. <!-- 图片上传 -->
  36. <view class="image_upload">
  37. <uni-card>
  38. <uni-section title="图片上传" type="line"></uni-section>
  39. <view class="img_upload">
  40. <uni-file-picker limit="4" :v-model="pageData.imageList" @select="selectImg" @delete="deleteImg"></uni-file-picker>
  41. </view>
  42. </uni-card>
  43. </view>
  44. <!-- 按钮组 -->
  45. <view class="operator_button">
  46. <button class="pass_button" @click="pass">一键通过</button>
  47. <!-- 如果还有数据按钮显示为“下一个”,数据全部加载完毕显示为“完成” -->
  48. <view class="finish_button_grop">
  49. <button class="next_or_finish_button" v-if="pageData.djhjList!=0" @click="next">下一个</button>
  50. <button class="next_or_finish_button" @click="finish" v-else>完成</button>
  51. </view>
  52. </view>
  53. <!-- 不合格弹出框 -->
  54. <uni-popup ref="bhgDialog" type="dialog">
  55. <uni-popup-dialog type="info" mode="input" confirmText="提交" cancelText="取消" title="不合格原因" value="" placeholder="请填写不合格原因" @confirm="bhgDialogConfirm"
  56. @close="bhgDialogClose"></uni-popup-dialog>
  57. </uni-popup>
  58. </view>
  59. </template>
  60. <script setup>
  61. import { ref,reactive } from "vue";
  62. import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
  63. import http from '@/utils/request';
  64. const pageData=reactive({
  65. djhjList:[
  66. {
  67. item:'煎汤场所和设备设施',
  68. mean:'实地检查',
  69. content:'设有浸泡、煎药、清洗等功能区域,有分区标识,实行定置管理,能避免作业差错和交叉污染;',
  70. result:'待检'
  71. },
  72. {
  73. item:'煎药操作规范状况',
  74. mean:'实地检查',
  75. content:'有必要安全消防等防护措施,有进排水、通风防尘、防动物昆虫侵入等设施;',
  76. result:'不合格',
  77. reason:'无防尘措施'
  78. }
  79. ],
  80. imageList:[]
  81. })
  82. const formData=reactive({
  83. id:''
  84. })
  85. const createData=reactive({
  86. taskId:'',
  87. pId:'',
  88. providerType:''
  89. })
  90. // 定义不合格弹出输入框
  91. const bhgDialog=ref()
  92. // 提交不合格原因
  93. const bhgDialogConfirm=(val)=>{
  94. // 获取输入的不合格原因
  95. console.log(val)
  96. }
  97. // 取消不合格弹出输入框
  98. const bhgDialogClose=()=>{
  99. // 关闭不合格弹出框
  100. bhgDialog._value.close()
  101. }
  102. // 选中图片,将选中的图片添加列表
  103. const selectImg=(e)=>{
  104. console.log(e)
  105. e.tempFiles.forEach(item=>{
  106. pageData.imageList.push(item)
  107. })
  108. }
  109. // 删除图片,并将其从列表中删除
  110. const deleteImg=(e)=>{
  111. console.log(e)
  112. let index=0
  113. index = pageData.imageList.indexOf(e.tempFilePaths)
  114. pageData.imageList.splice(index, 1)
  115. }
  116. // 不合格
  117. const bhgCheck=()=>{
  118. // 打开不合格弹出输入框
  119. bhgDialog._value.open()
  120. }
  121. // 合格
  122. const hgCheck=()=>{
  123. console.log("合格")
  124. }
  125. // 一键通过
  126. const pass=()=>{
  127. console.log("一键通过")
  128. }
  129. // 下一个
  130. const next=()=>{
  131. console.log("下一个")
  132. http.post("app-api/zkzy/save").then(res=>{
  133. console.log(res)
  134. })
  135. }
  136. // 完成
  137. const finish=()=>{
  138. console.log("完成")
  139. }
  140. // 获取taskId
  141. const getTaskId=()=>{
  142. uni.getStorage({
  143. key:'saveTaskId',
  144. success: (res) => {
  145. console.log(res)
  146. createData.taskId = res.data.taskId
  147. }
  148. })
  149. }
  150. // 临时创建代煎代配企业评估任务内容
  151. const createTask=()=>{
  152. getTaskId()
  153. http.get("app-api/zkzy/create",createData).then(res=>{
  154. console.log(res)
  155. getDjTask(res)
  156. })
  157. }
  158. // 获取代煎质控作业
  159. const getDjTask=(data)=>{
  160. formData.id=data
  161. http.get("app-api/taskDetail/get",formData).then(res=>{
  162. console.log(res)
  163. pageData.djhjList = res.results
  164. })
  165. }
  166. onShow(()=>{
  167. createTask()
  168. })
  169. </script>
  170. <style lang="scss" scoped>
  171. @import './index.scss'
  172. </style>