采购修改

This commit is contained in:
weiwei committed 2025-03-10 15:51:07 +08:00
1 parent de4e4813f3
commit b486fffaf5
7 files changed
+49 -17

No files matched your search

+2 -2
View File
@@ -72,7 +72,7 @@ export function password(obj: Object) {
})
}
export function unbindingUser(type) {
export function unbindingUser(type: any) {
return request({
url: "/admin/user/unbinding",
method: "post",
@@ -144,7 +144,7 @@ export function validatePhone(rule: any, value: any, callback: any, isEdit: bool
}
// 获取简要用户信息
export function getSimpleUserAll(params: { name?: string; mobile?: string }) {
export function getSimpleUserAll(params?: { name?: string; mobile?: string }) {
return request({
url: "/admin/user/getSimpleUserAll",
method: "get",
@@ -12,15 +12,25 @@
@radio-change="radioChangeEvent"
>
<vxe-column type="radio" width="60" align="center" />
<vxe-column field="planCode" title="编号" align="center" width="200" />
<vxe-column field="planDate" title="单据日期" align="center" width="200" />
<vxe-column v-if="linkType == 1" field="planCode" title="编号" align="center" width="200" />
<vxe-column v-if="linkType == 2" field="code" title="编号" align="center" width="200" />
<vxe-column v-if="linkType == 3" field="inventoryCode" title="编号" align="center" width="200" />
<vxe-column v-if="linkType == 1" field="planDate" title="单据日期" align="center" width="200" />
<vxe-column v-if="linkType == 2" field="ddDate" title="单据日期" align="center" width="200" />
<vxe-column v-if="linkType == 3" field="inventoryDate" title="单据日期" align="center" width="200" />
<vxe-column field="productName" title="商品名称" align="center" width="200" />
<vxe-column field="handlerUserName" title="经办人" align="center" width="100" />
<!-- <vxe-column field="checkStatus" title="审批状态" align="center" width="100">-->
<!-- <template #default="{ row }">-->
<!-- <dict-tag :options="check_status" :value="row.checkStatus" />-->
<!-- </template>-->
<!-- </vxe-column>-->
<vxe-column field="handlerUserName" title="经办人" align="center" width="160">
<template #default="{ row }">
{{ handlerUserList.find((item: any) => item.id === row.handlerUserId)?.nameWithMobile }}
</template>
</vxe-column>
<vxe-column field="checkStatus" title="审批状态" align="center" width="100">
<template #default="{ row }">
<dict-tag :options="check_status" :value="row.checkStatus" />
</template>
</vxe-column>
<vxe-column field="remark" title="备注" show-overflow align="center" min-width="100" />
</vxe-table>
<!-- <pagination
@@ -42,7 +52,7 @@
<vxe-column field="unit" title="包装单位" align="center" width="200"></vxe-column>
<vxe-column field="quantity" title="数量" align="center" width="100"></vxe-column>
<vxe-column field="purchasePrice" title="进价" align="center" width="100"></vxe-column>
<vxe-column field="unitPrice" title="进价" align="center" width="100"></vxe-column>
<vxe-column field="unitPrice" title="单价" align="center" width="100"></vxe-column>
<vxe-column field="totalAmount" title="累计总金额" align="center" width="100"></vxe-column>
<vxe-column field="remark" title="备注" show-overflow align="center" min-width="100"></vxe-column>
</vxe-table>
@@ -59,7 +69,10 @@
<script setup lang="ts" name="linkCgCodeDialog">
import { ref } from "vue"
import { VxeTableEvents } from "vxe-table"
import { getSimpleUserAll } from "/@/api/admin/user"
import { useDict } from "/@/hooks/dict"
const { check_status } = useDict("check_status")
const linkCodeDialogVisible = defineModel()
const emit = defineEmits(["getSelectedLinkCode"])
const props = withDefaults(
@@ -79,10 +92,14 @@ const linkCodeUnitTableRef = ref() // 关联订单的包装单位表格ref
const linkCodeTableData = ref([]) // 关联订单列表数据
const currRadioRowItems = ref([]) // 当前单选的表格行的items
const step = ref(0)
const linkType = ref()
const handlerUserList = ref() // 经办人列表
// 打开关联补货单对话框
const openLinkCodeDialog = async () => {
// type: 1-采购订单 2-采购入库 3-采购退货
const openLinkCodeDialog = async (type: number) => {
linkCodeDialogVisible.value = true
linkType.value = type
step.value = 0
linkCodeLoading.value = true
try {
@@ -93,6 +110,8 @@ const openLinkCodeDialog = async () => {
} catch (error) {
linkCodeTableData.value = []
linkCodeLoading.value = false
} finally {
linkCodeLoading.value = false
}
}
@@ -120,6 +139,19 @@ const onClose = () => {
linkCodeTableData.value = []
}
onMounted(async () => {
try {
const res = await getSimpleUserAll()
if (res.code === 0) {
handlerUserList.value = res.data
} else {
handlerUserList.value = []
}
} catch (error) {
handlerUserList.value = []
}
})
defineExpose({
openLinkCodeDialog,
})
@@ -265,7 +265,7 @@ const getInitData = async () => {
}
// 点击关联采购申请编号
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog()
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog(3)
// 获取选择的采购申请
const getSelectedLinkCode = (selectionRows: any) => {
@@ -267,7 +267,7 @@ const getInitData = async () => {
}
// 点击关联采购申请编号
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog()
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog(1)
// 获取选择的采购申请
const getSelectedLinkCode = (selectionRows: any) => {
@@ -272,7 +272,7 @@ const getInitData = async () => {
}
// 点击关联采购申请编号
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog()
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog(2)
// 获取选择的采购申请
const getSelectedLinkCode = (selectionRows: any) => {
@@ -309,7 +309,7 @@ const getInitData = async () => {
}
// 点击关联采购申请编号
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog()
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog(3)
// 获取选择的采购申请
const getSelectedLinkCode = (selectionRows: any) => {
@@ -309,7 +309,7 @@ const getInitData = async () => {
}
// 点击关联采购申请编号
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog()
const handleClickLinkCode = () => linkCgPlanDialogRef.value.openLinkCodeDialog(2)
// 获取选择的采购申请
const getSelectedLinkCode = (selectionRows: any) => {