|
@@ -4,7 +4,7 @@
|
|
<a-divider orientation="left">
|
|
<a-divider orientation="left">
|
|
<b>{{ formTitle }}</b>
|
|
<b>{{ formTitle }}</b>
|
|
</a-divider>
|
|
</a-divider>
|
|
- <a-form-model ref="form" :model="form" :rules="rules">
|
|
|
|
|
|
+ <a-form-model ref="form" :model="form">
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
<a-form-model-item label="用户昵称" prop="nickName">
|
|
<a-form-model-item label="用户昵称" prop="nickName">
|
|
@@ -121,32 +121,42 @@
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-divider orientation="left">
|
|
<a-divider orientation="left">
|
|
- <b>驾驶证信息</b>
|
|
|
|
- </a-divider>
|
|
|
|
- <a-row>
|
|
|
|
|
|
+ <b>驾驶证信息</b>
|
|
|
|
+ </a-divider>
|
|
|
|
+ <a-row>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
- <a-form-model-item label="驾驶证号码" prop="userName">
|
|
|
|
- <a-input v-model="form.jczhm" placeholder="暂无信息" />
|
|
|
|
|
|
+ <a-form-model-item label="驾驶证号码">
|
|
|
|
+ <a-input v-model="drivingLicense.drivingLicenseCode" placeholder="暂无信息" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
<a-form-model-item label="准驾车辆分类" prop="password">
|
|
<a-form-model-item label="准驾车辆分类" prop="password">
|
|
- <a-input-password v-model="form.zjclfl" placeholder="暂无信息" :maxLength="20" />
|
|
|
|
|
|
+ <a-input v-model="drivingLicense.drivingLicenseType" placeholder="暂无信息" :maxLength="20" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
- <a-form-model-item label="初次申领日期" prop="userName">
|
|
|
|
- <a-input v-model="form.jczhm" placeholder="暂无信息" />
|
|
|
|
|
|
+ <a-form-model-item label="初次申领日期">
|
|
|
|
+ <a-date-picker style="width: 100%" v-model="drivingLicense.firstTime" format="YYYY-MM-DD" allow-clear />
|
|
|
|
+ <!-- <a-input v-model="drivingLicense.firstTime" placeholder="暂无信息" /> -->
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
- <a-form-model-item label="驾驶证有效期" prop="password">
|
|
|
|
- <a-input-password v-model="form.zjclfl" placeholder="暂无信息" :maxLength="20" />
|
|
|
|
|
|
+ <a-form-model-item label="驾驶证有效期">
|
|
|
|
+ <a-date-picker
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ v-model="drivingLicense.expirationTime"
|
|
|
|
+ format="YYYY-MM-DD"
|
|
|
|
+ allow-clear
|
|
|
|
+ />
|
|
|
|
+ <!-- <a-input v-model="drivingLicense.expirationTime" placeholder="暂无信息" :maxLength="20" /> -->
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
|
|
+ <a-form-model-item label="驾驶证照片" prop="photo">
|
|
|
|
+ <file-upload v-model="photoUrl" type="image" module="car" @UpdateImg="UpdateImgs"></file-upload>
|
|
|
|
+ </a-form-model-item>
|
|
<!-- <a-row>
|
|
<!-- <a-row>
|
|
<a-col :span="10">
|
|
<a-col :span="10">
|
|
<a-form-model-item label="性别" prop="sex">
|
|
<a-form-model-item label="性别" prop="sex">
|
|
@@ -181,7 +191,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getUser, addUser, updateUser } from '@/api/system/user'
|
|
|
|
|
|
+import { getUser, addUser, updateUser, drivingLicense } from '@/api/system/user'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'CreateForm',
|
|
name: 'CreateForm',
|
|
@@ -225,33 +235,44 @@ export default {
|
|
remark: undefined,
|
|
remark: undefined,
|
|
postIds: [],
|
|
postIds: [],
|
|
roleIds: [],
|
|
roleIds: [],
|
|
|
|
+ drivingLicense: null,
|
|
},
|
|
},
|
|
- open: false,
|
|
|
|
- rules: {
|
|
|
|
- userName: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
|
|
|
|
- nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
|
|
|
- deptId: [{ required: true, message: '部门不能为空', trigger: 'change' }],
|
|
|
|
- password: [
|
|
|
|
- { required: true, message: '密码不能为空', trigger: 'blur' },
|
|
|
|
- { min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
|
|
|
|
- ],
|
|
|
|
- email: [
|
|
|
|
- { required: true, message: '邮箱不能为空', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- type: 'email',
|
|
|
|
- message: '请正确填写邮箱地址',
|
|
|
|
- trigger: ['blur', 'change'],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- phonenumber: [
|
|
|
|
- { required: true, message: '手机号不能为空', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
|
- message: '请正确填写手机号',
|
|
|
|
- trigger: 'blur',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ drivingLicense: {
|
|
|
|
+ drivingLicenseCode: null,
|
|
|
|
+ drivingLicenseImageUrl: null,
|
|
|
|
+ drivingLicenseType: null,
|
|
|
|
+ expirationTime: null,
|
|
|
|
+ firstTime: null,
|
|
|
|
+ drivingLicenseImageId: null,
|
|
|
|
+ userId: null,
|
|
},
|
|
},
|
|
|
|
+ open: false,
|
|
|
|
+ photoUrl: '',
|
|
|
|
+ // rules: {
|
|
|
|
+ // userName: [{ required: true, message: '用户名不能为空', trigger: 'blur' }],
|
|
|
|
+ // nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
|
|
|
+ // deptId: [{ required: true, message: '部门不能为空', trigger: 'change' }],
|
|
|
|
+ // password: [
|
|
|
|
+ // { required: true, message: '密码不能为空', trigger: 'blur' },
|
|
|
|
+ // { min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
|
|
|
|
+ // ],
|
|
|
|
+ // email: [
|
|
|
|
+ // { required: true, message: '邮箱不能为空', trigger: 'blur' },
|
|
|
|
+ // {
|
|
|
|
+ // type: 'email',
|
|
|
|
+ // message: '请正确填写邮箱地址',
|
|
|
|
+ // trigger: ['blur', 'change'],
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // phonenumber: [
|
|
|
|
+ // { required: true, message: '手机号不能为空', trigger: 'blur' },
|
|
|
|
+ // {
|
|
|
|
+ // pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
|
+ // message: '请正确填写手机号',
|
|
|
|
+ // trigger: 'blur',
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
}
|
|
}
|
|
},
|
|
},
|
|
filters: {},
|
|
filters: {},
|
|
@@ -287,6 +308,15 @@ export default {
|
|
postIds: [],
|
|
postIds: [],
|
|
roleIds: [],
|
|
roleIds: [],
|
|
}
|
|
}
|
|
|
|
+ this.drivingLicense = {
|
|
|
|
+ drivingLicenseCode: null,
|
|
|
|
+ drivingLicenseImageUrl: null,
|
|
|
|
+ drivingLicenseType: null,
|
|
|
|
+ expirationTime: null,
|
|
|
|
+ firstTime: null,
|
|
|
|
+ drivingLicenseImageId: null,
|
|
|
|
+ }
|
|
|
|
+ this.photoUrl = ''
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
@@ -300,7 +330,7 @@ export default {
|
|
this.form.password = this.initPassword
|
|
this.form.password = this.initPassword
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- /** 修改按钮操作 */
|
|
|
|
|
|
+ /** 详情 */
|
|
handleUpdate(row, ids) {
|
|
handleUpdate(row, ids) {
|
|
this.reset()
|
|
this.reset()
|
|
this.$emit('select-tree')
|
|
this.$emit('select-tree')
|
|
@@ -311,41 +341,73 @@ export default {
|
|
this.roleOptions = response.roles
|
|
this.roleOptions = response.roles
|
|
this.form.postIds = response.postIds
|
|
this.form.postIds = response.postIds
|
|
this.form.roleIds = response.roleIds
|
|
this.form.roleIds = response.roleIds
|
|
|
|
+ if (response.data.drivingLicense) {
|
|
|
|
+ this.drivingLicense = response.data.drivingLicense
|
|
|
|
+ this.photoUrl = '/api' + response.data.drivingLicense.drivingLicenseImageUrl
|
|
|
|
+ }
|
|
this.open = true
|
|
this.open = true
|
|
this.formTitle = '用户详情'
|
|
this.formTitle = '用户详情'
|
|
this.form.password = ''
|
|
this.form.password = ''
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ /** 修改按钮操作 */
|
|
|
|
+ handleEdit(row, ids) {
|
|
|
|
+ console.log(row);
|
|
|
|
+ this.reset()
|
|
|
|
+ this.formType = 2
|
|
|
|
+ const userId = row ? row.userId : ids
|
|
|
|
+ getUser(userId).then((response) => {
|
|
|
|
+ this.form = response.data
|
|
|
|
+ this.postOptions = response.posts
|
|
|
|
+ this.roleOptions = response.roles
|
|
|
|
+ this.form.postIds = response.postIds
|
|
|
|
+ this.form.roleIds = response.roleIds
|
|
|
|
+ if (response.data.drivingLicense) {
|
|
|
|
+ this.drivingLicense = response.data.drivingLicense
|
|
|
|
+ this.photoUrl = '/api' + response.data.drivingLicense.drivingLicenseImageUrl
|
|
|
|
+ }
|
|
|
|
+ this.drivingLicense.userId = response.data.userId || row.userId
|
|
|
|
+ this.open = true
|
|
|
|
+ this.formTitle = '编辑'
|
|
|
|
+ this.form.password = ''
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 上传驾驶证
|
|
|
|
+ UpdateImgs(val) {
|
|
|
|
+ this.drivingLicense.drivingLicenseImageId = val.response.id
|
|
|
|
+ this.photoUrl = '/api' + val.response.fileName
|
|
|
|
+ },
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm: function () {
|
|
submitForm: function () {
|
|
|
|
+ this.submitLoading = false
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
- if (valid) {
|
|
|
|
- this.submitLoading = true
|
|
|
|
- if (this.form.userId !== undefined) {
|
|
|
|
- updateUser(this.form)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.$message.success('修改成功', 3)
|
|
|
|
- this.open = false
|
|
|
|
- this.$emit('ok')
|
|
|
|
- })
|
|
|
|
- .finally(() => {
|
|
|
|
- this.submitLoading = false
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addUser(this.form)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.$message.success('新增成功', 3)
|
|
|
|
- this.open = false
|
|
|
|
- this.$emit('ok')
|
|
|
|
- })
|
|
|
|
- .finally(() => {
|
|
|
|
- this.submitLoading = false
|
|
|
|
- })
|
|
|
|
|
|
+ this.submitLoading = true
|
|
|
|
+ if (this.drivingLicense) {
|
|
|
|
+ // this.form.drivingLicense = this.drivingLicense
|
|
|
|
+ if (this.drivingLicense.firstTime?.format) {
|
|
|
|
+ this.drivingLicense.firstTime = this.drivingLicense.firstTime.format('YYYY-MM-DD')
|
|
|
|
+ }
|
|
|
|
+ if (this.drivingLicense.expirationTime?.format) {
|
|
|
|
+ this.drivingLicense.expirationTime = this.drivingLicense.expirationTime.format('YYYY-MM-DD')
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- return false
|
|
|
|
}
|
|
}
|
|
|
|
+ // const params = {
|
|
|
|
+ // firstTime: this.form.drivingLicense.firstTime,
|
|
|
|
+ // expirationTime: this.form.drivingLicense.expirationTime,
|
|
|
|
+ // }
|
|
|
|
+ drivingLicense(this.drivingLicense)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success('修改成功', 3)
|
|
|
|
+ this.submitLoading = false
|
|
|
|
+ this.open = false
|
|
|
|
+ this.reset()
|
|
|
|
+ this.$emit('ok')
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.submitLoading = false
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
+ this.submitLoading = false
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -354,10 +416,10 @@ export default {
|
|
/deep/.ant-form-item {
|
|
/deep/.ant-form-item {
|
|
margin-right: 50px;
|
|
margin-right: 50px;
|
|
}
|
|
}
|
|
-/deep/.ant-select{
|
|
|
|
-color: #000;
|
|
|
|
|
|
+/deep/.ant-select {
|
|
|
|
+ color: #000;
|
|
}
|
|
}
|
|
-/deep/.ant-input{
|
|
|
|
- color: #000;
|
|
|
|
|
|
+/deep/.ant-input {
|
|
|
|
+ color: #000;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|