shish пре 3 година
родитељ
комит
996e18f7d3

+ 3 - 3
hdApp/src/admin/goods/add.vue

@@ -14,7 +14,7 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="true" :arrow="true">
-          <view class="tui-title required">类</view>
+          <view class="tui-title required">类</view>
           <view v-if="!$util.isEmpty(form.kindName)" style="width:480upx" @click.stop="changeKind()">{{form.kindName}}</view>
           <view v-else style="color:#CCCCCC;width:480upx" @click.stop="changeKind()">请选择</view>
         </tui-list-cell>
@@ -201,11 +201,11 @@ export default {
       }
 
       if(!this.form.kindId || Number(this.form.kindId) == 0){
-        this.$msg('请选择类')
+        this.$msg('请选择类')
         return false
       }
       if (this.$util.isEmpty(this.form.kindName)) {
-        this.$msg("请选择类哦")
+        this.$msg("请选择类哦")
         return false
       }
 

+ 2 - 2
hdApp/src/admin/goods/cgNewPlant.vue

@@ -4,7 +4,7 @@
       <view class="module-com input-line-wrap">
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">类</view>
+          <view class="tui-title">类</view>
           <view style="color:#3385FF">{{option.kindName ? option.kindName : ''}}</view>
         </tui-list-cell>
 
@@ -151,7 +151,7 @@ export default {
       }
       let kindId = this.option.kindId ? this.option.kindId : 0
       if(Number(kindId) <= 0){
-        this.$msg('请选择类')
+        this.$msg('请选择类')
         return false
       }
       let kindName = this.option.kindName ? this.option.kindName : ''

+ 3 - 3
hdApp/src/admin/goods/detail.vue

@@ -11,7 +11,7 @@
           <input v-model="form.price" @focus="form.price=''" placeholder-class="phcolor" class="tui-input" name="price" placeholder="请输入" maxlength="50" type="digit" />
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="true" :arrow="true">
-          <view class="tui-title required">类</view>
+          <view class="tui-title required">类</view>
           <view v-if="!$util.isEmpty(form.kindName)" style="width:480upx;" @click.stop="changeKind()">{{form.kindName}}</view>
           <view v-else style="color:#CCCCCC;width:480upx;" @click.stop="changeKind()">请选择</view>
         </tui-list-cell>
@@ -275,11 +275,11 @@ export default {
       this.form.categoryIdList = newIds
 
       if(!this.form.kindId || Number(this.form.kindId) == 0){
-        this.$msg('请选择类')
+        this.$msg('请选择类')
         return false
       }
       if (this.$util.isEmpty(this.form.kindName)) {
-        this.$msg("请选择类哦")
+        this.$msg("请选择类哦")
         return false
       }
 

+ 2 - 2
hdApp/src/admin/goods/kind.vue

@@ -23,7 +23,7 @@
 		</view>
 
 		<view class="app-footer">
-			<button class="admin-button-com big blue" @click="addKindFn">添加类</button>
+			<button class="admin-button-com big blue" @click="addKindFn">添加类</button>
 		</view>
 
 		<modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="modifyModalClick" width="92%" :title="modifyTitle" padding="30rpx 30rpx">
@@ -154,7 +154,7 @@ export default {
 		},
 		kindAddOrEdit() {
 			if (!this.modifyForm.name) {
-				this.$msg('请输入类名称')
+				this.$msg('请输入类名称')
 				return false
 			}
 			let form = JSON.parse(JSON.stringify(this.modifyForm))

+ 3 - 2
hdApp/src/admin/home/apply.vue

@@ -42,7 +42,7 @@ export default {
             list:[
                 { name: "商品", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/list",pf:1},
                 { name: "商城分类", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/category",pf:1},
-                { name: "类", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/kind",pf:1},
+                { name: "类", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/kind",pf:1},
                 { name: "涨价设置", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/price-increase",pf:1},
                 { name: "运费规则", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/freight",pf:1},
                 { name: "商品盘点", img: `${this.$constant.imgUrl}/ghs/home/pandian.png`, url: "/admin/goods/pdList",pf:1}
@@ -79,7 +79,8 @@ export default {
             {name: "花材销量",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/productSale",pf:1},
             // {name: "客户下单榜",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/customSale",pf:1},
             {name: "采购统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgStat",pf:1},
-            {name: "采购花材",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgItem",pf:1}
+            {name: "采购花材",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/cgItem",pf:1},
+            {name: "花束统计",img: `${this.$constant.imgUrl}/ghs/home/jyzk.png`,url: "/admin/stat/kind",pf:1}
           ]
         }
       ]

+ 2 - 2
hdApp/src/admin/order/workOrder.vue

@@ -7,7 +7,7 @@
        <view class="module-com input-line-wrap">
 
         <tui-list-cell class="line-cell" :arrow="true">
-          <view class="tui-title">类</view>
+          <view class="tui-title">类</view>
           <picker mode="selector" :value="form.kindId" :range="kindListData" range-key="name" @change="changeKindFn" class="tui-input" >
             <input v-model="form.kindId" name="kindId" type="text" hidden />
             <view v-if="form.kindId" style="height:45upx;" >{{ kindSelectedData.name }}</view>
@@ -16,7 +16,7 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :arrow="true">
-          <view class="tui-title">支数</view>
+          <view class="tui-title">单份支数</view>
           <picker mode="selector" :value="form.flowerNum" :range="flowerNumList" range-key="num" @change="changeNumFn" class="tui-input" >
             <input v-model="form.flowerNum" name="flowerNum" type="text" hidden />
             <view v-if="form.flowerNum" style="height:45upx;" >{{ numSelectedData.name }}</view>

+ 167 - 0
hdApp/src/admin/stat/kind.vue

@@ -0,0 +1,167 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<view class="top-bar">
+			<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
+		</view>
+		<scroll-view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block>
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th><view style="color:black;">类型</view></t-th>
+							<t-th><view style="color:black;">制作数量</view></t-th>
+							<t-th><view style="color:black;">销售数量</view></t-th>
+						</t-tr>
+						<t-tr v-for="(item, inIndex) in profit.kindStat" :key="inIndex">
+							<t-td><view style="color:black;font-size:25upx;">{{item.kindName}}</view></t-td>
+							<t-td><view style="color:black;font-size:25upx;">{{item.makeNum}}</view></t-td>
+							<t-td><view>{{item.saleNum}}</view></t-td>
+						</t-tr>
+						<t-tr>
+							<t-td><view style="color:black;font-size:30upx;font-weight:bold;margin-top:50upx;">拆散花材用量</view></t-td>
+						</t-tr>
+						<!--同个节点v-for key重复会报错,所以再包一层-->
+						<view>
+							<t-tr v-for="(item, exIndex) in profit.partStat" :key="exIndex">
+								<t-td><view style="color:black;font-size:25upx;">{{item.name}}</view></t-td>
+								<t-td><view style="color:black;font-size:25upx;">{{item.num}}扎</view></t-td>
+								<t-td></t-td>
+							</t-tr>
+						</view>
+					</t-table>
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getKindStatProfit } from "@/api/stat";
+import { list } from "@/mixins";
+import ShopSelect from "@/components/module/shopSelect";
+import DateSelect from "@/components/module/dateSelect";
+import {mapActions, mapGetters} from "vuex";
+export default {
+	components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect},
+	mixins: [list],
+	computed: {		
+		...mapGetters(["getDictionariesInfo","getLoginInfo"])
+	},
+	data() {
+		return {
+			params:{
+				searchTime:'',
+				startTime: "",
+				endTime: "",
+			},
+			profit:[],
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getStatList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	methods: {
+		...mapActions(['setUserShopAll']),
+		selectDateFn(val) {
+			this.params = {...this.params,...val}
+			this.init();			
+		},
+		init() {
+			this.getStatList();
+		},
+		getStatList() {
+			let that = this
+			getKindStatProfit(this.params).then(res => {
+				that.profit = res.data
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		top:20upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top: 80upx;
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			/deep/.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 2 - 2
hdApp/src/api/goods/index.js

@@ -1,11 +1,11 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-//添加
+//添加
 export const addKind = data => {
 	return https.post('/kind/add', data)
 }
 
-//修改
+//修改
 export const updateKind = data => {
 	return https.post('/kind/update', data)
 }

+ 4 - 0
hdApp/src/api/stat/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getKindStatProfit = data => {
+	return https.get('/stat-kind/profile', data)
+}
+
 export const getStatCgItem = data => {
 	return https.get('/stat-cg/profile', data)
 }

+ 5 - 4
hdApp/src/pages.json

@@ -15,7 +15,7 @@
 			"root": "admin/work",
 			"pages": [
 				{"path": "add","style": {"navigationBarTitleText": "新建制作单"}},
-				{"path": "statCat","style": {"navigationBarTitleText": "制作统计"}},
+				{"path": "statCat","style": {"navigationBarTitleText": "花束统计"}},
 				{"path": "statCatItem","style": {"navigationBarTitleText": "明细"}},
 				{"path": "addResult","style": {"navigationBarTitleText": "新建成功"}},
 				{"path": "list","style": {"navigationBarTitleText": "列表","enablePullDownRefresh": true}},
@@ -238,7 +238,7 @@
 			"pages": [
 				{ "path": "list", "style": { "navigationBarTitleText": "商品列表" } },
 				{ "path": "category", "style": { "navigationBarTitleText": "分类" } },
-				{ "path": "kind", "style": { "navigationBarTitleText": "类" } },
+				{ "path": "kind", "style": { "navigationBarTitleText": "类" } },
 				{ "path": "detail", "style": { "navigationBarTitleText": "商品详情" } },
 				{ "path": "add", "style": { "navigationBarTitleText": "新增" } },
 				{ "path": "selectItem", "style": { "navigationBarTitleText": "选择花材" } },
@@ -253,7 +253,7 @@
 				{ "path": "plantConfirm", "style": { "navigationBarTitleText": "确认采购" } },
 				{ "path": "plantResult", "style": { "navigationBarTitleText": "结果" } },
 				{ "path": "cgNewPlant", "style": { "navigationBarTitleText": "新商品采购" } },
-				{ "path": "selectKind", "style": { "navigationBarTitleText": "选择类" } },
+				{ "path": "selectKind", "style": { "navigationBarTitleText": "选择类" } },
 				{ "path": "cgNewPlantResult", "style": { "navigationBarTitleText": "采购成功" } },
 				{ "path": "stockChange", "style": { "navigationBarTitleText": "库存变动记录" } },
 				{ "path": "plantCg", "style": { "navigationBarTitleText": "商品采购记录" } },
@@ -297,7 +297,8 @@
 				{"path": "incomeStat","style": {"navigationBarTitleText": "应收款"}},
 				{"path": "cgStat","style": {"navigationBarTitleText": "采购统计"}},
 				{"path": "cgItem","style": {"navigationBarTitleText": "采购花材"}},
-				{"path": "mayPayStat","style": {"navigationBarTitleText": "应付款"}}
+				{"path": "mayPayStat","style": {"navigationBarTitleText": "应付款"}},
+				{"path": "kind","style": {"navigationBarTitleText": "花束统计"}}
 			]
 		},
 		{

+ 4 - 1
hdPad/src/pages/home/components/createWork.vue

@@ -54,6 +54,7 @@ export default {
             kindList:[],
             form:{
                 kindId:0,
+                kindName:'',
                 num:1,
                 flowerNum:0,
                 print:1
@@ -76,6 +77,7 @@ export default {
                 this.kindList = res.data.list ? res.data.list : []
                 if(!this.$util.isEmpty(this.kindList)){
                     this.form.kindId = this.kindList[0].id
+                    this.form.kindName = this.kindList[0].name
                 }
             }
         })
@@ -89,6 +91,7 @@ export default {
         },
         setKind(info){
             this.form.kindId = info.id
+            this.form.kindName = info.name
         },
         cancelCreate(){
             this.$emit('cancelCreate')
@@ -105,7 +108,7 @@ export default {
             let that = this
             let product = this.selectList.map(i=>({ productId:i.id, unitType: i.unitType, num: i.currentNum}))
 			uni.showLoading({mask:true})
-			createWorkFn({...this.form,product:JSON.stringify(product),complete:1}).then(res=>{
+			createWorkFn({...this.form,product:JSON.stringify(product),complete:1,name:that.form.kindName}).then(res=>{
 				uni.hideLoading()
 				if(res.code == 1){
 					that.$msg(res.msg)