接口
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" @tap="_queryPointInDtl">查询</button>
|
||||
<button class="mini-btn" type="primary" @tap="_getStockGroupInfo">查询</button>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -76,7 +76,7 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !index || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">确认叫料</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val2 || !dataList.length}" :disabled="disabled" @tap="_confirmCallMaterial">确认叫料</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -84,7 +84,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPointInDownload, queryPointInDtl, packInConfirm} from '@/utils/getData3.js'
|
||||
import {queryPointInDownload, getStockGroupInfo, confirmCallMaterial} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -97,6 +97,7 @@
|
||||
num: null,
|
||||
index: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
materialData: {},
|
||||
dataList: [],
|
||||
dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
@@ -105,7 +106,13 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryPointInDownload()
|
||||
// this._queryPointInDownload()
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.materialData = this.$store.getters.publicObj
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toJump (name) {
|
||||
@@ -136,9 +143,9 @@
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _queryPointInDtl () {
|
||||
async _getStockGroupInfo () {
|
||||
try {
|
||||
let res = await queryPointInDtl(this.val1)
|
||||
let res = await getStockGroupInfo('', this.materialData.material_code, this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
@@ -148,15 +155,14 @@
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _packInConfirm () {
|
||||
async _confirmCallMaterial () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index || !this.dataList.length) {
|
||||
if (!this.val2 || !this.dataList.length) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
try {
|
||||
let res = await packInConfirm(this.val1, this.index, this.num, this.dataList)
|
||||
let res = await confirmCallMaterial(this.val2, '', this.dataList)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user