Commit 7fe8831a authored by “yiyousong”'s avatar “yiyousong”

pref:修改部门窗口事项关联

parent 8546bd23
......@@ -110,12 +110,8 @@
class="select-department"
placeholder="事项来源"
>
<a-select-option :value="0">
一体化添加
</a-select-option>
<a-select-option :value="1">
手动添加
</a-select-option>
<a-select-option :value="0"> 一体化添加 </a-select-option>
<a-select-option :value="1"> 手动添加 </a-select-option>
</a-select>
<a-input-search
style="width: 300px"
......@@ -145,7 +141,6 @@
:data-source="siteMatterData"
:rowKey="(record) => record.id"
:row-selection="{
type: 'radio',
selectedRowKeys: matterKeys,
onChange: handleChange,
}"
......@@ -202,7 +197,7 @@
<script>
import { getSiteMatterList } from "@/services/matter";
import {
saveWindowmatter,
saveWindowbatch,
getWindowmatterList,
delWindowmatter,
getWindowInfo,
......@@ -403,19 +398,20 @@ export default {
},
// 保存
async handleOk() {
if (this.matterKeys.length) {
let obj = {
windowId: this.windowInfo.id,
windowName: this.windowInfo.name,
siteMatterId: this.matterKeys.join(","),
matterName: this.matterRows[0].matterName,
deptId: this.matterRows[0].deptId,
deptName: this.matterRows[0].deptName,
};
let res = await saveWindowmatter({
...this.formData,
...obj,
if (this.matterRows.length) {
let arr = this.matterRows.map((v) => {
return {
windowId: this.windowInfo.id,
windowName: this.windowInfo.name,
siteMatterId: v.id,
matterName: v.matterName,
deptId: v.deptId,
deptName: v.deptName,
isShow: 1,
sort: 99,
};
});
let res = await saveWindowbatch(arr);
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
......@@ -440,17 +436,10 @@ export default {
// 事项选择选择
handleChange(keys, rows) {
this.matterKeys = keys;
this.matterRows = rows;
// let { text } = event.componentOptions.children[0];
// this.formData.matterName = text;
},
// 事项搜索
filterOption(input, option) {
return (
option.componentOptions.children[0].text
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
);
this.matterRows = [...new Set([...this.matterRows, ...rows])];
this.matterRows = this.matterRows.filter((v) => {
return this.matterKeys.some((val) => val == v.id);
});
},
// 关闭添加窗口
handleClose() {
......@@ -501,10 +490,10 @@ export default {
async handleEdit(data) {
data.isEdit = !data.isEdit;
if (!data.isEdit) {
let res = await saveWindowmatter(data);
let { code, msg } = res.data;
let res = await saveWindowbatch([data]);
let { code } = res.data;
if (code === 1) {
this.$message.success(msg);
this.$message.success("修改成功");
this.getWindowmatterData();
} else {
this.getWindowmatterData();
......
......@@ -206,6 +206,7 @@ module.exports = {
info: `${BASE_URL}/base/window/matter/info`,
save: `${BASE_URL}/base/window/matter/save`,
delete: `${BASE_URL}/base/window/matter/delete`,
batchSave: `${BASE_URL}/base/window/matter/batchSave`,
},
// 短信设置
smsset: {
......
......@@ -109,6 +109,10 @@ export function uploadAllImg(data) {
export async function saveWindowmatter(data) {
return request(windowmatter.save, METHOD.POST, data);
}
// 批量保存窗口事项
export async function saveWindowbatch(data) {
return request(windowmatter.batchSave, METHOD.POST, data);
}
// 获取窗口事项列表
export async function getWindowmatterList(data) {
return request(windowmatter.list, METHOD.POST, data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment