|
@@ -12,13 +12,7 @@
|
|
|
</div>
|
|
|
<div class="hc-tree-box">
|
|
|
<el-scrollbar>
|
|
|
- <HcTreeData :autoExpandKeys="treeAutoExpandKeys"
|
|
|
- :projectId="projectId"
|
|
|
- :contractId="contractId"
|
|
|
- type="leftTree"
|
|
|
- @nodeTap="wbsElTreeClick"
|
|
|
- @menuTap="ElTreeMenuClick"
|
|
|
- />
|
|
|
+ <HcTreeData :autoExpandKeys="thirdTreeKeys" :projectId="projectId" :contractId="contractId" type="leftTree" @nodeTap="wbsElTreeClick"/>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<!--左右拖动-->
|
|
@@ -54,12 +48,10 @@
|
|
|
</template>
|
|
|
<template #search>
|
|
|
<div class="w-40">
|
|
|
- <el-select v-model="searchForm.user" placeholder="请选择送样人员" clearable>
|
|
|
- <el-option v-for="item in userData" :key="item.value" :label="item['label']" :value="item['value']"/>
|
|
|
- </el-select>
|
|
|
+ <el-input v-model="searchForm.queryName" placeholder="送样人员" clearable/>
|
|
|
</div>
|
|
|
<div class="w-40 ml-2">
|
|
|
- <el-select v-model="searchForm.qualified" placeholder="请选择是否合格" clearable>
|
|
|
+ <el-select v-model="searchForm.queryStatus" placeholder="请选择是否合格" clearable>
|
|
|
<el-option v-for="item in qualifiedData" :key="item.value" :label="item['label']" :value="item['value']"/>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -83,15 +75,6 @@
|
|
|
</HcCard>
|
|
|
</div>
|
|
|
|
|
|
- <!--新增/编辑 节点-->
|
|
|
- <HcDialog :show="addEditNodeFormModal" title="新增/编辑 节点" widths="30rem" :loading="addEditNodeFormLoading" @save="addEditNodeFormModalSave" @close="addEditNodeFormModalClose">
|
|
|
- <el-form :model="addEditNodeFormModel" label-width="auto" label-position="top" size="large">
|
|
|
- <el-form-item class="mb-0" label="节点名称">
|
|
|
- <el-input v-model="addEditNodeFormModel.key1" placeholder="请输入节点名称"/>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </HcDialog>
|
|
|
-
|
|
|
<!--新增/编辑-->
|
|
|
<HcDialog :show="addEditFormModal" title="新增/编辑 外委试验信息" widths="70rem" isRowFooter :isClose="false" @close="addEditFormModalClose">
|
|
|
<template #extra>
|
|
@@ -247,7 +230,8 @@ import {ref, watch, onMounted} from "vue";
|
|
|
import {useAppStore} from "~src/store";
|
|
|
import HcTreeData from "./components/HcTreeData.vue"
|
|
|
import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
|
-import {HcIsButton} from "~src/plugins/IsButtons";
|
|
|
+import dataApi from "~api/tentative/detect/third";
|
|
|
+import {getArrValue} from "vue-utils-plus";
|
|
|
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
@@ -264,106 +248,50 @@ watch(() => [
|
|
|
})
|
|
|
|
|
|
//自动展开缓存
|
|
|
-const treeAutoExpandKeys = ref(getStoreData('wbsTreeExpandKeys') || [])
|
|
|
+const thirdTreeKeys = ref(getStoreData('thirdTreeKeys'))
|
|
|
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
- setElTreeMenu()
|
|
|
+ const keys = thirdTreeKeys.value
|
|
|
+ if (keys) {
|
|
|
+ searchForm.value.nodeId = keys
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
-const userData = ref([
|
|
|
- {label: 'xxx', value: '1'}
|
|
|
-])
|
|
|
-
|
|
|
+//是否合格
|
|
|
const qualifiedData = ref([
|
|
|
- {label: '是', value: '1'}
|
|
|
+ {label: '不合格', value: 0},
|
|
|
+ {label: '合格', value: 1}
|
|
|
])
|
|
|
|
|
|
//搜索表单
|
|
|
-const searchForm = ref({user: null, qualified: null, betweenTime: null, queryValue: null, current: 1, size: 20, total: 0})
|
|
|
-
|
|
|
-//树菜单配置
|
|
|
-const ElTreeMenu = ref([])
|
|
|
-const setElTreeMenu = () => {
|
|
|
- let newArr = [];
|
|
|
- if (HcIsButton('tentative_detect_third_tree_add')) {
|
|
|
- newArr.push({icon: 'add-circle', label: '新增节点', key: "add"})
|
|
|
- }
|
|
|
- if (HcIsButton('tentative_detect_third_tree_edit')) {
|
|
|
- newArr.push({icon: 'draft', label: '修改节点', key: "edit"})
|
|
|
- }
|
|
|
- if (HcIsButton('tentative_detect_third_tree_del')) {
|
|
|
- newArr.push({icon: 'delete-bin', label: '删除节点', key: "del"})
|
|
|
- }
|
|
|
- ElTreeMenu.value = newArr
|
|
|
-}
|
|
|
-
|
|
|
-//树相关的变量
|
|
|
-const primaryKeyId = ref('')
|
|
|
-const nodeItemInfo = ref({})
|
|
|
-const nodeDataInfo = ref({})
|
|
|
+const searchForm = ref({
|
|
|
+ queryName: null, queryStatus: null, queryValue: null, startTime: null, endTime: null,
|
|
|
+ current: 1, size: 20, total: 0
|
|
|
+})
|
|
|
|
|
|
//树被点击
|
|
|
-const wbsElTreeClick = ({node, data, keys}) => {
|
|
|
+const nodeItemInfo = ref({})
|
|
|
+const wbsElTreeClick = ({node, keys}) => {
|
|
|
nodeItemInfo.value = node
|
|
|
- nodeDataInfo.value = data
|
|
|
- primaryKeyId.value = data['primaryKeyId'] || ''
|
|
|
//缓存自动展开
|
|
|
- treeAutoExpandKeys.value = keys
|
|
|
- setStoreData('wbsTreeExpandKeys',keys)
|
|
|
+ thirdTreeKeys.value = keys
|
|
|
+ setStoreData('thirdTreeKeys',keys)
|
|
|
//改变搜索表单数据
|
|
|
- //searchForm.value.wbsId = data['contractIdRelation'] ? data['id'] : data['primaryKeyId']
|
|
|
- //searchForm.value.contractIdRelation = data['contractIdRelation']
|
|
|
+ searchForm.value.nodeId = keys
|
|
|
searchForm.value.current = 1;
|
|
|
getTableData()
|
|
|
}
|
|
|
|
|
|
-//树菜单被点击
|
|
|
-const ElTreeMenuClick = async ({key,node,data}) => {
|
|
|
- nodeItemInfo.value = node
|
|
|
- nodeDataInfo.value = data
|
|
|
- if (key === 'add') {
|
|
|
- addEditNodeFormModal.value = true
|
|
|
- } else if (key === 'edit') {
|
|
|
- addEditNodeFormModal.value = true
|
|
|
- } else if (key === 'del') {
|
|
|
- delNodeModalClick()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-//新增/编辑 节点
|
|
|
-const addEditNodeFormModal = ref(false)
|
|
|
-const addEditNodeFormModel = ref({key1: ''})
|
|
|
-//保存节点信息
|
|
|
-const addEditNodeFormLoading = ref(false)
|
|
|
-const addEditNodeFormModalSave = () => {
|
|
|
- addEditNodeFormModal.value = false
|
|
|
-}
|
|
|
-//关闭节点编辑弹窗
|
|
|
-const addEditNodeFormModalClose = () => {
|
|
|
- addEditNodeFormModal.value = false
|
|
|
-}
|
|
|
-
|
|
|
-//删除节点
|
|
|
-const delNodeModalClick = () => {
|
|
|
- window?.$messageBox?.alert('请谨慎考虑后,确认是否需要删除?', '删除提醒', {
|
|
|
- showCancelButton: true,
|
|
|
- confirmButtonText: '确认删除',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- callback: (action) => {
|
|
|
- if (action === 'confirm') {
|
|
|
- //removeContractTreeNode()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
//日期时间被选择
|
|
|
const betweenTime = ref(null)
|
|
|
-const betweenTimeUpdate = ({arr,query}) => {
|
|
|
+const betweenTimeUpdate = ({arr}) => {
|
|
|
betweenTime.value = arr
|
|
|
- searchForm.value.betweenTime = query
|
|
|
+ if (arr.length > 0) {
|
|
|
+ searchForm.value.startTime = arr[0]
|
|
|
+ searchForm.value.endTime = arr[1]
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//回车搜索
|
|
@@ -390,37 +318,47 @@ const pageChange = ({current, size}) => {
|
|
|
//表格数据
|
|
|
const tableRef = ref(null)
|
|
|
const tableColumn = ref([
|
|
|
- {key:'key1', name: '委托编号'},
|
|
|
- {key:'key2', name: '报告编号'},
|
|
|
- {key:'key3', name: '样品编号'},
|
|
|
+ {key:'entrustNo', name: '委托编号'},
|
|
|
+ {key:'reportNo', name: '报告编号'},
|
|
|
+ {key:'specificationNumber', name: '样品编号'},
|
|
|
{key:'key4', name: '试验类型'},
|
|
|
- {key:'key5', name: '样品名称'},
|
|
|
+ {key:'materialName', name: '样品名称'},
|
|
|
{key:'key6', name: '规格型号'},
|
|
|
- {key:'key7', name: '委托单位'},
|
|
|
- {key:'key8', name: '检测机构'},
|
|
|
- {key:'key9', name: '工程部位'},
|
|
|
+ {key:'entrustCompany', name: '委托单位'},
|
|
|
+ {key:'inspectionOrganization', name: '检测机构'},
|
|
|
+ {key:'projectPosition', name: '工程部位'},
|
|
|
{key:'key10', name: '送样人'},
|
|
|
- {key:'key11', name: '送样日期'},
|
|
|
- {key:'key12', name: '报告日期'},
|
|
|
- {key:'key13', name: '检测结果'},
|
|
|
- {key:'key14', name: '备注'},
|
|
|
+ {key:'sampleDeliveryDate', name: '送样日期'},
|
|
|
+ {key:'reportDate', name: '报告日期'},
|
|
|
+ {key:'testConclusionText', name: '检测结果'},
|
|
|
+ {key:'remarks', name: '备注'},
|
|
|
])
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
-const tableData = ref([
|
|
|
- {}
|
|
|
-])
|
|
|
const getTableData = async () => {
|
|
|
-
|
|
|
+ tableLoading.value = true
|
|
|
+ const { error, code, data } = await dataApi.queryPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data.total || 0
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//多选
|
|
|
const tableCheckedKeys = ref([]);
|
|
|
const tableSelection = (rows) => {
|
|
|
- tableCheckedKeys.value = rows.filter((item) => {
|
|
|
- return (item??'') !== '';
|
|
|
- })
|
|
|
+ tableCheckedKeys.value = rows
|
|
|
}
|
|
|
|
|
|
//新增/编辑
|