You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

236 lines
5.5 KiB

<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<view class="top_card">
<view class="top_wrap" v-if="datacontent">
<view class="top_card">
<view class="device-detail">
<view class="list-style nopad">
<view class="ljh_box nopad">
<view class="tit_ljh uni-flex">
<text class="font_xl text_black text_bold">申请单号 : {{datacontent.number}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px">
<view class="detail-list " v-for="(item, index) in details" :key="index">
<view class="detail-content">
<view class="" style="">
<view class="uni-flex uni-row u-col-center">
<view class="" style="margin-top: 20rpx; margin-left: 10rpx; font-weight: bold;">
({{index+1}}).
</view>
<comItemCode :itemData="item"></comItemCode>
</view>
<uni-table border stripe style="">
<uni-tr>
<uni-td align="center">单件码</uni-td>
<uni-td>{{item.singleCodeRequest}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">单位</uni-td>
<uni-td>{{item.uom}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">标包数</uni-td>
<uni-td>{{item.stdPackQty}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">数量</uni-td>
<uni-td>
<view class="uni-flex uni-row">
<view class="uni-flex uni-row space-between" style="width: 100%;">
<view class="">
{{item.qty}}
</view>
<view class="">
</view>
</view>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</scroll-view>
<div class="new_bot_box">
<view class="new_btn_bot bot_pos uni-flex">
<button v-if="datacontent.requestStatus==1||datacontent.requestStatus==5" class="new_save_btn "
style="width: 100%; margin-right: 10rpx;" @click="cancel()">取消</button>
<button v-if="datacontent.requestStatus==9" class="new_save_btn "
style="width: 100%; margin-left: 10rpx;" @click="finish()">完成</button>
</view>
</div>
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage>
</view>
</template>
<script>
import {
getThirdLocationRequestDetail,
thirdLocationRequestFinish,
thirdLocationRequestCancel
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
navigateBack
} from '@/common/basic.js';
import comItemCode from '@/mycomponents/comItem/comItemCode.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
export default {
components: {
comMessage,
comJobScanDetail,
comItemCode
},
data() {
return {
id: "",
datacontent: {},
details: [],
jobStatus: "",
}
},
onLoad(param) {
this.id = param.id;
this.getDetail();
},
//返回首页
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
//加载零件信息
getDetail() {
uni.showLoading({
title: "加载中",
mask: false
})
let that = this;
getThirdLocationRequestDetail(that.id)
.then(item => {
uni.hideLoading()
console.log('item', item);
that.datacontent = item;
that.jobStatus = item.jobStatus
that.details = item.details;
})
.catch(err => {
uni.hideLoading()
this.showMessage('未查找到详细信息')
});
},
getScanCount() {
this.scanCount = this.datacontent.details.filter(r => r.scaned).length;
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
finish() {
showConfirmMsg("是否确认完成?", callback => {
if (callback) {
uni.showLoading({
title: "加载中",
mask: true
})
thirdLocationRequestFinish(this.datacontent.id).then(res => {
uni.hideLoading()
if (res.error) {
this.showMessage("完成失败" + res.error.message)
} else {
uni.showToast({
title: "完成成功"
})
navigateBack(1)
}
}).catch(error => {
uni.hideLoading()
this.showMessage("完成失败" + error)
})
}
})
},
cancel() {
showConfirmMsg("是否确认取消?", callback => {
if (callback) {
uni.showLoading({
title: "加载中",
mask: true
})
thirdLocationRequestCancel(this.datacontent.id).then(res => {
uni.hideLoading()
if (res.error) {
this.showMessage("取消失败" + res.error.message)
} else {
uni.showToast({
title: "取消成功"
})
navigateBack(1)
}
}).catch(error => {
uni.hideLoading()
this.showMessage("取消失败" + error)
})
}
})
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1); //点关闭直接返回列表
uni.hideLoading();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
}
}
</script>
<style scoped lang="scss">
</style>