组盘新
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料</span>
|
||||
<span class="filter_label">物料信息</span>
|
||||
</view>
|
||||
<view class="zd-col-24">
|
||||
<input type="text" class="filter_input" v-model="val1">
|
||||
@@ -18,16 +18,22 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
|
||||
<th>物料名称</th>
|
||||
<th>物料规格</th>
|
||||
<th>物料编码</th>
|
||||
<th>数量</th>
|
||||
<th>批次号</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<!-- <td>{{e.qty}}</td>
|
||||
<td>{{e.pcsn}}</td> -->
|
||||
<td><input type="number" class="sin_input" v-model="e.qty"></td>
|
||||
<td><input type="text" class="sin_input" v-model="e.pcsn"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -57,8 +63,10 @@
|
||||
title: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
// dataList: [{material_name: 'name1', checked: false, qty:'100', pcsn:'p001'},{material_name: 'name2', checked: false},{material_name: 'name3', checked: false}],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
allCheck: false,
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
@@ -73,7 +81,7 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this.searchList()
|
||||
// this.searchList()
|
||||
},
|
||||
methods: {
|
||||
searchList () {
|
||||
@@ -88,6 +96,9 @@
|
||||
if (res.totalElements > 0) {
|
||||
const dataMap = res.data
|
||||
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
this.reload = false
|
||||
} else {
|
||||
this.dataList = []
|
||||
@@ -108,9 +119,16 @@
|
||||
this.status = 'noMore'
|
||||
}
|
||||
},
|
||||
toAllCheck () {
|
||||
this.allCheck = !this.allCheck
|
||||
this.dataList.map(el => {
|
||||
el.checked = this.allCheck
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_id ? '' : e.material_id
|
||||
this.pkObj = this.pkId === e.material_id ? e : {}
|
||||
e.checked = !e.checked
|
||||
let arr = this.dataList.filter(el => el.checked === true)
|
||||
this.allCheck = arr.length === this.dataList.length
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
@@ -119,8 +137,9 @@
|
||||
this.pkId = ''
|
||||
},
|
||||
toSure () {
|
||||
if (this.pkId) {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
let arr = this.dataList.filter(el => el.checked === true)
|
||||
if (arr.length) {
|
||||
this.$store.dispatch('setPublicArr', arr)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">源单编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box v-model="val1"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">载具编码</span>
|
||||
@@ -17,62 +25,36 @@
|
||||
<span class="filter_label">物料信息</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
|
||||
<input type="text" class="filter_input" v-model="wlxxtext" @tap="toJump">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">物料名称</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_name" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">物料规格</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料数量</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<NumberInput v-model="currentData.qty" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料批次</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="val3">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">源单编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<search-box v-model="val1"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<th>物料编码</th>
|
||||
<th>数量</th>
|
||||
<th>批次号</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="_groupPlate">组盘确认</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !this.val2 || !this.dataList.length}" :disabled="disabled" @tap="_groupPlate">组盘确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -94,7 +76,8 @@
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
currentData: {},
|
||||
wlxxtext: '',
|
||||
dataList: [],
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false
|
||||
@@ -104,8 +87,8 @@
|
||||
this.title = options.title
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.currentData = this.$store.getters.publicObj
|
||||
if (this.$store.getters.publicArr.length) {
|
||||
this.dataList = this.$store.getters.publicArr
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -115,19 +98,18 @@
|
||||
})
|
||||
},
|
||||
toEmpty () {
|
||||
this.currentData = {}
|
||||
this.dataList = []
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _groupPlate () {
|
||||
this.disabled = true
|
||||
if (JSON.stringify(this.currentData) === '{}') {
|
||||
if (!this.val2 || !this.dataList.length) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
this.currentData.stor_code = this.index
|
||||
let res = await groupPlate(this.currentData.material_id, this.val3, this.currentData.qty, this.val2, this.val1)
|
||||
let res = await groupPlate(this.dataList, this.val2, this.val1)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
|
||||
Reference in New Issue
Block a user