提交
This commit is contained in:
1 parent
6d9354a194
commit
aff71d296b
2759 files changed
+860425
-13211
No files matched your search
@@ -98,15 +98,8 @@
|
||||
/>
|
||||
<el-button
|
||||
v-if="selectedPlan && selectedPlan.followStatus !== 'cancelled'"
|
||||
class="btn-ghost"
|
||||
:disabled="selectedRows.length !== 1"
|
||||
@click="handleToolbarEdit"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedPlan && selectedPlan.followStatus !== 'cancelled'"
|
||||
class="btn-ghost"
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
:disabled="selectedRows.length !== 1"
|
||||
@click="handleToolbarArchive"
|
||||
>
|
||||
@@ -272,12 +265,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<PlPlanFormDialog
|
||||
v-model:visible="formDialogVisible"
|
||||
:plan-id="editingPlanId"
|
||||
@success="handlePlanMutationSuccess"
|
||||
/>
|
||||
|
||||
<PlPlanViewDialog
|
||||
ref="viewDialogRef"
|
||||
v-model:visible="viewVisible"
|
||||
@@ -288,13 +275,6 @@
|
||||
v-if="viewingPlan.followStatus !== 'cancelled'"
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
@click="handleEdit(viewingPlan)"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="viewingPlan.followStatus !== 'cancelled'"
|
||||
class="btn-ghost"
|
||||
@click="handleArchive(viewingPlan)"
|
||||
>
|
||||
<el-icon><FolderChecked /></el-icon>{{ archiveButtonLabel(viewingPlan) }}
|
||||
@@ -315,7 +295,6 @@ import ListQuickSearchInput from '@/components/business/list-quick-search-input/
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import {
|
||||
Edit,
|
||||
FolderChecked,
|
||||
RefreshLeft,
|
||||
Search
|
||||
@@ -327,7 +306,6 @@ import {
|
||||
} from '@/composables/usePlToxicProductCertCheck'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
import PlPlanArchiveDialog from '@/components/business/pl-plan-archive-dialog/index.vue'
|
||||
import PlPlanFormDialog from '@/components/business/pl-plan-form-dialog/index.vue'
|
||||
import PlPlanListCertCell from '@/components/business/pl-plan-list-cert-cell/index.vue'
|
||||
import PlPlanListProductCell from '@/components/business/pl-plan-list-product-cell/index.vue'
|
||||
import PlPlanViewDialog from '@/components/business/pl-plan-view-dialog/index.vue'
|
||||
@@ -349,8 +327,6 @@ import { useMenuStore } from '@/store/modules/menu'
|
||||
|
||||
const menuStore = useMenuStore()
|
||||
const loading = ref(false)
|
||||
const formDialogVisible = ref(false)
|
||||
const editingPlanId = ref('')
|
||||
const viewVisible = ref(false)
|
||||
const viewPlanId = ref('')
|
||||
const viewDialogRef = ref<InstanceType<typeof PlPlanViewDialog>>()
|
||||
@@ -541,11 +517,6 @@ function archiveButtonLabel(row: Plan) {
|
||||
return row.archiveStatus === 'archived' ? '调整' : '归档'
|
||||
}
|
||||
|
||||
function handleEdit(row: Plan) {
|
||||
editingPlanId.value = row.id
|
||||
formDialogVisible.value = true
|
||||
}
|
||||
|
||||
async function handleArchive(row: Plan) {
|
||||
if (row.archiveStatus === 'archived') {
|
||||
archivePlanId.value = row.id
|
||||
@@ -578,11 +549,6 @@ async function handleArchive(row: Plan) {
|
||||
archiveDialogVisible.value = true
|
||||
}
|
||||
|
||||
function handleToolbarEdit() {
|
||||
if (selectedRows.value.length !== 1) return
|
||||
handleEdit(selectedRows.value[0])
|
||||
}
|
||||
|
||||
function handleToolbarArchive() {
|
||||
if (selectedRows.value.length !== 1) return
|
||||
handleArchive(selectedRows.value[0])
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
<PlPlanListProductCell :products="row.products" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="220">
|
||||
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="280">
|
||||
<template #default="{ row }">
|
||||
<PlPlanListCertCell
|
||||
:products="row.products"
|
||||
|
||||
@@ -478,9 +478,13 @@ async function refreshViewIfOpen() {
|
||||
await viewDialogRef.value?.reload()
|
||||
}
|
||||
|
||||
async function handlePlanMutationSuccess() {
|
||||
async function handlePlanMutationSuccess(payload?: { planId?: string; openArrange?: boolean }) {
|
||||
await fetchData()
|
||||
await refreshViewIfOpen()
|
||||
if (payload?.openArrange && payload.planId) {
|
||||
arrangePlanId.value = payload.planId
|
||||
arrangeDialogVisible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const selectedPlan = computed(() => (selectedRows.value.length === 1 ? selectedRows.value[0] : null))
|
||||
@@ -626,11 +630,20 @@ function handleEdit(row: Plan) {
|
||||
formDialogVisible.value = true
|
||||
}
|
||||
|
||||
function isIoPlanFrozen(row: Plan) {
|
||||
return (
|
||||
row.transportStatus === 'arranged' &&
|
||||
(row.planType === 'inbound' || row.planType === 'outbound')
|
||||
)
|
||||
}
|
||||
|
||||
function canEditPlan(row: Plan) {
|
||||
if (isIoPlanFrozen(row)) return false
|
||||
return row.archiveStatus !== 'archived' && row.followStatus !== 'cancelled'
|
||||
}
|
||||
|
||||
function canArrangeTransport(row: Plan) {
|
||||
if (isIoPlanFrozen(row)) return false
|
||||
return (
|
||||
(row.transportStatus === 'pending' || row.transportStatus === 'arranged') &&
|
||||
row.archiveStatus !== 'archived' &&
|
||||
@@ -692,7 +705,7 @@ async function handleDelete(row: Plan) {
|
||||
async function handleVoid(row: Plan) {
|
||||
const hint =
|
||||
row.transportStatus === 'arranged'
|
||||
? '作废后将取消运输安排、作废关联地磅出入库单,司机链接将提示计划已作废。是否继续?'
|
||||
? '作废后将取消运输安排、作废关联入库/出库单与地磅出入库单,现场链接将失效。是否继续?'
|
||||
: '确认作废该运输计划吗?作废后将无法恢复。'
|
||||
await ElMessageBox.confirm(hint, '作废运输计划', { type: 'warning' })
|
||||
voidLoading.value = true
|
||||
|
||||
Reference in new issue
Block a user