<template>
|
<default-header-page-layout ref="page" title="异常物料处理">
|
<view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
|
<action-user-row />
|
<view class="with-action-user-row-page-content">
|
<!-- step 1 start -->
|
<scan-input-form-item class="forma-item" label="物料二维码" v-model="form.materialId"
|
:msg="msg.materialId" :msg-type="msgType.materialId" @search="onSearchMaterial(form.materialId)"
|
@clear="onClearContainter"/>
|
|
|
|
<!-- <view class="p-form-label"><text class="required-tag"></text>选择异常工位位置</view> -->
|
<exceptionPlace v-show="Boolean(materialData.materialType)" :station.sync="form.station" :exceptePlace="exceptePlace"/>
|
<materialInfo :materialData="this.materialData" />
|
</view>
|
</view>
|
|
</view>
|
<template v-slot:footer>
|
<view class="bottom-btns-row">
|
<template>
|
<div class="btn-frame"><u-button :disabled="disabled" type="primary" text="自动出库" @click="submint(1)"
|
></u-button></div>
|
<div class="btn-frame"><u-button :disabled="disabled" type="primary" text="人工出库" @click="submint(2)"
|
></u-button></div>
|
</template>
|
</view>
|
</template>
|
</default-header-page-layout>
|
</template>
|
|
<script>
|
import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue'
|
import ActionUserRow from '@/components/ActionUserRow.vue'
|
import ScanInputFormItem from '@/components/ScanInputFormItem.vue'
|
import EasySelectFormItem from '@/components/EasySelectFormItem.vue'
|
import EasyPicker from '@/components/EasyPicker.vue'
|
import exceptionPlace from './modules/exceptionPlace.vue'
|
import materialInfo from './modules/materialInfo.vue'
|
import {
|
lisNoPage,exceptionInfo,outBound
|
} from '@/api/exception.js'
|
import { $alert, $successInfo, regexValidate } from '@/static/js/utils/index.js'
|
let initInterVal = null;
|
|
export default {
|
name: 'emptyInPage',
|
components: {
|
DefaultHeaderPageLayout,
|
ActionUserRow,
|
ScanInputFormItem,
|
EasySelectFormItem,
|
EasyPicker,
|
exceptionPlace,
|
materialInfo
|
},
|
data() {
|
return {
|
pageBodyHeight: 0,
|
form: {
|
no: '',
|
station:''
|
},
|
exceptePlace: [],
|
materialData: {},
|
msg: {
|
materialId:''
|
},
|
msgType: {
|
materialId:'info'
|
},
|
}
|
},
|
computed: {
|
disabled() {
|
return !Boolean(this.materialData.materialId)
|
}
|
},
|
methods: {
|
onClearContainter(){
|
this.form.station=''
|
this.materialData={}
|
},
|
// onReady() {
|
// this.startInitInterval(() => {
|
|
// })
|
// },
|
// 获取异常工位点
|
getExceptionPlace(materialType){
|
var areaCode=materialType==1?'GGYC':'JTYC'
|
try{
|
lisNoPage({areaCode}).then(res=>{
|
|
if(res.code == 200){
|
this.exceptePlace=res?.result
|
console.log(this.exceptePlace,'11');
|
}
|
})
|
|
}catch(e){
|
//TODO handle the exception
|
$alert(e);
|
return;
|
}
|
},
|
// 获取异常件信息信息
|
async onSearchMaterial() {
|
if (!this.form.materialId) {
|
this.msgType.materialId = 'error'
|
this.msg.materialId = '请输入扫码!';
|
return false;
|
}
|
const data = {
|
code: this.form.materialId
|
}
|
// 获取代码
|
try{
|
let {result}=await exceptionInfo(data)
|
this.materialData = result
|
this.getExceptionPlace(this.materialData.materialType);
|
}catch(e){
|
//TODO handle the exception
|
$alert(e)
|
return;
|
}
|
},
|
|
// 清除数据
|
setData(){
|
console.log('clear');
|
this.form={
|
no: '',
|
station:''
|
}
|
|
this.msg={
|
materialId:''
|
},
|
this.msgType={
|
materialId:'info'
|
}
|
this.exceptePlace= []
|
this.materialData= {}
|
},
|
// 出库
|
async submint(type) {
|
const data={
|
type,
|
materialId:this.materialData.materialId,
|
stationNo:this.form.station
|
}
|
console.log(data);
|
try{
|
await outBound(data)
|
this.setData()
|
$successInfo("出库成功!")
|
|
}catch(e){
|
//TODO handle the exception
|
console.log(e);
|
}
|
|
},
|
/* 页面初始化获取页面body高度的定时器 */
|
startInitInterval(callback) {
|
initInterVal = setInterval(() => {
|
if (this.pageBodyHeight) {
|
this.clearInitInterval()
|
callback && callback()
|
} else {
|
this.pageBodyHeight = this.$refs.page.getBodyHeight()
|
}
|
}, 200)
|
},
|
/* 清除定时器 */
|
clearInitInterval() {
|
try {
|
clearInterval(initInterVal)
|
initInterVal = null
|
} catch (e) {
|
//TODO handle the exception
|
}
|
}
|
},
|
onReady() {
|
this.startInitInterval(() => {
|
/* 页面初始化后需要执行的代码在这边调用 */
|
// this.getData()
|
// this.getLinesOptions()
|
// this.selectOptions.models = getDicList(this.$store,'assemble_taskmodel')
|
})
|
},
|
onUnload() {
|
this.clearInitInterval()
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.p-form-label{
|
font-size: 32rpx;
|
color: $u-tips-color;
|
padding-bottom: 12rpx;
|
padding-left: 20rpx;
|
.required-tag{
|
color:$u-error;
|
}
|
}
|
.bottom-btns-row {
|
display: flex;
|
justify-content: center;
|
padding: 10rpx 10rpx;
|
background-color: #fff;
|
|
.btn-frame {
|
flex:1;
|
box-sizing: border-box;
|
}
|
|
.btn-frame:nth-child(1){
|
margin-right: 10rpx;
|
}
|
|
.left-btn-frame {
|
padding-left: 20rpx;
|
padding-right: 8rpx;
|
}
|
|
.right-btn-frame {
|
padding-right: 20rpx;
|
padding-left: 8rpx;
|
}
|
}
|
|
.forma-item {
|
margin-bottom: 24rpx;
|
}
|
|
.material-item-group {
|
background-color: $uni-bg-color;
|
padding-top: 10rpx;
|
|
.material-list-item {
|
border-bottom: 2rpx solid $uni-border-color;
|
padding-bottom: 10rpx;
|
padding-left: 60rpx;
|
margin-bottom: 10rpx;
|
position: relative;
|
|
&:last-child {
|
border-bottom: 0;
|
}
|
|
.item-row {
|
display: flex;
|
|
&>.label {
|
flex-shrink: 0;
|
color: $u-tips-color;
|
width: 144rpx;
|
}
|
|
&>.content {
|
flex-grow: 1;
|
color: $u-content-color;
|
|
uni-input {
|
font: inherit;
|
color: $u-primary;
|
text-decoration: underline;
|
}
|
}
|
}
|
|
.badge-box {
|
position: absolute;
|
top: 8rpx;
|
left: 8rpx;
|
z-index: 1;
|
}
|
|
.close-btn {
|
$closeBtnSize: 70rpx;
|
width: $closeBtnSize;
|
height: $closeBtnSize;
|
z-index: 1;
|
position: absolute;
|
top: 0rpx;
|
right: 8rpx;
|
background-color: $u-error;
|
opacity: 0.6;
|
border-radius: 25rpx;
|
|
.icon-layer {
|
position: absolute;
|
width: 100%;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
z-index: 2;
|
}
|
}
|
}
|
}
|
</style>
|