Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop

This commit is contained in:
18571350067 2021-11-08 10:50:48 +08:00
commit d1887a42f9
9 changed files with 249 additions and 75 deletions

View File

@ -26,7 +26,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入用户名" v-decorator="['userName', {rules: [{required: true, min: 5, message: '请输入至少五个字符的账号'}]}]" /> <a-input placeholder="请输入用户名" :disabled="registerDisabled" v-decorator="['userName', {rules: [{required: true, min: 5, message: '请输入至少五个字符的账号'}]}]" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
@ -38,7 +38,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入姓名" v-decorator="['name', {rules: [{required: true, message: '请输入姓名'}]}]" /> <a-input placeholder="请输入姓名" :disabled="registerDisabled" v-decorator="['name', {rules: [{required: true, message: '请输入姓名'}]}]" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
@ -106,7 +106,9 @@
:wrapperCol="{span: 20}" :wrapperCol="{span: 20}"
has-feedback has-feedback
> >
<a-input v-decorator="['jobs',{rules: [{ required: true, message: '请输入岗位' }]}]" /> <a-select style="width: 100%" placeholder="请选择岗位" v-decorator="['jobs',{rules: [{ required: true, message: '请选择岗位' }]}]" >
<a-select-option v-for="(item,index) in jobsData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
@ -120,7 +122,9 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input v-decorator="['workType',{rules: [{ required: true, message: '请输入工种' }]}]" /> <a-select style="width: 100%" placeholder="请选择工种" v-decorator="['workType',{rules: [{ required: true, message: '请选择工种' }]}]" >
<a-select-option v-for="(item,index) in workTypeData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
@ -132,7 +136,9 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input v-decorator="['degreeId',{rules: [{ required: true, message: '请输入工种' }]}]" /> <a-select style="width: 100%" placeholder="请选择学历" v-decorator="['degreeId',{rules: [{ required: true, message: '请选择学历' }]}]" >
<a-select-option v-for="(item,index) in degreeData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
@ -146,20 +152,8 @@
:wrapperCol="{span: 20}" :wrapperCol="{span: 20}"
> >
<a-checkbox-group v-decorator="['type',{rules: [{ required: true, message: '请选择人员类型!' }]}]"> <a-checkbox-group v-decorator="['type',{rules: [{ required: true, message: '请选择人员类型!' }]}]">
<a-checkbox value="1" name="type"> <a-checkbox name="type" v-for="(item,index) in typeData" :key="index" :value="item.value" >
单位主要负责人 {{ item.name }}
</a-checkbox>
<a-checkbox value="2" name="type">
安全管理员
</a-checkbox>
<a-checkbox value="3" name="type">
班组长
</a-checkbox>
<a-checkbox value="4" name="type">
特种作业人员
</a-checkbox>
<a-checkbox value="5" name="type">
其他
</a-checkbox> </a-checkbox>
</a-checkbox-group> </a-checkbox-group>
</a-form-item> </a-form-item>
@ -175,7 +169,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input readOnly @click="openOrgTree" v-decorator="['orgName',{rules: [{ required: true, message: '请选择机构' }]}]" /> <a-input readOnly @click="openOrgTree" :disabled="registerDisabled" v-decorator="['orgName',{rules: [{ required: true, message: '请选择机构' }]}]" />
</a-form-item> </a-form-item>
<a-form-item style="display: none;"> <a-form-item style="display: none;">
<a-input v-decorator="['orgId']" /> <a-input v-decorator="['orgId']" />
@ -183,6 +177,9 @@
</a-form> </a-form>
</a-col> </a-col>
</a-row> </a-row>
<a-divider orientation="left">上传身份证</a-divider>
</a-spin> </a-spin>
<org-tree @selectOrg="selectOrg($event)" ref="orgModal"/> <org-tree @selectOrg="selectOrg($event)" ref="orgModal"/>
@ -192,6 +189,7 @@
<script> <script>
import { personAddOrUpdate, personGet } from '@/api/person/person' import { personAddOrUpdate, personGet } from '@/api/person/person'
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
import OrgTree from '../org/OrgTree' import OrgTree from '../org/OrgTree'
export default { export default {
components: { components: {
@ -210,28 +208,61 @@
modalTitle: '新增人员', modalTitle: '新增人员',
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this) registerDisabled: false,
form: this.$form.createForm(this),
jobsData: [],
workTypeData: [],
degreeData: [],
typeData: []
} }
}, },
mounted () {
this.dictionaryDropDown()
},
methods: { methods: {
// //
add () { registerEdit (record) {
this.modalTitle = '新增人员' this.modalTitle = '新增人员'
this.confirmLoading = true
this.visible = true this.visible = true
this.registerDisabled = true
setTimeout(() => {
//
this.form.setFieldsValue(
{
name: record.name,
userName: record.userName,
phone: record.phone,
orgId: record.orgId,
orgName: record.orgName
}
)
}, 100)
this.confirmLoading = false
}, },
// //
edit (record) { edit (record) {
this.modalTitle = '编辑人员' this.modalTitle = '编辑人员'
this.confirmLoading = true this.confirmLoading = true
this.visible = true this.visible = true
this.registerDisabled = true
// //
personGet({ id: record.id }).then((res) => { personGet({ id: record.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
const data = res.data const data = res.data
// //
const type = data.type.split(',') const type = data.type.split(',')
this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: type }) const typeIntArr = []//
type.forEach(item => {
typeIntArr.push(+item)
})
this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: typeIntArr })
console.log(data)
this.form.setFieldsValue( this.form.setFieldsValue(
{ {
id: data.id, id: data.id,
@ -242,8 +273,8 @@
// age: data.age, // age: data.age,
// sex: data.sex, // sex: data.sex,
phone: data.phone, phone: data.phone,
jobs: data.jobs, jobs: parseInt(data.jobs),
workType: data.workType, workType: parseInt(data.workType),
degreeId: data.degreeId, degreeId: data.degreeId,
orgId: data.orgId, orgId: data.orgId,
orgName: data.orgName orgName: data.orgName
@ -257,6 +288,29 @@
}) })
this.confirmLoading = false this.confirmLoading = false
}, },
/**
* 获取字典数据
*/
dictionaryDropDown () {
this.formLoading = true
//
dictionaryDropDown({ dictionaryCode: '0002' }).then((res) => {
this.jobsData = res.data
})
//
dictionaryDropDown({ dictionaryCode: '0003' }).then((res) => {
this.workTypeData = res.data
})
//
dictionaryDropDown({ dictionaryCode: '0004' }).then((res) => {
this.degreeData = res.data
})
//
dictionaryDropDown({ dictionaryCode: '0005' }).then((res) => {
this.typeData = res.data
this.formLoading = false
})
},
handleSubmit () { handleSubmit () {
const { form: { validateFields } } = this const { form: { validateFields } } = this
this.confirmLoading = true this.confirmLoading = true

View File

@ -41,7 +41,7 @@
</a-card> </a-card>
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-operator"> <div class="table-operator">
<a-button @click="$refs.personForm.add()" icon="plus" type="primary" v-if="hasPerm('person:add')">新增人员</a-button> <a-button @click="personRegister" icon="plus" type="primary" v-if="hasPerm('person:add')">新增人员</a-button>
<a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button> <a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button>
<a-button @click="quit" type="primary" v-if="hasPerm('person:quit')">离职</a-button> <a-button @click="quit" type="primary" v-if="hasPerm('person:quit')">离职</a-button>
@ -52,7 +52,7 @@
</div> </div>
<div class="table-operator"> <div class="table-operator">
<div class='person-type'> <div class="person-type">
<a-radio-group v-model="queryParam.isAdmin" @change="onRadioChange"> <a-radio-group v-model="queryParam.isAdmin" @change="onRadioChange">
<a-radio :value="2">学员</a-radio> <a-radio :value="2">学员</a-radio>
<a-radio :value="1">管理员</a-radio> <a-radio :value="1">管理员</a-radio>
@ -111,6 +111,7 @@
import { orgList } from '@/api/org/org' import { orgList } from '@/api/org/org'
import { listToTree } from '@/utils/util' import { listToTree } from '@/utils/util'
import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd } from '@/api/person/person' import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd } from '@/api/person/person'
import PersonRegister from './PersonRegister'
import PersonForm from './PersonForm' import PersonForm from './PersonForm'
import PersonDetail from './PersonDetail' import PersonDetail from './PersonDetail'
import OrgTree from '../org/OrgTree' import OrgTree from '../org/OrgTree'
@ -119,6 +120,7 @@
export default { export default {
components: { components: {
STable, STable,
PersonRegister,
PersonForm, PersonForm,
PersonDetail, PersonDetail,
OrgTree OrgTree
@ -172,14 +174,13 @@
title: 'name', title: 'name',
key: 'id', key: 'id',
value: 'id' value: 'id'
} },
orgId: ''
} }
}, },
created () { created () {
/** /**
* 获取到机构树展开顶级下树节点考虑到后期数据量变大不建议全部展开 * 获取到机构树展开顶级下树节点考虑到后期数据量变大不建议全部展开
完犊子你的决策支撑写完了可以的呢
我反正用不上这两天发展党员还可以凑凑
*/ */
orgList().then(res => { orgList().then(res => {
this.treeLoading = false this.treeLoading = false
@ -187,6 +188,8 @@
return return
} }
this.orgTree = listToTree(res.data, [], rootParentId) this.orgTree = listToTree(res.data, [], rootParentId)
this.orgId = this.orgTree[0].id
console.log(this.orgId)
for (var item of this.orgTree) { for (var item of this.orgTree) {
if (item.pid === 0) { if (item.pid === 0) {
this.defaultExpandedKeys.push(item.id) this.defaultExpandedKeys.push(item.id)
@ -313,6 +316,12 @@
} }
}) })
}, },
personRegister () {
this.$router.push({
path: '/person/personRegister',
query: { orgId: this.orgId }
})
},
/** /**
* 点击左侧机构树查询列表 * 点击左侧机构树查询列表
*/ */
@ -320,6 +329,7 @@
this.queryParam = { this.queryParam = {
'orgId': e.toString() 'orgId': e.toString()
} }
this.orgId = e.toString()
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}, },
handleOk () { handleOk () {

View File

@ -0,0 +1,117 @@
<template>
<div>
<a-card :bordered="false" style="padding-bottom: 0px; margin-bottom: 10px ">
<div class="table-page-search-wrapper">
<h3>新增人员</h3>
<h3>单位邀请码{{ invitationCode }}</h3>
<h3>邀请链接 www.anquanpeixun.com</h3>
</div>
</a-card>
<a-card :bordered="false">
<div class="table-operator">
<h3>最近注册人员</h3>
</div>
<s-table
ref="table"
:columns="columns"
:data="loadData"
:rowKey="(record) => record.id"
>
<template slot="createTime" slot-scope="text, record">
{{ record.createTime | moment('YYYY-MM-DD') }}
</template>
<span slot="action" slot-scope="text, record">
<a @click="$refs.personForm.registerEdit(record)">编辑</a>
</span>
</s-table>
<person-form ref="personForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { STable } from '@/components'
import { personRegisterPage } from '@/api/person/personRegister'
import PersonForm from './PersonForm'
export default {
components: {
STable,
PersonForm
},
data () {
return {
invitationCode: '',
//
queryParam: { orgId: this.$route.query.orgId },
//
columns: [
{
title: '姓名',
dataIndex: 'name'
},
{
title: '用户名',
dataIndex: 'userName'
},
{
title: '单位信息',
dataIndex: 'unit'
},
{
title: '部门信息',
dataIndex: 'dept'
},
{
title: '手机号',
dataIndex: 'phone'
},
{
title: '注册时间',
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' }
},
{
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
// Promise
loadData: parameter => {
return personRegisterPage(Object.assign(parameter, this.queryParam)).then((res) => {
console.log(res)
this.invitationCode = res.invitationCode
return res
})
}
}
},
created () {
},
methods: {
handleOk () {
this.$refs.table.refresh()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.person-type span{
font-size: 24px;
}
h3 {
font-weight: 600;
}
</style>

View File

@ -1,7 +1,7 @@
<template> <template>
<!-- PageHeader 第二种使用方式 (v-slot) --> <!-- PageHeader 第二种使用方式 (v-slot) -->
<a-card :bordered="false" :title="title"> <a-card :bordered="false" :title="title">
<a-steps class="steps" :current="currentTab"> <a-steps class="steps" type="navigation" :current="currentTab">
<a-step title="基本信息" /> <a-step title="基本信息" />
<a-step title="选择单位" /> <a-step title="选择单位" />
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" --> <!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->

View File

@ -9,7 +9,7 @@
<a-button icon="select" @click="$refs.CourseSelect.edit({})">添加课程</a-button> <a-button icon="select" @click="$refs.CourseSelect.edit({})">添加课程</a-button>
</a-space> </a-space>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData"> <s-table ref="table" size="default" rowKey="id" :columns="columns" :data="data1">
<span slot="serial" slot-scope="text, record, index"> <span slot="serial" slot-scope="text, record, index">
{{ index + 1 }} {{ index + 1 }}
</span> </span>
@ -49,34 +49,24 @@ export default {
data() { data() {
// //
return { return {
form: this.$form.createForm(this, { name: 'project' }), labelCol: {},
wrapperCol: {},
vertical: 'vertical',
data1: {},
totalHours: 0, // totalHours: 0, //
totalLearnHours: 0, // totalLearnHours: 0, //
totalTopicNum: 0, // totalTopicNum: 0, //
// queryParam: {},//
queryParam: {},
//
columns: [ columns: [
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } }, { title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' }, { title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
{ title: '课程名称', dataIndex: 'courseName', key: 'courseName' }, { title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' }, { title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' }, { title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
{ title: '题量', dataIndex: 'topicNumber', key: 'projectName' }, { title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
{ title: '项目名称', dataIndex: 'projectName', key: 'projectName' }, { title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
{ { title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' }, },
title: '操作', ], //
width: 200,
align: 'center',
scopedSlots: { customRender: 'action' },
},
],
// Promise
loadData: (parameter) => {
return getProjectList(Object.assign(parameter, this.queryParam)).then((res) => {
return res
})
},
} }
}, },
// data // data

View File

@ -12,8 +12,8 @@
<a-row type="flex" justify="center" align="top"> <a-row type="flex" justify="center" align="top">
<a-col :span="6"> <a-col :span="6">
<a-menu v-model="current" mode="horizontal"> <a-menu v-model="current" mode="horizontal">
<a-menu-item key="mail"> <a-icon type="mail" />系统课程</a-menu-item> <a-menu-item key="sys"> <a-icon type="mail" />系统课程</a-menu-item>
<a-menu-item key="app"> <a-icon type="appstore" />自制课程</a-menu-item> <a-menu-item key="self"> <a-icon type="appstore" />自制课程</a-menu-item>
</a-menu> </a-menu>
<a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" /> <a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
<a-tree <a-tree
@ -43,10 +43,6 @@
//jsjsjson //jsjsjson
//import from '' //import from ''
/**------------------------------------------------------------ */
420500199901110031
/**----------------------------------------------------------------- */
export default { export default {
//import使 //import使
components: {}, components: {},
@ -57,11 +53,11 @@ export default {
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
current: ['mail'], current: ['mail'],
modalTitle: '',
expandedKeys: [], expandedKeys: [],
searchValue: '', searchValue: '',
autoExpandParent: true, autoExpandParent: true,
gData, gData: [],
} }
}, },
// data // data

View File

@ -86,13 +86,13 @@
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" /> <a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
</a-form-item> </a-form-item>
<span> 补考次数: </span> <!-- <span> 补考次数: </span>
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" /> <a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
</a-form-item> </a-form-item>
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }"> <a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
<a-button type="primary" @click="randomResit"> 随机补考 </a-button> <a-button type="primary" @click="randomResit"> 随机补考 </a-button>
</a-form-item> </a-form-item> -->
</a-form-item> </a-form-item>
</a-col> </a-col>

View File

@ -7,6 +7,8 @@
@search="handleRefresh" @search="handleRefresh"
@reset="() => {queryParam = {}, handleRefresh()}" > @reset="() => {queryParam = {}, handleRefresh()}" >
</SearchCom> </SearchCom>
<a-button type="primary" @click="handleCreate">新增</a-button>
</div> </div>
<s-table <s-table
ref="table" ref="table"

View File

@ -46,13 +46,14 @@
<script> <script>
import { dictionaryItemPage, dictionaryItemDel } from '@/api/sys/dictionaryItem' import { dictionaryItemPage, dictionaryItemDel } from '@/api/sys/dictionaryItem'
import { STable } from '@/components' import { STable, GoBack } from '@/components'
import DictionaryItemForm from './DictionaryItemForm' import DictionaryItemForm from './DictionaryItemForm'
export default { export default {
name: 'DictionaryItemList', name: 'DictionaryItemList',
components: { components: {
STable, STable,
GoBack,
DictionaryItemForm DictionaryItemForm
}, },
data () { data () {
@ -91,6 +92,10 @@ export default {
} }
}, },
methods: { methods: {
goBack () {
//
this.$router.push({ path: '/dictionary' })
},
// //
handleCreate () { handleCreate () {
this.$refs.modal.add() this.$refs.modal.add()