外协零件查询导出
This commit is contained in:
@@ -13,15 +13,27 @@ export function getprocedure(processPlan, single) {
|
||||
})
|
||||
}
|
||||
// 查询外协零件
|
||||
export function searchTable(check, supplierNameValue, check1, MaterialsValue, pageSize, pageCurrent) {
|
||||
export function searchTable(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, pageSize, pageCurrent) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理_外协零件_查询数据',
|
||||
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue,
|
||||
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2,
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询外协零件
|
||||
export function getExport(check, supplierNameValue, check1, MaterialsValue, check2, time1, time2, pageSize, pageCurrent) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理_外协零件_查询数据',
|
||||
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue + '&时间_check=' + check2 + '&开始时间=' + time1 + '&结束时间=' + time2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function searchTable1(...params) {
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '采购管理_采购部采购_查询物料_分配后_加供应商',
|
||||
name: '采购管理_采购部采购_查询物料_分配后_加供应商_新',
|
||||
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}&物料名称_check=${params[7]}&物料名称=${params[8]}&物料规格_check=${params[9]}&物料规格=${params[10]}&物料型号_check=${params[11]}&物料型号=${params[12]}`,
|
||||
Pagination: params[4] + '&' + params[5]
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoic
|
||||
export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement
|
||||
export const uploadPerson = `http://192.168.1.231:8411/submit/uploadPerson.ashx`
|
||||
export const uploadOP = `http://192.168.1.231:8411/submit/uploadOP.ashx`
|
||||
export const url = `http://192.168.1.231:8411/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
|
||||
export const ExcelDownLoad = 'http://192.168.1.231:8411/submit/downloadFile.ashx' // 导出excel
|
||||
export const url = `http://192.168.0.101:8074/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
|
||||
export const ExcelDownLoad = 'http://192.168.0.101:8074/submit/downloadFile.ashx' // 导出excel
|
||||
// 技术中心程序发布时要更改下面所有的IP到0段
|
||||
export const ServerIP = `http://192.168.1.231:8411/webpage/file/`
|
||||
export const uploadFileMachine = `http://192.168.1.231:8411/submit/uploadFileMachine.ashx` // 机床总图 发布时改成0.231
|
||||
@@ -26,7 +26,7 @@ export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFil
|
||||
export const MESUploadFile = `http://192.168.1.231:8411/submit/MESUploadFile.ashx`
|
||||
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
|
||||
const service = axios.create({
|
||||
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
|
||||
baseURL: `http://192.168.0.101:8074/submit/MESCommonBase.ashx`,
|
||||
timeout: 1500000 // 请求超时时间
|
||||
})
|
||||
export default service
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<el-card style="width: 65%">
|
||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||
<span>外协厂家</span>
|
||||
<el-input v-model="supplierNameValue" size="small" placeholder="外协厂家" style="width: 160px" clearable/>
|
||||
<el-input v-model="supplierNameValue" size="small" placeholder="外协厂家或零件图号" style="width: 180px" clearable/>
|
||||
<span>外协日期</span>
|
||||
<el-date-picker v-model="timer" type="daterange" value-format="yyyy-MM-dd" size="small" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"/>
|
||||
<span>外协状态</span>
|
||||
<el-select v-model="MaterialsValue" placeholder="外协状态" filterable size="small" style="width: 100px" clearable>
|
||||
<el-option
|
||||
@@ -13,9 +15,10 @@
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrent = 1;pageSize = 50;getTableData()">查询</el-button>
|
||||
<el-button type="warning" class="el-icon-download" size="small" style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="width: 65%">
|
||||
<el-card style="width: 70%">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
@@ -79,6 +82,12 @@
|
||||
width="200">
|
||||
<template slot-scope="scope">{{ scope.row.表单号 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="外协日期"
|
||||
align="center"
|
||||
width="100">
|
||||
<template slot-scope="scope">{{ scope.row.任务下达日期.substr(0,10) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
@@ -96,10 +105,12 @@
|
||||
|
||||
<script>
|
||||
import { searchTable, getprocedure } from '@/api/Outsourcing/OutsourcingPartsQuery'
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
return {
|
||||
timer: '',
|
||||
supplierNameValue: '',
|
||||
loading: false,
|
||||
total: 0,
|
||||
@@ -114,24 +125,105 @@ export default {
|
||||
tableData: [],
|
||||
procedure: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 50
|
||||
pageSize: 50,
|
||||
tableData1: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
getTableData() {
|
||||
this.tableData = []
|
||||
this.loading = true
|
||||
let check, check1
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
exportExcel() {
|
||||
this.tableData1 = []
|
||||
let check, check1, check2
|
||||
this.supplierNameValue ? check = 1 : check = 0
|
||||
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
|
||||
check1 = 1
|
||||
} else {
|
||||
check1 = 0
|
||||
}
|
||||
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, this.pageSize, this.pageCurrent).then(response => {
|
||||
if (this.timer === null) {
|
||||
this.timer = ''
|
||||
}
|
||||
if (this.timer[1] === undefined || this.timer[0] === undefined || this.timer[1] === null || this.timer[0] === null) {
|
||||
check2 = 0
|
||||
} else {
|
||||
check2 = 1
|
||||
}
|
||||
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, check2, this.timer[0], this.timer[1], 100000000, this.pageCurrent).then(response => {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData1.push({
|
||||
到货状态: response.data.rows[i].到货状态,
|
||||
项目名称: response.data.rows[i].项目名称,
|
||||
零件图号: response.data.rows[i].零件图号,
|
||||
零件名称: response.data.rows[i].零件名称,
|
||||
批次数量: response.data.rows[i].批次数量,
|
||||
外协厂家名称: response.data.rows[i].外协厂家名称,
|
||||
表单号: response.data.rows[i].表单号,
|
||||
工艺计划流水号: response.data.rows[i].工艺计划流水号,
|
||||
单件是否外协: response.data.rows[i].单件是否外协,
|
||||
任务下达日期: response.data.rows[i].任务下达日期,
|
||||
外协工序: ''
|
||||
})
|
||||
}
|
||||
for (let i = 0; i < this.tableData1.length; i++) {
|
||||
getprocedure(this.tableData1[i].工艺计划流水号, this.tableData1[i].单件是否外协).then(response => {
|
||||
this.procedure[i] = ''
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称
|
||||
}
|
||||
this.tableData1[i].外协工序 = this.procedure[i]
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
setTimeout(this.exportExcel1, 500)
|
||||
})
|
||||
},
|
||||
exportExcel1() {
|
||||
console.log(this.tableData1, 232332)
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['外协状态', '项目名称', '零件图号', '零件名称', '数量', '外协工序', '外协厂家', '外协单号', '外协日期']
|
||||
const filterVal = ['到货状态', '项目名称', '零件图号', '零件名称', '批次数量', '外协工序', '外协厂家名称', '表单号', '任务下达日期']
|
||||
const list = this.tableData1
|
||||
const data = this.formatJson(filterVal, list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '外协零件表',
|
||||
autoWidth: true,
|
||||
bookType: 'xlsx'
|
||||
})
|
||||
})
|
||||
},
|
||||
getTableData() {
|
||||
// console.log(this.timer[0], 1)
|
||||
// console.log(this.timer[1], 2)
|
||||
this.tableData = []
|
||||
this.loading = true
|
||||
let check, check1, check2
|
||||
this.supplierNameValue ? check = 1 : check = 0
|
||||
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
|
||||
check1 = 1
|
||||
} else {
|
||||
check1 = 0
|
||||
}
|
||||
// this.timer === null ? (check2 = 0, this.timer = '') : check2 = 1
|
||||
if (this.timer === null) {
|
||||
this.timer = ''
|
||||
console.log(this.timer, 123)
|
||||
}
|
||||
if (this.timer[1] === undefined || this.timer[0] === undefined || this.timer[1] === null || this.timer[0] === null) {
|
||||
check2 = 0
|
||||
} else {
|
||||
check2 = 1
|
||||
}
|
||||
console.log(check2, 4564688)
|
||||
searchTable(check, this.supplierNameValue, check1, this.MaterialsValue, check2, this.timer[0], this.timer[1], this.pageSize, this.pageCurrent).then(response => {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData.push({
|
||||
到货状态: response.data.rows[i].到货状态,
|
||||
@@ -143,6 +235,7 @@ export default {
|
||||
表单号: response.data.rows[i].表单号,
|
||||
工艺计划流水号: response.data.rows[i].工艺计划流水号,
|
||||
单件是否外协: response.data.rows[i].单件是否外协,
|
||||
任务下达日期: response.data.rows[i].任务下达日期,
|
||||
外协工序: ''
|
||||
})
|
||||
}
|
||||
|
||||
@@ -77,12 +77,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="采购数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
|
||||
{{ scope.row.采购数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
|
||||
{{ scope.row.到货数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="不合格数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货状态" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
|
||||
<span v-else>未到货</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="150px" show-overflow-tooltip>
|
||||
@@ -165,12 +176,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="采购数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || scope.row.离线采购数量 || '—' }}
|
||||
{{ scope.row.采购数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || scope.row.离线到货数量 || '—' }}
|
||||
{{ scope.row.到货数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="不合格数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货状态" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
|
||||
<span v-else>未到货</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="150px" show-overflow-tooltip>
|
||||
@@ -258,14 +280,27 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="采购数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购数量 }}
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.数量 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到货数量 }}
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.已到货数量 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="不合格数量" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.不合格数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到货状态" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="Number(scope.row.到货数量) >= Number(scope.row.采购数量)">已到货</span>
|
||||
<span v-else>未到货</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="供应商" prop="供应商名称" min-width="100px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='' ? '—' : scope.row.供应商名称 || '—' }}
|
||||
@@ -502,7 +537,34 @@ export default {
|
||||
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 => {
|
||||
console.log(this.tableData0)
|
||||
this.tableData0 = response.data.rows
|
||||
if (response.data.rows.length !== 0) {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData0.push({
|
||||
人员编号: response.data.rows[i].人员编号,
|
||||
询价状态编号: response.data.rows[i].询价状态编号,
|
||||
采购状态编号: response.data.rows[i].采购状态编号,
|
||||
机床图号: response.data.rows[i].机床图号,
|
||||
组号: response.data.rows[i].组号,
|
||||
物料名称: response.data.rows[i].物料名称,
|
||||
物料型号: response.data.rows[i].物料型号,
|
||||
物料规格: response.data.rows[i].物料规格,
|
||||
供货商: response.data.rows[i].供货商,
|
||||
零件数量: response.data.rows[i].零件数量,
|
||||
数量: response.data.rows[i].数量,
|
||||
离线采购数量: response.data.rows[i].离线采购数量,
|
||||
已到货数量: response.data.rows[i].已到货数量,
|
||||
离线到货数量: response.data.rows[i].离线到货数量,
|
||||
供应商名称: response.data.rows[i].供应商名称,
|
||||
离线合同供应商名称: response.data.rows[i].离线合同供应商名称,
|
||||
采购合同编号: 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].离线采购数量 || '—',
|
||||
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
|
||||
不合格数量: response.data.rows[i].不合格数量
|
||||
})
|
||||
}
|
||||
}
|
||||
this.total0 = response.data.total
|
||||
})
|
||||
},
|
||||
@@ -514,8 +576,36 @@ export default {
|
||||
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.tableData1 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
if (response.data.rows.length !== 0) {
|
||||
for (let i = 0; i < response.data.rows.length; i++) {
|
||||
this.tableData1.push({
|
||||
人员编号: response.data.rows[i].人员编号,
|
||||
询价状态编号: response.data.rows[i].询价状态编号,
|
||||
采购状态编号: response.data.rows[i].采购状态编号,
|
||||
机床图号: response.data.rows[i].机床图号,
|
||||
组号: response.data.rows[i].组号,
|
||||
物料名称: response.data.rows[i].物料名称,
|
||||
物料型号: response.data.rows[i].物料型号,
|
||||
物料规格: response.data.rows[i].物料规格,
|
||||
供货商: response.data.rows[i].供货商,
|
||||
零件数量: response.data.rows[i].零件数量,
|
||||
数量: response.data.rows[i].数量,
|
||||
离线采购数量: response.data.rows[i].离线采购数量,
|
||||
已到货数量: response.data.rows[i].已到货数量,
|
||||
离线到货数量: response.data.rows[i].离线到货数量,
|
||||
供应商名称: response.data.rows[i].供应商名称,
|
||||
离线合同供应商名称: response.data.rows[i].离线合同供应商名称,
|
||||
采购合同编号: 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].离线采购数量 || '—',
|
||||
到货数量: Number(response.data.rows[i].询价状态编号) === 1 && response.data.rows[i].人员编号 !== '' ? '—' : response.data.rows[i].已到货数量 || response.data.rows[i].离线到货数量 || '—',
|
||||
不合格数量: response.data.rows[i].不合格数量
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log(response.data.total, this.total1, 898989)
|
||||
})
|
||||
},
|
||||
searchTable2() { // 查询基本件
|
||||
|
||||
Reference in New Issue
Block a user