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

This commit is contained in:
ZanGe丶 2023-12-03 21:24:38 +08:00
parent c322959c40
commit dde61c29a0
6 changed files with 86 additions and 91 deletions

View File

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

View File

@ -8,12 +8,20 @@
label-width="100px" label-width="100px"
v-loading="formLoading" v-loading="formLoading"
> >
<el-row>
<el-col :span="12">
<el-form-item label="产品名称" prop="name"> <el-form-item label="产品名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入产品名称" /> <el-input v-model="formData.name" placeholder="请输入产品名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="no"> <el-form-item label="产品编码" prop="no">
<el-input v-model="formData.no" placeholder="请输入产品编码" /> <el-input v-model="formData.no" placeholder="请输入产品编码" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位"> <el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位">
<el-option <el-option
@ -24,9 +32,15 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="价格" prop="price"> <el-form-item label="价格" prop="price">
<el-input type="number" v-model="formData.price" placeholder="请输入价格" /> <el-input type="number" v-model="formData.price" placeholder="请输入价格" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态"> <el-select v-model="formData.status" placeholder="请选择状态">
<el-option <el-option
@ -37,6 +51,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品分类" prop="categoryId"> <el-form-item label="产品分类" prop="categoryId">
<el-cascader <el-cascader
v-model="formData.categoryId" v-model="formData.categoryId"
@ -48,9 +64,15 @@
filterable filterable
/> />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产品描述" prop="description"> <el-form-item label="产品描述" prop="description">
<el-input v-model="formData.description" placeholder="请输入产品描述" /> <el-input v-model="formData.description" placeholder="请输入产品描述" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人" prop="ownerUserId"> <el-form-item label="负责人" prop="ownerUserId">
<el-select <el-select
v-model="formData.ownerUserId" v-model="formData.ownerUserId"
@ -65,6 +87,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
@ -75,7 +99,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/productCategory' import * as ProductCategoryApi from '@/api/crm/product/productCategory'
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'

View File

@ -17,15 +17,6 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </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-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option <el-option
@ -36,26 +27,6 @@
/> />
</el-select> </el-select>
</el-form-item> </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-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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> <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 ProductForm from './ProductForm.vue'
import ProductDetail from './ProductDetail.vue' import ProductDetail from './ProductDetail.vue'
import { fenToYuan } from '@/utils' 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' import { getSimpleUserList, UserVO } from '@/api/system/user'
defineOptions({ name: 'CrmProduct' }) defineOptions({ name: 'CrmProduct' })

View File

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

View File

@ -74,7 +74,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' 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 ProductCategoryForm from './ProductCategoryForm.vue'
import { handleTree } from '@/utils/tree' import { handleTree } from '@/utils/tree'