CRM:完善 CRM 相关实现(产品)

This commit is contained in:
YunaiV 2024-02-24 09:50:35 +08:00
parent 56db6bf307
commit a9e4ef9b7b
13 changed files with 26 additions and 46 deletions

View File

@ -8,17 +8,11 @@ export interface ProductVO {
price: number
status: number
categoryId: number
categoryName?: string
description: string
ownerUserId: number
}
// TODO 芋艿:待删除
export interface ProductExpandVO extends ProductVO {
count: number
discountPercent: number
totalPrice: number
}
// 查询产品列表
export const getProductPage = async (params) => {
return await request.get({ url: `/crm/product/page`, params })

View File

@ -38,7 +38,12 @@
</el-link>
</template>
</el-table-column>
<el-table-column label="商机金额" align="center" prop="price" :formatter="fenToYuanFormat" />
<el-table-column
label="商机金额"
align="center"
prop="price"
:formatter="erpPriceTableColumnFormatter"
/>
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="商机组" align="center" prop="statusTypeName" />
<el-table-column label="商机阶段" align="center" prop="statusName" />
@ -66,8 +71,8 @@ import * as BusinessApi from '@/api/crm/business'
import * as ContactApi from '@/api/crm/contact'
import BusinessForm from './../BusinessForm.vue'
import { BizTypeEnum } from '@/api/crm/permission'
import { fenToYuanFormat } from '@/utils/formatter'
import BusinessListModal from './BusinessListModal.vue'
import { erpPriceTableColumnFormatter } from '@/utils'
const message = useMessage() //

View File

@ -49,7 +49,7 @@
label="商机金额"
align="center"
prop="price"
:formatter="fenToYuanFormat"
:formatter="erpPriceInputFormatter"
/>
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="商机组" align="center" prop="statusTypeName" />
@ -75,7 +75,7 @@
<script setup lang="ts">
import * as BusinessApi from '@/api/crm/business'
import BusinessForm from '../BusinessForm.vue'
import { fenToYuanFormat } from '@/utils/formatter'
import { erpPriceInputFormatter } from '@/utils'
const message = useMessage() //
const props = defineProps<{

View File

@ -23,7 +23,7 @@
label="合同金额(元)"
align="center"
prop="price"
:formatter="fenToYuanFormat"
:formatter="erpPriceInputFormatter"
/>
<el-table-column
label="开始时间"
@ -61,9 +61,9 @@
import * as ContractApi from '@/api/crm/contract'
import ContractForm from './../ContractForm.vue'
import { BizTypeEnum } from '@/api/crm/permission'
import { fenToYuanFormat } from '@/utils/formatter'
import { dateFormatter } from '@/utils/formatTime'
import { DICT_TYPE } from '@/utils/dict'
import { erpPriceInputFormatter } from '@/utils'
defineOptions({ name: 'CrmContractList' })
const props = defineProps<{

View File

@ -19,9 +19,8 @@
<el-tab-pane label="产品">
<ContractProductList :contract="contract" />
</el-tab-pane>
<!-- TODO 合同 -->
<el-tab-pane label="回款"> 123 </el-tab-pane>
<!-- TODO @puhui999回款信息 -->
<el-tab-pane label="回款"> 123 </el-tab-pane>
<el-tab-pane label="团队成员">
<PermissionList
ref="permissionListRef"

View File

@ -245,7 +245,6 @@ import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ContractApi from '@/api/crm/contract'
import ContractForm from './ContractForm.vue'
import { fenToYuanFormat } from '@/utils/formatter'
import { DICT_TYPE } from '@/utils/dict'
import { erpPriceTableColumnFormatter } from '@/utils'
import * as CustomerApi from '@/api/crm/customer'

View File

@ -100,7 +100,7 @@
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import * as ProductApi from '@/api/crm/product'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/category'
import { defaultProps, handleTree } from '@/utils/tree'
import { getSimpleUserList, UserVO } from '@/api/system/user'
import { useUserStore } from '@/store/modules/user'

View File

@ -29,7 +29,7 @@
</Dialog>
</template>
<script setup lang="ts">
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/category'
defineOptions({ name: 'CrmProductCategoryForm' })

View File

@ -73,7 +73,7 @@
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/category'
import ProductCategoryForm from './ProductCategoryForm.vue'
import { handleTree } from '@/utils/tree'

View File

@ -18,13 +18,13 @@
</div>
<ContentWrap class="mt-10px">
<el-descriptions :column="5" direction="vertical">
<el-descriptions-item label="产品类别">
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
</el-descriptions-item>
<el-descriptions-item label="产品类别">{{ product.categoryName }}</el-descriptions-item>
<el-descriptions-item label="产品单位">
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
</el-descriptions-item>
<el-descriptions-item label="产品价格">{{ fenToYuan(product.price) }}</el-descriptions-item>
<el-descriptions-item label="产品价格">
{{ erpPriceInputFormatter(product.price) }}
</el-descriptions-item>
<el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>
</el-descriptions>
</ContentWrap>
@ -34,9 +34,8 @@
<script setup lang="ts">
import ProductForm from '@/views/crm/product/ProductForm.vue'
import { DICT_TYPE } from '@/utils/dict'
import { fenToYuan } from '@/utils'
import { erpPriceInputFormatter } from '@/utils'
import * as ProductApi from '@/api/crm/product'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
//
const formRef = ref()
@ -44,12 +43,4 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
const { product } = defineProps<{ product: ProductApi.ProductVO }>()
const emit = defineEmits(['refresh']) // success
/** 初始化 */
const productCategoryList = ref([]) //
onMounted(async () => {
productCategoryList.value = await ProductCategoryApi.getProductCategoryList({})
})
</script>

View File

@ -8,11 +8,11 @@
<el-descriptions :column="4">
<el-descriptions-item label="产品名称">{{ product.name }}</el-descriptions-item>
<el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>
<el-descriptions-item label="价格">{{ fenToYuan(product.price) }}</el-descriptions-item>
<el-descriptions-item label="产品描述">{{ product.description }}</el-descriptions-item>
<el-descriptions-item label="产品类型">
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
<el-descriptions-item label="价格">
{{ erpPriceInputFormatter(product.price) }}
</el-descriptions-item>
<el-descriptions-item label="产品描述">{{ product.description }}</el-descriptions-item>
<el-descriptions-item label="产品类型">{{ product.categoryName }}</el-descriptions-item>
<el-descriptions-item label="是否上下架">
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status" />
</el-descriptions-item>
@ -27,8 +27,7 @@
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import * as ProductApi from '@/api/crm/product'
import { fenToYuan } from '@/utils'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import { erpPriceInputFormatter } from '@/utils'
const { product } = defineProps<{
product: ProductApi.ProductVO
@ -36,10 +35,4 @@ const { product } = defineProps<{
//
const activeNames = ref(['basicInfo'])
/** 初始化 */
const productCategoryList = ref([]) //
onMounted(async () => {
productCategoryList.value = await ProductCategoryApi.getProductCategoryList({})
})
</script>

View File

@ -133,7 +133,6 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ProductApi from '@/api/crm/product'
import ProductForm from './ProductForm.vue'
import { fenToYuanFormat } from '@/utils/formatter'
import { erpPriceTableColumnFormatter } from '@/utils'
defineOptions({ name: 'CrmProduct' })