detailsList.vue 10 KB

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