叫料
This commit is contained in:
@@ -19,8 +19,16 @@
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</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="currentData.material_name" @tap="toJump">
|
||||
<input type="number" class="filter_input" v-model="val3" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
@@ -35,7 +43,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': !val1 || !val2}" :disabled="disabled" @tap="_loading">确认</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_loading">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -43,7 +51,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getRegionByPoint, loading} from '@/utils/getData4.js'
|
||||
import {getRegionByPoint, selectMaterialByRegion, loading} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -54,8 +62,10 @@
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '1',
|
||||
val3: '',
|
||||
options: [],
|
||||
index: '',
|
||||
pointCode: '',
|
||||
currentData: {},
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -65,13 +75,30 @@
|
||||
created () {
|
||||
},
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.currentData = this.$store.getters.publicObj
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async _selectMaterialByRegion () {
|
||||
try {
|
||||
let res = await selectMaterialByRegion(this.val1)
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
let selobj = this.options.find(item => item.value === this.index)
|
||||
this.val3 = selobj.qty
|
||||
},
|
||||
handleChange1 (e) {
|
||||
this._getRegionByPoint(e)
|
||||
if (e) {
|
||||
this._getRegionByPoint(e)
|
||||
this._selectMaterialByRegion()
|
||||
}
|
||||
},
|
||||
async _getRegionByPoint (e) {
|
||||
try {
|
||||
@@ -84,25 +111,21 @@
|
||||
this.val1 = ''
|
||||
}
|
||||
},
|
||||
toJump () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/ftdl/mater-list0?title=查询物料'
|
||||
})
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.pointCode = ''
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _loading () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
if (!this.val1 || !this.val2 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await loading(this.pointCode, this.val1, this.currentData.material_code, this.val2)
|
||||
let res = await loading(this.pointCode, this.val1, this.index, this.val2)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user