This commit is contained in:
chenjianan
2019-03-22 14:57:50 +08:00
parent 51f386e77b
commit 0cf71d09bd
3 changed files with 141 additions and 105 deletions

View File

@@ -36,14 +36,15 @@ export function searchTeam(machineNumber) {
})
}
// 初始化物料
export function searchPart(data1) {
export function searchPart(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '库存管理_离线外购件_出库查询',
param: '离线合同编号=' + data1
param: `物料名称_check=${params[0]}&物料名称=${params[1]}&物料规格_check=${params[2]}&物料规格=${params[3]}&物料型号_check=${params[4]}&物料型号=${params[5]}`,
Pagination: params[6] + '&' + params[7]
}
})
}

View File

@@ -1,28 +1,23 @@
<template>
<div class="app-container">
<el-card>
<span style="margin: 5px">离线合同编号</span>
<el-input v-model="offlineContract" clearable size="small" style="width:200px" />
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="searchPurchasePartinfo()">查询</el-button>
<span>物料名称</span>
<el-input v-model="materialName" placeholder="物料名称" clearable size="small"/>
<span>物料规格</span>
<el-input v-model="materialSpec" placeholder="物料规格" clearable size="small"/>
<span>物料型号</span>
<el-input v-model="materialModel" placeholder="物料型号" clearable size="small"/>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="listLoading" :data="tableDataBasic" size="mini" border style="width: 100%;" height="200" @row-click="searchoutRecord">
<el-table v-loading="listLoading" :data="tableDataBasic" size="mini" border style="width: 100%;" height="440">
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="离线合同编号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.离线合同编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="可出库数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column label="物料型号" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.物料型号 }}
@@ -33,77 +28,43 @@
{{ scope.row.物料规格 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120">
<el-table-column label="仓库名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="可出库数量" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope" align="center">
<el-button size="mini" type="primary" icon="el-icon-sort-up" style="margin: 0 0 0 0px" @click="parOut(scope.row)">出库</el-button>
<el-button :disabled="Number(scope.row.货位存量)===0" size="mini" type="primary" icon="el-icon-sort-up" @click="parOut(scope.row)">出库</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--零件出库对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-form ref="form" :model="Project" :rules="rules" label-position="left">
<el-form-item label="项目" prop="TotalContractAmount" label-width="100px">
<el-select v-model="form.ProjectValue" filterable clearable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="机床" prop="TotalContractAmount" label-width="100px">
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="分组" prop="TotalContractAmount" label-width="100px">
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.DirectNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="addDirectPartm()">确定</el-button>
<div class="block" style="margin-top: 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"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
</el-dialog>
</el-card>
<el-card>
<el-table
v-loading="listLoading1"
:data="tableDataOut"
size="mini"
border
style="width: 100%;"
height="350">
<el-table-column
label="序号"
align="center"
type="index"
width="50"/>
<el-table v-loading="listLoading1" :data="tableDataOut" size="mini" border style="width: 100%;" height="350">
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="项目名称" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
@@ -141,6 +102,57 @@
</el-table-column>
</el-table>
</el-card>
<!--零件出库对话框-->
<el-dialog :visible.sync="dialogFormVisible" title="零件出库" center width="380px">
<el-form ref="form" :model="form" :rules="rules" label-position="left">
<el-form-item label="项目" prop="TotalContractAmount" label-width="100px">
<el-select v-model="form.ProjectValue" filterable clearable size="small" placeholder="项目" style="width: 200px;margin-right:10px" @change="searchMachine()">
<el-option
v-for="item in Project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="机床" prop="TotalContractAmount" label-width="100px">
<el-select v-model="MachineValue" filterable clearable size="small" placeholder="机床" style="width: 200px;margin-right:10px" @change="searchGroupList()">
<el-option
v-for="item in Machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="分组" prop="TotalContractAmount" label-width="100px">
<el-select v-model="GroupNumValue" filterable clearable size="small" placeholder="分组" style="width: 200px;margin-right:10px">
<el-option
v-for="item in GroupNum"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="出库数量" prop="ContractNumberValue" label-width="100px" size="small">
<el-input v-model="form.DirectNumber" size="small" placeholder="出库数量" style="width: 200px"/>
</el-form-item>
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="TotalContractAmount" label-width="100px">
<el-input v-model="form.DirectNote" size="small" placeholder="请输入备注" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="addDirectPartm()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
@@ -152,10 +164,10 @@ export default {
return {
Project: [],
ProjectValue_check: 1,
MachineValue: ' ',
MachineValue: '',
Machine: [],
MachineValue_check: 1,
GroupNumValue: ' ',
GroupNumValue: '',
GroupNumValue_check: 1,
GroupNum: [],
tableDataBasic: [],
@@ -180,7 +192,12 @@ export default {
listLoading: '',
listLoading1: '',
partnumber: '',
offlineContract: null // 离线合同编号
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
materialName: '', // 物料名称
materialSpec: '', // 物料规格
materialModel: '' // 物料型号
}
},
computed: {
@@ -190,7 +207,7 @@ export default {
])
},
created() {
this.searchPurchasePartinfo()
this.searchTable1()
this.fetchData()
this.searchPeopleData()
this.getpeopleid()
@@ -207,6 +224,10 @@ export default {
if (this.ProjectValue === '') {
this.ProjectValue_check = 0
}
this.Machine = []
this.MachineValue = ''
this.GroupNum = []
this.GroupNumValue = ''
searchmachine(this.ProjectValue_check, this.form.ProjectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machine.push({
@@ -217,36 +238,44 @@ export default {
})
},
searchGroupList() { // 查询组号
this.GroupNum = []
this.GroupNumValue = ''
searchTeam(this.MachineValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.GroupNum.push({
label: response.data[i].件名称,
label: response.data[i].,
value: response.data[i].组件流水号
})
}
})
},
// 离线件查询
searchPurchasePartinfo() {
searchTable1() {
this.listLoading = true
this.tableDataBasic = []
searchPart(this.offlineContract).then(response => {
this.tableDataBasic = response.data
let check1, check2, check3
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
searchPart(check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.pageCurrent1, this.pageSize1).then(response => {
console.log(response.data)
this.tableDataBasic = response.data.rows
this.total1 = response.data.total
this.listLoading = false
})
},
// 离线记录查询
searchoutRecord(row) {
this.contractNumber = row.离线合同明细流水号
this.listLoading1 = true
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
})
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
// 打开表单
parOut(row) {
this.form = []
this.form = {}
this.MachineValue = ''
this.GroupNumValue = ''
this.dialogFormVisible = true
@@ -254,7 +283,6 @@ export default {
this.locateNumber = row.货位流水号
this.materialNumber = row.物料流水号
this.partnumber = row.货位存量
this.searchoutRecord()
},
// 重置表单
callOff() {
@@ -282,7 +310,7 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('零件出库成功')
this.dialogFormVisible = false
this.searchPurchasePartinfo()
this.searchTable1()
outRecord(this.contractNumber).then(response => {
this.tableDataOut = response.data
this.listLoading1 = false
@@ -305,4 +333,10 @@ export default {
span{
margin: 10px 0 10px 10px;
}
.el-select{
width:200px
}
.el-input{
width:200px
}
</style>

View File

@@ -235,7 +235,7 @@
</el-table-column>
<el-table-column label="合计" align="center" min-width="100" prop="合计">
<template slot-scope="scope">
{{ parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0) }}
{{ (parseFloat(scope.row.单价||0) * parseInt(scope.row.数量||0)).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="交货期要求" align="center" min-width="100" prop="交货期要求">
@@ -853,9 +853,9 @@ export default {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
return Number((prev + curr).toFixed(2))
} else {
return prev
return Number((prev).toFixed(2))
}
}, 0)
sums[index] += ' 元'
@@ -1008,11 +1008,12 @@ export default {
document.getElementsByClassName('tableData')[j].children[3].innerHTML = this.tableData3[j].物料型号
document.getElementsByClassName('tableData')[j].children[4].innerHTML = this.tableData3[j].数量
document.getElementsByClassName('tableData')[j].children[5].innerHTML = this.tableData3[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = this.tableData3[j].数量 * this.tableData3[j].单价
document.getElementsByClassName('tableData')[j].children[6].innerHTML = (this.tableData3[j].数量 * this.tableData3[j].单价).toFixed(2)
document.getElementsByClassName('tableData')[j].children[7].innerHTML = this.tableData3[j].交货期要求
document.getElementsByClassName('tableData')[j].children[8].innerHTML = this.tableData3[j].备注
total += this.tableData3[j].数量 * this.tableData3[j].单价
total += Number(this.tableData3[j].数量 * this.tableData3[j].单价)
}
total = total.toFixed(2)
document.getElementById('contractNum').innerHTML = row.离线合同编号
document.getElementById('contractName').innerHTML = row.离线合同名称
document.getElementById('supplier').innerHTML = row.供应商名称