This commit is contained in:
2025-08-06 18:19:22 +08:00
parent 1e06bc56b7
commit 5a8f25b428
4 changed files with 88 additions and 90 deletions

View File

@@ -30,9 +30,7 @@
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td> <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_code}}</td> <td>{{e.material_code}}</td>
<!-- <td>{{e.qty}}</td> <td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></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> <td><input type="text" class="sin_input" v-model="e.pcsn"></td>
</tr> </tr>
</tbody> </tbody>
@@ -44,7 +42,7 @@
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button> <button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" @tap="searchList">查询</button> <button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button> <button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" @tap="toSure">确认</button>
</view> </view>
</view> </view>
</template> </template>
@@ -63,10 +61,11 @@
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}], // dataList: [{material_name: 'name1', checked: false, qty:1, pcsn:'p001'},{material_name: 'name2', checked: false},{material_name: 'name3', checked: false}],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
allCheck: false, allCheck: false,
checkedArr: [],
reload: false, reload: false,
status: 'more', status: 'more',
contentText: { contentText: {
@@ -84,6 +83,21 @@
// this.searchList() // this.searchList()
}, },
methods: { methods: {
handleBlur (e) {
if (e.qty) {
if (e.qty < 0) {
e.qty = 0
} else {
e.qty = e.qty.replace(/[^0-9]/g, '')
e.qty = e.qty.replace(/^0+/, '') || '0'
}
} else {
uni.showToast({
title: '数量必填',
icon: 'none'
})
}
},
searchList () { searchList () {
this.dataList = [] this.dataList = []
this.pageNum = 1 this.pageNum = 1
@@ -127,8 +141,8 @@
}, },
toCheck (e) { toCheck (e) {
e.checked = !e.checked e.checked = !e.checked
let arr = this.dataList.filter(el => el.checked === true) this.checkedArr = this.dataList.filter(el => el.checked === true)
this.allCheck = arr.length === this.dataList.length this.allCheck = this.checkedArr.length === this.dataList.length
}, },
toEmpty () { toEmpty () {
this.val1 = '' this.val1 = ''
@@ -137,10 +151,18 @@
this.pkId = '' this.pkId = ''
}, },
toSure () { toSure () {
let arr = this.dataList.filter(el => el.checked === true) if (!this.checkedArr.length) {
if (arr.length) { return
this.$store.dispatch('setPublicArr', arr) }
const allValid = this.checkedArr.every(item => item.qty !== '');
if (allValid) {
this.$store.dispatch('setPublicArr', this.checkedArr)
uni.navigateBack() uni.navigateBack()
} else {
uni.showToast({
title: '数量必填',
icon: 'none'
})
} }
} }
} }

View File

@@ -4,17 +4,6 @@
<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="val2"
@handleChange="handleChange"
/>
</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>
@@ -34,51 +23,33 @@
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select> <uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</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 filter_input_disabled">物料数量</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.qty" 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.pcsn" disabled>
</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="clearUp">清空</button> <button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_confirmIn">确认</button> <button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_confirmIn">确认</button>
</view> </view>
</view> </view>
</template> </template>
@@ -96,12 +67,11 @@
return { return {
title: '', title: '',
val1: '', val1: '',
val2: '',
// options: [{text:'堆叠托盘', value:'11111111'},{text:'料箱',value: '22222222'},{text:'白色EPH',value: '33333333'}], // options: [{text:'堆叠托盘', value:'11111111'},{text:'料箱',value: '22222222'},{text:'白色EPH',value: '33333333'}],
options: [], options: [],
index: '', index: '',
disabled: false, disabled: false,
currentData: {} dataList: []
}; };
}, },
onLoad (options) { onLoad (options) {
@@ -135,29 +105,28 @@
try { try {
let res = await getVehicleMaterial(this.val1, this.val2, this.index) let res = await getVehicleMaterial(this.val1, this.val2, this.index)
if (res) { if (res) {
this.currentData = res this.dataList = res.data
} else { } else {
this.currentData = {} this.dataList = []
} }
} catch (e) { } catch (e) {
this.currentData = {} this.dataList = []
} }
}, },
clearUp () { clearUp () {
this.val1 = '' this.val1 = ''
this.val2 = ''
this.index = '' this.index = ''
this.disabled = false this.disabled = false
this.currentData = {} this.dataList = []
}, },
async _confirmIn () { async _confirmIn () {
this.disabled = true this.disabled = true
if (!this.val1 || !this.val2 || !this.index) { if (!this.val1 || !this.index) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await confirmIn(this.val1, this.val2, this.index) let res = await confirmIn(this.val1, this.index)
if (res.code === '200') { if (res.code === '200') {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@@ -4,14 +4,6 @@
<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>
@@ -28,6 +20,14 @@
<input type="text" class="filter_input" v-model="wlxxtext" @tap="toJump"> <input type="text" class="filter_input" v-model="wlxxtext" @tap="toJump">
</view> </view>
</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 class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
<view class="slide_new"> <view class="slide_new">
@@ -53,7 +53,7 @@
</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="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !this.val2 || !this.dataList.length}" :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>
@@ -78,8 +78,6 @@
val3: '', val3: '',
wlxxtext: '', wlxxtext: '',
dataList: [], dataList: [],
options: [],
index: '',
disabled: false disabled: false
}; };
}, },
@@ -97,9 +95,10 @@
url: '/pages/common/mater-list?title=查询物料' url: '/pages/common/mater-list?title=查询物料'
}) })
}, },
toEmpty () { clearUp () {
this.dataList = [] this.dataList = []
this.index = '' this.val1 = ''
this.val2 = ''
this.disabled = false this.disabled = false
}, },
async _groupPlate () { async _groupPlate () {
@@ -110,11 +109,19 @@
} }
try { try {
let res = await groupPlate(this.dataList, this.val2, this.val1) let res = await groupPlate(this.dataList, this.val2, this.val1)
uni.showToast({ if (res.code === '200') {
title: res.message, uni.showToast({
icon: 'none' title: res.message,
}) icon: 'none'
this.disabled = false })
this.clearUp()
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
}
} catch (e) { } catch (e) {
this.disabled = false this.disabled = false
} }

View File

@@ -79,7 +79,7 @@
</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="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}' || !val3}" :disabled="disabled" @tap="_groupPlate">组盘确认</button> <button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}' || !val3}" :disabled="disabled" @tap="_groupPlate">组盘确认</button>
</view> </view>
</view> </view>
@@ -122,7 +122,7 @@
url: '/pages/common/mater-list2?title=查询物料' url: '/pages/common/mater-list2?title=查询物料'
}) })
}, },
toEmpty () { clearUp () {
this.currentData = {} this.currentData = {}
this.index = '' this.index = ''
this.disabled = false this.disabled = false