feat(pl): 购买证运输证改为客户品类额度并支持齐备完善。
按客户与证用品类自动选证,未配置生效时间拦住安排;齐备仅放行安排,归档前须完善挂证,并补充迁移与测试造数脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
aad74505c0
commit
cd94ebc56d
31 files changed
+2835
-39
No files matched your search
@@ -0,0 +1,78 @@
|
||||
<!-- 运输证件规则切点 — 系统信息 Tab;P01 简表单 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">运输证件规则</h2>
|
||||
</div>
|
||||
<div class="p-6 max-w-xl">
|
||||
<p class="text-sm text-slate-500 mb-4">
|
||||
配置「客户+品类」额度生效时间。未配置时无法安排运输。计划创建时按该时间打规则版本;修改后只影响之后新建的计划。
|
||||
</p>
|
||||
<el-form label-position="top" class="dialog-form-layout">
|
||||
<el-form-item label="客户品类额度生效时间">
|
||||
<el-date-picker
|
||||
v-model="effectiveAt"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择生效时间"
|
||||
class="w-full"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="saving" @click="save">
|
||||
<el-icon><Check /></el-icon>保存
|
||||
</el-button>
|
||||
<el-button :loading="loading" @click="load">
|
||||
<el-icon><Refresh /></el-icon>刷新
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<p v-if="!configured" class="text-amber-600 text-sm">当前未配置:运输计划安排将被拦住。</p>
|
||||
<p v-else class="text-emerald-700 text-sm">已配置生效时间:{{ effectiveAt }}</p>
|
||||
</el-form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { certQuotaRuleApi } from '@/api/pl/quota-cert'
|
||||
import { Check, Refresh } from '@element-plus/icons-vue'
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const effectiveAt = ref<string | null>(null)
|
||||
const configured = ref(false)
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await certQuotaRuleApi.get()
|
||||
effectiveAt.value = data?.effectiveAt || null
|
||||
configured.value = Boolean(data?.configured)
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error?.message || '加载失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function save() {
|
||||
saving.value = true
|
||||
try {
|
||||
const data = await certQuotaRuleApi.save(effectiveAt.value)
|
||||
effectiveAt.value = data?.effectiveAt || null
|
||||
configured.value = Boolean(data?.configured)
|
||||
ElMessage.success(configured.value ? '已保存生效时间' : '已清空生效时间(安排将被拦住)')
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error?.message || '保存失败')
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load()
|
||||
})
|
||||
</script>
|
||||
Reference in new issue
Block a user