Browse Source

资料填报-根节点菜单添加

duy 2 weeks ago
parent
commit
65c303369e
2 changed files with 90 additions and 34 deletions
  1. 1 1
      public/version.json
  2. 89 33
      src/views/data-fill/wbs.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20251124110241"
+  "value": "20251202180827"
 }

+ 89 - 33
src/views/data-fill/wbs.vue

@@ -143,17 +143,8 @@
                                 class="scroll-bar-right-16"
                             >
                                 <HcDataTree
-                                    :is-show-collect="true"
-                                    :is-show-eye="classType === '1'"
-                                    :datas="searchTreeData"
-                                    :is-mark="TreeMark"
-                                    :menus="ElTreeMenu"
-                                   
-
-                                    is-type
-                                    :auto-expand-keys="TreeAutoExpandKeys"
-                                    
-                                    is-counts default-expand-all is-form-date 
+                                    :is-show-collect="true" :is-show-eye="classType === '1'" :datas="searchTreeData" :is-mark="TreeMark" :menus="ElTreeMenu" is-type
+                                    :auto-expand-keys="TreeAutoExpandKeys" is-counts default-expand-all is-form-date :root-menu="rootMenu"
                                     :is-show-sync="userInfo?.role_id?.split(',').includes('1123598816738675201')"
                                     @node-tap="wbsElTreeClick"
                                     @menu-tap="ElTreeMenuClick"
@@ -170,21 +161,10 @@
                                     :is-show-collect="true"
                                     :is-show-eye="classType === '1'"
                                     :is-show-sync="userInfo?.role_id?.split(',').includes('1123598816738675201')"
-                                    is-form-date
-                               
-                                    :auto-expand-keys="TreeAutoExpandKeys"
-                                    :is-mark="TreeMark"
-                                    :menus="ElTreeMenu"
-                                    is-counts
-                                    is-type
-                                    show-checkbox
-                                    check-strictly
-                                    @load="treeLoadNode"
-                                    @menu-tap="ElTreeMenuClick"
-                                    @node-loading="ElTreeNodeLoading"
-                                    @node-tap="wbsElTreeClick"
-                                    @check="ElTreeNodeCheck"
-                                    @collect="collectClick"
+                                    is-form-date :auto-expand-keys="TreeAutoExpandKeys" :is-mark="TreeMark"
+                                    :menus="ElTreeMenu" :root-menu="rootMenu" is-counts is-type show-checkbox check-strictly
+                                    @load="treeLoadNode" @menu-tap="ElTreeMenuClick" @node-loading="ElTreeNodeLoading"
+                                    @node-tap="wbsElTreeClick" @check="ElTreeNodeCheck" @collect="collectClick"
                                     @eye="eyeClick"
                                 />
                             </el-scrollbar>
@@ -1873,15 +1853,12 @@ const NodeTreeAccordion = ref(true)
 
 //设置树菜单数据
 const ElTreeMenu = ref([])
+const rootMenu = ref([])
 const TreeMark = ref(false)
 const setElTreeMenu = (contractType) => {
- 
-    
-    let newArr = []
-    if (contractType == 1 && contractInfo.value?.contractType !== 2) {
-
- 
-  
+    console.log(123, contractType, contractInfo.value?.contractType)
+    let newArr = [], rootNewArr = []
+    if (contractType === '1' && contractInfo.value?.contractType !== 2) {
         if (HcIsButton('wbs_tree_add')) {
             newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
             newArr.push({
@@ -1894,6 +1871,18 @@ const setElTreeMenu = (contractType) => {
                 label: '自定义节点(数字化文件)',
                 key: 'add2',
             })
+            rootNewArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
+            rootNewArr.push({
+                icon: 'add-circle',
+                label: '自定义节点(水利工程)',
+                key: 'add1',
+            })
+            rootNewArr.push({
+                icon: 'add-circle',
+                label: '自定义节点(数字化文件)',
+                key: 'add2',
+            })
+
         }
         if (HcIsButton('wbs_tree_edit')) {
             newArr.push({ icon: 'draft', label: '编辑节点', key: 'edit' })
@@ -1953,6 +1942,73 @@ const setElTreeMenu = (contractType) => {
             })
         }
 
+    ElTreeMenu.value = newArr
+    rootMenu.value = rootNewArr
+}
+
+
+// 批量导入资料-台账记录
+const batchImportVisible = ref(false)
+const IMPORT_STATUS = {
+    0: '未开始',
+    1: '进行中',
+    2: '成功',
+    3: '失败',
+}
+const batchImportData = ref([])
+const batchImportParams = ref({
+    size: 20,
+    current: 1,
+    contractId: contractId.value, //合同段ID, 必填
+    classify: '', //所属方,1:施工, 2:监理    
+    startTime: '', //开始时间
+    endTime: '', //截止时间
+    fileName: '', //文件名
+    status: '', //	状态,0:未开始, 1:进行中, 2:成功, 3:失败	
+    userId: '', //操作人ID
+})
+const createUserList = ref([])
+
+
+const getCreateUserList = async () => {
+    const { error, code, data } = await wbsApi.getBatchImportRecordUsers({ contractId: contractId.value })
+    if (!error && code === 200) {
+        createUserList.value = data || []
+    }
+}
+
+//日期时间被选择
+const betweenTime = ref(null)
+const betweenTimeUpdate = ({ arr }) => {
+    betweenTime.value = arr
+    batchImportParams.value.startTime = arr[0]
+    batchImportParams.value.endTime = arr[1]
+}
+
+const batchImportRecordClick = async () => {
+    await getCreateUserList()
+    batchImportVisible.value = true
+    await getBatchImportRecord()
+}
+
+const pageChange = async ({ current, size }) => {
+    batchImportParams.value.current = current
+    batchImportParams.value.size = size
+    await getBatchImportRecord()
+}
+
+const getBatchImportRecord = async () => {
+    // 1. 过滤空值
+    const params = Object.fromEntries(
+        Object.entries(batchImportParams.value).filter(([, v]) =>
+            v !== '' && v !== null && v !== undefined,
+        ),
+    )
+    const { error, code, data } = await wbsApi.getBatchImportRecord(params)
+
+    if (!error && code === 200) {
+        batchImportData.value.table = data?.records
+        batchImportData.value.total = data?.total
     }
     ElTreeMenu.value = newArr