From d4adf9d661d885c3dc92566b2c0e4073708d172e Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Thu, 17 Sep 2020 15:28:15 +0800
Subject: [PATCH 1/2] oullxinneirogn
---
client/src/views/certapp/qmsform.vue | 2 +-
client/src/views/certapp/review.vue | 83 ++++++++++++-------
.../migrations/0033_merge_20200916_1011.py | 14 ++++
.../0034_evaluationdetail_result.py | 18 ++++
server/apps/project/models.py | 8 +-
server/apps/project/views.py | 2 +-
6 files changed, 87 insertions(+), 40 deletions(-)
create mode 100644 server/apps/project/migrations/0033_merge_20200916_1011.py
create mode 100644 server/apps/project/migrations/0034_evaluationdetail_result.py
diff --git a/client/src/views/certapp/qmsform.vue b/client/src/views/certapp/qmsform.vue
index 96166fb..d3990a6 100644
--- a/client/src/views/certapp/qmsform.vue
+++ b/client/src/views/certapp/qmsform.vue
@@ -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'],
diff --git a/client/src/views/certapp/review.vue b/client/src/views/certapp/review.vue
index 7ed8027..8b97e42 100644
--- a/client/src/views/certapp/review.vue
+++ b/client/src/views/certapp/review.vue
@@ -4,32 +4,36 @@
-
-
-
- {{ scope.row.item.content }}
- {{ scope.row.content }}
-
-
+
+
+
+ {{ scope.row.item_v }}
+ {{ scope.row.content }}
+
+
-
-
-
-
- {{item}}
-
-
+
+
+
+
+ {{item}}
+
+
-
-
-
+
+
+
@@ -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{
this.$message.success('成功')
diff --git a/server/apps/project/migrations/0033_merge_20200916_1011.py b/server/apps/project/migrations/0033_merge_20200916_1011.py
new file mode 100644
index 0000000..a578fd8
--- /dev/null
+++ b/server/apps/project/migrations/0033_merge_20200916_1011.py
@@ -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 = [
+ ]
diff --git a/server/apps/project/migrations/0034_evaluationdetail_result.py b/server/apps/project/migrations/0034_evaluationdetail_result.py
new file mode 100644
index 0000000..52a27e3
--- /dev/null
+++ b/server/apps/project/migrations/0034_evaluationdetail_result.py
@@ -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='符合结果'),
+ ),
+ ]
diff --git a/server/apps/project/models.py b/server/apps/project/models.py
index e4686bd..9a31ffa 100644
--- a/server/apps/project/models.py
+++ b/server/apps/project/models.py
@@ -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:
diff --git a/server/apps/project/views.py b/server/apps/project/views.py
index f018ae9..7ff31f6 100644
--- a/server/apps/project/views.py
+++ b/server/apps/project/views.py
@@ -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)
From 0154341724f52e350fcd31370fd479c3f27bce1b Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Mon, 21 Sep 2020 15:15:07 +0800
Subject: [PATCH 2/2] shiyanshi
---
client/src/views/certapp/certapphandle.vue | 68 ++---
client/src/views/certapp/detectiontask.vue | 320 +++++++++++++++++++++
client/src/views/certapp/review.vue | 71 +++--
server/apps/project/views.py | 10 +
4 files changed, 409 insertions(+), 60 deletions(-)
create mode 100644 client/src/views/certapp/detectiontask.vue
diff --git a/client/src/views/certapp/certapphandle.vue b/client/src/views/certapp/certapphandle.vue
index ba9e411..384786e 100644
--- a/client/src/views/certapp/certapphandle.vue
+++ b/client/src/views/certapp/certapphandle.vue
@@ -14,37 +14,40 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -76,9 +79,10 @@ import QMSform from "@/views/certapp/qmsform"
import Conclusion from "@/views/audit/conclusion"
import Member from "@/views/audit/member"
import access from "@/views/accessment/access"
-import REVIEW from "@/views/certapp/review"
+ import REVIEW from "@/views/certapp/review"
+ import Detectiontask from "@/views/certapp/detectiontask"
export default {
- components: { CCCform, Productunit, QMSform, Conclusion, Member, access, CHARGE, REVIEW},
+ components: { CCCform,Detectiontask, Productunit, QMSform, Conclusion, Member, access, CHARGE, REVIEW},
props: [],
data() {
return {
diff --git a/client/src/views/certapp/detectiontask.vue b/client/src/views/certapp/detectiontask.vue
new file mode 100644
index 0000000..12f2a3b
--- /dev/null
+++ b/client/src/views/certapp/detectiontask.vue
@@ -0,0 +1,320 @@
+
+
+
+
+
+ {{ scope.row.name }}
+
+
+ {{ scope.row.description }}
+
+
+ {{ scope.row.standard_.fullname }}
+
+
+
+ {{ scope.row.create_time }}
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 创建新记录
+ 保存
+ 重置
+
+
+
+
+
+
diff --git a/client/src/views/certapp/review.vue b/client/src/views/certapp/review.vue
index 8b97e42..50a1951 100644
--- a/client/src/views/certapp/review.vue
+++ b/client/src/views/certapp/review.vue
@@ -85,7 +85,9 @@ export default {
},
created() {
- this.gitEvadellist()
+
+
+ this.gitEvadellist()
},
mounted() {},
methods: {
@@ -101,42 +103,55 @@ export default {
//修改的时候加载
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 {
+ this.$message.success('创建成功')
+ })
+
}
- reviewCertapp({certapps:[this.certapp], rlist:rlist}).then(res=>{
- this.$message.success('成功')
- })
- // let val = this.selectlistRow
- // console.log(this.selectlistRow);
+ else {
+ let rlist = []
+ for (var i = 0; i < this.eltList.length; i++) {
+ 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('修改成功')
+ })
+
+ }
+
},
diff --git a/server/apps/project/views.py b/server/apps/project/views.py
index 7ff31f6..b3df563 100644
--- a/server/apps/project/views.py
+++ b/server/apps/project/views.py
@@ -123,6 +123,16 @@ class EvaluationDetailViewset(CreateUpdateCustomMixin, PageOrNot,ModelViewSet):
serializer_class = EvaluationDetailSerializer
filterset_fields = ['cert_app']
ordering = ['-create_time']
+ def reviewupdate(self, request, pk=None):
+ """
+ 完成评审
+ """
+
+ rlist = request.data['rlist']
+ for i in rlist:
+ instance = EvaluationDetail.objects.update(item=Evaluations.objects.get(id=i['id']),item_v=i['content'], update_by=request.user, result=i['result'] )
+
+ return Response(status=status.HTTP_200_OK)