init
This commit is contained in:
158
pages/entry/group-to-store.vue
Normal file
158
pages/entry/group-to-store.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 单据入库 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">合格证编码</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">订单号</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.MONumber}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">组织</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.StockOrgId}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">货主</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.OwnerId_Id}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">物料编码</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.material_code}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">物料名称</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.material_name}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">物料规格</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.material_spec}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom filter_input_disabled">
|
||||
<view class="zd-col-8"><span class="filter_label">单位</span></view>
|
||||
<view class="zd-col-16"><span class="filter_input">{{currentData.unit_name}}</span></view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8"><span class="filter_label">物料数量</span></view>
|
||||
<view class="zd-col-16">
|
||||
<input type="number" class="filter_input" v-model="val3">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-8"><span class="filter_label">仓库编码</span></view>
|
||||
<view class="zd-col-16 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options"></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': !val2 || !val3 || !index}" :disabled="disabled" @tap="_inStorageConfirm">组盘确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {storList, getCertificateInfo, inStorageConfirm} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
currentData: {},
|
||||
options: [],
|
||||
index: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._storList()
|
||||
},
|
||||
methods: {
|
||||
async _storList () {
|
||||
let res = await storList()
|
||||
if (res.code === '200') {
|
||||
this.options = [...res.content]
|
||||
this.options.map(el => {
|
||||
this.$set(el, 'text', el.label)
|
||||
})
|
||||
}
|
||||
},
|
||||
handleChange1 (e) {
|
||||
this._getCertificateInfo(e)
|
||||
},
|
||||
async _getCertificateInfo (e) {
|
||||
let res = await getCertificateInfo(e)
|
||||
this.currentData = res
|
||||
if (JSON.stringify(this.currentData) !== '{}') {
|
||||
this.val3 = this.currentData.qty
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.currentData = {}
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _inStorageConfirm () {
|
||||
this.disabled = true
|
||||
if (!this.val2 || !this.val3 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let obj = Object.assign(this.currentData, {vehicle_code: this.val2, stor_code: this.index, qty: this.val3})
|
||||
let res = await inStorageConfirm(obj)
|
||||
if (res.code === '200') {
|
||||
this.toEmpty()
|
||||
}
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
</style>
|
||||
Reference in New Issue
Block a user