feat(web-admin): add mp plan form anchors and polish print customer pick.
Improve the page-variant plan form for WebView and align print customer selection with the mobile demo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bf81d9b77c
commit
ca0098f6ca
2 files changed
+163
-23
No files matched your search
@@ -8,8 +8,20 @@
|
||||
@update:model-value="onFormShellVisible"
|
||||
>
|
||||
<h2 v-if="isPageVariant" class="mp-plan-form-title">{{ dialogTitle }}</h2>
|
||||
<nav v-if="isPageVariant" class="mp-plan-anchor-bar">
|
||||
<button
|
||||
v-for="item in mpAnchors"
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="mp-plan-anchor"
|
||||
:class="{ active: mpActiveAnchor === item.id }"
|
||||
@click="scrollMpAnchor(item.id)"
|
||||
>
|
||||
{{ item.label }}
|
||||
</button>
|
||||
</nav>
|
||||
<div class="pl-plan-form-body">
|
||||
<section class="pl-plan-form-section">
|
||||
<section id="sec-basic" class="pl-plan-form-section">
|
||||
<h3 class="pl-plan-form-section-title">基础信息</h3>
|
||||
<el-form
|
||||
ref="basicFormRef"
|
||||
@@ -66,7 +78,7 @@
|
||||
</el-form>
|
||||
</section>
|
||||
|
||||
<section class="pl-plan-form-section">
|
||||
<section id="sec-transport" class="pl-plan-form-section">
|
||||
<h3 class="pl-plan-form-section-title">运输信息</h3>
|
||||
<el-form
|
||||
:model="formData"
|
||||
@@ -190,8 +202,9 @@
|
||||
</el-form>
|
||||
</section>
|
||||
|
||||
<section class="pl-plan-form-section">
|
||||
<section id="sec-load" class="pl-plan-form-section">
|
||||
<h3 class="pl-plan-form-section-title">装送货信息</h3>
|
||||
<div id="sec-delivery" class="mp-plan-anchor-target" aria-hidden="true" />
|
||||
<el-form :label-position="formLabelPosition" label-width="100px" class="pl-dialog-form">
|
||||
<PlPlanStopsSplitShell
|
||||
:plan-total-qty="planTotalQty"
|
||||
@@ -261,7 +274,7 @@
|
||||
</el-form>
|
||||
</section>
|
||||
|
||||
<section class="pl-plan-form-section">
|
||||
<section id="sec-remark" class="pl-plan-form-section">
|
||||
<h3 class="pl-plan-form-section-title">备注</h3>
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
</section>
|
||||
@@ -302,7 +315,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="mp-plan-form-footer dialog-footer">
|
||||
<div v-if="isPageVariant" class="mp-plan-form-footer dialog-footer">
|
||||
<el-button @click="handleCancel">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
@@ -541,6 +554,19 @@
|
||||
const isCopy = computed(() => !props.planId && !!props.copyFromPlanId)
|
||||
const isPageVariant = computed(() => props.variant === 'page')
|
||||
const formLabelPosition = computed(() => (isPageVariant.value ? 'top' : 'right'))
|
||||
const mpAnchors = [
|
||||
{ id: 'sec-basic', label: '基础' },
|
||||
{ id: 'sec-transport', label: '运输' },
|
||||
{ id: 'sec-load', label: '装货' },
|
||||
{ id: 'sec-delivery', label: '送货' },
|
||||
{ id: 'sec-remark', label: '备注' }
|
||||
]
|
||||
const mpActiveAnchor = ref('sec-basic')
|
||||
|
||||
function scrollMpAnchor(id: string) {
|
||||
mpActiveAnchor.value = id
|
||||
document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
||||
}
|
||||
const dialogTitle = computed(() => (isEdit.value ? '编辑运输计划' : '新增运输计划'))
|
||||
|
||||
const innerVisible = computed({
|
||||
@@ -2406,6 +2432,39 @@
|
||||
color: #087f57;
|
||||
}
|
||||
|
||||
.mp-plan-anchor-bar {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
overflow-x: auto;
|
||||
margin: 0 0 12px;
|
||||
padding-bottom: 2px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.mp-plan-anchor {
|
||||
flex: 0 0 auto;
|
||||
height: 30px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #dcebe4;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
font-size: 12px;
|
||||
color: #6b7b74;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mp-plan-anchor.active {
|
||||
color: #fff;
|
||||
background: #0a9f6d;
|
||||
border-color: #0a9f6d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mp-plan-anchor-target {
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mp-plan-form-page {
|
||||
:deep(.form-grid-5),
|
||||
:deep(.form-grid-4),
|
||||
@@ -2440,8 +2499,10 @@
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
|
||||
background: #f5f8f7;
|
||||
margin: 0 -4px;
|
||||
padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
|
||||
background: #fff;
|
||||
border-top: 1px solid #dcebe4;
|
||||
}
|
||||
|
||||
.pl-plan-transport-row {
|
||||
|
||||
Reference in new issue
Block a user