From 8a2ca5a181b3917ac6905785a3c5bc1d151032d6 Mon Sep 17 00:00:00 2001 From: zhangdingyu <974548713@qq.com> Date: Wed, 28 Nov 2018 14:35:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=AE=9A=E9=A2=9D?= =?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/PartWorkCraftSelect_rdlc/index.vue | 5 +++-- .../ManufacturingCenter/ProductionCapacityBalance/index.vue | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue index 5c52f099..8a863728 100644 --- a/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue +++ b/src/views/ManufacturingCenter/PartWorkCraftSelect_rdlc/index.vue @@ -29,7 +29,7 @@ @@ -588,7 +588,7 @@ export default { total: 0, tableData: [], loading: false, - PrNum: '027W191482-0001', + PrNum: '', tableData2: [], tableData3: [], 机床号: '', @@ -617,6 +617,7 @@ export default { searchData() { this.loading = true search(this.pageCurrent, this.pageSize, this.PrNum).then(response => { + console.log(response.data) this.tableData = response.data.rows this.total = response.data.total this.loading = false diff --git a/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue b/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue index a16a697c..ac3daab4 100644 --- a/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue +++ b/src/views/ManufacturingCenter/ProductionCapacityBalance/index.vue @@ -1224,7 +1224,6 @@ export default { } }).then(() => { this.tableData1.push(this.result[i]) - console.log(this.tableData1) selection2(this.工艺计划流水号[this.indexAdjust]).then(response => { // 刷新对话框显示和颜色 for (let i = 0; i < response.data.length; i++) { this.partType = response.data[i].零件类型 @@ -1473,7 +1472,6 @@ export default { }).then(() => { plan(this.tableData1[i].工艺计划流水号).then(response => { if (this.tableData1[i].平衡次数 !== 0 || this.tableData1[i].是否焊接 !== 1) { - console.log(this.tableData1[i].平衡次数, 111) this.result1 += parseInt(response.data[0].result) if (this.result1 === this.length) { this.$message.success('零件计划制定成功') From 72694d5749dbe19c28e1158c852a7612fab0d9ea Mon Sep 17 00:00:00 2001 From: chenjianan Date: Wed, 28 Nov 2018 15:13:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=9A=E4=BA=8C=E7=BB=B4=E7=A0=81=E4=B8=BA?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=B5=81=E6=B0=B4=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/PurchasingCenter/PurchaseContractSearch/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue index 3c214440..06380a0a 100644 --- a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue +++ b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue @@ -247,7 +247,8 @@ export default { } } // const str = 'http://192.168.1.111:8022/searchContract.html?contractNum=' + contractNum - const str = 'http://192.168.1.111:8080/#/ContractInquiry/index?id=' + contractNum + // const str = 'http://192.168.1.111:8080/#/ContractInquiry/index?id=' + contractNum + const str = contractNum QRCode.toDataURL(str, opts, function(err, url) { if (err) throw err const img = document.getElementById('img') From 68107dac4f278d3e4b13b0f9030f096263a5d47b Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 29 Nov 2018 11:18:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=9A=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchaseContractSearch/exportExcel.js | 19 ++++ .../PurchaseContractSearch/index.vue | 94 +++++++++++-------- 2 files changed, 74 insertions(+), 39 deletions(-) create mode 100644 src/views/PurchasingCenter/PurchaseContractSearch/exportExcel.js diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/exportExcel.js b/src/views/PurchasingCenter/PurchaseContractSearch/exportExcel.js new file mode 100644 index 00000000..88de1a6d --- /dev/null +++ b/src/views/PurchasingCenter/PurchaseContractSearch/exportExcel.js @@ -0,0 +1,19 @@ +// 导出Excel方法(表格id,不加扩展名的文件名,sheet名) +export function exportExcelMethod(tableId, fileName, sheetName) { + tableToExcel(tableId, fileName, sheetName) +} +const tableToExcel = (function() { + const uri = 'data:application/vnd.ms-excel;base64,' + // 设置导出表格的单元格默认高度/宽度/边框样式/字体颜色/背景颜色/居中,网页显示表格宽度建议1240,tr/td视情况而定 + const template = `{worksheet}{table}
` + const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) } + const format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p] }) } + return function(table, filename, sheetname) { + if (!table.nodeType) table = document.getElementById(table) + const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML } + const aTag = document.createElement('a') + aTag.href = uri + base64(format(template, ctx)) + aTag.download = filename + aTag.click() + } +})() diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue index 06380a0a..16345b1c 100644 --- a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue +++ b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue @@ -46,6 +46,11 @@ icon="el-icon-search" style="margin-left:10px" @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询 + 导出 @@ -126,49 +131,52 @@
- - - - - - - - - - - - - - - - - -
GAOJING产品销售合同
需方江苏高精机电装备有限公司合同编号{{ contract }}
供方{{ supplier }}签订地点江苏盐城
-
一、 产品名称、型号、数量、单价、品牌:
- - - - - - - - - - - - - +
+
物料名称物料规格物料型号发货天数数量单价总价
- - + + + - - + + + + - -
运费:{{ freight }}GAOJING产品销售合同
总价: (人民币){{ RMB }}(含0.17增值税) {{ TotalAmount }}需方江苏高精机电装备有限公司合同编号{{ contract }}
-
+ + 供方 + {{ supplier }} + 签订地点 + 江苏盐城 + + +
一、 产品名称、型号、数量、单价、品牌:
+ + + + + + + + + + + + + + + + + + + + + + +
物料名称物料规格物料型号发货天数数量单价总价
运费:{{ freight }}
总价: (人民币){{ RMB }}(含0.17增值税) {{ TotalAmount }}
+
+
@@ -184,6 +192,7 @@ import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch' import { searchFile } from '@/api/PurchasingCenter/CreateContract' import QRCode from 'qrcode' +import { exportExcelMethod } from './exportExcel' export default { data() { @@ -238,6 +247,13 @@ export default { this.fetchData() }, methods: { + download() { + if (this.contract) { + exportExcelMethod('print', '采购合同', '采购合同sheet1') + } else { + this.$message.error('请选择合同') + } + }, useqrcode(contractNum) { const opts = { errorCorrectionLevel: 'H',