✨ CRM:完善 CRM 相关实现(产品)
parent
56db6bf307
commit
a9e4ef9b7b
|
@ -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 })
|
||||
|
|
|
@ -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() // 消息
|
||||
|
||||
|
|
|
@ -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<{
|
||||
|
|
|
@ -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<{
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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' })
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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' })
|
||||
|
|
Loading…
Reference in New Issue