From 49d4281ebaba8a0d73b6669dcc13da0109a1b91f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 13 十一月 2023 15:13:57 +0800
Subject: [PATCH] 1.生产报工  75%

---
 config/api.js       |    5 +
 pages/scgl/scbg.vue |  166 ++++++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 124 insertions(+), 47 deletions(-)

diff --git a/config/api.js b/config/api.js
index c2a7afb..11b7809 100644
--- a/config/api.js
+++ b/config/api.js
@@ -174,8 +174,9 @@
 	data)
 
 // 鐝粍鏌ユ壘浜哄憳鍩虹璧勬枡
-export const GroupsPersonPermissions = (data) => http.get('/GeneralBasicData/GroupsPersonPermissions',
-	data)
+export const GroupsPersonPermissions = (data) => http.get('/GeneralBasicData/GroupsPersonPermissions', {
+	params: data
+})
 
 // 缂洪櫡涓嬫媺
 export const DefectPermissions = (data) => http.get('/GeneralBasicData/DefectPermissions',
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index 1d05155..01ed874 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -104,8 +104,8 @@
 						</view>
 
 
-						<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;"
-							v-if="reckway==='涓汉'">
+						<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
+							<!-- v-if="reckway==='涓汉'" -->
 							<view style="display: flex;" class="titleFont">
 								<view style="color: red;margin-right: 6rpx;">*</view> 鎶ュ伐浜哄憳锛�
 							</view>
@@ -193,13 +193,13 @@
 				</view>
 
 				<!-- 鎶ュ伐浜哄憳淇℃伅 -->
-				<u-gap height="15" v-if="reckway==='鐝粍'" bgColor="#eff0f1"></u-gap>
+				<!-- 			<u-gap height="15" v-if="reckway==='鐝粍'" bgColor="#eff0f1"></u-gap>
 				<view class="head marginLeft10 marginRight10" v-if="reckway==='鐝粍'">
 					<view class="head_block">
 						<view class="head_left">
 							<view class="head_bar"></view>
 							<view class="head_title">
-								鎶ュ伐浜哄憳淇℃伅
+								涓嶈壇鍘熷洜鏄庣粏
 							</view>
 						</view>
 					</view>
@@ -240,7 +240,7 @@
 
 
 
-				</view>
+				</view> -->
 
 			</view>
 
@@ -250,17 +250,12 @@
 				@click="submit" text="鎶ュ伐">
 			</u-button>
 
-			<!-- 			<u-action-sheet :actions="userGroupSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
-				:closeOnClickAction="true" @close="userGroupSheetShow=false" :show="userGroupSheetShow"
-				@select='userGroupSheetSelect'>
-			</u-action-sheet> -->
+
 			<u-picker v-if="topContent.length!==0" :show="userGroupSheetShow" :columns="userGroupColumns"
 				:itemHeight='55' :closeOnClickOverlay='true' @close='userGroupSheetShow=false'
 				@confirm='userGroupPickerConfirm' @cancel='userGroupSheetShow=false'>
 			</u-picker>
-			<!-- 		<u-action-sheet :actions="eqpSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
-				:closeOnClickAction="true" @close="eqpSheetShow=false" :show="eqpSheetShow" @select='eqpSheetSelect'>
-			</u-action-sheet> -->
+
 			<u-picker v-if="topContent.length!==0" :show="eqpSheetShow" :columns="eqpColumns" :itemHeight='55'
 				:closeOnClickOverlay='true' @close='eqpSheetShow=false' @confirm='eqpPickerConfirm'
 				@cancel='eqpSheetShow=false'>
@@ -285,9 +280,26 @@
 			</u-action-sheet>
 
 
-			<!-- 		<u-action-sheet :actions="operSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
-				:closeOnClickAction="true" @close="operSheetShow=false" :show="operSheetShow" @select='operSheetSelect'>
-			</u-action-sheet> -->
+
+			<u-action-sheet v-if="topContent.length!==0" :actions="userSelectArrAll" :safeAreaInsetBottom='true'
+				:closeOnClickOverlay="true" :closeOnClickAction="true" @close="userSheetShow=false"
+				:show="userSheetShow" @select='userSheetSelect'>
+				<view style="min-height: 100rpx;padding: 20rpx 20rpx 30rpx 20rpx;">
+					<u-checkbox-group @change="userCheckboxChange" size='20px' v-model="userCheckBoxValue"
+						iconPlacement="right" placement="column">
+						<view v-for="(item,index) in userSelectArrAll">
+							<u-checkbox activeColor="rgb(0, 102, 255)" labelSize='18' :key="item.code" :name='item.name'
+								:label="item.name">
+							</u-checkbox>
+							<u-divider :key="item.code"></u-divider>
+						</view>
+					</u-checkbox-group>
+				</view>
+			</u-action-sheet>
+
+
+
+
 			<u-picker v-if="topContent.length!==0" :show="operSheetShow" :columns="operColumns" :itemHeight='55'
 				:closeOnClickOverlay='true' @close='operSheetShow=false' @confirm='operPickerConfirm'
 				@cancel='operSheetShow=false'>
@@ -296,13 +308,36 @@
 
 			<u-modal v-if="topContent.length!==0" :show="modalShow" :showCancelButton='true' cancelText='鍙栨秷'
 				@close="modalShow=false" :closeOnClickOverlay="true" style=" " @cancel="modalCancel"
-				@confirm="modalConfirm" title="鎶ュ伐浜哄憳" :content='modalContent'>
+				@confirm="modalConfirm" title="涓嶈壇鏄庣粏" :content='modalContent'>
 
-				<uni-section style="width: 100%;" title=''>
+				<!-- 		<uni-section style="width: 100%;" title=''>
 					<uni-data-select v-model="userSelectValue" :clear='false' emptyText :localdata="userSelectArr"
 						@change="userChange">
 					</uni-data-select>
-				</uni-section>
+				</uni-section> -->
+
+				<!-- 	<view style="display: flex;flex-direction: column;">
+					<view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
+						<view style="color: #fff;margin-right: 6rpx;">*</view> 鏁伴噺锛�
+						<view class='inputClass'>
+							<u--input placeholder="璇疯緭鍏�" border="surround" @change='ngqtyChange' type='number'
+								v-model="ngqty"></u--input>
+						</view>
+					</view>
+					<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
+						<view style="display: flex;" class="titleFont">
+							<view style="color: #fff;margin-right: 6rpx;">*</view> 鍘熷洜锛�
+						</view>
+						<view @click='badSheetClick' class="custominputClass">
+							<view v-show='badSheetValue.length===0' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
+							<view v-show='badSheetValue.length!==0' class="ellipsis" style="width: 390rpx;">
+								{{badSheetValue}}
+							</view>
+							<u-icon :name="!badSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
+						</view>
+					</view>
+				</view> -->
+
 
 			</u-modal>
 
@@ -421,7 +456,10 @@
 				userGroupColumns: [], //
 				eqpColumns: [], //
 				operColumns: [], //
-				isAsyncChange: false
+				isAsyncChange: false,
+
+				userCheckBoxValue: [],
+				userSheetShow: false
 			}
 		},
 		created() {
@@ -432,16 +470,25 @@
 
 
 			this.getMesOrderStepStart('SGPO20231110_1;101')
-			this.getGroupsPermissions() //鑾峰彇鐢熶骇鐝粍
-			this.getEqpPermissionsPlus() //鑾峰彇璁惧鍚嶇О
-			this.getDefectPermissions() //鑾峰彇缂洪櫡涓嬫媺
-			this.getPersonPermissions() //鑾峰彇鎿嶄綔浜哄憳
-			// this.getGroupsPersonPermissions('BZ001') //鏍规嵁鐝粍鑾峰彇浜哄憳
+
+
+
+
+			this.getSellectAllApi()
+
+
 		},
 		methods: {
 			init() {
 				uni.stopPullDownRefresh();
 			},
+			async getSellectAllApi() {
+				await this.getGroupsPermissions() //鑾峰彇鐢熶骇鐝粍
+				await this.getEqpPermissionsPlus() //鑾峰彇璁惧鍚嶇О
+				await this.getDefectPermissions() //鑾峰彇缂洪櫡涓嬫媺
+				await this.getPersonPermissions() //鑾峰彇鎿嶄綔浜哄憳
+			},
+
 
 			//鑾峰彇鐢熶骇鐝粍
 			async getGroupsPermissions(wkshopcode) {
@@ -475,7 +522,7 @@
 					this.badSelectArr = res.data
 				}
 			},
-			// 鑾峰彇鎿嶄綔浜哄憳
+			// 鑾峰彇鎶ュ伐浜哄憳
 			async getPersonPermissions() {
 				const res = await PersonPermissions()
 				if (res.code === '200') {
@@ -492,26 +539,46 @@
 				}
 			},
 			// 鏍规嵁鐢熶骇鐝粍鑾峰彇浜哄憳
-			async getGroupsPersonPermissions(usergroupcode) {
-				const res = await GroupsPersonPermissions()
-				if (res.code === '200') {
-					this.userArr = res.data
-					this.calculatedValue()
-				}
-			},
-			// 璁$畻鍒嗛厤姣斾緥鐨勫��
-			calculatedValue() {
-				const total = 100;
-				let value = 0
-				this.userArr.forEach(item => {
-					item.ratio = parseFloat((100 / this.userArr.length).toFixed(2))
-					value += item.ratio
+			async getGroupsPersonPermissions(groupcode) {
+
+				const res = await GroupsPersonPermissions({
+					groupcode
 				})
-				if (Math.round(value * 100) / 100 !== total) {
-					this.userArr[this.userArr.length - 1].ratio = parseFloat((this.userArr[this.userArr.length - 1].ratio +
-						(total - value)).toFixed(2))
+				if (res.code === '200') {
+					this.userCheckBoxValue = []
+
+					if (res.data[0].usercode_list && res.data[0].usercode_list.length > 0) {
+						this.userSelectArrAll.forEach(i => {
+
+							if (res.data[0].usercode_list.split(',').includes(i.code)) {
+								this.userCheckBoxValue.push(i.name)
+							}
+
+						})
+
+					}
+
+					this.operSheetValue = this.userCheckBoxValue.join(',')
+
+
 				}
 			},
+
+
+
+			userSheetSelect() {
+
+			},
+			userCheckboxChange(val) {
+				this.userCheckBoxValue = val.join(',')
+				// this.userCheckBoxValue = ['001']
+				// this.$forceUpdate()
+
+				// console.log(this.userCheckBoxValue);
+			},
+
+
+
 
 			//鑾峰彇寮�宸ヤ俊鎭�
 			async getMesOrderStepStart(orderstepqrcode) {
@@ -750,7 +817,16 @@
 				console.log(this.badSheetValue, 5);
 			},
 			operSheetClick() {
-				this.operSheetShow = true
+				if (this.reckway === '涓汉') {
+					this.operSheetShow = true
+				}
+
+				if (this.reckway === '鐝粍') {
+					this.userSheetShow = true
+				}
+
+
+
 			},
 			operSheetSelect(val) {
 				this.operSheetValue = val.name
@@ -773,7 +849,7 @@
 			// 鍒犻櫎浜哄憳鎸夐挳
 			deleteUser(item) {
 				this.userArr = this.userArr.filter(i => i.usercode !== item.usercode)
-				this.calculatedValue()
+
 			},
 			// 妯℃�佹鍙栨秷鎸夐挳
 			modalCancel() {
@@ -792,7 +868,7 @@
 					uni.$u.toast('璇烽�夋嫨鎶ュ伐浜哄憳锛�')
 				}
 				this.modalShow = false
-				this.calculatedValue()
+
 			},
 			userChange(val) {
 				this.userSelectValue = val

--
Gitblit v1.9.3