@@ -1485,6 +1485,27 @@ function closeEditor() {
} )
}
async function resetCreateForm ( ) {
if ( saving . value ) return
if ( editorDirty . value ) {
try {
await ElMessageBox . confirm ( '确认清空当前填写的订单内容并恢复默认值?' , '重置订单' , {
type : 'warning' ,
confirmButtonText : '确认重置' ,
cancelButtonText : '继续填写' ,
} )
} catch ( error ) {
if ( error === 'cancel' || error === 'close' ) return
throw error
}
}
editingId . value = undefined
replaceForm ( emptyDraft ( ) )
await autofillWarehouseSelections ( )
resetEditorValidation ( )
await router . replace ( { name : 'first-leg-order-create' } )
}
function addCargoItem ( ) {
form . items . push ( createEmptyCargoItem ( ` new-cargo- ${ ++ cargoSequence } ` ) )
resetEditorValidation ( )
@@ -2134,8 +2155,8 @@ async function searchOrders(model: QueryModel) {
< FirstLegOrderEditorShell v-model = "editorOpen" :page="isCreatePage" :title="editingId ? '编辑订单草稿' : (routeCopySourceId ? '复制订单' : '创建订单')" :before-close="requestCloseEditor" @back="closeEditor" >
< el -form ref = "orderFormRef" v-loading = "isCreatePage && supportingDataLoading" :model="form" :rules="orderFormRules" label-position="top" class="order-form prototype-order-form" :class="{ 'is-dialog-order-form': !isCreatePage }" scroll -to -error >
< section class = "order-form-section prototype-section" >
< div class = "order-section-heading" > < div > < h3 > 客户下单 < / h3 > < p > 先选择货物如何送到国内收货仓 , 并填写本次运输安排 。 < / p > < / div > < / div >
< section class = "order-form-section prototype-section order-basic-section " >
< div class = "order-section-heading" > < div > < h3 > 客户下单 < / h3 > < p > 创建新订单 < / p > < / div > < / div >
< div class = "prototype-form-flow shipping-form-flow" >
< el-form-item label = "履约类型" prop = "fulfillmentType" required class = "prototype-form-row prototype-form-row--tabs" > < el-radio-group v-model = "form.fulfillmentType" class="segmented-options" @change="changeFulfillmentType"><el-radio-button value="STANDARD">普通头程</el-radio-button><el-radio-button value="ONE_CLICK_DROPSHIP">一件代发</el-radio-button></el-radio-group><small v-if="form.fulfillmentType === 'ONE_CLICK_DROPSHIP'" class="field-guidance" > 测量完成后不办理国内库存入库 , 将直接推送 PDA 合托 。 < / small > < / el -form -item >
< el-form-item v-if = "form.fulfillmentType === 'ONE_CLICK_DROPSHIP'" label="LX入库单号" prop="lxCode" class="prototype-form-row prototype-form-row--wide"><el-input v-model="form.lxCode" maxlength="128" placeholder="请输入LX入库单号" /><small class="field-guidance" > 用于绑定领星入库单 , 提交后可在尾程订单 、 入库单和出库单中查询 。 < / small > < / el -form -item >
@@ -2271,7 +2292,7 @@ async function searchOrders(model: QueryModel) {
< / div >
< / section >
< / el-form >
< template # footer > < div class = "editor-actions" > < el-button :disabled = "saving" @click ="closeEditor" > 返回 < / el -button > < el-button v-if = "editingId ? canEditOrder : canCreateOrder" :loading="saving" @click="saveDraft">保存草稿</el-button><el-button v-if="auth.hasPermission('order:first-leg:submit')" type="primary" :loading="saving" @click="submitOrder"><Send :size="16" / > { { companySubmissionBlocked ? '提交前需完成资料审核' : '提交订单' } } < / el-button > < / div > < / template >
< template # footer > < div class = "editor-actions" > < el-button v-if = "isCreatePage" :disabled= "saving" @click="resetCreateForm"><RotateCcw :size="16" />重置</el-button><el-button v-else :disabled="saving" @click="closeEditor">返回</el-button><el-button v-if= "editingId ? canEditOrder : canCreateOrder" :loading="saving" @click="saveDraft">保存草稿</el-button><el-button v-if="auth.hasPermission('order:first-leg:submit')" type="primary" :loading="saving" @click="submitOrder"><Send :size="16" / > { { companySubmissionBlocked ? '提交前需完成资料审核' : '提交订单' } } < / el-button > < / div > < / template >
< / FirstLegOrderEditorShell >
< el-dialog v-model = "batchImportOpen" title="Excel 批量创建订单草稿" width="680px" destroy -on -close append -to -body >
@@ -2528,8 +2549,22 @@ async function searchOrders(model: QueryModel) {
. is - create - route { gap : 0 ; }
. is - create - route . first - leg - editor - page { width : 100 % ; }
. is - create - route . supporting - data - error , . is - create - route > . el - alert { margin - bottom : 14 px ; }
. is - create - route . prototype - order - form { width : 100 % ; margin : 0 ; padding : 0 0 16 px ; }
. is - create - route . prototype - section : not ( . cargo - section ) : not ( . cost - estimate - section ) : not ( . destination - section ) { width : min ( 100 % , 900 px ) ; }
. is - create - route . prototype - order - form { display : grid ; width : 100 % ; grid - template - columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; align - items : stretch ; gap : 16 px ; margin : 0 ; padding : 0 0 16 px ; }
. is - create - route . prototype - section { min - width : 0 ; margin : 0 ; padding : 0 24 px 24 px ; border : 1 px solid # dfe6ee ; border - radius : 8 px ; background : # fff ; }
. is - create - route . prototype - section + . prototype - section { margin - top : 0 ; }
. is - create - route . order - basic - section , . is - create - route . destination - section { height : 100 % ; }
. is - create - route . cargo - section , . is - create - route . cost - estimate - section { grid - column : 1 / - 1 ; }
. is - create - route . order - section - heading { min - height : 66 px ; align - items : center ; margin : 0 - 24 px 22 px ; padding : 15 px 24 px ; border - bottom : 1 px solid # e7ecf2 ; }
. is - create - route . order - section - heading h3 , . is - create - route . prototype - section : first - child > . order - section - heading h3 { margin : 0 ; color : var ( -- navy ) ; font - size : 17 px ; font - weight : 700 ; }
. is - create - route . order - section - heading p { margin - top : 4 px ; color : # 8 a98a8 ; }
. is - create - route . prototype - form - flow , . is - create - route . destination - form - flow { width : 100 % ; max - width : none ; }
. is - create - route . prototype - form - row , . is - create - route . prototype - form - row -- wide , . is - create - route . prototype - form - row -- compact , . is - create - route . prototype - form - row -- short , . is - create - route . prototype - form - row -- tabs { grid - template - columns : 120 px minmax ( 0 , 1 fr ) ; }
. is - create - route . prototype - form - row : deep ( . el - form - item _ _label ) { padding - right : 18 px ; font - size : 13 px ; }
. is - create - route . segmented - options , . is - create - route . destination - type - options { width : 100 % ; max - width : 560 px ; background : # f3f6f9 ; }
. is - create - route . compact - transport - grid { width : 100 % ; margin - top : 4 px ; }
. is - create - route . compact - transport - grid > : deep ( . el - form - item ) , . is - create - route . compact - transport - grid > : deep ( . el - form - item : nth - child ( 1 ) ) , . is - create - route . compact - transport - grid > : deep ( . el - form - item : nth - child ( 6 ) ) , . is - create - route . compact - transport - grid > : deep ( . el - form - item : nth - child ( 7 ) ) { grid - template - columns : 120 px minmax ( 0 , 1 fr ) ; }
. is - create - route . selected - destination { width : auto ; margin - left : 138 px ; }
. is - create - route . cargo - table - heading , . is - create - route . cost - estimate - section . order - section - heading { margin - bottom : 16 px ; }
. order - form { width : min ( 100 % , 1000 px ) ; margin : 0 ; padding : 0 0 12 px ; }
. order - form . is - dialog - order - form { width : 100 % ; max - width : none ; }
. is - dialog - order - form > . cargo - section , . is - dialog - order - form > . cost - estimate - section { width : 100 % ; max - width : none ; }
@@ -2604,6 +2639,7 @@ async function searchOrders(model: QueryModel) {
. compact - transport - grid : deep ( . el - form - item _ _label ) { color : # 4 d5a6c ; font - size : 13 px ; }
. shipping - form - flow { max - width : 900 px ; }
. prototype - order - form > . prototype - section : first - child { width : 100 % ; }
. is - create - route . prototype - order - form > . prototype - section : first - child > . order - section - heading { margin - top : 0 ; }
. shipping - form - flow . prototype - form - row { margin - bottom : 10 px ; }
. shipping - form - flow . prototype - form - row -- tabs { margin - bottom : 12 px ; }
. compact - transport - grid { display : grid ; width : 100 % ; grid - template - columns : 1 fr ; gap : 0 ; margin : 6 px 0 0 ; }