446 lines
10 KiB
Vue
446 lines
10 KiB
Vue
![]() |
<template>
|
||
|
<view style="margin: 10rpx;">
|
||
|
<u-navbar back-text="返回" title="立体库出库" :background="background"></u-navbar>
|
||
|
<u-form ref="testForm" labelWidth="200" style="padding-bottom: 200rpx;">
|
||
|
<u-form-item class="item2">
|
||
|
<p>物料:</p>
|
||
|
<u-input v-model="materialSpecName" border></u-input>
|
||
|
</u-form-item>
|
||
|
<u-form-item class="item2">
|
||
|
<p>库区:</p>
|
||
|
<zxzUniDataSelect @change="changeSlect" filterable v-model="AreaName" :localdata="Area">
|
||
|
</zxzUniDataSelect>
|
||
|
</u-form-item>
|
||
|
<u-form-item>
|
||
|
<p>出货口:</p>
|
||
|
<zxzUniDataSelect filterable v-model="outPort" :localdata="outPortList">
|
||
|
</zxzUniDataSelect>
|
||
|
</u-form-item>
|
||
|
<br />
|
||
|
<checkbox-group @change="IFHaveBh">
|
||
|
<label>
|
||
|
<checkbox value="bh" />是否已备货
|
||
|
</label>
|
||
|
</checkbox-group>
|
||
|
<br />
|
||
|
|
||
|
<zb-table style="height: 400upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
|
||
|
:fit="false" :highlight="true" :border="true" :data="list_detail" :cell-style="cellStyleFn"
|
||
|
@toggleAllSelection="toggleAllSelection" @toggleRowSelection="stockSelectionChange"></zb-table>
|
||
|
<br />
|
||
|
<checkbox-group @change="IFUserAGV" >
|
||
|
<label>
|
||
|
<checkbox value="cb" />是否使用AGV
|
||
|
</label>
|
||
|
</checkbox-group>
|
||
|
<br />
|
||
|
<u-form-item label="起始点" v-if="AGVshow">
|
||
|
<zxzUniDataSelect filterable v-model="INITILATION" :localdata="items_In"></zxzUniDataSelect>
|
||
|
</u-form-item>
|
||
|
<u-form-item label="目的点" v-if="AGVshow">
|
||
|
<zxzUniDataSelect filterable v-model="ENDING" :localdata="items_En"></zxzUniDataSelect>
|
||
|
</u-form-item>
|
||
|
<u-form-item label="A/B轴" v-if="AGVshow">
|
||
|
<zxzUniDataSelect filterable v-model="AB" :localdata="ABS"></zxzUniDataSelect>
|
||
|
</u-form-item>
|
||
|
</u-form>
|
||
|
<view class="tabbar_bottom">
|
||
|
<uni-datetime-picker style="align-items: center;" type="date" :clear-icon="false" v-model="commitDate" @maskClick="maskClick" />
|
||
|
<u-button @click="FGStockIn" type="primary" :loading="loading">确定</u-button>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
|
||
|
export default {
|
||
|
components: {
|
||
|
zxzUniDataSelect
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
commitDate:'',
|
||
|
AREANAME:"",
|
||
|
IFBh:"",
|
||
|
outPort: "", // 出货口
|
||
|
list_detail: [],
|
||
|
column: [ //列
|
||
|
{
|
||
|
type: 'selection',
|
||
|
width: 40
|
||
|
},
|
||
|
{
|
||
|
name: 'MATERIALSPECNAME',
|
||
|
label: '料号'
|
||
|
},
|
||
|
{
|
||
|
name: 'CHARGE',
|
||
|
label: '批次',
|
||
|
align: 'center',
|
||
|
// fixed: true,
|
||
|
},
|
||
|
{
|
||
|
name: 'DESC_CN',
|
||
|
label: '品名'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
name: 'ERPLOCATION',
|
||
|
label: '库位'
|
||
|
},
|
||
|
{
|
||
|
name: 'LOCATIONNAME',
|
||
|
label: '货架'
|
||
|
}, {
|
||
|
name: 'DESCRIPTION',
|
||
|
label: '库区'
|
||
|
},{
|
||
|
name: 'TRAYNAME',
|
||
|
label: '载具'
|
||
|
},
|
||
|
{
|
||
|
name: 'SHELFNAME',
|
||
|
label: '立体库货架'
|
||
|
},
|
||
|
{
|
||
|
name: 'WIDTH',
|
||
|
label: '宽幅(AGV)',
|
||
|
sorter: true
|
||
|
},
|
||
|
{
|
||
|
name: 'DIAMETER',
|
||
|
label: '直径(AGV)',
|
||
|
sorter: true
|
||
|
},
|
||
|
{
|
||
|
name: 'DEVIATION',
|
||
|
label: '偏移量(AGV)',
|
||
|
sorter: true
|
||
|
},
|
||
|
{
|
||
|
name: 'WEIGHT',
|
||
|
label: '重量(AGV)',
|
||
|
sorter: true
|
||
|
},
|
||
|
{
|
||
|
name: 'PRODUCTLINE',
|
||
|
label: '生产线(AGV)',
|
||
|
sorter: true
|
||
|
},
|
||
|
{
|
||
|
name: 'MATERIALQUANTITY',
|
||
|
label: '系统数量',
|
||
|
sorter: true
|
||
|
},
|
||
|
],
|
||
|
items_In: [],
|
||
|
items_En: [],
|
||
|
INITILATION: '', //起始点
|
||
|
ENDING: '', //目的地
|
||
|
AB: '', //AB轴
|
||
|
DURABLENAMECode: '', //卷芯
|
||
|
AreaName: '',
|
||
|
materialSpecName : '',
|
||
|
Area: [],
|
||
|
value: '',
|
||
|
show: false,
|
||
|
AGVshow: false,
|
||
|
datamodel: '',
|
||
|
tabH: 800, //表格的宽度
|
||
|
RECEIVEACTNO: '', //入库单号
|
||
|
background: {
|
||
|
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
||
|
}, //返回按钮的样式
|
||
|
colors: ['#007aff', '#4cd964', '#dd524d'],
|
||
|
styleType: 'button',
|
||
|
BoxListInfo: [], //后端传回来的绑定表格的数据
|
||
|
activeColor: '#007aff',
|
||
|
loading: false,
|
||
|
siteName: "",
|
||
|
userId: "",
|
||
|
items: [],
|
||
|
stockChoose:[],
|
||
|
outPortList:[],
|
||
|
ABS : [
|
||
|
{
|
||
|
text : "A轴",
|
||
|
value : "A"
|
||
|
},
|
||
|
{
|
||
|
text : "B轴",
|
||
|
value : "B"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.GetArea()
|
||
|
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
|
||
|
}
|
||
|
})
|
||
|
|
||
|
this.GetLiberaryBaeIn()
|
||
|
this.GetLiberaryBaeEn()
|
||
|
this.getTimeData();
|
||
|
// let Things = 20
|
||
|
// for (var i = 0; i < Things; i++) {
|
||
|
// this.list_detail.push({aa:"1"})
|
||
|
// }
|
||
|
},
|
||
|
methods: {
|
||
|
getTimeData(){
|
||
|
var year=new Date().getFullYear();//年
|
||
|
if (year< 1900) year = year + 1900;
|
||
|
var month = new Date().getMonth() + 1;//月
|
||
|
if (month < 10) month = '0' + month;
|
||
|
var day = new Date().getDate();//日
|
||
|
if (day < 10) day = '0' + day;
|
||
|
const calendar1 = year+'-'+month+'-'+day
|
||
|
this.commitDate = calendar1
|
||
|
},
|
||
|
maskClick(e) {
|
||
|
console.log('maskClick事件:', e);
|
||
|
},
|
||
|
outPortFn() {
|
||
|
this.$MyRequest('/MaturationLibrary/getPort', {AREANAME:this.AREANAME}).then((res) => {
|
||
|
let list = res.data.resultObj.map(item => {
|
||
|
return {
|
||
|
value:item.PORTNO,
|
||
|
text: item.PORTNAME
|
||
|
}
|
||
|
})
|
||
|
console.log(list)
|
||
|
this.outPortList = list
|
||
|
})
|
||
|
},
|
||
|
changeSlect(e) {
|
||
|
this.outPort = "";
|
||
|
this.list_detail = []
|
||
|
console.log('1',e)
|
||
|
this.AREANAME = e.value
|
||
|
this.outPortFn()
|
||
|
this.getDetailQuery({AREANAME:this.AREANAME,SHIPREQUESTNAME:this.IFBh,MATERIALSPECNAME : this.materialSpecName})
|
||
|
},
|
||
|
IFHaveBh(e) {
|
||
|
let value = e.detail.value[0] || ""
|
||
|
console.log(value)
|
||
|
this.IFBh = value
|
||
|
this.list_detail = []
|
||
|
this.getDetailQuery({AREANAME:this.AREANAME,SHIPREQUESTNAME:this.IFBh,MATERIALSPECNAME : this.materialSpecName})
|
||
|
},
|
||
|
getDetailQuery(data) {
|
||
|
this.loading = true
|
||
|
this.$MyRequest('/MaturationLibrary/getPreStockOutByAuto', data).then((res) => {
|
||
|
this.list_detail = res.data.resultObj
|
||
|
this.loading = false
|
||
|
})
|
||
|
},
|
||
|
toggleAllSelection(e,data) {
|
||
|
console.log('调用了', data)
|
||
|
this.stockChoose = data
|
||
|
},
|
||
|
//选择备货
|
||
|
stockSelectionChange(e, selection) {
|
||
|
console.log('调用了', selection)
|
||
|
this.stockChoose = selection
|
||
|
},
|
||
|
cellStyleFn({
|
||
|
row,
|
||
|
column,
|
||
|
rowIndex,
|
||
|
columnIndex
|
||
|
}) {
|
||
|
console.log(row, column, rowIndex, columnIndex)
|
||
|
// return {backgroundColor: row.ISCHECK == 'Y' ? 'yellowgreen' : 'white'}
|
||
|
},
|
||
|
GetArea() {
|
||
|
this.$MyRequest('/api/storage/getArea2', {}).then(res => {
|
||
|
if (res.data.success) {
|
||
|
console.log(res.data.resultObj)
|
||
|
this.Area = res.data.resultObj
|
||
|
} else {
|
||
|
this.$showMessage(res.data.message)
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
this.$showMessage(err)
|
||
|
})
|
||
|
},
|
||
|
confirm(e) {
|
||
|
console.log(e[0].value)
|
||
|
this.AreaName = e[0].value
|
||
|
},
|
||
|
IFUserAGV(e) {
|
||
|
let value = e.detail.value[0]
|
||
|
console.log(value)
|
||
|
if (value == 'cb') {
|
||
|
this.AGVshow = true
|
||
|
} else {
|
||
|
this.AGVshow = false
|
||
|
}
|
||
|
},
|
||
|
GetLiberaryBaeIn() {
|
||
|
//发送请求
|
||
|
this.$MyRequest('/api/ApiQuery', {
|
||
|
queryId: "GetLibraryBaseIn",
|
||
|
version: "00001",
|
||
|
params: {}
|
||
|
}).then(res => {
|
||
|
for (let i = 0; i < res.data.data.length; i++) {
|
||
|
var _Arr = res.data.data[i];
|
||
|
this.items_In.push({
|
||
|
text: _Arr.LABEL,
|
||
|
value: _Arr.VALUE
|
||
|
});
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
this.$showMessage(err)
|
||
|
})
|
||
|
},
|
||
|
GetLiberaryBaeEn() {
|
||
|
//发送请求
|
||
|
this.$MyRequest('/api/ApiQuery', {
|
||
|
queryId: "GetLibraryBaseIn",
|
||
|
version: "00002",
|
||
|
params: {}
|
||
|
}).then(res => {
|
||
|
for (let i = 0; i < res.data.data.length; i++) {
|
||
|
var _Arr = res.data.data[i];
|
||
|
this.items_En.push({
|
||
|
text: _Arr.LABEL,
|
||
|
value: _Arr.VALUE
|
||
|
});
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
this.$showMessage(err)
|
||
|
})
|
||
|
},
|
||
|
/**
|
||
|
* 入库审核
|
||
|
*/
|
||
|
FGStockIn() {
|
||
|
console.log(this.commitDate)
|
||
|
if (this.stockChoose.length > 0) {
|
||
|
this.loading = true;
|
||
|
let ISAGV = this.AGVshow ? "TRUE" : "FALSE"
|
||
|
let MATERIALPACKINGNAMELIST = this.stockChoose.map(item => {
|
||
|
item.AREANAME = this.AREANAME
|
||
|
item.FLAG = "OUT"
|
||
|
item.OUTDESTINATION = this.AREANAME
|
||
|
item.ISAGV = ISAGV
|
||
|
item.INITILATION = this.INITILATION
|
||
|
item.ENDING = this.ENDING
|
||
|
item.AB = this.AB
|
||
|
item.TRANSPORTCOMMANDTYPE = "OUT"
|
||
|
item.PORT= this.outPort
|
||
|
item.DURABLENAME= item.TRAYNAME
|
||
|
// item.WIDTH = ""
|
||
|
// item.DIAMETER = ""
|
||
|
// item.DEVIATION = ""
|
||
|
// item.WEIGHT = ""
|
||
|
// item.PRODUCTLINE = ""
|
||
|
// item.SHIPREOUESTNAME = ""
|
||
|
|
||
|
return item;
|
||
|
})
|
||
|
this.$MyRequest('/MaturationLibrary/AutoStockOut', {
|
||
|
SITENAME:"SDK",
|
||
|
userId: this.userId,
|
||
|
AREANAME:this.AREANAME,
|
||
|
aimAreaName:"",
|
||
|
outProt:'',
|
||
|
erpLocation:"",
|
||
|
erpFactory:"",
|
||
|
locationName:"",
|
||
|
barCode:"",
|
||
|
// durableName:"102238",
|
||
|
shipRequestName:"",
|
||
|
commitDate : this.commitDate,
|
||
|
MATERIALPACKINGNAME:MATERIALPACKINGNAMELIST
|
||
|
}).then(res => {
|
||
|
if (res.data.success) {
|
||
|
this.loading = false;
|
||
|
this.resetValue();
|
||
|
this.$showMessage(res.data.message)
|
||
|
this.list_detail = [];
|
||
|
} else {
|
||
|
this.loading = false;
|
||
|
this.$showMessage(res.data.message)
|
||
|
this.list_detail = [];
|
||
|
}
|
||
|
}).catch(err => {
|
||
|
this.loading = false;
|
||
|
this.$showMessage(err)
|
||
|
});
|
||
|
} else {
|
||
|
this.$showMessage("请选择出库列表!")
|
||
|
}
|
||
|
},
|
||
|
|
||
|
resetValue() {
|
||
|
this.BoxListInfo = [];
|
||
|
this.RECEIVEACTNO = "";
|
||
|
},
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
<style>
|
||
|
.btn-bottom {
|
||
|
position: fixed;
|
||
|
bottom: 0;
|
||
|
width: 100%;
|
||
|
left: 0;
|
||
|
}
|
||
|
</style>
|
||
|
<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>
|