|
@@ -22,21 +22,33 @@
|
|
|
<el-table :data="tableData" :span-method="handleSpanMethod" border v-loading="loading" style="width: 100%">
|
|
<el-table :data="tableData" :span-method="handleSpanMethod" border v-loading="loading" style="width: 100%">
|
|
|
<el-table-column type="index" label="序号" width="80" align="center" />
|
|
<el-table-column type="index" label="序号" width="80" align="center" />
|
|
|
<el-table-column prop="materialName" label="物资名称" min-width="140" align="center" />
|
|
<el-table-column prop="materialName" label="物资名称" min-width="140" align="center" />
|
|
|
- <el-table-column prop="specification" label="规格" min-width="200" align="center" />
|
|
|
|
|
- <el-table-column prop="unitPrice" label="单价 (元)" width="120" align="center" />
|
|
|
|
|
- <el-table-column prop="subtotal" label="小计" min-width="200" align="center" />
|
|
|
|
|
|
|
+ <el-table-column prop="specification" label="规格" min-width="100" align="center" />
|
|
|
<el-table-column prop="department" label="需求部门" min-width="140" align="center" />
|
|
<el-table-column prop="department" label="需求部门" min-width="140" align="center" />
|
|
|
<el-table-column prop="quantity" label="数量" width="100" align="center" />
|
|
<el-table-column prop="quantity" label="数量" width="100" align="center" />
|
|
|
|
|
+ <el-table-column prop="requestReason" label="申请理由" min-width="200" align="center" />
|
|
|
<el-table-column prop="sizeDetails" label="尺寸明细" min-width="200" align="center" />
|
|
<el-table-column prop="sizeDetails" label="尺寸明细" min-width="200" align="center" />
|
|
|
<el-table-column prop="status" label="状态" width="120" align="center">
|
|
<el-table-column prop="status" label="状态" width="120" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<span>{{ getStatusText(scope.row.status) }}</span>
|
|
<span>{{ getStatusText(scope.row.status) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="claim" label="领用" width="100" align="center" v-if="supplyRequestManagePermission">
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="claim"
|
|
|
|
|
+ label="通知领用"
|
|
|
|
|
+ width="150"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ v-if="supplyRequestManagePermission"
|
|
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-link
|
|
<el-link
|
|
|
- v-if="scope.row.status === SUPPLY_REQUEST_STATUS.PURCHASING && !scope.row.isClaimed"
|
|
|
|
|
|
|
+ v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.PURCHASING"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleNotify(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 通知
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ v-else-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.NOTIFIED"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="handleClaim(scope.row)"
|
|
@click="handleClaim(scope.row)"
|
|
|
>
|
|
>
|
|
@@ -56,21 +68,21 @@
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="action-container">
|
|
<div class="action-container">
|
|
|
<el-link
|
|
<el-link
|
|
|
- v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING"
|
|
|
|
|
|
|
+ v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.APPLYING"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="handleEdit(scope.row)"
|
|
@click="handleEdit(scope.row)"
|
|
|
>
|
|
>
|
|
|
编辑
|
|
编辑
|
|
|
</el-link>
|
|
</el-link>
|
|
|
<el-link
|
|
<el-link
|
|
|
- v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING"
|
|
|
|
|
|
|
+ v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.APPLYING"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
style="margin-left: 8px"
|
|
style="margin-left: 8px"
|
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
|
>
|
|
>
|
|
|
删除
|
|
删除
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <span v-if="scope.row.status !== SUPPLY_REQUEST_STATUS.APPLYING">-</span>
|
|
|
|
|
|
|
+ <span v-if="scope.row.status !== SUPPLY_REQUEST_DETAIL_STATUS.APPLYING">-</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -78,11 +90,13 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- 领用弹窗 -->
|
|
|
|
|
- <ReceiveSupplyDialog ref="receiveSupplyDialogRef" @success="handleClaimSuccess" />
|
|
|
|
|
- <!-- 添加物资弹窗 -->
|
|
|
|
|
- <AddSuppliesDrawer ref="addSupplyDrawerRef" @success="handleAddMaterialSuccess" />
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 领用弹窗 -->
|
|
|
|
|
+ <ReceiveSupplyDialog ref="receiveSupplyDialogRef" @success="handleClaimSuccess" />
|
|
|
|
|
+ <!-- 添加物资弹窗 -->
|
|
|
|
|
+ <AddSuppliesDrawer ref="addSupplyDrawerRef" @success="handleAddMaterialSuccess" />
|
|
|
|
|
+ <!-- 通知部门领用弹窗 -->
|
|
|
|
|
+ <NotifyDepartmentDialog ref="notifyDepartmentDialogRef" @success="handleNotifySuccess" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -91,7 +105,11 @@
|
|
|
import { Plus, Download } from '@element-plus/icons-vue';
|
|
import { Plus, Download } from '@element-plus/icons-vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
|
|
import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
|
|
|
- import { SUPPLY_REQUEST_STATUS, SUPPLY_REQUEST_DETAIL_STATUS_MAP } from './src/constant';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ SUPPLY_REQUEST_STATUS,
|
|
|
|
|
+ SUPPLY_REQUEST_DETAIL_STATUS,
|
|
|
|
|
+ SUPPLY_REQUEST_DETAIL_STATUS_MAP,
|
|
|
|
|
+ } from './src/constant';
|
|
|
import {
|
|
import {
|
|
|
getSupplyRequestInfoById,
|
|
getSupplyRequestInfoById,
|
|
|
getSupplyRequestDetail,
|
|
getSupplyRequestDetail,
|
|
@@ -105,6 +123,7 @@
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
|
import { EMERGENCY_PERMISSIONS } from '@/views/emergency/src/constant';
|
|
import { EMERGENCY_PERMISSIONS } from '@/views/emergency/src/constant';
|
|
|
import AddSuppliesDrawer from './src/components/AddSuppliesDrawer.vue';
|
|
import AddSuppliesDrawer from './src/components/AddSuppliesDrawer.vue';
|
|
|
|
|
+ import NotifyDepartmentDialog from './src/components/NotifyDepartmentDialog.vue';
|
|
|
|
|
|
|
|
const { permissions } = useUserInfoHook();
|
|
const { permissions } = useUserInfoHook();
|
|
|
const supplyRequestManagePermission = ref<Boolean>(false);
|
|
const supplyRequestManagePermission = ref<Boolean>(false);
|
|
@@ -116,13 +135,11 @@
|
|
|
infoId: number; // info 的 id,用于合并单元格
|
|
infoId: number; // info 的 id,用于合并单元格
|
|
|
materialName: string; // info 的 supplyName
|
|
materialName: string; // info 的 supplyName
|
|
|
specification: string; // info 的 specs
|
|
specification: string; // info 的 specs
|
|
|
- unitPrice: number; // info 的 unitPrice
|
|
|
|
|
- subtotal: string; // info 的 subtotal
|
|
|
|
|
department: string; // detailList 的 deptName
|
|
department: string; // detailList 的 deptName
|
|
|
quantity: number; // detailList 的 quantity
|
|
quantity: number; // detailList 的 quantity
|
|
|
|
|
+ requestReason: string; // detailList 的 requestReason
|
|
|
sizeDetails: string; // detailList 的 sizeDetail
|
|
sizeDetails: string; // detailList 的 sizeDetail
|
|
|
status: number; // detailList 的 status
|
|
status: number; // detailList 的 status
|
|
|
- isClaimed?: boolean; // 是否已领用(根据状态判断)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -134,7 +151,8 @@
|
|
|
const tableData = ref<TableRowData[]>([]);
|
|
const tableData = ref<TableRowData[]>([]);
|
|
|
const addSupplyDrawerRef = ref<InstanceType<typeof AddSuppliesDrawer>>();
|
|
const addSupplyDrawerRef = ref<InstanceType<typeof AddSuppliesDrawer>>();
|
|
|
const supplyRequestDetailData = ref<SupplyRequestDetailItem[]>([]);
|
|
const supplyRequestDetailData = ref<SupplyRequestDetailItem[]>([]);
|
|
|
-
|
|
|
|
|
|
|
+ // 通知部门领用弹窗相关
|
|
|
|
|
+ const notifyDepartmentDialogRef = ref<InstanceType<typeof NotifyDepartmentDialog>>();
|
|
|
// 领用弹窗相关
|
|
// 领用弹窗相关
|
|
|
const receiveSupplyDialogRef = ref<InstanceType<typeof ReceiveSupplyDialog>>();
|
|
const receiveSupplyDialogRef = ref<InstanceType<typeof ReceiveSupplyDialog>>();
|
|
|
|
|
|
|
@@ -145,8 +163,8 @@
|
|
|
|
|
|
|
|
// 合并单元格方法
|
|
// 合并单元格方法
|
|
|
const handleSpanMethod = ({ row, rowIndex, columnIndex }: any) => {
|
|
const handleSpanMethod = ({ row, rowIndex, columnIndex }: any) => {
|
|
|
- // 需要合并的列索引:物资名称(1)、规格(2)、单价(3)、小计(4)、物资操作(10)
|
|
|
|
|
- const mergeColumns = [1, 2, 3, 4, 10];
|
|
|
|
|
|
|
+ // 需要合并的列索引:物资名称(1)、规格(2)、物资操作(9)
|
|
|
|
|
+ const mergeColumns = [1, 2, 9];
|
|
|
if (!mergeColumns.includes(columnIndex)) {
|
|
if (!mergeColumns.includes(columnIndex)) {
|
|
|
return { rowspan: 1, colspan: 1 };
|
|
return { rowspan: 1, colspan: 1 };
|
|
|
}
|
|
}
|
|
@@ -190,13 +208,11 @@
|
|
|
infoId: item.info.id, // 用于合并单元格
|
|
infoId: item.info.id, // 用于合并单元格
|
|
|
materialName: item.info.supplyName,
|
|
materialName: item.info.supplyName,
|
|
|
specification: item.info.specs,
|
|
specification: item.info.specs,
|
|
|
- unitPrice: item.info.unitPrice,
|
|
|
|
|
- subtotal: item.info.subtotal,
|
|
|
|
|
department: detail.deptName,
|
|
department: detail.deptName,
|
|
|
quantity: detail.quantity,
|
|
quantity: detail.quantity,
|
|
|
|
|
+ requestReason: detail.requestReason,
|
|
|
sizeDetails: detail.sizeDetail,
|
|
sizeDetails: detail.sizeDetail,
|
|
|
status: detail.status,
|
|
status: detail.status,
|
|
|
- isClaimed: detail.status === SUPPLY_REQUEST_STATUS.RECEIVED,
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -233,6 +249,15 @@
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 通知领用
|
|
|
|
|
+ const handleNotify = (row: TableRowData) => {
|
|
|
|
|
+ notifyDepartmentDialogRef.value?.openDialog(row.id);
|
|
|
|
|
+ };
|
|
|
|
|
+ // 通知领用成功回调
|
|
|
|
|
+ const handleNotifySuccess = async () => {
|
|
|
|
|
+ await getDetailData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 领用
|
|
// 领用
|
|
|
const handleClaim = (row: TableRowData) => {
|
|
const handleClaim = (row: TableRowData) => {
|
|
|
receiveSupplyDialogRef.value?.openDialog(row.materialName, row.quantity, row.id, id);
|
|
receiveSupplyDialogRef.value?.openDialog(row.materialName, row.quantity, row.id, id);
|