refactor: 合并原库房客户端到主WMS服务,退役8891端口
1. 将bj_power_wms_client的前端代码、配置及网关逻辑全部迁移到bj_power_wms主项目 2. 删除原库房客户端相关的所有文件与配置 3. 更新README与部署文档,说明合并后的服务架构 4. 新增Web配置项支持自动打开浏览器开关,统一服务端口为8890
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
<script setup>
|
||||
defineOptions({ name: 'Ledger' })
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import request from '../utils/request'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import { helpLedger } from '../help'
|
||||
|
||||
const orderNo = ref('')
|
||||
const materialCode = ref('')
|
||||
const materialName = ref('')
|
||||
const status = ref('')
|
||||
const loading = ref(false)
|
||||
const queried = ref(false)
|
||||
const rows = ref([])
|
||||
const total = ref(0)
|
||||
const page = reactive({ current: 1, size: 20 })
|
||||
|
||||
function gapOf(row) {
|
||||
return Math.max((row.totalQty || 0) - (row.outQty || 0), 0)
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await request.get('/ledger/query', {
|
||||
params: {
|
||||
orderNo: orderNo.value.trim() || undefined,
|
||||
materialCode: materialCode.value.trim() || undefined,
|
||||
materialName: materialName.value.trim() || undefined,
|
||||
status: status.value || undefined,
|
||||
page: page.current,
|
||||
pageSize: page.size
|
||||
}
|
||||
})
|
||||
rows.value = data?.list || []
|
||||
total.value = data?.total || 0
|
||||
queried.value = true
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function search() {
|
||||
page.current = 1
|
||||
load()
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
|
||||
// 展示状态由「已出库 vs 需求总量」实时派生,不再直接展示表内"进行中":
|
||||
// 领料完结(缺口=0) / 部分领料(有出库、缺口>0) / 待领料(未出过库)
|
||||
function statusView(row) {
|
||||
if (row.status === '领料完结') return { text: '领料完结', type: 'success' }
|
||||
if ((row.outQty || 0) > 0) return { text: '部分领料', type: 'primary' }
|
||||
return { text: '待领料', type: 'info' }
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-card shadow="never" class="mb12">
|
||||
<el-form inline @submit.prevent="search">
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="orderNo" placeholder="工单号(可空,查全部)" clearable
|
||||
style="width:200px" @keyup.enter="search" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="materialCode" placeholder="物料编码(可空)" clearable
|
||||
style="width:160px" @keyup.enter="search" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="materialName" placeholder="物料名称(可空)" clearable
|
||||
style="width:160px" @keyup.enter="search" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="status" placeholder="全部" clearable style="width:130px" @change="search">
|
||||
<el-option label="待领料" value="待领料" />
|
||||
<el-option label="部分领料" value="部分领料" />
|
||||
<el-option label="领料完结" value="领料完结" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="loading" @click="search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card v-if="queried" shadow="never">
|
||||
<template #header>
|
||||
工单备料台账(共 {{ total }} 条)
|
||||
</template>
|
||||
<el-table :data="rows" border v-loading="loading" empty-text="暂无台账数据">
|
||||
<el-table-column prop="id" label="ID" width="64" align="center" />
|
||||
<el-table-column prop="orderNo" label="工单号" min-width="150" />
|
||||
<el-table-column prop="materialCode" label="物料编码" min-width="140" />
|
||||
<el-table-column prop="materialName" label="物料名称" min-width="160">
|
||||
<template #default="{ row }">{{ row.materialName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalQty" label="需求总量" width="100" align="center" />
|
||||
<el-table-column prop="outQty" label="已出库" width="90" align="center" />
|
||||
<el-table-column label="缺口" width="90" align="center">
|
||||
<template #default="{ row }">{{ gapOf(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="statusView(row).type" size="small">{{ statusView(row).text }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="140">
|
||||
<template #default="{ row }">{{ row.remark || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="165" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, prev, pager, next" :total="total"
|
||||
:current-page="page.current" :page-size="page.size"
|
||||
@current-change="(p) => { page.current = p; load() }" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card v-else shadow="never">
|
||||
<el-skeleton :rows="6" animated />
|
||||
</el-card>
|
||||
</div>
|
||||
<PageHelp :data="helpLedger" page="Ledger" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mb12 { margin-bottom: 12px; }
|
||||
.pager { display: flex; justify-content: flex-end; margin-top: 10px; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user