djhjTask.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. const pageData=reactive({
  63. djhjList:[
  64. {
  65. item:'煎汤场所和设备设施',
  66. mean:'实地检查',
  67. content:'设有浸泡、煎药、清洗等功能区域,有分区标识,实行定置管理,能避免作业差错和交叉污染;',
  68. result:'待检'
  69. },
  70. {
  71. item:'煎药操作规范状况',
  72. mean:'实地检查',
  73. content:'有必要安全消防等防护措施,有进排水、通风防尘、防动物昆虫侵入等设施;',
  74. result:'不合格',
  75. reason:'无防尘措施'
  76. }
  77. ],
  78. imageList:[]
  79. })
  80. // 定义不合格弹出输入框
  81. const bhgDialog=ref()
  82. // 提交不合格原因
  83. const bhgDialogConfirm=(val)=>{
  84. // 获取输入的不合格原因
  85. console.log(val)
  86. }
  87. // 取消不合格弹出输入框
  88. const bhgDialogClose=()=>{
  89. // 关闭不合格弹出框
  90. bhgDialog._value.close()
  91. }
  92. // 选中图片,将选中的图片添加列表
  93. const selectImg=(e)=>{
  94. console.log(e)
  95. e.tempFiles.forEach(item=>{
  96. pageData.imageList.push(item)
  97. })
  98. }
  99. // 删除图片,并将其从列表中删除
  100. const deleteImg=(e)=>{
  101. console.log(e)
  102. let index=0
  103. index = pageData.imageList.indexOf(e.tempFilePaths)
  104. pageData.imageList.splice(index, 1)
  105. }
  106. // 不合格
  107. const bhgCheck=()=>{
  108. // 打开不合格弹出输入框
  109. bhgDialog._value.open()
  110. }
  111. // 合格
  112. const hgCheck=()=>{
  113. console.log("合格")
  114. }
  115. // 一键通过
  116. const pass=()=>{
  117. console.log("一键通过")
  118. }
  119. // 下一个
  120. const next=()=>{
  121. console.log("下一个")
  122. }
  123. // 完成
  124. const finish=()=>{
  125. console.log("完成")
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. @import './index.scss'
  130. </style>