shish 2 лет назад
Родитель
Сommit
7955fc6074

+ 10 - 4
ghsApp/src/admin/order/statBook.vue

@@ -7,12 +7,13 @@
 			</view>
 		</view>
 		<view class="top-bar">
-			<button class="admin-button-com middle blue" style="margin-left:80upx;" @click="changeStaff()">
+			<button class="admin-button-com middle blue" style="margin-left:30upx;" @click="modifyBook(0)" v-if="Number(bookSn)>0">结束预订</button>
+			<button class="admin-button-com middle blue" style="margin-left:30upx;" @click="modifyBook(1)" v-else>开启预订</button>
+			<button class="admin-button-com middle blue" style="margin-left:30upx;" @click="changeStaff()">
 				{{selectStaff.id == 0 ?'采购人':selectStaff.name}}
 			</button>
-			<button class="admin-button-com middle blue" style="margin-left:60upx;" @click="modifyBook(0)" v-if="Number(bookSn)>0">结束预订</button>
-			<button class="admin-button-com middle blue" style="margin-left:60upx;" @click="modifyBook(1)" v-else>开启预订</button>
-			<button class="admin-button-com middle blue" style="margin-left:60upx;" @click="goCg()">去采购</button>
+			<button class="admin-button-com middle blue" style="margin-left:30upx;" @click="myCg()">我的采购</button>
+			<button class="admin-button-com middle blue" style="margin-left:30upx;" @click="goCg()">去采购</button>
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 			<view class="space-view ex-table">
@@ -173,6 +174,11 @@ export default {
 			this.selectStaff.name = ''
 			this.getStatList()
 		},
+		myCg(){
+			let staffId = this.getLoginInfo.staff.id
+			let staffName = this.getLoginInfo.staff.name
+			this.$util.pageTo({ url: "/pagesPurchase/order?cgStaffId="+staffId+'&cgStaffName='+staffName})
+		},
 		changeStaff(){
 			this.$refs.staffRef.open('center')
 		},

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

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const changeLocationFn = data => {
+	return https.get('/ghs/change-location', data)
+}
+
 export const changeGhsName = data => {
 	return https.get('/ghs/modify-name', data)
 }

+ 101 - 33
ghsApp/src/pagesPurchase/order.vue

@@ -1,30 +1,46 @@
 <template>
-<view class="app-content">
-	<view class="order-page">
-		<view class="input-wrap_box">
-			<view>
-				<AppSearchModule placeholder="核销码 / 名称 / 手机号" @input="searchFn"/>
+	<view class="app-content">
+		<view class="order-page">
+			<view class="input-wrap_box">
+				<view>
+					<AppSearchModule placeholder="核销码 / 名称 / 手机号" @input="searchFn"/>
+				</view>
+				<view style="padding:0 0upx 0 20upx;" >
+					<button class="admin-button-com middle blue" @click="showCgStaff">{{ cgStaffName==''?'采购人':cgStaffName}}</button>
+				</view>
+			</view>
+			<view class="tabs">
+				<Tabs :isFixed="false" :tabs="tabs" :currentTab="tabIndex" @change="changeTabEvent" itemWidth="25%"></Tabs>
+			</view>
+			<view scroll-y class="order-list">
+			<view style="margin-left:50upx;padding-bottom:25upx;">
+				<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
+			</view>
+				<block v-if="!$util.isEmpty(list.data)">
+					<OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetails(item)"></OrderItem>
+				</block>
+				<block v-else>
+					<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+				</block>
+			</view>
+			<view class="app-footer open_btn">
+				<view @click="addEvent" class="admin-button-com big blue">新增采购</view>
 			</view>
 		</view>
-		<view class="tabs">
-			<Tabs :isFixed="false" :tabs="tabs" :currentTab="tabIndex" @change="changeTabEvent" itemWidth="25%"></Tabs>
-		</view>
-		<view scroll-y class="order-list">
-		<view style="margin-left:50upx;padding-bottom:15upx;">
-        	<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
-      	</view>
-			<block v-if="!$util.isEmpty(list.data)">
-				<OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetails(item)"></OrderItem>
-			</block>
-			<block v-else>
-				<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-			</block>
-		</view>
-		<view class="app-footer open_btn">
-			<view @click="addEvent" class="admin-button-com big blue">新增采购</view>
-		</view>
+
+		<uni-popup ref="staffRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="max-height:90vh;overflow: scroll;">
+				<view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择:</view>
+				<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+					<view v-for="(item, index) in staffData" :key="index" @tap.stop="getCgStaff(item)" style="margin-bottom:20upx;margin-left:3upx;">
+						<view style="margin-top:8upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;font-weight:bold;font-size:30upx;">{{item.name}}</view>
+					</view>
+				</view>
+				<view style="text-align:center;padding:10upx 0 10upx 0;"><button class="admin-button-com big blue" @click="cancelSelectStaff()">取消选择</button></view>
+			</view>
+    	</uni-popup>
+
 	</view>
-</view>
 </template>
 <script>
 import Tabs from "@/components/plugin/tabs";
@@ -34,6 +50,7 @@ import { list } from "@/mixins";
 import { getPurchaseListApi,getLsRunningOrderNum } from "@/api/purchase";
 import AppSearchModule from "@/components/module/app-search";
 import DateSelect from "@/components/module/dateSelect";
+import { getAllStaff } from "@/api/shop-admin";
 export default {
 	components: {
 		Tabs,
@@ -49,6 +66,7 @@ export default {
 			tabIndex: 0,
 			lsFhNum:0,
 			lsShNum:0,
+			staffData:[],
 			needRefresh:0,
 			tabs: [
 				{
@@ -73,9 +91,13 @@ export default {
 				}
 			],
 			T:null,
-			searchContent:'',			searchTime:'',
+			searchContent:'',			
+			searchTime:'',
 			startTime:'',
-			endTime:''		};
+			endTime:'',
+			cgStaffName:'',
+			cgStaffId:0
+		}
 	},
 	onPullDownRefresh() {
 		this.resetList();
@@ -85,15 +107,30 @@ export default {
 	},
 	onReachBottom() {
 		if (!this.list.finished) {
-		this.getCgList().then((res) => {
-			uni.stopPullDownRefresh();
-		});
+			this.getCgList().then((res) => {
+				uni.stopPullDownRefresh();
+			})
 		} else {
-		uni.stopPullDownRefresh();
+			uni.stopPullDownRefresh()
 		}
 	},
 	onLoad(){
+
+		if(this.option.cgStaffId){
+			this.cgStaffId = this.option.cgStaffId
+		}
+		if(this.option.cgStaffName){
+			this.cgStaffName = this.option.cgStaffName
+		}
+
 		this.getCgList()
+
+		getAllStaff().then(res=>{
+			if(res.code == 1){
+				this.staffData = res.data.list ? res.data.list : []
+			}
+		})
+
 	},
 	onShow() {
 		//采购成功之后的订单详情页过来不刷新
@@ -105,6 +142,26 @@ export default {
 		}
   	},
 	methods: {
+		cancelSelectStaff(){
+			this.$refs.staffRef.close()
+			this.cgStaffName = ''
+			this.cgStaffId = 0
+			this.resetList()
+			this.getCgList()
+		},
+		cancelShowCgStaff(){
+			this.$refs.staffRef.close()
+		},
+		getCgStaff(staff){
+			this.$refs.staffRef.close()
+			this.cgStaffName = staff.name
+			this.cgStaffId = staff.id
+			this.resetList()
+			this.getCgList()
+		},
+		showCgStaff(){
+			this.$refs.staffRef.open('center')
+		},
 		searchFn(e){
 			let that = this
 			if(that.T != null){
@@ -115,20 +172,21 @@ export default {
 				that.resetList()
 				that.getCgList()
 			},700)
-		},		selectDateFn(val) {
+		},		
+		selectDateFn(val) {
 			this.searchTime = val.searchTime
 			this.startTime = val.startTime
 			this.endTime = val.endTime
 			this.resetList();
 			this.getCgList();
-		},		init(){
+		},		
+		init(){
 
 		},
 		getCgList() {
 			let ghsId = this.option.ghsId || 0
 			let status = this.tabs[this.tabIndex].key
-
-			let options = {page:this.list.page,status:status,ghsId:ghsId,search:this.searchContent,,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}
+			let options = {page:this.list.page,status:status,ghsId:ghsId,search:this.searchContent,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,cgStaffId:this.cgStaffId}
 			return getPurchaseListApi(options) .then(res => {
 					this.completes(res);
 					this.tabs[this.tabIndex].value = res.data.totalNum?res.data.totalNum:0
@@ -158,6 +216,16 @@ export default {
 	display: flex;
 	flex-direction: column;
 	background-color: #f9fbfc;
+	.input-wrap_box {
+		background-color: #fff;
+		height: 100upx;
+		display: flex;
+		align-items: center;
+		padding: 0 30upx;
+		& > view:nth-child(1) {
+			flex: 1;
+		}
+  	}
 	.order-list {
 		padding-top:20upx;
 		padding-bottom:100upx;

+ 16 - 5
ghsApp/src/pagesPurchase/supplier.vue

@@ -19,9 +19,8 @@
         <block v-if="!$util.isEmpty(list.data)">
           <view class="list_item" v-for="(item, index) in list.data" :key="index">
 
-            <view v-if="item.location == 1"
-            style="width:90upx;padding:5upx 0 5upx 0;font-size:20upx;background-color:#7babc1;color:white;position:absolute;left:0;top:0;text-align:center;"
-            >附近</view>
+            <view @click.stop="changeLocation(item)" v-if="item.location == 1" style="width:90upx;padding:5upx 0 5upx 0;font-size:20upx;background-color:#7babc1;color:white;position:absolute;left:0;top:0;text-align:center;">附近</view>
+            <view @click.stop="changeLocation(item)" v-else style="width:90upx;padding:5upx 0 5upx 0;font-size:20upx;background-color:#DDDDDD;color:white;position:absolute;left:0;top:0;text-align:center;">上游</view>
 
             <view class="store_name">
               <view class="store_title" @click.stop="nameModify(item)">
@@ -72,7 +71,7 @@
 <script>
 import Tabs from "@/components/plugin/tabs";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { getList,changeGhsName } from "@/api/ghs";
+import { getList,changeGhsName,changeLocationFn } from "@/api/ghs";
 import AppSearchModule from "@/components/module/app-search";
 import ModalModule from "@/components/plugin/modal"
 import { list } from "@/mixins";
@@ -125,6 +124,18 @@ export default {
     }
   },
   methods: {
+    changeLocation(ghs){
+      let that = this
+      changeLocationFn({id:ghs.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg('修改成功')
+          setTimeout(() => {
+            that.resetList()
+            that.getGhsList()            
+          }, 1000);
+        }
+      })
+    },
     modifyConfirm(val){
 			let that=this;
 			if (val.index == 0) {
@@ -375,7 +386,7 @@ export default {
             position: absolute;
             top:40upx;
             right:-125upx;
-            z-index:99;
+            z-index: 1;
         }
       }
       .box_6 {