فهرست منبع

选择考评方案

lilei 4 سال پیش
والد
کامیت
c7389c2989

+ 10 - 0
components/uni-check-list/uni-check-list.vue

@@ -47,6 +47,12 @@
 			showArrow:{
 				type: Boolean,
 				default: true
+			},
+			defValue:{
+				type: Array,
+				default:function(){
+					return []
+				}
 			}
 		},
 		data() {
@@ -58,6 +64,10 @@
 		watch: {
 			listData(newValue, oldValue) {
 				this.list = newValue
+			},
+			defValue(newValue){
+				this.value = newValue
+				this.hasCheck()
 			}
 		},
 		mounted() {

+ 9 - 0
hybrid/html/video.html

@@ -229,6 +229,15 @@
 			clearInterval(this.hsID)
 		},
 		methods: {
+	      // 重置页面
+		  resetPage(){
+			  this.activeIndex = 0
+			  this.activeZbIndex = 0
+			  this.activeZbPhoto = 0
+			  this.curZbItem = {remarks:'',taskTargetPhotoVOList:[]}
+			  this.isDelItem = false
+			  this.showPz = false
+		  },
 		  // 设置类型
 		  setTyps(type){
 			  console.log(type)

+ 6 - 3
pages/evaluatePlan/evaluatePlan.vue

@@ -7,7 +7,7 @@
 	 listData 是数据
 	 showArrow 是否显示右边箭头
 	 -->
-	<uni-check-list :listData="list" types="radio" @ok="chooseOk" @rightClick="viewDetail">
+	<uni-check-list :listData="list" :defValue="value" types="radio" @ok="chooseOk" @rightClick="viewDetail">
 		<view slot="right">
 			详情
 		</view>
@@ -20,10 +20,11 @@
 		data() {
 			return {
 				list: [],
-				value: '',
+				value: [],
 			}
 		},
-		onLoad() {
+		onLoad(opts) {
+			this.value[0]=opts.id
 			// 查询方案
 			findScheme({status:1}).then(res=>{
 				console.log(res.data)
@@ -43,6 +44,8 @@
 					})
 				}else{
 					//关闭当前页面,这里处理数据逻辑
+					uni.$emit("resetTaskKpItem",item[0])
+					uni.navigateBack()
 				}
 			},
 			// 查看详情

+ 44 - 15
pages/evaluatePlan/planDetail.vue

@@ -3,33 +3,62 @@
 		<!-- 考评项 -->
 		<view class="kp-tabsBox">
 			<view class="kp-tabs">
-				<view class="active">
-					<view>正常营业</view>
-					<view>(4项)</view>
-				</view>
-				<view>
-					<view>正常营业</view>
-					<view>(4项)</view>
-				</view>
-				<view>
-					<view>正常营业</view>
-					<view>(4项)</view>
+				<view 
+				v-for="(item,index) in list" 
+				:key="item.id" 
+				@click="onTab(index)"
+				:class="activeIndx==index?'active':''">
+					<view>{{item.name}}</view>
+					<view>({{item.assessTargetNum}}项)</view>
 				</view>
 			</view>
 			<view class="kp-items">
-				<view>正常营业</view>
-				<view>正常关门</view>
-				<view>卫生整洁</view>
+				<view v-for="(item,index) in list[activeIndx].assessTargetList" :key="item.id">
+					{{item.name}}
+				</view>
 			</view>
 		</view>
 		<!-- 选择按钮 -->
-		<view class="kp-ok">
+		<view class="kp-ok" @click="kpOk">
 			确认选择该考评方案
 		</view>
 	</view>
 </template>
 
 <script>
+	import {queryItemBySchemeId} from '@/api/assess'
+	export default {
+		data() {
+			return {
+				list: [],
+				activeIndx:0,
+				schemeId:''
+			}
+		},
+		onLoad(opts) {
+			this.schemeId = opts.id
+			// 查询方案的项
+			queryItemBySchemeId({schemeId:opts.id}).then(res=>{
+				console.log(res.data)
+				if(res.status == 200){
+					this.list = res.data
+				}
+			})
+		},
+		methods: {
+			// 选中方案
+			kpOk(item) {
+				uni.$emit("resetTaskKpItem",this.schemeId)
+				uni.navigateBack({
+					delta:2
+				})
+			},
+			// onTab
+			onTab(index){
+				this.activeIndx = index
+			}
+		}
+	}
 </script>
 
 <style lang="scss">

+ 31 - 3
pages/shopTour/shopTour.vue

@@ -21,6 +21,7 @@
 				restart: '', // 是否重新巡店
 				taskId: '', // 任务id
 				storeId: '', // 门店id
+				assessSchemeId: '', // 方案id
 			};
 		},
 		methods: {
@@ -153,6 +154,7 @@
 			// 查询任务明细
 			getTaskDetail(){
 				getTaskDetail({id:this.taskId}).then(res => {
+					this.assessSchemeId = res.data.assessSchemeId // 方案id
 					this.wv.evalJS("vm.getTaskDetail('"+JSON.stringify(res.data)+"')")
 				})
 			},
@@ -161,6 +163,23 @@
 				getTaskItem({id:this.taskId}).then(res => {
 					this.wv.evalJS("vm.getTaskItem('"+JSON.stringify(res.data)+"')")
 				})
+			},
+			// 更新方案项目
+			updateTaskItem(schemeId){
+				console.log(schemeId)
+				updateTaskItem({schemeId,taskId:this.taskId}).then(res=>{
+					if(res.status==200){
+						// 重置页面
+						this.wv.evalJS("vm.resetPage()")
+						this.getTaskDetail()
+						this.getTaskItem()
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.message
+						})
+					}
+				})
 			}
 		},
 		onLoad(options) {
@@ -190,6 +209,11 @@
 				}
 			 }, 500);
 			// #endif
+			
+			// 监听选择方案后事件,schemeId 方案id
+			uni.$on("resetTaskKpItem",(schemeId)=>{
+				_this.updateTaskItem(schemeId)
+			})
 		},
 		// 监听返回键
 		onBackPress() {
@@ -226,10 +250,14 @@
 		// 添加考评模板
 		onNavigationBarButtonTap(e) {
 			// 且当前没编辑图片或抓拍图片
-			if(e.index==0 && !this.isEditImg && !this.showPz){
-				console.log(e.text)
+			if(e.index==0 && !this.isEditImg){
 				uni.navigateTo({
-					url: '/pages/evaluatePlan/evaluatePlan'
+					url: '/pages/evaluatePlan/evaluatePlan?id='+this.assessSchemeId
+				})
+			}else{
+				uni.showToast({
+					icon:"none",
+					title:"正在编辑图片,不能选择考评方案"
 				})
 			}
 		},

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


+ 41 - 34
unpackage/dist/dev/app-plus/app-view.js

@@ -7419,7 +7419,7 @@ __webpack_require__.r(__webpack_exports__);
 Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default =
 
 {
-  name: "UniCheckList", props: ["listData", "types", "titleKeys", "showArrow"],
+  name: "UniCheckList", props: ["listData", "types", "titleKeys", "showArrow", "defValue"],
   data: function data() {
     return {
       wxsProps: {} };
@@ -7657,53 +7657,60 @@ var render = function() {
           _c(
             "v-uni-view",
             { staticClass: _vm._$g(2, "sc"), attrs: { _i: 2 } },
-            [
-              _c(
-                "v-uni-view",
-                { staticClass: _vm._$g(3, "sc"), attrs: { _i: 3 } },
-                [
-                  _c("v-uni-view", { attrs: { _i: 4 } }, [_vm._v("正常营业")]),
-                  _c("v-uni-view", { attrs: { _i: 5 } }, [_vm._v("(4项)")])
-                ],
-                1
-              ),
-              _c(
-                "v-uni-view",
-                { attrs: { _i: 6 } },
-                [
-                  _c("v-uni-view", { attrs: { _i: 7 } }, [_vm._v("正常营业")]),
-                  _c("v-uni-view", { attrs: { _i: 8 } }, [_vm._v("(4项)")])
-                ],
-                1
-              ),
-              _c(
+            _vm._l(_vm._$g(3, "f"), function(item, index, $20, $30) {
+              return _c(
                 "v-uni-view",
-                { attrs: { _i: 9 } },
+                {
+                  key: item,
+                  class: _vm._$g("3-" + $30, "c"),
+                  attrs: { _i: "3-" + $30 },
+                  on: {
+                    click: function($event) {
+                      return _vm.$handleViewEvent($event)
+                    }
+                  }
+                },
                 [
-                  _c("v-uni-view", { attrs: { _i: 10 } }, [_vm._v("正常营业")]),
-                  _c("v-uni-view", { attrs: { _i: 11 } }, [_vm._v("(4项)")])
+                  _c("v-uni-view", { attrs: { _i: "4-" + $30 } }, [
+                    _vm._v(_vm._$g("4-" + $30, "t0-0"))
+                  ]),
+                  _c("v-uni-view", { attrs: { _i: "5-" + $30 } }, [
+                    _vm._v("(" + _vm._$g("5-" + $30, "t0-0") + "项)")
+                  ])
                 ],
                 1
               )
-            ],
+            }),
             1
           ),
           _c(
             "v-uni-view",
-            { staticClass: _vm._$g(12, "sc"), attrs: { _i: 12 } },
-            [
-              _c("v-uni-view", { attrs: { _i: 13 } }, [_vm._v("正常营业")]),
-              _c("v-uni-view", { attrs: { _i: 14 } }, [_vm._v("正常关门")]),
-              _c("v-uni-view", { attrs: { _i: 15 } }, [_vm._v("卫生整洁")])
-            ],
+            { staticClass: _vm._$g(6, "sc"), attrs: { _i: 6 } },
+            _vm._l(_vm._$g(7, "f"), function(item, index, $21, $31) {
+              return _c(
+                "v-uni-view",
+                { key: item, attrs: { _i: "7-" + $31 } },
+                [_vm._v(_vm._$g("7-" + $31, "t0-0"))]
+              )
+            }),
             1
           )
         ],
         1
       ),
-      _c("v-uni-view", { staticClass: _vm._$g(16, "sc"), attrs: { _i: 16 } }, [
-        _vm._v("确认选择该考评方案")
-      ])
+      _c(
+        "v-uni-view",
+        {
+          staticClass: _vm._$g(8, "sc"),
+          attrs: { _i: 8 },
+          on: {
+            click: function($event) {
+              return _vm.$handleViewEvent($event)
+            }
+          }
+        },
+        [_vm._v("确认选择该考评方案")]
+      )
     ],
     1
   )

+ 9 - 0
unpackage/dist/dev/app-plus/hybrid/html/video.html

@@ -229,6 +229,15 @@
 			clearInterval(this.hsID)
 		},
 		methods: {
+	      // 重置页面
+		  resetPage(){
+			  this.activeIndex = 0
+			  this.activeZbIndex = 0
+			  this.activeZbPhoto = 0
+			  this.curZbItem = {remarks:'',taskTargetPhotoVOList:[]}
+			  this.isDelItem = false
+			  this.showPz = false
+		  },
 		  // 设置类型
 		  setTyps(type){
 			  console.log(type)

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است