|
@@ -10,80 +10,85 @@
|
|
|
<div class="dialog-tree-box">
|
|
|
<el-scrollbar>
|
|
|
<!-- 试验检测树 -->
|
|
|
- <TestTree v-if="fileModalradio==1"
|
|
|
- :contractId="contractId"
|
|
|
- :projectId="projectId"
|
|
|
- :tenantId="tenant_id"
|
|
|
- :wbsId="wbsTempId"
|
|
|
- :wbsType="wbs_type"
|
|
|
- @nodeTap="fileModalElTreeClick"
|
|
|
- >
|
|
|
- </TestTree>
|
|
|
+ <TestTree
|
|
|
+ v-if="fileModalradio == 1"
|
|
|
+ :contract-id="contractId"
|
|
|
+ :project-id="projectId"
|
|
|
+ :tenant-id="tenant_id"
|
|
|
+ :wbs-id="wbsTempId"
|
|
|
+ :wbs-type="wbs_type"
|
|
|
+ @nodeTap="fileModalElTreeClick"
|
|
|
+ />
|
|
|
<!-- 第三方树 -->
|
|
|
<ElTree
|
|
|
v-else
|
|
|
ref="ElTreeRef2" :data="thirdtreeDatas" :indent="0" :props="thirdElTreeProps"
|
|
|
accordion class="hc-tree-node" highlight-current
|
|
|
- node-key="id" @node-click="thirdtreeDatasElTreeClick">
|
|
|
- </ElTree>
|
|
|
+ node-key="id" @node-click="thirdtreeDatasElTreeClick"
|
|
|
+ />
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<div class="dialog-table-box">
|
|
|
<div class="dialog-search">
|
|
|
<div class="w-64 ml-2">
|
|
|
- <HcDatePicker :dates="filebetweenTime" clearable @change="filebetweenTimeUpdate"/>
|
|
|
+ <HcDatePicker :dates="filebetweenTime" clearable @change="filebetweenTimeUpdate" />
|
|
|
</div>
|
|
|
<div class="ml-2">
|
|
|
<el-button type="primary" @click="filesearchClick">
|
|
|
- <HcIcon name="search-2"/>
|
|
|
+ <HcIcon name="search-2" />
|
|
|
<span>搜索</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="dialog-table">
|
|
|
- <HcTable v-if="fileModalradio==1" ref="dialogTableRef1" :column="filedialogTableColumn"
|
|
|
- :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
|
|
|
- @selection-change="filedialogTableSelection1">
|
|
|
- <template #reportNo="{row}">
|
|
|
- <span :class="[row?.isSelectedStatus==1?'text-green':'']">{{ row?.reportNo }}</span>
|
|
|
+ <HcTable
|
|
|
+ v-if="fileModalradio == 1" ref="dialogTableRef1" :column="filedialogTableColumn"
|
|
|
+ :datas="filedialogTableData" :loading="filedialogTableLoading" is-check border
|
|
|
+ @selection-change="filedialogTableSelection1"
|
|
|
+ >
|
|
|
+ <template #reportNo="{ row }">
|
|
|
+ <span :class="[row?.isSelectedStatus == 1 ? 'text-green' : '']">{{ row?.reportNo }}</span>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
- <HcTable v-if="fileModalradio==2" ref="dialogTableRef2" :column="filedialogTableColumn1"
|
|
|
- :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
|
|
|
- @selection-change="filedialogTableSelection">
|
|
|
- <template #reportNo="{row}">
|
|
|
- <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
|
|
|
+ <HcTable
|
|
|
+ v-if="fileModalradio == 2" ref="dialogTableRef2" :column="filedialogTableColumn1"
|
|
|
+ :datas="filedialogTableData" :loading="filedialogTableLoading" is-check border
|
|
|
+ @selection-change="filedialogTableSelection"
|
|
|
+ >
|
|
|
+ <template #reportNo="{ row }">
|
|
|
+ <span :class="[row?.isSelectedStatus === 1 ? 'text-green' : '']">{{ row?.reportNo }}</span>
|
|
|
</template>
|
|
|
- <template #status="{row}">
|
|
|
+ <template #status="{ row }">
|
|
|
<span>{{ row?.status == 1 ? '合格' : '不合格' }}</span>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
- <HcTable v-if="fileModalradio==3" ref="dialogTableRef" :column="filedialogTableColumn1"
|
|
|
- :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
|
|
|
- @selection-change="filedialogTableSelection">
|
|
|
- <template #reportNo="{row}">
|
|
|
- <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
|
|
|
+ <HcTable
|
|
|
+ v-if="fileModalradio == 3" ref="dialogTableRef" :column="filedialogTableColumn1"
|
|
|
+ :datas="filedialogTableData" :loading="filedialogTableLoading" is-check border
|
|
|
+ @selection-change="filedialogTableSelection"
|
|
|
+ >
|
|
|
+ <template #reportNo="{ row }">
|
|
|
+ <span :class="[row?.isSelectedStatus === 1 ? 'text-green' : '']">{{ row?.reportNo }}</span>
|
|
|
</template>
|
|
|
- <template #status="{row}">
|
|
|
+ <template #status="{ row }">
|
|
|
<span>{{ row?.status == 1 ? '合格' : '不合格' }}</span>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
-
|
|
|
</div>
|
|
|
<div class="dialog-pages">
|
|
|
- <HcPages :pages="filesearchFormPage" @change="filesearchFormPageChange"/>
|
|
|
+ <HcPages :pages="filesearchFormPage" @change="filesearchFormPageChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref, watch, onMounted, nextTick} from "vue";
|
|
|
-import {getArrValue} from "js-fast-way"
|
|
|
-import {getTreeAll} from "~api/tentative/detect";
|
|
|
-import thirdApi from "~api/tentative/detect/third";
|
|
|
-import samplingApi from "~api/tentative/material/sampling";
|
|
|
-import TestTree from "./testTree.vue"
|
|
|
+import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
+import { getTreeAll } from '~api/tentative/detect'
|
|
|
+import thirdApi from '~api/tentative/detect/third'
|
|
|
+import samplingApi from '~api/tentative/material/sampling'
|
|
|
+import TestTree from './testTree.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
|
projectId: [String, Number],
|
|
@@ -94,8 +99,8 @@ const props = defineProps({
|
|
|
treeId: [String, Number],
|
|
|
})
|
|
|
|
|
|
-const projectId = ref(props.projectId);
|
|
|
-const contractId = ref(props.contractId);
|
|
|
+const projectId = ref(props.projectId)
|
|
|
+const contractId = ref(props.contractId)
|
|
|
|
|
|
const wbsTempId = ref(props.wbsId)
|
|
|
const tenant_id = ref(props.tenantId)
|
|
@@ -109,7 +114,7 @@ watch(() => [
|
|
|
props.wbsId,
|
|
|
props.tenantId,
|
|
|
props.wbsType,
|
|
|
- props.treeId
|
|
|
+ props.treeId,
|
|
|
], ([pid, cid, wbs_id, tid, type, treeId]) => {
|
|
|
projectId.value = pid
|
|
|
contractId.value = cid
|
|
@@ -124,7 +129,7 @@ const defaultExpandedCids = ref([])
|
|
|
const ElTreeProps = ref({
|
|
|
label: 'title',
|
|
|
children: 'children',
|
|
|
- isLeaf: 'hasChildren'
|
|
|
+ isLeaf: 'hasChildren',
|
|
|
})
|
|
|
|
|
|
|
|
@@ -144,13 +149,13 @@ const filenodeItemInfo = ref({})
|
|
|
const filenodeDataInfo = ref({})
|
|
|
const fileTableData1 = ref([])
|
|
|
const fileTableColumn = ref([
|
|
|
- {key: 'recordNo', name: '报告编号'},
|
|
|
- {key: 'reportDate', name: '报告日期'},
|
|
|
- {key: 'projectPositionName', name: '工程用途及部位'},
|
|
|
- {key: 'detectionResultName', name: '检测结果'},
|
|
|
+ { key: 'recordNo', name: '报告编号' },
|
|
|
+ { key: 'reportDate', name: '报告日期' },
|
|
|
+ { key: 'projectPositionName', name: '工程用途及部位' },
|
|
|
+ { key: 'detectionResultName', name: '检测结果' },
|
|
|
])
|
|
|
|
|
|
-const fileModalElTreeClick = async ({data, node}) => {
|
|
|
+const fileModalElTreeClick = async ({ data, node }) => {
|
|
|
filenodeItemInfo.value = node
|
|
|
filenodeDataInfo.value = data
|
|
|
getfileNodeData()
|
|
@@ -164,13 +169,13 @@ const thirdElTreeProps = ref({
|
|
|
label: 'nodeName',
|
|
|
children: 'children',
|
|
|
isLeaf: function (data) {
|
|
|
- return !data.hasChildren;
|
|
|
+ return !data.hasChildren
|
|
|
},
|
|
|
})
|
|
|
const getthirdTreeDatas = async (type) => {
|
|
|
- const {error, code, data} = await getTreeAll({
|
|
|
+ const { error, code, data } = await getTreeAll({
|
|
|
projectId: projectId.value,
|
|
|
- contractId: contractId.value
|
|
|
+ contractId: contractId.value,
|
|
|
})
|
|
|
if (!error && code === 200) {
|
|
|
if (type == 2) {
|
|
@@ -189,7 +194,7 @@ const thirdfilenodeDataInfo = ref({})
|
|
|
//获取第三方树节点下的数据
|
|
|
const getthirdTreetavleDatas = async () => {
|
|
|
filedialogTableLoading.value = true
|
|
|
- const {error, code, data} = await thirdApi.queryPage({
|
|
|
+ const { error, code, data } = await thirdApi.queryPage({
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
nodeId: thirdfilenodeDataInfo.value.id,
|
|
@@ -197,7 +202,7 @@ const getthirdTreetavleDatas = async () => {
|
|
|
size: filesearchFormPage.value.size,
|
|
|
startTime: filesearchFormPage.value.startTime,
|
|
|
endTime: filesearchFormPage.value.lastTime,
|
|
|
- qualityTestPKeyId: isPrimaryKeyId.value
|
|
|
+ qualityTestPKeyId: isPrimaryKeyId.value,
|
|
|
|
|
|
|
|
|
})
|
|
@@ -213,7 +218,7 @@ const getthirdTreetavleDatas = async () => {
|
|
|
defaultarr.push(item)
|
|
|
|
|
|
}
|
|
|
- if (fileModalradio === 2) {
|
|
|
+ if (fileModalradio.value === 2) {
|
|
|
outtabtoggleSelection(defaultarr)
|
|
|
} else {
|
|
|
thirdtabtoggleSelection(defaultarr)
|
|
@@ -236,50 +241,50 @@ const thirdtreeDatasElTreeClick = (data, node) => {
|
|
|
|
|
|
const filebetweenTime = ref([])
|
|
|
const filesearchFormPage = ref({
|
|
|
- startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0
|
|
|
+ startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0,
|
|
|
})
|
|
|
-const filesearchFormPageChange = ({current, size}) => {
|
|
|
+const filesearchFormPageChange = ({ current, size }) => {
|
|
|
filesearchFormPage.value.current = current
|
|
|
filesearchFormPage.value.size = size
|
|
|
// getDialogTableData()
|
|
|
}
|
|
|
-const filebetweenTimeUpdate = ({arr}) => {
|
|
|
+const filebetweenTimeUpdate = ({ arr }) => {
|
|
|
filebetweenTime.value = arr
|
|
|
filesearchFormPage.value.startTime = arr[0]
|
|
|
filesearchFormPage.value.lastTime = arr[1]
|
|
|
}
|
|
|
|
|
|
const filesearchClick = () => {
|
|
|
- filesearchFormPage.value.current = 1;
|
|
|
+ filesearchFormPage.value.current = 1
|
|
|
getfileNodeData()
|
|
|
}
|
|
|
const filedialogTableLoading = ref(false)
|
|
|
|
|
|
const filedialogTableColumn = ref([
|
|
|
// reportNo
|
|
|
- {key: 'reportNo', name: '报告编号'},
|
|
|
- {key: 'reportDate', name: '报告日期'},
|
|
|
- {key: 'projectPositionName', name: '工程用途及部位'},
|
|
|
- {key: 'detectionResultName', name: '检测结果'},
|
|
|
+ { key: 'reportNo', name: '报告编号' },
|
|
|
+ { key: 'reportDate', name: '报告日期' },
|
|
|
+ { key: 'projectPositionName', name: '工程用途及部位' },
|
|
|
+ { key: 'detectionResultName', name: '检测结果' },
|
|
|
])
|
|
|
const filedialogTableColumn1 = ref([
|
|
|
// reportNo
|
|
|
- {key: 'reportNo', name: '报告编号'},
|
|
|
- {key: 'reportDate', name: '报告日期'},
|
|
|
- {key: 'projectPosition', name: '工程用途及部位'},
|
|
|
- {key: 'status', name: '检测结果'},
|
|
|
+ { key: 'reportNo', name: '报告编号' },
|
|
|
+ { key: 'reportDate', name: '报告日期' },
|
|
|
+ { key: 'projectPosition', name: '工程用途及部位' },
|
|
|
+ { key: 'status', name: '检测结果' },
|
|
|
])
|
|
|
|
|
|
//多选
|
|
|
-const filetableCheckedKeys = ref([]);
|
|
|
+const filetableCheckedKeys = ref([])
|
|
|
const filedialogTableSelection1 = (rows) => {
|
|
|
filetableCheckedKeys.value = rows.filter((item) => {
|
|
|
- return (item ?? '') !== '';
|
|
|
+ return (item ?? '') !== ''
|
|
|
})
|
|
|
}
|
|
|
const filedialogTableSelection = (rows) => {
|
|
|
filetableCheckedKeys.value = rows.filter((item) => {
|
|
|
- return (item ?? '') !== '';
|
|
|
+ return (item ?? '') !== ''
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -287,14 +292,14 @@ const filedialogTableSelection = (rows) => {
|
|
|
const getfileNodeData = async () => {
|
|
|
//获取数据
|
|
|
filedialogTableLoading.value = true
|
|
|
- const {error, code, data} = await samplingApi.gettrialPage({
|
|
|
+ const { error, code, data } = await samplingApi.gettrialPage({
|
|
|
contractId: contractId.value,
|
|
|
nodeId: filenodeDataInfo.value.primaryKeyId,
|
|
|
current: filesearchFormPage.value.current,
|
|
|
size: filesearchFormPage.value.size,
|
|
|
startTime: filesearchFormPage.value.startTime,
|
|
|
endTime: filesearchFormPage.value.lastTime,
|
|
|
- qualityTestPKeyId: isPrimaryKeyId.value
|
|
|
+ qualityTestPKeyId: isPrimaryKeyId.value,
|
|
|
})
|
|
|
//处理数据
|
|
|
if (!error && code === 200) {
|
|
@@ -324,11 +329,11 @@ const tabtoggleSelection = (rows) => {
|
|
|
if (rows) {
|
|
|
rows.forEach(row => {
|
|
|
nextTick(() => {
|
|
|
- dialogTableRef1.value?.toggleRowSelection(row, true);
|
|
|
+ dialogTableRef1.value?.toggleRowSelection(row, true)
|
|
|
})
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
- dialogTableRef1.value?.clearSelection();
|
|
|
+ dialogTableRef1.value?.clearSelection()
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -345,12 +350,12 @@ const savefileSubmit = async () => {
|
|
|
|
|
|
//关联试验文件
|
|
|
const savesubmitRelationFile = async (ids) => {
|
|
|
- const {error, code, data} = await samplingApi.submitRelationFile({
|
|
|
+ const { error, code, data } = await samplingApi.submitRelationFile({
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
nodeId: isPrimaryKeyId.value,
|
|
|
type: fileModalradio.value,
|
|
|
- ids
|
|
|
+ ids,
|
|
|
})
|
|
|
if (!error && code === 200) {
|
|
|
window?.$message?.success('操作成功')
|
|
@@ -359,7 +364,7 @@ const savesubmitRelationFile = async (ids) => {
|
|
|
|
|
|
// 暴露出去
|
|
|
defineExpose({
|
|
|
- savefileSubmit
|
|
|
+ savefileSubmit,
|
|
|
})
|
|
|
</script>
|
|
|
|