feat: 拉取代码
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import UserAPI from "@/api/product/commonUnits";
|
||||
import UserAPI from "@/api/product/index";
|
||||
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UserAPI from "@/api/product/commonUnits";
|
||||
import UserAPI from "@/api/product/index";
|
||||
import RoleAPI from "@/api/system/role";
|
||||
import type { UserPageQuery } from "@/api/system/user";
|
||||
import type { IContentConfig } from "@/components/CURD/types";
|
||||
@@ -15,9 +15,12 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
pageSize: 20,
|
||||
pageSizes: [10, 20, 30, 50],
|
||||
},
|
||||
indexActionData: { name: "", orderBy: "name asc" },
|
||||
indexActionData: {},
|
||||
indexAction: function (params) {
|
||||
return UserAPI.getPage(params);
|
||||
let obj = { ...params, ...params.times }
|
||||
obj.createBeginTime = obj['0']
|
||||
obj.createEndTime = obj['1']
|
||||
return UserAPI.getPage(obj);
|
||||
},
|
||||
deleteAction: UserAPI.deleteByIds,
|
||||
// importAction(file) {
|
||||
@@ -39,11 +42,35 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
pk: "id",
|
||||
toolbar: [
|
||||
"add",
|
||||
// {
|
||||
// icon: "edit",
|
||||
// text: "库存预警",
|
||||
// type: "info",
|
||||
// name: "custom1",
|
||||
// auth: "import",
|
||||
// },
|
||||
],
|
||||
cols: [
|
||||
// { type: "selection", width: 50, align: "center" },
|
||||
{ label: "单位名称", align: "center", prop: "name" },
|
||||
{ label: "排序", align: "center", prop: "id" },
|
||||
{ label: "封面图", align: "center", prop: "coverImg", templet: "image" },
|
||||
{ label: "分类名称", align: "center", prop: "categoryName", },
|
||||
{ label: "售价", align: "center", prop: "id" },
|
||||
{ label: "规格名称", align: "center", prop: "specName" },
|
||||
{ label: "库存", align: "center", prop: "stockNumber" },
|
||||
{ label: "耗材信息", align: "center", prop: "id" },
|
||||
{
|
||||
label: "上架",
|
||||
align: "center",
|
||||
prop: "isSale",
|
||||
templet: "switch",
|
||||
slotName: "status",
|
||||
}, {
|
||||
label: "是否启用库存",
|
||||
align: "center",
|
||||
prop: "isStock",
|
||||
templet: "switch",
|
||||
slotName: "status",
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
align: "center",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import UserAPI from "@/api/product/commonUnits";
|
||||
import UserAPI from "@/api/product/index";
|
||||
|
||||
import type { IModalConfig } from "@/components/CURD/types";
|
||||
import { DeviceEnum } from "@/enums/DeviceEnum";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import DeptAPI from "@/api/system/dept";
|
||||
import UserAPI from "@/api/product/productclassification";
|
||||
import DeptAPI from "@/api/product/specificationsconfig";
|
||||
|
||||
import type { ISearchConfig } from "@/components/CURD/types";
|
||||
|
||||
const searchConfig: ISearchConfig = {
|
||||
@@ -6,38 +8,92 @@ const searchConfig: ISearchConfig = {
|
||||
formItems: [
|
||||
{
|
||||
type: "input",
|
||||
label: "单位名称",
|
||||
label: "商品名称",
|
||||
prop: "name",
|
||||
attrs: {
|
||||
placeholder: "请输入单位名称",
|
||||
placeholder: "请输入商品名称",
|
||||
clearable: true,
|
||||
style: {
|
||||
width: "200px",
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// type: "tree-select",
|
||||
// label: "设备类型",
|
||||
// prop: "deptId",
|
||||
// attrs: {
|
||||
// placeholder: "请选择设备类型",
|
||||
// data: [],
|
||||
// filterable: true,
|
||||
// "check-strictly": true,
|
||||
// "render-after-expand": false,
|
||||
// clearable: true,
|
||||
// style: {
|
||||
// width: "150px",
|
||||
// },
|
||||
// },
|
||||
// async initFn(formItem) {
|
||||
// formItem.attrs.data = await DeptAPI.getOptions();
|
||||
// // 注意:如果initFn函数不是箭头函数,this会指向此配置项对象,那么也就可以用this来替代形参formItem
|
||||
// // this.attrs!.data = await DeptAPI.getOptions();
|
||||
// },
|
||||
// },
|
||||
{
|
||||
type: "select",
|
||||
label: "商品分类",
|
||||
prop: "categoryId",
|
||||
attrs: {
|
||||
placeholder: "请选择商品分类",
|
||||
clearable: true,
|
||||
style: {
|
||||
width: "200px",
|
||||
},
|
||||
},
|
||||
options: [],
|
||||
async initFn(formItem) {
|
||||
formItem.options = await UserAPI.getList();
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
type: "tree-select",
|
||||
label: "商品规格",
|
||||
prop: "specId",
|
||||
attrs: {
|
||||
placeholder: "请选择商品规格",
|
||||
data: [],
|
||||
filterable: true,
|
||||
"check-strictly": true,
|
||||
"render-after-expand": false,
|
||||
clearable: true,
|
||||
style: {
|
||||
width: "200px",
|
||||
},
|
||||
props: {
|
||||
label: 'name', // 指定节点显示的文本字段为 name
|
||||
value: 'id' // 指定节点的值字段为 id
|
||||
}
|
||||
},
|
||||
async initFn(formItem) {
|
||||
formItem.attrs.data = await DeptAPI.getPage();
|
||||
// 注意:如果initFn函数不是箭头函数,this会指向此配置项对象,那么也就可以用this来替代形参formItem
|
||||
// this.attrs!.data = await DeptAPI.getOptions();
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "date-picker",
|
||||
label: "日期",
|
||||
prop: "times",
|
||||
attrs: {
|
||||
type: "daterange",
|
||||
"range-separator": "~",
|
||||
"start-placeholder": "开始时间",
|
||||
"end-placeholder": "截止时间",
|
||||
"value-format": "YYYY-MM-DD",
|
||||
style: {
|
||||
width: "240px",
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "select",
|
||||
label: "排序",
|
||||
prop: "orderBy",
|
||||
attrs: {
|
||||
placeholder: "请选择商品分类",
|
||||
clearable: true,
|
||||
style: {
|
||||
width: "200px",
|
||||
},
|
||||
},
|
||||
options: [{
|
||||
label: "创建时间",
|
||||
value: "create_time asc"
|
||||
}, {
|
||||
label: "数量由低到高",
|
||||
value: "stock_number asc"
|
||||
}],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
100
src/views/product/indexconfig/statistics.vue
Normal file
100
src/views/product/indexconfig/statistics.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<div class="statistics">
|
||||
<div style="width: 200px;">
|
||||
<el-icon class="iconStyle">
|
||||
<PieChart />
|
||||
</el-icon>
|
||||
<span>商品种树</span>
|
||||
<span>{{ datas.totalRow }}</span>
|
||||
</div>
|
||||
<div style="width: 300px;">
|
||||
<el-icon class="iconStyle">
|
||||
<SortUp />
|
||||
</el-icon>
|
||||
<div>
|
||||
<div><span>增加数量:</span><span>0</span></div>
|
||||
<div style="display: flex;">
|
||||
<div>
|
||||
<span>手动增加:</span><span>0</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px;color: #ccc;">|</span>
|
||||
<div>
|
||||
<span>退货:</span><span>0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 400px;">
|
||||
<el-icon class="iconStyle">
|
||||
<SortDown />
|
||||
</el-icon>
|
||||
<div>
|
||||
<div><span>减少数量:</span><span>0</span></div>
|
||||
<div style="display: flex;">
|
||||
<div>
|
||||
<span>手动减少:</span><span>0</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px;color: #ccc;">|</span>
|
||||
<div>
|
||||
<span>销售量:</span><span>0</span>
|
||||
</div>
|
||||
<span style="margin: 0 20px;color: #ccc;">|</span>
|
||||
<div>
|
||||
<span>报损:</span><span>0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import UserAPI from "@/api/product/index";
|
||||
import { onMounted, reactive } from "vue";
|
||||
onMounted(() => {
|
||||
getPage();
|
||||
})
|
||||
let datas = reactive({
|
||||
totalRow: 0
|
||||
})
|
||||
async function getPage() {
|
||||
let res = await UserAPI.getPage();
|
||||
datas.totalRow = res.totalRow
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.statistics {
|
||||
border: 1px solid #e4e7ed;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 10px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
>div {
|
||||
height: 80px;
|
||||
background-color: #f4f9ff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
|
||||
padding: 20px;
|
||||
|
||||
.iconStyle {
|
||||
background-color: #d4e9fe;
|
||||
border-radius: 50%;
|
||||
padding: 6px;
|
||||
font-size: 36px;
|
||||
color: #3f9eff;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user