fix :user/view 修改批量创建用户
This commit is contained in:
parent
cd0837970c
commit
5b785dfd79
|
@ -115,7 +115,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<el-button type="danger" @click="close_dialog">取消</el-button>
|
<el-button type="danger" @click="close_dialog">取消</el-button>
|
||||||
<el-button type="primary" @click="submitUpload" :disabled="saveLoading">确认</el-button>
|
<el-button type="primary" @click="submitUpload">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -516,9 +516,11 @@ export default {
|
||||||
updateUser(this.user.id, this.user).then((res) => {
|
updateUser(this.user.id, this.user).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = true;
|
||||||
|
this.impForm.file = ''
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
};
|
||||||
|
this.impForm.file = ''
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createUser(this.user).then((res) => {
|
createUser(this.user).then((res) => {
|
||||||
|
|
|
@ -109,7 +109,7 @@ class ImpMixin:
|
||||||
data_list = self.build_data(sheet, start)
|
data_list = self.build_data(sheet, start)
|
||||||
serializer = mySerializer(data=data_list, many=True, context={'request': request})
|
serializer = mySerializer(data=data_list, many=True, context={'request': request})
|
||||||
if serializer.is_valid():
|
if serializer.is_valid():
|
||||||
serializer.save(create_by=request.user, belong_dept=request.user.dept)
|
serializer.save()
|
||||||
else:
|
else:
|
||||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
@ -349,8 +349,7 @@ class UserExamViewset(ImpMixin, ModelViewSet):
|
||||||
if row[0] is not None:
|
if row[0] is not None:
|
||||||
dept = Organization.objects.get(name=row[2])
|
dept = Organization.objects.get(name=row[2])
|
||||||
user_depts = get_child_queryset2(self.request.user.dept).order_by('sort')
|
user_depts = get_child_queryset2(self.request.user.dept).order_by('sort')
|
||||||
serializer = OrganizationSerializer(user_depts, many=True)
|
depts = any(i.name==dept.name for i in user_depts)
|
||||||
depts = any(i.id==dept.id for i in serializer.data)
|
|
||||||
if depts is False:
|
if depts is False:
|
||||||
return Response({'msg': f'本公司下不存在此部门{row[2]}'})
|
return Response({'msg': f'本公司下不存在此部门{row[2]}'})
|
||||||
serializer_data = {
|
serializer_data = {
|
||||||
|
|
Loading…
Reference in New Issue