8 changed files with 712 additions and 162 deletions
-
3src/api/production/abnormal.js
-
7src/api/schedule/com_feed_back_upload_file.js
-
39src/utils/httpRequest.js
-
331src/views/modules/knifemold/tool-info.vue
-
43src/views/modules/knifemold/toolOperatorRecord.vue
-
108src/views/modules/print/label/print_tool_label_preview.js
-
202src/views/modules/schedule/abnormalFeedBack.vue
-
141src/views/modules/schedule/feed_back_upload_file.vue
@ -0,0 +1,7 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
/*图片上传*/ |
|||
export const uploadFeedBackFile = data => createAPI('/sys/file/upload','post',data) |
|||
|
|||
/*查询设备的文件内容*/ |
|||
export const getFileContentList = data => createAPI('sys/file/getSysFileByOrderRef2','post',data) |
|||
@ -0,0 +1,108 @@ |
|||
/*调用js打印标签*/ |
|||
import getLodop from '@/utils/LodopFuncs.js' |
|||
/*打印材料卷标签*/ |
|||
export function printToolLabelPreview(printList) { |
|||
const LODOP = getLodop() |
|||
if (LODOP) { |
|||
//LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", "");
|
|||
LODOP.SET_LICENSES("", "AF8A5800B823CC8E18BCF67B925E7BF0", "", ""); |
|||
// LODOP.SET_PRINTER_INDEXA("小标签打印机");
|
|||
//循环调用打印机
|
|||
for(let i = 0; i < printList.length; i++){ |
|||
let printData = printList[i]; |
|||
LODOP.NewPage(); |
|||
|
|||
LODOP.PRINT_INIT(""); |
|||
LODOP.SET_PRINT_PAGESIZE(0,750,200,""); |
|||
LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); |
|||
LODOP.ADD_PRINT_BARCODE(6,205,189,88,"QRCode",printData.toolInstanceId); |
|||
LODOP.ADD_PRINT_TEXT(0,3,76,28,"工具编码"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(0,80,119,28,printData.toolId); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(20,3,76,28,"实例编码"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(20,80,119,28,printData.toolInstanceId); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(39,3,76,28,"工具规格"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(40,80,119,28,printData.spec); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(58,3,76,28,"仓库/库位"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_TEXT(58,80,119,28,printData.locationId); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontName","微软雅黑"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.ADD_PRINT_RECT(0,0,198,75,0,1); |
|||
LODOP.ADD_PRINT_LINE(18,1,19,198,0,1); |
|||
LODOP.ADD_PRINT_LINE(38,1,39,198,0,1); |
|||
LODOP.ADD_PRINT_LINE(57,0,58,197,0,1); |
|||
LODOP.ADD_PRINT_LINE(79,72,2,73,0,1); |
|||
} |
|||
LODOP.PRINT_DESIGN(); |
|||
// LODOP.PREVIEW();
|
|||
// LODOP.PRINT();
|
|||
console.log(printList) |
|||
} |
|||
} |
|||
|
|||
// LODOP.SET_PRINT_PAGESIZE(0,1000,700,"");
|
|||
// LODOP.ADD_PRINT_BARCODE(11,244,208,140,"QRCode",printData.seqNo);
|
|||
// LODOP.ADD_PRINT_TEXT(58,8,108,25,"WareHouseId:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(58,110,140,25,printData.wareHouseId);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(111,8,77,24,"BatchNo:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(111,110,140,20,printData.batchNo);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(84,8,98,25,"LocationId:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(84,110,139,25,printData.locationId);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(9,8,72,25,"PartNo:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(9,110,136,25,printData.partNo);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(136,8,82,25,"OrderNo:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(136,110,141,25,printData.orderNo);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(34,8,56,25,"Qty:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(34,110,138,24,printData.qty);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(162,8,92,25,"TransDate:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(162,110,170,25,printData.transDate);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Bold",1);
|
|||
// LODOP.ADD_PRINT_TEXT(192,5,256,24,"Manufactured by A&M Polymer");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.ADD_PRINT_TEXT(192,259,109,25,"vender Code:");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.ADD_PRINT_TEXT(210,5,257,35,"No.188 Taigu Road,Lili lndustrial Park,Wujiang District,Suzhou,China");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.ADD_PRINT_TEXT(246,5,407,35,"Phone: 086-0512-63678826 Email: service@husenrubber.com");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.ADD_PRINT_LINE(186,2,187,374,0,1);
|
|||
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="生产订单:" > |
|||
<el-input v-model="pageData.orderNo" style="width: 120px;" disabled ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="派工单号:" > |
|||
<el-input v-model="pageData.seqNo" style="width: 120px;" disabled ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-upload class="customer-upload" drag |
|||
action="javascript:void(0);" ref="uploadFile" :limit="1" |
|||
:before-upload="beforeUploadHandle" :on-change="onChange" |
|||
accept="*" :auto-upload="false" |
|||
style="text-align: left;"> |
|||
<i class="el-icon-upload"></i> |
|||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|||
</el-upload> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24" style="margin-bottom: 30px;"> |
|||
<el-form-item class="customer-item" label="备注:" > |
|||
<el-input type="textarea" style="width: 360px;" placeholder="请输入内容" v-model="pageData.fileRemark"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
</el-row> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveUploadFile()">保存</el-button> |
|||
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
uploadFeedBackFile, |
|||
} from '@/api/schedule/com_feed_back_upload_file.js'; |
|||
|
|||
/* 引入组件 */ |
|||
var functionId = 'C10000002'; |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
titleCon: '异常反馈文件上传', |
|||
visible: false, |
|||
folder: '', |
|||
fileList: [], |
|||
pageData: { |
|||
site: '', |
|||
username: '', |
|||
id: '', |
|||
orderNo: '', |
|||
seqNo: '', |
|||
fileRemark: '', |
|||
folder: '', |
|||
}, |
|||
dataListLoading: false, |
|||
} |
|||
}, |
|||
methods: { |
|||
//初始化组件的参数 |
|||
init(currentRow) { |
|||
//初始化参数 |
|||
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
|||
this.folder = this.pageData.folder |
|||
//打开页面 |
|||
this.visible = true |
|||
}, |
|||
// 上传之前 |
|||
beforeUploadHandle(file) { |
|||
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
|||
// this.$message.error('只支持图片和PDF文档!') |
|||
// return false |
|||
// } |
|||
// this.num++ |
|||
}, |
|||
/*选择上传文件时*/ |
|||
onChange(file){ |
|||
this.fileList.push(file); |
|||
}, |
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
this.fileList = []; |
|||
// 刷新报工的页面 |
|||
this.$emit('refreshPageTables'); |
|||
//关闭当前的页面 |
|||
this.visible = false; |
|||
}, |
|||
/*保修当前的数据*/ |
|||
saveUploadFile(){ |
|||
let remark = this.pageData.fileRemark; |
|||
if(null == remark || remark == undefined){ |
|||
remark = '' |
|||
} |
|||
/*判断文件是否上传*/ |
|||
if(null == this.fileList || 0 === this.fileList.length){ |
|||
this.$message.error("请先上传文件!"); |
|||
return false; |
|||
} |
|||
const formData = new FormData(); |
|||
//片接文件 |
|||
formData.append("file", this.fileList[0].raw); |
|||
formData.append("folder", this.folder); |
|||
formData.append("site", this.pageData.site); |
|||
formData.append("id", this.pageData.id); |
|||
formData.append("remark", remark); |
|||
uploadFeedBackFile(formData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.$message.success(data.msg); |
|||
//清空文件上传记录 |
|||
this.$refs.uploadFile.clearFiles(); |
|||
this.pageData.fileRemark = ''; |
|||
this.fileList = []; |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue