询价单合并数量
This commit is contained in:
@@ -790,7 +790,7 @@
|
||||
<script>
|
||||
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
|
||||
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 { exportExcelMethod } from './exportExcel'
|
||||
import $ from 'jquery'
|
||||
@@ -942,7 +942,6 @@ export default {
|
||||
standardAndPurchaseValue: '', // 标准件和外购件流水号
|
||||
title2: '',
|
||||
orderExport: '',
|
||||
supplierExport: '',
|
||||
useNumber: '',
|
||||
maxUseNumber: '',
|
||||
dialogVisible4: false,
|
||||
@@ -1142,7 +1141,7 @@ export default {
|
||||
})
|
||||
},
|
||||
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) { // 筛选备注
|
||||
return row['备注'] === value
|
||||
@@ -1348,47 +1347,49 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.tableData3.length === 0 && !this.supplierExport) {
|
||||
this.$message.error('请选择正确的询价单导出')
|
||||
} else {
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementsByClassName('inquirySheet')[0]
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
searchMerge(this.inquirySheetFlowNum).then(res => {
|
||||
if (res.data.length === 0) {
|
||||
this.$message.error('请选择正确的询价单导出')
|
||||
} else {
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementsByClassName('inquirySheet')[0]
|
||||
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 = ''
|
||||
}
|
||||
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 = ''
|
||||
}
|
||||
}).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()
|
||||
}).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 => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
@@ -1403,37 +1404,40 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.tableData3.length === 0 && !this.supplierExport) {
|
||||
this.$message.error('请选择正确的询价单导出')
|
||||
} else {
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementsByClassName('inquirySheet')[0]
|
||||
if (children.length !== 0) {
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
parent.removeChild(children[i])
|
||||
// 询价单导出结果
|
||||
searchMerge(this.inquirySheetFlowNum).then(res => {
|
||||
if (res.data.length === 0) {
|
||||
this.$message.error('请选择正确的询价单导出')
|
||||
} else {
|
||||
const children = document.getElementsByClassName('tableData')
|
||||
const parent = document.getElementsByClassName('inquirySheet')[0]
|
||||
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 => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
@@ -1592,7 +1596,6 @@ export default {
|
||||
searchTable3(row) { // 查询该询价单中的物料和零件
|
||||
this.tableData3 = []
|
||||
this.inquirySheetFlowNum = row.询价单流水号
|
||||
this.supplierExport = row.供应商名称
|
||||
this.orderExport = row.询价单编号
|
||||
searchSheetDetail(row.询价单流水号).then(response => {
|
||||
console.log(response.data)
|
||||
|
||||
Reference in New Issue
Block a user