This commit is contained in:
chenjianan
2019-05-30 15:58:29 +08:00
8 changed files with 1876 additions and 134 deletions

View File

@@ -0,0 +1,187 @@
import request from '@/utils/request'
// 初始化项目
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_项目名称_查询数据_按时间排序'
}
})
}
// 机床查询
export function searchmachine(check, num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_机床名称_查询数据',
param: '项目流水号_check=' + check + '=int&项目流水号=' + num
}
})
}
// 分组查询
export function searchTeam(machineNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_组件名称_查询数据',
param: '机床流水号=' + machineNumber
}
})
}
// 外购件、标准件查询
export function searchPurchasePart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_外购件出库_零件查询',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 基本件、通用件查询
export function searchBasicPart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_基本件出库_零件查询',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 车间采购件查询
export function searchHoursePart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_车间采购出库_零件查询',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 领料单查询
export function searchList(pageCurrent, pageSize, listNumber_check, listNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间装配管理_领料单_领料单查询',
param: '领料单编号_check=' + listNumber_check + '&领料单编号=' + listNumber,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 领料单明细查询
export function searchListDetail(listNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间装配管理_领料单_领料单明细查询',
param: '领料单流水号=' + listNumber
}
})
}
// 创建领料单
export function addList(peopleNumber) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间装配管理_领料单_领料单增加',
param: '领料人流水号=' + peopleNumber
}
})
}
// 删除领料单
export function dropList(PickingListNumberx) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间装配管理_领料单_领料单删除',
param: '领料单流水号=' + PickingListNumberx
}
})
}
// 删除领料单明细
export function dropListDetail(DetailNumberx, isBacklog) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间装配管理_领料单_领料单明细删除',
param: '领料单明细流水号=' + DetailNumberx + '&是否是滞货=' + isBacklog
}
})
}
// 删除领料单明细/基本件
export function dropListDetailBasic(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间装配管理_领料单_领料单明细删除_基本件',
param: `领料单明细流水号=${params[0]}&收件信息ID=${params[1]}&返还数量=${params[2]}`
}
})
}
// 增加领料单明细
export function addListDetail(PickingListNumberx, projectnumber, machinenumber, teamNumber, outNumber, partType, Note, data1, data2, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间装配管理_领料单_领料单明细增加',
param: '领料单流水号=' + PickingListNumberx + '&项目流水号=' + projectnumber + '&机床流水号=' + machinenumber + '&组件流水号=' + teamNumber + '&出库数量=' + outNumber + '&零件类型=' + partType + '&备注\\=' + Note + '&工艺计划流水号=' + data1 + '&收件信息ID=' + data2 + '&采购合同明细流水号=' + data4 + '&请购单明细流水号=' + data5 + '&货位流水号=' + data6 + '&出库类型=' + data7 + '&物料与货位对照流水号=' + data8 + '&名称=' + data9 + '&物料规格\\=' + data10 + '&物料型号=' + data11 + '&零件图号=' + data12 + '&材料=' + data13
}
})
}
// 查询滞货件
export function searchBacklogPart(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '采购管理_滞货件领料_查询数据',
param: '项目流水号_check=' + project_check + '&项目流水号=' + project + '&机床流水号_check=' + machine_check + '&机床流水号=' + machine + '&组件流水号_check=' + group_check + '&组件流水号=' + group,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 领料滞货件
export function submitAddBacklogList(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_领料单明细_滞货件_增加数据',
param: `领料单流水号=${params[0]}&项目流水号=${params[1]}&机床流水号=${params[2]}&组件流水号=${params[3]}&出库数量=${params[4]}&备注\\=${params[5]}&货位流水号=${params[6]}&物料与货位对照流水号=${params[7]}&名称=${params[8]}&物料规格\\=${params[9]}&物料型号=${params[10]}`
}
})
}

View File

@@ -1,5 +1,17 @@
import request from '@/utils/request'
// 外购备料出库
export function change3(Number, code, num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_自家备料到货更改',
param: '工序流水号组=' + Number + '&工作者考勤编号=' + code + '&工艺计划流水号组=' + num
}
})
}
// 查询零件
export function searchtable(num1, num2, num3, pageCurrent, pageSize) {
return request({

View File

@@ -0,0 +1,88 @@
import request from '@/utils/request'
// 查询零件
export function searchtable(num1, num2, num3, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料到货查询',
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料到货_check=' + num3,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询零件工艺
export function searchtable2(num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_备料打印_查询工序信息',
param: '工艺计划流水号=' + num1
}
})
}
// 完成备料工序
export function handlechange(Number, code) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工序_修改数据_工作者',
param: '工序流水号=' + 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
}
})
}
// 外购备料出库
export function change2(Number, code, num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_外购备料到货更改',
param: '工序流水号组=' + Number + '&工作者考勤编号=' + code + '&工艺计划流水号组=' + num
}
})
}
export function handlechange2(Number, code) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工序_修改数据_修改实际完成时间',
param: '工序流水号=' + Number + '&实际完成时间=' + code
}
})
}

View File

@@ -1,5 +1,32 @@
import request from '@/utils/request'
// 查询原材料库存
export function searchRawMaterial(num, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_原材料库存管理_查询',
param: '原材料名称=' + num,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 增加采购计划明细
export function addMateriel2(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_采购计划明细_增加数据2',
param: `采购计划流水号=${num1}&原材料流水号组=${num2}`
}
})
}
// ////////////////////////////////////////////////////////////////////////////////0529新加↑
// 查询外购备料列表
export function initPartDrawing(check1, name) {
return request({

File diff suppressed because it is too large Load Diff

View File

@@ -5,14 +5,13 @@
<span>零件图号:</span>
<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 size="small" icon="el-icon-refresh" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">刷新</el-button>-->
<el-button size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit2()">自家备料确认</el-button>
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange2">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
@@ -28,25 +27,6 @@
{{ 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
@@ -64,14 +44,11 @@
<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-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 type="selection" width="55" align="center"/>
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
@@ -115,11 +92,12 @@
</template>
<script>
import { searchtable, searchtable2, change, handlechange, searchtable3, change2, handlechange2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { searchtable, searchtable2, change, handlechange, searchtable3, change2, handlechange2, change3 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
arrest2: [],
editTime: '',
bianliang1: [],
bianliang2: [],
@@ -153,6 +131,25 @@ export default {
this.searchTable2()
},
methods: {
handleSelectionChange2(val) {
this.arrest2 = val
},
edit2() {
this.bianliang1 = []
this.bianliang2 = []
if (this.arrest2.length === 0) {
this.$message.warning('请选择零件')
} else {
for (let i = 0; i < this.arrest2.length; i++) {
this.bianliang1.push(this.arrest2[i].工艺计划流水号)
this.bianliang2.push(this.arrest2[i].工序流水号)
}
change3(this.bianliang2, '0000', this.bianliang1).then(response => {
this.searchTable()
})
}
},
// ////////////////////////////////////////////////////////////////////////////0530新↑
// 查询表格数据
searchTable() {
this.loading = true
@@ -195,13 +192,8 @@ export default {
return i
}
},
// 自家备料出库
// 自家备料确认
handleChange1(row) {
if (row.重量 === '' || row.重量 === null) {
this.$message.error('请输入重量')
} else if (row.单价 === '' || row.单价 === null) {
this.$message.error('请输入单价')
} else {
var date = new Date()
var month = this.zeroFill(date.getMonth() + 1)
var day = this.zeroFill(date.getDate())
@@ -213,7 +205,6 @@ export default {
}).then(response => {
this.searchTable()
})
}
},
handleSelectionChange(val) {
this.arrest = val

View File

@@ -0,0 +1,294 @@
<template>
<div>
<el-card>
<el-row>
<span>零件图号:</span>
<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 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="拼命加载中">
<el-table-column label="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="备料" align="center">
<template slot-scope="scope">
{{ scope.row.工艺要求 }}
</template>
</el-table-column>
<el-table-column 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 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
v-if="!loading"
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-card>
<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="零件名称" align="center" width="220px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="240px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="重量" align="center" width="140px">
<template slot-scope="scope">
{{ 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="!loading2"
:current-page="pageCurrent2"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize2"
:total="total2"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</div>
</template>
<script>
import { searchtable, searchtable2, change, handlechange, searchtable3, change2, handlechange2 } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
import { mapGetters } from 'vuex'
export default {
data() {
return {
editTime: '',
bianliang1: [],
bianliang2: [],
num: 0,
arrest: [],
all: false,
partName: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1, // 后台获取页
loading2: false,
partName2: '',
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize2: 10, // 每页显示条数
pageCurrent2: 1 // 后台获取页
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.searchTable()
this.searchTable2()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.Data = []
if (this.partName !== '' && this.partName !== null) {
this.partNamecheck = true
} else {
this.partNamecheck = false
}
searchtable(this.partNamecheck, this.partName, !this.all, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.Data = response.data.rows
this.total = response.data.total
}
}).then(() => {
for (let i = 0; i < this.Data.length; i++) {
searchtable2(this.Data[i].工艺计划流水号).then(response => {
this.tableData.push({
工艺计划流水号: this.Data[i].工艺计划流水号,
零件名称: this.Data[i].零件名称,
零件图号: this.Data[i].零件图号,
备料到货: this.Data[i].备料到货,
工艺要求: response.data[0].工艺要求,
工序流水号: response.data[0].工序流水号,
重量: response.data[0].重量,
单价: 0
})
})
this.loading = false
}
})
},
zeroFill(i) {
if (i >= 0 && i <= 9) {
return '0' + i
} else {
return i
}
},
// 自家备料确认
handleChange1(row) {
if (row.重量 === '' || row.重量 === null) {
this.$message.error('请输入重量')
} else if (row.单价 === '' || row.单价 === null) {
this.$message.error('请输入单价')
} else {
var date = new Date()
var month = this.zeroFill(date.getMonth() + 1)
var day = this.zeroFill(date.getDate())
this.editTime = date.getFullYear() + '-' + month + '-' + day
change(row.工艺计划流水号, row.重量, row.单价).then(() => {
handlechange(row.工序流水号, '0000').then(response => {
handlechange2(row.工序流水号, this.form.完成时间)
})
}).then(response => {
this.searchTable()
})
}
},
handleSelectionChange(val) {
this.arrest = val
},
searchTable2() {
this.loading2 = true
this.tableData2 = []
this.Data2 = []
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.Data2 = response.data.rows
this.total2 = response.data.total
}
}).then(() => {
for (let i = 0; i < this.Data2.length; i++) {
searchtable2(this.Data2[i].工艺计划流水号).then(response => {
this.tableData2.push({
工艺计划流水号: this.Data2[i].工艺计划流水号,
零件名称: this.Data2[i].零件名称,
零件图号: this.Data2[i].零件图号,
重量1: this.Data2[i].重量1,
单价: this.Data2[i].单价,
备注1: this.Data2[i].备注1,
工序流水号: response.data[0].工序流水号
})
})
this.loading2 = false
}
})
},
edit() {
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(response => {
this.searchTable2()
})
}
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChange2(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,75 +1,69 @@
<template>
<div class="app-container">
<el-card>
<div slot="header">
<span>零件图号:</span>
<el-select v-model="partDrawingNumberValue" placeholder="零件图号" size="small" clearable>
<el-option
v-for="item in partDrawingNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</div>
<div v-show="showMaterialTable">
<el-table
v-loading="loading1"
:data="tableData1"
border
style="width: 100%;max-height: 460px;"
height="330"
size="mini"
@selection-change="handleSelectionChange">
<el-col :span="9">
<span>原材料名称:</span>
<el-input v-model="RawMaterialName" placeholder="原材料名称" size="mini" clearable style="width: 120px"/>
<el-button type="success" icon="el-icon-search" size="mini" style="margin-left: 10px" @click="pageCurrent=1;searchRawMaterial()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel2">选入原材料</el-button>
<el-table :data="tableData" border style="width: 100%;height: 460px;margin-top: 15px;" height="330" size="mini" @selection-change="handleSelectionChange2">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="零件图号" min-width="150" align="center">
<el-table-column label="原材料名称" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;margin-bottom: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-size="pageSize"
:total="total"
style="display:inline-block;width:50%"
layout="total, prev, pager, next"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-col>
<el-col :span="14" style="margin-left: 20px">
<span>零件图号:</span>
<el-input v-model="partDrawingNumber" placeholder="零件图号" size="mini" clearable style="width: 120px"/>
<el-button type="success" size="mini" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入物料</el-button>
<el-table v-loading="loading1" :data="tableData1" border style="width: 100%;height: 460px;margin-top: 15px;" height="330" size="mini" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="零件图号" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" min-width="150" align="center">
<el-table-column label="零件名称" min-width="100" align="center">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="数量" min-width="150" align="center">
<el-table-column label="数量" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="材料" min-width="150" align="center">
<el-table-column label="材料" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="规格" min-width="90" align="center">
<template slot-scope="scope">
{{ scope.row.原材料规格 }}
</template>
</el-table-column>
<el-table-column label="重量" min-width="90" align="center">
<template slot-scope="scope">
{{ scope.row.重量 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<div class="block" style="margin-top: 10px;margin-bottom: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
layout="total, prev, pager, next"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</div>
</el-col>
</el-card>
<el-card>
@@ -78,30 +72,9 @@
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" clearable/>
<span>供应商:</span>
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
style="margin-left: 10px"
@click="addPurchaseOrder">创建采购单</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="addMateriel">选入物料</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="saveMateriel">保存</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">创建采购单</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存</el-button>
</div>
<el-table v-loading="" :data="tableData2" border style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="单号状态" align="center" width="100" fixed="left">
@@ -161,9 +134,14 @@
@current-change="handleCurrentChange2"/>
</div>
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
<el-table-column label="零件图号" align="center" min-width="150">
<el-table-column label="物料编码" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
{{ scope.row.物料零件编码 }}
</template>
</el-table-column>
<el-table-column label="原材料名称" align="center" min-width="150">
<template slot-scope="scope">
{{ scope.row.原材料名称 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" min-width="150">
@@ -176,11 +154,6 @@
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column label="单位" align="center" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.单位" :disabled="disable" size="mini" style="width:70px"/>
</template>
</el-table-column>
<el-table-column label="数量" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
@@ -414,8 +387,9 @@
</div>
</template>
<script>import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, searchSupplier, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchMateriel,
addMateriel, deleteMateriel, saveMateriel } from '@/api/WorkshopProcurement/CreatingPurchasingMaterials'
<script>
import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, searchSupplier, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchMateriel,
addMateriel, deleteMateriel, saveMateriel, searchRawMaterial, addMateriel2 } from '@/api/WorkshopProcurement/CreatingPurchasingMaterials'
import QRCode from 'qrcode'
import $ from 'jquery'
import { mapGetters } from 'vuex'
@@ -423,10 +397,14 @@ export default {
name: '', // 采购计划
data() {
return {
partDrawingNumberValue: '',
partDrawingNumber: [],
RawMaterialGroup: [],
RawMaterialName: '',
tableData: [],
pageCurrent: 1,
pageSize: 10,
total: null,
partDrawingNumber: '',
Buyer: '',
showMaterialTable: true,
loading1: false,
title2: '',
check1: 0,
@@ -509,11 +487,43 @@ export default {
])
},
created() {
this.fetchData()
this.searchRawMaterial()
this.searchTable1()
this.searchTable2()
},
methods: {
// 获取原材料
searchRawMaterial() {
searchRawMaterial(this.RawMaterialName, this.pageCurrent, this.pageSize).then(response => {
this.tableData = response.data.rows
this.total = parseInt(response.data.total)
})
},
addMateriel2() { // 将材料选入请购单
if (!this.purchasingOrderNumber) {
this.$message.warning('请选择采购单')
} else if (this.RawMaterialGroup.length === 0) {
this.$message.warning('请勾选原材料')
} else {
addMateriel2(this.purchasingOrderNumber, this.RawMaterialGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
this.searchTable1()
this.searchRawMaterial()
searchMateriel(this.purchasingOrderNumber).then(response => {
this.tableData3 = response.data
})
} else { this.$message.error('选入失败') }
})
}
},
handleSelectionChange2(val) {
this.RawMaterialGroup = []
for (let i = 0; i < val.length; i++) {
this.RawMaterialGroup.push(val[i].原材料流水号)
}
},
// ///////////////////////////////////////////////////////////////////////////////////////0529新加↑
useqrcode(contractNum) {
const opts = {
errorCorrectionLevel: 'H',
@@ -540,8 +550,8 @@ export default {
},
searchTable1() { // 查询外购备料
this.loading1 = true
this.partDrawingNumberValue ? this.check1 = 1 : this.check1 = 0
searchPurchasedMaterials(this.pageCurrent1, this.pageSize1, this.check1, this.partDrawingNumberValue).then(response => {
this.partDrawingNumber ? this.check1 = 1 : this.check1 = 0
searchPurchasedMaterials(this.pageCurrent1, this.pageSize1, this.check1, this.partDrawingNumber).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.loading1 = false
@@ -600,7 +610,6 @@ export default {
} else { this.$message.error('新建采购单失败') }
})
} else {
console.log('error submit!!')
return false
}
})
@@ -620,7 +629,6 @@ export default {
submitEditPurchaseOrder() {
this.$refs['form2'].validate((valid) => {
if (valid) {
console.log(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.供应商流水号, this.form2.计划完成日期)
editPurchaseOrder(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.供应商流水号, this.form2.计划完成日期).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改采购单成功')
@@ -629,7 +637,6 @@ export default {
} else { this.$message.error('修改采购单失败') }
})
} else {
console.log('error submit!!')
return false
}
})
@@ -717,7 +724,6 @@ export default {
this.计划完成日期 = row.计划完成日期.split(' ')[0]
this.下单日期 = row.下单日期.split(' ')[0]
searchMateriel(this.purchasingOrderNumber).then(response => {
console.log(response.data)
this.tableData3 = response.data
})
},
@@ -773,7 +779,6 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(row)
deleteMateriel(row.采购计划明细流水号, row.工艺计划流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移除成功')
@@ -807,7 +812,6 @@ export default {
body.children().not('#app').hide()
printNode.remove()
}).catch(res => {
console.log(res)
this.$message({
type: 'info',
message: '已取消操作'