|
@@ -61,7 +61,15 @@ export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- form1: {},
|
|
|
+ form1: {
|
|
|
+ personnelJobNumber : '',
|
|
|
+ personnelName : '',
|
|
|
+ personnelPost : '',
|
|
|
+ personnelWorkshopid : '',
|
|
|
+ shipperId : '',
|
|
|
+ personnelShifts : '',
|
|
|
+ personnelTeam : ''
|
|
|
+ },
|
|
|
value: undefined,
|
|
|
//新增用户的SSO主键
|
|
|
personnelSsoId:'',
|
|
@@ -72,13 +80,19 @@ export default {
|
|
|
//选中的二级部门名称
|
|
|
value1:'',
|
|
|
//选中的二级部门机构ID和机构编码
|
|
|
- map1:[],
|
|
|
+ map1:{
|
|
|
+ shipperOrgCode : '',
|
|
|
+ shipperSsoId : ''
|
|
|
+ },
|
|
|
// 三级部门
|
|
|
options2:[],
|
|
|
// 选中的三级部门名称
|
|
|
value2:'',
|
|
|
//选中的三级部门机构ID和机构编码
|
|
|
- map2:[],
|
|
|
+ map2:{
|
|
|
+ shipperOrgCode : '',
|
|
|
+ shipperSsoId : ''
|
|
|
+ },
|
|
|
// 角色
|
|
|
options3:[],
|
|
|
// 选中的角色名称
|
|
@@ -135,7 +149,11 @@ export default {
|
|
|
//确定人员新增
|
|
|
makeSure() {
|
|
|
//初始化用户信息
|
|
|
- let userInfo = {};
|
|
|
+ let userInfo = {
|
|
|
+ orgCode : '',
|
|
|
+ orgName : '',
|
|
|
+ orgId : '',
|
|
|
+ };
|
|
|
//该用户没有三级部门
|
|
|
if(this.options2.length==0){
|
|
|
userInfo = {
|
|
@@ -169,100 +187,63 @@ export default {
|
|
|
Object.keys(userInfo).forEach((key) => {
|
|
|
formData.append(key, userInfo[key]);
|
|
|
});
|
|
|
+ //判断数据是否都填了
|
|
|
+ if(
|
|
|
+ this.form1.personnelJobNumber =='' ||
|
|
|
+ this.form1.personnelPost =='' ||
|
|
|
+ this.form1.personnelName =='' ||
|
|
|
+ // RmsPersonnel.personnelWorkshopid==null ||
|
|
|
+ this.form1.shipperId=='' ||
|
|
|
+ this.form1.personnelShifts=='' ||
|
|
|
+ this.form1.personnelTeam=='' ||
|
|
|
+ userInfo.orgName=='' ||
|
|
|
+ userInfo.orgCode=='' ||
|
|
|
+ userInfo.orgId=='' ||
|
|
|
+ this.value3==''
|
|
|
+ ){
|
|
|
+ this.$message.error("存在空值!");
|
|
|
+ }else{
|
|
|
+
|
|
|
//新增用户
|
|
|
this.$store.dispatch('system/usersManage/addUser',formData)
|
|
|
.then((res)=>{
|
|
|
|
|
|
- //再新增RMS_PERSONNEL表信息
|
|
|
- let rmsPersonnel = {
|
|
|
- personnelJobNumber : this.form1.personnelJobNumber,
|
|
|
- personnelPost : this.form1.personnelPost,
|
|
|
- personnelName : this.form1.personnelName,
|
|
|
- personnelDepartmentId : this.form1.shipperId,
|
|
|
- // personnelWorkshopid : this.form1.personnelWorkshopid,
|
|
|
- personnelShifts : this.form1.personnelShifts,
|
|
|
- personnelTeam : this.form1.personnelTeam,
|
|
|
- personnelSsoId : res.data.userId
|
|
|
- }
|
|
|
- if(
|
|
|
- RmsPersonnel.personnelJobNumber ==null ||
|
|
|
- RmsPersonnel.personnelName ==null ||
|
|
|
- RmsPersonnel.personnelPost ==null ||
|
|
|
- // RmsPersonnel.personnelWorkshopid==null ||
|
|
|
- RmsPersonnel.personnelShifts==null ||
|
|
|
- RmsPersonnel.departmentId==null ||
|
|
|
- RmsPersonnel.personnelTeam==null ||
|
|
|
- userInfo.orgName==null ||
|
|
|
- userInfo.orgCode==null ||
|
|
|
- userInfo.orgId==null ||
|
|
|
- this.value3==null
|
|
|
- )this.$message.error("存在空值!");
|
|
|
- else
|
|
|
-
|
|
|
- this.axios.post('/api/v1/rms/addPersonnel',rmsPersonnel)
|
|
|
- .then((res)=>{
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "新增成功!",
|
|
|
- });
|
|
|
- // this.$refs.table.refreshData();
|
|
|
- } else {
|
|
|
- this.$message.error("新增失败,可能存在重复!");
|
|
|
+ //再新增RMS_PERSONNEL表信息
|
|
|
+ let rmsPersonnel = {
|
|
|
+ personnelJobNumber : this.form1.personnelJobNumber,
|
|
|
+ personnelPost : this.form1.personnelPost,
|
|
|
+ personnelName : this.form1.personnelName,
|
|
|
+ personnelDepartmentId : this.form1.shipperId,
|
|
|
+ // personnelWorkshopid : this.form1.personnelWorkshopid,
|
|
|
+ personnelShifts : this.form1.personnelShifts,
|
|
|
+ personnelTeam : this.form1.personnelTeam,
|
|
|
+ personnelSsoId : res.data.userId
|
|
|
}
|
|
|
- // this.$refs['table'].resetField();
|
|
|
- })
|
|
|
+ this.axios.post('/api/v1/rms/addPersonnel',rmsPersonnel)
|
|
|
+ .then((res)=>{
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "新增成功!",
|
|
|
+ });
|
|
|
+ // this.$refs.table.refreshData();
|
|
|
+ } else {
|
|
|
+ this.$message.error("新增失败,可能存在重复!");
|
|
|
+ }
|
|
|
+ // this.$refs['table'].resetField();
|
|
|
+ })
|
|
|
|
|
|
- //最后新增角色赋权表
|
|
|
- this.axios.post('pass/v1/sysuserroles/addUserroles?userId='
|
|
|
- +res.data.userId+'&userCode='+this.form1.personnelJobNumber+'&roleId='+this.value3)
|
|
|
- .then((res)=>{
|
|
|
- this.$router.go(-1);
|
|
|
- })
|
|
|
- });
|
|
|
+ //最后新增角色赋权表
|
|
|
|
|
|
- //最后新增角色赋权表
|
|
|
-
|
|
|
-
|
|
|
+ this.axios.post('pass/v1/sysuserroles/addUserroles?userId='
|
|
|
+ +res.data.userId+'&userCode='+this.form1.personnelJobNumber+'&roleId='+this.value3)
|
|
|
+ .then((res)=>{
|
|
|
+ this.$router.go(-1);
|
|
|
+ })
|
|
|
|
|
|
- // let RmsPersonnel={
|
|
|
- // personnelId:this.form1.personnelId,
|
|
|
- // personnelJobNumber: this.form1.personnelJobNumber,
|
|
|
- // personnelName: this.form1.personnelName,
|
|
|
- // personnelPost: this.form1.personnelPost,
|
|
|
- // personnelWorkshopid: this.form1.personnelWorkshopid,
|
|
|
- // personnelShifts: this.form1.personnelShifts,
|
|
|
- // personnelTeam:this.form1.personnelTeam,
|
|
|
- // departmentId: this.form1.shipperId
|
|
|
- // };
|
|
|
- // if(
|
|
|
- // RmsPersonnel.personnelJobNumber ==null ||
|
|
|
- // RmsPersonnel.personnelName ==null ||
|
|
|
- // RmsPersonnel.personnelPost ==null ||
|
|
|
- // RmsPersonnel.personnelWorkshopid==null ||
|
|
|
- // RmsPersonnel.personnelShifts==null ||
|
|
|
- // RmsPersonnel.departmentId==null ||
|
|
|
- // RmsPersonnel.personnelTeam==null
|
|
|
- // )this.$message.error("存在空值!");
|
|
|
- // else
|
|
|
- // this.axios
|
|
|
- // .post(
|
|
|
- // "/api/v1/rms/insertPersonnel",
|
|
|
- // RmsPersonnel
|
|
|
- // )
|
|
|
- // .then((res) => {
|
|
|
- // if (res.data.code == 200) {
|
|
|
- // this.$message({
|
|
|
- // type: "success",
|
|
|
- // message: "新增成功!",
|
|
|
- // });
|
|
|
- // // this.$refs.table.refreshData();
|
|
|
- // this.$router.go(-1);
|
|
|
- // } else {
|
|
|
- // this.$message.error("新增失败,可能存在重复!");
|
|
|
- // }
|
|
|
- // this.$refs['table'].resetField();
|
|
|
- // });
|
|
|
+ });//end
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
// 取消
|
|
|
cancel() {
|