fix:修改资质情况表
This commit is contained in:
parent
e16ac399ba
commit
fd070e1be0
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@ export function getQi(id) {
|
||||||
|
|
||||||
export function updateQi(id, data) {
|
export function updateQi(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/info/faqch/${id}/`,
|
url: `/info/faq/${id}/`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|
|
@ -412,14 +412,14 @@ export const asyncRoutes = [
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/infoCollect/',
|
redirect: '/infoCollect/',
|
||||||
name: 'informationCollect',
|
name: 'informationCollect',
|
||||||
meta: { title: '信息收集', icon: 'PT', perms: ['infoCollect'] },
|
meta: { title: '信息收集', icon: 'PT'},
|
||||||
alwaysShow: true,
|
alwaysShow: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'qualificInfo',
|
path: 'qualificInfo',
|
||||||
name: 'qualificInfo',
|
name: 'qualificInfo',
|
||||||
component: () => import('@/views/informatiomCollect/qualificInfo.vue'),
|
component: () => import('@/views/informatiomCollect/qualificInfo.vue'),
|
||||||
meta: { title: '资质情况', perms: ['infoCollect_QIN'] }
|
meta: { title: '资质情况'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'qualiChange',
|
path: 'qualiChange',
|
||||||
|
|
|
@ -105,6 +105,9 @@
|
||||||
<el-form-item label="资质范围" prop="scope">
|
<el-form-item label="资质范围" prop="scope">
|
||||||
<el-input v-model="Content.scope" ></el-input>
|
<el-input v-model="Content.scope" ></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="变更原因" prop="change_reason">
|
||||||
|
<el-input v-model="Content.change_reason" ></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="参数数量" prop="number" >
|
<el-form-item label="参数数量" prop="number" >
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="Content.number"
|
v-model="Content.number"
|
||||||
|
@ -158,7 +161,8 @@ const defaultContent = {
|
||||||
scope: "",
|
scope: "",
|
||||||
number: "",
|
number: "",
|
||||||
cie_path: "",
|
cie_path: "",
|
||||||
change_date:""
|
change_date:"",
|
||||||
|
change_reason:""
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -175,7 +179,8 @@ export default {
|
||||||
scope: "",
|
scope: "",
|
||||||
number: "",
|
number: "",
|
||||||
cie_path: "",
|
cie_path: "",
|
||||||
change_date:""
|
change_date:"",
|
||||||
|
change_reason:""
|
||||||
},
|
},
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
|
@ -227,7 +232,6 @@ export default {
|
||||||
let height1 = document.getElementsByClassName('app-main')[0].clientHeight;
|
let height1 = document.getElementsByClassName('app-main')[0].clientHeight;
|
||||||
let height2 = document.getElementsByClassName('elHeader')[0].clientHeight;
|
let height2 = document.getElementsByClassName('elHeader')[0].clientHeight;
|
||||||
that.tableHeight = height1 - height2 - 70;
|
that.tableHeight = height1 - height2 - 70;
|
||||||
console.log(that.tableHeight)
|
|
||||||
that.getList();
|
that.getList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -256,13 +260,11 @@ export default {
|
||||||
// if (!this.exportForm.startDate || !this.exportForm.endDate) {
|
// if (!this.exportForm.startDate || !this.exportForm.endDate) {
|
||||||
// this.$message.error('请选择完整的起止日期!');
|
// this.$message.error('请选择完整的起止日期!');
|
||||||
// return;}
|
// return;}
|
||||||
console.log(this.exportForm)
|
|
||||||
getMyQi().then((response) => {
|
getMyQi().then((response) => {
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
let filename = '资质变更情况统计表.xlsx';
|
let filename = '资质变更情况统计表.xlsx';
|
||||||
let tableData = response.data;
|
let tableData = response.data;
|
||||||
console.log(tableData)
|
|
||||||
const ws = XLSX.utils.json_to_sheet(tableData.results);
|
const ws = XLSX.utils.json_to_sheet(tableData.results);
|
||||||
const wb = XLSX.utils.book_new();
|
const wb = XLSX.utils.book_new();
|
||||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
||||||
|
@ -297,7 +299,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleUpSuccess(res, file, filelist) {
|
handleUpSuccess(res, file, filelist) {
|
||||||
console.log(res.data.path)
|
|
||||||
this.Content.cie_path = res.data.path;
|
this.Content.cie_path = res.data.path;
|
||||||
this.Content.file = res.data.id;
|
this.Content.file = res.data.id;
|
||||||
|
|
||||||
|
@ -312,7 +313,6 @@ export default {
|
||||||
this.tableData.results =[];
|
this.tableData.results =[];
|
||||||
this.tableData.count =0;
|
this.tableData.count =0;
|
||||||
getMyQi(this.listQuery).then((response) => {
|
getMyQi(this.listQuery).then((response) => {
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.tableData = response.data;
|
this.tableData = response.data;
|
||||||
|
|
||||||
|
@ -362,25 +362,6 @@ export default {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// handleChange(scope) {
|
|
||||||
// this.listLoading = true;
|
|
||||||
// this.Content = Object.assign({}, scope.row); // copy obj
|
|
||||||
// this.changeTableData =[];
|
|
||||||
// this.dialogTableVisible=true;
|
|
||||||
// getQi(scope.row.id).then((response) => {
|
|
||||||
// if (response.data.count>0) {
|
|
||||||
// this.changeTableData = response.data.results;
|
|
||||||
// console.log(this.changeTableData);
|
|
||||||
// this.listLoading = false;
|
|
||||||
// }else{
|
|
||||||
// alert('无变更记录')
|
|
||||||
// this.dialogTableVisible=false;
|
|
||||||
// this.listLoading = false;
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
|
|
||||||
async confirm(form) {
|
async confirm(form) {
|
||||||
this.$refs[form].validate((valid) => {
|
this.$refs[form].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="elHeader">
|
<el-card class="elHeader">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAddFile">新增</el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddFile">新增</el-button>
|
||||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
<el-button type="primary" @click="handleExport">导出</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 10px">
|
<el-card style="margin-top: 10px">
|
||||||
|
@ -227,7 +227,6 @@ export default {
|
||||||
let height1 = document.getElementsByClassName('app-main')[0].clientHeight;
|
let height1 = document.getElementsByClassName('app-main')[0].clientHeight;
|
||||||
let height2 = document.getElementsByClassName('elHeader')[0].clientHeight;
|
let height2 = document.getElementsByClassName('elHeader')[0].clientHeight;
|
||||||
that.tableHeight = height1 - height2 - 70;
|
that.tableHeight = height1 - height2 - 70;
|
||||||
console.log(that.tableHeight)
|
|
||||||
that.getList();
|
that.getList();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -256,13 +255,10 @@ export default {
|
||||||
// if (!this.exportForm.startDate || !this.exportForm.endDate) {
|
// if (!this.exportForm.startDate || !this.exportForm.endDate) {
|
||||||
// this.$message.error('请选择完整的起止日期!');
|
// this.$message.error('请选择完整的起止日期!');
|
||||||
// return;}
|
// return;}
|
||||||
console.log(this.exportForm)
|
|
||||||
getAllQi().then((response) => {
|
getAllQi().then((response) => {
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
let filename = '资质情况统计表.xlsx';
|
let filename = '资质情况统计表.xlsx';
|
||||||
let tableData = response.data;
|
let tableData = response.data;
|
||||||
console.log(tableData)
|
|
||||||
const ws = XLSX.utils.json_to_sheet(tableData.results);
|
const ws = XLSX.utils.json_to_sheet(tableData.results);
|
||||||
const wb = XLSX.utils.book_new();
|
const wb = XLSX.utils.book_new();
|
||||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
||||||
|
@ -272,7 +268,7 @@ export default {
|
||||||
} catch (e) { if(typeof console !== 'undefined') console.log(e, wbout); }
|
} catch (e) { if(typeof console !== 'undefined') console.log(e, wbout); }
|
||||||
return;
|
return;
|
||||||
}else {
|
}else {
|
||||||
this.$message.error(data.message || '导出失败');
|
this.$message.error(data.message || '导出失败');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// this.showExportDialog = false;
|
// this.showExportDialog = false;
|
||||||
|
@ -297,7 +293,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleUpSuccess(res, file, filelist) {
|
handleUpSuccess(res, file, filelist) {
|
||||||
console.log(res.data.path)
|
|
||||||
this.Content.cie_path = res.data.path;
|
this.Content.cie_path = res.data.path;
|
||||||
this.Content.file = res.data.id;
|
this.Content.file = res.data.id;
|
||||||
|
|
||||||
|
@ -312,7 +307,6 @@ export default {
|
||||||
this.tableData.results =[];
|
this.tableData.results =[];
|
||||||
this.tableData.count =0;
|
this.tableData.count =0;
|
||||||
getAllQi(this.listQuery).then((response) => {
|
getAllQi(this.listQuery).then((response) => {
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.tableData = response.data;
|
this.tableData = response.data;
|
||||||
|
|
||||||
|
@ -370,7 +364,6 @@ export default {
|
||||||
getQi(scope.row.id).then((response) => {
|
getQi(scope.row.id).then((response) => {
|
||||||
if (response.data.count>0) {
|
if (response.data.count>0) {
|
||||||
this.changeTableData = response.data.results;
|
this.changeTableData = response.data.results;
|
||||||
console.log(this.changeTableData);
|
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
}else{
|
}else{
|
||||||
alert('无变更记录')
|
alert('无变更记录')
|
||||||
|
@ -386,7 +379,6 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogType === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
console.log(this.Content, "edited");
|
|
||||||
updateQi(this.Content.id, this.Content).then((response) => {
|
updateQi(this.Content.id, this.Content).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.tableData = response.data;
|
this.tableData = response.data;
|
||||||
|
@ -398,8 +390,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
createQi(this.Content).then((response) => {
|
createQi(this.Content).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
console.log(response.data, "created");
|
this.tableData = response.data;
|
||||||
this.tableData = response.data;
|
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
|
|
@ -73,13 +73,19 @@
|
||||||
<span v-if="scope.row.task2_">{{ cycleList[scope.row.task2_.cycle] }}</span>
|
<span v-if="scope.row.task2_">{{ cycleList[scope.row.task2_.cycle] }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center">
|
<el-table-column label="任务状态" align="center">
|
||||||
<template slot-scope="scope" v-if="scope.row.task2_">
|
<template slot-scope="scope" v-if="scope.row.task2_">
|
||||||
<el-tag v-if="scope.row.task2_.state=='10'" type="warning">创建中</el-tag>
|
<el-tag v-if="scope.row.task2_.state=='10'" type="warning">创建中</el-tag>
|
||||||
<el-tag v-else-if="scope.row.task2_.state=='20'" type="primary">进行中</el-tag>
|
<el-tag v-else-if="scope.row.task2_.state=='20'" type="primary">进行中</el-tag>
|
||||||
<el-tag v-else type="success">已关闭</el-tag>
|
<el-tag v-else type="success">已关闭</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="执行状态" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.count_up>=scope.row.count_all" type="success"">已完成</el-tag>
|
||||||
|
<el-tag v-else type="danger">未完成</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="应提交" prop="count_all" align="center"></el-table-column>
|
<el-table-column label="应提交" prop="count_all" align="center"></el-table-column>
|
||||||
<el-table-column label="已提交" prop="count_up" align="center"></el-table-column>
|
<el-table-column label="已提交" prop="count_up" align="center"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
|
@ -86,13 +86,18 @@ class ExamListSerializer(ModelSerializer):
|
||||||
create_by_name = CharField(source='create_by.name', read_only=True)
|
create_by_name = CharField(source='create_by.name', read_only=True)
|
||||||
paper_ = PaperSerializer(source='paper', read_only=True)
|
paper_ = PaperSerializer(source='paper', read_only=True)
|
||||||
course_ = CourseSerializer(source='course_name', read_only=True)
|
course_ = CourseSerializer(source='course_name', read_only=True)
|
||||||
participant_user = UserListSerializer(many=True, read_only=True)
|
user_count = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Exam
|
model = Exam
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
def get_user_count(self, obj):
|
||||||
|
total_user_count = 0
|
||||||
|
for p in obj.participant_dep.all():
|
||||||
|
user_count = User.objects.filter(dept_id = p.id).count()
|
||||||
|
total_user_count += user_count
|
||||||
|
return total_user_count+obj.participant_user.count()
|
||||||
|
|
||||||
|
|
||||||
class ExamDetailSerializer(ModelSerializer):
|
class ExamDetailSerializer(ModelSerializer):
|
||||||
create_by_name = CharField(source='create_by.name', read_only=True)
|
create_by_name = CharField(source='create_by.name', read_only=True)
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.2.12 on 2024-05-16 07:30
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('information', '0038_parsepdf_status'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='auditlog',
|
||||||
|
name='change_reason',
|
||||||
|
field=models.CharField(blank=True, max_length=50, null=True, verbose_name='变更原因'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -26,7 +26,7 @@ class AuditLog(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||||
action = models.CharField('动作', max_length=20)
|
action = models.CharField('动作', max_length=20)
|
||||||
instance = models.ForeignKey(Qualification, on_delete=models.CASCADE, verbose_name='实例ID')
|
instance = models.ForeignKey(Qualification, on_delete=models.CASCADE, verbose_name='实例ID')
|
||||||
change_reason = models.CharField('变更原因', default='', max_length=50)
|
change_reason = models.CharField('变更原因', null=True ,blank=True ,max_length=50)
|
||||||
change_user = models.ForeignKey('system.user', on_delete=models.SET_NULL, verbose_name='操作人', null=True, blank=True)
|
change_user = models.ForeignKey('system.user', on_delete=models.SET_NULL, verbose_name='操作人', null=True, blank=True)
|
||||||
change_time = models.DateField('变更时间')
|
change_time = models.DateField('变更时间')
|
||||||
val_new = models.JSONField('变更后完整数据', default=dict)
|
val_new = models.JSONField('变更后完整数据', default=dict)
|
||||||
|
|
|
@ -484,11 +484,11 @@ class QualiChangeViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet):
|
||||||
|
|
||||||
|
|
||||||
# 重写更新的方法
|
# 重写更新的方法
|
||||||
def partial_update(self, request, pk=None):
|
def update(self, request, pk=None):
|
||||||
#获取需要更新的实列
|
#获取需要更新的实列
|
||||||
instance = self.get_object()
|
instance = self.get_object()
|
||||||
# 数据比较
|
# 数据比较
|
||||||
ignore_fields = ['create_by', 'create_time', 'update_date', 'id']
|
ignore_fields = ['create_by', 'create_time', 'update_date', 'id', 'change_reason']
|
||||||
origin_dict = QualificationSerializer(instance=instance).data
|
origin_dict = QualificationSerializer(instance=instance).data
|
||||||
diff = []
|
diff = []
|
||||||
for k, v in request.data.items():
|
for k, v in request.data.items():
|
||||||
|
@ -504,6 +504,7 @@ class QualiChangeViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet):
|
||||||
action='update',
|
action='update',
|
||||||
instance=instance,
|
instance=instance,
|
||||||
change_time = datetime.now(),
|
change_time = datetime.now(),
|
||||||
|
change_reason = request.data.get('change_reason'),
|
||||||
change_user=request.user,
|
change_user=request.user,
|
||||||
val_new=serializers.data,
|
val_new=serializers.data,
|
||||||
difference=diff
|
difference=diff
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
from .settings import *
|
from .settings import *
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
#'default': {
|
'default': {
|
||||||
# 'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
# 'NAME': 'cma',
|
'NAME': 'cma',
|
||||||
# 'USER': 'postgres',
|
'USER': 'postgres',
|
||||||
#'PASSWORD': 'zcDsj2021',
|
'PASSWORD': 'zcDsj2021',
|
||||||
#'HOST': '49.232.14.174',
|
'HOST': '49.232.14.174',
|
||||||
#'PORT': '5432',
|
'PORT': '5432',
|
||||||
#},
|
},
|
||||||
# 'default': {
|
# 'default': {
|
||||||
# 'ENGINE': 'django.db.backends.postgresql',
|
# 'ENGINE': 'django.db.backends.postgresql',
|
||||||
# 'NAME': 'cma',
|
# 'NAME': 'cma',
|
||||||
|
@ -27,15 +27,15 @@ DATABASES = {
|
||||||
# 'HOST': '127.0.0.1',
|
# 'HOST': '127.0.0.1',
|
||||||
# 'PORT': '5432',
|
# 'PORT': '5432',
|
||||||
# }
|
# }
|
||||||
'default': {
|
# 'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
# 'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': 'cma',
|
# 'NAME': 'cma',
|
||||||
'USER': 'cma',
|
# 'USER': 'cma',
|
||||||
'PASSWORD': 'cma123',
|
# 'PASSWORD': 'cma123',
|
||||||
'HOST': '127.0.0.1',
|
# 'HOST': '127.0.0.1',
|
||||||
# 'HOST': '1.203.161.102',
|
# # 'HOST': '1.203.161.102',
|
||||||
'PORT': '5432',
|
# 'PORT': '5432',
|
||||||
}
|
# }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue