更新
This commit is contained in:
@@ -22,6 +22,17 @@
|
||||
<el-input v-model="Name" placeholder="名称规格型号" size="small" clearable/>
|
||||
<!-- <el-input v-model="spec" placeholder="规格" size="small" clearable/>-->
|
||||
<!-- <el-input v-model="model" placeholder="型号" size="small" clearable/>-->
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
style="width:250px;margin-left: 5px"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
|
||||
<el-tooltip :open-delay="1000" effect="dark" content="将全部采购件导出到表格" placement="top">
|
||||
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 15px" @click="exportDetail()">导出</el-button>
|
||||
@@ -116,6 +127,11 @@
|
||||
{{ scope.row.备注 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
@@ -215,6 +231,11 @@
|
||||
{{ scope.row.备注 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
@@ -321,6 +342,11 @@
|
||||
{{ scope.row.备注 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="下达任务时间" min-width="100px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作日期 ? scope.row.操作日期.split(' ')[0] : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
@@ -345,6 +371,7 @@ export default {
|
||||
name: '', // 采购件采购查询
|
||||
data() {
|
||||
return {
|
||||
startTime: '',
|
||||
Name: '',
|
||||
spec: '',
|
||||
model: '',
|
||||
@@ -381,17 +408,18 @@ export default {
|
||||
methods: {
|
||||
// 导出采购物料执行情况
|
||||
exportDetail() {
|
||||
let check1, check2
|
||||
let check1, check2, check3
|
||||
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 1).then(res1 => { // 标准件
|
||||
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 2).then(res2 => { // 外购件
|
||||
searchTable2Export(check1, this.machineNumberValue, check2, this.groupNumberValue).then(res3 => { // 基本件
|
||||
this.startTime ? check3 = 1 : (check3 = 0, this.startTime = '')
|
||||
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 1, check3, this.startTime[0], this.startTime[1]).then(res1 => { // 标准件
|
||||
searchTable1Export(check1, this.machineNumberValue, check2, this.groupNumberValue, 2, check3, this.startTime[0], this.startTime[1]).then(res2 => { // 外购件
|
||||
searchTable2Export(check1, this.machineNumberValue, check2, this.groupNumberValue, check3, this.startTime[0], this.startTime[1]).then(res3 => { // 基本件
|
||||
import('./Export2Excel').then(excel => {
|
||||
const dataGroup = []
|
||||
const filterVal1 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData0里的属性名
|
||||
const filterVal2 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '备注'] // tableData1里的属性名
|
||||
const filterVal3 = ['机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '零件数量', '数量', '已到货数量', '供应商名称', '采购合同编号', '姓名', '供货商', '备注'] // tableData2里的属性名
|
||||
const filterVal1 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '操作日期', '备注'] // tableData0里的属性名
|
||||
const filterVal2 = ['机床图号', '组号', '物料名称', '物料型号', '物料规格', '零件数量', ['数量', '离线采购数量'], ['已到货数量', '离线到货数量'], ['供应商名称', '离线合同供应商名称'], ['采购合同编号', '离线合同编号'], '姓名', '供货商', '操作日期', '备注'] // tableData1里的属性名
|
||||
const filterVal3 = ['机床图号', '组号', '零件名称', '零件图号', '规格', '材料', '零件数量', '数量', '已到货数量', '供应商名称', '采购合同编号', '姓名', '供货商', '操作日期', '备注'] // tableData2里的属性名
|
||||
const data1 = res1.data.map(v => filterVal1.map(j => {
|
||||
if (typeof (j) === 'string') {
|
||||
return v[j] || '—'
|
||||
@@ -402,13 +430,13 @@ export default {
|
||||
data1.map(v => {
|
||||
v.push('') // 物料状态
|
||||
if (v[10] === '—') {
|
||||
v[13] = '未分配'
|
||||
v[14] = '未分配'
|
||||
} else if (v[6] === '—') {
|
||||
v[13] = '未采购'
|
||||
v[14] = '未采购'
|
||||
} else if (v[6] !== '—' && v[6] !== v[7]) {
|
||||
v[13] = '未全部到货'
|
||||
v[14] = '未全部到货'
|
||||
} else if (v[6] !== '—' && v[6] === v[7]) {
|
||||
v[13] = '全部到货'
|
||||
v[14] = '全部到货'
|
||||
}
|
||||
})
|
||||
dataGroup.push(data1)
|
||||
@@ -422,13 +450,13 @@ export default {
|
||||
data2.map(v => {
|
||||
v.push('') // 物料状态
|
||||
if (v[10] === '—') {
|
||||
v[13] = '未分配'
|
||||
v[14] = '未分配'
|
||||
} else if (v[6] === '—') {
|
||||
v[13] = '未采购'
|
||||
v[14] = '未采购'
|
||||
} else if (v[6] !== '—' && v[6] !== v[7]) {
|
||||
v[13] = '未全部到货'
|
||||
v[14] = '未全部到货'
|
||||
} else if (v[6] !== '—' && v[6] === v[7]) {
|
||||
v[13] = '全部到货'
|
||||
v[14] = '全部到货'
|
||||
}
|
||||
})
|
||||
dataGroup.push(data2)
|
||||
@@ -442,19 +470,19 @@ export default {
|
||||
data3.map(v => {
|
||||
v.push('') // 物料状态
|
||||
if (v[11] === '—') {
|
||||
v[14] = '未分配'
|
||||
v[15] = '未分配'
|
||||
} else if (v[7] === '—') {
|
||||
v[14] = '未采购'
|
||||
v[15] = '未采购'
|
||||
} else if (v[7] !== '—' && v[7] !== v[8]) {
|
||||
v[14] = '未全部到货'
|
||||
v[15] = '未全部到货'
|
||||
} else if (v[7] !== '—' && v[7] === v[8]) {
|
||||
v[14] = '全部到货'
|
||||
v[15] = '全部到货'
|
||||
}
|
||||
})
|
||||
dataGroup.push(data3)
|
||||
const headerGroup = [['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
|
||||
['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态'],
|
||||
['机床号', '组号', '名称', '图号或型号', '规格', '材料', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '备注', '物料状态']]
|
||||
const headerGroup = [['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态'],
|
||||
['机床号', '组号', '名称', '图号或型号', '规格', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态'],
|
||||
['机床号', '组号', '名称', '图号或型号', '规格', '材料', '技术下达数量', '合同采购数量', '到货数量', '供应商', '合同编号', '采购员', '供货商', '下达任务时间', '备注', '物料状态']]
|
||||
const sheetGroup = ['标准件', '外购件', '基本件']
|
||||
excel.export_json_to_excel({
|
||||
headerGroup: headerGroup,
|
||||
@@ -529,13 +557,15 @@ export default {
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable0() { // 查询标准件
|
||||
let check1, check2, check3, check4, check5
|
||||
this.tableData0 = []
|
||||
let check1, check2, check3, check4, check5, check6
|
||||
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||
this.Name ? check3 = 1 : check3 = 0
|
||||
this.spec ? check4 = 1 : check4 = 0
|
||||
this.model ? check5 = 1 : check5 = 0
|
||||
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
|
||||
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
|
||||
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
|
||||
console.log(this.tableData0)
|
||||
if (response.data.rows.length !== 0) {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
@@ -561,7 +591,8 @@ export default {
|
||||
备注: response.data.rows[i].备注,
|
||||
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
|
||||
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
|
||||
不合格数量: response.data.rows[i].不合格数量
|
||||
不合格数量: response.data.rows[i].不合格数量,
|
||||
操作日期: response.data.rows[i].操作日期
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -569,13 +600,15 @@ export default {
|
||||
})
|
||||
},
|
||||
searchTable1() { // 查询外购件
|
||||
let check1, check2, check3, check4, check5
|
||||
this.tableData1 = []
|
||||
let check1, check2, check3, check4, check5, check6
|
||||
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||
this.Name ? check3 = 1 : check3 = 0
|
||||
this.spec ? check4 = 1 : check4 = 0
|
||||
this.model ? check5 = 1 : check5 = 0
|
||||
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
|
||||
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
|
||||
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
|
||||
this.total1 = response.data.total
|
||||
if (response.data.rows.length !== 0) {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
@@ -601,7 +634,8 @@ export default {
|
||||
备注: response.data.rows[i].备注,
|
||||
采购数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].数量 || response.data.rows[i].离线采购数量 || '—',
|
||||
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
|
||||
不合格数量: response.data.rows[i].不合格数量
|
||||
不合格数量: response.data.rows[i].不合格数量,
|
||||
操作日期: response.data.rows[i].操作日期
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -609,13 +643,14 @@ export default {
|
||||
})
|
||||
},
|
||||
searchTable2() { // 查询基本件
|
||||
let check1, check2, check3, check4, check5
|
||||
let check1, check2, check3, check4, check5, check6
|
||||
this.machineNumberValue ? check1 = 1 : check1 = 0
|
||||
this.groupNumberValue ? check2 = 1 : check2 = 0
|
||||
this.Name ? check3 = 1 : check3 = 0
|
||||
this.spec ? check4 = 1 : check4 = 0
|
||||
this.model ? check5 = 1 : check5 = 0
|
||||
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.Name, check4, this.spec, check5, this.model).then(response => {
|
||||
this.startTime ? check6 = 1 : (check6 = 0, this.startTime = '')
|
||||
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.Name, check4, this.spec, check5, this.model, check6, this.startTime[0], this.startTime[1]).then(response => {
|
||||
this.tableData2 = response.data.rows
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user