【crm:优化产品及产品分类】

(cherry picked from commit dde61c29a0)
pull/420/head
ZanGe丶 2023-12-03 21:24:38 +08:00 committed by shizhong
parent 7c9cf67fb0
commit 776fed6a5d
6 changed files with 86 additions and 91 deletions

View File

@ -33,7 +33,7 @@
</template>
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import * as ProductCategoryApi from '@/api/crm/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import * as ProductApi from '@/api/crm/product'
import { formatDate } from '@/utils/formatTime'
import { fenToYuan } from '@/utils'

View File

@ -8,63 +8,87 @@
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="产品名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="产品编码" prop="no">
<el-input v-model="formData.no" placeholder="请输入产品编码" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input type="number" v-model="formData.price" placeholder="请输入价格" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="产品分类" prop="categoryId">
<el-cascader
v-model="formData.categoryId"
:options="productCategoryList"
:props="defaultProps"
class="w-1/1"
clearable
placeholder="请选择产品分类"
filterable
/>
</el-form-item>
<el-form-item label="产品描述" prop="description">
<el-input v-model="formData.description" placeholder="请输入产品描述" />
</el-form-item>
<el-form-item label="负责人" prop="ownerUserId">
<el-select
v-model="formData.ownerUserId"
placeholder="请选择负责人"
:disabled="formData.id"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.nickname"
:value="user.id"
/>
</el-select>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="no">
<el-input v-model="formData.no" placeholder="请输入产品编码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_UNIT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="价格" prop="price">
<el-input type="number" v-model="formData.price" placeholder="请输入价格" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品分类" prop="categoryId">
<el-cascader
v-model="formData.categoryId"
:options="productCategoryList"
:props="defaultProps"
class="w-1/1"
clearable
placeholder="请选择产品分类"
filterable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产品描述" prop="description">
<el-input v-model="formData.description" placeholder="请输入产品描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人" prop="ownerUserId">
<el-select
v-model="formData.ownerUserId"
placeholder="请选择负责人"
:disabled="formData.id"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.nickname"
:value="user.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
@ -75,7 +99,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/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import { defaultProps, handleTree } from '@/utils/tree'
import { getSimpleUserList, UserVO } from '@/api/system/user'
import { useUserStore } from '@/store/modules/user'

View File

@ -17,15 +17,6 @@
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产品编码" prop="no">
<el-input
v-model="queryParams.no"
placeholder="请输入产品编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option
@ -36,26 +27,6 @@
/>
</el-select>
</el-form-item>
<el-form-item label="产品分类" prop="categoryId">
<el-input
v-model="queryParams.categoryId"
placeholder="请选择产品分类"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@ -167,7 +138,7 @@ 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/productCategory'
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
import { getSimpleUserList, UserVO } from '@/api/system/user'
defineOptions({ name: 'CrmProduct' })

View File

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

View File

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