customerLog.vue 8.91 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
<template>
 <div :style="{padding:customerId ? '0px' : '20px'}">
   <el-card style="margin-bottom: 30px"  v-show="!customerId" :title="$t('客户操作日志')">
     <el-descriptions border :column="3">
       <el-descriptions-item :label="$t('订单编号')"><el-input :placeholder="$t('请输入订单编号')" v-model="queryForm.orderNo"></el-input></el-descriptions-item>
       <el-descriptions-item :label="$t('操作人')">
         <el-select filterable  v-model="queryForm.operator">
           <el-option v-for="(item) in allSimplList" :value="item.id" :label="item.nickname" :key="item.id"></el-option>
         </el-select>
       </el-descriptions-item>
       <el-descriptions-item :label="$t('老客户经理')">
         <el-select filterable  v-model="queryForm.oldCustomerService">
           <el-option v-for="(item) in customerServiceList" :value="item.id" :label="item.nickname" :key="item.id"></el-option>
         </el-select>
<!--         <el-input v-model="queryForm.oldCustomerService"></el-input>-->
       </el-descriptions-item>
<!--       <el-descriptions-item label="客户编号"><el-input :placeholder="$t('请输入客户编号')" v-model="queryForm.number"></el-input></el-descriptions-item>-->
       <el-descriptions-item :label="$t('新客户经理')">
         <el-select clearable filterable  v-model="queryForm.newCustomerService">
           <el-option v-for="(item) in customerServiceList" :value="item.id" :label="item.nickname" :key="item.id"></el-option>
         </el-select>
<!--         <el-input v-model="queryForm.newCustomerService"></el-input>-->
       </el-descriptions-item>
<!--       <el-descriptions-item label="客户名称"><el-input :placeholder="$t('请输入客户名称')" style="width: 45%;" v-model="queryForm.name"></el-input></el-descriptions-item>-->
       <el-descriptions-item :label="$t('操作类型')">
         <dict-selector  :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" v-model="queryForm.operateType">

         </dict-selector>
       </el-descriptions-item>
       <el-descriptions-item :label="$t('新的预计进入公海的时间')">
           <el-date-picker
          v-model="newEstimateEnterOpenSeaTimeArr"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
           range-separator="至"
           :start-placeholder="$t('开始日期')"
           :end-placeholder="$t('结束日期')"
           align="right">
         </el-date-picker>
       </el-descriptions-item>
       <el-descriptions-item :label="$t('老的预计进入公海的时间')">
         <el-date-picker
           v-model="newEstimateEnterOpenSeaTimeArr"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
           range-separator="至"
           :start-placeholder="$t('开始日期')"
           :end-placeholder="$t('结束日期')"
           align="right">
         </el-date-picker>
       </el-descriptions-item>
       <el-descriptions-item>
         <el-button @click="getList">{{$t('搜索')}}</el-button>
         <el-button @click="initialize();getList()">{{$t('重置')}}</el-button>
       </el-descriptions-item>
     </el-descriptions>
   </el-card>
   <el-table :data="list">
     <el-table-column :label="$t('订单编号')" prop="orderNo"></el-table-column>
     <el-table-column :label="$t('新客户经理')" prop="newCustomerService">
       <template v-slot="{row}">
         {{row.newCustomerService ? operatorFn(row.newCustomerService) : '/'}}
       </template>
     </el-table-column>
     <el-table-column :label="$t('老客户经理')" prop="oldCustomerService">
       <template v-slot="{row}">
         {{row.oldCustomerService ? operatorFn(row.oldCustomerService) : '/'}}
       </template>
     </el-table-column>
     <el-table-column :label="$t('操作类型')">
       <template v-slot="{row}">
         <dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="row.operateType"></dict-tag>
       </template>
     </el-table-column>
     <el-table-column :label="$t('操作人')" prop="operatorName">
     </el-table-column>
     <el-table-column :label="$t('操作时间')" prop="operator">
        <template v-slot="{row}">
          {{parseTime(row.createTime) || '/'}}
        </template>
     </el-table-column>
     <el-table-column :label="$t('新的预计入公海时间')">
       <template v-slot="{row}">
         {{parseTime(row.newEstimateEnterOpenSeaTime) || '/'}}
       </template>
     </el-table-column>
     <el-table-column :label="$t('老的预计入公海时间')" >
       <template v-slot="{row}">
         {{parseTime(row.oldEstimateEnterOpenSeaTime) || '/'}}
       </template>
     </el-table-column>
     <el-table-column :label="$t('备注')" prop="remark" >
     </el-table-column>
     <el-table-column  :label="$t('操作')">
       <template v-slot="{row}">
         <el-button type="text" @click="getCustomerLog(row.id)">
           {{$t('详情')}}
         </el-button>
       </template>
     </el-table-column>
   </el-table>
   <pagination v-show="total > 0" :total="total" :page.sync="queryForm.page" :limit.sync="queryForm.rows"
               @pagination="getList"/>
   <el-dialog :title="$t('客户日志')" :visible.sync="show">
     <el-form>
       <el-form-item :label="$t('订单编号')+':'">
         {{dataLog.orderNo ? dataLog.orderNo :'/'}}
       </el-form-item>
       <el-form-item :label="$t('新客户经理')+':'">
         {{dataLog.newCustomerService ? operatorFn(dataLog.newCustomerService) : '/'}}
       </el-form-item>
       <el-form-item :label="$t('老客户经理')+':'">
         {{dataLog.oldCustomerService ? operatorFn(dataLog.oldCustomerService) : '/'}}
       </el-form-item>
       <el-form-item :label="$t('操作类型')+':'">
         <dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="dataLog.operateType"></dict-tag>
       </el-form-item>
       <el-form-item :label="$t('操作人')+':'">
         {{dataLog.operatorName}}
       </el-form-item>
       <el-form-item :label="$t('操作时间')+':'">
         {{parseTime(dataLog.createTime)}}
       </el-form-item>
       <el-form-item :label="$t('新预计进入公海时间')+':'">
         {{parseTime(dataLog.newEstimateEnterOpenSeaTime) || '/'}}
       </el-form-item>
       <el-form-item :label="$t('老的预计进入公海时间')+':'">
         {{parseTime(dataLog.oldEstimateEnterOpenSeaTime) || '/'}}
       </el-form-item>
       <el-form-item :label="$t('备注')+':'">
         {{dataLog.remark}}
       </el-form-item>
     </el-form>
   </el-dialog>
 </div>
</template>

<script>
import {getCustomerOperatelog, getCustomerOperatelogPage} from "@/api/ecw/customer";
import {parseTime} from "../../../utils/ruoyi";
import Template from "@/views/cms/template/index.vue";
import {DICT_TYPE} from "@/utils/dict";
import {listAllSimpl, listServiceUser} from "@/api/system/user";
import {number} from "echarts/lib/export";
export default {
  name: "customerLog",
  props:{
    customerId:{
      type:[Number,String],
      default:null,
    }
  },
  computed: {
    DICT_TYPE() {
      return DICT_TYPE
    },
    operatorFn(){
      return (val)=>{
        return this.allSimplList.find(item => item.id == val)?.nickname || '/'
      }
    }
  },
  components: {Template},
  created() {
     this.initialize()
    this.getList()
    listAllSimpl().then(r => {
      this.allSimplList = r.data
    })
    listServiceUser().then(r=>{
      this.customerServiceList = r.data;
    })
    },
  data(){
    return {
      queryForm:{},
      newEstimateEnterOpenSeaTimeArr:[],
      oldEstimateEnterOpenSeaTimeArr:[],
      list:[],
      total:0,
      show:false,
      allSimplList:[],
      dataLog:{},
      customerServiceList:[],
    }
  },
  methods:{
    parseTime,
    initialize(){
      this.queryForm = {
        page:1,
        rows:10,
        name:null,
        oldCustomerService:null,
        newCustomerService:null,
        operateType:null,
        operator:null,
        orderNo:null,
        newEstimateEnterOpenSeaTime:null,
        beginNewEstimateEnterOpenSeaTime:null,
        beginOldEstimateEnterOpenSeaTime:null,
        endNewEstimateEnterOpenSeaTime:null,
        endOldEstimateEnterOpenSeaTime:null,
204 205 206 207
        memberCode: null,
        memberName: null,
        memberMobile: null,
        memberAreaCode: null,
lanbaoming's avatar
lanbaoming committed
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
        customerId:this.customerId
      }
    },
    getList(){
      this.queryForm.beginNewEstimateEnterOpenSeaTime = this.newEstimateEnterOpenSeaTimeArr[0] || ''
      this.queryForm.endNewEstimateEnterOpenSeaTime = this.newEstimateEnterOpenSeaTimeArr[1] || ''
      this.beginOldEstimateEnterOpenSeaTime = this.oldEstimateEnterOpenSeaTimeArr[0] || ''
      this.endOldEstimateEnterOpenSeaTime = this.oldEstimateEnterOpenSeaTimeArr[1] || ''
      getCustomerOperatelogPage(this.queryForm).then(r => {
         this.list = r.data.list;
         this.total = r.data.total;
      })
    },
    getCustomerLog(val){
      getCustomerOperatelog({id:val}).then(r =>{
       this.dataLog = r.data
        this.show = true;
      })
    }
  }
}
</script>

<style scoped>

</style>