|
|
|
|
@ -86,7 +86,20 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item :label="t('ErpStock.Pallet.unit')" prop="unit">
|
|
|
|
|
<el-input v-model="formData.unit" :placeholder="t('ErpStock.Pallet.placeholderUnit')" />
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.unit"
|
|
|
|
|
clearable
|
|
|
|
|
filterable
|
|
|
|
|
:placeholder="t('ErpStock.Pallet.placeholderUnit')"
|
|
|
|
|
class="!w-1/1"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="unit in unitList"
|
|
|
|
|
:key="unit.id"
|
|
|
|
|
:label="unit.name"
|
|
|
|
|
:value="unit.name"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
@ -359,6 +372,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
|
|
|
|
|
import { WarehouseAreaApi, WarehouseAreaVO } from '@/api/erp/stock/warehousearea'
|
|
|
|
|
import { ProductApi, ProductVO } from '@/api/erp/product/product'
|
|
|
|
|
import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit'
|
|
|
|
|
import QrcodeActionCard from '@/components/QrcodeActionCard/index.vue'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'PalletForm' })
|
|
|
|
|
@ -374,6 +388,7 @@ const formRef = ref()
|
|
|
|
|
const warehouseOptions = ref<WarehouseVO[]>([])
|
|
|
|
|
const areaOptions = ref<WarehouseAreaVO[]>([])
|
|
|
|
|
const productList = ref<ProductVO[]>([])
|
|
|
|
|
const unitList = ref<ProductUnitVO[]>([])
|
|
|
|
|
const selectedWarehouse = ref<WarehouseVO | undefined>()
|
|
|
|
|
const selectedArea = ref<WarehouseAreaVO | undefined>()
|
|
|
|
|
|
|
|
|
|
@ -406,7 +421,7 @@ const formData = ref<PalletVO>({
|
|
|
|
|
palletType: undefined,
|
|
|
|
|
specification: undefined,
|
|
|
|
|
ratedLoadWeight: undefined,
|
|
|
|
|
unit: 'kg',
|
|
|
|
|
unit: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
warehouseId: undefined,
|
|
|
|
|
areaId: undefined,
|
|
|
|
|
@ -450,7 +465,7 @@ const open = async (type: string, row?: PalletVO) => {
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
resetForm()
|
|
|
|
|
await Promise.all([getWarehouseOptions(), getAreaOptions(), getProductList()])
|
|
|
|
|
await Promise.all([getWarehouseOptions(), getAreaOptions(), getProductList(), getUnitList()])
|
|
|
|
|
if (type === 'update' && row) {
|
|
|
|
|
formData.value = {
|
|
|
|
|
...row,
|
|
|
|
|
@ -500,6 +515,10 @@ const getProductList = async () => {
|
|
|
|
|
productList.value = await ProductApi.getProductSimpleList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getUnitList = async () => {
|
|
|
|
|
unitList.value = await ProductUnitApi.getProductUnitSimpleList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const buildPrintData = () => {
|
|
|
|
|
return {
|
|
|
|
|
id: formData.value.id,
|
|
|
|
|
@ -670,7 +689,7 @@ const resetForm = () => {
|
|
|
|
|
palletType: undefined,
|
|
|
|
|
specification: undefined,
|
|
|
|
|
ratedLoadWeight: undefined,
|
|
|
|
|
unit: 'kg',
|
|
|
|
|
unit: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
warehouseId: undefined,
|
|
|
|
|
areaId: undefined,
|
|
|
|
|
|