添加接口

This commit is contained in:
2022-07-01 16:21:52 +08:00
parent ad4674f2a6
commit 94907d847f
8 changed files with 435 additions and 172 deletions

View File

@@ -287,3 +287,47 @@ export const taskoperate = (op, pcode, scode) => post('api/pda/task/operate', {
point_code: pcode, point_code: pcode,
storagevehicle_code: scode 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,62 +11,62 @@
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">日期</div> <div class="filter-label txtjustify">日期</div>
<div class="fxcol mgl20"> <div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.turnout_struct_code" disabled> <input type="text" class="filter-input filter-scan-input" v-model="val2">
</div> </div>
</div> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">工作时间</div> <div class="filter-label txtjustify">工作时间()</div>
<div class="fxcol mgl20"> <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="val3">
</div> </div>
</div> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">准备时间</div> <div class="filter-label txtjustify">准备时间()</div>
<div class="fxcol mgl20"> <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="val4">
</div> </div>
</div> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">故障时间</div> <div class="filter-label txtjustify">故障时间()</div>
<div class="fxcol mgl20"> <div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="robj.pcsn" disabled> <input type="text" class="filter-input filter-scan-input" v-model="val5">
</div> </div>
</div> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">工装调整时间</div> <div class="filter-label txtjustify">工装调整时间()</div>
<div class="fxcol mgl20"> <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> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">生产总量</div> <div class="filter-label txtjustify">生产总量</div>
<div class="fxcol mgl20"> <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> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">不合格量</div> <div class="filter-label txtjustify">不合格量</div>
<div class="fxcol mgl20"> <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> </div>
<div class="bottom-filter-tip"> <div class="bottom-filter-tip">
<div class="filter-label txtjustify">综合效率</div> <div class="filter-label txtjustify">综合效率(%)</div>
<div class="fxcol mgl20"> <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> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <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> <button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': (JSON.stringify(robj) == '{}') }" @click="save">保存</button>
</section> </section>
</section> </section>
</template> </template>
<script> <script>
import {queryPlate, confirmPlate} from '@config/getData1.js' import {queryRunRecord, calculate, save} from '@config/getData1.js'
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
export default { export default {
@@ -78,32 +78,70 @@ export default {
data () { data () {
return { return {
val1: '', val1: '',
val2: '',
val3: '0',
val4: '0',
val5: '0',
val6: '0',
val7: '0',
val8: '0',
val9: '',
robj: {}, robj: {},
form: {},
disabled1: false disabled1: false
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: { methods: {
handleChange (e, type) { handleChange (e, type) {
if (type) { if (type) {
this._queryPlate() this._queryRunRecord()
} }
}, },
async _queryPlate () { async _queryRunRecord () {
let res = await queryPlate(this.val1) let res = await queryRunRecord(this.val1)
if (res.code === '1') { if (res.code === '1') {
this.robj = res.plate_jo this.robj = res.content
this.val2 = 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 { } else {
this.Dialog(res.desc) this.Dialog(res.desc)
} }
}, },
async _confirmPlate () { calform () {
this.form = {
device_code: this.val1,
run_date: this.val2,
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.disabled1 = true
this.calform()
try { try {
let res = await confirmPlate(this.robj) let res = await calculate(this.form)
if (res.code === '1') { if (res.code === '1') {
this.toast(res.desc) this.toast(res.desc)
this.val1 = '' this.val1 = ''
this.robj = {} this.robj = {}
this.form = {}
} else { } else {
this.Dialog(res.desc) this.Dialog(res.desc)
} }
@@ -112,9 +150,28 @@ export default {
this.disabled1 = false this.disabled1 = false
} }
}, },
save () { async save () {
console.log(111) 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> </script>
<style lang="stylus" scoped>
>>>.filter-label
width 2.3rem
</style>

View File

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

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> <tr>
<th>入库单号</th> <th>入库单号</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.device_code}}</td> <td>{{e.bill_code}}</td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="slide"> <div class="slide">
<table class="layout-t"> <table class="layout-t">
<tr> <tr>
<th>备件名称</th> <th>物料编码</th>
<th>物料名称</th>
<th>数量</th> <th>数量</th>
<th>入库数量</th> <th>已入数</th>
<th>单位</th> <th>单位</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td> <td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td> <td>{{e.plan_qty}}</td>
<td>{{e.finish_qty}}</td>
<td>{{e.qty_unit_name}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">扫码入库</button> <button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="scaninstore">扫码入库</button>
</section> </section>
</section> </section>
</template> </template>
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import { queryIODtl } from '@config/getData1.js'
export default { export default {
name: 'SparePartInstore', name: 'SparePartInstore',
components: { components: {
NavBar, NavBar
SearchBox
}, },
data () { data () {
return { return {
val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {}
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: { methods: {
handleChange1 (e, type) { /** 1.1出入库单查询 */
if (type) { async _queryIODtl () {
console.log(e) let res = await queryIODtl('0')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.iostorinvdtl_id ? '' : e.iostorinvdtl_id
this.pkObj = this.pkId === e.worktask_id ? e : {} 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> <section>
<nav-bar title="备件出库"></nav-bar> <nav-bar title="备件出库"></nav-bar>
<section class="content mgt186"> <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="grid-wraper">
<div class="left_fixed"> <div class="left_fixed">
<table class="layout-t left_layout_t"> <table class="layout-t left_layout_t">
<tr> <tr>
<th>出库单号</th> <th>出库单号</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.device_code}}</td> <td>{{e.bill_code}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -26,78 +19,70 @@
<th>物料编码</th> <th>物料编码</th>
<th>物料名称</th> <th>物料名称</th>
<th>数量</th> <th>数量</th>
<th>已出数</th>
<th>单位</th>
<th>关联设备</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td> <td>{{e.material_name}}</td>
</tr> <td>{{e.plan_qty}}</td>
</table> <td>{{e.finish_qty}}</td>
</div> <td>{{e.qty_unit_name}}</td>
</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.device_code}}</td> <td>{{e.device_code}}</td>
</tr> </tr>
</table> </table>
</div> </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> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">查询</button> <button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="scaninstore">扫码出库</button>
<button class="btn submit-button">删除</button>
<button class="btn submit-button">确认</button>
</section> </section>
</section> </section>
</template> </template>
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import { queryIODtl } from '@config/getData1.js'
export default { export default {
name: 'SparePartOutstore', name: 'SparePartOutstore',
components: { components: {
NavBar, NavBar
SearchBox
}, },
data () { data () {
return { return {
val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {}
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: { methods: {
handleChange1 (e, type) { /** 1.1出入库单查询 */
if (type) { async _queryIODtl () {
console.log(e) let res = await queryIODtl('1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.iostorinvdtl_id ? '' : e.iostorinvdtl_id
this.pkObj = this.pkId === e.worktask_id ? e : {} 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" v-model="val1"
@handleChange="handleChange" @handleChange="handleChange"
></search-box> ></search-box>
<div class="bottom-filter-tip"> </div>
<div class="filter-label txtjustify">备件名称</div> <div class="grid-wraper">
<div class="fxcol mgl20"> <div class="left_fixed">
<input type="text" class="filter-input filter-scan-input" v-model="robj.turnout_struct_code" disabled> <table class="layout-t left_layout_t">
</div> <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>
<div class="bottom-filter-tip"> <div class="slide">
<div class="filter-label txtjustify"> </div> <table class="layout-t">
<div class="fxcol mgl20"> <tr>
<input type="text" class="filter-input filter-scan-input" v-model="robj.storagevehicle_code" disabled> <th>备件名称</th>
</div> <th>型号</th>
</div> <th>规格</th>
<div class="bottom-filter-tip"> <th>数量</th>
<div class="filter-label txtjustify">技术规格</div> <th>源单号</th>
<div class="fxcol mgl20"> <th>源单类型</th>
<input type="text" class="filter-input filter-scan-input" v-model="robj.material_code" disabled> <th>关联设备</th>
</div> </tr>
</div> <tr v-for="e in dataList" :key="e.sparepart_only_id" @click="toCheck(e)" :class="{'checked': e.sparepart_only_id === pkId}">
<div class="bottom-filter-tip"> <td>{{e.material_name}}</td>
<div class="filter-label txtjustify"> </div> <td>{{e.material_model}}</td>
<div class="fxcol mgl20"> <td>{{e.material_spec}}</td>
<input type="text" class="filter-input filter-scan-input" v-model="robj.pcsn" disabled> <td>{{e.qty_unit_name}}</td>
</div> <td>{{e.source_bill_code}}</td>
</div> <td>{{e.source_type_name}}</td>
<div class="bottom-filter-tip"> <td>{{e.device_code}}</td>
<div class="filter-label txtjustify">出库单号</div> </tr>
<div class="fxcol mgl20"> </table>
<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> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <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>
</section> </section>
</template> </template>
<script> <script>
import {queryPlate, confirmPlate} from '@config/getData1.js' import {queryReturnDis, confirmReturn} from '@config/getData1.js'
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
export default { export default {
@@ -65,32 +63,44 @@ export default {
data () { data () {
return { return {
val1: '', val1: '',
robj: {}, dataList: [],
disabled1: false disabled1: false
} }
}, },
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
methods: { methods: {
handleChange (e, type) { handleChange (e, type) {
if (type) { if (type) {
this._queryPlate() this._queryReturnDis()
} }
}, },
async _queryPlate () { async _queryReturnDis () {
let res = await queryPlate(this.val1) let res = await queryReturnDis(this.val1)
if (res.code === '1') { if (res.code === '1') {
this.robj = res.plate_jo this.dataList.map((el) => {
if (el.sparepart_only_id === this.val1) {
this.toast('报错')
} else {
this.dataList.push(res.content)
}
})
} else { } else {
this.Dialog(res.desc) this.Dialog(res.desc)
} }
}, },
async _confirmPlate () { async _confirmReturn () {
this.disabled1 = true this.disabled1 = true
try { try {
let res = await confirmPlate(this.robj) let res = await confirmReturn(this.dataList)
if (res.code === '1') { if (res.code === '1') {
this.toast(res.desc) this.toast(res.desc)
this.val1 = '' this.val1 = ''
this.robj = {} this.dataList = []
} else { } else {
this.Dialog(res.desc) 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 SparePartInstore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/SparePartInstore')), 'SparePartInstore')
const ScanInStore = r => require.ensure([], () => r(require('../pages/xinrui/equipment/ScanInStore')), 'ScanInStore') 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 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 UseReturn = r => require.ensure([], () => r(require('../pages/xinrui/equipment/UseReturn')), 'UseReturn')
const RunLogFill = r => require.ensure([], () => r(require('../pages/xinrui/equipment/RunLogFill')), 'RunLogFill') const RunLogFill = r => require.ensure([], () => r(require('../pages/xinrui/equipment/RunLogFill')), 'RunLogFill')
@@ -491,6 +492,10 @@ export default new Router({
path: '/SparePartOutstore', // 备件出库 path: '/SparePartOutstore', // 备件出库
component: SparePartOutstore component: SparePartOutstore
}, },
{
path: '/ScanOutStore', // 扫码出库
component: ScanOutStore
},
{ {
path: '/UseReturn', // 领用还回 path: '/UseReturn', // 领用还回
component: UseReturn component: UseReturn