|
@@ -0,0 +1,119 @@
|
|
|
+<template>
|
|
|
+ <hc-card-item class="hc-test-sample-card-item">
|
|
|
+ <template #header>
|
|
|
+ <div class="w-200px">
|
|
|
+ <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable clearable block>
|
|
|
+ <el-option label="测试1" value="1" />
|
|
|
+ <el-option label="测试2" value="2" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="ml-2 w-250px">
|
|
|
+ <hc-search-input v-model="searchForm.queryValue" @search="searchClick" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #extra>
|
|
|
+ <el-button type="danger" :disabled="tableCheckedKeys.length <= 0" @click="batchCancel">批量取消待测</el-button>
|
|
|
+ </template>
|
|
|
+ <hc-table
|
|
|
+ :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
|
|
|
+ :index-style="{ width: 60 }" :check-style="{ width: 29 }" @selection-change="tableSelection"
|
|
|
+ >
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-link type="primary" @click="rowReports(row)">创建报告</el-link>
|
|
|
+ <el-link type="danger" @click="rowCancel(row)">取消待测</el-link>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
+ <template #action>
|
|
|
+ <hc-pages :pages="searchForm" @change="pageChange" />
|
|
|
+ </template>
|
|
|
+ </hc-card-item>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { getObjValue } from 'js-fast-way'
|
|
|
+
|
|
|
+//参数
|
|
|
+const props = defineProps({
|
|
|
+ tree: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+//变量
|
|
|
+const store = useAppStore()
|
|
|
+const projectId = ref(store.getProjectId)
|
|
|
+const contractId = ref(store.getContractId)
|
|
|
+
|
|
|
+//渲染完成
|
|
|
+onMounted(() => {
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
+//监听数据
|
|
|
+const treeInfo = ref({})
|
|
|
+watch(() => props.tree, (obj) => {
|
|
|
+ treeInfo.value = getObjValue(obj)
|
|
|
+})
|
|
|
+
|
|
|
+//搜索表单
|
|
|
+const searchForm = ref({ current: 1, size: 20, total: 0 })
|
|
|
+
|
|
|
+//搜索
|
|
|
+const searchClick = () => {
|
|
|
+ searchForm.value.current = 1
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+//分页被点击
|
|
|
+const pageChange = ({ current, size }) => {
|
|
|
+ searchForm.value.current = current
|
|
|
+ searchForm.value.size = size
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+//表格数据
|
|
|
+const tableColumn = ref([
|
|
|
+ { key: 'key1', name: '取样名称' },
|
|
|
+ { key: 'key2', name: '规格型号', align: 'center' },
|
|
|
+ { key: 'key3', name: '试样数量', align: 'center' },
|
|
|
+ { key: 'key4', name: '计算单位', align: 'center' },
|
|
|
+ { key: 'key5', name: '拟用部位' },
|
|
|
+ { key: 'key6', name: '代表数量', align: 'center' },
|
|
|
+ { key: 'key7', name: '取样人', align: 'center' },
|
|
|
+ { key: 'key8', name: '待测时间', align: 'center' },
|
|
|
+ { key: 'action', name: '操作', width: 150, align: 'center' },
|
|
|
+])
|
|
|
+const tableData = ref([
|
|
|
+ {},
|
|
|
+])
|
|
|
+
|
|
|
+//获取表格数据
|
|
|
+const tableLoading = ref(false)
|
|
|
+const getTableData = async () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//多选
|
|
|
+const tableCheckedKeys = ref([])
|
|
|
+const tableSelection = (rows) => {
|
|
|
+ tableCheckedKeys.value = rows
|
|
|
+}
|
|
|
+
|
|
|
+//创建报告
|
|
|
+const rowReports = (row) => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//取消待测
|
|
|
+const rowCancel = (row) => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//批量取消待测
|
|
|
+const batchCancel = () => {
|
|
|
+
|
|
|
+}
|
|
|
+</script>
|