djTask.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="djTask">
  3. <!-- 任务进度 -->
  4. <view class="progress_title">
  5. <view class="progress">
  6. <image src="../../../static/progress_icon.png" class="progress_image"></image>
  7. <text class="progress_text">任务进度</text>
  8. </view>
  9. <view class="dj_num">
  10. <text class="dj_num_title">代煎7贴:<text class="dj_num_text">3/5</text></text>
  11. <text class="dj_num_title">代煎14贴:<text class="dj_num_text">3/5</text></text>
  12. </view>
  13. </view>
  14. <!-- 处方编号 -->
  15. <view class="sub_title">
  16. <view class="cfbh">
  17. <text class="cfbh_title">处方编号<text class="cfbh_text">{{pageData.cfbh}}</text></text>
  18. </view>
  19. <view class="bhgs">
  20. <text class="bhgs_title">不合格数<text class="bhgs_text">1</text></text>
  21. </view>
  22. </view>
  23. <!-- 检查结果 -->
  24. <uni-card padding="0" spacing="0" v-for="(item,index) in pageData.djList" class="djList">
  25. <view class="djList_title">
  26. <view class="djList_text">检查项目</view>
  27. <view class="djList_righttext">{{item.item}}</view>
  28. </view>
  29. <view class="djList_title">
  30. <view class="djList_text">检查内容</view>
  31. <view class="djList_righttext">{{item.assessmentCriteria}}</view>
  32. </view>
  33. <view class="djList_title">
  34. <view class="djList_text">检查结果</view>
  35. <view class="djList_righttext">{{item.score}}</view>
  36. </view>
  37. <view class="djList_title" v-if="item.result=='不合格'">
  38. <view class="djList_text">原因</view>
  39. <view class="djList_righttext">{{item.reason}}</view>
  40. </view>
  41. <view class="button_group">
  42. <view class="bhg_button" @click="bhgCheck(item)">不合格</view>
  43. <view class="hg_button" @click="hgCheck(item)">合格</view>
  44. </view>
  45. </uni-card>
  46. <!-- 图片上传 -->
  47. <view class="image_upload">
  48. <uni-card>
  49. <uni-section title="图片上传" type="line"></uni-section>
  50. <view class="img_upload">
  51. <uni-file-picker :v-model="pageData.imageList" @select="selectImg" @delete="deleteImg"></uni-file-picker>
  52. </view>
  53. </uni-card>
  54. </view>
  55. <!-- 按钮 -->
  56. <view class="operator_button" v-if="pageData.operatorStatus=='add'">
  57. <button class="pass_button" @click="pass">一键通过</button>
  58. <!-- 如果还有数据按钮显示为“下一个”,数据全部加载完毕显示为“完成” -->
  59. <view class="finish_button_grop">
  60. <button class="next_or_finish_button" v-if="pageData.djList!=0" @click="next">下一个</button>
  61. <button class="next_or_finish_button" @click="finish" v-else>完成</button>
  62. </view>
  63. </view>
  64. <!-- 不合格弹出框 -->
  65. <uni-popup ref="bhgDialog" type="dialog">
  66. <uni-popup-dialog type="info" mode="input" confirmText="确定" cancelText="取消" title="不合格原因" value="" placeholder="请填写不合格原因" @confirm="bhgDialogConfirm"
  67. @close="bhgDialogClose">
  68. <uni-easyinput type="textarea" autoHeight v-model="pageData.reason" placeholder="请输入不合格原因"></uni-easyinput>
  69. </uni-popup-dialog>
  70. </uni-popup>
  71. </view>
  72. </template>
  73. <script setup>
  74. import { ref,reactive } from "vue";
  75. import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
  76. import http from '@/utils/request';
  77. const pageData=reactive({
  78. // 处方编号
  79. cfbh:'',
  80. // 操作状态,是编辑/查看
  81. operatorStatus:'',
  82. djList:[
  83. {
  84. item:'检查项目1',
  85. content:'检查内容1',
  86. result:'检查结果1'
  87. },
  88. {
  89. item:'检查项目2',
  90. content:'检查内容2',
  91. result:'检查结果2'
  92. },
  93. {
  94. item:'检查项目3',
  95. content:'检查内容3',
  96. result:'不合格',
  97. reason:'还是的撒'
  98. },
  99. ],
  100. // 图片列表
  101. imageList:[],
  102. // 检查项目Id
  103. checkId:'',
  104. // 合格列表
  105. hgList:[],
  106. // 不合格列表
  107. bhgList:[],
  108. // 不合格原因
  109. reason:''
  110. })
  111. const formData=reactive({
  112. id:'',
  113. pageSize:1,
  114. pageNum:10
  115. })
  116. const createData=reactive({
  117. taskId:'',
  118. pId:'',
  119. providerType:''
  120. })
  121. const saveTaskData=reactive({
  122. unHgStateName:''
  123. })
  124. // 定义不合格弹出输入框
  125. const bhgDialog=ref()
  126. // 提交不合格原因
  127. const bhgDialogConfirm=()=>{
  128. console.log(pageData.reason)
  129. // 获取输入的不合格原因
  130. let o={}
  131. o.id=pageData.checkId
  132. // o.reason.val
  133. pageData.bhgList.push(o)
  134. // console.log(val)
  135. }
  136. // 取消不合格弹出输入框
  137. const bhgDialogClose=()=>{
  138. // 关闭不合格弹出框
  139. bhgDialog._value.close()
  140. }
  141. // 选中图片,将选中的图片添加列表
  142. const selectImg=(e)=>{
  143. console.log(e)
  144. e.tempFiles.forEach(item=>{
  145. pageData.imageList.push(item)
  146. })
  147. }
  148. // 删除图片,并将其从列表中删除
  149. const deleteImg=(e)=>{
  150. console.log(e)
  151. let index=0
  152. index = pageData.imageList.indexOf(e.tempFilePaths)
  153. pageData.imageList.splice(index, 1)
  154. }
  155. // 不合格
  156. const bhgCheck=(e)=>{
  157. pageData.checkId=e.id
  158. // 打开不合格弹出输入框
  159. bhgDialog._value.open()
  160. }
  161. // 合格
  162. const hgCheck=(e)=>{
  163. pageData.hgList.push(e.id)
  164. console.log(pageData.hgList)
  165. console.log("合格")
  166. }
  167. // 一键通过
  168. const pass=()=>{
  169. console.log("一键通过")
  170. saveTaskData.unHgStateName='合格'
  171. http.post("app-api/zkzy/save",saveTaskData).then(res=>{
  172. console.log(res)
  173. })
  174. }
  175. // 下一个
  176. const next=()=>{
  177. console.log("下一个")
  178. http.post("app-api/zkzy/save",saveTaskData).then(res=>{
  179. console.log(res)
  180. })
  181. }
  182. // 完成
  183. const finish=()=>{
  184. console.log("完成")
  185. }
  186. // 临时创建代煎代配企业评估任务内容
  187. const createTask=()=>{
  188. getTaskId()
  189. http.get("app-api/zkzy/create",createData).then(res=>{
  190. console.log(res)
  191. getDjTask(res)
  192. })
  193. }
  194. // 获取代煎质控作业
  195. const getDjTask=(data)=>{
  196. formData.id=data
  197. http.get("app-api/taskDetail/get",formData).then(res=>{
  198. console.log(res)
  199. pageData.djList = res.results
  200. })
  201. }
  202. // 获取taskId
  203. const getTaskId=()=>{
  204. uni.getStorage({
  205. key:'saveTaskId',
  206. success: (res) => {
  207. console.log(res)
  208. createData.taskId = res.data.taskId
  209. }
  210. })
  211. }
  212. onShow(()=>{
  213. createTask()
  214. })
  215. onLoad((type)=>{
  216. console.log(type)
  217. if(type.state!=null){
  218. pageData.operatorStatus=type.state
  219. }
  220. if(type.cfbh!=null){
  221. pageData.cfbh=type.cfbh
  222. }
  223. if(type.ptwybh!=null){
  224. createData.pId=type.ptwybh
  225. }
  226. if(type.fyfslx!=null){
  227. createData.providerType=type.fyfslx
  228. }
  229. })
  230. </script>
  231. <style lang="scss" scoped>
  232. @import './index.scss'
  233. </style>