设备监控、采购件入库

This commit is contained in:
zhangdingyu
2019-10-10 11:29:43 +08:00
parent 12fa29bc00
commit aa27408b54
3 changed files with 582 additions and 12 deletions

View File

@@ -57,3 +57,25 @@ export function getDaijiagong(num) {
}
})
}
// 查询总装
export function getZongzhuang() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: 'SELECT 机床图号 FROM PDM_机床名称 where 机床装配实际开始时间 is not null and 机床装配实际完成时间 is null'
}
})
}
// 查询部装
export function getBuzhuang() {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: 'SELECT 机床图号,组号,任务名称 FROM 车间管理_工作计划 inner join PDM_机床名称 on 车间管理_工作计划.机床流水号=PDM_机床名称.机床流水号 where 计划类型=1 and 是否工作=1 and 组号 <> \'\''
}
})
}

View File

@@ -0,0 +1,526 @@
<template>
<div>
<div class="main">
<div style="padding: 0 10px">
<el-form label-width="80px" onsubmit="return false" style="font-size: 22px;">
<el-form-item label="物料码">
<el-input id="code1" v-model="qrCode" placeholder="输入合同明细流水号" @keyup.native.enter="codeChange1()" @focus="qrCode=''"/>
</el-form-item>
<el-form-item label="合同类型">
<el-select v-model="contractType" placeholder="请选择" style="width: 100%" @change="contractTypeChange">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<el-button type="primary" style="margin-bottom: 10px;width: 100%" @click="searchPartDetail">查询零件详情</el-button>
</div>
<el-form label-width="80px" style="margin-right:10px;margin-left: 10px">
<el-row>
<el-col :span="13">
<el-form-item v-show="Projectshow" label="机床号">
<el-tooltip :content="machine" class="item" effect="dark" placement="top">
<el-input v-model="machine" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item v-show="Projectshow" label="组号">
<el-tooltip :content="team" class="item" effect="dark" placement="top">
<el-input v-model="team" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
</el-col>
</el-row>
<el-form-item v-show="purchasepart" label="物料名称">
<el-tooltip :content="materialname" class="item" effect="dark" placement="top">
<el-input v-model="materialname" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item v-show="purchasepart" label="物料型号">
<el-tooltip :content="materialtype" class="item" effect="dark" placement="top">
<el-input v-model="materialtype" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item v-show="purchasepart" label="物料规格">
<el-tooltip :content="materialscale" class="item" effect="dark" placement="top">
<el-input v-model="materialscale" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item v-show="basicpart" label="零件名称">
<el-tooltip :content="partname" class="item" effect="dark" placement="top">
<el-input v-model="partname" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item v-show="basicpart" label="零件图号">
<el-tooltip :content="partpaint" class="item" effect="dark" placement="top">
<el-input v-model="partpaint" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item label="供应商">
<el-tooltip :content="supplier" class="item" effect="dark" placement="top">
<el-input v-model="supplier" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item label="合同编号">
<el-tooltip :content="contractnumber" class="item" effect="dark" placement="top">
<el-input v-model="contractnumber" readonly placeholder="无"/>
</el-tooltip>
</el-form-item>
<el-form-item label="采购数量">
<el-input v-model="contractnum" readonly placeholder="无"/>
</el-form-item>
</el-form>
<hr style="margin-bottom: 10px">
<div style="width:310px;margin: 0 auto">
<el-radio v-model="locateType" label="1" border @change="locateNumber=''">扫码货位二维码</el-radio>
<el-radio v-model="locateType" label="2" border @change="locateNumber=''">选择仓库货位</el-radio>
</div>
<hr style="margin: 10px 0">
<el-form label-width="80px" onsubmit="return false" style="margin-right:10px;margin-left: 10px">
<el-form-item v-show="locateType==='1'" label="货位码">
<el-input id="code2" v-model="locateNumber" placeholder="若不扫码,可在此输入货位流水号" @keyup.native.enter="codeChange2()" @focus="locateNumber=''"/>
</el-form-item>
<el-form-item v-show="locateType==='2'" label="仓库名称">
<el-select v-model="inventoryNumber" style="width: 100%" placeholder="仓库名称" @change="getLocate">
<el-option
v-for="item in inventoryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-show="locateType==='2'" label="货位名称">
<el-select v-model="locateNumber" style="width: 100%" placeholder="货位名称">
<el-option
v-for="item in locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="入库数量">
<el-input-number v-model="inboundNumber" :min="0" style="width: 100%"/>
</el-form-item>
<el-form-item label="重量/面积">
<el-input v-model="area" style="width: 53%"/>
<el-select v-model="unit" style="width: 45%">
<el-option
v-for="item in basicUnit"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="备注" >
<el-input v-model="inboundNote" style="width: 100%"/>
</el-form-item>
</el-form>
<el-button type="primary" style="margin-bottom: 40px;width:100%" @click="inBound">确定入库</el-button>
</div>
</div>
</template>
<script>
import url from '@/utils/request'
import axios from 'axios'
import Cookie from 'js-cookie'
export default {
data() {
return {
locateType: '1',
qrCode: '',
inboundNote: '',
multipleSelection: [],
oldVal: '',
project: '',
machine: '',
team: '',
materialname: '',
materialtype: '',
materialscale: '',
supplier: '',
contractnumber: '',
contractnum: '',
locateNumber: '',
locateName: [],
partname: '',
partpaint: '',
note: '',
partnumber: '', // 物料流水号
inboundNumber: 0, // 入库数量
inventoryPeople: '', // 入库人员
options: [
{
value: 1,
label: '采购部采购合同'
// }, {
// value: 2,
// label: '采购部离线合同'
}, {
value: 3,
label: '车间采购合同'
}, {
value: 4,
label: '车间离线合同'
}
],
contractType: 1,
exchange: '',
purchasepart: true,
Projectshow: true,
basicpart: false,
basicUnit: [], // 单位下拉框
unit: '', // 单位
requestcardnumber: '', // 请购单明细流水号
area: '', // 面积或重量
inventoryNumber: '', // 仓库流水号
inventoryName: [], // 仓库名称
teampartnumber: '', // 组件零件流水号
teampartbasicnumber: '', // 组件零件基本件流水号
unArrivalNum: 0 // 未到货数量
}
},
created() {
this.getpeopleid()
this.getHouse()
},
mounted() {
this.getUnit()
},
methods: {
// 获取人员编号
getpeopleid() {
this.inventoryPeople = Cookie.get('id')
},
// 合同类型变更
contractTypeChange() {
if (this.contractType === 3) { // 车间采购
this.Projectshow = true
this.basicpart = true
} else if (this.contractType === 2 || this.contractType === 4) { // 采购离线,车间离线
this.Projectshow = false
this.basicpart = false
} else { // 采购采购
this.Projectshow = true
this.basicpart = false
}
},
// 异步加载零件详情
async searchPartDetail() {
if (this.contractType === 1) { // 采购合同
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_外购件入库_查询数据',
param: `采购合同明细流水号=${this.qrCode}`
}
}
const res = await axios(param)
if (res.data.length > 0) {
if (res.data[0].组件零件流水号) { // 标准件和外购件
this.purchasepart = true
this.basicpart = false
this.project = res.data[0].项目名称
this.machine = res.data[0].机床图号
this.team = res.data[0].组号
this.materialname = res.data[0].物料名称
this.materialtype = res.data[0].物料型号
this.materialscale = res.data[0].物料规格
this.partnumber = res.data[0].物料流水号
} else {
this.purchasepart = false
this.basicpart = true
this.project = res.data[0].基本件项目名称
this.machine = res.data[0].基本件机床图号
this.team = res.data[0].基本件组号
this.partpaint = res.data[0].零件图号
this.partname = res.data[0].零件名称
}
this.inboundNumber = res.data[0].未到货数量
this.unArrivalNum = res.data[0].未到货数量
this.supplier = res.data[0].供应商名称
this.contractnumber = res.data[0].采购合同编号
this.contractnum = res.data[0].数量
this.teampartnumber = res.data[0].组件零件流水号
this.teampartbasicnumber = res.data[0].组件零件基本件流水号
} else {
this.clear()
}
const param2 = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_交换件_入库查询',
param: `采购合同明细流水号=${this.qrCode}`
}
}
const res1 = await axios(param2)
res1.data.length > 0 ? this.locateNumber = res1.data[0].货位流水号 : this.locateNumber = ''
} else if (this.contractType === 2) { // 离线合同
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_离线合同外购件入库_查询数据',
param: `离线合同明细流水号=${this.qrCode}`
}
}
const res = await axios(param)
if (res.data.length > 0) {
this.materialname = res.data[0].物料名称
this.materialtype = res.data[0].物料型号
this.materialscale = res.data[0].物料规格
this.supplier = res.data[0].供应商名称
this.contractnumber = res.data[0].离线合同编号
this.contractnum = res.data[0].数量
this.partnumber = res.data[0].物料流水号
} else {
this.clear()
}
} else if (this.contractType === 3) { // 车间采购合同
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_车间采购_零件详情查询',
param: `采购合同明细流水号=${this.qrCode}`
}
}
const res = await axios(param)
if (res.data.length > 0) {
if (!res.data[0].基本件流水号) {
this.purchasepart = true
this.basicpart = false
this.materialname = res.data[0].物料名称
this.materialtype = res.data[0].物料型号
this.materialscale = res.data[0].物料规格
} else {
this.purchasepart = false
this.basicpart = true
this.partpaint = res.data[0].零件图号
this.partname = res.data[0].物料名称
}
this.project = res.data[0].项目名称
this.machine = res.data[0].机床图号
this.team = res.data[0].组号
this.supplier = res.data[0].供应商名称
this.contractnumber = res.data[0].采购合同编号
this.contractnum = res.data[0].数量
this.partnumber = res.data[0].物料流水号
this.requestcardnumber = res.data[0].请购单明细流水号
} else {
this.clear()
}
} else if (this.contractType === 4) { // 车间离线合同
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_车间离线合同外购件入库_查询数据',
param: `离线合同明细流水号=${this.qrCode}`
}
}
const res = await axios(param)
if (res.data.length > 0) {
this.materialname = res.data[0].物料名称
this.materialtype = res.data[0].物料型号
this.materialscale = res.data[0].物料规格
this.supplier = res.data[0].供应商名称
this.contractnumber = res.data[0].离线合同编号
this.contractnum = res.data[0].数量
this.partnumber = res.data[0].物料流水号
} else {
this.clear()
}
}
},
// 获取仓库
async getHouse() {
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_仓库查询'
}
}
const res = await axios(param)
for (let i = 0; i < res.data.length; i++) {
this.inventoryName.push({
label: res.data[i].仓库名称,
value: res.data[i].仓库流水号
})
}
},
// 获取货位
async getLocate() {
this.locateName = []
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_货位主文件_查询数据',
param: `仓库流水号=${this.inventoryNumber}`
}
}
const res = await axios(param)
for (let i = 0; i < res.data.length; i++) {
this.locateName.push({
label: res.data[i].货位名称,
value: res.data[i].货位流水号
})
}
},
// 获取单位
async getUnit() {
const param = {
url: url,
method: 'post',
data: {
type: '1',
name: '库存管理_车间采购_单位查询'
}
}
const res = await axios(param)
for (let i = 0; i < res.data.length; i++) {
this.basicUnit.push({
label: res.data[i].单位,
value: res.data[i].单位编号
})
}
},
// 清空
clear() {
this.locateNumber = ''
this.inboundNumber = 0
// this.qrCode = ''
this.locateNumber = ''
this.inventoryNumber = ''
this.project = ''
this.machine = ''
this.team = ''
this.materialname = ''
this.materialtype = ''
this.materialscale = ''
this.supplier = ''
this.contractnumber = ''
this.contractnum = ''
this.partpaint = ''
this.partname = ''
this.locateNumber = ''
this.inventoryNumber = ''
this.partnumber = ''
this.inboundNote = ''
this.area = ''
},
// 执行入库
async inBound() {
if (this.inboundNumber && this.locateNumber) {
if (this.contractType === 1) {
if (this.qrCode) {
const param = {
url: url,
method: 'post',
data: {
type: '2',
name: '库存管理_外购件入库_修改数据',
param: `物料流水号=${this.partnumber}&实际到货数量=${this.inboundNumber}&货位流水号=${this.locateNumber}&采购合同明细流水号=${this.qrCode}&入库人员流水号=${this.inventoryPeople}&备注=${this.inboundNote}&组件零件流水号=${this.teampartnumber}&组件零件基本件流水号=${this.teampartbasicnumber}`
}
}
const res = await axios(param)
if (res.data[0].result === '1') {
this.$message.success('入库成功')
this.clear()
} else {
this.$message.error('入库失败')
}
} else {
this.$message.warning('请扫描二维码')
}
} else if (this.contractType === 2) {
if (this.qrCode) {
const param = {
url: url,
method: 'post',
data: {
type: '2',
name: '库存管理_离线物料货位_增加修改数据',
param: `物料流水号=${this.partnumber}&实际到货数量=${this.inboundNumber}&货位流水号=${this.locateNumber}&离线合同明细流水号=${this.qrCode}&入库人员流水号=${this.inventoryPeople}`
}
}
const res = await axios(param)
if (res.data[0].result === '1') {
this.$message.success('入库成功')
this.clear()
} else {
this.$message.error('入库失败')
}
} else {
this.$message.warning('请扫描二维码')
}
} else if (this.contractType === 3) {
if (this.requestcardnumber) {
const param = {
url: url,
method: 'post',
data: {
type: '2',
name: '库存管理_车间采购_零件入库',
param: `物料流水号=${this.partnumber}&实际到货数量=${this.inboundNumber}&货位流水号=${this.locateNumber}&入库人员流水号=${this.inventoryPeople}&请购单明细流水号=${this.requestcardnumber}&备注=${this.inboundNote}&重量或面积=${this.area}&单位=${this.unit}`
}
}
const res = await axios(param)
if (res.data[0].result === '1') {
this.$message.success('入库成功')
this.clear()
} else {
this.$message.error('入库失败')
}
} else {
this.$message.warning('请扫描二维码')
}
} else if (this.contractType === 4) {
if (this.qrCode) {
const param = {
url: url,
method: 'post',
data: {
type: '2',
name: '库存管理_车间离线物料货位_增加修改数据',
param: `物料流水号=${this.partnumber}&实际到货数量=${this.inboundNumber}&货位流水号=${this.locateNumber}&离线合同明细流水号=${this.qrCode}&入库人员流水号=${this.inventoryPeople}`
}
}
const res = await axios(param)
if (res.data[0].result === '1') {
this.$message.success('入库成功')
this.clear()
} else {
this.$message.error('入库失败')
}
} else {
this.$message.warning('请扫描二维码')
}
}
} else {
this.$message.warning('请选择货位并填写入库数量')
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -491,20 +491,18 @@
</el-row>
</div>
</el-tooltip>
<el-tooltip :enterable="false" :id="机床总装" placement="top" @mouseover.native.prevent="changeActive($event)">
<div slot="content">{{ tooltip1 }}<br>{{ tooltip2 }}<br>{{ tooltip3 }}</div>
<el-tooltip :id="机床总装" placement="bottom" @mouseover.native.prevent="changeActive($event)">
<div slot="content" style="max-height: 200px;overflow: auto" v-html="returns1"/>
<div :title="tooltip" style="position: relative;left:520px;top:-1170px; width: 100px;height: 28px;">
<el-row>
<!--<div :id="机床总装+circle" class="circle" style="margin-left: 13px"/>-->
<div style="float: left;text-align: center;width: 60px;line-height: 12px;font-size: 15px;font-weight: bold;margin-left: 3px">{{ 机床总装 }}</div>
</el-row>
</div>
</el-tooltip>
<el-tooltip :enterable="false" :id="部件装配" placement="top" @mouseover.native.prevent="changeActive($event)">
<div slot="content">{{ tooltip1 }}<br>{{ tooltip2 }}<br>{{ tooltip3 }}</div>
<el-tooltip :id="部件装配" placement="bottom" @mouseover.native.prevent="changeActive($event)">
<div slot="content" style="max-height: 200px;overflow: auto" v-html="returns2"/>
<div :title="tooltip" style="position: relative;left:660px;top:-1198px; width: 100px;height: 28px;">
<el-row>
<!--<div :id="部件装配+circle" class="circle" style="margin-left: 13px"/>-->
<div style="float: left;text-align: center;width: 60px;line-height: 12px;font-size: 15px;font-weight: bold;margin-left: 3px">{{ 部件装配 }}</div>
</el-row>
</div>
@@ -515,12 +513,14 @@
<script>
import $ from 'jquery'
import { mapGetters } from 'vuex'
import { getwork_state, getOP_state, searchtooltip, getOP_state2, getDaijiagong } from '@/api/ManufacturingCenter/EquipmentMonitoring'
import { getwork_state, getOP_state, searchtooltip, getOP_state2, getDaijiagong, getZongzhuang, getBuzhuang } from '@/api/ManufacturingCenter/EquipmentMonitoring'
import { wsuri, name3 } from '@/utils/request'
import { mapGetters } from 'vuex' // 暂无用
export default {
data() {
return {
returns1: '',
returns2: '',
fang: '_fang',
circle: '_circle',
tooltip: '',
@@ -583,12 +583,12 @@ export default {
opname: ''
}
},
computed: {
computed: { // 暂无用
...mapGetters([
'sidebar'
])
},
watch: {
watch: { // 暂无用
sidebar(val) {
console.log(val)
}
@@ -672,10 +672,32 @@ export default {
this.tooltip1 = ''
this.tooltip2 = ''
this.tooltip3 = ''
this.returns1 = ''
this.returns2 = ''
if ($event.path[2].id === '机床总装') {
this.tooltip1 = '无装配机床'
getZongzhuang().then(res2 => {
if (res2.data.length !== 0) {
this.returns1 = '<div slot="content">'
for (let i = 0; i < res2.data.length; i++) {
this.returns1 = this.returns1 + res2.data[i].机床图号 + '<br>'
}
this.returns1 = this.returns1 + '</div>'
} else {
this.returns1 = '<div slot="content">无总装机床</div>'
}
})
} else if ($event.path[2].id === '部件装配') {
this.tooltip1 = '无装配部件'
getBuzhuang().then(res3 => {
if (res3.data.length !== 0) {
this.returns2 = '<div slot="content">'
for (let i = 0; i < res3.data.length; i++) {
this.returns2 = this.returns2 + res3.data[i].机床图号 + '&nbsp;&nbsp;&nbsp;' + res3.data[i].任务名称 + '<br>'
}
this.returns2 = this.returns2 + '</div>'
} else {
this.returns2 = '<div slot="content">无装配部件</div>'
}
})
} else if ($event.path[2].id === 'OP1470') {
searchtooltip($event.path[2].id).then(response => {
if (response.data[0].工艺计划流水号 === 0 || response.data[0].工艺计划流水号 === null) {