优化
This commit is contained in:
@@ -25,15 +25,15 @@
|
||||
<span class="filter_label">料桶号</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.storagevehicle_code" @tap="toJump">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料信息</span>
|
||||
<span class="filter_label filter_input_disabled">物料编码</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input" v-model="currentData.material_name">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -46,20 +46,31 @@
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">物料规格</span>
|
||||
<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>
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.struct_code" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">物料编码</span>
|
||||
<span class="filter_label filter_input_disabled">数量(kg)</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
|
||||
<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">数量(kg)</span>
|
||||
</view>
|
||||
<view class="zd-col-17">
|
||||
<NumberInput
|
||||
v-model="val3"
|
||||
mode="integer"
|
||||
/>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label filter_input_disabled">供应商编码</span>
|
||||
@@ -88,7 +99,7 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !this.index || !this.index2 || !this.val1 || !this.currentData.material_code || !this.index4}" :disabled="disabled" @tap="_checkoutbillcallMaterial">确认</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !this.index || !this.val1 || !this.currentData.material_code || !this.index4}" :disabled="disabled" @tap="_checkoutbillcallMaterial">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -96,7 +107,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getPdaSect, getPdaVehicleCodeBySectCode, getMaterialSuppByVehicleCode, checkoutbillcallMaterial} from '@/utils/getData4.js'
|
||||
import {getPdaCallMaterialSect, checkoutbillcallMaterial} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -108,8 +119,6 @@
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
options4: [{text:'单独上料', value:'1'}, {text:'下空桶上满料', value: '2'}],
|
||||
index4: '',
|
||||
currentData: {},
|
||||
@@ -120,14 +129,22 @@
|
||||
this.title = options.title
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.currentData = this.$store.getters.publicObj
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._getPdaSect()
|
||||
this._getPdaCallMaterialSect()
|
||||
},
|
||||
methods: {
|
||||
async _getPdaSect () {
|
||||
toJump () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/ftdl/wl-list?title=查询物料§code=' + this.index
|
||||
})
|
||||
},
|
||||
async _getPdaCallMaterialSect () {
|
||||
try {
|
||||
let res = await getPdaSect()
|
||||
let res = await getPdaCallMaterialSect(this.val1)
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
@@ -137,43 +154,9 @@
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
async _getPdaVehicleCodeBySectCode () {
|
||||
try {
|
||||
let res = await getPdaVehicleCodeBySectCode(this.index)
|
||||
if (res) {
|
||||
this.options2 = res.data
|
||||
} else {
|
||||
this.options2 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
async _getMaterialSuppByVehicleCode () {
|
||||
try {
|
||||
let res = await getMaterialSuppByVehicleCode(this.index2)
|
||||
if (res.code === '200') {
|
||||
this.currentData = res.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
if (e) {
|
||||
this.index = e
|
||||
this.index2 = ''
|
||||
this._getPdaVehicleCodeBySectCode(e)
|
||||
}
|
||||
},
|
||||
selectChange2 (e) {
|
||||
this.index2 = e
|
||||
if (this.index && this.index2) {
|
||||
this._getMaterialSuppByVehicleCode()
|
||||
}
|
||||
},
|
||||
selectChange4 (e) {
|
||||
@@ -181,19 +164,18 @@
|
||||
},
|
||||
clearUp () {
|
||||
this.index = ''
|
||||
this.index2 = ''
|
||||
this.val1 = ''
|
||||
this.currentData = {}
|
||||
this.disabled = false
|
||||
},
|
||||
async _checkoutbillcallMaterial () {
|
||||
this.disabled = true
|
||||
if (!this.index || !this.index2 || !this.val1 || !this.currentData.material_code || !this.index4) {
|
||||
if (!this.index || !this.val1 || !this.currentData.material_code || !this.index4) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await checkoutbillcallMaterial(this.val1, this.index2, this.currentData.material_code, this.index4, this.currentData.supp_code, this.currentData.supp_name)
|
||||
let res = await checkoutbillcallMaterial(this.val1, this.index, this.currentData.material_code, this.index4, this.currentData.supp_code, this.currentData.supp_name)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user