Browse Source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
修改

1004749546@qq.com 4 năm trước cách đây
mục cha
commit
4498231f57

+ 8 - 0
api/user.js

@@ -137,4 +137,12 @@ export const findUserInfo = param => {
     url: `dduser/findUserInfo`,
     method: 'get'
   })
+}
+// 获取用户列表
+export const findUserList = param => {
+  return axios.request({
+    url: `dduser/query`,
+	data: param,
+	method: 'post'
+  })
 }

+ 7 - 1
components/uni-check-list/uni-check-list.vue

@@ -16,7 +16,7 @@
 				</view>
 			</view>
 			<view style="padding-top: 10vh;" v-if="list.length==0">
-				<u-empty text="暂无考评方案" mode="list"></u-empty>
+				<u-empty :text="noDataText" mode="list"></u-empty>
 			</view>
 		</view>
 		<!-- 选择按钮 -->
@@ -44,6 +44,11 @@ export default {
 			type: String,
 			default: 'name'
 		},
+		// 暂无数据提示内容
+		noDataText: {
+			type: String,
+			default: '暂无考评方案'
+		},
 		// 是否显示右边箭头
 		showArrow: {
 			type: Boolean,
@@ -96,6 +101,7 @@ export default {
 				})
 				item.checked = a>=0
 			})
+			console.log(this.list,'111111111')
 		},
 		// 选中
 		chooseItem(item) {

+ 5 - 1
pages/spotCheckConfigure/evaluateStore.vue

@@ -16,6 +16,7 @@
 	:showArrow="false" 
 	:defValue="value" 
 	:types="type" 
+	:noDataText="noDataText"
 	backValue="objArr"
 	@ok="chooseOk">
 	</uni-check-list>
@@ -28,13 +29,14 @@
 			return {
 				list: [],
 				value: [],
+				noDataText: '暂无考评门店',
 				type: ''  // 单选或多选
 			}
 		},
 		onLoad(opts) {
 			this.value = opts.item&&JSON.parse(opts.item)||[]
 			this.value.map(item=>{
-				item.id = item.storeId
+				item.id = item.storeId || item.id
 			})
 			this.type = opts.type && opts.type || 'checkbox'
 			console.log(this.value)
@@ -42,6 +44,8 @@
 			findStoreList({}).then(res=>{
 				if(res.status == 200){
 					this.list = res.data || []
+				} else {
+					this.noDataText = res.message
 				}
 			})
 		},

+ 29 - 6
pages/toDoList/addBacklog.vue

@@ -17,15 +17,15 @@
 			<u-form class="form-content" :model="form" ref="uForm" label-width="180">
 				<u-form-item label="门店" prop="storeName">
 					<u-input @click="chooseStore" input-align="right" v-model="form.storeName" disabled placeholder="请选择门店" />
-					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
+					<u-icon @click="chooseStore" name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
 				</u-form-item>
 				<u-form-item label="考评指标" prop="clsName">
 					<u-input @click="chooseClsName" input-align="right" v-model="form.clsName" disabled placeholder="请选择考评指标" />
-					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
+					<u-icon @click="chooseClsName" name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
 				</u-form-item>
 				<u-form-item label="抄送人" prop="receiveUser"> 
-					<u-input input-align="right" v-model="form.clsName" disabled placeholder="请选择抄送人" />
-					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="30" color="#888888"></u-icon>
+					<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-input @click="showPicker=true" input-align="right" v-model="form.effectiveEndTime" disabled placeholder="请选择整改到期日" />
@@ -65,17 +65,22 @@
 					storeName: '', // 门店
 					storeId: '', // 门店id
 					clsName: '',// 考评指标
-					putUser: '', // 处理人
 					receiveUser: '', // 抄送人
 					effectiveEndTime: '' // 整改到期日
 				},
 				storeSelected : [], // 已选门店
+				userSelected : [], // 已选用户
 				remarks: '' // 备注
 			}
 		},
 		onLoad(option) {
 			uni.$on('selKpStores',this.setStore)
+			uni.$on('selKpUsers',this.setUser)
 		}, 
+		onUnload() {
+			uni.$off('selKpStores', this.setStore)
+			uni.$off('selKpUsers', this.setUser)
+		},
 		methods: { 
 			// 获取选择门店
 			setStore (data) {
@@ -113,7 +118,25 @@
 				uni.navigateTo({
 					url: '/pages/spotCheckConfigure/evaluateItem'
 				})
-			}
+			},
+			// 选择抄送人
+			chooseUser () {
+				uni.navigateTo({
+					url: `/pages/toDoList/chooseReceiveUser?type=${'checkbox'}&item=${encodeURIComponent(JSON.stringify(this.userSelected))}`
+				})
+			},
+			// 获取选择抄送人
+			setUser (data) {
+				// console.log(data,'eeeeeeee')
+				this.userSelected = data
+				let name = ''
+				if (data.length) {
+					data.map((item,index) =>{
+						name = (name?(name + ',') : '') + item.name 
+					})
+				}
+				this.form.receiveUser = name
+			},
 			
 		}
 	}

+ 8 - 4
pages/toDoList/chooseReceiveUser.vue

@@ -16,18 +16,20 @@
 	:showArrow="false" 
 	:defValue="value" 
 	:types="type" 
+	:noDataText="noDataText"
 	backValue="objArr"
 	@ok="chooseOk">
 	</uni-check-list>
 </template>
 
 <script>
-	import {findStoreList} from '@/api/store'
+	import {findUserList} from '@/api/user.js'
 	export default {
 		data() {
 			return {
 				list: [],
 				value: [],
+				noDataText: '暂无抄送人数据',
 				type: ''  // 单选或多选
 			}
 		},
@@ -35,10 +37,12 @@
 			this.value = opts.item&&JSON.parse(opts.item)||[]
 			this.type = opts.type && opts.type || 'checkbox'
 			console.log(this.value)
-			// 查询门店
-			findStoreList({}).then(res=>{
+			// 查询用户列表
+			findUserList({}).then(res=>{
 				if(res.status == 200){
 					this.list = res.data || []
+				} else {
+					this.noDataText = res.message
 				}
 			})
 		},
@@ -47,7 +51,7 @@
 			chooseOk(item) {
 				console.log(item)
 				//关闭当前页面,这里处理数据逻辑
-				uni.$emit("selKpStores",item)
+				uni.$emit("selKpUsers",item)
 				uni.navigateBack()
 			},
 		}