接口
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</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-24">
|
||||
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
|
||||
@@ -28,7 +28,7 @@
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -84,7 +84,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': !val1 || !val2 || !index}" :disabled="disabled" @tap="_preProcessingDown">出料</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -92,7 +92,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPointInDownload, queryPointInDtl, packInConfirm} from '@/utils/getData3.js'
|
||||
import {queryPointInDownload, getGroupInfo, preProcessingDown} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -105,19 +105,22 @@
|
||||
options: [{text:'原粉区', value: '1'}, {text:'批料室', value: '1'}, {text:'粉碎室1', value: 'f1'}, {text:'粉碎室2', value: 'f2'}],
|
||||
index: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryPointInDownload()
|
||||
// this._queryPointInDownload()
|
||||
},
|
||||
methods: {
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index = ''
|
||||
this.num = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
@@ -136,11 +139,12 @@
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _queryPointInDtl () {
|
||||
async _getGroupInfo () {
|
||||
try {
|
||||
let res = await queryPointInDtl(this.val1)
|
||||
let res = await getGroupInfo(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 = []
|
||||
}
|
||||
@@ -148,14 +152,14 @@
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _packInConfirm () {
|
||||
async _preProcessingDown () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index || !this.dataList.length) {
|
||||
if (!this.val1 || !this.val2 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await packInConfirm(this.val1, this.index, this.dataList)
|
||||
let res = await preProcessingDown(this.val1, this.val2, this.index)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user