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

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

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