|
@@ -45,19 +45,19 @@
|
|
<ListItem ref="ListItemRef" :datas="listItemData" :status="1" :baseData="listItemBaseData" @offsetTop="ListItemOffsetTop" @renew="getTableDataAll"/>
|
|
<ListItem ref="ListItemRef" :datas="listItemData" :status="1" :baseData="listItemBaseData" @offsetTop="ListItemOffsetTop" @renew="getTableDataAll"/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
<template #action>
|
|
<template #action>
|
|
- <el-button type="primary" hc-btn>
|
|
|
|
|
|
+ <el-button type="primary" hc-btn :disabled="listItemData.length <= 0" :loading="tableFormSaveLoading" @click="tableFormSaveClick">
|
|
<HcIcon name="save"/>
|
|
<HcIcon name="save"/>
|
|
<span>保存</span>
|
|
<span>保存</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button hc-btn>
|
|
|
|
|
|
+ <el-button hc-btn :loading="reportLoading" @click="reportModalClick">
|
|
<HcIcon name="send-plane-2"/>
|
|
<HcIcon name="send-plane-2"/>
|
|
<span>上报</span>
|
|
<span>上报</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button hc-btn>
|
|
|
|
|
|
+ <el-button hc-btn :loading="bussPdfsLoading" @click="bussPdfsClick">
|
|
<HcIcon name="eye"/>
|
|
<HcIcon name="eye"/>
|
|
<span>预览</span>
|
|
<span>预览</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button hc-btn>
|
|
|
|
|
|
+ <el-button hc-btn @click="abolishOneClick">
|
|
<HcIcon name="arrow-go-back"/>
|
|
<HcIcon name="arrow-go-back"/>
|
|
<span>撤回上报流程</span>
|
|
<span>撤回上报流程</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -80,7 +80,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="hc-tree-scrollbar" v-loading="linksRelateTreeLoading" element-loading-text="获取数据中...">
|
|
<div class="hc-tree-scrollbar" v-loading="linksRelateTreeLoading" element-loading-text="获取数据中...">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
- <WbsTree :projectId="projectId" :contractId="contractId"/>
|
|
|
|
|
|
+ <TestTree :projectId="projectId" :contractId="contractId"/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -91,7 +91,7 @@
|
|
<div class="hc-links-sample-modal-box">
|
|
<div class="hc-links-sample-modal-box">
|
|
<div class="hc-links-sample-tree-box">
|
|
<div class="hc-links-sample-tree-box">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
- <WbsTree :projectId="projectId" :contractId="contractId"/>
|
|
|
|
|
|
+ <TestTree :projectId="projectId" :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial" :wbsType="2" :tenantId="userInfo?.tenant_id" @nodeTap="linksRawTreeClick"/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
<div class="hc-links-sample-table-box">
|
|
<div class="hc-links-sample-table-box">
|
|
@@ -105,7 +105,7 @@
|
|
<div class="hc-links-sample-modal-box">
|
|
<div class="hc-links-sample-modal-box">
|
|
<div class="hc-links-sample-tree-box">
|
|
<div class="hc-links-sample-tree-box">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
- <WbsTree :projectId="projectId" :contractId="contractId"/>
|
|
|
|
|
|
+ <TestTree :projectId="projectId" :wbsTempId="projectInfo?.referenceWbsTemplateIdTrial" :wbsType="2" :tenantId="userInfo?.tenant_id" @nodeTap="linksSampleTreeClick"/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
<div class="hc-links-sample-table-box">
|
|
<div class="hc-links-sample-table-box">
|
|
@@ -124,17 +124,20 @@ import {useRouter, useRoute} from 'vue-router'
|
|
import ListItem from "./components/ListItem.vue"
|
|
import ListItem from "./components/ListItem.vue"
|
|
import dataApi from "~api/tentative/detect/test";
|
|
import dataApi from "~api/tentative/detect/test";
|
|
import {getStoreData} from '~src/utils/storage'
|
|
import {getStoreData} from '~src/utils/storage'
|
|
-import WbsTree from "../../data-fill/components/WbsTree.vue"
|
|
|
|
-import {getArrValue, getObjValue} from "vue-utils-plus";
|
|
|
|
|
|
+import TestTree from "../material/components/TestTree.vue"
|
|
|
|
+import {getArrValue, getObjValue, getObjNullValue} from "vue-utils-plus";
|
|
import {getDictionary} from "~api/other";
|
|
import {getDictionary} from "~api/other";
|
|
|
|
+import {rowsToId} from "~uti/tools";
|
|
import dayjs from "dayjs"
|
|
import dayjs from "dayjs"
|
|
|
|
|
|
//变量
|
|
//变量
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const useRoutes = useRoute()
|
|
const useRoutes = useRoute()
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
|
|
+const userInfo = ref(useAppState.getUserInfo);
|
|
const projectId = ref(useAppState.getProjectId);
|
|
const projectId = ref(useAppState.getProjectId);
|
|
const contractId = ref(useAppState.getContractId);
|
|
const contractId = ref(useAppState.getContractId);
|
|
|
|
+const projectInfo = ref(useAppState.getProjectInfo);
|
|
const contractInfo = ref(useAppState.getContractInfo);
|
|
const contractInfo = ref(useAppState.getContractInfo);
|
|
|
|
|
|
//路由参数
|
|
//路由参数
|
|
@@ -197,7 +200,7 @@ const getCategoryData = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
//顶部表单
|
|
//顶部表单
|
|
-const topFormModel = ref({})
|
|
|
|
|
|
+const ListItemRef = ref(null);
|
|
const listItemBaseData = ref({
|
|
const listItemBaseData = ref({
|
|
sampleIds: '', contractId: null, nodeId: nodeId, trialProjectName: null, type: dataType, tableType: '1',
|
|
sampleIds: '', contractId: null, nodeId: nodeId, trialProjectName: null, type: dataType, tableType: '1',
|
|
detectionCategory: '', detection_result: '', reportDate: '', trialUserName: '',
|
|
detectionCategory: '', detection_result: '', reportDate: '', trialUserName: '',
|
|
@@ -266,6 +269,12 @@ const linksRawModalClick = () => {
|
|
linksRawModal.value = true
|
|
linksRawModal.value = true
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//树被点击
|
|
|
|
+const linksRawTreeClick = ({data}) => {
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
//原材检测报告数据
|
|
//原材检测报告数据
|
|
const tableRawRef = ref(null)
|
|
const tableRawRef = ref(null)
|
|
const linksRawTableColumn = ref([
|
|
const linksRawTableColumn = ref([
|
|
@@ -280,9 +289,7 @@ const linksRawTableLoading = ref(false)
|
|
//多选
|
|
//多选
|
|
const tableRawCheckedKeys = ref([]);
|
|
const tableRawCheckedKeys = ref([]);
|
|
const linksRawTableSelection = (rows) => {
|
|
const linksRawTableSelection = (rows) => {
|
|
- tableRawCheckedKeys.value = rows.filter((item) => {
|
|
|
|
- return (item??'') !== '';
|
|
|
|
- })
|
|
|
|
|
|
+ tableRawCheckedKeys.value = rows
|
|
}
|
|
}
|
|
|
|
|
|
const linksRawModalSave = () => {
|
|
const linksRawModalSave = () => {
|
|
@@ -296,41 +303,169 @@ const linksRawModalClose = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-//关联进场材料
|
|
|
|
|
|
+//关联取样
|
|
const linksSampleModal = ref(false)
|
|
const linksSampleModal = ref(false)
|
|
const linksSampleModalClick = () => {
|
|
const linksSampleModalClick = () => {
|
|
|
|
+ linksSampleTableData.value = [];
|
|
linksSampleModal.value = true
|
|
linksSampleModal.value = true
|
|
}
|
|
}
|
|
|
|
|
|
-//关联进场材料数据
|
|
|
|
|
|
+//搜索表单
|
|
|
|
+const linksSampleSearchForm = ref({
|
|
|
|
+ nodeId: null, current: 1, size: 20, total: 0
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+//树被点击
|
|
|
|
+const linksSampleTreeClick = ({data}) => {
|
|
|
|
+ linksSampleSearchForm.value.nodeId = data.primaryKeyId;
|
|
|
|
+ linksSampleSearchForm.value.current = 1;
|
|
|
|
+ getLinksSampleData()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//关联取样数据
|
|
const tableSampleRef = ref(null)
|
|
const tableSampleRef = ref(null)
|
|
const linksSampleTableColumn = ref([
|
|
const linksSampleTableColumn = ref([
|
|
- {key:'key1', name: '样品名称'},
|
|
|
|
- {key:'key2', name: '取样日期'},
|
|
|
|
- {key:'key4', name: '规格型号'},
|
|
|
|
- {key:'key7', name: '拟用部位'},
|
|
|
|
- {key:'key9', name: '取样人'},
|
|
|
|
|
|
+ {key:'materialName', name: '样品名称'},
|
|
|
|
+ {key:'samplingDate', name: '取样日期'},
|
|
|
|
+ {key:'specificationModel', name: '规格型号'},
|
|
|
|
+ {key:'proposedPosition', name: '拟用部位'},
|
|
|
|
+ {key:'userName', name: '取样人'},
|
|
])
|
|
])
|
|
const linksSampleTableData = ref([])
|
|
const linksSampleTableData = ref([])
|
|
|
|
+
|
|
|
|
+//获取关联数据
|
|
const linksSampleTableLoading = ref(false)
|
|
const linksSampleTableLoading = ref(false)
|
|
|
|
+const getLinksSampleData = async () => {
|
|
|
|
+ linksSampleTableLoading.value = true
|
|
|
|
+ const { error, code, data } = await dataApi.sampleListInfo({
|
|
|
|
+ ...linksSampleSearchForm.value,
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ linksSampleTableLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ linksSampleTableData.value = getArrValue(data)
|
|
|
|
+ //searchForm.value.total = data.total || 0
|
|
|
|
+ } else {
|
|
|
|
+ linksSampleTableData.value = []
|
|
|
|
+ //searchForm.value.total = 0
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
//多选
|
|
//多选
|
|
const tableSampleCheckedKeys = ref([]);
|
|
const tableSampleCheckedKeys = ref([]);
|
|
const linksSampleTableSelection = (rows) => {
|
|
const linksSampleTableSelection = (rows) => {
|
|
- tableSampleCheckedKeys.value = rows.filter((item) => {
|
|
|
|
- return (item??'') !== '';
|
|
|
|
- })
|
|
|
|
|
|
+ tableSampleCheckedKeys.value = rows
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//保存关联
|
|
const linksSampleModalSave = () => {
|
|
const linksSampleModalSave = () => {
|
|
-
|
|
|
|
|
|
+ const rows = tableSampleCheckedKeys.value
|
|
|
|
+ if (rows.length > 0) {
|
|
|
|
+ listItemBaseData.value.sampleIds = rowsToId(rows) || '';
|
|
|
|
+ tableSampleRef.value?.clearSelection();
|
|
|
|
+ tableSampleCheckedKeys.value = [];
|
|
|
|
+ linksSampleModal.value = false
|
|
|
|
+ } else {
|
|
|
|
+ window.$message?.warning('请先勾选需要关联的记录')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-//关闭关联进场材料
|
|
|
|
|
|
+//关闭关联取样
|
|
const linksSampleModalClose = () => {
|
|
const linksSampleModalClose = () => {
|
|
linksSampleModal.value = false
|
|
linksSampleModal.value = false
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//保存
|
|
|
|
+const tableFormSaveLoading = ref(false)
|
|
|
|
+const tableFormSaveClick = async () => {
|
|
|
|
+ let FormData = ListItemRef.value?.getFormData()
|
|
|
|
+ let FormRegExpJson = ListItemRef.value?.getFormRegExpJson()
|
|
|
|
+ //效验数据
|
|
|
|
+ if (getObjNullValue(FormRegExpJson)) {
|
|
|
|
+ setFormRegExpJson(FormRegExpJson)
|
|
|
|
+ } else if (FormData.length > 0) {
|
|
|
|
+ tableFormSaveLoading.value = true
|
|
|
|
+ const {error, code} = await dataApi.saveExcelBussData({
|
|
|
|
+ ...listItemBaseData.value,
|
|
|
|
+ dataInfo: {orderList: FormData}
|
|
|
|
+ })
|
|
|
|
+ tableFormSaveLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window?.$message?.success('保存成功')
|
|
|
|
+ //bussPdfsClick()
|
|
|
|
+ getTableDataAll()
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //bussPdfsClick()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//效验数据
|
|
|
|
+const setFormRegExpJson = (FormRegExpJson) => {
|
|
|
|
+ let nodeName = '', itemId = '';
|
|
|
|
+ Object.keys(FormRegExpJson).forEach(key => {
|
|
|
|
+ const name = FormRegExpJson[key]?.nodeName ?? ''
|
|
|
|
+ if (name) {
|
|
|
|
+ if (nodeName) {
|
|
|
|
+ nodeName += ',' + name
|
|
|
|
+ } else {
|
|
|
|
+ nodeName = name
|
|
|
|
+ itemId = FormRegExpJson[key]?.itemId
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ //const activeKey = ListItemRef.value?.getActiveKey()
|
|
|
|
+ //弹出提示
|
|
|
|
+ const val = '<div style="font-size: 16px;">请先完善 <span style="color:#1ECC95;">' + nodeName + '</span> 的数据内容</div>'
|
|
|
|
+ window?.$messageBox?.alert(val, '表单完善提醒', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
+ ListItemRef.value?.setActiveKey(itemId)
|
|
|
|
+ ListItemOffsetTop(0)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ const offsetTop = document.getElementById(itemId)?.offsetTop
|
|
|
|
+ ListItemOffsetTop(offsetTop)
|
|
|
|
+ }, 350)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//上报数据
|
|
|
|
+const reportLoading = ref(false)
|
|
|
|
+const reportModalClick = async () => {
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//多表预览
|
|
|
|
+const bussPdfsLoading = ref(false)
|
|
|
|
+const bussPdfsClick = async () => {
|
|
|
|
+ bussPdfsLoading.value = true
|
|
|
|
+ const {error, code, data} = await dataApi.getBussPdfs({
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ classify: authBtnTabKey.value,
|
|
|
|
+ tableType: tabTypeKey.value,
|
|
|
|
+ nodeId: nodeId,
|
|
|
|
+ })
|
|
|
|
+ bussPdfsLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.open(data,'_blank')
|
|
|
|
+ } else {
|
|
|
|
+ window.$message?.warning('获取PDF失败')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//撤回上报流程
|
|
|
|
+const abolishOneClick = () => {
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
//返回
|
|
//返回
|
|
const toBackClick = () => {
|
|
const toBackClick = () => {
|
|
router.push({
|
|
router.push({
|