移交问题管理

This commit is contained in:
cwchen 2025-09-22 16:11:09 +08:00
parent c06b7ccedc
commit fd01b20f05
2 changed files with 40 additions and 105 deletions

View File

@ -95,12 +95,10 @@ export default {
}, },
// //
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.title = "详情";
name: 'DetailData', this.isAdd = 'detail';
query: { this.row = row;
id: encryptWithSM4(row.id ?? '0'), this.isflag = true;
}
})
}, },
/* 搜索操作 */ /* 搜索操作 */
handleQuery() { handleQuery() {

View File

@ -5,24 +5,32 @@
<div> <div>
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px"> <el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px">
<el-form-item label="项目" prop="proId"> <el-form-item label="项目" prop="proId">
<el-select class="form-item" v-model="form.proId" filterable clearable placeholder="请选择项目" <el-select class="form-item" v-model="form.proId" filterable clearable placeholder="请选择项目" :disabled="isRead"
@change="handleProChange"> @change="handleProChange">
<el-option v-for="item in proList" :key="item.id" :label="item.name" <el-option v-for="item in proList" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="移交时间" prop="transferTime">
<el-date-picker class="form-item" v-model="form.transferTime" placeholder="请选择移交时间" :disabled="isRead"
value-format="yyyy-MM-dd" type="date"></el-date-picker>
</el-form-item>
<el-form-item label="接收组织" prop="deptId"> <el-form-item label="接收组织" prop="deptId">
<treeselect v-model="form.deptId" :options="treeDataList" placeholder="请选择接收组织" value-key="id" <treeselect v-model="form.deptId" :options="treeDataList" placeholder="请选择接收组织" value-key="id"
:disable-branch-nodes="true" noChildrenText="没有数据了" noOptionsText="没有数据了" :disable-branch-nodes="true" noChildrenText="没有数据了" noOptionsText="没有数据了"
noResultsText="没有搜索结果" /> noResultsText="没有搜索结果" :disabled="isRead"/>
</el-form-item>
<el-form-item label="移交问题" prop="issue">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" class="form-item"
v-model="form.issue" clearable show-word-limit placeholder="请输入移交问题" maxlength="255" :disabled="isRead"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button> <el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
<el-button type="primary" class="search-btn" :disabled="disabled" <el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button> @click="submitForm('ruleForm')" v-if="!isRead">确认</el-button>
</span> </span>
<FileTree v-if="isflag" :isAdd="isAdd" :rowData="fileTreeRow" :title="fileTreeTitle" @closeDialog="closeDialog" <FileTree v-if="isflag" :isAdd="isAdd" :rowData="fileTreeRow" :title="fileTreeTitle" @closeDialog="closeDialog"
@getTreeData="getTreeData" :dataForm="fileTreeRow" :width="600" /> @getTreeData="getTreeData" :dataForm="fileTreeRow" :width="600" />
@ -63,21 +71,15 @@ export default {
proId: [ proId: [
{ required: true, message: '请选择项目', trigger: 'change' } { required: true, message: '请选择项目', trigger: 'change' }
], ],
checkTreeData: [
{
validator: (rule, value, callback) => {
if (!this.checkTreeData || this.checkTreeData.length === 0) {
callback(new Error('请选择移交档案'));
} else {
callback();
}
},
trigger: 'change'
}
],
deptId: [ deptId: [
{ required: true, message: '请选择接收组织', trigger: 'change' } { required: true, message: '请选择接收组织', trigger: 'change' }
], ],
issue: [
{ required: true, message: '请输入移交问题', trigger: 'blur' }
],
transferTime: [
{ required: true, message: '请选择移交时间', trigger: 'blur' }
],
}, },
fileTreeTitle: "", fileTreeTitle: "",
isflag: false, isflag: false,
@ -87,6 +89,11 @@ export default {
created() { created() {
this.initFormData(); this.initFormData();
}, },
computed: {
isRead() {
return this.isAdd === 'detail';
}
},
methods: { methods: {
/** 初始化表单数据 */ /** 初始化表单数据 */
async initFormData() { async initFormData() {
@ -98,50 +105,27 @@ export default {
}); });
if (this.isAdd === 'edit' && this.rowData) { if ((this.isAdd === 'edit' || this.isAdd === 'detail') && this.rowData) {
// //
this.form = { this.form = {
id: this.rowData.id || null, id: this.rowData.id || null,
proId: this.rowData.proId || undefined, proId: this.rowData.proId || undefined,
deptId: this.rowData.deptId || undefined, deptId: this.rowData.deptId || undefined,
transferTime: this.rowData.transferTime || undefined,
issue: this.rowData.issue || null,
}; };
const res = await getTransferApplyFilesByApplyIdApi({ id: this.rowData.id });
if (Array.isArray(res.data) && res.data.length > 0) {
res.data.map(item => {
const newFile = {
proFilesContentsId: item.id,
parParentName: item.parParentName,
parentName: item.parentName,
fileName: item.fileName,
proId: item.proId,
fileSourceId: item.fileId,
filePath: item.filePath
};
this.checkTreeData.push(newFile);
})
}
} else { } else {
// //
this.form = { this.form = {
proId: undefined, proId: undefined,
deptId: undefined, deptId: undefined,
transferTime: null,
issue: null,
}; };
} }
}, },
handleProChange(value) {
console.log(value);
this.checkTreeData = [];
},
//
handleAddFile() {
if (!this.form.proId) {
return this.$modal.msgError('请选择项目');
}
const proId = this.form.proId;
this.fileTreeTitle = "选择";
this.fileTreeRow = { proId };
this.isflag = true;
},
closeDialog() { closeDialog() {
this.isflag = false; this.isflag = false;
}, },
@ -167,9 +151,10 @@ export default {
/**重置表单*/ /**重置表单*/
reset() { reset() {
this.form = { this.form = {
id: null,
proId: undefined, proId: undefined,
deptId: undefined deptId: undefined,
transferTime: null,
issue: null,
}; };
this.resetForm("ruleForm"); this.resetForm("ruleForm");
this.checkTreeData = []; this.checkTreeData = [];
@ -191,14 +176,7 @@ export default {
background: 'rgba(0,0,0,0.5)', background: 'rgba(0,0,0,0.5)',
target: this.$el.querySelector('.el-dialog') || document.body target: this.$el.querySelector('.el-dialog') || document.body
}) })
let params = _.cloneDeep(this.form);
//
let proObj = this.proList.find(item => item.id === params.proId);
params.singleProName = proObj.name;
//
const obj = this.findNodeById(this.treeDataList, this.form.deptId);
params.deptName = obj?.label || '';
params.transferFileDtos = this.checkTreeData;
console.log(params); console.log(params);
if (this.isAdd === 'add') { if (this.isAdd === 'add') {
@ -251,54 +229,13 @@ export default {
return node return node
}) })
}, },
findNodeById(nodes, id) {
for (const node of nodes) {
if (node.id === id) return node;
if (node.children) {
const found = this.findNodeById(node.children, id);
if (found) return found;
}
}
return null;
},
//
async getTreeData(nodeId) {
this.checkTreeData = [];
const res = await getTransferApplyFilesApi({ proId: this.form.proId, id: nodeId });
if (Array.isArray(res.data) && res.data.length > 0) {
res.data.map(item => {
const newFile = {
proFilesContentsId: item.id,
parParentName: item.parParentName,
parentName: item.parentName,
fileName: item.fileName,
proId: item.proId,
fileSourceId: item.fileId,
filePath: item.filePath
};
this.checkTreeData.push(newFile);
})
}
//
this.$nextTick(() => {
this.$refs.ruleForm.validateField('checkTreeData');
});
},
//
removeFile(index) {
this.checkTreeData.splice(index, 1);
//
this.$nextTick(() => {
this.$refs.ruleForm.validateField('checkTreeData');
});
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.w700 ::v-deep .el-dialog { .w700 ::v-deep .el-dialog {
width: 1100px; width: 700px;
} }
.w500 ::v-deep .el-dialog { .w500 ::v-deep .el-dialog {