فهرست منبع

采购负责人优化

shish 2 سال پیش
والد
کامیت
22d0bf35e0

+ 36 - 6
ghsApp/src/admin/changePrice/changeCgStaff.vue

@@ -30,7 +30,7 @@
 						</view>
 						</view>
 						<view v-if="classItem.child && !$util.isEmpty(classItem.child)">
 						<view v-if="classItem.child && !$util.isEmpty(classItem.child)">
 							<view style="height:230upx" :id="`class_${classIndex}`" v-for="(productItem, productIndex) in classItem.child" :key="productIndex">
 							<view style="height:230upx" :id="`class_${classIndex}`" v-for="(productItem, productIndex) in classItem.child" :key="productIndex">
-								<ItemComponent :ref="`item_${productItem.id}`" v-if="classItem.isActive" :isPrice="false" @checkItem="checkItemEvent" :info="productItem"></ItemComponent>
+								<ItemComponent :ref="`item_${productItem.id}`" v-if="classItem.isActive" :isPrice="false" @checkItem="checkItemEvent" @changeStaff="changeMan" :info="productItem"></ItemComponent>
 							</view>
 							</view>
 						</view>
 						</view>
 						<view v-else>
 						<view v-else>
@@ -82,6 +82,17 @@
 			</template>
 			</template>
 		</modal-module>
 		</modal-module>
 
 
+		<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 staffListData" :key="index" @tap.stop="setNewStaff(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="cancelChange()">取消选择</button></view>
+			</view>
+      	</uni-popup>
 
 
 	</view>
 	</view>
 </view>
 </view>
@@ -96,6 +107,7 @@ import { mapGetters } from "vuex";
 import ModalModule from "@/components/plugin/modal";
 import ModalModule from "@/components/plugin/modal";
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
 import { getAllItemClass } from "@/api/item-class";
 import { getAllItemClass } from "@/api/item-class";
+import { changeCgStaff } from "@/api/item";
 import { getAllStaff } from "@/api/shop-admin"
 import { getAllStaff } from "@/api/shop-admin"
 export default {
 export default {
 	name: "outlist",
 	name: "outlist",
@@ -118,7 +130,9 @@ export default {
 			staffListData:[],
 			staffListData:[],
 			stafffSelectedData:{},
 			stafffSelectedData:{},
 			staffId:0,
 			staffId:0,
-			showStaffModel:false
+			showStaffModel:false,
+			beforeId:0,
+			newId:0
 		};
 		};
 	},
 	},
 	computed:{
 	computed:{
@@ -135,13 +149,29 @@ export default {
 		})
 		})
 
 
 		getAllStaff().then(res=>{
 		getAllStaff().then(res=>{
-        if(res.code == 1){
-		  this.staffListData = res.data.list
-        }
-      })
+			if(res.code == 1){
+				this.staffListData = res.data.list
+			}
+      	})
 
 
 	},
 	},
 	methods: {
 	methods: {
+		setNewStaff(staff){
+			changeCgStaff({newId:staff.id,beforeId:this.beforeId}).then(res=>{
+				if(res.code == 1){
+					this.$refs.staffRef.close()
+					this.$msg('修改成功')
+					this.initProduct()
+				}
+			})
+		},
+		cancelChange(){
+			this.$refs.staffRef.close()
+		},
+		changeMan(id){
+			this.beforeId = id
+			this.$refs.staffRef.open('center')
+		},
 		changeItemClassFn(e) {
 		changeItemClassFn(e) {
 			this.stafffSelectedData = this.staffListData[e.detail.value];
 			this.stafffSelectedData = this.staffListData[e.detail.value];
 			this.staffId = this.stafffSelectedData.id;
 			this.staffId = this.stafffSelectedData.id;

+ 4 - 1
ghsApp/src/admin/changePrice/components/changeCgStaffItem.vue

@@ -22,7 +22,7 @@
 				v-if="info.presell == 1">预售</text>
 				v-if="info.presell == 1">预售</text>
 				{{ info.name || "" }}
 				{{ info.name || "" }}
 			</view>
 			</view>
-			<view class="kc">{{ info.cgStaffName?info.cgStaffName:'' }}</view>
+			<view class="kc" @click.stop="changeStaff(info.cgStaffId)">{{ info.cgStaffName?info.cgStaffName:'' }}</view>
 			<view class="num-open_bx">
 			<view class="num-open_bx">
 				<view>
 				<view>
 					<view class="open-bx" >
 					<view class="open-bx" >
@@ -64,6 +64,9 @@ export default {
 	mounted(){
 	mounted(){
 	},
 	},
 	methods: {
 	methods: {
+		changeStaff(staffId){
+			this.$emit("changeStaff", staffId)
+		},
 		checkEvent() {
 		checkEvent() {
 			this.isCheck = this.isCheck == true ? false : true
 			this.isCheck = this.isCheck == true ? false : true
 			this.$emit("checkItem", this.info,this.isCheck)
 			this.$emit("checkItem", this.info,this.isCheck)

+ 52 - 23
ghsApp/src/admin/order/statBook.vue

@@ -7,10 +7,10 @@
 		</view>
 		</view>
 		</view>
 		</view>
 		<view class="top-bar">
 		<view class="top-bar">
-			<DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
-			<button class="admin-button-com mini-btn blue" style="margin-left:30upx;" @click="printOrder()">打印</button>
+			<text @click="changeStaff()" style="margin-left:90upx;font-size:30upx;">{{selectStaff.id == 0 ?'选采购人':selectStaff.name}}</text>
 			<button class="admin-button-com mini-btn blue" style="margin-left:50upx;" @click="modifyBook(0)" v-if="Number(bookSn)>0">结束预订</button>
 			<button class="admin-button-com mini-btn blue" style="margin-left:50upx;" @click="modifyBook(0)" v-if="Number(bookSn)>0">结束预订</button>
 			<button class="admin-button-com mini-btn blue" style="margin-left:50upx;" @click="modifyBook(1)" v-else>开启预订</button>
 			<button class="admin-button-com mini-btn blue" style="margin-left:50upx;" @click="modifyBook(1)" v-else>开启预订</button>
+			<button class="admin-button-com mini-btn blue" style="margin-left:50upx;" @click="goCg()">去采购</button>
 		</view>
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 			<view class="space-view ex-table">
 			<view class="space-view ex-table">
@@ -39,12 +39,26 @@
 			</view>
 			</view>
 		</scroll-view>
 		</scroll-view>
 		</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="getCurrentStaff(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="cancelCurrentStaff()">取消选择</button></view>
+			</view>
+      	</uni-popup>
+
 	</view>
 	</view>
 </template>
 </template>
 <script>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import SelectList from "@/components/plugin/selectList";
 import SelectList from "@/components/plugin/selectList";
 import { getStatBookProfit,getStatBookPrint } from "@/api/stat";
 import { getStatBookProfit,getStatBookPrint } from "@/api/stat";
+import { getAllStaff } from "@/api/shop-admin";
 import { changeBook } from "@/api/book"
 import { changeBook } from "@/api/book"
 import { list } from "@/mixins";
 import { list } from "@/mixins";
 import ShopSelect from "@/components/module/shopSelect";
 import ShopSelect from "@/components/module/shopSelect";
@@ -83,7 +97,10 @@ export default {
 			},
 			},
 			profile:[],
 			profile:[],
 			searchContent:'',
 			searchContent:'',
-			bookSn:0
+			bookSn:0,
+			staffData:[],
+			selectStaff:{id:0,name:''},
+			T:null
 		};
 		};
 	},
 	},
 	onPullDownRefresh() {
 	onPullDownRefresh() {
@@ -96,9 +113,32 @@ export default {
 		this.itemId = e.id;
 		this.itemId = e.id;
 		this.params.itemId = e.id;
 		this.params.itemId = e.id;
 		this.shopId = this.getLoginInfo.shopId;
 		this.shopId = this.getLoginInfo.shopId;
+		getAllStaff().then(res=>{
+			if(res.code == 1){
+				this.staffData = res.data.list ? res.data.list : []
+			}
+		})
 	},
 	},
 	methods: {
 	methods: {
 		...mapActions(['setUserShopAll']),
 		...mapActions(['setUserShopAll']),
+		getCurrentStaff(staff){
+			this.$refs.staffRef.close()
+			this.selectStaff.id = staff.id
+			this.selectStaff.name = staff.name
+			this.getStatList()
+		},
+		cancelCurrentStaff(){
+			this.$refs.staffRef.close()
+			this.selectStaff.id = 0
+			this.selectStaff.name = ''
+			this.getStatList()
+		},
+		changeStaff(){
+			this.$refs.staffRef.open('center')
+		},
+		goCg(){
+			this.$util.pageTo({ url: "/pagesPurchase/supplier",type:2})
+		},
 		modifyBook(status){
 		modifyBook(status){
 			let hint = status == 0 ?'确认结束?':'确认开启?'
 			let hint = status == 0 ?'确认结束?':'确认开启?'
 			this.$util.confirmModal({content:hint},() => {
 			this.$util.confirmModal({content:hint},() => {
@@ -111,21 +151,15 @@ export default {
 				})
 				})
 			})
 			})
 		},
 		},
-		printOrder(){
-			this.$msg('开发中')
-			return false
-			this.$util.confirmModal({content:'确认打印?'},() => {
-				uni.showLoading({mask:true})
-				getStatBookPrint(this.params).then(res => {
-					uni.hideLoading()
-					if(res.code == 1){
-						this.$msg('打印成功')
-					}
-				})
-			})
-		},
 		searchFn(e){
 		searchFn(e){
-			this.searchContent = e;
+			let that = this
+			if(that.T != null){
+				clearTimeout(that.T)
+			}
+			that.T = setTimeout(function(){
+				that.searchContent = e
+				that.getStatList()
+			},700)
 		},
 		},
 		goDetail(item){
 		goDetail(item){
 			this.$util.pageTo({ url: "/admin/book/itemCustom?itemId="+item.itemId+'&itemName='+item.name})
 			this.$util.pageTo({ url: "/admin/book/itemCustom?itemId="+item.itemId+'&itemName='+item.name})
@@ -142,11 +176,6 @@ export default {
 		goBookCgChange(item){
 		goBookCgChange(item){
 			this.$util.pageTo({ url: "/admin/book/globalBookCgChange?itemId="+item.itemId+'&itemName='+item.name+'&id='+item.id})
 			this.$util.pageTo({ url: "/admin/book/globalBookCgChange?itemId="+item.itemId+'&itemName='+item.name+'&id='+item.id})
 		},
 		},
-		selectShopFn(val){
-			this.params.shopId = val.id;
-			this.init();
-		},
-		//选择时间
 		selectDateFn(val) {
 		selectDateFn(val) {
 			this.params = {...this.params,...val}
 			this.params = {...this.params,...val}
 			this.init()
 			this.init()
@@ -157,7 +186,7 @@ export default {
 		getStatList() {
 		getStatList() {
 			let that = this
 			let that = this
 			uni.showLoading()
 			uni.showLoading()
-			getStatBookProfit(this.params).then(res => {
+			getStatBookProfit({...this.params,staffId:this.selectStaff.id,search:this.searchContent}).then(res => {
 				uni.hideLoading()
 				uni.hideLoading()
 				this.bookSn = res.data.shop && res.data.shop.bookSn ? res.data.shop.bookSn : 0
 				this.bookSn = res.data.shop && res.data.shop.bookSn ? res.data.shop.bookSn : 0
 				if (!this.$util.isEmpty(res.data.list)) {
 				if (!this.$util.isEmpty(res.data.list)) {

+ 28 - 1
ghsApp/src/admin/staff/add.vue

@@ -18,6 +18,29 @@
             </picker>
             </picker>
           </tui-list-cell>
           </tui-list-cell>
 
 
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">身份</view>
+            <radio-group class="tui-input" @change="identityChange">
+            
+              <label class="list" for="ptLink">
+              <radio id="ptLink" value="0" :checked="form.identity == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">常规</span>
+            </label>
+
+            <label class="list" for="cgLink">
+              <radio id="cgLink" value="1" :checked="form.identity == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">采购</span>
+            </label>
+
+            <label class="list" for="dbLink">
+              <radio id="dbLink" value="2" :checked="form.identity == 2" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">打包</span>
+            </label>
+
+            </radio-group>
+          </tui-list-cell>
+
+
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
               <div class="tui-title required">手机号</div>
               <div class="tui-title required">手机号</div>
               <input v-model="form.mobile" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile" placeholder="员工手机号" />
               <input v-model="form.mobile" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile" placeholder="员工手机号" />
@@ -97,7 +120,8 @@ export default {
         mobile:'',
         mobile:'',
         super:0,
         super:0,
         finance:0,
         finance:0,
-        switchShop:0
+        switchShop:0,
+        identity:0
       },
       },
       roleList: [],
       roleList: [],
       roleSelData: {},
       roleSelData: {},
@@ -117,6 +141,9 @@ export default {
 		prevPage.$vm.fromDetail = {status:1}
 		prevPage.$vm.fromDetail = {status:1}
   },
   },
   methods: {
   methods: {
+    identityChange(e){
+      this.form.identity = e.detail.value
+    },
     switchShopChangeFn(e){
     switchShopChangeFn(e){
       this.form.switchShop = e.detail.value ? 1 : 0;
       this.form.switchShop = e.detail.value ? 1 : 0;
     },
     },

+ 27 - 1
ghsApp/src/admin/staff/detail.vue

@@ -17,6 +17,28 @@
             </picker>
             </picker>
           </tui-list-cell>
           </tui-list-cell>
 
 
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">身份</view>
+            <radio-group class="tui-input" @change="identityChange">
+            
+              <label class="list" for="ptLink">
+              <radio id="ptLink" value="0" :checked="form.identity == 0" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">常规</span>
+            </label>
+
+            <label class="list" for="cgLink">
+              <radio id="cgLink" value="1" :checked="form.identity == 1" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">采购</span>
+            </label>
+
+            <label class="list" for="dbLink">
+              <radio id="dbLink" value="2" :checked="form.identity == 2" style="transform: scale(0.7,0.7);" />
+              <span class="checkbox-text" style="font-size:30upx;">打包</span>
+            </label>
+
+            </radio-group>
+          </tui-list-cell>
+
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
             <div class="tui-title">改库存改价</div>
             <div class="tui-title">改库存改价</div>
             <view><switch style="transform:scale(0.7,0.7)" :checked="form.super == 0 ? false : true" @change="superChangeFn" /></view>
             <view><switch style="transform:scale(0.7,0.7)" :checked="form.super == 0 ? false : true" @change="superChangeFn" /></view>
@@ -74,7 +96,8 @@ export default {
         remark: "",
         remark: "",
         super:0,
         super:0,
         finance:0,
         finance:0,
-        switchShop:0
+        switchShop:0,
+        identity:0
       },
       },
       roleList: [],
       roleList: [],
       roleSelData: {},
       roleSelData: {},
@@ -91,6 +114,9 @@ export default {
 		prevPage.$vm.fromDetail = {status:1}
 		prevPage.$vm.fromDetail = {status:1}
   },
   },
   methods: {
   methods: {
+    identityChange(e){
+      this.form.identity = e.detail.value
+    },
     init() {
     init() {
       let data = uni.getStorageSync("addStaffData");
       let data = uni.getStorageSync("addStaffData");
       if (data) {
       if (data) {

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

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
+export const changeCgStaff = data => {
+	return https.get('/item/change-cg-staff', data)
+}
+
 export const getItemList = data => {
 export const getItemList = data => {
 	return https.get('/item/get-item-list', data)
 	return https.get('/item/get-item-list', data)
 }
 }