Prechádzať zdrojové kódy

fix: 商用登录工程功能优化

zh 2 rokov pred
rodič
commit
1f074d815b

+ 32 - 14
src/views/commercialEngineering/components/base.vue

@@ -54,7 +54,7 @@
         <el-col :xs="24" :sm="12" :lg="12" class="item">
           <div class="label">{{ ['cross'].includes(pageType) ? '业务所在区域' : '项目所在区域' }}*:</div>
           <div class="value">
-            <el-select v-model="formData.projectArea" placeholder="请选择" clearable filterable>
+            <el-select v-model="formData.projectArea" placeholder="请选择" clearable filterable @change="handleProjectArea">
               <el-option
                 v-for="item in commonData.dict['TRADE_PROJECT_AREA']"
                 :key="item.value"
@@ -255,9 +255,9 @@
           <div class="label">详细地址*:</div>
           <div class="value">
             <!-- <el-input v-model="formData.positionAddress" placeholder="定位地址" size="mini" clearable disabled /> -->
-            <geographicalPosi style="margin: 0 20px 0 0;" v-if="module !== 'detail'" :form-data="formData" @selectPosi="handleSelectPosi" />
+            <geographicalPosi style="margin: 0 20px 0 0;" v-if="module !== 'detail' && !['cross'].includes(pageType)" :form-data="formData" @selectPosi="handleSelectPosi" />
             <el-input v-model="formData.address" placeholder="请填写详细地址" size="mini" clearable />
-            <i v-if="formData.positionAddress" class="el-icon-s-promotion" style="color: #409EFF;font-size: 16px;" />
+            <i v-if="formData.positionAddress && !['cross'].includes(pageType)" class="el-icon-s-promotion" style="color: #409EFF;font-size: 16px;" />
           </div>
         </el-col>
         <template>
@@ -497,7 +497,11 @@ export default {
       tradeList: [],
       orderTypeEume: {
         SAVE: '保存', WAIT: '待审核', OK: '登录成功', FAIL: '登录不成功', RETURN: '返回'
-      }
+      },
+      region: {
+          G: ['广州市', '清远市', '韶关市'],
+          F: ['佛山市','肇庆市','云浮市']
+         }
     }
   },
   computed: {
@@ -581,14 +585,22 @@ export default {
             this.provinceList = res.data.filter(k => {
               return k.name === '广东省'
             })
-            this.getPosition(res.data, 'provinceId', 'province')
+            this.getPosition(this.provinceList, 'provinceId', 'province')
           } else {
             this.provinceList = res.data
           }
-          console.log(res.data)
         } else if (level === 1) {
-          this.cityList = res.data
-          //   this.getPosition(res.data, 'cityId', 'city')
+          if (this.formData.province === '广东省') {
+            this.cityList = res.data.filter(k=>{
+              if(this.formData.projectArea){
+                return this.region[this.formData.projectArea].includes(k.name)
+              }
+              return  k
+            })
+          }else {
+            this.cityList = res.data
+          }
+
         } else if (level === 2) {
           this.areaList = res.data
         } else if (level === 3) {
@@ -596,16 +608,22 @@ export default {
         }
       })
     },
+    handleProjectArea(e){
+      if (this.formData.provinceId && this.formData.province === '广东省') {
+        this.getAutonaviRegion(1, this.formData.provinceId)
+      }
+    },
     getPosition(data, id, name) {
       if (this.module === 'add') {
         const item = data.find(k => k.name === this.$IpAdd[name])
-        this.formData[id] = item.id
+        this.formData[id] = item.lbsId
         this.formData[name] = item.name
-        if (name === 'province') {
-          this.getAutonaviRegion(1, item.id)
-        } else {
-          this.getAutonaviRegion(2, item.id)
-        }
+        // if (name === 'province') {
+        this.getAutonaviRegion(1, item.lbsId)
+        // }
+        //  else {
+        //   this.getAutonaviRegion(2, item.lbsId)
+        // }
       }
     },
     getPositionProject() {

+ 12 - 4
src/views/commercialEngineering/crossDistrict/crossDistrictkList.vue

@@ -129,7 +129,10 @@ export default {
                     }
                   }
                 ]
-              ],
+              ]
+            ]
+            : []
+        })(),
               [
                 [
                   {
@@ -139,6 +142,14 @@ export default {
                         this.$message.error('请选择需要删除的数据')
                         return
                       }
+                      if(!this.isTradeExaminer){
+                        for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (this.recordSelected[index].orderStatus !== '保存') {
+                          this.$message.error('请选择保存的数据')
+                          return
+                        }
+                      }
+                      }
                       // for (let index = 0; index < this.recordSelected.length; index++) {
                       //   if (this.recordSelected[index].orderStatus !== '已审核') {
                       //     this.$message.error('请选择审核通过的数据')
@@ -152,9 +163,6 @@ export default {
                   }
                 ]
               ]
-            ]
-            : []
-        })()
       ]
     }
   },

+ 12 - 4
src/views/commercialEngineering/frock/frockList.vue

@@ -127,7 +127,10 @@ export default {
                     }
                   }
                 ]
-              ],
+              ]
+            ]
+            : []
+        })(),
               [
                 [
                   {
@@ -137,6 +140,14 @@ export default {
                         this.$message.error('请选择需要删除的数据')
                         return
                       }
+                      if(!this.isTradeExaminer){
+                        for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (this.recordSelected[index].orderStatus !== '保存') {
+                          this.$message.error('请选择保存的数据')
+                          return
+                        }
+                      }
+                      }
                       // for (let index = 0; index < this.recordSelected.length; index++) {
                       //   if (this.recordSelected[index].orderStatus !== '已审核') {
                       //     this.$message.error('请选择审核通过的数据')
@@ -150,9 +161,6 @@ export default {
                   }
                 ]
               ]
-            ]
-            : []
-        })()
       ]
     }
   },

+ 39 - 1
src/views/commercialEngineering/homeDecoration/homeDecorationList.vue

@@ -145,6 +145,14 @@ export default {
                         this.$message.error('请选择需要删除的数据')
                         return
                       }
+                      if(!this.isTradeExaminer){
+                        for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (this.recordSelected[index].orderStatus !== '保存') {
+                          this.$message.error('请选择保存的数据')
+                          return
+                        }
+                      }
+                      }
                       // for (let index = 0; index < this.recordSelected.length; index++) {
                       //   if (this.recordSelected[index].orderStatus !== '已审核') {
                       //     this.$message.error('请选择审核通过的数据')
@@ -160,7 +168,37 @@ export default {
               ]
             ]
             : []
-        })()
+        })(),
+              [
+                [
+                  {
+                    name: '删除',
+                    click: () => {
+                      if (this.recordSelected.length === 0) {
+                        this.$message.error('请选择需要删除的数据')
+                        return
+                      }
+                      if(!this.isTradeExaminer){
+                        for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (this.recordSelected[index].orderStatus !== '保存') {
+                          this.$message.error('请选择保存的数据')
+                          return
+                        }
+                      }
+                      }
+                      // for (let index = 0; index < this.recordSelected.length; index++) {
+                      //   if (this.recordSelected[index].orderStatus !== '已审核') {
+                      //     this.$message.error('请选择审核通过的数据')
+                      //     return
+                      //   }
+                      // }
+                      this.operateType = 'delete'
+                      this.operateTitle = '删除'
+                      this.operateVisible = true
+                    }
+                  }
+                ]
+              ]
       ]
     }
   },