|
@@ -15,13 +15,13 @@
|
|
|
<div v-loading="treeLoading" class="hc-tree-box" element-loading-text="加载中...">
|
|
|
<el-scrollbar>
|
|
|
<HcTree
|
|
|
- ref="treeRef"
|
|
|
- :project-id="projectId"
|
|
|
- :contract-id="contractId"
|
|
|
- :auto-expand-keys="treeAutoExpandKeys"
|
|
|
+ ref="treeRef"
|
|
|
+ :project-id="projectId"
|
|
|
+ :contract-id="contractId"
|
|
|
+ :auto-expand-keys="treeAutoExpandKeys"
|
|
|
:menus="ElTreeMenu"
|
|
|
- @nodeTap="projectTreeClick"
|
|
|
- @nodeLoading="treeNodeLoading"
|
|
|
+ @nodeTap="projectTreeClick"
|
|
|
+ @nodeLoading="treeNodeLoading"
|
|
|
@menuTap="ElTreeMenuClick"
|
|
|
/>
|
|
|
</el-scrollbar>
|
|
@@ -57,7 +57,7 @@
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="file_collection_btn_report">
|
|
|
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0">
|
|
|
+ <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="reportModalClick">
|
|
|
<HcIcon name="send-plane-2" />
|
|
|
<span>上报</span>
|
|
|
</el-button>
|
|
@@ -423,6 +423,9 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<HcUploadFile ref="HcUploadFileRef" :options="UploadFileOptions" @progress="HcUploadFileProgress" @success="HcUploadFileSuccess" @finish="HcUploadFileFinish" />
|
|
|
+
|
|
|
+ <!-- 批量编辑 -->
|
|
|
+ <HcReport :show="isReport" :data="reportData" @finish="reportFinish" @hide="isReport = false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -431,9 +434,9 @@ import { useAppStore } from '~src/store'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import { nextTick, onMounted, ref, watch } from 'vue'
|
|
|
import HcTree from '~src/components/tree/hc-tree.vue'
|
|
|
-import HcFileUpload1 from './components/HcFileUpload1.vue'
|
|
|
+import HcReport from './components/HcReport.vue'
|
|
|
import notableform from '~src/assets/view/notableform.svg'
|
|
|
-import { delMessage, rowsToId, rowsToIdNumArr } from '~uti/tools'
|
|
|
+import { rowsToId } from '~uti/tools'
|
|
|
import { delMessageV2 } from '~com/message/index.js'
|
|
|
import archiveFileApi from '~api/archiveFile/archiveFile'
|
|
|
import { arrKeySort, arrToId, deepClone, getArrValue, getObjVal } from 'js-fast-way'
|
|
@@ -446,7 +449,6 @@ const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
const projectInfo = ref(useAppState.getProjectInfo)
|
|
|
-const contractInfo = ref(useAppState.getContractInfo)
|
|
|
|
|
|
const isCollapse = ref(useAppState.getCollapse)
|
|
|
const HcUploadFileRef = ref(null)
|
|
@@ -454,6 +456,8 @@ const HcUploadFileRef = ref(null)
|
|
|
//上传进度
|
|
|
const uploadsLoading = ref(false)
|
|
|
|
|
|
+const treeRef = ref(null)
|
|
|
+
|
|
|
//监听
|
|
|
watch(() => [
|
|
|
useAppState.getCollapse,
|
|
@@ -479,25 +483,24 @@ const UploadFileOptions = {
|
|
|
headers: getTokenHeader(),
|
|
|
}
|
|
|
|
|
|
-const { contractType } = contractInfo.value
|
|
|
const dutyUser = ref('')
|
|
|
//设置责任者
|
|
|
const setdutyUser = async ()=>{
|
|
|
- const { error, code, data, msg } = await archiveFileApi.getDutyUser({
|
|
|
+ const { error, code, data } = await archiveFileApi.getDutyUser({
|
|
|
contractId: treecontractId.value,
|
|
|
projectId:projectId.value,
|
|
|
})
|
|
|
if (!error && code === 200) {
|
|
|
- if (data?.contractType === 1) {
|
|
|
+ if (data?.contractType === 1) {
|
|
|
dutyUser.value = data?.constructionUnitName || ''
|
|
|
- } else if (data?.contractType === 2) {
|
|
|
- dutyUser.value = data?.supervisionUnitName || ''
|
|
|
- } else if (data?.contractType === 3) {
|
|
|
- dutyUser.value = data?.contractorUnitName || ''
|
|
|
- }
|
|
|
+ } else if (data?.contractType === 2) {
|
|
|
+ dutyUser.value = data?.supervisionUnitName || ''
|
|
|
+ } else if (data?.contractType === 3) {
|
|
|
+ dutyUser.value = data?.contractorUnitName || ''
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
//打开文件选择框
|
|
|
const uploadFileClick = () => {
|
|
|
HcUploadFileRef?.value?.cancelUpload()
|
|
@@ -505,7 +508,7 @@ const uploadFileClick = () => {
|
|
|
}
|
|
|
|
|
|
// 文件上传进度
|
|
|
-const HcUploadFileProgress = ({ file, status }) => {
|
|
|
+const HcUploadFileProgress = () => {
|
|
|
uploadsLoading.value = true
|
|
|
}
|
|
|
// 文件上传成功的回调
|
|
@@ -513,38 +516,32 @@ const HcUploadFileSuccess = (res) => {
|
|
|
console.log('文件上传成功', res)
|
|
|
uploadsLoading.value = false
|
|
|
uploadsChange(res.id, res.resData)
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
//替换文件
|
|
|
const newHcUploadFileSuccess = (res, row) => {
|
|
|
let item = res.resData
|
|
|
- //更新数据
|
|
|
- row.fileName = item?.originalName
|
|
|
- row.ossFileName = item?.name || ''
|
|
|
- row.fileUrl = item?.link || ''
|
|
|
- row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
- row.filePage = item?.page || ''
|
|
|
- row.isUpdateUrl = 1
|
|
|
-
|
|
|
- //uploadsLoading.value = false
|
|
|
- // uploadsChange(res.resData)
|
|
|
+ //更新数据
|
|
|
+ row.fileName = item?.originalName
|
|
|
+ row.ossFileName = item?.name || ''
|
|
|
+ row.fileUrl = item?.link || ''
|
|
|
+ row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
+ row.filePage = item?.page || ''
|
|
|
+ row.isUpdateUrl = 1
|
|
|
}
|
|
|
|
|
|
// 文件全部上传成功
|
|
|
const HcUploadFileFinish = () => {
|
|
|
- uploadsLoading.value = false
|
|
|
+ uploadsLoading.value = false
|
|
|
HcUploadFileRef?.value.setModalShow(false)
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//树加载
|
|
|
const treeLoading = ref(false)
|
|
|
const treeNodeLoading = () => {
|
|
|
treeLoading.value = false
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const treePanelLoading = ref(false)
|
|
|
const panelTreeLoading = () => {
|
|
|
treePanelLoading.value = false
|
|
@@ -571,14 +568,13 @@ const searchForm = ref({
|
|
|
})
|
|
|
|
|
|
//树相关的变量
|
|
|
-const primaryKeyId = ref('')
|
|
|
const isBuiltDrawing = ref(0)
|
|
|
const isStorageNode = ref(0)
|
|
|
const nodeIds = ref('')
|
|
|
const treecontractId = ref('')
|
|
|
//自动展开缓存
|
|
|
const treeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
|
|
|
-const projectTreeClick = ({ node, data, keys, key }) => {
|
|
|
+const projectTreeClick = ({ data, keys }) => {
|
|
|
setStoreValue('wbsTreeExpandKeys', keys)
|
|
|
treeAutoExpandKeys.value = keys || []
|
|
|
nodeIds.value = data.id || ''
|
|
@@ -594,29 +590,27 @@ const projectTreeClick = ({ node, data, keys, key }) => {
|
|
|
getTableData()
|
|
|
}
|
|
|
//树菜单被点击
|
|
|
-const ElTreeMenuClick = async ({ key, node, data, keys }) => {
|
|
|
+const ElTreeMenuClick = async ({ data, keys }) => {
|
|
|
setStoreValue('wbsTreeExpandKeys', keys)
|
|
|
treeAutoExpandKeys.value = keys || []
|
|
|
- if (data?.extType === 2) {
|
|
|
- ElTreeMenu.value = [
|
|
|
- { icon: 'add-circle', label: '新增', key: 'add' },
|
|
|
- { icon: 'draft', label: '编辑', key: 'edit' },
|
|
|
- { icon: 'delete-bin', label: '删除', key: 'del' },
|
|
|
- { icon: 'refresh', label: '目录同步', key: 'sync' },
|
|
|
- { icon: 'refresh', label: '文件同步', key: 'fileSync' },
|
|
|
- { icon: 'sort-asc', label: '排序', key: 'sort' },
|
|
|
- ]
|
|
|
-
|
|
|
- } else {
|
|
|
- ElTreeMenu.value = [
|
|
|
- { icon: 'add-circle', label: '新增', key: 'add' },
|
|
|
- { icon: 'draft', label: '编辑', key: 'edit' },
|
|
|
- { icon: 'delete-bin', label: '删除', key: 'del' },
|
|
|
- { icon: 'refresh', label: '目录同步', key: 'sync' },
|
|
|
- { icon: 'sort-asc', label: '排序', key: 'sort' },
|
|
|
- ]
|
|
|
- }
|
|
|
-
|
|
|
+ if (data?.extType === 2) {
|
|
|
+ ElTreeMenu.value = [
|
|
|
+ { icon: 'add-circle', label: '新增', key: 'add' },
|
|
|
+ { icon: 'draft', label: '编辑', key: 'edit' },
|
|
|
+ { icon: 'delete-bin', label: '删除', key: 'del' },
|
|
|
+ { icon: 'refresh', label: '目录同步', key: 'sync' },
|
|
|
+ { icon: 'refresh', label: '文件同步', key: 'fileSync' },
|
|
|
+ { icon: 'sort-asc', label: '排序', key: 'sort' },
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ ElTreeMenu.value = [
|
|
|
+ { icon: 'add-circle', label: '新增', key: 'add' },
|
|
|
+ { icon: 'draft', label: '编辑', key: 'edit' },
|
|
|
+ { icon: 'delete-bin', label: '删除', key: 'del' },
|
|
|
+ { icon: 'refresh', label: '目录同步', key: 'sync' },
|
|
|
+ { icon: 'sort-asc', label: '排序', key: 'sort' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
//回车搜索
|
|
|
const keyUpEvent = (e) => {
|
|
@@ -739,37 +733,15 @@ const sortingNoneModalClose = ()=>{
|
|
|
const sortingItemData = ref([])
|
|
|
const sortingOldData = ref([])//旧数据,用来对比是否修改名字
|
|
|
|
|
|
-//获取数据
|
|
|
-const sortingItemLoading = ref(false)
|
|
|
-const getSortingItemData = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
//校验
|
|
|
const tableIsInput = (val, row, key) => {
|
|
|
- //console.log(!val);
|
|
|
//检测是否改过案卷名字
|
|
|
- if (key == 'isName') {
|
|
|
+ if (key === 'isName') {
|
|
|
row.isChange = true
|
|
|
}
|
|
|
-
|
|
|
row[key] = !val
|
|
|
}
|
|
|
|
|
|
-//选择文件
|
|
|
-// const sortingActiveKey = ref('')
|
|
|
-// const sortingSelectFile = (row, index) => {
|
|
|
-// //取当前展开组的key
|
|
|
-// const key = sortingActiveKey.value;
|
|
|
-// const keys = key ? key.split('-') : [];
|
|
|
-// const active = keys.length > 0 ? keys[1]: -1;
|
|
|
-// if (Number(active) === index) {
|
|
|
-// sortingActiveKey.value = null;
|
|
|
-// } else {
|
|
|
-// sortingActiveKey.value = `item-${index}`;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
const sortingActiveKey = ref([])
|
|
|
const tableIndex = ref('')
|
|
|
const sortingSelectFile = (row, index) => {
|
|
@@ -790,7 +762,6 @@ const sortingSelectFile = (row, index) => {
|
|
|
const sortingTableColumn = [
|
|
|
{ key:'name', name: '文件名称' },
|
|
|
]
|
|
|
-const sortingTableData = ref([])
|
|
|
|
|
|
//获取数据
|
|
|
const sortingTableLoading = ref(false)
|
|
@@ -808,11 +779,7 @@ const getSortingTableData = async (row, index) => {
|
|
|
sortingTableLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
row.list = getArrValue(data['records'])
|
|
|
-
|
|
|
- setTableCheck(row, index)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ setTableCheck(row, index).then()
|
|
|
} else {
|
|
|
row.list = []
|
|
|
}
|
|
@@ -823,30 +790,26 @@ const sorTableRef = ref([])
|
|
|
const tableindex = ref('')
|
|
|
//回显勾选
|
|
|
const setTableCheck = async (row, index) => {
|
|
|
- //console.log(row)
|
|
|
if (row.ids) {
|
|
|
- const keys = row.ids.split(',')
|
|
|
- row.list.forEach(async (item)=>{
|
|
|
+ const keys = row.ids.split(','), list = row.list
|
|
|
+ for (let i = 0; i < list.list; i++) {
|
|
|
+ const item = list[i]
|
|
|
if (keys.indexOf(item.id) > -1) {
|
|
|
item.checked = true
|
|
|
await nextTick()
|
|
|
sorTableRef.value[index].toggleRowSelection(item, true)
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//多选
|
|
|
-const sortingTableKeys = ref([])
|
|
|
const checkList = ref([])
|
|
|
const arrfliter = ref([])
|
|
|
const singleCheck = async ({ row })=>{
|
|
|
let isCheck = false
|
|
|
let checkrow = JSON.parse(JSON.stringify(row))
|
|
|
if (checkrow.checked === false || checkrow.checked === undefined) {
|
|
|
-
|
|
|
if ( checkList.value.length > 0) {
|
|
|
let arr = checkList.value.filter(e => e.id === checkrow.id)
|
|
|
if (arr.length > 0) {
|
|
@@ -854,49 +817,39 @@ const singleCheck = async ({ row })=>{
|
|
|
await nextTick()
|
|
|
sorTableRef.value[tableindex.value].toggleRowSelection(row, false)
|
|
|
isCheck = true
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
isCheck = false
|
|
|
row.tableindex = tableindex.value
|
|
|
checkList.value.push(row)
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
row.tableindex = tableindex.value
|
|
|
checkList.value.push(row)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
let arr = checkList.value.filter(e => e.id === checkrow.id)
|
|
|
if (isCheck === false && arr[0]?.checked === true || isCheck) {
|
|
|
arrfliter.value = checkList.value.filter(e => e.id !== checkrow.id)
|
|
|
-
|
|
|
} else {
|
|
|
arrfliter.value = checkList.value
|
|
|
}
|
|
|
let newarr = []
|
|
|
arrfliter.value.forEach((item)=>{
|
|
|
newarr.push(JSON.parse(JSON.stringify(item)))
|
|
|
-
|
|
|
})
|
|
|
checkList.value = newarr
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
const sortingTableSelection = (rows, list, index) => {
|
|
|
tableindex.value = index
|
|
|
if (list) {
|
|
|
list.forEach(element => {
|
|
|
- element.checked = false
|
|
|
+ element.checked = false
|
|
|
})
|
|
|
}
|
|
|
rows.forEach((element)=>{
|
|
|
- element.checked = true
|
|
|
+ element.checked = true
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -1610,6 +1563,30 @@ const tableRowName = (row) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//上报
|
|
|
+const isReport = ref(false)
|
|
|
+const reportData = ref([])
|
|
|
+const reportModalClick = () => {
|
|
|
+ reportData.value = []
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ //判断是否满足条件
|
|
|
+ const result = rows.every(({ status }) => {
|
|
|
+ return status === 0
|
|
|
+ })
|
|
|
+ if (!result) {
|
|
|
+ window.$message?.warning('已上报的文件不能进行再次上报')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //展示上报弹窗
|
|
|
+ reportData.value = rows
|
|
|
+ isReport.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//上报完成
|
|
|
+const reportFinish = () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
//左右拖动,改变树形结构宽度
|
|
|
const leftWidth = ref(382)
|
|
@@ -1644,11 +1621,11 @@ const onmousedown = () => {
|
|
|
@import '~style/file/collection.scss';
|
|
|
.panel-body .el-checkbox{
|
|
|
height: auto;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
.panel-body .el-radio-group{
|
|
|
width: auto ;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
.panel-body .el-checkbox.size-xl .el-checkbox__label, .el-radio.size-xl .el-radio__label {
|
|
|
// font-size: 16px;
|