外协厂家效率
This commit is contained in:
@@ -45,3 +45,15 @@ export function getExport(check, supplierNameValue, check1, MaterialsValue, chec
|
||||
}
|
||||
})
|
||||
}
|
||||
export function search1() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
UserID: state.state.user.id,
|
||||
ModularID: router.currentRoute.path,
|
||||
type: '1',
|
||||
name: '车间生产管理_外协厂家效率图表_查询'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||
<span>外协厂家</span>
|
||||
<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-select v-model="MaterialsValue" placeholder="外协状态" filterable size="small" style="width: 120px" clearable>
|
||||
<el-option
|
||||
v-for="item in Materials"
|
||||
:key="item.value"
|
||||
@@ -79,14 +76,17 @@
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div id="myChart1" :style="{width: '100%', height: '400px', margin: 'auto'}"/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchTable, getprocedure } from '@/api/Outsourcing/OutsourcingPartsQuery'
|
||||
import { searchTable, getprocedure, search1 } from '@/api/Outsourcing/OutsourcingPartsQuery'
|
||||
import echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
return {
|
||||
timer: '',
|
||||
@@ -110,6 +110,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getTableData()
|
||||
this.search1()
|
||||
},
|
||||
methods: {
|
||||
formatJson(filterVal, jsonData) {
|
||||
@@ -164,7 +165,6 @@ export default {
|
||||
})
|
||||
},
|
||||
exportExcel1() {
|
||||
console.log(this.tableData1, 232332)
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const tHeader = ['外协状态', '项目名称', '零件图号', '零件名称', '数量', '外协工序', '外协厂家', '外协单号', '外协日期']
|
||||
const filterVal = ['到货状态', '项目名称', '零件图号', '零件名称', '批次数量', '外协工序', '外协厂家名称', '表单号', '任务下达日期']
|
||||
@@ -180,8 +180,6 @@ export default {
|
||||
})
|
||||
},
|
||||
getTableData() {
|
||||
// console.log(this.timer[0], 1)
|
||||
// console.log(this.timer[1], 2)
|
||||
this.tableData = []
|
||||
this.loading = true
|
||||
let check, check1, check2
|
||||
@@ -191,17 +189,14 @@ export default {
|
||||
} 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({
|
||||
@@ -242,6 +237,70 @@ export default {
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTableData()
|
||||
},
|
||||
// 统计图
|
||||
search1() {
|
||||
search1().then(response => {
|
||||
this.res1 = response.data
|
||||
}).then(() => {
|
||||
var myChart1 = echarts.init(document.getElementById('myChart1'))
|
||||
myChart1.clear()
|
||||
this.drawLine1(this.res1)
|
||||
})
|
||||
},
|
||||
drawLine1(data) {
|
||||
var dataX = []
|
||||
var lineData1 = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
dataX.push(data[i].外协厂家名称)
|
||||
lineData1.push(data[i].时间)
|
||||
}
|
||||
var myChart1 = echarts.init(document.getElementById('myChart1'))
|
||||
myChart1.clear()
|
||||
myChart1.setOption({
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '8%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '外协厂家',
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 0,
|
||||
margin: 10
|
||||
},
|
||||
data: dataX
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '天',
|
||||
min: 0,
|
||||
scale: 'true'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '加工时间',
|
||||
type: 'bar',
|
||||
color: '#67C23A',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'inside'
|
||||
}
|
||||
},
|
||||
data: lineData1
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user