修改
This commit is contained in:
@@ -67,7 +67,6 @@
|
||||
</view>
|
||||
<view class="zd-col-17 filter_select">
|
||||
<!-- <zxz-uni-data-select v-model="index1" filterable :localdata="options1"></zxz-uni-data-select> -->
|
||||
<!-- <uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select> -->
|
||||
<view class="input-wrapper">
|
||||
<input
|
||||
class="input-field"
|
||||
@@ -91,11 +90,20 @@
|
||||
</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 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</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="toSure">组盘确认</button>
|
||||
<button class="zd-col-7 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="toSure">组盘确认</button>
|
||||
<button class="zd-col-8 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="toSure2">组盘并绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -104,7 +112,7 @@
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import NumberInput from '@/components/NumberInput.vue'
|
||||
import {vehiclelist, suppList, combination} from '@/utils/getData4.js'
|
||||
import {vehiclelist, suppList, structList, combination, groupAndBind} from '@/utils/getData4.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -118,6 +126,8 @@
|
||||
currentData: {},
|
||||
options: [],
|
||||
index: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
// options1: [{text:'t1', value: 't1'}, {text:'t2', value: 't2'}],
|
||||
// index1: '',
|
||||
vehicleCode: '',
|
||||
@@ -140,6 +150,7 @@
|
||||
this.title = options.title
|
||||
this._suppList()
|
||||
this._vehiclelist()
|
||||
this._structList()
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
@@ -148,6 +159,21 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async _structList () {
|
||||
try {
|
||||
let res = await structList()
|
||||
if (res) {
|
||||
this.options2 = res.data
|
||||
} else {
|
||||
this.options2 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
selectChange2 (e) {
|
||||
this.index2 = e
|
||||
},
|
||||
onInput(e) {
|
||||
// console.log('输入内容:', e.detail.value)
|
||||
},
|
||||
@@ -207,7 +233,11 @@
|
||||
toEmpty () {
|
||||
this.currentData = {}
|
||||
this.index = ''
|
||||
this.vehicleCode = ''
|
||||
this.index2 = ''
|
||||
this.disabled = false
|
||||
this._vehiclelist()
|
||||
this._structList()
|
||||
},
|
||||
toSure () {
|
||||
this.disabled = true
|
||||
@@ -240,6 +270,44 @@
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toSure2 () {
|
||||
this.disabled = true
|
||||
if (JSON.stringify(this.currentData) === '{}') {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
if (Number(this.currentData.single_weight) > 2000) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '输入的重量'+ Number(this.currentData.single_weight) +'过大,是否继续?',
|
||||
confirmColor: '#ff6a00',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this._groupAndBind()
|
||||
} else if (res.cancel) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this._groupAndBind()
|
||||
}
|
||||
},
|
||||
async _groupAndBind () {
|
||||
try {
|
||||
let selobj = this.options.find(item => item.value === this.index)
|
||||
let res = await groupAndBind(this.vehicleCode, this.currentData.pcsn, this.currentData.material_id, selobj.value, selobj.text, this.currentData.single_weight, this.index2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
|
||||
@@ -344,6 +344,12 @@ export const combination = (vcode, pcsn, mid, spcode, spname, sweight) => reques
|
||||
data: {vehicle_code: vcode, pcsn: pcsn, material_id: mid, supp_code: spcode, supp_name: spname, single_weight: sweight}
|
||||
})
|
||||
|
||||
// 组盘并绑定
|
||||
export const groupAndBind = (vcode, pcsn, mid, spcode, spname, sweight, pcode) => request({
|
||||
url:'api/pda/jb/groupAndBind',
|
||||
data: {vehicle_code: vcode, pcsn: pcsn, material_id: mid, supp_code: spcode, supp_name: spname, single_weight: sweight, point_code: pcode}
|
||||
})
|
||||
|
||||
// 料桶组盘-可用载具数组
|
||||
export const vehiclelist = () => request({
|
||||
url:'api/pda/jb/vehiclelist',
|
||||
|
||||
Reference in New Issue
Block a user