Browse Source

代码提交

master
juwei001 1 year ago
parent
commit
6320380d17
  1. 67
      src/views/modules/communityParty/partyBuilding/activitys.vue
  2. 62
      src/views/modules/communityParty/partyBuilding/activitysForm.vue
  3. 292
      src/views/modules/partymember/edit-dyzxh.vue
  4. 7
      src/views/modules/partymember/icpartyorg-add-or-update.vue
  5. 18
      src/views/modules/partymember/icpartyorgtree.vue

67
src/views/modules/communityParty/partyBuilding/activitys.vue

@ -64,36 +64,63 @@
>
</div>
<el-table
class="table"
<!-- class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
style="width: 100%"
style="width: 100%" -->
<el-table
class="resi-table"
v-loading="tableLoading"
:data="tableData"
default-expand-all
row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
:height="tableHeight"
>
<el-table-column
prop="type"
header-align="center"
align="center"
header-align="left"
width="160px"
align="left"
label="类型"
>
<template slot-scope="scope">
<span>{{ getTypeLable(scope.row.type) }}</span>
</template>
</el-table-column>
<el-table-column
prop="menuType"
header-align="left"
align="left"
width="100px"
label="目录/内容"
>
<template slot-scope="scope">
<span>{{
scope.row.menuType == 1
? "目录"
: scope.row.menuType == 2
? "内容"
: "--"
}}</span>
</template>
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
header-align="left"
align="left"
label="标题"
width="240px"
>
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
header-align="left"
align="left"
label="内容"
>
</el-table-column>
@ -101,8 +128,8 @@
label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
header-align="left"
align="left"
class="operate"
>
<template slot-scope="scope">
@ -130,7 +157,7 @@
</template>
</el-table-column>
</el-table>
<div>
<!-- <div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@ -141,7 +168,7 @@
:total="total"
>
</el-pagination>
</div>
</div> -->
</div>
<!-- 修改弹出框 -->
@ -159,6 +186,7 @@
ref="ref_form"
:unitList="unitList"
:gridList="gridList"
:tableData="tableData"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"
></activitys-form>
@ -257,7 +285,8 @@ export default {
async loadTable() {
this.tableLoading = true;
const url = "/resi/partymember/icpartyplace/page";
// const url = "/resi/partymember/icpartyplace/page";
const url = "/resi/partymember/icpartyplace/getPageList";
let params = {
limit: this.pageSize,
page: this.pageNo,
@ -266,8 +295,8 @@ export default {
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
this.total = data.total;
this.tableData = data.list;
// this.total = data.total;
this.tableData = data;
} else {
this.$message.error(msg);
}
@ -276,8 +305,8 @@ export default {
getTypeLable(type) {
if (type) {
const lable =
this.unitList.filter((item) => item.value == type)[0].label;
const lable = this.unitList.filter((item) => item.value == type)[0]
.label;
return lable;
}
return "";
@ -370,7 +399,7 @@ export default {
this.loadTable();
})
.catch((res) => {
this.$message.error(res.msg||'删除失败!');
this.$message.error(res.msg || "删除失败!");
});
},
//

62
src/views/modules/communityParty/partyBuilding/activitysForm.vue

@ -9,6 +9,22 @@
:disabled="formType === 'detail'"
class="form"
>
<el-form-item label="上级目录" label-width="150px" prop="parentId">
<el-select
class="item_width_1"
v-model="formData.parentId"
placeholder="请选择上级目录"
clearable
>
<el-option
v-for="item in [{ name: '一级目录', id: '0' },...tableData]"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="类型" label-width="150px" prop="type">
<el-select
class="item_width_1"
@ -25,6 +41,25 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="菜单/内容" label-width="150px" prop="menuType">
<el-select
class="item_width_1"
v-model="formData.menuType"
placeholder="请选择类型"
clearable
>
<el-option
label="目录"
:value="1"
>
</el-option>
<el-option
label="内容"
:value="2"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="标题"
prop="name"
@ -38,6 +73,19 @@
>
</el-input>
</el-form-item>
<el-form-item
label="排序"
prop="sort"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
placeholder="请输入标题"
v-model="formData.sort"
>
</el-input>
</el-form-item>
<el-form-item
label="内容"
@ -91,6 +139,7 @@ export default {
formType: "add", // addeditdetail
loading: false,
formData: {
parentId: '0',
name: null,
type: null,
description: null,
@ -137,7 +186,7 @@ export default {
async addActivity() {
let url = "/resi/partymember/icpartyplace";
// let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/save"
console.log("this.formData:::", this.formData);
// console.log("this.formData:::", this.formData);
const { data, code, msg } = await requestPost(url, this.formData);
if (code === 0) {
@ -183,11 +232,12 @@ export default {
computed: {
dataRule() {
return {
parentId: [{ required: true, message: "上级目录不能为空", trigger: "blur" }],
name: [{ required: true, message: "标题不能为空", trigger: "blur" }],
type: [{ required: true, message: "类型不能为空", trigger: "blur" }],
description: [
{ required: true, message: "内容不能为空", trigger: "blur" },
],
// description: [
// { required: true, message: "", trigger: "blur" },
// ],
};
},
},
@ -196,6 +246,10 @@ export default {
type: Array,
default: [],
},
tableData: {
type: Array,
default: [],
},
},
};
</script>

292
src/views/modules/partymember/edit-dyzxh.vue

@ -0,0 +1,292 @@
<template>
<el-dialog
:visible.sync="visible"
title="党员中心户"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-table
:data="tableData"
border
row-key="id"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
>
<el-table-column prop="name" label="姓名">
<template slot-scope="scope">
<span v-if="!scope.row.ifEdit">{{ scope.row.name }}</span>
<el-input v-model="tableDataEdit[scope.$index].name" v-else />
</template>
</el-table-column>
<el-table-column prop="type" label="职位">
<template slot-scope="scope">
<span v-if="!scope.row.ifEdit">{{
scope.row.type == 1 ? "组长" : scope.row.type == 2 ? "组员" : ""
}}</span>
<el-select v-model="tableDataEdit[scope.$index].type" v-else>
<el-option label="组长" :value="1"></el-option>
<el-option label="组员" :value="2"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序">
<template slot-scope="scope">
<span v-if="!scope.row.ifEdit">{{ scope.row.sort }}</span>
<el-input v-model="tableDataEdit[scope.$index].sort" v-else />
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
type="text"
v-if="!scope.row.ifEdit"
size="small"
@click="onEdit(scope.$index)"
class="div-table-button--detail"
>
修改
</el-button>
<el-button
type="text"
v-if="scope.row.ifEdit"
size="small"
@click="onSave(tableDataEdit[scope.$index])"
class="div-table-button--detail"
>
保存
</el-button>
<el-button
type="text"
v-if="scope.row.ifEdit"
size="small"
@click="onClose(scope)"
class="div-table-button--detail"
>
取消
</el-button>
<el-button
type="text"
v-if="!scope.row.ifEdit"
size="small"
@click="onDelete(scope.row)"
class="div-table-button--detail"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-button size="small" style="width: 100%" @click="onAdd"
>+ 添加</el-button
>
<template slot="footer">
<el-button @click="handleCancle">关闭</el-button>
<!-- <el-button type="primary" @click="dataFormSubmitHandle()">{{
$t("confirm")
}}</el-button> -->
</template>
</el-dialog>
</template>
<script>
import { requestPost, requestGet } from "@/js/dai/request";
export default {
data() {
return {
loading: false,
visible: false,
dataForm: {},
form: {},
partyOrgId: null,
tableData: [],
tableDataEdit: [],
};
},
mounted() {
// this.visible = true;
},
methods: {
handleCancle() {
this.resetData();
this.visible = false;
},
async getData() {
await this.$http
.get("/resi/partymember/icpartymemberzxh/page", {
params: {
pageNo: 1,
pageSize: 200,
orgId: this.partyOrgId,
},
})
.then((res) => {
this.tableDataEdit = res.data.data.list;
this.tableData = res.data.data.list.map((item) => {
return {
...item,
ifEdit: false,
};
});
});
},
resetData() {
this.partyOrgId = null;
this.dataForm = {};
this.form = {};
this.partyOrgId = null;
this.tableData = [];
this.tableDataEdit = [];
},
//
dataFormSubmitHandle() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$http[!this.dataForm.id ? "post" : "put"](
"/resi/partymember/icPartyOrg/",
this.dataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(
res.internalMsg
? res.internalMsg
: res.msg
? res.msg
: "查询失败"
);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.resetData();
this.visible = false;
this.$emit("refreshDataList");
},
});
})
.catch(() => {});
});
},
onEdit(index) {
this.tableData[index].ifEdit = true;
},
async onSave(item) {
const row = { ...item, ifEdit: undefined };
let url = "/resi/partymember/icpartymemberzxh";
const { data, code, msg } = await requestPost(url, {
...row,
orgId: this.partyOrgId,
});
if (code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.getData();
} else {
this.$message.error(msg);
}
},
onClose(scope) {
if (scope.row.id) {
this.tableData = this.tableData.map((item, i) => {
if (scope.$index == i) {
return {
...item,
ifEdit: false,
};
}
return item;
});
this.tableDataEdit = this.tableData;
} else {
this.tableData = this.tableData.slice(0, -1);
this.tableDataEdit = this.tableDataEdit.slice(0, -1);
}
},
async onDelete(row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteActivity(row);
})
.catch((err) => {
if (err == "cancel") {
}
});
},
async deleteActivity(row) {
this.$http
.delete("/resi/partymember/icpartymemberzxh", { data: [row.id] })
.then((res) => {
this.$message({
type: "success",
message: "删除成功",
});
this.getData();
})
.catch((res) => {
this.$message.error(res.msg || "删除失败!");
});
},
onAdd() {
this.tableData = [
...this.tableData,
{ name: null, position: null, ifEdit: true },
];
this.tableDataEdit = [
...this.tableDataEdit,
{ name: null, position: null, ifEdit: true },
];
},
},
computed: {},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.form {
margin-top: 0;
}
.item_width_1 {
width: 560px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>

7
src/views/modules/partymember/icpartyorg-add-or-update.vue

@ -105,6 +105,13 @@
placeholder="党组织介绍"
></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input
style="width: 300px"
v-model="dataForm.sort"
placeholder="排序"
></el-input>
</el-form-item>
<el-form-item label="地图位置" prop="longitude" style="display: block">
<div style="width: 500px">
<el-select

18
src/views/modules/partymember/icpartyorgtree.vue

@ -57,13 +57,14 @@
>{{ "负责人" }}</el-button
>
<el-button
@click="openLdbz(scope.row)"
v-if="scope.row.partyOrgType==3||scope.row.partyOrgType==4||scope.row.partyOrgType==5"
@click="openDyzxh(scope.row)"
v-if="scope.row.partyOrgType==6"
type="text"
size="small"
class="div-table-button--detail"
>领导班子</el-button
>
党员中心户
</el-button>
<el-button
@click="openTj(scope.row)"
type="text"
@ -146,6 +147,9 @@
<editLdbz
ref="ldbz"
></editLdbz>
<editDyzxh
ref="dyzxh"
></editDyzxh>
<tongji
ref="tongji"
></tongji>
@ -210,6 +214,7 @@
<script>
import AddOrUpdate from "./icpartyorg-add-or-update";
import editLdbz from "./edit-ldbz";
import editDyzxh from "./edit-dyzxh";
import tongji from "./tongji";
// import TableTreeColumn from "@/components/table-tree-column";
import lookMember from "./lookMember";
@ -275,6 +280,7 @@ export default {
components: {
AddOrUpdate,
editLdbz,
editDyzxh,
lookMember,
tongji,
},
@ -465,6 +471,12 @@ export default {
this.$refs.ldbz.partyOrgId = item.id;
this.$refs.ldbz.getData()
},
openDyzxh(item){
this.dyzxhVisible = true;
this.$refs.dyzxh.visible = true;
this.$refs.dyzxh.partyOrgId = item.id;
this.$refs.dyzxh.getData()
},
openTj(item){
this.tongjiVisible = true;
this.$refs.tongji.visible = true;

Loading…
Cancel
Save