|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<uni-navbar-lite :showRight=false title="申请详情"></uni-navbar-lite>
|
|
|
<view class="page-container">
|
|
|
- <scroll-view class="page-content" :scroll-y="true">
|
|
|
+ <scroll-view class="page-content" :class="{ 'has-bottom-buttons': applyStatus != null && applyStatus.trim() == 'PREPARE' }" :scroll-y="true">
|
|
|
<!-- 申请单信息 -->
|
|
|
<view class="section">
|
|
|
<view class="section-header">
|
|
|
@@ -17,6 +17,10 @@
|
|
|
<text class="info-label">状态</text>
|
|
|
<text class="info-value status-text" :class="'status-' + applyStatus">{{ applyStatusText }}</text>
|
|
|
</view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">申购状态</text>
|
|
|
+ <text class="info-value status-text" :class="'purchase-status-' + purchaseStatus">{{getPurchaseStatusText(purchaseStatus)}}</text>
|
|
|
+ </view>
|
|
|
<view class="info-row">
|
|
|
<text class="info-label">申请时间</text>
|
|
|
<text class="info-value">{{ createTime }}</text>
|
|
|
@@ -49,12 +53,22 @@
|
|
|
<!-- <text class="material-spec">{{ getSpecification(item) }}</text> -->
|
|
|
</view>
|
|
|
<view class="material-detail">
|
|
|
- <view class="detail-row">
|
|
|
+ <view class="detail-row detail-row-left">
|
|
|
<text class="detail-label">数量</text>
|
|
|
<text class="detail-value quantity-value">{{ getQuantity(item) }}</text>
|
|
|
<text class="detail-value">{{ getMeasureName(item) }}</text>
|
|
|
</view>
|
|
|
- <view class="detail-row">
|
|
|
+ <view class="detail-row detail-row-right">
|
|
|
+ <text class="detail-label">已出库</text>
|
|
|
+ <text class="detail-value">{{ getQuantityOutTotal(item) }}</text>
|
|
|
+ <text class="detail-value">{{ getMeasureName(item) }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="detail-row detail-row-left">
|
|
|
+ <text class="detail-label">库存</text>
|
|
|
+ <text class="detail-value">{{ getCurrentStock(item) }}</text>
|
|
|
+ <text class="detail-value">{{ getMeasureName(item) }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="detail-row detail-row-right">
|
|
|
<text class="detail-label">状态</text>
|
|
|
<text class="detail-value status-text" :class="'line-status-' + getLineStatus(item)">{{ getLineStatusText(item) }}</text>
|
|
|
</view>
|
|
|
@@ -79,6 +93,7 @@
|
|
|
const applyId = ref<string>("")
|
|
|
const applyCode = ref<string>("")
|
|
|
const applyStatus = ref<string>("")
|
|
|
+ const purchaseStatus = ref<string>("")
|
|
|
const createTime = ref<string>("")
|
|
|
const nickName = ref<string>("")
|
|
|
const lineList = ref<UTSJSONObject[]>([])
|
|
|
@@ -91,11 +106,20 @@
|
|
|
case 'APPROVING': return '审批中'
|
|
|
case 'APPROVED': return '已审批'
|
|
|
case 'FINISHED': return '已完成'
|
|
|
+ case 'WAITOUT': return '待出库'
|
|
|
case 'CANCEL': return '已取消'
|
|
|
default: return status
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ const getPurchaseStatusText = (status: string): string => {
|
|
|
+ switch (status) {
|
|
|
+ case '0': return '未申购'
|
|
|
+ case '1': return '已申购'
|
|
|
+ default: return ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const getItemName = (item: UTSJSONObject): string => {
|
|
|
if (item == null) return ''
|
|
|
const val = item['itemName']
|
|
|
@@ -136,10 +160,23 @@
|
|
|
case '4': return '已申请采购/出库'
|
|
|
case '5': return '已完成'
|
|
|
case '6': return '已取消'
|
|
|
+ case '7': return '部分出库'
|
|
|
default: return status
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const getQuantityOutTotal = (item: UTSJSONObject): string => {
|
|
|
+ if (item == null) return '0'
|
|
|
+ const val = item['quantityOutTotal']
|
|
|
+ return val != null ? val.toString() : '0'
|
|
|
+ }
|
|
|
+
|
|
|
+ const getCurrentStock = (item: UTSJSONObject): string => {
|
|
|
+ if (item == null) return '0'
|
|
|
+ const val = item['quantityStock']
|
|
|
+ return val != null ? val.toString() : '0'
|
|
|
+ }
|
|
|
+
|
|
|
const loadDetail = (): void => {
|
|
|
if (applyId.value.length === 0) return
|
|
|
getPurchaseApplyById(applyId.value).then((res: any) => {
|
|
|
@@ -147,6 +184,7 @@
|
|
|
const data = res["data"] as UTSJSONObject
|
|
|
applyCode.value = data['applyCode'] != null ? data['applyCode'].toString() : ''
|
|
|
applyStatus.value = data['status'] != null ? data['status'].toString() : ''
|
|
|
+ purchaseStatus.value = data['applyStatus'] != null ? data['applyStatus'].toString() : ''
|
|
|
createTime.value = data['createTime'] != null ? data['createTime'].toString() : ''
|
|
|
nickName.value = data['nickName'] != null ? data['nickName'].toString() : ''
|
|
|
const lines = data['wmPurchaseApplyLineList']
|
|
|
@@ -229,7 +267,10 @@
|
|
|
.page-content {
|
|
|
flex: 1;
|
|
|
padding: 20rpx;
|
|
|
- padding-bottom: 150rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .page-content.has-bottom-buttons {
|
|
|
+ padding-bottom: 130rpx;
|
|
|
}
|
|
|
|
|
|
.section {
|
|
|
@@ -292,7 +333,7 @@
|
|
|
&.status-CONFIRMED {
|
|
|
color: #1890ff;
|
|
|
}
|
|
|
- &.status-APPROVING {
|
|
|
+ &.status-WAITOUT {
|
|
|
color: #fa8c16;
|
|
|
}
|
|
|
&.status-APPROVED {
|
|
|
@@ -313,7 +354,7 @@
|
|
|
&.line-status-3 {
|
|
|
color: #722ed1;
|
|
|
}
|
|
|
- &.line-status-4 {
|
|
|
+ &.line-status-7 {
|
|
|
color: #fa8c16;
|
|
|
}
|
|
|
&.line-status-5 {
|
|
|
@@ -322,6 +363,14 @@
|
|
|
&.line-status-6 {
|
|
|
color: #ff4d4f;
|
|
|
}
|
|
|
+
|
|
|
+ &.purchase-status-0 {
|
|
|
+ color: #faad14;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.purchase-status-1 {
|
|
|
+ color: #52c41a;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.material-list {
|
|
|
@@ -369,11 +418,23 @@
|
|
|
|
|
|
.material-detail {
|
|
|
flex-direction: row;
|
|
|
- justify-content: space-between;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin: -8rpx;
|
|
|
}
|
|
|
|
|
|
.detail-row {
|
|
|
flex-direction: row;
|
|
|
+ width: 50%;
|
|
|
+ padding: 8rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail-row-left {
|
|
|
+ justify-content: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail-row-right {
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
.detail-label {
|