175 lines
4.1 KiB
Vue
175 lines
4.1 KiB
Vue
<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-6">
|
|
<span class="filter_label">载具码</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<search-box
|
|
v-model="vcode"
|
|
@handleChange="handleChange1"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">点位编码</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<input type="text" class="filter_input" v-model="pointCode">
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-6">
|
|
<span class="filter_label">库区编码</span>
|
|
</view>
|
|
<view class="zd-col-18 filter_select">
|
|
<uni-data-select v-model="sectId" :localdata="options"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd_wrapper grid-wraper">
|
|
<view class="slide_new">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>物料编码</th>
|
|
<th>物料名称</th>
|
|
<th>批次</th>
|
|
<th>数量</th>
|
|
<th>单位</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="(e, index) in dataList" :key="e.group_id">
|
|
<td>{{e.material_code}}</td>
|
|
<td>{{e.material_name}}</td>
|
|
<td>{{e.pcsn}}</td>
|
|
<td>{{e.qty}}</td>
|
|
<td>{{e.qty_unit_name}}</td>
|
|
<td><button type="warn" size="mini" :disabled="id === e.group_id && disabled3" @tap="_deleteDtl(e)">删除</button></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-6 button-default" @tap="clearUp2">清空</button>
|
|
<button class="zd-col-15 button-primary" :class="{'button-info': !vcode || !pointCode || !sectId}" :disabled="disabled2" @tap="_confirmIn">入库确认</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import {getPlateDtl, getSect, confirmIn, deleteDtl} from '@/utils/getData.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox
|
|
},
|
|
data() {
|
|
return {
|
|
title: '',
|
|
vcode: '',
|
|
dataList: [],
|
|
pointCode: '',
|
|
sectId: '',
|
|
options: [],
|
|
disabled1: false,
|
|
disabled2: false,
|
|
id: '',
|
|
disabled3: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
this._getSect()
|
|
},
|
|
methods: {
|
|
handleChange1 (e) {
|
|
if (e) {
|
|
this._getPlateDtl(e)
|
|
}
|
|
},
|
|
async _getPlateDtl (e) {
|
|
try {
|
|
let res = await getPlateDtl(e)
|
|
if (res && res.data) {
|
|
this.dataList = [...res.data]
|
|
} else {
|
|
this.dataList = []
|
|
}
|
|
} catch (e) {
|
|
this.dataList = []
|
|
}
|
|
},
|
|
clearUp2 () {
|
|
this.vcode = ''
|
|
this.pointCode = ''
|
|
this.sectId = ''
|
|
this.disabled = false
|
|
this.dataList = []
|
|
|
|
},
|
|
async _getSect () {
|
|
try {
|
|
let res = await getSect()
|
|
if (res && res.data) {
|
|
this.options = [...res.data]
|
|
this.options.map(el => {
|
|
this.$set(el, 'value', el.sect_id)
|
|
this.$set(el, 'text', el.sect_name)
|
|
})
|
|
}
|
|
} catch (e) {
|
|
this.options = []
|
|
}
|
|
},
|
|
// 入库确认
|
|
async _confirmIn () {
|
|
this.disabled2 = true
|
|
if (!this.vcode || !this.pointCode || !this.sectId) {
|
|
this.disabled2 = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await confirmIn(this.vcode, this.pointCode, this.sectId)
|
|
this.disabled2 = false
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
this.clearUp2()
|
|
} catch (e) {
|
|
this.disabled2 = false
|
|
}
|
|
},
|
|
// 删除
|
|
async _deleteDtl (e) {
|
|
this.id = e.group_id
|
|
this.disabled3 = true
|
|
try {
|
|
let res = await deleteDtl(e)
|
|
this.disabled3 = false
|
|
this.id = ''
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
this._getPlateDtl(this.vcode)
|
|
} catch (e) {
|
|
this.disabled3 = false
|
|
this.id = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script> |