djTask.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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.bhgx}}</view>
  28. </view>
  29. <view class="djList_title">
  30. <view class="djList_text">检查内容</view>
  31. <view class="djList_righttext">{{item.content}}</view>
  32. </view>
  33. <view class="djList_title">
  34. <view class="djList_text">检查结果</view>
  35. <view class="djList_righttext">{{item.result}}</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()">不合格</view>
  43. <view class="hg_button" @click="hgCheck()">合格</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"></uni-popup-dialog>
  68. </uni-popup>
  69. </view>
  70. </template>
  71. <script setup>
  72. import { ref,reactive } from "vue";
  73. import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
  74. import http from "../../../utils/request";
  75. const pageData=reactive({
  76. // 处方编号
  77. cfbh:'',
  78. // 操作状态,是编辑/查看
  79. operatorStatus:'',
  80. djList:[
  81. {
  82. item:'检查项目1',
  83. content:'检查内容1',
  84. result:'检查结果1'
  85. },
  86. {
  87. item:'检查项目2',
  88. content:'检查内容2',
  89. result:'检查结果2'
  90. },
  91. {
  92. item:'检查项目3',
  93. content:'检查内容3',
  94. result:'不合格',
  95. reason:'还是的撒'
  96. },
  97. ],
  98. // 图片列表
  99. imageList:[]
  100. })
  101. const formData=reactive({
  102. id:''
  103. })
  104. const createData=reactive({
  105. taskId:'',
  106. pId:'',
  107. providerType:''
  108. })
  109. // 定义不合格弹出输入框
  110. const bhgDialog=ref()
  111. // 提交不合格原因
  112. const bhgDialogConfirm=(val)=>{
  113. // 获取输入的不合格原因
  114. console.log(val)
  115. }
  116. // 取消不合格弹出输入框
  117. const bhgDialogClose=()=>{
  118. // 关闭不合格弹出框
  119. bhgDialog._value.close()
  120. }
  121. // 选中图片,将选中的图片添加列表
  122. const selectImg=(e)=>{
  123. console.log(e)
  124. e.tempFiles.forEach(item=>{
  125. pageData.imageList.push(item)
  126. })
  127. }
  128. // 删除图片,并将其从列表中删除
  129. const deleteImg=(e)=>{
  130. console.log(e)
  131. let index=0
  132. index = pageData.imageList.indexOf(e.tempFilePaths)
  133. pageData.imageList.splice(index, 1)
  134. }
  135. // 不合格
  136. const bhgCheck=()=>{
  137. // 打开不合格弹出输入框
  138. bhgDialog._value.open()
  139. }
  140. // 合格
  141. const hgCheck=()=>{
  142. console.log("合格")
  143. }
  144. // 一键通过
  145. const pass=()=>{
  146. console.log("一键通过")
  147. }
  148. // 下一个
  149. const next=()=>{
  150. console.log("下一个")
  151. }
  152. // 完成
  153. const finish=()=>{
  154. console.log("完成")
  155. }
  156. // 临时创建代煎代配企业评估任务内容
  157. const createTask=()=>{
  158. getTaskId()
  159. http.get("app-api/zkzy/create",createData).then(res=>{
  160. console.log(res)
  161. getDjTask(res)
  162. })
  163. }
  164. // 获取代煎质控作业
  165. const getDjTask=(data)=>{
  166. formData.id=data
  167. http.get("app-api/taskDetail/getTaskDjDetailById",formData).then(res=>{
  168. console.log(res)
  169. pageData.djList = res.djCfDetail
  170. })
  171. }
  172. // 获取taskId
  173. const getTaskId=()=>{
  174. uni.getStorage({
  175. key:'taskId',
  176. success: (res) => {
  177. console.log(res)
  178. createData.taskId = res.data.taskId
  179. }
  180. })
  181. }
  182. onShow(()=>{
  183. createTask()
  184. })
  185. onLoad((type)=>{
  186. console.log(type)
  187. if(type.status!=null){
  188. pageData.operatorStatus=type.status
  189. }
  190. if(type.cfbh!=null){
  191. pageData.cfbh=type.cfbh
  192. }
  193. if(type.ptwybh!=null){
  194. createData.pId=type.ptwybh
  195. }
  196. if(type.fyfslx!=null){
  197. createData.providerType=type.fyfslx
  198. }
  199. })
  200. </script>
  201. <style lang="scss" scoped>
  202. @import './index.scss'
  203. </style>