2025-11-27 18:56:44 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<basic-container>
|
|
|
|
|
|
<avue-crud
|
|
|
|
|
|
:option="option"
|
|
|
|
|
|
:table-loading="loading"
|
|
|
|
|
|
:data="data"
|
|
|
|
|
|
v-model:page="page"
|
|
|
|
|
|
:permission="permissionList"
|
|
|
|
|
|
:before-open="beforeOpen"
|
|
|
|
|
|
v-model="form"
|
|
|
|
|
|
ref="crud"
|
|
|
|
|
|
@search-change="searchChange"
|
|
|
|
|
|
@search-reset="searchReset"
|
|
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
|
|
@current-change="currentChange"
|
|
|
|
|
|
@size-change="sizeChange"
|
|
|
|
|
|
@refresh-change="refreshChange"
|
|
|
|
|
|
@on-load="onLoad"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #receiveStatus="{ row }">
|
2025-11-29 18:50:10 +08:00
|
|
|
|
<span
|
|
|
|
|
|
class="clickable-status"
|
|
|
|
|
|
@click="handleTProgress(row)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ getProgressStatusText(row.transferStatus) }}
|
|
|
|
|
|
</span>
|
2025-11-27 18:56:44 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template #deptId="{ row }">
|
|
|
|
|
|
{{ row.deptName }}
|
|
|
|
|
|
</template>
|
2025-11-29 18:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 接收清单操作 -->
|
|
|
|
|
|
<template #transferIssue="{ row }">
|
|
|
|
|
|
<span
|
|
|
|
|
|
class="clickable-status"
|
|
|
|
|
|
@click="handleTList(row)"
|
|
|
|
|
|
>
|
|
|
|
|
|
查看清单
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2025-11-27 18:56:44 +08:00
|
|
|
|
</avue-crud>
|
|
|
|
|
|
</basic-container>
|
2025-11-29 18:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
<RecordList
|
|
|
|
|
|
v-model="recordListVisible"
|
|
|
|
|
|
:title="recordListTitle"
|
|
|
|
|
|
:row-data="recordListRow"
|
|
|
|
|
|
:jump-type="recordListJumpType"
|
|
|
|
|
|
@handle-query="onLoad(page, query)"
|
|
|
|
|
|
@close="recordListVisible = false"
|
|
|
|
|
|
/>
|
2025-11-27 18:56:44 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-11-29 18:50:10 +08:00
|
|
|
|
import RecordList from '@/views/fileTransfer/components/recordAcceptList.vue'
|
2025-11-27 18:56:44 +08:00
|
|
|
|
import {
|
|
|
|
|
|
getTransferReceiceListApi,
|
|
|
|
|
|
} from '@/api/filesTransfer/accept';
|
|
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
|
import website from '@/config/website';
|
|
|
|
|
|
import { getDeptSelectApi } from '@/api/select';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
2025-11-29 18:50:10 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
RecordList
|
|
|
|
|
|
},
|
2025-11-27 18:56:44 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
form: {},
|
|
|
|
|
|
query: {},
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
page: {
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
},
|
|
|
|
|
|
selectionList: [],
|
|
|
|
|
|
option: {
|
|
|
|
|
|
height: 'auto',
|
|
|
|
|
|
calcHeight: 32,
|
|
|
|
|
|
tip: false,
|
|
|
|
|
|
searchShow: true,
|
|
|
|
|
|
searchMenuSpan: 6,
|
|
|
|
|
|
border: true,
|
|
|
|
|
|
index: true,
|
|
|
|
|
|
viewBtn: true,
|
|
|
|
|
|
editBtn: false,
|
|
|
|
|
|
delBtn: false,
|
|
|
|
|
|
selection: false,
|
|
|
|
|
|
addBtn:true,
|
|
|
|
|
|
dialogClickModal: false,
|
|
|
|
|
|
column: [
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '项目名称',
|
|
|
|
|
|
prop: 'proName',
|
|
|
|
|
|
search: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '单项工程名称',
|
|
|
|
|
|
prop: 'singleProName',
|
|
|
|
|
|
search: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '移交时间',
|
|
|
|
|
|
prop: 'transferTime',
|
|
|
|
|
|
search: true,
|
|
|
|
|
|
type: 'date',
|
|
|
|
|
|
format: 'YYYY-MM-DD',
|
|
|
|
|
|
valueFormat: 'YYYY-MM-DD',
|
|
|
|
|
|
dataType: 'string'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '接收单位',
|
|
|
|
|
|
prop: 'deptId',
|
|
|
|
|
|
search: true,
|
|
|
|
|
|
type: 'tree',
|
|
|
|
|
|
dicData: [], // 初始空,后面动态赋值
|
|
|
|
|
|
props: {
|
|
|
|
|
|
label: 'label',
|
|
|
|
|
|
value: 'id',
|
|
|
|
|
|
children: 'children'
|
|
|
|
|
|
},
|
|
|
|
|
|
// 显示时用插槽展示 deptName(因为 row.deptName 是名称)
|
|
|
|
|
|
slot: true
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '接收清单',
|
|
|
|
|
|
prop: 'transferIssue',
|
2025-11-29 18:50:10 +08:00
|
|
|
|
slot: true // 启用插槽
|
2025-11-27 18:56:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '接收进度',
|
|
|
|
|
|
prop: 'receiveStatus',
|
|
|
|
|
|
slot: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
data: [],
|
2025-11-29 18:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
recordListVisible: false,
|
|
|
|
|
|
recordListTitle: '',
|
|
|
|
|
|
recordListRow: null,
|
|
|
|
|
|
recordListJumpType: 'list'
|
2025-11-27 18:56:44 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapGetters(['permission']),
|
|
|
|
|
|
permissionList() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
addBtn: this.validData(this.permission.post_add, false),
|
|
|
|
|
|
viewBtn: this.validData(this.permission.post_view, false),
|
|
|
|
|
|
delBtn: this.validData(this.permission.post_delete, false),
|
|
|
|
|
|
editBtn: this.validData(this.permission.post_edit, false),
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
ids() {
|
|
|
|
|
|
let ids = [];
|
|
|
|
|
|
this.selectionList.forEach(ele => {
|
|
|
|
|
|
ids.push(ele.id);
|
|
|
|
|
|
});
|
|
|
|
|
|
return ids.join(',');
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
/* 查看接收进度 */
|
|
|
|
|
|
getProgressStatusText(status) {
|
|
|
|
|
|
switch (status) {
|
|
|
|
|
|
case '0':
|
|
|
|
|
|
return '进行中'
|
|
|
|
|
|
case '1':
|
|
|
|
|
|
return '已完成'
|
|
|
|
|
|
default:
|
|
|
|
|
|
return '未知状态'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
loadDeptOptions() {
|
|
|
|
|
|
getDeptSelectApi().then(res => {
|
|
|
|
|
|
this.treeDataList = this.convertToVueTree(res.data.data);
|
|
|
|
|
|
// 找到 deptId 列并更新 dicData
|
|
|
|
|
|
const deptColumn = this.option.column.find(col => col.prop === 'deptId');
|
|
|
|
|
|
if (deptColumn) {
|
|
|
|
|
|
deptColumn.dicData = this.treeDataList; // Vue 3 可直接赋值;Vue 2 建议用 this.$set
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
console.error('加载部门列表失败', err);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// 树数据过滤 - 支持无限层级转换
|
|
|
|
|
|
convertToVueTree(data, level = 1) {
|
|
|
|
|
|
if (!data || !Array.isArray(data)) {
|
|
|
|
|
|
return []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return data.map(item => {
|
|
|
|
|
|
const node = {
|
|
|
|
|
|
id: item.deptId,
|
|
|
|
|
|
label: item.deptName,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
|
|
|
|
|
if (level < 3) {
|
|
|
|
|
|
const children = this.convertToVueTree(item.children, level + 1)
|
|
|
|
|
|
if (children.length > 0) node.children = children
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return node
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
beforeOpen(done, type, row) {
|
|
|
|
|
|
done(); // 必须调用 done()
|
|
|
|
|
|
},
|
|
|
|
|
|
searchReset() {
|
|
|
|
|
|
this.query = {};
|
|
|
|
|
|
this.onLoad(this.page);
|
|
|
|
|
|
},
|
|
|
|
|
|
searchChange(params, done) {
|
|
|
|
|
|
this.query = params;
|
|
|
|
|
|
this.page.currentPage = 1;
|
|
|
|
|
|
this.onLoad(this.page, params);
|
|
|
|
|
|
done();
|
|
|
|
|
|
},
|
|
|
|
|
|
selectionChange(list) {
|
|
|
|
|
|
this.selectionList = list;
|
|
|
|
|
|
},
|
|
|
|
|
|
selectionClear() {
|
|
|
|
|
|
this.selectionList = [];
|
|
|
|
|
|
this.$refs.crud.toggleSelection();
|
|
|
|
|
|
},
|
|
|
|
|
|
currentChange(currentPage) {
|
|
|
|
|
|
this.page.currentPage = currentPage;
|
|
|
|
|
|
},
|
|
|
|
|
|
sizeChange(pageSize) {
|
|
|
|
|
|
this.page.pageSize = pageSize;
|
|
|
|
|
|
},
|
|
|
|
|
|
refreshChange() {
|
|
|
|
|
|
this.onLoad(this.page, this.query);
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(page, params = {}) {
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
this.loadDeptOptions();
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
...params,
|
|
|
|
|
|
pageNum:page.currentPage,
|
|
|
|
|
|
pageSize:page.pageSize
|
|
|
|
|
|
};
|
|
|
|
|
|
getTransferReceiceListApi(data).then(res => {
|
|
|
|
|
|
const data = res.data;
|
|
|
|
|
|
this.page.total = data.total;
|
|
|
|
|
|
this.data = data.rows;
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
this.selectionClear();
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-11-29 18:50:10 +08:00
|
|
|
|
|
|
|
|
|
|
handleTList(row) {
|
|
|
|
|
|
this.recordListTitle = '移交清单';
|
|
|
|
|
|
this.recordListRow = row;
|
|
|
|
|
|
this.recordListJumpType = 'list';
|
|
|
|
|
|
this.recordListVisible = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handleTProgress(row) {
|
|
|
|
|
|
this.recordListTitle = '移交进度';
|
|
|
|
|
|
this.recordListRow = row;
|
|
|
|
|
|
this.recordListJumpType = 'progress';
|
|
|
|
|
|
this.recordListVisible = true;
|
|
|
|
|
|
}
|
2025-11-27 18:56:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2025-11-29 18:50:10 +08:00
|
|
|
|
<style scoped>
|
|
|
|
|
|
.clickable-status {
|
|
|
|
|
|
color: #409eff;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
.clickable-status:hover {
|
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|