Bläddra i källkod

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

1004749546@qq.com 4 år sedan
förälder
incheckning
523ca8b434
2 ändrade filer med 24 tillägg och 22 borttagningar
  1. 1 1
      src/api/evaluationPlan.js
  2. 23 21
      src/views/evaluation/evaluationPlan/SetEvaDefaultModal.vue

+ 1 - 1
src/api/evaluationPlan.js

@@ -16,7 +16,7 @@ export const planQuery = (params) => {
   const url = `/assess/scheme/queryList`
   return axios({
     url: url,
-    data: {},
+    data: params,
     method: 'post'
   })
 }

+ 23 - 21
src/views/evaluation/evaluationPlan/SetEvaDefaultModal.vue

@@ -20,9 +20,8 @@
                   { initialValue: formData.videoType,
                     rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
                 ]"
-                placeholder="请选择考评方案(单选)"
-              >
-                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                placeholder="请选择考评方案(单选)">
+                <a-select-option v-for="item in videoPlanList" :key="item.id" :value="item.id">
                   {{ item.name }}
                 </a-select-option>
               </a-select>
@@ -42,7 +41,7 @@
                   { initialValue: formData.spotType,
                     rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
                 ]">
-                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                <a-select-option v-for="item in spotPlanList" :key="item.id" :value="item.id">
                   {{ item.name }}
                 </a-select-option>
               </a-select>
@@ -109,7 +108,8 @@ export default {
       if (newValue) {
         this.form.resetFields()
         // 获取方案列表数据
-        this.getPlanList()
+        this.getPlanList('VIDEO_INSPECTION')
+        this.getPlanList('SPOT_INSPECTION')
         // 默认方案回显
         this.pageInit()
       } else {
@@ -123,20 +123,17 @@ export default {
       form: this.$form.createForm(this, {
         name: 'AddEvaModal'
       }),
-	  // 默认值设为undefined, 解决placeholder不生效问题
+      // 默认值设为undefined, 解决placeholder不生效问题
       formData: {
         videoType: undefined, // 视频巡店默认方案
         spotType: undefined // 现场巡店默认方案
       },
-      planList: [], // 考评方案列表
-	  loading: false // 确定按钮loading
+      videoPlanList: [], // 视频巡店考评方案列表
+      spotPlanList: [], // 现场巡店考评方案列表
+      loading: false // 确定按钮loading
     }
   },
   computed: {},
-  mounted () {
-    // 获取方案列表数据
-    this.getPlanList()
-  },
   methods: {
     pageInit () {
       if (this.defaultPlanList.length) {
@@ -150,13 +147,18 @@ export default {
       this.formData.spotType = undefined
       this.$emit('close')
     },
-    // 获取方案列表数据
-    getPlanList () {
-      planQuery().then(res => {
-        if (res.status == 200) {
-          this.planList = res.data
-        } else {
-          this.planList = []
+    // 获取方案列表数据 "适用范围(视频巡店 VIDEO_INSPECTION /现场巡店 SPOT_INSPECTION/点检 POINT_INSPECTION)
+    getPlanList (type) {
+      planQuery({
+        status: 1,
+        scopeType: type
+      }).then(res => {
+        // console.log(res, res.data, 'rrrrrrrrrr')
+        if (type == 'VIDEO_INSPECTION') {
+          this.videoPlanList = res.data || []
+        }
+        if (type == 'SPOT_INSPECTION') {
+          this.spotPlanList = res.data || []
         }
       })
     },
@@ -187,8 +189,8 @@ export default {
             console.log(res, 'res--save')
             if (res.status + '' === '200') {
               this.$message.success(res.message ? res.message : '保存成功')
-			  // 保存后更新默认方案
-			  this.$emit('refresh')
+              // 保存后更新默认方案
+              this.$emit('refresh')
               setTimeout(function () {
                 _this.cancel()
               }, 300)