This commit is contained in:
bryan sun
2019-10-17 18:13:47 +08:00
18 changed files with 1149 additions and 588 deletions

View File

@@ -55,11 +55,11 @@
<h4>领料单明细{{ pickingListNumberShow }}</h4>
</el-col>
<el-col style="float:left;width: 200px;margin-top:15px">
<el-button :disabled="multipleSelection.length===0" size="small" type="warning" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="multipleSelection.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
<el-button :disabled="SELECTION.length===0" size="small" type="warning" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="SELECTION.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
</el-col>
</el-row>
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="400" @row-click="clickListDetail" @selection-change="handleSelectionChange">
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="400" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="名称" sortable prop="名称" align="center" min-width="100">
@@ -97,14 +97,19 @@
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column label="已领数量" align="center" min-width="50">
<el-table-column label="货位存量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
{{ scope.row.请购单明细流水号 ? scope.row.货位存量 : scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="200">
<el-table-column label="已领数量" align="center" min-width="50">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="mini" @change="UpdateRemark(scope.row)"/>
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" width="200">
<template slot-scope="scope">
<el-input-number v-model="scope.row.出库数量" size="mini"/>
</template>
</el-table-column>
<el-table-column v-if="true" label="备料确认" align="center" width="100">
@@ -115,8 +120,9 @@
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" size="mini" type="success">已领料</el-tag>
<el-tag v-else type="warning" size="mini">未领</el-tag>
<el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领料</el-tag>
<el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未领</el-tag>
<el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领料</el-tag>
</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" width="100" fixed="right">-->
@@ -127,65 +133,64 @@
</el-table>
</el-card>
<el-card>
<el-row>
<el-col :span="12">
<h4 style="margin-top:0">物料货位数量信息</h4>
</el-col>
<el-col :span="12">
占用数量{{ 占用数量 }}
</el-col>
</el-row>
<el-table :data="StockNumberTable" border stripe style="width: 100%;" size="mini" height="300" show-summary>
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 || scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 || scope.row.规格 || '—' }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位名称" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="货位存量" align="center" min-width="70" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 || '—' }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.组号 || '—' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200px">
<template slot-scope="scope" align="center">
<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>
<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--<el-card>-->
<!--<el-row>-->
<!--<el-col :span="12">-->
<!--<h4 style="margin-top:0">物料货位数量信息</h4>-->
<!--</el-col>-->
<!--<el-col :span="12">-->
<!--占用数量{{ 占用数量 }}-->
<!--</el-col>-->
<!--</el-row>-->
<!--<el-table :data="StockNumberTable" border stripe style="width: 100%;" size="mini" height="300" show-summary>-->
<!--<el-table-column label="序号" align="center" type="index" width="50"/>-->
<!--<el-table-column label="名称" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料名称 || scope.row.零件名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="图号或型号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="规格" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料规格 || scope.row.规格 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="仓库名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.仓库名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位存量" align="center" min-width="70" prop="货位存量">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位存量 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="机床图号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.机床图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="组号" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.组号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="操作" align="center" width="200px">-->
<!--<template slot-scope="scope" align="center">-->
<!--<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>-->
<!--<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>--><!--</el-card>-->
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="物料出库" center width="380px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
@@ -255,16 +260,22 @@
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible3" title="领料确认" center width="380px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left">
<el-form-item label="领料人" prop="personName" label-width="100px" size="small">
<el-input v-model="form3.personName" readonly size="small" placeholder="领料人" style="width: 200px"/>
<el-form-item label="出库类别" prop="outTypeValue" label-width="100px">
<el-select v-model="form3.outTypeValue" size="small" placeholder="出库类别" style="width: 200px;margin-right:10px">
<el-option
v-for="item in outType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="密码" prop="password" label-width="100px" size="small">
<el-input v-model="form3.password" size="small" placeholder="密码" style="width: 200px"/>
<el-form-item label="人员编号" prop="password" label-width="100px" size="small">
<el-input v-model="form3.password" size="small" placeholder="人员编号" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3=false">取消</el-button>
<el-button type="primary" @click="pickConfirm()"> </el-button>
<el-button type="primary" @click="pickConfirm1()"> </el-button>
</div>
</el-dialog>
@@ -340,7 +351,7 @@ export default {
货位流水号: ''
},
form3: {
personName: '',
outTypeValue: '',
password: ''
},
form4: {
@@ -360,7 +371,8 @@ export default {
reason: [{ required: true, message: '请输入' }]
},
rules3: {
password: [{ required: true, message: '请输入' }]
password: [{ required: true, message: '请输入' }],
outTypeValue: [{ required: true, message: '请选择' }]
},
rules4: {
仓库流水号: [{ required: true, message: '请输入' }],
@@ -370,15 +382,16 @@ export default {
machine: [],
group: [],
person: [],
materialNum: '', // 中间变量物料流水号
machineValue: '', // 中间变量机床流水号
groupNumValue: '', // 中间变量组件流水号
basePartNum: '', // 中间变量基本件流水号
purchaseBillNum: '', // 中间变量请购单明细流水号
parchasePartNum: '', // 中间变量标准件和外购件流水号
SELECTION: [],
materialNum: [], // 中间变量物料流水号
machineValue: [], // 中间变量机床流水号
groupNumValue: [], // 中间变量件流水号
basePartNum: [], // 中间变量基本件流水号
purchaseBillNum: [], // 中间变量请购单明细流水号
parchasePartNum: [], // 中间变量标准件和外购件流水号
inventoryNum: '', // 中间变量仓库流水号
locationNum: '', // 中间变量货位流水号
outNumber: 0, // 中间变量出库数量
outNumber: [], // 中间变量出库数量
inventoryName: [],
locateName: [],
物料流水号: '',
@@ -476,13 +489,6 @@ export default {
}
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = []
val.map(v => {
this.multipleSelection.push(v.领料单明细流水号)
})
},
// 备料确认
prepareConfirm() {
this.$confirm('是否备料确认?', '提示', {
@@ -629,12 +635,39 @@ export default {
this.pickListTable2 = res.data
})
},
// 多选
handleSelectionChange(val) {
console.log(val)
this.SELECTION = val
},
// 提交领料确认
pickConfirm1() {
for (let i = 0; i < this.SELECTION.length; i++) {
this.multipleSelection.push(this.SELECTION[i].领料单明细流水号)
this.basePartNum.push(this.SELECTION[i].基本件流水号)
this.materialNum.push(this.SELECTION[i].物料流水号)
this.parchasePartNum.push(this.SELECTION[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.SELECTION[i].请购单明细流水号)
this.groupNumValue.push(this.SELECTION[i].组件流水号)
this.machineValue.push(this.SELECTION[i].机床流水号)
this.outNumber.push(this.SELECTION[i].出库数量)
}
submitOutStore(this.multipleSelection, this.basePartNum, this.materialNum, this.parchasePartNum, this.purchaseBillNum, this.groupNumValue, this.machineValue, this.outNumber, this.id, this.form3.password, this.form3.outTypeValue, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible3 = false
searchListDetail(this.pickingListNum).then(res => {
this.pickListTable2 = res.data
})
} else { this.$message.error('操作失败') }
})
},
// 查看领料单明细相关的物料货位数量
clickListDetail(row) {
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = null) : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.purchaseBillNum
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
@@ -642,112 +675,14 @@ export default {
searchStockNumber1(this.materialNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 物料名称
,物料规格
,物料型号
,sum(零件数量 * 机床数量) as 占用数量
,PDM_零件明细表_标准件和外购件.物料流水号
from PDM_零件明细表_标准件和外购件
inner join PDM_组件名称 on PDM_零件明细表_标准件和外购件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料主文件_基本.物料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_标准件和外购件.标准件和外购件流水号 = 车间装配管理_领料单明细.标准件和外购件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and PDM_零件明细表_标准件和外购件.物料流水号 = ${this.materialNum}
group by 物料名称
,物料规格
,物料型号
,PDM_零件明细表_标准件和外购件.物料流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.basePartNum) {
searchStockNumber2(this.basePartNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 零件名称,零件图号,规格,材料,sum(零件数量 * 机床数量) as 占用数量,PDM_零件明细表_基本件.基本件流水号
from PDM_零件明细表_基本件 inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join PDM_零件明细表_材料 on PDM_零件明细表_基本件.材料流水号 = PDM_零件明细表_材料.材料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_基本件.基本件流水号 = 车间装配管理_领料单明细.基本件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and 车间装配管理_领料单明细.基本件流水号 = ${this.basePartNum}
group by 零件名称,零件图号,规格,材料,PDM_零件明细表_基本件.基本件流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.purchaseBillNum) {
searchStockNumber3(this.purchaseBillNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select
库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_基本件_查询视图
inner join PDM_零件明细表_基本件 on 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号 = PDM_零件明细表_基本件.基本件流水号
inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
union
select
库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号 as 零件图号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称 as 零件名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格 as 规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_标准件和外购件_查询视图
inner join PDM_零件明细表_标准件和外购件 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
inner join PDM_组件名称 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号 = 库存管理_物料主文件_基本.物料流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
}
},
// 出库