Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2022-04-22 08:38:34 +08:00
commit 309b9f3b20
6 changed files with 117 additions and 105 deletions

View File

@ -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'

View File

@ -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({

View File

@ -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',

View File

@ -113,6 +113,20 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="表单模板" prop="template">
<el-upload
ref="upload"
:action="upUrl"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".docx"
>
<el-button size="small" type="primary">上传模板</el-button>
</el-upload>
</el-form-item>
<el-form-item label="是否启用" prop="name">
<el-switch v-model="recordform.enabled"></el-switch>
</el-form-item>
@ -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(

View File

@ -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 {
},
},
};
</script>
</script>

View File

@ -713,47 +713,11 @@
</el-dialog>
<!--已完成检查表查看-->
<el-dialog
:title="formName"
:visible.sync="recordFinishedVisible"
:close-on-click-modal="false"
id="showForm"
>
<div id="pdfDom" class="report" ref="report" style="padding: 30px;">
<div style="height: 40px;line-height:40px;text-align: center;font-size: 20px;font-weight: bold">{{formName}}
</div>
<div style="overflow: hidden;border-top: 1px solid #000000;border-left: 1px solid #000000;
border-right: 1px solid #000000;box-sizing: border-box">
<div
style="height: 40px;line-height: 40px;padding-left: 20px;width: 50%;float: left;border-right: 1px solid #000000;border-bottom: 1px solid #000000;">
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">操作人</span>
<span>{{create_by_}}</span>
</div>
<div
style="height: 40px;line-height: 40px;padding-left: 20px;width: 50%;float: left;border-right: 1px solid #000000;border-bottom: 1px solid #000000;">
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">操作时间</span>
<span>{{update_time}}</span>
</div>
<div v-for="item in fieldList" :key="item.id" style="width: 50%;display: inline-block;float: left;">
<div
v-if="item.field_type!=='draw'&&item.field_value!==null&&item.field_value!==''"
style="height: 40px;line-height: 40px;padding-left: 20px;border-right: 1px solid #000000;border-bottom: 1px solid #000000;"
>
<span
style="width: 150px;display: inline-block;font-size: 14px;color: #606266;font-weight: 600;border-right: 1px solid #000000;">{{item.field_name}}</span>
<span>{{item.field_value}}</span>
</div>
</div>
<div v-for="item in fieldList" :key="item.id" style="width: 100%;display: inline-block;float: left;">
<div v-if="item.field_type==='draw'"
style="height: 400px;border-bottom: 1px solid #000000;border-right: 1px solid #000000;">
<span style="font-size: 14px;color: #606266;font-weight: 600;">{{item.field_name}}</span>
<img style="width: 45%;vertical-align: text-top;" :src="'http://49.232.14.174:2222'+item.field_value"/>
</div>
</div>
</div>
</div>
<!--<el-row id="pdfDom">
<el-row>
<el-col :span="12">
<div class="items">
<span class="itemLabel">操作人</span>
@ -773,13 +737,13 @@
</div>
</el-col>
<el-col v-for="item in fieldList" :key="item.id" :span="24">
<div class="items" v-if="item.field_type==='draw'" style="height: 400px">
<div class="items" v-if="item.field_type==='draw'" style="height: fit-content">
<span class="itemLabel">{{item.field_name}}</span>
<img style="width: 45%;vertical-align: text-top;" :src="'http://49.232.14.174:2222'+item.field_value"/>
</div>
</el-col>
</el-row>-->
<el-button @click="exportDom">导出</el-button>
<el-button @click="exportDom">导出</el-button>
</el-row>
</el-dialog>
<!--刷脸验证-->
<el-dialog :visible.sync="limitedPhoto" @close="closeCamera" id="loginFaceWrap">
@ -801,7 +765,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 +777,7 @@
components: {Pagination, customForm, reviewForm, faceLogin},
data() {
return {
exportFormId:null,
testitem: defaultetestitem,
formbcp: {},
form: {remark: "", warehouse: ""},
@ -975,13 +940,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 = `<!DOCTYPE html><html lang="en"><body> ${str}</body></html>`;
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 +1348,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;