<template>
  <div class="app-container">


    <div class = "search-bx"  >

      <div class="search">
        <el-row :gutter="0">

              <el-input v-model="tableObj.getdataListParm.parammaps.customerName" placeholder="客户名称" style="width: 180px;padding-bottom:10px;" class="filter-item" clearable />

              <el-select v-model="tableObj.getdataListParm.parammaps.groupId" placeholder="集团" class="filter-item" style="width: 120px;padding-bottom:10px;" clearable filterable>
                <el-option v-for="(item,index) in groupNameList" :key="index" :label="item.name" :value="item.id" />
              </el-select>

              <el-select v-model="tableObj.getdataListParm.parammaps.dealerId" placeholder="经销商" class="filter-item" style="width: 190px;padding-bottom:10px;" clearable filterable>
                <el-option v-for="(item,index) in dealNameList" :key="index" :label="item.dealerName" :value="item.dealerId" />
              </el-select>

              <el-select v-model="tableObj.getdataListParm.parammaps.rangeName" placeholder="客户区域" class="filter-item" style="width: 120px;" clearable filterable>
                <el-option v-for="(item,index) in rangeNameList" :key="index" :label="item.name" :value="item.id" />
              </el-select>

              <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />

              <el-select v-model="tableObj.getdataListParm.parammaps.customeStatusName" placeholder="客户状态" class="filter-item" style="width: 120px;" clearable>
                <el-option v-for="(item,index) in customeStatusList" :key="index" :label="item.name" :value="item.id" />
              </el-select>

              <el-select v-model="tableObj.getdataListParm.parammaps.customeLevelName" placeholder="客户等级" class="filter-item" style="width: 120px;" clearable>
                <el-option v-for="(item,index) in customeLevelList" :key="index" :label="item.name" :value="item.id" />
              </el-select>

              <el-select v-model="tableObj.getdataListParm.parammaps.directorId" placeholder="负责人" class="filter-item" style="width: 100px;" clearable filterable>
                <el-option v-for="(item,index) in directorNameList" :key="index" :label="item.name" :value="item.id" />
              </el-select>

              <el-select v-model="tableObj.getdataListParm.parammaps.createrId" placeholder="创建人" class="filter-item" style="width: 100px;" clearable filterable>
                <el-option v-for="(item,index) in createrNameList" :key="index" :label="item.name" :value="item.id" />
              </el-select>


              <el-button class="successBorder" @click="form_search">查询</el-button>
              <el-button class="successBorder" @click="form_clear">重置</el-button>

              <el-button v-if="isCustomerAdd" class="success" icon="el-icon-plus" @click="form_add">新增</el-button>
              <!--  <el-button  class="success" icon="el-icon-upload2" @click="form_export">导出</el-button> -->


        </el-row>
      </div>
      <!-- <div class="operation">
        <el-row :gutter="0">
          <el-col :span="21">
            <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="form_add">新增</el-button>
          </el-col>
          <el-col :span="3">

                <el-dropdown>
                <el-button class="export">导出</el-button>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item @click.native="form_export(1)">导出模板</el-dropdown-item>
                  <el-dropdown-item @click.native="form_export(2)">导出数据</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
          </el-col>
        </el-row>
      </div> -->

    </div>

    <div class="table" >
      <el-table :key="tableObj.tableKey" v-loading="tableObj.listLoading" element-loading-text="给我一点时间" :data="tableObj.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" :max-height="myHeight">
        <!-- <el-table-column type="selection" align="center" width="50" /> -->
        <el-table-column label="序号" align="center" type="index" width="50px" fixed="left">
          <template slot-scope="scope">
            <span>{{ scope.$index + (tableObj.pageNum-1) * tableObj.pageSize + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户名称" min-width="150px" align="center" fixed="left">

          <template slot-scope="scope">
            <span  style = "color:#409EFF; cursor: pointer;" @click="click_customer(scope.row)">{{ scope.row.customerName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户集团" min-width="110px" align="center" show-overflow-tooltip fixed="left">
          <template slot-scope="scope">
            <span>{{ scope.row.groupName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="曾用名" min-width="110px" align="center" show-overflow-tooltip fixed="left">
          <template slot-scope="scope">
            <span>{{ scope.row.customerUsedName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="经销商" min-width="110px" align="center" show-overflow-tooltip fixed="left">
          <template slot-scope="scope">
            <span>{{ scope.row.dealerNames }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户状态" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.customeStatusName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户等级" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.customeLevelName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户区域" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.rangeName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="省份" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.province }}</span>
          </template>
        </el-table-column>
        <el-table-column label="客户地址" min-width="190px" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.address }}</span>
          </template>
        </el-table-column>
        <el-table-column label="负责人" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.directorName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建人" min-width="110px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.createrName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" min-width="120px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.createtime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="备注" min-width="120px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            <span>{{ scope.row.remark }}</span>
          </template>
        </el-table-column>
        <el-table-column label="启用" min-width="80px" header-align="center" align="center">
          <template slot-scope="scope">
            <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="change_enable(scope.$index, scope.row)" />
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" :width="autoWidth"  fixed="right">
          <template slot-scope="{row}">
            <!-- <el-button v-if="isRoleEdit" class="miniSuccess" @click="form_edit(row)">编辑</el-button>
            <el-button v-if="isRoleEdit" class="miniDanger" @click="form_delete(row)">删除</el-button> -->
            <!-- <el-button class="miniPrimary" @click="form_see(row)">查看</el-button> -->
            <el-button v-if="isCustomerAdd" class="miniSuccess" @click="form_edit(row)">编辑</el-button>
           <el-button v-if="isCustomerDel" class="miniDanger" @click="form_delete(row)">删除</el-button>
            <el-button  class="miniPrimary" @click="handleService(row)">服务记录</el-button>
            <el-button v-if="isCustomerContract"  class="miniPrimary" @click="handleContact(row)">联系人管理</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="tableObj.total>=0" :total="tableObj.total" :page.sync="tableObj.getdataListParm.offset" :limit.sync="tableObj.getdataListParm.pagecount" @pagination="get_table_data" />
    </div>

    <!-- 新增/编辑 -->
    <el-dialog :title="textMap[create.dialogStatus]" :visible.sync="create.dialogFormVisible" :close-on-click-modal="false" width="40%">
      <div class="app-add">
        <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">

          <el-form-item label="客户名称：" prop="customerName">
            <el-input ref="customerName" v-model="create.temp.customerName" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" />
          </el-form-item>

          <el-form-item label="曾用名：" prop="customerUsedName">
            <el-input ref="customerUsedName" v-model="create.temp.customerUsedName" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" />
          </el-form-item>

          <el-form-item label="客户集团：" prop="groupId">
            <el-select v-model="create.temp.groupId" placeholder="请选择集团" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'">
              <el-option v-for="(item,index) in groupNameList" :key="index" :label="item.name" :value="item.id" />
            </el-select>
          </el-form-item>

          <el-form-item label="经销商：" prop="dealerIdsArr">
            <el-select v-model="create.temp.dealerIdsArr"  multiple placeholder="请选择经销商" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'" @change="change_deal">
              <el-option v-for="(item,index) in dealNameList" :key="index" :label="item.dealerName" :value="item.dealerId" />
            </el-select>
          </el-form-item>


          <!-- <el-form-item label="客户状态：" prop="customeStatusName">
            <el-select v-model="create.temp.customeStatusName" placeholder="请选择状态" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'">
              <el-option v-for="(item,index) in customeStatusList" :key="index" :label="item.name" :value="item.id" />
            </el-select>
          </el-form-item>
          <el-form-item label="客户等级：" prop="customeLevelName">
            <el-select v-model="create.temp.customeLevelName" placeholder="请选择等级" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'">
              <el-option v-for="(item,index) in customeLevelList" :key="index" :label="item.name" :value="item.id" />
            </el-select>
          </el-form-item> -->


          <el-form-item label="统一社会信用代码：" prop="scode">
            <el-input ref="scode" v-model="create.temp.scode" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" maxlength="18"/>
          </el-form-item>
          <el-form-item label="客户区域：" prop="rangeName">
            <el-select v-model="create.temp.rangeName" placeholder="请选择区域" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'">
              <el-option v-for="(item,index) in rangeNameList" :key="index" :label="item.name" :value="item.id" />
            </el-select>
          </el-form-item>
          <el-form-item label="客户省份：" prop="province">
            <el-input ref="province" v-model="create.temp.province" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" />
          </el-form-item>
          <el-form-item label="客户地址：" prop="address">
            <el-input ref="address" v-model="create.temp.address" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" />
          </el-form-item>

          <!-- <el-form-item label="负责人：" prop="directorId">
            <el-select v-model="create.temp.directorId" placeholder="请选择" class="filter-item" style="width: 100%;" clearable :disabled="create.dialogStatus=='see'">
              <el-option v-for="(item,index) in directorNameList" :key="index" :label="item.name" :value="item.id" />
            </el-select>
          </el-form-item> -->


          <el-form-item label="负责人：" prop="directorName">
            <el-input ref="directorName" v-model="create.temp.directorName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>


          <el-form-item label="创建人：" prop="createrName">
            <el-input ref="createrName" v-model="create.temp.createrName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>
          <el-form-item label="创建日期：" prop="createtime">
            <el-date-picker v-model="create.temp.createtime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" :disabled="create.dialogStatus=='see'" />

          </el-form-item>
          <el-form-item label="备注：" prop="remark">
            <el-input ref="remark" v-model="create.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="请输入备注，最多255个字" maxlength="255" class="filter-item" style="width: 100%;" :disabled="create.dialogStatus=='see'" />
          </el-form-item>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="create.dialogFormVisible = false;get_table_data()">关闭</el-button>
          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" :disabled="isokDisable" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save()">确认</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 服务记录 -->
    <el-dialog title="服务记录" :visible.sync="service.dialogFormVisible" :close-on-click-modal="false" width="80%">
      <div class="app-add">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="拜访记录" name="first">
            <div class="table">
              <el-table :key="servicetable1.tableKey" v-loading="servicetable1.listLoading" element-loading-text="给我一点时间" :data="servicetable1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable1.pageNum-1) * servicetable1.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="拜访日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.vdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="拜访人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.visiterName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="接待人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="接待人电话" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverTel }}</span>
                  </template>
                </el-table-column>


                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee1(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable1.total>=0" :total="servicetable1.total" :page.sync="servicetable1.getdataListParm.offset" :limit.sync="servicetable1.getdataListParm.pagecount" @pagination="getServiceTableList1" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="电话回访记录" name="second">
            <div class="table">
              <el-table :key="servicetable2.tableKey" v-loading="servicetable2.listLoading" element-loading-text="给我一点时间" :data="servicetable2.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable2.pageNum-1) * servicetable2.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="回访日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.tdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="回访人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.visiterName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="被回访人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="被回访人电话" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverTel }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="回访状态" min-width=" 90px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.statusName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee2(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable2.total>=0" :total="servicetable2.total" :page.sync="servicetable2.getdataListParm.offset" :limit.sync="servicetable2.getdataListParm.pagecount" @pagination="getServiceTableList2" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="快递接收记录" name="third">
            <div class="table">
              <el-table :key="servicetable3.tableKey" v-loading="servicetable3.listLoading" element-loading-text="给我一点时间" :data="servicetable3.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable3.pageNum-1) * servicetable3.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="接收日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.pdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="寄件人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.posterName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="寄件电话" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.posterTel }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="寄件单号" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.postCode }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee3(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable3.total>=0" :total="servicetable3.total" :page.sync="servicetable3.getdataListParm.offset" :limit.sync="servicetable3.getdataListParm.pagecount" @pagination="getServiceTableList3" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="备货记录" name="fourth">
            <div class="table">
              <el-table :key="servicetable4.tableKey" v-loading="servicetable4.listLoading" element-loading-text="给我一点时间" :data="servicetable4.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable4.pageNum-1) * servicetable4.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="下单日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.sdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="备货单号" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.stockupCode }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="备货日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.successDate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="备货人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.employeeName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee4(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable4.total>=0" :total="servicetable4.total" :page.sync="servicetable4.getdataListParm.offset" :limit.sync="servicetable4.getdataListParm.pagecount" @pagination="getServiceTableList4" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="发货记录" name="fifth">
            <div class="table">
              <el-table :key="servicetable4.tableKey" v-loading="servicetable5.listLoading" element-loading-text="给我一点时间" :data="servicetable5.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable5.pageNum-1) * servicetable5.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="发货单号" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.deliveryCode }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="发货日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.sendDate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="收件人姓名" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="收件人电话" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverTel }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee5(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable5.total>=0" :total="servicetable5.total" :page.sync="servicetable5.getdataListParm.offset" :limit.sync="servicetable5.getdataListParm.pagecount" @pagination="getServiceTableList5" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="远程服务记录" name="sixth">
            <div class="table">
              <el-table :key="servicetable6.tableKey" v-loading="servicetable6.listLoading" element-loading-text="给我一点时间" :data="servicetable6.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable6.pageNum-1) * servicetable6.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="服务日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.rdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="技术人员" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.employeeName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="客户对接人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.receiverName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee6(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable6.total>=0" :total="servicetable6.total" :page.sync="servicetable6.getdataListParm.offset" :limit.sync="servicetable6.getdataListParm.pagecount" @pagination="getServiceTableList6" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="现场服务记录" name="seventh">
            <div class="table">
              <el-table :key="servicetable7.tableKey" v-loading="servicetable7.listLoading" element-loading-text="给我一点时间" :data="servicetable7.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable7.pageNum-1) * servicetable7.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="服务单号" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.serviceCode }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="服务日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.serviceBeginDate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="服务人员" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.employeeName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="服务类型" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.serviceTypeName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee7(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable7.total>=0" :total="servicetable7.total" :page.sync="servicetable7.getdataListParm.offset" :limit.sync="servicetable7.getdataListParm.pagecount" @pagination="getServiceTableList7" />
            </div>
          </el-tab-pane>
          <el-tab-pane label="投诉记录" name="eightth">
            <div class="table">
              <el-table :key="servicetable8.tableKey" v-loading="servicetable8.listLoading" element-loading-text="给我一点时间" :data="servicetable8.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <!-- <el-table-column type="selection" align="center" width="50" /> -->
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + (servicetable8.pageNum-1) * servicetable8.pageSize + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="投诉日期" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.cdate }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="投诉人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.proposerName }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="投诉电话" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.telephone }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="被投诉人" min-width="110px" align="center" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <span>{{ scope.row.respondentName }}</span>
                  </template>
                </el-table-column>

                <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button class="miniPrimary" @click="handleServiceSee8(row)">查看</el-button>
                  </template>
                </el-table-column>

              </el-table>
              <pagination v-show="servicetable8.total>=0" :total="servicetable8.total" :page.sync="servicetable8.getdataListParm.offset" :limit.sync="servicetable8.getdataListParm.pagecount" @pagination="getServiceTableList8" />
            </div>
          </el-tab-pane>
        </el-tabs>

        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="service.dialogFormVisible = false;get_table_data()">关闭</el-button>
          <el-button class="success" @click="service.dialogFormVisible = false;get_table_data()">确认</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 联系人管理 -->
    <el-dialog title="联系人管理" :visible.sync="contact.dialogFormVisible" :close-on-click-modal="false" width="80%">
      <div class="app-add">
        <el-button v-if="isCustomerContract" class="success" @click="form_add2">新增</el-button>
        <div class="table">
          <el-form ref="form" :rules="contact.rules" :model="contact.temp" style="width: 80%;margin:0 auto 50px">
            <el-table :key="contact.tableKey" v-loading="contact.listLoading" element-loading-text="给我一点时间" :data="contact.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">

              <el-table-column label="序号" align="center" type="index" width="50px">
                <template slot-scope="scope">
                  <span>{{ scope.$index + (contact.pageNum-1) * contact.pageSize + 1 }}</span>
                </template>
              </el-table-column>

              <el-table-column label="联系人姓名" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.NoEdit">{{ scope.row.contactName }}</span>
                  <el-input v-if="scope.row.Edit" v-model="scope.row.contactName" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:80%;padding:10px 0;" maxlength="32" />
                </template>
              </el-table-column>
              <el-table-column label="联系人电话" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.NoEdit">{{ scope.row.telephone }}</span>
                  <el-input v-if="scope.row.Edit" v-model="scope.row.telephone" type="number"  oninput = "if(value.length > 11) value = value.slice(0,11)" style="width:80%;padding:10px 0;" />
                </template>
              </el-table-column>
              <el-table-column label="收货地址" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.NoEdit">{{ scope.row.address }}</span>
                  <el-input v-if="scope.row.Edit" v-model="scope.row.address" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
                </template>
              </el-table-column>
              <el-table-column label="备注" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.NoEdit">{{ scope.row.remark }}</span>
                  <el-input v-if="scope.row.Edit" v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
                </template>
              </el-table-column>

              <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
                <template slot-scope="{row}">
                  <!-- 新增 -->
                  <el-button v-if="row.isCreate && isCustomerContract" class="miniSuccess" @click="add_dialog_save2(row)">保存</el-button>
                  <el-button v-if="row.isCreate && isCustomerContract" class="minCancel" @click="add_cancel2(row)">取消</el-button>
                  <!-- 编辑 -->
                  <el-button v-if="row.isUpdate && isCustomerContract" class="miniSuccess" @click="form_edit2(row)">编辑</el-button>
                  <el-button v-if="row.isUpdate && isCustomerContract" class="miniDanger" @click="form_delete2(row)">删除</el-button>

                  <!-- 编辑保存  -->
                  <el-button v-if="row.isUpdateSave && isCustomerContract" class="miniSuccess" @click="form_edit_save2(row)">保存</el-button>
                  <el-button v-if="row.isUpdateSave && isCustomerContract" class="minCancel" @click="edit_cancel2(row)">取消</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-form>
          <pagination v-show="contact.total>=0" :total="contact.total" :page.sync="contact.getdataListParm.offset" :limit.sync="contact.getdataListParm.pagecount" @pagination="get_table_data2" />

        </div>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="contact.dialogFormVisible = false;get_table_data()">关闭</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 拜访记录 -->
    <el-dialog title="拜访记录" :visible.sync="createSee1.dialogFormVisible" :close-on-click-modal="false" width="40%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee1.rules" :model="createSee1.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">

          <el-form-item label="客户名称：" prop="customerId">
            <el-input ref="customerName" v-model="createSee1.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="集团：" prop="groupName">
            <el-input ref="groupName" v-model="createSee1.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="拜访日期：" prop="vdate">
            <el-input ref="vdate" v-model="createSee1.temp.vdate" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="拜访人：" prop="visiterName">
            <el-input ref="vdate" v-model="createSee1.temp.visiterName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="接待人：" prop="visiterId">
            <el-input ref="vdate" v-model="createSee1.temp.receiverName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="接待人电话：" prop="receiverTel">
            <el-input ref="receiverTel" v-model="createSee1.temp.receiverTel" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="现场照片：" prop="vPhoto1">
            <el-upload id="uploadPic" list-type="picture-card" :class="{hide:hideUpload}" :action="uploadImageUrl" :limit='9' :headers="headers" :file-list="fileList" :on-preview="handlePicPreview" :auto-upload="true" :on-change="(file,fileList)=>{ return handlePicChange(file, fileList) }" :on-success="(response,file, fileList)=>{ return handlePicSuccess(response,file, fileList) }" :on-remove="(file, fileList)=>{ return handlePicRemove(file, fileList) }">
              <i slot="default" class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="dialogVisible" append-to-body width="40%">
              <img width="80%" :src="dialogImageUrl" alt="">
            </el-dialog>
          </el-form-item>

          <el-form-item label="定位：" prop="location">
            <el-input ref="location" v-model="createSee1.temp.location" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="情况说明：" prop="content">
            <el-input ref="content" v-model="createSee1.temp.content" type="textarea" maxlength="255" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="下一步计划：" prop="nextId">
            <el-input ref="nextName" v-model="createSee1.temp.nextName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="备注：" prop="remark">
            <el-input ref="remark" v-model="createSee1.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee1.dialogFormVisible = false">关闭</el-button>

        </div>
      </div>
    </el-dialog>

    <!-- 电话回访 -->
    <el-dialog title="电话回访" :visible.sync="createSee2.dialogFormVisible" :close-on-click-modal="false" width="40%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee2.rules" :model="createSee2.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-form-item label="客户名称：" prop="customerName">
            <el-input ref="customerName" v-model="createSee2.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="集团：" prop="groupName">
            <el-input ref="groupName" v-model="createSee2.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="回访日期：" prop="tdate">
            <el-input ref="tdate" v-model="createSee2.temp.tdate" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="回访人：" prop="visiterId">
            <el-input ref="visiterName" v-model="createSee2.temp.visiterName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="被回访人：" prop="receiverId">
            <el-input ref="receiverName" v-model="createSee2.temp.receiverName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="被回访人电话：" prop="receiverTel">
            <el-input ref="receiverTel" v-model="createSee2.temp.receiverTel" class="filter-item" style="width: 100%;" maxlength="11" disabled />
          </el-form-item>

          <el-form-item label="回访类型：" prop="typeIds">

            <el-checkbox-group v-model="createSee2.temp.typeIdsArr">
              <el-checkbox v-for="(item,index) in typeNameList" :key="index" :label="item.id">{{ item.name }}</el-checkbox>
            </el-checkbox-group>
          </el-form-item>

          <el-form-item label="回访状态：" prop="statusName">
            <el-radio v-model="createSee2.temp.statusName" label="良好" disabled>良好</el-radio>
            <el-radio v-model="createSee2.temp.statusName" label="不佳" disabled>不佳</el-radio>
          </el-form-item>

          <el-form-item label="回访情况：" prop="content">
            <el-input ref="content" v-model="createSee2.temp.content" type="textarea" placeholder="请输入情况说明" maxlength="255" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="下一步计划：" prop="nextId">
            <el-input ref="nextName" v-model="createSee2.temp.nextName" class="filter-item" style="width: 100%;" maxlength="11" disabled />
          </el-form-item>

          <el-form-item label="备注：" prop="remark">
            <el-input ref="remark" v-model="createSee2.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee2.dialogFormVisible = false;get_table_data()">关闭</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 快递接收 -->
    <el-dialog title="快递接收" :visible.sync="createSee3.dialogFormVisible" :close-on-click-modal="false" width="80%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee3.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="客户名称：" prop="customerName">
                <el-input ref="customerName" v-model="createSee3.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="集团：" prop="groupName">
                <el-input ref="groupName" v-model="createSee3.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="接收日期：" prop="pdate">
                <el-date-picker v-model="createSee3.temp.pdate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" :clearable="false" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="寄件人：" prop="posterId">
                <el-input ref="posterId" v-model="createSee3.temp.posterId" class="filter-item" style="width: 100%;" disabled/>

              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="寄件电话：" prop="posterTel">
                <el-input ref="posterTel" v-model="createSee3.temp.posterTel" class="filter-item" style="width: 100%;" maxlength="11" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="寄件单号：" prop="postCode">
                <el-input ref="postCode" v-model="createSee3.temp.postCode" class="filter-item" style="width: 100%;" maxlength="30" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="寄件原因：" prop="reason">
                <el-input ref="reason" v-model="createSee3.temp.reason" class="filter-item" style="width: 100%;" maxlength="11" disabled />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="处理方式：" prop="handletypeId">
                <el-input ref="customerName" v-model="createSee3.temp.handletypeId" class="filter-item" style="width: 100%;" disabled/>

              </el-form-item>

            </el-col>
          </el-row>

          <el-row>
            <el-form-item label="备注：" prop="remark">
              <el-input ref="remark" v-model="createSee3.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" class="filter-item" style="width: 100%;" disabled/>
            </el-form-item>
          </el-row>

          <el-row>
            <el-form-item label="添加收货物品：" prop="visiterId">
              <el-select ref="visiterId" v-model="createSee3.temp.visiterId" filterable placeholder="请选择收货物品" class="filter-item" style="width: 100%;" disabled>
                <el-option v-for="(item,index) in receProductNameList" :key="index" :label='"货品名称："+ item.pname + " 型号：" + item.model + " 规格：" + item.Specifications' :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <el-row>
            <el-table :key="createSee3contact.tableKey" v-loading="createSee3contact.listLoading" element-loading-text="给我一点时间" :data="createSee3contact.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">

              <el-table-column label="序号" align="center" type="index" width="50px">
                <template slot-scope="scope">
                  <span>{{ scope.$index + 1 }}</span>
                </template>
              </el-table-column>

              <el-table-column label="货品名称" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.pname }}</span>
                </template>
              </el-table-column>
              <el-table-column label="型号" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.model }}</span>
                </template>
              </el-table-column>
              <el-table-column label="规格" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.Specifications }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>
                </template>
              </el-table-column>

              <el-table-column label="备注" min-width="280px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.remark }}</span>

                </template>
              </el-table-column>

            </el-table>
          </el-row>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee3.dialogFormVisible = false;get_table_data()">关闭</el-button>
        </div>
      </div>
    </el-dialog>

    <!--- 备货通知 -->
    <el-dialog title="备货通知" :visible.sync="createSee4.dialogFormVisible" :close-on-click-modal="false" width="60%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee4.rules" :model="createSee4.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="客户名称：" prop="customerName">
                <el-input ref="customerName" v-model="createSee4.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="集团：" prop="groupName">
                <el-input ref="groupName" v-model="createSee4.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="下单日期：" prop="sdate">
                <el-date-picker v-model="createSee4.temp.sdate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="备货原因：" prop="reasonName">
                <el-input ref="reasonName" v-model="createSee4.temp.reasonName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>

            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="订单来源：" prop="sourceName">
                <el-input ref="sourceName" v-model="createSee4.temp.sourceName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="备注：" prop="remark">
                <el-input ref="remark" v-model="createSee4.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" class="filter-item" style="width: 100%;" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="备货状态：" prop="statusName">
                <el-input ref="statusName" v-model="createSee4.temp.statusName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="录入日期：" prop="created">
                <el-input ref="created" v-model="createSee4.temp.created" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="备货人：" prop="employeeName">
                <el-input ref="employeeName" v-model="createSee4.temp.employeeName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="备货日期：" prop="successDate">
                <el-input ref="successDate" v-model="createSee4.temp.successDate" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-form-item label="关联接收快递：" prop="postalId">
              <el-select ref="postalId" v-model="createSee4.temp.postalId" filterable placeholder="请选择接收快递" class="filter-item" style="width: 100%;" disabled clearable>
                <el-option v-for="(item,index) in createSee4.postalNameList" :key="index" :label='item.name' :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <el-row>
            <el-table :key="createSee4contact.tableKey" v-loading="createSee4contact.listLoading" element-loading-text="给我一点时间" :data="createSee4contact.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">

              <el-table-column label="序号" align="center" type="index" width="50px">
                <template slot-scope="scope">
                  <span>{{ scope.$index + 1 }}</span>
                </template>
              </el-table-column>

              <el-table-column label="货品名称" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.pname }}</span>
                </template>
              </el-table-column>
              <el-table-column label="型号" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.model }}</span>
                </template>
              </el-table-column>
              <el-table-column label="规格" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.Specifications }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" min-width="110px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>

                </template>
              </el-table-column>

              <el-table-column label="备注" min-width="280px" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.remark }}</span>

                </template>
              </el-table-column>

            </el-table>
          </el-row>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee4.dialogFormVisible = false;get_table_data()">关闭</el-button>

        </div>
      </div>
    </el-dialog>

    <!-- 发货记录 -->
    <el-dialog title="发货记录" :visible.sync="createSee5.dialogFormVisible" :close-on-click-modal="false" width="60%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee5.rules" :model="createSee5.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="客户名称：" prop="customerName">
                <el-input ref="customerName" v-model="createSee5.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="集团：" prop="groupName">
                <el-input ref="groupName" v-model="createSee5.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="收件人姓名：" prop="receiverName">
                <el-input ref="receiverName" v-model="createSee5.temp.receiverName" class="filter-item" style="width: 100%;" disabled/>

              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="收件人电话：" prop="receiverTel">
                <el-input ref="receiverTel" v-model="createSee5.temp.receiverTel" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="快递名称：" prop="postName">
                <el-input ref="postName" v-model="createSee5.temp.postName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="快递单号：" prop="postCode">
                <el-input ref="postCode" v-model="createSee5.temp.postCode" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="发货日期：" prop="sendDate">
                <el-input ref="sendDate" v-model="createSee5.temp.sendDate" class="filter-item" style="width: 100%;" disabled/>

              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="备注：" prop="remark">
                <el-input ref="remark" v-model="createSee5.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="255" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-form-item label="发货详情：" prop="stockupId">
              <el-select ref="stockupId" v-model="createSee5.temp.stockupId" filterable class="filter-item" style="width: 100%;" disabled>
                <el-option v-for="(item,index) in create.postalNameList" :key="index" :label='item.name' :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <div v-for="(item, index) in createSee5tableArrList">
            <el-row>
              <!-- <el-divider></el-divider> -->
              备货单号：{{ item.title}} 备货人：{{ item.name}} 备货日期：{{ item.date}}
            </el-row>
            <el-row>
              <el-table :key="item.tableKey" :data="item.tablelist" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="货品名称" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.pname }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="型号" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.model }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="规格" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.Specifications }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="数量" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.nums }}</span>

                  </template>
                </el-table-column>

                <el-table-column label="备注" min-width="280px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.remark }}</span>
                  </template>
                </el-table-column>

              </el-table>
            </el-row>

          </div>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee5.dialogFormVisible = false;get_table_data()">关闭</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 远程服务 -->
    <el-dialog title="远程服务" :visible.sync="createSee6.dialogFormVisible" :close-on-click-modal="false" width="70%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee6.rules" :model="createSee6.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-form-item label="客户名称：" prop="customerName">
            <el-input ref="customerName" v-model="createSee6.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="集团：" prop="groupName">
            <el-input ref="groupName" v-model="createSee6.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="服务日期：" prop="rdate">
            <el-input ref="rdate" v-model="createSee6.temp.rdate" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="技术人员：" prop="employeeName">
            <el-input ref="employeeName" v-model="createSee6.temp.employeeName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="客户对接人：" prop="receiverName">
            <el-input ref="receiverName" v-model="createSee6.temp.receiverName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="服务内容：" prop="content">
            <el-input ref="content" v-model="createSee6.temp.content" type="textarea" placeholder="请输入服务内容" maxlength="255" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="拜访记录关联：" prop="visitName">
            <el-input ref="visitName" v-model="createSee6.temp.visitName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="回访记录关联：" prop="telvisitName">
            <el-input ref="telvisitName" v-model="createSee6.temp.telvisitName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>

          <el-form-item label="备注：" prop="remark">
            <el-input ref="remark" v-model="createSee6.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="请输入备注，最多255个字" maxlength="255" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee6.dialogFormVisible = false;get_table_data()">关闭</el-button>

        </div>
      </div>
    </el-dialog>

    <!-- 现场服务 -->
    <el-dialog title="现场服务" :visible.sync="createSee7.dialogFormVisible" :close-on-click-modal="false" width="80%">
      <div class="app-add">
        <el-form ref="temp" :rules="createSee7.rules" :model="createSee7.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="客户名称：" prop="customerName">
                <el-input ref="customerName" v-model="createSee7.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="集团：" prop="groupName">
                <el-input ref="groupName" v-model="createSee7.temp.groupName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>

            <el-col :span="12">
              <el-form-item label="服务单号：" prop="serviceCode">
                <el-input ref="serviceCode" v-model="createSee7.temp.serviceCode" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="服务日期：" prop="serviceDate">
                <el-input ref="serviceDate" v-model="createSee7.temp.serviceDate" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="服务人员：" prop="employeeName">
                <el-input ref="employeeName" v-model="createSee7.temp.employeeName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="服务类型：" prop="servicetypeName">
                <el-input ref="servicetypeName" v-model="createSee7.temp.servicetypeName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="接待人：" prop="receiverName">
                <el-input ref="receiverName" v-model="createSee7.temp.receiverName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接待人电话：" prop="receiverTel">
                <el-input ref="receiverTel" v-model="createSee7.temp.receiverTel" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>

            <el-col :span="24">
              <el-form-item label="服务结果：" prop="serviceResult">
                <el-input ref="serviceResult" v-model="createSee7.temp.serviceResult" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="拜访记录关联：" prop="visitName">
                <el-input ref="visitName" v-model="createSee7.temp.visitName" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="回访记录关联：" prop="telvisitId">
                <el-select ref="telvisitId" v-model="createSee7.temp.telvisitId" filterable placeholder="请选回访记录关联 " class="filter-item" style="width: 100%;" disabled>
                  <el-option v-for="(item,index) in createSee7.telvisitNameList" :key="index" :label="item.name" :value="item.id" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="12">
              <el-form-item label="备注：" prop="remark">
                <el-input ref="grouremarkpName" v-model="createSee7.temp.remark" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="定位：" prop="location">
                <el-input ref="location" v-model="create.temp.location" class="filter-item" style="width: 100%;" disabled />
              </el-form-item>
            </el-col>
          </el-row>


          <el-row>
           <el-col :span="24">
              <el-form-item label="服务描述：" prop="describe">
                <el-input ref="describe" v-model="createSee7.temp.describe" class="filter-item" style="width: 100%;" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>

                 <el-form-item label="现场照片：" prop="scenePhoto1">

                   <div style = "display:inline-block;margin-right:10px;" v-for="(item,index) in fileList"  >
                       <el-image
                         style="width: 150px; height: 150px;display:inline-block"
                         :src="item.url" @click="handlePicPreview(item)"></el-image>
                   </div>


                   <el-dialog :visible.sync="dialogVisible" append-to-body width="40%">
                     <img width="80%" :src="dialogImageUrl" alt="">
                   </el-dialog>
                 </el-form-item>

             </el-row>

             <el-row>

                 <el-form-item label="服务单照片：" prop="serviceCodePhoto">
                   <div style = "display:inline-block;margin-right:10px;" v-for="(item,index) in fileList2"  >
                       <el-image
                         style="width: 150px; height: 150px;display:inline-block"
                         :src="item.url" @click="handlePicPreview2(item)"></el-image>
                   </div>
                   <el-dialog :visible.sync="dialogVisible2" append-to-body width="40%">
                     <img width="100%" :src="dialogImageUrl2" alt="">
                   </el-dialog>
                 </el-form-item>

             </el-row>


          <!-- <el-row>
            <el-col :span="12">
              <el-form-item label="现场照片：" prop="scenePhoto1">
                <el-upload id="uploadPic1" list-type="picture-card" :class="{hide:hideUpload}" :action="uploadImageUrl" :limit='9' :headers="headers" :file-list="fileList" :on-preview="handlePicPreview" :auto-upload="true" :on-change="(file,fileList)=>{ return handlePicChange(file, fileList) }" :on-success="(response,file, fileList)=>{ return handlePicSuccess(response,file, fileList) }" :on-remove="(file, fileList)=>{ return handlePicRemove(file, fileList) }">
                  <i slot="default" class="el-icon-plus"></i>
                </el-upload>
                <el-dialog :visible.sync="dialogVisible" append-to-body width="40%">
                  <img width="80%" :src="dialogImageUrl" alt="">
                </el-dialog>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="服务单照片：" prop="serviceCodePhoto">
                <el-upload id="uploadPic2" list-type="picture-card" :class="{hide:hideUpload}" :action="uploadImageUrl" :limit='1' :headers="headers" :file-list="fileList2" :on-preview="handlePicPreview2" :auto-upload="true" :on-change="(file,fileList)=>{ return handlePicChange2(file, fileList) }" :on-success="(response,file, fileList)=>{ return handlePicSuccess2(response,file, fileList) }" :on-remove="(file, fileList)=>{ return handlePicRemove2(file, fileList) }">
                  <i slot="default" class="el-icon-plus"></i>

                </el-upload>
                <el-dialog :visible.sync="dialogVisible2">
                  <img width="100%" :src="dialogImageUrl2" alt="">
                </el-dialog>
              </el-form-item>
            </el-col>
          </el-row> -->

          <el-row>
            <el-form-item label="备货关联：" prop="stockupId">
              <el-select ref="stockupId" v-model="createSee7.temp.stockupId" filterable placeholder="请选择备货关联" class="filter-item" style="width: 100%;" disabled>
                <el-option v-for="(item,index) in createSee7.postalNameList" :key="index" :label='item.name' :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <div v-for="(item, index) in createSee7tableArrList" :key="index">
            <el-row>
              <el-divider></el-divider>
              备货单号：{{ item.title}}
            </el-row>
            <el-row>
              <el-table :key="item.tableKey" :data="item.tablelist" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
                <el-table-column label="序号" align="center" type="index" width="50px">
                  <template slot-scope="scope">
                    <span>{{ scope.$index + 1 }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="货品名称" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.pname }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="型号" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.model }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="规格" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span>{{ scope.row.Specifications }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="数量" min-width="110px" align="center">
                  <template slot-scope="scope">
                    <span v-if="create.dialogStatus == 'see'">{{ scope.row.nums }}</span>
                    <el-input v-if="create.dialogStatus == 'update' ||  create.dialogStatus == 'create' " v-model="scope.row.nums" style="width:95%;padding:10px 0;" />
                  </template>
                </el-table-column>

                <el-table-column label="备注" min-width="280px" align="center">
                  <template slot-scope="scope">
                    <span v-if="create.dialogStatus == 'see'">{{ scope.row.remark }}</span>
                    <el-input v-if="create.dialogStatus == 'update' ||  create.dialogStatus == 'create' " v-model="scope.row.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
                  </template>
                </el-table-column>
                <el-table-column v-if="create.dialogStatus == 'update' ||  create.dialogStatus == 'create' " label="操作" align="center" width="110" class-name="small-padding fixed-width" fixed="right">
                  <template slot-scope="{row}">
                    <el-button v-if="create.dialogStatus == 'update' ||  create.dialogStatus == 'create' " class="miniDanger" @click="form_delete2(row,index)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </el-row>

          </div>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee7.dialogFormVisible = false;get_table_data()">关闭</el-button>
        </div>
      </div>
    </el-dialog>

    <!-- 投诉处理 -->
    <el-dialog title="投诉处理" :visible.sync="createSee8.dialogFormVisible" :close-on-click-modal="false" width="40%">
      <div class="app-add">
        <el-form ref="createTemp" :rules="createSee8.rules" :model="createSee8.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
          <el-form-item label="客户名称：" prop="customerName">
            <el-input ref="customerName" v-model="createSee8.temp.customerName" class="filter-item" style="width: 100%;" disabled/>
          </el-form-item>
          <el-form-item label="集团：" prop="groupName">
            <el-input ref="groupName" v-model="createSee8.temp.groupName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="投诉日期：" prop="cdate">
            <el-input ref="cdate" v-model="createSee8.temp.cdate" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="投诉人：" prop="proposerName">
            <el-input ref="proposerName" v-model="createSee8.temp.proposerName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="投诉人电话：" prop="telephone">
            <el-input ref="telephone" v-model="createSee8.temp.telephone" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="投诉接收人：" prop="receiverName">
            <el-input ref="receiverName" v-model="createSee8.temp.receiverName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-form-item label="被投诉人：" prop="respondentName">
            <el-input ref="respondentName" v-model="createSee8.temp.respondentName" class="filter-item" style="width: 100%;" disabled />
          </el-form-item>

          <el-row>
            <el-form-item label="投诉内容：" prop="content">
              <el-input ref="content" v-model="createSee8.temp.content" type="textarea" placeholder="请输入情况说明" maxlength="255" class="filter-item" style="width: 100%;" disabled />
            </el-form-item>
          </el-row>

          <el-row>
            <el-form-item label="备注：" prop="remark">
              <el-input ref="remark" v-model="createSee8.temp.remark" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" placeholder="请输入备注，最多255个字" maxlength="255" class="filter-item" style="width: 100%;" disabled/>
            </el-form-item>
          </el-row>

        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="createSee8.dialogFormVisible = false;get_table_data()">关闭</el-button>

        </div>
      </div>
    </el-dialog>

    <!-- 客户详情 -->
    <el-dialog  title="客户详情" :visible.sync="seeCustomer.dialogFormVisible" top="10px"  :close-on-click-modal="false" width="95%">
      <div class="app-add">
        <CustomerDetail :customer-data="customerData"  />

        <div slot="footer" class="dialog-footer">
          <el-button class="cancelClose" @click="seeCustomer.dialogFormVisible = false;get_table_data()">关闭</el-button>

        </div>
      </div>
    </el-dialog>


  </div>
</template>

<script>
import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth} from '@/api/common'
import Cookies from 'js-cookie'
import { parseTime , json2excel} from '@/utils/index.js'
import Pagination from '@/components/Pagination'
import { MessageBox } from 'element-ui'
import { getToken } from '@/utils/auth'


import CustomerDetail from '@/componentView/CustomerDetail.vue'
import { constants } from 'zlib';

export default {
  name: 'CustomerInformation',
  components: { Pagination , CustomerDetail},
  data() {
    return {
      myHeight:document.documentElement.clientHeight - 85 - 160,
      hideUpload: false,

      isRoleEdit: [], isCustomerAdd: [], CustomerSet: [], isCustomerDel: [],isCustomerContract: [],


      restaurants: [],
      state: '',
      timeout: null,

      autoWidth:200,


      // 客户名称 - 下拉框
      customerNameList: [
        // {id: 1425, name: "测试12"},
        // {id: 1423, name: "朝日牧场（唯品牧场）"},
        // {id: 1422, name: "富源牧业（眉山）有限公司（眉山富源）"}
      ],
      loading: false,

      //集团 - 下拉框
      groupNameList: [
        // {id: 253, name: "无"},
        // {id: 207, name: "星连星牧业"},
        // {id: 208, name: "海高牧业"},
        // {id: 254, name: "完达山"}
      ],

      //经销商 - 下拉框
      dealNameList: [
        // {id: 253, name: "无"},
        // {id: 207, name: "星连星牧业"},
        // {id: 208, name: "海高牧业"},
        // {id: 254, name: "完达山"}
      ],
      //客户区域 - 下拉框
      rangeNameList: [
        {id: "华北区域", name: "华北区域"},
        {id: "东北区域", name: "东北区域"},
        {id: "西北区域", name: "西北区域"},
        {id: "南方大区", name: "南方大区"}
       ],

      //客户状态 - 下拉框
      customeStatusList: [
        {id: "普通客户", name: "普通客户"},
        {id:  "欠款客户", name: "欠款客户"},
         {id: "准客户", name: "准客户"}
      ],

      //客户等级 - 下拉框
      customeLevelList:[
        {"id":"1级","name":"1级"},
        {"id":"2级","name":"2级"},
        {"id":"3级","name":"3级"},
      ],
      //负责人 - 下拉框
      directorNameList: [
        // {id: 18, name: "韩佳佳"},
        // {id: 19, name: "多秋阳"},
        // {id: 20, name: "张明星"},
      ],
      //创建人 - 下拉框
      createrNameList: [
        // {id: 3072707379235128300, name: "管理员"},
        // {id: 3248184121834865700, name: "杨文山"}
      ],
      typeNameList: [],

      //表格 - 列表 - 查询
      tableObj: {
        getdataListParm: {
          name: 'getCustomer',
          page: 1,
          offset: 1,
          pagecount: parseInt(Cookies.get('pagecount')),
          returntype: 'Map',
          parammaps: {
            roleId: Cookies.get('g_roleId'),
            userId: Cookies.get('g_userId'),
            customerName: '',
            customerId: '',
            groupId: '',
            rangeName: '',
            customeStatusName: '',
            customeLevelName: '',
            createrId: '',
            directorId: '',
            dealerId: '',

            inputDatetime: '',
            beginDate: '',
            endDate: '',
          }
        },
        tableKey: 0,
        list: [
          // {"address":"1","createrId":"3072707379235128328","createrName":"管理员","createtime":"2022-05-11","customeLevelName":"2级","customeStatusName":"欠款客户","customerName":"测试12","directorId":24,"directorName":"康亮","enable":1,"groupId":207,"groupName":"星连星牧业","id":1425,"province":"1","rangeName":"西北区域","remark":"","scode":"123456789012345678","sort":1},
          // {"address":"山东省烟台市莱阳市沐浴店镇朝日绿源农业园","createrId":"3248184121834865668","createrName":"高占永","createtime":"2022-05-10","customeStatusId":199,"customeStatusName":"普通客户","customerName":"朝日牧场（唯品牧场）","directorId":30,"directorName":"高占永","enable":1,"groupId":253,"groupName":"无","id":1423,"province":"山东省","rangeId":"202","rangeName":"华北区域","remark":"","scode":"******************","sort":2},
          // {"address":"四川省眉山市青神县西龙镇万沟村4组","createrId":"3248184121834865668","createrName":"高占永","createtime":"2022-05-10","customeStatusId":199,"customeStatusName":"普通客户","customerName":"富源牧业（眉山）有限公司（眉山富源）","directorId":30,"directorName":"高占永","enable":1,"groupId":210,"groupName":"富源牧业","id":1422,"province":"四川省","rangeId":"205","rangeName":"南方大区","remark":"","scode":"******************","sort":3},
          // {"address":"","createrId":"3248184121834865667","createrName":"杨文山","createtime":"2022-05-06","customeStatusId":199,"customeStatusName":"普通客户","customerName":"科元克隆牧场","directorId":22,"directorName":"杨文山","enable":1,"groupId":253,"groupName":"无","id":1421,"province":"","rangeId":"","remark":"","scode":"123456789987654321","sort":4},

        ],
        total: 0,
        listLoading: true,
        temp: {}
      },


      download: {
        getdataListParm: {
          name: 'getCustomer',
          page: 1,
          offset: 1,
          pagecount: 0,
          returntype: 'Map',
          parammaps: {
            roleId: Cookies.get('g_roleId'),
            userId: Cookies.get('g_userId'),
            customerName: '',
            customerId: '',
            groupId: '',
            rangeName: '',
            customeStatusName: '',
            customeLevelName: '',
            createrId: '',
            directorId: '',
            inputDatetime: '',
            beginDate: '',
            endDate: '',
          }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },

      //客户资料详情组件
      customerData:{ id:"" },

      dialogImageUrl: '',
      //图片请求地址
      uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
      //图片请求头
      headers: {
        optname: 'insertcustompic',
        id: 1,
        token: getToken() // 从cookie里获取token，并赋值token
      },
      //图片路径
      fileList: [],
      receProductNameList: [],
      createSee7tableArrList: [],

      // 新增/编辑
      createSee1: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: {          customerId: '', groupId: '', groupName: '', vdate: parseTime(new Date(), '{y}-{m}-{d}'), visiterId: '', receiverId: '', receiverName: '', receiverTel: '', remark: '', content: '', nextId: '', modifyName: 'add', receiverChoose: 'true', vPhoto1: -1, vPhoto2: -1, vPhoto3: -1, vPhoto4: -1, vPhoto5: -1, vPhoto6: -1, vPhoto7: -1, vPhoto8: -1, vPhoto9: -1,
          picname1: '', picname2: '', picname3: '', picname4: '', picname5: '', picname6: '', picname7: '', picname8: '', picname9: '', location: ""        },
        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          vdate: [{ required: true, message: '必填', trigger: 'blur' }],
          visiterId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverTel: [{ required: true, message: '必填', trigger: 'blur' }],
          content: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
          vPhoto1: [{ required: true, message: '必填', trigger: 'blur' }],
        },
        // 接待人
        getdataListParm0: {
          name: 'getContacts',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        receiverNameList: [], // 接待人
        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 接待人电话
        getdataListParm3: {
          name: 'getTelById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },

      },
      createSee2: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', tdate: parseTime(new Date(), '{y}-{m}-{d}'), visiterId: '', receiverId: '', receiverName: '', receiverTel: '', typeIds: '', typeIdsArr: [], statusName: '良好', remark: '', content: '', nextId: '', modifyName: 'add', receiverChoose: 'true' },
        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          tdate: [{ required: true, message: '必填', trigger: 'blur' }],
          visiterId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverTel: [{ required: true, message: '必填', trigger: 'blur' }],
          typeIds: [{ required: true, message: '必填', trigger: 'blur' }],
          statusName: [{ required: true, message: '必填', trigger: 'blur' }],
          content: [{ required: true, message: '必填', trigger: 'blur' }],


        },
        // 接待人
        getdataListParm: {
          name: 'getContacts',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        // 接待人
        getdataListParm2: {
          name: 'getgroupNameById',
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 接待人电话
        getdataListParm3: {
          name: 'getTelById',
          returntype: 'Map',
          parammaps: { id: "" }
        },
        receiverNameList: [] // 接待人
      },

      createSee3: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', pdate: parseTime(new Date(), '{y}-{m}-{d}'), posterId: '', posterName: '', posterTel: '', postCode: '', reason: '', handletypeId: '', remark: '', id: '', modifyName: 'add', receiverChoose: 'true' },

        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          pdate: [{ required: true, message: '必填', trigger: 'blur' }],
          posterId: [{ required: true, message: '必填', trigger: 'blur' }],
          posterTel: [{ required: true, message: '必填', trigger: 'blur' }],
          postCode: [{ required: true, message: '必填', trigger: 'blur' }],
        },
        // 寄件人
        getdataListParm: {
          name: 'getContacts',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        posterNameList: [], // 寄件人
        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 弹窗里的表格，仅编辑查看时调用
        getdataListParm3: {
          name: 'getPostalGoodsById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { postalId: "" }
        },
        // 寄件人电话
        getdataListParm4: {
          name: 'getTelById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
      },
      createSee3contact: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { id: '', contactName: '', telephone: '', address: '', remark: '' },
        rules: {},
        getdataListParm: {
          name: 'getContacts',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: '' }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: false,

      },

      createSee4: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', sdate: parseTime(new Date(), '{y}-{m}-{d}'), reasonId: '', sourceId: '', remark: '', id: '', modifyName: 'add', receiverChoose: 'true', statusName: '', created: '', employeeName: '', successDate: '' },

        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          sdate: [{ required: true, message: '必填', trigger: 'blur' }],
          reasonId: [{ required: true, message: '必填', trigger: 'blur' }],
          visiterId: [{ required: true, message: '必填', trigger: 'blur' }]

        },
        // 关联接收快递名称
        getdataListParm1: {
          name: 'getPostalsByCustomerId',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        postalNameList: [], //关联接收快递名称
        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 弹窗里的表格，关联快递下拉时调用
        getdataListParm3: {
          name: 'getPostalGoodsById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { postalId: "" }
        },
        // 弹窗里的表格，仅编辑查看时调用
        getdataListParm4: {
          name: 'getStockGoodsBySid',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { stockupId: "" }
        }

      },
      createSee4contact: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { id: '', contactName: '', telephone: '', address: '', remark: '' },
        rules: {},
        getdataListParm: {
          name: 'getContacts',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: '' }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: false,

      },

      stockupIdArr: [],
      createSee5tableArrList: [],
      // 新增/编辑
      createSee5: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', sendDate: parseTime(new Date(), '{y}-{m}-{d}'), receiverId: '', receiverTel: '', receiverName: '', postId: '', postCode: '', stockupIds: '', remark: '', id: '', modifyName: 'add', receiverChoose: 'true' },

        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          sendDate: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverTel: [{ required: true, message: '必填', trigger: 'blur' }],
          postId: [{ required: true, message: '必填', trigger: 'blur' }],
          postCode: [{ required: true, message: '必填', trigger: 'blur' }],
          stockupIds: [{ required: true, message: '必填', trigger: 'blur' }]
        },
        // 接待人
        getdataListParm0: {
          name: 'getContacts',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        // 接待人电话
        getdataListParm01: {
          name: 'getTelById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        receiverNameList: [], // 接待人

        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 发货清单
        getdataListParm1: {
          name: 'getStockGoodsByCustomerId',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        postalNameList: [], //发货清单

        // 弹窗里的表格，关联发货清单时调用
        getdataListParm3: {
          name: 'getStockGoodsBySid',
          returntype: 'Map',
          parammaps: { stockupId: "" }
        },

        // 弹窗里的表格，仅编辑查看时调用
        getdataListParm4: {
          name: 'getStockupGoodsByDeliveryId',
          returntype: 'Map',
          parammaps: { deliveryId: "" }
        }

      },

      createSee6: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', rdate: parseTime(new Date(), '{y}-{m}-{d}'), employeeId: '', receiverId: '', receiverName: '', content: '', remark: '', visitId: '', telvisitId: '', modifyName: 'add', receiverChoose: 'true' },

        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          rdate: [{ required: true, message: '必填', trigger: 'blur' }],
          visiterId: [{ required: true, message: '必填', trigger: 'blur' }],
          employeeId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          content: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
        },
        // 客户对接人
        getdataListParm1: {
          name: 'getContacts',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        receiverNameList: [], // 客户对接人
        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 拜访记录
        getdataListParm3: {
          name: 'getVisitByCustomerId',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        visitNameList: [], // 拜访记录
        // 回访记录
        getdataListParm4: {
          name: 'getTelvisitByCustomerId',
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        telvisitNameList: [], // 回访记录

      },


      dialogImageUrl: '',
      dialogVisible: false,
      dialogImageUrl2: '',
      dialogVisible2: false,
      //图片请求地址
      uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
      //图片请求头
      headers: {
        optname: 'insertcustompic',
        id: 1,
        token: getToken() // 从cookie里获取token，并赋值token
      },
      //图片路径
      fileList: [],
      fileList2: [],


      createSee7: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', serviceCode: '', serviceDate: parseTime(new Date(), '{y}-{m}-{d}'), employeeId: '', servicetypeId: '', receiverId: '', receiverTel: '', receiverName: '', describe: '', serviceResult: '', visitId: '', telvisitId: '', stockupIds: '', remark: '', id: '', modifyName: 'add', receiverChoose: 'true', scenePhoto1: -1, scenePhoto2: -1, scenePhoto3: -1, scenePhoto4: -1, scenePhoto5: -1, scenePhoto6: -1, scenePhoto7: -1, scenePhoto8: -1, scenePhoto9: -1, serviceCodePhoto: -1, picname1: '', picname2: '', picname3: '', picname4: '', picname5: '', picname6: '', picname7: '', picname8: '', picname9: '' },

        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          serviceCode: [{ required: true, message: '必填', trigger: 'blur' }],
          serviceDate: [{ required: true, message: '必填', trigger: 'blur' }],
          employeeId: [{ required: true, message: '必填', trigger: 'blur' }],
          servicetypeId: [{ required: true, message: '必填', trigger: 'blur' }],
          serviceResult: [{ required: true, message: '必填', trigger: 'blur' }],
          describe: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverTel: [{ required: true, message: '必填', trigger: 'blur' }],

          scenePhoto1: [{ required: true, message: '必填', trigger: 'blur' }],
          serviceCodePhoto: [{ required: true, message: '必填', trigger: 'blur' }],

        },
        // 接待人
        getdataListParm0: {
          name: 'getContacts',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        // 接待人电话
        getdataListParm01: {
          name: 'getTelById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        receiverNameList: [], // 接待人

        // 集团
        getdataListParm2: {
          name: 'getgroupNameById',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 发货清单
        getdataListParm1: {
          name: 'getStockGoodsByCustomerId',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        postalNameList: [], //发货清单

        // 弹窗里的表格，关联发货清单时调用
        getdataListParm3: {
          name: 'getStockGoodsBySid',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { stockupId: "" }
        },

        // 弹窗里的表格，仅编辑查看时调用
        getdataListParm4: {
          name: 'getServiceGoodsByServiceId',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { serviceId: "" }
        },

        // 拜访记录
        getdataListParm5: {
          name: 'getVisitByCustomerId',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        visitNameList: [], //拜访记录
        // 回访记录
        getdataListParm6: {
          name: 'getTelvisitByCustomerId',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "" }
        },
        telvisitNameList: [], //回访记录

      },
      activeName: 'second',
      createSee8: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { customerId: '', groupId: '', groupName: '', cdate: parseTime(new Date(), '{y}-{m}-{d}'), telephone: '', receiverId: '', receiverName: '', respondentId: '', content: '', remark: '', modifyName: 'add', receiverChoose: 'true' },
        rules: {
          customerId: [{ required: true, message: '必填', trigger: 'blur' }],
          cdate: [{ required: true, message: '必填', trigger: 'blur' }],
          proposerId: [{ required: true, message: '必填', trigger: 'blur' }],
          telephone: [{ required: true, message: '必填', trigger: 'blur' }],
          receiverId: [{ required: true, message: '必填', trigger: 'blur' }],
          respondentId: [{ required: true, message: '必填', trigger: 'blur' }],
          content: [{ required: true, message: '必填', trigger: 'blur' }],
        },
        // 投诉人
        getdataListParm: {
          name: 'getContacts',

          returntype: 'Map',
          parammaps: { customerId: "" }
        },

        getdataListParm2: {
          name: 'getgroupNameById',

          returntype: 'Map',
          parammaps: { id: "" }
        },
        // 接待人电话
        getdataListParm3: {
          name: 'getTelById',

          returntype: 'Map',
          parammaps: { id: "" }
        },
        proposerNameList: [], // 投诉人

      },


      dialogVisible: false,
      // 新增/编辑
      create: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { pastureid: Cookies.get('pastureid'), customerName: '', groupId: '', customeStatusName: '', dealerNames: '', dealerIds: '',dealerIdsArr: [], customerUsedName: '', customeLevelName: '',rangeName: '', province: '', address: '',  createrId: '',  creater: '', createtime: parseTime(new Date(), '{y}-{m}-{d}'), remark: '', scode: '' ,directorId: Cookies.get('g_userId'), directorName: Cookies.get('employename'), createrId: '',createrName: Cookies.get('employename'),},
        rules: {
          customerName: [{ required: true, message: '必填', trigger: 'blur' }],
          groupId: [{ required: true, message: '必填', trigger: 'blur' }],
           // customeStatusName: [{ required: true, message: '必填', trigger: 'blur' }]
          // directorId: [{ required: true, message: '必填', trigger: 'blur' }],
          // scode: [{ required: true, message: '必填', trigger: 'blur' },
          //   { min: 18, max: 18, message: '必填18个字符', trigger: 'blur' }
          // ]
        },
      },


      //客户详情
      seeCustomer: {
        dialogFormVisible: false,
      },


      textMap: {
        create: '新增',
        see: '查看',
        update: '编辑'
      },

      activeName: 'first',
      // 服务记录
      service: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { id: '' },
      },
      // 服务记录中表格
      servicetable1: {
        getdataListParm: {
          name: 'getVisit',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { visitCode: "", customerId: "", groupId: "", visiterId: "", receiverName: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable2: {
        getdataListParm: {
          name: 'getTelvisit',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { telVisitCode: "", customerId: "", groupId: "", visiterId: "", receiverId: "", typeIds: "", statusId: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },

      servicetable3: {
        getdataListParm: {
          name: 'getPostal',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "", groupId: "", posterName: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable4: {
        getdataListParm: {
          name: 'getStockup',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { stockupCode: "", customerId: "", groupId: "", employeeId: "", statusName: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable5: {
        getdataListParm: {
          name: 'getDelivery',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { deliveryCode: "", customerId: "", groupId: "", postId: "", postCode: "", stockupCodes: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable6: {
        getdataListParm: {
          name: 'getRemote',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "", groupId: "", employeeId: "", receiverName: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable7: {
        getdataListParm: {
          name: 'getService',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { serviceCode: "", customerId: "", groupId: "", employeeId: "", servicetypeId: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },
      servicetable8: {
        getdataListParm: {
          name: 'getComplaint',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: "", groupId: "", proposerId: "", respondentId: "", statusName: "", beginDate: "", endDate: "" }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,
        temp: {}
      },


      // 联系人管理
      contact: {
        dialogFormVisible: false,
        dialogStatus: '',
        temp: { id: '', contactName: '', telephone: '', address: '', remark: '' },
        rules: {

        },
        getdataListParm: {
          name: 'getContacts',
          page: 1,
          offset: 1,
          pagecount: 10,
          returntype: 'Map',
          parammaps: { customerId: '' }
        },
        tableKey: 0,
        list: [],
        total: 0,
        listLoading: true,

      },
      requestParam: {},
      isokDisable: false,
      selectList: [],
      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
      cellStyle: { padding: 0 + 'px' }
    }
  },

  created() {
    this.get_table_data()
    this.get_select_list()
    this.get_auto_buttons()

    this.getSevList()


  },

  methods: {


    //获取按钮权限
    get_auto_buttons() {
      const Edit = 'CustomerInformation'
      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
      this.isRoleEdit = isRoleEdit

      const CustomerAdd = 'customerInformation:customerInformation:add'
      const isCustomerAdd = checkButtons(this.$store.state.user.buttons, CustomerAdd)
      this.isCustomerAdd = isCustomerAdd

      const CustomerDel = 'customerInformation:customerInformation:del'
      const isCustomerDel = checkButtons(this.$store.state.user.buttons, CustomerDel)
      this.isCustomerDel = isCustomerDel

      const CustomerContract = 'customerInformation:customerInformation:contract'
      const isCustomerContract= checkButtons(this.$store.state.user.buttons, CustomerContract)
      this.isCustomerContract = isCustomerContract

      const CustomerSet = 'customerInformation:return:set'
      const isCustomerSet = checkButtons(this.$store.state.user.buttons, CustomerSet)
      this.isCustomerSet = isCustomerSet


      //操作的宽度
      var widthCount = calculativeWidth(isCustomerAdd,isCustomerDel,isCustomerContract) + 90
      this.autoWidth = widthCount

    },


    //获取所有下拉框的内容
    get_select_list() {
      // 下拉框请求
      var send_select_list = [
        // { name: 'getCustomerSelect', offset: 0, pagecount: 0, parammaps: {} },
        { name: 'getDictListSelect1', offset: 0, pagecount: 0, parammaps: { "pid": "54" } },
        { name: 'getEmployeesSelect', offset: 0, pagecount: 0, parammaps: {} },
        { name: 'getUsersSelect', offset: 0, pagecount: 0, parammaps: { "enable": "1" } },
        { name: 'getProductsEnable', offset: 0, pagecount: 0, parammaps: { "enable": "1" } },
        { name: 'getDealerSelect', offset: 0, pagecount: 0, parammaps: { } },
      ]
      GetDataByNames(send_select_list).then(response => {
        // this.customerNameList = response.data.getCustomerSelect.list
        // console.log("客户名称下拉框", this.customerNameList)
        this.groupNameList = response.data.getDictListSelect1.list
        console.log("集团下拉框", this.groupNameList)


        this.dealNameList = response.data.getDealerSelect.list
        console.log("经销商下拉框", this.dealNameList)

        this.directorNameList = response.data.getEmployeesSelect.list
        console.log("负责人下拉框", this.directorNameList)
        this.createrNameList = response.data.getUsersSelect.list
        console.log("创建人下拉框", this.createrNameList)
        this.receProductNameList = response.data.getProductsEnable.list
        console.log("收件货品下拉框", this.receProductNameList)
      })


    },


    //加载表格
    get_table_data() {
      this.tableObj.listLoading = true
      GetDataByName(this.tableObj.getdataListParm).then(response => {
        console.log('table数据', response.data.list)
        if (response.data.list !== null) {


          this.tableObj.pageNum = response.data.pageNum
          this.tableObj.pageSize = response.data.pageSize
          this.tableObj.total = response.data.total

          var arr = response.data.list

          arr.map(function(i, j) {
            // console.log(i, '====')
            if (i.dealerIds) {

              var dealerIdsArr = i.dealerIds.split(',')
              var nedeArr = dealerIdsArr.map(Number)
              console.log(nedeArr)
              return i.dealerIdsArr =  nedeArr
            } else {
              return i.dealerIdsArr = []
            }
          })


          this.tableObj.list = arr
          console.log(arr)


        } else {
          this.tableObj.list = []
        }
        setTimeout(() => {
          this.tableObj.listLoading = false
        }, 100)
      })
    },


    //模糊查询客户
    customer_search(queryString, cb) {
      console.log('模糊查询输入值', queryString)
      GetDataByName({ name: 'getCustomerNameFuzzy', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputvalue: queryString } }).then(response => {
        this.customerNameList = response.data.list
        console.log("客户名称下拉框", response)
        cb(response.data.list)
        // this.$refs.elautocomplete.handleFocus()
      })
    },

    //模糊查询客户选择
    change_customer_select(item) {
      console.log('客户名称模糊查询选中值', item)
      this.tableObj.getdataListParm.parammaps.customerId = item.id
      this.tableObj.getdataListParm.parammaps.customerName = item.name
      this.$forceUpdate()
    },
    //清空客户选择
    clear_customer_select(item) {
      document.activeElement.blur()
      this.tableObj.getdataListParm.parammaps.customerId = ""
      this.tableObj.getdataListParm.parammaps.customerName = ""
      this.customerNameList = []
    },

    //客户失去焦点
    customer_search_blur(item) {
      console.log("客户失去焦点")
      this.tableObj.getdataListParm.parammaps.customerId = ""
      this.tableObj.getdataListParm.parammaps.customerName = ""
      this.customerNameList = []

    },

    getSevList() {
      GetDataByName({ name: 'getDictListSelect2', offset: 0, pagecount: 0, parammaps: { "pid": "56" } }).then(response => {
        console.log('table数据', response.data.list)
        if (response.data.list !== null) {
          this.typeNameList = response.data.list
          console.log("回访类型", this.typeNameList)
        } else {
          this.typeNameList = []
        }

      })
    },

    //监听 - 表单查询
    form_search() {
      console.log('点击了查询', this.tableObj.getdataListParm.parammaps)
      if (this.tableObj.getdataListParm.parammaps.inputDatetime !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime !== null) {
        this.tableObj.getdataListParm.parammaps.beginDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        this.tableObj.getdataListParm.parammaps.endDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
      } else {
        this.tableObj.getdataListParm.parammaps.inputDatetime = ''
        this.tableObj.getdataListParm.parammaps.beginDate = ''
        this.tableObj.getdataListParm.parammaps.endDate = ''
      }

      this.tableObj.getdataListParm.offset = 1
      this.get_table_data()
    },

    //事件 - 清空查询信息
    form_clear() {
      console.log('点击了重置')
      this.tableObj.getdataListParm.parammaps.beginDate = ''
      this.tableObj.getdataListParm.parammaps.endDate = ''
      this.tableObj.getdataListParm.parammaps.inputDatetime = ''

      this.tableObj.getdataListParm.parammaps.customerName = ''
      this.tableObj.getdataListParm.parammaps.dealerId = ''
      this.tableObj.getdataListParm.parammaps.customerId = ''
      this.tableObj.getdataListParm.parammaps.groupId = ''
      this.tableObj.getdataListParm.parammaps.rangeName = ''
      this.tableObj.getdataListParm.parammaps.customeStatusName = ''
      this.tableObj.getdataListParm.parammaps.customeLevelName = ''
      this.tableObj.getdataListParm.parammaps.createrId = ''
      this.tableObj.getdataListParm.parammaps.directorId = ''
      this.tableObj.getdataListParm.offset = 1
      this.get_table_data()
    },

    //事件 - 清空所有表单信息
    form_reset() {
      this.create.temp = { pastureid: Cookies.get('pastureid'), customerName: '', groupId: '', customeStatusName: '', customeLevelName: '', rangeName: '', province: '', address: '', directorId: Cookies.get('g_userId'), directorName: Cookies.get('employename'), createrId: '',createrName: Cookies.get('employename'), director: '', creater: '', createtime: parseTime(new Date(), '{y}-{m}-{d}'), remark: '', scode: '' ,dealerIdsArr:[],  dealerIds:""}
    },

    //监听 - 表格中客户名称
    change_bar(item) {
      this.create.temp.barname = this.houseNameList.find(obj => obj.id === item).bname
    },

    change_custormer_remote(query) {
      if (query !== '') {
        this.loading = true;
        GetDataByName({ name: 'getCustomerNameFuzzy', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputvalue: query } }).then(response => {
          this.customerNameList = response.data.list
          console.log("客户名称下拉框", response)
          this.loading = false;
        })
      } else {
        this.customerNameList = [];
      }
    },


    change_deal(item) {


      // dealNameList
      console.log(item)
     //  this.create.temp.dealerId = item

    //  var arr = []

    //   this.dealNameList.forEach(function(i) {
    //     val.forEach(function(j) {
    //       if (i.dealerId == j) {
    //         arr.push(i)
    //       }
    //     })
    //   })

    //   console.log('点击了角色', arr)

    //   this.table.temp.dealerIdsArr = arr


    },


    //监听 - 弹窗 - 新增
    form_add() {
      console.log('点击了新增')
      this.form_reset()
      // this.getNoteTakerList()
      this.create.dialogStatus = 'create'
      this.create.dialogFormVisible = true
    },
    //监听 - 弹窗 - 新增保存
    add_dialog_save() {
      var me  = this
      console.log('点击了新增保存')
      this.isokDisable = true
      setTimeout(() => {
        this.isokDisable = false
      }, 1000)
      this.$refs['temp'].validate(valid => {
        if (valid) {
          this.isokDisable = true
          setTimeout(() => {
            this.isokDisable = false
          }, 1000)


          //验证名字是否存在
          this.requestParam.name = 'checkCustomerByName'
          this.requestParam.parammaps = this.create.temp


          var send_data_check = { "name": "checkCustomerByName", "parammaps": { "customerName": this.create.temp.customerName, "type": "add", "id": "" } }

          GetDataByName(send_data_check).then(response => {
            console.log('验证名字是否存在', this.requestParam)
            if (response.data.list[0].num == 0) {

              console.log('正常保存' )
                this.create.temp.createtime = parseTime(this.create.temp.createtime, '{y}-{m}-{d}')
                this.create.temp.createrId = Cookies.get('employeid')


                me.create.temp.dealerIds = me.create.temp.dealerIdsArr.toString()


                this.requestParam.name = 'insertCustomer'
                this.requestParam.parammaps = this.create.temp


                PostDataByName(this.requestParam).then(response => {
                  console.log('新增保存发送参数', this.requestParam)
                  if (response.msg !== 'fail') {


                    this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
                    this.create.dialogFormVisible = false
                    this.get_table_data()
                  } else {
                    this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
                  }
                })


            } else {

              this.$notify({ title: '失败', message: '客户名称已存在', type: 'error', duration: 2000 })

            }
          })


        }
      })
    },
    // 查看
    form_see(row) {
      this.create.dialogStatus = 'see'
      this.create.dialogFormVisible = true
      console.log('点击了查看', row)
      this.$nextTick(() => {
        this.$refs.temp.resetFields()
        this.create.temp = Object.assign({}, row)
      })


    },

    //查看客户信息
    click_customer(row) {
      console.log('查看客户信息卡片', row)
      this.customerData.id = row.id
      this.seeCustomer.dialogFormVisible = true
    },


    //监听 - 弹窗 - 编辑
    form_edit(row) {
      console.log('点击了编辑', row)

      this.create.temp = Object.assign({}, row)
      this.create.temp.id = row.id


      // if(this.create.temp.dealerIds && this.create.temp.dealerIds !== ""){
      //   var dearArr =  this.create.temp.dealerIds.split(",")
      //   var newDearArr = []
      //   dearArr.forEach(function(item){
      //     newDearArr.push(parseInt(item))
      //   })
      //   this.create.temp.dealerIdsArr  = newDearArr
      //   console.log(newDearArr)
      //   console.log(dearArr)
      // }else {
      //   this.create.temp.dealerIdsArr = []
      // }


      this.create.dialogStatus = 'update'
      this.create.dialogFormVisible = true
    },

    //监听 - 弹窗 - 编辑保存
    form_edit_save() {
      this.isokDisable = true
      var me = this
      setTimeout(() => {
        this.isokDisable = false
      }, 1000)
      this.$refs['temp'].validate(valid => {
        if (valid) {
          this.isokDisable = true
          setTimeout(() => {
            this.isokDisable = false
          }, 1000)
          //验证名字是否存在
          this.create.temp.type = "update"
          var send_data = {
            name: 'checkCustomerByName',
            parammaps: this.create.temp
          }

          GetDataByName(send_data).then(response => {
            console.log('验证名字是否存在', send_data)
            if (response.data.list[0].num > 0) {
              this.$notify({ title: '失败', message: '客户名称已存在', type: 'error', duration: 2000 })
            }     else {


              me.create.temp.dealerIds = me.create.temp.dealerIdsArr.toString()

              this.create.temp.createtime = parseTime(this.create.temp.createtime, '{y}-{m}-{d}')
               var send_data2 = {
                name: 'updateCustomer',
                parammaps: this.create.temp
              }

              PostDataByName(send_data2).then(response => {
                console.log('编辑保存发送参数', send_data2)
                if (response.msg !== 'fail') {
                  this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
                  this.create.dialogFormVisible = false
                  this.get_table_data()
                } else {
                  this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
                }
              })
            }
          })


        }
      })
    },

    // 表格中的启用
    change_enable(index, row) {
      this.requestParam.name = 'updateCustomerEnable'
      this.requestParam.parammaps = {
        id: row.id,
        enable: row.enable
      }


      PostDataByName(this.requestParam).then(response => {
        console.log('表格中的启用发送参数', this.requestParam)
        if (response.msg !== 'fail') {
          if (this.requestParam.parammaps.enable == 1) {
            this.$notify({ title: '成功', message: '启用成功', type: 'success', duration: 2000 })
          } else {
            this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
          }

          this.create.dialogFormVisible = false
          this.get_table_data()
        } else {
          this.$notify({ title: '失败', message: '失败' + response.data, type: 'error', duration: 2000 })
        }
      })


    },

    // 删除
    form_delete(row) {
      MessageBox.confirm('是否确认删除此信息?', {
        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
      }).then(() => {
        this.requestParam.name = 'delCustomer'
        this.requestParam.parammaps = {}
        this.requestParam.parammaps.id = row.id
        PostDataByName(this.requestParam).then(response => {
          if (response.msg === 'fail') {
            this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
          } else {
            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
            this.get_table_data()
          }
        })
      }).catch(() => {
        this.$message({ type: 'info', message: '已取消删除' })
      })
    },

    // 服务记录
    handleService(row) {
      console.log('点击了服务记录', row)
      this.service.temp = Object.assign({}, row)
      this.service.temp.id = row.id
      this.service.dialogFormVisible = true

      this.servicetable1.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList1()
      this.servicetable2.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList2()
      this.servicetable3.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList3()
      this.servicetable4.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList4()
      this.servicetable5.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList5()
      this.servicetable6.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList6()
      this.servicetable7.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList7()
      this.servicetable8.getdataListParm.parammaps.customerId = row.id
      this.getServiceTableList8()
    },


    //加载表格
    getServiceTableList1() {
      this.servicetable1.listLoading = true
      GetDataByName(this.servicetable1.getdataListParm).then(response => {
        console.log('servicetable1数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable1.list = response.data.list
          this.servicetable1.pageNum = response.data.pageNum
          this.servicetable1.pageSize = response.data.pageSize
          this.servicetable1.total = response.data.total
        } else {
          this.servicetable1.list = []
        }
        setTimeout(() => {
          this.servicetable1.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList2() {
      this.servicetable2.listLoading = true
      GetDataByName(this.servicetable2.getdataListParm).then(response => {
        console.log('servicetable2数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable2.list = response.data.list
          this.servicetable2.pageNum = response.data.pageNum
          this.servicetable2.pageSize = response.data.pageSize
          this.servicetable2.total = response.data.total
        } else {
          this.servicetable2.list = []
        }
        setTimeout(() => {
          this.servicetable2.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList3() {
      this.servicetable3.listLoading = true
      GetDataByName(this.servicetable3.getdataListParm).then(response => {
        console.log('servicetable3数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable3.list = response.data.list
          this.servicetable3.pageNum = response.data.pageNum
          this.servicetable3.pageSize = response.data.pageSize
          this.servicetable3.total = response.data.total
        } else {
          this.servicetable3.list = []
        }
        setTimeout(() => {
          this.servicetable3.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList4() {
      this.servicetable4.listLoading = true
      GetDataByName(this.servicetable4.getdataListParm).then(response => {
        console.log('servicetable4数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable4.list = response.data.list
          this.servicetable4.pageNum = response.data.pageNum
          this.servicetable4.pageSize = response.data.pageSize
          this.servicetable4.total = response.data.total
        } else {
          this.servicetable4.list = []
        }
        setTimeout(() => {
          this.servicetable4.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList5() {
      this.servicetable5.listLoading = true
      GetDataByName(this.servicetable5.getdataListParm).then(response => {
        console.log('servicetable5数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable5.list = response.data.list
          this.servicetable5.pageNum = response.data.pageNum
          this.servicetable5.pageSize = response.data.pageSize
          this.servicetable5.total = response.data.total
        } else {
          this.servicetable5.list = []
        }
        setTimeout(() => {
          this.servicetable5.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList6() {
      this.servicetable6.listLoading = true
      GetDataByName(this.servicetable6.getdataListParm).then(response => {
        console.log('servicetable6数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable6.list = response.data.list
          this.servicetable6.pageNum = response.data.pageNum
          this.servicetable6.pageSize = response.data.pageSize
          this.servicetable6.total = response.data.total
        } else {
          this.servicetable6.list = []
        }
        setTimeout(() => {
          this.servicetable6.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList7() {
      this.servicetable7.listLoading = true
      GetDataByName(this.servicetable7.getdataListParm).then(response => {
        console.log('servicetable7数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable7.list = response.data.list
          this.servicetable7.pageNum = response.data.pageNum
          this.servicetable7.pageSize = response.data.pageSize
          this.servicetable7.total = response.data.total
        } else {
          this.servicetable7.list = []
        }
        setTimeout(() => {
          this.servicetable7.listLoading = false
        }, 100)
      })
    },

    //加载表格
    getServiceTableList8() {
      this.servicetable8.listLoading = true
      GetDataByName(this.servicetable8.getdataListParm).then(response => {
        console.log('servicetable8数据', response.data.list)
        if (response.data.list !== null) {

          this.servicetable8.list = response.data.list
          this.servicetable8.pageNum = response.data.pageNum
          this.servicetable8.pageSize = response.data.pageSize
          this.servicetable8.total = response.data.total
        } else {
          this.servicetable8.list = []
        }
        setTimeout(() => {
          this.servicetable8.listLoading = false
        }, 100)
      })
    },


    //服务记录 - 拜访记录表格跳转
    handleServiceSee1(row) {
      // this.$router.push({ path: '/businessManagement/visitRecord', query: {} })

      GetDataByName({ "name": "getVisitById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('拜访记录', response)


          this.createSee1.temp = response.data.list[0]

          // 现场照片
          const urlArray = []
          const urlArrayId = []
          const fileList = []

          if (this.createSee1.temp.picname1 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname1)
            urlArrayId.push(this.create.temp.vPhoto1)
          }
          if (this.createSee1.temp.picname2 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname2)
            urlArrayId.push(this.create.temp.vPhoto2)
          }
          if (this.createSee1.temp.picname3 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname3)
            urlArrayId.push(this.create.temp.vPhoto3)
          }
          if (this.createSee1.temp.picname4 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname4)
            urlArrayId.push(this.create.temp.vPhoto4)
          }
          if (this.createSee1.temp.picname5 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname5)
            urlArrayId.push(this.create.temp.vPhoto5)
          }
          if (this.createSee1.temp.picname6 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname6)
            urlArrayId.push(this.create.temp.vPhoto6)
          }
          if (this.createSee1.temp.picname7 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname7)
            urlArrayId.push(this.create.temp.vPhoto7)
          }
          if (this.createSee1.temp.picname8 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname8)
            urlArrayId.push(this.create.temp.vPhoto8)
          }
          if (this.createSee1.temp.picname9 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee1.temp.picname9)
            urlArrayId.push(this.create.temp.vPhoto9)
          }


          console.log("urlArray", urlArray)
          console.log("urlArrayId", urlArrayId)


          for (let i = 0; i < urlArray.length; i++) {
            var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } }
            urlObj.url = urlArray[i]
            // this.$set(urlObj, 'url', urlArray[i])
            // this.$set(urlObj, 'response', 15)
            urlObj.response.execresult.LastInsertId = urlArrayId[i]
            fileList.push(urlObj)
          }

          this.fileList = fileList

          console.log("fileList", fileList)


          this.createSee1.dialogFormVisible = true

          this.hideUpload = true

          document.getElementById('uploadPic1').lastChild.style.display = "none"
          document.getElementById('uploadPic2').lastChild.style.display = "none"
          document.getElementById('uploadPic').lastChild.style.display = "none"
          document.getElementById('uploadPic').lastChild.style.cssText = "display:none!important"
        }
      })
    },
    //服务记录 - 电话回访记录表格跳转
    handleServiceSee2(row) {
      // this.$router.push({ path: '/businessManagement/telephoneFollow', query: {} })
      GetDataByName({ "name": "getTelvisitById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('电话记录', response)
          this.createSee2.temp = response.data.list[0]
          // if (response.data.list[0].typeIdsArr != "" && response.data.list[0].typeIdsArr != undefined) {
          //   this.createSee2.temp.typeIdsArr = response.data.list[0].typeIdsArr.map(Number)
          // }

          // this.createSee2.dialogFormVisible = true


          var typeIdsArr = response.data.list[0].typeIds.split(",")

          this.createSee2.temp.typeIdsArr = typeIdsArr.map(Number)

          this.createSee2.dialogFormVisible = true

        }
      })
    },
    //服务记录表格跳转
    handleServiceSee3(row) {
      // this.$router.push({ path: '/businessManagement/ExpressReception', query: {} })

      GetDataByName({ "name": "getPostalById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('快递记录', response)
          this.createSee3.temp = response.data.list[0]
          this.createSee3.dialogFormVisible = true
          // this.create.getdataListParm2.parammaps.id = item
          // this.getGroupNameId()
          this.createSee3.getdataListParm.parammaps.customerId = row.customerId
          this.getPosterNameList()
          this.createSee3.getdataListParm3.parammaps.postalId = row.id
          this.getReceProduct()
        }
      })

    },
    getPosterNameList() {
      GetDataByName(this.createSee3.getdataListParm).then(response => {
        if (response.data.list !== null) {
          this.create.posterNameList = response.data.list
          console.log('寄件人数据', response.data.list)
        } else {
          this.createSee3.posterNameList = []
        }
      })
    },
    // 查看和编辑中的小表格
    getReceProduct() {
      GetDataByName(this.createSee3.getdataListParm3).then(response => {
        console.log("查看和编辑中的小表格", response.data.list)
        if (response.data.list !== null) {
          this.createSee3contact.list = response.data.list
        }
      })
    },


    //服务记录表格跳转
    handleServiceSee4(row) {
      // this.$router.push({ path: '/businessManagement/stockNotice', query: {} })
      GetDataByName({ "name": "getStockup", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('备货记录', response)
          this.createSee4.temp = response.data.list[0]
          this.createSee4.dialogFormVisible = true

          this.createSee4.getdataListParm1.parammaps.customerId = row.customerId
          this.get_postalNameList()
          this.createSee4.getdataListParm4.parammaps.stockupId = row.id
          this.getReceProduct2()
        }
      })
    },

    get_postalNameList() {
      GetDataByName(this.createSee4.getdataListParm1).then(response => {
        if (response.data.list !== null) {
          this.createSee4.postalNameList = response.data.list
          console.log('关联接收数据', response.data.list)
        } else {
          this.createSee4.postalNameList = []
        }
      })
    },
    getReceProduct2() {
      GetDataByName(this.createSee4.getdataListParm4).then(response => {
        console.log("查看和编辑中的小表格", response.data.list)
        if (response.data.list !== null) {
          this.createSee4contact.list = response.data.list
        }
      })
    },


    //服务记录表格跳转
    handleServiceSee5(row) {
      // this.$router.push({ path: '/businessManagement/deliveryRecord', query: {} })
      GetDataByName({ "name": "getDeliveryById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('快递记录', response)
          this.createSee5.temp = response.data.list[0]
          this.createSee5.dialogFormVisible = true


          this.createSee5.getdataListParm0.parammaps.customerId = row.customerId
          this.getReceiverNameList5()

          this.createSee5.getdataListParm1.parammaps.customerId = row.customerId
          this.get_postalNameList5()

          if (response.data.list[0].stockupIds !== "") {
            this.stockupIdArr = row.stockupIds.split(',')
            console.log("stockupIdArr", this.stockupIdArr)
            this.createSee5.getdataListParm4.parammaps.deliveryId = row.id
            this.getReceProduct25()
          }

        }
      })
    },
    getReceiverNameList5() {
      GetDataByName(this.createSee5.getdataListParm0).then(response => {
        if (response.data.list !== null) {
          this.createSee5.receiverNameList = response.data.list
          console.log('接待人数据', response.data.list)
        } else {
          this.createSee5.receiverNameList = []
        }
      })
    },
    get_postalNameList5() {
      GetDataByName(this.createSee5.getdataListParm1).then(response => {
        if (response.data.list !== null) {
          this.createSee5.postalNameList = response.data.list
          console.log('关联接收数据', response.data.list)
        } else {
          this.createSee5.postalNameList = []
        }
      })
    },
    getReceProduct25() {
      GetDataByName(this.createSee5.getdataListParm4).then(response => {
        console.log("查看和编辑中的小表格", response.data.list)
        console.log("查看和编辑的当前小表格ID", this.stockupIdArr)

        if (response.data.list !== null) {

          var allArr = []

          this.stockupIdArr.forEach(function (j) {
            var obj = { "title": "", "name": "", "date": "", "stockupId": j, "tablelist": [] }
            response.data.list.forEach(function (i) {
              if (j == i.stockupId) {
                obj.tablelist.push(i)
              }
            })
            allArr.push(obj)
          })
          console.log(allArr)

          allArr.map(function (i) {
            return (i.title = i.tablelist[0].stockupCode)
          })
          allArr.map(function (i) {
            return (i.name = i.tablelist[0].employeeName)
          })
          allArr.map(function (i) {
            return (i.date = i.tablelist[0].successDate)
          })

          this.createSee5tableArrList = allArr


        }
      })
    },
    handlePicPreview2(file) {
      this.dialogImageUrl2 = file.url
      this.dialogVisible2 = true
    },

    //服务记录表格跳转
    handleServiceSee6(row) {
      // this.$router.push({ path: '/businessManagement/remoteService', query: {} })
      GetDataByName({ "name": "getRemoteById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('远程记录', response)
          this.createSee6.temp = response.data.list[0]
          this.createSee6.dialogFormVisible = true
        }
      })
    },
    //服务记录表格跳转
    handleServiceSee7(row) {
      //this.$router.push({ path: '/businessManagement/siteService', query: {} })
      GetDataByName({ "name": "getServiceById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('现场服务记录', response)
          this.createSee7.temp = response.data.list[0]


          this.createSee7.getdataListParm1.parammaps.customerId = row.customerId
          this.get_postalNameList7()
          if (row.stockupIds !== "" && row.stockupIds !== null && row.stockupIds !== undefined) {
            this.stockupIdArr = row.stockupIds.split(',')

            var tempArr = []
            this.stockupIdArr.forEach(function (i) {
              tempArr.push(parseInt(i))
            })
            this.stockupIdArr = tempArr
            console.log("stockupIdArr", this.stockupIdArr)

            this.createSee7.getdataListParm4.parammaps.serviceId = row.id
            this.getReceProduct27()


          }

          // 现场照片
          const urlArray = []
          const urlArrayId = []
          const fileList = []

          if (this.createSee7.temp.picname1 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname1)
            urlArrayId.push(this.createSee7.temp.scenePhoto1)
          }
          if (this.createSee7.temp.picname2 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname2)
            urlArrayId.push(this.createSee7.temp.scenePhoto2)
          }
          if (this.createSee7.temp.picname3 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname3)
            urlArrayId.push(this.createSee7.temp.scenePhoto3)
          }
          if (this.createSee7.temp.picname4 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname4)
            urlArrayId.push(this.createSee7.temp.scenePhoto4)
          }
          if (this.createSee7.temp.picname5 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname5)
            urlArrayId.push(this.createSee7.temp.scenePhoto5)
          }
          if (this.createSee7.temp.picname6 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname6)
            urlArrayId.push(this.createSee7.temp.scenePhoto6)
          }
          if (this.createSee7.temp.picname7 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname7)
            urlArrayId.push(this.createSee7.temp.scenePhoto7)
          }
          if (this.createSee7.temp.picname8 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname8)
            urlArrayId.push(this.createSee7.temp.scenePhoto8)
          }
          if (this.createSee7.temp.picname9 != undefined) {
            urlArray.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.picname2)
            urlArrayId.push(this.createSee7.temp.scenePhoto9)
          }


          console.log("urlArray", urlArray)
          console.log("urlArrayId", urlArrayId)


          for (let i = 0; i < urlArray.length; i++) {
            var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } }
            urlObj.url = urlArray[i]
            // this.$set(urlObj, 'url', urlArray[i])
            // this.$set(urlObj, 'response', 15)
            urlObj.response.execresult.LastInsertId = urlArrayId[i]
            fileList.push(urlObj)
          }

          this.fileList = fileList

          console.log("fileList", fileList)


          // 服务单照片
          const urlArray2 = []
          const urlArrayId2 = []
          const fileList2 = []
          if (this.createSee7.temp.codePicname == undefined) {
            urlArray2.push()
          } else {
            urlArray2.push(process.env.VUE_APP_BASE_API + this.createSee7.temp.codePicname)
            urlArrayId2.push(this.createSee7.temp.serviceCodePhoto)
          }
          console.log("urlArray2", urlArray2)
          console.log("urlArrayId2", urlArrayId2)


          for (let i = 0; i < urlArray2.length; i++) {
            var urlObj2 = { "url": "", "response": { "execresult": { "LastInsertId": "" } } }
            urlObj2.url = urlArray2[i]
            urlObj2.response.execresult.LastInsertId = urlArrayId2[i]
            fileList2.push(urlObj2)
          }

          this.fileList2 = fileList2
          console.log("fileList2", fileList2)

          this.createSee7.dialogFormVisible = true


        }
      })

    },

    get_postalNameList7() {
      GetDataByName(this.createSee7.getdataListParm1).then(response => {
        if (response.data.list !== null) {
          this.createSee7.postalNameList = response.data.list
          console.log('关联接收数据', response.data.list)
        } else {
          this.createSee7.postalNameList = []
        }
      })
    },

    getReceProduct27() {
      GetDataByName(this.createSee7.getdataListParm4).then(response => {
        console.log("查看和编辑中的小表格", response.data.list)
        console.log("查看和编辑的当前小表格ID", this.stockupIdArr)

        if (response.data.list !== null) {

          var allArr = []

          this.stockupIdArr.forEach(function (j) {
            var obj = { "title": "", "stockupId": j, "tablelist": [] }
            response.data.list.forEach(function (i) {
              if (j == i.stockupId) {
                obj.tablelist.push(i)
              }
            })
            allArr.push(obj)
          })
          console.log(allArr)

          allArr.map(function (i) {
            return (i.title = i.tablelist[0].stockupCode)
          })

          this.createSee7tableArrList = allArr


        }
      })
    },


    //服务记录表格跳转
    handleServiceSee8(row) {
      //this.$router.push({ path: '/businessManagement/complaintRecord', query: {} })
      GetDataByName({ "name": "getComplaintById", "parammaps": { "id": row.id } }).then(response => {
        if (response.data.list !== null) {

          console.log('投诉记录', response)
          this.createSee8.temp = response.data.list[0]
          this.createSee8.dialogFormVisible = true
        }
      })

    },


    //服务记录TAB切换
    handleClick(tab, event) {
      console.log(tab, event);
    },


    // 联系人管理
    handleContact(row) {
      console.log('点击了联系人管理', row)

      this.contact.getdataListParm.parammaps.customerId = row.id
      this.contact.temp.customerId = row.id
      this.contact.dialogFormVisible = true
      this.get_table_data2()
    },


    //图片展示
    handlePicPreview(file) {
      this.dialogImageUrl = file.url
      this.dialogVisible = true
    },
    handlePicChange(file, fileList) {

    },
    handlePicSuccess(response, file, fileList) {

    },
    handlePicRemove(file, fileList) {
    },
    //加载表格
    get_table_data2() {
      this.contact.listLoading = true
      GetDataByName(this.contact.getdataListParm).then(response => {
        console.log('table数据', response.data.list)
        if (response.data.list !== null) {
          for (let i = 0; i < response.data.list.length; i++) {
            this.$set(response.data.list[i], 'Edit', false) // 编辑
            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
          }
          this.contact.list = response.data.list
          this.contact.pageNum = response.data.pageNum
          this.contact.pageSize = response.data.pageSize
          this.contact.total = response.data.total
        } else {
          this.contact.list = []
        }
        setTimeout(() => {
          this.contact.listLoading = false
        }, 100)
      })
    },


    // 联系人管理 - 新增
    form_add2() {
      console.log('点击了联系人管理新增')
      // 编辑true/不可编辑false
      // 新增操true,编辑false，编辑保存false
      for (let i = 0; i < this.tableObj.list.length; i++) {
        if (this.tableObj.list[i].Edit == true) {
          this.$message({ type: 'error', message: '当前内容未保存，请点击取消或保存继续进行操作', duration: 2000 })
          return false
        }
      }
      this.contact.list.unshift({ id: (new Date()).valueOf(), contactName: '', telephone: '', address: '', remark: '', 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, })
    },
    add_dialog_save2(row) {
      console.log('点击了新增保存')

      this.contact.temp.contactName = row.contactName
      this.contact.temp.telephone = row.telephone
      this.contact.temp.address = row.address
      this.contact.temp.remark = row.remark


      // 联系人姓名/联系人电话是否为空
      if (this.contact.temp.contactName == '' && this.tableObj.temp.telephone == '') {
        this.$message({ type: 'error', message: '联系人姓名/联系人电话不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.contactName == '') {
        this.$message({ type: 'error', message: '联系人姓名不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.telephone == '') {
        this.$message({ type: 'error', message: '联系人电话不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.telephone.length !== 11 ) {
        this.$message({ type: 'error', message: '联系人电话固定位数为11位', duration: 2000 })
        return false
      }
      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？]")
      if (pattern.test(this.contact.temp.contactName)) {
        this.$message({ type: 'error', message: '联系人姓名不可输入特殊字符', duration: 2000 })
        return false
      }

      this.isokDisable = true
      setTimeout(() => {
        this.isokDisable = false
      }, 1000)
      this.requestParam.name = 'insertContacts'
      this.requestParam.parammaps = this.contact.temp
      PostDataByName(this.requestParam).then(response => {
        console.log('新增保存发送参数', this.requestParam)
        if (response.msg !== 'fail') {
          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
          this.get_table_data2()
        } else {

          this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
        }
      })
    },
    add_cancel2(row) {
      console.log('点击了新增取消')
      for (let i = 0; i < this.contact.list.length; i++) {
        if (row.id === this.contact.list[i].id) {
          var listIndex = this.contact.list.indexOf(this.contact.list[i])
        }
        if (listIndex > -1) {
          this.contact.list.splice(listIndex, 1)
          return
        }
      }
    },


    // 联系人管理 - 编辑
    form_edit2(row) {
      for (let i = 0; i < this.contact.list.length; i++) {
        if (this.contact.list[i].Edit == true) {
          this.$message({ type: 'error', message: '当前内容未保存，请点击取消或保存继续进行操作', duration: 2000 })
          return false
        }
      }
      // 编辑true,不可编辑false
      row.Edit = true
      row.NoEdit = false
      // 新增false,编辑false,编辑保存true
      row.isCreate = false
      row.isUpdate = false
      row.isUpdateSave = true
    },

    form_edit_save2(row) {
      console.log('点击了编辑保存，',this.contact.temp)


      this.contact.temp.contactName = row.contactName
      this.contact.temp.telephone = row.telephone
      this.contact.temp.address = row.address
      this.contact.temp.remark = row.remark
      this.contact.temp.id = row.id
      // 联系人姓名/联系人电话是否为空
      if (this.contact.temp.contactName == '' && this.tableObj.temp.telephone == '') {
        this.$message({ type: 'error', message: '联系人姓名/联系人电话不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.contactName == '') {
        this.$message({ type: 'error', message: '联系人姓名不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.telephone == '') {
        this.$message({ type: 'error', message: '联系人电话不能为空', duration: 2000 })
        return false
      } else if (this.contact.temp.telephone.length !== 11) {
        this.$message({ type: 'error', message: '联系人电话固定位数为11位', duration: 2000 })
        return false
      }
      const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？]")
      if (pattern.test(this.contact.temp.contactName)) {
        this.$message({ type: 'error', message: '联系人姓名不可输入特殊字符', duration: 2000 })
        return false
      }

      this.isokDisable = true
      setTimeout(() => {
        this.isokDisable = false
      }, 1000)
      this.requestParam.name = 'updateContacts'
      this.requestParam.parammaps = this.contact.temp
      PostDataByName(this.requestParam).then(response => {
        console.log('编辑保存发送参数', this.requestParam)
        if (response.msg !== 'fail') {
          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
          this.get_table_data2()
        } else {

          this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
        }
      })


    },
    edit_cancel2(row) {
      console.log('点击了编辑取消')
      // 编辑false,不可编辑true
      row.Edit = false
      row.NoEdit = true
      // 新增false,编辑true,编辑保存false
      row.isCreate = false
      row.isUpdate = true
      row.isUpdateSave = false
      this.get_table_data2()
    },

    // 删除
    form_delete2(row) {
      console.log('点击了行内删除')
      MessageBox.confirm('是否确认删除此信息?', {
        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
      }).then(() => {
        this.requestParam.name = 'delContacts'
        this.requestParam.parammaps = {}
        this.requestParam.parammaps.id = row.id
        PostDataByName(this.requestParam).then(response => {
          if (response.msg === 'fail') {
            this.$notify({ title: '失败', message: '删除失败', type: 'warning', duration: 2000 })
          } else {
            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
            this.get_table_data2()
          }
        })
      }).catch(() => {
        this.$message({ type: 'info', message: '已取消删除' })
      })
    },


    // 导出
    form_export(item) {
      // if (item == 1) {
      //   console.log('点击了导出模板')
      // } else {
      //   console.log('点击了导出数据')
      // }

      this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps

      GetDataByName(this.download.getdataListParm).then(response => {
        if (response.data.list !== null) {
          this.download.list = response.data.list
        } else {
          this.download.list = []
        }
        var excelDatas = [
          {
            tHeader: ['序号', '客户名称', '客户集团', '客户状态', '客户等级', '客户区域', '省份', '客户地址', '负责人', '创建人', '创建时间', '备注', '启用'],
            filterVal: ['sort', 'customerName', 'groupName', 'customeStatusName', 'customeLevelName', 'rangeName', 'province', 'address', 'directorName', 'createrName', 'createtime', 'remark', 'enable'],
            tableDatas: this.download.list,
            sheetName: 'Sheet1'
          }
        ]
        json2excel(excelDatas, '客户信息', true, 'xlsx')
      })

    },

    // 导入
    form_inport() {
      console.log('点击了导入')
    }

  }
}
</script>


<style lang="scss" scoped>
.search {
  padding-top: 10px;
  clear: both;
}
.table {
  margin-top: 10px;
}
#uploadPic1 {
  width: 900px;
}
#uploadPic2 {
  width: 900px;
}
#uploadPic {
  width: 900px;
}
</style>


<style>
.hide .el-upload--picture-card {
  display: none;
}
</style>
