Просмотр исходного кода

feature: 合同、回款功能优化

liuyaqi 2 лет назад
Родитель
Сommit
5bdea3682f
3 измененных файлов с 219 добавлено и 7 удалено
  1. 78 2
      src/views/collection/index.vue
  2. 92 3
      src/views/collection/plan.vue
  3. 49 2
      src/views/contract/index.vue

+ 78 - 2
src/views/collection/index.vue

@@ -26,6 +26,38 @@
               <el-option v-for="item in approStatusOption" :key="item.id" :label="item.label" :value="item.id" />
               <el-option v-for="item in approStatusOption" :key="item.id" :label="item.label" :value="item.id" />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
+          <el-form-item prop="inchargeName">
+            <el-input
+              v-model="queryForm.inchargeName"
+              clearable
+              placeholder="销售工程师"
+              @keyup.enter.native="queryData" />
+          </el-form-item>
+          <el-form-item prop="custProvince">
+            <el-select v-model="queryForm.custProvince" clearable placeholder="所在省" value-key="id">
+              <el-option v-for="item in provinceOptions" :key="item.id" :label="item.distName" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="custCity">
+            <el-select v-model="queryForm.custCity" clearable placeholder="所在市" value-key="id">
+              <el-option
+                v-for="item in queryForm.custProvince ? queryForm.custProvince.children : []"
+                :key="item.id"
+                clearable
+                :label="item.distName"
+                :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="filterDate">
+            <el-date-picker
+              v-model="queryForm.filterDate"
+              end-placeholder="回款结束时间"
+              range-separator="至"
+              start-placeholder="回款开始时间"
+              style="width: 100%"
+              type="daterange"
+              value-format="yyyy-MM-dd" />
+          </el-form-item>
           <el-form-item>
           <el-form-item>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
           </el-form-item>
           </el-form-item>
@@ -99,6 +131,7 @@
   import to from 'await-to-js'
   import to from 'await-to-js'
   import collectionApi from '@/api/contract/collection'
   import collectionApi from '@/api/contract/collection'
   import TableTool from '@/components/table/TableTool'
   import TableTool from '@/components/table/TableTool'
+  import api from '@/api/customer'
   export default {
   export default {
     name: 'Collection',
     name: 'Collection',
     components: {
     components: {
@@ -121,9 +154,16 @@
           contractCode: '', // 合同编号
           contractCode: '', // 合同编号
           contractName: '', //合同名称
           contractName: '', //合同名称
           custName: '', // 客户名称  ()
           custName: '', // 客户名称  ()
+          inchargeName: '', // 负责人(销售工程师)
+          custProvinceId: 0,
+          custProvince: null,
+          custCityId: 0,
+          custCity: null,
+          filterDate: [],
           nboName: '', //项目名称
           nboName: '', //项目名称
           approStatus: '', //审批状态
           approStatus: '', //审批状态
         },
         },
+        provinceOptions: [],
         collectionTypeOption: [], //回款方式
         collectionTypeOption: [], //回款方式
         selectRows: [], //选择的表格数据
         selectRows: [], //选择的表格数据
         industryOptions: [], //客户行业
         industryOptions: [], //客户行业
@@ -179,6 +219,34 @@
             sortable: false,
             sortable: false,
             disableCheck: false,
             disableCheck: false,
           },
           },
+          {
+            label: '回款时间',
+            width: '100px',
+            prop: 'collectionDatetime',
+            sortable: false,
+            disableCheck: false,
+          },
+          {
+            label: '销售工程师',
+            width: '100px',
+            prop: 'inchargeName',
+            sortable: false,
+            disableCheck: false,
+          },
+          {
+            label: '所在省',
+            width: '100px',
+            prop: 'custProvince',
+            sortable: false,
+            disableCheck: false,
+          },
+          {
+            label: '所在市',
+            width: '100px',
+            prop: 'custCity',
+            sortable: false,
+            disableCheck: false,
+          },
           {
           {
             label: '更新时间',
             label: '更新时间',
             width: '100px',
             width: '100px',
@@ -217,8 +285,9 @@
     },
     },
     methods: {
     methods: {
       async getOptions() {
       async getOptions() {
-        await Promise.all([this.getDicts('collection_type')])
-          .then(([collectionType]) => {
+        await Promise.all([api.getProvinceDetail(), this.getDicts('collection_type')])
+          .then(([province, collectionType]) => {
+            this.provinceOptions = province.data.list || []
             this.collectionTypeOption = collectionType.data.values || []
             this.collectionTypeOption = collectionType.data.values || []
           })
           })
           .catch((err) => console.log(err))
           .catch((err) => console.log(err))
@@ -226,6 +295,12 @@
       async queryData() {
       async queryData() {
         this.listLoading = true
         this.listLoading = true
         const params = { ...this.queryForm }
         const params = { ...this.queryForm }
+        params.custProvinceId = params.custProvince ? params.custProvince.id : 0
+        params.custCityId = params.custCity ? params.custCity.id : 0
+        if (this.queryForm.filterDate && this.queryForm.filterDate.length === 2) {
+          params.collectionDatetimeStart = this.queryForm.filterDate[0]
+          params.collectionDatetimeEnd = this.queryForm.filterDate[1]
+        }
         const [err, res] = await to(collectionApi.getList(params))
         const [err, res] = await to(collectionApi.getList(params))
         if (err) return (this.listLoading = false)
         if (err) return (this.listLoading = false)
         this.list = res.data.list || []
         this.list = res.data.list || []
@@ -239,6 +314,7 @@
           pageSize: 10,
           pageSize: 10,
           custCode: '', // 客户编码
           custCode: '', // 客户编码
           custName: '', //客户名称
           custName: '', //客户名称
+          inchargeName: '', // 负责人(销售工程师)
           custIndustry: '', // 客户行业  ()
           custIndustry: '', // 客户行业  ()
           custLevel: '', //客户级别
           custLevel: '', //客户级别
         }
         }

+ 92 - 3
src/views/collection/plan.vue

@@ -21,6 +21,43 @@
           <el-form-item prop="custId">
           <el-form-item prop="custId">
             <el-input v-model="queryForm.custName" clearable placeholder="客户名称" @keyup.enter.native="queryData" />
             <el-input v-model="queryForm.custName" clearable placeholder="客户名称" @keyup.enter.native="queryData" />
           </el-form-item>
           </el-form-item>
+          <el-form-item prop="contractStatus">
+            <el-select v-model="queryForm.contractStatus" clearable placeholder="回款状态">
+              <el-option v-for="item in approStatusOption" :key="item.id" :label="item.label" :value="item.id" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="inchargeName">
+            <el-input
+              v-model="queryForm.inchargeName"
+              clearable
+              placeholder="销售工程师"
+              @keyup.enter.native="queryData" />
+          </el-form-item>
+          <el-form-item prop="custProvince">
+            <el-select v-model="queryForm.custProvince" clearable placeholder="所在省" value-key="id">
+              <el-option v-for="item in provinceOptions" :key="item.id" :label="item.distName" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="custCity">
+            <el-select v-model="queryForm.custCity" clearable placeholder="所在市" value-key="id">
+              <el-option
+                v-for="item in queryForm.custProvince ? queryForm.custProvince.children : []"
+                :key="item.id"
+                clearable
+                :label="item.distName"
+                :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="filterDate">
+            <el-date-picker
+              v-model="queryForm.filterDate"
+              end-placeholder="计划回款结束时间"
+              range-separator="至"
+              start-placeholder="计划回款开始时间"
+              style="width: 100%"
+              type="daterange"
+              value-format="yyyy-MM-dd" />
+          </el-form-item>
           <el-form-item>
           <el-form-item>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
           </el-form-item>
           </el-form-item>
@@ -98,6 +135,7 @@
   import to from 'await-to-js'
   import to from 'await-to-js'
   import collectionPlanApi from '@/api/contract/collectionPlan'
   import collectionPlanApi from '@/api/contract/collectionPlan'
   import TableTool from '@/components/table/TableTool'
   import TableTool from '@/components/table/TableTool'
+  import api from '@/api/customer'
   export default {
   export default {
     name: 'CollectionPlan',
     name: 'CollectionPlan',
     components: {
     components: {
@@ -107,8 +145,9 @@
       return {
       return {
         height: this.$baseTableHeight(2),
         height: this.$baseTableHeight(2),
         approStatusOption: [
         approStatusOption: [
-          { id: '10', label: '未回款' },
-          { id: '20', label: '已回款' },
+          { id: '10', label: '待回款' },
+          { id: '20', label: '部分回款' },
+          { id: '30', label: '全部回款' },
         ],
         ],
         listLoading: false,
         listLoading: false,
         layout: 'total, sizes, prev, pager, next, jumper',
         layout: 'total, sizes, prev, pager, next, jumper',
@@ -117,9 +156,17 @@
         queryForm: {
         queryForm: {
           pageNum: 1,
           pageNum: 1,
           pageSize: 10,
           pageSize: 10,
+          contractStatus: '',
+          inchargeName: '', // 负责人(销售工程师)
+          custProvinceId: 0,
+          custProvince: null,
+          custCityId: 0,
+          custCity: null,
+          filterDate: [],
           contractCode: '', // 合同编号
           contractCode: '', // 合同编号
           custName: '', // 客户名称  ()
           custName: '', // 客户名称  ()
         },
         },
+        provinceOptions: [],
         selectRows: [], //选择的表格数据
         selectRows: [], //选择的表格数据
         industryOptions: [], //客户行业
         industryOptions: [], //客户行业
         // 自定义列表
         // 自定义列表
@@ -187,6 +234,27 @@
             sortable: false,
             sortable: false,
             disableCheck: false,
             disableCheck: false,
           },
           },
+          {
+            label: '销售工程师',
+            width: '100px',
+            prop: 'inchargeName',
+            sortable: false,
+            disableCheck: false,
+          },
+          {
+            label: '所在省',
+            width: '100px',
+            prop: 'custProvince',
+            sortable: false,
+            disableCheck: false,
+          },
+          {
+            label: '所在市',
+            width: '100px',
+            prop: 'custCity',
+            sortable: false,
+            disableCheck: false,
+          },
           {
           {
             label: '更新时间',
             label: '更新时间',
             width: '100px',
             width: '100px',
@@ -214,13 +282,20 @@
     activated() {
     activated() {
       this.queryData()
       this.queryData()
     },
     },
-    mounted() {
+    async mounted() {
+      await this.getOptions()
       this.queryData()
       this.queryData()
     },
     },
     methods: {
     methods: {
       async queryData() {
       async queryData() {
         this.listLoading = true
         this.listLoading = true
         const params = { ...this.queryForm }
         const params = { ...this.queryForm }
+        params.custProvinceId = params.custProvince ? params.custProvince.id : 0
+        params.custCityId = params.custCity ? params.custCity.id : 0
+        if (this.queryForm.filterDate && this.queryForm.filterDate.length === 2) {
+          params.planBeginTime = this.queryForm.filterDate[0]
+          params.planEndTime = this.queryForm.filterDate[1]
+        }
         const [err, res] = await to(collectionPlanApi.getList(params))
         const [err, res] = await to(collectionPlanApi.getList(params))
         if (err) return (this.listLoading = false)
         if (err) return (this.listLoading = false)
         this.list = res.data.list || []
         this.list = res.data.list || []
@@ -228,12 +303,26 @@
         this.listLoading = false
         this.listLoading = false
         this.$nextTick(() => this.$refs.table.doLayout())
         this.$nextTick(() => this.$refs.table.doLayout())
       },
       },
+      async getOptions() {
+        await Promise.all([api.getProvinceDetail()])
+          .then(([province]) => {
+            this.provinceOptions = province.data.list || []
+          })
+          .catch((err) => console.log(err))
+      },
       reset() {
       reset() {
         this.queryForm = {
         this.queryForm = {
           pageNum: 1,
           pageNum: 1,
           pageSize: 10,
           pageSize: 10,
           custCode: '', // 客户编码
           custCode: '', // 客户编码
           custName: '', //客户名称
           custName: '', //客户名称
+          contractStatus: '',
+          inchargeName: '', // 负责人(销售工程师)
+          custProvinceId: 0,
+          custProvince: null,
+          custCityId: 0,
+          custCity: null,
+          filterDate: [],
           custIndustry: '', // 客户行业  ()
           custIndustry: '', // 客户行业  ()
           custLevel: '', //客户级别
           custLevel: '', //客户级别
         }
         }

+ 49 - 2
src/views/contract/index.vue

@@ -35,6 +35,38 @@
               <el-option v-for="(v, k) in approStatusOption" :key="k" :label="v" :value="k" />
               <el-option v-for="(v, k) in approStatusOption" :key="k" :label="v" :value="k" />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
+          <el-form-item prop="inchargeName">
+            <el-input
+              v-model="queryForm.inchargeName"
+              clearable
+              placeholder="销售工程师"
+              @keyup.enter.native="queryData" />
+          </el-form-item>
+          <el-form-item prop="custProvince">
+            <el-select v-model="queryForm.custProvince" clearable placeholder="所在省" value-key="id">
+              <el-option v-for="item in provinceOptions" :key="item.id" :label="item.distName" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="custCity">
+            <el-select v-model="queryForm.custCity" clearable placeholder="所在市" value-key="id">
+              <el-option
+                v-for="item in queryForm.custProvince ? queryForm.custProvince.children : []"
+                :key="item.id"
+                clearable
+                :label="item.distName"
+                :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="filterDate">
+            <el-date-picker
+              v-model="queryForm.filterDate"
+              end-placeholder="合同签订结束时间"
+              range-separator="至"
+              start-placeholder="合同签订开始时间"
+              style="width: 100%"
+              type="daterange"
+              value-format="yyyy-MM-dd" />
+          </el-form-item>
           <el-form-item>
           <el-form-item>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
             <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
           </el-form-item>
           </el-form-item>
@@ -179,6 +211,7 @@
   import TableTool from '@/components/table/TableTool'
   import TableTool from '@/components/table/TableTool'
   import Transfer from './components/Transfer'
   import Transfer from './components/Transfer'
   import ApplyContract from './components/ApplyContract'
   import ApplyContract from './components/ApplyContract'
+  import api from '@/api/customer'
 
 
   export default {
   export default {
     name: 'Contract',
     name: 'Contract',
@@ -211,7 +244,14 @@
           custName: '', // 客户名称  ()
           custName: '', // 客户名称  ()
           nboName: '', //项目名称
           nboName: '', //项目名称
           approStatus: '', //审批状态
           approStatus: '', //审批状态
+          inchargeName: '', // 负责人(销售工程师)
+          custProvinceId: 0,
+          custProvince: null,
+          custCityId: 0,
+          custCity: null,
+          filterDate: [],
         },
         },
+        provinceOptions: [],
         selectRows: [], //选择的表格数据
         selectRows: [], //选择的表格数据
         industryOptions: [], //客户行业
         industryOptions: [], //客户行业
         levelOptions: [], //客户级别
         levelOptions: [], //客户级别
@@ -340,8 +380,8 @@
     },
     },
     methods: {
     methods: {
       getOptions() {
       getOptions() {
-        Promise.all([this.getDicts('contract_type'), this.getDicts('sys_product_line')])
-          .then(([contract, productLine]) => {
+        Promise.all([api.getProvinceDetail(), this.getDicts('contract_type'), this.getDicts('sys_product_line')])
+          .then(([province, contract, productLine]) => {
             this.contractOptions = {}
             this.contractOptions = {}
             contract.data.values.filter((i) => {
             contract.data.values.filter((i) => {
               this.contractOptions[i.key] = i.value
               this.contractOptions[i.key] = i.value
@@ -350,12 +390,19 @@
             productLine.data.values.filter((i) => {
             productLine.data.values.filter((i) => {
               this.productLineOptions[i.key] = i.value
               this.productLineOptions[i.key] = i.value
             })
             })
+            this.provinceOptions = province.data.list || []
           })
           })
           .catch((err) => console.log(err))
           .catch((err) => console.log(err))
       },
       },
       async queryData() {
       async queryData() {
         this.listLoading = true
         this.listLoading = true
         const params = { ...this.queryForm }
         const params = { ...this.queryForm }
+        params.custProvinceId = params.custProvince ? params.custProvince.id : 0
+        params.custCityId = params.custCity ? params.custCity.id : 0
+        if (this.queryForm.filterDate && this.queryForm.filterDate.length === 2) {
+          params.contractSignTimeStart = this.queryForm.filterDate[0]
+          params.contractSignTimeEnd = this.queryForm.filterDate[1]
+        }
         const [err, res] = await to(contractApi.getList(params))
         const [err, res] = await to(contractApi.getList(params))
         if (err) return (this.listLoading = false)
         if (err) return (this.listLoading = false)
         this.list = res.data.list || []
         this.list = res.data.list || []