更新
This commit is contained in:
27
src/api/Outsourcing/OutsourcingPartsQuery.js
Normal file
27
src/api/Outsourcing/OutsourcingPartsQuery.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取零件工序信息(零件号表中)
|
||||||
|
export function getprocedure(processPlan, single) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理工艺_零件工序_查询数据_根据工艺计划流水号_工艺名称简称_新',
|
||||||
|
param: '工艺计划流水号=' + processPlan + '=int&单件是否外协=' + single + '=int'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询外协零件
|
||||||
|
export function searchTable(check, supplierNameValue, check1, MaterialsValue, pageSize, pageCurrent) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '车间生产管理_外协零件_查询数据',
|
||||||
|
param: '外协厂家_check=' + check + '&外协厂家=' + supplierNameValue + '&外协状态_check=' + check1 + '&外协状态=' + MaterialsValue,
|
||||||
|
Pagination: pageCurrent + '&' + pageSize
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
25
src/api/PurchasingCenter/PurchasingEfficiencyAnalysis.js
Normal file
25
src/api/PurchasingCenter/PurchasingEfficiencyAnalysis.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getData(date1, date2) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '采购管理_采购效率_查询数据_折线图',
|
||||||
|
param: '开始时间=' + date1 + '&结束时间=' + date2
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getData1(num) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
type: '1',
|
||||||
|
name: '采购管理_采购效率分析_查询',
|
||||||
|
param: '采购合同流水号=' + num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -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 MESUploadFile = `http://192.168.1.231:8411/submit/MESUploadFile.ashx`
|
||||||
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
|
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: `http://192.168.0.103:8074/submit/MESCommonBase.ashx`,
|
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
|
||||||
timeout: 1500000 // 请求超时时间
|
timeout: 1500000 // 请求超时时间
|
||||||
})
|
})
|
||||||
export default service
|
export default service
|
||||||
|
|||||||
231
src/views/Outsourcing/OutsourcingPartsQuery/index.vue
Normal file
231
src/views/Outsourcing/OutsourcingPartsQuery/index.vue
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<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/>
|
||||||
|
<span>外协状态</span>
|
||||||
|
<el-select v-model="MaterialsValue" placeholder="外协状态" filterable size="small" style="width: 100px" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in Materials"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
<el-button icon="el-icon-search" type="success" size="small" @click="pageCurrent = 1;pageSize = 50;getTableData()">查询</el-button>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="width: 65%">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="tableData"
|
||||||
|
highlight-current-row
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
size="mini"
|
||||||
|
style="width: 100%"
|
||||||
|
height="760">
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
type="index"
|
||||||
|
width="50"/>
|
||||||
|
<el-table-column
|
||||||
|
label="外协状态"
|
||||||
|
align="center"
|
||||||
|
width="70px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="Number(scope.row.到货状态)!==1" type="warning" size="mini">未到</el-tag>
|
||||||
|
<el-tag v-if="Number(scope.row.到货状态)===1" type="success" size="mini">已到</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="项目名称"
|
||||||
|
align="center"
|
||||||
|
width="140px">
|
||||||
|
<template slot-scope="scope">{{ scope.row.项目名称 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="零件图号"
|
||||||
|
align="center"
|
||||||
|
width="160px">
|
||||||
|
<template slot-scope="scope">{{ scope.row.零件图号 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="零件名称"
|
||||||
|
align="center"
|
||||||
|
width="120px">
|
||||||
|
<template slot-scope="scope">{{ scope.row.零件名称 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量" align="center" width="70">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.批次数量 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="外协工序" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.外协工序 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="外协厂家"
|
||||||
|
align="center"
|
||||||
|
width="160px">
|
||||||
|
<template slot-scope="scope">{{ scope.row.外协厂家名称 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="外协单号"
|
||||||
|
align="center"
|
||||||
|
width="200">
|
||||||
|
<template slot-scope="scope">{{ scope.row.表单号 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="block" style="margin-top: 10px;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="pageCurrent"
|
||||||
|
:page-sizes="[10, 20, 30, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChanges"
|
||||||
|
@current-change="handleCurrentChanges"/>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { searchTable, getprocedure } from '@/api/Outsourcing/OutsourcingPartsQuery'
|
||||||
|
export default {
|
||||||
|
name: 'Index',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
supplierNameValue: '',
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
MaterialsValue: '',
|
||||||
|
Materials: [{
|
||||||
|
value: 0,
|
||||||
|
label: '未到'
|
||||||
|
}, {
|
||||||
|
value: 1,
|
||||||
|
label: '已到'
|
||||||
|
}],
|
||||||
|
tableData: [],
|
||||||
|
procedure: [],
|
||||||
|
pageCurrent: 1,
|
||||||
|
pageSize: 50
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.tableData = []
|
||||||
|
this.loading = true
|
||||||
|
let check, check1
|
||||||
|
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 => {
|
||||||
|
for (let i = 0; i < response.data.rows.length; i++) {
|
||||||
|
this.tableData.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].单件是否外协,
|
||||||
|
外协工序: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.getProcedure(this.tableData)
|
||||||
|
this.total = response.data.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProcedure(row) {
|
||||||
|
for (let i = 0; i < row.length; i++) {
|
||||||
|
getprocedure(row[i].工艺计划流水号, row[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.tableData[i].外协工序 = this.procedure[i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSizeChanges(val) {
|
||||||
|
this.pageCurrent = 1
|
||||||
|
this.pageSize = val
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
handleCurrentChanges(val) {
|
||||||
|
this.pageCurrent = val
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
span{
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
.wrapper{
|
||||||
|
width: 225px;
|
||||||
|
height: 50px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid #b8c7d9;
|
||||||
|
float: left;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
position: relative;
|
||||||
|
padding: 8px 8px 0 8px;
|
||||||
|
}
|
||||||
|
.action{
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 8px;
|
||||||
|
}
|
||||||
|
.delete{
|
||||||
|
padding: 0 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: #0f84b0;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.delete:hover{
|
||||||
|
background: -webkit-linear-gradient(top,#0ba9e3,#0099d3);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
a{
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.icon{
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 7px;
|
||||||
|
margin-top: 2px;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
.info{
|
||||||
|
position: absolute;
|
||||||
|
left: 44px;
|
||||||
|
line-height: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.el-card {
|
||||||
|
padding: 0px !important;
|
||||||
|
margin: 0px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<span style="margin-left: 10px">时间段:</span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="date1"
|
||||||
|
style="width:160px;margin:10px;"
|
||||||
|
size="small"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期"/>
|
||||||
|
<span>~</span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="date2"
|
||||||
|
style="width:160px;margin:10px;"
|
||||||
|
size="small"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期"/>
|
||||||
|
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchData1()">查询</el-button>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<div id="myChart" style="width: 1000px; height: 570px; margin: auto"/>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getData, getData1 } from '@/api/PurchasingCenter/PurchasingEfficiencyAnalysis'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableData: [],
|
||||||
|
data1: '',
|
||||||
|
data2: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.tableData = []
|
||||||
|
getData(this.date1, this.date2).then(response => {
|
||||||
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
|
this.tableData.push({
|
||||||
|
采购合同流水号: response.data[i].采购合同流水号,
|
||||||
|
采购合同编号: response.data[i].采购合同编号,
|
||||||
|
合同生成日期: response.data[i].操作日期,
|
||||||
|
平均分配日期: '',
|
||||||
|
平均采购时间: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.getTableData1(this.tableData)
|
||||||
|
}).then(() => {
|
||||||
|
this.drawLine()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTableData1(row) {
|
||||||
|
for (let i = 0; i < row.length; i++) {
|
||||||
|
getData1(row[i].采购合同流水号).then(response => {
|
||||||
|
this.tableData[i].平均分配日期 = response.data[0].平均分配日期
|
||||||
|
this.tableData[i].平均采购时间 = response.data[0].平均采购时间
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 绘制图形
|
||||||
|
drawLine() {
|
||||||
|
const myChart = this.$echarts.init(document.getElementById('myChart'))
|
||||||
|
const xData = []
|
||||||
|
const lineData = []
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
xData.push(this.tableData[i].采购合同编号.split(' ')[0])
|
||||||
|
lineData.push(this.tableData[i].平均采购时间.toFixed(2))
|
||||||
|
}
|
||||||
|
myChart.clear()
|
||||||
|
myChart.setOption({
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'cross',
|
||||||
|
crossStyle: {
|
||||||
|
color: '#999'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['采购用时']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: 'category',
|
||||||
|
name: '合同编号',
|
||||||
|
data: xData,
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
name: '采购用时'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '采购用时',
|
||||||
|
type: 'line',
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
show: true,
|
||||||
|
position: 'top'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: lineData
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -144,6 +144,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
|
this.getTableData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData() {
|
fetchData() {
|
||||||
|
|||||||
@@ -699,9 +699,9 @@ export default {
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
.el-table .adopt{
|
.el-table .adopt{
|
||||||
background: limegreen;
|
background: #9BD7FC;
|
||||||
}
|
}
|
||||||
.el-table .NotThrough{
|
.el-table .NotThrough{
|
||||||
background: palevioletred;
|
background: #FF9759;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user