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