230320a303 před 1 rokem
rodič
revize
3f9cf07ef3

+ 12 - 0
src/api/cust.js

@@ -52,4 +52,16 @@ export default {
   admtradedel: params => { // 成交 -  删除
     return getRequestNoSort('/adm/trade/del', params, 'loading')
   },
+  admtraderecordlist: params => { // 成交 更新记录 -  列表
+    return getRequest('/adm/trade/record/list', params)
+  },
+  admtraderecordadd: params => { // 成交  更新记录 -  添加
+    return getRequestNoSort('/adm/trade/record/add', params, 'loading')
+  },
+  admtraderecordedit: params => { // 成交 更新记录 -  编辑
+    return getRequestNoSort('/adm/trade/record/edit', params, 'loading')
+  },
+  admtraderecorddel: params => { // 成交  更新记录 -  删除
+    return getRequestNoSort('/adm/trade/record/del', params, 'loading')
+  },
 }

+ 1 - 1
src/views/trade/components/popup/IndexEdit.vue

@@ -66,7 +66,7 @@ export default {
         { label: '折扣体系', key: 'discount', class: 'c-2' },
         { label: '佣金', key: 'brokerage', class: 'c-2', type: 'inputFont', appendFont: '元' },
         { label: '返佣', key: 'rebate', class: 'c-2', type: 'inputFont', appendFont: '元' },
-        { label: '佣金凭证', key: 'housbrokerage_imge_no', type: 'uploads', class: 'c-2'},
+        { label: '佣金凭证', key: 'brokerage_img', type: 'uploads', class: 'c-2'},
         { label: '备注', key: 'remark', type: 'textarea' },
       ]
       this.setDefaultValue(params)

+ 39 - 30
src/views/trade/components/popup/IndexRecord.vue

@@ -33,7 +33,7 @@
         </div>
         <div class="si-row">
           <div class="si-col">报备渠道:{{dtlObj.report_dept}}</div>
-          <div class="si-col">成交佣金:{{dtlObj.brokerage || '-'}}元</div>
+          <div class="si-col" @click="openBrokerageImgPopup">成交佣金:{{dtlObj.brokerage || '-'}}元 <span class="img">[图片凭证]</span></div>
           <div class="si-col">成交返佣:{{dtlObj.rebate || '-'}}元</div>
         </div>
       </div>
@@ -49,9 +49,9 @@
       </div>
       <div class="xl-form" style="padding-top: 20px;">
         <div class="xl-form-footer">
-            <div class="scoped-btn-more" v-if="curRoles !== '6'">
-              <!-- <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc2" @click="openPopup">更新报备进度</el-button>
-              <el-button type="small" icon="el-icon-warning" class="xl-form-btn bgc4" @click="openStatePopup">修改状态</el-button> -->
+            <div class="scoped-btn-more">
+              <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc2" @click="openPopup">更新成交进度</el-button>
+              <!-- <el-button type="small" icon="el-icon-warning" class="xl-form-btn bgc4" @click="openStatePopup">修改状态</el-button> -->
             </div>
           <el-button class="xl-form-btn t2" @click="close">关闭弹窗</el-button>
         </div>
@@ -63,23 +63,19 @@
       :curObj="subObj"
       @close="closePopup"
     />
-    <state-edit
-      :isShow="isStateShow"
-      :pObj="dtlObj"
-      :curObj="subObj"
-      @close="closeStatePopup"
-    />
+    <popup-big-img :is-show="bigImgShow" :src="`${bigImgSrc}`" @close="closebigImg" />
   </div>
 </template>
 <script>
+import PopupBigImg from '@/components/Common/PopupBigImg'
 import RecordEdit from './RecordEdit'
-import StateEdit from './StateEdit'
 import baseTable from '_m/baseTable.js'
 import { arrToObj } from '@/utils'
+
 export default {
   components: {
     RecordEdit,
-    StateEdit,
+    PopupBigImg,
   },
   mixins: [...mixins, baseTable],
   props: {
@@ -89,10 +85,9 @@ export default {
   inject: ['parentData'],
   data() {
     return {
-      apiStr: 'cust.admtradedetail',
+      apiStr: 'cust.admtraderecordlist',
       noCreated: true,
       searchForm: {},
-      aList: [],
       subObj: {},
       isDtlShow: false,
       reportFlow: [],
@@ -100,27 +95,27 @@ export default {
       isStateShow: false,
       houseTypeObj: {},
       dealTypeObj: {},
-      curRoles: ''
+      bigImgShow: {},
+      bigImgSrc: '',
     }
   },
   mounted() {
-    const uObj = JSON.parse(this.$storage('fp_user'))
-    this.curRoles = uObj.roles
     this.houseTypeObj = arrToObj(this.$dictData.trade_house_type)
     this.dealTypeObj = arrToObj(this.$dictData.trade_deal_type)
     this.listConfig = {
       rows: [
-        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
-        { label: '报备进度', prop: 'report_step', type: 'flag', flags: arrToObj(this.$dictData.report_step	) },
-        { label: '更新人', prop: 'operator_nickname' },
+        { label: '佣金到款日', prop: 'info1'},
+        { label: '回款比例(%)', prop: 'info2' },
+        { label: '是否开票', prop: 'info3', type: 'tag', tags: arrToObj(this.$dictData.sys_yesno	), tagTypeObj: {'1': 'success', '2': 'warning'} },
+        { label: '上传凭证', prop: 'info4', type: 'img' },
+        { label: '备注', prop: 'remark', fullShow: true, minWidth: 100, align: 'left' },
         { label: '更新时间', prop: 'create_at' },
-        { label: '备注', prop: 'describe', fullShow: true, minWidth: 200, align: 'left' },
-        // { label: '操作', width: 120, type: 'handle2', operations:
-        //   [
-        //     { label: '编辑', func: this.openPopup, btnType: 'primary' },
-        //     { label: '删除', func: this.delHandle, btnType: 'danger' },
-        //   ]
-        // }
+        { label: '操作', width: 60, type: 'handle2', operations:
+          [
+            // { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
       ]
     }
   },
@@ -145,15 +140,24 @@ export default {
     },
   },
   methods: {
+    openBrokerageImgPopup () {
+      this.bigImgShow = true
+    },
+    closebigImg () {
+      this.bigImgShow = false
+    },
     getData () {
       this.$api.cust.admtradedetail({id: this.curObj.id}).then(res => {
         this.dtlObj = res || {}
-        this.reportFlow = res.report_flow || []
+        this.bigImgSrc = this.dtlObj.brokerage_img || ''
+      })
+      this.$api.cust.admtraderecordlist({trade_id: this.curObj.id}).then(res => {
+        this.reportFlow = res.list || []
       })
     },
     delHandle(row) {
-      this.$msg(`您确定要删除该跟进记录吗?`, 'confirm', () => {
-        this.$api.user.admcustomerrecorddel({
+      this.$msg(`您确定要删除该成交记录吗?`, 'confirm', () => {
+        this.$api.cust.admtraderecorddel({
           id: row.id
         }).then(data => {
           this.$msgs(`已删除!`)
@@ -209,6 +213,11 @@ export default {
     box-sizing: border-box;
     padding: 10px 20px;
     border-right: 1px solid #dcdcdc;
+    .img {
+      text-decoration: underline;
+      color: #2d8cf0;
+      cursor: pointer;
+    }
   }
 }
 

+ 10 - 12
src/views/trade/components/popup/RecordEdit.vue

@@ -5,14 +5,13 @@
       :show-close="false"
       :close-on-click-modal="false"
       :visible.sync="isShow"
-      :title="curObj.id ? '编辑报备进度' : '更新报备进度'"
+      :title="curObj.id ? '编辑成交进度' : '更新成交进度'"
       :fullscreen="false"
-      width="400px"
+      width="330px"
       custom-class="xl-dialog"
       center
     >
-      <div class="scoped-tips">当前报备进度:<span class="t">{{reportStepStr}}</span></div>
-      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="90px">
         <div slot="footer" style="padding-top: 20px;">
           <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
           <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
@@ -40,11 +39,7 @@ export default {
       curEstateObj: {},
     }
   },
-  computed: {
-    reportStepStr () {
-      return arrToObj(this.$dictData.report_step)[this.pObj.report_step]
-    }
-  },
+  computed: {},
   watch: {
     isShow: function(val) {
       if (val) {
@@ -56,7 +51,10 @@ export default {
     getDef() {
       let params = { ...this.curObj }
       this.formData = [
-        { label: '新报备进度', key: 'report_step', rules: 1, type: 'select', options: this.$dictData.report_step },
+        { label: '佣金到款日', key: 'info1', type: 'datePicker', type2: 'date'},
+        { label: '回款比例', key: 'info2', type: 'inputFont', appendFont: '%' },
+        { label: '是否开票', key: 'info3', type: 'select', options: this.$dictData.sys_yesno },
+        { label: '上传凭证', key: 'info4', type: 'uploads'},
         { label: '备注', key: 'remark', type: 'textarea' },
       ]
       this.setDefaultValue(params)
@@ -67,9 +65,9 @@ export default {
           if (valid) {
             const oldform = this.$refs.ruleForm.baseForm
             const newForm = { ...oldform }
-            let apiStr = 'admreportstepadd'
+            let apiStr = 'admtraderecordadd'
             if (this.pObj.id) {
-              newForm.id = this.pObj.id
+              newForm.trade_id = this.pObj.id
             }
             this.$api.cust[apiStr](newForm).then(data => {
               this.$msgs(newForm.id ? '编辑成功' : '新增成功')

+ 0 - 100
src/views/trade/components/popup/StateEdit.vue

@@ -1,100 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      v-loading="loading"
-      :show-close="false"
-      :close-on-click-modal="false"
-      :visible.sync="isShow"
-      :title="curObj.id ? '编辑报备进度' : '更新报备进度'"
-      :fullscreen="false"
-      width="400px"
-      custom-class="xl-dialog"
-      center
-    >
-      <div class="scoped-tips">当前客户报备状态:<span class="t">{{reportStateStr}}</span></div>
-      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
-        <div slot="footer" style="padding-top: 20px;">
-          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
-          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
-        </div>
-      </base-form>
-    </el-dialog>
-  </div>
-</template>
-<script>
-import { arrToObj } from '@/utils'
-export default {
-  components: { },
-  mixins,
-  props: {
-    isShow: Boolean,
-    curObj: Object,
-    pObj: Object,
-  },
-  inject: ['parentData'],
-  data() {
-    return {
-      formData: [],
-      loading: true,
-      cObj: {},
-      curEstateObj: {},
-    }
-  },
-  watch: {
-    isShow: function(val) {
-      if (val) {
-        this.getDef()
-      }
-    },
-  },
-  computed: {
-    reportStateStr () {
-      return arrToObj(this.$dictData.report_state)[this.pObj.report_state]
-    }
-  },
-  methods: {
-    getDef() {
-      let params = { ...this.curObj }
-      this.formData = [
-        { label: '新报备状态', key: 'report_state', rules: 1, type: 'select', options: this.$dictData.report_state },
-        { label: '报备时间', key: 'report_at', type: 'datePicker', type2: 'datetime', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
-        { label: '报备二维码', key: 'report_code', type: 'uploads' },
-        { label: '备注', key: 'remark', type: 'textarea' },
-      ]
-      this.setDefaultValue(params)
-    },
-    close(str) {
-      if (str === 'confirm') {
-        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
-          if (valid) {
-            const oldform = this.$refs.ruleForm.baseForm
-            const newForm = { ...oldform }
-            let apiStr = 'admreportstateadd'
-            if (this.pObj.id) {
-              newForm.id = this.pObj.id
-            }
-            this.$api.cust[apiStr](newForm).then(data => {
-              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
-              this.$emit('close', newForm)
-            })
-          }
-        })
-      } else {
-        this.$emit('close')
-        this.setDefaultValue()
-      }
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-.scoped-tips {
-  padding-bottom: 6px;
-  text-align: center;
-  .t {
-    font-size: 18px;
-    font-weight: bold;
-    color: #0c78b1;
-  }
-}
-</style>

+ 1 - 3
src/views/trade/components/searchForm/Index.vue

@@ -47,8 +47,6 @@ export default {
       this.$emit('change', newForm)
     },
     toExportExcel () {
-      this.$msgw('开发中')
-        return
       const oldform = this.$refs.ruleForm.baseForm
       const newForm = { ...oldform }
       if (newForm.startEndTime) {
@@ -60,7 +58,7 @@ export default {
         return
       }
       const token = window.sessionStorage.getItem('fp_token')
-      window.open(`https://api.fangpiaovip.com/adm/report/export?token=${encodeURIComponent(token)}&section=${newForm.section}&start_at=${newForm.start_at}&end_at=${newForm.end_at}&estate_id=${newForm.estate_id}&report_state=${newForm.report_state}&report_step=${newForm.report_step}&user_id=${newForm.user_id}`)
+      window.open(`https://api.fangpiaovip.com/adm/trade/export?token=${encodeURIComponent(token)}&start_at=${newForm.start_at}&end_at=${newForm.end_at}`)
     }
   }
 }

+ 2 - 1
src/views/trade/index.vue

@@ -85,8 +85,9 @@ export default {
         { label: '面积(㎡)', prop: 'area' },
         { label: '总价(万元)', prop: 'price' },
         { label: '创建时间', prop: 'create_at' },
-        { label: '操作', width: 150, type: 'handle2', operations:
+        { label: '操作', width: 200, type: 'handle2', operations:
           [
+            { label: '编辑', func: this.openPopup, btnType: 'success' },
             { label: '成交详情', func: this.openQPopup, btnType: 'primary' },
             { label: '删除', func: this.delHandle, btnType: 'danger' },
           ]