From a701296baa566023ed5b30198c1f23a330692e6e Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Apr 2022 14:08:25 +0800 Subject: [PATCH 1/4] 0421 --- hb_client/src/router/index.js | 94 ++++++++++---------- hb_client/src/views/personnel/userupdate.vue | 10 +-- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index fa70183..e02ebec 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -113,7 +113,7 @@ export const asyncRoutes = [ path: 'material/:id', name: 'MaterialDO', component: () => import('@/views/mtm/materialdo.vue'), - meta: { title: '绑定检查表', perms: ['vendor_manage'] }, + meta: { title: '绑定检查表' }, hidden: true } , @@ -121,7 +121,7 @@ export const asyncRoutes = [ path: 'materialDetail/:id', name: 'MaterialDetail', component: () => import('@/views/mtm/materialDetail.vue'), - meta: { title: '物料详情', perms: ['vendor_manage'] }, + meta: { title: '物料详情' }, hidden: true }, { @@ -134,7 +134,7 @@ export const asyncRoutes = [ path: 'step/:id', name: 'Step', component: () => import('@/views/mtm/step.vue'), - meta: { title: '子工序', perms: ['vendor_manage'] }, + meta: { title: '子工序'}, hidden: true } , @@ -142,7 +142,7 @@ export const asyncRoutes = [ path: 'stepdo/:id', name: 'StepDo', component: () => import('@/views/mtm/stepdo.vue'), - meta: { title: '子工序查看', perms: ['vendor_manage'] }, + meta: { title: '子工序查看'}, hidden: true }, { @@ -155,13 +155,13 @@ export const asyncRoutes = [ path: 'productList', name: 'productList', component: () => import('@/views/mtm/productList'), - meta: { title: '成品列表', icon: 'material', perms: ['mtm_material'] } + meta: { title: '成品列表', icon: 'material', perms: ['mtm_product'] } } ,{ path: 'wproductList', name: 'wproductList', component: () => import('@/views/mtm/wproductList'), - meta: { title: '半成品列表', icon: 'material', perms: ['mtm_material'] } + meta: { title: '半成品列表', icon: 'material', perms: ['mtm_wproduct'] } } ] }, @@ -183,7 +183,7 @@ export const asyncRoutes = [ path: 'work/:id', name: 'work', component: () => import('@/views/pm/work'), - meta: { title: '生产子计划', perms: ['pm_plan'] }, + meta: { title: '生产子计划'}, hidden: true }, { @@ -199,24 +199,24 @@ export const asyncRoutes = [ component: () => import('@/views/pm/management'), meta: { title: '生产任务管理', icon: 'productionTask', perms: ['pm_testitem'] } }, - + { path: 'plandetails/:id', name: 'plandetails', component: () => import('@/views/pm/plandetails'), - meta: { title: '生产任务详情', perms: ['pm_testitem'] }, + meta: { title: '生产任务详情'}, hidden: true } , - + { path: 'processcard/:id', name: 'processcard', component: () => import('@/views/pm/processcard'), - meta: { title: '流程卡', perms: ['vendor_manage'] }, + meta: { title: '流程卡' }, hidden: true } - + ] }, { @@ -226,7 +226,7 @@ export const asyncRoutes = [ name: 'wpm', meta: { title: '生产执行', icon: 'execute', perms: ['wpm_manage'] }, children: [ - { + { path: 'worktask', name: 'worktask', component: () => import('@/views/wpm/worktask'), @@ -316,10 +316,10 @@ export const asyncRoutes = [ path: 'contractdetail/:id', name: 'contractdetail', component: () => import('@/views/sam/contractdetail'), - meta: { title: '合同详情', perms: ['sam_contract'] }, + meta: { title: '合同详情'}, hidden: true } - + , { path: 'order', @@ -327,13 +327,13 @@ export const asyncRoutes = [ component: () => import('@/views/sam/order'), meta: { title: '订单管理', icon: 'order', perms: ['sam_order'] } } - + , { path: 'orderdetail/:id', name: 'orderdetail', component: () => import('@/views/sam/orderdetail'), - meta: { title: '订单详情', perms: ['sam_order'] }, + meta: { title: '订单详情'}, hidden: true }, { @@ -347,7 +347,7 @@ export const asyncRoutes = [ path: 'salesdetail/:id', name: 'salesdetail', component: () => import('@/views/sam/salesdetail'), - meta: { title: '销售详情', perms: ['sam_sales'] }, + meta: { title: '销售详情'}, hidden: true } ] @@ -383,7 +383,7 @@ export const asyncRoutes = [ path: 'taskdetails/:id', name: 'taskdetails', component: () => import('@/views/qm/taskdetails'), - meta: { title: '过程检验详情', perms: ['qm_processtest'] }, + meta: { title: '过程检验详情'}, hidden: true } , @@ -391,7 +391,7 @@ export const asyncRoutes = [ path: 'wproduct/:id', name: 'wproduct', component: () => import('@/views/qm/wproduct'), - meta: { title: '工序玻璃', perms: ['vendor_manage'] }, + meta: { title: '工序玻璃' }, hidden: true } , @@ -399,7 +399,7 @@ export const asyncRoutes = [ path: 'taskrecordfrom/:id', name: 'taskrecordfrom', component: () => import('@/views/qm/taskrecordfrom'), - meta: { title: '检验记录', perms: ['vendor_manage'] }, + meta: { title: '检验记录'}, hidden: true } , @@ -415,7 +415,7 @@ export const asyncRoutes = [ component: () => import('@/views/qm/unproduct'), meta: { title: '不合格品', icon: 'unqualified', perms: ['qm_unproduct'] } } - + ] }, { @@ -423,19 +423,19 @@ export const asyncRoutes = [ component: Layout, redirect: '/personnel/user', name: 'personnel', - meta: { title: '人员管理', icon: 'user', perms: ['personnel_set'] }, + meta: { title: '人员管理', icon: 'user', perms: ['employee_manage'] }, children: [ { path: 'user', name: 'user', component: () => import('@/views/personnel/user'), - meta: { title: '人员列表', icon: 'userList', perms: ['personnel_user'] } + meta: { title: '人员列表', icon: 'userList', perms: ['employee_userList'] } }, { path: 'attendance', name: 'attendance', component: () => import('@/views/personnel/attendance'), - meta: { title: '考勤列表', icon: 'attendance', perms: ['personnel_attendance'] } + meta: { title: '考勤列表', icon: 'attendance', perms: ['employee_attendance'] } } ,{ path: 'userupdate/:id', name: 'userupdate', @@ -443,7 +443,7 @@ export const asyncRoutes = [ meta: { title: '人员信息详情', icon: 'home' }, hidden: true }, - + ] }, { @@ -463,7 +463,7 @@ export const asyncRoutes = [ path: 'inventory/:id', name: 'inventory', component: () => import('@/views/inm/inventory'), - meta: { title: '仓库物料', perms: ['vendor_manage'] }, + meta: { title: '仓库物料' }, hidden: true } , @@ -483,7 +483,7 @@ export const asyncRoutes = [ path: 'fifodetail/:id', name: 'fifodetail', component: () => import('@/views/inm/fifodetail'), - meta: { title: '仓库物料', perms: ['vendor_manage'] }, + meta: { title: '仓库物料'}, hidden: true }, { @@ -498,7 +498,7 @@ export const asyncRoutes = [ component: () => import('@/views/inm/product'), meta: { title: '成品库', icon: 'finishedProduct', perms: ['inm_product'] } }, - + ] }, { @@ -506,25 +506,25 @@ export const asyncRoutes = [ component: Layout, redirect: '/procurement/vendor', name: 'procurement', - meta: { title: '采购管理', icon: 'purchase', perms: ['procurement_manage'] }, + meta: { title: '采购管理', icon: 'purchase', perms: ['pum_manage'] }, children: [ { path: 'vendor', name: 'vendor', component: () => import('@/views/procurement/vendor'), - meta: { title: '供应商', icon: 'supplier', perms: ['procurement_vendor'] } + meta: { title: '供应商', icon: 'supplier', perms: ['pum_vendor'] } }, { path: 'puorder', name: 'puorder', component: () => import('@/views/procurement/puorder'), - meta: { title: '采购订单', icon: 'purchaseOrder', perms: ['procurement_puorder'] } + meta: { title: '采购订单', icon: 'purchaseOrder', perms: ['pum_puorder'] } }, { path: 'puorderitem/:id', name: 'puorderitem', component: () => import('@/views/procurement/puorderitem'), - meta: { title: '采购订单项', perms: ['procurement_puorder'] }, + meta: { title: '采购订单项'}, hidden: true } ] @@ -554,18 +554,18 @@ export const asyncRoutes = [ component: () => import('@/views/statistics/personStatistics'), meta: { title: '人员统计', icon: 'personStatistics', perms: ['statistics_personStatistics'] } }, - { - path: 'costStatistics', - name: 'costStatistics', - component: () => import('@/views/statistics/costStatistics'), - meta: { title: '成本统计', icon: 'costStatistics', perms: ['workflow_index'] } - }, - { - path: 'testStatistics', - name: 'testStatistics', - component: () => import('@/views/statistics/testStatistics'), - meta: { title: '检验统计', icon: 'testStatistics', perms: ['workflow_index'] } - }, + /* { + path: 'costStatistics', + name: 'costStatistics', + component: () => import('@/views/statistics/costStatistics'), + meta: { title: '成本统计', icon: 'costStatistics', perms: ['workflow_index'] } + }, + { + path: 'testStatistics', + name: 'testStatistics', + component: () => import('@/views/statistics/testStatistics'), + meta: { title: '检验统计', icon: 'testStatistics', perms: ['workflow_index'] } + },*/ ] }, @@ -647,7 +647,7 @@ export const asyncRoutes = [ meta: { title: '用户管理', icon: 'home', perms: ['user_manage'] } } , - + { path: 'organization', name: 'Organization', @@ -676,7 +676,7 @@ export const asyncRoutes = [ path: 'file', name: 'File', component: () => import('@/views/system/file'), - meta: { title: '文件库', icon: 'home', perms: ['file_room'] } + meta: { title: '文件库', icon: 'home', perms: ['system_file'] } }, { path: 'task', diff --git a/hb_client/src/views/personnel/userupdate.vue b/hb_client/src/views/personnel/userupdate.vue index 8f0cd22..e277c8b 100644 --- a/hb_client/src/views/personnel/userupdate.vue +++ b/hb_client/src/views/personnel/userupdate.vue @@ -333,9 +333,9 @@ export default { this.user.avatar = res.data.path; }, beforeAvatarUpload(file) { - const isLt2M = file.size / 1024 / 1024 < 2; + const isLt2M = file.size / 1024 / 1024 < 5; if (!isLt2M) { - this.$message.error("上传头像图片大小不能超过 2MB!"); + this.$message.error("上传头像图片大小不能超过 5MB!"); } return isLt2M; }, @@ -344,9 +344,9 @@ export default { return data.label.indexOf(value) !== -1; }, beforeUpload(file) { - const isLt1M = file.size / 1024 / 1024 < 1; + const isLt1M = file.size / 1024 / 1024 < 5; if (!isLt1M) { - this.$message.error("上传头像图片大小不能超过 1MB!"); + this.$message.error("上传头像图片大小不能超过 5MB!"); } return isLt1M; }, @@ -402,4 +402,4 @@ export default { }, }, }; - \ No newline at end of file + From adab213a4524b1ecd41a269fba6ca09d2acda095 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Apr 2022 14:11:55 +0800 Subject: [PATCH 2/4] 0421 --- hb_client/.env.production | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hb_client/.env.production b/hb_client/.env.production index d12d8ae..9305698 100644 --- a/hb_client/.env.production +++ b/hb_client/.env.production @@ -3,6 +3,6 @@ ENV = 'production' # base api #VUE_APP_BASE_API = 'http://192.168.1.250/api' -VUE_APP_BASE_API = 'http://127.0.0.1:3333/api' +VUE_APP_BASE_API = 'http://49.232.14.174:2222/api' #VUE_APP_BASE_API = 'http://127.0.0.1:8000/api' From 48d7ebb85c5578c176ad5bc3df986f57d8080090 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Apr 2022 14:54:43 +0800 Subject: [PATCH 3/4] 0421 --- hb_client/src/api/qm.js | 7 +++++++ hb_client/src/views/wpm/need.vue | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hb_client/src/api/qm.js b/hb_client/src/api/qm.js index 32ddc26..d18d4e2 100644 --- a/hb_client/src/api/qm.js +++ b/hb_client/src/api/qm.js @@ -65,6 +65,13 @@ export function getTestRecord(query) { params: query }) } +//检测记录模板 +export function getTestRecordExport(id) { + return request({ + url: `/qm/testrecord/${id}/export/`, + method: 'get' + }) +} //检测记录 export function getTestRecordItem(id) { return request({ diff --git a/hb_client/src/views/wpm/need.vue b/hb_client/src/views/wpm/need.vue index 1a29bcf..3f4f087 100644 --- a/hb_client/src/views/wpm/need.vue +++ b/hb_client/src/views/wpm/need.vue @@ -801,7 +801,7 @@ import {createTicket, getWorkflowInit} from "@/api/workflow"; import {getrecordformList, getrffieldList} from "@/api/mtm"; import {getwproductList, wproductPutin, createputins, testInit, scrap, getRetrial} from "@/api/wpm"; - import {getTestRecord, getTestRecordItem, putTestRecordItem, delTestRecordItem, subTestRecordItem} from "@/api/qm"; + import {getTestRecord, getTestRecordItem, putTestRecordItem, delTestRecordItem, subTestRecordItem,getTestRecordExport} from "@/api/qm"; import Pagination from "@/components/Pagination"; // secondary package based on el-pagination // import {saveAs} from "file-saver"; // import htmlDocx from "html-docx-js/dist/html-docx"; @@ -813,6 +813,7 @@ components: {Pagination, customForm, reviewForm, faceLogin}, data() { return { + exportFormId:null, testitem: defaultetestitem, formbcp: {}, form: {remark: "", warehouse: ""}, @@ -975,13 +976,17 @@ }, methods: { exportDom() { - htmlToPdf.downloadPDF(document.getElementById('pdfDom'), this.formName); - /* let dom = document.querySelector("#showForm .el-dialog"); - let str = dom.innerHTML; - debugger; - console.log(str); - let htmlStr = ` ${str}`; - saveAs(htmlDocx.asBlob(htmlStr, {orientation: "landscape"}), "报告.doc");*/ + // htmlToPdf.downloadPDF(document.getElementById('pdfDom'), this.formName); + getTestRecordExport(this.exportFormId).then(res=>{ + if(res.code===200){ + debugger; + console.log(res.data.path) + let link = document.createElement('a'); + link.href = 'http://49.232.14.174:2222'+res.data.path; + document.body.appendChild(link); + link.click(); + } + }) }, checkPermission, @@ -1379,6 +1384,7 @@ that.fieldList = []; that.create_by_ = scope.row.create_by_.name; that.update_time = scope.row.update_time; + that.exportFormId = scope.row.id; getTestRecordItem(scope.row.id).then((res) => { if (res.code >= 200) { that.recordFinishedVisible = true; From 0a6a9ed7296c52dd81c6a86590b4ca7a3fb85bb2 Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 21 Apr 2022 15:23:10 +0800 Subject: [PATCH 4/4] 0421 --- hb_client/src/views/mtm/materialdo.vue | 41 +++++++++++++++++++++-- hb_client/src/views/wpm/need.vue | 46 +++----------------------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/hb_client/src/views/mtm/materialdo.vue b/hb_client/src/views/mtm/materialdo.vue index 6a63650..a0ec526 100644 --- a/hb_client/src/views/mtm/materialdo.vue +++ b/hb_client/src/views/mtm/materialdo.vue @@ -113,6 +113,20 @@ + + + 上传模板 + + @@ -519,9 +533,8 @@ import {upFile} from "@/api/file"; import {genTree} from "@/utils"; import Pagination from "@/components/Pagination"; // secondary package based on el-pagination - import Treeselect from '@riophae/vue-treeselect' - import '@riophae/vue-treeselect/dist/vue-treeselect.css' - + import Treeselect from '@riophae/vue-treeselect'; + import '@riophae/vue-treeselect/dist/vue-treeselect.css'; const defaultstep = { name: "", number: "", @@ -709,6 +722,19 @@ }); }, methods: { + /* handlePreview(file) { + if ("url" in file) { + window.open(file.url); + } else { + window.open(file.response.data.path); + } + },*/ + handleUpSuccess(res) { + this.recordform.export_template = res.data.path; + }, + handleRemove() { + this.recordform.export_template = ''; + }, formFunc(value) { this.dialogVisibleForm = value; }, @@ -927,6 +953,14 @@ this.recordform = Object.assign({}, scope.row); // copy obj this.dialogType = "edit"; this.dialogVisible = true; + if (this.recordform.export_template) { + this.fileList = [ + { + name: this.recordform.export_template, + url: this.recordform.export_template, + }, + ]; + } this.$nextTick(() => { this.$refs["Forms"].clearValidate(); }); @@ -979,6 +1013,7 @@ obj.name=this.recordform.name; obj.type=this.recordform.type; obj.enabled=this.recordform.enabled; + obj.export_template=this.recordform.export_template?this.recordform.export_template:''; if (isEdit) { obj.form=this.recordform.form?this.recordform.form:null; updaterecordform(this.recordform.id, obj).then( diff --git a/hb_client/src/views/wpm/need.vue b/hb_client/src/views/wpm/need.vue index 3f4f087..b844f4e 100644 --- a/hb_client/src/views/wpm/need.vue +++ b/hb_client/src/views/wpm/need.vue @@ -713,47 +713,11 @@ -
-
{{formName}} -
-
-
- 操作人: - {{create_by_}} -
-
- 操作时间: - {{update_time}} -
-
-
- {{item.field_name}}: - {{item.field_value}} -
-
-
-
- {{item.field_name}}: - -
-
-
-
- - 导出 + 导出 +