shish 4 лет назад
Родитель
Сommit
14f4a4803d

+ 38 - 2
ghsApp/src/admin/billing/affirm.vue

@@ -151,6 +151,14 @@
             <text v-if="modifyPrice > 0 && modifyPrice < finalPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((finalPrice-modifyPrice).toFixed(2))}}</text>
           </tui-list-cell>
 
+          <tui-list-cell class="line-cell" :arrow="true">
+            <div class="tui-title">开单人</div>
+            <picker mode="selector" :value="form.shopAdminId" :range="staffList" range-key="name" @change="kdChange" class="tui-input" >
+              <input v-model="form.shopAdminId" name="shopAdminId" type="text" hidden />
+              <div style="padding:6upx 0 6upx 0;">{{form.shopAdminName}}</div>
+            </picker>
+          </tui-list-cell>
+
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">备注</view>
 						<textarea style="height: 100upx" v-model="form.remark" placeholder="选填" />
@@ -187,6 +195,7 @@ import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
 const formUtil = require("@/utils/formValidation.js");
 import { createOrder, updateOrder } from "@/api/order/index";
+import { getAllStaff } from "@/api/shop-admin"
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member";
 import ModalModule from "@/components/plugin/modal";
@@ -211,6 +220,7 @@ export default {
     return {
       autoLoad: false,
       isBilling: true,
+      staffList:[],
 			payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayindex:0,
       form: {
@@ -232,7 +242,8 @@ export default {
         remark:"",
         payWay:0,
         needPrint:1,//订单生成时打印订单1需要2不需要
-        hasPay:0
+        hasPay:0,
+        shopAdminName:''
       },
       showCustomer: false,
       customInfo:{discount:1},
@@ -261,7 +272,7 @@ export default {
     } else {
       uni.setNavigationBarTitle({ title: this.getMerchantInfo.name, })
     }
-    
+
     //默认自取
     this.setSendType(2);
 
@@ -291,6 +302,22 @@ export default {
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
 			this.showCustomer = true;
 		}
+
+    //获取所有在职员工
+    getAllStaff().then(res=>{
+      if(res.code == 1){
+        this.staffList = res.data.list
+        if(!this.$util.isEmpty(this.staffList)){
+          for(const ele of this.staffList){
+            if(this.getLoginInfo.shopAdminId == ele.id){
+              this.form.shopAdminId = ele.id
+              this.form.shopAdminName = ele.name
+            }
+          }
+        }
+      }
+    })
+
 	},
 	onUnload(){
 			uni.removeStorageSync('newClient');
@@ -389,6 +416,15 @@ export default {
 		},
     init () {
       this._getDet();
+    },
+    kdChange(e){
+			let index = e.detail.value
+      if(!this.$util.isEmpty(this.staffList)){
+        if(this.staffList[index]){
+          this.form.shopAdminName = this.staffList[index].name
+          this.form.shopAdminId = this.staffList[index].id
+        }
+      }
     },
 		payWayChange(e){
 			let index = e.detail.value

+ 5 - 0
ghsApp/src/api/shop-admin/index.js

@@ -8,4 +8,9 @@ export const prepareBind = data => {
 //创建管理员
 export const generateAdmin = data => {
 	return https.post('/shop-admin/generate-admin', data)
+}
+
+//获取所有在职员工 ssh 20220510
+export const getAllStaff = data => {
+	return https.get('/shop-admin/get-all-staff', data)
 }

+ 1 - 1
hdApp/src/pages.json

@@ -388,7 +388,7 @@
 		{
 			"root": "admin/clear",
 			"pages": [
-				{ "path": "list", "style": { "navigationBarTitleText": "结帐记录" } },
+				{ "path": "list", "style": { "navigationBarTitleText": "结账单" } },
 				{ "path": "info", "style": { "navigationBarTitleText": "详情" } }
 			]
 		}

+ 1 - 1
hdApp/src/pagesPurchase/gathering.vue

@@ -179,7 +179,7 @@ export default {
         purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:that.option.id }).then(res => {
           if(res.code == 1) {
             if(res.data.hasUnComplete && res.data.hasUnComplete == 1){
-              that.$util.confirmModal({content:'还有完成的结账单',okText:'查看'},() => {
+              that.$util.confirmModal({content:'还有完成的结账单',okText:'查看'},() => {
                 that.pageTo({ url: '/admin/clear/list', type: 2})
               })              
             }else{

+ 5 - 6
hdApp/src/pagesPurchase/purDetails.vue

@@ -273,13 +273,12 @@ export default {
         let that = this
         purchaseClearCreateOrder({ purchaseIds:id,ghsId:ghsId }).then(res => {
           if(res.code == 1) {
-            that.pageTo({
-              url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond,
-              type: 2
-            })
+            if(res.data.hasUnComplete && res.data.hasUnComplete == 1){
+              that.$util.confirmModal({content:'还有待完成的结账单',okText:'查看'},() => { that.pageTo({ url: '/admin/clear/list', type: 2}) })
+            }else{
+              that.pageTo({ url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond, type: 2 })
+            }
           }
-        }).catch(err => {
-          console.log('err', err)
         })
     },
     //跳转到结账页