oullxinneirogn
This commit is contained in:
parent
464b46b1ff
commit
d4adf9d661
|
@ -298,7 +298,7 @@ export default {
|
|||
name: "QMSform",
|
||||
inheritAttrs: false,
|
||||
components: { Enterprisechose, Treeselect },
|
||||
props: ["action", "certapp"],
|
||||
props: ["certapp"],
|
||||
data() {
|
||||
return {
|
||||
activeNames: ['1', '2', '3', '4','5'],
|
||||
|
|
|
@ -4,32 +4,36 @@
|
|||
<el-row :gutter="12">
|
||||
|
||||
<el-col>
|
||||
<el-table id="evl"
|
||||
ref="multipleTable"
|
||||
:data="eltList"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
max-height="600">
|
||||
<el-table-column align="center" label="项目内容" width="750">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.item">{{ scope.row.item.content }}</span>
|
||||
<span v-else>{{ scope.row.content }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table id="evl"
|
||||
ref="multipleTable"
|
||||
:data="eltList"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
max-height="600">
|
||||
<el-table-column align="center" label="项目内容" width="750">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.item">{{ scope.row.item_v }}</span>
|
||||
<span v-else>{{ scope.row.content }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="符合">
|
||||
<template slot-scope="scope">
|
||||
<!-- @change="changeHandler(scope.$index,radio[scope.$index])" -->
|
||||
<el-radio-group v-model="radio[scope.$index]" @change="changeHandler(scope.$index,radio[scope.$index])">
|
||||
<el-radio :label="item" :key="item" v-for="item in review_options ">{{item}}</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<el-table-column label="符合">
|
||||
<template slot-scope="scope">
|
||||
<!-- @change="changeHandler(scope.$index,radio[scope.$index])" -->
|
||||
<el-radio-group v-model="radio[scope.$index]" @change="changeHandler(scope.$index,radio[scope.$index])">
|
||||
<el-radio :label="item" :key="item" v-for="item in review_options ">{{item}}</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="需说明备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"></el-input>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
@ -81,22 +85,37 @@ export default {
|
|||
|
||||
},
|
||||
created() {
|
||||
|
||||
this.getList()
|
||||
this.gitEvadellist()
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
//创建的时候的加载
|
||||
getList() {
|
||||
|
||||
getEvaluationsList().then(response => {
|
||||
|
||||
this.eltList = response.data.results
|
||||
for (var i = 0; i < this.eltList.length; i++) {
|
||||
// this.eltList[i].options = this.review_options;
|
||||
// this.eltList[i].result = '符合'
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
//修改的时候加载
|
||||
gitEvadellist() {
|
||||
getEvaluationDetailList({cert_app:this.certapp}).then(response => {
|
||||
|
||||
this.eltList = response.data.results;
|
||||
|
||||
let myarrq = response.data.results;
|
||||
let arrq=[];
|
||||
for(var i=0;i<myarrq.length;i++){
|
||||
arrq.push(parseInt(myarrq[i].result))
|
||||
|
||||
}
|
||||
this.radio = arrq;
|
||||
|
||||
console.log(this.radio)
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
// 获取表格选中时的数据
|
||||
selectRow (val) {
|
||||
|
@ -111,7 +130,7 @@ export default {
|
|||
console.log(this.eltList)
|
||||
let rlist = []
|
||||
for (var i = 0; i < this.eltList.length; i++) {
|
||||
rlist.push({id:this.eltList[i].id,result:this.eltList[i].result})
|
||||
rlist.push({id:this.eltList[i].id,content:this.eltList[i].content,result:this.eltList[i].result})
|
||||
}
|
||||
reviewCertapp({certapps:[this.certapp], rlist:rlist}).then(res=>{
|
||||
this.$message.success('成功')
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 3.0.5 on 2020-09-16 02:11
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0032_merge_20200903_1142'),
|
||||
('project', '0029_auto_20200904_1553'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.0.5 on 2020-09-16 02:12
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('project', '0033_merge_20200916_1011'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='evaluationdetail',
|
||||
name='result',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='符合结果'),
|
||||
),
|
||||
]
|
|
@ -183,15 +183,11 @@ class SubApplication(CommonBModel):
|
|||
return self.number
|
||||
|
||||
class EvaluationDetail(CommonBModel):
|
||||
result_choices = (
|
||||
('符合', '符合'),
|
||||
('不符合', '不符合'),
|
||||
('不适用', '不适用'),
|
||||
('需说明', '需说明'),
|
||||
)
|
||||
|
||||
cert_app = models.ManyToManyField(CertApp, verbose_name='关联受理', related_name='evaluationdetail_cert_app')
|
||||
item = models.ForeignKey(Evaluations,on_delete=models.DO_NOTHING,verbose_name='评审项',null=True, blank=True, related_name='evaluationdetail_item')
|
||||
item_v = JSONField(verbose_name='评审项目',null=True, blank=True)
|
||||
result = models.TextField('符合结果',null=True, blank=True)
|
||||
remark = models.TextField('备注', null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
|
|
|
@ -109,7 +109,7 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet):
|
|||
certapps = request.data['certapps']
|
||||
rlist = request.data['rlist']
|
||||
for i in rlist:
|
||||
instance = EvaluationDetail.objects.create(item=Evaluations.objects.get(id=i['id']), create_by=request.user, result=i['result'] if 'result' in i and i['result'] else None)
|
||||
instance = EvaluationDetail.objects.create(item=Evaluations.objects.get(id=i['id']),item_v=i['content'], create_by=request.user, result=i['result'] if 'result' in i and i['result'] else None)
|
||||
instance.cert_app.add(*certapps)
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
|
|
Loading…
Reference in New Issue