detailsList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <view >
  3. <custom-tabs type="detailRef" :value="pageInfo.activeIndex" :fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="tabChange">
  4. <custom-tab-pane label="任务信息" name="detailRef_1">
  5. <view class="taskInfo">
  6. <!-- 质控信息 -->
  7. <uni-card>
  8. <view style="color: rgba(51, 51, 51, 1);font-size: 17px;">{{pageInfo.detailList.name}}</view>
  9. <template v-slot:right>
  10. <image style="width: 50rpx; height: 50rpx;" :src="showIcon.nowIcon" @click="changeState()">
  11. </image>
  12. </template>
  13. <view class="detail_list">
  14. <view class="List_title">
  15. <view class="detail_text">任务编号</view>
  16. <view class="detail_righttext">{{pageInfo.detailList.taskNumber}}</view>
  17. </view>
  18. <view class="List_title">
  19. <view class="detail_text">任务状态</view>
  20. <view class="detail_righttext">{{pageInfo.detailList.status}}</view>
  21. </view>
  22. <view class="List_title">
  23. <view class="detail_text">被质控代煎企业</view>
  24. <view class="detail_righttext">{{pageInfo.detailList.bzkOrgName}}</view>
  25. </view>
  26. <view class="List_title">
  27. <view class="detail_text">地址</view>
  28. <view class="detail_righttext">{{pageInfo.detailList.address}}</view>
  29. </view>
  30. <view class="List_title">
  31. <view class="detail_text">完成日期</view>
  32. <view class="detail_righttext">{{pageInfo.detailList.wcrq2}}</view>
  33. </view>
  34. <view class="List_title">
  35. <view class="detail_text">任务发布人</view>
  36. <view class="detail_righttext">{{pageInfo.detailList.creator}}</view>
  37. </view>
  38. <view class="List_title">
  39. <view class="detail_text">发布日期</view>
  40. <view class="detail_righttext">{{pageInfo.detailList.wcrq1}}</view>
  41. </view>
  42. <view class="List_title">
  43. <view class="detail_text">质控日期</view>
  44. <view class="detail_righttext">{{pageInfo.detailList.zkrq}}</view>
  45. </view>
  46. </view>
  47. </uni-card>
  48. <!-- 详情 -->
  49. <uni-card>
  50. <view class="detail_list">
  51. <view class="List_title">
  52. <view class="detail_text">代配抽样数量</view>
  53. <view class="detail_righttext">{{pageInfo.detailList.dpCyCount}}</view>
  54. </view>
  55. <view class="List_title">
  56. <view class="detail_text">代煎抽样数量</view>
  57. <view class="detail_righttext">{{pageInfo.detailList.djCyCount}}</view>
  58. </view>
  59. <view class="List_title">
  60. <view class="detail_text">抽样总数</view>
  61. <view class="detail_righttext">{{pageInfo.detailList.totalCyCount}}</view>
  62. </view>
  63. <view class="List_title">
  64. <view class="detail_text">组长</view>
  65. <view class="detail_righttext">{{pageInfo.detailList.zzName}}</view>
  66. </view>
  67. <view class="List_title">
  68. <view class="detail_text">组员</view>
  69. <view class="detail_righttext">{{pageInfo.detailList.zyNames}}</view>
  70. </view>
  71. <view class="List_title">
  72. <view class="detail_text">备注</view>
  73. <view class="detail_righttext">{{pageInfo.detailList.bz}}</view>
  74. </view>
  75. </view>
  76. </uni-card>
  77. <!-- 开始质控 -->
  78. <view class="finish_button" v-if="pageInfo.detailList.status!='已质控'">
  79. <button class="button" @click="startTask()">开始质控</button>
  80. </view>
  81. </view>
  82. </custom-tab-pane>
  83. <custom-tab-pane label="代配质控" name="detailRef_2">
  84. <DPTaskDetail :dpTaskList="pageInfo.dpTaskList" :dpbhg="pageInfo.dpbhg"
  85. :taskStatus="pageInfo.taskStatus" :dpCyCount="pageInfo.dpCyCount" :dpWcCount="pageInfo.dpWcCount">
  86. </DPTaskDetail>
  87. </custom-tab-pane>
  88. <custom-tab-pane label="代煎质控" name="detailRef_3">
  89. <DJTaskDetail :djTaskList="pageInfo.djTaskList" :djbhg="pageInfo.djbhg"
  90. :taskStatus="pageInfo.taskStatus" :djCyCount="pageInfo.djCyCount" :djWcCount="pageInfo.djWcCount">
  91. </DJTaskDetail>
  92. </custom-tab-pane>
  93. <custom-tab-pane label="环境质控" name="detailRef_4">
  94. <DPhjTaskDetail :hjTaskList="pageInfo.hjTaskList" :imageUrl="pageInfo.imageUrl" :hjbhg="pageInfo.hjbhg"
  95. :creatorName="pageInfo.creatorName" :taskStatus="pageInfo.taskStatus">
  96. </DPhjTaskDetail>
  97. </custom-tab-pane>
  98. </custom-tabs>
  99. <uni-popup ref="operatorDialog" type="dialog">
  100. <uni-popup-dialog type="info" confirmText="确定" cancelText="取消" :title="pageInfo.popupMessage.title"
  101. :content="pageInfo.popupMessage.showMessage" @confirm="operatorDialogConfirm"
  102. @close="operatorDialogClose"></uni-popup-dialog>
  103. </uni-popup>
  104. </view>
  105. </template>
  106. <script setup>
  107. import { reactive,ref } from "vue";
  108. import http from '@/utils/request';
  109. import { onLoad,onShow,onUnload,onPullDownRefresh } from "@dcloudio/uni-app";
  110. import DJTaskDetail from "./djTaskDetail.vue"
  111. import DPTaskDetail from "./dpTaskDetail.vue"
  112. import DPhjTaskDetail from "./djhjTaskDetail.vue"
  113. import { uploadImageModelValue } from '@/pages/controls/image/OssService'
  114. const pageInfo = reactive({
  115. // 判断列表是否为空
  116. isEmpty: true,
  117. total: 0,
  118. value: 0,
  119. tabs: ["任务信息", "代配质控", "代煎质控", "环境质控"],
  120. activeIndex: 0,
  121. // 任务状态
  122. taskStatus: '',
  123. // 任务信息
  124. detailList: {},
  125. // 代配质控列表
  126. dpTaskList: [],
  127. // 代煎质控列表
  128. djTaskList: [],
  129. // 环境质控
  130. hjTaskList: [],
  131. imageUrl: [],
  132. // 代配不合格数
  133. dpbhg: "",
  134. // 代煎不合格数
  135. djbhg: 0,
  136. // 环境质控不合格数
  137. hjbhg: 0,
  138. // 代配抽样数量
  139. dpCyCount: 0,
  140. // 代配完成数量
  141. dpWcCount: 0,
  142. // 代煎抽样数量
  143. djCyCount: 0,
  144. // 代煎完成数量
  145. djWcCount: 0,
  146. // 创建人
  147. creatorName: '',
  148. // 对话框
  149. popupMessage: {
  150. // 标题
  151. title: '开始质控',
  152. // 提示内容
  153. showMessage: '是否确认开始质控任务'
  154. }
  155. });
  156. const formData = reactive({
  157. id: ''
  158. })
  159. const showIcon = reactive({
  160. nowIcon: '',
  161. showIcon: '/static/blackDisplay.png',
  162. hideIcon: '/static/blackHide.png'
  163. })
  164. const detailRef=ref(null)
  165. // 开始质控
  166. const startTask = () => {
  167. if (pageInfo.detailList.isKszk == true) {
  168. uni.navigateTo({
  169. url: '/pages/ypczk/zkTask/zkTask?taskId=' + formData.id
  170. });
  171. } else {
  172. operatorDialog.value.open()
  173. }
  174. }
  175. // 定义/开始质控对话框
  176. const operatorDialog = ref(null)
  177. // 开始质控对话框确定事件
  178. const operatorDialogConfirm = () => {
  179. getStartTask()
  180. }
  181. // 开始质控对话框取消事件
  182. const operatorDialogClose = () => {
  183. operatorDialog.value.close()
  184. }
  185. // 开始质控接口
  186. const getStartTask = () => {
  187. http.get("app-api/index/kszkByid", {
  188. taskId: formData.id
  189. }).then(res => {
  190. // 1表示开始质控,-1表示不是组长不能质控,其他表示开始质控失败
  191. if (res == 1) {
  192. uni.navigateTo({
  193. url: '/pages/ypczk/zkTask/zkTask?taskId=' + formData.id
  194. })
  195. } else if (res = -1) {
  196. // 提示-只有组长能够开始质控
  197. uni.showModal({
  198. title: '提示',
  199. content: '只有组长能够开始质控',
  200. confirmColor: 'rgba(190, 163, 117, 1)', //确定字体颜色
  201. showCancel: false, //没有取消按钮的弹框
  202. buttonText: '确定'
  203. })
  204. } else {
  205. uni.showToast({
  206. title: '开始质控失败',
  207. icon: 'none'
  208. });
  209. }
  210. })
  211. operatorDialog.value.close()
  212. }
  213. // 切换显示状态
  214. const changeState = () => {
  215. if (showIcon.nowIcon == showIcon.showIcon) {
  216. showIcon.nowIcon = showIcon.hideIcon
  217. } else {
  218. showIcon.nowIcon = showIcon.showIcon
  219. }
  220. }
  221. // 切换tab
  222. const tabChange = (e) => {
  223. switch (e.value) {
  224. case 0: {
  225. getTaskData();
  226. break;
  227. }
  228. case 1: {
  229. getDpTaskData();
  230. break;
  231. }
  232. case 2: {
  233. getDjTaskData();
  234. break;
  235. }
  236. case 3: {
  237. getDjhjTaskData();
  238. break;
  239. }
  240. }
  241. }
  242. // 获取任务信息
  243. const getTaskData = () => {
  244. http.get("app-api/taskDetail/getTaskDetailById", formData).then(res => {
  245. pageInfo.detailList = res
  246. if (res.status == '7002') {
  247. pageInfo.detailList.status = '待确认'
  248. } else if (res.status == '7003') {
  249. pageInfo.detailList.status = '质控中'
  250. } else {
  251. pageInfo.detailList.status = '已质控'
  252. }
  253. })
  254. }
  255. // 获取代配质控
  256. const getDpTaskData = () => {
  257. http.get("app-api/taskDetail/getTaskDpDetailById", formData).then(res => {
  258. pageInfo.dpTaskList = res.dpCfDetail
  259. pageInfo.dpCyCount = res.dpCyCount
  260. pageInfo.dpWcCount = res.dpWcCount
  261. })
  262. }
  263. // 获取代煎质控
  264. const getDjTaskData = () => {
  265. http.get("app-api/taskDetail/getTaskDjDetailById", formData).then(res => {
  266. pageInfo.djbhg = res.djbhg
  267. pageInfo.djTaskList = res.djCfDetail
  268. pageInfo.djCyCount = res.djCyCount
  269. pageInfo.djWcCount = res.djWcCount
  270. })
  271. }
  272. // 获取环境质控
  273. const getDjhjTaskData = () => {
  274. http.get("app-api/taskDetail/getTaskHzZkDetailById", formData).then(res => {
  275. if (res != null) {
  276. pageInfo.hjbhg = 0;
  277. pageInfo.hjTaskList = res.results
  278. pageInfo.hjTaskList.forEach(item => {
  279. // 检查内容(分数与总分相同为合格,反之不合格)
  280. if (item.score == item.totalScore && !item.isDj && item.isDj != null) {
  281. item.assessmentResult = '合格'
  282. } else {
  283. item.assessmentResult = item.isDj || item.isDj == null ? '待检' : '不合格'
  284. if (item.assessmentResult == '不合格') pageInfo.hjbhg = pageInfo.hjbhg + 1;
  285. }
  286. })
  287. if (res.detail.imageIds != null) {
  288. pageInfo.imageUrl = res.detail.imageIds
  289. }
  290. pageInfo.creatorName = res.detail.creatorName
  291. }
  292. })
  293. }
  294. // 显示图片
  295. const showImage = (id) => {
  296. return uploadImageModelValue(id)
  297. }
  298. // 获取taskId
  299. const getTaskId = () => {
  300. uni.getStorage({
  301. key: 'saveTaskId',
  302. success: (res) => {
  303. formData.id = res.data.taskId
  304. }
  305. })
  306. }
  307. onShow(() => {
  308. showIcon.nowIcon = showIcon.hideIcon
  309. getTaskId();
  310. getTaskData();
  311. uni.$off("startTaskInfo")
  312. uni.$on("startTaskInfo", () => {
  313. startTask()
  314. })
  315. })
  316. onLoad((data) => {
  317. if (data.taskInfo != null) {
  318. pageInfo.taskStatus = JSON.parse(decodeURIComponent(data.taskInfo)).status
  319. pageInfo.status = JSON.parse(decodeURIComponent(data.taskInfo)).status
  320. }
  321. })
  322. </script>
  323. <style lang="scss" scoped>
  324. @import './index.scss';
  325. </style>