ZaiZai 1 жил өмнө
parent
commit
545d58e122

+ 119 - 0
src/views/tentative/material/modules/testSample/tested.vue

@@ -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>

+ 3 - 1
src/views/tentative/material/testSample.vue

@@ -9,6 +9,7 @@
         <hc-tab-card :tabs="tabsData" :tab-key="tabsKey" @change="tabsChange">
             <SampleFlow v-if="tabsKey === 'flow'" :tree="treeInfo" />
             <SampleInventory v-if="tabsKey === 'inventory'" :tree="treeInfo" />
+            <SampleTested v-if="tabsKey === 'tested'" :tree="treeInfo" />
         </hc-tab-card>
     </hc-body>
 </template>
@@ -21,6 +22,7 @@ import { getObjValue } from 'js-fast-way'
 import TestTree from './components/TestTree.vue'
 import SampleFlow from './modules/testSample/flow.vue'
 import SampleInventory from './modules/testSample/inventory.vue'
+import SampleTested from './modules/testSample/tested.vue'
 
 //变量
 const store = useAppStore()
@@ -48,7 +50,7 @@ const wbsElTreeClick = ({ data, keys }) => {
 }
 
 //选项卡卡片
-const tabsKey = ref('inventory')
+const tabsKey = ref('tested')
 const tabsData = ref([
     { key: 'flow', name: '样品流转' },
     { key: 'inventory', name: '样品库存' },