init
This commit is contained in:
201
src/pages/xinrui/softwaste/CleaningGroupBarrel.vue
Normal file
201
src/pages/xinrui/softwaste/CleaningGroupBarrel.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="清洗组桶标签打印"></nav-bar>
|
||||
<section class="content mgt186">
|
||||
<div class="filter-wraper">
|
||||
<search-box
|
||||
label="装入桶"
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
></search-box>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="fxcol fxrow relative">
|
||||
<div class="filter-label txtjustify">物料</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" v-model="val2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mgl20">
|
||||
<button class="btn" @click="searchList">查询</button>
|
||||
</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="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" v-model="val4">
|
||||
</div>
|
||||
<div class="mgl20">{{result.qty_unit_name}}</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="val5">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" @click="clearUp">清空</button>
|
||||
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': val1 !== '' || val2 === '' || val3 === '' || val4 === '' || val5 === ''}" @click="toSure">确认组桶</button>
|
||||
<button class="btn submit-button" :disabled="disabled2" :class="{'btn-disabled': val1 === ''}" @click="toPrint">打印</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import {queryInfoBybucket3, confirmGroupBucket3, reworkMaterialPrint3, getpcsn} from '@config/getData2.js'
|
||||
import {toPrint} from '@config/print.js'
|
||||
export default {
|
||||
name: 'CleaningGroupBarrel',
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
val4: '50',
|
||||
val5: '1',
|
||||
result: {},
|
||||
disabled1: false,
|
||||
disabled2: false
|
||||
}
|
||||
},
|
||||
beforeRouteLeave (to, from, next) {
|
||||
if (to.path === '/home' || to.path === '/login') {
|
||||
this.$store.dispatch('setKeepAlive', [])
|
||||
}
|
||||
next()
|
||||
},
|
||||
activated () {
|
||||
this.val2 = this.$store.getters.materObj.material_code
|
||||
},
|
||||
created () {
|
||||
// let cd = new Date()
|
||||
// let year = cd.getFullYear()
|
||||
// let month = cd.getMonth() + 1 < 10 ? '0' + (cd.getMonth() + 1) : cd.getMonth() + 1
|
||||
// let date = cd.getDate() < 10 ? '0' + cd.getDate() : cd.getDate()
|
||||
// this.val3 = year + month + date + '-QX'
|
||||
this._getpcsn()
|
||||
},
|
||||
methods: {
|
||||
handleChange (e, type) {
|
||||
if (type) {
|
||||
this._queryInfoBybucket2(e)
|
||||
}
|
||||
},
|
||||
/** 物料查询 */
|
||||
async searchList () {
|
||||
this.$router.push({
|
||||
path: '/MaterInfoSearchRadio'
|
||||
})
|
||||
},
|
||||
/** 批次查询 */
|
||||
async _getpcsn () {
|
||||
let res = await getpcsn()
|
||||
if (res.code === '1') {
|
||||
this.val3 = res.result + '-QX'
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 根据桶查询 */
|
||||
async _queryInfoBybucket2 (e) {
|
||||
let res = await queryInfoBybucket3(e)
|
||||
if (res.code === '1') {
|
||||
this.$store.dispatch('materObj', '')
|
||||
if ('result' in res) {
|
||||
this.result = res.result
|
||||
this.val2 = res.result.material_code
|
||||
this.val3 = res.result.pcsn
|
||||
this.val4 = res.result.storage_qty
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 清空 */
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.$store.dispatch('materObj', '')
|
||||
this.val3 = ''
|
||||
this.val4 = '50'
|
||||
this.val5 = '1'
|
||||
this.result = {}
|
||||
},
|
||||
/** 确认组桶 */
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (this.val1 !== '') {
|
||||
this.toast('桶码必须为空')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.val2 === '' || this.val3 === '' || this.val4 === '' || this.val5 === '') {
|
||||
this.toast('物料、批次、重量、桶数不能为空')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
this._confirmGroupBucket2()
|
||||
},
|
||||
async _confirmGroupBucket2 () {
|
||||
try {
|
||||
let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : ''
|
||||
let user = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).user_name : ''
|
||||
let newObj = Object.assign({}, this.result, this.$store.getters.materObj, {pcsn: this.val3, storage_qty: this.val4, bucket_no: this.val5, accountId: accountId, user: user})
|
||||
let res = await confirmGroupBucket3(newObj)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
if (res.result.length > 0) {
|
||||
res.result.map(el => {
|
||||
setTimeout(toPrint(el), 800)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
async toPrint () {
|
||||
this.disabled2 = true
|
||||
if (this.val1 === '') {
|
||||
this.toast('桶码不能为空')
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await reworkMaterialPrint3(this.val1)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
if (res.result.length > 0) {
|
||||
res.result.map(el => {
|
||||
setTimeout(toPrint(el), 800)
|
||||
})
|
||||
}
|
||||
Object.assign(this.$data, this.$options.data())
|
||||
this._getpcsn()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
234
src/pages/xinrui/softwaste/SoftWasteCleanInStore.vue
Normal file
234
src/pages/xinrui/softwaste/SoftWasteCleanInStore.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="软废清洗入库"></nav-bar>
|
||||
<section class="content mgt186 mgb70">
|
||||
<div class="filter-wraper">
|
||||
<search-box
|
||||
label="站点"
|
||||
v-model="val1"
|
||||
@handleChange="handleChange1"
|
||||
></search-box>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="fxcol">
|
||||
<search-box
|
||||
class="pad"
|
||||
label="载具码"
|
||||
:focused="true"
|
||||
v-model="val2"
|
||||
@handleChange="handleChange2"
|
||||
></search-box>
|
||||
</div>
|
||||
<!-- <div class="mgl5">
|
||||
<button class="btn btn1" :class="{'btn-disabled': !(val1 !== '' && (val2 === '' || val2 === undefined))}" @click="getPallet">取空托盘</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<search-box
|
||||
label="桶码"
|
||||
:focused="true"
|
||||
v-model="val3"
|
||||
@handleChange="handleChange3"
|
||||
></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.bucketunique" @click="toCheck(e)" :class="{'checked': e.bucketunique === pkId}">
|
||||
<td>{{e.bucketunique}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="slide">
|
||||
<table class="layout-t">
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<th>批次</th>
|
||||
<th>重量kg</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.bucketunique" @click="toCheck(e)" :class="{'checked': e.bucketunique === pkId}">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.storage_qty | numeric(3)}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="calc_value_wraper">
|
||||
<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="val4">
|
||||
</div>
|
||||
<div class="mgl20">KG</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" :class="{'btn-disabled': this.pkId === ''}" @click="deleteList">删除行</button>
|
||||
<button class="btn submit-button" :disabled="disabled" :class="{'btn-disabled': dataList.length === 0}" @click="toSure">组盘入库</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import SearchBox from '@components/SearchBox.vue'
|
||||
import {queryPoint, needVehicle, checkVehicle, checkBucket, confirmVehicle} from '@config/getData2.js'
|
||||
import {accAdd} from '@config/mUtils.js'
|
||||
export default {
|
||||
name: 'SoftWasteCleanInStore',
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
vehicle: {},
|
||||
point: {},
|
||||
val2: '',
|
||||
val3: '',
|
||||
val4: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: '',
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange1 (e, type) {
|
||||
if (type) {
|
||||
this._queryPoint(e)
|
||||
}
|
||||
},
|
||||
handleChange2 (e, type) {
|
||||
if (this.val1 === '' || this.val1 === undefined) {
|
||||
this.toast('请先扫站点')
|
||||
return
|
||||
}
|
||||
if (type) {
|
||||
this._checkVehicle(e, '7')
|
||||
}
|
||||
},
|
||||
handleChange3 (e, type) {
|
||||
if (type) {
|
||||
this._checkBucket(e, '7')
|
||||
}
|
||||
},
|
||||
/** 取空托盘 */
|
||||
getPallet () {
|
||||
if (this.val1 !== '' && (this.val2 === '' || this.val2 === undefined)) {
|
||||
this._needVehicle(this.val1)
|
||||
}
|
||||
},
|
||||
async _needVehicle (code) {
|
||||
let res = await needVehicle(code)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.bucketunique ? '' : e.bucketunique
|
||||
this.pkObj = this.pkId === e.bucketunique ? e : {}
|
||||
},
|
||||
/** 删除行 */
|
||||
deleteList () {
|
||||
if (this.pkId !== '') {
|
||||
this.dataList.map((el, i) => {
|
||||
if (el.bucketunique === this.pkId) {
|
||||
this.dataList.splice(i, 1)
|
||||
}
|
||||
})
|
||||
this.val4 = '0.000'
|
||||
this.dataList.map(el => {
|
||||
this.val4 = accAdd(this.val4, el.storage_qty)
|
||||
})
|
||||
this.val4 = Number(this.val4).toFixed(3) + ''
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
}
|
||||
},
|
||||
/** 确认组盘 */
|
||||
toSure () {
|
||||
this.disabled = true
|
||||
if (this.dataList.length === 0) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this._confirmVehicle()
|
||||
},
|
||||
/** 查询站点 */
|
||||
async _queryPoint (code) {
|
||||
let res = await queryPoint(code, '')
|
||||
if (res.code === '1') {
|
||||
this.vehicle = res.vehicle
|
||||
this.point = res.point
|
||||
this.val1 = res.point.point_code
|
||||
this.val2 = res.vehicle.storagevehicle_code
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 查询载具码 */
|
||||
async _checkVehicle (code, type) {
|
||||
let res = await checkVehicle(code, type)
|
||||
if (res.code === '1') {
|
||||
this.vehicle = res.vehicle_jo
|
||||
this.val2 = res.vehicle_jo.storagevehicle_code
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
/** 查询桶信息 */
|
||||
async _checkBucket (code, type) {
|
||||
let res = await checkBucket(code, type)
|
||||
if (res.code === '1') {
|
||||
if (this.dataList.length) {
|
||||
let arr = this.dataList.filter(el => { return el.bucketunique === res.bucket_jo.bucketunique })
|
||||
if (arr.length) {
|
||||
this.toast('桶码已存在')
|
||||
} else {
|
||||
this.dataList.push(res.bucket_jo)
|
||||
}
|
||||
} else {
|
||||
this.dataList.push(res.bucket_jo)
|
||||
}
|
||||
this.val4 = '0.000'
|
||||
this.dataList.map(el => {
|
||||
this.val4 = accAdd(this.val4, el.storage_qty)
|
||||
})
|
||||
this.val4 = Number(this.val4).toFixed(3) + ''
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _confirmVehicle () {
|
||||
try {
|
||||
let res = await confirmVehicle('7', this.vehicle, this.dataList, this.point)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
Object.assign(this.$data, this.$options.data())
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.pad
|
||||
padding-top 0
|
||||
.btn1
|
||||
max-width auto
|
||||
font-size .2rem
|
||||
padding 0 .1rem
|
||||
</style>
|
||||
Reference in New Issue
Block a user