<template>
  <div>
    <div v-if="ontype == '1'">
      <div >
        <el-tabs v-model="xiangTab">
          <el-tab-pane label="商家信息" name="one">
            <div style="margin-top: 30px;" class="editcss">
              <TitleWithCircle title="基础信息" />
              <div style="padding: 20px;margin-top: 10px;">
                <el-form :model="info" ref="ruleForm" label-width="140px" class="demo-ruleForm">
                  <el-row :gutter="20">
                    <el-col :span="9">
                      <el-form-item label="姓名" prop="name">
                        <div class="duiqi">{{info.name}}</div>
                      </el-form-item>
                    </el-col>
                    <el-col :span="9">
                      <el-form-item label="手机号" prop="phone">
                        <div class="duiqi">{{info.phone}}</div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="20">
                    <el-col :span="9">
                      <el-form-item label="证件类型" prop="idCardType">
                        <div class="duiqi">{{info.idCardType}}</div>
                      </el-form-item>
                    </el-col>
                    <el-col :span="9">
                      <el-form-item label="身份证号码" prop="idCardNumber">
                        <div class="duiqi">{{info.idCardNumber}}</div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-form-item label="身份证照片（正）" prop="idCardFrontImage">
                    <div style="display: flex;">
                      <allimg v-if="item" :src="item" fit="contain" v-for="item in info.idCardFrontImage.split(',')"
                        style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;" />
                    </div>
                  </el-form-item>
                  <el-form-item label="身份证照片（反）" prop="idCardBackImage">
                    <div style="display: flex;">
                      <allimg v-if="item" :src="item" fit="contain" v-for="item in info.idCardBackImage.split(',')"
                        style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;" />
                    </div>
                  </el-form-item>
                  <el-row :gutter="20">
                    <el-col :span="9">
                      <el-form-item label="评级" prop="rating">
                        <div class="duiqi">{{info.rating || '-'}}</div>
                      </el-form-item>
                    </el-col>
                    <el-col :span="9">
                      <el-form-item label="是否黑名单" prop="idCardNumber">
                        <div class="duiqi">{{info.isBlackList=='2'?'是':'否'}}</div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </el-form>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="意向信息" name="two">
            <div class="editcss"   >
              <div style="padding: 20px;">
                <el-table :data="datalistyx"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="意向租赁类型" prop="leaseType"/>
                  <el-table-column label="主体名称" prop="leaseCycle" />
                  <el-table-column label="主体类型" prop="operationType" />
                  <el-table-column label="经营范围" prop="idCardNumber"  />
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totalyx}}</span> 项数据</div>
                  <el-pagination :current-page="pagequeryyx.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequeryyx.pageSize"
                    background small layout="prev, pager, next" :total="totalyx" @size-change="e => handleSizeChange(e,'pagequeryyx')"
                    @current-change="e=> handleCurrentChange(e,'pagequeryyx')">
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="招商过程信息" name="three">
            <div class="editcss" style="margin-top: 30px;">
              <TitleWithCircle title="跟进记录" />
              <div style="padding: 20px;">
                <el-table :data="datalistgg"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="跟进时间" prop="followUpTime"/>
                  <el-table-column label="跟进类型" prop="followUpType" />
                  <el-table-column label="客户级别" prop="customerLevel" />
                  <el-table-column label="当前阶段" prop="currentStage"  />
                  <el-table-column label="下次更进时间" prop="plan_Time"  >
                    <template slot-scope="scope">
                      {{scope.row.nextFollowUpStartTime}} - {{scope.row.nextFollowUpEndTime}}
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <div @click="open1(scope.row,'1')" class="tableBtn greens">查看记录</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totalgg}}</span> 项数据</div>
                  <el-pagination :current-page="pagequerygg.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequerygg.pageSize"
                    background small layout="prev, pager, next" :total="totalgg" @size-change="e => handleSizeChange(e,'pagequerygg')"
                    @current-change="e=> handleCurrentChange(e,'pagequerygg')">
                  </el-pagination>
                </div>
              </div>
              <TitleWithCircle title="谈判记录" />
              <div style="padding: 20px;">
                <el-table :data="datalisttp"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="谈判时间" prop="negotiationTime"/>
                  <el-table-column label="谈判主题" prop="negotiationTheme" />
                  <el-table-column label="标段号" prop="bidSegmentNumber" />
                  <el-table-column label="当前阶段" prop="currentStage"  />
                  <el-table-column label="下次谈判时间" prop="plan_Time"  >
                    <template slot-scope="scope">
                      {{scope.row.nextNegotiationStartTime}} - {{scope.row.nextNegotiationEndTime}}
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <div @click="open1(scope.row,'2')" class="tableBtn greens">查看记录</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totaltp}}</span> 项数据</div>
                  <el-pagination :current-page="pagequerytp.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequerytp.pageSize"
                    background small layout="prev, pager, next" :total="totaltp" @size-change="e => handleSizeChange(e,'pagequerytp')"
                    @current-change="e=> handleCurrentChange(e,'pagequerytp')">
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="商户租赁信息" name="four">
            <div class="editcss" style="margin-top: 30px;">
              <TitleWithCircle title="商铺资源" />
              <div style="padding: 20px;">
                <el-table :data="zlsplist"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="商铺名称" prop="followUpTime">
                    <template slot-scope="scope">
                      {{scope.row.cereBasicInformationShop.shopName?scope.row.cereBasicInformationShop.shopName:scope.row.cereAdvertisingInformation.advertisingName?scope.row.cereAdvertisingInformation.advertisingName:scope.row.cereBasicInformationVenue.venueName}}
                    </template>
                  </el-table-column>
                  <el-table-column label="店铺名称" prop="followUpType" >
                    <template slot-scope="scope">
                      {{scope.row.cereBasicInformationShop?(scope.row.cereBasicInformationShop.storeName || '-'):'-'}}
                    </template>
                  </el-table-column>
                  <el-table-column label="详细位置" prop="detailedLocation" >
                    <template slot-scope="scope">
                      {{scope.row.cereBasicInformationShop.detailedLocation || '-'}}
                    </template>
                  </el-table-column>
                  <el-table-column label="租金（元）/周期" prop="currentStage" >
                    <template slot-scope="scope">
                      {{scope.row.contractAmount}}/{{ scope.row.paymentCycle }}
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <div @click="details(scope.row,'1')" class="tableBtn greens">查看</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{zlsplist.length}}</span> 项数据</div>
                  <el-pagination :current-page="1" :page-sizes="[10, 20, 50, 100]" :page-size="50"
                    background small layout="prev, pager, next" :total="zlsplist.length" >
                  </el-pagination>
                </div>
              </div>
              <TitleWithCircle title="广告位资源" />
              <div style="padding: 20px;">
                <el-table :data="zlgglist"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="广告位名称" prop="followUpTime">
                    <template slot-scope="scope">
                      {{scope.row.cereBasicInformationShop.shopName?scope.row.cereBasicInformationShop.shopName:scope.row.cereAdvertisingInformation.advertisingName?scope.row.cereAdvertisingInformation.advertisingName:scope.row.cereBasicInformationVenue.venueName}}
                    </template>
                  </el-table-column>
                  <el-table-column label="投放时间" prop="followUpTime">
                    <template slot-scope="scope">
                      {{scope.row.leaseStartDate}} 至 {{scope.row.contractTerminationDate}}
                    </template>
                  </el-table-column>
                  <el-table-column label="广告位类型" prop="followUpTime">
                    <template slot-scope="scope">
                      {{scope.row.cereAdvertisingInformation.advertisingType}} 
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <div @click="details(scope.row,'1')" class="tableBtn greens">查看</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{zlgglist.length}}</span> 项数据</div>
                  <el-pagination :current-page="1" :page-sizes="[10, 20, 50, 100]" :page-size="50"
                    background small layout="prev, pager, next" :total="zlgglist.length" >
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="缴费记录" name="five">
            <div class="editcss" style="margin-top: 30px;">
              <TitleWithCircle title="租赁缴费" />
              <div style="padding: 20px;">
                <el-table :data="datalistzljf"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="资源名称" prop="shopName"/>
                  <el-table-column label="租金/周期" >
                    <template slot-scope="scope">
                      {{ scope.row.paymentAmount  }} / {{ scope.row.payType=='1'?'日':scope.row.payType=='2'?'月':scope.row.payType=='3'?'季':scope.row.payType=='4'?'年':'' }}
                    </template>
                  </el-table-column>
                  <el-table-column label="付款日" prop="payDay"/>
                  <el-table-column label="缴费时间" prop="paymentTime"/>
                  <el-table-column label="付款类型" >
                    <template slot-scope="scope">
                      线上缴费
                    </template>
                  </el-table-column>

                  <el-table-column label="状态" prop="payState">
                    <template slot-scope="scope">
                      {{ scope.row.payState=='0'?'未缴费':scope.row.payState=='1'?'缴费成功':'' }}
                    </template>
                  </el-table-column>
                  <el-table-column label="财务复核" prop="isOpeningInvoice">
                    <template slot-scope="scope">
                      {{ scope.row.isOpeningInvoice=='0'?'待复核':scope.row.isOpeningInvoice=='1'?'待开发票':scope.row.isOpeningInvoice=='2'?'已开发票':'-'}}
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <!-- <div class="tableBtn greens">查看</div> -->
                      <div @click="fhjf(scope.row)" class="tableBtn greens" v-if="scope.row.payState=='1' && scope.row.isOpeningInvoice=='0'">复核</div>
                      <div @click ="openckfapinfo(scope.row)"  class="tableBtn greens" v-if="scope.row.isOpeningInvoice!='0'">查看开票信息</div>
                      <div @click ="openaddfapinfo(scope.row)" class="tableBtn greens" v-if="scope.row.isOpeningInvoice=='1'">上传发票</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totalzljf}}</span> 项数据</div>
                  <el-pagination :current-page="pagequeryzljf.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequeryzljf.pageSize"
                    background small layout="prev, pager, next" :total="totalzljf" @size-change="e => handleSizeChange(e,'pagequeryzljf')"
                    @current-change="e=> handleCurrentChange(e,'pagequeryzljf')">
                  </el-pagination>
                </div>
              </div>
              <TitleWithCircle title="物业缴费" />
              <div style="padding: 20px;">
                <el-table :data="datalistwyjf"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="店铺" prop="merchantName"/>
                  <el-table-column label="金额（元）" prop="actualPaymentFee">
                    <template slot-scope="scope">
                      {{ scope.row.actualPaymentFee/100}}
                    </template>
                  </el-table-column>
                  <el-table-column label="付款时间" prop="paymentCompletionTime">
                    <template slot-scope="scope">
                      {{ scope.row.paymentCompletionTime || '-'}}
                    </template>
                  </el-table-column>
                  <el-table-column label="备注" prop="paymentMethod">
                    <template slot-scope="scope">
                      {{ scope.row.paymentMethod || '-'}}
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totalwyjf}}</span> 项数据</div>
                  <el-pagination :current-page="pagequerywyjf.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequerywyjf.pageSize"
                    background small layout="prev, pager, next" :total="totalwyjf" @size-change="e => handleSizeChange(e,'pagequerywyjf')"
                    @current-change="e=> handleCurrentChange(e,'pagequerywyjf')">
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="合同信息" name="six">
            <div class="editcss"   >
              <div style="padding: 20px;">
                <el-table :data="datalistht"
                :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
                tooltip-effect="dark custom-tooltip-effect">
                  <el-table-column label="序号" width="100">
                    <template slot-scope="scope">
                      {{scope.$index +1 }}
                    </template>
                  </el-table-column>
                  <el-table-column label="合同名称" prop="contractName"/>
                  <el-table-column label="合同金额（元）" prop="contractAmount"/>
                  <el-table-column label="签订日期" prop="contractSigningDate"/>
                  <el-table-column label="终止日期" prop="contractTerminationDate"/>
                  <el-table-column label="合同类型" prop="contractType"/>
                  <el-table-column label="状态" prop="dataStatus">
                    <template slot-scope="scope">
                      <span v-if='scope.row.dataStatus == 1'>使用中</span>
                      <span v-else-if='scope.row.dataStatus == 2'>往期合同</span>
                      <span v-else-if='scope.row.dataStatus == 3'>已终止</span>
                      <span v-else-if='scope.row.dataStatus == 4'>待发起</span>
                      <span v-else-if='scope.row.dataStatus == 5'>待审核</span>
                      <span v-else-if='scope.row.dataStatus == 6'>已拒绝</span>
                      <span v-else>-</span>
                    </template>
                  </el-table-column>
                  <el-table-column label="操作" fixed="right">
                    <template slot-scope="scope">
                      <div @click="details(scope.row,'1')" class="tableBtn greens">查看</div>
                      <div v-if='scope.row.dataStatus == 1' @click="removeinfo(scope.row,'合同变更')" class="tableBtn greens">合同变更</div>
                      <div v-if='scope.row.dataStatus == 1' @click="removeinfo(scope.row,'合同续约')" class="tableBtn greens">合同续约</div>
                      <div v-if='scope.row.dataStatus == 1' @click="removeinfozz(scope.row,'合同终止')" class="tableBtn greens">合同终止</div>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="display: flex;justify-content: space-between;" class="bom">
                  <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{totalht}}</span> 项数据</div>
                  <el-pagination :current-page="pagequeryht.pageNumber+1" :page-sizes="[10, 20, 50, 100]" :page-size="pagequeryht.pageSize"
                    background small layout="prev, pager, next" :total="totalht" @size-change="e => handleSizeChange(e,'pagequeryht')"
                    @current-change="e=> handleCurrentChange(e,'pagequeryht')">
                  </el-pagination>
                </div>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
      <div v-if="info.checkState == '1' && issp == '2'">
        <TitleWithCircle title="审核情况" />
        <div style="padding: 20px;">
          <el-form :model="info" label-width="100px" class="demo-ruleForm">
            <el-form-item label="状态" style="align-items: center;">
              <el-radio v-model="radio" label="2">通过</el-radio>
              <el-radio v-model="radio" label="3">不通过</el-radio>
            </el-form-item>
            <el-form-item label="审核意见">
              <el-input maxlength="200" show-word-limit rows="4" v-model="checkOpinion" placeholder="请输入审核意见"
                type="textarea" />
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div v-if="info.checkState == '2' || info.checkState == '3'">
        <TitleWithCircle title="审核结果" />
        <div style="padding: 20px;">
          <el-form :model="info" label-width="100px" class="demo-ruleForm">
            <el-form-item label="状态">
              <div class="duiqi">{{info.checkState=='2'?'已通过':info.checkState=='3'?'不通过':'无'}}</div>
            </el-form-item>
            <el-form-item label="审核意见">
              <div class="duiqi">{{info.checkOpinion || '无'}}</div>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div>
        <el-button v-if="info.checkState == '1' && issp == '2'" @click="minSev"
          style="background-color: #3F9B6A;color: #fff;">确定</el-button>
        <el-button class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;margin-top: 20px;"
          @click="changetype">返回</el-button>
      </div>
    </div>
    <div class="zhuti" v-if="ontype == '3'"  style="margin-top: 30px;">
      <TitleWithCircle title="跟进日志" v-if="zstype == '1'"/>
      <TitleWithCircle title="谈判日志" v-if="zstype == '2'"/>
      <div style="padding: 20px;margin-top: 10px;" v-if="zstype == '1'">
        <el-form :model="formInline" ref="formInline" label-width="120px" class="demo-ruleForm">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="跟进时间" prop="followUpTime">
              <div class="duiqi">{{formInline.followUpTime  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="跟进类型" prop="followUpType" >
              <div class="duiqi">{{formInline.followUpType  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="客户级别" prop="customerLevel" style="width: 100%;">
              <div class="duiqi">{{formInline.customerLevel  || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="当前阶段" prop="currentStage">
              <div class="duiqi">{{formInline.currentStage  || '无'}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="意向资源"  style="width: 100%;">
          <div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
            <div style="padding: 15px;">
              <div style="padding: 0px 20px 0px 0px">
                <el-table :data="addziyuanData"
                  :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
                  <el-table-column label="序号">
                    <template slot-scope="scope">
                      {{scope.$index + 1}}
                    </template>
                  </el-table-column>
                  <el-table-column label="资源编号" prop="id" ></el-table-column>
                  <el-table-column label="意向资源名称"  prop="name"   show-overflow-tooltip>
                    <template slot-scope="scope">
                      {{scope.row.shopName ? scope.row.shopName :  scope.row.advertisingName?scope.row.advertisingName:scope.row.venueName}}
                    </template>
                  </el-table-column>
                  <el-table-column label="意向资源类型" prop="type" >
                    <template slot-scope="scope">
                      {{scope.row.shopName ? '商铺' : scope.row.advertisingType?scope.row.advertisingType:'场地'}}
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="内容反馈" prop="contentFeedback">
          <div class="duiqi">{{formInline.contentFeedback  || '无'}}</div>
        </el-form-item>
        <el-form-item label="现场照片">
          <div style="display: flex;">
            <allimg v-if="item" :src="item" fit="contain" v-for="item in imgList"
              style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;" />
          </div>
        </el-form-item>
        <el-form-item label="下次更进时间" prop="plan_Time">
          <div class="duiqi">{{formInline.plan_Time?formInline.plan_Time.length>0?formInline.plan_Time[0]+' 至 '+formInline.plan_Time[1]:'无':'无'}}</div>
        </el-form-item>
      </el-form>
      </div>
      <div style="padding: 20px;margin-top: 10px;" v-if="zstype == '2'">
        <el-form ref="tanform" :model="formInline"  label-width="120px">
          <el-form-item label="谈判时间" prop="negotiationTime">
            <div class="duiqi">{{formInline.negotiationTime  || '无'}}</div>
          </el-form-item>
          <el-form-item label="谈判主题" prop="negotiationTheme" >
            <div class="duiqi">{{formInline.negotiationTheme  || '无'}}</div>
          </el-form-item>
          <el-form-item label="标段号" prop="bidSegmentNumber" >
            <div class="duiqi">{{formInline.bidSegmentNumber  || '无'}}</div>
          </el-form-item>

          <el-form-item label="会议纪要" prop="meetingMinutes">
            <div class="duiqi">{{formInline.meetingMinutes  || '无'}}</div>
          </el-form-item>
          <el-form-item label="谈判内容" prop="negotiationContent">
            <div class="duiqi">{{formInline.negotiationContent  || '无'}}</div>
          </el-form-item>
          <el-form-item label="谈判结果" prop="negotiationResult">
            <div class="duiqi">{{formInline.negotiationResult  || '无'}}</div>
          </el-form-item>
          <el-form-item label="当前阶段" prop="currentStage">
            <div class="duiqi">{{formInline.currentStage  || '无'}}</div>
          </el-form-item>
          <el-form-item label="其他附件" prop="otherAttachments">
            <div class="duiqi greens"
              @click="formInline.otherAttachments?openfile(formInline.otherAttachments):''">
              {{formInline.otherAttachments?'查看详情':'暂无文件'}}</div>
          </el-form-item>
          <el-form-item label="现场照片">
            <div style="display:flex;flex-wrap: wrap">
              <div style="display: flex;">
                <allimg v-if="item" :src="item" fit="contain" v-for="item in imgList"
                  style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;" />
              </div>
            </div>
          </el-form-item>
          <el-form-item label="下次谈判时间" prop="plan_Time">
            <div class="duiqi">{{formInline.plan_Time?formInline.plan_Time.length>0&&formInline.plan_Time[0]?formInline.plan_Time[0]+' 至 '+formInline.plan_Time[1]:'无':'无'}}</div>
          </el-form-item>
        </el-form>
      </div>
      <div style="display: flex;">
        <el-button @click="closeFn" class="buttonHover"
          style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">返回</el-button>
      </div>
    </div>
    <div class="zhuti" v-if="ontype == '4'">
      <!-- <TitleWithCircle title="合同管理"/> -->
      <div>
        <busCha :issp="issp" :info="detailsinfo" @removeonaction="removeonaction"></busCha>
      </div>
    </div>
    <div class="zhuti" v-if="ontype == '5'">
      <!-- <TitleWithCircle :title="contractChangeReason"/> -->
      <div style="padding: 20px 20px 20px 0;">
        <add :info="detailsinfo" :contractChangeReason="contractChangeReason" @removeonaction="removeonaction"></add>
      </div>
    </div>
    <el-dialog :visible.sync="addfapinfo" title="上传发票" width="65%" append-to-body center :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
      <el-form :model="fapinfo" :rules="rulesfapinfo" ref="fapForm" label-width="130px" class="demo-ruleForm">
        <!-- <el-row :gutter="20" v-if="isaddshow">
          <el-col :span="12">
            <el-form-item label="商铺类型" prop="invoiceType">
              <el-select v-model="fapinfo.invoiceType" placeholder="请选择" style="width: 100%;">
                <el-option label="普通发票" value="普通发票"></el-option>
                <el-option label="专用发票" value="专用发票"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抬头类型" prop="titleType">
              <el-select v-model="fapinfo.titleType" placeholder="请选择" style="width: 100%;" @change="changeTitleType">
                <el-option label="个人" value="个人"></el-option>
                <el-option label="单位" value="单位"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="发票抬头" prop="invoiceTitle">
              <el-input v-model="fapinfo.invoiceTitle" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单位税号" prop="unitTaxNo">
              <el-input v-model="fapinfo.unitTaxNo" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="注册地址" prop="registerAddress">
              <el-input v-model="fapinfo.registerAddress" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="注册电话" prop="registerPhone">
              <el-input v-model="fapinfo.registerPhone" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开户银行" prop="openingBank">
              <el-input v-model="fapinfo.openingBank" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收票邮箱" prop="receiptEmail">
              <el-input v-model="fapinfo.receiptEmail" placeholder="请输入"  maxlength="50"></el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
        
        <el-form-item  label="发票图片" prop="invoiceUrl">
			<upfile  filePath="sp" inputtype="invoiceUrl" :value="fapinfo.invoiceUrl" accept=".pdf"  @changimg="e=>changimg(e,'invoiceUrl')"></upfile>
          <!-- <upimg :cmpOption="{disabled:false,isSetCover:false}" filePath="sp" inputtype="architecturalDrawings" :value="fapinfo.invoiceUrl"
            @changimg="e=>changimg(e,'invoiceUrl')"></upimg> -->
        </el-form-item>
        <el-form-item>
          <div style="margin-top: 20px;display: flex;flex-direction: row-reverse;">
            <el-button @click="addfapinfo = false" class="buttonHover"
              style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;margin-left: 15px;">取消</el-button>
            <el-button @click="add()" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
            
          </div>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog :visible.sync="ckfapinfo" title="查看发票" width="65%" append-to-body center :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
      <el-form :model="formInline" :rules="rulesfapinfo" ref="fapForm" label-width="130px" class="demo-ruleForm">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="发票类型" prop="invoiceType">
              <div class="duiqi">{{formInline.invoiceType || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抬头类型" prop="titleType">
              <div class="duiqi">{{formInline.titleType || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="发票抬头" prop="invoiceTitle">
              <div class="duiqi">{{formInline.invoiceTitle || '无'}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="单位税号" prop="unitTaxNo">
              <div class="duiqi">{{formInline.unitTaxNo || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="注册地址" prop="registerAddress">
              <div class="duiqi">{{formInline.registerAddress || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="注册电话" prop="registerPhone">
              <div class="duiqi">{{formInline.registerPhone || '无'}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="开户银行" prop="openingBank">
              <div class="duiqi">{{formInline.openingBank || '无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收票邮箱" prop="receiptEmail">
              <div class="duiqi">{{formInline.receiptEmail || '无'}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="发票图片" prop="invoiceUrl">
          <div v-if="formInline.invoiceUrl">
              <div style="display: flex;">
				  <a class="greens" :href="$baseURL+formInline.invoiceUrl"
				  	target="_blank" download>{{formInline.invoiceUrl?'查看详情':'无'}}</a>
				  <!-- <div :class="formInline.invoiceUrl?'greens':''" @click ="editbgid.otherImageVideos?openfile($baseURL+formInline.invoiceUrl):''">{{formInline.invoiceUrl?'查看详情':'无'}}</div> -->
                <!-- <allimg v-if="item" :src="item" fit="contain"  v-for="item in formInline.invoiceUrl.split(',')" style="width: 112px;height: 112px;border: 1px dotted #dcdfe6;border-radius: 2px;overflow: hidden;margin: 0 10px 10px 0;"/> -->
              </div>
          </div>
          <div  class="duiqi" v-else>无</div>
        </el-form-item>
        <el-form-item>
          <div style="margin-top: 20px;display: flex;flex-direction: row-reverse;">
            <el-button @click="ckfapinfo = false" class="buttonHover"
              style="color: #606266;border: 1px solid #DBDBDB;background-color: #fff;margin-left: 15px;">关闭</el-button>
          </div>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
  import upimg from "@/components/ImageUpload/index"
  import {
    cerePlatformMerchantedit,

    cereNegotiationDetails,
    cereFollowDetails,
    cerePropertyOrder,
    editToRecheck,
    uploadInvoice,
    cereInvoiceTitlegetByTenementId,
    cereContractInformationgetPage,
    cerePaymentInfo,
    cereContractInformationgetPages
  } from '@/api/newly.js'
  import {
    icManAll
  } from '@/api/icManagement.js'
  import TitleWithCircle from '@/components/top/index';
  import allimg from '@/components/chakan/allimg.vue';
  import busCha from '@/components/buscha/busCha'
  import add from '@/components/add/addht.vue'
  import upfile from "@/components/fujianUpload/fujianList"
  export default {
    components: {
      TitleWithCircle,
      allimg,
      upimg,
      busCha,
      add,
	  upfile
    },
    props: {
      info: {
        type: Object,
        default: function() {
          return {}; // 返回一个空数组作为默认值
        },
      },
      issp: {
        type: String,
        default: function() {
          return '1';
        },
      },
    },
    data() {
      return {
        // 合同
        contractChangeReason:'',
        issp:'1',
        detailsinfo:{},

        isaddshow:true,
        fapinfo: {
          invoiceType: '', // 发票类型，例如 '普通发票' 或 '专用发票'
          titleType: '', // 抬头类型，例如 '个人' 或 '单位'
          invoiceTitle: '', // 发票抬头
          unitTaxNo: '', // 单位税号
          registerAddress: '', // 注册地址
          registerPhone: '', // 注册电话
          openingBank: '', // 开户银行
          receiptEmail: '', // 收票邮箱
          invoiceUrl: '' // 发票图片的 URL
        },
        ckfapinfo:false,
        addfapinfo:false,
        rulesfapinfo:{
          invoiceType: [{
            required: true,
            message: '请选择商铺类型',
            trigger: 'blur'
          }, ],
          titleType: [{
            required: true,
            message: '请选择抬头类型',
            trigger: 'blur'
          }, ],
          invoiceTitle: [{
            required: true,
            message: '请输入发票抬头',
            trigger: 'blur'
          }, ],
        },
        addziyuanData:[],
        formInline:{},
        ontype:'1',
        totalyx: 0,
        pagequeryyx:{
          pageNumber: 0,
          pageSize: 10,
        },
        datalistyx:[],

        totalwyjf: 0,
        pagequerywyjf:{
          pageNumber: 0,
          pageSize: 10,
        },
        datalistwyjf:[],

        totalzljf: 0,
        pagequeryzljf:{
          pageNumber: 0,
          pageSize: 10,
          // "relatedMerchants":"27"
        },
        datalistzljf:[],

        totalgg: 0,
        pagequerygg:{
          pageNumber: 0,
          pageSize: 10,
        },
        datalistgg:[],


        totalht: 0,
        pagequeryht:{
          pageNumber: 0,
          pageSize: 10,
        },
        datalistht:[],

        totaltp: 0,
        pagequerytp:{
          pageNumber: 0,
          pageSize: 10,
        },
        datalisttp:[],

        pagequeryzl:{
          pageNumber: 0,
          pageSize: 100,
          // relatedMerchants:'28'
        },
        zlgglist:[],
        zlsplist:[],

        checkOpinion: '',
        radio: '2',
        xiangTab: 'one',
        list: [],
        zstype:"1"
      }
    },
    created() {
      this.pagequeryyx.phone = this.info.phone
      this.pagequerytp.phone = this.info.phone
      this.pagequerygg.phone = this.info.phone
      this.pagequeryzl.relatedMerchants  = this.info.id
      this.pagequeryzljf.relatedMerchants = this.info.id
      this.pagequerywyjf.paymentAccount= this.info.phone
      this.pagequeryht.relatedMerchants  = this.info.id
      this.getAllyx()
      
      this.getAlltp()
      this.getAllgg()
      this.getAllzljf()
      this.getAllht()
      this.getAllwyjf()
      this.getAllzl()
    },
    computed: {

    },
    methods: {
      changeTitleType(e) {
        console.error(e)
        this.isaddshow = false
        if(e == '个人') {
          this.rulesfapinfo={
            invoiceType: [{
              required: true,
              message: '请选择商铺类型',
              trigger: 'blur'
            }, ],
            titleType: [{
              required: true,
              message: '请选择抬头类型',
              trigger: 'blur'
            }, ],
            invoiceTitle: [{
              required: true,
              message: '请输入发票抬头',
              trigger: 'blur'
            }, ],
          }
        } else if(e == '单位') {
          this.rulesfapinfo={
            invoiceType: [{
              required: true,
              message: '请选择商铺类型',
              trigger: 'blur'
            }, ],
            titleType: [{
              required: true,
              message: '请选择抬头类型',
              trigger: 'blur'
            }, ],
            invoiceTitle: [{
              required: true,
              message: '请输入发票抬头',
              trigger: 'blur'
            }, ],
            unitTaxNo: [{
              required: true,
              message: '请输入单位税号',
              trigger: 'blur'
            }, ],
            registerAddress: [{
              required: true,
              message: '请输入注册地址',
              trigger: 'blur'
            }, ],
            registerPhone: [{
              required: true,
              message: '请输入注册电话',
              trigger: 'blur'
            }, ],
            openingBank: [{
              required: true,
              message: '请输入开户银行',
              trigger: 'blur'
            }, ],
            bankAccount: [{
              required: true,
              message: '请输入银行账号',
              trigger: 'blur'
            }, ],
          }
        }
        this.$nextTick(() => {
            this.isaddshow =  true
          })
      },
      openckfapinfo(item) {
        cereInvoiceTitlegetByTenementId({id:item.id}).then(res => {
          // console.error(res.data)
          this.formInline = res.data
          this.ckfapinfo = true
        })
      },
      openaddfapinfo(item) {
		  
        this.formInline = item
		
        this.addfapinfo = true
      },
      add(){
        this.fapinfo.tenementId = this.formInline.id
        console.error({...this.fapinfo})
        this.$refs.fapForm.validate((valid) => {
          console.log(valid)
          if (valid) {
            uploadInvoice(this.fapinfo).then(res => {
              if (res.code == 200) {
                this.$message({
                  message: '上传成功',
                  type: 'success'
                })
                this.addfapinfo = false
                this.pagequeryzljf.pageNumber = 0
                this.getAllzljf()
              } else {
                this.$message({
                  message: res.msg,
                  type: 'error'
                })
              }
            })
          } else {
            this.$message({
              message: '请填写完整信息',
              type: 'error'
            })
          }


        })
      },
      changimg(e, type) {
        this.fapinfo[type] = e
      },
      closeFn(){
        this.ontype = '1'
      },
      open1(item,type){
        this.formInline = {}
        this.formInline = item
        this.formInline.plan_Time = [item.nextFollowUpStartTime, item.nextFollowUpEndTime]
        if (typeof item.intendedResource == 'string' && item.intendedResource != '') {
          this.addziyuanData = JSON.parse(item.intendedResource)
        }

        if (typeof item.onSitePhotos == 'string') {
          this.imgList = item.onSitePhotos.split(',') || []
        }
        this.zstype = type
        this.ontype = '3'
      },
      getAllzl() {
        cereContractInformationgetPages(this.pagequeryzl).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistht= [];
            return;
          }
          console.error('[[[[[[[[[[]]]]]]]]]]')
          this.zlsplist = res.data.content.filter( item => {
            return item.cereBasicInformationShop.id || item.cereBasicInformationVenue.id
          })
          this.zlgglist = res.data.content.filter( item => {
            return item.cereAdvertisingInformation.id
          })
          console.error(res.data.content)
        })
      },
      getAllht() {
        cereContractInformationgetPage(this.pagequeryht).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistht= [];
            return;
          }
          this.datalistht = res.data.content
          this.totalht = res.data.totalElements
        })
      },
      getAllwyjf() {
        cerePaymentInfo(this.pagequerywyjf).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistwyjf= [];
            return;
          }
          this.datalistwyjf = res.data.content
          this.totalwyjf = res.data.totalElements
        })
      },
      getAllzljf() {
        cerePropertyOrder(this.pagequeryzljf).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistzljf= [];
            return;
          }
          this.datalistzljf = res.data.content
          this.totalzljf = res.data.totalElements
        })
      },
      getAllgg() {
        cereFollowDetails(this.pagequerygg).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistgg = [];
            return;
          }
          this.datalistgg = res.data.content
          this.totalgg = res.data.totalElements
        })
      },
      getAlltp() {
        cereNegotiationDetails(this.pagequerytp).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalisttp= [];
            return;
          }
          this.datalisttp = res.data.content
          this.totaltp = res.data.totalElements
        })
      },
      getAllyx() {
        icManAll(this.pagequeryyx).then(res => {
          console.error(res)
          if (!Array.isArray(res.data.content)) {
            this.datalistyx = [];
            return;
          }
          this.datalistyx = res.data.content
          this.totalyx = res.data.totalElements
        })
      },
      handleCurrentChange(val,type) {
        this[type].pageNumber = val - 1
        if(type == 'pagequeryyx') {
          this.getAllyx()
        } else if(type == 'pagequerytp') {
          this.getAlltp()
        } else if(type == 'pagequerygg') {
          this.getAllgg()
        } else if(type == 'pagequeryzljf') {
          this.getAllzljf()
        } else if(type == 'pagequeryht') {
          this.getAllht()
        } else if(type == 'pagequerywyjf') {
          this.getAllwyjf()
        }
      },
      handleSizeChange(val,type) {
        this[type].pageSize = val
        this[type].pageNumber = 0
        if(type == 'pagequeryyx') {
          this.getAllyx()
        } else if(type == 'pagequerytp') {
          this.getAlltp()
        } else if(type == 'pagequerygg') {
          this.getAllgg()
        } else if(type == 'pagequeryzljf') {
          this.getAllzljf()
        } else if(type == 'pagequeryht') {
          this.getAllht()
        } else if(type == 'pagequerywyjf') {
          this.getAllwyjf()
        }
      },
      minSev() {
        let that = this
        console.error(this.info)
        // return
        cerePlatformMerchantedit({
          ...this.info,
          'checkState': this.radio,
          checkOpinion: this.checkOpinion ? this.checkOpinion : null
        }).then(res => {
          console.error(res)
          if (res.code == 200) {
            this.$message({
              message: '处理成功',
              type: 'success'
            })
            that.setmsg()
            this.info.checkState = this.radio
            this.$emit('removeonaction', '1')
          } else {
            this.$message({
              message: '处理失败',
              type: 'error'
            })
          }
        })
      },
      async setmsg() {
        let info = {
          type: '通知消息',
          phone: this.info.phone,
          content: {
            type: '1',
            title: this.radio == '2' ? '商家审核已通过' : this.radio == '3' ? '商家审核已驳回' : '商家',
            content: this.checkOpinion
          },
        }
        await this.$setmsg(info);
      },
      changetype() {
        this.xiangTab = 'first'
        this.$emit('removeonaction', '1')
      },
      //复核
      fhjf(item) {
        const h = this.$createElement;
        this.$msgbox({
          title: '消息',
          message: h('p', null, [
            h('span', null, '是否复核 '),
          ]),
          showCancelButton: true,
          showClose: false,
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          customClass: 'oe-dialog-btn',
          beforeClose: (action, instance, done) => {
            if (action === 'confirm') {
              editToRecheck({
                id: item.id
              }).then(res => {
                this.$message({
                  message: '复核成功',
                  type: 'success'
                })
                this.pagequeryzljf.pageNumber = 0
                this.getAllzljf()
                done();
              })
            } else {
              done();
            }
          }
        })
      },
      //合同操作
      details(row,e) {
        this.issp = e
        this.detailsinfo = row
        this.ontype = '4'
      },
      removeonaction(e) {
        this.ontype = '1'
      },
      removeinfo(row, e) {
        this.contractChangeReason = e
        // console.error(this.contractChangeReason)
        this.detailsinfo = row
        this.ontype = '5'
      },
      removeinfozz(row, e) {
        let that = this
        this.$confirm('确定要终止合同吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          cereContractInformation({
            ...row,
            contractChangeReason: e,
            dataStatus: '3',
            originalContractCode: row.contractNumber,
            updateDate: that.gettime(),
            createDate: that.gettime(),
            contractChangeTime: that.gettime(),
            updateUser:localStorage.getItem('roleName')
          }).then(res => {
            console.error(res)
            if (res.code == 200) {
              this.$message({
                message: '终止成功',
                type: 'success'
              })
              let c1 = row.shopNumber
              modifyResourceStatus({
                resourcesId: c1,
                status:"0"
              }).then(res => {
                console.error(res)
              })
              // this.$emit('removeonaction', '1')
              this.getAll()
            } else {
              this.$message({
                message: res.msg,
                type: 'error'
              })
            }

          })
        })
      },
    }
  }
</script>
<style>
  .el-form-item__label {
    color: #a2a2a2;
  }

  .greens {
    color: #3F9B6A;
  }
</style>
