接口
This commit is contained in:
@@ -6,26 +6,27 @@
|
||||
<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 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">总数量</span>
|
||||
</view>
|
||||
<view class="zd-col-24">
|
||||
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<button class="zd-col-11 button-primary ftsize1" @tap="toScanAdd">扫码插入</button>
|
||||
<button class="zd-col-11 button-primary ftsize1" @tap="toDel">删除行</button>
|
||||
</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-24">
|
||||
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
@@ -54,7 +55,7 @@
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.qty}}</td>
|
||||
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
|
||||
<td>{{e.qty_unit_name}}</td>
|
||||
<td>{{e.supp_name}}</td>
|
||||
<td>{{e.material_type_id}}</td>
|
||||
@@ -70,9 +71,9 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button> -->
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !val1 || !index || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">取物料</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !val1 || !index || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">取载具</button>
|
||||
<button class="zd-col-6 button-primary" :class="{'button-info': !val1 || !index || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">取货完成</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_takePalletMaterial">取物料</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_takeTheVehicle">取载具</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_takeFinish">取货完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -80,7 +81,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPointInDownload, queryPointInDtl, packInConfirm} from '@/utils/getData3.js'
|
||||
import {getPalletAssemblyOK, takePalletMaterial, takeTheVehicle, takeFinish} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -89,8 +90,6 @@
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
val1: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
@@ -100,7 +99,6 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryPointInDownload()
|
||||
},
|
||||
methods: {
|
||||
toScanAdd () {
|
||||
@@ -175,26 +173,36 @@
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
async _queryPointInDownload () {
|
||||
try {
|
||||
let res = await queryPointInDownload()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
handleBlur (e) {
|
||||
if (e.qty) {
|
||||
if (e.qty < 0) {
|
||||
e.qty = 0
|
||||
} else {
|
||||
this.options = []
|
||||
e.qty = e.qty.replace(/[^0-9]/g, '')
|
||||
e.qty = e.qty.replace(/^0+/, '') || '0'
|
||||
if (e.qty > e.initialQty) {
|
||||
e.qty = e.initialQty
|
||||
}
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
} else {
|
||||
// uni.showToast({
|
||||
// title: '数量必填',
|
||||
// icon: 'none'
|
||||
// })
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getPalletAssemblyOK()
|
||||
}
|
||||
},
|
||||
async _queryPointInDtl () {
|
||||
async _getPalletAssemblyOK () {
|
||||
try {
|
||||
let res = await queryPointInDtl(this.val1)
|
||||
let res = await getPalletAssemblyOK(this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
@@ -202,14 +210,54 @@
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _packInConfirm () {
|
||||
async _takePalletMaterial () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index || !this.dataList.length) {
|
||||
if (!this.val1 || !this.dataList.length) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await packInConfirm(this.val1, this.index, this.dataList)
|
||||
let res = await takePalletMaterial(this.val1, this.dataList)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _takeTheVehicle () {
|
||||
this.disabled = true
|
||||
if (!this.val1) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await takeTheVehicle(this.val1)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _takeFinish () {
|
||||
this.disabled = true
|
||||
if (!this.val1) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await takeFinish()
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user