Commit cd0dcf2a authored by “yiyousong”'s avatar “yiyousong”

feat: 办事指南事项添加帮办代办

parent a3e22055
<template> <template>
<div class="basicset-tab4"> <div class="basicset-tab4">
<div class="left"> <div class="left">
<div class="header"> <div class="header">
...@@ -74,24 +74,30 @@ ...@@ -74,24 +74,30 @@
{{ (current - 1) * size + index + 1 }} {{ (current - 1) * size + index + 1 }}
</span> </span>
</template> </template>
<!-- 部门 -->
<template slot="deptName" slot-scope="text">
{{ text.deptName ? text.deptName : "--" }}
</template>
<!-- 事项名称 --> <!-- 事项名称 -->
<template slot="matterName" slot-scope="text"> <template slot="matterName" slot-scope="text">
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template slot="title"> <template slot="title">
{{ text.matterName }} {{ text }}
</template> </template>
<div class="matter-name">{{ text.matterName }}</div> <div class="matter-name">{{ text }}</div>
</a-tooltip> </a-tooltip>
</template> </template>
<!-- 事项来源 --> <!-- 事项来源 -->
<template slot="source" slot-scope="text"> <template slot="source" slot-scope="text">
<a-tag v-if="text.source == 0" color="green"> 一体化添加 </a-tag> <a-tag v-if="text == 0" color="green"> 一体化添加 </a-tag>
<a-tag v-else color="blue"> 手动添加 </a-tag> <a-tag v-else color="blue"> 手动添加 </a-tag>
</template> </template>
<!-- 帮办代办 -->
<template slot="agent" slot-scope="text">
<y-switch
v-model="text.agent"
@onChange="changeAgent($event, text)"
></y-switch>
</template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a-space size="middle"> <a-space size="middle">
...@@ -114,6 +120,12 @@ ...@@ -114,6 +120,12 @@
</a-table> </a-table>
</div> </div>
</div> </div>
<!-- 帮办代办人员信息 -->
<SetAgent
ref="SetAgent"
:addVisile.sync="addVisile"
@success="getMatterSiteData"
></SetAgent>
</div> </div>
</template> </template>
...@@ -121,7 +133,9 @@ ...@@ -121,7 +133,9 @@
import { getSiteMatterList, addSitematter } from "@/services/matter"; import { getSiteMatterList, addSitematter } from "@/services/matter";
import { pageSizeOptions } from "@/config/pageConfig.js"; import { pageSizeOptions } from "@/config/pageConfig.js";
import { getDeptList } from "@/services/dept"; import { getDeptList } from "@/services/dept";
import YSwitch from "@/components/yswitch/YSwitch.vue";
import local from "@/utils/local"; import local from "@/utils/local";
import SetAgent from "../group/SetAgent.vue";
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
...@@ -131,24 +145,30 @@ const columns = [ ...@@ -131,24 +145,30 @@ const columns = [
{ {
title: "部门", title: "部门",
width: "20%", width: "20%",
scopedSlots: { dataIndex: "deptName",
customRender: "deptName",
},
}, },
{ {
title: "事项名称", title: "事项名称",
// ellipsis: true, // ellipsis: true,
align: "left", align: "left",
dataIndex: "matterName",
scopedSlots: { scopedSlots: {
customRender: "matterName", customRender: "matterName",
}, },
}, },
{ {
title: "事项来源", title: "事项来源",
dataIndex: "source",
scopedSlots: { scopedSlots: {
customRender: "source", customRender: "source",
}, },
}, },
{
title: "帮办代办",
scopedSlots: {
customRender: "agent",
},
},
{ {
title: "操作", title: "操作",
width: "200px", width: "200px",
...@@ -159,11 +179,15 @@ const columns = [ ...@@ -159,11 +179,15 @@ const columns = [
]; ];
export default { export default {
components: {}, components: {
YSwitch,
SetAgent,
},
data() { data() {
return { return {
columns, columns,
loading: false, loading: false,
addVisile: false,
source: undefined, // 左边来源 source: undefined, // 左边来源
selectedRowKeys: [], selectedRowKeys: [],
matterSiteData: [], // 站点事项 matterSiteData: [], // 站点事项
...@@ -263,6 +287,24 @@ export default { ...@@ -263,6 +287,24 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
} }
}, },
// 设置帮办代办
async changeAgent(val, row) {
if (val == 1) {
this.$refs.SetAgent.onEdit(row);
this.addVisile = true;
} else {
let obj = { ...row };
obj.agentName = "";
obj.agentPhone = "";
obj.agentPost = "";
let res = await addSitematter(obj);
if (res.data.code == 1) {
this.$message.success(res.data.msg);
}
this.getMatterSiteData();
}
},
}, },
}; };
</script> </script>
......
<template>
<div>
<a-modal
v-model="Visible"
:maskClosable="false"
title="帮办代办人员信息"
@cancel="handleClose"
>
<a-form-model
ref="form"
:model="form"
:rules="rules"
:label-col="{ span: 3 }"
:wrapper-col="{ span: 21 }"
>
<a-form-model-item label="姓名" prop="agentName">
<a-input
v-model="form.agentName"
placeholder="请输入帮办代办人员姓名"
/>
</a-form-model-item>
<a-form-model-item label="电话" prop="agentPhone">
<a-input
v-model="form.agentPhone"
placeholder="请输入帮办代办人员电话号码"
/>
</a-form-model-item>
<a-form-model-item label="职务" prop="agentPost">
<a-input
v-model="form.agentPost"
placeholder="请输入帮办代办人员职务"
/>
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
</a-modal>
</div>
</template>
<script>
import { addSitematter } from "@/services/matter.js";
export default {
props: {
addVisile: {
type: Boolean,
require: true,
default: false,
},
},
components: {},
data() {
return {
form: {
agentName: "", // 姓名
agentPhone: "", // 电话
agentPost: "", // 职务
},
rules: {
agentName: [
{
required: true,
message: "请输入帮办代办人员姓名",
trigger: "blur",
},
],
agentPhone: [
{
required: true,
message: "请输入帮办代办人员电话号码",
trigger: "blur",
},
],
agentPost: [
{
required: true,
message: "请输入帮办代办人员职务",
trigger: "blur",
},
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisile;
},
set(val) {
this.$emit("update:addVisile", val);
},
},
},
methods: {
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(data) {
setTimeout(() => {
this.form = { ...data };
}, 10);
},
// 关闭弹窗
handleClose() {
this.$emit("success");
this.$refs.form.resetFields();
this.Visible = false;
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await addSitematter(this.form);
let { code } = res.data;
if (code == 1) {
this.$message.success("添加成功");
this.handleClose();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
},
};
</script>
<style lang="less" scoped>
.ant-input-number {
width: 100%;
}
</style>
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