|
@@ -28,7 +28,8 @@
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import { getErtractInfo } from '~api/other'
|
|
import { getErtractInfo } from '~api/other'
|
|
-import { getArrValue, getObjValue } from 'js-fast-way'
|
|
|
|
|
|
+import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
+import mainApi from '~api/tentative/material/testSample'
|
|
|
|
|
|
//参数
|
|
//参数
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -64,13 +65,17 @@ const getContractData = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
//监听数据
|
|
//监听数据
|
|
-const treeInfo = ref({})
|
|
|
|
|
|
+const treeInfo = ref(props.tree)
|
|
watch(() => props.tree, (obj) => {
|
|
watch(() => props.tree, (obj) => {
|
|
treeInfo.value = getObjValue(obj)
|
|
treeInfo.value = getObjValue(obj)
|
|
|
|
+ searchClick()
|
|
})
|
|
})
|
|
|
|
|
|
//搜索表单
|
|
//搜索表单
|
|
-const searchForm = ref({ current: 1, size: 20, total: 0 })
|
|
|
|
|
|
+const searchForm = ref({
|
|
|
|
+ status: 6, startTime: null, endTime: null, materialName: null,
|
|
|
|
+ current: 1, size: 20, total: 0,
|
|
|
|
+})
|
|
|
|
|
|
//日期时间被选择
|
|
//日期时间被选择
|
|
const betweenTime = ref(null)
|
|
const betweenTime = ref(null)
|
|
@@ -80,8 +85,8 @@ const betweenTimeUpdate = ({ arr }) => {
|
|
searchForm.value.startTime = arr[0]
|
|
searchForm.value.startTime = arr[0]
|
|
searchForm.value.endTime = arr[1]
|
|
searchForm.value.endTime = arr[1]
|
|
} else {
|
|
} else {
|
|
- searchForm.value.startTime = ''
|
|
|
|
- searchForm.value.endTime = ''
|
|
|
|
|
|
+ searchForm.value.startTime = null
|
|
|
|
+ searchForm.value.endTime = null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -100,31 +105,46 @@ const pageChange = ({ current, size }) => {
|
|
|
|
|
|
//表格数据
|
|
//表格数据
|
|
const tableColumn = ref([
|
|
const tableColumn = ref([
|
|
- { key: 'key1', name: '取样名称' },
|
|
|
|
- { key: 'key2', name: '规格型号', align: 'center' },
|
|
|
|
- { key: 'key3', name: '试样数量', align: 'center' },
|
|
|
|
- { key: 'key4', name: '试验数量', align: 'center' },
|
|
|
|
|
|
+ { key: 'materialName', name: '样品名称' },
|
|
|
|
+ { key: 'specificationModel', name: '规格型号', align: 'center' },
|
|
|
|
+ { key: 'materialCount', name: '试样数量', align: 'center' },
|
|
|
|
+ { key: 'expCount', name: '试验数量', align: 'center' },
|
|
{ key: 'key5', name: '废除数量', align: 'center' },
|
|
{ key: 'key5', name: '废除数量', align: 'center' },
|
|
- { key: 'key6', name: '计算单位', align: 'center' },
|
|
|
|
- { key: 'key7', name: '拟用部位' },
|
|
|
|
- { key: 'key8', name: '代表数量', align: 'center' },
|
|
|
|
- { key: 'key9', name: '委托上报时间', align: 'center' },
|
|
|
|
- { key: 'key9', name: '入库时间', align: 'center' },
|
|
|
|
- { key: 'key9', name: '创建试验时间', align: 'center' },
|
|
|
|
|
|
+ { key: 'calculationUnit', name: '计算单位', align: 'center' },
|
|
|
|
+ { key: 'proposedPosition', name: '拟用部位' },
|
|
|
|
+ { key: 'representativeCount', name: '代表数量', align: 'center' },
|
|
|
|
+ { key: 'entrustTime', name: '委托上报时间', align: 'center' },
|
|
|
|
+ { key: 'carryTime', name: '入库时间', align: 'center' },
|
|
|
|
+ { key: 'createTime', name: '创建试验时间', align: 'center' },
|
|
{ key: 'key9', name: '是否留样', align: 'center' },
|
|
{ key: 'key9', name: '是否留样', align: 'center' },
|
|
- { key: 'key9', name: '留样时间', align: 'center' },
|
|
|
|
- { key: 'key9', name: '废除时间', align: 'center' },
|
|
|
|
- { key: 'key9', name: '废除原因', align: 'center' },
|
|
|
|
|
|
+ { key: 'resamTime', name: '留样时间', align: 'center' },
|
|
|
|
+ { key: 'repealTime', name: '废除时间', align: 'center' },
|
|
|
|
+ { key: 'repealReason', name: '废除原因', align: 'center' },
|
|
{ key: 'action', name: '操作', width: 100, align: 'center', fixed: 'right' },
|
|
{ key: 'action', name: '操作', width: 100, align: 'center', fixed: 'right' },
|
|
])
|
|
])
|
|
-const tableData = ref([
|
|
|
|
- {},
|
|
|
|
-])
|
|
|
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
//获取表格数据
|
|
//获取表格数据
|
|
const tableLoading = ref(false)
|
|
const tableLoading = ref(false)
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
-
|
|
|
|
|
|
+ const { primaryKeyId } = treeInfo.value
|
|
|
|
+ if (isNullES(primaryKeyId)) return
|
|
|
|
+ tableLoading.value = true
|
|
|
|
+ const { error, code, data } = await mainApi.queryPage({
|
|
|
|
+ ...searchForm.value,
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ nodeId: primaryKeyId || '',
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ 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
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//查看报告
|
|
//查看报告
|