ZaiZai 1 year ago
parent
commit
51ba371c55

+ 20 - 0
src/router/modules/base.js

@@ -264,6 +264,12 @@ export default [
                 redirect: '/tentative/detect/approach',
                 meta: { title: '试验检测' },
                 children: [
+                    {
+                        path: '/tentative/detect/commission',
+                        name: 'tentative-detect-commission',
+                        meta: { title: '委托单管理' },
+                        component: () => import('~src/views/tentative/detect/commission.vue'),
+                    },
                     {
                         path: '/tentative/detect/third',
                         name: 'tentative-detect-third',
@@ -290,6 +296,20 @@ export default [
                     },
                 ],
             },
+            {
+                path: '/tentative/acquisition',
+                name: 'tentative-acquisition',
+                redirect: '/tentative/acquisition/data',
+                meta: { title: '物联网采集' },
+                children: [
+                    {
+                        path: '/tentative/acquisition/data',
+                        name: 'tentative-acquisition-data',
+                        meta: { title: '数据采集' },
+                        component: () => import('~src/views/tentative/acquisition/data.vue'),
+                    },
+                ],
+            },
             {
                 path: '/tentative/collect',
                 name: 'tentative-collect',

+ 2 - 2
src/views/login/new.vue

@@ -4,14 +4,14 @@
         <div class="hc-new-login-main hc-full hc-flex-center">
             <div class="hc-new-login-content relative mt-30 w-[985px]">
                 <div class="app-title mb-8 text-center text-[34px] text-white">重庆市交通规划和技术发展中心 (重庆市交通工程档案馆)</div>
-                <div class="hc-new-login-form-card bg-white p-6 flex">
+                <div class="hc-new-login-form-card flex bg-white p-6">
                     <div class="form-left relative flex-1">
                         <img class="form-logo w-[117px]" :src="logoPng" alt="bg">
                         <img class="form-img" :src="imgPng" alt="bg">
                     </div>
                     <div class="form-right relative flex-1">
                         <div class="form-main">
-                            <div class="title font-bold text-center text-[24px]">登&nbsp;&nbsp;录</div>
+                            <div class="title text-center text-[24px] font-bold">登&nbsp;&nbsp;录</div>
                             <el-form ref="formRef" :model="formValue" :rules="formRules" label-position="left" label-width="0px" size="large">
                                 <el-form-item prop="tenantId">
                                     <el-input v-model="formValue.tenantId" clearable placeholder="请输入区域号">

+ 11 - 0
src/views/tentative/acquisition/data.vue

@@ -0,0 +1,11 @@
+<template>
+    <div>数据采集</div>
+</template>
+
+<script setup>
+
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 218 - 0
src/views/tentative/detect/commission.vue

@@ -0,0 +1,218 @@
+<template>
+    <hc-body split :project-nmae="projectInfo?.projectName">
+        <template #tree>
+            <TestTree
+                :auto-expand-keys="treeAutoExpandKeys" :project-id="projectId" :tenant-id="userInfo?.tenant_id"
+                :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial" :wbs-type="2" @node-tap="wbsElTreeClick"
+            />
+        </template>
+        <hc-new-card w-to="1919">
+            <template #headerToSearch>
+                <div class="w-50">
+                    <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-40">
+                    <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 #extraToHeader>
+                <el-button hc-btn type="primary" @click="addFormData">
+                    <hc-icon name="add-circle" />
+                    <span>新增</span>
+                </el-button>
+                <el-button v-del-com:[delModalClick] :disabled="tableCheckedKeys.length <= 0" hc-btn type="danger">
+                    <hc-icon name="delete-bin-2" />
+                    <span>删除</span>
+                </el-button>
+                <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn color="#567722">
+                    <hc-icon name="printer" />
+                    <span>批量打印</span>
+                </el-button>
+                <el-button :disabled="tableCheckedKeys.length <= 0" class="text-white" hc-btn color="#FF976A">
+                    <HcIcon name="send-plane-2" />
+                    <span>上报</span>
+                </el-button>
+                <el-button hc-btn color="#567722">
+                    <hc-icon name="printer" />
+                    <span>打印空表</span>
+                </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 #key5="{ row }">
+                    <el-tag v-if="row.key5 === 1" type="info" effect="dark">未上报</el-tag>
+                    <el-tag v-if="row.key5 === 2" type="warning" effect="dark">已上报-待审批</el-tag>
+                    <el-tag v-if="row.key5 === 3" type="primary" effect="dark">待试验</el-tag>
+                    <el-tag v-if="row.key5 === 4" type="success" effect="dark">委托完成</el-tag>
+                </template>
+                <template #action="{ row }">
+                    <el-link v-if="row.key5 === 1" type="primary" @click="rowEdit(row)">修改</el-link>
+                    <el-link v-else type="success" @click="rowView(row)">查看</el-link>
+                    <el-link type="danger" :disabled="row.key5 !== 1" @click="rowReports(row)">创建报告</el-link>
+                </template>
+            </hc-table>
+            <template #action>
+                <hc-pages :pages="searchForm" @change="pageChange" />
+            </template>
+        </hc-new-card>
+
+        <!-- 新增委托 -->
+        <hc-new-dialog v-model="delegateModal" is-footer-center is-table title="新增委托" widths="60rem" @close="delegateModalClose">
+            html表单
+            <template #footer>
+                <el-button @click="delegateModalClose">取消</el-button>
+                <el-button hc-btn type="warning" @click="linkSamplingShow">关联取样材料</el-button>
+                <el-button hc-btn type="primary" @click="creatingDelegate">创建</el-button>
+            </template>
+        </hc-new-dialog>
+
+        <!-- 关联取样材料 -->
+        <hc-new-dialog v-model="linkSamplingModal" is-footer-center is-table title="关联取样材料" widths="80%" @close="linkSamplingClose">
+            <SamplingPage />
+            <template #footer>
+                <el-button @click="linkSamplingClose">取消</el-button>
+                <el-button hc-btn type="primary" @click="linkSamplingClick">确定</el-button>
+            </template>
+        </hc-new-dialog>
+    </hc-body>
+</template>
+
+<script setup>
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import TestTree from '~src/views/tentative/material/components/TestTree.vue'
+import SamplingPage from './commission/sampling.vue'
+
+//变量
+const useAppState = useAppStore()
+const userInfo = ref(useAppState.getUserInfo)
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+
+//渲染完成
+onMounted(() => {
+
+})
+
+//搜索表单
+const searchForm = ref({ current: 1, size: 20, total: 0 })
+
+//自动展开缓存
+const treeAutoExpandKeys = ref(getStoreValue('testTreeExpandKeys') || [])
+
+//树被点击
+const nodeDataInfo = ref({})
+const wbsElTreeClick = ({ data, keys }) => {
+    nodeDataInfo.value = data
+    //缓存自动展开
+    treeAutoExpandKeys.value = keys
+    setStoreValue('testTreeExpandKeys', keys)
+}
+
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1
+    getTableData()
+}
+
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableData = ref([
+    { key5:1 }, { key5:2 }, { key5:3 }, { key5:4 },
+])
+const tableColumn = ref([
+    { key: 'key1', name: '委托单位' },
+    { key: 'key2', name: '委托单编号' },
+    { key: 'key3', name: '委托单名称' },
+    { key: 'key4', name: '关联材料名称' },
+    { key: 'key5', name: '委托单状态', width: 120, align: 'center' },
+    { key: 'action', name: '操作', width: 120, align: 'center' },
+])
+
+//获取数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+
+}
+
+//多选
+const tableCheckedKeys = ref([])
+const tableSelection = (rows) => {
+    tableCheckedKeys.value = rows
+}
+
+//删除
+const delModalClick = async (_, resolve) => {
+    resolve()
+}
+
+//新增
+const delegateModal = ref(false)
+const addFormData = () => {
+    delegateModal.value = true
+}
+
+//修改
+const rowEdit = (row) => {
+    delegateModal.value = true
+}
+
+//创建委托
+const creatingDelegate = async () => {
+    delegateModalClose()
+}
+
+//关闭委托
+const delegateModalClose = () => {
+    delegateModal.value = false
+}
+
+//关联取样材料
+const linkSamplingModal = ref(false)
+const linkSamplingShow = () => {
+    linkSamplingModal.value = true
+}
+
+//确认关联取样材料
+const linkSamplingClick = () => {
+    linkSamplingClose()
+}
+
+//取消关联取样材料
+const linkSamplingClose = () => {
+    linkSamplingModal.value = false
+}
+
+//查看
+const rowView = (row) => {
+
+}
+
+//创建报告
+const rowReports = (row) => {
+
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 110 - 0
src/views/tentative/detect/commission/sampling.vue

@@ -0,0 +1,110 @@
+<template>
+    <hc-body split :project-nmae="projectInfo?.projectName">
+        <template #tree>
+            <TestTree
+                :auto-expand-keys="treeAutoExpandKeys" :project-id="projectId" :tenant-id="userInfo?.tenant_id"
+                :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial" :wbs-type="2" @node-tap="wbsElTreeClick"
+            />
+        </template>
+        <hc-new-card>
+            <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }">
+                <template #action="{ row }">
+                    <el-link v-if="row.id === 1" type="primary" @click="rowSelect(row)">选择</el-link>
+                    <el-link v-else type="success" @click="rowCancel(row)">取消选择</el-link>
+                </template>
+            </hc-table>
+            <template #action>
+                <hc-pages :pages="searchForm" @change="pageChange" />
+            </template>
+        </hc-new-card>
+    </hc-body>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { useAppStore } from '~src/store'
+import TestTree from '~src/views/tentative/material/components/TestTree.vue'
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
+import samplingApi from '~api/tentative/material/sampling'
+import { getArrValue } from 'js-fast-way'
+
+//事件
+const emit = defineEmits(['change'])
+//变量
+const useAppState = useAppStore()
+const userInfo = ref(useAppState.getUserInfo)
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const projectInfo = ref(useAppState.getProjectInfo)
+
+//自动展开缓存
+const treeAutoExpandKeys = ref(getStoreValue('testTreeExpandKeys') || [])
+
+//搜索表单
+const searchForm = ref({ current: 1, size: 20, total: 0 })
+
+//树被点击
+const nodeDataInfo = ref({})
+const wbsElTreeClick = ({ data, keys }) => {
+    nodeDataInfo.value = data
+    //缓存自动展开
+    treeAutoExpandKeys.value = keys
+    setStoreValue('testTreeExpandKeys', keys)
+    //改变搜索表单数据
+    searchForm.value.nodeId = data['primaryKeyId'] || ''
+    searchForm.value.current = 1
+    getTableData()
+}
+
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableColumn = ref([
+    { key: 'materialName', name: '取样名称' },
+    { key: 'samplingDate', name: '取样日期' },
+    { key: 'specificationNumber', name: '样品编号' },
+    { key: 'specificationModel', name: '规格型号' },
+    { key: 'materialCount', name: '试样数量' },
+    { key: 'calculationUnit', name: '计算单位' },
+    { key: 'proposedPosition', name: '拟用部位' },
+    { key: 'representativeCount', name: '代表数量' },
+    { key: 'userName', name: '取样人' },
+    { key: 'action', name: '操作', width: 100, align: 'center' },
+])
+
+//获取数据
+const tableLoading = ref(false)
+const tableData = ref([])
+const getTableData = async () => {
+    tableLoading.value = true
+    const { error, code, data } = await samplingApi.queryPage({
+        projectId: projectId.value,
+        contractId: contractId.value,
+        ...searchForm.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 rowSelect = (row) => {
+    emit('change', { type: 1, data: row })
+}
+
+//取消选择
+const rowCancel = (row) => {
+    emit('change', { type: 0, data: row })
+}
+</script>

+ 4 - 4
src/views/tentative/detect/test.vue

@@ -8,7 +8,7 @@
                 <div class="hc-project-icon-box">
                     <HcIcon name="stack" />
                 </div>
-                <div class="ml-2 project-name-box">
+                <div class="project-name-box ml-2">
                     <div class="project-alias">{{ projectInfo.projectName }}</div>
                 </div>
             </div>
@@ -109,7 +109,7 @@
                             @keyup="keyUpEvent"
                         />
                     </div>
-                    <div class="w-40 ml-2">
+                    <div class="ml-2 w-40">
                         <el-select v-model="searchForm.queryStatus" clearable placeholder="请选择是否合格">
                             <el-option
                                 v-for="item in qualifiedData" :key="item.value" :label="item.label"
@@ -117,10 +117,10 @@
                             />
                         </el-select>
                     </div>
-                    <div class="w-64 ml-2">
+                    <div class="ml-2 w-64">
                         <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
                     </div>
-                    <div class="w-72 ml-2">
+                    <div class="ml-2 w-72">
                         <el-input
                             v-model="searchForm.queryValue" clearable placeholder="请输入项目名称关键字"
                             @keyup="keyUpEvent"

+ 1 - 1
src/views/tentative/material/sampling.vue

@@ -235,7 +235,7 @@
 
         <!-- 创建委托 -->
         <hc-new-dialog v-model="delegateModal" is-footer-center is-table title="创建委托" widths="60rem" @close="delegateModalClose">
-            11231233
+            html表单
             <template #footer>
                 <el-button @click="delegateModalClose">取消</el-button>
                 <el-button hc-btn type="primary" @click="creatingDelegate">创建</el-button>