Bläddra i källkod

8.23bug修改

caojunjie 1 år sedan
förälder
incheckning
57292cdb13

+ 2 - 1
pages.json

@@ -90,7 +90,8 @@
 			"path": "device/EquipmentArchives/EquipmentArchives",
 			"style": {
 				"navigationBarTitleText": "设备档案",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
 			}
 
 		}, {

+ 21 - 6
pages/device/EquipmentArchives/EquipmentArchives.vue

@@ -1,14 +1,19 @@
 <template>
 	<view>
-		<!-- <view>
-			<u-navbar title="个人中心" @rightClick="rightClick" :autoBack="true" ></u-navbar>
-		</view> -->
+		<view style="margin-bottom: 90rpx;">
+			<u-navbar title="设备档案" bgColor="#fd4b09" leftIconColor="#fff" leftIconSize="27px"
+			:titleStyle="{'color':'#fff'}" :autoBack="true" >
+				<view class="u-nav-slot" slot="right" >
+					<view style="color: #fff;font-size: 30rpx;" @click="Jumpfun()">添加档案</view>
+				</view>
+			</u-navbar>
+		</view>
 		<view class="searchforBox">
 			<view style="display: flex;align-items: center;">
 				<u-search v-model="page.corpName" :showAction="true" actionText="搜索"
 				clearabled :animation="false" 
 				@search="searchfun" @custom="searchfun" @clear="clearfun"></u-search>
-				<view class="addbox" @click="Jumpfun()">添加档案</view>
+				<!-- <view class="addbox" @click="Jumpfun()">添加档案</view> -->
 			</view>
 <!-- 			<view class="screenflex">
 				<view>数量排序</view>
@@ -39,6 +44,8 @@
 			</view>
 		</view>
 		<u-loadmore v-if="total !== 0" :status="status" />
+		
+		<u-loading-page style="z-index: 999;" bgColor="rgba(0,0,0,.5)"  :loading="loading"></u-loading-page>
 	</view>
 </template>
 
@@ -55,14 +62,17 @@
 				// 列表数据
 				listData:[],
 				status: 'loadmore',
-				total:0
+				total:0,
+				loading:false,
 				
 			}
 		},
 		onLoad() {
+			
+		},
+		onShow() {
 			this.corpequipmentarchivesListfun()
 		},
-		onShow() {},
 		onReachBottom() {
 			this.status = 'loading'
 			if (this.page.current * this.page.size < this.total) {
@@ -92,15 +102,20 @@
 			},
 			// 搜索清空
 			clearfun(){
+				this.listData = []
+				this.page.current = 1
+				this.page.size = 10
 				this.page.corpName = ''
 				this.corpequipmentarchivesListfun()
 			},
 			// 获取设备档案列表
 			corpequipmentarchivesListfun(){
+				this.loading = true
 				corpequipmentarchivesList(this.page).then(res=>{
 					let list = res.data.records
 					this.listData = [...this.listData,...list]
 					this.total = res.data.total
+					this.loading = false
 				})
 			}
 			

+ 9 - 1
pages/device/FileDetails/FileDetails.vue

@@ -448,6 +448,7 @@
 				
 		<!-- <u-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarClose"></u-calendar> -->
 
+		<u-loading-page style="z-index: 999;" bgColor="rgba(0,0,0,.5)"  :loading="loading"></u-loading-page>
 	</view>
 </template>
 
@@ -472,6 +473,7 @@
 	export default {
 		data() {
 			return {
+				loading:false,
 				// 弹框
 				// 设备添加
 				EquipmentAddConfirm: false,
@@ -577,7 +579,7 @@
 					signingDateEnd: this.form.signingDateEnd ? this.form.signingDateEnd + ' 00:00:00' : null,
 					remarks: this.form.remarks ? this.form.remarks : null
 				}
-				console.log(obj, 166);
+				this.loading = true
 				this.corpequipmentarchivesSubmitfun(obj)
 			},
 			// 保存数据接口
@@ -588,7 +590,13 @@
 							type: 'success',
 							message: '操作成功',
 						})
+						this.loading = false
 						this.form = res.data
+						this.form.corpEquipmentArchivesItemList.map(item=>{
+							item.exitDate = item.exitDate ? item.exitDate.slice(0,10) : null
+							item.repairReportDate = item.repairReportDate ? item.repairReportDate.slice(0,10) : null
+							item.maintenanceDate = item.maintenanceDate ? item.maintenanceDate.slice(0,10) : null
+						})
 					} else {
 						this.$refs.uToast.show({
 							type: 'error',

+ 60 - 14
pages/device/RepairDetails/RepairDetails.vue

@@ -48,7 +48,7 @@
 				<!-- <view style="font-size: 30rpx;color: #999;margin-left: 10rpx;">添加图片</view> -->
 				<view style="margin-top: 20rpx;">
 					<u-upload
-						:fileList="form.maintenanceFiles"
+						:fileList="userImgList"
 						 :disabled="form.status != 3"
 						@afterRead="afterRead"
 						@delete="deletePic"
@@ -166,7 +166,7 @@
 			<view class="kapian" >
 				<view class="wxtitleflex">
 					<view class="wxtitle">添加费用</view>
-					<view v-if="form.status == 3 && userInfoRoleName.indexOf('admin') != -1" 
+					<view v-if="form.status == 3 || userInfoRoleName.indexOf('admin') != -1" 
 					style="color: #fff; background-color: #FD4B09;" class="addwx" 
 					@click="kapianShow = true">添加</view>
 				</view>
@@ -186,7 +186,7 @@
 			<view class="bottombox_name" @click="pickerShowfun" v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1">
 				<text>{{form.maintenanceWorkerName == null || form.maintenanceWorkerName == '' ? '请选择维修工' : form.maintenanceWorkerName}}</text>
 			</view>
-			<view v-if="(form.status == 3 || form.status == 4) && form.dispatchingWorkers == 3" style="color: #FD4B09;">维修费{{form.maintenanceAmount?form.maintenanceAmount:0}}元</view>
+			<view v-if="(form.status == 3 || form.status == 4) && form.dispatchingWorkers == 3" style="color: #FD4B09;">维修费:{{form.maintenanceAmount?form.maintenanceAmount:0}}元</view>
 			<view class="bottombox_right">
 				<view class="buttonClass"
 				 v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1" 
@@ -228,6 +228,7 @@
 					border="bottom" type="digit" confirm-type="done" @input="moneyInput" placeholder="金额" ></u-input>
 				</view>
 			</view>
+			<u-toast ref="uToastkapian"></u-toast>
 		</u-modal>
 		<!-- <u-overlay :show="overlayShow">
 				<view class="warp">
@@ -236,6 +237,7 @@
 			</u-overlay> -->
 			
 			<u-loading-page bg-color="#e8e8e8" :loading="overlayShow" loading-text="加载中..." style="z-index: 999;" bgColor="rgba(0,0,0,0.5)"></u-loading-page>
+			
 	</view>
 </template>
 
@@ -258,7 +260,7 @@
 		data() {
 			return {
 				id:null,
-				wxStyle: '#fd4b09',
+				wxStyle: '',
 				gzStyle: '',
 				overlayShow: false,
 				form:{
@@ -287,7 +289,7 @@
 				// 当前点击费用的下标
 				kapianindex:null,
 				// 用户图片
-				userImgList: []
+				userImgList: [],
 			}
 		},
 		onLoad(e) {
@@ -314,26 +316,62 @@
 			},
 			// 添加项目确认
 			kapianConfirm() {
-				console.log("this.kapianindex," + this.kapianindex);
+				console.log(this.kapianindex,319);
+				if(!this.kapian.costName) {
+					this.$refs.uToastkapian.show({
+						type: 'warning',
+						position:'top',
+						message: "请输入项目名称",
+					})
+					return
+				}
+				if(!this.kapian.amount) {
+					this.$refs.uToastkapian.show({
+						type: 'warning',
+						position:'top',
+						message: "请输入金额",
+					})
+					return
+				}
+				if(Number(this.kapian.amount) <= 0) {
+					this.$refs.uToastkapian.show({
+						type: 'warning',
+						position:'top',
+						message: "请输入不包含负数的数字",
+					})
+					return
+				}
 				if (this.kapianindex != null) {
 					this.form.maintenanceFees[this.kapianindex] = this.kapian
 				}else {
 					this.form.maintenanceFees.push(this.kapian)
 				}
+				var money = 0
+				for (let fees of this.form.maintenanceFees) {
+					money += Number(fees.amount)
+				}
+				
+				this.form.maintenanceAmount = money;
+				
 				this.kapianindex = null
 				this.kapianShow = false;
-				
 				this.kapian = {}
 				
 			},
-			moneyInput() {
-				var money = 0
+			moneyInput(value) {
+				//正则表达试
+				value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
+				//重新赋值给input
+				this.$nextTick(() => {
+				    this.kapian.amount = value
+				})
 				
-				for (let fees of this.form.maintenanceFees) {
-					money += Number(fees.amount)
-				}
+				// var money = 0
+				// for (let fees of this.form.maintenanceFees) {
+				// 	money += Number(fees.amount)
+				// }
 				
-				this.form.maintenanceAmount = money;
+				// this.form.maintenanceAmount = money;
 			},
 			tab(type) {
 				if(type == "wx") {
@@ -342,7 +380,7 @@
 					// this.form.status = 2
 					
 				} else if (type == "gz") {
-					if (this.form.dispatchingWorkers == 1) return
+					if (this.form.dispatchingWorkers == 2 && this.userInfoRoleName.indexOf('admin') == -1) return
 					this.gzStyle = "#fd4b09"
 					this.wxStyle = ""
 					// this.form.status = 3
@@ -350,12 +388,18 @@
 			},
 			// 设备删除
 			maintenanceDe(index){
+				this.kapianindex = null
+				this.kapianShow = false;
+				this.kapian = {}
 				this.form.maintenanceFees.splice(index,1)
 				this.moneyInput()
 			},
 			// 撤销派工
 			maintenanceRevokeDispatchingWorkersfun(){
 				this.overlayShow = true;
+				this.form.maintenanceWorkerId = null
+				this.form.maintenanceWorkerName = null
+				this.form.maintenanceWorkerTel = null
 				maintenanceRevokeDispatchingWorkers(this.form).then(res=>{
 					if (res.code == 200) {
 						this.$refs.uToast.show({
@@ -363,6 +407,8 @@
 							message: "撤销派工成功",
 						})
 						this.form = res.data
+						this.wxStyle = ""
+						this.gzStyle = ""
 					}else {
 						this.$refs.uToast.show({
 							type: 'error',

+ 86 - 49
pages/device/RepairReportList/RepairReportList.vue

@@ -1,56 +1,68 @@
 <template>
-	<view class="listbox">
-		<u-tabs :list="tabforData" @click="tbafun"></u-tabs>
-		<!-- <view class="tbasflex">
-			<view class="tabforBox" :class="page.status == item.id?'Selected':''" v-for="item in tabforData" :key="item.id" @click="tbafun(item.id)">
-				<text>{{item.name}}</text>
-			</view>
-		</view> -->
-		
-		<view class="cardBox" v-for="(item,index) in Datalist" :key="index" @click="cardBoxClick(item)">
-			<view class="cardBox_top">
-				<!-- <u-icon name="bookmark-fill" size="24"></u-icon> -->
+	<view>
+		<view class="searchforBox">
+			<u-search v-model="page.corpName" :showAction="true" actionText="搜索"
+			clearabled :animation="false" 
+			@search="searchfun" @custom="searchfun" @clear="clearfun"></u-search>
+		</view>
+		<view class="listbox">
+			<u-tabs :list="tabforData" @click="tbafun"></u-tabs>
+			<!-- <view class="tbasflex">
+				<view class="tabforBox" :class="page.status == item.id?'Selected':''" v-for="item in tabforData" :key="item.id" @click="tbafun(item.id)">
+					<text>{{item.name}}</text>
+				</view>
+			</view> -->
+			
+			<view class="cardBox" v-for="(item,index) in Datalist" :key="index" @click="cardBoxClick(item)">
 				<view class="cardBox_top">
-					<view style="width: 10rpx;height: 35rpx;background-color: #fd4b09; margin-right: 8rpx;"></view>
-					<view class="text">{{item.sysNo}}</view>
+					<!-- <u-icon name="bookmark-fill" size="24"></u-icon> -->
+					<view class="cardBox_top">
+						<view style="width: 10rpx;height: 35rpx;background-color: #fd4b09; margin-right: 8rpx;"></view>
+						<view class="text">{{item.sysNo}}</view>
+					</view>
+					<view>
+						<text v-if="item.status == 1" style="color: #3c9cff; font-size: 28rpx">待派工</text>
+						<!-- <text v-if="item.status == 2" style="color: #fd4b09; font-size: 28rpx">待接单</text> -->
+						<text v-if="item.status == 3" style="color: rgba(222, 36, 18, 1); font-size: 28rpx">待维修</text>
+						<text v-if="item.status == 4" style="color:  rgba(233, 157, 66, 1); font-size: 28rpx">待结算</text>
+						<text v-if="item.status == 5" style="color: rgba(129, 179, 55, 1); font-size: 28rpx">已完工</text>
+					</view>
 				</view>
-				<view>
-					<text v-if="item.status == 1" style="color: #3c9cff; font-size: 28rpx">待派工</text>
-					<!-- <text v-if="item.status == 2" style="color: #fd4b09; font-size: 28rpx">待接单</text> -->
-					<text v-if="item.status == 3" style="color: rgba(222, 36, 18, 1); font-size: 28rpx">待维修</text>
-					<text v-if="item.status == 4" style="color:  rgba(233, 157, 66, 1); font-size: 28rpx">待结算</text>
-					<text v-if="item.status == 5" style="color: rgba(129, 179, 55, 1); font-size: 28rpx">已完工</text>
+				<view class="title">{{item.deviceName}}</view>
+				<view class="text">
+					<view class="text_left">客户名称:</view>
+					<view>{{item.corpName}}</view>
 				</view>
+				<view class="text">
+					<view class="text_left">客户电话:</view>
+					<view>{{item.corpTel}}</view>
+				</view>
+				<view class="text">
+					<view class="text_left">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:</view>
+					<view>{{item.deviceAddress}}</view>
+				</view>
+				<view class="text">
+					<view class="text_left">维修人员:</view>
+					<view>{{item.maintenanceWorkerName}}</view>
+				</view>
+				<view class="text">
+					<view class="text_left">维修电话:</view>
+					<view>{{item.maintenanceWorkerTel}}</view>
+				</view>
+				
+				<view class="positioningButton">
+					<!-- <view class="Buttonjd" v-if="item.status == 1 && userInfoRoleName.indexOf('admin') != -1" @click="Jumpfun(item.id,'PG')">派工</view>
+					<view class="Buttonjd" v-if="item.status == 2 && userInfoRoleName.indexOf('admin') != -1" @click="Jumpfun(item.id,'QXPG')">撤销派工</view>
+					<view class="Buttonjd" v-if="item.status == 2 && userInfoRoleName.indexOf('维修工') != -1" @click="Jumpfun(item.id,'JD')">接单</view>
+					<view class="Buttonjd" v-if="item.status == 3 && userInfoRoleName.indexOf('admin') == -1" @click="Jumpfun(item.id,'FY')">提交费用</view>
+					<view class="Buttonjd" v-if="item.status == 4 && userInfoRoleName.indexOf('admin') == -1" @click="Jumpfun(item.id,'FY')">确认结算</view> -->
+					<!-- <view class="Buttonxq" @click="Jumpfun(item.id,'XQ')">详情</view> -->
+				</view>
+				
 			</view>
-			<view class="title">{{item.deviceName}}</view>
-			<view class="text">
-				<view class="text_left">客户电话:</view>
-				<view>{{item.corpTel}}</view>
-			</view>
-			<view class="text">
-				<view class="text_left">设备地址:</view>
-				<view>{{item.deviceAddress}}</view>
-			</view>
-			<view class="text">
-				<view class="text_left">维修工:</view>
-				<view>{{item.maintenanceWorkerName}}</view>
-			</view>
-			<view class="text">
-				<view class="text_left">维修电话:</view>
-				<view>{{item.maintenanceWorkerTel}}</view>
-			</view>
-			
-			<view class="positioningButton">
-				<!-- <view class="Buttonjd" v-if="item.status == 1 && userInfoRoleName.indexOf('admin') != -1" @click="Jumpfun(item.id,'PG')">派工</view>
-				<view class="Buttonjd" v-if="item.status == 2 && userInfoRoleName.indexOf('admin') != -1" @click="Jumpfun(item.id,'QXPG')">撤销派工</view>
-				<view class="Buttonjd" v-if="item.status == 2 && userInfoRoleName.indexOf('维修工') != -1" @click="Jumpfun(item.id,'JD')">接单</view>
-				<view class="Buttonjd" v-if="item.status == 3 && userInfoRoleName.indexOf('admin') == -1" @click="Jumpfun(item.id,'FY')">提交费用</view>
-				<view class="Buttonjd" v-if="item.status == 4 && userInfoRoleName.indexOf('admin') == -1" @click="Jumpfun(item.id,'FY')">确认结算</view> -->
-				<!-- <view class="Buttonxq" @click="Jumpfun(item.id,'XQ')">详情</view> -->
-			</view>
-			
+			<u-loadmore v-if="total !== 0" :status="status" />
+			<u-loading-page style="z-index: 999;" bgColor="rgba(0,0,0,.5)"  :loading="loading"></u-loading-page>
 		</view>
-		<u-loadmore v-if="total !== 0" :status="status" />
 	</view>
 </template>
 
@@ -84,12 +96,13 @@
 				page:{
 					status:null,
 					current: 1,
-					size: 5,
+					size: 10,
 				},
 				Datalist:[],
 				total:0,
 				status: 'loadmore',
-				userInfoRoleName:[]
+				userInfoRoleName:[],
+				loading:false
 			}
 		},
 		onLoad() {
@@ -115,6 +128,22 @@
 			}
 		},
 		methods: {
+			// 搜索
+			searchfun(value)	{
+				this.Datalist = []
+				this.page.current = 1
+				this.page.size = 10
+				this.page.corpName = value
+				this.maintenanceListfun()
+			},
+			// 搜索清空
+			clearfun(){
+				this.Datalist = []
+				this.page.current = 1
+				this.page.size = 10
+				this.page.corpName = ''
+				this.maintenanceListfun()
+			},
 			cardBoxClick(item) {
 				if (item.status == 1 && this.userInfoRoleName.indexOf('admin') != -1) {
 					this.Jumpfun(item.id,'PG');
@@ -143,10 +172,12 @@
 			},
 			// 获取待接单状态的维修数据
 			maintenanceListfun(){
+				this.loading = true
 				maintenanceList(this.page).then(res=>{
 					const arr = res.data.records
 					this.Datalist = [...this.Datalist,...arr]
 					this.total = res.data.total
+					this.loading = false
 				})
 			}
 		}
@@ -154,6 +185,12 @@
 </script>
 
 <style lang="scss" scoped>
+	.searchforBox {
+		width: 100%;
+		background: #fff;
+		padding: 20rpx 30rpx;
+		box-sizing: border-box;
+	}
 	.listbox{
 		padding: 20rpx;
 		box-sizing: border-box;

+ 5 - 0
pages/tabBar/center.vue

@@ -104,6 +104,11 @@
 					this.revenueTop = e.statusBarHeight
 				}
 			})
+		},
+		onShow() {
+			this.src = uni.getStorageSync('userInfo').avatar
+			this.userName = uni.getStorageSync('userInfo').account
+			this.role = uni.getStorageSync('userInfo').role_name
 		},
 		methods: {
 			click() {