Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_web
| | |
| | | } |
| | | } |
| | | |
| | | 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", { |
| | |
| | | resolve({ fistMenu, menuData }); |
| | | } |
| | | |
| | | // commit("DEL_ALL_TAG"); |
| | | commit("DEL_ALL_TAG"); |
| | | }); |
| | | } |
| | | }) |
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2023-12-14 17:10:00 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2024-01-09 18:59:37 |
| | | * @FilePath: \jczz_web\src\views\task\reportForRepairs.vue |
| | | * @LastEditTime: 2024-01-24 14:04:48 |
| | | * @FilePath: \jczz_web\src\views\cGovernance\reportForRepairs.vue |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2023 by shuishen, All Rights Reserved. |
| | |
| | | </el-timeline> |
| | | </template> |
| | | |
| | | <template slot-scope="{row, size, index}" slot="menu"> |
| | | <template slot="menu"> |
| | | <el-button :size="size" v-if="permission.report_for_repairs_details" type="text" |
| | | icon="el-icon-document-remove" @click="rowExpansion(row)"> |
| | | 详情 |
| | |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 |
| | | <template slot-scope="{row, size, index}" slot="menuLeft"> |
| | | <el-button :size="size" type="primary" v-if="permission.reportForRepairs_add" icon="el-icon-plus" |
| | | @click="$refs.crud.rowAdd()">新增</el-button> |
| | | |
| | | <el-button :size="size" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 |
| | | 除 |
| | | </el-button> |
| | | </template> |
| | |
| | | searchMenuSpan: 3, |
| | | menuWidth: 280, |
| | | |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | |
| | | hide: true, |
| | | span: 6, |
| | | cascader: ['city'], |
| | | dicUrl: `/api/blade-system/region/select`, |
| | | dicUrl: `/api/blade-system/region/select?code=100000`, |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择省份', |
| | |
| | | <!-- 物业公司管理 --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | |
| | | <template slot-scope="{ row, size, index }" slot="menu"> |
| | | <!-- <el-button :size="size" type="text" v-if="row.applyStatus === 4" @click="handleWork(row)">调整申请 |
| | | </el-button> --> |
| | | <el-button :size="size" type="text" @click="goDetail(row)">查看申请 |
| | | <template slot-scope="{row, size, index}" slot="menu"> |
| | | <el-button type="text" :size="size" icon="el-icon-s-check" v-if="permission.work_todo_handle" |
| | | @click.stop="handleWork(row)">处理 |
| | | </el-button> |
| | | <!-- <el-button :size="size" type="text" @click="goDetail(row)">删 除 |
| | | </el-button> --> |
| | | <el-button type="text" :size="size" icon="el-icon-info" v-if="permission.work_todo_detail" |
| | | @click.stop="handleDetail(row)">详情 |
| | | </el-button> |
| | | <el-button type="text" :size="size" icon="el-icon-search" v-if="permission.work_todo_follow" |
| | | @click.stop="handleImage(row, index)">流程图 |
| | | </el-button> |
| | | </template> |
| | | <!-- <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCapitalApply_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> --> |
| | | <!-- <template slot="constructionSchemeUrlsType" slot-scope="{file}"> |
| | | <span>{{ file }}</span> |
| | | </template> --> |
| | | <template slot-scope="{row, size}" slot="processDefinitionVersion"> |
| | | <el-tag :size="size">v{{ row.processDefinitionVersion }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <flow-design is-dialog :is-display.sync="flowBox" :process-instance-id="processInstanceId"></flow-design> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getList, |
| | | remove, |
| | | update, |
| | | add, |
| | | getPropertyCapitalApply |
| | | } from "@/api/property/propertyCapitalApply" |
| | | import { |
| | | mapGetters |
| | | } from "vuex" |
| | | import website from '@/config/website' |
| | | import func from "@/util/func" |
| | | import { |
| | | todoList |
| | | } from "@/api/work/work" |
| | | import { |
| | | flowCategory, |
| | | flowRoute |
| | | } from "@/util/flow" |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: { |
| | | // constructionSchemeUrls:[] |
| | | }, |
| | | form: {}, |
| | | selectionId: '', |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | total: 0 |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | processInstanceId: '', |
| | | flowBox: false, |
| | | workBox: false, |
| | | option: { |
| | | labelWidth: 154, |
| | | labelWidth: 120, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 210, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 1150, |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | tip: false, |
| | | simplePage: true, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | // selection: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | dialogWidth: 900, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: "流程分类", |
| | | type: "select", |
| | | row: true, |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=flow", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | | }, |
| | | dataType: "number", |
| | | slot: true, |
| | | prop: "category", |
| | | // search: true, |
| | | hide: true, |
| | | width: 100, |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: '申请类型', |
| | | prop: 'categoryName', |
| | | // search: true, |
| | | }, |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区名称", |
| | | trigger: "blur", |
| | | }], |
| | | }, |
| | | |
| | | { |
| | | hide: true, |
| | | parent: false, |
| | | label: "小区", |
| | | prop: "districtId", |
| | | search: false, |
| | | // search: true, |
| | | type: 'tree', |
| | | dicUrl: `/api/blade-district/district/getDistrictTree`, |
| | | props: { |
| | |
| | | value: "id" |
| | | }, |
| | | defaultExpandedKeys: ["361102003"], |
| | | span: 12, |
| | | width: 260, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | |
| | | { |
| | | label: '维修项目名称', |
| | | prop: 'name', |
| | | searchSpan: 5, |
| | | searchLabelWidth: 124, |
| | | search: true, |
| | | span: 12, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入维修项目名称", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "预计开工时间", |
| | | prop: "runTime", |
| | | span: 12, |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择合同开始时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "预计竣工时间", |
| | | prop: "completedTime", |
| | | span: 12, |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择合同结束时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | label: "项目分摊方式", |
| | | prop: "allocationWay", |
| | | value: '按建筑面积分摊', |
| | | span: 14, |
| | | row: true, |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: '联系人', |
| | | prop: 'linkman', |
| | | span: 12, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 80, |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入联系人", |
| | | trigger: "blur", |
| | | }, ], |
| | | // search: true, |
| | | }, |
| | | { |
| | | width: 120, |
| | | label: '联系方式', |
| | | label: '联系电话', |
| | | prop: 'linkPhone', |
| | | span: 12, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入联系方式", |
| | | trigger: "blur", |
| | | }, ], |
| | | // search: true, |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: '项目名称', |
| | | prop: 'name', |
| | | // search: true, |
| | | }, |
| | | { |
| | | label: '当前步骤', |
| | | prop: 'taskName', |
| | | }, |
| | | // { |
| | | // label: '流程版本', |
| | | // prop: 'processDefinitionVersion', |
| | | // // slot: true, |
| | | // width: 80, |
| | | // }, |
| | | { |
| | | width: 144, |
| | | label: '申请时间', |
| | | prop: 'applyTime', |
| | | span: 12, |
| | | display: false, |
| | | }, { |
| | | label: '审核进度', |
| | | prop: 'applyStatus', |
| | | span: 12, |
| | | display: false, |
| | | dicData: [{ |
| | | label: "待审核", |
| | | value: 0, |
| | | }, { |
| | | label: "业委会", |
| | | value: 1, |
| | | }, { |
| | | label: "街道", |
| | | value: 2, |
| | | }, { |
| | | label: "住建局", |
| | | value: 3, |
| | | }, { |
| | | label: "调整申请", |
| | | value: 4, |
| | | }, { |
| | | label: "审核通过", |
| | | value: 5, |
| | | }, { |
| | | label: "审核不通过", |
| | | value: 6, |
| | | }] |
| | | prop: 'createTime', |
| | | }, |
| | | { |
| | | label: "项目预算总金额(元)", |
| | | prop: "budgetAmount", |
| | | span: 12, |
| | | hide: true, |
| | | type: 'number', |
| | | precision: 2, |
| | | value: '0.00' |
| | | }, |
| | | { |
| | | label: "实际预算金额(元)", |
| | | prop: "actualAmount", |
| | | span: 12, |
| | | hide: true, |
| | | type: 'number', |
| | | precision: 2, |
| | | value: '0.00' |
| | | }, |
| | | { |
| | | label: "自筹金额(元)", |
| | | prop: "selfAmount", |
| | | span: 12, |
| | | hide: true, |
| | | type: 'number', |
| | | precision: 2, |
| | | value: '0.00' |
| | | }, |
| | | { |
| | | label: "预算应拨付金额(元)", |
| | | prop: "budgetAppropriateAmount", |
| | | span: 12, |
| | | hide: true, |
| | | type: 'number', |
| | | precision: 2, |
| | | value: '0.00' |
| | | }, |
| | | { |
| | | label: "项目摘要", |
| | | span: 24, |
| | | hide: true, |
| | | prop: "projectDigest", |
| | | placeholder: "例如:“XX小区XX栋XX设施设备维修,总的预算金额是X,是否含有审价,本次维修涉及范围共XX户,总面积的建筑面积为XX平方米”", |
| | | type: "textarea" |
| | | }, |
| | | { |
| | | label: "项目进度描述", |
| | | span: 24, |
| | | hide: true, |
| | | prop: "projectDescribe", |
| | | type: "textarea" |
| | | }, |
| | | { |
| | | label: '施工方案附件', |
| | | prop: 'constructionSchemeUrls', |
| | | type: 'upload', |
| | | span: 24, |
| | | hide: true, |
| | | multiple: true, |
| | | // showFileList: true, |
| | | propsHttp: { |
| | | res: 'data', |
| | | name: "originalName", |
| | | url: "link" |
| | | }, |
| | | action: '/api/blade-resource/oss/endpoint/put-file-attach', |
| | | rules: [{ |
| | | required: true, |
| | | message: "请上传施工方案", |
| | | trigger: "blur", |
| | | }, ], |
| | | } |
| | | ], |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [] |
| | | } |
| | | }, |
| | | watch: {}, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.propertyCapitalApply_add, true), |
| | | viewBtn: this.vaildData(this.permission.propertyCapitalApply_view, true), |
| | | delBtn: this.vaildData(this.permission.propertyCapitalApply_delete, true), |
| | | editBtn: this.vaildData(this.permission.propertyCapitalApply_edit, true), |
| | | } |
| | | }, |
| | | ...mapGetters(["permission", "flowRoutes"]), |
| | | ids() { |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleWork(row) { |
| | | this.$router.push({ |
| | | path: `/work/process/maintenanceFundApply/edit/${row.taskId}/${row.processInstanceId}/${row.id}` |
| | | }) |
| | | }, |
| | | goDetail(row) { |
| | | this.$router.push({ |
| | | path: `/work/process/maintenanceFundApply/detail/${row.processInstanceId}/${row.id}` |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | row.constructionSchemeUrls = func.join(row.constructionSchemeUrls) |
| | | if (row.constructionSchemeUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.constructionSchemeUrls.split(",") |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/") |
| | | urls.push(names[1]) |
| | | }) |
| | | row.constructionSchemeUrls = urls.join(",") |
| | | } |
| | | row.propertyFlag = 1 |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.constructionSchemeUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.constructionSchemeUrls.split(",") |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/") |
| | | urls.push(names[1]) |
| | | }) |
| | | row.constructionSchemeUrls = urls.join(",") |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | window.console.log(error) |
| | | loading() |
| | | } |
| | | ) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | handleWork(row) { |
| | | this.$router.push({ |
| | | path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/handle/${row.taskId}/${row.processInstanceId}/${row.businessId}` |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getPropertyCapitalApply(this.form.id).then((res) => { |
| | | this.form = res.data.data |
| | | this.form.propertyFlag = 1 |
| | | if (this.form.constructionSchemeUrls.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.constructionSchemeUrls.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.constructionSchemeUrls = urls.join(",") |
| | | } |
| | | }) |
| | | } |
| | | // con |
| | | done() |
| | | handleDetail(row) { |
| | | this.$router.push({ |
| | | path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/detail/${row.processInstanceId}/${row.businessId}` |
| | | }) |
| | | }, |
| | | handleImage(row) { |
| | | this.processInstanceId = row.processInstanceId |
| | | this.flowBox = true |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage |
| | |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { |
| | | dateTime |
| | | } = this.query |
| | | let values = { |
| | | ...params, |
| | | } |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | } |
| | | values.dateTime = null |
| | | const query = { |
| | | ...this.query, |
| | | category: (params.category) ? flowCategory(params.category) : null |
| | | } |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | todoList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.data.forEach(item => { |
| | | if (item.constructionSchemeUrls.length > 0) { |
| | | var urls = [] |
| | | var names = item.constructionSchemeUrls.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.constructionSchemeUrls = urls.join(",") |
| | | } |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| | | </script> |
| | |
| | | <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=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 |
| | | } |
| | | ] |
| | | }, |
| | | 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> |
| | |
| | | }, |
| | | { |
| | | imageUrl: 'img/tiwen.png', |
| | | url: '/task/reportForRepairs', |
| | | url: '/cGovernance/reportForRepairs', |
| | | title: '报事报修', |
| | | newOpen: false, |
| | | }, |