Merge remote-tracking branch 'origin/master'
| | |
| | | } |
| | | } |
| | | |
| | | if (JSON.stringify(res) == '{}') { |
| | | this.$router.push({ path: this.tagWel.value }) |
| | | } else { |
| | | this.$router.$avueRouter.formatRoutes(res.menuData, true) |
| | | |
| | | this.$router.push({ path: res.fistMenu.path }) |
| | | } |
| | | this.$router.$avueRouter.formatRoutes(res.menuData, true) |
| | | this.$router.push({ path: res.fistMenu.path }) |
| | | |
| | | loading.close() |
| | | }).catch(() => { |
| | |
| | | } |
| | | } |
| | | |
| | | function findChildrenRole (data, str) { |
| | | return data.split(',').find(item => item == str) |
| | | } |
| | | |
| | | function addPath(ele, first) { |
| | | const menu = website.menu; |
| | | const propsConfig = menu.props; |
| | |
| | | |
| | | dispatch("GetMenu").then((menuData) => { |
| | | let fistMenu = findChildrenUrl(menuData); |
| | | if (data.role_name == "jdgly" || data.role_name == "sqgly") { |
| | | if (findChildrenRole(data.role_name, "jdgly") ||findChildrenRole(data.role_name, "sqgly")) { |
| | | setStore({ name: "showMenu", content: true }); |
| | | |
| | | commit("SET_HOMEFIRSTTAGPAGE", { |
| | |
| | | |
| | | commit("SET_HOMEFIRSTPAGE", "/wel"); |
| | | |
| | | resolve({}); |
| | | resolve({ |
| | | fistMenu: { |
| | | path: "/wel", |
| | | }, |
| | | menuData, |
| | | }); |
| | | } else { |
| | | setStore({ name: "showMenu", content: false }); |
| | | |
| | |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentCode = (node.level === 0) ? "361102" : node.data.id; |
| | | const parentCode = (node.level === 0) ? "0" : node.data.id; |
| | | getLazyTree(parentCode).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | |
| | | <template> |
| | | <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose"> |
| | | |
| | | <div class="cur-container-box" v-if="roleBox"> |
| | | |
| | | <div class="cur-container-box"> |
| | | <div class="content-box"> |
| | | |
| | | <box-title class="m10" :classVal="9" :title="'基本信息'"></box-title> |
| | | <avue-form ref="baseForm" :option="option" v-model="form" :key="reload"></avue-form> |
| | | <avue-form v-if="baseShow" ref="baseForm" :option="option" v-model="form"></avue-form> |
| | | |
| | | <box-title class="m10" :classVal="9" :title="'其他信息'"></box-title> |
| | | <avue-form ref="restForm" :option="optionDetail" v-model="placeForm"></avue-form> |
| | | <avue-form v-if="restShow" ref="restForm" :option="optionDetail" v-model="placeForm"></avue-form> |
| | | |
| | | <box-title class="m10" :classVal="9" :title="'从业人员'"></box-title> |
| | | <avue-crud :option="placeOption" :table-loading="loading" :data="placeExt" ref="crud" |
| | |
| | | @current-change="holdCurrentChange" @size-change="holdSizeChange" @refresh-change="refreshHoldChange" |
| | | @on-load="holdOnLoad"> |
| | | </avue-crud> |
| | | |
| | | </div> |
| | | |
| | | <div class="footer-btn-box"> |
| | |
| | | |
| | | <el-button size="small" @click="roleBoxClose">关 闭</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | getPlace, |
| | | getPlaceExt, |
| | | |
| | | holdRemove, |
| | | holdAdd, |
| | | holdUpdate, |
| | | getHoldList, |
| | | |
| | | update, |
| | | updatePlaceExt, |
| | | } from "@/api/place/place" |
| | | |
| | | import website from '@/config/website' |
| | | import website from "@/config/website" |
| | | |
| | | import boxTitle from './boxTitle' |
| | | import boxTitle from "./boxTitle" |
| | | |
| | | export default { |
| | | data () { |
| | | |
| | | //手机号格式校验 |
| | | let validatorPhone = function (rule, value, callback) { |
| | | if (value) { |
| | | if (!/^1[3456789]\d{9}$/.test(value)) { |
| | | callback(new Error('手机号格式有误!')) |
| | | callback(new Error("手机号格式有误!")) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | } |
| | | |
| | | return { |
| | | reload: Math.random(), |
| | | roleBox: false, |
| | | baseShow: false, |
| | | restShow: false, |
| | | |
| | | placeExt: [], |
| | | |
| | |
| | | span: 12, |
| | | label: "场所名称", |
| | | prop: "placeName", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入场所名称", |
| | | trigger: "blur", |
| | | }], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入场所名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | |
| | | { |
| | | width: 160, |
| | |
| | | slot: true, |
| | | label: "地址", |
| | | prop: "location", |
| | | type: 'map', |
| | | type: "map", |
| | | dataType: "string", |
| | | span: 12, |
| | | value: [117.966460, 28.431002, ""], |
| | | value: [117.96646, 28.431002, ""], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "负责人", |
| | | prop: "principal", |
| | | rules: [{ |
| | | required: false, |
| | | message: "请输入负责人", |
| | | trigger: "blur", |
| | | }], |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入负责人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | |
| | | rules: [ |
| | | { |
| | | validator: validatorPhone, |
| | | trigger: 'blur' |
| | | } |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | |
| | | prop: "neiCode", |
| | | search: false, |
| | | type: "tree", |
| | | dataType: 'string', |
| | | dicUrl: "/api/blade-system/region/tree", |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | }, |
| | | cascader: ["gridCode"], |
| | | // dicFormatter: (res) => { |
| | | // return dsposeData(res.data) |
| | | // }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ], |
| | | }, |
| | | |
| | | |
| | | { |
| | | span: 7, |
| | | label: "场所标签", |
| | |
| | | cascader: ["smallLabel"], |
| | | props: { |
| | | label: "categoryName", |
| | | value: "categoryNo" |
| | | value: "categoryNo", |
| | | }, |
| | | dataType: "string", |
| | | hide: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入场所标签", |
| | | trigger: "blur", |
| | | },], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入场所标签", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | span: 5, |
| | |
| | | labelWidth: 20, |
| | | prop: "smallLabel", |
| | | type: "select", |
| | | dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}", |
| | | dicUrl: |
| | | "/api/blade-category/category/getCategory?parentNo={{label}}", |
| | | props: { |
| | | label: "categoryName", |
| | | value: "categoryNo" |
| | | value: "categoryNo", |
| | | }, |
| | | dataType: "string", |
| | | hide: true, |
| | |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: '绿', |
| | | value: 'green' |
| | | }, { |
| | | label: '黄', |
| | | value: 'yellow' |
| | | }, { |
| | | label: '红', |
| | | value: 'red' |
| | | } |
| | | label: "绿", |
| | | value: "green", |
| | | }, |
| | | { |
| | | label: "黄", |
| | | value: "yellow", |
| | | }, |
| | | { |
| | | label: "红", |
| | | value: "red", |
| | | }, |
| | | ], |
| | | props: { |
| | | label: "label", |
| | | value: "value" |
| | | value: "value", |
| | | }, |
| | | hide: true, |
| | | }, |
| | |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | name: 'name', |
| | | name: "name", |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | | }, |
| | | ] |
| | | ], |
| | | }, |
| | | |
| | | placeForm: {}, |
| | |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: '法人信息', |
| | | prop: 'legalPerson' |
| | | label: "法人信息", |
| | | prop: "legalPerson", |
| | | }, |
| | | |
| | | { |
| | |
| | | rules: [ |
| | | { |
| | | validator: validatorPhone, |
| | | trigger: 'blur' |
| | | } |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | name: 'name', |
| | | name: "name", |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | name: 'name', |
| | | name: "name", |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | | }, |
| | | |
| | | ] |
| | | ], |
| | | }, |
| | | |
| | | loading: true, |
| | |
| | | rules: [ |
| | | { |
| | | validator: validatorPhone, |
| | | trigger: 'blur' |
| | | } |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | |
| | | prop: "tempAddress", |
| | | searchSpan: 4, |
| | | search: true, |
| | | },] |
| | | }, |
| | | ], |
| | | }, |
| | | holdPage: { |
| | | pageSize: 20, |
| | |
| | | total: 0, |
| | | }, |
| | | houseHoldForm: {}, |
| | | |
| | | } |
| | | }, |
| | | |
| | |
| | | initOpen (newData) { |
| | | this.curRow = newData |
| | | this.roleBox = true |
| | | this.baseShow = false |
| | | this.restShow = false |
| | | this.form = {} |
| | | this.placeForm = {} |
| | | |
| | | const that = this |
| | | |
| | | that.$axios.all([ |
| | | getPlace(newData['id']), |
| | | getPlaceExt({ placeId: newData['id'] }), |
| | | ]).then(that.$axios.spread(function (baseInfo, restInfo) { |
| | | that.form = baseInfo.data.data |
| | | that.$axios |
| | | .all([getPlace(newData["id"]), getPlaceExt({ placeId: newData["id"] })]) |
| | | .then( |
| | | that.$axios.spread(function (baseInfo, restInfo) { |
| | | that.form = baseInfo.data.data |
| | | |
| | | that.form.location = [that.form.lng, that.form.lat, that.form.location].join(',') |
| | | that.form.location = [ |
| | | that.form.lng, |
| | | that.form.lat, |
| | | that.form.location, |
| | | ].join(",") |
| | | |
| | | if (that.form.imageUrls && that.form.imageUrls.length) { |
| | | that.form.imageUrls = that.form.imageUrls.split(",").filter(item => item != '').map(item => website.minioUrl + item).join(',') |
| | | } |
| | | if (that.form.imageUrls && that.form.imageUrls.length) { |
| | | that.form.imageUrls = that.form.imageUrls |
| | | .split(",") |
| | | .filter((item) => item != "") |
| | | .map((item) => website.minioUrl + item) |
| | | .join(",") |
| | | } |
| | | |
| | | if (that.form.placePoiLabelVOList && that.form.placePoiLabelVOList.length) { |
| | | let lebelTwo = that.form.placePoiLabelVOList.find(item => { |
| | | return item.type == 2 |
| | | if ( |
| | | that.form.placePoiLabelVOList && |
| | | that.form.placePoiLabelVOList.length |
| | | ) { |
| | | let lebelTwo = that.form.placePoiLabelVOList.find((item) => { |
| | | return item.type == 2 |
| | | }) |
| | | |
| | | if (lebelTwo) that.form.label = String(lebelTwo.poiCode) |
| | | |
| | | let lebelThree = that.form.placePoiLabelVOList.find((item) => { |
| | | return item.type == 3 |
| | | }) |
| | | |
| | | if (lebelThree) that.form.smallLabel = String(lebelThree.poiCode) |
| | | } |
| | | |
| | | that.baseShow = true |
| | | |
| | | const data = restInfo.data.data |
| | | |
| | | if (data) { |
| | | let imageUrls = data.imageUrls |
| | | let planImageUrls = data.planImageUrls |
| | | |
| | | if (imageUrls && imageUrls.length) { |
| | | imageUrls = imageUrls |
| | | .split(",") |
| | | .filter((item) => item != "") |
| | | .map((item) => website.minioUrl + item) |
| | | .join(",") |
| | | } |
| | | |
| | | if (planImageUrls && planImageUrls.length) { |
| | | planImageUrls = planImageUrls |
| | | .split(",") |
| | | .filter((item) => item != "") |
| | | .map((item) => website.minioUrl + item) |
| | | .join(",") |
| | | } |
| | | |
| | | that.placeForm = { |
| | | ...data, |
| | | imageUrls, |
| | | planImageUrls, |
| | | } |
| | | } |
| | | |
| | | that.restShow = true |
| | | }) |
| | | |
| | | if (lebelTwo) that.form.label = String(lebelTwo.poiCode) |
| | | |
| | | let lebelThree = that.form.placePoiLabelVOList.find(item => { |
| | | return item.type == 3 |
| | | }) |
| | | |
| | | if (lebelThree) that.form.smallLabel = String(lebelThree.poiCode) |
| | | } |
| | | |
| | | const data = restInfo.data.data |
| | | |
| | | if (data) { |
| | | let imageUrls = data.imageUrls |
| | | let planImageUrls = data.planImageUrls |
| | | |
| | | if (imageUrls && imageUrls.length) { |
| | | imageUrls = imageUrls.split(',').filter(item => item != '').map(item => website.minioUrl + item).join(",") |
| | | } |
| | | |
| | | if (planImageUrls && planImageUrls.length) { |
| | | planImageUrls = planImageUrls.split(',').filter(item => item != '').map(item => website.minioUrl + item).join(",") |
| | | } |
| | | |
| | | that.placeForm = { |
| | | ...data, |
| | | imageUrls, |
| | | planImageUrls |
| | | } |
| | | } |
| | | })) |
| | | ) |
| | | }, |
| | | |
| | | locationDispose (data) { |
| | | data = data.split(',') |
| | | data = data.split(",") |
| | | |
| | | return { |
| | | longitude: data[0], |
| | | latitude: data[1], |
| | | location: data[2] |
| | | location: data[2], |
| | | } |
| | | }, |
| | | |
| | |
| | | houseHoldRowSave (row, done, loading) { |
| | | holdAdd({ |
| | | ...row, |
| | | placeId: this.curRow.id |
| | | placeId: this.curRow.id, |
| | | }).then( |
| | | () => { |
| | | this.holdOnLoad(this.holdPage) |
| | |
| | | }, |
| | | |
| | | holdOnLoad (holdPage, params = {}) { |
| | | |
| | | if (!this.curRow.id) return |
| | | |
| | | let values = { |
| | | ...params, |
| | | placeId: this.curRow.id |
| | | placeId: this.curRow.id, |
| | | } |
| | | |
| | | getHoldList(holdPage.currentPage, holdPage.pageSize, values).then((res) => { |
| | | const data = res.data.data |
| | | getHoldList(holdPage.currentPage, holdPage.pageSize, values).then( |
| | | (res) => { |
| | | const data = res.data.data |
| | | |
| | | this.holdPage.total = data.total |
| | | this.placeExt = data.records |
| | | this.holdPage.total = data.total |
| | | this.placeExt = data.records |
| | | |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | } |
| | | ) |
| | | }, |
| | | |
| | | holdCurrentChange (currentPage) { |
| | |
| | | desposeImage (data) { |
| | | if (data.length > 0) { |
| | | var urls = [] |
| | | var split = data.split(",").filter(item => item != '') |
| | | split.forEach(url => { |
| | | var split = data.split(",").filter((item) => item != "") |
| | | split.forEach((url) => { |
| | | var names = url.split("jczz/") |
| | | urls.push(names[1]) |
| | | }) |
| | |
| | | let placeImages = this.desposeImage(this.placeForm.imageUrls) |
| | | let placePlanImageUrls = this.desposeImage(this.placeForm.planImageUrls) |
| | | |
| | | |
| | | let label = this.form.label |
| | | |
| | | if (this.form.smallLabel != '') { |
| | | label = label + ',' + this.form.smallLabel |
| | | if (this.form.smallLabel != "") { |
| | | label = label + "," + this.form.smallLabel |
| | | } |
| | | |
| | | delete this.form.smallLabel |
| | | |
| | | this.$refs.baseForm.validate((valid, done, msg) => { |
| | | if (valid) { |
| | | that.$axios.all([ |
| | | update({ |
| | | // ...this.placeElement.curRow, |
| | | ...this.form, |
| | | imageUrls, |
| | | label, |
| | | ...this.locationDispose(this.form.location) |
| | | }), |
| | | updatePlaceExt({ |
| | | ...this.placeForm, |
| | | imageUrls: placeImages, |
| | | planImageUrls: placePlanImageUrls |
| | | }) |
| | | ]).then(that.$axios.spread(function () { |
| | | that.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | that.$axios |
| | | .all([ |
| | | update({ |
| | | // ...this.placeElement.curRow, |
| | | ...this.form, |
| | | imageUrls, |
| | | label, |
| | | ...this.locationDispose(this.form.location), |
| | | }), |
| | | updatePlaceExt({ |
| | | ...this.placeForm, |
| | | imageUrls: placeImages, |
| | | planImageUrls: placePlanImageUrls, |
| | | }), |
| | | ]) |
| | | .then( |
| | | that.$axios.spread(function () { |
| | | that.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | |
| | | that.roleBoxClose() |
| | | that.roleBoxClose() |
| | | |
| | | that.placeElement.onLoad(that.placeElement.page, that.placeElement.query) |
| | | that.placeElement.onLoad( |
| | | that.placeElement.page, |
| | | that.placeElement.query |
| | | ) |
| | | |
| | | done() |
| | | })) |
| | | done() |
| | | }) |
| | | ) |
| | | } else { |
| | | console.log('error submit!!') |
| | | console.log("error submit!!") |
| | | return false |
| | | } |
| | | }) |
| | |
| | | |
| | | this.$refs.baseForm && this.$refs.baseForm.resetForm() |
| | | this.$refs.restForm && this.$refs.restForm.resetForm() |
| | | |
| | | this.baseShow = false |
| | | this.restShow = false |
| | | this.roleBox = false |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | hide: true, |
| | | span: 6, |
| | | cascader: ['city'], |
| | | dicUrl: `/api/blade-system/region/select`, |
| | | dicUrl: `/api/blade-system/region/select?code=100000`, |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择省份', |
| | |
| | | label: "社会信用代码", |
| | | prop: "socialCreditCode", |
| | | searchSpan: 5, |
| | | // searchLabelWidth: 124, |
| | | searchLabelWidth: 124, |
| | | search: true, |
| | | span: 18, |
| | | row: true, |
| | | width: 100, |
| | | |
| | | }, |
| | | { |
| | | label: "基础信息分", |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel" |
| | | @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.dept_delete" plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-circle-plus-outline" size="small" |
| | | @click.stop="handleAdd(scope.row, scope.index)" v-if="userInfo.role_name.includes('admin')">新增子项 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="deptCategory"> |
| | | <el-tag>{{ row.deptCategoryName }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel" |
| | | @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.dept_delete" plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-circle-plus-outline" size="small" |
| | | @click.stop="handleAdd(scope.row, scope.index)" v-if="permission.add_children">新增子项 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="deptCategory"> |
| | | <el-tag>{{ row.deptCategoryName }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getLazyList, |
| | | remove, |
| | | update, |
| | | add, |
| | | getDept, |
| | | getDeptTree |
| | | } from "@/api/system/dept"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from '@/config/website'; |
| | | getLazyList, |
| | | remove, |
| | | update, |
| | | add, |
| | | getDept, |
| | | getDeptTree |
| | | } from "@/api/system/dept" |
| | | import { mapGetters } from "vuex" |
| | | import website from '@/config/website' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | parentId: 0, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | lazy: true, |
| | | tip: false, |
| | | simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | tree: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | menuWidth: 300, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "机构名称", |
| | | prop: "deptName", |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "所属租户", |
| | | prop: "tenantId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/tenant/select", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | span: 24, |
| | | props: { |
| | | label: "tenantName", |
| | | value: "tenantId" |
| | | data () { |
| | | return { |
| | | form: {}, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | parentId: 0, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | hide: true, |
| | | search: false, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入所属租户", |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | { |
| | | label: "机构全称", |
| | | prop: "fullName", |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构全称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "上级机构", |
| | | prop: "parentId", |
| | | dicData: [], |
| | | type: "tree", |
| | | hide: true, |
| | | addDisabled: false, |
| | | props: { |
| | | label: "title" |
| | | option: { |
| | | lazy: true, |
| | | tip: false, |
| | | simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | tree: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | menuWidth: 300, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "机构名称", |
| | | prop: "deptName", |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "所属租户", |
| | | prop: "tenantId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/tenant/select", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | span: 24, |
| | | props: { |
| | | label: "tenantName", |
| | | value: "tenantId" |
| | | }, |
| | | hide: true, |
| | | search: false, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入所属租户", |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | { |
| | | label: "机构全称", |
| | | prop: "fullName", |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构全称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "上级机构", |
| | | prop: "parentId", |
| | | dicData: [], |
| | | type: "tree", |
| | | hide: true, |
| | | addDisabled: false, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | rules: [{ |
| | | required: false, |
| | | message: "请选择上级机构", |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | { |
| | | label: "机构类型", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=org_category", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | | }, |
| | | dataType: "number", |
| | | width: 120, |
| | | prop: "deptCategory", |
| | | slot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构类型", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "管辖区域", |
| | | prop: "regionCode", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/tree?cityCode=361100", |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | }, |
| | | defaultExpandedKeys: ["361102003"], |
| | | rules: [{ |
| | | required: false, |
| | | message: "请选择管辖区域", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "排序", |
| | | prop: "sort", |
| | | type: "number", |
| | | align: "right", |
| | | width: 80, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入排序", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remark", |
| | | rules: [{ |
| | | required: false, |
| | | message: "请输入备注", |
| | | trigger: "blur" |
| | | }], |
| | | span: 24, |
| | | hide: true |
| | | } |
| | | ] |
| | | }, |
| | | rules: [{ |
| | | required: false, |
| | | message: "请选择上级机构", |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | { |
| | | label: "机构类型", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=org_category", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | | }, |
| | | dataType: "number", |
| | | width: 120, |
| | | prop: "deptCategory", |
| | | slot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入机构类型", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "管辖区域", |
| | | prop: "regionCode", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/tree?cityCode=361100000000", |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | }, |
| | | defaultExpandedKeys: ["361102003"], |
| | | rules: [{ |
| | | required: false, |
| | | message: "请选择管辖区域", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "排序", |
| | | prop: "sort", |
| | | type: "number", |
| | | align: "right", |
| | | width: 80, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入排序", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remark", |
| | | rules: [{ |
| | | required: false, |
| | | message: "请输入备注", |
| | | trigger: "blur" |
| | | }], |
| | | span:24, |
| | | hide: true |
| | | } |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.dept_add, false), |
| | | viewBtn: this.vaildData(this.permission.dept_view, false), |
| | | delBtn: this.vaildData(this.permission.dept_delete, false), |
| | | editBtn: this.vaildData(this.permission.dept_edit, false) |
| | | }; |
| | | data: [] |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.dept_add, false), |
| | | viewBtn: this.vaildData(this.permission.dept_view, false), |
| | | delBtn: this.vaildData(this.permission.dept_delete, false), |
| | | editBtn: this.vaildData(this.permission.dept_edit, false) |
| | | } |
| | | }, |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | initData () { |
| | | getDeptTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.dicData = res.data.data |
| | | }) |
| | | }, |
| | | handleAdd (row) { |
| | | this.parentId = row.id |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.value = row.id |
| | | column.addDisabled = true |
| | | this.$refs.crud.rowAdd() |
| | | }, |
| | | rowSave (row, done, loading) { |
| | | add(row).then((res) => { |
| | | // 获取新增数据的相关字段 |
| | | const data = res.data.data |
| | | row.id = data.id |
| | | row.deptCategoryName = data.deptCategoryName |
| | | row.tenantId = data.tenantId |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row) |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row) |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel (row, index, done) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | // 数据回调进行刷新 |
| | | done(row) |
| | | }) |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | // 刷新表格数据并重载 |
| | | this.data = [] |
| | | this.parentId = 0 |
| | | this.$refs.crud.refreshTable() |
| | | this.$refs.crud.toggleSelection() |
| | | // 表格数据重载 |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["add", "edit"].includes(type)) { |
| | | this.initData() |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getDept(this.form.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | beforeClose (done) { |
| | | this.parentId = "" |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.value = "" |
| | | column.addDisabled = false |
| | | done() |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | treeLoad (tree, treeNode, resolve) { |
| | | const parentId = tree.id |
| | | getLazyList(parentId).then(res => { |
| | | resolve(res.data.data) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | initData() { |
| | | getDeptTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }, |
| | | handleAdd(row) { |
| | | this.parentId = row.id; |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.value = row.id; |
| | | column.addDisabled = true; |
| | | this.$refs.crud.rowAdd(); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then((res) => { |
| | | // 获取新增数据的相关字段 |
| | | const data = res.data.data; |
| | | row.id = data.id; |
| | | row.deptCategoryName = data.deptCategoryName; |
| | | row.tenantId = data.tenantId; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowDel(row, index, done) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | // 刷新表格数据并重载 |
| | | this.data = []; |
| | | this.parentId = 0; |
| | | this.$refs.crud.refreshTable(); |
| | | this.$refs.crud.toggleSelection(); |
| | | // 表格数据重载 |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["add", "edit"].includes(type)) { |
| | | this.initData(); |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getDept(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | beforeClose(done) { |
| | | this.parentId = ""; |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.value = ""; |
| | | column.addDisabled = false; |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style></style> |
| | |
| | | @row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" |
| | | @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.household_delete" |
| | | <!-- <template slot="menuLeft"> --> |
| | | <!-- <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.household_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button type="success" size="small" plain v-if="permission.household_import" |
| | |
| | | </el-button> |
| | | <el-button type="warning" size="small" plain v-if="permission.household_export" |
| | | icon="el-icon-download" @click="handleExport">导出 |
| | | </el-button> |
| | | </template> |
| | | </el-button> --> |
| | | <!-- </template> --> |
| | | |
| | | <template slot-scope="{row, size}" slot="menu"> |
| | | <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" |
| | |
| | | <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')" |
| | | icon="el-icon-download" @click="handleExport">导出 |
| | | </el-button> --> |
| | | <el-button type="success" size="small" plain v-if="permission.house_import" |
| | | icon="el-icon-upload2" @click="handleImport">导入 |
| | | </el-button> |
| | | <el-button type="warning" size="small" plain v-if="permission.house_export" |
| | | icon="el-icon-download" @click="handleExport">导出 |
| | | </el-button> |
| | | <!-- <el-button type="success" size="small" plain v-if="permission.house_import" icon="el-icon-upload2" |
| | | @click="handleImport">导入 |
| | | </el-button> --> |
| | | <!-- <el-button type="warning" size="small" plain v-if="permission.house_export" icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | </el-button> --> |
| | | </template> |
| | | <template slot-scope="{row}" slot="location"> |
| | | <span v-text="showLocation(row.location)"></span> |
| | | </template> |
| | | |
| | | <template slot-scope="{row, size}" slot="menu"> |
| | | <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" |
| | | v-if="permission.house_manager" @click="handleHouseholdManager(row)">住户管理 |
| | | </el-button> |
| | | <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" |
| | | v-if="permission.house_tag" @click="manageLabel(row)">标签 |
| | | <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" v-if="permission.house_tag" |
| | | @click="manageLabel(row)">标签 |
| | | </el-button> |
| | | </template> |
| | | |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { setLabelColor } from '@/util/util' |
| | | |
| | |
| | | } from "@/util/date" |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | import func from "@/util/func" |
| | | import householdManager from "./components/householdManager" |
| | | import Qs from "qs" |
| | | export default { |
| | |
| | | overHidden: true, |
| | | label: '地址', |
| | | parent: false, |
| | | prop: "houseName", |
| | | prop: "address", |
| | | display: false, |
| | | searchLabelWidth: 66, |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | overHidden: true, |
| | | slot: true, |
| | | label: "地址", |
| | | prop: "location", |
| | | type: 'map', |
| | | disabled: false, |
| | | dataType: "string", |
| | | searchLabelWidth: 66, |
| | | hide: true, |
| | | value: [117.966460, 28.431002, ""], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择巡查地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | | hide: true, |
| | | parent: false, |
| | |
| | | } |
| | | } |
| | | }, |
| | | watch: {}, |
| | | watch: { |
| | | 'form.source': { |
| | | handler (newData) { |
| | | |
| | | let locationColumn = this.findObject( |
| | | this.option.column, |
| | | 'location' |
| | | ) |
| | | |
| | | if (newData == 1) { |
| | | locationColumn.disabled = true |
| | | } else { |
| | | locationColumn.disabled = false |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList () { |
| | |
| | | } |
| | | } |
| | | }, |
| | | showLocation () { |
| | | return (data) => { |
| | | if (data != null && data.indexOf(',') != -1) { |
| | | data = data.split(',') |
| | | |
| | | return data[2] |
| | | } else { |
| | | return data || '' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | labelDispose () { |
| | | return (list) => { |
| | |
| | | }, |
| | | mounted () { }, |
| | | methods: { |
| | | locationDispose (data) { |
| | | data = data.split(',') |
| | | |
| | | return { |
| | | lng: data[0], |
| | | lat: data[1], |
| | | address: data[2] |
| | | } |
| | | }, |
| | | |
| | | onsubmit () { |
| | | if (this.labelForm.color === '#EBEDF0') { |
| | |
| | | row.imageUrls = urls.join(",") |
| | | } |
| | | |
| | | add(row).then(() => { |
| | | add({ ...row, ...this.locationDispose(row.location) } |
| | | ).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | row.imageUrls = urls.join(",") |
| | | } |
| | | |
| | | update(row).then(() => { |
| | | update({ ...row, ...this.locationDispose(row.location) }).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | }).then(res => { |
| | | this.form = res.data.data |
| | | |
| | | this.form.location = [this.form.lng, this.form.lat, this.form.address].join(',') |
| | | |
| | | if (this.form.imageUrls) { |
| | | if (this.form.imageUrls.length > 0) { |
| | | var urls = [] |
| | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style> |
| | | .box { |
| | | height: 800px; |