Merge branch 'master' of http://192.168.1.149:10010/r/高精2.0
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="零件投产数量" align="center">
|
<el-table-column label="零件投产数量" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.已投产数量 }}
|
{{ scope.row.批次数量 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -588,7 +588,7 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
PrNum: '027W191482-0001',
|
PrNum: '',
|
||||||
tableData2: [],
|
tableData2: [],
|
||||||
tableData3: [],
|
tableData3: [],
|
||||||
机床号: '',
|
机床号: '',
|
||||||
@@ -617,6 +617,7 @@ export default {
|
|||||||
searchData() {
|
searchData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
search(this.pageCurrent, this.pageSize, this.PrNum).then(response => {
|
search(this.pageCurrent, this.pageSize, this.PrNum).then(response => {
|
||||||
|
console.log(response.data)
|
||||||
this.tableData = response.data.rows
|
this.tableData = response.data.rows
|
||||||
this.total = response.data.total
|
this.total = response.data.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|||||||
@@ -1224,7 +1224,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.tableData1.push(this.result[i])
|
this.tableData1.push(this.result[i])
|
||||||
console.log(this.tableData1)
|
|
||||||
selection2(this.工艺计划流水号[this.indexAdjust]).then(response => { // 刷新对话框显示和颜色
|
selection2(this.工艺计划流水号[this.indexAdjust]).then(response => { // 刷新对话框显示和颜色
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
this.partType = response.data[i].零件类型
|
this.partType = response.data[i].零件类型
|
||||||
@@ -1473,7 +1472,6 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
plan(this.tableData1[i].工艺计划流水号).then(response => {
|
plan(this.tableData1[i].工艺计划流水号).then(response => {
|
||||||
if (this.tableData1[i].平衡次数 !== 0 || this.tableData1[i].是否焊接 !== 1) {
|
if (this.tableData1[i].平衡次数 !== 0 || this.tableData1[i].是否焊接 !== 1) {
|
||||||
console.log(this.tableData1[i].平衡次数, 111)
|
|
||||||
this.result1 += parseInt(response.data[0].result)
|
this.result1 += parseInt(response.data[0].result)
|
||||||
if (this.result1 === this.length) {
|
if (this.result1 === this.length) {
|
||||||
this.$message.success('零件计划制定成功')
|
this.$message.success('零件计划制定成功')
|
||||||
|
|||||||
@@ -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 = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 2px solid #000000;width:100px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -46,6 +46,11 @@
|
|||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
style="margin-left:10px"
|
style="margin-left:10px"
|
||||||
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-download"
|
||||||
|
@click="download()">导出</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
@@ -126,49 +131,52 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="width:900px;margin: 0 auto">
|
<div style="width:900px;margin: 0 auto">
|
||||||
<el-card>
|
<el-card>
|
||||||
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
|
<div id="print" style="width:860px;">
|
||||||
<tr style="height: 40px">
|
<table id="1" cellspacing="0px" align="center" border width="100%">
|
||||||
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
|
|
||||||
<td colspan="3" align="center" style="font-weight: bold">产品销售合同</td>
|
|
||||||
</tr>
|
|
||||||
<tr style="height: 40px">
|
|
||||||
<td colspan="1" align="center">需方</td>
|
|
||||||
<td colspan="1" align="center">江苏高精机电装备有限公司</td>
|
|
||||||
<td colspan="1" align="center">合同编号</td>
|
|
||||||
<td colspan="1" align="center">{{ contract }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr style="height: 40px">
|
|
||||||
<td colspan="1" align="center">供方</td>
|
|
||||||
<td colspan="1" align="center">{{ supplier }}</td>
|
|
||||||
<td colspan="1" align="center">签订地点</td>
|
|
||||||
<td colspan="1" align="center">江苏盐城</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div>一、 产品名称、型号、数量、单价、品牌:</div>
|
|
||||||
<table id="2" cellspacing="0px" align="center" border width="100%" style="">
|
|
||||||
<tbody id="4">
|
|
||||||
<tr id="tableHead" style="height: 40px">
|
|
||||||
<td colspan="1" align="center">物料名称</td>
|
|
||||||
<td colspan="1" align="center">物料规格</td>
|
|
||||||
<td colspan="1" align="center">物料型号</td>
|
|
||||||
<td colspan="1" align="center">发货天数</td>
|
|
||||||
<td colspan="1" align="center">数量</td>
|
|
||||||
<td colspan="1" align="center">单价</td>
|
|
||||||
<td colspan="1" align="center">总价</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr style="height: 40px">
|
<tr style="height: 40px">
|
||||||
<td colspan="6">运费:</td>
|
<td colspan="1" align="center" style="font-weight: bold">GAOJING</td>
|
||||||
<td colspan="1" align="center">{{ freight }}</td>
|
<td colspan="4" align="center" style="font-weight: bold">产品销售合同</td>
|
||||||
|
<td colspan="2" rowspan="3" align="center" style="width: 100px"/>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="height: 40px">
|
<tr style="height: 40px">
|
||||||
<td colspan="6">总价: (人民币){{ RMB }}(含0.17增值税) </td>
|
<td colspan="1" align="center">需方</td>
|
||||||
<td colspan="1" align="center">{{ TotalAmount }}</td>
|
<td colspan="2" align="center">江苏高精机电装备有限公司</td>
|
||||||
|
<td colspan="1" align="center">合同编号</td>
|
||||||
|
<td colspan="1" align="center">{{ contract }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
<tr style="height: 40px">
|
||||||
</table>
|
<td colspan="1" align="center">供方</td>
|
||||||
<div id="23"/>
|
<td colspan="2" align="center">{{ supplier }}</td>
|
||||||
|
<td colspan="1" align="center">签订地点</td>
|
||||||
|
<td colspan="1" align="center">江苏盐城</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div>一、 产品名称、型号、数量、单价、品牌:</div>
|
||||||
|
<table id="2" cellspacing="0px" align="center" border width="100%" style="">
|
||||||
|
<tbody id="4">
|
||||||
|
<tr id="tableHead" style="height: 40px">
|
||||||
|
<td colspan="1" align="center">物料名称</td>
|
||||||
|
<td colspan="1" align="center">物料规格</td>
|
||||||
|
<td colspan="1" align="center">物料型号</td>
|
||||||
|
<td colspan="1" align="center">发货天数</td>
|
||||||
|
<td colspan="1" align="center">数量</td>
|
||||||
|
<td colspan="1" align="center">单价</td>
|
||||||
|
<td colspan="1" align="center">总价</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr style="height: 40px">
|
||||||
|
<td colspan="6">运费:</td>
|
||||||
|
<td colspan="1" align="center">{{ freight }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr style="height: 40px">
|
||||||
|
<td colspan="6">总价: (人民币){{ RMB }}(含0.17增值税) </td>
|
||||||
|
<td colspan="1" align="center">{{ TotalAmount }}</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
<div id="23"/>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -184,6 +192,7 @@
|
|||||||
import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch'
|
import { initContract, initBuyer, searchTable1, searchTable2 } from '@/api/PurchasingCenter/PurchaseContractSearch'
|
||||||
import { searchFile } from '@/api/PurchasingCenter/CreateContract'
|
import { searchFile } from '@/api/PurchasingCenter/CreateContract'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
|
import { exportExcelMethod } from './exportExcel'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -238,6 +247,13 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
download() {
|
||||||
|
if (this.contract) {
|
||||||
|
exportExcelMethod('print', '采购合同', '采购合同sheet1')
|
||||||
|
} else {
|
||||||
|
this.$message.error('请选择合同')
|
||||||
|
}
|
||||||
|
},
|
||||||
useqrcode(contractNum) {
|
useqrcode(contractNum) {
|
||||||
const opts = {
|
const opts = {
|
||||||
errorCorrectionLevel: 'H',
|
errorCorrectionLevel: 'H',
|
||||||
@@ -247,7 +263,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// const str = 'http://192.168.1.111:8022/searchContract.html?contractNum=' + contractNum
|
// 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) {
|
QRCode.toDataURL(str, opts, function(err, url) {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
const img = document.getElementById('img')
|
const img = document.getElementById('img')
|
||||||
|
|||||||
Reference in New Issue
Block a user