备料出库

This commit is contained in:
zhangdingyu
2019-03-20 18:36:10 +08:00
parent 78e979277c
commit 3fd43e9af4
2 changed files with 136 additions and 51 deletions

View File

@@ -25,7 +25,7 @@ export function searchtable2(num1) {
}
})
}
// 完成备料工序
export function handlechange(Number, code) {
return request({
url: '',
@@ -37,17 +37,32 @@ export function handlechange(Number, code) {
}
})
}
// 查询外购备料零件
export function searchtable3(num, num1, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_外购备料查询',
param: '零件图号_check=' + num + '&零件图号=' + num1,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 自家备料出库
export function change(Number, code, num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_备料到货更改',
param: '工流水号=' + Number + '&工作者考勤编号=' + code + '&工艺计划流水号组=' + num
name: '车间生产管理工艺_备料到货_状态更改',
param: '工艺计划流水号=' + Number + '&重量=' + code + '&单价=' + num
}
})
}
// 外购备料出库
export function change2(Number, code, num) {
return request({
url: '',

View File

@@ -6,24 +6,13 @@
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<!--<el-checkbox v-model="all" size="mini" @change="searchTable">查询全部</el-checkbox>-->
<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">自家备料出库</el-button>
<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit2()">外购备料出库</el-button>
<!--<el-button :disabled="all" size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">自家备料出库</el-button>-->
<!--<el-button size="small" icon="el-icon-refresh" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">刷新</el-button>-->
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
@@ -39,6 +28,25 @@
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
<el-table-column prop="request" label="重量(kg)" align="center" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.重量" size="mini"/>
</template>
</el-table-column>
<el-table-column prop="request" label="单价(元)" align="center" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.单价" size="mini"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
class="el-icon-edit"
@click="handleChange1(scope.row)">出库</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -53,17 +61,17 @@
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<span>零件图号:</span>
<el-input v-model="partName2" placeholder="零件图号" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="total2=0;pageSize2=10; pageCurrent2=1;searchTable2()">查询</el-button>
<el-button size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">外购备料出库</el-button>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="tableData2" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column label="到货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
@@ -74,22 +82,32 @@
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<el-table-column label="重量" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
{{ scope.row.重量1 }}
</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">
<template slot-scope="scope">
{{ scope.row.备注1 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
v-if="!loading2"
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
@@ -97,7 +115,8 @@
</template>
<script>
import { searchtable, searchtable2, change, change2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { searchtable, searchtable2, change, handlechange, searchtable3, change2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
@@ -111,11 +130,26 @@ export default {
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1 // 后台获取页
pageCurrent: 1, // 后台获取页
loading2: false,
partName2: '',
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize2: 10, // 每页显示条数
pageCurrent2: 1 // 后台获取页
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.searchTable()
this.searchTable2()
},
methods: {
// 查询表格数据
@@ -144,16 +178,58 @@ export default {
零件图号: this.Data[i].零件图号,
备料到货: this.Data[i].备料到货,
工艺要求: response.data[0].工艺要求,
工序流水号: response.data[0].工序流水号
工序流水号: response.data[0].工序流水号,
重量: response.data[0].重量
})
})
this.loading = false
}
})
},
// 自家备料出库
handleChange1(row) {
change(row.工艺计划流水号, row.重量, row.单价).then(() => {
handlechange(row.工序流水号, this.id)
}).then(response => {
this.searchTable()
})
},
handleSelectionChange(val) {
this.arrest = val
},
searchTable2() {
this.loading2 = true
this.tableData2 = []
this.Data = []
if (this.partName2 !== '' && this.partName2 !== null) {
this.partNamecheck2 = 1
} else {
this.partNamecheck2 = 0
}
searchtable3(this.partNamecheck2, this.partName2, this.pageCurrent2, this.pageSize2).then(response => {
if (response.data.total === 0) {
this.loading2 = false
} else {
this.Data = response.data.rows
this.total2 = response.data.total
}
}).then(() => {
for (let i = 0; i < this.Data.length; i++) {
searchtable2(this.Data[i].工艺计划流水号).then(response => {
this.tableData2.push({
工艺计划流水号: this.Data[i].工艺计划流水号,
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
重量1: this.Data[i].重量1,
单价: this.Data[i].单价,
备注1: this.Data[i].备注1,
工序流水号: response.data[0].工序流水号
})
})
this.loading2 = false
}
})
},
edit() {
this.bianliang1 = []
this.bianliang2 = []
@@ -164,23 +240,8 @@ export default {
this.bianliang1.push(this.arrest[i].工艺计划流水号)
this.bianliang2.push(this.arrest[i].工序流水号)
}
change(this.bianliang2, '0000', this.bianliang1).then(() => {
this.searchTable()
})
}
},
edit2() {
this.bianliang1 = []
this.bianliang2 = []
if (this.arrest.length === 0) {
this.$message.warning('请选择零件')
} else {
for (let i = 0; i < this.arrest.length; i++) {
this.bianliang1.push(this.arrest[i].工艺计划流水号)
this.bianliang2.push(this.arrest[i].工序流水号)
}
change2(this.bianliang2, '0000', this.bianliang1).then(() => {
this.searchTable()
change2(this.bianliang2, this.id, this.bianliang1).then(response => {
this.searchTable2()
})
}
},
@@ -193,6 +254,15 @@ export default {
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChange2(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
}
}
}