ERP:采购入库 100%

pull/379/MERGE
YunaiV 2024-02-12 16:51:18 +08:00
parent 3d4feeff6b
commit 57044cb716
6 changed files with 38 additions and 59 deletions

View File

@ -37,9 +37,9 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应商" prop="customerId">
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="formData.customerId"
v-model="formData.supplierId"
clearable
filterable
disabled
@ -47,7 +47,7 @@
class="!w-1/1"
>
<el-option
v-for="item in customerList"
v-for="item in supplierList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -55,24 +55,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售人员" prop="purchaseUserId">
<el-select
v-model="formData.purchaseUserId"
clearable
filterable
placeholder="请选择销售人员"
class="!w-1/1"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="备注" prop="remark">
<el-input
@ -111,7 +93,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="款优惠" prop="discountPrice">
<el-form-item label="款优惠" prop="discountPrice">
<el-input
disabled
v-model="formData.discountPrice"
@ -155,13 +137,13 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本次收款" prop="payPrice">
<el-form-item label="本次付款" prop="refundPrice">
<el-input-number
v-model="formData.payPrice"
v-model="formData.refundPrice"
controls-position="right"
:min="0"
:precision="2"
placeholder="请输入本次款"
placeholder="请输入本次款"
class="!w-1/1"
/>
</el-form-item>
@ -177,10 +159,10 @@
</Dialog>
<!-- 可入库的订单列表 -->
<!-- <PurchaseOrderInEnableList-->
<!-- ref="purchaseOrderInEnableListRef"-->
<!-- @success="handlePurchaseOrderChange"-->
<!-- />-->
<PurchaseOrderInEnableList
ref="purchaseOrderInEnableListRef"
@success="handlePurchaseOrderChange"
/>
</template>
<script setup lang="ts">
import { PurchaseInApi, PurchaseInVO } from '@/api/erp/purchase/in'
@ -188,9 +170,10 @@ import PurchaseInItemForm from './components/PurchaseInItemForm.vue'
// import { CustomerApi, CustomerVO } from '@/api/erp/purchase/customer'
import { AccountApi, AccountVO } from '@/api/erp/finance/account'
import { erpPriceInputFormatter, erpPriceMultiply } from '@/utils'
// import PurchaseOrderInEnableList from '@/views/erp/purchase/order/components/PurchaseOrderInEnableList.vue'
import PurchaseOrderInEnableList from '@/views/erp/purchase/order/components/PurchaseOrderInEnableList.vue'
import { PurchaseOrderVO } from '@/api/erp/purchase/order'
import * as UserApi from '@/api/system/user'
import { SupplierApi } from '@/api/erp/purchase/supplier'
/** ERP 销售入库表单 */
defineOptions({ name: 'PurchaseInForm' })
@ -204,9 +187,8 @@ const formLoading = ref(false) // 表单的加载中1修改时的数据加
const formType = ref('') // create - update - detail -
const formData = ref({
id: undefined,
customerId: undefined,
supplierId: undefined,
accountId: undefined,
purchaseUserId: undefined,
inTime: undefined,
remark: undefined,
fileUrl: '',
@ -214,19 +196,19 @@ const formData = ref({
discountPrice: 0,
totalPrice: 0,
otherPrice: 0,
payPrice: undefined,
refundPrice: undefined,
orderNo: undefined,
items: [],
no: undefined //
})
const formRules = reactive({
customerId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }],
payPrice: [{ required: true, message: '本次款不能为空', trigger: 'blur' }]
refundPrice: [{ required: true, message: '本次款不能为空', trigger: 'blur' }]
})
const disabled = computed(() => formType.value === 'detail')
const formRef = ref() // Ref
const customerList = ref<CustomerVO[]>([]) //
const supplierList = ref<CustomerVO[]>([]) //
const accountList = ref<AccountVO[]>([]) //
const userList = ref<UserApi.UserVO[]>([]) //
@ -246,13 +228,13 @@ watch(
const discountPrice =
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0
// debugger
// TODO payPrice
// const payPrice = totalPrice - discountPrice + val.otherPrice
// TODO refundPrice
// const refundPrice = totalPrice - discountPrice + val.otherPrice
//
formData.value.discountPrice = discountPrice
formData.value.totalPrice = totalPrice - discountPrice
// val.payPrice = payPrice
// formData.value.payPrice = payPrice
// val.refundPrice = refundPrice
// formData.value.refundPrice = refundPrice
},
{ deep: true }
)
@ -273,7 +255,7 @@ const open = async (type: string, id?: number) => {
}
}
//
customerList.value = await CustomerApi.getCustomerSimpleList()
supplierList.value = await SupplierApi.getSupplierSimpleList()
//
userList.value = await UserApi.getSimpleUserList()
//
@ -295,9 +277,8 @@ const handlePurchaseOrderChange = (order: PurchaseOrderVO) => {
//
formData.value.orderId = order.id
formData.value.orderNo = order.no
formData.value.customerId = order.customerId
formData.value.supplierId = order.supplierId
formData.value.accountId = order.accountId
formData.value.purchaseUserId = order.purchaseUserId
formData.value.discountPercent = order.discountPercent
formData.value.remark = order.remark
formData.value.fileUrl = order.fileUrl
@ -340,9 +321,8 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: undefined,
customerId: undefined,
supplierId: undefined,
accountId: undefined,
purchaseUserId: undefined,
inTime: undefined,
remark: undefined,
fileUrl: undefined,
@ -350,7 +330,7 @@ const resetForm = () => {
discountPrice: 0,
totalPrice: 0,
otherPrice: 0,
payPrice: undefined,
refundPrice: undefined,
items: []
}
formRef.value?.resetFields()

View File

@ -221,13 +221,13 @@
/>
<el-table-column label="待收金额" align="center">
<template #default="scope">
{{ erpPriceInputFormatter(scope.row.payPrice + scope.row.debtPrice) }}
{{ erpPriceInputFormatter(scope.row.refundPrice + scope.row.debtPrice) }}
</template>
</el-table-column>
<el-table-column
label="本次款"
label="本次款"
align="center"
prop="payPrice"
prop="refundPrice"
:formatter="erpPriceTableColumnFormatter"
/>
<el-table-column label="本次欠款" align="center" prop="debtPrice">

View File

@ -81,7 +81,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="款优惠" prop="discountPrice">
<el-form-item label="款优惠" prop="discountPrice">
<el-input
disabled
v-model="formData.discountPrice"

View File

@ -1,7 +1,7 @@
<!-- 可入库的订单列表 -->
<template>
<Dialog
title="选择销售订单(仅展示可入库)"
title="选择采购订单(仅展示可入库)"
v-model="dialogVisible"
:appendToBody="true"
:scroll="true"
@ -92,7 +92,7 @@
<el-table-column
label="入库数量"
align="center"
prop="outCount"
prop="inCount"
:formatter="erpCountTableColumnFormatter"
/>
<el-table-column
@ -122,7 +122,6 @@
</template>
</Dialog>
</template>
<script lang="ts" setup>
import { ElTable } from 'element-plus'
import { PurchaseOrderApi, PurchaseOrderVO } from '@/api/erp/purchase/order'
@ -142,7 +141,7 @@ const queryParams = reactive({
no: undefined,
productId: undefined,
orderTime: [],
outEnable: true
inEnable: true
})
const queryFormRef = ref() //
const productList = ref<ProductVO[]>([]) //

View File

@ -1,7 +1,7 @@
<!-- 可退货的订单列表 -->
<template>
<Dialog
title="选择销售订单(仅展示可退货)"
title="选择采购订单(仅展示可退货)"
v-model="dialogVisible"
:appendToBody="true"
:scroll="true"
@ -92,7 +92,7 @@
<el-table-column
label="入库数量"
align="center"
prop="outCount"
prop="inCount"
:formatter="erpCountTableColumnFormatter"
/>
<el-table-column

View File

@ -95,9 +95,9 @@
class="!w-240px"
/>
</el-form-item>
<el-form-item label="入库数量" prop="outStatus">
<el-form-item label="入库数量" prop="inStatus">
<el-select
v-model="queryParams.outStatus"
v-model="queryParams.inStatus"
placeholder="请选择入库数量"
clearable
class="!w-240px"
@ -305,7 +305,7 @@ const queryParams = reactive({
status: undefined,
remark: undefined,
creator: undefined,
outStatus: undefined,
inStatus: undefined,
returnStatus: undefined
})
const queryFormRef = ref() //