feat:额外收费

This commit is contained in:
dzc committed 2026-03-26 11:04:37 +08:00
1 parent f1e9c596b5
commit 1bd2ba3a8e
12 files changed
+749 -209

No files matched your search

@@ -13,12 +13,8 @@
</div>
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">经办人:</span>
<SelectHandlerUser
v-model.trim="baseDataForm.handlerUserId"
placeholder="请选择经办人"
style="width: 200px"
:isDisplayName="true"
/>
<SelectHandlerUser v-model.trim="baseDataForm.handlerUserId" placeholder="请选择经办人"
style="width: 200px" :isDisplayName="true" />
</div>
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">关联补货申请:</span>
@@ -26,7 +22,8 @@
</div>
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">货商:</span>
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px" :disabled="disabled" :isDisplayName="true" />
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px"
:disabled="disabled" :isDisplayName="true" />
</div>
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">备注:</span>
@@ -43,90 +40,65 @@
<el-input v-model="baseDataForm.ddDate" readonly style="width: 200px" :disabled="disabled" />
</el-form-item>
<el-form-item label="经办人" prop="handlerUserId">
<SelectHandlerUser
v-model.trim="baseDataForm.handlerUserId"
placeholder="请选择经办人"
style="width: 200px"
:disabled="disabled"
/>
<SelectHandlerUser v-model.trim="baseDataForm.handlerUserId" placeholder="请选择经办人"
style="width: 200px" :disabled="disabled" />
</el-form-item>
<el-form-item label="关联补货申请" prop="linkCode">
<el-input
v-model="baseDataForm.linkCode"
:suffix-icon="Search"
@click="handleClickLinkCode"
readonly
placeholder="请选择补货申请单"
style="width: 200px"
:disabled="disabled"
/>
<el-input v-model="baseDataForm.linkCode" :suffix-icon="Search" @click="handleClickLinkCode"
readonly placeholder="请选择补货申请单" style="width: 200px" :disabled="disabled" />
</el-form-item>
<el-form-item label="货商" prop="supplierId">
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px" :disabled="disabled" />
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px"
:disabled="disabled" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="baseDataForm.remark" placeholder="请输入备注" style="width: 200px" :disabled="disabled" />
<el-input v-model="baseDataForm.remark" placeholder="请输入备注" style="width: 200px"
:disabled="disabled" />
</el-form-item>
</div>
</el-form>
<el-row v-if="!disabled" class="my-3">
<el-button type="primary" plain @click="handleClickSpuSelect">商品选择</el-button>
<el-button @click="removeSelectRowEvent" :disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
<el-button @click="removeSelectRowEvent"
:disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
<el-button type="danger" plain @click="clearData">清空数据</el-button>
</el-row>
<vxe-table
ref="editableTableRef"
border
:loading="loading"
show-overflow
max-height="410"
:edit-config="{
trigger: 'click',
mode: 'cell',
beforeEditMethod({ row, column, rowIndex }:any) {
// 禁止编辑
// if (column.property === '') {
// return false
// }
if(disabled) return false
return true
},
}"
:column-config="{ resizable: true }"
:row-config="{ isHover: true }"
:resizable-config="{ dragMode: 'fixed' }"
:data="state.editableTableData"
:edit-rules="validRules"
@checkbox-all="selectChangeEvent"
@checkbox-change="selectChangeEvent"
size="mini"
align="center"
>
<vxe-table ref="editableTableRef" border :loading="loading" show-overflow max-height="410" :edit-config="{
trigger: 'click',
mode: 'cell',
beforeEditMethod({ row, column, rowIndex }: any) {
// 禁止编辑
// if (column.property === '') {
// return false
// }
if (disabled) return false
return true
},
}" :column-config="{ resizable: true }" :row-config="{ isHover: true }" :resizable-config="{ dragMode: 'fixed' }"
:data="state.editableTableData" :edit-rules="validRules" @checkbox-all="selectChangeEvent"
@checkbox-change="selectChangeEvent" size="mini" align="center">
<vxe-column type="checkbox" width="40" fixed="left" />
<vxe-column type="seq" width="50" fixed="left" />
<vxe-column field="productName" title="库存商品">
<template #default="{ row }">
<span v-if="row.productName">{{ row.productName }}</span>
<span v-else>{{ row.erpSpuId && state.erpSpuSimpleAll.find((item: any) => item.id === row.erpSpuId)?.productName }}</span>
<span v-else>{{row.erpSpuId && state.erpSpuSimpleAll.find((item: any) => item.id ===
row.erpSpuId)?.productName }}</span>
</template>
</vxe-column>
<vxe-column field="unitId" title="包装单位" :edit-render="{}">
<template #edit="{ row }">
<el-select v-model="row.unitId" placeholder="请选择包装单位">
<el-option
v-if="row.erpUnitVos?.length > 0"
v-for="item in row.erpUnitVos"
:key="item.id"
:label="item.unit"
:value="item.id"
/>
<el-option v-if="row.erpUnitVos?.length > 0" v-for="item in row.erpUnitVos" :key="item.id"
:label="item.unit" :value="item.id" />
<el-option v-else :key="row.id" :label="row.unit" :value="row.unitId" />
</el-select>
</template>
<template #default="{ row }">
<span v-if="row.unitId">{{ row.unit ?? row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.unit }}</span>
<span v-if="row.unitId">{{row.unit ?? row.erpUnitVos?.find((item: any) => item.id ==
row.unitId)?.unit }}</span>
<span v-else style="color: #c0c4cf">请选择</span>
</template>
</vxe-column>
@@ -150,7 +122,8 @@
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
</span>
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
{{displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id ==
row.unitId)?.purchasePrice) * row.quantity) }}
</span>
</template>
</vxe-column>
@@ -179,12 +152,8 @@
<!-- 商品选择对话框 -->
<select-dialog ref="erpSpuSelectDialogRef" @getSelectedRows="getSelectedRows" />
<link-code-dialog
ref="linkCodeDialogRef"
title="关联补货申请"
:getTableData="getCgsqPage"
@getSelectedLinkCode="getSelectedLinkCode"
/>
<link-code-dialog ref="linkCodeDialogRef" title="关联补货申请" :getTableData="getCgsqPage"
@getSelectedLinkCode="getSelectedLinkCode" />
</div>
</div>
</template>
@@ -403,19 +372,19 @@ const { formValidate, submitData } = useSmProcessFormAction()
const onContinueAdd = async () => {
console.log("baseDataForm", baseDataForm)
console.log("state.editableTableData", state.editableTableData)
;(await formValidate(baseDataFormRef, editableTableRef, state.editableTableData.length)) &&
(await submitData(baseDataForm, cgPlanSpuItems, loading, putObj, addObj)) &&
clearData()
; (await formValidate(baseDataFormRef, editableTableRef, state.editableTableData.length)) &&
(await submitData(baseDataForm, cgPlanSpuItems, loading, putObj, addObj)) &&
clearData()
}
// 点击保存
const onSave = async () => {
console.log("baseDataForm", baseDataForm)
console.log("state.editableTableData", state.editableTableData)
;(await formValidate(baseDataFormRef, editableTableRef, state.editableTableData.length)) &&
(await submitData(baseDataForm, cgPlanSpuItems, loading, putObj, addObj)) &&
clearData() &&
emit("close")
; (await formValidate(baseDataFormRef, editableTableRef, state.editableTableData.length)) &&
(await submitData(baseDataForm, cgPlanSpuItems, loading, putObj, addObj)) &&
clearData() &&
emit("close")
}
// 清空填写的数据 返回 true
@@ -22,7 +22,8 @@
</div> -->
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">货商:</span>
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px" :disabled="disabled" :isDisplayName="true" />
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px"
:disabled="disabled" :isDisplayName="true" />
</div>
<div style="width: 33.33%; height: 28px; line-height: 28px">
<span class="font-bold">备注:</span>
@@ -33,10 +34,12 @@
<el-form v-else ref="baseFormRef" :model="baseDataForm" :rules="dataRules" label-width="100px">
<div class="flex flex-wrap">
<el-form-item label="单据编号" prop="inventoryCode">
<el-input v-model.trim="baseDataForm.inventoryCode" readonly style="width: 200px" :disabled="disabled" />
<el-input v-model.trim="baseDataForm.inventoryCode" readonly style="width: 200px"
:disabled="disabled" />
</el-form-item>
<el-form-item label="单据日期" prop="inventoryDate">
<el-date-picker v-model="baseDataForm.inventoryDate" style="width: 200px" :disabled="disabled" value-format="YYYY-MM-DD" />
<el-date-picker v-model="baseDataForm.inventoryDate" style="width: 200px" :disabled="disabled"
value-format="YYYY-MM-DD" />
</el-form-item>
<!-- <el-form-item label="关联采购订单" prop="linkCode">
<el-input
@@ -58,10 +61,12 @@
/>
</el-form-item> -->
<el-form-item label="货商" prop="supplierId">
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px" :disabled="disabled" />
<SelectSupermarketSupplier v-model="baseDataForm.supplierId" style="width: 200px"
:disabled="disabled" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model.trim="baseDataForm.remark" placeholder="请输入备注" style="width: 200px" :disabled="disabled" />
<el-input v-model.trim="baseDataForm.remark" placeholder="请输入备注" style="width: 200px"
:disabled="disabled" />
</el-form-item>
</div>
</el-form>
@@ -72,32 +77,20 @@
<el-button type="danger" plain @click="clearData">清空数据</el-button>
</el-row>
<vxe-table
ref="vxeTableRef"
border
:loading="loading"
show-overflow
max-height="410"
:edit-config="{
trigger: 'click',
mode: 'cell',
beforeEditMethod({ row, column, rowIndex }:any) {
// 禁止编辑
// if (column.property === '') {
// return false
// }
if(disabled) return false
return true
},
}"
:column-config="{ resizable: true }"
:row-config="{ isHover: true }"
:resizable-config="{ dragMode: 'fixed' }"
:checkbox-config="{ highlight: true, range: true }"
:data="vxeTableData"
:edit-rules="validRules"
show-footer
:footer-data="[
<vxe-table ref="vxeTableRef" border :loading="loading" show-overflow max-height="410" :edit-config="{
trigger: 'click',
mode: 'cell',
beforeEditMethod({ row, column, rowIndex }: any) {
// 禁止编辑
// if (column.property === '') {
// return false
// }
if (disabled) return false
return true
},
}" :column-config="{ resizable: true }" :row-config="{ isHover: true }" :resizable-config="{ dragMode: 'fixed' }"
:checkbox-config="{ highlight: true, range: true }" :data="vxeTableData" :edit-rules="validRules"
show-footer :footer-data="[
{
seq: '合计',
quantity: total.quantity,
@@ -106,35 +99,28 @@
realPrice: `${total.realPrice}元`,
totalAmount: total.totalAmount,
},
]"
:merge-footer-items="[{ row: 0, col: 2, rowspan: 1, colspan: 4 }]"
@checkbox-all=""
@checkbox-change=""
size="mini"
align="center"
>
]" :merge-footer-items="[{ row: 0, col: 2, rowspan: 1, colspan: 4 }]" @checkbox-all="" @checkbox-change=""
size="mini" align="center">
<vxe-column type="checkbox" width="40" fixed="left" />
<vxe-column field="seq" type="seq" width="50" fixed="left" />
<vxe-column field="productName" title="库存商品">
<template #default="{ row }">
<span v-if="row.productName">{{ row.productName }}</span>
<span v-else>{{ row.erpSpuId && erpSpuSimpleAll.find((item: any) => item.id === row.erpSpuId)?.productName }}</span>
<span v-else>{{row.erpSpuId && erpSpuSimpleAll.find((item: any) => item.id ===
row.erpSpuId)?.productName }}</span>
</template>
</vxe-column>
<vxe-column field="productNature" title="商品性质">
<template #default="{ row }">
{{ supermarket_nature.find((item: any) => item.value == row.productNature)?.label || "" }}
{{supermarket_nature.find((item: any) => item.value == row.productNature)?.label || ""}}
</template>
</vxe-column>
<vxe-column field="selectedUnitObj" title="包装单位" :edit-render="{}">
<template #edit="{ row }">
<el-select v-model="row.selectedUnitObj" value-key="id" placeholder="请选择包装单位" @change="onUnitChange(row)">
<el-option
v-for="item in row.erpUnitVos"
:key="item.id"
:label="item.spec ? item.unit + '-' + item.spec : item.unit"
:value="item"
/>
<el-select v-model="row.selectedUnitObj" value-key="id" placeholder="请选择包装单位"
@change="onUnitChange(row)">
<el-option v-for="item in row.erpUnitVos" :key="item.id"
:label="item.spec ? item.unit + '-' + item.spec : item.unit" :value="item" />
</el-select>
</template>
<template #default="{ row }">
@@ -148,14 +134,10 @@
</vxe-column>
<vxe-column field="quantity" title="数量" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
<template #edit="{ row, $rowIndex }">
<el-input-number
v-if="row.productNature == '1'"
v-model="row.quantity"
:min="0"
:precision="0"
@change="onQuantityChange(row, $rowIndex)"
/>
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2" @change="onQuantityChange(row, $rowIndex)" />
<el-input-number v-if="row.productNature == '1'" v-model="row.quantity" :min="0" :precision="0"
@change="onQuantityChange(row, $rowIndex)" />
<el-input-number v-else v-model="row.quantity" :min="0" :precision="2"
@change="onQuantityChange(row, $rowIndex)" />
</template>
</vxe-column>
<vxe-column field="retailPrice" title="零售价" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
@@ -190,13 +172,8 @@
{{ row?.selectedUnitObj?.totalAmount }}
</template>
<template #edit="{ row, $rowIndex }">
<el-input-number
v-if="row.selectedUnitObj"
v-model="row.selectedUnitObj.totalAmount"
:min="0"
:precision="2"
@change="onTotalAmountChange(row, $rowIndex)"
/>
<el-input-number v-if="row.selectedUnitObj" v-model="row.selectedUnitObj.totalAmount" :min="0"
:precision="2" @change="onTotalAmountChange(row, $rowIndex)" />
</template>
<template #footer="{ row }">
<span style="color: #2e5cf6; font-weight: bold">{{ total.totalAmount }}元</span>
@@ -433,19 +410,19 @@ const { formValidate, submitData } = useSmProcessFormAction()
const onContinueAdd = async () => {
console.log("baseDataForm", baseDataForm)
console.log("vxeTableData.value", vxeTableData.value)
;(await formValidate(baseFormRef, vxeTableRef, vxeTableData.value.length)) &&
(await submitData(baseDataForm, settledTableItems.value, loading, putObj, addObj)) &&
clearData()
; (await formValidate(baseFormRef, vxeTableRef, vxeTableData.value.length)) &&
(await submitData(baseDataForm, settledTableItems.value, loading, putObj, addObj)) &&
clearData()
}
// 点击保存
const onSave = async () => {
console.log("baseDataForm", baseDataForm)
console.log("vxeTableData.value", vxeTableData.value)
;(await formValidate(baseFormRef, vxeTableRef, vxeTableData.value.length)) &&
(await submitData(baseDataForm, settledTableItems.value, loading, putObj, addObj)) &&
clearData() &&
emit("close")
; (await formValidate(baseFormRef, vxeTableRef, vxeTableData.value.length)) &&
(await submitData(baseDataForm, settledTableItems.value, loading, putObj, addObj)) &&
clearData() &&
emit("close")
}
// 清空数据