mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-31 03:04:07 +08:00
🔨 CRM:优化产品代码的实现
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option
|
||||
v-for="dict in getBoolDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@@ -49,35 +49,35 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<!--<el-table-column label="主键id" align="center" prop="id" />-->
|
||||
<el-table-column label="产品名称" align="center" prop="name" />
|
||||
<el-table-column label="产品编码" align="center" prop="no" />
|
||||
<el-table-column label="单位" align="center" prop="unit">
|
||||
<el-table-column label="产品类型" align="center" prop="categoryName" />
|
||||
<el-table-column label="产品单位" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格" align="center" prop="price">
|
||||
<template #default="{ row }">
|
||||
{{ fenToYuan(row.price) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<el-table-column label="产品编码" align="center" prop="no" />
|
||||
<el-table-column
|
||||
label="价格(元)"
|
||||
align="center"
|
||||
prop="price"
|
||||
:formatter="fenToYuanFormat"
|
||||
/>
|
||||
<el-table-column label="产品描述" align="center" prop="description" />
|
||||
<el-table-column label="是否上下架" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品分类" align="center" prop="categoryId">
|
||||
<template #default="{ row }">
|
||||
<span>{{ productCategoryList?.find((c) => c.id === row.categoryId)?.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品描述" align="center" prop="description" />
|
||||
<el-table-column label="负责人" align="center" prop="ownerUserId">
|
||||
<template #default="{ row }">
|
||||
<span>{{ userList?.find((c) => c.id === row.ownerUserId)?.nickname }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="ownerUserName" />
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
align="center"
|
||||
prop="updateTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="创建" align="center" prop="creatorName" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
@@ -125,21 +125,18 @@
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ProductForm ref="formRef" @success="getList" />
|
||||
|
||||
<!-- 表单弹窗:详情 -->
|
||||
<ProductDetail ref="detailRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import ProductForm from './ProductForm.vue'
|
||||
import ProductDetail from './ProductDetail.vue'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
||||
import { getSimpleUserList, UserVO } from '@/api/system/user'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
|
||||
defineOptions({ name: 'CrmProduct' })
|
||||
|
||||
@@ -152,15 +149,8 @@ const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
no: null,
|
||||
unit: null,
|
||||
price: null,
|
||||
status: null,
|
||||
categoryId: null,
|
||||
description: null,
|
||||
ownerUserId: null,
|
||||
createTime: []
|
||||
name: undefined,
|
||||
status: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
@@ -228,13 +218,8 @@ const handleExport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const productCategoryList = ref([]) // 产品分类树
|
||||
const userList = ref<UserVO[]>([]) // 系统用户
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
productCategoryList.value = await ProductCategoryApi.getProductCategoryList({})
|
||||
userList.value = await getSimpleUserList()
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user