const branchUnionUserManage = {
template:
/*language=HTML*/
`
添加
`,
mixins: [initTableMixins],
props: {
union_id: {
type: String,
required: true
}
},
data() {
return {
pageForm: {
searchName: "username"
},
dialogFormVisible: false,
formData: {}
}
},
watch: {
union_id(val) {
this.doSearch()
}
},
methods: {
openAdd() {
this.dialogFormVisible = true
this.$nextTick(() => {
this.formData = {}
})
},
doSubmit() {
this.$axios.post("/platform/sys/union/insertBranchUnionUserRole", {
...this.formData,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.doSearch()
} else {
this.$message.error(res.msg)
}
})
},
doDelete({ userId, roleCode }) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then((res) => {
$.post("/platform/sys/union/deleteBranchUnionUserRole", {
userId,
roleCode,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
pageData() {
$.get("/platform/sys/union/branchUnionUserPageData", {
...this.pageForm,
unionId: this.union_id
}).then((res) => {
if (res.code === 0) {
this.tableData = res.data
}
})
}
},
created() {
this.pageData()
},
style: /*language=CSS*/ `
/deep/ .el-select {
width: 100% !important;
}
`
}