test.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. <template>
  2. <div class="hc-page-layout-box">
  3. <div
  4. :style="`width:${isWbsTreeShow ? leftWidth : 0}px; ${isWbsTreeShow ? '' : 'display: none'}`"
  5. class="hc-layout-left-box bg-white" :class="[isWbsTreeShow ? 'show' : '']"
  6. >
  7. <div class="hc-project-box">
  8. <div class="hc-project-icon-box">
  9. <hc-icon name="stack" />
  10. </div>
  11. <div class="project-name-box ml-2">
  12. <div class="project-alias">{{ projectInfo.projectName }}</div>
  13. </div>
  14. </div>
  15. <div class="hc-tree-box">
  16. <el-scrollbar>
  17. <TestTree
  18. :auto-expand-keys="treeAutoExpandKeys"
  19. :project-id="projectId"
  20. :tenant-id="userInfo?.tenant_id"
  21. :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
  22. :wbs-type="2"
  23. :entrust="1"
  24. @node-tap="wbsElTreeClick"
  25. />
  26. </el-scrollbar>
  27. </div>
  28. <!-- 左右拖动 -->
  29. <div class="horizontal-drag-line" @mousedown="onmousedown" />
  30. </div>
  31. <div class="hc-page-content-box">
  32. <!---展开收缩树 -->
  33. <div class="hc-expansion-contraction-tree" @click="setWbsTreeShow">
  34. <hc-icon v-show="isWbsTreeShow" name="arrow-left-s" />
  35. <hc-icon v-show="!isWbsTreeShow" name="arrow-right-s" />
  36. </div>
  37. <HcTabCard :tabs="authBtnTabdata" :tab-key="authBtnTabKey" @change="authBtnTabClick">
  38. <template #extra>
  39. <HcTooltip keys="tentative_detect_test_add">
  40. <el-button
  41. :disabled="!primaryKeyId" hc-btn color="#37c0fe" style="color: white;"
  42. @click="addFormModalClick"
  43. >
  44. <hc-icon name="add-circle" />
  45. <span>新增</span>
  46. </el-button>
  47. </HcTooltip>
  48. <HcTooltip keys="tentative_detect_test_copy">
  49. <el-button
  50. :disabled="tableCheckedKeys.length <= 0" :loading="copyLoading" hc-btn
  51. color="#A16222" @click="copyDataClick"
  52. >
  53. <hc-icon name="file-copy-2" />
  54. <span>复制</span>
  55. </el-button>
  56. </HcTooltip>
  57. <HcTooltip keys="tentative_detect_test_del">
  58. <el-button
  59. :disabled="tableCheckedKeys.length <= 0" :loading="removeLoading" hc-btn
  60. color="#e03997" @click="delModalClick"
  61. >
  62. <hc-icon name="delete-bin-2" />
  63. <span>删除</span>
  64. </el-button>
  65. </HcTooltip>
  66. <HcTooltip keys="tentative_detect_test_print">
  67. <el-button
  68. :disabled="tableCheckedKeys.length <= 0" :loading="printPdfLoading" hc-btn
  69. color="#567722" @click="printPdfClick"
  70. >
  71. <hc-icon name="printer" />
  72. <span>批量打印</span>
  73. </el-button>
  74. </HcTooltip>
  75. <HcTooltip keys="tentative_detect_test_report">
  76. <el-button
  77. :disabled="tableCheckedKeys.length <= 0" :loading="reportPdfLoading" hc-btn
  78. color="#FF976A" style="color: white;" @click="reportPdfClick"
  79. >
  80. <hc-icon name="send-plane-2" />
  81. <span>批量上报</span>
  82. </el-button>
  83. </HcTooltip>
  84. <HcTooltip keys="tentative_detect_test_quit">
  85. <el-button
  86. :disabled="tableCheckedKeys.length <= 0" :loading="quitPdfLoading" hc-btn
  87. color="#e54d42" @click="quitPdfClick"
  88. >
  89. <hc-icon name="delete-bin-3" />
  90. <span>批量废除</span>
  91. </el-button>
  92. </HcTooltip>
  93. <HcTooltip keys="tentative_detect_test_null">
  94. <el-button
  95. :disabled="tableCheckedKeys.length <= 0" :loading="printNullPdfLoading" hc-btn
  96. color="#567722" @click="printNullPdfClick"
  97. >
  98. <hc-icon name="printer" />
  99. <span>打印空表</span>
  100. </el-button>
  101. </HcTooltip>
  102. </template>
  103. <template #search>
  104. <div class="w-40">
  105. <el-input
  106. v-model="searchForm.trialUserName" clearable placeholder="请输入试验人员"
  107. @keyup="keyUpEvent"
  108. />
  109. </div>
  110. <div class="ml-2 w-200px">
  111. <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable block>
  112. <el-option
  113. v-for="item in contractData" :key="item.id" :label="item.contractName"
  114. :value="item.id"
  115. />
  116. </el-select>
  117. </div>
  118. <div class="ml-2 w-32">
  119. <el-select v-model="searchForm.queryStatus" clearable placeholder="是否合格">
  120. <el-option
  121. v-for="item in qualifiedData" :key="item.value" :label="item.label"
  122. :value="item.value"
  123. />
  124. </el-select>
  125. </div>
  126. <div class="ml-2 w-250px">
  127. <hc-date-picker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
  128. </div>
  129. <div class="ml-2 w-72">
  130. <el-input v-model="searchForm.queryValue" clearable placeholder="请输入项目名称关键字" @keyup="keyUpEvent" />
  131. </div>
  132. <div class="ml-2">
  133. <el-button type="primary" @click="searchClick">
  134. <hc-icon name="search-2" />
  135. <span>搜索</span>
  136. </el-button>
  137. </div>
  138. </template>
  139. <HcTable
  140. ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
  141. is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  142. @selection-change="tableSelection"
  143. >
  144. <template #recordNo="{ row }">
  145. <span class="text-link" @click="tableRowEdit(row, '1')">{{ row?.recordNo }}</span>
  146. </template>
  147. <template #reportNo="{ row }">
  148. <span class="text-link" @click="tableRowEdit(row, '2')">{{ row?.reportNo }}</span>
  149. </template>
  150. <template #trialProjectName="{ row }">
  151. <span class="text-link font-bold" @click="tableRowPdf(row)">{{ row?.trialProjectName }}</span>
  152. </template>
  153. <template #taskStatus="{ row }">
  154. <!-- <el-tag :type="`${row.status === 2 ? 'success' : row.status === 0 ? 'warning' : row.status === 1 ? 'danger' : 'info'}`" -->
  155. <el-tag
  156. v-if="row.taskStatus"
  157. :type="`${row.taskStatus === '已审批' ? 'success' : row.taskStatus === '待审批' ? 'warning' : row.taskStatus === '已废除' ? 'danger' : 'info'}`"
  158. class="mx-1" effect="dark"
  159. >
  160. {{ row.taskStatus }}
  161. </el-tag>
  162. </template>
  163. <template #detectionCategory="{ row }">
  164. <!-- <span>{{arrKeyValue(categoryData, 'dictKey', 'dictValue', row.detectionCategory)}}</span> -->
  165. <span>{{ row.detectionCategoryName }}</span>
  166. </template>
  167. <template #isUploadCertificate="{ row }">
  168. <!-- <span>{{row.isUploadCertificate == 0 ? '是':row.isUploadCertificate == -1?'' : '否'}}</span> -->
  169. <span>{{ row.isUploadCertificateName }}</span>
  170. </template>
  171. <template #contractId="{ row }">
  172. <span>{{ contractInfo?.name }}</span>
  173. </template>
  174. <template #detectionResult="{ row }">
  175. <span>{{ row?.reportNo && row?.reportNo.length > 0 ? row.detectionResultName : '' }}</span>
  176. </template>
  177. <template #action="{ row }">
  178. <HcTooltip keys="tentative_detect_test_annex">
  179. <el-link type="primary" @click="viewAttachmentModalClick(row)">附件</el-link>
  180. </HcTooltip>
  181. <el-link type="primary" @click="relatedSearchClick(row)">关联查阅</el-link>
  182. <!-- HcTooltip keys="tentative_detect_test_info">
  183. <el-link type="primary" @click="samplingRecordModalClick(row)">样品信息</el-link>
  184. </HcTooltip -->
  185. </template>
  186. </HcTable>
  187. <template #action>
  188. <HcPages :pages="searchForm" @change="pageChange" />
  189. </template>
  190. </HcTabCard>
  191. </div>
  192. <!-- 查看附件 -->
  193. <hc-new-dialog
  194. :footer="false" :show="viewAttachmentModal" is-table title="查看附件" widths="70rem"
  195. @close="viewAttachmentModalClose"
  196. >
  197. <template #extra>
  198. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" size="default" @change="tabTypeChange" />
  199. </template>
  200. <div v-loading="viewAttachmentLoading" class="hc-switch-tab-content">
  201. <div class="h-full w-full flex">
  202. <div v-if="viewAttachmentData.length > 0" class="pdf-file-list-box">
  203. <template v-for="item in viewAttachmentData">
  204. <div :class="[item.isCheck ? 'cur' : '']" class="file-item" @click="viewCurFile(item)">
  205. {{ item.fileName || '' }}
  206. </div>
  207. </template>
  208. </div>
  209. <div v-else class="pdf-file-list-box">
  210. <hc-empty />
  211. </div>
  212. <iframe v-if="attachmentPdfUrl" :src="attachmentPdfUrl" frameborder="1" height="100%" width="80%" />
  213. <div class="hc-no-table-form">
  214. <div class="table-form-no">
  215. <HcDragUpload
  216. :datas="uploadData" :file-list="fileListData" @del-file="delFileData"
  217. @finished="uploadFinished" @progress="uploadprogress" @close="viewAttachmentModalClose"
  218. />
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. </hc-new-dialog>
  224. <!-- 查看样品信息 -->
  225. <hc-new-dialog
  226. :footer="false" :show="samplingRecordModal" is-table title="查看样品信息" widths="60%"
  227. @close="samplingRecordModalClose"
  228. >
  229. <HcTable
  230. :column="samplingTableColumn" :datas="samplingTableData" :is-index="false"
  231. :loading="samplingTableLoading" is-new
  232. />
  233. </hc-new-dialog>
  234. <!-- 关联查阅 -->
  235. <hc-dialog
  236. v-model="isRelatedSearch" :footer="false" is-table title="关联查阅" widths="80%" :padding="false"
  237. @close="relatedSearchModalClose"
  238. >
  239. <div class="hc-related-search-box relative mt-10px">
  240. <hc-card-item title="样品信息">
  241. <template #extra>
  242. <el-button :disabled="relatedData1.length <= 0" type="primary" size="small" @click="rowDispose">
  243. 样品处理
  244. </el-button>
  245. </template>
  246. <hc-table :column="relatedColumn1" :datas="relatedData1" :is-index="false" />
  247. </hc-card-item>
  248. <hc-card-item title="委托单信息" class="mt-14px">
  249. <hc-table :column="relatedColumn2" :datas="relatedData2" :is-index="false">
  250. <template #status="{ row }">
  251. <el-tag v-if="row.status === 1" type="info" effect="dark">未上报</el-tag>
  252. <el-tag v-if="row.status === 2" type="warning" effect="dark">已上报-待审批</el-tag>
  253. <el-tag v-if="row.status === 3" type="primary" effect="dark">待试验</el-tag>
  254. <el-tag v-if="row.status === 4" type="success" effect="dark">委托完成</el-tag>
  255. </template>
  256. </hc-table>
  257. </hc-card-item>
  258. <hc-card-item title="设备采集信息" class="mt-14px">
  259. <hc-table :column="relatedColumn3" :datas="relatedData3" :is-index="false" />
  260. </hc-card-item>
  261. </div>
  262. </hc-dialog>
  263. <!-- 样品处理 -->
  264. <hc-new-dialog v-model="disposeModal" is-footer-center title="样品处理" widths="40rem" @close="disposeClose">
  265. <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="left" label-width="auto">
  266. <el-form-item label="处理方式:" prop="repealType">
  267. <el-radio-group v-model="formModel.repealType">
  268. <el-radio :value="1">处理</el-radio>
  269. <el-radio :value="2">留样</el-radio>
  270. </el-radio-group>
  271. </el-form-item>
  272. <el-form-item v-if="formModel.repealType === 1" label="处理原因:" prop="repealReason">
  273. <el-input v-model="formModel.repealReason" type="textarea" :rows="5" resize="none" />
  274. </el-form-item>
  275. <el-form-item v-if="formModel.repealType === 2" label="留样时间:" prop="resamStartTime">
  276. <hc-date-picker :dates="formTime" clearable @change="formTimeUpdate" />
  277. </el-form-item>
  278. </el-form>
  279. <template #footer>
  280. <el-button @click="disposeClose">取消</el-button>
  281. <el-button hc-btn type="primary" :loading="saveLoading" @click="disposeSave">确定</el-button>
  282. </template>
  283. </hc-new-dialog>
  284. <!-- 批量上报审批 -->
  285. <HcReportModal
  286. :classify-type="authBtnTabKey"
  287. :addition="reportAddition" :contract-id="contractId" :ids="reportIds"
  288. :project-id="projectId" :show="showReportModal" :task-name="reportTaskName"
  289. :trial-self-inspection-record-id="1"
  290. :type-data="reportTypeData" title="批量上报审批" type="wbs"
  291. url="informationWriteQuery/batchTask" @finish="showReportFinish"
  292. @hide="showReportModal = false"
  293. />
  294. </div>
  295. </template>
  296. <script setup>
  297. import { onActivated, onMounted, ref, watch } from 'vue'
  298. import { useRoute, useRouter } from 'vue-router'
  299. import { useAppStore } from '~src/store'
  300. import TestTree from '../material/components/TestTree.vue'
  301. import { delStoreValue, getStoreValue, setStoreValue } from '~src/utils/storage'
  302. import HcDragUpload from './components/HcDragUpload.vue'
  303. import { getDictionary } from '~api/other'
  304. import { eVisaTaskCheckApi } from '~api/other'
  305. import { getErtractInfo } from '~api/other'
  306. import wbsApi from '~api/data-fill/wbs'
  307. import dataApi from '~api/tentative/detect/test'
  308. import testSampleApi from '~api/tentative/material/testSample'
  309. import commissionApi from '~api/tentative/detect/commission'
  310. import acquisitionApi from '~api/tentative/acquisition/data'
  311. import { arrToId, formValidate, getArrValue, getObjVal, getObjValue, isNullES, isString } from 'js-fast-way'
  312. import { HcDelMsg } from 'hc-vue3-ui'
  313. import { toPdfPage } from '~uti/btn-auth'
  314. //变量
  315. const router = useRouter()
  316. const useRoutes = useRoute()
  317. const useAppState = useAppStore()
  318. const userInfo = ref(useAppState.getUserInfo)
  319. const projectId = ref(useAppState.getProjectId)
  320. const contractId = ref(useAppState.getContractId)
  321. const projectInfo = ref(useAppState.getProjectInfo)
  322. const contractInfo = ref(useAppState.getContractInfo)
  323. const isCollapse = ref(useAppState.getCollapse)
  324. const isBubble = ref(useAppState.getBubble)
  325. //监听
  326. watch(() => [useAppState.getCollapse, useAppState.getBubble], ([Collapse, bubble]) => {
  327. isCollapse.value = Collapse
  328. isBubble.value = bubble
  329. })
  330. //获取气泡数据
  331. const getButtonsVal = (value) => {
  332. return useAppState.getButtonsVal(value)
  333. }
  334. //自动展开缓存
  335. const treeAutoExpandKeys = ref(getStoreValue('testTreeExpandKeys') || [])
  336. const btn_edit = ref(false)
  337. //渲染完成
  338. onMounted(() => {
  339. btn_edit.value = getButtonsVal('tentative_detect_test_edit')
  340. setContractType(contractInfo.value?.contractType)
  341. getCategoryData()
  342. getContractData()
  343. })
  344. //缓存被激活时,重新获取表格数据
  345. onActivated(() => {
  346. getDataApi()
  347. })
  348. const isFirstTime = ref(false)
  349. const getDataApi = async () => {
  350. isFirstTime.value = true
  351. const routerQuery = useRoutes?.query
  352. let currentPage = routerQuery?.current
  353. if (isNullES(currentPage)) {
  354. searchForm.value.current = 1
  355. } else {
  356. searchForm.value.current = Number(currentPage)
  357. }
  358. console.log(searchForm.value)
  359. // setMountOnEventKey()
  360. getTableData().then()
  361. }
  362. //获取合同段信息
  363. const contractData = ref([])
  364. const getContractData = async () => {
  365. const { data } = await getErtractInfo({
  366. projectId: projectId.value,
  367. contractId: contractId.value,
  368. })
  369. const res = getArrValue(data)
  370. contractData.value = res
  371. if (res.length <= 0) return
  372. let cid
  373. for (let i = 0; i < res.length; i++) {
  374. if (contractId.value == res[i].id) {
  375. cid = res[i].id
  376. }
  377. }
  378. searchForm.value.contractId = isNullES(cid) ? res[0].id : cid
  379. }
  380. const qualifiedData = ref([
  381. { label: '不合格', value: '0' },
  382. { label: '合格', value: '1' },
  383. ])
  384. //树展开和收起
  385. const isWbsTreeShow = ref(true)
  386. const setWbsTreeShow = () => {
  387. isWbsTreeShow.value = !isWbsTreeShow.value
  388. }
  389. //获取检测类别类型
  390. const categoryData = ref([])
  391. const getCategoryData = async () => {
  392. const { data } = await getDictionary({
  393. code: 'trial_detection_category',
  394. })
  395. const arrData = getArrValue(data)
  396. arrData.forEach(item => {
  397. item.dictKey = Number(item.dictKey)
  398. })
  399. categoryData.value = arrData
  400. }
  401. //搜索表单
  402. const searchForm = ref({
  403. trialUserName: null, queryStatus: null, queryValue: null, type: '1',
  404. current: 1, size: 20, total: 0,
  405. })
  406. //树相关的变量
  407. const primaryKeyId = ref('')
  408. const nodeDataInfo = ref({})
  409. //树被点击
  410. const wbsElTreeClick = ({ data, keys }) => {
  411. nodeDataInfo.value = data
  412. primaryKeyId.value = data['primaryKeyId'] || ''
  413. setStoreValue('testTreeItem', data)
  414. //缓存自动展开
  415. treeAutoExpandKeys.value = keys
  416. setStoreValue('testTreeExpandKeys', keys)
  417. //改变搜索表单数据
  418. searchForm.value.nodeId = data['primaryKeyId']
  419. if (!isFirstTime.value) {
  420. searchForm.value.current = 1
  421. } else {
  422. isFirstTime.value = false
  423. }
  424. getTableData()
  425. }
  426. //身份按钮切换数据
  427. const authBtnTabKey = ref('1')
  428. const authBtnTabdata = ref([
  429. { key: '1', name: '施工自检' },
  430. { key: '2', name: '监理抽检' },
  431. { key: '3', name: '业主抽检' },
  432. ])
  433. const authBtnTabClick = (item) => {
  434. tableData.value = []
  435. if (item.key !== authBtnTabKey.value && item.key < 3) {
  436. authBtnTabKey.value = item.key
  437. searchForm.value.type = item.key
  438. searchForm.value.current = 1
  439. getTableData()
  440. } else if (item.key === '3') {
  441. authBtnTabKey.value = item.key
  442. searchForm.value.type = item.key
  443. searchForm.value.current = 1
  444. getTableData()
  445. }
  446. }
  447. //contractType, 1施工,2监理, 3业主
  448. const setContractType = (contractType) => {
  449. let typeValue = '1'
  450. if (contractType > 0) {
  451. typeValue = contractType + ''
  452. }
  453. authBtnTabKey.value = typeValue
  454. searchForm.value.type = typeValue
  455. searchForm.value.current = 1
  456. }
  457. //日期时间被选择
  458. const betweenTime = ref(null)
  459. const betweenTimeUpdate = ({ arr }) => {
  460. betweenTime.value = arr
  461. if (arr.length > 0) {
  462. searchForm.value.startTime = arr[0]
  463. searchForm.value.endTime = arr[1]
  464. } else {
  465. searchForm.value.startTime = ''
  466. searchForm.value.endTime = ''
  467. }
  468. }
  469. //回车搜索
  470. const keyUpEvent = (e) => {
  471. if (e.key === 'Enter') {
  472. searchForm.value.current = 1
  473. getTableData()
  474. }
  475. }
  476. //搜索
  477. const searchClick = () => {
  478. searchForm.value.current = 1
  479. getTableData()
  480. }
  481. //分页被点击
  482. const pageChange = ({ current, size }) => {
  483. searchForm.value.current = current
  484. searchForm.value.size = size
  485. getTableData()
  486. }
  487. //表格数据
  488. const tableRef = ref(null)
  489. const tableColumn = ref([
  490. { key: 'recordNo', name: '记录编号', width: 190 },
  491. { key: 'reportNo', name: '报告编号', width: 190, autoWidth: true },
  492. { key: 'trialProjectName', name: '试验项目名称', width: 100, autoWidth: true },
  493. { key: 'detectionResult', name: '检测结果', width: 140, autoWidth: true },
  494. { key: 'taskStatus', name: '任务状态', width: 120, autoWidth: true },
  495. { key: 'reportDate', name: '报告日期', width: 170, autoWidth: true },
  496. { key: 'trialUserName', name: '试验人员', width: 170, autoWidth: true },
  497. { key: 'samplingLocation', name: '取样地点', width: 180, autoWidth: true },
  498. { key: 'detectionCategory', name: '检测类别', width: 100, autoWidth: true },
  499. { key: 'isUploadCertificate', name: '是否上传合格证', width: 120, autoWidth: true },
  500. { key: 'contractId', name: '合同段', width: 140, autoWidth: true },
  501. { key: 'company', name: '单位', width: 160, autoWidth: true },
  502. { key: 'entrustName', name: '委托单名称', autoWidth: true },
  503. { key: 'entrustNo', name: '委托单编号', autoWidth: true },
  504. { key: 'specificationNumber', name: '样品编号', width: 220, autoWidth: true },
  505. { key: 'specificationModel', name: '规格类型', width: 200, autoWidth: true },
  506. //{key:'projectPosition', name: '工程部位及用途', width: 160},
  507. { key: 'projectPositionName', name: '工程部位及用途', width: 160, autoWidth: true },
  508. { key: 'action', name: '操作', width: 120, fixed: 'right', align: 'center' },
  509. ])
  510. const tableData = ref([])
  511. //获取数据
  512. const tableLoading = ref(false)
  513. const getTableData = async () => {
  514. tableLoading.value = true
  515. const { error, code, data } = await dataApi.queryPage({
  516. ...searchForm.value,
  517. projectId: projectId.value,
  518. //contractId: contractId.value,
  519. })
  520. //处理数据
  521. tableLoading.value = false
  522. if (!error && code === 200) {
  523. tableData.value = getArrValue(data?.records)
  524. searchForm.value.total = data?.total || 0
  525. } else {
  526. tableData.value = []
  527. searchForm.value.total = 0
  528. }
  529. }
  530. //多选
  531. const tableCheckedKeys = ref([])
  532. const tableSelection = (rows) => {
  533. tableCheckedKeys.value = rows
  534. }
  535. //新增
  536. const addFormModalClick = () => {
  537. delStoreValue('test-form')
  538. setStoreValue('prenodeDataInfo', nodeDataInfo.value)
  539. const obj = getObjValue(searchForm.value)
  540. router.push({
  541. path: '/tentative/detect/test-form',
  542. query: {
  543. nodeId: primaryKeyId.value,
  544. dataType: authBtnTabKey.value,
  545. cid: obj?.contractId,
  546. isaddType: true,
  547. current: obj?.current,
  548. },
  549. })
  550. }
  551. //编辑
  552. const tableRowEdit = (row, tabTypeKey) => {
  553. setStoreValue('test-form', row)
  554. setStoreValue('prenodeDataInfo', nodeDataInfo.value)
  555. const obj = getObjValue(searchForm.value)
  556. router.push({
  557. path: '/tentative/detect/test-form',
  558. query: {
  559. id: row.id,
  560. nodeId: row.nodeId,
  561. dataType: row.type,
  562. tabTypeKey: tabTypeKey,
  563. cid: obj?.contractId,
  564. current: obj?.current,
  565. // prenodeDataInfo:JSON.stringify(nodeDataInfo.value)
  566. },
  567. })
  568. }
  569. //预览PDF
  570. const tableRowPdf = ({ pdfUrl }) => {
  571. if (pdfUrl) {
  572. toPdfPage(pdfUrl)
  573. //window.open(pdfUrl, '_blank')
  574. } else {
  575. window.$message?.warning('该数据暂无PDF')
  576. }
  577. }
  578. //复制
  579. const copyDataClick = () => {
  580. const rows = tableCheckedKeys.value
  581. if (rows.length > 0) {
  582. const ids = arrToId(rows)
  583. copyDataApi(ids)
  584. } else {
  585. window.$message?.warning('请先勾选需要复制的记录')
  586. }
  587. }
  588. //请求复制
  589. const copyLoading = ref(false)
  590. const copyDataApi = async (ids) => {
  591. //请求数据
  592. copyLoading.value = true
  593. const { error, code, msg } = await dataApi.copyData({
  594. projectId: projectId.value,
  595. ids: ids,
  596. }, false)
  597. //处理数据
  598. copyLoading.value = false
  599. if (!error && code === 200) {
  600. window.$message?.success('复制成功')
  601. searchClick()
  602. } else {
  603. window.$message?.error(msg)
  604. }
  605. }
  606. //删除
  607. const delModalClick = () => {
  608. const rows = tableCheckedKeys.value
  609. if (rows.length > 0) {
  610. const ids = arrToId(rows)
  611. HcDelMsg(async (resolve) => {
  612. await removeDataApi(ids)
  613. resolve() //关闭弹窗的回调
  614. })
  615. } else {
  616. window.$message?.warning('请先勾选需要删除的记录')
  617. }
  618. }
  619. //请求删除
  620. const removeLoading = ref(false)
  621. const removeDataApi = async (ids) => {
  622. //请求数据
  623. removeLoading.value = true
  624. const { error, code, msg } = await dataApi.removeData({
  625. projectId: projectId.value,
  626. ids: ids,
  627. }, false)
  628. //处理数据
  629. removeLoading.value = false
  630. if (!error && code === 200) {
  631. window.$message?.success('删除成功')
  632. searchClick()
  633. } else {
  634. window.$message?.error(msg)
  635. }
  636. }
  637. //批量打印
  638. const printPdfLoading = ref(false)
  639. const printPdfClick = async () => {
  640. const rows = tableCheckedKeys.value
  641. if (rows.length > 0) {
  642. const ids = arrToId(rows)
  643. //请求数据
  644. printPdfLoading.value = true
  645. const { error, code, msg, data } = await dataApi.printPdf({
  646. projectId: projectId.value,
  647. ids: ids,
  648. }, false)
  649. //处理数据
  650. const pdfUrl = isString(data) ? data || '' : ''
  651. printPdfLoading.value = false
  652. if (!error && code === 200 && pdfUrl) {
  653. toPdfPage(pdfUrl)
  654. //window.open(pdfUrl, '_blank')
  655. } else {
  656. window.$message?.error(msg || '文件异常')
  657. }
  658. } else {
  659. window.$message?.warning('请先勾选需要批量打印的记录')
  660. }
  661. }
  662. //批量废除
  663. const quitPdfLoading = ref(false)
  664. const quitPdfClick = async () => {
  665. const rows = tableCheckedKeys.value
  666. if (rows.length > 0) {
  667. const ids = arrToId(rows)
  668. const res1 = rows.some(item => item.taskStatus === '未上报')
  669. const res2 = rows.some(item => item.taskStatus === '已废除')
  670. if (res1) {
  671. window.$message?.warning('未上报的文件不能废除')
  672. } else if (res2) {
  673. window.$message?.warning('已废除的文件不能再次废除')
  674. } else {
  675. //请求数据
  676. quitPdfLoading.value = true
  677. const { error, code, msg } = await dataApi.batchAbolish({
  678. projectId: projectId.value,
  679. contractId: contractId.value,
  680. primaryKeyId: primaryKeyId.value,
  681. ids: ids,
  682. }, false)
  683. //处理数据
  684. if (!error && code === 200) {
  685. window.$message?.success('废除成功')
  686. quitPdfLoading.value = false
  687. searchClick()
  688. } else {
  689. quitPdfLoading.value = false
  690. window.$message?.error(msg)
  691. }
  692. }
  693. } else {
  694. window.$message?.warning('请先勾选需要批量打印的记录')
  695. }
  696. }
  697. //批量上报
  698. const reportPdfLoading = ref(false)
  699. //批量上报
  700. const reportIds = ref('')
  701. const reportTaskName = ref('')
  702. const reportAddition = ref({})
  703. const showReportModal = ref(false)
  704. const reportLoading = ref(false)
  705. const reportTypeData = ref([])
  706. const reportPdfClick = async () => {
  707. const rows = tableCheckedKeys.value
  708. if (rows.length > 0) {
  709. const info = getStoreValue('prenodeDataInfo') || {}
  710. const res1 = rows.some(item => item.pdfUrl.length < 1)
  711. const res2 = rows.some(item => item.taskStatus === '待审批' || item.taskStatus === '已审批')
  712. if (res1) {
  713. window.$message?.warning('当前数据暂无pdf无法上报')
  714. } else if (res2) {
  715. window.$message?.warning('已上报的数据无法再次上报')
  716. } else {
  717. reportLoading.value = true
  718. const ids = arrToId(rows)
  719. reportIds.value = ids
  720. const taskCheck = await eVisaTaskCheckApi({
  721. projectId: projectId.value,
  722. contractId: contractId.value,
  723. })
  724. //处理数据
  725. let newArr = []
  726. for (let i = 0; i < rows.length; i++) {
  727. newArr.push(rows[i]['tableIds'])
  728. }
  729. reportTypeData.value = [...newArr]
  730. console.log(reportTypeData.value, ' reportTypeData.value')
  731. reportLoading.value = false
  732. if (taskCheck) {
  733. //初始弹出弹窗,防呆
  734. reportAddition.value = {
  735. classify: authBtnTabKey.value,
  736. contractIdRelation: info['contractIdRelation'],
  737. }
  738. showReportModal.value = true
  739. //请求文件题名
  740. const { data } = await wbsApi.queryDocumentTitle({
  741. // primaryKeyId: info['primaryKeyId'],
  742. primaryKeyId: rows[0].id,
  743. classify: authBtnTabKey.value,
  744. })
  745. reportTaskName.value = isString(data) ? data : ''
  746. } else {
  747. window.$message?.warning('暂无相关数据')
  748. }
  749. }
  750. } else {
  751. window.$message?.warning('请先勾选需要批量上报的记录')
  752. }
  753. }
  754. //上报完成
  755. const showReportFinish = () => {
  756. showReportModal.value = false
  757. getTableData()
  758. }
  759. //打印空表
  760. const printNullPdfLoading = ref(false)
  761. const printNullPdfClick = async () => {
  762. const rows = tableCheckedKeys.value
  763. if (rows.length > 0) {
  764. const ids = arrToId(rows)
  765. //请求数据
  766. printNullPdfLoading.value = true
  767. const { error, code, msg, data } = await dataApi.printNullPdf({
  768. projectId: projectId.value,
  769. ids: ids,
  770. }, false)
  771. //处理数据
  772. const pdfUrl = isString(data) ? data || '' : ''
  773. printNullPdfLoading.value = false
  774. if (!error && code === 200 && pdfUrl) {
  775. toPdfPage(pdfUrl)
  776. //window.open(pdfUrl, '_blank')
  777. } else {
  778. window.$message?.error(msg || '文件异常')
  779. }
  780. } else {
  781. window.$message?.warning('请先勾选需要打印空表的记录')
  782. }
  783. }
  784. //查看附件
  785. const viewAttachmentModal = ref(false)
  786. const viewAttachmentLoading = ref(false)
  787. const viewAttachmentId = ref('')
  788. const viewAttachmentData = ref([])
  789. const viewAttachmentModalClick = async ({ id }) => {
  790. viewAttachmentId.value = id
  791. viewAttachmentModal.value = true
  792. getAttachmentModalClick(viewAttachmentId.value, '1')
  793. }
  794. const getCaption = (obj) => {
  795. const index = obj.lastIndexOf('pdf')
  796. return index
  797. }
  798. //获取附件
  799. const getAttachmentModalClick = async (id, type) => {
  800. viewAttachmentLoading.value = true
  801. const { error, code, data } = await dataApi.ancillaryDocumentsList({ id: id, type: type })
  802. console.log(data, 'data')
  803. viewAttachmentLoading.value = false
  804. if (!error && code === 200) {
  805. viewAttachmentData.value = getArrValue(data)
  806. curFileData.value = viewAttachmentData.value[0]
  807. viewCurFile(curFileData.value)
  808. } else {
  809. viewAttachmentData.value = []
  810. }
  811. }
  812. const refeshAttachmentModalClick = async (id, type) => {
  813. const { error, code, data } = await dataApi.ancillaryDocumentsList({ id: id, type: type })
  814. //处理数据
  815. viewAttachmentLoading.value = false
  816. if (!error && code === 200) {
  817. viewAttachmentData.value = getArrValue(data)
  818. if (viewAttachmentData.value.length < 1) {
  819. // window.$message?.warning('该条记录不存在附件')
  820. } else {
  821. viewCurFile(viewAttachmentData.value[0])
  822. }
  823. } else {
  824. viewAttachmentData.value = []
  825. }
  826. }
  827. const attachmentPdfUrl = ref('')
  828. const curFileData = ref({})
  829. //类型tab数据和相关处理
  830. const tabTypeKey = ref('1')
  831. const tabTypeTab = ref([
  832. { key: '1', name: '生产合格证' },
  833. { key: '2', name: '厂家质检报告' },
  834. { key: '3', name: '其他文件' },
  835. ])
  836. const tabTypeChange = (item) => {
  837. console.log(1111111111)
  838. tabTypeKey.value = item?.key
  839. getAttachmentModalClick(viewAttachmentId.value, item?.key)
  840. fileListData.value = []
  841. refeshAttachmentModalClick(viewAttachmentId.value, tabTypeKey.value)
  842. }
  843. //关闭查看附件
  844. const viewAttachmentModalClose = () => {
  845. viewAttachmentModal.value = false
  846. curFileData.value = ''
  847. attachmentPdfUrl.value = ''
  848. }
  849. const uploadData = ref({})
  850. const fileListData = ref([])
  851. const listuploadref = ref('1')
  852. //截取文件名称
  853. const splitFileName = (str) => {
  854. // if(str.indexOf("https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload") != -1){
  855. if (str.indexOf('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload') != -1) {
  856. let a = str.split('//')[2].split('/')[2]
  857. return a
  858. } else {
  859. return str
  860. }
  861. }
  862. //查看当前文件pdf
  863. const viewCurFile = (item) => {
  864. console.log(item, 'item')
  865. if (item) {
  866. curFileData.value = item
  867. let arr = []
  868. arr.push({ name: item.fileName, url: item.url })
  869. fileListData.value = getArrValue(arr)
  870. viewAttachmentData.value.forEach((ele) => {
  871. ele.isCheck = false
  872. })
  873. item.isCheck = true
  874. }
  875. }
  876. //上传进度
  877. const uploadprogress = (res) => {
  878. console.log('进度')
  879. }
  880. //上传完成
  881. const uploadFinished = async (res) => {
  882. const { error, code, data } = await dataApi.updateAncillaryDocument(
  883. {
  884. selfId: viewAttachmentId.value,
  885. url: res.link,
  886. type: tabTypeKey.value,
  887. })
  888. console.log(data, 'data')
  889. if (!error && code === 200) {
  890. refeshAttachmentModalClick(viewAttachmentId.value, tabTypeKey.value)
  891. }
  892. }
  893. //上传文件delFileData
  894. const delFileData = async (res) => {
  895. console.log('删除文件', curFileData.value)
  896. if (curFileData.value.isDel == 0) {
  897. window.$message.warning('该文件不可删除')
  898. } else {
  899. const { error, code, data } = await dataApi.removedocuments({
  900. projectId: projectId.value,
  901. id: curFileData.value.id,
  902. })
  903. if (!error && code === 200) {
  904. window.$message.success('删除成功')
  905. refeshAttachmentModalClick(viewAttachmentId.value, tabTypeKey.value)
  906. }
  907. }
  908. }
  909. //样品信息数据
  910. const samplingTableColumn = ref([
  911. { key: 'materialName', name: '样品名称' },
  912. { key: 'samplingDate', name: '取样时间' },
  913. { key: 'specificationNumber', name: '样品编号' },
  914. { key: 'specificationModel', name: '规格型号' },
  915. { key: 'materialCount', name: '试样数量' },
  916. { key: 'calculationUnit', name: '计算单位' },
  917. { key: 'proposedPosition', name: '拟用部位' },
  918. { key: 'representativeCount', name: '代表数量' },
  919. { key: 'userName', name: '取样人' },
  920. ])
  921. const samplingTableData = ref([])
  922. const samplingTableLoading = ref(false)
  923. //取样记录
  924. const samplingRecordModal = ref(false)
  925. const samplingRecordModalClick = async ({ id }) => {
  926. samplingRecordModal.value = true
  927. samplingTableLoading.value = true
  928. const { error, code, data } = await dataApi.getSampleList({
  929. projectId: projectId.value,
  930. id: id,
  931. })
  932. //处理数据
  933. samplingTableLoading.value = false
  934. if (!error && code === 200) {
  935. samplingTableData.value = getArrValue(data)
  936. } else {
  937. samplingTableData.value = []
  938. }
  939. }
  940. //关闭样品信息
  941. const samplingRecordModalClose = () => {
  942. samplingRecordModal.value = false
  943. samplingTableData.value = []
  944. }
  945. //左右拖动,改变树形结构宽度
  946. const leftWidth = ref(382)
  947. const onmousedown = () => {
  948. const leftNum = isCollapse.value ? 142 : 272
  949. document.onmousemove = (ve) => {
  950. let diffVal = ve.clientX - leftNum
  951. if (diffVal >= 310 && diffVal <= 900) {
  952. leftWidth.value = diffVal
  953. }
  954. }
  955. document.onmouseup = () => {
  956. document.onmousemove = null
  957. document.onmouseup = null
  958. }
  959. }
  960. //关联查阅
  961. const isRelatedSearch = ref(false)
  962. const relatedSearchClick = (row) => {
  963. isRelatedSearch.value = true
  964. //获取样品信息
  965. getSampleList(row.id)
  966. //获取委托单
  967. getCommissionData(row.entrustId)
  968. //获取关联设备
  969. getAcquisitionData(row.loadDataId)
  970. }
  971. //样品信息
  972. const relatedColumn1 = [
  973. { key: 'materialName', name: '样品名称' },
  974. { key: 'samplingDate', name: '取样日期' },
  975. { key: 'specificationNumber', name: '样品编号' },
  976. { key: 'specificationModel', name: '规格型号' },
  977. { key: 'materialCount', name: '试样数量' },
  978. { key: 'calculationUnit', name: '计算单位' },
  979. { key: 'proposedPosition', name: '拟用部位' },
  980. { key: 'representativeCount', name: '代表数量' },
  981. { key: 'userName', name: '取样人' },
  982. { key: 'carryTime', name: '入库时间', align: 'center' },
  983. { key: 'createTime', name: '试验时间', align: 'center' },
  984. { key: 'no-key', name: '样品处理' },
  985. { key: 'no-key', name: '时间(或处理原因)' },
  986. ]
  987. const relatedData1 = ref([])
  988. const getSampleList = async (id) => {
  989. relatedData1.value = []
  990. if (isNullES(id) || id == 0) return
  991. const { data } = await dataApi.getSampleList({ id })
  992. relatedData1.value = getArrValue(data)
  993. }
  994. //委托单信息
  995. const relatedColumn2 = [
  996. { key: 'entrustInfo', name: '委托单位' },
  997. { key: 'entrustNo', name: '委托单编号' },
  998. { key: 'entrustName', name: '委托单名称' },
  999. { key: 'status', name: '委托单状态', width: 120, align: 'center' },
  1000. ]
  1001. const relatedData2 = ref([])
  1002. const getCommissionData = async (id) => {
  1003. relatedData2.value = []
  1004. if (isNullES(id) || id == 0) return
  1005. const { data } = await commissionApi.detail(id)
  1006. const res = getObjVal(data)
  1007. relatedData2.value = res ? [res] : []
  1008. }
  1009. //设备采集信息
  1010. const relatedColumn3 = [
  1011. { key: 'engineInfo', name: '工程部位' },
  1012. { key: 'deviceName', name: '设备名称' },
  1013. { key: 'equipmentAcquisitionNumber', name: '设备采集编号', width: 180, align: 'center' },
  1014. { key: 'testDate', name: '试验日期', width: 160, align: 'center' },
  1015. { key: 'specificationNumber', name: '样品编号', width: 180, align: 'center' },
  1016. { key: 'testTypeName', name: '试验类型', width: 100, align: 'center' },
  1017. { key: 'beArea', name: '承压面积(mm2)', width: 100, align: 'center' },
  1018. { key: 'specimenSize', name: '试件尺寸(mm)', width: 100, align: 'center' },
  1019. { key: 'desStrength', name: '设计强度(MPa)', width: 100, align: 'center' },
  1020. { key: 'ageDate', name: '龄期(d)', width: 100, align: 'center' },
  1021. { key: 'load1', name: '荷载1(KN)', width: 100, align: 'center' },
  1022. { key: 'load2', name: '荷载2(KN)', width: 100, align: 'center' },
  1023. { key: 'load3', name: '荷载3(KN)', width: 100, align: 'center' },
  1024. { key: 'no-key', name: '荷载4(KN)', width: 100, align: 'center' },
  1025. { key: 'no-key', name: '荷载5(KN)', width: 100, align: 'center' },
  1026. { key: 'no-key', name: '荷载6(KN)', width: 100, align: 'center' },
  1027. { key: 'strengthAVG', name: '强度代表值(MPa)', width: 100, align: 'center' },
  1028. {
  1029. name: '最大力总延伸(%)',
  1030. children: [
  1031. { key: 'maxConceal1', name: '1', width: 100, align: 'center' },
  1032. { key: 'maxConceal2', name: '2', width: 100, align: 'center' },
  1033. { key: 'maxConceal3', name: '3', width: 100, align: 'center' },
  1034. ],
  1035. },
  1036. //{ key: 'dataQualified', name: '试验结果是否合格', width: 100, align: 'center' },
  1037. { key: 'dataStatus', name: '数据状态', width: 100, align: 'center' },
  1038. ]
  1039. const relatedData3 = ref([])
  1040. const getAcquisitionData = async (id) => {
  1041. relatedData3.value = []
  1042. if (isNullES(id) || id == 0) return
  1043. const { data } = await acquisitionApi.selectDataInfoById(id)
  1044. const res = getObjVal(data)
  1045. if (res) {
  1046. relatedData3.value = res ? [res] : []
  1047. setRelatedColumn3(res.testTypePId)
  1048. }
  1049. }
  1050. //设置表头
  1051. const setRelatedColumn3 = (type) => {
  1052. //压力机
  1053. if (type === '1') {
  1054. relatedColumn3.value = [
  1055. { key: 'engineInfo', name: '工程部位' },
  1056. { key: 'deviceName', name: '设备名称' },
  1057. { key: 'equipmentAcquisitionNumber', name: '设备采集编号', width: 180, align: 'center' },
  1058. { key: 'testDate', name: '试验日期', width: 160, align: 'center' },
  1059. { key: 'specificationNumber', name: '样品编号', width: 180, align: 'center' },
  1060. { key: 'testTypeName', name: '试验类型', width: 100, align: 'center' },
  1061. { key: 'beArea', name: '承压面积(mm2)', width: 100, align: 'center' },
  1062. { key: 'specimenSize', name: '试件尺寸(mm)', width: 100, align: 'center' },
  1063. { key: 'desStrength', name: '设计强度(MPa)', width: 100, align: 'center' },
  1064. { key: 'no-key', name: '龄期(d)', width: 100, align: 'center' },
  1065. { key: 'load1', name: '荷载1(KN)', width: 100, align: 'center' },
  1066. { key: 'load2', name: '荷载2(KN)', width: 100, align: 'center' },
  1067. { key: 'load3', name: '荷载3(KN)', width: 100, align: 'center' },
  1068. { key: 'no-key', name: '荷载4(KN)', width: 100, align: 'center' },
  1069. { key: 'no-key', name: '荷载5(KN)', width: 100, align: 'center' },
  1070. { key: 'no-key', name: '荷载6(KN)', width: 100, align: 'center' },
  1071. { key: 'no-key', name: '强度代表值(MPa)', width: 100, align: 'center' },
  1072. {
  1073. name: '最大力总延伸(%)',
  1074. children: [
  1075. { key: 'maxConceal1', name: '1', width: 100, align: 'center' },
  1076. { key: 'maxConceal2', name: '2', width: 100, align: 'center' },
  1077. { key: 'maxConceal3', name: '3', width: 100, align: 'center' },
  1078. ],
  1079. },
  1080. //{ key: 'dataQualified', name: '试验结果是否合格', width: 100, align: 'center' },
  1081. { key: 'dataStatus', name: '数据状态', width: 100, align: 'center' },
  1082. ]
  1083. } else if (type === '2') {
  1084. //万能机
  1085. relatedColumn3.value = [
  1086. { key: 'engineInfo', name: '工程部位' },
  1087. { key: 'deviceName', name: '设备名称' },
  1088. { key: 'equipmentAcquisitionNumber', name: '设备采集编号', width: 180, align: 'center' },
  1089. { key: 'testDate', name: '试验日期', width: 160, align: 'center' },
  1090. { key: 'specificationNumber', name: '样品编号', width: 180, align: 'center' },
  1091. { key: 'testTypeName', name: '试验类型', width: 100, align: 'center' },
  1092. { key: 'no-key', name: '牌号', width: 100, align: 'center' },
  1093. { key: 'no-key', name: '公称直径(mm)', width: 100, align: 'center' },
  1094. { key: 'no-key', name: '规格', width: 100, align: 'center' },
  1095. {
  1096. name: '最大力/荷载(KN)',
  1097. children: [
  1098. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1099. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1100. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1101. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1102. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1103. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1104. ],
  1105. },
  1106. {
  1107. name: '抗拉强度/强度代表值(MPa)',
  1108. children: [
  1109. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1110. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1111. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1112. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1113. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1114. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1115. ],
  1116. },
  1117. {
  1118. name: '上屈服力(KN)',
  1119. children: [
  1120. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1121. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1122. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1123. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1124. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1125. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1126. ],
  1127. },
  1128. {
  1129. name: '下屈服力(KN)',
  1130. children: [
  1131. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1132. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1133. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1134. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1135. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1136. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1137. ],
  1138. },
  1139. {
  1140. name: '上屈服强度(MPa)',
  1141. children: [
  1142. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1143. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1144. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1145. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1146. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1147. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1148. ],
  1149. },
  1150. {
  1151. name: '下屈服强度(MPa)',
  1152. children: [
  1153. { key: 'no-key', name: '1', width: 100, align: 'center' },
  1154. { key: 'no-key', name: '2', width: 100, align: 'center' },
  1155. { key: 'no-key', name: '3', width: 100, align: 'center' },
  1156. { key: 'no-key', name: '4', width: 100, align: 'center' },
  1157. { key: 'no-key', name: '5', width: 100, align: 'center' },
  1158. { key: 'no-key', name: '6', width: 100, align: 'center' },
  1159. ],
  1160. },
  1161. { key: 'dataStatus', name: '数据状态', width: 100, align: 'center' },
  1162. ]
  1163. }
  1164. }
  1165. //关闭关联查阅
  1166. const relatedSearchModalClose = () => {
  1167. isRelatedSearch.value = false
  1168. relatedData1.value = []
  1169. relatedData2.value = []
  1170. relatedData3.value = []
  1171. }
  1172. //表单数据
  1173. const formRef = ref(null)
  1174. const formModel = ref({})
  1175. const formRules = {
  1176. repealType: {
  1177. required: true,
  1178. trigger: 'blur',
  1179. message: '请选择处理方式',
  1180. },
  1181. repealReason: {
  1182. required: true,
  1183. trigger: 'blur',
  1184. message: '请填写处理原因',
  1185. },
  1186. resamStartTime: {
  1187. required: true,
  1188. trigger: 'blur',
  1189. message: '请选择留样时间',
  1190. },
  1191. }
  1192. //样品处理
  1193. const disposeModal = ref(false)
  1194. const rowDispose = () => {
  1195. disposeModal.value = true
  1196. const rows = relatedData1.value
  1197. formModel.value = {
  1198. id: arrToId(rows),
  1199. repealType: 1,
  1200. }
  1201. }
  1202. //日期时间被选择
  1203. const formTime = ref(null)
  1204. const formTimeUpdate = ({ arr }) => {
  1205. formTime.value = arr
  1206. if (arr.length > 0) {
  1207. formModel.value.resamStartTime = arr[0]
  1208. formModel.value.resamEndTime = arr[1]
  1209. } else {
  1210. formModel.value.resamStartTime = ''
  1211. formModel.value.resamEndTime = ''
  1212. }
  1213. }
  1214. //确定提交
  1215. const saveLoading = ref(false)
  1216. const disposeSave = async () => {
  1217. const isForm = await formValidate(formRef.value)
  1218. if (!isForm) return
  1219. const { error, code, msg } = await testSampleApi.update(formModel.value)
  1220. saveLoading.value = false
  1221. if (!error && code === 200) {
  1222. window.$message.success('提交成功')
  1223. disposeClose()
  1224. getTableData().then()
  1225. } else {
  1226. window.$message.error(msg || '操作失败')
  1227. }
  1228. }
  1229. //关闭弹窗
  1230. const disposeClose = () => {
  1231. disposeModal.value = false
  1232. formModel.value = {}
  1233. }
  1234. </script>
  1235. <style lang="scss" scoped>
  1236. @import "../../../styles/tentative/detect/test.scss";
  1237. .hc-switch-tab-content {
  1238. .pdf-file-list-box {
  1239. position: relative;
  1240. border-right: 1px solid #e9e9e9;
  1241. padding: 5px 0;
  1242. overflow-y: auto;
  1243. height: 100%;
  1244. flex: 1;
  1245. .file-item {
  1246. position: relative;
  1247. cursor: pointer;
  1248. padding: 6px 10px;
  1249. &:hover {
  1250. color: var(--el-color-primary);
  1251. background-color: var(--el-color-primary-light-8);
  1252. }
  1253. &.cur {
  1254. color: var(--el-color-primary);
  1255. background-color: var(--el-color-primary-light-8);
  1256. }
  1257. }
  1258. }
  1259. .hc-no-table-form {
  1260. flex: 1;
  1261. }
  1262. }
  1263. </style>
  1264. <style lang="scss">
  1265. .hc-related-search-box .hc-card-item-box {
  1266. background: #f5f5f5;
  1267. .hc-card-item-header {
  1268. color: #101010;
  1269. padding-bottom: 14px;
  1270. border-bottom: 1px solid #d6d6d6;
  1271. }
  1272. .hc-card-item-header .item-header {
  1273. font-size: 16px;
  1274. }
  1275. }
  1276. </style>