This commit is contained in:
2022-07-01 17:28:50 +08:00
8 changed files with 462 additions and 177 deletions

View File

@@ -287,3 +287,47 @@ export const taskoperate = (op, pcode, scode) => post('api/pda/task/operate', {
point_code: pcode,
storagevehicle_code: scode
})
/** 备件出入库 */
// 1.1出入库单查询
export const queryIODtl = (flag) => post('api/pda/sb/queryIODtl', {
io_flag: flag
})
// 1.2备品备件扫描
export const queryIODis = (sid, iid) => post('api/pda/sb/queryIODis', {
sparepart_only_id: sid,
iostorinvdtl_id: iid
})
// 1.3确认
export const confirmDis = (ioflag, form, rows) => post('api/pda/sb/confirmDis', {
io_flag: ioflag,
form: form,
rows: rows
})
// 1.4领用还回查询
export const queryReturnDis = (sid) => post('api/pda/sb/queryReturnDis', {
sparepart_only_id: sid
})
// 1.5确认入库
export const confirmReturn = (rows) => post('api/pda/sb/confirmReturn', {
rows: rows
})
// 1.6运行记录查询
export const queryRunRecord = (code) => post('api/pda/sb/queryRunRecord', {
device_code: code
})
// 1.7计算
export const calculate = (form) => post('api/pda/sb/calculate', {
form: form
})
// 1.8保存
export const save = (form) => post('api/pda/sb/save', {
form: form
})

View File

@@ -11,99 +11,159 @@
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">日期</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.turnout_struct_code" disabled>
<div class="filter-input filter-input_1 pointer" @click="show = true">{{date}}</div>
</div>
</div>
<van-calendar v-model="show" :min-date="minDate" :default-date="defaultDate" @confirm="onConfirm" />
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">工作时间()</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val3">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">工作时间</div>
<div class="filter-label txtjustify">准备时间()</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.storagevehicle_code" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val4">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">准备时间</div>
<div class="filter-label txtjustify">故障时间()</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.material_code" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val5">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">故障时间</div>
<div class="filter-label txtjustify">工装调整时间()</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.pcsn" disabled>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">工装调整时间</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.bucket_out" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val6">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">生产总量</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.out_qty" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val7">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">不合格量</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.out_qty" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val8">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">综合效率</div>
<div class="filter-label txtjustify">综合效率(%)</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.out_qty" disabled>
<input type="text" class="filter-input filter-scan-input" v-model="val9" disabled>
</div>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': (JSON.stringify(robj) == '{}') }" @click="_confirmPlate">计算</button>
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': (JSON.stringify(robj) == '{}') }" @click="calculate">计算</button>
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': (JSON.stringify(robj) == '{}') }" @click="save">保存</button>
</section>
</section>
</template>
<script>
import {queryPlate, confirmPlate} from '@config/getData1.js'
import { Calendar } from 'vant'
import {queryRunRecord, calculate, save} from '@config/getData1.js'
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
export default {
name: 'RunLogFill',
components: {
NavBar,
SearchBox
SearchBox,
[Calendar.name]: Calendar
},
data () {
return {
val1: '',
val3: '0',
val4: '0',
val5: '0',
val6: '0',
val7: '0',
val8: '0',
val9: '',
robj: {},
form: {},
date: '',
show: false,
minDate: new Date(2000, 0, 1),
defaultDate: new Date(),
disabled1: false
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
created () {
this.date = this.formatDate(new Date())
},
methods: {
formatDate (date) {
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return `${date.getFullYear()}-` + month + `-` + day
},
onConfirm (date) {
this.show = false
this.date = this.formatDate(date)
},
handleChange (e, type) {
if (type) {
this._queryPlate()
this._queryRunRecord()
}
},
async _queryPlate () {
let res = await queryPlate(this.val1)
async _queryRunRecord () {
let res = await queryRunRecord(this.val1)
if (res.code === '1') {
this.robj = res.plate_jo
this.robj = res.content
this.date = this.robj.run_date
this.val3 = this.robj.run_times
this.val4 = this.robj.prepare_times
this.val5 = this.robj.error_times
this.val6 = this.robj.adjust_times
this.val7 = this.robj.product_qty
this.val8 = this.robj.nok_qty
this.val9 = this.robj.oee_value
} else {
this.Dialog(res.desc)
}
},
async _confirmPlate () {
calform () {
if (!(this.val3 >= 0 && this.val4 >= 0 && this.val5 >= 0 && this.val6 >= 0 && this.val7 >= 0 && this.val8 >= 0)) {
this.toast('值须>=0')
return
}
this.form = {
device_code: this.val1,
run_date: this.date,
run_times: this.val3,
prepare_times: this.val4,
error_times: this.val5,
adjust_times: this.val6,
product_qty: this.val7,
nok_qty: this.val8,
oee_value: this.val9
}
},
async calculate () {
this.disabled1 = true
this.calform()
try {
let res = await confirmPlate(this.robj)
let res = await calculate(this.form)
if (res.code === '1') {
this.toast(res.desc)
this.val1 = ''
this.robj = {}
this.form = {}
} else {
this.Dialog(res.desc)
}
@@ -112,9 +172,28 @@ export default {
this.disabled1 = false
}
},
save () {
console.log(111)
async save () {
this.disabled1 = true
this.calform()
try {
let res = await save(this.form)
if (res.code === '1') {
this.toast(res.desc)
this.val1 = ''
this.robj = {}
this.form = {}
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (error) {
this.disabled1 = false
}
}
}
}
</script>
<style lang="stylus" scoped>
>>>.filter-label
width 2.3rem
</style>

View File

@@ -21,13 +21,13 @@
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">采购数量</div>
<div class="filter-label txtjustify">待入数</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val4">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">入库数量</div>
<div class="filter-label txtjustify">已入数</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val5">
</div>
@@ -40,19 +40,21 @@
<th>备件唯一编码</th>
<th>备件名称</th>
<th>数量</th>
<th>单位</th>
</tr>
<tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
<td>{{e.maint_item_name}}</td>
<td>{{e.item_level}}</td>
<td>{{e.contents}}</td>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<td>{{e.sparepart_only_id}}</td>
<td>{{e.material_name}}</td>
<td>{{e.real_qty}}</td>
<td>{{e.qty_unit_name}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure1">删除</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled2" @click="toSure2">确认</button>
<button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="del()">删除</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认</button>
</section>
</section>
</template>
@@ -60,7 +62,7 @@
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import {queryMaintenanceDtl, dtlConfirm} from '@config/getData2.js'
import {queryIODis, confirmDis} from '@config/getData1.js'
export default {
name: 'ScanInStore',
components: {
@@ -70,66 +72,67 @@ export default {
data () {
return {
val1: '',
val2: '',
val3: '',
val4: '',
val5: '',
val2: this.$store.getters.materObj.bill_code || '',
val3: this.$store.getters.materObj.material_name || '',
val4: this.$store.getters.materObj.need_qty || '',
val5: this.$store.getters.materObj.finish_qty || '',
dataList: [],
pkId: '',
pkObj: {},
disabled1: false,
disabled2: false
disabled1: false
}
},
methods: {
handleChange1 (e, type) {
if (type) {
console.log(e)
this._queryIODis(e)
}
},
toCheck (e) {
this.pkId = this.pkId === e.maint_dtl_id ? '' : e.maint_dtl_id
this.pkObj = this.pkId === e.maint_dtl_id ? e : {}
this.pkId = this.pkId === e.sparepart_only_id ? '' : e.sparepart_only_id
this.pkObj = this.pkId === e.sparepart_only_id ? e : {}
},
/** 明细查询 */
async _queryMaintenanceDtl () {
let res = await queryMaintenanceDtl(this.$store.getters.materObj)
/** 1.2备品备件扫描 */
async _queryIODis (e) {
let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id)
if (res.code === '1') {
this.dataList = [...res.content.rows]
this.dataList = [...res.content]
} else {
this.Dialog(res.desc)
}
},
async _dtlConfirm () {
async _confirmDis () {
try {
let res = await dtlConfirm(this.dataList)
let res = await confirmDis('0', this.$store.getters.materObj, this.dataList)
if (res.code === '1') {
this.toast(res.desc)
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
this.disabled2 = false
} catch (e) {
this.disabled1 = false
this.disabled2 = false
}
},
toSure1 () {
del () {
if (!this.pkId) {
return
}
this.dataList.map((el, i) => {
if (el.sparepart_only_id === this.pkId) {
this.dataList.splice(i, 1)
}
})
this.pkId = ''
this.pkObj = {}
},
toSure () {
this.disabled1 = true
if (!this.dataList.length) {
this.disabled1 = false
return
}
this._dtlConfirm()
},
toSure2 () {
this.disabled2 = true
if (!this.dataList.length) {
this.disabled2 = false
return
}
this._dtlConfirm()
this._confirmDis()
}
}
}

View File

@@ -0,0 +1,141 @@
<template>
<section>
<nav-bar :inner="true" title="扫码出库"></nav-bar>
<section class="content mgt186">
<div class="filter-wraper">
<search-box
label="备品备件"
v-model="val1"
@handleChange="handleChange1"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">出库单</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val2">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">物料</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val3">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">待出数</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val4">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">已出数</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="" v-model="val5">
</div>
</div>
</div>
<div class="grid-wraper">
<div class="slide">
<table class="layout-t">
<tr>
<th>备件唯一编码</th>
<th>备件名称</th>
<th>数量</th>
<th>单位</th>
<th>货位</th>
</tr>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<td>{{e.sparepart_only_id}}</td>
<td>{{e.material_name}}</td>
<td>{{e.real_qty}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.struct_name}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="del()">删除</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import {queryIODis, confirmDis} from '@config/getData1.js'
export default {
name: 'ScanOutStore',
components: {
NavBar,
SearchBox
},
data () {
return {
val1: '',
val2: this.$store.getters.materObj.bill_code || '',
val3: this.$store.getters.materObj.material_name || '',
val4: this.$store.getters.materObj.need_qty || '',
val5: this.$store.getters.materObj.finish_qty || '',
dataList: [],
pkId: '',
pkObj: {},
disabled1: false
}
},
methods: {
handleChange1 (e, type) {
if (type) {
this._queryIODis(e)
}
},
toCheck (e) {
this.pkId = this.pkId === e.sparepart_only_id ? '' : e.sparepart_only_id
this.pkObj = this.pkId === e.sparepart_only_id ? e : {}
},
/** 1.2备品备件扫描 */
async _queryIODis (e) {
let res = await queryIODis(e, this.$store.getters.materObj.iostorinvdtl_id)
if (res.code === '1') {
this.dataList = [...res.content]
} else {
this.Dialog(res.desc)
}
},
async _confirmDis () {
try {
let res = await confirmDis('1', this.$store.getters.materObj, this.dataList)
if (res.code === '1') {
this.toast(res.desc)
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
del () {
if (!this.pkId) {
return
}
this.dataList.map((el, i) => {
if (el.sparepart_only_id === this.pkId) {
this.dataList.splice(i, 1)
}
})
this.pkId = ''
this.pkObj = {}
},
toSure () {
this.disabled1 = true
if (!this.dataList.length) {
this.disabled1 = false
return
}
this._confirmDis()
}
}
}
</script>

View File

@@ -8,61 +8,79 @@
<tr>
<th>入库单号</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.device_code}}</td>
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.bill_code}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>备件名称</th>
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
<th>入库数量</th>
<th>已入数</th>
<th>单位</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.workorder_code}}</td>
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.material_name}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.finish_qty}}</td>
<td>{{e.qty_unit_name}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button">扫码入库</button>
<button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="scaninstore">扫码入库</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import { queryIODtl } from '@config/getData1.js'
export default {
name: 'SparePartInstore',
components: {
NavBar,
SearchBox
NavBar
},
data () {
return {
val1: '',
dataList: [],
pkId: '',
pkObj: {}
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: {
handleChange1 (e, type) {
if (type) {
console.log(e)
/** 1.1出入库单查询 */
async _queryIODtl () {
let res = await queryIODtl('0')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
this.pkObj = this.pkId === e.worktask_id ? e : {}
this.pkId = this.pkId === e.iostorinvdtl_id ? '' : e.iostorinvdtl_id
this.pkObj = this.pkId === e.iostorinvdtl_id ? e : {}
},
scaninstore () {
if (this.pkId) {
this.$store.dispatch('materObj', this.pkObj)
this.$router.push({
path: '/ScanInStore'
})
}
}
}
}

View File

@@ -2,21 +2,14 @@
<section>
<nav-bar title="备件出库"></nav-bar>
<section class="content mgt186">
<div class="filter-wraper">
<search-box
label="备品备件"
v-model="val1"
@handleChange="handleChange1"
></search-box>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>出库单号</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.device_code}}</td>
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.bill_code}}</td>
</tr>
</table>
</div>
@@ -26,78 +19,70 @@
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
<th>已出数</th>
<th>单位</th>
<th>关联设备</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.workorder_code}}</td>
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="content mgt186">
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>备件唯一码</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.material_name}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.finish_qty}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.device_code}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button">查询</button>
<button class="btn submit-button">删除</button>
<button class="btn submit-button">确认</button>
<button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="scaninstore">扫码出库</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import { queryIODtl } from '@config/getData1.js'
export default {
name: 'SparePartOutstore',
components: {
NavBar,
SearchBox
NavBar
},
data () {
return {
val1: '',
dataList: [],
pkId: '',
pkObj: {}
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: {
handleChange1 (e, type) {
if (type) {
console.log(e)
/** 1.1出入库单查询 */
async _queryIODtl () {
let res = await queryIODtl('1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
this.pkObj = this.pkId === e.worktask_id ? e : {}
this.pkId = this.pkId === e.iostorinvdtl_id ? '' : e.iostorinvdtl_id
this.pkObj = this.pkId === e.iostorinvdtl_id ? e : {}
},
scaninstore () {
if (this.pkId) {
this.$store.dispatch('materObj', this.pkObj)
this.$router.push({
path: '/ScanOutStore'
})
}
}
}
}

View File

@@ -8,52 +8,50 @@
v-model="val1"
@handleChange="handleChange"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">备件名称</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.turnout_struct_code" disabled>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>备件唯一编码</th>
</tr>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<td>{{e.sparepart_only_id}}</td>
</tr>
</table>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify"> </div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.storagevehicle_code" disabled>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">技术规格</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.material_code" disabled>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify"> </div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.pcsn" disabled>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">出库单号</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.bucket_out" disabled>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">关联设备</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.out_qty" disabled>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>备件名称</th>
<th>型号</th>
<th>规格</th>
<th>数量</th>
<th>源单号</th>
<th>源单类型</th>
<th>关联设备</th>
</tr>
<tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<td>{{e.material_name}}</td>
<td>{{e.material_model}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.source_bill_code}}</td>
<td>{{e.source_type_name}}</td>
<td>{{e.device_code}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': (JSON.stringify(robj) == '{}') }" @click="_confirmPlate">确认</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认入库</button>
</section>
</section>
</template>
<script>
import {queryPlate, confirmPlate} from '@config/getData1.js'
import {queryReturnDis, confirmReturn} from '@config/getData1.js'
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
export default {
@@ -65,32 +63,44 @@ export default {
data () {
return {
val1: '',
robj: {},
dataList: [],
disabled1: false
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: {
handleChange (e, type) {
if (type) {
this._queryPlate()
this._queryReturnDis()
}
},
async _queryPlate () {
let res = await queryPlate(this.val1)
async _queryReturnDis () {
let res = await queryReturnDis(this.val1)
if (res.code === '1') {
this.robj = res.plate_jo
this.dataList.map((el) => {
if (el.sparepart_only_id === this.val1) {
this.dataList.push(res.content)
} else {
this.toast('关联设备不一致')
}
})
} else {
this.Dialog(res.desc)
}
},
async _confirmPlate () {
async _confirmReturn () {
this.disabled1 = true
try {
let res = await confirmPlate(this.robj)
let res = await confirmReturn(this.dataList)
if (res.code === '1') {
this.toast(res.desc)
this.val1 = ''
this.robj = {}
this.dataList = []
} else {
this.Dialog(res.desc)
}

View File

@@ -99,6 +99,7 @@ const EquipRepairConfirm = r => require.ensure([], () => r(require('../pages/xin
const SparePartInstore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/SparePartInstore')), 'SparePartInstore')
const ScanInStore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/ScanInStore')), 'ScanInStore')
const SparePartOutstore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/SparePartOutstore')), 'SparePartOutstore')
const ScanOutStore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/ScanOutStore')), 'ScanOutStore')
const UseReturn = r => require.ensure([], () => r(require('../pages/xinrui/equipment/UseReturn')), 'UseReturn')
const RunLogFill = r => require.ensure([], () => r(require('../pages/xinrui/equipment/RunLogFill')), 'RunLogFill')
@@ -492,6 +493,10 @@ export default new Router({
path: '/SparePartOutstore', // 备件出库
component: SparePartOutstore
},
{
path: '/ScanOutStore', // 扫码出库
component: ScanOutStore
},
{
path: '/UseReturn', // 领用还回
component: UseReturn