add 人工出入库
This commit is contained in:
85
pages/task/sgck.vue
Normal file
85
pages/task/sgck.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<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-5">
|
||||
<span class="filter_label">载具码</span>
|
||||
</view>
|
||||
<view class="zd-col-19 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-5">
|
||||
<span class="filter_label">点位编码</span>
|
||||
</view>
|
||||
<view class="zd-col-19 filter_select">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handOut">出库确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {handOut} from '@/utils/getData.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _handOut () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handOut(this.val1, this.val2)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
|
||||
</style>
|
||||
175
pages/task/sgrk.vue
Normal file
175
pages/task/sgrk.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<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="_handIn">入库确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getPlateDtl, getSect, handIn, 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 _handIn () {
|
||||
this.disabled2 = true
|
||||
if (!this.vcode || !this.pointCode || !this.sectId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await handIn(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>
|
||||
Reference in New Issue
Block a user