From e0673329aafe8fc5e17daa75f940807566813290 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期四, 07 九月 2023 15:34:55 +0800
Subject: [PATCH] 小程序

---
 minipro_standard/pages.json                                                  |    3 
 minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue |  394 ++++++++++++++++--------------------------------
 minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue |   30 +++
 minipro_standard/util/api/QualityAPI.js                                      |    8 
 minipro_standard/common/config.js                                            |    4 
 minipro_standard/components/Search.vue                                       |    6 
 6 files changed, 174 insertions(+), 271 deletions(-)

diff --git a/minipro_standard/common/config.js b/minipro_standard/common/config.js
index 28019e1..3573667 100644
--- a/minipro_standard/common/config.js
+++ b/minipro_standard/common/config.js
@@ -1,8 +1,8 @@
 module.exports = {
 	// baseUrl: 'http://106.14.20.42/test_hfznzz/',
 	// baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
-	baseUrl: 'http://192.168.0.15:10021',
-	// baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
+	// baseUrl: 'http://192.168.0.15:10021',
+	baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
 	phoneRegular: /^1[3456789]\d{9}$/,
 	mailboxRegular: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
 	positiveInteger: /^[0-9]*[1-9][0-9]*$/,
diff --git a/minipro_standard/components/Search.vue b/minipro_standard/components/Search.vue
index 082e02b..f79d349 100644
--- a/minipro_standard/components/Search.vue
+++ b/minipro_standard/components/Search.vue
@@ -66,6 +66,8 @@
 	    display: flex;
 	    align-items: center;
 	    .zhanwei {
+			width: 100%;
+			height: calc(88rpx + 30rpx);
 	        background: #ffffff;
 	    }
 	    .content {
@@ -81,7 +83,7 @@
 	        justify-content: space-between;
 	        padding-left: 40rpx;
 	        padding-right: 40rpx;
-	        padding-bottom: 64rpx;
+	        padding-bottom: env(safe-area-inset-bottom);
 	        box-sizing: border-box;
 	        position: fixed;
 	        bottom: 0;
@@ -91,6 +93,7 @@
 	        .footer_close {
 	            flex: 1;
 	            padding: 28rpx 0;
+				height: 88rpx;
 	            box-sizing: border-box;
 	            margin-right: 22rpx;
 	            font-size: 32rpx;
@@ -103,6 +106,7 @@
 	        }
 	        .footer_submit {
 	            flex: 1;
+				height: 88rpx;
 	            padding: 28rpx 0;
 	            box-sizing: border-box;
 	            font-size: 32rpx;
diff --git a/minipro_standard/pages.json b/minipro_standard/pages.json
index 26a231a..2f12ed3 100644
--- a/minipro_standard/pages.json
+++ b/minipro_standard/pages.json
@@ -249,7 +249,8 @@
 		},
 		{
 			"root": "pages_inspect",
-			"pages": [{
+			"pages": [
+				{
 					"path": "pages/InspectionRecords/InspectionRecords",
 					"style": {
 						"navigationBarTitleText": "妫�楠岃褰�",
diff --git a/minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue b/minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue
index 4518724..a91f3a6 100644
--- a/minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue
+++ b/minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue
@@ -73,11 +73,41 @@
 </template>
 
 <script>
+	import { getBYid } from '@/util/api/QualityAPI'
+	import { deletejy } from "@/util/api/PlanningAPI"
+	
 	export default {
 		data() {
 			return {
+				id: null,
 				info: {}
 			};
+		},
+		onLoad(option) {
+			this.id = option.id
+			this.getBYids()
+		},
+		methods: {
+			getBYids() {
+				getBYid(this.id)
+					.then(res => {
+						if (res.code === 200 && res.data) {
+							this.info = res.data
+						}
+					})
+			},
+			// 鍒犻櫎妫�楠岃褰�
+			dele() {
+				deletejy(this.id)
+					.then(res => {
+						if (res.code === 200) {
+							uni.showToast({ title: '鍒犻櫎鎴愬姛', duration: 2000, mask: true })
+							setTimeout(() => {
+								uni.navigateBack({ delta: 1 });
+							}, 2000)
+						}
+					})
+			}
 		}
 	}
 </script>
diff --git a/minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue b/minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue
index a2dbb0c..39f2295 100644
--- a/minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue
+++ b/minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="content_search">
-			<Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="鎼滅储宸ュ崟缂栫爜/鐗╂枡缂栫爜2">
+			<Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="鎼滅储宸ュ崟缂栫爜/鐗╂枡缂栫爜">
 				<template v-slot:content>
 					<view class="Search_item">
 						<view class="Search_item_label">妫�楠屾棩鏈�</view>
@@ -36,10 +36,17 @@
 				</template>
 			</Search>
 		</view>
-		<view class="content_total" :style="{top: top}">鍏眥{listData.total}}鏉℃暟鎹�</view>
+		<view class="content_total" :style="{top: top}">鍏眥{pageData.total}}鏉℃暟鎹�</view>
 		<view class="content_list">
-			<scroll-view @scrolltolower="getLists" scroll-y :style="{height: height}">
-				<view class="content_list_item" v-for="item in lists" :key="item.id" @click="jump(item)">
+			<scroll-view
+			:refresher-enabled="true"
+			:refresher-triggered="isLoading"
+			@refresherrefresh="onRefresh"
+			refresher-background="#fff"
+			@scrolltolower="onLoads"
+			scroll-y
+			:style="{height: height}">
+				<view class="content_list_item" v-for="item in listData" :key="item.id" @click="jumpDesc(item)">
 					<view class="content_list_item_title">
 						<text>{{item.code}}</text>
 						<text class="warning" v-if="item.checkType === 0">宸$嚎</text>
@@ -92,156 +99,48 @@
 			</scroll-view>
 		</view>
 		<!-- 閫夋嫨鏃ユ湡 -->
-		<u-calendar :show="timeShow" mode="range" @confirm="timeConfirm"></u-calendar>
+		<u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar>
 	</view>
 </template>
 
 <script>
 	import Search from '@/components/Search.vue'
+	import { page } from '@/util/api/QualityAPI'
+	import { getWorkingProcedure, deletejy } from "@/util/api/PlanningAPI"
+	import { mapState } from 'vuex'
+	
 	export default {
 		components: { Search },
 		data() {
 			return {
 				height: '',
 				top: '',
-				listData: {
+				isLoading: false,
+				pageData: {
 					capacity: 10,
 					page: 0,
 					total: 0,
-					startDate: '',
-					endDate: '',
-					procedureIds: [],
-					departIds: '',
-					mixParam: '',
-					cateIds: []
+					checkStartDate: '',
+					checkEndDate: '',
+					minParam: '',
+					batch: '',
+					checkType: '',
+					procedureId: '',
+					workorderId: ''
 				},
 				data: [		// 妫�楠岀被鍨�
 					{ id: '0', name: '宸$嚎', isActive: false },
 					{ id: '1', name: '宸℃', isActive: false },
 					{ id: '2', name: '瀹屽伐妫�', isActive: false }
 				],
+				minDate: new Date(2021, 0, 1),
+				maxDate: new Date(new Date().getFullYear() + 1, 12, 30),
+				listData: [],
 				workingProcedure: [],	// 宸ュ簭
-				finished: true,
 				loading: false,
+				finished: false,
 				refreshing: false,
-				timeShow: false,
-				lists: [
-					{
-						id: 1,
-						checkType: 0,
-						status: 0,
-						code: '1234543223',
-						urgent: 1,
-						num: 100,
-						batch: '11111',
-						planDate: '2023-08-29',
-						mmodel: {
-							name: '宸ュ簭璁″垝',
-							code: 'fbdseasafghb'
-						},
-						usermodel: {
-							realname: '璁″垝浜哄憳'
-						},
-						pmodel: {
-							name: '宸ュ簭璁″垝'
-						},
-						fmodel: {
-							name: '宸ュ巶'
-						}
-					},
-					{
-						id: 2,
-						checkType: 1,
-						code: '1234543223',
-						status: 0,
-						urgent: 1,
-						num: 100,
-						batch: '11111',
-						planDate: '2023-08-29',
-						mmodel: {
-							name: '宸ュ簭璁″垝',
-							code: 'fbdseasafghb'
-						},
-						usermodel: {
-							realname: '璁″垝浜哄憳'
-						},
-						pmodel: {
-							name: '宸ュ簭璁″垝'
-						},
-						fmodel: {
-							name: '宸ュ巶'
-						}
-					},
-					{
-						id: 3,
-						checkType: 2,
-						code: '1234543223',
-						status: 0,
-						urgent: 1,
-						num: 100,
-						batch: '11111',
-						planDate: '2023-08-29',
-						mmodel: {
-							name: '宸ュ簭璁″垝',
-							code: 'fbdseasafghb'
-						},
-						usermodel: {
-							realname: '璁″垝浜哄憳'
-						},
-						pmodel: {
-							name: '宸ュ簭璁″垝'
-						},
-						fmodel: {
-							name: '宸ュ巶'
-						}
-					},
-					{
-						checkType: 2,
-						id: 4,
-						status: 0,
-						urgent: 1,
-						code: '1234543223',
-						num: 100,
-						batch: '11111',
-						planDate: '2023-08-29',
-						mmodel: {
-							name: '宸ュ簭璁″垝',
-							code: 'fbdseasafghb'
-						},
-						usermodel: {
-							realname: '璁″垝浜哄憳'
-						},
-						pmodel: {
-							name: '宸ュ簭璁″垝'
-						},
-						fmodel: {
-							name: '宸ュ巶'
-						}
-					},
-					{
-						checkType: 1,
-						id: 5,
-						status: 0,
-						code: '1234543223',
-						urgent: 1,
-						num: 100,
-						batch: '11111',
-						planDate: '2023-08-29',
-						mmodel: {
-							name: '宸ュ簭璁″垝',
-							code: 'fbdseasafghb'
-						},
-						usermodel: {
-							realname: '璁″垝浜哄憳'
-						},
-						pmodel: {
-							name: '宸ュ簭璁″垝'
-						},
-						fmodel: {
-							name: '宸ュ巶'
-						}
-					}
-				]
+				timeShow: false
 			};
 		},
 		onReady() {
@@ -253,51 +152,65 @@
 				}).exec()
 			})
 		},
+		computed: {
+			...mapState(['userInfo'])
+		},
+		onLoad(option) {
+			if (option.id) {
+				this.pageData.workorderId = option.id
+			}
+			this.onLoads()
+			this.getWorkingProcedures()
+		},
 		methods: {
 			// 璺宠浆
-			jump(item) {
+			jumpDesc(item) {
 				uni.navigateTo({
-					url: `/pages/InspectionDetails/InspectionDetails?id=${item.id}`
+					url: `/pages_inspect/pages/InspectionDetails/InspectionDetails?id=${item.id}`
 				})
 			},
 			// 鑾峰彇澶撮儴缁勪欢楂樺害
 			getHeight(height) {
 				this.height = height
 			},
+			onRefresh() {
+				if (this.isLoading) return
+				this.isLoading = true
+				this.listData = []
+				this.pageData.page = 0
+				this.onLoads()
+			},
 			// 閲嶇疆
 			reset() {
-				this.listData.page = 0
+				this.pageData.checkStartDate = ''
+				this.pageData.checkEndDate = ''
+				this.pageData.minParam = ''
+				this.pageData.checkType = ''
+				this.pageData.procedureId = ''
+				this.pageData.batch = ''
+				this.pageData.page = 0
+				this.listData = []
 				this.finished = false
-				this.lists = []
-				this.listData.mixParam = ''
-				this.listData.startDate = ''
-				this.listData.endDate = ''
-				this.listData.procedureIds = []
-				if (this.factoryList.length > 0) {
-					this.listData.departIds = this.factoryList[0].id
-				}
-				if (this.data.length > 0) {
-					this.data.forEach(item => { item.isActive = false })
-				}
-				// this.getLists()
-				// this.pageCounts()
+				this.data.forEach(item => { item.isActive = false })
+				this.workingProcedure.forEach(item => { item.isActive = false })
+				this.onLoads()
 			},
 			// 鏃ユ湡纭畾
 			timeConfirm(val) {
-				this.listData.startDate = val[0]
-				this.listData.endDate = val[val.length - 1]
+				this.pageData.checkStartDate = val[0]
+				this.pageData.checkEndDate = val[val.length - 1]
 				this.timeShow = false
 			},
-			// 鍒囨崲宸ュ巶
-			changeTags(i, id) {
-				this.listData.departIds = id
-				this.getWorkingProcedures(id)
-				this.factoryList.forEach((item, index) => {
-					if (index === i) {
-						item.isActive = true
-					} else {
-						item.isActive = false
-					}
+			// 鍒囨崲妫�绫诲瀷
+			changeTag(i) {
+				this.data.forEach((item, index) => {
+					item.isActive = index === i;
+				})
+			},
+			// 鍒囨崲妫�宸ュ簭
+			changeTag1(i) {
+				this.workingProcedure.forEach((item, index) => {
+					item.isActive = index === i;
 				})
 			},
 			// 鎵撳紑鏃ユ湡鎻掍欢
@@ -306,130 +219,85 @@
 			},
 			// 鎼滅储
 			searchInput(val) {
-				this.listData.mixParam = val
-				this.listData.page = 0
+				this.pageData.minParam = val
+				this.pageData.page = 0
+				this.listData = []
 				this.finished = false
-				this.lists = []
-				this.getLists()
-			},
-			// 鐐瑰嚮鏍囩鎼滅储
-			clickTag(ids) {
-				this.listData.cateIds = ids
-				this.listData.page = 0
-				this.finished = false
-				this.lists = []
-				// this.getLists()
-			},
-			// 鑾峰彇鍒楄〃缁熻
-			pageCounts() {
-				pageCount({
-					factoryId: this.listData.departIds,
-					procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
-					startDate: this.listData.startDate,
-					endDate: this.listData.endDate,
-					statusList: this.listData.cateIds
-				}).then(res => {
-					if (res.code === 200 && res.data) {
-						this.tagList[0].num = res.data.allNum.toString()
-						this.tagList[1].num = res.data.startNum.toString()
-						this.tagList[2].num = res.data.ingNum.toString()
-						this.tagList[3].num = res.data.endNum.toString()
-					}
-				})
-			},
-			// 鑾峰彇宸ュ巶鏁版嵁
-			getOrganizations() {
-				getOrganization({
-					type: 1
-				}).then(res => {
-					if (res.code === 200 && res.data && res.data.length !== 0) {
-						res.data.forEach((item, i) => {
-							item.isActive = i === 0;
-						})
-						if (res.data.length > 0) {
-							this.factoryList = res.data
-							this.listData.departIds = this.factoryList[0].id
-							this.listData.procedureIds = ''
-							this.finished = false
-							this.getWorkingProcedures(this.factoryList[0].id)
-							this.getLists()
-							this.pageCounts()
-						}
-					}
-				})
+				this.onLoads()
 			},
 			// 鑾峰彇宸ュ簭鏁版嵁
-			getWorkingProcedures(orgId) {
-				this.data = []
-				getWorkingProcedure({ orgId })
-					.then(res => {
-						if (res.code === 200 && res.data && res.data.length !== 0) {
-							res.data.forEach((item, i) => {
-								item.isActive = false;
-							})
-							this.data = res.data
-						}
-					})
-			},
-			// 鎼滅储寮规鎻愪氦
-			submit()  {
-				let pmodelOrgId = []
-				this.data.forEach((item) => {
-					if (item.isActive) {
-						pmodelOrgId.push(item.id)
+			getWorkingProcedures() {
+				getWorkingProcedure({
+					capacity: 100,
+					page: 1,
+					model: {
+						userId: this.userInfo.id
+					}
+				}).then(res => {
+					if (res.code === 200 && res.data.records.length !== 0) {
+						res.data.records.forEach((item, index) => {
+							// if (index === 0) {
+							//     workingProcedure.push({ id: item.id, name: item.name, isActive: true })
+							// } else {
+								this.workingProcedure.push({ id: item.id, name: item.name, isActive: false })
+							// }
+						})
 					}
 				})
-				this.listData.procedureIds = pmodelOrgId
-				this.listData.page = 0
-				this.finished = false
-				this.lists = []
-				// this.getLists()
-				// this.pageCounts()
 			},
-			// 鑾峰彇璁″垝鍒楄〃鏁版嵁
-			getLists() {
-				console.log('getLists')
+			// 鎼滅储寮规鎻愪氦
+			submit() {
+				this.data.forEach(item => {
+					if (item.isActive) {
+						this.pageData.checkType = item.id
+					}
+				})
+				this.workingProcedure.forEach(item => {
+					if (item.isActive) {
+						this.pageData.procedureId = item.id
+					}
+				})
+				this.pageData.page = 0
+				this.listData = []
+				this.finished = false
+				this.onLoads()
+			},
+			// 鍒楄〃
+			onLoads() {
 				if (!this.finished) {
+					this.pageData.page = this.pageData.page += 1
 					this.loading = true
-					this.listData.page = this.listData.page++
-					getList({
-						capacity: this.listData.capacity,
+					page({
+						capacity: this.pageData.capacity,
+						page: this.pageData.page,
 						model: {
-							mixParam: this.listData.mixParam,
-							startDate: this.listData.startDate,
-							endDate: this.listData.endDate,
-							procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
-							factoryId: this.listData.departIds,
-							statusList: this.listData.cateIds
-						},
-						page: this.listData.page,
-						sorts: [
-							{
-								direction: 'ASC',
-								property: 'publishDate'
-							}
-						]
+							minParam: this.pageData.minParam,
+							checkStartDate: this.pageData.checkStartDate,
+							checkEndDate: this.pageData.checkEndDate,
+							checkType: this.pageData.checkType,
+							procedureId: this.pageData.procedureId,
+							workorderId: this.pageData.workorderId,
+							batch: this.pageData.batch
+						}
 					}).then(res => {
-						this.loading = false
-						this.listData.total = res.data.total
+						this.isLoading = false
 						if (this.refreshing) {
-							this.lists = []
+							this.listData = []
 							this.refreshing = false;
 						}
-						if (res.code === 200 && res.data.records.length !== 0) {
-							if (this.lists.length === 0) {
-								this.lists = res.data.records
-							} else {
-								this.lists.push(...res.data.records)
-							}
+						this.loading = false
+						if (res.code === 200 && res.data.records && res.data.records.length !== 0) {
+							this.pageData.total = res.data.total
+							this.listData.push(...res.data.records)
 						} else {
 							this.finished = true
 						}
 					}).catch(err => {
+						this.isLoading = false
 						this.loading = false
 						this.finished = true
 						if (this.refreshing) {
-							this.lists = []
+							this.listData = []
 							this.refreshing = false;
 						}
 					})
diff --git a/minipro_standard/util/api/QualityAPI.js b/minipro_standard/util/api/QualityAPI.js
index 72031cf..8c4a347 100644
--- a/minipro_standard/util/api/QualityAPI.js
+++ b/minipro_standard/util/api/QualityAPI.js
@@ -38,7 +38,7 @@
 
 // 鏍规嵁ID鏌ヨ
 export function getBYid (id) {
-  return request.post(`/ext/workorderCheckExt/${id}`, data)
+  return request.post(`/ext/workorderCheckExt/${id}`)
 }
 // export function getBYid(id: any): Promise<any> {
 //     return httpRequest({
@@ -49,7 +49,7 @@
 
 // 鑾峰彇鍑哄叆搴撲俊鎭�
 export function findById (id) {
-  return request.post(`/ext/wOutboundExt/findById?id=${id}`, data)
+  return request.post(`/ext/wOutboundExt/findById?id=${id}`)
 }
 // export function findById(id: Number): Promise<any> {
 //     return httpRequest({
@@ -107,8 +107,8 @@
 // }
 
 // 鏍规嵁ID鏌ヨ璁惧
-export function getBYid (id) {
-  return request.post(`/ext/deviceExt/${id}`, data)
+export function getsbInfo (id) {
+  return request.post(`/ext/deviceExt/${id}`)
 }
 // export function getsbInfo (id: any): Promise<any> {
 //     return httpRequest({

--
Gitblit v1.9.3