Browse Source

硬核页面修改

feature/syp_points
zhangyongzhangyong 5 years ago
parent
commit
ff2276a795
  1. 46
      src/views/modules/custom/deptinfo-add-or-update.vue
  2. 1
      src/views/modules/custom/deptinfo.vue

46
src/views/modules/custom/deptinfo-add-or-update.vue

@ -1,21 +1,14 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="部门名称" prop="deptId">
<el-cascader
ref="name"
v-model="dataForm.deptId"
:options="options"
:props="{ checkStrictly: true }"
@change="changeHandle"
clearable
collapse-tags
style="width:50%"
:disabled="disabledDeptName">
</el-cascader>
<el-form-item label="部门名称" prop="deptName">
<el-input v-model="dataForm.deptName" placeholder="部门名称" maxlength="20" show-word-limit></el-input>
</el-form-item>
<el-form-item label="部门电话" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="部门电话" style="width:50%"></el-input>
<el-input v-model="dataForm.mobile" placeholder="部门电话"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="0" :max="9999"></el-input-number>
</el-form-item>
</el-form>
<template slot="footer">
@ -44,17 +37,19 @@ export default {
updatedTime: '',
streetId: '',
communityId: '',
gridId: ''
gridId: '',
sort: ''
},
ids: [],
options: [],
disabledDeptName: false
ids: []
}
},
computed: {
dataRule () {
return {
deptId: [
deptName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sort: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mobile: [
@ -65,28 +60,13 @@ export default {
}
},
created () {
this.$http
.get(`/sys/user/deptOptions/getAllByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
},
methods: {
changeHandle (value, selectedData) {
this.dataForm.deptName = this.$refs['name'].getCheckedNodes()[0].label
this.dataForm.deptId = this.$refs['name'].getCheckedNodes()[0].value
},
init () {
this.visible = true
this.disabledDeptName = false
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.disabledDeptName = true
this.getInfo()
}
})

1
src/views/modules/custom/deptinfo.vue

@ -19,6 +19,7 @@
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="deptName" label="部门名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" label="部门电话" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">

Loading…
Cancel
Save