无袋
This commit is contained in:
82
src/components/SearchBox3.vue
Normal file
82
src/components/SearchBox3.vue
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bottom-filter-tip">
|
||||||
|
<div class="filter-label txtjustify">{{label}}</div>
|
||||||
|
<div class="fxcol mgl20 relative">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="filter-input filter-scan-input search_input"
|
||||||
|
ref="input"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:value="value"
|
||||||
|
@focus="handleFocus"
|
||||||
|
@blur="handleBlur"
|
||||||
|
@submit="handleSend">
|
||||||
|
<div class="button_box">
|
||||||
|
<button class="search_box_icon" @click="focusState = true">
|
||||||
|
<span class="iconfont scan_icon" :class="{'scan_icon_checked': focusState}"></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SearchBox',
|
||||||
|
model: {
|
||||||
|
prop: 'value',
|
||||||
|
event: 'input'
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
value: String,
|
||||||
|
label: String,
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
focusState: false,
|
||||||
|
readOnly: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleFocus () {
|
||||||
|
this.$refs.input.focus()
|
||||||
|
this.focusState = true
|
||||||
|
},
|
||||||
|
handleBlur (e) {
|
||||||
|
this.$emit('input', e.target.value)
|
||||||
|
if (e.target.value.length) {
|
||||||
|
this.$emit('handleChange', e.target.value)
|
||||||
|
}
|
||||||
|
this.focusState = false
|
||||||
|
},
|
||||||
|
handleSend (e) {
|
||||||
|
this.$emit('input', e.target.value)
|
||||||
|
if (e.target.value.length) {
|
||||||
|
this.$emit('handleChange', e.target.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
@import '~@style/mixin'
|
||||||
|
.search_input
|
||||||
|
padding-right .7rem
|
||||||
|
.button_box
|
||||||
|
_fj()
|
||||||
|
position absolute
|
||||||
|
top 50%
|
||||||
|
transform translateY(-50%)
|
||||||
|
right 0.02rem
|
||||||
|
// height .9rem
|
||||||
|
.search_box_icon
|
||||||
|
_wh(.7rem, 100%)
|
||||||
|
background-color #fff
|
||||||
|
.bor_r
|
||||||
|
border-right 0.02rem solid #dcdfe6
|
||||||
|
</style>
|
||||||
@@ -66,10 +66,18 @@ export const confirmGroupBucket = (mst, dtl) => post('api/pda/set/bucket/confirm
|
|||||||
mst: mst,
|
mst: mst,
|
||||||
dtl: dtl
|
dtl: dtl
|
||||||
})
|
})
|
||||||
|
// 软废无袋组桶标签打印-确定组桶(点击确定组桶按钮)
|
||||||
|
export const confirmGroupBucketNo = (mst) => post('api/pda/set/bucket/confirmGroupBucket2', {
|
||||||
|
mst: mst
|
||||||
|
})
|
||||||
// 1.4 确定组桶打印(点击确定组桶按钮)
|
// 1.4 确定组桶打印(点击确定组桶按钮)
|
||||||
export const bucketPrint = (code) => post('api/pda/set/bucket/print', {
|
export const bucketPrint = (code) => post('api/pda/set/bucket/print', {
|
||||||
bucketunique: code
|
bucketunique: code
|
||||||
})
|
})
|
||||||
|
// 软废无袋组桶标签打印-确定组桶打印(点击确定组桶按钮)
|
||||||
|
export const bucketPrintNo = (code) => post('api/pda/set/bucket/print2', {
|
||||||
|
bucketunique: code
|
||||||
|
})
|
||||||
// 1.5等级下拉框
|
// 1.5等级下拉框
|
||||||
export const bucketGetLevel = () => post('api/pda/set/bucket/getLevel', {})
|
export const bucketGetLevel = () => post('api/pda/set/bucket/getLevel', {})
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<section>
|
<section>
|
||||||
<nav-bar title="软废无袋组桶标签打印"></nav-bar>
|
<nav-bar title="软废无袋组桶标签打印"></nav-bar>
|
||||||
<section ref="content" class="content mgb70" :style="'margin-top: '+(0.96+2 * 0.92)+ 'rem'">
|
<section ref="content" class="content mgb70" :style="'margin-top: '+(0.96+ 0.92 + 0.76)+ 'rem'">
|
||||||
<div class="filter-wraper">
|
<div class="filter-wraper">
|
||||||
<search-box
|
<search-box
|
||||||
|
ref="scanChild"
|
||||||
label="桶码"
|
label="桶码"
|
||||||
|
placeholder="请按扫码键输入"
|
||||||
v-model="val1"
|
v-model="val1"
|
||||||
@handleChange="handleChange1"
|
@handleChange="handleChange"
|
||||||
></search-box>
|
></search-box>
|
||||||
<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="val2" disabled>
|
<input type="text" class="filter-input filter-scan-input" v-model="val2" disabled>
|
||||||
</div>
|
</div>
|
||||||
<div class="mgl20">
|
|
||||||
<button class="btn" :disabled="disabled4" :class="{'btn-disabled': this.val1 !== ''}" @click="searchList">查询</button>
|
|
||||||
</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="val3">
|
<input type="text" class="filter-input filter-scan-input" v-model="val3" disabled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-filter-tip">
|
<div class="bottom-filter-tip">
|
||||||
@@ -30,11 +29,16 @@
|
|||||||
:option="option"
|
:option="option"
|
||||||
:active="active"
|
:active="active"
|
||||||
:open="open"
|
:open="open"
|
||||||
@toggleItem="toggleItem"
|
:disabled="true">
|
||||||
@dropdownMenu="dropdownMenu">
|
|
||||||
</dropdown-menu>
|
</dropdown-menu>
|
||||||
</div>
|
</div>
|
||||||
</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" disabled>
|
||||||
|
</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 visible" >
|
<div class="fxcol mgl20 visible" >
|
||||||
@@ -42,64 +46,24 @@
|
|||||||
:option="option1"
|
:option="option1"
|
||||||
:active="active1"
|
:active="active1"
|
||||||
:open="open1"
|
:open="open1"
|
||||||
@toggleItem="toggleItem1"
|
:disabled="true">
|
||||||
@dropdownMenu="dropdownMenu1">
|
|
||||||
</dropdown-menu>
|
</dropdown-menu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<search-box
|
|
||||||
label="袋码"
|
|
||||||
v-model="val4"
|
|
||||||
:focused='true'
|
|
||||||
@handleChange="handleChange4"
|
|
||||||
></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.bag_id" @click="toCheck(e)" :class="{'checked': e.bag_id === pkId}">
|
|
||||||
<td>{{e.bucketunique}}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="slide">
|
|
||||||
<table class="layout-t">
|
|
||||||
<tr>
|
|
||||||
<th>袋码</th>
|
|
||||||
<th>物料编码</th>
|
|
||||||
<th>批次</th>
|
|
||||||
<th>重量kg</th>
|
|
||||||
<th>是否新加</th>
|
|
||||||
</tr>
|
|
||||||
<tr v-for="e in dataList" :key="e.bag_id" @click="toCheck(e)" :class="{'checked': e.bag_id === pkId}">
|
|
||||||
<td>{{e.bag_id}}</td>
|
|
||||||
<td>{{e.material_code}}</td>
|
|
||||||
<td>{{e.pcsn}}</td>
|
|
||||||
<td>{{e.storage_qty | numeric(3)}}</td>
|
|
||||||
<td>{{e.is_new_name}}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="calc_value_wraper">
|
|
||||||
<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" disabled v-model="val5">
|
<input type="text" class="filter-input filter-scan-input" v-model="val4" disabled>
|
||||||
</div>
|
</div>
|
||||||
<div class="mgl20">KG</div>
|
<div class="mgl20">KG</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section ref="submit" class="submit-bar submit-bar1">
|
<section ref="submit" class="submit-bar submit-bar1">
|
||||||
<button class="btn submit-button" @click="cancle">清空</button>
|
<button class="btn submit-button" @click="cancle">清空</button>
|
||||||
<button class="btn submit-button" :disabled="disabled3" :class="{'btn-disabled': pkId === ''}" @click="deleteList">删除行</button>
|
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': val1 === ''}" @click="toSure">组桶</button>
|
||||||
<button class="btn submit-button" :disabled="disabled5" :class="{'btn-disabled': dataList.length === 0 || val2 === '' || val2 === undefined}" @click="toSure">组桶</button>
|
<button class="btn submit-button" :disabled="disabled2" :class="{'btn-disabled': val1 === ''}" @click="toSurePrint">组桶并打印</button>
|
||||||
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': dataList.length === 0 || val2 === '' || val2 === undefined}" @click="toSurePrint">组桶并打印</button>
|
<button class="btn submit-button" :disabled="disabled3" :class="{'btn-disabled': val1 === ''}" @click="toPrint">打印</button>
|
||||||
<button class="btn submit-button" :disabled="disabled2" :class="{'btn-disabled': val1 === ''}" @click="toPrint">打印</button>
|
|
||||||
<div class="fxrow bottom-filter-tip_1">
|
<div class="fxrow bottom-filter-tip_1">
|
||||||
<div class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': printWeight === true}" @click="toAdd"></div>
|
<div class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': printWeight === true}" @click="toAdd"></div>
|
||||||
<div class="check_icon_txt">是否打印重量</div>
|
<div class="check_icon_txt">是否打印重量</div>
|
||||||
@@ -111,10 +75,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NavBar from '@components/NavBar.vue'
|
import NavBar from '@components/NavBar.vue'
|
||||||
import SearchBox from '@components/SearchBox.vue'
|
import SearchBox from '@components/SearchBox3.vue'
|
||||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||||
import { queryInfoBybucket, queryInfoByBag, confirmGroupBucket, bucketPrint, bucketDelete, getpcsn, bucketGetLevel } from '@config/getData2.js'
|
import { bucketGetLevel, confirmGroupBucketNo, bucketPrintNo } from '@config/getData2.js'
|
||||||
import {accAdd, submitPackUp} from '@config/mUtils.js'
|
import {submitPackUp} from '@config/mUtils.js'
|
||||||
import {toPrint} from '@config/print.js'
|
import {toPrint} from '@config/print.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'SoftWasteBarrelPrint',
|
name: 'SoftWasteBarrelPrint',
|
||||||
@@ -129,6 +93,7 @@ export default {
|
|||||||
val2: '',
|
val2: '',
|
||||||
val3: '',
|
val3: '',
|
||||||
val4: '',
|
val4: '',
|
||||||
|
val5: '',
|
||||||
result: {},
|
result: {},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
dataList2: [],
|
dataList2: [],
|
||||||
@@ -137,276 +102,94 @@ export default {
|
|||||||
disabled1: false,
|
disabled1: false,
|
||||||
disabled2: false,
|
disabled2: false,
|
||||||
disabled3: false,
|
disabled3: false,
|
||||||
disabled4: false,
|
|
||||||
disabled5: false,
|
disabled5: false,
|
||||||
printWeight: true,
|
printWeight: true,
|
||||||
option: [{value: '0', label: '不可用'}, {value: '1', label: '可用'}],
|
option: [{value: '0', label: '不可用'}, {value: '1', label: '可用'}],
|
||||||
active: '1',
|
active: '',
|
||||||
open: false,
|
open: false,
|
||||||
option1: [],
|
option1: [],
|
||||||
active1: '',
|
active1: '',
|
||||||
open1: false
|
open1: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
val5 () {
|
|
||||||
let cur = '0.000'
|
|
||||||
if (this.dataList.length) {
|
|
||||||
this.dataList.map(el => {
|
|
||||||
cur = accAdd(cur, el.storage_qty)
|
|
||||||
})
|
|
||||||
cur = Number(cur).toFixed(3) + ''
|
|
||||||
}
|
|
||||||
return cur
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeRouteLeave (to, from, next) {
|
|
||||||
if (to.path === '/home' || to.path === '/login') {
|
|
||||||
this.$store.dispatch('setKeepAlive', [])
|
|
||||||
}
|
|
||||||
next()
|
|
||||||
},
|
|
||||||
activated () {
|
|
||||||
if (this.val2 !== '' && this.$store.getters.materObj !== '' && this.val2 !== this.$store.getters.materObj.material_code) {
|
|
||||||
this.dataList = []
|
|
||||||
this.val4 = ''
|
|
||||||
}
|
|
||||||
if (this.$store.getters.materObj !== '') {
|
|
||||||
this.val2 = this.$store.getters.materObj.material_code
|
|
||||||
this.val4 = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
created () {
|
||||||
this._getpcsn()
|
|
||||||
this._bucketGetLevel()
|
this._bucketGetLevel()
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scanChild.handleFocus()
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange1 (e, type) {
|
handleChange (e) {
|
||||||
if (type) {
|
let arr = e.split('##')
|
||||||
this._queryInfoBybucket(e)
|
this.val1 = arr[0]
|
||||||
|
this.val2 = arr[1]
|
||||||
|
this.val3 = arr[2]
|
||||||
|
this.val4 = arr[3]
|
||||||
|
this.val5 = arr[4]
|
||||||
|
this.active = arr[5] + ''
|
||||||
|
this.option1.map((el, i) => {
|
||||||
|
if (el.value === arr[5]) {
|
||||||
|
this.active1 = i + ''
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
handleChange4 (e, type) {
|
|
||||||
if (this.val2 === '') {
|
|
||||||
this.toast('物料编码不能为空')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (type) {
|
|
||||||
this._queryInfoByBag(e)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toCheck (e) {
|
|
||||||
this.pkId = this.pkId === e.bag_id ? '' : e.bag_id
|
|
||||||
this.pkObj = this.pkId === e.bag_id ? e : {}
|
|
||||||
},
|
},
|
||||||
toAdd () {
|
toAdd () {
|
||||||
this.printWeight = !this.printWeight
|
this.printWeight = !this.printWeight
|
||||||
},
|
},
|
||||||
/** 物料查询 */
|
|
||||||
async searchList () {
|
|
||||||
this.$router.push({
|
|
||||||
path: '/MaterInfoSearchRadio'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 批次查询 */
|
|
||||||
async _getpcsn () {
|
|
||||||
let res = await getpcsn()
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.val3 = res.result
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 等级 */
|
/** 等级 */
|
||||||
async _bucketGetLevel () {
|
async _bucketGetLevel () {
|
||||||
let res = await bucketGetLevel()
|
let res = await bucketGetLevel()
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.option1 = [...res.result]
|
this.option1 = [...res.result]
|
||||||
this.active1 = '0'
|
|
||||||
} else {
|
} else {
|
||||||
this.Dialog(res.desc)
|
this.Dialog(res.desc)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 桶码查询信息 */
|
|
||||||
async _queryInfoBybucket (e) {
|
|
||||||
let res = await queryInfoBybucket(e)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.$store.dispatch('materObj', '')
|
|
||||||
this.result = res.result.result
|
|
||||||
this.val1 = res.result.result.bucketunique
|
|
||||||
this.disabled4 = true
|
|
||||||
this.val2 = res.result.result.material_code
|
|
||||||
this.val3 = res.result.result.pcsn
|
|
||||||
this.dataList = []
|
|
||||||
this.val4 = ''
|
|
||||||
this.dataList = res.result.results
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 袋码查询信息 */
|
|
||||||
async _queryInfoByBag (e) {
|
|
||||||
let res = await queryInfoByBag(e)
|
|
||||||
if (res.code === '1') {
|
|
||||||
let pai = this.getPai(this.val2)
|
|
||||||
if (pai === res.result.material_code) {
|
|
||||||
if (this.dataList.length) {
|
|
||||||
let arr1 = this.dataList.filter(el => {
|
|
||||||
return el.bag_id === res.result.bag_id
|
|
||||||
})
|
|
||||||
if (arr1.length === 0) {
|
|
||||||
this.dataList.push(res.result)
|
|
||||||
} else {
|
|
||||||
this.toast('袋码已存在')
|
|
||||||
this.val4 = ''
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (JSON.stringify(res.result) !== '{}') {
|
|
||||||
this.dataList.push(res.result)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.toast('袋物料PG粉与所选软废PG粉物料不一致')
|
|
||||||
this.val4 = ''
|
|
||||||
}
|
|
||||||
// if (this.dataList.length) {
|
|
||||||
// let arr1 = this.dataList.filter(el => {
|
|
||||||
// return el.material_code.split('-')[0] === res.result.material_code.split('-')[0]
|
|
||||||
// })
|
|
||||||
// let arr2 = this.dataList.filter(el => {
|
|
||||||
// return el.bag_id === res.result.bag_id
|
|
||||||
// })
|
|
||||||
// if (arr1.length === this.dataList.length) {
|
|
||||||
// if (arr2.length === 0) {
|
|
||||||
// this.dataList.push(res.result)
|
|
||||||
// } else {
|
|
||||||
// this.toast('袋码已存在')
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// this.toast('返回信息牌号与列表中的所有牌号不一致')
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (JSON.stringify(res.result) !== '{}') {
|
|
||||||
// this.dataList.push(res.result)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 获取牌号 */
|
|
||||||
getPai (a) {
|
|
||||||
let arr1 = a.split('-')
|
|
||||||
arr1.pop()
|
|
||||||
let arr3 = arr1.join('-')
|
|
||||||
return arr3
|
|
||||||
},
|
|
||||||
/** 删除行 */
|
|
||||||
deleteList () {
|
|
||||||
this.disabled3 = true
|
|
||||||
if (this.pkId === '') {
|
|
||||||
this.toast('袋码不能为空')
|
|
||||||
this.disabled3 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.pkId !== '' && (this.pkObj.bucketunique !== this.result.bucketunique)) {
|
|
||||||
this.dataList.map((el, i) => {
|
|
||||||
if (el.bag_id === this.pkId) {
|
|
||||||
this.dataList.splice(i, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.disabled3 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this._bucketDelete()
|
|
||||||
},
|
|
||||||
async _bucketDelete () {
|
|
||||||
try {
|
|
||||||
let res = await bucketDelete(this.pkObj.bucketunique, this.pkId)
|
|
||||||
if (res.code === '1') {
|
|
||||||
this.toast(res.desc)
|
|
||||||
this.dataList.map((el, i) => {
|
|
||||||
if (el.bag_id === this.pkId) {
|
|
||||||
this.dataList.splice(i, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
} else {
|
|
||||||
this.Dialog(res.desc)
|
|
||||||
}
|
|
||||||
this.disabled3 = false
|
|
||||||
} catch (e) {
|
|
||||||
this.disabled3 = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 组桶 */
|
/** 组桶 */
|
||||||
toSure () {
|
toSure () {
|
||||||
this.disabled5 = true
|
this.disabled1 = true
|
||||||
if (this.dataList.length === 0) {
|
if (this.val1 === '') {
|
||||||
this.disabled5 = false
|
this.toast('桶码不能为空')
|
||||||
|
this.disabled1 = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.val2 === '' || this.val2 === undefined) {
|
this._confirmGroupBucketNo()
|
||||||
this.toast('物料编码不能为空')
|
|
||||||
this.disabled5 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this._confirmGroupBucket()
|
|
||||||
},
|
},
|
||||||
async _confirmGroupBucket () {
|
async _confirmGroupBucketNo () {
|
||||||
try {
|
try {
|
||||||
let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : ''
|
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 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.val5, accountId: accountId, user: user, is_active: this.option[this.active].value, ivt_level: this.option1[this.active1].value})
|
let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': this.option[this.active].value, 'ivt_level': this.option1[this.active1].value}
|
||||||
let res = await confirmGroupBucket(newObj, this.dataList)
|
let res = await confirmGroupBucketNo(newObj)
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.toast(res.desc)
|
this.toast(res.desc)
|
||||||
this.val1 = ''
|
this.cancle()
|
||||||
this.val4 = ''
|
|
||||||
this.result = {}
|
|
||||||
this.dataList = []
|
|
||||||
this.dataList2 = []
|
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.disabled5 = false
|
|
||||||
this.active = '1'
|
|
||||||
this.active1 = '0'
|
|
||||||
} else {
|
} else {
|
||||||
this.Dialog(res.desc)
|
this.Dialog(res.desc)
|
||||||
this.disabled5 = false
|
this.disabled1 = false
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled5 = false
|
this.disabled1 = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 组桶并打印 */
|
/** 组桶并打印 */
|
||||||
toSurePrint () {
|
toSurePrint () {
|
||||||
this.disabled1 = true
|
this.disabled2 = true
|
||||||
if (this.dataList.length === 0) {
|
if (this.val1 === '') {
|
||||||
this.disabled1 = false
|
this.toast('桶码不能为空')
|
||||||
|
this.disabled2 = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.val2 === '' || this.val2 === undefined) {
|
|
||||||
this.toast('物料编码不能为空')
|
|
||||||
this.disabled1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (this.$store.getters.materObj !== '' && Number(this.val5) > Number(this.$store.getters.materObj.standard_weight)) {
|
|
||||||
// this.toast('总重量不能超过该软废产品标准桶重量')
|
|
||||||
// this.disabled1 = false
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
this._confirmGroupBucketPrint()
|
this._confirmGroupBucketPrint()
|
||||||
},
|
},
|
||||||
async _confirmGroupBucketPrint () {
|
async _confirmGroupBucketPrint () {
|
||||||
try {
|
try {
|
||||||
let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : ''
|
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 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.val5, accountId: accountId, user: user, is_active: this.option[this.active].value, ivt_level: this.option1[this.active1].value})
|
let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': this.option[this.active].value, 'ivt_level': this.option1[this.active1].value}
|
||||||
let res = await confirmGroupBucket(newObj, this.dataList)
|
let res = await confirmGroupBucketNo(newObj)
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.toast(res.desc)
|
this.toast(res.desc)
|
||||||
if (JSON.stringify(res.result) !== '{}') {
|
if (JSON.stringify(res.result) !== '{}') {
|
||||||
@@ -417,32 +200,23 @@ export default {
|
|||||||
let data = Object.assign({}, res.result, {printWeight: this.printWeight})
|
let data = Object.assign({}, res.result, {printWeight: this.printWeight})
|
||||||
setTimeout(toPrint(data), 800)
|
setTimeout(toPrint(data), 800)
|
||||||
}
|
}
|
||||||
this.val1 = ''
|
this.cancle()
|
||||||
this.val4 = ''
|
|
||||||
this.result = {}
|
|
||||||
this.dataList = []
|
|
||||||
this.dataList2 = []
|
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.disabled1 = false
|
|
||||||
this.active = '1'
|
|
||||||
this.active1 = '0'
|
|
||||||
} else {
|
} else {
|
||||||
this.Dialog(res.desc)
|
this.Dialog(res.desc)
|
||||||
this.disabled1 = false
|
this.disabled2 = false
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled1 = false
|
this.disabled2 = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async toPrint () {
|
async toPrint () {
|
||||||
this.disabled2 = true
|
this.disabled3 = true
|
||||||
if (this.val1 === '') {
|
if (this.val1 === '') {
|
||||||
this.disabled2 = false
|
this.disabled3 = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await bucketPrint(this.val1)
|
let res = await bucketPrintNo(this.val1)
|
||||||
if (res.code === '1') {
|
if (res.code === '1') {
|
||||||
this.toast(res.desc)
|
this.toast(res.desc)
|
||||||
if (JSON.stringify(res.result) !== '{}') {
|
if (JSON.stringify(res.result) !== '{}') {
|
||||||
@@ -453,56 +227,28 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.Dialog(res.desc)
|
this.Dialog(res.desc)
|
||||||
}
|
}
|
||||||
this.disabled2 = false
|
this.disabled3 = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled2 = false
|
this.disabled3 = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 清空 */
|
/** 清空 */
|
||||||
cancle () {
|
cancle () {
|
||||||
// Object.assign(this.$data, this.$options.data())
|
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
this.val2 = ''
|
this.val2 = ''
|
||||||
|
this.val3 = ''
|
||||||
this.val4 = ''
|
this.val4 = ''
|
||||||
|
this.val5 = ''
|
||||||
this.result = {}
|
this.result = {}
|
||||||
this.dataList = []
|
this.active = ''
|
||||||
this.dataList2 = []
|
this.active1 = ''
|
||||||
this.pkId = ''
|
|
||||||
this.pkObj = {}
|
|
||||||
this.disabled1 = false
|
this.disabled1 = false
|
||||||
this.disabled2 = false
|
this.disabled2 = false
|
||||||
this.disabled3 = false
|
this.disabled3 = false
|
||||||
this.disabled4 = false
|
this.$refs.scanChild.handleFocus()
|
||||||
this.disabled5 = false
|
|
||||||
this.active = '1'
|
|
||||||
this.active1 = '0'
|
|
||||||
this.$store.dispatch('materObj', '')
|
|
||||||
this._getpcsn()
|
|
||||||
},
|
},
|
||||||
packUp () {
|
packUp () {
|
||||||
this.up = submitPackUp(this.$refs.submit, this.$refs.arrow, this.$refs.content, 2, this.up)
|
this.up = submitPackUp(this.$refs.submit, this.$refs.arrow, this.$refs.content, 2, this.up)
|
||||||
},
|
|
||||||
toggleItem () {
|
|
||||||
if (!this.open) {
|
|
||||||
this.open = true
|
|
||||||
} else {
|
|
||||||
this.open = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dropdownMenu (i) {
|
|
||||||
this.active = i + ''
|
|
||||||
this.open = false
|
|
||||||
},
|
|
||||||
toggleItem1 () {
|
|
||||||
if (!this.open1) {
|
|
||||||
this.open1 = true
|
|
||||||
} else {
|
|
||||||
this.open1 = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dropdownMenu1 (i) {
|
|
||||||
this.active1 = i + ''
|
|
||||||
this.open1 = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -512,7 +258,7 @@ export default {
|
|||||||
@import '~@style/mixin'
|
@import '~@style/mixin'
|
||||||
.bottom-filter-tip_1
|
.bottom-filter-tip_1
|
||||||
width 35%
|
width 35%
|
||||||
margin-right 5%
|
margin .2rem 5% .2rem 0
|
||||||
.bottom-filter-tip_2
|
.bottom-filter-tip_2
|
||||||
width 65%
|
width 65%
|
||||||
.width1
|
.width1
|
||||||
|
|||||||
Reference in New Issue
Block a user