检测资质修改导入
This commit is contained in:
parent
588f88f180
commit
0bb202749b
|
@ -36,7 +36,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-top:10px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['qualification_create'])">新增</el-button>
|
||||
<el-button type="primary" style="display:none" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['qualification_create'])">新增</el-button>
|
||||
|
||||
<el-popover
|
||||
placement="top"
|
||||
|
@ -79,8 +79,8 @@
|
|||
ref="filterTable"
|
||||
@filter-change="filterChange"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="所属单位"
|
||||
<el-table-column fixed type="index" width="50" />
|
||||
<el-table-column fixed label="所属单位" width="150"
|
||||
prop="sszx"
|
||||
column-key="sszx"
|
||||
:filters="groupBy.sszx"
|
||||
|
@ -88,29 +88,37 @@
|
|||
>
|
||||
<template slot-scope="scope">{{ scope.row.sszx }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="CMA资质">
|
||||
<el-table-column width="150" fixed label="CMA资质">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="showlight(scope.row.cma)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="CNAS资质">
|
||||
<el-table-column width="150" fixed label="CNAS资质">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="showlight(scope.row.cnas)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其它资质">
|
||||
<el-table-column width="1050" label="检验检测相关其他资质及校准资质">
|
||||
<el-table-column label="其它资质" width="360">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="showlight(scope.row.other)" ></span>
|
||||
<p style="border-bottom: 1px dashed blue" v-for="item in scope.row.otherqualification" v-html="showlight(item.name)" ></p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主要服务">
|
||||
<el-table-column label="资质范围" width="690">
|
||||
<template slot-scope="scope">
|
||||
<p v-for="item in scope.row.otherqualification" style="border-bottom: 1px dashed blue " v-html="showlight(item.description)" ></p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" width="200" label="主要服务">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="showlight(scope.row.service)"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column width="150" fixed="right" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
style="display:none"
|
||||
:disabled="!checkPermission(['qualification_update'])"
|
||||
type="primary"
|
||||
size="small"
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.0.5 on 2020-10-20 01:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ability', '0011_qualificationother'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qualificationother',
|
||||
name='qualification',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='other_qualification', to='ability.Qualification'),
|
||||
),
|
||||
]
|
|
@ -224,12 +224,14 @@ def import_qualification(path):
|
|||
sheet = wb.worksheets[0]
|
||||
i = 3
|
||||
max_row = sheet.max_row
|
||||
obj = {}
|
||||
Qualificationother.objects.all().delete()
|
||||
while i<max_row+1:
|
||||
sszx = sheet['b'+str(i)].value
|
||||
cma = sheet['c'+str(i)].value
|
||||
cnas = sheet['d'+str(i)].value
|
||||
service = sheet['g'+str(i)].value
|
||||
name = sheet['g'+str(i)].value
|
||||
name = sheet['e'+str(i)].value
|
||||
description = sheet['f'+str(i)].value
|
||||
if sszx:
|
||||
if Qualification.objects.filter(sszx=sszx).exists():
|
||||
|
@ -240,9 +242,10 @@ def import_qualification(path):
|
|||
qualification.cnas = cnas
|
||||
qualification.service = service
|
||||
qualification.save()
|
||||
obj = qualification
|
||||
Qualificationother.objects.create(qualification=qualification, name=name, description=description)
|
||||
else:
|
||||
Qualificationother.objects.create(qualification=qualification, name=name, description=description)
|
||||
Qualificationother.objects.create(qualification=obj, name=name, description=description)
|
||||
i = i + 1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue