lilei 4 éve
szülő
commit
3e1e1e9dba

+ 116 - 32
pages/toDoList/addBacklog.vue

@@ -1,21 +1,16 @@
 <template>
 	<view class="back-body">
 		<view class="back-content">
-			<!-- 轮播图 -->
-			<swiper v-if="backlogPhotoList.length" class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
-				<swiper-item v-for="(item,index) in backlogPhotoList" :key="index">
-					<div class="swiper-item uni-bg-red">
-						<u-image mode="scaleToFill" width="750upx" height="400upx" :src="item"></u-image>
-					</div>
-				</swiper-item>
-			</swiper>
-			<view v-else class="paizhao">
-				<view class="icon" @click="takePhone">
-					<u-icon name="xianchangpaishe" custom-prefix="xd-icon" size="64" color="#888888"></u-icon>
-				</view>
+			<view class="wrap">
+				<u-upload :custom-btn="true" :multiple="false" ref="uUpload" :action="action"> 
+					<view v-if="lists.length<5" slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
+						<u-icon name="plus" size="60" color="#c0c4cc"></u-icon>
+						<view>选择图片</view>
+					</view>
+				</u-upload> 
 			</view>
 			<u-form class="form-content" :model="form" ref="uForm" label-width="180">
-				<u-form-item label="门店" prop="storeName">
+				<u-form-item required label="门店" prop="storeName">
 					<u-input @click="chooseStore" input-align="right" v-model="form.storeName" disabled placeholder="请选择门店" />
 					<u-icon @click="chooseStore" name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
 				</u-form-item>
@@ -27,7 +22,7 @@
 					<u-input @click="chooseUser" input-align="right" v-model="form.receiveUser" disabled placeholder="请选择抄送人" />
 					<u-icon @click="chooseUser" name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
 				</u-form-item>
-				<u-form-item label="整改到期日" prop="effectiveEndTime" >
+				<u-form-item required label="整改到期日" prop="effectiveEndTime" >
 					<u-input @click="showPicker=true" input-align="right" v-model="form.effectiveEndTime" disabled placeholder="请选择整改到期日" />
 					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
 				</u-form-item>
@@ -36,7 +31,7 @@
 				<u-input v-model="remarks" type="textarea" placeholder="请输入备注..." />
 			</view>
 		</view>
-		<u-button class="save-btn" type="primary">保存</u-button>
+		<u-button @click="handleSave" :loading="loading" class="save-btn" type="primary">保存</u-button>
 		<!-- 时间选择器 -->
 		<w-picker
 		class="date-picker"
@@ -53,13 +48,17 @@
 </template>
 
 <script>
+	import {saveBackLog} from '@/api/backLog.js'
 	export default {
 		components: {
 		},
 		data() {
 			return {
-				// 顶部轮播图片
-				backlogPhotoList:[],
+				action: 'http://md.test.zyucgj.com/saas/clz/upload', // 图片上传后端地址
+				showUploadList: false, 
+				// 如果将某个ref的组件实例赋值给data中的变量,在小程序中会因为循环引用而报错
+				// 这里直接获取内部的lists变量即可
+				lists: [],
 				showPicker: false, // 是否显示时间弹窗
 				form: {
 					storeName: '', // 门店
@@ -70,16 +69,25 @@
 				},
 				storeSelected : [], // 已选门店
 				userSelected : [], // 已选用户
-				remarks: '' // 备注
+				evaItemSelected : null, // 已选指标
+				remarks: '', // 备注
+				loading: false  // 保存按钮loading
 			}
 		},
+		// 只有onReady生命周期才能调用refs操作组件
+		onReady() {
+			// 得到整个组件对象,内部图片列表变量为"lists"
+			this.lists = this.$refs.uUpload.lists;
+		},
 		onLoad(option) {
 			uni.$on('selKpStores',this.setStore)
 			uni.$on('selKpUsers',this.setUser)
+			uni.$on('selKpItem',this.setEvaItem)
 		}, 
 		onUnload() {
 			uni.$off('selKpStores', this.setStore)
 			uni.$off('selKpUsers', this.setUser)
+			uni.$off('selKpItem', this.setEvaItem)
 		},
 		methods: { 
 			// 获取选择门店
@@ -90,20 +98,8 @@
 				this.form.storeId = this.storeSelected[0].id
 				console.log(this.storeSelected,this.form.storeName,'2222222')
 			},
-			// 拍照 或从相册选相片 
-			takePhone () {
-				let _this = this
-				uni.chooseImage({
-				    count: 6, //默认9
-				    success: function (res) {
-				        console.log(JSON.stringify(res.tempFilePaths));
-						_this.backlogPhotoList = res.tempFilePaths
-				    }
-				})
-			},
 			// 确认日期选择
 			onSelected (v) {
-				console.log(v,'vvvvvvvv')
 				this.form.effectiveEndTime = v.value
 				this.showPicker = false
 			},
@@ -116,16 +112,23 @@
 			// 选择考评指标
 			chooseClsName () {
 				uni.navigateTo({
-					url: '/pages/spotCheckConfigure/evaluateItem'
+					url: '/pages/toDoList/chooseEvaluateItem?item='+encodeURIComponent(JSON.stringify(this.evaItemSelected))
 				})
 			},
+			// 获取选择的指标
+			setEvaItem (data) {
+				console.log(data,'eeeeeeee')
+				this.evaItemSelected = data
+				this.form.clsName = data.name
+				console.log(data.name,this.form.clsName,'222222')
+			},
 			// 选择抄送人
 			chooseUser () {
 				uni.navigateTo({
 					url: `/pages/toDoList/chooseReceiveUser?type=${'checkbox'}&item=${encodeURIComponent(JSON.stringify(this.userSelected))}`
 				})
 			},
-			// 获取选择抄送人
+			// 获取选择抄送人
 			setUser (data) {
 				// console.log(data,'eeeeeeee')
 				this.userSelected = data
@@ -137,6 +140,63 @@
 				}
 				this.form.receiveUser = name
 			},
+			// 保存提交
+			handleSave () {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						console.log('验证通过');
+						if (!this.form.storeName) {
+							this.toashMsg('请选择门店!')
+						} else if (!this.form.effectiveEndTime) {
+							this.toashMsg('请选择整改到期日!')
+						}
+						const copyUserList = []
+						this.userSelected.map(item =>{
+							let p = {
+								userId: item.id,
+								userName: item.name
+							}
+							copyUserList.push(p)
+						})
+						console.log(params,'ppppppppp')
+						let params = {
+							"copyUserList": copyUserList,
+							"backlogPhotoList":[
+								{
+									"photoBasePath":"www.baidu.com",
+									"photoPath":"123.jpg"
+								},
+								{
+									"photoBasePath":"www.baidu.com",
+									"photoPath":"124.jpg"
+								}
+							],
+							"clsNo": this.evaItemSelected ? this.evaItemSelected.assessItemId : '',
+							"clsName": this.evaItemSelected ? this.evaItemSelected.name : '',
+							"problemDesc": this.remarks,
+							"effectiveEndTime": this.form.effectiveEndTime,
+							"storeId" : this.form.storeId
+						}
+						console.log(params,'ppppppppp')
+						this.loading = true
+						uni.showLoading({
+							title: '保存中,请稍后...', 
+							mask: true
+						})
+						saveBackLog(params).then(res=>{
+							this.toashMsg(res.message)
+							if(res.status == 200) {
+								uni.navigateBack()
+							} 
+							this.loading = false
+							uni.hideLoading()
+						})
+						
+					} else {
+						console.log('验证失败');
+					}
+				})
+			}
 			
 		}
 	}
@@ -151,6 +211,30 @@
 		.back-content {
 			flex: 1;
 			overflow-y: scroll;
+		} 
+		.wrap {
+			padding: 24upx;
+			background-color: #fff;
+			width: 100%;
+		}
+		
+		.slot-btn {
+			width: 200upx;
+			height: 200upx;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			background: rgb(244, 245, 246);
+			border-radius: 10upx;
+			color: #999;
+			view {
+				margin-top: 10upx;
+			}
+		}
+
+		.slot-btn__hover {
+			background-color: rgb(235, 236, 238);
 		}
 		.paizhao {
 			background-color: #fff;

+ 8 - 24
pages/toDoList/chooseEvaluateItem.vue

@@ -12,7 +12,7 @@
 				<view v-for="(item,index) in childItems" :key="item.id" @click="chooseItem(item,index)" class="checkbox-item">
 					<view class="item-name">{{item.name}}</view>
 					<view>
-						<checkbox :value="item.id" :checked="item.checked" />
+						<radio :checked="item.checked" :value="item.id" />
 					</view>
 				</view>
 			</view>
@@ -20,10 +20,7 @@
 		<view style="flex-grow: 1;" v-if="items.length==0">
 			<u-empty text="暂无考评指标" mode="list"></u-empty>
 		</view>
-		<!-- 选择按钮 -->
-		<view class="kp-ok" @click="kpOk">
-			确定选择
-		</view>
+		
 	</view>
 </template>
 
@@ -35,14 +32,11 @@
 				items: [],
 				activeIndex:0,
 				childItems:[],
-				checkedList:[]
+				checkedItem: null // 已选指标
 			}
 		},
 		onLoad(opts) {
-			this.checkedList = opts.item&&JSON.parse(opts.item)||[]
-			this.checkedList.map(item=>{
-				item.id = item.assessTargetId
-			})
+			this.checkedItem = opts.item&&JSON.parse(opts.item)||null
 			findAllItem().then(res=>{
 				console.log(res,'0')
 				if(res.status == 200){
@@ -56,26 +50,16 @@
 				this.activeIndex = index
 				this.childItems = this.items[index].assessTargetList
 				this.childItems.map(item=>{
-					let hasItemIndex = this.checkedList.findIndex(o=>o.id==item.id)
-					item.checked = hasItemIndex>=0
+					item.checked = (this.checkedItem && item.id == this.checkedItem.id) ? true :false
 				})
 			},
 			chooseItem(item,index){
 				console.log(item,index)
-				let hasItemIndex = this.checkedList.findIndex(o=>o.id==item.id)
-				// 已存在
-				if(hasItemIndex>=0){
-					this.checkedList.splice(hasItemIndex,1)
-				}else{
-					this.checkedList.push(item)
-				}
-				this.childItems[index].checked  = !(hasItemIndex>=0)
-				this.childItems.splice()
-			},
-			kpOk(){
-				uni.$emit('selKpItem',this.checkedList)
+				this.checkedItem = item
+				uni.$emit('selKpItem',item)
 				uni.navigateBack()
 			}
+			
 		}
 	}
 </script>

+ 2 - 2
pages/toDoList/toDoList.vue

@@ -52,13 +52,13 @@
 								 </view>
 								 <view class="check-row">
 									 <view>
-										{{item.sourceType}}
+										{{item.sourceTypeDictValue}}
 									 </view>
 									 <view class="text-right">
 										 <text v-if="item.copyFlag && item.copyFlag == 1" class="mark">
 										 	抄送
 										 </text>
-										 <view :class="['status',clsStatus(item.status)]">{{item.status}}</view>
+										 <view :class="['status',clsStatus(item.statusDictValue)]">{{item.statusDictValue}}</view>
 									 </view>
 								 </view>
 							 </view>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 5 - 3
unpackage/dist/dev/app-plus/app-service.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 66 - 75
unpackage/dist/dev/app-plus/app-view.js


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott