浏览代码

动火台账审核

“yueshang” 2 年之前
父节点
当前提交
464578c3a2

+ 6 - 6
pages/mine/info/edit.vue

@@ -10,7 +10,7 @@
 			<view class="u-demo-block">
 				<view class="u-demo-block__content">
 					<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
-					<u--form label-position="top" :model="user" ref="form1" label-width='100'>
+					<u--form label-position="top" :model="user" ref="customForm" label-width='100'>
 						<view class="flex flex-direction-row">
 							<view class="flex justify-center align-center" style="width: 12%;">
 								<image :src="`${urls}/info/id.svg`" class="editimg"></image>
@@ -201,7 +201,7 @@
 		},
 		onReady() {
 			// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
-			this.$refs.form1.setRules(this.rules)
+			this.$refs.customForm.setRules(this.rules)
 		},
 		onLoad() {
 			this.getUser()
@@ -229,20 +229,20 @@
 			sexSelect(e) {
 				this.user.userInfo.sexname = e.name
 				this.user.userInfo.sex = e.id
-				this.$refs.form1.validateField('userInfo.sex')
+				this.$refs.customForm.validateField('userInfo.sex')
 			},
 			birthdayClose() {
 				this.showBirthday = false
-				this.$refs.form1.validateField('userInfo.birthday')
+				this.$refs.customForm.validateField('userInfo.birthday')
 			},
 			birthdayConfirm(e) {
 				this.showBirthday = false
 				this.user.userInfo.birthday = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
-				this.$refs.form1.validateField('userInfo.birthday')
+				this.$refs.customForm.validateField('userInfo.birthday')
 			},
 			submit() {
 				// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
-				this.$refs.form1.validate().then(res => {
+				this.$refs.customForm.validate().then(res => {
 					// uni.$u.toast('校验通过')
 					updateUserProfile(this.user.userInfo).then(response => {
 						// this.user = response.data

+ 2 - 2
pagesB/fire/fireSpecial/addSpecial/index.vue

@@ -228,9 +228,9 @@
 				this.formData.issueDate = e.detail.value
 			},
 			submit(ref) {
-				this.formData.att = this.formData.attId?this.formData.attId.join(''):this.formData.att
+				
 				this.$refs[ref].validate().then(res => {
-					console.log(this.isview, 'this.formDatathis.isview');
+					this.formData.att = this.formData.attId?this.formData.attId.join(''):this.formData.att
 					if (this.isedit) {
 						fireSpecialUpdate(JSON.stringify(this.formData)).then(res => {
 							this.$modal.msg('修改成功')

+ 11 - 6
pagesB/fire/fireWork/addWork/index.vue

@@ -11,11 +11,11 @@
 					</u-form-item>
 					<u-form-item label="动火作业执行人" prop="executor" :required="true"
 						@click="showExecutor = true; hideKeyboard()">
-						<u-input v-model="formData.executor" placeholder="请输入" :disabled="isview" />
+						<u-input v-model="formData.executor" placeholder="请选择" :disabled="isview" />
 					</u-form-item>
 					<u-form-item label="动火台账状态" prop="workStatus" :required="true"
-						@click="showSex = true; hideKeyboard()">
-						<u-input v-model="formData.workStatus" placeholder="请输入" :disabled="isview" />
+						@click="showSex = true; hideKeyboard()" v-if="isview">
+						<u-input v-model="formData.workStatus" placeholder="请选择" :disabled="isview" />
 					</u-form-item>
 					<picker mode="date" :value="dateTime" @change="bindDateChange" :disabled="isview">
 						<view class="datatime-street">
@@ -109,7 +109,7 @@
 					orgId: '',
 					workReason: '',
 					executor: '',
-					workStatus: '',
+					workStatus: '未审核',
 					workBegin: '',
 					workEnd: '',
 					att: '',
@@ -262,9 +262,14 @@
 				this.formData.workEnd = e.detail.value
 			},
 			submit(ref) {
-				this.formData.att = this.formData.attId? this.formData.attId.join('') :this.formData.att
+				const end = new Date(this.formData.workEnd).getTime()
+				const start = new Date(this.formData.workBegin).getTime()
+				if (start > end) {
+					console.log(start,end,'000000000000');
+					return this.$modal.msg('结束时间不能小于开始时间')
+				} 
 				this.$refs[ref].validate().then(res => {
-					console.log(this.isview, 'this.formDatathis.isview');
+					this.formData.att = this.formData.attId? this.formData.attId.join('') :this.formData.att
 					if (this.isedit) {
 						fireWorkUpdate(JSON.stringify(this.formData)).then(res => {
 							this.$modal.msg('修改成功')

+ 35 - 6
pagesB/fire/fireWork/index.vue

@@ -42,9 +42,13 @@
 							<view class="an-niu" @click.native="showModal(item.id)" v-if="item.workStatus=='未审核'">
 								<text class="detailDel">删除</text>
 							</view>
-							<view class="an-niu" @click.native="onClick(item.id)" link><text class="detail">查看详情</text>
+							<view @click.native="onClick(item.id)" link  class="an-niu" ><text class="detail">查看详情</text>
 							</view>
-							<view class="an-niu" @click.native="editClick(item.id)" link><text class="detail" v-if="item.workStatus=='未审核'">编辑</text>
+							<view @click.native="editClick(item.id)" link  class="an-niu" ><text class="solve"
+									v-if="item.workStatus=='未审核'">编辑</text>
+							</view>
+							<view @click.native="processClick(item.id)" link  class="an-niu" v-if="item.workStatus=='未审核'&&juese=='fire_leader'"><text class="solve"
+								>审核</text>
 							</view>
 						</view>
 					</uni-card>
@@ -63,6 +67,9 @@
 				@select="sexSelect"></u-action-sheet>
 			<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
 				showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
+			<u-modal title="审核是否通过" :show="showShenHe" showCancelButton closeOnClickOverlay confirmText="审核通过"
+				cancelText="审核不通过" @confirm="confirmShenHe" :closeOnClickOverlay="true" @cancel="cancelShenHe" @close="close">
+			</u-modal>
 			<!-- 加载中 -->
 			<isLodingModel></isLodingModel>
 		</view>
@@ -83,6 +90,7 @@
 	export default {
 		data() {
 			return {
+				showShenHe:false,
 				screenHeight: this.$screenHeight,
 				wheight: '',
 				keyword: '',
@@ -110,7 +118,8 @@
 				formData: {},
 				show: false,
 				showtimeStart: false,
-				showtimeEnd: false
+				showtimeEnd: false,
+				juese: {}
 			};
 		},
 		// 在 vue页面,向起始页通过事件传递数据
@@ -129,6 +138,7 @@
 		onShow() {
 			this.actions = []
 			that = this;
+			this.juese=uni.getStorageSync('getUserInfo_key').userRoles.appRoles[0].role_lable
 			getOrgId({
 				pageNo: this.pageNo,
 				pageSize: this.pageSize,
@@ -153,6 +163,25 @@
 		onReady() {},
 		mixins: [uni.$u.mixin],
 		methods: {
+			processClick() { //审核
+               this.showShenHe=true
+			},
+			//审核通过
+			confirmShenHe() {
+				this.showShenHe = false
+				// verifytask({
+				// }).then(response => {
+				// 	if (response.data) {
+						
+				// 		this.tableData = []
+				// 		this.getData()
+				// 	}
+				// })
+			},
+			//审核不通过	
+			cancelShenHe() {
+				this.showShenHe = false
+			},
 			search(val) {
 				console.log(val, 'valvals', this.formData);
 				this.tableData = []
@@ -215,7 +244,7 @@
 					console.log(response, 'sdsdsd');
 					this.isLoaded = true
 					this.tableData = response.data ? [...this.tableData, ...response.data.list] : []
-					this.total = response.data?response.data.total:0
+					this.total = response.data ? response.data.total : 0
 					this.loading = false
 				});
 			},
@@ -231,7 +260,7 @@
 			editClick(val) {
 				this.isLoaded = false
 				uni.navigateTo({
-					url: `/pagesB/fire/fireWork/addWork/index?title=查看动火审批&&editData=${val}&&orgaction=${JSON.stringify(this.actions)}`
+					url: `/pagesB/fire/fireWork/addWork/index?title=编辑动火审批&&editData=${val}&&orgaction=${JSON.stringify(this.actions)}`
 				})
 			},
 			addClick() {
@@ -322,7 +351,7 @@
 		.detailDel {
 			width: 60px;
 			height: 60rpx;
-			padding: 0 20rpx;
+			// padding: 0 20rpx;
 			border-radius: 30px;
 			background-color: #ff2e31;
 			color: white;