会签管理,库管员多选

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

@ -24,10 +24,10 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -39,7 +39,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>新增</el-button >新增</el-button
> >
</el-col> </el-col>
<right-toolbar <right-toolbar
@ -57,8 +57,8 @@
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -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">
@ -126,19 +138,19 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="流程名称" prop="processId"> <el-form-item label="流程名称" prop="processId">
<el-select <el-select
v-model="form.processId" v-model="form.processId"
placeholder="请选择流程名称" placeholder="请选择流程名称"
style="width: 100%;" style="width: 100%;"
filterable filterable
clearable clearable
> >
<el-option <el-option
v-for="dict in dict.type.countersign_process_config_name" v-for="dict in dict.type.countersign_process_config_name"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -147,19 +159,19 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="会签类型" prop="signType"> <el-form-item label="会签类型" prop="signType">
<el-select <el-select
v-model="form.signType" v-model="form.signType"
placeholder="请选择会签类型" placeholder="请选择会签类型"
style="width: 100%;" style="width: 100%;"
filterable filterable
clearable clearable
> >
<el-option <el-option
v-for="dict in dict.type.countersign_process_type_name" v-for="dict in dict.type.countersign_process_type_name"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -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>
@ -186,17 +202,23 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script>
<script> import {
import { getProcessList, addProcess, getProcessDetail, editProcess, delProcess } from "@/api/countersign/countersignProcess"; getProcessList,
import { listDept, } from "@/api/system/dept"; addProcess,
import { deptTreeSelect } from "@/api/system/user"; getProcessDetail,
editProcess,
delProcess
} from "@/api/countersign/countersignProcess";
import {listDept,} from "@/api/system/dept";
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"],
data() { data() {
return { return {
// //
@ -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",
}, },
], ],
@ -254,7 +277,7 @@ export default {
this.getDeptList() this.getDeptList()
this.getList(); this.getList();
}, },
components: { Treeselect }, components: {Treeselect},
methods: { methods: {
// /** */ // /** */
// getUserList() { // getUserList() {
@ -267,13 +290,13 @@ export default {
/** 查询部门列表 */ /** 查询部门列表 */
getDeptList() { getDeptList() {
listDept({ userId:1}).then(response => { listDept({userId: 1}).then(response => {
this.deptOptions = this.handleTree(response.data, "deptId"); this.deptOptions = this.handleTree(response.data, "deptId");
}); });
}, },
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children; delete node.children;
} }
@ -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,42 +400,58 @@ 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(() => {
});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uploadImg { .uploadImg {
padding-top: 20px; padding-top: 20px;
display: flex; display: flex;
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;
} }
} }
</style>
//
::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>