Bladeren bron

feature(优化):
1、经销商-所属区域添加我的区域
2、项目详情返回按钮 保留查询参数

ZZH-wl 2 jaren geleden
bovenliggende
commit
d526317d47

+ 6 - 0
src/api/base/regionAuth.js

@@ -7,6 +7,7 @@
  * @FilePath: \opms_frontend\src\api\base\regionAuth.js
  */
 import micro_request from '@/utils/micro_request'
+
 const basePath = process.env.VUE_APP_AdminPath
 export default {
   // 用户列表
@@ -21,4 +22,9 @@ export default {
   getDetail(query) {
     return micro_request.postRequest(basePath, 'BaseRegionAuth', 'GetList', query)
   },
+
+  //获取用户销售省份
+  getUserSalesProvince(query) {
+    return micro_request.postRequest(basePath, 'BaseRegionAuth', 'GetUserSalesProvince', query)
+  },
 }

+ 1 - 1
src/views/base/distributor/detail.vue

@@ -42,7 +42,7 @@
               {{ detail.createdName }}
             </el-descriptions-item>
             <el-descriptions-item content-class-name="my-content" label="创建时间" label-class-name="my-label">
-              {{ detail.createdTime }}
+              {{ parseTime(detail.createdTime, '{y}-{m}-{d}') }}
             </el-descriptions-item>
           </el-descriptions>
         </header>

+ 14 - 2
src/views/base/distributor/index.vue

@@ -3,6 +3,8 @@
     <div class="side-layout">
       <div class="tree-side">
         <span style="font-size: 25px">所属区域</span>
+        <!--        我负责的区域-->
+        <!--        所有区域-->
         <el-tree
           ref="tree"
           :data="regionOptions"
@@ -11,6 +13,7 @@
           :expand-on-click-node="true"
           :filter-node-method="filterNode"
           highlight-current
+          node-key="id"
           :props="defaultProps"
           @node-click="handleNodeClick">
           <span slot-scope="{ node }" class="custom-tree-node">
@@ -102,6 +105,7 @@
 <script>
   import distrApi from '@/api/base/distr'
   import regionApi from '@/api/base/region'
+  import regionAuthApi from '@/api/base/regionAuth'
 
   import Edit from './components/DistrEdit'
   import TableTool from '@/components/table/TableTool'
@@ -158,7 +162,8 @@
           },
         ],
 
-        regionOptions: undefined,
+        regionOptions: [],
+        userSalesProvince: undefined,
         defaultProps: {
           id: 'id',
           children: 'children',
@@ -178,11 +183,18 @@
     created() {
       this.fetchData()
       this.getRegionTree()
+      this.getUserSalesProvince()
     },
     methods: {
       async getRegionTree() {
         const { data: data } = await regionApi.getRegionTree({})
-        this.regionOptions = data.list
+        this.regionOptions.push(...data.list)
+      },
+      async getUserSalesProvince() {
+        const { data: data } = await regionAuthApi.getUserSalesProvince({})
+        if (data && data.list) {
+          this.regionOptions.unshift(data.list)
+        }
       },
       // 筛选节点
       filterNode(value, data) {

+ 2 - 2
src/views/plat/task/index.vue

@@ -264,13 +264,13 @@
           },
           {
             label: '发布时间',
-            width: '160px',
+            width: '120px',
             prop: 'taskStartDate',
             sortable: false,
           },
           {
             label: '要求完成时间',
-            width: '160px',
+            width: '120px',
             prop: 'taskEndDate',
             sortable: false,
           },

+ 9 - 3
src/views/proj/business/detail.vue

@@ -33,7 +33,9 @@
             <!--              {{ details.nboCode }}-->
             <!--            </el-descriptions-item>-->
             <el-descriptions-item content-class-name="my-content" label="客户名称" label-class-name="my-label">
-              <span class="link-button" @click="handleCustomerDetail(details)">{{ details.custName }}</span>
+              <span style="color: #1890ff; cursor: pointer" @click="handleCustomerDetail(details)">
+                {{ details.custName }}
+              </span>
             </el-descriptions-item>
             <el-descriptions-item content-class-name="my-content" label="销售工程师" label-class-name="my-label">
               {{ details.saleName }}
@@ -205,7 +207,7 @@
         <div class="buttons">
           <el-button v-permissions="['proj:business:edit']" type="primary" @click="handleEdit">编辑</el-button>
           <!--          <el-button @click="handleDelete">删除</el-button>-->
-          <el-button @click="$router.go(-1)">返回</el-button>
+          <el-button @click="back">返回</el-button>
         </div>
         <details-records :dynamics-list="dynamicsList" />
       </div>
@@ -417,7 +419,11 @@
         })
       },
       back() {
-        this.$router.go(-1)
+        // this.$router.go(-1)
+        this.$router.push({
+          name: 'Business',
+          params: this.$route.params,
+        })
       },
     },
   }

+ 7 - 1
src/views/proj/business/index.vue

@@ -436,6 +436,10 @@
       },
     },
     created() {
+      if (this.$route.params) {
+        this.queryForm = this.$route.params
+        this.activeName = this.queryForm.activeName ? this.queryForm.activeName : 'all'
+      }
       this.fetchData()
       this.getOptions()
     },
@@ -487,11 +491,13 @@
       },
       // 跳转详情
       handleDetail(row) {
+        this.queryForm.activeName = this.activeName
         this.$router.push({
-          path: '/opportunity/detail',
+          name: 'BusinessDetail',
           query: {
             id: row.id,
           },
+          params: this.queryForm,
         })
       },
       handleFollow(row) {