会签管理,库管员多选

This commit is contained in:
hayu 2025-05-26 00:55:11 +08:00
parent dd78391934
commit 29cbf02ac6
2 changed files with 108 additions and 51 deletions

View File

@ -20,9 +20,9 @@ export function addProcess(data) {
//会签流程管理--详细信息 //会签流程管理--详细信息
export function getProcessDetail(id) { export function getProcessDetail(ids) {
return request({ return request({
url: '/material/sign_process/'+ id, url: '/material/sign_process/'+ ids,
method: 'get', method: 'get',
}) })
} }
@ -38,9 +38,9 @@ export function editProcess(data) {
// 会签配置管理--删除 // 会签配置管理--删除
export function delProcess(id) { export function delProcess(ids) {
return request({ return request({
url: '/material/sign_process/delProcess/' + id, url: '/material/sign_process/delProcess/' + ids,
method: 'post', method: 'post',
}) })
} }

View File

@ -81,7 +81,19 @@
prop="orgName" prop="orgName"
sortable sortable
show-overflow-tooltip show-overflow-tooltip
/> min-width="150"
>
<template slot-scope="scope">
<el-tooltip
v-if="scope.row.orgName && scope.row.orgName.length > 20"
:content="scope.row.orgName"
placement="top"
>
<span>{{ scope.row.orgName.substring(0, 20) + '...' }}</span>
</el-tooltip>
<span v-else>{{ scope.row.orgName || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
@ -167,13 +179,17 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="会签组织" prop="orgId"> <el-form-item label="会签组织" prop="orgIds">
<treeselect <treeselect
v-model="form.orgId" v-model="form.orgIds"
:multiple="true"
:searchable="true" :searchable="true"
:options="deptOptions" :options="deptOptions"
:normalizer="normalizer" :normalizer="normalizer"
placeholder="请选择会签组织" placeholder="请选择会签组织"
:show-count="true"
:limit="10"
:limit-text="count => `还有 ${count} 个选项`"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -187,13 +203,19 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getProcessList, addProcess, getProcessDetail, editProcess, delProcess } from "@/api/countersign/countersignProcess"; import {
getProcessList,
addProcess,
getProcessDetail,
editProcess,
delProcess
} from "@/api/countersign/countersignProcess";
import {listDept,} from "@/api/system/dept"; import {listDept,} from "@/api/system/dept";
import {deptTreeSelect} from "@/api/system/user"; import {deptTreeSelect} from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Process", name: "Process",
dicts: ["countersign_process_config_name", "countersign_process_type_name"], dicts: ["countersign_process_config_name", "countersign_process_type_name"],
@ -222,8 +244,7 @@ export default {
}, },
// //
form: { form: {},
},
// //
rules: { rules: {
processId: [ processId: [
@ -240,10 +261,12 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
orgId: [ orgIds: [
{ {
required: true, required: true,
message: "请选择会签组织", type: 'array',
min: 1,
message: "请至少选择一个会签组织",
trigger: "blur", trigger: "blur",
}, },
], ],
@ -304,16 +327,28 @@ export default {
/** 编辑按钮操作 */ /** 编辑按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id; const ids = row.ids;
getProcessDetail(id).then((response) => { getProcessDetail(ids).then((response) => {
this.form = response.data; this.form = response.data;
// orgIds
if (this.form.orgIds && !Array.isArray(this.form.orgIds)) {
//
if (typeof this.form.orgIds === 'string') {
this.form.orgIds = this.form.orgIds.split(',').map(id => parseInt(id.trim()));
} else {
this.form.orgIds = [this.form.orgIds];
}
}
this.showProcess = true; this.showProcess = true;
this.title = "编辑"; this.title = "编辑";
}); });
}, },
// //
reset() { reset() {
this.form = {}; this.form = {
orgIds: [] //
};
this.resetForm("form"); this.resetForm("form");
}, },
@ -334,14 +369,20 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
// orgIds
const submitData = { ...this.form };
//
// submitData.orgIds = this.form.orgIds.join(',');
if (this.form.id != undefined) { if (this.form.id != undefined) {
editProcess(this.form).then((response) => { editProcess(submitData).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.showProcess = false; this.showProcess = false;
this.getList(); this.getList();
}); });
} else { } else {
addProcess(this.form).then((response) => { addProcess(submitData).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.showProcess = false; this.showProcess = false;
this.getList(); this.getList();
@ -359,17 +400,18 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const ids = row.ids;
this.$modal this.$modal
.confirm("是否确认删除数据项?") .confirm("是否确认删除数据项?")
.then(function () { .then(function () {
return delProcess(id); return delProcess(ids);
}) })
.then(() => { .then(() => {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
this.getList(); this.getList();
}) })
.catch(() => {}); .catch(() => {
});
}, },
}, },
@ -382,19 +424,34 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.deviceCode { .deviceCode {
margin-top: 10px; margin-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 18px; font-size: 18px;
} }
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
//css //css
::v-deep.disabled { ::v-deep.disabled {
.el-upload--picture-card { .el-upload--picture-card {
display: none; display: none;
} }
} }
//
::v-deep .vue-treeselect__multi-value {
margin: 2px;
max-width: 150px;
}
::v-deep .vue-treeselect__multi-value-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style> </style>