Files
hht-hengsen-uni/pages/entry/group-to-store.vue

159 lines
4.9 KiB
Vue
Raw Normal View History

2024-07-22 17:32:37 +08:00
<template>
<view class="zd_container">
2024-11-13 18:04:22 +08:00
<!-- 单据入库 -->
2024-07-22 17:32:37 +08:00
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
2024-11-26 17:21:05 +08:00
<view class="zd-col-8">
<span class="filter_label">合格证编码</span>
2024-07-22 17:32:37 +08:00
</view>
2024-11-26 17:21:05 +08:00
<view class="zd-col-16">
2024-07-22 17:32:37 +08:00
<search-box
v-model="val1"
2024-11-26 17:21:05 +08:00
@handleChange="handleChange1"
2024-07-22 17:32:37 +08:00
/>
</view>
</view>
2024-11-26 17:21:05 +08:00
<view class="zd-row">
<view class="zd-col-8">
<span class="filter_label">载具编码</span>
2024-07-22 17:32:37 +08:00
</view>
2024-11-26 17:21:05 +08:00
<view class="zd-col-16">
<search-box
v-model="val2"
/>
2024-07-22 17:32:37 +08:00
</view>
</view>
</view>
2024-11-26 17:21:05 +08:00
<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>
2024-11-27 13:27:59 +08:00
<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>
2024-11-26 17:21:05 +08:00
<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">
2024-11-27 13:27:59 +08:00
<input type="number" class="filter_input" v-model="val3">
2024-11-26 17:21:05 +08:00
</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>
2024-07-22 17:32:37 +08:00
</view>
</view>
</view>
<view class="zd-row submit-bar">
2024-11-15 17:42:20 +08:00
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
2024-11-27 13:27:59 +08:00
<button class="zd-col-16 button-primary" :class="{'button-info': !val2 || !val3 || !index}" :disabled="disabled" @tap="_inStorageConfirm">组盘确认</button>
2024-07-22 17:32:37 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2024-11-26 17:21:05 +08:00
import {storList, getCertificateInfo, inStorageConfirm} from '@/utils/getData2.js'
2024-07-22 17:32:37 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
2024-11-27 13:27:59 +08:00
val3: '',
2024-11-26 17:21:05 +08:00
currentData: {},
options: [],
index: '',
2024-07-22 17:32:37 +08:00
disabled: false
};
},
onLoad (options) {
this.title = options.title
2024-11-26 17:21:05 +08:00
this._storList()
2024-08-02 17:26:50 +08:00
},
2024-07-22 17:32:37 +08:00
methods: {
2024-11-26 17:21:05 +08:00
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
2024-11-27 13:27:59 +08:00
if (JSON.stringify(this.currentData) !== '{}') {
this.val3 = this.currentData.qty
}
2024-07-22 17:32:37 +08:00
},
2024-08-02 17:26:50 +08:00
toEmpty () {
this.val1 = ''
2024-11-26 17:21:05 +08:00
this.val2 = ''
2024-11-27 13:27:59 +08:00
this.val3 = ''
2024-11-26 17:21:05 +08:00
this.currentData = {}
this.index = ''
this.disabled = false
2024-07-22 17:32:37 +08:00
},
2024-11-26 17:21:05 +08:00
async _inStorageConfirm () {
2024-07-22 17:32:37 +08:00
this.disabled = true
2024-11-27 13:27:59 +08:00
if (!this.val2 || !this.val3 || !this.index) {
2024-07-22 17:32:37 +08:00
this.disabled = false
return
}
try {
2024-11-27 13:27:59 +08:00
let obj = Object.assign(this.currentData, {vehicle_code: this.val2, stor_code: this.index, qty: this.val3})
2024-11-26 17:21:05 +08:00
let res = await inStorageConfirm(obj)
if (res.code === '200') {
this.toEmpty()
}
2024-07-22 17:32:37 +08:00
this.disabled = false
uni.showToast({
2024-08-02 17:26:50 +08:00
title: res.msg,
2024-07-22 17:32:37 +08:00
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>