Преглед изворни кода

客户列表,设置默认定金比例

zxz пре 3 година
родитељ
комит
6517cef255
3 измењених фајлова са 103 додато и 113 уклоњено
  1. 5 0
      src/api/V2/customer/index.js
  2. 10 2
      src/model/customer/index.js
  3. 88 111
      src/views/customer/customerList.vue

+ 5 - 0
src/api/V2/customer/index.js

@@ -2,4 +2,9 @@
 //客户列表查看
 export const API_GET_CUSTOMERINFO_LOOK = '/customerInfo/selectCustomerInfo'
 
+// 设置默认定金比例
+export const API_POST_INSTALLDEPOSITRATIO = '/customerInfo/api/installDepositRatio'
+
+// 编辑
+export const API_POST_EDITCUSTOMERINFO = '/customerInfo/api/editCustomerInfo'
 

+ 10 - 2
src/model/customer/index.js

@@ -2,12 +2,20 @@ import { errorCatcher, errorHandle, filter } from 'base-core-lib'
 import { appRx } from '../defalutConfig/indexRx'
 import {
     API_GET_CUSTOMERINFO_LOOK,
-    
+    API_POST_INSTALLDEPOSITRATIO,
+    API_POST_EDITCUSTOMERINFO
 } from '@/api/V2/customer'
 // import { app } from 'electron'
-// 列表
+
+// 客户管理列表
 export const getList = appRx.get(API_GET_CUSTOMERINFO_LOOK, errorCatcher, errorHandle, filter)
 
+// 设置默认定金比例
+export const installDepositRatio = appRx.post(API_POST_INSTALLDEPOSITRATIO, errorCatcher, errorHandle, filter)
+
+// 编辑
+export const editCustomerInfo = appRx.post(API_POST_EDITCUSTOMERINFO, errorCatcher, errorHandle, filter)
+
 
 
 

+ 88 - 111
src/views/customer/customerList.vue

@@ -27,11 +27,11 @@
             src="../../../public/img/sousuo.png"
             alt=""
         /></ws-button>
-        <el-button class="bg-bottom" type="primary" size="small" @click="installDepositRatio()"
+        <el-button class="bg-bottom" type="primary" size="small" @click="installRatio()"
         >默认定金比例</el-button
       >
       <WinseaContentModal
-      v-model="outerVisible"
+      v-model="outerVisibleEdit"
       title="设置默认定金比例"
       @on-cancel="handleClose"
     >
@@ -43,12 +43,12 @@
         :rows="2"
         maxlength="30"
         placeholder="请输入定金比例"
-        v-model="auditMind"
+        v-model="auditMindEdit"
       >
       </el-input>
       </div>
       <div class="dialog-footer">
-        <el-button @click="outerVisible = false">取 消</el-button>
+        <el-button @click="outerVisibleEdit = false">取 消</el-button>
         <el-button type="primary" @click="editDepositRatio()">确定</el-button>
       </div>
     </WinseaContentModal>
@@ -76,7 +76,7 @@
      
       <div class="dialog-footer">
         <el-button @click="outerVisibleAdd = false">取 消</el-button>
-        <el-button type="primary" @click="editPriceAdd()">确定</el-button>
+        <el-button type="primary" @click="editPrice(0)">确定</el-button>
       </div>
     </WinseaContentModal>
 
@@ -102,7 +102,7 @@
      
       <div class="dialog-footer">
         <el-button @click="outerVisibleReturn = false">取 消</el-button>
-        <el-button type="primary" @click="editPriceReturn()">确定</el-button>
+        <el-button type="primary" @click="editPrice(1)">确定</el-button>
       </div>
     </WinseaContentModal>
       </template>
@@ -111,7 +111,7 @@
     <div>
       <el-table
         class="wenzi"
-        :data="warehouseList.records"
+        :data="customerList.records"
         style="width: 100%"
         height="780"
       >
@@ -122,18 +122,21 @@
           </template>
         </el-table-column>
         <el-table-column prop="customerName" label="客户名称">
+            <template scope="scope">
+            <span v-if="scope.row.customerName == '' || scope.row.customerName == null">{{scope.row.compName}}</span>
+             <span v-if="scope.row.compName == '' || scope.row.compName == null">{{scope.row.customerName}}</span>
+          </template>
         </el-table-column>
-        <el-table-column prop="compAddress" label="地址">
-            <template>asddddddd</template>
-        </el-table-column>
+        <el-table-column prop="compAddress" label="地址"></el-table-column>
         <el-table-column prop="customerPhone" label="电话"> </el-table-column>
         <el-table-column prop="payTaxesCard" label="纳税人识别号"> </el-table-column>
         <el-table-column prop="bankDeposit" label="开户行"> </el-table-column>
         <el-table-column prop="bankCard" label="银行卡号"> </el-table-column>
         <el-table-column prop="totalDeposit" label="总定金(元)"> </el-table-column>
         <el-table-column prop="freezingDeposit" label="冻结定金(元)"> </el-table-column>
-        <el-table-column prop="processStatus" label="定金比例(元/吨)">
+        <el-table-column prop="depositRatio" label="定金比例(元/吨)">
           <template slot-scope="scope">
+            {{scope.row.depositRatio}}
             <img
               width="17"
               height="18"
@@ -147,9 +150,9 @@
         <el-table-column prop="updateDate" label="更新时间"> </el-table-column>
         <el-table-column prop="seller" label="操作" width="280" >
           <template>
-            <el-button class="find" type="primary" @click="addPrice()"
+            <el-button class="find" type="primary" @click="editClick(1)"
           >增加定金</el-button>
-            <el-button class="find" type="primary" @click="returnPrice()"
+            <el-button class="find" type="primary" @click="editClick(2)"
           >退回定金</el-button>
           </template>
         </el-table-column>
@@ -167,7 +170,11 @@
   </div>
 </template>
 <script>
-import { automobileList, alsostate } from '@/model/transport/index'
+import { 
+  getList,
+  installDepositRatio,
+  editCustomerInfo
+} from '@/model/customer/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 
@@ -202,9 +209,8 @@ export default {
       currentPage: 1,
       pageSize: 10,
       deptBudgetTotal: 0,
-      searchTypeText: '执行中',
       searchKeyWord: '',
-      outerVisible: false,
+      outerVisibleEdit: false,
       outerVisibleAdd: false,
       outerVisibleReturn: false,
       contractType: 2,
@@ -213,29 +219,20 @@ export default {
       submitType: true,
       size: 10,
       spanArr: [],
-      inOutDate: [],
-      auditMind: '',
+      auditMindEdit: '',
       auditMindAdd: '',
       auditMindReturn: '',
-      tranTypeKey: '1',
-      warehouseName: '',
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
-      warehouseList: [],
+      customerList: [],
       deptBudgetList: {},
       historyList: [],
-      taskTypeList: [
-        { value: '执行中', type: 1 },
-        { value: '已完成', type: 2 },
-        { value: '全部任务', type: '' },
-      ],
       pickerBeginDateBefore: {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
         },
       },
       accessoryTFs: false,
-     
     }
   },
   activated() {
@@ -244,43 +241,29 @@ export default {
   },
   methods: {
     //设置默认定金比例
-    installDepositRatio(){
-      this.outerVisible = true
+    installRatio(){
+      // installDepositRatio({
+      //     compId: sessionStorage.getItem('ws-pf_compId'),
+      //     depositRatio:this.depositRatio,
+      // })
+      this.outerVisibleEdit = true
     },
     editDepositRatio(){
-      
-      if (!this.auditMind) {
-        this.$message({
-          message: '默认定金比例不能为空!',
-          type: 'warning',
-        })
-        return
-      }
-      
-    },
-    //增加定金
-    addPrice(){
-        this.outerVisibleAdd = true
-    },
-    editPriceAdd(){
-      
-      if (!this.auditMindAdd) {
-        this.$message({
-          message: '增加金额不能为空!',
-          type: 'warning',
+      installDepositRatio({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+       depositRatio:this.depositRatio,
+      })
+        .toPromise()
+        .then((response) => {
+          // this.deptCircularPage.currentPage = response.current
+          // this.deptCircularPage.pageSize = response.size
+          // this.deptBudgetTotal = response.total
+          // this.customerList = response
+          console.log('成功')
         })
-        return
-      }
-      
-    },
-    //退回定金
-    returnPrice(){
-        this.outerVisibleReturn = true
-    },
-    editPriceReturn(){
-      if (!this.auditMindOneReturn) {
+      if (!this.auditMindEdit) {
         this.$message({
-          message: '退回金额不能为空!',
+          message: '默认定金比例不能为空!',
           type: 'warning',
         })
         return
@@ -335,59 +318,65 @@ export default {
       this.getList()
     },
     getList() {
-      automobileList({
+      getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
-        searchType: this.searchType,
-        startDate: this.startDate,
-        endDate: this.endDate,
         searchKeyWord: this.searchKeyWord,
-        tranTypeKey: this.tranTypeKey,
+        customerTypeFlag: this.customerTypeFlag,
       })
         .toPromise()
         .then((response) => {
           this.deptCircularPage.currentPage = response.current
           this.deptCircularPage.pageSize = response.size
           this.deptBudgetTotal = response.total
-          this.warehouseList = response
+          this.customerList = response
         })
     },
-    editClick(row) {
-      var status = ''
-      if (row.processStatus == '待执行' || row.processStatus == '已完成') {
-        status = '执行中'
-      } else if (row.processStatus == '执行中') {
-        status = '已完成'
-      }
-      //cancelButtonClass: "btn-custom-cancel"
-      this.$confirm(`是否将状态改为${status}`, {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
+    editClick(index) {
+      editCustomerInfo({
+          
       })
-        .then(() => {
-          alsostate({ id: row.id })
-            .toPromise()
-            .then((response) => {
-              this.$notify.success({
-                title: '成功',
-                message: '状态修改成功',
-              })
-              this.getList()
-            })
-            .catch((response) => {
-              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-            })
-        })
-        .catch(() => {
-          return false
+      .toPromise()
+        .then((response) => {
+          // this.deptCircularPage.currentPage = response.current
+          // this.deptCircularPage.pageSize = response.size
+          // this.deptBudgetTotal = response.total
+          // this.customerList = response
+          console.log('成功')
         })
+      //更改定金比例
+      if(index == 0){
+          this.outerVisibleEdit = true
+      }
+      //增加定金
+      else if(index == 1){
+          this.outerVisibleAdd = true
+      }
+      //退回定金
+      else{
+        this.outerVisibleReturn = true
+      }
     },
-    selecttaskType(e) {
-      for (var i = 0; i < this.taskTypeList.length; i++) {
-        if (this.taskTypeList[i].value == e) {
-          this.searchType = this.taskTypeList[i].type
+    editPrice(asdf){
+      //增加定金
+        if(asdf == 0){
+            if (!this.auditMindAdd) {
+              this.$message({
+              message: '增加金额不能为空!',
+              type: 'warning',
+            })
+            return
+            }
+          }
+      //退回定金
+      if(asdf == 1){
+          if (!this.auditMindOneReturn) {
+            this.$message({
+            message: '退回金额不能为空!',
+            type: 'warning',
+            })
+          return
         }
       }
     },
@@ -398,19 +387,7 @@ export default {
           this.historyList = response
         })
     },
-    find() {
-      if (this.inOutDate != null) {
-        if (this.inOutDate.length > 0) {
-          this.startDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[0])
-          this.endDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[1])
-        } else {
-          this.startDate = ''
-          this.endDate = ''
-        }
-      }else{
-        this.startDate = ''
-          this.endDate = ''
-      }
+     find() {
       this.currentPage = 1
       this.getList()
     },