feat:添加模具出库模块
parent
3f17d6317f
commit
e3dec8568e
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getMoldGetPage(params = {}) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getMoldGetDetail(id) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/get',
|
||||
method: 'get',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function createMoldGet(data) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/create',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMoldGet(data) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/update',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMoldGetStatus(id, status) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/update-status',
|
||||
method: 'put',
|
||||
params: { id, status }
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteMoldGet(ids = []) {
|
||||
return request({
|
||||
url: '/admin-api/erp/stock-out/delete',
|
||||
method: 'delete',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
export function getWarehouseSimpleList() {
|
||||
return request({
|
||||
url: '/admin-api/erp/warehouse/simple-list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getSimpleUserList() {
|
||||
return request({
|
||||
url: '/admin-api/system/user/simple-list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<view class="page-container">
|
||||
<view class="fixed-header">
|
||||
<AppTitleHeader :title="t('moldGet.detailTitle')" />
|
||||
</view>
|
||||
<view class="content-section">
|
||||
<view class="info-card">
|
||||
<view class="card-title">{{ t('moldGet.basicInfo') }}</view>
|
||||
<view class="info-list">
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.outNo') }}</text>
|
||||
<text class="info-value">{{ textValue(detail.no) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.outType') }}</text>
|
||||
<text class="info-value">{{ textValue(detail.outType) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.outTime') }}</text>
|
||||
<text class="info-value">{{ dateTimeLabel(detail.outTime) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.warehouse') }}</text>
|
||||
<text class="info-value">{{ textValue(detail.warehouseName) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.creator') }}</text>
|
||||
<text class="info-value">{{ textValue(detail.creatorName) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">{{ t('moldGet.status') }}</text>
|
||||
<text class="info-value">{{ statusLabel(detail.status) }}</text>
|
||||
</view>
|
||||
<view class="info-row remark-row">
|
||||
<text class="info-label">{{ t('moldGet.remark') }}</text>
|
||||
<text class="info-value remark-value">{{ textValue(detail.remark) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tabs-card">
|
||||
<u-tabs :list="tabList" :current="currentTab" :is-scroll="false" activeColor="#1a3a5c" @change="onTabChange" />
|
||||
<view v-if="currentTab === 0" class="item-wrap">
|
||||
<view v-if="!items.length" class="empty">{{ t('moldGet.noItems') }}</view>
|
||||
<view v-for="(item, index) in items" :key="index" class="item-card">
|
||||
<view class="item-head">{{ textValue(item.productName) }}</view>
|
||||
<view class="item-row">
|
||||
<text class="item-label">{{ t('moldGet.moldCode') }}</text>
|
||||
<text class="item-value">{{ textValue(item.productCode || item.productBarCode) }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="item-label">{{ t('moldGet.count') }}</text>
|
||||
<text class="item-value">{{ textValue(item.count) }}</text>
|
||||
</view>
|
||||
<view class="item-row">
|
||||
<text class="item-label">{{ t('moldGet.itemRemark') }}</text>
|
||||
<text class="item-value">{{ textValue(item.remark) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import AppTitleHeader from '@/components/common/AppTitleHeader.vue'
|
||||
import { getMoldGetDetail } from '@/api/mes/moldget'
|
||||
import { useDict } from '@/utils/dict'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { erp_audit_status } = useDict('erp_audit_status')
|
||||
|
||||
const detail = ref({})
|
||||
const items = ref([])
|
||||
const currentTab = ref(0)
|
||||
const tabList = ref([{ name: t('moldGet.itemListTitle') }])
|
||||
|
||||
function textValue(v) {
|
||||
if (v === 0) return '0'
|
||||
if (v === null || v === undefined) return '-'
|
||||
const s = String(v).trim()
|
||||
return s || '-'
|
||||
}
|
||||
|
||||
function dateTimeLabel(v) {
|
||||
if (!v) return '-'
|
||||
const d = new Date(Number(v))
|
||||
if (Number.isNaN(d.getTime())) return textValue(v)
|
||||
const p = (n) => String(n).padStart(2, '0')
|
||||
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`
|
||||
}
|
||||
|
||||
function statusLabel(status) {
|
||||
const hit = (erp_audit_status.value || []).find((s) => String(s.value) === String(status))
|
||||
return hit ? hit.label : textValue(status)
|
||||
}
|
||||
|
||||
function onTabChange(e) {
|
||||
const idx = e && typeof e === 'object' ? e.index : e
|
||||
currentTab.value = Number(idx || 0)
|
||||
}
|
||||
|
||||
async function loadDetail(id) {
|
||||
const res = await getMoldGetDetail(id)
|
||||
const data = res?.data || {}
|
||||
detail.value = data
|
||||
items.value = Array.isArray(data.items) ? data.items : []
|
||||
}
|
||||
|
||||
onLoad(async (query) => {
|
||||
const id = query?.id
|
||||
if (!id) {
|
||||
uni.showToast({ title: t('functionCommon.noIdView'), icon: 'none' })
|
||||
return
|
||||
}
|
||||
try {
|
||||
await loadDetail(id)
|
||||
} catch (e) {
|
||||
uni.showToast({ title: t('functionCommon.loadFailed'), icon: 'none' })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.fixed-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
}
|
||||
.content-section {
|
||||
padding: 0 24rpx 24rpx;
|
||||
}
|
||||
.info-card,
|
||||
.tabs-card {
|
||||
margin-top: 20rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 28rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.tabs-card {
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.card-title {
|
||||
font-size: 32rpx;
|
||||
color: #1a3a5c;
|
||||
font-weight: 700;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
.info-list {
|
||||
background: #ffffff;
|
||||
}
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
padding: 18rpx 0;
|
||||
border-bottom: 1rpx solid #edf0f3;
|
||||
}
|
||||
.info-label {
|
||||
font-size: 27rpx;
|
||||
color: #8a9099;
|
||||
width: 220rpx;
|
||||
}
|
||||
.info-value {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
color: #303133;
|
||||
line-height: 1.45;
|
||||
}
|
||||
.remark-row {
|
||||
border-bottom: none;
|
||||
}
|
||||
.remark-value {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.item-wrap {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
.item-card {
|
||||
background: #f8fafc;
|
||||
border-radius: 12rpx;
|
||||
padding: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.item-head {
|
||||
font-size: 26rpx;
|
||||
color: #1a3a5c;
|
||||
font-weight: 700;
|
||||
}
|
||||
.item-row {
|
||||
margin-top: 10rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.item-label {
|
||||
color: #909399;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
.item-value {
|
||||
color: #303133;
|
||||
font-size: 22rpx;
|
||||
max-width: 65%;
|
||||
text-align: right;
|
||||
}
|
||||
.empty {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
padding: 24rpx 0;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue