Commit 20e526fa93f88b1e55561e9e4867cb36d9b89f8e

Authored by wuxw
1 parent 34fbc487

完成业务会功能

src/api/owner/addOwnerCommitteeApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 保存业委会信息
  4 +export function saveOwnerCommittee(data) {
  5 + return new Promise((resolve, reject) => {
  6 + request({
  7 + url: '/ownerCommittee.saveOwnerCommittee',
  8 + method: 'post',
  9 + data
  10 + }).then(response => {
  11 + const res = response.data
  12 + if (res.code === 0) {
  13 + resolve(res)
  14 + } else {
  15 + reject(new Error(res.msg || '保存业委会信息失败'))
  16 + }
  17 + }).catch(error => {
  18 + reject(error)
  19 + })
  20 + })
  21 +}
0 \ No newline at end of file 22 \ No newline at end of file
src/api/owner/editOwnerCommitteeApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取业委会详情
  5 +export function getOwnerCommitteeDetail(params) {
  6 + return new Promise((resolve, reject) => {
  7 + const communityId = getCommunityId()
  8 + request({
  9 + url: '/ownerCommittee.listOwnerCommittee',
  10 + method: 'get',
  11 + params: {
  12 + ...params,
  13 + communityId,
  14 + page: 1,
  15 + row: 1
  16 + }
  17 + }).then(response => {
  18 + const res = response.data
  19 + if (res.code === 0 && res.data && res.data.length > 0) {
  20 + resolve({ data: res.data[0] })
  21 + } else {
  22 + reject(new Error(res.msg || 'Failed to get owner committee details'))
  23 + }
  24 + }).catch(error => {
  25 + reject(error)
  26 + })
  27 + })
  28 +}
  29 +
  30 +// 更新业委会信息
  31 +export function updateOwnerCommittee(data) {
  32 + return new Promise((resolve, reject) => {
  33 + const communityId = getCommunityId()
  34 + request({
  35 + url: '/ownerCommittee.updateOwnerCommittee',
  36 + method: 'post',
  37 + data: {
  38 + ...data,
  39 + communityId
  40 + }
  41 + }).then(response => {
  42 + const res = response.data
  43 + if (res.code === 0) {
  44 + resolve(res)
  45 + } else {
  46 + reject(new Error(res.msg || 'Failed to update owner committee'))
  47 + }
  48 + }).catch(error => {
  49 + reject(error)
  50 + })
  51 + })
  52 +}
  53 +
  54 +// 获取业委会紧急联系人列表
  55 +export function listOwnerCommitteeContract(params) {
  56 + return new Promise((resolve, reject) => {
  57 + const communityId = getCommunityId()
  58 + request({
  59 + url: '/ownerCommittee.listOwnerCommitteeContract',
  60 + method: 'get',
  61 + params: {
  62 + ...params,
  63 + communityId,
  64 + page: 1,
  65 + row: 100
  66 + }
  67 + }).then(response => {
  68 + const res = response.data
  69 + if (res.code === 0) {
  70 + resolve({
  71 + data: res.data.map(item => ({
  72 + ...item,
  73 + id: item.contractId
  74 + }))
  75 + })
  76 + } else {
  77 + reject(new Error(res.msg || 'Failed to get emergency contacts'))
  78 + }
  79 + }).catch(error => {
  80 + reject(error)
  81 + })
  82 + })
  83 +}
0 \ No newline at end of file 84 \ No newline at end of file
src/api/owner/ownerCommitteeDetailApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取业委会成员详情
  5 +export function getOwnerCommitteeDetail(params) {
  6 + return new Promise((resolve, reject) => {
  7 + const communityId = getCommunityId()
  8 + const queryParams = {
  9 + ...params,
  10 + communityId
  11 + }
  12 +
  13 + request({
  14 + url: '/ownerCommittee.listOwnerCommittee',
  15 + method: 'get',
  16 + params: queryParams
  17 + }).then(response => {
  18 + const res = response.data
  19 + if (res.code === 0) {
  20 + resolve(res)
  21 + } else {
  22 + reject(new Error(res.msg || 'Failed to get owner committee details'))
  23 + }
  24 + }).catch(error => {
  25 + reject(error)
  26 + })
  27 + })
  28 +}
  29 +
  30 +// 获取业委会成员紧急联系人
  31 +export function listOwnerCommitteeContracts(params) {
  32 + return new Promise((resolve, reject) => {
  33 + const communityId = getCommunityId()
  34 + const queryParams = {
  35 + ...params,
  36 + communityId
  37 + }
  38 +
  39 + request({
  40 + url: '/ownerCommittee.listOwnerCommitteeContract',
  41 + method: 'get',
  42 + params: queryParams
  43 + }).then(response => {
  44 + const res = response.data
  45 + if (res.code === 0) {
  46 + resolve(res)
  47 + } else {
  48 + reject(new Error(res.msg || 'Failed to get emergency contacts'))
  49 + }
  50 + }).catch(error => {
  51 + reject(error)
  52 + })
  53 + })
  54 +}
0 \ No newline at end of file 55 \ No newline at end of file
src/api/owner/ownerCommitteeManageApi.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +import { getCommunityId } from '@/api/community/communityApi'
  3 +
  4 +// 获取业委会列表
  5 +export function listOwnerCommittee(params) {
  6 + return new Promise((resolve, reject) => {
  7 + request({
  8 + url: '/ownerCommittee.listOwnerCommittee',
  9 + method: 'get',
  10 + params: {
  11 + ...params,
  12 + communityId: params.communityId || getCommunityId()
  13 + }
  14 + }).then(response => {
  15 + const res = response.data
  16 + if (res.code === 0) {
  17 + resolve({
  18 + data: res.data,
  19 + total: res.total
  20 + })
  21 + } else {
  22 + reject(new Error(res.msg || '获取业委会列表失败'))
  23 + }
  24 + }).catch(error => {
  25 + reject(error)
  26 + })
  27 + })
  28 +}
  29 +
  30 +// 删除业委会成员
  31 +export function deleteOwnerCommittee(data) {
  32 + return new Promise((resolve, reject) => {
  33 + request({
  34 + url: '/ownerCommittee.deleteOwnerCommittee',
  35 + method: 'post',
  36 + data: {
  37 + ...data,
  38 + communityId: data.communityId || getCommunityId()
  39 + }
  40 + }).then(response => {
  41 + const res = response.data
  42 + if (res.code === 0) {
  43 + resolve(res)
  44 + } else {
  45 + reject(new Error(res.msg || '删除业委会成员失败'))
  46 + }
  47 + }).catch(error => {
  48 + reject(error)
  49 + })
  50 + })
  51 +}
0 \ No newline at end of file 52 \ No newline at end of file
src/components/owner/AddOwnerCommittee.vue 0 → 100644
  1 +<template>
  2 + <el-dialog
  3 + :title="$t('addOwnerCommittee.addTitle')"
  4 + :visible.sync="visible"
  5 + width="80%"
  6 + @close="resetForm"
  7 + >
  8 + <el-form ref="form" :model="formData" label-width="120px" :rules="rules">
  9 + <el-row :gutter="20">
  10 + <el-col :span="12">
  11 + <el-form-item :label="$t('addOwnerCommittee.name')" prop="name">
  12 + <el-input
  13 + v-model="formData.name"
  14 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.name')"
  15 + />
  16 + </el-form-item>
  17 + </el-col>
  18 + <el-col :span="12">
  19 + <el-form-item :label="$t('addOwnerCommittee.sex')" prop="sex">
  20 + <el-select
  21 + v-model="formData.sex"
  22 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.sex')"
  23 + style="width:100%"
  24 + >
  25 + <el-option :label="$t('addOwnerCommittee.male')" value="B" />
  26 + <el-option :label="$t('addOwnerCommittee.female')" value="G" />
  27 + </el-select>
  28 + </el-form-item>
  29 + </el-col>
  30 + </el-row>
  31 +
  32 + <el-row :gutter="20">
  33 + <el-col :span="12">
  34 + <el-form-item :label="$t('addOwnerCommittee.phone')" prop="link">
  35 + <el-input
  36 + v-model="formData.link"
  37 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.phone')"
  38 + />
  39 + </el-form-item>
  40 + </el-col>
  41 + <el-col :span="12">
  42 + <el-form-item :label="$t('addOwnerCommittee.idCard')" prop="idCard">
  43 + <el-input
  44 + v-model="formData.idCard"
  45 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.idCard')"
  46 + />
  47 + </el-form-item>
  48 + </el-col>
  49 + </el-row>
  50 +
  51 + <el-row :gutter="20">
  52 + <el-col :span="12">
  53 + <el-form-item :label="$t('addOwnerCommittee.address')" prop="address">
  54 + <el-input
  55 + v-model="formData.address"
  56 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.address')"
  57 + />
  58 + </el-form-item>
  59 + </el-col>
  60 + <el-col :span="12">
  61 + <el-form-item :label="$t('addOwnerCommittee.position')" prop="position">
  62 + <el-input
  63 + v-model="formData.position"
  64 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.position')"
  65 + />
  66 + </el-form-item>
  67 + </el-col>
  68 + </el-row>
  69 +
  70 + <el-row :gutter="20">
  71 + <el-col :span="12">
  72 + <el-form-item :label="$t('addOwnerCommittee.post')" prop="post">
  73 + <el-input
  74 + v-model="formData.post"
  75 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.post')"
  76 + />
  77 + </el-form-item>
  78 + </el-col>
  79 + <el-col :span="12">
  80 + <el-form-item :label="$t('addOwnerCommittee.postDesc')">
  81 + <el-input
  82 + v-model="formData.postDesc"
  83 + :placeholder="$t('addOwnerCommittee.optional') + $t('addOwnerCommittee.postDesc')"
  84 + />
  85 + </el-form-item>
  86 + </el-col>
  87 + </el-row>
  88 +
  89 + <el-row :gutter="20">
  90 + <el-col :span="12">
  91 + <el-form-item :label="$t('addOwnerCommittee.appointTime')" prop="appointTime">
  92 + <el-input
  93 + v-model="formData.appointTime"
  94 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.appointTime')"
  95 + />
  96 + </el-form-item>
  97 + </el-col>
  98 + <el-col :span="12">
  99 + <el-form-item :label="$t('addOwnerCommittee.curTime')" prop="curTime">
  100 + <el-input
  101 + v-model="formData.curTime"
  102 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.curTime')"
  103 + />
  104 + </el-form-item>
  105 + </el-col>
  106 + </el-row>
  107 +
  108 + <el-row :gutter="20">
  109 + <el-col :span="12">
  110 + <el-form-item :label="$t('addOwnerCommittee.state')" prop="state">
  111 + <el-select
  112 + v-model="formData.state"
  113 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.state')"
  114 + style="width:100%"
  115 + >
  116 + <el-option :label="$t('addOwnerCommittee.inService')" value="1000" />
  117 + <el-option :label="$t('addOwnerCommittee.leave')" value="2000" />
  118 + </el-select>
  119 + </el-form-item>
  120 + </el-col>
  121 + <el-col :span="12">
  122 + <el-form-item :label="$t('addOwnerCommittee.remark')">
  123 + <el-input
  124 + v-model="formData.remark"
  125 + type="textarea"
  126 + :placeholder="$t('addOwnerCommittee.optional') + $t('addOwnerCommittee.remark')"
  127 + />
  128 + </el-form-item>
  129 + </el-col>
  130 + </el-row>
  131 +
  132 + <el-card class="box-card" style="margin-top:20px">
  133 + <div slot="header" class="clearfix">
  134 + <span>{{ $t('addOwnerCommittee.emergencyContact') }}</span>
  135 + <el-button type="primary" size="mini" style="float: right; padding: 3px 0" @click="addContract">
  136 + {{ $t('addOwnerCommittee.add') }}
  137 + </el-button>
  138 + </div>
  139 + <el-table :data="formData.contracts" border style="width: 100%">
  140 + <el-table-column :label="$t('addOwnerCommittee.contactRelation')" align="center">
  141 + <template slot-scope="scope">
  142 + <el-input
  143 + v-model="scope.row.relName"
  144 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.contactRelation')"
  145 + />
  146 + </template>
  147 + </el-table-column>
  148 + <el-table-column :label="$t('addOwnerCommittee.contactName')" align="center">
  149 + <template slot-scope="scope">
  150 + <el-input
  151 + v-model="scope.row.name"
  152 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.contactName')"
  153 + />
  154 + </template>
  155 + </el-table-column>
  156 + <el-table-column :label="$t('addOwnerCommittee.contactPhone')" align="center">
  157 + <template slot-scope="scope">
  158 + <el-input
  159 + v-model="scope.row.link"
  160 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.contactPhone')"
  161 + />
  162 + </template>
  163 + </el-table-column>
  164 + <el-table-column :label="$t('addOwnerCommittee.contactAddress')" align="center" width="250">
  165 + <template slot-scope="scope">
  166 + <el-input
  167 + v-model="scope.row.address"
  168 + :placeholder="$t('addOwnerCommittee.required') + $t('addOwnerCommittee.contactAddress')"
  169 + />
  170 + </template>
  171 + </el-table-column>
  172 + <el-table-column :label="$t('addOwnerCommittee.operation')" align="center" width="100">
  173 + <template slot-scope="scope">
  174 + <el-button type="danger" size="mini" @click="deleteContract(scope.row)">
  175 + {{ $t('addOwnerCommittee.delete') }}
  176 + </el-button>
  177 + </template>
  178 + </el-table-column>
  179 + </el-table>
  180 + </el-card>
  181 + </el-form>
  182 +
  183 + <div slot="footer" class="dialog-footer">
  184 + <el-button @click="visible = false">{{ $t('addOwnerCommittee.back') }}</el-button>
  185 + <el-button type="primary" @click="saveOwnerCommitteeInfo">{{ $t('addOwnerCommittee.save') }}</el-button>
  186 + </div>
  187 + </el-dialog>
  188 +</template>
  189 +
  190 +<script>
  191 +import { saveOwnerCommittee } from '@/api/owner/addOwnerCommitteeApi'
  192 +import { getCommunityId } from '@/api/community/communityApi'
  193 +
  194 +export default {
  195 + name: 'AddOwnerCommittee',
  196 + data() {
  197 + return {
  198 + visible: false,
  199 + formData: {
  200 + name: '',
  201 + sex: '',
  202 + link: '',
  203 + idCard: '',
  204 + address: '',
  205 + position: '',
  206 + post: '',
  207 + postDesc: '',
  208 + appointTime: '',
  209 + curTime: '',
  210 + state: '',
  211 + remark: '',
  212 + contracts: []
  213 + },
  214 + rules: {
  215 + name: [
  216 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.name'), trigger: 'blur' },
  217 + { max: 30, message: this.$t('addOwnerCommittee.name') + this.$t('addOwnerCommittee.maxLength30'), trigger: 'blur' }
  218 + ],
  219 + sex: [
  220 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.sex'), trigger: 'change' }
  221 + ],
  222 + link: [
  223 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.phone'), trigger: 'blur' },
  224 + { max: 11, message: this.$t('addOwnerCommittee.phone') + this.$t('addOwnerCommittee.maxLength11'), trigger: 'blur' }
  225 + ],
  226 + idCard: [
  227 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.idCard'), trigger: 'blur' },
  228 + { max: 18, message: this.$t('addOwnerCommittee.idCard') + this.$t('addOwnerCommittee.maxLength18'), trigger: 'blur' }
  229 + ],
  230 + address: [
  231 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.address'), trigger: 'blur' },
  232 + { max: 256, message: this.$t('addOwnerCommittee.address') + this.$t('addOwnerCommittee.maxLength256'), trigger: 'blur' }
  233 + ],
  234 + position: [
  235 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.position'), trigger: 'blur' },
  236 + { max: 64, message: this.$t('addOwnerCommittee.position') + this.$t('addOwnerCommittee.maxLength64'), trigger: 'blur' }
  237 + ],
  238 + post: [
  239 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.post'), trigger: 'blur' },
  240 + { max: 64, message: this.$t('addOwnerCommittee.post') + this.$t('addOwnerCommittee.maxLength64'), trigger: 'blur' }
  241 + ],
  242 + postDesc: [
  243 + { max: 64, message: this.$t('addOwnerCommittee.postDesc') + this.$t('addOwnerCommittee.maxLength64'), trigger: 'blur' }
  244 + ],
  245 + appointTime: [
  246 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.appointTime'), trigger: 'blur' },
  247 + { max: 256, message: this.$t('addOwnerCommittee.appointTime') + this.$t('addOwnerCommittee.maxLength256'), trigger: 'blur' }
  248 + ],
  249 + curTime: [
  250 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.curTime'), trigger: 'blur' },
  251 + { max: 256, message: this.$t('addOwnerCommittee.curTime') + this.$t('addOwnerCommittee.maxLength256'), trigger: 'blur' }
  252 + ],
  253 + state: [
  254 + { required: true, message: this.$t('addOwnerCommittee.required') + this.$t('addOwnerCommittee.state'), trigger: 'change' }
  255 + ],
  256 + remark: [
  257 + { max: 200, message: this.$t('addOwnerCommittee.remark') + this.$t('addOwnerCommittee.maxLength200'), trigger: 'blur' }
  258 + ]
  259 + }
  260 + }
  261 + },
  262 + methods: {
  263 + open() {
  264 + this.visible = true
  265 + },
  266 + resetForm() {
  267 + this.$refs.form.resetFields()
  268 + this.formData = {
  269 + name: '',
  270 + sex: '',
  271 + link: '',
  272 + idCard: '',
  273 + address: '',
  274 + position: '',
  275 + post: '',
  276 + postDesc: '',
  277 + appointTime: '',
  278 + curTime: '',
  279 + state: '',
  280 + remark: '',
  281 + contracts: []
  282 + }
  283 + },
  284 + addContract() {
  285 + this.formData.contracts.push({
  286 + id: this.generateUUID(),
  287 + relName: '',
  288 + name: '',
  289 + link: '',
  290 + address: ''
  291 + })
  292 + },
  293 + deleteContract(contract) {
  294 + const index = this.formData.contracts.findIndex(item => item.id === contract.id)
  295 + if (index !== -1) {
  296 + this.formData.contracts.splice(index, 1)
  297 + }
  298 + },
  299 + generateUUID() {
  300 + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  301 + const r = Math.random() * 16 | 0
  302 + const v = c === 'x' ? r : (r & 0x3 | 0x8)
  303 + return v.toString(16)
  304 + })
  305 + },
  306 + async saveOwnerCommitteeInfo() {
  307 + this.$refs.form.validate(async valid => {
  308 + if (valid) {
  309 + try {
  310 + const communityId = await getCommunityId()
  311 + const data = {
  312 + ...this.formData,
  313 + communityId
  314 + }
  315 + await saveOwnerCommittee(data)
  316 + this.$message.success(this.$t('common.saveSuccess'))
  317 + this.visible = false
  318 + this.$emit('success')
  319 + } catch (error) {
  320 + this.$message.error(error.message || this.$t('common.saveFailed'))
  321 + }
  322 + }
  323 + })
  324 + }
  325 + }
  326 +}
  327 +</script>
0 \ No newline at end of file 328 \ No newline at end of file
src/components/owner/DeleteOwnerCommittee.vue 0 → 100644
  1 +<template>
  2 + <el-dialog :title="$t('ownerCommitteeManage.deleteTitle')" :visible.sync="visible" width="500px"
  3 + :close-on-click-modal="false" @close="handleClose">
  4 + <div class="delete-confirm">
  5 + <p>{{ $t('common.deleteConfirm') }}</p>
  6 + </div>
  7 +
  8 + <div slot="footer" class="dialog-footer">
  9 + <el-button @click="visible = false">
  10 + {{ $t('common.cancel') }}
  11 + </el-button>
  12 + <el-button type="primary" :loading="loading" @click="handleDelete">
  13 + {{ $t('common.confirm') }}
  14 + </el-button>
  15 + </div>
  16 + </el-dialog>
  17 +</template>
  18 +
  19 +<script>
  20 +import { deleteOwnerCommittee } from '@/api/owner/ownerCommitteeManageApi'
  21 +import { getCommunityId } from '@/api/community/communityApi'
  22 +
  23 +export default {
  24 + name: 'DeleteOwnerCommittee',
  25 + data() {
  26 + return {
  27 + visible: false,
  28 + loading: false,
  29 + currentData: null
  30 + }
  31 + },
  32 + methods: {
  33 + open(data) {
  34 + this.currentData = data
  35 + this.visible = true
  36 + },
  37 + handleClose() {
  38 + this.currentData = null
  39 + },
  40 + async handleDelete() {
  41 + try {
  42 + this.loading = true
  43 + const params = {
  44 + ...this.currentData,
  45 + communityId: getCommunityId()
  46 + }
  47 + await deleteOwnerCommittee(params)
  48 + this.$emit('success')
  49 + this.visible = false
  50 + } catch (error) {
  51 + this.$message.error(this.$t('ownerCommitteeManage.deleteError'))
  52 + } finally {
  53 + this.loading = false
  54 + }
  55 + }
  56 + }
  57 +}
  58 +</script>
  59 +
  60 +<style scoped>
  61 +.delete-confirm {
  62 + text-align: center;
  63 + font-size: 16px;
  64 + padding: 20px 0;
  65 +}
  66 +</style>
0 \ No newline at end of file 67 \ No newline at end of file
src/i18n/index.js
@@ -135,6 +135,10 @@ import { messages as communitySpaceManageMessages } from &#39;../views/community/com @@ -135,6 +135,10 @@ import { messages as communitySpaceManageMessages } from &#39;../views/community/com
135 import { messages as reportCommunitySpaceMessages } from '../views/community/reportCommunitySpaceLang' 135 import { messages as reportCommunitySpaceMessages } from '../views/community/reportCommunitySpaceLang'
136 import { messages as communitySpacePersonManageMessages } from '../views/community/communitySpacePersonManageLang' 136 import { messages as communitySpacePersonManageMessages } from '../views/community/communitySpacePersonManageLang'
137 import { messages as communitySpaceConfirmMessages } from '../views/community/communitySpaceConfirmLang' 137 import { messages as communitySpaceConfirmMessages } from '../views/community/communitySpaceConfirmLang'
  138 +import { messages as ownerCommitteeManageMessages } from '../views/owner/ownerCommitteeManageLang'
  139 +import { messages as addOwnerCommitteeMessages } from '../views/owner/addOwnerCommitteeLang'
  140 +import { messages as editOwnerCommitteeMessages } from '../views/owner/editOwnerCommitteeLang'
  141 +import { messages as ownerCommitteeDetailMessages } from '../views/owner/ownerCommitteeDetailLang'
138 142
139 Vue.use(VueI18n) 143 Vue.use(VueI18n)
140 144
@@ -274,6 +278,10 @@ const messages = { @@ -274,6 +278,10 @@ const messages = {
274 ...reportCommunitySpaceMessages.en, 278 ...reportCommunitySpaceMessages.en,
275 ...communitySpacePersonManageMessages.en, 279 ...communitySpacePersonManageMessages.en,
276 ...communitySpaceConfirmMessages.en, 280 ...communitySpaceConfirmMessages.en,
  281 + ...ownerCommitteeManageMessages.en,
  282 + ...addOwnerCommitteeMessages.en,
  283 + ...editOwnerCommitteeMessages.en,
  284 + ...ownerCommitteeDetailMessages.en,
277 }, 285 },
278 zh: { 286 zh: {
279 ...loginMessages.zh, 287 ...loginMessages.zh,
@@ -409,6 +417,10 @@ const messages = { @@ -409,6 +417,10 @@ const messages = {
409 ...reportCommunitySpaceMessages.zh, 417 ...reportCommunitySpaceMessages.zh,
410 ...communitySpacePersonManageMessages.zh, 418 ...communitySpacePersonManageMessages.zh,
411 ...communitySpaceConfirmMessages.zh, 419 ...communitySpaceConfirmMessages.zh,
  420 + ...ownerCommitteeManageMessages.zh,
  421 + ...addOwnerCommitteeMessages.zh,
  422 + ...editOwnerCommitteeMessages.zh,
  423 + ...ownerCommitteeDetailMessages.zh,
412 } 424 }
413 } 425 }
414 426
src/router/index.js
@@ -657,15 +657,35 @@ const routes = [ @@ -657,15 +657,35 @@ const routes = [
657 component: () => import('@/views/community/reportCommunitySpaceList.vue') 657 component: () => import('@/views/community/reportCommunitySpaceList.vue')
658 }, 658 },
659 { 659 {
660 - path:'/pages/property/communitySpacePersonManage',  
661 - name:'/pages/property/communitySpacePersonManage', 660 + path: '/pages/property/communitySpacePersonManage',
  661 + name: '/pages/property/communitySpacePersonManage',
662 component: () => import('@/views/community/communitySpacePersonManageList.vue') 662 component: () => import('@/views/community/communitySpacePersonManageList.vue')
  663 + },
  664 + {
  665 + path: '/pages/property/communitySpaceConfirm',
  666 + name: '/pages/property/communitySpaceConfirm',
  667 + component: () => import('@/views/community/communitySpaceConfirmList.vue')
  668 + },
  669 + {
  670 + path: '/pages/owner/ownerCommitteeManage',
  671 + name: '/pages/owner/ownerCommitteeManage',
  672 + component: () => import('@/views/owner/ownerCommitteeManageList.vue')
  673 + },
  674 + {
  675 + path: '/views/owner/addOwnerCommittee',
  676 + name: '/views/owner/addOwnerCommittee',
  677 + component: () => import('@/views/owner/addOwnerCommitteeList.vue')
  678 + },
  679 + {
  680 + path: '/views/owner/editOwnerCommittee',
  681 + name: '/views/owner/editOwnerCommittee',
  682 + component: () => import('@/views/owner/editOwnerCommitteeList.vue')
  683 + },
  684 + {
  685 + path:'/views/owner/ownerCommitteeDetail',
  686 + name:'/views/owner/ownerCommitteeDetail',
  687 + component: () => import('@/views/owner/ownerCommitteeDetailList.vue')
663 }, 688 },
664 - {  
665 - path:'/pages/property/communitySpaceConfirm',  
666 - name:'/pages/property/communitySpaceConfirm',  
667 - component: () => import('@/views/community/communitySpaceConfirmList.vue')  
668 - },  
669 // 其他子路由可以在这里添加 689 // 其他子路由可以在这里添加
670 ] 690 ]
671 }, 691 },
src/views/community/communitySpacePersonManageLang.js
@@ -40,9 +40,6 @@ export const messages = { @@ -40,9 +40,6 @@ export const messages = {
40 cancel: 'Cancel', 40 cancel: 'Cancel',
41 confirmCancel: 'Confirm Cancel' 41 confirmCancel: 'Confirm Cancel'
42 }, 42 },
43 - common: {  
44 - total: 'Total'  
45 - }  
46 }, 43 },
47 zh: { 44 zh: {
48 communitySpacePersonManage: { 45 communitySpacePersonManage: {
@@ -85,8 +82,5 @@ export const messages = { @@ -85,8 +82,5 @@ export const messages = {
85 cancel: '点错了', 82 cancel: '点错了',
86 confirmCancel: '确认取消' 83 confirmCancel: '确认取消'
87 }, 84 },
88 - common: {  
89 - total: '共'  
90 - }  
91 } 85 }
92 } 86 }
93 \ No newline at end of file 87 \ No newline at end of file
src/views/owner/addOwnerCommitteeLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + addOwnerCommittee: {
  4 + title: 'Add Owner Committee',
  5 + name: 'Name',
  6 + sex: 'Gender',
  7 + phone: 'Phone',
  8 + idCard: 'ID Card',
  9 + address: 'Address',
  10 + position: 'Position',
  11 + post: 'Post',
  12 + postDesc: 'Post Description',
  13 + appointTime: 'Appointment Term',
  14 + curTime: 'Current Term',
  15 + state: 'Status',
  16 + remark: 'Remark',
  17 + emergencyContact: 'Emergency Contact',
  18 + contactRelationship: 'Relationship',
  19 + contactName: 'Name',
  20 + contactPhone: 'Phone',
  21 + contactAddress: 'Address',
  22 + male: 'Male',
  23 + female: 'Female',
  24 + onJob: 'On Job',
  25 + leaveJob: 'Leave Job',
  26 + requiredName: 'Required, please fill in name',
  27 + requiredSex: 'Required, please select gender',
  28 + requiredPhone: 'Required, please fill in phone',
  29 + requiredIdCard: 'Required, please fill in ID card',
  30 + requiredAddress: 'Required, please fill in address',
  31 + requiredPosition: 'Required, please fill in position',
  32 + requiredPost: 'Required, please fill in post',
  33 + optionalPostDesc: 'Optional, please fill in post description',
  34 + requiredAppointTime: 'Required, please fill in appointment term',
  35 + requiredCurTime: 'Required, please fill in current term',
  36 + requiredState: 'Required, please select status',
  37 + optionalRemark: 'Optional, please fill in remark',
  38 + requiredRelationship: 'Required, please fill in relationship',
  39 + maxName: 'Name cannot exceed {max} characters',
  40 + maxSex: 'Gender cannot exceed {max} characters',
  41 + maxPhone: 'Phone cannot exceed {max} characters',
  42 + maxIdCard: 'ID card cannot exceed {max} characters',
  43 + maxAddress: 'Address cannot exceed {max} characters',
  44 + maxPosition: 'Position cannot exceed {max} characters',
  45 + maxPost: 'Post cannot exceed {max} characters',
  46 + maxPostDesc: 'Post description cannot exceed {max} characters',
  47 + maxAppointTime: 'Appointment term cannot exceed {max} characters',
  48 + maxCurTime: 'Current term cannot exceed {max} characters',
  49 + maxState: 'Status cannot exceed {max} characters',
  50 + maxRemark: 'Remark cannot exceed {max} characters',
  51 + saveSuccess: 'Save successfully',
  52 + saveError: 'Save failed'
  53 + }
  54 + },
  55 + zh: {
  56 + addOwnerCommittee: {
  57 + title: '添加业委会',
  58 + name: '姓名',
  59 + sex: '性别',
  60 + phone: '电话',
  61 + idCard: '身份证号码',
  62 + address: '住址',
  63 + position: '职位',
  64 + post: '岗位',
  65 + postDesc: '岗位描述',
  66 + appointTime: '届期',
  67 + curTime: '任期',
  68 + state: '状态',
  69 + remark: '备注',
  70 + emergencyContact: '紧急联系人',
  71 + contactRelationship: '成员关系',
  72 + contactName: '姓名',
  73 + contactPhone: '联系电话',
  74 + contactAddress: '住址',
  75 + male: '男',
  76 + female: '女',
  77 + onJob: '在职',
  78 + leaveJob: '离职',
  79 + requiredName: '必填,请填写姓名',
  80 + requiredSex: '必填,请选择性别',
  81 + requiredPhone: '必填,请填写电话',
  82 + requiredIdCard: '必填,请填写身份证号码',
  83 + requiredAddress: '必填,请填写住址',
  84 + requiredPosition: '必填,请填写职位',
  85 + requiredPost: '必填,请填写岗位',
  86 + optionalPostDesc: '选填,请填写岗位描述',
  87 + requiredAppointTime: '必填,请填写届期',
  88 + requiredCurTime: '必填,请填写任期',
  89 + requiredState: '必填,请选择状态',
  90 + optionalRemark: '选填,请填写备注',
  91 + requiredRelationship: '必填,请填写关系',
  92 + maxName: '姓名不能超过{max}个字符',
  93 + maxSex: '性别不能超过{max}个字符',
  94 + maxPhone: '电话不能超过{max}个字符',
  95 + maxIdCard: '身份证号码不能超过{max}个字符',
  96 + maxAddress: '住址不能超过{max}个字符',
  97 + maxPosition: '职位不能超过{max}个字符',
  98 + maxPost: '岗位不能超过{max}个字符',
  99 + maxPostDesc: '岗位描述不能超过{max}个字符',
  100 + maxAppointTime: '届期不能超过{max}个字符',
  101 + maxCurTime: '任期不能超过{max}个字符',
  102 + maxState: '状态不能超过{max}个字符',
  103 + maxRemark: '备注不能超过{max}个字符',
  104 + saveSuccess: '保存成功',
  105 + saveError: '保存失败'
  106 + }
  107 + }
  108 +}
0 \ No newline at end of file 109 \ No newline at end of file
src/views/owner/addOwnerCommitteeList.vue 0 → 100644
  1 +<template>
  2 + <div class="add-owner-committee-container">
  3 + <el-row :gutter="20">
  4 + <el-col :span="24">
  5 + <el-card class="ibox">
  6 + <div slot="header" class="flex justify-between">
  7 + <div>{{ $t('addOwnerCommittee.title') }}</div>
  8 + <div class="ibox-tools">
  9 + <el-button type="primary" size="small" @click="goBack">
  10 + {{ $t('common.back') }}
  11 + </el-button>
  12 + </div>
  13 + </div>
  14 + <el-form
  15 + ref="form"
  16 + :model="addOwnerCommitteeInfo"
  17 + :rules="rules"
  18 + label-width="120px"
  19 + label-position="right"
  20 + >
  21 + <el-row>
  22 + <el-col :span="12">
  23 + <el-form-item :label="$t('addOwnerCommittee.name')" prop="name">
  24 + <el-input
  25 + v-model="addOwnerCommitteeInfo.name"
  26 + :placeholder="$t('addOwnerCommittee.requiredName')"
  27 + />
  28 + </el-form-item>
  29 + </el-col>
  30 + <el-col :span="12">
  31 + <el-form-item :label="$t('addOwnerCommittee.sex')" prop="sex">
  32 + <el-select
  33 + v-model="addOwnerCommitteeInfo.sex"
  34 + :placeholder="$t('addOwnerCommittee.requiredSex')"
  35 + style="width:100%"
  36 + >
  37 + <el-option disabled value="">{{ $t('addOwnerCommittee.requiredSex') }}</el-option>
  38 + <el-option value="B">{{ $t('addOwnerCommittee.male') }}</el-option>
  39 + <el-option value="G">{{ $t('addOwnerCommittee.female') }}</el-option>
  40 + </el-select>
  41 + </el-form-item>
  42 + </el-col>
  43 + </el-row>
  44 +
  45 + <el-row>
  46 + <el-col :span="12">
  47 + <el-form-item :label="$t('addOwnerCommittee.phone')" prop="link">
  48 + <el-input
  49 + v-model="addOwnerCommitteeInfo.link"
  50 + :placeholder="$t('addOwnerCommittee.requiredPhone')"
  51 + />
  52 + </el-form-item>
  53 + </el-col>
  54 + <el-col :span="12">
  55 + <el-form-item :label="$t('addOwnerCommittee.idCard')" prop="idCard">
  56 + <el-input
  57 + v-model="addOwnerCommitteeInfo.idCard"
  58 + :placeholder="$t('addOwnerCommittee.requiredIdCard')"
  59 + />
  60 + </el-form-item>
  61 + </el-col>
  62 + </el-row>
  63 +
  64 + <el-row>
  65 + <el-col :span="12">
  66 + <el-form-item :label="$t('addOwnerCommittee.address')" prop="address">
  67 + <el-input
  68 + v-model="addOwnerCommitteeInfo.address"
  69 + :placeholder="$t('addOwnerCommittee.requiredAddress')"
  70 + />
  71 + </el-form-item>
  72 + </el-col>
  73 + <el-col :span="12">
  74 + <el-form-item :label="$t('addOwnerCommittee.position')" prop="position">
  75 + <el-input
  76 + v-model="addOwnerCommitteeInfo.position"
  77 + :placeholder="$t('addOwnerCommittee.requiredPosition')"
  78 + />
  79 + </el-form-item>
  80 + </el-col>
  81 + </el-row>
  82 +
  83 + <el-row>
  84 + <el-col :span="12">
  85 + <el-form-item :label="$t('addOwnerCommittee.post')" prop="post">
  86 + <el-input
  87 + v-model="addOwnerCommitteeInfo.post"
  88 + :placeholder="$t('addOwnerCommittee.requiredPost')"
  89 + />
  90 + </el-form-item>
  91 + </el-col>
  92 + <el-col :span="12">
  93 + <el-form-item :label="$t('addOwnerCommittee.postDesc')">
  94 + <el-input
  95 + v-model="addOwnerCommitteeInfo.postDesc"
  96 + :placeholder="$t('addOwnerCommittee.optionalPostDesc')"
  97 + />
  98 + </el-form-item>
  99 + </el-col>
  100 + </el-row>
  101 +
  102 + <el-row>
  103 + <el-col :span="12">
  104 + <el-form-item :label="$t('addOwnerCommittee.appointTime')" prop="appointTime">
  105 + <el-input
  106 + v-model="addOwnerCommitteeInfo.appointTime"
  107 + :placeholder="$t('addOwnerCommittee.requiredAppointTime')"
  108 + />
  109 + </el-form-item>
  110 + </el-col>
  111 + <el-col :span="12">
  112 + <el-form-item :label="$t('addOwnerCommittee.curTime')" prop="curTime">
  113 + <el-input
  114 + v-model="addOwnerCommitteeInfo.curTime"
  115 + :placeholder="$t('addOwnerCommittee.requiredCurTime')"
  116 + />
  117 + </el-form-item>
  118 + </el-col>
  119 + </el-row>
  120 +
  121 + <el-row>
  122 + <el-col :span="12">
  123 + <el-form-item :label="$t('addOwnerCommittee.state')" prop="state">
  124 + <el-select
  125 + v-model="addOwnerCommitteeInfo.state"
  126 + :placeholder="$t('addOwnerCommittee.requiredState')"
  127 + style="width:100%"
  128 + >
  129 + <el-option disabled value="">{{ $t('addOwnerCommittee.requiredState') }}</el-option>
  130 + <el-option value="1000">{{ $t('addOwnerCommittee.onJob') }}</el-option>
  131 + <el-option value="2000">{{ $t('addOwnerCommittee.leaveJob') }}</el-option>
  132 + </el-select>
  133 + </el-form-item>
  134 + </el-col>
  135 + <el-col :span="12">
  136 + <el-form-item :label="$t('addOwnerCommittee.remark')">
  137 + <el-input
  138 + v-model="addOwnerCommitteeInfo.remark"
  139 + type="textarea"
  140 + :placeholder="$t('addOwnerCommittee.optionalRemark')"
  141 + />
  142 + </el-form-item>
  143 + </el-col>
  144 + </el-row>
  145 + </el-form>
  146 + </el-card>
  147 + </el-col>
  148 + </el-row>
  149 +
  150 + <el-row :gutter="20" class="margin-top">
  151 + <el-col :span="24">
  152 + <el-card class="ibox">
  153 + <div slot="header" class="flex justify-between">
  154 + <div>{{ $t('addOwnerCommittee.emergencyContact') }}</div>
  155 + <div class="ibox-tools">
  156 + <el-button type="primary" size="small" @click="addContract">
  157 + <i class="el-icon-plus"></i> {{ $t('common.add') }}
  158 + </el-button>
  159 + </div>
  160 + </div>
  161 + <el-table :data="addOwnerCommitteeInfo.contracts" border style="width: 100%">
  162 + <el-table-column :label="$t('addOwnerCommittee.contactRelationship')" align="center">
  163 + <template slot-scope="scope">
  164 + <el-input
  165 + v-model="scope.row.relName"
  166 + :placeholder="$t('addOwnerCommittee.requiredRelationship')"
  167 + />
  168 + </template>
  169 + </el-table-column>
  170 + <el-table-column :label="$t('addOwnerCommittee.contactName')" align="center">
  171 + <template slot-scope="scope">
  172 + <el-input
  173 + v-model="scope.row.name"
  174 + :placeholder="$t('addOwnerCommittee.requiredName')"
  175 + />
  176 + </template>
  177 + </el-table-column>
  178 + <el-table-column :label="$t('addOwnerCommittee.contactPhone')" align="center">
  179 + <template slot-scope="scope">
  180 + <el-input
  181 + v-model="scope.row.link"
  182 + :placeholder="$t('addOwnerCommittee.requiredPhone')"
  183 + />
  184 + </template>
  185 + </el-table-column>
  186 + <el-table-column :label="$t('addOwnerCommittee.contactAddress')" align="center" width="250">
  187 + <template slot-scope="scope">
  188 + <el-input
  189 + v-model="scope.row.address"
  190 + :placeholder="$t('addOwnerCommittee.requiredAddress')"
  191 + />
  192 + </template>
  193 + </el-table-column>
  194 + <el-table-column :label="$t('common.operation')" align="center" width="100">
  195 + <template slot-scope="scope">
  196 + <el-button
  197 + type="danger"
  198 + size="mini"
  199 + @click="deleteContract(scope.row)"
  200 + >
  201 + {{ $t('common.delete') }}
  202 + </el-button>
  203 + </template>
  204 + </el-table-column>
  205 + </el-table>
  206 + </el-card>
  207 + </el-col>
  208 + </el-row>
  209 +
  210 + <div class="margin-top">
  211 + <el-button type="primary" class="float-right" @click="saveOwnerCommitteeInfo">
  212 + <i class="el-icon-check"></i>&nbsp;
  213 + {{ $t('common.save') }}
  214 + </el-button>
  215 + <el-button type="warning" class="float-right" style="margin-right:20px;" @click="goBack">
  216 + {{ $t('common.back') }}
  217 + </el-button>
  218 + </div>
  219 + </div>
  220 +</template>
  221 +
  222 +<script>
  223 +import { saveOwnerCommittee } from '@/api/owner/addOwnerCommitteeApi'
  224 +import { getCommunityId } from '@/api/community/communityApi'
  225 +
  226 +export default {
  227 + name: 'AddOwnerCommitteeList',
  228 + data() {
  229 + return {
  230 + addOwnerCommitteeInfo: {
  231 + ocId: '',
  232 + name: '',
  233 + sex: '',
  234 + link: '',
  235 + idCard: '',
  236 + address: '',
  237 + position: '',
  238 + post: '',
  239 + postDesc: '',
  240 + appointTime: '',
  241 + curTime: '',
  242 + state: '',
  243 + remark: '',
  244 + contracts: []
  245 + },
  246 + rules: {
  247 + name: [
  248 + { required: true, message: this.$t('addOwnerCommittee.requiredName'), trigger: 'blur' },
  249 + { max: 30, message: this.$t('addOwnerCommittee.maxName', { max: 30 }), trigger: 'blur' }
  250 + ],
  251 + sex: [
  252 + { required: true, message: this.$t('addOwnerCommittee.requiredSex'), trigger: 'change' },
  253 + { max: 12, message: this.$t('addOwnerCommittee.maxSex', { max: 12 }), trigger: 'blur' }
  254 + ],
  255 + link: [
  256 + { required: true, message: this.$t('addOwnerCommittee.requiredPhone'), trigger: 'blur' },
  257 + { max: 11, message: this.$t('addOwnerCommittee.maxPhone', { max: 11 }), trigger: 'blur' }
  258 + ],
  259 + idCard: [
  260 + { required: true, message: this.$t('addOwnerCommittee.requiredIdCard'), trigger: 'blur' },
  261 + { max: 18, message: this.$t('addOwnerCommittee.maxIdCard', { max: 18 }), trigger: 'blur' }
  262 + ],
  263 + address: [
  264 + { required: true, message: this.$t('addOwnerCommittee.requiredAddress'), trigger: 'blur' },
  265 + { max: 256, message: this.$t('addOwnerCommittee.maxAddress', { max: 256 }), trigger: 'blur' }
  266 + ],
  267 + position: [
  268 + { required: true, message: this.$t('addOwnerCommittee.requiredPosition'), trigger: 'blur' },
  269 + { max: 64, message: this.$t('addOwnerCommittee.maxPosition', { max: 64 }), trigger: 'blur' }
  270 + ],
  271 + post: [
  272 + { required: true, message: this.$t('addOwnerCommittee.requiredPost'), trigger: 'blur' },
  273 + { max: 64, message: this.$t('addOwnerCommittee.maxPost', { max: 64 }), trigger: 'blur' }
  274 + ],
  275 + postDesc: [
  276 + { max: 64, message: this.$t('addOwnerCommittee.maxPostDesc', { max: 64 }), trigger: 'blur' }
  277 + ],
  278 + appointTime: [
  279 + { required: true, message: this.$t('addOwnerCommittee.requiredAppointTime'), trigger: 'blur' },
  280 + { max: 256, message: this.$t('addOwnerCommittee.maxAppointTime', { max: 256 }), trigger: 'blur' }
  281 + ],
  282 + curTime: [
  283 + { required: true, message: this.$t('addOwnerCommittee.requiredCurTime'), trigger: 'blur' },
  284 + { max: 256, message: this.$t('addOwnerCommittee.maxCurTime', { max: 256 }), trigger: 'blur' }
  285 + ],
  286 + state: [
  287 + { required: true, message: this.$t('addOwnerCommittee.requiredState'), trigger: 'change' },
  288 + { max: 12, message: this.$t('addOwnerCommittee.maxState', { max: 12 }), trigger: 'blur' }
  289 + ],
  290 + remark: [
  291 + { max: 200, message: this.$t('addOwnerCommittee.maxRemark', { max: 200 }), trigger: 'blur' }
  292 + ]
  293 + }
  294 + }
  295 + },
  296 + methods: {
  297 + goBack() {
  298 + this.$router.go(-1)
  299 + },
  300 + addContract() {
  301 + this.addOwnerCommitteeInfo.contracts.push({
  302 + id: this.generateUUID(),
  303 + relName: '',
  304 + name: '',
  305 + link: '',
  306 + address: ''
  307 + })
  308 + },
  309 + deleteContract(contract) {
  310 + const index = this.addOwnerCommitteeInfo.contracts.findIndex(item => item.id === contract.id)
  311 + if (index !== -1) {
  312 + this.addOwnerCommitteeInfo.contracts.splice(index, 1)
  313 + }
  314 + },
  315 + generateUUID() {
  316 + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  317 + const r = Math.random() * 16 | 0
  318 + const v = c === 'x' ? r : (r & 0x3 | 0x8)
  319 + return v.toString(16)
  320 + })
  321 + },
  322 + async saveOwnerCommitteeInfo() {
  323 + try {
  324 + await this.$refs.form.validate()
  325 +
  326 + this.addOwnerCommitteeInfo.communityId = getCommunityId()
  327 + const response = await saveOwnerCommittee(this.addOwnerCommitteeInfo)
  328 +
  329 + if (response.code === 0) {
  330 + this.$message.success(this.$t('addOwnerCommittee.saveSuccess'))
  331 + this.goBack()
  332 + } else {
  333 + this.$message.error(response.msg || this.$t('addOwnerCommittee.saveError'))
  334 + }
  335 + } catch (error) {
  336 + console.error('保存失败:', error)
  337 + }
  338 + }
  339 + }
  340 +}
  341 +</script>
  342 +
  343 +<style scoped>
  344 +.add-owner-committee-container {
  345 + padding: 20px;
  346 +}
  347 +
  348 +.ibox {
  349 + margin-bottom: 20px;
  350 +}
  351 +
  352 +.ibox-title {
  353 + display: flex;
  354 + justify-content: space-between;
  355 + align-items: center;
  356 + padding: 10px 15px;
  357 + border-bottom: 1px solid #e7eaec;
  358 +}
  359 +
  360 +.margin-top {
  361 + margin-top: 20px;
  362 +}
  363 +
  364 +.float-right {
  365 + float: right;
  366 +}
  367 +
  368 +.clearfix:after {
  369 + content: "";
  370 + display: table;
  371 + clear: both;
  372 +}
  373 +</style>
0 \ No newline at end of file 374 \ No newline at end of file
src/views/owner/editOwnerCommitteeLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + editOwnerCommittee: {
  4 + title: 'Edit Owner Committee',
  5 + name: 'Name',
  6 + nameRequired: 'Name is required',
  7 + namePlaceholder: 'Please enter name',
  8 + sex: 'Gender',
  9 + sexRequired: 'Gender is required',
  10 + sexPlaceholder: 'Please select gender',
  11 + male: 'Male',
  12 + female: 'Female',
  13 + phone: 'Phone',
  14 + phoneRequired: 'Phone is required',
  15 + phoneLength: 'Phone must be 11 digits',
  16 + phonePlaceholder: 'Please enter phone number',
  17 + idCard: 'ID Card',
  18 + idCardRequired: 'ID Card is required',
  19 + idCardLength: 'ID Card must be 18 digits',
  20 + idCardPlaceholder: 'Please enter ID card number',
  21 + address: 'Address',
  22 + addressRequired: 'Address is required',
  23 + addressMaxLength: 'Address cannot exceed 256 characters',
  24 + addressPlaceholder: 'Please enter address',
  25 + position: 'Position',
  26 + positionRequired: 'Position is required',
  27 + positionMaxLength: 'Position cannot exceed 64 characters',
  28 + positionPlaceholder: 'Please enter position',
  29 + post: 'Post',
  30 + postRequired: 'Post is required',
  31 + postMaxLength: 'Post cannot exceed 64 characters',
  32 + postPlaceholder: 'Please enter post',
  33 + postDesc: 'Post Description',
  34 + postDescMaxLength: 'Description cannot exceed 64 characters',
  35 + postDescPlaceholder: 'Optional, enter description',
  36 + appointTime: 'Term',
  37 + appointTimeRequired: 'Term is required',
  38 + appointTimeMaxLength: 'Term cannot exceed 256 characters',
  39 + appointTimePlaceholder: 'Please enter term',
  40 + curTime: 'Tenure',
  41 + curTimeRequired: 'Tenure is required',
  42 + curTimeMaxLength: 'Tenure cannot exceed 256 characters',
  43 + curTimePlaceholder: 'Please enter tenure',
  44 + status: 'Status',
  45 + statusRequired: 'Status is required',
  46 + statusPlaceholder: 'Please select status',
  47 + onDuty: 'On Duty',
  48 + leave: 'Leave',
  49 + remark: 'Remark',
  50 + remarkMaxLength: 'Remark cannot exceed 200 characters',
  51 + remarkPlaceholder: 'Optional, enter remark',
  52 + emergencyContact: 'Emergency Contact',
  53 + relation: 'Relationship',
  54 + relationPlaceholder: 'Required, enter relationship',
  55 + contactName: 'Contact Name',
  56 + contactNamePlaceholder: 'Required, enter name',
  57 + contactPhone: 'Contact Phone',
  58 + contactPhonePlaceholder: 'Required, enter phone',
  59 + contactAddress: 'Contact Address',
  60 + contactAddressPlaceholder: 'Required, enter address',
  61 + updateSuccess: 'Update successful',
  62 + fetchError: 'Failed to fetch data'
  63 + }
  64 + },
  65 + zh: {
  66 + editOwnerCommittee: {
  67 + title: '修改业委会',
  68 + name: '姓名',
  69 + nameRequired: '姓名不能为空',
  70 + namePlaceholder: '请填写姓名',
  71 + sex: '性别',
  72 + sexRequired: '性别不能为空',
  73 + sexPlaceholder: '请选择性别',
  74 + male: '男',
  75 + female: '女',
  76 + phone: '电话',
  77 + phoneRequired: '电话不能为空',
  78 + phoneLength: '电话必须为11位',
  79 + phonePlaceholder: '请填写电话',
  80 + idCard: '身份证号码',
  81 + idCardRequired: '身份证号码不能为空',
  82 + idCardLength: '身份证号码必须为18位',
  83 + idCardPlaceholder: '请填写身份证号码',
  84 + address: '住址',
  85 + addressRequired: '住址不能为空',
  86 + addressMaxLength: '住址不能超过256个字符',
  87 + addressPlaceholder: '请填写住址',
  88 + position: '职位',
  89 + positionRequired: '职位不能为空',
  90 + positionMaxLength: '职位不能超过64个字符',
  91 + positionPlaceholder: '请填写职位',
  92 + post: '岗位',
  93 + postRequired: '岗位不能为空',
  94 + postMaxLength: '岗位不能超过64个字符',
  95 + postPlaceholder: '请填写岗位',
  96 + postDesc: '岗位描述',
  97 + postDescMaxLength: '描述不能超过64个字符',
  98 + postDescPlaceholder: '选填,请填写岗位描述',
  99 + appointTime: '届期',
  100 + appointTimeRequired: '届期不能为空',
  101 + appointTimeMaxLength: '届期不能超过256个字符',
  102 + appointTimePlaceholder: '请填写届期',
  103 + curTime: '任期',
  104 + curTimeRequired: '任期不能为空',
  105 + curTimeMaxLength: '任期不能超过256个字符',
  106 + curTimePlaceholder: '请填写任期',
  107 + status: '状态',
  108 + statusRequired: '状态不能为空',
  109 + statusPlaceholder: '请选择状态',
  110 + onDuty: '在职',
  111 + leave: '离职',
  112 + remark: '备注',
  113 + remarkMaxLength: '备注不能超过200个字符',
  114 + remarkPlaceholder: '选填,请填写备注',
  115 + emergencyContact: '紧急联系人',
  116 + relation: '成员关系',
  117 + relationPlaceholder: '必填,请填写关系',
  118 + contactName: '姓名',
  119 + contactNamePlaceholder: '必填,请填写名称',
  120 + contactPhone: '联系电话',
  121 + contactPhonePlaceholder: '必填,请填写电话',
  122 + contactAddress: '住址',
  123 + contactAddressPlaceholder: '必填,请填写地址',
  124 + updateSuccess: '修改成功',
  125 + fetchError: '获取数据失败'
  126 + }
  127 + }
  128 +}
0 \ No newline at end of file 129 \ No newline at end of file
src/views/owner/editOwnerCommitteeList.vue 0 → 100644
  1 +<template>
  2 + <div class="edit-owner-committee-container">
  3 + <el-card class="box-card">
  4 + <div slot="header" class="clearfix">
  5 + <span>{{ $t('editOwnerCommittee.title') }}</span>
  6 + <div class="card-tools">
  7 + <el-button type="primary" icon="el-icon-close" @click="goBack">
  8 + {{ $t('common.back') }}
  9 + </el-button>
  10 + </div>
  11 + </div>
  12 + <el-form ref="form" :model="formData" label-width="120px" label-position="right" class="form-container">
  13 + <el-row :gutter="20">
  14 + <el-col :span="12">
  15 + <el-form-item :label="$t('editOwnerCommittee.name')" prop="name"
  16 + :rules="[{ required: true, message: $t('editOwnerCommittee.nameRequired'), trigger: 'blur' }]">
  17 + <el-input v-model="formData.name" :placeholder="$t('editOwnerCommittee.namePlaceholder')" />
  18 + </el-form-item>
  19 + </el-col>
  20 + <el-col :span="12">
  21 + <el-form-item :label="$t('editOwnerCommittee.sex')" prop="sex"
  22 + :rules="[{ required: true, message: $t('editOwnerCommittee.sexRequired'), trigger: 'change' }]">
  23 + <el-select v-model="formData.sex" :placeholder="$t('editOwnerCommittee.sexPlaceholder')" style="width:100%">
  24 + <el-option v-for="item in sexOptions" :key="item.value" :label="item.label" :value="item.value" />
  25 + </el-select>
  26 + </el-form-item>
  27 + </el-col>
  28 + </el-row>
  29 +
  30 + <el-row :gutter="20">
  31 + <el-col :span="12">
  32 + <el-form-item :label="$t('editOwnerCommittee.phone')" prop="link" :rules="[
  33 + { required: true, message: $t('editOwnerCommittee.phoneRequired'), trigger: 'blur' },
  34 + { min: 11, max: 11, message: $t('editOwnerCommittee.phoneLength'), trigger: 'blur' }
  35 + ]">
  36 + <el-input v-model="formData.link" :placeholder="$t('editOwnerCommittee.phonePlaceholder')" />
  37 + </el-form-item>
  38 + </el-col>
  39 + <el-col :span="12">
  40 + <el-form-item :label="$t('editOwnerCommittee.idCard')" prop="idCard" :rules="[
  41 + { required: true, message: $t('editOwnerCommittee.idCardRequired'), trigger: 'blur' },
  42 + { min: 18, max: 18, message: $t('editOwnerCommittee.idCardLength'), trigger: 'blur' }
  43 + ]">
  44 + <el-input v-model="formData.idCard" :placeholder="$t('editOwnerCommittee.idCardPlaceholder')" />
  45 + </el-form-item>
  46 + </el-col>
  47 + </el-row>
  48 +
  49 + <el-row :gutter="20">
  50 + <el-col :span="12">
  51 + <el-form-item :label="$t('editOwnerCommittee.address')" prop="address" :rules="[
  52 + { required: true, message: $t('editOwnerCommittee.addressRequired'), trigger: 'blur' },
  53 + { max: 256, message: $t('editOwnerCommittee.addressMaxLength'), trigger: 'blur' }
  54 + ]">
  55 + <el-input v-model="formData.address" :placeholder="$t('editOwnerCommittee.addressPlaceholder')" />
  56 + </el-form-item>
  57 + </el-col>
  58 + <el-col :span="12">
  59 + <el-form-item :label="$t('editOwnerCommittee.position')" prop="position" :rules="[
  60 + { required: true, message: $t('editOwnerCommittee.positionRequired'), trigger: 'blur' },
  61 + { max: 64, message: $t('editOwnerCommittee.positionMaxLength'), trigger: 'blur' }
  62 + ]">
  63 + <el-input v-model="formData.position" :placeholder="$t('editOwnerCommittee.positionPlaceholder')" />
  64 + </el-form-item>
  65 + </el-col>
  66 + </el-row>
  67 +
  68 + <el-row :gutter="20">
  69 + <el-col :span="12">
  70 + <el-form-item :label="$t('editOwnerCommittee.post')" prop="post" :rules="[
  71 + { required: true, message: $t('editOwnerCommittee.postRequired'), trigger: 'blur' },
  72 + { max: 64, message: $t('editOwnerCommittee.postMaxLength'), trigger: 'blur' }
  73 + ]">
  74 + <el-input v-model="formData.post" :placeholder="$t('editOwnerCommittee.postPlaceholder')" />
  75 + </el-form-item>
  76 + </el-col>
  77 + <el-col :span="12">
  78 + <el-form-item :label="$t('editOwnerCommittee.postDesc')" prop="postDesc"
  79 + :rules="[{ max: 64, message: $t('editOwnerCommittee.postDescMaxLength'), trigger: 'blur' }]">
  80 + <el-input v-model="formData.postDesc" :placeholder="$t('editOwnerCommittee.postDescPlaceholder')" />
  81 + </el-form-item>
  82 + </el-col>
  83 + </el-row>
  84 +
  85 + <el-row :gutter="20">
  86 + <el-col :span="12">
  87 + <el-form-item :label="$t('editOwnerCommittee.appointTime')" prop="appointTime" :rules="[
  88 + { required: true, message: $t('editOwnerCommittee.appointTimeRequired'), trigger: 'blur' },
  89 + { max: 256, message: $t('editOwnerCommittee.appointTimeMaxLength'), trigger: 'blur' }
  90 + ]">
  91 + <el-input v-model="formData.appointTime" :placeholder="$t('editOwnerCommittee.appointTimePlaceholder')" />
  92 + </el-form-item>
  93 + </el-col>
  94 + <el-col :span="12">
  95 + <el-form-item :label="$t('editOwnerCommittee.curTime')" prop="curTime" :rules="[
  96 + { required: true, message: $t('editOwnerCommittee.curTimeRequired'), trigger: 'blur' },
  97 + { max: 256, message: $t('editOwnerCommittee.curTimeMaxLength'), trigger: 'blur' }
  98 + ]">
  99 + <el-input v-model="formData.curTime" :placeholder="$t('editOwnerCommittee.curTimePlaceholder')" />
  100 + </el-form-item>
  101 + </el-col>
  102 + </el-row>
  103 +
  104 + <el-row :gutter="20">
  105 + <el-col :span="12">
  106 + <el-form-item :label="$t('editOwnerCommittee.status')" prop="state"
  107 + :rules="[{ required: true, message: $t('editOwnerCommittee.statusRequired'), trigger: 'change' }]">
  108 + <el-select v-model="formData.state" :placeholder="$t('editOwnerCommittee.statusPlaceholder')"
  109 + style="width:100%">
  110 + <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
  111 + </el-select>
  112 + </el-form-item>
  113 + </el-col>
  114 + <el-col :span="12">
  115 + <el-form-item :label="$t('editOwnerCommittee.remark')" prop="remark"
  116 + :rules="[{ max: 200, message: $t('editOwnerCommittee.remarkMaxLength'), trigger: 'blur' }]">
  117 + <el-input v-model="formData.remark" type="textarea"
  118 + :placeholder="$t('editOwnerCommittee.remarkPlaceholder')" />
  119 + </el-form-item>
  120 + </el-col>
  121 + </el-row>
  122 + </el-form>
  123 + </el-card>
  124 +
  125 + <el-card class="box-card margin-top-20">
  126 + <div slot="header" class="clearfix">
  127 + <span>{{ $t('editOwnerCommittee.emergencyContact') }}</span>
  128 + <div class="card-tools">
  129 + <el-button type="primary" icon="el-icon-plus" size="small" @click="addContract">
  130 + {{ $t('common.add') }}
  131 + </el-button>
  132 + </div>
  133 + </div>
  134 +
  135 + <el-table :data="formData.contracts" border style="width: 100%" class="contact-table">
  136 + <el-table-column :label="$t('editOwnerCommittee.relation')" align="center">
  137 + <template slot-scope="scope">
  138 + <el-input v-model="scope.row.relName" :placeholder="$t('editOwnerCommittee.relationPlaceholder')" />
  139 + </template>
  140 + </el-table-column>
  141 + <el-table-column :label="$t('editOwnerCommittee.contactName')" align="center">
  142 + <template slot-scope="scope">
  143 + <el-input v-model="scope.row.name" :placeholder="$t('editOwnerCommittee.contactNamePlaceholder')" />
  144 + </template>
  145 + </el-table-column>
  146 + <el-table-column :label="$t('editOwnerCommittee.contactPhone')" align="center">
  147 + <template slot-scope="scope">
  148 + <el-input v-model="scope.row.link" :placeholder="$t('editOwnerCommittee.contactPhonePlaceholder')" />
  149 + </template>
  150 + </el-table-column>
  151 + <el-table-column :label="$t('editOwnerCommittee.contactAddress')" align="center" width="250">
  152 + <template slot-scope="scope">
  153 + <el-input v-model="scope.row.address" :placeholder="$t('editOwnerCommittee.contactAddressPlaceholder')" />
  154 + </template>
  155 + </el-table-column>
  156 + <el-table-column :label="$t('common.operation')" align="center" width="100">
  157 + <template slot-scope="scope">
  158 + <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteContract(scope.row)" />
  159 + </template>
  160 + </el-table-column>
  161 + </el-table>
  162 + </el-card>
  163 +
  164 + <div class="action-buttons margin-top-20">
  165 + <el-button type="primary" icon="el-icon-check" @click="submitForm">
  166 + {{ $t('common.save') }}
  167 + </el-button>
  168 + <el-button type="warning" class="margin-left-10" @click="goBack">
  169 + {{ $t('common.back') }}
  170 + </el-button>
  171 + </div>
  172 + </div>
  173 +</template>
  174 +
  175 +<script>
  176 +import {
  177 + getOwnerCommitteeDetail,
  178 + updateOwnerCommittee,
  179 + listOwnerCommitteeContract
  180 +} from '@/api/owner/editOwnerCommitteeApi'
  181 +//import { getDict } from '@/api/community/communityApi'
  182 +import { getCommunityId } from '@/api/community/communityApi'
  183 +
  184 +export default {
  185 + name: 'EditOwnerCommittee',
  186 + data() {
  187 + return {
  188 + formData: {
  189 + ocId: '',
  190 + communityId: '',
  191 + name: '',
  192 + sex: '',
  193 + link: '',
  194 + idCard: '',
  195 + address: '',
  196 + position: '',
  197 + post: '',
  198 + postDesc: '',
  199 + appointTime: '',
  200 + curTime: '',
  201 + state: '',
  202 + remark: '',
  203 + contracts: []
  204 + },
  205 + sexOptions: [
  206 + { value: 'B', label: this.$t('editOwnerCommittee.male') },
  207 + { value: 'G', label: this.$t('editOwnerCommittee.female') }
  208 + ],
  209 + statusOptions: [
  210 + { value: '1000', label: this.$t('editOwnerCommittee.onDuty') },
  211 + { value: '2000', label: this.$t('editOwnerCommittee.leave') }
  212 + ]
  213 + }
  214 + },
  215 + created() {
  216 + this.formData.ocId = this.$route.query.ocId
  217 + this.formData.communityId = getCommunityId()
  218 + this.fetchData()
  219 + },
  220 + methods: {
  221 + async fetchData() {
  222 + try {
  223 + // 获取业主委员会详情
  224 + const detailRes = await getOwnerCommitteeDetail({
  225 + ocId: this.formData.ocId,
  226 + communityId: this.formData.communityId
  227 + })
  228 + Object.assign(this.formData, detailRes.data)
  229 +
  230 + // 获取紧急联系人列表
  231 + const contractRes = await listOwnerCommitteeContract({
  232 + ocId: this.formData.ocId,
  233 + communityId: this.formData.communityId
  234 + })
  235 + this.formData.contracts = contractRes.data.map(item => ({
  236 + ...item,
  237 + id: item.contractId
  238 + }))
  239 + } catch (error) {
  240 + this.$message.error(this.$t('editOwnerCommittee.fetchError'))
  241 + }
  242 + },
  243 + addContract() {
  244 + this.formData.contracts.push({
  245 + id: Date.now().toString(),
  246 + relName: '',
  247 + name: '',
  248 + link: '',
  249 + address: ''
  250 + })
  251 + },
  252 + deleteContract(contract) {
  253 + const index = this.formData.contracts.findIndex(item => item.id === contract.id)
  254 + if (index !== -1) {
  255 + this.formData.contracts.splice(index, 1)
  256 + }
  257 + },
  258 + async submitForm() {
  259 + try {
  260 + await this.$refs.form.validate()
  261 + await updateOwnerCommittee(this.formData)
  262 + this.$message.success(this.$t('editOwnerCommittee.updateSuccess'))
  263 + this.goBack()
  264 + } catch (error) {
  265 + if (error instanceof Error) {
  266 + this.$message.error(error.message)
  267 + }
  268 + }
  269 + },
  270 + goBack() {
  271 + this.$router.go(-1)
  272 + }
  273 + }
  274 +}
  275 +</script>
  276 +
  277 +<style lang="scss" scoped>
  278 +.edit-owner-committee-container {
  279 + padding: 20px;
  280 +
  281 + .box-card {
  282 + margin-bottom: 20px;
  283 +
  284 + .clearfix {
  285 + display: flex;
  286 + justify-content: space-between;
  287 + align-items: center;
  288 + }
  289 +
  290 + .card-tools {
  291 + display: flex;
  292 + align-items: center;
  293 + }
  294 + }
  295 +
  296 + .form-container {
  297 + padding: 20px;
  298 + }
  299 +
  300 + .contact-table {
  301 + margin-top: 10px;
  302 + }
  303 +
  304 + .action-buttons {
  305 + display: flex;
  306 + justify-content: flex-end;
  307 + padding: 20px 0;
  308 + }
  309 +
  310 + .margin-top-20 {
  311 + margin-top: 20px;
  312 + }
  313 +
  314 + .margin-left-10 {
  315 + margin-left: 10px;
  316 + }
  317 +}
  318 +</style>
0 \ No newline at end of file 319 \ No newline at end of file
src/views/owner/ownerCommitteeDetailLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + ownerCommitteeDetail: {
  4 + title: 'Owner Committee Detail',
  5 + name: 'Name',
  6 + sex: 'Gender',
  7 + link: 'Phone',
  8 + idCard: 'ID Card',
  9 + address: 'Address',
  10 + position: 'Position',
  11 + post: 'Post',
  12 + postDesc: 'Post Description',
  13 + appointTime: 'Appointment Period',
  14 + curTime: 'Term of Office',
  15 + state: 'Status',
  16 + remark: 'Remark',
  17 + emergencyContacts: 'Emergency Contacts',
  18 + memberRelation: 'Member Relation',
  19 + contactPhone: 'Contact Phone',
  20 + fetchDetailError: 'Failed to fetch committee details',
  21 + fetchContactsError: 'Failed to fetch emergency contacts'
  22 + }
  23 + },
  24 + zh: {
  25 + ownerCommitteeDetail: {
  26 + title: '业委会成员详情',
  27 + name: '姓名',
  28 + sex: '性别',
  29 + link: '电话',
  30 + idCard: '身份证号码',
  31 + address: '住址',
  32 + position: '职位',
  33 + post: '岗位',
  34 + postDesc: '岗位描述',
  35 + appointTime: '届期',
  36 + curTime: '任期',
  37 + state: '状态',
  38 + remark: '备注',
  39 + emergencyContacts: '紧急联系人',
  40 + memberRelation: '成员关系',
  41 + contactPhone: '联系电话',
  42 + fetchDetailError: '获取业委会详情失败',
  43 + fetchContactsError: '获取紧急联系人失败'
  44 + }
  45 + }
  46 +}
0 \ No newline at end of file 47 \ No newline at end of file
src/views/owner/ownerCommitteeDetailList.vue 0 → 100644
  1 +<template>
  2 + <div class="owner-committee-detail-container">
  3 + <el-row :gutter="20">
  4 + <el-col :span="24">
  5 + <el-card class="box-card">
  6 + <div slot="header" class="clearfix">
  7 + <span>{{ $t('ownerCommitteeDetail.title') }}</span>
  8 + <div class="card-header-actions">
  9 + <el-button type="primary" icon="el-icon-close" @click="goBack">
  10 + {{ $t('common.back') }}
  11 + </el-button>
  12 + </div>
  13 + </div>
  14 + <el-row :gutter="20">
  15 + <el-col :span="24">
  16 + <el-row :gutter="20">
  17 + <el-col :span="12">
  18 + <div class="detail-item">
  19 + <label>{{ $t('ownerCommitteeDetail.name') }}:</label>
  20 + <span>{{ ownerCommitteeDetailInfo.name }}</span>
  21 + </div>
  22 + </el-col>
  23 + <el-col :span="12">
  24 + <div class="detail-item">
  25 + <label>{{ $t('ownerCommitteeDetail.sex') }}:</label>
  26 + <span>{{ ownerCommitteeDetailInfo.sex == 'B' ? $t('common.male') : $t('common.female') }}</span>
  27 + </div>
  28 + </el-col>
  29 + </el-row>
  30 +
  31 + <el-row :gutter="20">
  32 + <el-col :span="12">
  33 + <div class="detail-item">
  34 + <label>{{ $t('ownerCommitteeDetail.link') }}:</label>
  35 + <span>{{ ownerCommitteeDetailInfo.link }}</span>
  36 + </div>
  37 + </el-col>
  38 + <el-col :span="12">
  39 + <div class="detail-item">
  40 + <label>{{ $t('ownerCommitteeDetail.idCard') }}:</label>
  41 + <span>{{ ownerCommitteeDetailInfo.idCard }}</span>
  42 + </div>
  43 + </el-col>
  44 + </el-row>
  45 +
  46 + <el-row :gutter="20">
  47 + <el-col :span="12">
  48 + <div class="detail-item">
  49 + <label>{{ $t('ownerCommitteeDetail.address') }}:</label>
  50 + <span>{{ ownerCommitteeDetailInfo.address }}</span>
  51 + </div>
  52 + </el-col>
  53 + <el-col :span="12">
  54 + <div class="detail-item">
  55 + <label>{{ $t('ownerCommitteeDetail.position') }}:</label>
  56 + <span>{{ ownerCommitteeDetailInfo.position }}</span>
  57 + </div>
  58 + </el-col>
  59 + </el-row>
  60 +
  61 + <el-row :gutter="20">
  62 + <el-col :span="12">
  63 + <div class="detail-item">
  64 + <label>{{ $t('ownerCommitteeDetail.post') }}:</label>
  65 + <span>{{ ownerCommitteeDetailInfo.post }}</span>
  66 + </div>
  67 + </el-col>
  68 + <el-col :span="12">
  69 + <div class="detail-item">
  70 + <label>{{ $t('ownerCommitteeDetail.postDesc') }}:</label>
  71 + <span>{{ ownerCommitteeDetailInfo.postDesc }}</span>
  72 + </div>
  73 + </el-col>
  74 + </el-row>
  75 +
  76 + <el-row :gutter="20">
  77 + <el-col :span="12">
  78 + <div class="detail-item">
  79 + <label>{{ $t('ownerCommitteeDetail.appointTime') }}:</label>
  80 + <span>{{ ownerCommitteeDetailInfo.appointTime }}</span>
  81 + </div>
  82 + </el-col>
  83 + <el-col :span="12">
  84 + <div class="detail-item">
  85 + <label>{{ $t('ownerCommitteeDetail.curTime') }}:</label>
  86 + <span>{{ ownerCommitteeDetailInfo.curTime }}</span>
  87 + </div>
  88 + </el-col>
  89 + </el-row>
  90 +
  91 + <el-row :gutter="20">
  92 + <el-col :span="12">
  93 + <div class="detail-item">
  94 + <label>{{ $t('ownerCommitteeDetail.state') }}:</label>
  95 + <span>{{ ownerCommitteeDetailInfo.state == '1000' ? $t('common.inService') : $t('common.leave')
  96 + }}</span>
  97 + </div>
  98 + </el-col>
  99 + <el-col :span="12">
  100 + <div class="detail-item">
  101 + <label>{{ $t('ownerCommitteeDetail.remark') }}:</label>
  102 + <span>{{ ownerCommitteeDetailInfo.remark }}</span>
  103 + </div>
  104 + </el-col>
  105 + </el-row>
  106 + </el-col>
  107 + </el-row>
  108 + </el-card>
  109 + </el-col>
  110 + </el-row>
  111 +
  112 + <el-row :gutter="20" class="mt-20">
  113 + <el-col :span="24">
  114 + <el-card class="box-card">
  115 + <div slot="header" class="clearfix">
  116 + <span>{{ $t('ownerCommitteeDetail.emergencyContacts') }}</span>
  117 + </div>
  118 + <el-table :data="ownerCommitteeDetailInfo.contracts" border style="width: 100%" v-loading="loading">
  119 + <el-table-column prop="relName" :label="$t('ownerCommitteeDetail.memberRelation')" align="center" />
  120 + <el-table-column prop="name" :label="$t('ownerCommitteeDetail.name')" align="center" />
  121 + <el-table-column prop="link" :label="$t('ownerCommitteeDetail.contactPhone')" align="center" />
  122 + <el-table-column prop="address" :label="$t('ownerCommitteeDetail.address')" align="center" />
  123 + </el-table>
  124 + </el-card>
  125 + </el-col>
  126 + </el-row>
  127 + </div>
  128 +</template>
  129 +
  130 +<script>
  131 +import { getOwnerCommitteeDetail, listOwnerCommitteeContracts } from '@/api/owner/ownerCommitteeDetailApi'
  132 +import { getCommunityId } from '@/api/community/communityApi'
  133 +
  134 +export default {
  135 + name: 'OwnerCommitteeDetailList',
  136 + data() {
  137 + return {
  138 + ownerCommitteeDetailInfo: {
  139 + ocId: '',
  140 + name: '',
  141 + sex: '',
  142 + link: '',
  143 + idCard: '',
  144 + address: '',
  145 + position: '',
  146 + post: '',
  147 + postDesc: '',
  148 + appointTime: '',
  149 + curTime: '',
  150 + state: '',
  151 + remark: '',
  152 + contracts: [],
  153 + communityId: ''
  154 + },
  155 + loading: false
  156 + }
  157 + },
  158 + created() {
  159 + this.initData()
  160 + },
  161 + methods: {
  162 + initData() {
  163 + this.ownerCommitteeDetailInfo.ocId = this.$route.query.ocId
  164 + this.communityId = getCommunityId()
  165 + this.getOwnerCommitteeDetail()
  166 + this.getOwnerCommitteeContracts()
  167 + },
  168 + async getOwnerCommitteeDetail() {
  169 + try {
  170 + this.loading = true
  171 + const params = {
  172 + page: 1,
  173 + row: 1,
  174 + communityId: this.communityId,
  175 + ocId: this.ownerCommitteeDetailInfo.ocId
  176 + }
  177 + const res = await getOwnerCommitteeDetail(params)
  178 + if (res.data && res.data.length > 0) {
  179 + Object.assign(this.ownerCommitteeDetailInfo, res.data[0])
  180 + }
  181 + } catch (error) {
  182 + this.$message.error(this.$t('ownerCommitteeDetail.fetchDetailError'))
  183 + } finally {
  184 + this.loading = false
  185 + }
  186 + },
  187 + async getOwnerCommitteeContracts() {
  188 + try {
  189 + this.loading = true
  190 + const params = {
  191 + page: 1,
  192 + row: 100, // 获取所有紧急联系人
  193 + communityId: this.communityId,
  194 + ocId: this.ownerCommitteeDetailInfo.ocId
  195 + }
  196 + const res = await listOwnerCommitteeContracts(params)
  197 + this.ownerCommitteeDetailInfo.contracts = res.data || []
  198 + } catch (error) {
  199 + this.$message.error(this.$t('ownerCommitteeDetail.fetchContactsError'))
  200 + } finally {
  201 + this.loading = false
  202 + }
  203 + },
  204 + goBack() {
  205 + this.$router.go(-1)
  206 + }
  207 + }
  208 +}
  209 +</script>
  210 +
  211 +<style lang="scss" scoped>
  212 +.owner-committee-detail-container {
  213 + padding: 20px;
  214 +
  215 + .box-card {
  216 + margin-bottom: 20px;
  217 +
  218 + .clearfix {
  219 + display: flex;
  220 + justify-content: space-between;
  221 + align-items: center;
  222 + }
  223 +
  224 + .card-header-actions {
  225 + display: flex;
  226 + align-items: center;
  227 + }
  228 + }
  229 +
  230 + .detail-item {
  231 + margin-bottom: 15px;
  232 + display: flex;
  233 + justify-content: flex-start;
  234 +
  235 + label {
  236 + min-width: 100px;
  237 + text-align: right;
  238 + margin-right: 10px;
  239 + color: #606266;
  240 + }
  241 +
  242 + span {
  243 + flex: 1;
  244 + }
  245 + }
  246 +
  247 + .mt-20 {
  248 + margin-top: 20px;
  249 + }
  250 +}
  251 +</style>
0 \ No newline at end of file 252 \ No newline at end of file
src/views/owner/ownerCommitteeManageLang.js 0 → 100644
  1 +export const messages = {
  2 + en: {
  3 + ownerCommitteeManage: {
  4 + searchTitle: 'Search Conditions',
  5 + namePlaceholder: 'Please enter name',
  6 + phonePlaceholder: 'Please enter phone number',
  7 + statePlaceholder: 'Please select status',
  8 + onDuty: 'On Duty',
  9 + resigned: 'Resigned',
  10 + listTitle: 'Owner Committee',
  11 + id: 'ID',
  12 + name: 'Name',
  13 + gender: 'Gender',
  14 + phone: 'Phone',
  15 + idCard: 'ID Card',
  16 + address: 'Address',
  17 + position: 'Position',
  18 + post: 'Post',
  19 + appointTime: 'Appoint Time',
  20 + term: 'Term',
  21 + status: 'Status',
  22 + deleteTitle: 'Confirm Operation',
  23 + deleteConfirm: 'Are you sure to delete this committee member?',
  24 + deleteSuccess: 'Delete successful',
  25 + fetchError: 'Failed to fetch committee list',
  26 + deleteError: 'Failed to delete committee member'
  27 + }
  28 + },
  29 + zh: {
  30 + ownerCommitteeManage: {
  31 + searchTitle: '查询条件',
  32 + namePlaceholder: '请输入姓名',
  33 + phonePlaceholder: '请输入电话',
  34 + statePlaceholder: '请选择状态',
  35 + onDuty: '在职',
  36 + resigned: '离职',
  37 + listTitle: '业委会',
  38 + id: '编号',
  39 + name: '姓名',
  40 + gender: '性别',
  41 + phone: '电话',
  42 + idCard: '身份证',
  43 + address: '住址',
  44 + position: '职位',
  45 + post: '岗位',
  46 + appointTime: '届期',
  47 + term: '任期',
  48 + status: '状态',
  49 + deleteTitle: '确认操作',
  50 + deleteConfirm: '确定删除该业委会成员吗?',
  51 + deleteSuccess: '删除成功',
  52 + fetchError: '获取业委会列表失败',
  53 + deleteError: '删除业委会成员失败'
  54 + }
  55 + }
  56 +}
0 \ No newline at end of file 57 \ No newline at end of file
src/views/owner/ownerCommitteeManageList.vue 0 → 100644
  1 +<template>
  2 + <div class="owner-committee-container">
  3 + <!-- 查询条件 -->
  4 + <el-card class="search-wrapper">
  5 + <div slot="header" class="clearfix text-left">
  6 + <span>{{ $t('ownerCommitteeManage.searchTitle') }}</span>
  7 + </div>
  8 + <el-row :gutter="20">
  9 + <el-col :span="6">
  10 + <el-input v-model="searchForm.name" :placeholder="$t('ownerCommitteeManage.namePlaceholder')" clearable />
  11 + </el-col>
  12 + <el-col :span="6">
  13 + <el-input v-model="searchForm.link" :placeholder="$t('ownerCommitteeManage.phonePlaceholder')" clearable />
  14 + </el-col>
  15 + <el-col :span="6">
  16 + <el-select v-model="searchForm.state" :placeholder="$t('ownerCommitteeManage.statePlaceholder')"
  17 + style="width:100%">
  18 + <el-option :label="$t('ownerCommitteeManage.onDuty')" value="1000" />
  19 + <el-option :label="$t('ownerCommitteeManage.resigned')" value="2000" />
  20 + </el-select>
  21 + </el-col>
  22 + <el-col :span="6">
  23 + <el-button type="primary" icon="el-icon-search" @click="handleSearch">
  24 + {{ $t('common.search') }}
  25 + </el-button>
  26 + <el-button icon="el-icon-refresh" @click="handleReset">
  27 + {{ $t('common.reset') }}
  28 + </el-button>
  29 + </el-col>
  30 + </el-row>
  31 + </el-card>
  32 +
  33 + <!-- 业委会列表 -->
  34 + <el-card class="list-wrapper">
  35 + <div slot="header" class=" flex justify-between">
  36 + <span>{{ $t('ownerCommitteeManage.listTitle') }}</span>
  37 + <el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd">
  38 + {{ $t('common.add') }}
  39 + </el-button>
  40 + </div>
  41 +
  42 + <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  43 + <el-table-column prop="ocId" :label="$t('ownerCommitteeManage.id')" align="center" />
  44 + <el-table-column prop="name" :label="$t('ownerCommitteeManage.name')" align="center" />
  45 + <el-table-column prop="sex" :label="$t('ownerCommitteeManage.gender')" align="center">
  46 + <template slot-scope="scope">
  47 + {{ scope.row.sex === 'B' ? $t('common.male') : $t('common.female') }}
  48 + </template>
  49 + </el-table-column>
  50 + <el-table-column prop="link" :label="$t('ownerCommitteeManage.phone')" align="center" />
  51 + <el-table-column prop="idCard" :label="$t('ownerCommitteeManage.idCard')" align="center" />
  52 + <el-table-column prop="address" :label="$t('ownerCommitteeManage.address')" align="center" />
  53 + <el-table-column prop="position" :label="$t('ownerCommitteeManage.position')" align="center" />
  54 + <el-table-column prop="post" :label="$t('ownerCommitteeManage.post')" align="center" />
  55 + <el-table-column prop="appointTime" :label="$t('ownerCommitteeManage.appointTime')" align="center" />
  56 + <el-table-column prop="curTime" :label="$t('ownerCommitteeManage.term')" align="center" />
  57 + <el-table-column prop="state" :label="$t('ownerCommitteeManage.status')" align="center">
  58 + <template slot-scope="scope">
  59 + {{ scope.row.state === '1000' ? $t('ownerCommitteeManage.onDuty') : $t('ownerCommitteeManage.resigned') }}
  60 + </template>
  61 + </el-table-column>
  62 + <el-table-column :label="$t('common.operation')" align="center" width="250" fixed="right">
  63 + <template slot-scope="scope">
  64 + <el-button size="mini" type="primary" @click="handleEdit(scope.row)">
  65 + {{ $t('common.edit') }}
  66 + </el-button>
  67 + <el-button size="mini" type="danger" @click="handleDelete(scope.row)">
  68 + {{ $t('common.delete') }}
  69 + </el-button>
  70 + <el-button size="mini" @click="handleDetail(scope.row)">
  71 + {{ $t('common.detail') }}
  72 + </el-button>
  73 + </template>
  74 + </el-table-column>
  75 + </el-table>
  76 +
  77 + <el-pagination :current-page.sync="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
  78 + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" @size-change="handleSizeChange"
  79 + @current-change="handlePageChange" />
  80 + </el-card>
  81 +
  82 + <!-- 删除对话框 -->
  83 + <delete-owner-committee ref="deleteDialog" @success="handleDeleteSuccess" />
  84 + </div>
  85 +</template>
  86 +
  87 +<script>
  88 +import { listOwnerCommittee } from '@/api/owner/ownerCommitteeManageApi'
  89 +import DeleteOwnerCommittee from '@/components/owner/DeleteOwnerCommittee'
  90 +import { getCommunityId } from '@/api/community/communityApi'
  91 +
  92 +export default {
  93 + name: 'OwnerCommitteeManageList',
  94 + components: {
  95 + DeleteOwnerCommittee
  96 + },
  97 + data() {
  98 + return {
  99 + loading: false,
  100 + searchForm: {
  101 + name: '',
  102 + link: '',
  103 + state: '',
  104 + communityId: ''
  105 + },
  106 + tableData: [],
  107 + pagination: {
  108 + current: 1,
  109 + size: 10,
  110 + total: 0
  111 + }
  112 + }
  113 + },
  114 + created() {
  115 + this.searchForm.communityId = getCommunityId()
  116 + this.getList()
  117 + },
  118 + methods: {
  119 + async getList() {
  120 + try {
  121 + this.loading = true
  122 + const params = {
  123 + ...this.searchForm,
  124 + page: this.pagination.current,
  125 + row: this.pagination.size
  126 + }
  127 + const { data, total } = await listOwnerCommittee(params)
  128 + this.tableData = data
  129 + this.pagination.total = total
  130 + } catch (error) {
  131 + this.$message.error(this.$t('ownerCommitteeManage.fetchError'))
  132 + } finally {
  133 + this.loading = false
  134 + }
  135 + },
  136 + handleSearch() {
  137 + this.pagination.current = 1
  138 + this.getList()
  139 + },
  140 + handleReset() {
  141 + this.searchForm = {
  142 + name: '',
  143 + link: '',
  144 + state: '',
  145 + communityId: getCommunityId()
  146 + }
  147 + this.pagination.current = 1
  148 + this.getList()
  149 + },
  150 + handleAdd() {
  151 + this.$router.push({ path: '/views/owner/addOwnerCommittee' })
  152 + },
  153 + handleEdit(row) {
  154 + this.$router.push({ path: `/views/owner/editOwnerCommittee?ocId=${row.ocId}` })
  155 + },
  156 + handleDelete(row) {
  157 + this.$refs.deleteDialog.open(row)
  158 + },
  159 + handleDetail(row) {
  160 + this.$router.push({ path: `/views/owner/ownerCommitteeDetail?ocId=${row.ocId}` })
  161 + },
  162 + handleDeleteSuccess() {
  163 + this.getList()
  164 + this.$message.success(this.$t('ownerCommitteeManage.deleteSuccess'))
  165 + },
  166 + handleSizeChange(val) {
  167 + this.pagination.size = val
  168 + this.getList()
  169 + },
  170 + handlePageChange(val) {
  171 + this.pagination.current = val
  172 + this.getList()
  173 + }
  174 + }
  175 +}
  176 +</script>
  177 +
  178 +<style lang="scss" scoped>
  179 +.owner-committee-container {
  180 + padding: 20px;
  181 +
  182 + .search-wrapper {
  183 + margin-bottom: 20px;
  184 +
  185 + .el-row {
  186 + margin-bottom: -10px;
  187 + }
  188 +
  189 + .el-col {
  190 + padding-bottom: 10px;
  191 + }
  192 + }
  193 +
  194 + .list-wrapper {
  195 + .el-table {
  196 + margin-top: 15px;
  197 + }
  198 +
  199 + .el-pagination {
  200 + margin-top: 20px;
  201 + text-align: right;
  202 + }
  203 + }
  204 +}
  205 +</style>
0 \ No newline at end of file 206 \ No newline at end of file