From 0a357b3765e29c0ca4eb516b5a4b291e8ed6e6a9 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 14 Jun 2021 22:10:11 +0800 Subject: [PATCH] =?UTF-8?q?pc=E7=AB=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_client/src/api/candidate.js | 9 ++ test_client/src/router/index.js | 10 +- test_client/src/views/exam/issue.vue | 126 +++++++++++++++++++++++++ test_mini/app.js | 4 +- test_mini/pages/admin/exam/detail.js | 29 +++++- test_mini/pages/admin/exam/detail.wxml | 49 +++++++++- test_mini/pages/main/main.wxml | 9 -- test_mini/pages/my/index.wxml | 15 ++- test_server/crm/models.py | 2 +- test_server/crm/serializers.py | 1 + 10 files changed, 231 insertions(+), 23 deletions(-) create mode 100644 test_client/src/api/candidate.js create mode 100644 test_client/src/views/exam/issue.vue diff --git a/test_client/src/api/candidate.js b/test_client/src/api/candidate.js new file mode 100644 index 0000000..4374232 --- /dev/null +++ b/test_client/src/api/candidate.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getCandidateList(query) { + return request({ + url: '/crm/candidate/', + method: 'get', + params:query + }) +} \ No newline at end of file diff --git a/test_client/src/router/index.js b/test_client/src/router/index.js index af2b724..214f289 100644 --- a/test_client/src/router/index.js +++ b/test_client/src/router/index.js @@ -252,13 +252,19 @@ export const asyncRoutes = [ component: Layout, redirect: '/exammanage/index', name: 'Exammanage', - meta: { title: '考试管理', icon: ''}, + meta: { title: '考证管理', icon: 'component'}, children: [ { path: 'index', name: 'exam', component: () => import('@/views/exam/index.vue'), - meta: { title: '考试管理', icon: 'component', perms: ['exam_view'] } + meta: { title: '正式考试', perms: ['exam_view'] } + }, + { + path: 'issue', + name: 'issue', + component: () => import('@/views/exam/issue.vue'), + meta: { title: '出证记录', perms: ['candidate_view'] } }, ] }, diff --git a/test_client/src/views/exam/issue.vue b/test_client/src/views/exam/issue.vue new file mode 100644 index 0000000..d1a8618 --- /dev/null +++ b/test_client/src/views/exam/issue.vue @@ -0,0 +1,126 @@ + + + diff --git a/test_mini/app.js b/test_mini/app.js index 307bbe3..877e559 100644 --- a/test_mini/app.js +++ b/test_mini/app.js @@ -70,9 +70,9 @@ App({ globalData: { userInfo: {}, userinfo: {}, // 服务器传回的消费者信息 - //host: 'https://apitest.ahctc.cn', + host: 'https://apitest.ahctc.cn', mediahost: 'https://apitest.ahctc.cn', - host: 'http://127.0.0.1:8000', + //host: 'http://127.0.0.1:8000', //mediahost: 'http://127.0.0.1:8000', token : '', rlogin:true diff --git a/test_mini/pages/admin/exam/detail.js b/test_mini/pages/admin/exam/detail.js index e4eb023..3fee37e 100644 --- a/test_mini/pages/admin/exam/detail.js +++ b/test_mini/pages/admin/exam/detail.js @@ -6,7 +6,10 @@ Page({ * 页面的初始数据 */ data: { - exam:{}, + exam:{ + qdimgs:[], + xcimgs:[] + }, tests:[] }, @@ -16,7 +19,7 @@ Page({ onLoad: function (options) { if(options.id){ let id = options.id - that.data.exam.id = id + this.data.exam.id = id api.requesta('/examtest/examtest/', 'GET', {exam:id, pageoff:true}).then(res=>{ this.setData({ tests:res.data @@ -27,11 +30,31 @@ Page({ getExam: function(){ let id = this.data.exam.id api.requesta(`/examtest/exam/${id}/`, 'GET').then(res=>{ + let exam = res.data + for(var i=0;i - - - + + + + + + + + + 签到表图片 + + + + + + + + + + + + + + + + + + + + 现场照片 + + + + + + + + + + + + + + + diff --git a/test_mini/pages/main/main.wxml b/test_mini/pages/main/main.wxml index b80716f..1b2c954 100644 --- a/test_mini/pages/main/main.wxml +++ b/test_mini/pages/main/main.wxml @@ -63,15 +63,6 @@ - - - - - 考核名额监控 - - - - diff --git a/test_mini/pages/my/index.wxml b/test_mini/pages/my/index.wxml index 7659c07..9837a27 100644 --- a/test_mini/pages/my/index.wxml +++ b/test_mini/pages/my/index.wxml @@ -71,6 +71,15 @@ 个人防护用品检测(铅当量) + + + + + 考核名额监控 + + + + 管理员操作台 @@ -79,10 +88,10 @@ - - + diff --git a/test_server/crm/models.py b/test_server/crm/models.py index b712860..66b5e26 100644 --- a/test_server/crm/models.py +++ b/test_server/crm/models.py @@ -105,7 +105,7 @@ class SendCode(CommonModel): code = models.CharField(max_length=4, verbose_name= '验证码') class Candidate(CommonModel): - consumer = models.ForeignKey(Consumer, on_delete=models.CASCADE, related_name='candidate_consumer') + consumer = models.ForeignKey(Consumer, on_delete=models.DO_NOTHING, related_name='candidate_consumer') workscope = models.ForeignKey(WorkScope, on_delete=models.DO_NOTHING, related_name='candidate_workscope') diff --git a/test_server/crm/serializers.py b/test_server/crm/serializers.py index e5be1dd..e9e8a88 100644 --- a/test_server/crm/serializers.py +++ b/test_server/crm/serializers.py @@ -76,6 +76,7 @@ class ConsumerDetailSerializer(serializers.ModelSerializer): class CandidateSerializer(serializers.ModelSerializer): + create_admin_username = serializers.StringRelatedField(source='create_admin', read_only=True) class Meta: model = Candidate fields = '__all__' \ No newline at end of file