From 7c95c7f123acd5cf906177fa9e33d070f7c44c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=89=E6=BA=90?= <1976974459@qq.com> Date: Thu, 27 Jul 2023 12:33:32 +0800 Subject: [PATCH] =?UTF-8?q?2023-07-27=20=E5=BC=82=E5=B8=B8=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/production/abnormal.js | 3 + src/api/schedule/com_feed_back_upload_file.js | 7 + src/utils/httpRequest.js | 39 +++ src/views/modules/knifemold/tool-info.vue | 331 ++++++++++-------- .../modules/knifemold/toolOperatorRecord.vue | 43 ++- .../print/label/print_tool_label_preview.js | 108 ++++++ .../modules/schedule/abnormalFeedBack.vue | 202 ++++++++++- .../schedule/feed_back_upload_file.vue | 141 ++++++++ 8 files changed, 712 insertions(+), 162 deletions(-) create mode 100644 src/api/schedule/com_feed_back_upload_file.js create mode 100644 src/views/modules/print/label/print_tool_label_preview.js create mode 100644 src/views/modules/schedule/feed_back_upload_file.vue diff --git a/src/api/production/abnormal.js b/src/api/production/abnormal.js index aa17604..2878c3e 100644 --- a/src/api/production/abnormal.js +++ b/src/api/production/abnormal.js @@ -7,3 +7,6 @@ export const saveAbnormalData=data => createAPI(`abnormal/saveAbnormalData`, 'po export const saveAbnormalDetail=data => createAPI(`abnormal/saveAbnormalDetail`, 'post', data); export const openFeedBack=data => createAPI(`abnormal/openFeedBack`, 'post', data); export const closeFeedBack=data => createAPI(`abnormal/closeFeedBack`, 'post', data); +export const deleteObjectFile= data => createAPI(`abnormal/deleteObjectFile`,'post',data) +export const downLoadObjectFile = data => createAPI(`abnormal/downLoadObjectFile?id=`+data.id,'post',777) + diff --git a/src/api/schedule/com_feed_back_upload_file.js b/src/api/schedule/com_feed_back_upload_file.js new file mode 100644 index 0000000..b47b979 --- /dev/null +++ b/src/api/schedule/com_feed_back_upload_file.js @@ -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) diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index bde06a6..b1ce6ed 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -111,7 +111,39 @@ instance.interceptors.response.use(response => { return Promise.reject(error) }) +// ============================= 下载功能的请求 ============================= +const instance2 = axios.create({ + baseURL: (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl), + timeout: 10000 * 30, + withCredentials: true, + responseType: 'blob', + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } +}) +/** + * 请求拦截 + */ +instance2.interceptors.request.use(config => { + config.headers['token'] = Vue.cookie.get('token') // 请求头带上token + return config +}, error => { + return Promise.reject(error) +}) + +/** + * 响应拦截 + */ +instance2.interceptors.response.use(response => { + if (response.data && response.data.code === 401) { // 401, token失效 + clearLoginInfo() + router.push({name: 'login'}) + } + return response +}, error => { + return Promise.reject(error) +}) export const createAPI = (url, method, data) => { @@ -121,6 +153,13 @@ export const createAPI = (url, method, data) => { } else { config.data = data } + if (data === 777){ // 下载功能的请求 + return instance2({ + url, + method, + ...config + }) + } return instance({ url, method, diff --git a/src/views/modules/knifemold/tool-info.vue b/src/views/modules/knifemold/tool-info.vue index 8c754c9..29388e0 100644 --- a/src/views/modules/knifemold/tool-info.vue +++ b/src/views/modules/knifemold/tool-info.vue @@ -80,7 +80,7 @@ 复制 编辑 工具标签 - 网版 + @@ -300,11 +300,12 @@ + style="width: 100%;" + :key="myTable"> @@ -472,6 +473,9 @@ import { } from '@/api/knifemold/tool-info.js' import {printToolData} from '@/api/knifemold/receive.js' import {searchProcessRouteTool} from '@/api/base/productProcessRoute.js' +import { + printToolLabelPreview, +} from "@/views/modules/print/label/print_tool_label_preview.js" var functionId = '106001003' export default { components: { @@ -508,36 +512,36 @@ export default { actualUseQty: 0, createDate: '', createdBy: this.$store.state.user.name, - description: null, + description: '', estUseQty: 0, - inspectDuration: null, - lastUpdateBy: null, - latestInspectDate: null, - latestUseDate: null, - locationId: null, + inspectDuration: '', + lastUpdateBy: '', + latestInspectDate: '', + latestUseDate: '', + locationId: '', phaseInDate: '', phaseOutDate: '', purchaseDate: '', remark: '', site: this.$store.state.user.site, status: '', - statusRef: null, - steelSeal: null, + statusRef: '', + steelSeal: '', strCreateDate: '', - strLatestInspectDate: null, - strLatestUseDate: null, + strLatestInspectDate: '', + strLatestUseDate: '', strPhaseInDate: '', strPhaseOutDate: '', strPurchaseDate: '', supplierId: '', supplierName: '', - toolDescription: null, + toolDescription: '', toolId: '', - toolIndex: null, + toolIndex: '', toolInstanceId: '', - torNumacc: null, - torNumdown: null, - workCenterNo: null + torNumacc: '', + torNumdown: '', + workCenterNo: '' }, setUp: { toolEditFlag: false, @@ -610,49 +614,49 @@ export default { detailList: [], headerData: { active: '', - codeNo: null, + codeNo: '', createDate: '', createdBy: '', - defaultLocationId: null, - defaultWarehouseId: null, - familyId: null, - familyName: null, - lastUpdateBy: null, - partCreatedFlag: null, - partNo: null, - remark: null, + defaultLocationId: '', + defaultWarehouseId: '', + familyId: '', + familyName: '', + lastUpdateBy: '', + partCreatedFlag: '', + partNo: '', + remark: '', site: this.$store.state.user.site, - spec: null, - standardCost: null, + spec: '', + standardCost: '', strActive: '', strCreateDate: '', strPartCreated: '', toolDescription: '', toolId: '', - umid: null + umid: '' }, editHeaderData: { active: '', - codeNo: null, + codeNo: '', createDate: '', createdBy: '', - defaultLocationId: null, - defaultWarehouseId: null, - familyId: null, - familyName: null, - lastUpdateBy: null, - partCreatedFlag: null, - partNo: null, - remark: null, + defaultLocationId: '', + defaultWarehouseId: '', + familyId: '', + familyName: '', + lastUpdateBy: '', + partCreatedFlag: '', + partNo: '', + remark: '', site: this.$store.state.user.site, - spec: null, - standardCost: null, + spec: '', + standardCost: '', strActive: '', strCreateDate: '', strPartCreated: '', toolDescription: '', toolId: '', - umid: null + umid: '' }, site: this.$store.state.user.site, // table高度 @@ -1075,7 +1079,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1120,6 +1124,18 @@ export default { status: true, fixed: false }, + { + columnProp: 'supplierName', + headerAlign: 'center', + align: 'center', + columnLabel: '供应商名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false + }, { columnProp: 'remark', headerAlign: 'center', @@ -1185,7 +1201,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1233,7 +1249,7 @@ export default { { columnProp: 'transPrice', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '维修金额', columnHidden: false, columnImage: false, @@ -1307,7 +1323,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1344,7 +1360,19 @@ export default { columnProp: 'supplierId', headerAlign: 'center', align: 'center', - columnLabel: '借用部门', + columnLabel: '借用部门编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false + }, + { + columnProp: 'supplierName', + headerAlign: 'center', + align: 'center', + columnLabel: '借用部门名称', columnHidden: false, columnImage: false, columnSortable: false, @@ -1417,7 +1445,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1515,7 +1543,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1560,6 +1588,18 @@ export default { status: true, fixed: false }, + { + columnProp: 'supplierName', + headerAlign: 'center', + align: 'center', + columnLabel: '机台名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false + }, { columnProp: 'remark', headerAlign: 'center', @@ -1625,7 +1665,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -1706,7 +1746,8 @@ export default { status: true, fixed: false } - ] + ], + myTable: 0 } }, watch: { @@ -1755,7 +1796,7 @@ export default { /** * 工具实例操作记录内容改变事件 */ - toolOperatorChange() { + async toolOperatorChange() { let queryData = { limit: this.pageSize, page: this.pageIndex, @@ -1763,22 +1804,26 @@ export default { site: this.site, toolInstanceId: this.currentDetailData.toolInstanceId } - queryToolOperatorRecord(queryData).then(({data}) => { + await queryToolOperatorRecord(queryData).then(({data}) => { if (data.code === 0) { if (queryData.typeFlag === 'TR' || queryData.typeFlag === 'TJF' || queryData.typeFlag === 'TB' || queryData.typeFlag === 'TLF') { - this.toolColumnList = this.toolBorrowingReturnList; + this.toolColumnList = this.toolBorrowingReturnList } else if (queryData.typeFlag === 'TW') { - this.toolColumnList = this.toolRepairList; + this.toolColumnList = this.toolRepairList } else if (queryData.typeFlag === 'TWF') { - this.toolColumnList = this.toolRepairReturnList; + this.toolColumnList = this.toolRepairReturnList } else if (queryData.typeFlag === 'TJ') { - this.toolColumnList = this.toolBorrowingList; + this.toolColumnList = this.toolBorrowingList } else if (queryData.typeFlag === 'TC') { - this.toolColumnList = this.toolOutOfLibraryList; + this.toolColumnList = this.toolOutOfLibraryList } else if (queryData.typeFlag === 'TL') { - this.toolColumnList = this.toolRequisitionList; + this.toolColumnList = this.toolRequisitionList } this.toolOperatorDataList = data.page.list + this.pageIndex = data.page.currPage + this.pageSize = data.page.pageSize + this.totalPage = data.page.totalCount + this.myTable++ } }) }, @@ -1859,89 +1904,97 @@ export default { toolInstanceId: this.currentDetailData.toolInstanceId } printDataList.push(printData) - if (val === 'Y') { - this.labelPrintGJ(printDataList) - } else { - this.labelPrintWB(printDataList) - } + this.labelPrintGJ(printDataList) } }) }, - labelPrintWB(printDataList) { - const LODOP = getLodop() - if (LODOP) { - // 循环调用打印机 - for (let i = 0; i < printDataList.length; i++) { - let printData = printDataList[i] - LODOP.NewPage() - LODOP.SET_PRINT_PAGESIZE(0, 700, 180, '') - LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1) - LODOP.ADD_PRINT_RECT(2, 5, 250, 67, 0, 1) - LODOP.ADD_PRINT_LINE(19, 5, 18, 255, 0, 1) - LODOP.ADD_PRINT_LINE(36, 5, 35, 205, 0, 1) - LODOP.ADD_PRINT_LINE(54, 5, 53, 205, 0, 1) - LODOP.ADD_PRINT_LINE(2, 65, 69, 66, 0, 1) - LODOP.ADD_PRINT_LINE(68, 205, 18, 206, 0, 1) - LODOP.ADD_PRINT_BARCODE(21, 208, 90, 60, 'QRCode', printData.toolInstanceId) - LODOP.ADD_PRINT_TEXT(5, 9, 60, 14, '工具名称') - LODOP.ADD_PRINT_TEXT(21, 9, 60, 15, '工具编号') - LODOP.ADD_PRINT_TEXT(38, 9, 60, 15, '实例编号') - LODOP.ADD_PRINT_TEXT(55, 9, 60, 15, '经办人') - LODOP.ADD_PRINT_TEXT(4, 70, 180, 14, printData.toolDescription) - LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) - LODOP.ADD_PRINT_TEXT(21, 71, 133, 14, printData.toolId) - LODOP.ADD_PRINT_TEXT(39, 71, 133, 14, printData.toolInstanceId) - LODOP.ADD_PRINT_TEXT(55, 71, 133, 14, printData.createdBy) - } - LODOP.PREVIEW() - } - }, - labelPrintGJ(printDataList) { - const LODOP = getLodop() - if (LODOP) { - // 循环调用打印机 - for (let i = 0; i < printDataList.length; i++) { - let printData = printDataList[i] - LODOP.NewPage() - LODOP.SET_PRINT_PAGESIZE(0, 700, 540, '') - LODOP.ADD_PRINT_RECT(6, 5, 250, 190, 0, 1) - LODOP.ADD_PRINT_LINE(24, 5, 23, 255, 0, 1) - LODOP.ADD_PRINT_LINE(41, 5, 40, 255, 0, 1) - LODOP.ADD_PRINT_LINE(58, 5, 57, 255, 0, 1) - LODOP.ADD_PRINT_LINE(75, 5, 74, 255, 0, 1) - LODOP.ADD_PRINT_LINE(92, 5, 91, 255, 0, 1) - LODOP.ADD_PRINT_LINE(109, 5, 108, 255, 0, 1) - LODOP.ADD_PRINT_LINE(126, 5, 125, 178, 0, 1) - LODOP.ADD_PRINT_LINE(144, 5, 143, 178, 0, 1) - LODOP.ADD_PRINT_LINE(162, 5, 161, 178, 0, 1) - LODOP.ADD_PRINT_LINE(179, 5, 178, 255, 0, 1) - LODOP.ADD_PRINT_LINE(23, 65, 195, 66, 0, 1) - LODOP.ADD_PRINT_LINE(178, 177, 108, 178, 0, 1) - LODOP.ADD_PRINT_BARCODE(110, 183, 110, 85, 'QRCode', printData.toolInstanceId) - LODOP.ADD_PRINT_TEXT(9, 94, 100, 14, '工具标签') - LODOP.SET_PRINT_STYLEA(0, 'Bold', 1) - LODOP.ADD_PRINT_TEXT(26, 9, 60, 14, '工具名称') - LODOP.ADD_PRINT_TEXT(43, 9, 60, 15, '规格型号') - LODOP.ADD_PRINT_TEXT(60, 9, 60, 15, '工具编号') - LODOP.ADD_PRINT_TEXT(77, 9, 60, 15, '实例编号') - LODOP.ADD_PRINT_TEXT(94, 9, 60, 15, '厂商') - LODOP.ADD_PRINT_TEXT(111, 9, 60, 15, '入库日期') - LODOP.ADD_PRINT_TEXT(129, 9, 60, 15, '库位') - LODOP.ADD_PRINT_TEXT(147, 9, 60, 15, '经办人') - LODOP.ADD_PRINT_TEXT(181, 9, 60, 15, '检验签章') - LODOP.ADD_PRINT_TEXT(25, 72, 180, 14, printData.toolDescription) - LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) - LODOP.ADD_PRINT_TEXT(42, 72, 180, 14, printData.spec) // 规格 - LODOP.ADD_PRINT_TEXT(60, 72, 180, 14, printData.toolId) - LODOP.ADD_PRINT_TEXT(78, 71, 180, 14, printData.toolInstanceId) - LODOP.ADD_PRINT_TEXT(94, 71, 180, 14, printData.SupplierName) - LODOP.ADD_PRINT_TEXT(111, 71, 95, 14, this.dayjs(printData.createDate).format('YYYY-MM-DD')) - LODOP.ADD_PRINT_TEXT(130, 71, 95, 14, printData.locationId) - LODOP.ADD_PRINT_TEXT(148, 71, 95, 14, printData.createdBy) - } - LODOP.PREVIEW() + labelPrintGJ(row) { + let array = []; + let data = { + toolId: row[0].toolId, + toolInstanceId: row[0].toolInstanceId, + spec: row[0].spec, + locationId: row[0].locationId } + array.push(data) + console.log(array) + printToolLabelPreview(array); }, + // labelPrintWB(printDataList) { + // const LODOP = getLodop() + // if (LODOP) { + // // 循环调用打印机 + // for (let i = 0; i < printDataList.length; i++) { + // let printData = printDataList[i] + // LODOP.NewPage() + // LODOP.SET_PRINT_PAGESIZE(0, 700, 180, '') + // LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1) + // LODOP.ADD_PRINT_RECT(2, 5, 250, 67, 0, 1) + // LODOP.ADD_PRINT_LINE(19, 5, 18, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(36, 5, 35, 205, 0, 1) + // LODOP.ADD_PRINT_LINE(54, 5, 53, 205, 0, 1) + // LODOP.ADD_PRINT_LINE(2, 65, 69, 66, 0, 1) + // LODOP.ADD_PRINT_LINE(68, 205, 18, 206, 0, 1) + // LODOP.ADD_PRINT_BARCODE(21, 208, 90, 60, 'QRCode', printData.toolInstanceId) + // LODOP.ADD_PRINT_TEXT(5, 9, 60, 14, '工具名称') + // LODOP.ADD_PRINT_TEXT(21, 9, 60, 15, '工具编号') + // LODOP.ADD_PRINT_TEXT(38, 9, 60, 15, '实例编号') + // LODOP.ADD_PRINT_TEXT(55, 9, 60, 15, '经办人') + // LODOP.ADD_PRINT_TEXT(4, 70, 180, 14, printData.toolDescription) + // LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) + // LODOP.ADD_PRINT_TEXT(21, 71, 133, 14, printData.toolId) + // LODOP.ADD_PRINT_TEXT(39, 71, 133, 14, printData.toolInstanceId) + // LODOP.ADD_PRINT_TEXT(55, 71, 133, 14, printData.createdBy) + // } + // LODOP.PREVIEW() + // } + // }, + // labelPrintGJ(printDataList) { + // const LODOP = getLodop() + // if (LODOP) { + // // 循环调用打印机 + // for (let i = 0; i < printDataList.length; i++) { + // let printData = printDataList[i] + // LODOP.NewPage() + // LODOP.SET_PRINT_PAGESIZE(0, 700, 540, '') + // LODOP.ADD_PRINT_RECT(6, 5, 250, 190, 0, 1) + // LODOP.ADD_PRINT_LINE(24, 5, 23, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(41, 5, 40, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(58, 5, 57, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(75, 5, 74, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(92, 5, 91, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(109, 5, 108, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(126, 5, 125, 178, 0, 1) + // LODOP.ADD_PRINT_LINE(144, 5, 143, 178, 0, 1) + // LODOP.ADD_PRINT_LINE(162, 5, 161, 178, 0, 1) + // LODOP.ADD_PRINT_LINE(179, 5, 178, 255, 0, 1) + // LODOP.ADD_PRINT_LINE(23, 65, 195, 66, 0, 1) + // LODOP.ADD_PRINT_LINE(178, 177, 108, 178, 0, 1) + // LODOP.ADD_PRINT_BARCODE(110, 183, 110, 85, 'QRCode', printData.toolInstanceId) + // LODOP.ADD_PRINT_TEXT(9, 94, 100, 14, '工具标签') + // LODOP.SET_PRINT_STYLEA(0, 'Bold', 1) + // LODOP.ADD_PRINT_TEXT(26, 9, 60, 14, '工具名称') + // LODOP.ADD_PRINT_TEXT(43, 9, 60, 15, '规格型号') + // LODOP.ADD_PRINT_TEXT(60, 9, 60, 15, '工具编号') + // LODOP.ADD_PRINT_TEXT(77, 9, 60, 15, '实例编号') + // LODOP.ADD_PRINT_TEXT(94, 9, 60, 15, '厂商') + // LODOP.ADD_PRINT_TEXT(111, 9, 60, 15, '入库日期') + // LODOP.ADD_PRINT_TEXT(129, 9, 60, 15, '库位') + // LODOP.ADD_PRINT_TEXT(147, 9, 60, 15, '经办人') + // LODOP.ADD_PRINT_TEXT(181, 9, 60, 15, '检验签章') + // LODOP.ADD_PRINT_TEXT(25, 72, 180, 14, printData.toolDescription) + // LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2) + // LODOP.ADD_PRINT_TEXT(42, 72, 180, 14, printData.spec) // 规格 + // LODOP.ADD_PRINT_TEXT(60, 72, 180, 14, printData.toolId) + // LODOP.ADD_PRINT_TEXT(78, 71, 180, 14, printData.toolInstanceId) + // LODOP.ADD_PRINT_TEXT(94, 71, 180, 14, printData.SupplierName) + // LODOP.ADD_PRINT_TEXT(111, 71, 95, 14, this.dayjs(printData.createDate).format('YYYY-MM-DD')) + // LODOP.ADD_PRINT_TEXT(130, 71, 95, 14, printData.locationId) + // LODOP.ADD_PRINT_TEXT(148, 71, 95, 14, printData.createdBy) + // } + // LODOP.PREVIEW() + // } + // }, getBaseData(val) { if (this.tagNo === 70) { this.headerData.toolId = val.ToolID @@ -1977,6 +2030,7 @@ export default { if (val === 7) { strVal = this.editHeaderData.umid } + console.log(this.editHeaderData.familyId) this.$refs.baseList.init(val, strVal) }) }, @@ -2059,7 +2113,6 @@ export default { } }, saveAndUpdateToolHeader() { - console.log(this.$store.state.user.site) if (!this.editHeaderData.toolId) { this.$message.warning('工具编号不能为空,请选择') return diff --git a/src/views/modules/knifemold/toolOperatorRecord.vue b/src/views/modules/knifemold/toolOperatorRecord.vue index 1717736..f25f2d7 100644 --- a/src/views/modules/knifemold/toolOperatorRecord.vue +++ b/src/views/modules/knifemold/toolOperatorRecord.vue @@ -53,7 +53,8 @@ :data="dataList" border v-loading="dataListLoading" - style="width: 100%;"> + style="width: 100%;" + :key="myTable"> @@ -75,7 +76,7 @@ @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" - :page-sizes="[100, 200, 500]" + :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> @@ -105,7 +106,7 @@ export default { typeFlag: 'TR' }, pageIndex: 1, - pageSize: 100, + pageSize: 20, totalPage: 0, // 数据集 dataList: [], @@ -146,7 +147,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -268,7 +269,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -316,7 +317,7 @@ export default { { columnProp: 'transPrice', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '维修金额', columnHidden: false, columnImage: false, @@ -390,7 +391,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -427,7 +428,19 @@ export default { columnProp: 'supplierId', headerAlign: 'center', align: 'center', - columnLabel: '借用部门', + columnLabel: '借用部门编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false + }, + { + columnProp: 'supplierName', + headerAlign: 'center', + align: 'center', + columnLabel: '借用部门名称', columnHidden: false, columnImage: false, columnSortable: false, @@ -500,7 +513,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -598,7 +611,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -720,7 +733,7 @@ export default { { columnProp: 'transQty', headerAlign: 'center', - align: 'center', + align: 'right', columnLabel: '出入库数量', columnHidden: false, columnImage: false, @@ -801,7 +814,8 @@ export default { status: true, fixed: false } - ] + ], + myTable: 0 } }, created () { @@ -826,7 +840,6 @@ export default { * 查询基础数据 */ getDataList () { - this.dataListLoading = true this.queryTool.limit = this.pageSize this.queryTool.page = this.pageIndex queryToolOperatorRecord (this.queryTool).then(({data}) => { @@ -848,8 +861,8 @@ export default { this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount + this.myTable++ } - this.dataListLoading = false }) }, // --------- 分页 ---------- diff --git a/src/views/modules/print/label/print_tool_label_preview.js b/src/views/modules/print/label/print_tool_label_preview.js new file mode 100644 index 0000000..d8fed72 --- /dev/null +++ b/src/views/modules/print/label/print_tool_label_preview.js @@ -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); diff --git a/src/views/modules/schedule/abnormalFeedBack.vue b/src/views/modules/schedule/abnormalFeedBack.vue index f26b508..7d221fd 100644 --- a/src/views/modules/schedule/abnormalFeedBack.vue +++ b/src/views/modules/schedule/abnormalFeedBack.vue @@ -210,15 +210,21 @@ + + 上传文件 + + + 文件清单 + - + - + @@ -227,6 +233,46 @@ + + + + + + + + + + + + + + + @@ -239,13 +285,18 @@ saveAbnormalDetail, openFeedBack, closeFeedBack, - + deleteObjectFile, + downLoadObjectFile } from "@/api/production/abnormal.js" + import {getFileContentList} from '@/api/schedule/com_feed_back_upload_file.js' + import feedBackUploadFile from "./feed_back_upload_file" export default { + components: { + feedBackUploadFile + }, name: 'AbnormalFeedBack', data () { return { - searchData:{ userId:this.$store.state.user.name, startDate:'', @@ -289,16 +340,65 @@ abnormalCode:'', abnormalRemark:'', }, - addModalFlag:false, modalFlag:false, disableFlag4:false, disableFlag1:false, disableFlag2:false, abnormalList:[], - abnormalFeedBackData:{ - - }, + abnormalFeedBackData:{}, + fileContentList: [], + fileFlag: false, + fileColumnList: [ + { + columnProp: 'fileName', + headerAlign: "center", + align: "center", + columnLabel: '文件名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + columnProp: 'createdBy', + headerAlign: "center", + align: 'center', + columnLabel: '上传人', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: false + }, + { + columnProp: 'createDate', + headerAlign: "center", + align: 'center', + columnLabel: '上传时间', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: false + }, + { + columnProp: 'orderRef2', + headerAlign: "center", + align: 'center', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: false + }, + ], } }, mounted() { @@ -403,6 +503,92 @@ this.disableFlag4=true; this.modalFlag=true; }, + /** + * 新增文件的modal + */ + addUploadFileModal(){ + let currentData = { + site: this.$store.state.user.site, + username: this.$store.state.user.name, + id: this.abnormalFeedBackData.id, + orderNo: this.abnormalFeedBackData.orderNo, + seqNo: this.abnormalFeedBackData.seqNo, + folder: 'abnormalFeedBack', + fileRemark: '' + }; + //打开组件 去做新增业务 + this.$nextTick(() => { + this.$refs.feedBackUploadFile.init(currentData); + }) + }, + /** + * 刷新派设备文档的列表 + */ + getFileContentData() { + let currentData = { + orderRef1: this.abnormalFeedBackData.id, + }; + getFileContentList(currentData).then(({data}) => { + //区分请求成功和失败的状况 + if (data && data.code === 200) { + this.fileContentList = data.rows; + } else { + this.fileContentList = []; + } + }) + this.fileFlag = true; + }, + /** + * 删除文件 + * @param row + */ + deleteFile(row){ + this.$confirm('确定要删除此文件?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteObjectFile(row).then(({data}) => { + if (data && data.code === 0) { + this.getFileContentData(row); + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + downloadFile(row){ + downLoadObjectFile(row) + .then(({data}) => { + // 不限制文件下载类型 + const blob = new Blob([data], {type: "application/octet-stream"}) + // 下载文件名称 + const fileName = row.fileName + // a标签下载 + const linkNode = document.createElement('a') + // a标签的download属性规定下载文件的名称 + linkNode.download = fileName + linkNode.style.display = 'none' + // 生成一个Blob URL + linkNode.href = URL.createObjectURL(blob) + document.body.appendChild(linkNode) + // 模拟在按钮上的一次鼠标单击 + linkNode.click() + // 释放URL 对象 + URL.revokeObjectURL(linkNode.href) + document.body.removeChild(linkNode) + }) + }, saveAbnormalDetail(){ if( this.abnormalFeedBackData.processingResult==''&&this.abnormalFeedBackData.processingResult==null){ this.$alert("请填写处理结果", '错误', { diff --git a/src/views/modules/schedule/feed_back_upload_file.vue b/src/views/modules/schedule/feed_back_upload_file.vue new file mode 100644 index 0000000..066f8e7 --- /dev/null +++ b/src/views/modules/schedule/feed_back_upload_file.vue @@ -0,0 +1,141 @@ + + + +