| | |
| | | <el-dialog |
| | | v-model="isShow" |
| | | title="新增采购退货" |
| | | width="1600" |
| | | width="70%" |
| | | top="3vh" |
| | | @close="closeModal" |
| | | class="purchase-return-dialog" |
| | | > |
| | | <el-form label-width="140px" :model="formState" label-position="top" ref="formRef" :inline="true"> |
| | | <div class="section-title"> |
| | |
| | | <el-option label="拒收" :value="1" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="发货类型" |
| | | prop="shippingType" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: '请选择发货类型', |
| | | trigger: 'change', |
| | | } |
| | | ]" |
| | | > |
| | | <el-select |
| | | v-model="formState.shippingType" |
| | | placeholder="请选择发货类型" |
| | | style="width: 240px" |
| | | @change="handleShippingTypeChange" |
| | | > |
| | | <el-option label="货车" :value="1" /> |
| | | <el-option label="快递" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="formState.shippingType === 1" |
| | | label="发货车牌号" |
| | | prop="truckPlateNo" |
| | | > |
| | | <el-input |
| | | v-model="formState.truckPlateNo" |
| | | placeholder="请输入发货车牌号" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <template v-else-if="formState.shippingType === 2"> |
| | | <el-form-item |
| | | label="快递公司" |
| | | prop="expressCompany" |
| | | > |
| | | <el-input |
| | | v-model="formState.expressCompany" |
| | | placeholder="请输入快递公司" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="快递单号" |
| | | prop="expressNo" |
| | | > |
| | | <el-input |
| | | v-model="formState.expressNo" |
| | | placeholder="请输入快递单号" |
| | | style="width: 240px" |
| | | /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <el-form-item |
| | | label="供应商名称" |
| | |
| | | <el-input style="width: 240px" v-model="formState.remark" :rows="1" type="textarea" placeholder="请输入备注"/> |
| | | </el-form-item> |
| | | |
| | | <div style="margin: 20px 0;"> |
| | | <div style="margin:20px 0;min-width:0;"> |
| | | <div class="section-title"> |
| | | <span class="title-dot"></span> |
| | | <span class="title-text">产品列表</span> |
| | | </div> |
| | | <el-button type="primary" size="small" style="margin-bottom: 20px" @click="isShowProductsModal = true" :disabled="!formState.purchaseLedgerId">添加产品</el-button> |
| | | <div class="product-table-scroll"> |
| | | <el-table class="product-table-inner" |
| | | <el-button type="primary" size="small" style="margin-bottom:20px" @click="isShowProductsModal = true" :disabled="!formState.purchaseLedgerId">添加产品</el-button> |
| | | <el-table |
| | | :data="formState.purchaseReturnOrderProductsDtos" |
| | | border |
| | | max-height="400" |
| | | show-summary |
| | | :summary-method="summarizeChildrenTable"> |
| | | :summary-method="summarizeChildrenTable" |
| | | style="width:100%;min-width:0;"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" /> |
| | |
| | | <el-table-column label="数量" |
| | | prop="stockInNum" |
| | | width="100" /> |
| | | <el-table-column label="销售发货数量" |
| | | prop="saleOutQuantity" |
| | | width="120" /> |
| | | <el-table-column label="可退货数量" |
| | | prop="unQuantity" |
| | | width="130" /> |
| | | <el-table-column label="已退货数量" |
| | | prop="totalReturnNum" |
| | | width="130" /> |
| | | width="130"> |
| | | <template #default="scope"> |
| | | {{ formattedNumber(scope.row, null, scope.row.totalReturnNum || 0) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="退货数量" |
| | | prop="returnQuantity" |
| | | width="180"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="section-title"> |
| | |
| | | <script setup> |
| | | import {ref, computed, getCurrentInstance, watch, defineAsyncComponent} from "vue"; |
| | | import {createPurchaseReturnOrder} from "@/api/procurementManagement/purchase_return_order.js"; |
| | | import {getOptions, purchaseList} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {getOptions, purchaseReturnableList} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | const ProductList = defineAsyncComponent(() => import("@/views/procurementManagement/purchaseReturnOrder/ProductList.vue")); |
| | | const props = defineProps({ |
| | |
| | | no: '', |
| | | isDefaultNo: true, |
| | | returnType: 0, |
| | | shippingType: undefined, |
| | | truckPlateNo: '', |
| | | expressCompany: '', |
| | | expressNo: '', |
| | | incomeType: undefined, |
| | | remark: '', |
| | | supplierId: undefined, |
| | |
| | | const purchaseLedgerOptions = ref([]) |
| | | // 是否展示产品列表数据 |
| | | const isShowProductsModal = ref(false) |
| | | |
| | | const handleShippingTypeChange = (val) => { |
| | | if (val === 1) { |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | } else if (val === 2) { |
| | | formState.value.truckPlateNo = ''; |
| | | } else { |
| | | formState.value.truckPlateNo = ''; |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | } |
| | | }; |
| | | |
| | | const isShow = computed({ |
| | | get() { |
| | |
| | | } |
| | | |
| | | const closeModal = () => { |
| | | formState.value.shippingType = undefined; |
| | | formState.value.truckPlateNo = ''; |
| | | formState.value.expressCompany = ''; |
| | | formState.value.expressNo = ''; |
| | | isShow.value = false; |
| | | }; |
| | | |
| | |
| | | const fetchPurchaseLedgerOptions = () => { |
| | | purchaseLedgerOptions.value = [] |
| | | if (formState.value.supplierId) { |
| | | purchaseList({supplierId: formState.value.supplierId,approvalStatus:3}).then((res) => { |
| | | purchaseReturnableList({ supplierId: formState.value.supplierId }).then((res) => { |
| | | purchaseLedgerOptions.value = res.rows; |
| | | }); |
| | | } |
| | |
| | | ...item, |
| | | returnQuantity: undefined, |
| | | taxInclusiveTotalPrice: 0, |
| | | salesLedgerProductId: item.salesLedgerProductId ?? item.id, |
| | | // salesLedgerProductId: item.salesLedgerProductId, |
| | | })); |
| | | formState.value.purchaseReturnOrderProductsDtos.push(...newProducts); |
| | | syncTotalAmount() |
| | |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | .product-table-scroll { |
| | | width: 100%; |
| | | overflow-x: auto; |
| | | } |
| | | |
| | | .product-table-inner { |
| | | min-width: 1280px; |
| | | } |
| | | </style> |
| | | </style> |