| | |
| | | import { lintOnSave } from "../../../vue.config" |
| | | |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | labelData: [], |
| | | form: {}, |
| | |
| | | width: 96, |
| | | label: "姓名", |
| | | prop: "name", |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | }, |
| | |
| | | width: 106, |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | slot: true, |
| | |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | search: true, |
| | | labelWidth: 120, |
| | | searchSpan: 4, |
| | | slot: true, |
| | | }, |
| | |
| | | label: "性别", |
| | | prop: "gender", |
| | | type: "select", |
| | | labelWidth: 120, |
| | | dicData: [{ |
| | | label: "男", |
| | | value: 1 |
| | |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "roleType", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleType", |
| | | labelWidth: 120, |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "与角色关系", |
| | | prop: "relationship", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleRelation", |
| | | dataType: "number", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | |
| | | prop: "aoiName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | display: false |
| | | }, |
| | | |
| | | { |
| | |
| | | label: "标签", |
| | | prop: "householdLabelList", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "主要联系人", |
| | | prop: "isPrimaryContact", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=primaryContactType", |
| | | dataType: "number", |
| | | hide: true, |
| | | labelWidth: 120, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "居住情况", |
| | | prop: "residentialStatus", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth: 120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=residentialStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "生日", |
| | | prop: "birthday", |
| | | type: "date", |
| | | labelWidth: 120, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "港澳台通行证", |
| | | prop: "hkmtPass", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "护照", |
| | | prop: "passport", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "民族", |
| | | prop: "ethnicity", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth: 120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "学历", |
| | | prop: "education", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth: 120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "户籍登记地", |
| | | prop: "hukouRegistration", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "工作状态", |
| | | prop: "workStatus", |
| | | type: "select", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=workStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "工作单位", |
| | | prop: "employer", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "婚姻状态", |
| | | prop: "maritalStatus", |
| | | type: "select", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=marriageStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "车牌号", |
| | | prop: "cardNumber", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "其他联系方式", |
| | | prop: "otherContact", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "现居住地址", |
| | | prop: "currentAddress", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "残疾证", |
| | | prop: "disabilityCert", |
| | | labelWidth: 120, |
| | | hide: true, |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | watch: {}, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList () { |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.household_add, false), |
| | | viewBtn: this.vaildData(this.permission.household_view, true), |
| | |
| | | } |
| | | }, |
| | | |
| | | textDispose () { |
| | | textDispose() { |
| | | return (row, flag, type) => { |
| | | if (row[flag] || row[type] == null) { |
| | | return row[type] |
| | |
| | | } |
| | | }, |
| | | |
| | | labelDispose () { |
| | | labelDispose() { |
| | | return (list) => { |
| | | return list.map(item => item.labelName).join(',') |
| | | } |
| | | } |
| | | }, |
| | | mounted () { }, |
| | | mounted() { }, |
| | | methods: { |
| | | onsubmit () { |
| | | onsubmit() { |
| | | if (this.labelForm.color === '#EBEDF0') { |
| | | let params = { |
| | | householdId: this.currentRow.id, |
| | |
| | | } |
| | | }, |
| | | |
| | | changLabel (item) { |
| | | changLabel(item) { |
| | | this.editLabelFlge = true |
| | | this.currentLabel = item |
| | | this.labelForm.color = item.color |
| | | this.labelForm.remark = item.remark |
| | | }, |
| | | manageLabel (item) { |
| | | manageLabel(item) { |
| | | this.currentRow = item |
| | | this.loading = true |
| | | this.labelFlag = true |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | rowSave (row, done, loading) { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel (row) { |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset () { |
| | | searchReset() { |
| | | this.query = {} |
| | | this.treeDeptId = '' |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange (params, done) { |
| | | searchChange(params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange (list) { |
| | | selectionChange(list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | selectionClear() { |
| | | this.selectionList = [] |
| | | // this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete () { |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleImport () { |
| | | handleImport() { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter (res, done, loading, column) { |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleExport () { |
| | | handleExport() { |
| | | this.$confirm("是否导出住户数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | handleTemplate () { |
| | | handleTemplate() { |
| | | exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "住户数据模板.xlsx") |
| | | }) |
| | | }, |
| | | beforeOpen (done, type) { |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetatil(this.form.id).then(res => { |
| | | this.form = res.data.data |
| | |
| | | this.initFlag = true |
| | | done() |
| | | }, |
| | | currentChange (currentPage) { |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange (pageSize) { |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange () { |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | |
| | | onLoad (page, params = {}) { |
| | | onLoad(page, params = {}) { |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = { |
| | |
| | | }) |
| | | }, |
| | | |
| | | showStringDispose (row, type) { |
| | | showStringDispose(row, type) { |
| | | row[type] = !row[type] |
| | | } |
| | | } |