出库
This commit is contained in:
@@ -13,54 +13,92 @@
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">物料余量</span>
|
||||
<span class="filter_label">起点点位</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="number" class="filter_input" v-model="val2">
|
||||
<input type="text" class="filter_input" v-model="val2">
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">物料点位</span>
|
||||
<span class="filter_label">终点点位</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="number" class="filter_input" v-model="val3">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flow_wrapper" v-for="e in dataList" :key="e.point_code">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-24">
|
||||
<view class="zd-row">
|
||||
<view class="zd-col-2">
|
||||
<view class="zd-row flow_icon_item_1">
|
||||
<view class="iconfont icon_start_point"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-col-22">
|
||||
<view class="zd-row flow_start_item" @tap="checkcode(e)" :class="{'flow_start_item_checked': pkId === e.point_code}">
|
||||
<view class="zd-col-12 pdl20 pdr20 font-size-1">{{e.point_code}}</view>
|
||||
<view class="zd-col-12 pdr20 font-size-2">{{e.point_name}}</view>
|
||||
<view v-show="pkId === e.point_code" class="iconfont icon_choosed"></view>
|
||||
</view>
|
||||
</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>
|
||||
<th>物料数量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.group_id === pkId}">
|
||||
<td>{{e.point_code}}</td>
|
||||
<td>{{e.point_name}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.material_qty}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit-bar_new">
|
||||
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId || !$store.getters.publicObj}" :disabled="disabled1" @tap="_fullVehicleOut">满托出库</button>
|
||||
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !pkId || !$store.getters.publicObj}" :disabled="disabled2" @tap="_vehicleGoBack">余料回库</button>
|
||||
<button class="zd-col-10 submit-button_new" :class="{'btn-disabled': !pkId || !$store.getters.publicObj}" :disabled="disabled3" @tap="_fullVehicleOutConfirm">满托出库确认</button>
|
||||
<button class="zd-col-4 submit-button_new" @tap="clearUp">清空</button>
|
||||
<button class="zd-col-6 submit-button_new" :class="{'btn-disabled': !val2 || !index1}" :disabled="disabled1" @tap="_fullVehicleOut">满托出库</button>
|
||||
<button class="zd-col-6 submit-button_new" @tap="popUp(1)">余料回库</button>
|
||||
<button class="zd-col-7 submit-button_new" @tap="popUp(2)">满托出库确认</button>
|
||||
</view>
|
||||
<view class="msg_wrapper" :class="show ? 'popshow' : 'pophide'">
|
||||
<view class="msg_box">
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">当前点位</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index2" :localdata="options1" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">载具编码</view>
|
||||
<view class="filter_input_wraper">
|
||||
<search-box
|
||||
v-model="val3"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">物料数量</view>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="number" class="filter_input" v-model="val4">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row msg_btns">
|
||||
<button class="zd-col-9 msg_btn_cancle" @tap="toClear">清空</button>
|
||||
<button class="zd-col-13 msg_btn" :class="{'btn-disabled': !index2 || !val3 || !val4}" :disabled="disabled2" @tap="toConfirm">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="show" class="msg_mask" @click.stop="show = false"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPoints, fullVehicleOut, vehicleGoBack, fullVehicleOutConfirm} from '@/utils/getData2.js'
|
||||
import {queryLinkMaterial, queryPoints, fullVehicleOut, vehicleGoBack, fullVehicleOutConfirm} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -70,12 +108,18 @@
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
options1: [],
|
||||
index1: '',
|
||||
index2: '',
|
||||
val3: '',
|
||||
val4: '',
|
||||
dataList: [],
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
pkId: ''
|
||||
pkId: '',
|
||||
show: false,
|
||||
type: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
@@ -87,41 +131,51 @@
|
||||
onShow() {
|
||||
if (this.$store.getters.publicObj) {
|
||||
this.val1 = this.$store.getters.publicObj.material_name
|
||||
this.val2 = this.$store.getters.publicObj.material_qty
|
||||
this.val3 = this.$store.getters.publicObj.point_code
|
||||
this.val4 = this.$store.getters.publicObj.vehicle_code
|
||||
this._queryLinkMaterial(this.$store.getters.publicObj.material_id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 初始化查询 */
|
||||
async _queryPoints () {
|
||||
let res = await queryPoints('2')
|
||||
this.dataList = [...res]
|
||||
},
|
||||
getMater () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/manage/search-mater'
|
||||
url: '/pages/manage/search-mater-1'
|
||||
})
|
||||
},
|
||||
checkcode (e) {
|
||||
this.pkId = this.pkId === e.point_code ? '' : e.point_code
|
||||
/** grid查询 */
|
||||
async _queryLinkMaterial (e) {
|
||||
let res = await queryLinkMaterial(e)
|
||||
this.dataList = [...res]
|
||||
},
|
||||
/** 选择器 */
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
},
|
||||
selectChange2(e) {
|
||||
this.index2 = e
|
||||
},
|
||||
/** 点位下拉框 */
|
||||
async _queryPoints () {
|
||||
let res = await queryPoints('2')
|
||||
res.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'text', el.point_name)
|
||||
})
|
||||
this.options1 = [...res]
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.group_id ? '' : e.group_id
|
||||
this.val2 = this.pkId === e.group_id ? e.point_code : ''
|
||||
},
|
||||
/** 满托出库 */
|
||||
async _fullVehicleOut () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
if (!this.val2 || !this.index1) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await fullVehicleOut(this.val3, this.pkId)
|
||||
let res = await fullVehicleOut(this.val2, this.index1)
|
||||
this.disabled1 = false
|
||||
this.pkId = ''
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.val4 = ''
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
this._queryLinkMaterial(this.$store.getters.publicObj.material_id)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -130,53 +184,75 @@
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
|
||||
popUp (type) {
|
||||
this.show = true
|
||||
this.type = type
|
||||
},
|
||||
toClear () {
|
||||
this.index2 = ''
|
||||
this.val3 =''
|
||||
this.val4 =''
|
||||
},
|
||||
toConfirm () {
|
||||
if (this.type === 1) {
|
||||
this._vehicleGoBack()
|
||||
}
|
||||
if (this.type === 2) {
|
||||
this._fullVehicleOutConfirm()
|
||||
}
|
||||
},
|
||||
/** 余料回库 */
|
||||
async _vehicleGoBack () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
if (!this.index2 || !this.val3 || !this.val4) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await vehicleGoBack(this.pkId, this.val4, this.val2)
|
||||
let res = await vehicleGoBack(this.index2, this.val3, this.val4)
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.val4 = ''
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
this.toClear()
|
||||
this.show = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
this.toClear()
|
||||
this.show = false
|
||||
}
|
||||
},
|
||||
/** 满托出库确认 */
|
||||
async _fullVehicleOutConfirm () {
|
||||
this.disabled3 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled3 = false
|
||||
this.disabled2 = true
|
||||
if (!this.index2 || !this.val3 || !this.val4) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await fullVehicleOutConfirm(this.pkId, this.val4, this.val2)
|
||||
this.disabled3 = false
|
||||
this.pkId = ''
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.val3 = ''
|
||||
this.val4 = ''
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
let res = await fullVehicleOutConfirm(this.index2, this.val3, this.val4)
|
||||
this.disabled2 = false
|
||||
this.toClear()
|
||||
this.show = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
this.disabled2 = false
|
||||
this.toClear()
|
||||
this.show = false
|
||||
}
|
||||
},
|
||||
clearUp () {
|
||||
this.index1 = ''
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user