From 45b91a958bc4eb9aedc4cef3fcc530e9ebe0d0e7 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Wed, 8 May 2019 19:13:07 +0800 Subject: [PATCH 01/10] v-if --- .../ProductionCapacityBalance/index.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue b/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue index 86e3249e..92899aac 100644 --- a/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue +++ b/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue @@ -431,7 +431,7 @@ @current-change="handleCurrentChange1"/>
虚拟排产 - 确定零件计划 + 确定零件计划 全部选出
@@ -620,6 +620,7 @@ export default { directives: { elDragDialog }, data() { return { + 可以确定零件计划: false, bianliang1: [], count: 0, 是否扫描: false, @@ -1226,6 +1227,12 @@ export default { this.计划日期.push(response.data[i].计划日期) } }) + this.可以确定零件计划 = true + for (let i = 0; i < this.planDate.length; i++) { + for (let j = 0; j < this.planDate[i].length; j++) { + this.可以确定零件计划 = this.可以确定零件计划 && !!this.planDate[i][j] + } + } }) } } else { @@ -1435,6 +1442,7 @@ export default { this.bianliang1.push(this.tableData1[i].工艺计划流水号) } discharge(this.bianliang1).then(response => { + console.log(response.data) this.Selection1() }) }, From 82590a97185317e7dc1d5c48acb314ed0f1d6e52 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Wed, 15 May 2019 15:17:15 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=B7=A5=E8=89=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug.log | 1 + .../PartWorkCraftSelect_rdlc.js | 12 + .../ProcessQuotaEstablishment.js | 481 +++++ src/utils/request.js | 6 - .../PartWorkCraftSelect_rdlc/index.vue | 40 +- .../ProcessQuotaEstablishment/index.vue | 1628 +++++++++++++++++ .../CreateInquirySheet/exportExcel.js | 5 + 7 files changed, 2162 insertions(+), 11 deletions(-) create mode 100644 src/api/ManufacturingCenter/ProcessQuotaEstablishment.js create mode 100644 src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue diff --git a/debug.log b/debug.log index ed97f861..cf7df822 100644 --- a/debug.log +++ b/debug.log @@ -1 +1,2 @@ [0301/083149.303:ERROR:http_transport_win.cc(273)] WinHttpSendRequest: ɹɡ (0x0) +[0515/102246.688:ERROR:http_transport_win.cc(276)] WinHttpSendRequest: ɹɡ (0x0) diff --git a/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js b/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js index 6356cd22..3f8f6066 100644 --- a/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js +++ b/src/api/ManufacturingCenter/PartWorkCraftSelect_rdlc.js @@ -71,3 +71,15 @@ export function searchtable2(num) { } }) } +// 在制零件工艺修改 +export function returnEdit(num) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_在制零件工艺调整_修改工艺', + param: '工艺计划流水号=' + num + } + }) +} diff --git a/src/api/ManufacturingCenter/ProcessQuotaEstablishment.js b/src/api/ManufacturingCenter/ProcessQuotaEstablishment.js new file mode 100644 index 00000000..7a4fa413 --- /dev/null +++ b/src/api/ManufacturingCenter/ProcessQuotaEstablishment.js @@ -0,0 +1,481 @@ +import request from '@/utils/request' + +// 典艺查询<高精原有数据> +export function searchProcess11(num) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_原零件工艺查询_MESWORK', + param: '零件图号=' + num + } + }) +} +// 典艺查询<高精原有数据> +export function numChange(num) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_原零件工艺明细查询_MESWORK', + param: '典艺流水号=' + num + } + }) +} +// 保存主表工艺 +export function selectRequest(num0, num1, num2, num3, request0) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_根据工序流水号和工艺计划流水号', + param: '工序流水号=' + num0 + '&工艺计划流水号=' + num1 + '&工艺编号=' + num2 + '&工艺顺序=' + num3 + '&工艺要求=' + request0 + } + }) +} +// 初始化 工艺员A +export function initCraftmen() { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号', + param: '考核部门编号=20' + } + }) +} +// 查询 未编制 零件号 +export function getPartnames1(num1, num2) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工艺计划_编制工艺_按人员查', + param: '工艺人员编号=' + num1 + '&零件图号=' + num2 + } + }) +} +// 初始化 已编制 零件号 +export function getPartnames2(num1, num2) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工艺计划_查询已完成工艺制定零件', + param: '工艺人员编号=' + num1 + '&零件图号=' + num2 + } + }) +} +// 零件详细信息 +export function detailInfo(serialNum) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工艺计划_查已投产零件信息', + param: '工艺计划流水号=' + serialNum + '=int' + } + }) +} +// 初始化材质 +export function getMaterial(pageCurrent, pageSize) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_材质表_查询数据', + Pagination: pageCurrent + '&' + pageSize + } + }) +} +// 根据材质名称查材质 +export function searchMaterial(pageCurrent, pageSize, name) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_材质表_查询数据_根据材料名称', + param: '材料名称=' + name, + Pagination: pageCurrent + '&' + pageSize + } + }) +} +// 典型工艺选择零件分类A +export function typicalProcess() { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_典型工艺名称_分类_查询数据' + } + }) +} +// 典型工艺选择零件名称、工艺号、备注 +export function FcK(serialNum) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_典型工艺名称_查询数据_查典型工艺名称', + param: '典型工艺名称分类流水号=' + serialNum + '=int' + } + }) +} +// 典型工艺查询 +export function searchProcess(check1, a, check2, b, check3, c) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_典型工艺名称_查询数据_综合查询', + param: '典型工艺名称分类流水号_check=' + check1 + '=bit&典型工艺名称分类流水号=' + a + '=int&典型工艺流水号_check=' + check2 + '=bit&典型工艺流水号=' + b + '=int&典型工艺流水号1_check=' + check3 + '=bit&典型工艺流水号1=' + c + '=int' + } + }) +} +// 初始化工艺名称 +export function processNameClick() { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_工艺分类名称_查询数据_零件工艺制定专用' + } + }) +} +// 工艺名称查询 +export function processNameSelect(val) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_工艺名称_查询数据', + param: '工艺分类流水号_check=1=bit&工艺分类流水号=' + val + '=int' + } + }) +} +// 工艺要求查询 +export function processRequestSelect(val) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理_基础表_工艺要求_查询数据', + param: '工艺编号=' + val + '=int' + } + }) +} +// 初始化公差A +export function initTolerance() { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_公差对照表_查询数据' + } + }) +} +// 公差查询 +export function searchTolerance(val1, val2) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_基础表_公差对照表_公差_查询数据', + param: '输入数值=' + val1 + '&参数=' + val2 + } + }) +} +// 工艺定额人员查询 +export function initPerson() { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号', + param: '考核部门编号=9' + } + }) +} +// 完艺工艺查询 +export function searchWYgongyi(check1, tuhao, check2, bianhao, check3, start, end, check4, name) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工艺计划_查询数据_根据零件图号查询已投产的工艺计划流水号', + param: '零件图号_check=' + check1 + '&零件图号=' + tuhao + '&工艺员编号_check=' + check2 + '&工艺员编号=' + bianhao + '&工艺时间_check=' + check3 + '&工艺开始时间=' + start + '=datetime&工艺结束时间=' + end + '=datetime&零件名称_check=' + check4 + '&零件名称=' + name + } + }) +} +// 完艺工艺要求查询 +export function gongyiYQ(num) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工艺计划_查询数据', + param: '工艺计划流水号=' + num + } + }) +} +// 完艺工艺拷贝 +export function gongyiCopy(num1, num2) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工序_工艺拷贝_工艺计划流水号', + param: '工艺计划流水号_完成工艺=' + num1 + '=int&工艺计划流水号_被拷工艺=' + num2 + '=int' + } + }) +} +// 主界面选择零件号查主表 +export function mainTable(num) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_零件工序_查询工序信息', + param: '工艺计划流水号=' + num + '=int' + } + }) +} +// 主界面主表难度等级修改 +export function hardEdit(num, hard) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_工艺难度等级', + param: '工序流水号=' + num + '=int&工艺难度等级=' + hard + } + }) +} +// 主界面主表工艺要求修改 +export function requestEdit(num, request0) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_工艺要求_根据工序流水号', + param: '工序流水号=' + num + '=int&工艺要求=' + request0 + } + }) +} +// 主界面主表插入功能 +export function insertOne(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_工艺计划流水号和工序流水号', + param: '工艺计划流水号=' + num0 + '=int&工序流水号=' + num1 + '=int' + } + }) +} +// 主界面主表删除功能 +export function deleteOne(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_删除数据_工序流水号', + param: '工艺计划流水号=' + num0 + '=int&工序流水号=' + num1 + '=int' + } + }) +} +// 主界面主表上移功能 +export function upOne(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_上移工序', + param: '工艺计划流水号=' + num0 + '=int&工序流水号=' + num1 + '=int' + } + }) +} +// 主界面主表下移功能 +export function downOne(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_修改数据_下移工序', + param: '工艺计划流水号=' + num0 + '=int&工序流水号=' + num1 + '=int' + } + }) +} +// 保存变更材质 +export function saveMaterial(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工艺计划_修改零件材料', + param: '工艺计划流水号=' + num0 + '&材料流水号=' + num1 + } + }) +} +// 核准保存 +export function saveApprove(num0, num1, request0, spec, num2, outhelp, num3, num4, weight, area, num5, level) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_增加数据_同时修改工艺计划', + param: '工艺计划流水号=' + num0 + '&工艺编号=' + num1 + '&工艺要求=' + request0 + '&原材料规格=' + spec + '&工序顺序=' + num2 + '&工序间是否外协=' + outhelp + '&工序流水号=' + num3 + '&材料流水号=' + num4 + '&重量=' + weight + '&面积=' + area + '&工艺人员编号=' + num5 + '&工艺难度等级=' + level + } + }) +} + +// 粘贴 +export function pasteTable(oldNum, newNum) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工艺计划_拷贝零件工艺', + param: '工艺计划流水号旧=' + oldNum + '&工艺计划流水号新=' + newNum + } + }) +} +// 删除 +export function deleteTable(num) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_删除零件工艺', + param: '工艺计划流水号=' + num + } + }) +} +// 在制零件工艺修改 +export function returnEdit(num) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_在制零件工艺调整_修改工艺', + param: '工艺计划流水号=' + num + } + }) +} +// 查询工艺记录 +export function searchRecord(num) { + return request({ + url: '', + method: 'post', + data: { + type: '1', + name: '车间生产管理工艺_在制零件工艺调整_查询工艺', + param: '工艺计划流水号=' + num + } + }) +} +// 重量拷贝 +export function WeightCopy(num, num2) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_重量拷贝_工艺计划流水号', + param: '工艺计划流水号=' + num + '&重量信息=' + num2 + } + }) +} +// 保存变更材质 +export function saveWeight(num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工艺计划_修改零件重量', + param: '工艺计划流水号=' + num0 + '&重量=' + num1 + } + }) +} +// 单件工时改变 +export function singleChange(val1, val2) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_单件准结定额_修改数据', + param: '工序流水号=' + val1 + '&单件定额工时=' + val2 + } + }) +} +// 准结工时改变 +export function readyChange(val1, val2) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_单件准结定额_修改数据', + param: '工序流水号=' + val1 + '&准结定额工时=' + val2 + } + }) +} +// 未编制定额保存 +export function TableAddLi1(a, b) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_定额任务分配_保存数据', + param: '工艺计划流水号=' + a + '=string&人员编号=' + b + '=string' + } + }) +} +// 已编制定额保存 +export function TableAddLi(a, b, c, num0, num1) { + return request({ + url: '', + method: 'post', + data: { + type: '2', + name: '车间生产管理工艺_零件工序_增加数据_修改数据', + param: '单件定额工时=' + a + '=string&准结定额工时=' + b + '=string&零件图号=' + c + '=string&工序流水号=' + num0 + '=int&工艺计划流水号=' + num1 + '=int' + } + }) +} diff --git a/src/utils/request.js b/src/utils/request.js index 0a45cef9..4499cb7a 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -16,13 +16,7 @@ export const uploadInvoiceScan = `http://192.168.1.231:8411/submit/uploadInvoice export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement const service = axios.create({ - // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, - // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, - // baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, - // baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, - // baseURL: `http://localhost:8077/submit/MESCommonBase.ashx`, - // baseURL: `http://192.168.0.112:8411/submit/MESCommonBase.ashx`, timeout: 1500000 // 请求超时时间 }) diff --git a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue index a033f54f..20f76a6e 100644 --- a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue +++ b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue @@ -32,15 +32,13 @@ 工艺员: - + - - 查询 @@ -81,6 +79,9 @@ +
+ 在制零件工艺调整 +
@@ -151,7 +152,8 @@ + + + diff --git a/src/views/PurchasingCenter/CreateInquirySheet/exportExcel.js b/src/views/PurchasingCenter/CreateInquirySheet/exportExcel.js index ce61818e..c5075de7 100644 --- a/src/views/PurchasingCenter/CreateInquirySheet/exportExcel.js +++ b/src/views/PurchasingCenter/CreateInquirySheet/exportExcel.js @@ -11,6 +11,11 @@ const tableToExcel = (function() { return function(table, filename, sheetname) { if (!table.nodeType) table = document.getElementById(table) const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML } + const blob = new Blob([format(template, ctx)]) + if ('msSaveOrOpenBlob' in navigator) { + window.navigator.msSaveOrOpenBlob(blob, filename + '.xls') + return + } const aTag = document.createElement('a') aTag.href = uri + base64(format(template, ctx)) aTag.download = filename From 2069467268d7a11d9c23ba50b17ad15d16eda638 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Wed, 15 May 2019 15:20:04 +0800 Subject: [PATCH 03/10] conflict --- src/views/TechnologyCenter/ImportParts/specificationData.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/views/TechnologyCenter/ImportParts/specificationData.vue b/src/views/TechnologyCenter/ImportParts/specificationData.vue index bdce2613..e775f0c1 100644 --- a/src/views/TechnologyCenter/ImportParts/specificationData.vue +++ b/src/views/TechnologyCenter/ImportParts/specificationData.vue @@ -640,11 +640,7 @@ export default { \ No newline at end of file From acbdb7908455f3d761a5dbe3b1a5fcc9b49a6da9 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 16 May 2019 08:20:54 +0800 Subject: [PATCH 05/10] fixed bug --- src/utils/request.js | 18 ++++---- .../ProcessQuotaEstablishment/index.vue | 44 +++---------------- 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 8d46ce0f..9762a082 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,16 +8,16 @@ export const name = `OP8888` export const name1 = `OP1000` // 创建axios实例 -export const readFile = `http://192.168.1.231:8411/webpage/file/` // invoice -export const readImg = `http://192.168.1.231:8411/webpage/img/` // delivery/MS/performancebond -export const upload = `http://192.168.1.231:8411/submit/uploadFile.ashx` // ContractInformationManagement -export const upload2 = `http://192.168.1.231:8411/submit/upload2.ashx` // delivery -export const upload3 = `http://192.168.1.231:8411/submit/upload3.ashx` // performancebond -export const uploadInvoiceScan = `http://192.168.1.231:8411/submit/uploadInvoiceScan.ashx` // invoice -export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) -export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement +export const readFile = `http://localhost:8411/webpage/file/` // invoice +export const readImg = `http://localhost:8411/webpage/img/` // delivery/MS/performancebond +export const upload = `http://localhost:8411/submit/uploadFile.ashx` // ContractInformationManagement +export const upload2 = `http://localhost:8411/submit/upload2.ashx` // delivery +export const upload3 = `http://localhost:8411/submit/upload3.ashx` // performancebond +export const uploadInvoiceScan = `http://localhost:8411/submit/uploadInvoiceScan.ashx` // invoice +export const uploadInvoiceScan1 = `http://localhost:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) +export const download = `http://localhost:8411/submit/downloadFile.ashx` // ContractInformationManagement const service = axios.create({ - baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, + baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, timeout: 1500000 // 请求超时时间 }) diff --git a/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue b/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue index 0b3179f8..5cb760d1 100644 --- a/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue +++ b/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue @@ -252,12 +252,12 @@ @@ -407,47 +407,16 @@ - + - - - - - - - - - - - - - - - - - - - - 查询 - + 查询 + 工艺拷贝 @@ -473,9 +442,6 @@ - - 工艺拷贝 - From c103c64a8a4abec28f3c1050aab2e63ad9c279d3 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 16 May 2019 08:21:44 +0800 Subject: [PATCH 06/10] fixed bug --- src/utils/request.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 9762a082..8d46ce0f 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,16 +8,16 @@ export const name = `OP8888` export const name1 = `OP1000` // 创建axios实例 -export const readFile = `http://localhost:8411/webpage/file/` // invoice -export const readImg = `http://localhost:8411/webpage/img/` // delivery/MS/performancebond -export const upload = `http://localhost:8411/submit/uploadFile.ashx` // ContractInformationManagement -export const upload2 = `http://localhost:8411/submit/upload2.ashx` // delivery -export const upload3 = `http://localhost:8411/submit/upload3.ashx` // performancebond -export const uploadInvoiceScan = `http://localhost:8411/submit/uploadInvoiceScan.ashx` // invoice -export const uploadInvoiceScan1 = `http://localhost:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) -export const download = `http://localhost:8411/submit/downloadFile.ashx` // ContractInformationManagement +export const readFile = `http://192.168.1.231:8411/webpage/file/` // invoice +export const readImg = `http://192.168.1.231:8411/webpage/img/` // delivery/MS/performancebond +export const upload = `http://192.168.1.231:8411/submit/uploadFile.ashx` // ContractInformationManagement +export const upload2 = `http://192.168.1.231:8411/submit/upload2.ashx` // delivery +export const upload3 = `http://192.168.1.231:8411/submit/upload3.ashx` // performancebond +export const uploadInvoiceScan = `http://192.168.1.231:8411/submit/uploadInvoiceScan.ashx` // invoice +export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoiceScan1.ashx` // invoice(workshop) +export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement const service = axios.create({ - baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, + baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`, timeout: 1500000 // 请求超时时间 }) From 8c4c48bba4a16f0cd8bcb1a6d6deeb14e92fc68d Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 16 May 2019 11:15:32 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=87=8D=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessQuotaEstablishment/index.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue b/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue index 5cb760d1..e6225803 100644 --- a/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue +++ b/src/views/ManufacturingCenter/ProcessQuotaEstablishment/index.vue @@ -1175,8 +1175,23 @@ export default { if (response.data[i].工艺要求 === null) { response.data[i].工艺要求 = '' } + if (response.data[i].工艺名称 === null || response.data[i].工艺名称 === '') { + response.data[i].工艺难度等级 = '' + response.data[i].单件定额工时 = '' + response.data[i].准结定额工时 = '' + } } this.tableData = response.data + this.tableData.map(h => { + this.$set(h, '工艺分类及名称', []) + this.options.map(v => { + v.children.map(l => { + if (l.value === h.工艺编号) { + h.工艺分类及名称 = [Number(v.value), Number(h.工艺编号)] + } + }) + }) + }) this.newNum = this.partNumValue }).then(() => { this.loading0 = false From 4add252f01e07a84fa444e38dc02bdb765459eba Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 16 May 2019 17:04:11 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManufacturingCenter/ProcessingStatus.js | 19 +++ src/vendor/Export2Excel.js | 133 ++++++++++++++---- .../ProcessingStatus/index.vue | 30 +++- 3 files changed, 154 insertions(+), 28 deletions(-) diff --git a/src/api/ManufacturingCenter/ProcessingStatus.js b/src/api/ManufacturingCenter/ProcessingStatus.js index d157775b..9892821f 100644 --- a/src/api/ManufacturingCenter/ProcessingStatus.js +++ b/src/api/ManufacturingCenter/ProcessingStatus.js @@ -60,3 +60,22 @@ export function getTable2(stepNumber) { } }) } +export function getExport(num) { + return request({ + url: '', + method: 'post', + data: { + type: '3', + name: `select 机床流水号,组件流水号,车间生产管理工艺_零件工艺计划.工艺计划流水号,车间生产管理工艺_零件工艺计划.零件图号_零件工艺计划,车间生产管理工艺_零件工序_视图.零件名称,待加工工序顺序,车间生产管理工艺_零件工序.工序流水号,车间生产管理工艺_零件工序.工艺编号,车间生产管理工艺_基础表_工艺名称.工艺名称,批次数量,材料 +from ( select 工艺计划流水号,min(工序顺序) as 待加工工序顺序 + from 车间生产管理工艺_零件工序_视图 + where 完成日期_短 is null and 考核状态 = 6 + group by 工艺计划流水号) as 当前加工工序表 +inner join 车间生产管理工艺_零件工艺计划 on 当前加工工序表.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号 +inner join 车间生产管理工艺_零件工序 on 当前加工工序表.工艺计划流水号 = 车间生产管理工艺_零件工序.工艺计划流水号 and 当前加工工序表.待加工工序顺序 = 车间生产管理工艺_零件工序.工序顺序 +inner join 车间生产管理工艺_基础表_工艺名称 on 车间生产管理工艺_基础表_工艺名称.工艺编号 = 车间生产管理工艺_零件工序.工艺编号 +inner join 车间生产管理工艺_零件工序_视图 on 车间生产管理工艺_零件工序_视图.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号 and 当前加工工序表.待加工工序顺序 = 车间生产管理工艺_零件工序_视图.工序顺序 +where 组件流水号 = ${num}` + } + }) +} diff --git a/src/vendor/Export2Excel.js b/src/vendor/Export2Excel.js index 8fad94f5..81ce705b 100644 --- a/src/vendor/Export2Excel.js +++ b/src/vendor/Export2Excel.js @@ -1,7 +1,7 @@ /* eslint-disable */ require('script-loader!file-saver'); -require('script-loader!@/vendor/Blob'); -require('script-loader!xlsx/dist/xlsx.core.min'); +import XLSX from 'xlsx' + function generateArray(table) { var out = []; var rows = table.querySelectorAll('tr'); @@ -28,15 +28,24 @@ function generateArray(table) { if (rowspan || colspan) { rowspan = rowspan || 1; colspan = colspan || 1; - ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}}); - } - ; + ranges.push({ + s: { + r: R, + c: outRow.length + }, + e: { + r: R + rowspan - 1, + c: outRow.length + colspan - 1 + } + }); + }; //Handle Value outRow.push(cellValue !== "" ? cellValue : null); //Handle Colspan - if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null); + if (colspan) + for (var k = 0; k < colspan - 1; ++k) outRow.push(null); } out.push(outRow); } @@ -51,16 +60,30 @@ function datenum(v, date1904) { function sheet_from_array_of_arrays(data, opts) { var ws = {}; - var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}}; + var range = { + s: { + c: 10000000, + r: 10000000 + }, + e: { + c: 0, + r: 0 + } + }; for (var R = 0; R != data.length; ++R) { for (var C = 0; C != data[R].length; ++C) { if (range.s.r > R) range.s.r = R; if (range.s.c > C) range.s.c = C; if (range.e.r < R) range.e.r = R; if (range.e.c < C) range.e.c = C; - var cell = {v: data[R][C]}; + var cell = { + v: data[R][C] + }; if (cell.v == null) continue; - var cell_ref = XLSX.utils.encode_cell({c: C, r: R}); // here + var cell_ref = XLSX.utils.encode_cell({ + c: C, + r: R + }); if (typeof cell.v === 'number') cell.t = 'n'; else if (typeof cell.v === 'boolean') cell.t = 'b'; @@ -68,8 +91,7 @@ function sheet_from_array_of_arrays(data, opts) { cell.t = 'n'; cell.z = XLSX.SSF._table[14]; cell.v = datenum(cell.v); - } - else cell.t = 's'; + } else cell.t = 's'; ws[cell_ref] = cell; } @@ -93,16 +115,15 @@ function s2ab(s) { export function export_table_to_excel(id) { var theTable = document.getElementById(id); - console.log('a') var oo = generateArray(theTable); var ranges = oo[1]; /* original data */ var data = oo[0]; var ws_name = "SheetJS"; - console.log(data); - var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); + var wb = new Workbook(), + ws = sheet_from_array_of_arrays(data); /* add ranges to worksheet */ // ws['!cols'] = ['apple', 'banan']; @@ -112,30 +133,88 @@ export function export_table_to_excel(id) { wb.SheetNames.push(ws_name); wb.Sheets[ws_name] = ws; - var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'}); + var wbout = XLSX.write(wb, { + bookType: 'xlsx', + bookSST: false, + type: 'binary' + }); - saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), "test.xlsx") + saveAs(new Blob([s2ab(wbout)], { + type: "application/octet-stream" + }), "test.xlsx") } -function formatJson(jsonData) { - console.log(jsonData) -} -export function export_json_to_excel(th, jsonData, defaultTitle) { - +export function export_json_to_excel({ + multiHeader = [], + header, + data, + filename, + merges = [], + autoWidth = true, + bookType= 'xlsx' + } = {}) { /* original data */ + filename = filename || 'excel-list' + data = [...data] + data.unshift(header); + + for (let i = multiHeader.length-1; i > -1; i--) { + data.unshift(multiHeader[i]) + } - var data = jsonData; - data.unshift(th); var ws_name = "SheetJS"; + var wb = new Workbook(), + ws = sheet_from_array_of_arrays(data); - var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); + if (merges.length > 0) { + if (!ws['!merges']) ws['!merges'] = []; + merges.forEach(item => { + ws['!merges'].push(XLSX.utils.decode_range(item)) + }) + } + if (autoWidth) { + /*设置worksheet每列的最大宽度*/ + const colWidth = data.map(row => row.map(val => { + /*先判断是否为null/undefined*/ + if (val == null) { + return { + 'wch': 10 + }; + } + /*再判断是否为中文*/ + else if (val.toString().charCodeAt(0) > 255) { + return { + 'wch': val.toString().length * 2 + }; + } else { + return { + 'wch': val.toString().length + }; + } + })) + /*以第一行为初始值*/ + let result = colWidth[0]; + for (let i = 1; i < colWidth.length; i++) { + for (let j = 0; j < colWidth[i].length; j++) { + if (result[j]['wch'] < colWidth[i][j]['wch']) { + result[j]['wch'] = colWidth[i][j]['wch']; + } + } + } + ws['!cols'] = result; + } /* add worksheet to workbook */ wb.SheetNames.push(ws_name); wb.Sheets[ws_name] = ws; - var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'}); - var title = defaultTitle || '列表' - saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx") + var wbout = XLSX.write(wb, { + bookType: bookType, + bookSST: false, + type: 'binary' + }); + saveAs(new Blob([s2ab(wbout)], { + type: "application/octet-stream" + }), `${filename}.${bookType}`); } diff --git a/src/views/ManufacturingCenter/ProcessingStatus/index.vue b/src/views/ManufacturingCenter/ProcessingStatus/index.vue index e8462be2..c8271a02 100644 --- a/src/views/ManufacturingCenter/ProcessingStatus/index.vue +++ b/src/views/ManufacturingCenter/ProcessingStatus/index.vue @@ -48,6 +48,7 @@ type="date" placeholder="选择日期"/> 查询 + 导出 @@ -309,7 +310,7 @@ + +
江苏高精