CRM:合同的 code review

(cherry picked from commit 3ad68c3227)
This commit is contained in:
YunaiV
2024-02-04 09:48:44 +08:00
committed by shizhong
parent d4eb24798b
commit b0a6af4b40
4 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,4 @@
<!-- 合同详情产品列表 -->
<template>
<el-table :data="list" :show-overflow-tooltip="true" :stripe="true">
<el-table-column align="center" label="产品名称" prop="name" width="160" />
@ -35,7 +36,8 @@ defineOptions({ name: 'ContractProductList' })
const props = withDefaults(defineProps<{ modelValue: ProductApi.ProductExpandVO[] }>(), {
modelValue: () => []
})
const list = ref<ProductApi.ProductExpandVO[]>([]) // 列表数量
const list = ref<ProductApi.ProductExpandVO[]>([]) // 产品列表
/** 计算 totalPrice */
const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
const totalPrice =
@ -43,8 +45,9 @@ const getTotalPrice = computed(() => (row: ProductApi.ProductExpandVO) => {
row.totalPrice = isNaN(totalPrice) ? 0 : yuanToFen(totalPrice)
return isNaN(totalPrice) ? 0 : totalPrice.toFixed(2)
})
const isSetListValue = ref(false) // 判断是否已经给 list 赋值过,用于编辑表单商品回显
// 编辑时合同品回显
/** 编辑时合同品回显 */
const isSetListValue = ref(false) // 判断是否已经给 list 赋值过,用于编辑表单产品回显
watch(
() => props.modelValue,
(val) => {

View File

@ -87,6 +87,7 @@ const getOperateLog = async (contractId: number) => {
}
/** 转移 */
// TODO @puhui999这个组件要不传递业务类型然后组件里判断 title 和 api 能调用哪个;整体治理掉;
const transferFormRef = ref<InstanceType<typeof CrmTransferForm>>() // 合同转移表单 ref
const transferContract = () => {
transferFormRef.value?.open('合同转移', contract.value.id, ContractApi.transferContract)