test-form.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div class="hc-page-box">
  3. <HcCard actionUi="text-center">
  4. <template #header>
  5. <el-button :type="authBtnTabKey === '1'?'primary':''" hc-btn @click="authBtnTabClick('1')">
  6. <HcIcon name="folder-user"/>
  7. <span>施工质检</span>
  8. </el-button>
  9. <el-button :type="authBtnTabKey === '2'?'primary':''" hc-btn @click="authBtnTabClick('2')">
  10. <HcIcon name="folder-shield"/>
  11. <span>监理质检</span>
  12. </el-button>
  13. </template>
  14. <template #extra>
  15. <el-button type="primary" hc-btn @click="linksRelateModalClick">关联工程用途及部位</el-button>
  16. <el-button type="primary" hc-btn @click="linksRawModalClick">关联原材检测报告</el-button>
  17. <el-button type="primary" hc-btn @click="linksSampleModalClick">关联取样</el-button>
  18. </template>
  19. <template #search>
  20. <div class="flex-1">
  21. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange" size="default" :round="false"/>
  22. </div>
  23. <div class="hc-search-top-form">
  24. <div class="w-36" v-if="tabTypeKey === 'tab2'">
  25. <el-date-picker type="date" v-model="topFormModel.key1" class="block" value-format="YYYY-MM-DD" :clearable="false" placeholder="请选择报告日期"/>
  26. </div>
  27. <div class="w-28 ml-2" v-if="tabTypeKey === 'tab2'">
  28. <el-select v-model="topFormModel.key2" placeholder="是否合格" block>
  29. <el-option label="合格" value="1" />
  30. <el-option label="不合格" value="2" />
  31. </el-select>
  32. </div>
  33. <div class="w-36 ml-2">
  34. <el-select v-model="topFormModel.key3" placeholder="选择检测类型" block>
  35. <el-option label="自检" value="1" />
  36. <el-option label="抽检" value="2" />
  37. <el-option label="平行试验" value="3" />
  38. <el-option label="验证试验" value="4" />
  39. <el-option label="中心实验室抽检" value="5" />
  40. </el-select>
  41. </div>
  42. </div>
  43. </template>
  44. <!--清表列表-->
  45. 清表列表(等待接口,然后把资料填报的组件,搬过来改一下即可。目前没数据,搞起来麻烦。)
  46. <!--el-scrollbar ref="ListItemScrollRef" v-loading="ListItemLoading" v-if="ListItemDatas.length > 0">
  47. <ListItem ref="ListItemRef" :datas="ListItemDatas" :status="NodeStatus" :classify="authBtnTabKey" @offsetTop="ListItemOffsetTop" :primaryKeyId="primaryKeyId" :contractId="contractId" @renew="getTableDataAll"/>
  48. </el-scrollbar-->
  49. <template #action>
  50. <el-button type="primary" hc-btn>
  51. <HcIcon name="save"/>
  52. <span>保存</span>
  53. </el-button>
  54. <el-button hc-btn>
  55. <HcIcon name="send-plane-2"/>
  56. <span>上报</span>
  57. </el-button>
  58. <el-button hc-btn>
  59. <HcIcon name="eye"/>
  60. <span>预览</span>
  61. </el-button>
  62. <el-button hc-btn>
  63. <HcIcon name="arrow-go-back"/>
  64. <span>撤回上报流程</span>
  65. </el-button>
  66. <el-button hc-btn @click="toBackClick">
  67. <HcIcon name="delete-back"/>
  68. <span>返回</span>
  69. </el-button>
  70. </template>
  71. </HcCard>
  72. <!--关联工程用途及部位-->
  73. <HcDialog :show="linksRelateModal" title="关联工程用途及部位" widths="50rem" isTable saveText="确认关联" @close="linksRelateModalClose" @save="linksRelateModalSave">
  74. <div class="hc-links-relate-tree-box">
  75. <div class="hc-search-tree-val">
  76. <el-input v-model="linksRelateSearchTreeVal" block size="large" placeholder="请输入名称关键词检索" clearable>
  77. <template #suffix>
  78. <HcIcon name="search-2" ui="text-xl"/>
  79. </template>
  80. </el-input>
  81. </div>
  82. <div class="hc-tree-scrollbar" v-loading="linksRelateTreeLoading" element-loading-text="获取数据中...">
  83. <el-scrollbar>
  84. <WbsTree :projectId="projectId" :contractId="contractId"/>
  85. </el-scrollbar>
  86. </div>
  87. </div>
  88. </HcDialog>
  89. <!--关联原材检测报告-->
  90. <HcDialog :show="linksRawModal" title="关联原材检测报告" widths="75rem" isTable saveText="确认关联" @close="linksRawModalClose" @save="linksRawModalSave">
  91. <div class="hc-links-sample-modal-box">
  92. <div class="hc-links-sample-tree-box">
  93. <el-scrollbar>
  94. <WbsTree :projectId="projectId" :contractId="contractId"/>
  95. </el-scrollbar>
  96. </div>
  97. <div class="hc-links-sample-table-box">
  98. <HcTable ref="tableRawRef" :column="linksRawTableColumn" :datas="linksRawTableData" :loading="linksRawTableLoading" :isIndex="false" isCheck @selection-change="linksRawTableSelection"/>
  99. </div>
  100. </div>
  101. </HcDialog>
  102. <!--关联取样-->
  103. <HcDialog :show="linksSampleModal" title="关联取样信息" widths="75rem" isTable saveText="确认" @close="linksSampleModalClose" @save="linksSampleModalSave">
  104. <div class="hc-links-sample-modal-box">
  105. <div class="hc-links-sample-tree-box">
  106. <el-scrollbar>
  107. <WbsTree :projectId="projectId" :contractId="contractId"/>
  108. </el-scrollbar>
  109. </div>
  110. <div class="hc-links-sample-table-box">
  111. <HcTable ref="tableSampleRef" :column="linksSampleTableColumn" :datas="linksSampleTableData" :loading="linksSampleTableLoading" :isIndex="false" isCheck @selection-change="linksSampleTableSelection"/>
  112. </div>
  113. </div>
  114. </HcDialog>
  115. </div>
  116. </template>
  117. <script setup>
  118. import {ref, watch, onMounted} from "vue";
  119. import {useAppStore} from "~src/store";
  120. import {useRouter, useRoute} from 'vue-router'
  121. import ListItem from "./components/ListItem.vue"
  122. import WbsTree from "../../data-fill/components/WbsTree.vue"
  123. import dayjs from "dayjs"
  124. //变量
  125. const router = useRouter()
  126. const useRoutes = useRoute()
  127. const useAppState = useAppStore()
  128. const projectId = ref(useAppState.getProjectId);
  129. const contractId = ref(useAppState.getContractId);
  130. const contractInfo = ref(useAppState.getContractInfo);
  131. //路由参数
  132. const routerQuery = useRoutes?.query;
  133. //存储目录格式 1按部位存储,2按日期存储
  134. const dataId = routerQuery?.id || '';
  135. const dataType = parseInt(routerQuery?.type + '') || 1;
  136. const fileType = parseInt(routerQuery?.fileType + '') || 2;
  137. const dayDate = dayjs().format('YYYY-MM-DD')
  138. //渲染完成
  139. onMounted(() => {
  140. setContractType(contractInfo.value?.contractType)
  141. topFormModel.value.key1 = dayDate
  142. })
  143. //身份按钮切换数据
  144. const authBtnTabKey = ref('1')
  145. const authBtnTabClick = (val) => {
  146. if (val !== authBtnTabKey.value) {
  147. authBtnTabKey.value = val
  148. //getTableDataAll()
  149. }
  150. }
  151. //contractType, 1施工,2监理
  152. const setContractType = (contractType) => {
  153. if (contractType <= 0) {
  154. authBtnTabKey.value = '1'
  155. authBtnTabKey.value = '1'
  156. topFormModel.value.key3 = '1'
  157. } else {
  158. authBtnTabKey.value = contractType + ''
  159. if (contractType < 3) {
  160. topFormModel.value.key3 = contractType + ''
  161. } else {
  162. topFormModel.value.key3 = '1'
  163. }
  164. }
  165. }
  166. //类型tab数据和相关处理
  167. const tabTypeKey = ref('tab1')
  168. const tabTypeTab = ref([
  169. {key:'tab1', name: '记录表'},
  170. {key:'tab2', name: '报告单'},
  171. ]);
  172. const tabTypeChange = (item) => {
  173. tabTypeKey.value = item?.key
  174. }
  175. //顶部表单
  176. const topFormModel = ref({})
  177. const searchForm = ref({})
  178. //关联工程用途及部位 树
  179. const linksRelateModal = ref(false)
  180. const linksRelateModalClick = () => {
  181. linksRelateModal.value = true
  182. }
  183. const linksRelateSearchTreeVal = ref('')
  184. const linksRelateTreeLoading = ref(false)
  185. //确认关联
  186. const linksRelateModalSave = () => {
  187. linksRelateModal.value = false
  188. }
  189. const linksRelateModalClose = () => {
  190. linksRelateModal.value = false
  191. }
  192. //关联原材检测报告
  193. const linksRawModal = ref(false)
  194. const linksRawModalClick = () => {
  195. linksRawModal.value = true
  196. }
  197. //原材检测报告数据
  198. const tableRawRef = ref(null)
  199. const linksRawTableColumn = ref([
  200. {key:'key1', name: '报告编号'},
  201. {key:'key2', name: '试验项目名称'},
  202. {key:'key3', name: '工程部位及用途'},
  203. {key:'key4', name: '报告日期'}
  204. ])
  205. const linksRawTableData = ref([])
  206. const linksRawTableLoading = ref(false)
  207. //多选
  208. const tableRawCheckedKeys = ref([]);
  209. const linksRawTableSelection = (rows) => {
  210. tableRawCheckedKeys.value = rows.filter((item) => {
  211. return (item??'') !== '';
  212. })
  213. }
  214. const linksRawModalSave = () => {
  215. }
  216. //关闭原材检测报告
  217. const linksRawModalClose = () => {
  218. linksRawModal.value = false
  219. }
  220. //关联进场材料
  221. const linksSampleModal = ref(false)
  222. const linksSampleModalClick = () => {
  223. linksSampleModal.value = true
  224. }
  225. //关联进场材料数据
  226. const tableSampleRef = ref(null)
  227. const linksSampleTableColumn = ref([
  228. {key:'key1', name: '样品名称'},
  229. {key:'key2', name: '取样日期'},
  230. {key:'key4', name: '规格型号'},
  231. {key:'key7', name: '拟用部位'},
  232. {key:'key9', name: '取样人'},
  233. ])
  234. const linksSampleTableData = ref([])
  235. const linksSampleTableLoading = ref(false)
  236. //多选
  237. const tableSampleCheckedKeys = ref([]);
  238. const linksSampleTableSelection = (rows) => {
  239. tableSampleCheckedKeys.value = rows.filter((item) => {
  240. return (item??'') !== '';
  241. })
  242. }
  243. const linksSampleModalSave = () => {
  244. }
  245. //关闭关联进场材料
  246. const linksSampleModalClose = () => {
  247. linksSampleModal.value = false
  248. }
  249. //返回
  250. const toBackClick = () => {
  251. router.push({
  252. path: '/tentative/detect/test',
  253. query: {}
  254. })
  255. }
  256. </script>
  257. <style lang="scss" scoped>
  258. @import "../../../styles/tentative/detect/test-form.scss";
  259. </style>