|
@@ -272,377 +272,377 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
- import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
|
|
|
- import { accountApplyHistory, accountApplyFill, getCompanyAll, getAllAuditors, getAllDepartments } from '@/api/base'
|
|
|
- import { getRemoteFile } from '@/api/ftp'
|
|
|
- import { regPhone, regEmail, regPassword, regUserName, regRealName } from '@/utils/reg'
|
|
|
+import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
|
|
|
+import { accountApplyHistory, accountApplyFill, getCompanyAll, getAllAuditors, getAllDepartments } from '@/api/base'
|
|
|
+import { getRemoteFile } from '@/api/ftp'
|
|
|
+import { regPhone, regEmail, regPassword, regUserName, regRealName } from '@/utils/reg'
|
|
|
|
|
|
- // eslint-disable-next-line no-unused-vars
|
|
|
- import { ElForm } from 'element-ui/types/form'
|
|
|
+// eslint-disable-next-line no-unused-vars
|
|
|
+import { ElForm } from 'element-ui/types/form'
|
|
|
+import { encryption } from '@/utils/encryption'
|
|
|
|
|
|
- const sha1Hex = require('sha1-hex')
|
|
|
- const columns = [
|
|
|
- { prop: 'order', label: '序号', width: '80' },
|
|
|
- { prop: 'username', label: '登录名' },
|
|
|
- { prop: 'realName', label: '用户姓名' },
|
|
|
- { prop: 'createTime', label: '申请时间' },
|
|
|
- { prop: 'applyername', label: '申请人' },
|
|
|
- {
|
|
|
- prop: 'auditstatus',
|
|
|
- label: '审核意见',
|
|
|
- formatter: (row, col, cellValue, index) => {
|
|
|
- if (cellValue === '0') return '不同意'
|
|
|
- if (cellValue === '1') return '未审核'
|
|
|
- if (cellValue === '2') return '同意'
|
|
|
- }
|
|
|
- },
|
|
|
- { prop: 'audittime', label: '审核时间' },
|
|
|
- { label: '操作', scopedSlot: 'actions' }
|
|
|
- ]
|
|
|
- const getDefaultVal = () => ({
|
|
|
- username: '',
|
|
|
- password: '',
|
|
|
- realName: '',
|
|
|
- phone: '',
|
|
|
- email: '',
|
|
|
- departmentId: [],
|
|
|
- recipient: '', // 审核人
|
|
|
- note: '',
|
|
|
- job: '',
|
|
|
- applystate: '',
|
|
|
- file: '', // 用户头像
|
|
|
- electronicFile: '' // 电子签名
|
|
|
- })
|
|
|
+const columns = [
|
|
|
+ { prop: 'order', label: '序号', width: '80' },
|
|
|
+ { prop: 'username', label: '登录名' },
|
|
|
+ { prop: 'realName', label: '用户姓名' },
|
|
|
+ { prop: 'createTime', label: '申请时间' },
|
|
|
+ { prop: 'applyername', label: '申请人' },
|
|
|
+ {
|
|
|
+ prop: 'auditstatus',
|
|
|
+ label: '审核意见',
|
|
|
+ formatter: (row, col, cellValue, index) => {
|
|
|
+ if (cellValue === '0') return '不同意'
|
|
|
+ if (cellValue === '1') return '未审核'
|
|
|
+ if (cellValue === '2') return '同意'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { prop: 'audittime', label: '审核时间' },
|
|
|
+ { label: '操作', scopedSlot: 'actions' }
|
|
|
+]
|
|
|
+const getDefaultVal = () => ({
|
|
|
+ username: '',
|
|
|
+ password: '',
|
|
|
+ realName: '',
|
|
|
+ phone: '',
|
|
|
+ email: '',
|
|
|
+ departmentId: [],
|
|
|
+ recipient: '', // 审核人
|
|
|
+ note: '',
|
|
|
+ job: '',
|
|
|
+ applystate: '',
|
|
|
+ file: '', // 用户头像
|
|
|
+ electronicFile: '' // 电子签名
|
|
|
+})
|
|
|
|
|
|
- @Component({
|
|
|
- filters: {
|
|
|
- formatteAuditStatus(val) {
|
|
|
- switch (val) {
|
|
|
- case '0':
|
|
|
- return '不同意'
|
|
|
+@Component({
|
|
|
+ filters: {
|
|
|
+ formatteAuditStatus(val) {
|
|
|
+ switch (val) {
|
|
|
+ case '0':
|
|
|
+ return '不同意'
|
|
|
|
|
|
- case '1':
|
|
|
- return '未审核'
|
|
|
+ case '1':
|
|
|
+ return '未审核'
|
|
|
|
|
|
- case '2':
|
|
|
- return '同意'
|
|
|
- }
|
|
|
+ case '2':
|
|
|
+ return '同意'
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- export default class AccountApply extends Vue {
|
|
|
- @Prop({ default: false }) showApply: boolean
|
|
|
- formatteAuditStatus: any
|
|
|
- accountApply = getDefaultVal()
|
|
|
- accountApplyRules = {
|
|
|
- username: [
|
|
|
- { required: true, message: '请输入登录名', trigger: 'blur' },
|
|
|
- {
|
|
|
- pattern: regUserName(),
|
|
|
- message: '4-16位字母与数字,不可包含非法字符!',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- password: [
|
|
|
- { required: true, message: '请输入密码', trigger: 'blur' },
|
|
|
- {
|
|
|
- pattern: regPassword(),
|
|
|
- message: '密码位数8-16位,必须包含大小写字母和数字,不可包含非法字符!',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- realName: [
|
|
|
- { required: true, message: '请输入用户姓名', trigger: 'blur' },
|
|
|
- {
|
|
|
- pattern: regRealName(),
|
|
|
- message: '2-6位中文字符,不可包含非法字符!',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- phone: [{ pattern: regPhone(), message: '请输入正确的联系电话', trigger: 'blur' }],
|
|
|
- email: [{ pattern: regEmail(), message: '请输入正确的邮箱', trigger: 'blur' }],
|
|
|
- // role: [{ required: true, message: '请输入角色', trigger: 'blur' }],
|
|
|
- departmentId: [{ required: true, message: '请选择部门', trigger: 'blur' }],
|
|
|
- recipient: [{ required: true, message: '请选择审核人', trigger: 'blur' }]
|
|
|
- // sign: [{ required: true, message: '请上传个性签名', trigger: 'blur' }],
|
|
|
- // applyNote: [
|
|
|
- // { required: true, message: '请输入备注信息', trigger: 'blur' }
|
|
|
- // ],
|
|
|
- // applyState: [
|
|
|
- // { required: true, message: '请输入申请说明', trigger: 'blur' }
|
|
|
- // ]
|
|
|
- }
|
|
|
- accountApplyTab = false
|
|
|
- applyDetailTab = false
|
|
|
- columns
|
|
|
- activeTab = 'history'
|
|
|
- departmentIdOptions = []
|
|
|
- recipients = [] // 审核人列表
|
|
|
- value = ''
|
|
|
- fileList = []
|
|
|
- applyRealName = ''
|
|
|
- applyStatus = ''
|
|
|
- applyTime = ''
|
|
|
- applyHistory = []
|
|
|
- pageSize = 10
|
|
|
- page = 1
|
|
|
- total = 0
|
|
|
- detailInfo = null
|
|
|
- activeNames = ['baseInfo']
|
|
|
- esign = ''
|
|
|
- head = ''
|
|
|
- @Watch('showApply')
|
|
|
- showApplyChange(val) {
|
|
|
- if (val === false) {
|
|
|
- this.accountApplyTab && (this.$refs.accountApply as ElForm).resetFields()
|
|
|
- this.accountApplyTab = false
|
|
|
- this.applyDetailTab = false
|
|
|
- this.activeTab = 'history'
|
|
|
+ }
|
|
|
+})
|
|
|
+export default class AccountApply extends Vue {
|
|
|
+ @Prop({ default: false }) showApply: boolean
|
|
|
+ formatteAuditStatus: any
|
|
|
+ accountApply = getDefaultVal()
|
|
|
+ accountApplyRules = {
|
|
|
+ username: [
|
|
|
+ { required: true, message: '请输入登录名', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ pattern: regUserName(),
|
|
|
+ message: '4-16位字母与数字,不可包含非法字符!',
|
|
|
+ trigger: 'blur'
|
|
|
}
|
|
|
+ ],
|
|
|
+ password: [
|
|
|
+ { required: true, message: '请输入密码', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ pattern: regPassword(),
|
|
|
+ message: '密码位数8-16位,必须包含大小写字母和数字,不可包含非法字符!',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ realName: [
|
|
|
+ { required: true, message: '请输入用户姓名', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ pattern: regRealName(),
|
|
|
+ message: '2-6位中文字符,不可包含非法字符!',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ phone: [{ pattern: regPhone(), message: '请输入正确的联系电话', trigger: 'blur' }],
|
|
|
+ email: [{ pattern: regEmail(), message: '请输入正确的邮箱', trigger: 'blur' }],
|
|
|
+ // role: [{ required: true, message: '请输入角色', trigger: 'blur' }],
|
|
|
+ departmentId: [{ required: true, message: '请选择部门', trigger: 'blur' }],
|
|
|
+ recipient: [{ required: true, message: '请选择审核人', trigger: 'blur' }]
|
|
|
+ // sign: [{ required: true, message: '请上传个性签名', trigger: 'blur' }],
|
|
|
+ // applyNote: [
|
|
|
+ // { required: true, message: '请输入备注信息', trigger: 'blur' }
|
|
|
+ // ],
|
|
|
+ // applyState: [
|
|
|
+ // { required: true, message: '请输入申请说明', trigger: 'blur' }
|
|
|
+ // ]
|
|
|
+ }
|
|
|
+ accountApplyTab = false
|
|
|
+ applyDetailTab = false
|
|
|
+ columns
|
|
|
+ activeTab = 'history'
|
|
|
+ departmentIdOptions = []
|
|
|
+ recipients = [] // 审核人列表
|
|
|
+ value = ''
|
|
|
+ fileList = []
|
|
|
+ applyRealName = ''
|
|
|
+ applyStatus = ''
|
|
|
+ applyTime = ''
|
|
|
+ applyHistory = []
|
|
|
+ pageSize = 10
|
|
|
+ page = 1
|
|
|
+ total = 0
|
|
|
+ detailInfo = null
|
|
|
+ activeNames = ['baseInfo']
|
|
|
+ esign = ''
|
|
|
+ head = ''
|
|
|
+ @Watch('showApply')
|
|
|
+ showApplyChange(val) {
|
|
|
+ if (val === false) {
|
|
|
+ this.accountApplyTab && (this.$refs.accountApply as ElForm).resetFields()
|
|
|
+ this.accountApplyTab = false
|
|
|
+ this.applyDetailTab = false
|
|
|
+ this.activeTab = 'history'
|
|
|
}
|
|
|
- departmentId = ''
|
|
|
- get reviewers() {
|
|
|
- return (this.recipients || []).filter(({ departmentId: id }) => {
|
|
|
- return id === this.departmentId
|
|
|
- })
|
|
|
- }
|
|
|
- onDeptChange(val = []) {
|
|
|
- this.accountApply.recipient = ''
|
|
|
- this.departmentId = val[val.length - 1] || ''
|
|
|
- }
|
|
|
- mounted() {
|
|
|
- this.columns = columns
|
|
|
- this.historyList()
|
|
|
- this.getdepartmentId()
|
|
|
- this.getAuditors()
|
|
|
- }
|
|
|
- // 打开账号申请界面
|
|
|
- toggleAccountApplyTab() {
|
|
|
- this.accountApplyTab = true
|
|
|
- if (this.accountApplyTab) this.activeTab = 'account'
|
|
|
+ }
|
|
|
+ departmentId = ''
|
|
|
+ get reviewers() {
|
|
|
+ return (this.recipients || []).filter(({ departmentId: id }) => {
|
|
|
+ return id === this.departmentId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ onDeptChange(val = []) {
|
|
|
+ this.accountApply.recipient = ''
|
|
|
+ this.departmentId = val[val.length - 1] || ''
|
|
|
+ }
|
|
|
+ mounted() {
|
|
|
+ this.columns = columns
|
|
|
+ this.historyList()
|
|
|
+ this.getdepartmentId()
|
|
|
+ this.getAuditors()
|
|
|
+ }
|
|
|
+ // 打开账号申请界面
|
|
|
+ toggleAccountApplyTab() {
|
|
|
+ this.accountApplyTab = true
|
|
|
+ if (this.accountApplyTab) this.activeTab = 'account'
|
|
|
|
|
|
- console.log(this.recipients)
|
|
|
- }
|
|
|
- // 打开申请详情页面
|
|
|
- toggleAccountApplyDetailTab(data) {
|
|
|
- this.detailInfo = data
|
|
|
- this.applyDetailTab = true
|
|
|
- if (this.applyDetailTab) this.activeTab = 'accountApplyDetail'
|
|
|
- const arr = [this.detailInfo.avatar, this.detailInfo.esignature]
|
|
|
- // arr.forEach((item, index) => {
|
|
|
- // item !== null &&
|
|
|
- // getRemoteFile(item).then((res) => {
|
|
|
- // if (res.status === 200) {
|
|
|
- // index === 1
|
|
|
- // ? (this.detailInfo.esignature = res.config.url)
|
|
|
- // : (this.detailInfo.avatar = res.config.url)
|
|
|
- // }
|
|
|
- // })
|
|
|
+ console.log(this.recipients)
|
|
|
+ }
|
|
|
+ // 打开申请详情页面
|
|
|
+ toggleAccountApplyDetailTab(data) {
|
|
|
+ this.detailInfo = data
|
|
|
+ this.applyDetailTab = true
|
|
|
+ if (this.applyDetailTab) this.activeTab = 'accountApplyDetail'
|
|
|
+ const arr = [this.detailInfo.avatar, this.detailInfo.esignature]
|
|
|
+ // arr.forEach((item, index) => {
|
|
|
+ // item !== null &&
|
|
|
+ // getRemoteFile(item).then((res) => {
|
|
|
+ // if (res.status === 200) {
|
|
|
+ // index === 1
|
|
|
+ // ? (this.detailInfo.esignature = res.config.url)
|
|
|
+ // : (this.detailInfo.avatar = res.config.url)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
- // })
|
|
|
- const { departmentId } = this.accountApply
|
|
|
+ // })
|
|
|
+ const { departmentId } = this.accountApply
|
|
|
|
|
|
- this.detailInfo = {
|
|
|
- ...this.detailInfo,
|
|
|
- departmentId: Array.isArray(departmentId) ? [...departmentId].pop() : departmentId,
|
|
|
- esignature: getRemoteFile(this.detailInfo.esignature),
|
|
|
- avatar: getRemoteFile(this.detailInfo.avatar)
|
|
|
- }
|
|
|
+ this.detailInfo = {
|
|
|
+ ...this.detailInfo,
|
|
|
+ departmentId: Array.isArray(departmentId) ? [...departmentId].pop() : departmentId,
|
|
|
+ esignature: getRemoteFile(this.detailInfo.esignature),
|
|
|
+ avatar: getRemoteFile(this.detailInfo.avatar)
|
|
|
}
|
|
|
- // 关闭dialog
|
|
|
- closeDialog() {
|
|
|
- this.$emit('update:showApply', false)
|
|
|
+ }
|
|
|
+ // 关闭dialog
|
|
|
+ closeDialog() {
|
|
|
+ this.$emit('update:showApply', false)
|
|
|
+ }
|
|
|
+ // 历史申请记录
|
|
|
+ historyList() {
|
|
|
+ const data = {
|
|
|
+ realName: this.applyRealName,
|
|
|
+ auditStatus: this.applyStatus,
|
|
|
+ startAuditTime: (this.applyTime !== null && this.applyTime[0]) || '',
|
|
|
+ endAuditTime: (this.applyTime !== null && this.applyTime[1]) || '',
|
|
|
+ current: this.page,
|
|
|
+ size: this.pageSize
|
|
|
+ // 'orders[0].asc': false,
|
|
|
+ // 'orders[0].column': 'ID'
|
|
|
}
|
|
|
- // 历史申请记录
|
|
|
- historyList() {
|
|
|
- const data = {
|
|
|
- realName: this.applyRealName,
|
|
|
- auditStatus: this.applyStatus,
|
|
|
- startAuditTime: (this.applyTime !== null && this.applyTime[0]) || '',
|
|
|
- endAuditTime: (this.applyTime !== null && this.applyTime[1]) || '',
|
|
|
- current: this.page,
|
|
|
- size: this.pageSize
|
|
|
- // 'orders[0].asc': false,
|
|
|
- // 'orders[0].column': 'ID'
|
|
|
- }
|
|
|
- accountApplyHistory(data).then((res) => {
|
|
|
- this.total = res.result.total
|
|
|
- res.result.records.forEach((item, index) => {
|
|
|
- item.order = index + 1
|
|
|
- })
|
|
|
- this.applyHistory = res.result.records
|
|
|
+ accountApplyHistory(data).then((res) => {
|
|
|
+ this.total = res.result.total
|
|
|
+ res.result.records.forEach((item, index) => {
|
|
|
+ item.order = index + 1
|
|
|
})
|
|
|
- }
|
|
|
- // 申请账号
|
|
|
- submitApply() {
|
|
|
- ;(this.$refs.accountApply as ElForm).validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- const data = new FormData()
|
|
|
- for (const key in this.accountApply) {
|
|
|
- if (key === 'departmentId') {
|
|
|
- data.append(
|
|
|
- key,
|
|
|
- Array.isArray(this.accountApply[key]) ? [...this.accountApply[key]].pop() : this.accountApply[key]
|
|
|
- )
|
|
|
- } else {
|
|
|
- data.append(key, key === 'password' ? sha1Hex(this.accountApply[key]) : this.accountApply[key])
|
|
|
- }
|
|
|
+ this.applyHistory = res.result.records
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 申请账号
|
|
|
+ submitApply() {
|
|
|
+ ;(this.$refs.accountApply as ElForm).validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ const data = new FormData()
|
|
|
+ for (const key in this.accountApply) {
|
|
|
+ if (key === 'departmentId') {
|
|
|
+ data.append(
|
|
|
+ key,
|
|
|
+ Array.isArray(this.accountApply[key]) ? [...this.accountApply[key]].pop() : this.accountApply[key]
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ data.append(key, key === 'password' ? encryption(this.accountApply[key]) : this.accountApply[key])
|
|
|
}
|
|
|
- accountApplyFill(data).then((res) => {
|
|
|
- // 用户存在的时候, 后台返回的数据多包了一层,造成永远都是code = 1, 报错的时候是res.result.code === -1
|
|
|
- if ((res.result || {}).code === -1) {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.result.message
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.code === 1) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '用户申请成功'
|
|
|
- })
|
|
|
-
|
|
|
- this.accountApplyTab = false
|
|
|
- this.accountApply = getDefaultVal()
|
|
|
- this.activeTab = 'history'
|
|
|
- this.$store.dispatch('user/finnishApply', true)
|
|
|
- this.historyList()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- return false
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- // 上传之前做验证和文件转换
|
|
|
- beforePicUpload(file, type) {
|
|
|
- const isJPG = file.type === 'image/jpeg'
|
|
|
- const isPng = file.type === 'image/png'
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2
|
|
|
+ accountApplyFill(data).then((res) => {
|
|
|
+ // 用户存在的时候, 后台返回的数据多包了一层,造成永远都是code = 1, 报错的时候是res.result.code === -1
|
|
|
+ if ((res.result || {}).code === -1) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.result.message
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '用户申请成功'
|
|
|
+ })
|
|
|
|
|
|
- if (!isJPG && !isPng) {
|
|
|
- this.$message.error('上传图片只能是 JPG或png 格式!')
|
|
|
- return false
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error('上传头像图片大小不能超过 2MB!')
|
|
|
+ this.accountApplyTab = false
|
|
|
+ this.accountApply = getDefaultVal()
|
|
|
+ this.activeTab = 'history'
|
|
|
+ this.$store.dispatch('user/finnishApply', true)
|
|
|
+ this.historyList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
return false
|
|
|
}
|
|
|
- const _this = this
|
|
|
- const reader = new FileReader()
|
|
|
- type === 'sign' ? (this.accountApply.electronicFile = file) : (this.accountApply.file = file)
|
|
|
- // 转base64
|
|
|
- reader.onload = function (e) {
|
|
|
- type === 'sign' ? (_this.esign = e.target.result.toString()) : (_this.head = e.target.result.toString()) // 将图片路径赋值给src
|
|
|
- }
|
|
|
- reader.readAsDataURL(file)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 上传之前做验证和文件转换
|
|
|
+ beforePicUpload(file, type) {
|
|
|
+ const isJPG = file.type === 'image/jpeg'
|
|
|
+ const isPng = file.type === 'image/png'
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2
|
|
|
+
|
|
|
+ if (!isJPG && !isPng) {
|
|
|
+ this.$message.error('上传图片只能是 JPG或png 格式!')
|
|
|
return false
|
|
|
}
|
|
|
- // 获取部门
|
|
|
- getdepartmentId() {
|
|
|
- getAllDepartments().then((res) => {
|
|
|
- this.departmentIdOptions = res.result || []
|
|
|
- })
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error('上传头像图片大小不能超过 2MB!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ const _this = this
|
|
|
+ const reader = new FileReader()
|
|
|
+ type === 'sign' ? (this.accountApply.electronicFile = file) : (this.accountApply.file = file)
|
|
|
+ // 转base64
|
|
|
+ reader.onload = function (e) {
|
|
|
+ type === 'sign' ? (_this.esign = e.target.result.toString()) : (_this.head = e.target.result.toString()) // 将图片路径赋值给src
|
|
|
}
|
|
|
+ reader.readAsDataURL(file)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ // 获取部门
|
|
|
+ getdepartmentId() {
|
|
|
+ getAllDepartments().then((res) => {
|
|
|
+ this.departmentIdOptions = res.result || []
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- get deptmentTree() {
|
|
|
- const getChildren = (parent) => {
|
|
|
- const { id: parentId } = parent
|
|
|
- const children = this.departmentIdOptions.filter((item) => item.parentId === parentId)
|
|
|
- if (!!children.length) parent.children = children.map(getChildren)
|
|
|
- return parent
|
|
|
- }
|
|
|
- return this.departmentIdOptions.filter((item) => !item.parentId).map(getChildren)
|
|
|
+ get deptmentTree() {
|
|
|
+ const getChildren = (parent) => {
|
|
|
+ const { id: parentId } = parent
|
|
|
+ const children = this.departmentIdOptions.filter((item) => item.parentId === parentId)
|
|
|
+ if (!!children.length) parent.children = children.map(getChildren)
|
|
|
+ return parent
|
|
|
}
|
|
|
+ return this.departmentIdOptions.filter((item) => !item.parentId).map(getChildren)
|
|
|
+ }
|
|
|
|
|
|
- // 获取审核人
|
|
|
- getAuditors() {
|
|
|
- getAllAuditors(null).then((res) => {
|
|
|
- this.recipients = res.result.map((item) => {
|
|
|
- return {
|
|
|
- name: item.realName,
|
|
|
- id: item.id,
|
|
|
- departmentId: item.departmentId
|
|
|
- }
|
|
|
- })
|
|
|
+ // 获取审核人
|
|
|
+ getAuditors() {
|
|
|
+ getAllAuditors(null).then((res) => {
|
|
|
+ this.recipients = res.result.map((item) => {
|
|
|
+ return {
|
|
|
+ name: item.realName,
|
|
|
+ id: item.id,
|
|
|
+ departmentId: item.departmentId
|
|
|
+ }
|
|
|
})
|
|
|
- }
|
|
|
- handleSizeChange(size) {
|
|
|
- this.pageSize = size
|
|
|
- this.historyList()
|
|
|
- }
|
|
|
- handleCurrentChange(data) {
|
|
|
- this.page = data
|
|
|
- this.historyList()
|
|
|
- }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleSizeChange(size) {
|
|
|
+ this.pageSize = size
|
|
|
+ this.historyList()
|
|
|
}
|
|
|
+ handleCurrentChange(data) {
|
|
|
+ this.page = data
|
|
|
+ this.historyList()
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .apply-account-container {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- .avatar-uploader .el-upload {
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
- border-radius: 6px;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- .avatar-uploader .el-upload:hover {
|
|
|
- border-color: #409eff;
|
|
|
- }
|
|
|
- .avatar-uploader-icon {
|
|
|
- font-size: 28px;
|
|
|
- color: #8c939d;
|
|
|
- width: 178px;
|
|
|
- height: 178px;
|
|
|
- line-height: 178px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .avatar {
|
|
|
- width: 178px;
|
|
|
- height: 178px;
|
|
|
- display: block;
|
|
|
- object-fit: cover;
|
|
|
- }
|
|
|
- .msg {
|
|
|
- color: #c0c4cc;
|
|
|
- font-size: 12px;
|
|
|
- line-height: 20px;
|
|
|
- }
|
|
|
+.apply-account-container {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .avatar-uploader .el-upload {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
- .base-info {
|
|
|
- .el-row {
|
|
|
- display: flex;
|
|
|
- margin-bottom: 20px;
|
|
|
- .title {
|
|
|
- display: inline-block;
|
|
|
- width: 100px;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
- .title + span,
|
|
|
- img {
|
|
|
- display: inline-block;
|
|
|
- width: 380px;
|
|
|
- }
|
|
|
- img {
|
|
|
- width: 120px;
|
|
|
- }
|
|
|
- }
|
|
|
+ .avatar-uploader .el-upload:hover {
|
|
|
+ border-color: #409eff;
|
|
|
}
|
|
|
- .custom-row {
|
|
|
+ .avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ line-height: 178px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .avatar {
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ display: block;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+ .msg {
|
|
|
+ color: #c0c4cc;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.base-info {
|
|
|
+ .el-row {
|
|
|
display: flex;
|
|
|
margin-bottom: 20px;
|
|
|
- span {
|
|
|
+ .title {
|
|
|
display: inline-block;
|
|
|
- width: 80%;
|
|
|
- &.title {
|
|
|
- width: 100px;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
+ width: 100px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .title + span,
|
|
|
+ img {
|
|
|
+ display: inline-block;
|
|
|
+ width: 380px;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 120px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.custom-row {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ width: 80%;
|
|
|
+ &.title {
|
|
|
+ width: 100px;
|
|
|
+ text-align: right;
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</style>
|