<template>
|
<div class="page_member">
|
<v-header
|
title="项目列表"
|
search
|
:bar="bar"
|
@on-search="onSearch"
|
></v-header>
|
<!-- 按钮区 -->
|
<div class="tool" v-if="isZuZhibuUser">
|
<el-button size="medium" type="primary" @click="add">新增</el-button>
|
<!-- <el-button size="medium" type="primary" @click="send">导入</el-button>
|
<el-button size="medium" type="primary" @click="out">导出</el-button> -->
|
</div>
|
<!-- 正文 -->
|
<div class="cen">
|
<!-- list列表 -->
|
<!-- <div class="list">
|
<p class="text_overflow">党组织名称</p>
|
<v-tool-scroll ids="member-list-scroll" class="lists">
|
<ul>
|
<li
|
v-for="(i, j) in list"
|
:key="j"
|
class="text_overflow"
|
:class="{ active: listIndex === j }"
|
@click.stop="onList(i, j)"
|
>
|
{{ i.name }}
|
</li>
|
</ul>
|
</v-tool-scroll>
|
</div> -->
|
<!-- 表格+分页 -->
|
<div class="tab_data">
|
<div class="tab">
|
<v-tool-table :trs="trs" :tds="tds">
|
<template v-slot:btn="item">
|
<div class="table_flex">
|
<span @click="edit(item.scope)" v-if="backstageType != 1"
|
>编辑</span
|
>
|
<span
|
@click="del(item.scope)"
|
v-if="backstageType != 1 && backstageType != 4"
|
>删除</span
|
>
|
</div>
|
</template>
|
<template v-slot:pic="item">
|
<div class="table_flex">
|
<img
|
:src="item.scope.photoPath || '/static/image/dh.jpg'"
|
@click="onScaleImage(item.scope)"
|
/>
|
</div>
|
</template>
|
<template v-slot:acc="item">
|
<div class="table_flex">
|
<b class="col_primary unline">{{ item.scope.phone }}</b>
|
</div>
|
</template>
|
</v-tool-table>
|
</div>
|
<div class="page">
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from "vuex";
|
import { areaAccountReturn } from "../../../utils/common";
|
const REX_VAL = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*.`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&.*`~()-+=]+$)(?![0-9\W_!@#$%^.&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&.*`~()-+=]{8,16}$/;
|
export default {
|
props: {},
|
components: {},
|
data() {
|
return {
|
bar: [
|
{
|
title: "项目名称",
|
name: "title",
|
plac: "项目名称",
|
width: "350px !important"
|
},
|
{
|
title: "职能特长及服务意愿",
|
name: "meritId",
|
type: "select",
|
list: [
|
{ label: "党建指导", value: 1, checkType: false },
|
{ label: "政策宣讲", value: 2, checkType: false },
|
{ label: "教育培训", value: 3, checkType: false },
|
{ label: "就业服务", value: 4, checkType: false },
|
{ label: "志愿服务", value: 5, checkType: false },
|
{ label: "维修服务", value: 6, checkType: false },
|
{ label: "家政服务", value: 7, checkType: false },
|
{ label: "其他", value: 8, checkType: false }
|
]
|
}
|
],
|
skillList: [],
|
total: 0,
|
os: {},
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
listIndex: -1,
|
areaType: false,
|
backstageType: "",
|
communityId: "",
|
formInfo: {
|
account: "",
|
password: "",
|
confirmPssword: ""
|
}, // 表单
|
trs: [
|
{ text: "序号", val: "id" },
|
{ text: "项目名称", val: "title" },
|
{ text: "项目负责人电话", val: "phone" },
|
{ text: "职能特长及服务意愿", val: "meritId" },
|
{ text: "操作", val: "btn", width: "200px" }
|
],
|
tds: [],
|
list: [],
|
isZuZhibuUser: false,
|
dialogVisible: false,
|
btnloading: false,
|
dialogTitle: "新增账号",
|
isUnitUser: "",
|
communityList: ["东区", "仁和区", "米易县", "盐边县", "西区"],
|
unitId: ""
|
};
|
},
|
computed: {
|
...mapState({ vuex_page: "pageReset" })
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
if (n.page === this.$route.path) {
|
this.paged.page = 1;
|
this.init();
|
}
|
},
|
deep: true
|
}
|
},
|
methods: {
|
// 查看大图
|
onScaleImage(v) {
|
this.$store.dispatch("setImage", {
|
time: Date.now(),
|
title: v.name,
|
pic: v.photoPath,
|
tool: true
|
});
|
},
|
// 分页点击
|
onPage(v) {
|
if (v.page === this.paged.page && v.page && !v.reset) {
|
return 0;
|
}
|
this.paged.page = v.page;
|
this.paged.limit = v.limit;
|
this.init();
|
},
|
// 获取数据
|
init() {
|
let v = demo.copy(
|
Object.assign(this.os, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
unitId: this.unitId
|
})
|
);
|
|
this.$api.get(
|
"StriveFor/ResourceSharing/getResourceSharingList",
|
v,
|
e => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
}
|
);
|
},
|
// 删除
|
del(v) {
|
let t = this;
|
t.$js.model("删除项目", "是否删除项目[" + v.name + "]", res => {
|
if (res) {
|
t.$api.get(
|
"StriveFor/ResourceSharing/expurgateResourceSharingData",
|
{
|
id: v.id
|
},
|
e => {
|
demo.toast("删除成功");
|
t.$nextTick(() => {
|
t.init();
|
});
|
}
|
);
|
}
|
});
|
},
|
|
// 编辑
|
edit(v) {
|
this.$router.push(
|
"/addUnitProject?id=" +
|
v.id +
|
"&unitId=" +
|
this.unitId +
|
"&communityId=" +
|
this.communityId
|
);
|
// v.orgId = v.orgId || "";
|
// this._open("member-add", "编辑", v);
|
},
|
// 新增
|
add() {
|
// this._open("member-add", "新增", { id: 0 });
|
this.$router.push(
|
"/addUnitProject?unitId=" +
|
this.unitId +
|
"&communityId=" +
|
this.communityId
|
);
|
},
|
// 查询
|
onSearch(v) {
|
this.os = v;
|
this.paged.page = 1;
|
// this.listIndex = -1;
|
this.init();
|
},
|
// 点击党组织
|
onList(i, j) {
|
this.listIndex = j;
|
this.os.orgName = i.name;
|
this.init();
|
}
|
},
|
mounted() {
|
this.isZuZhibuUser = demo.$session.get("user").account == "zuzhibu";
|
this.isUnitUser = demo.$session.get("user").bindingCheckUnitId;
|
this.backstageType = demo.$session.get("user").backstageType;
|
this.is_community = this.communityList.indexOf(
|
demo.$session.get("user").name
|
);
|
this.unitId = this.$route.query.id;
|
this.communityId = this.$route.query.communityId;
|
console.log(this.unitId);
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
.page_member {
|
overflow-y: auto;
|
.tool {
|
margin: 5px 0 15px;
|
}
|
.cen {
|
display: flex;
|
height: 500px;
|
> div {
|
height: 100%;
|
position: relative;
|
}
|
.list {
|
width: 160px;
|
p {
|
background-color: #f2f2f2;
|
font-size: 14px;
|
font-weight: 650;
|
}
|
.lists {
|
height: calc(~"100% - 40px");
|
}
|
p,
|
li {
|
height: 40px;
|
line-height: 40px;
|
}
|
li {
|
cursor: pointer;
|
transition: all 0.2s;
|
font-size: 13px;
|
text-indent: 5px;
|
}
|
li.active {
|
background-color: #1890ff;
|
color: #fff;
|
}
|
}
|
.tab_data {
|
.tab {
|
height: calc(~"100% - 50px");
|
}
|
.page {
|
height: 50px;
|
box-sizing: border-box;
|
padding-top: 10px;
|
}
|
}
|
}
|
}
|
</style>
|