<template>
|
<view>
|
<view>
|
<u-table font-size="25">
|
<u-tr>
|
<u-td>
|
<xfl-select :list="UserArray" :initValue="this.$UserTool.UserInfo.userName" :clearable="false" :disabled="true">
|
</xfl-select>
|
</u-td>
|
<u-td width="25%">现在时间:</u-td>
|
<u-td width="25%">{{DateTime}}</u-td>
|
</u-tr>
|
</u-table>
|
</view>
|
<view style="padding: 20rpx 0rpx">
|
<u-table>
|
<u-tr>
|
<u-td width="25%">呼叫数量</u-td>
|
<u-td width="50%" >
|
<u-input type="number" v-model="EmptyTrayNum" :border="true" placeholder="请输入呼叫数量,默认1"></u-input>
|
</u-td>
|
<u-td width="25%">
|
<u-button type="primary" @click="Save">呼叫</u-button>
|
</u-td>
|
</u-tr>
|
</u-table>
|
</view>
|
<view style="padding: 0rpx 0rpx">
|
<!-- <text class="u-text-left">出库任务列表:每页{{pageSize}}条,共{{total}}条</text> -->
|
<u-table font-size="22">
|
<u-tr style="height: 50px;">
|
<u-th class="tdth" width="10%">序列</u-th>
|
<u-th class="tdth" width="25%">托盘号</u-th>
|
<u-th class="tdth" width="25%">货位号</u-th>
|
<u-th class="tdth" width="20%">执行状态</u-th>
|
<u-th class="tdth" width="20%">操作</u-th>
|
</u-tr>
|
<u-tr style="height: 50px;" v-for="(item,index) in TaskArray" @click.native="TableItemCheck(item)">
|
<!-- @dblclick.native="TableItemCheck(item)" -->
|
<u-td width="10%">{{index+1}}</u-td><!-- {{(current-1)*pageSize+(index+1)}} -->
|
<u-td width="25%">{{item.barcode}}</u-td>
|
<u-td width="25%">{{item.locationId}}</u-td>
|
<u-td width="20%">{{item.state}}</u-td>
|
<u-td width="20%"><u-button style="height: 25px;width: 55px;" class="deleteBtn" type="primary" @click="CancelTask(index)">取消</u-button></u-td>
|
</u-tr>
|
</u-table>
|
</view>
|
<uni-pagination @change="handlePage" :total="total" :pageSize="pageSize" :current="current">
|
</uni-pagination>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
var _this;
|
var _user;
|
export default {
|
data() {
|
return {
|
DateTime: '',
|
CurrentUser: '', //当前用户
|
EmptyTrayNum: '', //空托盘数
|
total: 0,
|
pageSize: 10,
|
current: 1,
|
TaskArray: []
|
}
|
},
|
methods: {
|
|
//取消某一个空托盘出库
|
CancelTask(index){
|
uni.showModal({
|
title: '提示',
|
content: '确认要取消该条呼叫记录吗?',
|
success: function(res) {
|
if (res.confirm) {
|
var task = _this.TaskArray[index];
|
let data = {
|
mainData:
|
{
|
"barcode": task.barcode
|
}
|
};
|
_this.$AjaxRequest.Params('post', 'Dt_taskinfo/CancelATask', data, _user
|
.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
|
uni.showToast({
|
title: "取消成功!",
|
duration: 2000
|
});
|
|
_this.$AjaxRequest.Params('post', 'Dt_taskinfo/GetEmptyPalletTaskList', data, _user
|
.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
_this.TaskArray = result.data.data;
|
} else {
|
|
}
|
}).catch(function(err) {
|
|
});
|
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: "请求错误:" + result.data.message,
|
duration: 2000
|
});
|
}
|
}).catch(function(err) {
|
uni.showToast({
|
icon: 'none',
|
title: "请求后台异常,错误信息." + err.errMsg,
|
duration: 2000
|
});
|
});
|
}else if (res.cancel) {}
|
}
|
});
|
},
|
|
setTimer() {
|
if (this.timer == null) {
|
this.timer = setInterval(() => {
|
this.DateTime = this.$DateTool.getDate();
|
}, 1000)
|
}
|
},
|
Save() {
|
if ('' == _this.EmptyTrayNum) {
|
// uni.showToast({
|
// icon: 'none',
|
// title: "请输入呼叫数量",
|
// duration: 2000
|
// });
|
// return;
|
_this.EmptyTrayNum = 1;
|
}
|
|
uni.showModal({
|
title: '提示',
|
content: '确认要呼叫该数量的空托盘吗?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
mainData:
|
{
|
"callNumber": _this.EmptyTrayNum
|
}
|
};
|
_this.$AjaxRequest.Params('post', 'VV_ContainerInfo_EmptyPallet/CallEmptyPallet', data, _user
|
.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
uni.showToast({
|
title: "呼叫成功!",
|
duration: 2000
|
});
|
|
_this.$AjaxRequest.Params('post', 'Dt_taskinfo/GetEmptyPalletTaskList', data, _user
|
.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
_this.TaskArray = result.data.data;
|
} else {
|
|
}
|
}).catch(function(err) {
|
|
});
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: "请求错误:" + result.data.message,
|
duration: 2000
|
});
|
}
|
}).catch(function(err) {
|
uni.showToast({
|
icon: 'none',
|
title: "请求后台异常,错误信息." + err.errMsg,
|
duration: 2000
|
});
|
});
|
}else if (res.cancel) {}
|
}
|
});
|
}
|
},
|
created: function() {
|
//this.date = this.$DateTool.getDate();
|
// 每次进入界面时,先清除之前的所有定时器,然后启动新的定时器
|
clearInterval(this.timer)
|
this.timer = null;
|
this.setTimer();
|
_user = this.$UserTool.UserInfo;
|
this.CurrentUser = _user.userName;
|
this.UserArray = [this.$UserTool.AllUserInfo];
|
|
this.$AjaxRequest.Params('post', 'Dt_taskinfo/GetEmptyPalletTaskList', null, _user
|
.token);
|
this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
_this.TaskArray = result.data.data;
|
} else {
|
|
}
|
}).catch(function(err) {
|
|
});
|
},
|
destroyed: function() {
|
// 每次离开当前界面时,清除定时器
|
clearInterval(this.timer);
|
this.timer = null;
|
},
|
mounted() {
|
_this = this;
|
|
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.tdHeight {
|
height: 80rpx;
|
}
|
</style>
|