✨ CRM:完善 CRM 相关实现(产品)
This commit is contained in:
parent
56db6bf307
commit
a9e4ef9b7b
@ -8,17 +8,11 @@ export interface ProductVO {
|
|||||||
price: number
|
price: number
|
||||||
status: number
|
status: number
|
||||||
categoryId: number
|
categoryId: number
|
||||||
|
categoryName?: string
|
||||||
description: string
|
description: string
|
||||||
ownerUserId: number
|
ownerUserId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 芋艿:待删除
|
|
||||||
export interface ProductExpandVO extends ProductVO {
|
|
||||||
count: number
|
|
||||||
discountPercent: number
|
|
||||||
totalPrice: number
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询产品列表
|
// 查询产品列表
|
||||||
export const getProductPage = async (params) => {
|
export const getProductPage = async (params) => {
|
||||||
return await request.get({ url: `/crm/product/page`, params })
|
return await request.get({ url: `/crm/product/page`, params })
|
||||||
|
@ -38,7 +38,12 @@
|
|||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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="customerName" />
|
||||||
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
||||||
<el-table-column label="商机阶段" align="center" prop="statusName" />
|
<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 * as ContactApi from '@/api/crm/contact'
|
||||||
import BusinessForm from './../BusinessForm.vue'
|
import BusinessForm from './../BusinessForm.vue'
|
||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
import { fenToYuanFormat } from '@/utils/formatter'
|
|
||||||
import BusinessListModal from './BusinessListModal.vue'
|
import BusinessListModal from './BusinessListModal.vue'
|
||||||
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||||
|
|
||||||
const message = useMessage() // 消息
|
const message = useMessage() // 消息
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
label="商机金额"
|
label="商机金额"
|
||||||
align="center"
|
align="center"
|
||||||
prop="price"
|
prop="price"
|
||||||
:formatter="fenToYuanFormat"
|
:formatter="erpPriceInputFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="客户名称" align="center" prop="customerName" />
|
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||||
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as BusinessApi from '@/api/crm/business'
|
import * as BusinessApi from '@/api/crm/business'
|
||||||
import BusinessForm from '../BusinessForm.vue'
|
import BusinessForm from '../BusinessForm.vue'
|
||||||
import { fenToYuanFormat } from '@/utils/formatter'
|
import { erpPriceInputFormatter } from '@/utils'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
label="合同金额(元)"
|
label="合同金额(元)"
|
||||||
align="center"
|
align="center"
|
||||||
prop="price"
|
prop="price"
|
||||||
:formatter="fenToYuanFormat"
|
:formatter="erpPriceInputFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="开始时间"
|
label="开始时间"
|
||||||
@ -61,9 +61,9 @@
|
|||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import ContractForm from './../ContractForm.vue'
|
import ContractForm from './../ContractForm.vue'
|
||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
import { fenToYuanFormat } from '@/utils/formatter'
|
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { erpPriceInputFormatter } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmContractList' })
|
defineOptions({ name: 'CrmContractList' })
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -19,9 +19,8 @@
|
|||||||
<el-tab-pane label="产品">
|
<el-tab-pane label="产品">
|
||||||
<ContractProductList :contract="contract" />
|
<ContractProductList :contract="contract" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- TODO 合同 -->
|
|
||||||
<el-tab-pane label="回款"> 123 </el-tab-pane>
|
|
||||||
<!-- TODO @puhui999:回款信息 -->
|
<!-- TODO @puhui999:回款信息 -->
|
||||||
|
<el-tab-pane label="回款"> 123 </el-tab-pane>
|
||||||
<el-tab-pane label="团队成员">
|
<el-tab-pane label="团队成员">
|
||||||
<PermissionList
|
<PermissionList
|
||||||
ref="permissionListRef"
|
ref="permissionListRef"
|
||||||
|
@ -245,7 +245,6 @@ import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import ContractForm from './ContractForm.vue'
|
import ContractForm from './ContractForm.vue'
|
||||||
import { fenToYuanFormat } from '@/utils/formatter'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { erpPriceTableColumnFormatter } from '@/utils'
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import * as ProductApi from '@/api/crm/product'
|
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 { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import { getSimpleUserList, UserVO } from '@/api/system/user'
|
import { getSimpleUserList, UserVO } from '@/api/system/user'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
import * as ProductCategoryApi from '@/api/crm/product/category'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmProductCategoryForm' })
|
defineOptions({ name: 'CrmProductCategoryForm' })
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
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 ProductCategoryForm from './ProductCategoryForm.vue'
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<ContentWrap class="mt-10px">
|
<ContentWrap class="mt-10px">
|
||||||
<el-descriptions :column="5" direction="vertical">
|
<el-descriptions :column="5" direction="vertical">
|
||||||
<el-descriptions-item label="产品类别">
|
<el-descriptions-item label="产品类别">{{ product.categoryName }}</el-descriptions-item>
|
||||||
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="产品单位">
|
<el-descriptions-item label="产品单位">
|
||||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
|
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
|
||||||
</el-descriptions-item>
|
</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-item label="产品编码">{{ product.no }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@ -34,9 +34,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ProductForm from '@/views/crm/product/ProductForm.vue'
|
import ProductForm from '@/views/crm/product/ProductForm.vue'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { fenToYuan } from '@/utils'
|
import { erpPriceInputFormatter } from '@/utils'
|
||||||
import * as ProductApi from '@/api/crm/product'
|
import * as ProductApi from '@/api/crm/product'
|
||||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
|
||||||
|
|
||||||
// 操作修改
|
// 操作修改
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
@ -44,12 +43,4 @@ const openForm = (type: string, id?: number) => {
|
|||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
const { product } = defineProps<{ product: ProductApi.ProductVO }>()
|
const { product } = defineProps<{ product: ProductApi.ProductVO }>()
|
||||||
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
|
|
||||||
|
|
||||||
/** 初始化 */
|
|
||||||
const productCategoryList = ref([]) // 产品分类树
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
productCategoryList.value = await ProductCategoryApi.getProductCategoryList({})
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
<el-descriptions :column="4">
|
<el-descriptions :column="4">
|
||||||
<el-descriptions-item label="产品名称">{{ product.name }}</el-descriptions-item>
|
<el-descriptions-item label="产品名称">{{ product.name }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="产品编码">{{ product.no }}</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="价格">
|
||||||
<el-descriptions-item label="产品描述">{{ product.description }}</el-descriptions-item>
|
{{ erpPriceInputFormatter(product.price) }} 元
|
||||||
<el-descriptions-item label="产品类型">
|
|
||||||
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
|
|
||||||
</el-descriptions-item>
|
</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="是否上下架">
|
<el-descriptions-item label="是否上下架">
|
||||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status" />
|
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@ -27,8 +27,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import * as ProductApi from '@/api/crm/product'
|
import * as ProductApi from '@/api/crm/product'
|
||||||
import { fenToYuan } from '@/utils'
|
import { erpPriceInputFormatter } from '@/utils'
|
||||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
|
||||||
|
|
||||||
const { product } = defineProps<{
|
const { product } = defineProps<{
|
||||||
product: ProductApi.ProductVO
|
product: ProductApi.ProductVO
|
||||||
@ -36,10 +35,4 @@ const { product } = defineProps<{
|
|||||||
|
|
||||||
// 展示的折叠面板
|
// 展示的折叠面板
|
||||||
const activeNames = ref(['basicInfo'])
|
const activeNames = ref(['basicInfo'])
|
||||||
|
|
||||||
/** 初始化 */
|
|
||||||
const productCategoryList = ref([]) // 产品分类树
|
|
||||||
onMounted(async () => {
|
|
||||||
productCategoryList.value = await ProductCategoryApi.getProductCategoryList({})
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -133,7 +133,6 @@ import { dateFormatter } from '@/utils/formatTime'
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import * as ProductApi from '@/api/crm/product'
|
import * as ProductApi from '@/api/crm/product'
|
||||||
import ProductForm from './ProductForm.vue'
|
import ProductForm from './ProductForm.vue'
|
||||||
import { fenToYuanFormat } from '@/utils/formatter'
|
|
||||||
import { erpPriceTableColumnFormatter } from '@/utils'
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmProduct' })
|
defineOptions({ name: 'CrmProduct' })
|
||||||
|
Loading…
Reference in New Issue
Block a user