baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
+605
@@ -0,0 +1,605 @@
|
||||
<template>
|
||||
<view class="main-wrapper">
|
||||
<view style="margin: 0 20rpx 20rpx 20rpx;">
|
||||
<view class="header-top1">
|
||||
<!--<view v-if="pageKey==='detail'" class="header-top-back" @click="backToMain">-->
|
||||
<!-- <!– 返回箭頭–>-->
|
||||
<!-- <image-->
|
||||
<!-- src="../../../static/img/arrow.svg"-->
|
||||
<!-- class="img"-->
|
||||
<!-- @click="scanEvent"-->
|
||||
<!-- ></image>-->
|
||||
<!-- 当前配送任务-->
|
||||
<!--</view>-->
|
||||
<view class="header-top-back"></view>
|
||||
|
||||
<view class="header-top-organzie1" style="">
|
||||
<text class="header-row-title-class1">当前组织:</text>
|
||||
<view class="header-top-organzie-select1">
|
||||
<picker
|
||||
@change="orgChange"
|
||||
:value="index"
|
||||
:range="orgArry"
|
||||
range-key="FNAME"
|
||||
style="width: 100%"
|
||||
>
|
||||
<view class="header-top-organzie-content1">
|
||||
{{ orgArry[index] ? orgArry[index].FNAME : "" }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<image
|
||||
class="header-top-organzie-img1"
|
||||
src="@/static/img/changearrow.svg"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="pageKey === 'detail'" style="margin: 0 20rpx 20rpx 20rpx;">
|
||||
<view class="detail-content-header">
|
||||
<view>当前任务: {{currentTasks.length}}</view>
|
||||
<view>
|
||||
<image
|
||||
src="../../../static/img/refresh.svg"
|
||||
class="img"
|
||||
@click="getTaskList"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view v-for="(item, index) in currentTasks" class="current-task-item" :key="index">
|
||||
<view class="current-task-item-top">
|
||||
<view class="current-task-item-left">
|
||||
<view v-if="item.status === '已送达'" style="color: #7f91bb">已送达</view>
|
||||
<view v-else :style="item.timeMatch === 'no' ? 'color: #9ab603' : 'color: #d9001b'">
|
||||
{{secToInfo(item.timeInfo) + (item.timeMatch === 'no' ? '未超时' : ' 已超时')}}
|
||||
</view>
|
||||
<view style="font-size: 40rpx">叫料单: {{item.FBILLNO}}</view>
|
||||
</view>
|
||||
<view class="current-task-item-right">
|
||||
<view style="color: #7f7f7f">{{item.FBILLTYPENAME}}</view>
|
||||
<!--<view :class="item.FRESPONSE === 4 ? 'current-task-item-right-button' : 'current-task-item-right-button-disabled'">送达</view>-->
|
||||
<!-- 4 代表已送达; 响应状态0=待响应;1=驳回;2=备料;3=配送;4=送达-->
|
||||
<!--<view v-if="item.FRESPONSE === 4" class="current-task-item-right-button" style="background-color: #aaaaaa">送达</view>-->
|
||||
<view :class="item.status === '已送达' ? 'current-task-item-right-button-disabled' : 'current-task-item-right-button'" @click="taskSend(item,'single')">送达</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="display: flex">
|
||||
<view style="min-width: 200rpx;">{{item.FWORKSHOPNAME ? item.FWORKSHOPNAME : '-' }}</view>
|
||||
<view style="min-width: 200rpx;">资源编号: {{item.FWORKRESOURCENAME ? item.FWORKRESOURCENAME : '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="button" v-if="pageKey==='detail'">
|
||||
<!-- 清除已送达任务 刷新一下就可以了-->
|
||||
<view class="item" style="background-color: #fff" @click="getTaskList">清除已送达任务</view>
|
||||
<view class="item" style="color:#fff;background-color: #5778ff" @click="taskSend">一键送达</view>
|
||||
</view>
|
||||
|
||||
<opsoft-dialog-notice
|
||||
:dialogNoticeShow="showErrorDialog"
|
||||
:dialogNoticeType="dialogNoticeType"
|
||||
:dialogNoticeTitle="dialogNoticeTitle"
|
||||
:dialogNoticeContent="dialogNoticeContent"
|
||||
@dialogNoticeConfirmClick="showErrorDialog = false"
|
||||
/>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 当前配送任务列表
|
||||
export default {
|
||||
name: "CurerentPeiSong",
|
||||
data() {
|
||||
return {
|
||||
// org about
|
||||
orgArry: [],
|
||||
index: 0,
|
||||
orgFItemID: "",
|
||||
pageKey: "detail",
|
||||
// 当前配送任务
|
||||
currentTasks: [
|
||||
// 清空 测试数据
|
||||
// {
|
||||
// timeInfo: 3000, // 秒
|
||||
// FBILLNO: 'FB2019080假数据',
|
||||
// bomInfo: 'BOM内叫料-假数据',
|
||||
// workShopNo: '车间1产线3',
|
||||
// resourceNo: '0001',
|
||||
// },
|
||||
// {
|
||||
// timeInfo: 3200,
|
||||
// FBILLNO: 'FB201908020002',
|
||||
// bomInfo: 'BOM内叫料',
|
||||
// workShopNo: '车间1产线3',
|
||||
// resourceNo: '0001',
|
||||
// }
|
||||
],
|
||||
showErrorDialog: false,
|
||||
dialogNoticeType: 'error', // or success
|
||||
dialogNoticeTitle: '异常提示',
|
||||
dialogNoticeContent: 'content',
|
||||
// 定时器
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getOrgList();
|
||||
// this.getTaskList();
|
||||
setTimeout(() => {
|
||||
clearInterval(this.timer);
|
||||
}, 1000*60*30);
|
||||
},
|
||||
onShow() {
|
||||
// 页面从后台进入时触发
|
||||
this.getOrgList();
|
||||
this.getTaskList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
methods: {
|
||||
getOrgList() {
|
||||
let _self = this
|
||||
let orgInfo = uni.getStorageSync("orgInfo")
|
||||
|
||||
if (orgInfo && orgInfo.length > 0) {
|
||||
let defaultOrgInfo = uni.getStorageSync("defaultOrgInfo")
|
||||
let isOpenDefaultOrg = uni.getStorageSync("isOpenDefaultOrg")
|
||||
if (!isOpenDefaultOrg) {
|
||||
this.orgFItemID = orgInfo[0].FINTERID
|
||||
} else {
|
||||
if (defaultOrgInfo) {
|
||||
this.orgFItemID = defaultOrgInfo.FINTERID
|
||||
} else {
|
||||
this.orgFItemID = orgInfo[0].FINTERID
|
||||
}
|
||||
}
|
||||
|
||||
this.orgArry = orgInfo
|
||||
this.orgArry.forEach(function (el, index) {
|
||||
let currentOrgid = el.FINTERID
|
||||
let result = currentOrgid == _self.orgFItemID
|
||||
if (result) {
|
||||
_self.index = index
|
||||
el.FNAME = el.FNAME ? el.FNAME : "无"
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.orgArry = [
|
||||
{ name: "请选择组织", key: "", FNAME: "当前无组织" },
|
||||
]
|
||||
this.index = 0
|
||||
}
|
||||
},
|
||||
|
||||
orgChange(e) {
|
||||
this.isChangedOrg = true
|
||||
this.index = e.target.value
|
||||
let isOpenDefaultOrg = uni.getStorageSync("isOpenDefaultOrg")
|
||||
if (!this.orgArry[this.index].FINTERID) {
|
||||
this.orgFItemID = ""
|
||||
} else {
|
||||
this.orgFItemID = this.orgArry[this.index].FINTERID
|
||||
if (isOpenDefaultOrg) {
|
||||
uni.setStorageSync(
|
||||
"defaultOrgInfo",
|
||||
this.orgArry[this.index]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
this.getTaskList();
|
||||
|
||||
// let cashValue = uni.getStorageSync(
|
||||
// "pageCash" +
|
||||
// this.dbAlise +
|
||||
// this.userName +
|
||||
// this.currentTranType +
|
||||
// this.orgFItemID
|
||||
// )
|
||||
// if (cashValue) {
|
||||
// this.loadByCash()
|
||||
// } else {
|
||||
// this.getDeptInfo()
|
||||
// this.getSupplierInfo()
|
||||
// this.getCustomerInfo()
|
||||
// this.orgChangedClear()
|
||||
// }
|
||||
//
|
||||
// this.$refs.bluetoothPrintTab.orgId = this.orgFItemID
|
||||
},
|
||||
backToMain() {
|
||||
this.pageKey = "main"
|
||||
},
|
||||
// 只会收到未送达的 单据
|
||||
getTaskList() {
|
||||
// api 文档: https://www.tapd.cn/36031001/markdown_wikis/show/#1136031001001000968
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
mask:true
|
||||
})
|
||||
this.$request
|
||||
.post("/CallMaterial/GetCallBillInfo", {
|
||||
BillNo: undefined, // 叫料单号
|
||||
MoBillNo: undefined, // 工单号;生产任务单号
|
||||
WorkShop: undefined, // 车间号
|
||||
CompanyId: this.orgFItemID, // 组织号
|
||||
IsSend: true, // 固定true
|
||||
type: 2
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading();
|
||||
console.log(res)
|
||||
let data = res;
|
||||
if (data.length === 0 ) {
|
||||
uni.showToast({
|
||||
title: "暂无数据",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
data.forEach(function (el, index) {
|
||||
// template 里要显示的
|
||||
// el.bomInfo = el.FBILLTYPEID === 1 ? "BOM内叫料" : "BOM外叫料";
|
||||
|
||||
// 当前时间 和 当前单据下物料的用料时间比较
|
||||
el.secArr = [];
|
||||
el.Entries.forEach(function (el2, index2) {
|
||||
el.secArr.push(new Date(el2.FUSEDATE).getTime());
|
||||
})
|
||||
|
||||
console.log('el.secArr', el.secArr)
|
||||
|
||||
// let temp = el.secArr.fitler((item)=>{
|
||||
// return typeof item === 'number'
|
||||
// })
|
||||
// 时间差 秒
|
||||
el.timeInfo = Number(((Math.min(...el.secArr) - new Date().getTime())/1000).toFixed(0));
|
||||
// 大于0的代表没超时
|
||||
console.log("%c" + el.timeInfo, "font-size: 70px;color: red");
|
||||
// if(Math.abs(el.timeInfo) < 10) {
|
||||
// // 没超时
|
||||
// el.timeMatch = 'no'
|
||||
// } else
|
||||
if ((el.timeInfo) > 0) {
|
||||
// 没超时
|
||||
el.timeMatch = 'no'
|
||||
} else {
|
||||
el.timeMatch = 'yes'
|
||||
el.timeInfo = Math.abs(el.timeInfo)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
this.currentTasks = data;
|
||||
this.changeTimeBySec();
|
||||
}).catch((err) => {
|
||||
uni.hideLoading();
|
||||
console.log(err)
|
||||
this.showErrorDialog = true;
|
||||
this.dialogNoticeType = "error";
|
||||
this.dialogNoticeTitle = "异常提示";
|
||||
this.dialogNoticeContent = err.toString();
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 倒计时
|
||||
*/
|
||||
changeTimeBySec() {
|
||||
clearInterval(this.timer)
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.currentTasks.forEach(function (el, index) {
|
||||
// el.timeInfo--;
|
||||
if (el.timeMatch === 'yes') {
|
||||
// 超时了, 只会越来越大
|
||||
el.timeInfo ++;
|
||||
} else {
|
||||
el.timeInfo --
|
||||
if (el.timeInfo <= 0) {
|
||||
el.timeMatch = 'no'
|
||||
el.timeInfo = -el.timeInfo
|
||||
}
|
||||
}
|
||||
})
|
||||
},1000)
|
||||
},
|
||||
/**
|
||||
* 秒 转换为 时分秒 等显示信息
|
||||
*/
|
||||
secToInfo(sec) {
|
||||
// let hour = Math.floor(sec / 3600);
|
||||
// 一天 24*60*60 秒
|
||||
let day = (sec / (24 * 60 * 60)).toFixed(0);
|
||||
let hour = Math.floor((sec - day * 24 * 60 * 60) / 3600).toFixed(0);
|
||||
let min = Math.floor((sec - day * 24 * 60 * 60 - hour * 3600) / 60).toFixed(0);
|
||||
let sec2 = Math.floor(sec - day * 24 * 60 * 60 - hour * 3600 - min * 60).toFixed(0);
|
||||
if (day > 0) {
|
||||
return day + "天" + hour + "小时" + min + "分" + sec2 + "秒";
|
||||
} else if (hour > 0) {
|
||||
return hour + "小时" + min + "分" + sec2 + "秒";
|
||||
} else if (min > 0) {
|
||||
return min + "分" + sec2 + "秒";
|
||||
} else {
|
||||
return sec2 + "秒";
|
||||
}
|
||||
},
|
||||
taskSend(item, type) {
|
||||
let billArr = [];
|
||||
console.log(item.status)
|
||||
if (item.status === '已送达') {
|
||||
return
|
||||
}
|
||||
if ( type === 'single' && item.FBILLNO ) {
|
||||
billArr.push(item.FBILLNO)
|
||||
|
||||
} else {
|
||||
// 一键送达
|
||||
billArr = this.currentTasks.map(el => el.FBILLNO)
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
mask:true
|
||||
})
|
||||
this.$request
|
||||
.post("/CallMaterial/SendTo", billArr)
|
||||
.then((res) => {
|
||||
uni.hideLoading();
|
||||
console.log(res)
|
||||
let data = res;
|
||||
|
||||
this.showErrorDialog = true;
|
||||
this.dialogNoticeType = "success";
|
||||
this.dialogNoticeTitle = "成功提示";
|
||||
this.dialogNoticeContent = res;
|
||||
|
||||
// 单个送达
|
||||
if (item) {
|
||||
item.status = '已送达'
|
||||
console.log(item.status)
|
||||
} else {
|
||||
this.getTaskList();
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
uni.hideLoading();
|
||||
console.log(err)
|
||||
this.showErrorDialog = true;
|
||||
this.dialogNoticeType = "error";
|
||||
this.dialogNoticeTitle = "异常提示";
|
||||
this.dialogNoticeContent = err.toString();
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main-wrapper {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
// 底部按钮
|
||||
.button {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
.item {
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
color: #666666;
|
||||
//width: 100%
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.table-tag-header {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
align-items: center;
|
||||
|
||||
.scan-header-item {
|
||||
flex-grow: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
color: #666666;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
.scan-header-blue-text {
|
||||
color: #0000ff;
|
||||
border-bottom: 1px solid #0000ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scan {
|
||||
.scan-header2 {
|
||||
// 已录条码明细
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
.text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.scan-button {
|
||||
background-color: #3241c4;
|
||||
padding: 0 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.detail-content-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10rpx 40rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 2px solid #e8e8e8;
|
||||
.img {
|
||||
width:40rpx;
|
||||
height:40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.current-task-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
//justify-content: space-between;
|
||||
//align-items: center;
|
||||
background-color: #f2f2f2;
|
||||
padding: 10rpx 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
//border-bottom: 2px solid #e8e8e8;
|
||||
.current-task-item-top {
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.current-task-item-left {
|
||||
flex-grow: 4;
|
||||
}
|
||||
|
||||
.current-task-item-right {
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
flex-direction: column;
|
||||
text-align: right;
|
||||
flex-grow: 1;
|
||||
.current-task-item-right-button, .current-task-item-right-button-disabled {
|
||||
border-radius: 10rpx;
|
||||
font-size: 34rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background-color: #169bd5;
|
||||
}
|
||||
|
||||
.current-task-item-right-button-disabled {
|
||||
background-color: #aaaaaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.header-top1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.header-top-back {
|
||||
//align-content: flex-start;
|
||||
align-self: flex-start;
|
||||
font-size: 32rpx;
|
||||
font-family: MicrosoftYaHei;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666666;
|
||||
.img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
vertical-align: middle;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
.header-top-organzie1 {
|
||||
display: flex;
|
||||
// justify-content: flex-end;
|
||||
align-items: center;
|
||||
// padding-right: 50rpx;
|
||||
|
||||
.header-row-title-class1 {
|
||||
font-size: 32rpx;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.header-top-organzie-select1 {
|
||||
min-width: 100rpx;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
.header-top-organzie-content1 {
|
||||
font-size: 32rpx;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.header-top-organzie-img1 {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.input-content-label {
|
||||
width: 200rpx;
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
text-align: right;
|
||||
}
|
||||
.input-content-picker {
|
||||
flex-grow:1;
|
||||
margin-left: 20rpx;
|
||||
border: 1px solid gray;
|
||||
border-radius: 12rpx;
|
||||
.show-box {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.input-content-input {
|
||||
flex-grow:1;
|
||||
border: 1px solid gray;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-left: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
height: 60rpx;
|
||||
|
||||
.asd {
|
||||
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user