index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <hc-sys :tabbar="false" isNavBar navBarUi="home-nav-bar">
  3. <template #navBar>
  4. <view class="hc-home-nav-bar px-5 py-4">
  5. <view class="title">应用主页</view>
  6. <view class="icon">
  7. <text class="i-ri-layout-masonry-fill" v-if="isListType" @click="isListType = false"/>
  8. <text class="i-material-symbols-view-list-rounded" v-else @click="isListType = true"/>
  9. </view>
  10. </view>
  11. </template>
  12. <view class="relative px-5" v-if="msgCountData.taskCount > 0">
  13. <uni-notice-bar class="radius" show-icon :text="`您有${msgCountData.taskCount}条待办任务,请注意及时处理`" @click="toTaskPage"/>
  14. </view>
  15. <template v-if="!isListType">
  16. <view class="hc-flex-conten mt-4">
  17. <view class="left-col-card-1" :class="isAnimation?'is-animation':''" @click="isDataFill">
  18. <view class="card-bg">
  19. <view class="icon">
  20. <text class="i-solar-calendar-search-outline"/>
  21. </view>
  22. </view>
  23. <view class="text-box">
  24. <text class="text">资料填报</text>
  25. </view>
  26. </view>
  27. <view class="right-col-card-1"
  28. :class="isAnimation?'is-animation':''"
  29. @click="toNoAuth"
  30. >
  31. <view class="card-bg">
  32. <text class="text">进度查询</text>
  33. </view>
  34. <view class="icon">
  35. <text class="i-ic-outline-list-alt"/>
  36. </view>
  37. </view>
  38. <view class="right-col-card-2"
  39. :class="isAnimation?'is-animation':''"
  40. @click="homeToPage('/pages/ledger/index')"
  41. >
  42. <view class="card-bg">
  43. <text class="text">日志填报</text>
  44. </view>
  45. <view class="icon">
  46. <text class="i-mdi-text-box-edit-outline"/>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="hc-flex-conten __150 mt-4">
  51. <view class="left-col-card-2"
  52. :class="isAnimation?'is-animation':''"
  53. @click="toTaskPage"
  54. >
  55. <view class="card-bg">
  56. <view class="icon">
  57. <text class="i-fluent-task-list-square-settings-20-filled"/>
  58. </view>
  59. <view class="text-box">
  60. <text class="text">任务管理</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="hc-flex-conten __180 mt-4">
  66. <view class="left-col-card-3"
  67. :class="isAnimation?'is-animation':''"
  68. @click="homeToPage('/pages/image/index')"
  69. >
  70. <view class="card-bg">
  71. <view class="icon">
  72. <text class="i-solar-videocamera-record-linear"/>
  73. </view>
  74. </view>
  75. <view class="text-box">
  76. <text class="text">声像资料</text>
  77. </view>
  78. </view>
  79. <view class="right-col-card-3"
  80. :class="isAnimation?'is-animation':''"
  81. @click="toNoAuth"
  82. >
  83. <view class="card-bg">
  84. <view class="icon">
  85. <text class="i-icon-park-outline-history-query"/>
  86. </view>
  87. <text class="text">资料查询</text>
  88. </view>
  89. </view>
  90. <view class="right-col-card-4"
  91. :class="isAnimation?'is-animation':''"
  92. @click="toNoAuth"
  93. >
  94. <view class="card-bg">
  95. <text class="text">工单消息</text>
  96. </view>
  97. <view class="icon">
  98. <text class="i-icon-park-outline-message"/>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <template v-else>
  104. <view class="hc-list-container">
  105. <view class="hc-list-item shadow-sm"
  106. :class="isAnimation?'a-l':''"
  107. @click="isDataFill"
  108. >
  109. <view class="icon bg-1">
  110. <text class="i-solar-calendar-search-outline"/>
  111. </view>
  112. <view class="container">
  113. <view class="title">资料填报</view>
  114. <view class="text">派发监理通知单及监理指令</view>
  115. </view>
  116. </view>
  117. <view class="hc-list-item shadow-sm"
  118. :class="isAnimation?'a-r':''"
  119. @click="toNoAuth"
  120. >
  121. <view class="icon bg-2">
  122. <text class="i-ic-outline-list-alt"/>
  123. </view>
  124. <view class="container">
  125. <view class="title">进度查询</view>
  126. <view class="text">资料进度数据统计查询</view>
  127. </view>
  128. </view>
  129. <view class="hc-list-item shadow-sm"
  130. :class="isAnimation?'a-l':''"
  131. @click="homeToPage('/pages/ledger/index')"
  132. >
  133. <view class="icon bg-3">
  134. <text class="i-mdi-text-box-edit-outline"/>
  135. </view>
  136. <view class="container">
  137. <view class="title">日志填报</view>
  138. <view class="text">施工及监理日志填报</view>
  139. </view>
  140. </view>
  141. <view class="hc-list-item shadow-sm"
  142. :class="isAnimation?'a-r':''"
  143. @click="toNoAuth"
  144. >
  145. <view class="icon bg-4">
  146. <text class="i-fluent-form-48-regular"/>
  147. </view>
  148. <view class="container">
  149. <view class="title">资料填报</view>
  150. <view class="text">质检资料及试验资料数据填报</view>
  151. </view>
  152. </view>
  153. <view class="hc-list-item shadow-sm"
  154. :class="isAnimation?'a-l':''"
  155. @click="homeToPage('/pages/image/index')"
  156. >
  157. <view class="icon bg-5">
  158. <text class="i-solar-videocamera-record-linear"/>
  159. </view>
  160. <view class="container">
  161. <view class="title">声像资料</view>
  162. <view class="text">拍照及上传影像资料</view>
  163. </view>
  164. </view>
  165. <view class="hc-list-item shadow-sm"
  166. :class="isAnimation?'a-r':''"
  167. @click="toNoAuth"
  168. >
  169. <view class="icon bg-6">
  170. <text class="i-icon-park-outline-history-query"/>
  171. </view>
  172. <view class="container">
  173. <view class="title">资料查询</view>
  174. <view class="text">质检及试验报表资料查看</view>
  175. </view>
  176. </view>
  177. <view class="hc-list-item shadow-sm"
  178. :class="isAnimation?'a-l':''"
  179. @click="toNoAuth"
  180. >
  181. <view class="icon bg-7">
  182. <text class="i-solar-calendar-linear"/>
  183. </view>
  184. <view class="container">
  185. <view class="title">施工台账</view>
  186. <view class="text">完善外业台账数据</view>
  187. </view>
  188. </view>
  189. </view>
  190. </template>
  191. <!--弹窗-->
  192. <view class="hc-popover-box" :class="isPopovershow ? 'show' : ''">
  193. <view class="img-box">
  194. <view class="img-bg"/>
  195. </view>
  196. <view class="close-icon" @click="closePopover">
  197. <text class="i-material-symbols-cancel-rounded"/>
  198. </view>
  199. <view class="hc-popover-container">
  200. <view class="project-name">{{projectInfo.projectName}}</view>
  201. <view class="contrac-name">{{contractInfo.contractName}}</view>
  202. <view class="tip-title">填报规则温馨提示</view>
  203. <view class="tip-content-box">
  204. <view class="tip-item">
  205. <view class="icon">
  206. <text class="i-ri-magic-fill"/>
  207. </view>
  208. <view class="text">填报之后务必点击保存按钮,避免数据丢失</view>
  209. </view>
  210. <view class="tip-item">
  211. <view class="icon">
  212. <text class="i-ri-magic-fill"/>
  213. </view>
  214. <view class="text">灰色按键为非必填项,系统已内置公式模型,可不用手动填写</view>
  215. </view>
  216. <view class="tip-item">
  217. <view class="icon">
  218. <text class="i-ri-magic-fill"/>
  219. </view>
  220. <view class="text">当前工序上报的报表数据必填项少于90%的填报率,系统不允许上报</view>
  221. </view>
  222. </view>
  223. <view class="mt-16">
  224. <uni-data-checkbox multiple v-model="checkbox1" :localdata="hobby"/>
  225. </view>
  226. <view class="mt-10">
  227. <button class="hc-btn rounded-36" type="primary" @click="startDataFill">开始填报</button>
  228. </view>
  229. </view>
  230. </view>
  231. </hc-sys>
  232. </template>
  233. <script setup>
  234. import {ref, watch} from "vue";
  235. import {useAppStore} from "@/store";
  236. import {onShow, onHide} from '@dcloudio/uni-app'
  237. import mainApi from '~api/user/index';
  238. import {errorToast} from "@/utils/tools";
  239. //变量
  240. const store = useAppStore()
  241. const isListType = ref(false);
  242. const checkbox1 = ref([])
  243. const hobby = [{text: '以后忽略此页面提示', value: 0}]
  244. //是否动画
  245. const isAnimation = ref(store.isAnimation)
  246. const msgCountData = ref(store.msgCountData)
  247. const projectInfo = ref(store.projectInfo)
  248. const contractInfo = ref(store.contractInfo)
  249. onShow(()=>{
  250. if(store.isAnimation) {
  251. isAnimation.value = true
  252. }
  253. userConfigInfo()
  254. })
  255. onHide(() => {
  256. isAnimation.value = false
  257. })
  258. //深度监听长连接消息
  259. watch(() => [
  260. store.msgCountData,
  261. ], ([val]) => {
  262. msgCountData.value = val
  263. }, {deep: true,})
  264. //获取配置
  265. const appCheck = ref(1)
  266. const userConfigInfo = async () => {
  267. const { data } = await mainApi.userConfigInfo()
  268. appCheck.value = data?.appCheck ?? 1
  269. }
  270. //资料填报
  271. const isPopovershow = ref(false);
  272. const isDataFill = () => {
  273. if (appCheck.value === 2) {
  274. homeToPage('/pages/data-fill/index')
  275. } else {
  276. isPopovershow.value = true;
  277. }
  278. }
  279. //关闭弹窗
  280. const closePopover = () => {
  281. isPopovershow.value = false;
  282. }
  283. //开始填报
  284. const startDataFill = async () => {
  285. isPopovershow.value = false;
  286. if (checkbox1.value.length > 0) {
  287. mainApi.userConfigSave({
  288. appCheck: 2
  289. }).then()
  290. }
  291. homeToPage('/pages/data-fill/index')
  292. }
  293. //跳转页面
  294. const homeToPage = (url) => {
  295. uni.navigateTo({
  296. url: url
  297. })
  298. }
  299. //跳转到任务页面
  300. const toTaskPage = () => {
  301. uni.switchTab({
  302. url: '/pages/task/index'
  303. })
  304. }
  305. const toNoAuth = () => {
  306. errorToast('此功能还在开发中')
  307. }
  308. </script>
  309. <style lang="scss">
  310. :deep(.home-nav-bar) {
  311. background-color: #EFEFF4;
  312. }
  313. </style>
  314. <style lang="scss" scoped>
  315. @import "@/style/index/index.scoped.scss";
  316. </style>