فهرست منبع

开启财务权限和查看财务

shish 7 ماه پیش
والد
کامیت
308ba53fba
4فایلهای تغییر یافته به همراه36 افزوده شده و 18 حذف شده
  1. 24 10
      ghsApp/src/admin/billing/affirm.vue
  2. 4 0
      ghsApp/src/api/staff/index.js
  3. 7 7
      ghsApp/src/mixins/product.js
  4. 1 1
      ghsApp/src/pagesOrder/detail.vue

+ 24 - 10
ghsApp/src/admin/billing/affirm.vue

@@ -31,9 +31,8 @@
 
                       <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-if="item.bigCount > 0">¥{{ parseFloat((Number(item.bigCount)*Number(item.userPrice)).toFixed(2)) }}</text>
                       <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else>¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
-                      <text :class="[Number(item.cost) > Number(item.userPrice) && item.bigCount > 0 ? 'warning-price' : 'normal-price']" style="position: absolute;right:0upx;top:55upx;font-size:24upx;font-weight:bold;width:350upx;text-align:right;">
-                        ¥{{ item.cost?parseFloat(item.cost):0 }}
-                        <text style="margin-left:8upx;" v-if="Number(item.cost) > Number(item.userPrice) && item.bigCount > 0">售价过低</text>
+                      <text v-if="showFinance==1" :class="[Number(item.avCost) > Number(item.userPrice) && item.bigCount > 0 ? 'warning-price' : 'normal-price']" style="position: absolute;right:0upx;top:55upx;font-size:24upx;font-weight:bold;width:350upx;text-align:right;">
+                        成本¥{{ item.avCost?parseFloat(item.avCost):0 }}<text style="margin-left:8upx;" v-if="Number(item.avCost) > Number(item.userPrice) && item.bigCount > 0">售价过低</text>
                       </text>
 
                       <view class="open-bx" >
@@ -54,14 +53,15 @@
               <view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
               <view class="operate-view" v-else @click="gobackEvent" style="font-size:32upx;font-weight:bold;"><text class="iconfont icongouwuche" style="margin-right:5upx;"></text>返回修改</view>
               <view class="describe-view">
-                <text>合计 ¥{{ allPrice }},</text>
-                <text>¥{{ allCount.cost }},</text>
-                <text>¥{{ parseFloat((Number(allPrice)-Number(allCount.cost)).toFixed(2)) }}</text>
+                <text>合计 ¥{{ allPrice }}</text>
+                <block v-if="showFinance==1">
+                  <text>,成本 ¥{{ allCount.avCost }}</text>
+                  <text>,利润 ¥{{ parseFloat((Number(allPrice)-Number(allCount.avCost)).toFixed(2)) }}</text>
+                </block>
               </view>
             </view>
             <view class="summary-bar">
-              <view class="operate-view" v-if="isScanEnv" @click="pageToItemList()"><text class="iconfont iconzeng"></text>手动添加花材</view>
-              <view class="operate-view" v-if="isScanEnv == false"><text> </text></view>
+              <view class="operate-view" v-if="hasFinance==1" @click="getMyFinance">查看财务</view>
               <view class="describe-view">
                 <text>{{ selectList.length }}种,</text>
                 <text v-if="Number(totalItemNum.big)>0">{{totalItemNum.big?parseFloat(totalItemNum.big):0}}扎</text>
@@ -306,7 +306,7 @@ import { getAllStaff } from "@/api/shop-admin"
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member"
 import ModalModule from "@/components/plugin/modal"
-import { getAllWl } from "@/api/shop"
+import { getStaffInfo } from "@/api/staff"
 import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
 export default {
   name: "affirm",
@@ -376,6 +376,8 @@ export default {
       currentShop:{default:0},
       book:0,
       selectStaff: { id: '', name: '' },
+      showFinance:0,
+      hasFinance:0,
     };
   },
   onLoad (option) {
@@ -422,6 +424,15 @@ export default {
 	  //#endif
 
     this.listenScanItem()
+
+
+    getStaffInfo().then(res=>{
+      if(res.code == 1){
+        let staffInfo = res.data.staff?res.data.staff:[]
+        this.hasFinance = staffInfo.finance?staffInfo.finance:0
+      }
+    })
+
   },
 	onShow(){
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
@@ -502,6 +513,9 @@ export default {
   },
   methods: {
     ...mapActions(["initMerchantInfo"]),
+    getMyFinance(){
+      this.showFinance = 1
+    },
     bindHistoryDateChange(){
 			this.pickerType = 'history'
 			this.showPicker = true
@@ -873,7 +887,7 @@ export default {
           display: flex;
           align-items: center;
           color: #333;
-          font-size: 28upx;
+          font-size: 26upx;
           font-weight:bold;
           .price {
             margin-left:8upx;

+ 4 - 0
ghsApp/src/api/staff/index.js

@@ -82,4 +82,8 @@ export const getStaffAuthCode = data => {
 //添加员工
 export const createStaff = data => {
 	return https.post('/shop-admin/add-staff', data)
+}
+
+export const getStaffInfo = data => {
+	return https.get('/shop-admin/get-staff-info', data)
 }

+ 7 - 7
ghsApp/src/mixins/product.js

@@ -83,7 +83,7 @@ export default {
 			let bigLength = 0;
 			let smallLength = 0;
 			let weight = 0
-			let cost = 0
+			let avCost = 0
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					bigLength += Number(item.bigCount)
@@ -92,17 +92,17 @@ export default {
 					let currentWeight = Number(thisWeight)*Number(item.bigCount)
 					weight = Number(weight) + Number(currentWeight)
 
-					let thisCost = item.cost ? item.cost : 0
-					let currentCost = Number(thisCost)*Number(item.bigCount)
-					cost = Number(cost) + Number(currentCost)
+					let thisAvCost = item.avCost ? item.avCost : 0
+					let currentAvCost = Number(thisAvCost)*Number(item.bigCount)
+					avCost = Number(avCost) + Number(currentAvCost)
 				}
 				weight = weight.toFixed(2)
 				weight = parseFloat(weight)
 
-				cost = cost.toFixed(2)
-				cost = parseFloat(cost)
+				avCost = avCost.toFixed(2)
+				avCost = parseFloat(avCost)
 			}
-			return {bigLength:bigLength,smallLength:smallLength,weight:weight,cost:cost};
+			return {bigLength:bigLength,smallLength:smallLength,weight:weight,avCost:avCost};
 		},
 		//当前选中商品列表中是否有没有库存的商品
 		hasNoStock() {

+ 1 - 1
ghsApp/src/pagesOrder/detail.vue

@@ -381,7 +381,7 @@
 
 				<block v-if="detailInfo.staffFinance==1">
 					<tui-list-cell class="line-cell" :hover="false" @click="toggleFinanceInfo">
-						<div class="tui-title">财务信息</div>
+						<div class="tui-title">查看财务</div>
 						<div v-if="showFinanceInfo" class="detail-price_box" style="font-weight:normal;font-size:30upx;">成本¥{{ detailInfo.remainCost?parseFloat(detailInfo.remainCost):0 }} 利润¥{{ detailInfo.profit?parseFloat(detailInfo.profit):0 }}</div>
 						<div v-else class="detail-price_box" style="color:#ada8a8;font-size:30upx;font-weight:normal;">点击查看</div>
 					</tui-list-cell>