询价单合并数量

This commit is contained in:
chenjianan
2019-05-27 11:59:54 +08:00
parent edcc2c577c
commit 8854c04660
2 changed files with 87 additions and 72 deletions

View File

@@ -320,3 +320,15 @@ export function editBaseInfo(...params) {
} }
}) })
} }
// 查询询价单基础信息维护
export function searchMerge(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_询价单明细合并_查询数据',
param: '询价单流水号=' + num
}
})
}

View File

@@ -790,7 +790,7 @@
<script> <script>
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet, import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder, createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2 } from '@/api/PurchasingCenter/CreateInquirySheet' submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2, searchMerge } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { exportExcelMethod } from './exportExcel' import { exportExcelMethod } from './exportExcel'
import $ from 'jquery' import $ from 'jquery'
@@ -942,7 +942,6 @@ export default {
standardAndPurchaseValue: '', // 标准件和外购件流水号 standardAndPurchaseValue: '', // 标准件和外购件流水号
title2: '', title2: '',
orderExport: '', orderExport: '',
supplierExport: '',
useNumber: '', useNumber: '',
maxUseNumber: '', maxUseNumber: '',
dialogVisible4: false, dialogVisible4: false,
@@ -1142,7 +1141,7 @@ export default {
}) })
}, },
selectable(row, index) { // 控制某行是否可选 selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) === 1 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改 return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) < 3 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
}, },
filterHandler0(value, row) { // 筛选备注 filterHandler0(value, row) { // 筛选备注
return row['备注'] === value return row['备注'] === value
@@ -1348,47 +1347,49 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (this.tableData3.length === 0 && !this.supplierExport) { searchMerge(this.inquirySheetFlowNum).then(res => {
this.$message.error('请选择正确的询价单导出') if (res.data.length === 0) {
} else { this.$message.error('请选择正确的询价单导出')
const children = document.getElementsByClassName('tableData') } else {
const parent = document.getElementsByClassName('inquirySheet')[0] const children = document.getElementsByClassName('tableData')
if (children.length !== 0) { const parent = document.getElementsByClassName('inquirySheet')[0]
for (let i = children.length - 1; i >= 0; i--) { if (children.length !== 0) {
parent.removeChild(children[i]) for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
} }
const tr = []
let length = 0
res.data.length < 15 ? length = 15 : length = res.data.length
for (let i = 0; i < length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = `<td width="8.3%" height="30px"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" colspan="3"/>`
$('#tablehead').after(tr[i])
}
for (let j = 0; j < res.data.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = res.data[j].物料型号 || res.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = res.data[j].物料名称 || res.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = res.data[j].物料规格 || res.data[j].规格
document.getElementsByClassName('tableData')[j].children[4].innerHTML = res.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = res.data[j].备注
}
document.getElementById('inquirySheetNum').innerHTML = this.orderExport
document.getElementById('supplier').innerHTML = ''
} }
const tr = [] }).then(() => {
let length = 0 const htmlNode = $('#inquirySheet').html()
this.tableData3.length < 15 ? length = 15 : length = this.tableData3.length const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;')
for (let i = 0; i < length; i++) { body.children().hide()
tr[i] = document.createElement('tr') const printNode = $(htmlNode)
tr[i].setAttribute('class', 'tableData') body.append(printNode)
tr[i].innerHTML = `<td width="8.3%" height="30px"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" colspan="3"/>` window.print()
$('#tablehead').after(tr[i]) body.removeAttr('style')
} body.children().not('script').show()
for (let j = 0; j < this.tableData3.length; j++) { body.children().not('#app').hide()
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1 printNode.remove()
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.tableData3[j].物料型号 || this.tableData3[j].零件图号 })
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.tableData3[j].物料名称 || this.tableData3[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料规格 || this.tableData3[j].规格
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].备注
}
document.getElementById('inquirySheetNum').innerHTML = this.orderExport
document.getElementById('supplier').innerHTML = ''
}
}).then(() => {
const htmlNode = $('#inquirySheet').html()
const body = $('body').attr('style', 'padding: 20px;margin: 0 auto;display: block;width: 800px;background: #fff;')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.removeAttr('style')
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
}).catch(res => { }).catch(res => {
console.log(res) console.log(res)
this.$message({ this.$message({
@@ -1403,37 +1404,40 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (this.tableData3.length === 0 && !this.supplierExport) { // 询价单导出结果
this.$message.error('请选择正确的询价单导出') searchMerge(this.inquirySheetFlowNum).then(res => {
} else { if (res.data.length === 0) {
const children = document.getElementsByClassName('tableData') this.$message.error('请选择正确的询价单导出')
const parent = document.getElementsByClassName('inquirySheet')[0] } else {
if (children.length !== 0) { const children = document.getElementsByClassName('tableData')
for (let i = children.length - 1; i >= 0; i--) { const parent = document.getElementsByClassName('inquirySheet')[0]
parent.removeChild(children[i]) if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
} }
const tr = []
let length = 0
res.data.length < 15 ? length = 15 : length = res.data.length
for (let i = 0; i < length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = `<td width="8.3%" height="30px"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" colspan="3"/>`
$('#tablehead').after(tr[i])
}
for (let j = 0; j < res.data.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = res.data[j].物料型号 || res.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = res.data[j].物料名称 || res.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = res.data[j].物料规格 || res.data[j].规格
document.getElementsByClassName('tableData')[j].children[4].innerHTML = res.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = res.data[j].备注
}
document.getElementById('inquirySheetNum').innerHTML = this.orderExport
document.getElementById('supplier').innerHTML = ''
exportExcelMethod('inquirySheet', '采购询价单', '采购询价单sheet')
} }
const tr = [] })
let length = 0
this.tableData3.length < 15 ? length = 15 : length = this.tableData3.length
for (let i = 0; i < length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = `<td width="8.3%" height="30px"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" width="16.6%" colspan="2"/><td height="30px" colspan="3"/>`
$('#tablehead').after(tr[i])
}
for (let j = 0; j < this.tableData3.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = this.tableData3[j].物料型号 || this.tableData3[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = this.tableData3[j].物料名称 || this.tableData3[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料规格 || this.tableData3[j].规格
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].备注
}
document.getElementById('inquirySheetNum').innerHTML = this.orderExport
document.getElementById('supplier').innerHTML = ''
exportExcelMethod('inquirySheet', '采购询价单', '采购询价单sheet')
}
}).catch(res => { }).catch(res => {
console.log(res) console.log(res)
this.$message({ this.$message({
@@ -1592,7 +1596,6 @@ export default {
searchTable3(row) { // 查询该询价单中的物料和零件 searchTable3(row) { // 查询该询价单中的物料和零件
this.tableData3 = [] this.tableData3 = []
this.inquirySheetFlowNum = row.询价单流水号 this.inquirySheetFlowNum = row.询价单流水号
this.supplierExport = row.供应商名称
this.orderExport = row.询价单编号 this.orderExport = row.询价单编号
searchSheetDetail(row.询价单流水号).then(response => { searchSheetDetail(row.询价单流水号).then(response => {
console.log(response.data) console.log(response.data)