const branchUnionManage = {
template: `
基层干部审核
新建分工会
编辑
删除
`,
mixins: [initTableMixins],
data() {
return {
dialogFormVisible: false,
formData: {},
formRules: {
name: [{ required: true, message: "请输入工会名称", trigger: ["change", "blur"] }],
unionCode: [{ required: true, message: "请输入工会编码", trigger: ["change", "blur"] }],
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }]
}
}
},
methods: {
pageData() {
$.get("/platform/sys/union/pageData", this.pageForm).then((res) => {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
})
},
// 基层干部审核
openAudit() {
this.$emit('union-cadre')
},
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
openEdit(id) {
this.dialogFormVisible = true
$.get("/platform/sys/union/findOne", { id }).then((res) => {
this.formData = res.data
})
},
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (!valid) return
$.post("/platform/sys/union/" + (this.formData.id ? "update" : "insert"), this.formData).then((res) => {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.pageData()
this.$emit("refresh", null)
})
})
},
doDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
$.post("/platform/sys/union/doDelete", { id }).then((res) => {
this.$message.success(res.msg)
this.pageData()
this.$emit("refresh", null)
})
})
}
},
created() {
this.pageData()
}
}