diff --git a/test_client/.env.development b/test_client/.env.development index bf384e6..54ebc0d 100644 --- a/test_client/.env.development +++ b/test_client/.env.development @@ -3,6 +3,6 @@ ENV = 'development' # base api #VUE_APP_BASE_API = 'http://localhost:8000' -VUE_APP_BASE_API = 'https://qw.ctc-zc.com/api' +VUE_APP_BASE_API = 'https://dppz.ctc.ac.cn/api' VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/test_client/.env.production b/test_client/.env.production index 73a6894..fc76490 100644 --- a/test_client/.env.production +++ b/test_client/.env.production @@ -3,4 +3,4 @@ ENV = 'production' # base api # VUE_APP_BASE_API = '/prod-api' -VUE_APP_BASE_API = 'https://qw.ctc-zc.com/api' +VUE_APP_BASE_API = 'https://dppz.ctc.ac.cn/api' diff --git a/test_client/src/api/cms.js b/test_client/src/api/cms.js index e6eb590..d1d5b49 100644 --- a/test_client/src/api/cms.js +++ b/test_client/src/api/cms.js @@ -4,7 +4,7 @@ export function getArticleList(query) { return request({ url: '/cms/article/', method: 'get', - params:query + params: query }) } export function createArticle(data) { @@ -24,19 +24,19 @@ export function updateArticle(id, data) { export function deleteArticle(id) { return request({ url: `/cms/article/${id}/`, - method: 'delete', + method: 'delete' }) } export function getArticle(id) { return request({ url: `/cms/article/${id}/`, - method: 'get', + method: 'get' }) } export function topArticle(id) { return request({ url: `/cms/article/${id}/top/`, - method: 'put', + method: 'put' }) } @@ -44,7 +44,7 @@ export function getMaterialList(query) { return request({ url: '/cms/material/', method: 'get', - params:query + params: query }) } export function createMaterial(data) { @@ -72,7 +72,7 @@ export function getSourceList(query) { return request({ url: '/cms/source/', method: 'get', - params:query + params: query }) } export function createSource(data) { @@ -100,7 +100,7 @@ export function getThresholdList(query) { return request({ url: '/cms/threshold/', method: 'get', - params:query + params: query }) } export function createThreshold(data) { @@ -123,3 +123,60 @@ export function deleteThreshold(id) { method: 'delete' }) } +// 地坪项目优培企业 +export function getCompanyList(query) { + return request({ + url: '/cms/company/', + method: 'get', + params: query + }) +} +export function createCompany(data) { + return request({ + url: '/cms/company/', + method: 'post', + data + }) +} +export function updateCompany(id, data) { + return request({ + url: `/cms/company/${id}/`, + method: 'put', + data + }) +} +export function deleteCompany(id) { + return request({ + url: `/cms/company/${id}/`, + method: 'delete' + }) +} + +export function getChildcompanyList(query) { + return request({ + url: '/cms/childcomany/', + method: 'get', + params: query + }) +} +export function createChildcomany(data) { + return request({ + url: '/cms/childcomany/', + method: 'post', + data + }) +} +export function updateChildcomany(id, data) { + return request({ + url: `/cms/childcomany/${id}/`, + method: 'put', + data + }) +} +export function deleteChildcomany(id) { + return request({ + url: `/cms/childcomany/${id}/`, + method: 'delete' + }) +} + diff --git a/test_client/src/router/index.js b/test_client/src/router/index.js index 197e6fc..ef7b0b7 100644 --- a/test_client/src/router/index.js +++ b/test_client/src/router/index.js @@ -48,6 +48,7 @@ export const constantRoutes = [ * asyncRoutes * the routes that need to be dynamically loaded based on user perms */ +// eslint-disable-next-line no-sparse-arrays export const asyncRoutes = [ { path: '/', @@ -57,7 +58,7 @@ export const asyncRoutes = [ path: 'dashboard', name: 'Dashboard', component: () => import('@/views/dashboard/index'), - meta: { title: '首页', icon: 'dashboard', perms:['admin'] } + meta: { title: '首页', icon: 'dashboard', perms: ['admin'] } }] }, { @@ -83,18 +84,37 @@ export const asyncRoutes = [ path: 'news/create', name: 'NewsCreate', component: () => import('@/views/news/newscreate.vue'), - meta: { title: '新建文章', noCache: true, icon: '', perms: ['news_create']}, + meta: { title: '新建文章', noCache: true, icon: '', perms: ['news_create'] }, hidden: true }, { path: 'news/update', name: 'NewsUpdate', component: () => import('@/views/news/newsupdate.vue'), - meta: { title: '编辑文章', noCache: true, icon: '', perms: ['news_update']}, + meta: { title: '编辑文章', noCache: true, icon: '', perms: ['news_update'] }, hidden: true } ] }, + + + // youpei 是只针对地坪项目新建的菜单 + { + path: '/youpei', + component: Layout, + redirect: '/youpei/index', + name: 'Youpei', + meta: { title: '优培企业', icon: 'documentation', perms: ['youpei_view'] }, + children: [ + { + path: 'index', + name: 'youpeiList', + component: () => import('@/views/youpei/index.vue'), + meta: { title: '优培企业', icon: 'documentation', perms: ['youpei_view'] } + } + ] + }, + { path: '/vod', component: Layout, @@ -155,7 +175,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/Qmanage/question', name: 'Qmanage', - meta: { title: '题库管理', icon: 'table'}, + meta: { title: '题库管理', icon: 'table' }, children: [ { path: 'subject', @@ -179,14 +199,14 @@ export const asyncRoutes = [ path: 'question/create', name: 'CreateQuestion', component: () => import('@/views/question/questioncreate.vue'), - meta: { title: '新建题目', noCache: true, icon: '', perms: ['question_create']}, + meta: { title: '新建题目', noCache: true, icon: '', perms: ['question_create'] }, hidden: true }, { path: 'question/update', name: 'UpdateQuestion', component: () => import('@/views/question/questionupdate.vue'), - meta: { title: '编辑题目', noCache: true, icon: '', perms: ['question_update']}, + meta: { title: '编辑题目', noCache: true, icon: '', perms: ['question_update'] }, hidden: true } ] @@ -196,19 +216,19 @@ export const asyncRoutes = [ component: Layout, redirect: '/sjmanage/workscope', name: 'Sjmanage', - meta: { title: '出卷管理', icon: 'component', perms: []}, + meta: { title: '出卷管理', icon: 'component', perms: [] }, children: [ { path: 'testrule', name: 'TestRule', component: () => import('@/views/examtest/rule.vue'), - meta: { title: '试卷结构', icon: '', perms: ['testrule_manage'] }, + meta: { title: '试卷结构', icon: '', perms: ['testrule_manage'] } }, { path: 'workscope', name: 'workscope', component: () => import('@/views/examtest/workscope.vue'), - meta: { title: '工作类别', icon: '', perms: ['workscope_manage'] }, + meta: { title: '工作类别', icon: '', perms: ['workscope_manage'] } }, { path: 'testpaper', @@ -220,42 +240,42 @@ export const asyncRoutes = [ path: 'testrule/create', name: 'CreateRule', component: () => import('@/views/examtest/rulecreate.vue'), - meta: { title: '新建试卷结构', noCache: true, icon: '', perms: ['testrule_add']}, + meta: { title: '新建试卷结构', noCache: true, icon: '', perms: ['testrule_add'] }, hidden: true }, { path: 'testrule/update', name: 'UpdateRule', component: () => import('@/views/examtest/ruleupdate.vue'), - meta: { title: '编辑试卷结构', noCache: true, icon: '', perms: ['testrule_update']}, + meta: { title: '编辑试卷结构', noCache: true, icon: '', perms: ['testrule_update'] }, hidden: true }, { path: 'workscope/create', name: 'CreateWorkscope', component: () => import('@/views/examtest/workscopecreate.vue'), - meta: { title: '新建工作类别', noCache: true, icon: '', perms: ['workscope_add']}, + meta: { title: '新建工作类别', noCache: true, icon: '', perms: ['workscope_add'] }, hidden: true }, { path: 'workscope/update', name: 'UpdateWorkscope', component: () => import('@/views/examtest/workscopeupdate.vue'), - meta: { title: '编辑工作类别', noCache: true, icon: '', perms: ['workscope_update']}, + meta: { title: '编辑工作类别', noCache: true, icon: '', perms: ['workscope_update'] }, hidden: true }, { path: 'paper/create', name: 'CreatePaper', component: () => import('@/views/examtest/papercreate.vue'), - meta: { title: '新建押题试卷', noCache: true, icon: '', perms: ['paper_add']}, + meta: { title: '新建押题试卷', noCache: true, icon: '', perms: ['paper_add'] }, hidden: true }, { path: 'paper/update', name: 'UpdatePaper', component: () => import('@/views/examtest/paperupdate.vue'), - meta: { title: '编辑押题试卷', noCache: true, icon: '', perms: ['paper_update']}, + meta: { title: '编辑押题试卷', noCache: true, icon: '', perms: ['paper_update'] }, hidden: true } ] @@ -265,19 +285,19 @@ export const asyncRoutes = [ component: Layout, redirect: '/exammanage/index', name: 'Exammanage', - meta: { title: '考证管理', icon: 'component'}, + meta: { title: '考证管理', icon: 'component' }, children: [ { path: 'index', name: 'exam', component: () => import('@/views/exam/index.vue'), - meta: { title: '正式考试', perms: ['exam_view'] } + meta: { title: '正式考试', perms: ['exam_view'] } }, { path: 'issue', name: 'issue', component: () => import('@/views/exam/issue.vue'), - meta: { title: '出证记录', perms: ['certificate_view'] } + meta: { title: '出证记录', perms: ['certificate_view'] } } ] }, @@ -286,13 +306,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/threshold/source', name: 'Threshold', - meta: { title: '阈值库', icon: 'component'}, + meta: { title: '阈值库', icon: 'component', perms: ['threshold_view']}, children: [ { path: 'source', name: 'source', component: () => import('@/views/threshold/source.vue'), - meta: { title: '阈值库', perms: ['threshold_view'] } + meta: { title: '阈值库', perms: ['threshold_view'] } } ] }, @@ -301,7 +321,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/analyse/examtest', name: 'Analyse', - meta: { title: '统计分析', icon: 'chart', perms: ['examtest_view']}, + meta: { title: '统计分析', icon: 'chart', perms: ['examtest_view'] }, children: [ { path: 'examtest', @@ -344,7 +364,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/system/admin', name: 'System', - meta: { title: '系统管理', icon: 'tree', perms:[] }, + meta: { title: '系统管理', icon: 'tree', perms: [] }, children: [ { path: 'banner', @@ -369,7 +389,7 @@ export const asyncRoutes = [ name: 'Msg', component: () => import('@/views/system/msg'), meta: { title: '短信发送', icon: '', perms: ['msg_view'] } - }, + } // { // path: 'user/password', // name: 'ChangePassword', @@ -385,15 +405,15 @@ export const asyncRoutes = [ redirect: '/changepassword', name: 'ChangePW', meta: { title: '修改密码', icon: 'tree' }, - hidden:true, + hidden: true, children: [ { path: '', name: 'ChangePassword', component: () => import('@/views/system/changepassword'), - meta: { title: '修改密码', noCache: true, icon: ''}, + meta: { title: '修改密码', noCache: true, icon: '' }, hidden: true - }, + } ] }, // 404 page must be placed at the end !!! diff --git a/test_client/src/views/analyse/examtest.vue b/test_client/src/views/analyse/examtest.vue index b63d3f7..9ea230c 100644 --- a/test_client/src/views/analyse/examtest.vue +++ b/test_client/src/views/analyse/examtest.vue @@ -302,11 +302,11 @@ this.$confirm("确认删除该考试记录吗?将丢失数据!", "警告", { }else{ this.listQuery.ordering = '-' + val.prop } - + this.getList() }, - + } }; diff --git a/test_client/src/views/crm/consumer.vue b/test_client/src/views/crm/consumer.vue index b77e166..1fd1d0c 100644 --- a/test_client/src/views/crm/consumer.vue +++ b/test_client/src/views/crm/consumer.vue @@ -1,55 +1,55 @@ @@ -375,50 +390,47 @@ import { unbindConsumer, getConsumerRoleAll, updateendConsumers -} from "@/api/crm"; -import { getSubjectAll } from "@/api/question"; -import { getWorkScopeAll } from "@/api/examtest"; -import { getCompanyList } from "@/api/crm"; -import { genTree, deepClone } from "@/utils"; -import checkPermission from "@/utils/permission"; -import { upUrl } from "@/api/file"; -import { getUserList } from "@/api/user"; -import { getToken } from "@/utils/auth"; -import Pagination from "@/components/Pagination"; // secondary package based on el-pagination -import Companychose from "@/views/crm/companychose"; +} from '@/api/crm' +import { getSubjectAll } from '@/api/question' +import { getWorkScopeAll } from '@/api/examtest' +import { getCompanyList } from '@/api/crm' +import { genTree, deepClone } from '@/utils' +import checkPermission from '@/utils/permission' + +import { upUrl, upHeaders } from '@/api/file' +import { getUserList } from '@/api/user' +import { getToken } from '@/utils/auth' +import Pagination from '@/components/Pagination' // secondary package based on el-pagination +import Companychose from '@/views/crm/companychose' const defaultConsumer = { - id: "", - name: "", - username: "", + id: '', + name: '', + username: '', company: null, company_: {}, subjects: [], workscope: null, role: 3, -}; + avatar: '' +} const listQuery = { page: 1, limit: 20, - search: "", -}; + search: '' +} export default { components: { Pagination, Companychose }, - watch: { - filterOrgText(val) { - this.$refs.tree.filter(val); - }, - }, data() { return { - dateVisible:false, - exceed_date:'', + dateVisible: false, + exceed_date: '', dgVisiable: false, tableKey: 0, showCreate: true, upUrl: upUrl(), popovervisible: false, consumer: defaultConsumer, - upHeaders: { Authorization: "JWT " + getToken() }, + upHeaders: { Authorization: 'JWT ' + getToken() }, consumerList: [], total: 0, listLoading: true, @@ -426,36 +438,36 @@ export default { listQuery: { page: 1, limit: 20, - search: "", + search: '' }, listQueryc: { page: 1, limit: 20, - search: "", + search: '' }, - tableDatac: {count:0}, + tableDatac: { count: 0 }, enabledOptions: [ - { key: "true", display_name: "已缴" }, - { key: "false", display_name: "未缴" }, + { key: 'true', display_name: '已缴' }, + { key: 'false', display_name: '未缴' } ], dialogVisible: false, - dialogType: "new", + dialogType: 'new', rule1: { - name: [{ required: true, message: "请输入姓名", trigger: "blur" }], + name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], username: [ { required: true, - message: "请输入手机号", - trigger: "change", - pattern: /^1[3456789]\d{9}$/, - }, + message: '请输入手机号', + trigger: 'change', + pattern: /^1[3456789]\d{9}$/ + } ], - role: [{ required: true, message: "请选择", trigger: "change" }], - workscope: [{ required: true, message: "请选择", trigger: "change" }], - subjects: [{ required: true, message: "请选择", trigger: "change" }], - exceed_date: [{ required: true, message: "请选择", trigger: "change" }], + role: [{ required: true, message: '请选择', trigger: 'change' }], + workscope: [{ required: true, message: '请选择', trigger: 'change' }], + subjects: [{ required: true, message: '请选择', trigger: 'change' }], + exceed_date: [{ required: true, message: '请选择', trigger: 'change' }] }, - filterOrgText: "", + filterOrgText: '', treeLoding: false, companyData: [], subjectData: [], @@ -465,104 +477,119 @@ export default { pickerOptions: { shortcuts: [ { - text: "最近一天", + text: '最近一天', onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24); - picker.$emit("pick", [start, end]); - }, + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24) + picker.$emit('pick', [start, end]) + } }, { - text: "最近一周", + text: '最近一周', onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); - picker.$emit("pick", [start, end]); - }, + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', [start, end]) + } }, { - text: "最近一个月", + text: '最近一个月', onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); - picker.$emit("pick", [start, end]); - }, + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + picker.$emit('pick', [start, end]) + } }, { - text: "最近三个月", + text: '最近三个月', onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); - picker.$emit("pick", [start, end]); - }, - }, - ], + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + picker.$emit('pick', [start, end]) + } + } + ] }, - datevalue: "", - adminOptions: [], - }; + datevalue: '', + adminOptions: [] + } }, computed: {}, watch: { - datevalue: "setTimeRange", + filterOrgText(val) { + this.$refs.tree.filter(val) + } + }, + watch: { + datevalue: 'setTimeRange' }, created() { - this.getList(); - this.getListc(); - this.getSubjectAll(); - this.getWorkScopeAll(); - this.getConsumerRoleAll(); - this.getAdminOptions(); + this.getList() + this.getListc() + this.getSubjectAll() + this.getWorkScopeAll() + this.getConsumerRoleAll() + this.getAdminOptions() }, methods: { checkPermission, + handleAvatarSuccess(res, file) { + this.consumer.avatar = res.data.path + }, + beforeAvatarUpload(file) { + const isLt2M = file.size / 1024 / 1024 < 2 + if (!isLt2M) { + this.$message.error('上传图片大小不能超过 2MB!') + } + return isLt2M + }, handleUploadSuccess(res, file) { if (res.code == 200) { - const loading = this.$loading({ text: "正在导入中..." }); + const loading = this.$loading({ text: '正在导入中...' }) importConsumer(res.data).then((response) => { - loading.close(); + loading.close() if (response.code == 200) { this.$message({ - message: "导入成功", - type: "success", - }); - this.getList(listQuery); + message: '导入成功', + type: 'success' + }) + this.getList(listQuery) } else if (response.code == 206) { this.$message({ - message: "部分未成功" + response.data, - type: "success", - }); - this.getList(listQuery); + message: '部分未成功' + response.data, + type: 'success' + }) + this.getList(listQuery) } else { - this.$message.error(response.msg); + this.$message.error(response.msg) } - }); + }) } else { - this.$message.error("Excel上传失败!"); + this.$message.error('Excel上传失败!') } }, filterNode(value, data) { - if (!value) return true; - return data.label.indexOf(value) !== -1; + if (!value) return true + return data.label.indexOf(value) !== -1 }, getList() { - this.listLoading = true; + this.listLoading = true getConsumerList(this.listQuery).then((response) => { - this.consumerList = response.data.results; - this.total = response.data.count; - this.listLoading = false; - }); + this.consumerList = response.data.results + this.total = response.data.count + this.listLoading = false + }) }, getListc() { - this.listLoadingc = true; + this.listLoadingc = true getCompanyList(this.listQueryc).then((response) => { - this.tableDatac = response.data; - this.listLoadingc = false; - }); + this.tableDatac = response.data + this.listLoadingc = false + }) }, // getCompanyList() { // this.treeLoding = true; @@ -580,126 +607,126 @@ export default { // }, getSubjectAll() { getSubjectAll().then((response) => { - this.subjectData = genTree(response.data); - }); + this.subjectData = genTree(response.data) + }) }, getWorkScopeAll() { getWorkScopeAll().then((response) => { - this.workscopeData = genTree(response.data); - }); + this.workscopeData = genTree(response.data) + }) }, getConsumerRoleAll() { getConsumerRoleAll().then((response) => { - this.roleData = genTree(response.data); - }); + this.roleData = genTree(response.data) + }) }, resetFilter() { this.listQuery = { page: 1, limit: 20, - search: "", - }; - this.getList(); + search: '' + } + this.getList() }, handleFilter() { - this.listQuery.page = 1; - this.getList(); + this.listQuery.page = 1 + this.getList() }, handleAddUser() { - this.consumer = Object.assign({}, defaultConsumer); - this.dialogType = "new"; - this.dialogVisible = true; + this.consumer = Object.assign({}, defaultConsumer) + this.dialogType = 'new' + this.dialogVisible = true this.$nextTick(() => { - this.$refs["consumerForm"].clearValidate(); - }); + this.$refs['consumerForm'].clearValidate() + }) }, handleEdit(scope) { - this.consumer = Object.assign({}, scope.row); // copy obj + this.consumer = Object.assign({}, scope.row) // copy obj if (this.consumer.company_ == null) { - this.consumer.company_ = {}; + this.consumer.company_ = {} } - this.dialogType = "edit"; - this.dialogVisible = true; + this.dialogType = 'edit' + this.dialogVisible = true this.$nextTick(() => { - this.$refs["consumerForm"].clearValidate(); - }); + this.$refs['consumerForm'].clearValidate() + }) }, handleUnbind(scope) { - this.$confirm("确认解除该账户的微信绑定吗!", "警告", { - type: "warning", + this.$confirm('确认解除该账户的微信绑定吗!', '警告', { + type: 'warning' }) .then(() => { unbindConsumer(scope.row.id) .then((res) => { this.$message({ - type: "success", - message: "解绑成功!", - }); - this.getList(); + type: 'success', + message: '解绑成功!' + }) + this.getList() }) .catch((err) => { - console.error(err); - }); + console.error(err) + }) }) .catch((err) => { - console.error(err); - }); + console.error(err) + }) }, handleDelete(scope) { - this.$confirm("确认删除该用户吗?将丢失数据!", "警告", { - confirmButtonText: "确认", - cancelButtonText: "取消", - type: "error", + this.$confirm('确认删除该用户吗?将丢失数据!', '警告', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'error' }) - .then(async () => { - await deleteConsumer(scope.row.id); - this.consumerList.splice(scope.row.index, 1); + .then(async() => { + await deleteConsumer(scope.row.id) + this.consumerList.splice(scope.row.index, 1) this.$message({ - type: "success", - message: "成功删除!", - }); + type: 'success', + message: '成功删除!' + }) }) .catch((err) => { - console.error(err); - }); + console.error(err) + }) }, handleDeletes() { if (this.selects.length) { this.$confirm( - "确认删除这" + this.selects.length + "位用户吗?将丢失数据!", - "警告", + '确认删除这' + this.selects.length + '位用户吗?将丢失数据!', + '警告', { - confirmButtonText: "确认", - cancelButtonText: "取消", - type: "error", + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'error' } ) - .then(async () => { - const { code } = await deleteConsumers({ ids: this.selects }); + .then(async() => { + const { code } = await deleteConsumers({ ids: this.selects }) if (code >= 200) { - this.getList(); + this.getList() this.$message({ - type: "success", - message: "成功删除!", - }); + type: 'success', + message: '成功删除!' + }) } }) .catch((err) => { - console.error(err); - }); + console.error(err) + }) } else { this.$message({ - message: "请先选择", - type: "warning", - }); + message: '请先选择', + type: 'warning' + }) } }, async confirmUser(form) { this.$refs[form].validate((valid) => { if (valid) { - const isEdit = this.dialogType === "edit"; + const isEdit = this.dialogType === 'edit' if (isEdit) { - let consumer = this.consumer; + const consumer = this.consumer updateConsumer(this.consumer.id, consumer).then((res) => { // for (let index = 0; index < this.consumerList.length; index++) { // if (this.consumerList[index].id === this.consumer.id) { @@ -711,71 +738,70 @@ export default { // break; // } // } - this.getList(); - this.dialogVisible = false; - this.$message.success('成功') - - }); + this.getList() + this.dialogVisible = false + this.$message.success('成功') + }) } else { createConsumer(this.consumer).then((res) => { // this.consumer = res.data // this.consumerList.unshift(this.consumer) - this.getList(); - this.dialogVisible = false; - this.$message.success('成功') - }); + this.getList() + this.dialogVisible = false + this.$message.success('成功') + }) } } else { - return false; + return false } - }); + }) }, exportConsumer() { - const loading = this.$loading(); + const loading = this.$loading() exportConsumer(this.listQuery).then((response) => { - loading.close(); - window.open(response.data.path, "_blank"); - }).catch(()=>{loading.close()}); + loading.close() + window.open(response.data.path, '_blank') + }).catch(() => { loading.close() }) }, changeSort(val) { - if (val.order == "ascending") { - this.listQuery.ordering = val.prop; + if (val.order == 'ascending') { + this.listQuery.ordering = val.prop } else { - this.listQuery.ordering = "-" + val.prop; + this.listQuery.ordering = '-' + val.prop } - this.getList(); + this.getList() }, handleSelectionChange(val) { - let selects = []; + const selects = [] for (var i = 0; i < val.length; i++) { - selects.push(val[i].id); + selects.push(val[i].id) } - this.selects = selects; + this.selects = selects }, setTimeRange() { (this.listQuery.min_create = this.datevalue[0]), - (this.listQuery.max_create = this.datevalue[1]), - this.getList(); + (this.listQuery.max_create = this.datevalue[1]), + this.getList() }, getAdminOptions() { - if (checkPermission(["admin"])) { - getUserList({pageoff:true}).then((res) => { - this.adminOptions = res.data; - }); + if (checkPermission(['admin'])) { + getUserList({ pageoff: true }).then((res) => { + this.adminOptions = res.data + }) } }, choose() { - this.dgVisiable = true; + this.dgVisiable = true }, chooseComplete(val) { - this.dgVisiable = false; + this.dgVisiable = false if (val) { - this.consumer.company_ = val; - this.consumer.company = val.id; + this.consumer.company_ = val + this.consumer.company = val.id } }, - handleCompanyClick(row, column, event){ + handleCompanyClick(row, column, event) { this.listQuery.company = row.id this.getList() }, @@ -784,22 +810,22 @@ export default { this.dateVisible = true } else { this.$message({ - message: "请先选择", - type: "warning", - }); + message: '请先选择', + type: 'warning' + }) } }, - confirmupdateend(){ - if(this.exceed_date.length>0){ - updateendConsumers({ ids: this.selects,exceed_date:this.exceed_date }).then(res=>{ + confirmupdateend() { + if (this.exceed_date.length > 0) { + updateendConsumers({ ids: this.selects, exceed_date: this.exceed_date }).then(res => { this.getList() this.dateVisible = false this.$message.success('成功') - }).catch(e=>{ + }).catch(e => { this.dateVisible = false }) } } - }, -}; + } +} diff --git a/test_client/src/views/exam/issue.vue b/test_client/src/views/exam/issue.vue index 45dab18..8aa4d24 100644 --- a/test_client/src/views/exam/issue.vue +++ b/test_client/src/views/exam/issue.vue @@ -38,12 +38,18 @@ + + + + + + @@ -118,6 +124,9 @@ + + + @@ -127,12 +136,11 @@ placeholder="工作类别" /> + - - - + @@ -167,23 +175,18 @@ value-format="yyyy-MM-dd" /> - - - - - + + + + + + + @@ -202,10 +205,10 @@ width="1000px" title="证书查看" > - - + + - +
取消 @@ -276,7 +279,15 @@ export default { candidate: { photo: '' }, candidateRule: { number: [{ required: true, message: '请输入编号', trigger: 'blur' }] - } + }, + typeOption:[ + { name: '初级工', value: '初级工' }, + { name: '中级工', value: '中级工'}, + { name: '高级工', value: '高级工' }, + { name: '技师', value: '技师'}, + { name: '高级技师', value: '高级技师' } + ], + } }, computed: {}, @@ -322,19 +333,16 @@ export default { }, // 气味分析证书展示 handleDialogissue(scope) { - if(scope.row.photo==null) - { - this.$message({ + if (scope.row.photo == null) { + this.$message({ message: '请先点击编辑上传证书人员照片!', type: 'warning' - }); + }) + } else { + this.dialogVisibleissue = true + this.src = 'https://qw.ctc-zc.com' + scope.row.path + this.name = scope.row.workscope_name } - else{ - this.dialogVisibleissue = true - this.src = 'https://qw.ctc-zc.com' + scope.row.path - this.name = scope.row.workscope_name - } - }, handleAdd() { this.dialogVisible = true @@ -375,11 +383,11 @@ export default { }, // 下载证书 downCandidate() { - var a = document.createElement('a'); - a.href = this.src ; - a.download = this.src ; - a.target="_blank" - a.click() + var a = document.createElement('a') + a.href = this.src + a.download = this.src + a.target = '_blank' + a.click() } } } diff --git a/test_client/src/views/examtest/papercreate.vue b/test_client/src/views/examtest/papercreate.vue index 3db1968..8b9984b 100644 --- a/test_client/src/views/examtest/papercreate.vue +++ b/test_client/src/views/examtest/papercreate.vue @@ -199,4 +199,4 @@ export default { } } }; - \ No newline at end of file + diff --git a/test_client/src/views/login/index.vue b/test_client/src/views/login/index.vue index 8971951..bd396d1 100644 --- a/test_client/src/views/login/index.vue +++ b/test_client/src/views/login/index.vue @@ -12,7 +12,7 @@
-

中科辐射小程序后台管理

+

小程序后台管理

diff --git a/test_client/src/views/material/material.vue b/test_client/src/views/material/material.vue index 48f5879..281ee6d 100644 --- a/test_client/src/views/material/material.vue +++ b/test_client/src/views/material/material.vue @@ -1,125 +1,126 @@