Files
hht-fujia-uni/pages/manage/zprk.vue
2025-09-25 17:39:07 +08:00

181 lines
4.7 KiB
Vue

<template>
<view class="zd_container">
<!-- 组盘入库 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="is-required">
<view class="filter_label">{{$t('label.StartPosition')}}</view>
<search-box
v-model="val2"
@handleChange="handleChange"
/>
</view>
<view class="is-required">
<view class="filter_label">{{$t('label.CarrierCode')}}</view>
</view>
<view class="zd-row">
<view class="zd-col-18">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
<button class="mini-btn" type="primary" size="mini" style="margin-right: 0" @tap="_getVehicleMaterial(val1)">{{$t('button.search')}}</button>
</view>
<view class="is-required">
<view class="filter_label">{{$t('label.WarehouseArea')}}</view>
<view class="filter_select">
<uni-data-select :placeholder="$t('utils.selectPlaceholder')" :emptyTips="$t('utils.selectEmptyTips')" v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
<view>
<view class="filter_label">{{$t('label.MaterialName')}}</view>
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_name" disabled>
</view>
<view>
<view class="filter_label">{{$t('label.MaterialSpecification')}}</view>
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
</view>
<view>
<view class="filter_label">{{$t('label.MaterialCode')}}</view>
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
</view>
<view>
<view class="filter_label">{{$t('label.MaterialQuantity')}}</view>
<view class="zd-row">
<view class="zd-col-20"><input type="text" class="filter_input filter_input_disabled" v-model="currentData.qty" disabled></view>
<view class="zd-col-4 filter_unit">{{currentData.qty_unit_name}}</view>
</view>
</view>
</view>
<view v-if="dataList.length" class="zd_wrapper grid-wraper">
<view v-if="dataList.length" class="slide_new">
<table>
<thead>
<tr>
<th width="60%">{{$t('th.MaterialBoxNumber')}}</th>
<th width="40%">{{$t('th.Quantity')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.mater_frame}}</td>
<td>{{e.qty}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_confirmIn">{{$t('button.confirm')}}</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getSect, getVehicleMaterial, confirmIn} from '@/utils/getData.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
options: [],
index: '',
disabled: false,
currentData: {},
dataList: []
};
},
onLoad (options) {
this.title = options.title
},
created () {
this._getSect()
},
methods: {
async _getSect () {
try {
let res = await getSect()
if (res) {
this.options = res
} else {
this.options =[]
}
} catch (e) {
this.options = []
}
},
selectChange (e) {
this.index = e
},
handleChange (e) {
if (e) {
this._getVehicleMaterial(e)
}
},
async _getVehicleMaterial (e) {
try {
let res = await getVehicleMaterial(e)
if (res) {
this.currentData = res
this.dataList = res.dtlList
} else {
this.currentData = {}
this.dataList = []
}
} catch (e) {
this.currentData = {}
this.dataList = []
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.disabled = false
this.currentData = {}
this.dataList = []
},
async _confirmIn () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
this.disabled = false
return
}
try {
let res = await confirmIn(this.val1, this.val2, this.index)
if (res.status === '200') {
this.clearUp()
}
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
.slide_new
table
table-layout auto
th,td
&:first-child
box-shadow: none
</style>