lilei пре 4 година
родитељ
комит
68de04bdae

+ 5 - 13
components/select/v-select.vue

@@ -1,7 +1,7 @@
 <template>
 	<view style="width: 100%;">
 		<u-input :value="selected" :input-align="inputAlign" :placeholder="placeholder" @click="showPick=true" type="select" />
-		<u-picker mode="selector" v-model="showPick" @confirm="toChange" :default-selector="[0]" :range="datalist" range-key="dispName"></u-picker>
+		<u-picker mode="selector" v-model="showPick" @confirm="toChange" :default-selector="[index]" :range="datalist" range-key="dispName"></u-picker>
 	</view>
 </template>
 
@@ -38,12 +38,7 @@ export default {
       default: ''
     },
   },
-  watch: {
-  	value(newValue, oldValue) {
-  		this.setVal(newValue)
-  	}
-  },
-  created () {
+  mounted () {
     if (this.code) {
       if (this.placeholder) {
         this.placeholderText = this.placeholder
@@ -51,20 +46,17 @@ export default {
       getLookUpDatas({
         type: this.code
       }).then(result => {
-		  console.log(result, 'result')
         if (result && result.status + '' === '200') {
           this.datalist = result.data
-		  // 设置默认值
-		  this.setVal(this.value)
+		  if(this.value){
+			  this.setVal(this.value)
+		  }
         }
       })
     }  
-    // 获取所有数据字典
-    this.lookUp = this.$store.state.vuex_allLookUp
   },
   methods: {
     getDataList (){
-	  console.log(this.datalist)
       return this.datalist
     },
     getOptionName (val) {

+ 1 - 6
components/uni-multiple-picker/uni-multiple-picker.vue

@@ -41,8 +41,8 @@
 				this.isShow = newValue
 			},
 			dataList (newValue, oldValue) {
+				console.log(newValue)
 				this.listData = newValue
-				this.init()
 			},
 		},
 		computed: {
@@ -73,11 +73,6 @@
 			}
 		},
 		methods: {
-			init(){
-				this.listData.map((item, ind) => {
-					this.$set(this.listData[ind], 'checked', false)
-				})
-			},
 			//  选择
 			chooseItem(ind){
 				this.$set(this.listData[ind], 'checked', !this.listData[ind].checked)

+ 11 - 0
pages/index/index.vue

@@ -40,6 +40,7 @@
 import iconItemsList from '@/components/icon-items-list/icon-items-list.vue'
 import { bannerList } from "@/api/banner.js"
 import { getBackLogList } from '@/api/backLog'
+import { getLookUpDatas } from "@/api/data.js"
 import moment from 'moment'
 export default {
 	components: {
@@ -95,8 +96,18 @@ export default {
 	onLoad() {
 		this.getBanner('HOME_TOP')
 		this.gettoDoData()
+		// 获取周
+		this.getLookUpList('WEEK', 'vuex_weeks');
 	},
 	methods: {
+		// 或某一项字典列表,参数code
+		getLookUpList(code, vuexKey) {
+			getLookUpDatas({ type: code }).then(res => {
+				if (res.status == 200) {
+					this.$store.state[vuexKey] = res.data || [];
+				}
+			});
+		},
 		openVideo() {
 			 uni.navigateTo({
 			 	url:"/pages/shopTour/shopTour"

+ 26 - 12
pages/spotCheckConfigure/addSpotCheck.vue

@@ -13,8 +13,9 @@
 					<u-picker v-model="showBuildDateDay" @confirm="confirmBuildDateDay" mode="time" :default-time="form.buildDateDay"></u-picker>
 				</u-form-item>
 				<u-form-item label="执行日期" v-if="form.cycleType == 'WEEK'" label-width="160rpx" prop="buildDateWeekList">
-					<v-select ref="buildDateWeekList" v-show="false" code="WEEK"></v-select>
-					<view v-if="form.buildDateWeekList.length" style="width: 100%;text-align: right;" @click="openWeekSel">{{buildDateWeekNamesList.join(",")}}</view>
+					<view v-if="form.buildDateWeekList.length" style="width: 100%;text-align: right;" @click="openWeekSel">
+					{{weekNamesList}}
+					</view>
 					<view v-else style="color:rgb(192,196,204); width: 100%;text-align: right;" @click="openWeekSel">请选择</view>
 					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="28" color="#888888" @click="openWeekSel"></u-icon>
 				</u-form-item>
@@ -76,7 +77,6 @@ export default {
 			showBuildTime: false, // 默认是否显示执行时间的时间组件
 			showWeekSel: false, // 显示选择周几
 			weekList: [], // 周列表
-			buildDateWeekNamesList: [], // 已选周名称列表
 			// 执行时间配置
 			ZxTimeParams: {
 				year: false,
@@ -109,6 +109,11 @@ export default {
 			}
 		};
 	},
+	computed: {
+		weekNamesList() {
+			return this.getWeekNames(this.form.buildDateWeekList)
+		}
+	},
 	onLoad(opts) {
 		if(opts.id){
 			// 编辑
@@ -143,7 +148,6 @@ export default {
 		getCheckTaskConfig(id){
 			getCheckTaskConfig({id}).then(res => {
 				if(res.status==200){
-					console.log(res.data)
 					let data = res.data
 					data.assessTargetList.map(item=>{
 						delete item.id
@@ -156,7 +160,7 @@ export default {
 						name: data.name, // 任务名称
 						cycleType: data.cycleType, // 周期类型
 						buildDateDay: data.buildDateDay, // 执行日期
-						buildDateWeekList: data.buildDateWeekList, // 周几
+						buildDateWeekList: data.buildDateWeekList||[], // 周几
 						buildTime: data.buildTime, // 执行时间
 						startDate: data.startDate, // 开始日期
 						endDate: data.endDate, // 结束日期
@@ -164,11 +168,24 @@ export default {
 						storeList: data.storeList, // 考评门店
 						effectiveDay: Number(data.effectiveDay) // 任务有效天数
 					})
+					
 					// 回显任务周期类型
 					this.$refs.cycleType.setVal(data.cycleType)
 				}
 			})
 		},
+		// 获取周的中文名称
+		getWeekNames(sel){
+			let arr = this.$store.state.vuex_weeks
+			let ret = []
+			sel.map(item=>{
+				let has = arr.find(a=>a.code == item)
+				if(has){
+					ret.push(has.dispName)
+				}
+			})
+			return ret.join(',')
+		},
 		// 天类型的执行日期
 		confirmBuildDateDay(val) {
 			this.form.buildDateDay = val.year + '-' + val.month + '-' + val.day;
@@ -210,29 +227,26 @@ export default {
 		// 打开选择周
 		openWeekSel(){
 			if(this.weekList.length==0){
-				let arr = this.$refs.buildDateWeekList.getDataList()
+				let arr = this.$store.state.vuex_weeks
+				let sel = this.form.buildDateWeekList
 				arr.map(item=>{
+					let checked = sel.indexOf(item.code)
 					this.weekList.push({
 						id: item.code,
 						name: item.dispName,
-						checked: true
+						checked: checked >= 0
 					})
 				})
 			}
-			
 			this.showWeekSel = true
 		},
 		//  已选择角色确定
 		weekConfirm(arr){
-			console.log(arr)
 			let list = []
-			let weekNames = []
 			arr.map(item=>{
 				list.push(item.id)
-				weekNames.push(item.name)
 			})
 			this.form.buildDateWeekList = list
-			this.buildDateWeekNamesList = weekNames
 			this.showWeekSel = false
 		},
 		// 执行时间

+ 1 - 0
store/index.js

@@ -90,6 +90,7 @@ const store = new Vuex.Store({
 		vuex_versionInfo: lifeData.vuex_versionInfo ? lifeData.vuex_versionInfo : {}, // 版本信息
 		// 如果无需保存到本地永久存储,无需lifeData.xx方式
 		vuex_allLookUp: [],  //  数据字典
+		vuex_weeks:[], // 周
 		vuex_nowStaffData: {},  //  我的 - 员工信息 - 当前员工信息
 		vuex_nowRoleInfo:{},	//我的 - 员工角色 - 当前角色信息
 		vuex_socket: null, // 消息通知ws对象

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/app-plus/app-config-service.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


Разлика између датотеке није приказан због своје велике величине
+ 122 - 59
unpackage/dist/dev/app-plus/app-view.js


Неке датотеке нису приказане због велике количине промена