feat(biz): 添加采购订单模块功能
This commit is contained in:
parent
bba176ebec
commit
cd99537ba5
@ -91,4 +91,12 @@ public class PurOrderController {
|
|||||||
BeanUtils.toBean(list, PurOrderRespVO.class));
|
BeanUtils.toBean(list, PurOrderRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 审批接口,通过,驳回 审计
|
||||||
|
@PutMapping("/audit")
|
||||||
|
@Operation(summary = "审批采购订单主")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tsc:pur-order:approve')")
|
||||||
|
public CommonResult<Boolean> approvePurOrder(@RequestBody PurOrderSaveReqVO approveReqVO) {
|
||||||
|
purOrderService.approvePurOrder(approveReqVO.getIds(), approveReqVO.getPurStatus());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,8 @@ public class PurOrderSaveReqVO {
|
|||||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "5253")
|
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "5253")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
private List<Integer> ids;
|
||||||
|
|
||||||
@Schema(description = "采购订单号(CGDD+年份+月份+3位流水号)")
|
@Schema(description = "采购订单号(CGDD+年份+月份+3位流水号)")
|
||||||
private String purOrdNo;
|
private String purOrdNo;
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorder.vo.PurOrde
|
|||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购订单主 Service 接口
|
* 采购订单主 Service 接口
|
||||||
@ -60,4 +61,5 @@ public interface PurOrderService {
|
|||||||
*/
|
*/
|
||||||
PurOrderSaveReqVO getPurOrderWithItems(Integer id);
|
PurOrderSaveReqVO getPurOrderWithItems(Integer id);
|
||||||
|
|
||||||
|
void approvePurOrder(List<Integer> ids, String approveResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,10 @@ public class PurOrderServiceImpl implements PurOrderService {
|
|||||||
validatePurOrderExists(updateReqVO.getId());
|
validatePurOrderExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
PurOrderDO updateObj = BeanUtils.toBean(updateReqVO, PurOrderDO.class);
|
PurOrderDO updateObj = BeanUtils.toBean(updateReqVO, PurOrderDO.class);
|
||||||
|
// 已驳回
|
||||||
|
if ("4".equals(updateObj.getPurStatus())) {
|
||||||
|
updateObj.setPurStatus("1");
|
||||||
|
}
|
||||||
purOrderMapper.updateById(updateObj);
|
purOrderMapper.updateById(updateObj);
|
||||||
|
|
||||||
updatePurOrderItemList(updateReqVO.getId(), updateReqVO.getItemList());
|
updatePurOrderItemList(updateReqVO.getId(), updateReqVO.getItemList());
|
||||||
@ -77,7 +81,13 @@ public class PurOrderServiceImpl implements PurOrderService {
|
|||||||
@Override
|
@Override
|
||||||
public void deletePurOrder(Integer id) {
|
public void deletePurOrder(Integer id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validatePurOrderExists(id);
|
PurOrderDO purOrderDO = purOrderMapper.selectById(id);
|
||||||
|
if (purOrderDO == null) {
|
||||||
|
throw exception("采购订单不存在,请刷新页面!");
|
||||||
|
}
|
||||||
|
if ("2".equals(purOrderDO.getPurStatus()) || "3".equals(purOrderDO.getPurStatus())) {
|
||||||
|
throw exception("该采购单已确认或审批不允许删除,请刷新界面!");
|
||||||
|
}
|
||||||
// 删除
|
// 删除
|
||||||
purOrderMapper.deleteById(id);
|
purOrderMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
@ -135,4 +145,21 @@ public class PurOrderServiceImpl implements PurOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void approvePurOrder(List<Integer> ids, String approveResult) {
|
||||||
|
for (Integer id : ids) {
|
||||||
|
PurOrderDO purOrderDO = purOrderMapper.selectById(id);
|
||||||
|
if (purOrderDO == null) {
|
||||||
|
throw exception("采购订单不存在,请刷新页面!");
|
||||||
|
}
|
||||||
|
if (!"2".equals(purOrderDO.getPurStatus())) {
|
||||||
|
throw exception("采购订单状态不等于已确认,请刷新界面!");
|
||||||
|
}
|
||||||
|
purOrderDO.setPurStatus(approveResult);
|
||||||
|
purOrderMapper.updateById(purOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,3 +51,8 @@ export const deletePurOrder = async (id: number) => {
|
|||||||
export const exportPurOrder = async (params) => {
|
export const exportPurOrder = async (params) => {
|
||||||
return await request.download({ url: `/tsc/pur-order/export-excel`, params })
|
return await request.download({ url: `/tsc/pur-order/export-excel`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 审批采购订单主
|
||||||
|
export const auditPurOrder = async (ids: number[], purStatus: string) => {
|
||||||
|
return await request.put({ url: `/tsc/pur-order/audit`, data: { ids, purStatus } })
|
||||||
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ declare module 'vue' {
|
|||||||
AppLinkSelectDialog: typeof import('./../components/AppLinkInput/AppLinkSelectDialog.vue')['default']
|
AppLinkSelectDialog: typeof import('./../components/AppLinkInput/AppLinkSelectDialog.vue')['default']
|
||||||
Backtop: typeof import('./../components/Backtop/src/Backtop.vue')['default']
|
Backtop: typeof import('./../components/Backtop/src/Backtop.vue')['default']
|
||||||
CardTitle: typeof import('./../components/Card/src/CardTitle.vue')['default']
|
CardTitle: typeof import('./../components/Card/src/CardTitle.vue')['default']
|
||||||
|
'CheckstyleIdea.xml': typeof import('./../../.idea/checkstyle-idea.xml.tmp')['default']
|
||||||
ColorInput: typeof import('./../components/ColorInput/index.vue')['default']
|
ColorInput: typeof import('./../components/ColorInput/index.vue')['default']
|
||||||
ComponentContainer: typeof import('./../components/DiyEditor/components/ComponentContainer.vue')['default']
|
ComponentContainer: typeof import('./../components/DiyEditor/components/ComponentContainer.vue')['default']
|
||||||
ComponentContainerProperty: typeof import('./../components/DiyEditor/components/ComponentContainerProperty.vue')['default']
|
ComponentContainerProperty: typeof import('./../components/DiyEditor/components/ComponentContainerProperty.vue')['default']
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1500px">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
@ -29,10 +29,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据状态">
|
<el-form-item label="单据状态">
|
||||||
<el-tag v-if="formData.purStatus === '1'" type="info">已创建</el-tag>
|
<el-input v-model="formData.purStatus" disabled :value="formData.purStatus === '1' ? '已创建' : formData.purStatus === '2' ? '已确认' : formData.purStatus === '3' ? '已审批' : '已驳回'" />
|
||||||
<el-tag v-else-if="formData.purStatus === '2'" type="warning">已确认</el-tag>
|
|
||||||
<el-tag v-else-if="formData.purStatus === '3'" type="success">已审批</el-tag>
|
|
||||||
<el-tag v-else-if="formData.purStatus === '4'" type="danger">已驳回</el-tag>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -74,24 +71,29 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table :data="itemList" show-summary border :summary-method="getSummary">
|
<el-table :data="itemList" show-summary border :summary-method="getSummary">
|
||||||
<el-table-column label="序号" type="index" width="60px" align="center" />
|
<el-table-column label="序号" type="index" width="60px" align="center" />
|
||||||
<el-table-column label="物料编码" prop="materialCode" width="120px" align="center" />
|
<el-table-column label="物料编码" prop="materialCode" align="center" />
|
||||||
<el-table-column label="物料名称" prop="materialName" width="150px" align="center" />
|
<el-table-column label="物料名称" prop="materialName" align="center" />
|
||||||
<el-table-column label="规格型号" prop="spec" width="100px" align="center" />
|
<el-table-column label="收货状态" prop="acceptStatus" align="center">
|
||||||
<el-table-column label="单位" prop="unit" width="80px" align="center" />
|
<template #default="scope">
|
||||||
<el-table-column label="采购数量" prop="purQty" width="100px" align="center" />
|
{{ scope.row.acceptStatus === '1' ? '已收货' : '未收货' }}
|
||||||
<el-table-column label="要求交货日期" prop="reqDeliveryDate" width="130px" align="center" />
|
</template>
|
||||||
<el-table-column label="采购单价" prop="priceTax" width="100px" align="center">
|
</el-table-column>
|
||||||
|
<el-table-column label="收货数量" prop="acceptQty" align="center" />
|
||||||
|
<el-table-column label="单位" prop="unit" align="center" />
|
||||||
|
<el-table-column label="规格型号" prop="spec" align="center" />
|
||||||
|
<el-table-column label="采购数量" prop="purQty" align="center" />
|
||||||
|
<el-table-column label="要求交货日期" prop="reqDeliveryDate" align="center" />
|
||||||
|
<el-table-column label="采购单价" prop="priceTax" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span style="color: #409EFF;">{{ scope.row.priceTax }}</span>
|
<span style="color: #409EFF;">{{ scope.row.priceTax }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="税率(%)" prop="taxRatio" width="80px" align="center">
|
<el-table-column label="采购总价" prop="totalPrice" align="center" />
|
||||||
|
<el-table-column label="税率" prop="taxRatio" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.taxRatio }}%
|
{{ scope.row.taxRatio }}%
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="采购总价" prop="totalPrice" width="100px" align="center" />
|
|
||||||
<el-table-column label="备注" prop="remark" width="100px" align="center" />
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -135,14 +137,7 @@ const open = async (id: number) => {
|
|||||||
try {
|
try {
|
||||||
const data = await PurOrderApi.getPurOrder(id)
|
const data = await PurOrderApi.getPurOrder(id)
|
||||||
Object.assign(formData, data)
|
Object.assign(formData, data)
|
||||||
|
itemList.value = (data.itemList || []).map((item: any) => ({
|
||||||
// 加载子表数据
|
|
||||||
const itemData = await PurOrderItemApi.getPurOrderItemPage({
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
purId: id
|
|
||||||
})
|
|
||||||
itemList.value = (itemData.list || []).map((item: any) => ({
|
|
||||||
materialCode: item.materialCode,
|
materialCode: item.materialCode,
|
||||||
materialName: item.materialName,
|
materialName: item.materialName,
|
||||||
spec: item.spec,
|
spec: item.spec,
|
||||||
|
|||||||
@ -252,6 +252,7 @@ import * as UserApi from '@/api/system/user'
|
|||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
import MoneyInput from '../components/MoneyInput.vue'
|
import MoneyInput from '../components/MoneyInput.vue'
|
||||||
import { getDictOptions } from '@/utils/dict'
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
@ -266,10 +267,10 @@ const supplierOptions = ref<any[]>([])
|
|||||||
const supplierLoading = ref(false)
|
const supplierLoading = ref(false)
|
||||||
|
|
||||||
// 部门相关
|
// 部门相关
|
||||||
const deptList = ref<any[]>([])
|
const deptList = ref<DeptApi.DeptVO[]>([])
|
||||||
|
|
||||||
// 采购人员相关
|
// 采购人员相关
|
||||||
const userList = ref<any[]>([])
|
const userList = ref<UserApi.UserVO[]>([])
|
||||||
const userSelectLoading = ref(false)
|
const userSelectLoading = ref(false)
|
||||||
|
|
||||||
// 物料选择弹窗
|
// 物料选择弹窗
|
||||||
@ -308,9 +309,11 @@ const itemList = ref<any[]>([])
|
|||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
purDate: [{ required: true, message: '订单日期不能为空', trigger: 'change' }],
|
purDate: [{ required: true, message: '订单日期不能为空', trigger: 'change' }],
|
||||||
billType: [{ required: true, message: '单据类型不能为空', trigger: 'change' }],
|
billType: [{ required: true, message: '单据类型不能为空', trigger: 'change' }],
|
||||||
|
applyType: [{ required: true, message: '申请类型不能为空', trigger: 'change' }],
|
||||||
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'change' }],
|
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'change' }],
|
||||||
purDeptId: [{ required: true, message: '采购部门不能为空', trigger: 'change' }],
|
purDeptId: [{ required: true, message: '采购部门不能为空', trigger: 'change' }],
|
||||||
purEmpId: [{ required: true, message: '采购人员不能为空', trigger: 'change' }],
|
purStatus: [{ required: true, message: '单据状态不能为空', trigger: 'change' }],
|
||||||
|
acceptMeth: [{ required: true, message: '验收方式不能为空', trigger: 'change' }],
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
|||||||
@ -97,16 +97,16 @@
|
|||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50px" align="center" />
|
<el-table-column type="selection" width="50px" align="center" />
|
||||||
<el-table-column label="序号" align="center" type="index" width="60px"/>
|
<el-table-column label="序号" align="center" type="index" width="60px" />
|
||||||
<el-table-column label="单据类型" align="center" prop="billType" width="160px">
|
<el-table-column label="单据类型" align="center" prop="billType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.billType === '1' ? '标准采购申请' : '设备采购申请' }}
|
{{ scope.row.billType === '1' ? '标准采购申请' : '设备采购申请' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="采购订单号" align="center" prop="purOrdNo" width="160px" />
|
<el-table-column label="采购订单号" align="center" prop="purOrdNo" />
|
||||||
<el-table-column label="订单日期" align="center" prop="purDate" width="140px" />
|
<el-table-column label="订单日期" align="center" prop="purDate" />
|
||||||
<el-table-column label="供应商名称" align="center" prop="supplierName" width="300px" />
|
<el-table-column label="供应商名称" align="center" prop="supplierName" width="300px" />
|
||||||
<el-table-column label="单据状态" align="center" prop="purStatus" width="120px">
|
<el-table-column label="单据状态" align="center" prop="purStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.purStatus === '1'" type="info">已创建</el-tag>
|
<el-tag v-if="scope.row.purStatus === '1'" type="info">已创建</el-tag>
|
||||||
<el-tag v-else-if="scope.row.purStatus === '2'" type="warning">已确认</el-tag>
|
<el-tag v-else-if="scope.row.purStatus === '2'" type="warning">已确认</el-tag>
|
||||||
@ -114,17 +114,17 @@
|
|||||||
<el-tag v-else-if="scope.row.purStatus === '4'" type="danger">已驳回</el-tag>
|
<el-tag v-else-if="scope.row.purStatus === '4'" type="danger">已驳回</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="收货状态" align="center" prop="deliveryStatus" width="120px">
|
<el-table-column label="收货状态" align="center" prop="deliveryStatus" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.deliveryStatus === '1' ? '未收货' : scope.row.deliveryStatus === '2' ? '部分收货' : '全部收货' }}
|
{{ scope.row.deliveryStatus === '1' ? '未收货' : scope.row.deliveryStatus === '2' ? '部分收货' : '全部收货' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="200px">
|
<el-table-column label="操作" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="scope.row.purStatus === '1'"
|
v-if="scope.row.purStatus === '1' || scope.row.purStatus === '4'"
|
||||||
@click.stop="openForm('update', scope.row.id)"
|
@click.stop="openForm('update', scope.row.id)"
|
||||||
v-hasPermi="['biz:pur-order:update']"
|
v-hasPermi="['biz:pur-order:update']"
|
||||||
>
|
>
|
||||||
@ -173,10 +173,10 @@
|
|||||||
:summary-method="getItemSummary"
|
:summary-method="getItemSummary"
|
||||||
border
|
border
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" align="center" type="index" width="60px"/>
|
<el-table-column label="序号" align="center" type="index" width="60px" />
|
||||||
<el-table-column label="物料编码" align="center" prop="materialCode" width="120px" />
|
<el-table-column label="物料编码" align="center" prop="materialCode" />
|
||||||
<el-table-column label="物料名称" align="center" prop="materialName" width="200px" />
|
<el-table-column label="物料名称" align="center" prop="materialName" />
|
||||||
<el-table-column label="收货状态" align="center" prop="deliveryStatus" width="100px">
|
<el-table-column label="收货状态" align="center" prop="deliveryStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.deliveryStatus === '1' ? '未收货' : scope.row.deliveryStatus === '2' ? '部分收货' : '全部收货' }}
|
{{ scope.row.deliveryStatus === '1' ? '未收货' : scope.row.deliveryStatus === '2' ? '部分收货' : '全部收货' }}
|
||||||
</template>
|
</template>
|
||||||
@ -188,16 +188,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="规格型号" align="center" prop="spec" width="120px" />
|
<el-table-column label="规格型号" align="center" prop="spec" />
|
||||||
<el-table-column label="采购数量" align="center" prop="purQty" width="100px" />
|
<el-table-column label="采购数量" align="center" prop="purQty" />
|
||||||
<el-table-column label="要求交货日期" align="center" prop="reqDeliveryDate" width="150px" />
|
<el-table-column label="要求交货日期" align="center" prop="reqDeliveryDate" />
|
||||||
<el-table-column label="采购单价" align="center" prop="priceTax" width="100px">
|
<el-table-column label="采购单价" align="center" prop="priceTax">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span style="color: #409EFF;">{{ scope.row.priceTax }}</span>
|
<span style="color: #409EFF;">{{ scope.row.priceTax }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="采购总价" align="center" prop="totalPrice" width="100px" />
|
<el-table-column label="采购总价" align="center" prop="totalPrice" />
|
||||||
<el-table-column label="税率" align="center" prop="taxRatio" width="80px">
|
<el-table-column label="税率" align="center" prop="taxRatio">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.taxRatio || 0 }}%
|
{{ scope.row.taxRatio || 0 }}%
|
||||||
</template>
|
</template>
|
||||||
@ -338,6 +338,7 @@ const handleDelete = async (id: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 审批操作 */
|
/** 审批操作 */
|
||||||
const handleAudit = async () => {
|
const handleAudit = async () => {
|
||||||
if (selectedIds.value.length === 0) {
|
if (selectedIds.value.length === 0) {
|
||||||
@ -347,6 +348,7 @@ const handleAudit = async () => {
|
|||||||
try {
|
try {
|
||||||
await message.confirm('确认审批选中的采购订单吗?')
|
await message.confirm('确认审批选中的采购订单吗?')
|
||||||
// 这里调用审批API
|
// 这里调用审批API
|
||||||
|
await PurOrderApi.auditPurOrder(selectedIds.value, '3')
|
||||||
message.success('审批成功')
|
message.success('审批成功')
|
||||||
getList()
|
getList()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -363,6 +365,7 @@ const handleReject = async () => {
|
|||||||
try {
|
try {
|
||||||
await message.confirm('确认驳回选中的采购订单吗?')
|
await message.confirm('确认驳回选中的采购订单吗?')
|
||||||
// 这里调用驳回API
|
// 这里调用驳回API
|
||||||
|
await PurOrderApi.auditPurOrder(selectedIds.value, '4')
|
||||||
message.success('驳回成功')
|
message.success('驳回成功')
|
||||||
getList()
|
getList()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -492,20 +492,6 @@ const formRules = reactive({
|
|||||||
|
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
|
||||||
/** 详情偶发多包一层:根上无 items,但 data.items 为数组时取内层 */
|
|
||||||
const unwrapOrderDetail = (raw: Record<string, any>) => {
|
|
||||||
if (!raw || typeof raw !== 'object') {
|
|
||||||
return raw
|
|
||||||
}
|
|
||||||
if (Array.isArray(raw.items)) {
|
|
||||||
return raw
|
|
||||||
}
|
|
||||||
const inner = raw.data
|
|
||||||
if (inner && typeof inner === 'object' && !Array.isArray(inner) && Array.isArray(inner.items)) {
|
|
||||||
return inner
|
|
||||||
}
|
|
||||||
return raw
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 获取业务部门列表 */
|
/** 获取业务部门列表 */
|
||||||
const loadDeptList = async () => {
|
const loadDeptList = async () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user