This commit is contained in:
caoqianming 2020-06-15 09:28:40 +08:00
parent c60ee7cd58
commit 5ebb90dc07
5 changed files with 30 additions and 10 deletions

View File

@ -75,7 +75,7 @@
fit
stripe
highlight-current-row
max-height="260"
max-height="300"
ref="filterTable"
@filter-change="filterChange"
>
@ -106,10 +106,7 @@
>
<template slot-scope="scope">{{ scope.row.sszx }}</template>
</el-table-column>
<el-table-column align="header-center" label="限制范围">
<template slot-scope="scope">{{ scope.row.xzfw}}</template>
</el-table-column>
<el-table-column align="center" label="操作">
<!-- <el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
:disabled="!checkPermission(['cma_update'])"
@ -126,7 +123,7 @@
@click="handleDelete(scope)"
/>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<pagination
@ -145,7 +142,7 @@
fit
stripe
highlight-current-row
max-height="260"
max-height="300"
>
<el-table-column type="index" width="50" />
@ -161,11 +158,14 @@
<el-table-column align="header-center" label="标准编号">
<template slot-scope="scope">{{ scope.row.bzbh }}</template>
</el-table-column>
<el-table-column align="header-center" label="标准条款">
<template slot-scope="scope">{{ scope.row.bztk }}</template>
</el-table-column>
<el-table-column align="header-center" label="所属中心"
>
<template slot-scope="scope">{{ scope.row.sszx }}</template>
</el-table-column>
<el-table-column align="center" label="操作">
<!-- <el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
:disabled="!checkPermission(['cnas_update'])"
@ -182,7 +182,7 @@
@click="handleDelete(scope)"
/>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<pagination

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2020-06-15 01:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ability', '0005_cnas'),
]
operations = [
migrations.AddField(
model_name='cnas',
name='bztk',
field=models.CharField(blank=True, max_length=400, null=True, verbose_name='标准条款'),
),
]

View File

@ -26,4 +26,5 @@ class CNAS(BaseModel):
xmmc = models.CharField('项目名称', max_length=200,null=True,blank=True)
bzmc = models.CharField('标准名称', max_length=400,null=True,blank=True)
bzbh = models.CharField('标准编号', max_length=400,null=True,blank=True)
bztk = models.CharField('标准条款', max_length=400,null=True,blank=True)
sszx = models.TextField('所属中心',null=True,blank=True)

View File

@ -68,7 +68,7 @@ class CNASViewSet(ModelViewSet):
'put': 'cnas_update', 'delete': 'cnas_delete'}
queryset = CNAS.objects.all()
serializer_class = CNASSerializer
search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc']
search_fields = ['bzbh', 'bzmc', 'sszx', 'xmmc', 'bztk']
ordering_fields = ['bzmc']
ordering = 'bzmc'
@ -131,6 +131,7 @@ def import_cnas(filename, path):
data['xmmc'] = sheet['g'+str(i)].value
data['bzmc'] = sheet['l'+str(i)].value
data['bzbh'] = sheet['n'+str(i)].value
data['bztk'] = sheet['q'+str(i)].value
data['sszx'] = sszx
print(data)
datalist.append(CNAS(**data))

Binary file not shown.