wangxingcheng 2 years ago
parent
commit
906c0e6a16

+ 1 - 1
.env

@@ -5,7 +5,7 @@ VUE_APP_TENANT=default
 # 登录验证微服务名称
 VUE_APP_AdminPath  = dashoo.opms.admin-0.0.1
 VUE_APP_ParentPath = dashoo.opms.parent-0.0.1
-VUE_APP_MicroSrvProxy_API=http://127.0.0.1:9981/
+VUE_APP_MicroSrvProxy_API=http://192.168.0.81:9981/
 SSO_LOGIN=''
 SSO_HREF=''
 

+ 8 - 3
src/api/customer/index.js

@@ -92,9 +92,14 @@ export default {
     return micro_request.postRequest(basePath, 'Customer', 'DeleteById', query)
   },
   // 客户领取
-  // receiveCustomer(query) {
-  // return micro_request.postRequest(basePath, 'Contant', 'Create', query)
-  // },
+  receiveCustomer(query) {
+    return micro_request.postRequest(
+      basePath,
+      'Customer',
+      'DistriCustomer',
+      query
+    )
+  },
   // 省份
   getProvinceInfo(query) {
     return micro_request.postRequest(

+ 13 - 0
src/api/work/index.js

@@ -5,4 +5,17 @@ export default {
   getList(query) {
     return micro_request.postRequest(basePath, 'WorkOrder', 'GetList', query)
   },
+  //导出
+  deriveList(query) {
+    return micro_request.postRequest(basePath, 'WorkOrder', 'DeriveList', query)
+  },
+  //详情
+  getDetail(query) {
+    return micro_request.postRequest(
+      basePath,
+      'WorkOrder',
+      'GetEntityById',
+      query
+    )
+  },
 }

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

@@ -21,7 +21,7 @@
 
       <el-col :span="20" :xs="24">
         <vab-query-form>
-          <vab-query-form-left-panel :span="15">
+          <vab-query-form-left-panel :span="20">
             <el-form :inline="true" :model="queryForm" @submit.native.prevent>
               <el-form-item>
                 <el-input
@@ -50,9 +50,12 @@
                   @click="queryData">
                   查询
                 </el-button>
+                <el-button icon="el-icon-refresh-right" @click="reset">
+                  重置
+                </el-button>
               </el-form-item>
             </el-form>
-            <vab-query-form-left-panel :span="2">
+            <vab-query-form-left-panel :span="5">
               <el-button
                 icon="el-icon-plus"
                 type="primary"
@@ -268,6 +271,16 @@
         this.total = total
         this.listLoading = false
       },
+      reset() {
+        ;(this.queryForm = {
+          pageNum: 1,
+          pageSize: 10,
+          distCode: '',
+          distName: '',
+          belongSale: '',
+        }),
+          this.fetchData()
+      },
     },
   }
 </script>

+ 42 - 9
src/views/base/region/index.vue

@@ -5,8 +5,8 @@
         <div class="head-container" style="margin-bottom: 5px">
           <el-input v-model="filterText" placeholder="输入关键字进行过滤" />
           <el-tree
-            class="filter-tree"
             ref="tree"
+            class="filter-tree"
             :data="deptOptions"
             default-expand-all
             :default-expanded-keys="[1]"
@@ -31,7 +31,7 @@
           </el-button>
         </vab-query-form-left-panel>
       </el-col>
-      <el-col :span="15" :xs="24">
+      <el-col :span="19" :xs="27">
         <vab-query-form>
           <vab-query-form-left-panel :span="20">
             <el-form :inline="true" :model="queryForm" @submit.native.prevent>
@@ -50,22 +50,32 @@
                   placeholder="客户名称" />
               </el-form-item>
               &nbsp;
-              <el-form-item>
-                <el-input
-                  v-model.trim="queryForm.custIndustry"
-                  clearable
-                  placeholder="客户行业" />
+              <el-form-item label="" prop="custIndustry">
+                <el-select
+                  v-model="custIndustry"
+                  placeholder="请选择客户行业"
+                  style="width: 100%">
+                  <el-option
+                    v-for="item in industryOptions"
+                    :key="item.value"
+                    :label="item.value"
+                    :value="item.value" />
+                </el-select>
               </el-form-item>
-              <el-form-item>
+              <el-form-item style="margin-right: 5px">
                 <el-button
                   icon="el-icon-search"
                   type="primary"
                   @click="queryData">
                   查询
                 </el-button>
+                <el-button icon="el-icon-refresh-right" @click="reset">
+                  重置
+                </el-button>
               </el-form-item>
             </el-form>
-            <vab-query-form-left-panel :span="2">
+
+            <vab-query-form-left-panel :span="5">
               <el-button
                 icon="el-icon-plus"
                 type="primary"
@@ -155,6 +165,7 @@
         total: 0,
         selectRows: '',
         filterText: '',
+        custIndustry: '', // 客户行业  (没数据)
         queryForm: {
           pageNum: 1,
           pageSize: 10,
@@ -168,6 +179,7 @@
         },
         treeDefaultExpandAll: true,
         regionId: 0,
+        industryOptions: [], //客户行业
       }
     },
 
@@ -184,8 +196,25 @@
     created() {
       this.fetchData()
       this.getRegion()
+      this.getOptions()
     },
     methods: {
+      reset() {
+        this.queryForm = {
+          pageNum: 1,
+          pageSize: 10,
+          custCode: '',
+          custName: '',
+          custIndustry: '',
+        }
+      },
+      getOptions() {
+        Promise.all([this.getDicts('CustomerIndustry')])
+          .then(([industry]) => {
+            this.industryOptions = industry.data.values || []
+          })
+          .catch((err) => console.log(err))
+      },
       async getRegion() {
         const { data: data } = await regionApi.getRegion({})
         var first_id = data.list[0].id
@@ -260,6 +289,7 @@
         this.queryForm.pageNum = 1
         this.fetchData()
       },
+
       async fetchData() {
         this.listLoading = true
         const {
@@ -292,6 +322,9 @@
     font-weight: bold;
     background-color: #dde9ff !important;
   }
+  .el-form-item__content {
+    margin-right: 3px;
+  }
 
   .vab-query-form[data-v-64063760]
     .el-form-item:first-child

+ 2 - 0
src/views/customer/detail.vue

@@ -405,7 +405,9 @@
               item.opnContent = JSON.parse(item.opnContent)
             }
           }
+
           this.records = obj
+          console.log('-----', obj)
         }
       },
       setSelectRows(val) {

+ 2 - 0
src/views/customer/list.vue

@@ -77,7 +77,9 @@
       <el-table-column align="center" label="客户名称" prop="custName" />
       <el-table-column align="center" label="助记名" prop="abbrName" />
       <el-table-column align="center" label="所在地区" prop="custLocation" />
+
       <el-table-column align="center" label="客户行业" prop="custIndustry" />
+
       <el-table-column align="center" label="客户级别" prop="custLevel" />
       <el-table-column align="center" label="客户状态" prop="custStatus">
         <template slot-scope="scope">

+ 18 - 17
src/views/customer/openSea.vue

@@ -229,24 +229,25 @@
       handleReceive() {
         if (!this.selectRows.length) return this.$message.warning('请选择客户')
         const arr = this.selectRows.map((item) => item.id)
-        this.$confirm('确认领取客户?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(async () => {
-            const [err, res] = await to(
-              api.receiveCustomer({ ids: arr.join() })
-            )
-            if (err) return
-            if (res.code == 200) {
-              this.$message({
-                type: 'success',
-                message: '领取成功!',
-              })
-            }
+        console.log('redids', arr),
+          this.$confirm('确认领取客户?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
           })
-          .catch(() => {})
+            .then(async () => {
+              const [err, res] = await to(
+                api.receiveCustomer({ ids: arr, salesId: 1 })
+              )
+              if (err) return
+              if (res.code == 200) {
+                this.$message({
+                  type: 'success',
+                  message: '领取成功!',
+                })
+              }
+            })
+            .catch(() => {})
       },
     },
   }

+ 0 - 0
src/views/work/order/detail.vue


+ 238 - 0
src/views/work/order/index.vue

@@ -0,0 +1,238 @@
+<template>
+  <div class="list-container">
+    <el-row :gutter="10" style="margin-bottom: 10px">
+      <el-col :span="4">
+        <el-input v-model="queryForm.orderTypeDesc" placeholder="工单类型" />
+      </el-col>
+      <el-col :span="4">
+        <el-input v-model="queryForm.orderStatus" placeholder="工单状态" />
+      </el-col>
+      <el-col :span="4">
+        <el-input
+          v-model="queryForm.assignUserName"
+          placeholder="分派人员姓名" />
+      </el-col>
+      <el-col :span="12">
+        <el-button icon="el-icon-plus" type="primary" @click="fetchData">
+          查询
+        </el-button>
+        <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
+      </el-col>
+    </el-row>
+    <vab-query-form>
+      <vab-query-form-left-panel :span="12">
+        <el-button
+          icon="el-icon-plus"
+          size="mini"
+          type="primary"
+          @click="$refs.edit.init()">
+          新建
+        </el-button>
+      </vab-query-form-left-panel>
+      <vab-query-form-right-panel :span="12">
+        <el-button icon="el-icon-download" @click="exportData" />
+        <table-tool :check-list.sync="checkList" :columns="columns" />
+      </vab-query-form-right-panel>
+    </vab-query-form>
+
+    <el-table v-loading="listLoading" border :data="list" :height="height">
+      <el-table-column
+        v-for="(item, index) in finallyColumns"
+        :key="index"
+        align="center"
+        :label="item.label"
+        :prop="item.prop"
+        show-overflow-tooltip
+        :sortable="item.sortable"
+        :width="item.width">
+        <template #default="{ row }">
+          <span v-if="item.prop === 'orderTypeDesc'">
+            {{ row.orderTypeDesc }}
+          </span>
+          <span v-if="item.prop === 'orderStatus'">
+            {{ row.orderStatus }}
+          </span>
+          <span v-if="item.prop === 'assignUserName'">
+            {{ row.assignUserName }}
+          </span>
+          <span v-if="item.prop === 'feedBack'">
+            {{ row.feedBack }}
+          </span>
+          <span v-if="item.prop === 'createName'">
+            {{ row.createName }}
+          </span>
+          <span v-if="item.prop === 'createTime'">
+            {{ row.createTime }}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="操作" width="85">
+        <template #default="{ row }">
+          <el-button type="text" @click="handleDetail(row)">查看</el-button>
+        </template>
+      </el-table-column>
+      <template #empty>
+        <el-image
+          class="vab-data-empty"
+          :src="require('@/assets/empty_images/data_empty.png')" />
+      </template>
+    </el-table>
+
+    <el-pagination
+      background
+      :current-page="queryForm.pageNum"
+      :layout="layout"
+      :page-size="queryForm.pageSize"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange" />
+  </div>
+</template>
+
+<script>
+  import to from 'await-to-js'
+  import api from '@/api/work/index'
+  import downloadFileByByte from '@/utils/base64ToFile'
+  import TableTool from '@/components/table/TableTool'
+
+  export default {
+    components: { TableTool },
+    data() {
+      return {
+        activeName: 'first',
+        layout: 'total, sizes, prev, pager, next, jumper',
+        queryForm: {
+          orderTypeDesc: '',
+          orderStatus: '',
+          assignUserName: '',
+          pageNum: 1,
+          pageSize: 10,
+        },
+        total: 0,
+        listLoading: false,
+        list: [],
+        selectRows: [],
+        checkList: [],
+        columns: [
+          {
+            label: '工单类型',
+            width: 'auto',
+            prop: 'orderTypeDesc',
+            sortable: true,
+            disableCheck: true,
+          },
+          {
+            label: '工单状态',
+            width: 'auto',
+            prop: 'orderStatus',
+            sortable: true,
+          },
+          {
+            label: '分派人员',
+            width: 'auto',
+            prop: 'assignUserName',
+            sortable: true,
+          },
+          {
+            label: '反馈信息',
+            width: 'auto',
+            prop: 'feedBack',
+            sortable: true,
+          },
+          {
+            label: '创建人',
+            width: 'auto',
+            prop: 'createName',
+            sortable: true,
+          },
+          {
+            label: '创建时间',
+            width: 'auto',
+            prop: 'createTime',
+            sortable: true,
+          },
+        ],
+      }
+    },
+    computed: {
+      height() {
+        return this.$baseTableHeight(1)
+      },
+      finallyColumns() {
+        console.log('finallyColums')
+        return this.columns.filter((item) =>
+          this.checkList.includes(item.label)
+        )
+      },
+    },
+    mounted() {
+      this.fetchData()
+    },
+
+    methods: {
+      handleClick(tab) {
+        console.log(tab, 'tab')
+        this.fetchData()
+      },
+      async fetchData() {
+        this.listLoading = true
+        const params = { ...this.queryForm }
+        const [err, res] = await to(api.getList(params))
+        if (err) return (this.listLoading = false)
+        this.list = res.data.list || []
+        this.total = res.data.total
+        this.listLoading = false
+      },
+      exportData() {
+        let exportFrom = JSON.parse(JSON.stringify(this.queryForm))
+        exportFrom.columns = this.finallyColumns.map((item) => item.label)
+        api
+          .deriveList(exportFrom)
+          .then((res) => {
+            if (res.data.list.content) {
+              downloadFileByByte(res.data.list.content, '工单数据.xlsx')
+            }
+          })
+          .catch((err) => {
+            console.error(err)
+          })
+      },
+      //详情
+      handleDetail(row) {
+        this.$router.push({
+          path: './detail',
+          query: {
+            id: row.id,
+            privateCus: 1,
+          },
+        })
+      },
+      reset() {
+        this.queryForm = {
+          pageNum: 1,
+          pageSize: 10,
+          orderTypeDesc: '',
+          orderStatus: '',
+          assignUserName: '',
+        }
+        this.fetchData()
+      },
+
+      handleSizeChange(val) {
+        this.queryForm.pageSize = val
+        this.fetchData()
+      },
+      handleCurrentChange(val) {
+        this.queryForm.pageNum = val
+        this.fetchData()
+      },
+      setSelectRows(val) {
+        this.selectRows = val
+      },
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  $base: '.list';
+</style>