diff --git a/client/src/api/ability.js b/client/src/api/ability.js new file mode 100644 index 0000000..13becc6 --- /dev/null +++ b/client/src/api/ability.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' + +export function getUserDetailList(query) { + return request({ + url: '/employee/userdetail/', + method: 'get', + params: query + }) +} + +export function createUserDetail(data) { + return request({ + url: '/employee/userdetail/', + method: 'post', + data + }) +} + +export function updateUserDetail(id, data) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'put', + data + }) +} + +export function deleteUserDetail(id) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/api/education.js b/client/src/api/education.js new file mode 100644 index 0000000..13becc6 --- /dev/null +++ b/client/src/api/education.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' + +export function getUserDetailList(query) { + return request({ + url: '/employee/userdetail/', + method: 'get', + params: query + }) +} + +export function createUserDetail(data) { + return request({ + url: '/employee/userdetail/', + method: 'post', + data + }) +} + +export function updateUserDetail(id, data) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'put', + data + }) +} + +export function deleteUserDetail(id) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/api/qualification.js b/client/src/api/qualification.js new file mode 100644 index 0000000..13becc6 --- /dev/null +++ b/client/src/api/qualification.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' + +export function getUserDetailList(query) { + return request({ + url: '/employee/userdetail/', + method: 'get', + params: query + }) +} + +export function createUserDetail(data) { + return request({ + url: '/employee/userdetail/', + method: 'post', + data + }) +} + +export function updateUserDetail(id, data) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'put', + data + }) +} + +export function deleteUserDetail(id) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/api/train.js b/client/src/api/train.js new file mode 100644 index 0000000..13becc6 --- /dev/null +++ b/client/src/api/train.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' + +export function getUserDetailList(query) { + return request({ + url: '/employee/userdetail/', + method: 'get', + params: query + }) +} + +export function createUserDetail(data) { + return request({ + url: '/employee/userdetail/', + method: 'post', + data + }) +} + +export function updateUserDetail(id, data) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'put', + data + }) +} + +export function deleteUserDetail(id) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/api/userdetail.js b/client/src/api/userdetail.js new file mode 100644 index 0000000..13becc6 --- /dev/null +++ b/client/src/api/userdetail.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' + +export function getUserDetailList(query) { + return request({ + url: '/employee/userdetail/', + method: 'get', + params: query + }) +} + +export function createUserDetail(data) { + return request({ + url: '/employee/userdetail/', + method: 'post', + data + }) +} + +export function updateUserDetail(id, data) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'put', + data + }) +} + +export function deleteUserDetail(id) { + return request({ + url: `/employee/userdetail/${id}/`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/client/src/main.js b/client/src/main.js index c404257..1565358 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -14,6 +14,8 @@ import router from './router' import '@/icons' // icon import '@/permission' // permission control +// import Treeselect from '@riophae/vue-treeselect' + /** * If you don't want to use mock-server * you want to use MockJs for mock api diff --git a/client/src/router/index.js b/client/src/router/index.js index f33e6ec..1842f63 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -96,6 +96,27 @@ export const asyncRoutes = [ } ] }, + { + path: '/employee', + component: Layout, + redirect: '/employee/userdetail', + name: 'Employee', + meta: { title: '人员管理', icon: 'example'}, + children: [ + { + path: 'userdetail', + name: 'UserDetail', + component: () => import('@/views/employee/userdetail'), + meta: { title: '人员信息', icon: 'example', perms: ['userdetail_manage'] } + }, + { + path: 'qualification', + name: 'Qualification', + component: () => import('@/views/employee/qualification'), + meta: { title: '注册资格', icon: 'example', perms: ['qualification_manage'] } + }, + ] + }, { path: '/system', component: Layout, diff --git a/client/src/views/employee/qualification.vue b/client/src/views/employee/qualification.vue new file mode 100644 index 0000000..cf5e3a0 --- /dev/null +++ b/client/src/views/employee/qualification.vue @@ -0,0 +1,168 @@ + + diff --git a/client/src/views/employee/userdetail.vue b/client/src/views/employee/userdetail.vue new file mode 100644 index 0000000..95b1821 --- /dev/null +++ b/client/src/views/employee/userdetail.vue @@ -0,0 +1,168 @@ + + diff --git a/client/src/views/implementrule/implementrule.vue b/client/src/views/implementrule/implementrule.vue index c24ef4c..cf5e3a0 100644 --- a/client/src/views/implementrule/implementrule.vue +++ b/client/src/views/implementrule/implementrule.vue @@ -1,8 +1,9 @@ - + @@ -99,11 +100,15 @@ diff --git a/client/src/views/implementrule/implementrulecreate.vue b/client/src/views/implementrule/implementrulecreate.vue index 3bb2798..057d112 100644 --- a/client/src/views/implementrule/implementrulecreate.vue +++ b/client/src/views/implementrule/implementrulecreate.vue @@ -5,21 +5,10 @@ - - - - + + @@ -63,7 +52,7 @@ - + - + - + - + @@ -151,7 +140,8 @@ export default { upHeaders: upHeaders(), upUrl: upUrl(), formData: { - cert_type: undefined, + id:null, + cert_field: undefined, code: undefined, name: undefined, pv_scope: undefined, @@ -159,7 +149,7 @@ export default { ccc_list: undefined }, rules: { - cert_type: [ + cert_field: [ { required: true, message: "请选择认证类型", @@ -191,20 +181,8 @@ export default { pv_class: [], ccc_list: [] }, - cert_typeOptions: [ - { - label: "自愿性产品认证", - value: "pv" - }, - { - label: "强制性产品认证", - value: "ccc" - }, - { - label: "管理体系认证", - value: "sys" - } - ], + cert_fieldOptions: [], + cert_field_code:null, pv_scopeOptions: [], pv_classOptions: [], ccc_listOptions: [], @@ -213,16 +191,21 @@ export default { }, computed: {}, watch: { - "formData.cert_type": "changeRules" + // "formData.cert_field": "changeRules" }, created() { this.getPvscope(); this.getPvclass(); this.getCccList(); this.getCertpattern(); + this.getCerttype(); }, mounted() {}, methods: { + typeChange(node,id){ + this.cert_field_code = node.code + this.changeRules(node.code) + }, handlePreview(file) { if ("url" in file) { window.open(file.url); @@ -233,8 +216,8 @@ export default { handleSuccess(response, file, fileList) { this.formData.path = response.data.path; }, - changeRules() { - if (this.formData.cert_type == "pv") { + changeRules(val) { + if (val == "pv") { this.rules.pv_scope = [ { required: true, @@ -250,7 +233,7 @@ export default { } ]; this.rules.ccc_list = []; - } else if (this.formData.cert_type == "ccc") { + } else if (val == "ccc") { this.rules.ccc_list = [ { required: true, @@ -271,6 +254,13 @@ export default { this.formData = response.data; }); }, + getCerttype() { + getDictList({ type__code: "cert_field" }).then(response => { + if (response.data) { + this.cert_fieldOptions = genTree(response.data); + } + }); + }, getPvscope() { getDictList({ type__code: "pv_scope" }).then(response => { if (response.data) { @@ -304,10 +294,8 @@ export default { if (!valid) return; // TODO 提交表单 createImplementRule(this.formData).then(response => { - this.$message({ - type: 'success', - message: '成功!' - }) + this.$message.success('成功') + this.formData.id = response.data.id }); }); }, diff --git a/client/src/views/implementrule/implementruleupdate.vue b/client/src/views/implementrule/implementruleupdate.vue index dd1767b..ceae635 100644 --- a/client/src/views/implementrule/implementruleupdate.vue +++ b/client/src/views/implementrule/implementruleupdate.vue @@ -5,21 +5,10 @@ - - - - + + @@ -63,7 +52,7 @@ - + - + - + - + @@ -151,7 +140,7 @@ export default { upHeaders: upHeaders(), upUrl: upUrl(), formData: { - cert_type: undefined, + cert_field: undefined, code: undefined, name: undefined, pv_scope: undefined, @@ -159,7 +148,7 @@ export default { ccc_list: undefined }, rules: { - cert_type: [ + cert_field: [ { required: true, message: "请选择认证类型", @@ -191,20 +180,8 @@ export default { pv_class: [], ccc_list: [] }, - cert_typeOptions: [ - { - label: "自愿性产品认证", - value: "pv" - }, - { - label: "强制性产品认证", - value: "ccc" - }, - { - label: "管理体系认证", - value: "sys" - } - ], + cert_fieldOptions: [], + cert_field_code:null, pv_scopeOptions: [], pv_classOptions: [], ccc_listOptions: [], @@ -213,7 +190,7 @@ export default { }, computed: {}, watch: { - "formData.cert_type": "changeRules" + // "formData.cert_field": "changeRules" }, created() { this.formData.id = this.$route.query.id; //接收参数 @@ -222,9 +199,14 @@ export default { this.getPvclass(); this.getCccList(); this.getCertpattern(); + this.getCerttype(); }, mounted() {}, methods: { + typeChange(node,id){ + this.cert_field_code = node.code + this.changeRules(node.code) + }, handlePreview(file) { if ("url" in file) { window.open(file.url); @@ -235,8 +217,8 @@ export default { handleSuccess(response, file, fileList) { this.formData.path = response.data.path; }, - changeRules() { - if (this.formData.cert_type == "pv") { + changeRules(val) { + if (val == "pv") { this.rules.pv_scope = [ { required: true, @@ -252,7 +234,7 @@ export default { } ]; this.rules.ccc_list = []; - } else if (this.formData.cert_type == "ccc") { + } else if (val == "ccc") { this.rules.ccc_list = [ { required: true, @@ -271,6 +253,7 @@ export default { getRule() { getImplementRule(this.formData.id).then(response => { this.formData = response.data; + this.cert_field_code = response.data.cert_field_.code }); }, getPvscope() { @@ -287,6 +270,13 @@ export default { } }); }, + getCerttype() { + getDictList({ type__code: "cert_field" }).then(response => { + if (response.data) { + this.cert_fieldOptions = genTree(response.data); + } + }); + }, getCccList() { getDictList({ type__code: "ccc_list" }).then(response => { if (response.data) { diff --git a/client/src/views/implementrule/unittype.vue b/client/src/views/implementrule/unittype.vue index 14b2de7..d1e4838 100644 --- a/client/src/views/implementrule/unittype.vue +++ b/client/src/views/implementrule/unittype.vue @@ -140,11 +140,7 @@ export default { }, handleDelete(scope){ deleteUnitType(scope.row.id).then(res=>{ - this.$notify({ - title: '成功', - type: 'success', - duration: 2000 - }) + this.$message.success('成功') this.getList() }) }, @@ -163,21 +159,13 @@ handleDelete(scope){ updateUnitType(this.unittype.id, this.unittype).then(() => { this.getList() this.dialogVisible = false - this.$notify({ - title: '成功', - type: 'success', - duration: 2000 - }) + this.$message.success('成功') }) } else { createUnitType(this.unittype).then(res => { this.getList() this.dialogVisible = false - this.$notify({ - title: '成功', - type: 'success', - duration: 2000 - }) + this.$message.success('成功') }) } } else { diff --git a/client/src/views/standard/standard.vue b/client/src/views/standard/standard.vue index 8f602d4..306c0b0 100644 --- a/client/src/views/standard/standard.vue +++ b/client/src/views/standard/standard.vue @@ -273,22 +273,14 @@ export default { if (res.code >= 200) { this.getList(); this.dialogVisible = false - this.$notify({ - title: "成功", - message: "编辑成功", - type: "success", - duration: 2000 - }); + this.$message.success('成功') } }); } else { createStandard(this.standard).then(res => { this.getList(); this.dialogVisible = false - this.$notify({ - title: "成功", - type: "success", - }) + this.$message.success('成功') }).catch(error=>{}) } diff --git a/client/src/views/system/dict.vue b/client/src/views/system/dict.vue index bc92719..c9610ba 100644 --- a/client/src/views/system/dict.vue +++ b/client/src/views/system/dict.vue @@ -63,23 +63,23 @@ :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > - + - + - + - + - +