307 lines
8.7 KiB
Vue
307 lines
8.7 KiB
Vue
<template>
|
||
<view style="margin: 10rpx;">
|
||
<u-navbar back-text="返回" title="无来源入库" :background="background"></u-navbar>
|
||
<u-form ref="testForm">
|
||
<u-form-item :border-bottom="false">
|
||
<label>扫描货位:</label>
|
||
<u-input :border="true" placeholder="请扫描货位条码" :focus="focusBarCode" v-model="LocationName"
|
||
@confirm="getLocationName" />
|
||
</u-form-item>
|
||
<br />
|
||
<u-row align="left">
|
||
<u-col span="2"><label>组织:</label> </u-col>
|
||
<u-col span="2"><label>{{ERPFACTORY}}</label> </u-col>
|
||
<u-col span="2"><label>仓库:</label> </u-col>
|
||
<u-col span="2"><label>{{ERPLOCATION}}</label> </u-col>
|
||
<u-col span="2"><label>货位:</label> </u-col>
|
||
<u-col span="2"><label>{{LOCATIONNAME}}</label> </u-col>
|
||
</u-row>
|
||
<br />
|
||
<u-form-item :border-bottom="false">
|
||
<p>扫描条码:</p>
|
||
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
|
||
@confirm="ScanFGBarCode" />
|
||
</u-form-item>
|
||
<br />
|
||
<u-row>
|
||
<u-col span="3"><label style="text-align: right;">料号:</label> </u-col>
|
||
<u-col span="9"><label>{{MATERIALSPECNAME}}</label> </u-col>
|
||
</u-row>
|
||
<br />
|
||
<u-row>
|
||
<u-col span="3"><label style="text-align: right;">品名:</label> </u-col>
|
||
<u-col span="9"><label>{{DESC_CN}}</label> </u-col>
|
||
</u-row>
|
||
<br />
|
||
<u-row>
|
||
<u-col span="3"><label style="text-align: right;">规格:</label> </u-col>
|
||
<u-col span="9"><label>{{SPECNAME}}</label> </u-col>
|
||
</u-row>
|
||
<br />
|
||
<u-row>
|
||
<u-col span="3"><label style="text-align: right;">阶段:</label> </u-col>
|
||
<u-col span="9"><label>{{PHASE}}</label> </u-col>
|
||
</u-row>
|
||
<br />
|
||
<u-row>
|
||
<u-col span="3"><label style="text-align: right;">批次:</label> </u-col>
|
||
<u-col span="9"><label>{{CHARGE}}</label> </u-col>
|
||
</u-row>
|
||
</u-form>
|
||
<br />
|
||
<uni-table ref="BoxList" border stripe type="false">
|
||
<uni-tr>
|
||
<uni-th align="center">标签</uni-th>
|
||
<uni-th align="center">批次</uni-th>
|
||
<uni-th align="center">品名</uni-th>
|
||
<uni-th align="center">料号</uni-th>
|
||
<uni-th align="center">规格</uni-th>
|
||
<uni-th align="center">阶段</uni-th>
|
||
<uni-th align="center">数量</uni-th>
|
||
<uni-th align="center">组织</uni-th>
|
||
<uni-th align="center">仓库</uni-th>
|
||
<uni-th align="center">货位</uni-th>
|
||
</uni-tr>
|
||
<uni-tr v-for="(item, index) in BoxListInfo" :key="index">
|
||
<!-- :style="getStyle(index)"-->
|
||
<!--:style="{ backgroundColor: item.color === 0 ? 'white' : 'blue' }" -->
|
||
<uni-td align="center">{{ item.MATERIALPACKINGNAME}}</uni-td>
|
||
<uni-td align="center">{{ item.CHARGE}}</uni-td>
|
||
<uni-td align="center">{{ item.DESC_CN}}</uni-td>
|
||
<uni-td align="center">{{ item.MATERIALSPECNAME }}</uni-td>
|
||
<uni-td align="center">{{ item.SPECNAME }}</uni-td>
|
||
<uni-td align="center">{{ item.PHASE }}</uni-td>
|
||
<uni-td align="center">{{ item.MATERIALQUANTITY }}</uni-td>
|
||
<uni-td align="center">{{ item.ERPFACTORY }}</uni-td>
|
||
<uni-td align="center">{{ item.ERPLOCATION }}</uni-td>
|
||
<uni-td align="center">{{ item.LOCATIONNAME }}</uni-td>
|
||
</uni-tr>
|
||
</uni-table>
|
||
<u-button @click="NoInvoiceStockIn" type="primary" :loading="loading">确定</u-button>
|
||
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
LocationName: '660500029', //库位信息
|
||
LOCATIONNAME: '',
|
||
ERPFACTORY: '', //组织
|
||
ERPLOCATION: '', //库位
|
||
tabH: 800, //表格的宽度
|
||
MATERIALSPECNAME: '',
|
||
MATERIALPACKINGNAME: '', //条码
|
||
CHARGE: '', //批次
|
||
DESC_CN: '', //品名
|
||
SPECNAME: '', //规格
|
||
RECEIVEACTNO: '', //入库单号
|
||
UNIT: '', //单位
|
||
PHASE: '', //阶段
|
||
QTY: '', //数量
|
||
background: {
|
||
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
||
}, //返回按钮的样式
|
||
colors: ['#007aff', '#4cd964', '#dd524d'],
|
||
styleType: 'button',
|
||
current: 0,
|
||
BoxListInfo: [], //后端传回来的绑定表格的数据
|
||
colorIndex: 0,
|
||
activeColor: '#007aff',
|
||
styleType: 'text',
|
||
loading: false,
|
||
scanData: [], //已扫描箱
|
||
barCode: "", //条码
|
||
DURABLENAMECode: "", //卷芯
|
||
focusBarCode: false, //焦点是否被选中
|
||
focusShipRequest: true, //默认焦点在单号
|
||
siteName: "",
|
||
userId: "",
|
||
}
|
||
},
|
||
|
||
mounted() {
|
||
this.tabH = this.$GetRemainingHeight(4, 0); //定义表格的高度
|
||
let that = this
|
||
uni.getStorage({
|
||
key: "sitename",
|
||
success(res) {
|
||
that.siteName = res.data
|
||
}
|
||
})
|
||
uni.getStorage({
|
||
key: "userid",
|
||
success(res) {
|
||
that.userId = res.data
|
||
}
|
||
})
|
||
},
|
||
|
||
methods: {
|
||
//获取焦点的公共方法
|
||
getfocus(nextfocus) {
|
||
this.initfocus()
|
||
this[nextfocus]
|
||
this.$nextTick(() => { //vue是数据全部修改后才进行的视图更新,哪nextTick函数就是为了拿到最新的数据,还不懂的可以去百度
|
||
this[nextfocus] = true
|
||
})
|
||
},
|
||
getLocationName() {
|
||
this.$MyRequest('/storage/getLocationName', {
|
||
storageName: this.LocationName
|
||
}).then(res => {
|
||
if (res.data.success) {
|
||
var _Arr = res.data.resultObj;
|
||
this.LOCATIONNAME = _Arr[0].STORAGENAME;
|
||
this.ERPFACTORY = _Arr[0].ERPFACTORY;
|
||
this.ERPLOCATION = _Arr[0].ERPLOCATION;
|
||
} else {
|
||
this.$showMessage(res.data.message)
|
||
}
|
||
this.focusBarCode = true
|
||
this.focusShipRequest = false
|
||
}).catch(err => {
|
||
this.$showMessage(err)
|
||
});
|
||
},
|
||
async ScanFGBarCode() {
|
||
console.log(this.userId)
|
||
// if (this.userId == "" || this.userId == null) {
|
||
// this.$showMessage("登录失效,请重新登录")
|
||
// }
|
||
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
|
||
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
|
||
if (barCodeArr.length < 7) {
|
||
this.$showMessage("条码规则不符合需求!")
|
||
return;
|
||
}
|
||
if (this.LOCATIONNAME == "") {
|
||
this.$showMessage("货位不存在!")
|
||
return;
|
||
}
|
||
this.loading = true;
|
||
this.focusBarCode = false;
|
||
await this.$MyRequest('/NoInvoice/getBarCode', {
|
||
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
|
||
LOCATIONNAME: this.LOCATIONNAME,
|
||
ERPFACTORY: this.ERPFACTORY,
|
||
ERPLOCATION: this.ERPLOCATION,
|
||
CREATEUSER : this.userId
|
||
}).then(res => {
|
||
if (res.data.success) {
|
||
debugger
|
||
var _Arr = res.data.resultObj;
|
||
this.MATERIALPACKINGNAME = _Arr[0].MATERIALPACKINGNAME;
|
||
this.CHARGE = _Arr[0].CHARGE;
|
||
this.MATERIALSPECNAME = _Arr[0].MATERIALSPECNAME;
|
||
this.SPECNAME = _Arr[0].SPECNAME;
|
||
this.DESC_CN = _Arr[0].DESC_CN;
|
||
this.PHASE = _Arr[0].PHASE;
|
||
//this.BoxListInfo.push(_Arr[0])
|
||
//Array.from(new Set(this.BoxListInfo))
|
||
console.log(new Set(this.BoxListInfo))
|
||
|
||
array.push(_Arr[0])
|
||
//this.BoxListInfo = new Set(this.BoxListInfo)
|
||
//this.BoxListInfo = array
|
||
this.BoxListInfo = Array.from(new Set(array))
|
||
this.loading = false;
|
||
} else {
|
||
this.loading = false;
|
||
this.$showMessage(res.data.message)
|
||
this.MATERIALPACKINGNAME = ""
|
||
}
|
||
this.focusBarCode = true
|
||
this.focusShipRequest = false
|
||
}).catch(err => {
|
||
this.loading = false;
|
||
this.$showMessage(err)
|
||
this.MATERIALPACKINGNAME = ""
|
||
});
|
||
},
|
||
|
||
/**
|
||
* 入库审核
|
||
*/
|
||
NoInvoiceStockIn() {
|
||
this.loading = true;
|
||
this.$MyRequest('/NoInvoice/NoInvoiceStockIn', {
|
||
boxList: this.BoxListInfo
|
||
}).then(res => {
|
||
if (res.data.success) {
|
||
this.loading = false;
|
||
this.resetValue();
|
||
this.$showMessage(res.data.message)
|
||
} else {
|
||
this.loading = false;
|
||
this.$showMessage(res.data.message)
|
||
}
|
||
this.focusBarCode = true
|
||
this.focusShipRequest = false
|
||
}).catch(err => {
|
||
this.loading = false;
|
||
this.$showMessage(err)
|
||
});
|
||
},
|
||
|
||
resetValue() {
|
||
this.MATERIALPACKINGNAME = "";
|
||
this.LocationName = "";
|
||
this.ERPFACTORY = "";
|
||
this.ERPLOCATION = "";
|
||
this.BoxListInfo = [];
|
||
this.RECEIVEACTNO = "";
|
||
this.MATERIALSPECNAME = "";
|
||
this.PHASE = "";
|
||
this.SPECNAME = "";
|
||
this.DESC_CN = "";
|
||
this.CHARGE = "";
|
||
THIS.LOCATIONNAME = "";
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
switch {
|
||
color: #FFCC33;
|
||
}
|
||
|
||
/* 基础样式 */
|
||
.picker {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
width: 100%;
|
||
/* 根据需要调整宽度 */
|
||
}
|
||
|
||
.row {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
margin-bottom: 10px;
|
||
/* 行与行之间的间距 */
|
||
}
|
||
|
||
.col {
|
||
flex: 1;
|
||
/* 使得每列占据相等的空间 */
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
label {
|
||
// font-weight: bold;
|
||
/* 标签加粗 */
|
||
margin-bottom: 5px;
|
||
/* 标签和值之间的间距 */
|
||
}
|
||
|
||
.value {
|
||
/* 值的样式,可以根据需要调整 */
|
||
}
|
||
</style>
|