<template> 
 | 
    <GlobalWindow 
 | 
        :title="title" 
 | 
        width="60%" 
 | 
        submitText="返回修改" 
 | 
        :visible.sync="visible" 
 | 
        :confirm-working="isWorking" 
 | 
        @confirm="confirm" 
 | 
    > 
 | 
        <div class="info"> 
 | 
            <div class="info_label"> 
 | 
              <span v-if="model.status === 0">企业详情(待处理)</span> 
 | 
              <span v-if="model.status === 1">企业详情(已开票)</span> 
 | 
              <span v-if="model.status === 2">企业详情(平台撤回)</span> 
 | 
              <span v-if="model.status === 3">企业详情(已冲红)</span> 
 | 
            </div> 
 | 
            <div class="info_list"> 
 | 
                <div class="info_list_item"> 
 | 
                    <div class="info_list_item_label">开票名称:</div> 
 | 
                    <div class="info_list_item_val">{{ model.companyName}}</div> 
 | 
                </div> 
 | 
                <div class="info_list_item"> 
 | 
                    <div class="info_list_item_label">纳税人识别号:</div> 
 | 
                    <div class="info_list_item_val">{{ model.taxCode }}</div> 
 | 
                </div> 
 | 
                <div class="info_list_item"> 
 | 
                    <div class="info_list_item_label">开户行:</div> 
 | 
                    <div class="info_list_item_val">{{ model.taxBank }}</div> 
 | 
                </div> 
 | 
                <div class="info_list_item"> 
 | 
                    <div class="info_list_item_label">账号:</div> 
 | 
                    <div class="info_list_item_val"> 
 | 
                      {{ model.taxAccount }} 
 | 
                    </div> 
 | 
                </div> 
 | 
                <div class="info_list_item" style="width: 100%;"> 
 | 
                    <div class="info_list_item_label">地址、电话:</div> 
 | 
                    <div class="info_list_item_val">{{ model.taxAddr }}</div> 
 | 
                </div> 
 | 
                <div class="info_list_item" style="width: 100%;"> 
 | 
                    <div class="info_list_item_label">接收方式:</div> 
 | 
                    <div v-if="model.type === 0" class="info_list_item_val">电子发票</div> 
 | 
                    <div v-if="model.type === 1" class="info_list_item_val">纸质发票</div> 
 | 
                </div> 
 | 
                <div class="info_list_item" style="width: 100%;"> 
 | 
                    <div class="info_list_item_label">接收地址:</div> 
 | 
                    <div class="info_list_item_val">{{ model.addr }}</div> 
 | 
                </div> 
 | 
                <div class="info_list_item" style="width: 100%;"> 
 | 
                    <div class="info_list_item_label">开票金额:</div> 
 | 
                    <div class="info_list_item_val" style="color:rgba(249, 86, 1, 0.996078431372549);">{{ model.price }}</div> 
 | 
                </div> 
 | 
            </div> 
 | 
            <el-table 
 | 
                v-if="model.applyType ==0" 
 | 
                :data="tableData" 
 | 
                border 
 | 
                show-summary 
 | 
                :summary-method="getSummaries1" 
 | 
                style="width: 100%; margin-bottom: 20px;"> 
 | 
                <el-table-column 
 | 
                    label="序号" 
 | 
                    align="center" 
 | 
                    width="80"> 
 | 
                    <template slot-scope="scope"> 
 | 
                        <span>{{scope.$index + 1}}</span> 
 | 
                    </template> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="solutionName" 
 | 
                    label="保险方案"> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="applyCode" 
 | 
                    label="保单号"> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="fee" 
 | 
                    label="金额"> 
 | 
                  <template slot-scope="{row}"> 
 | 
                    <span  style="color:rgba(249, 86, 1, 0.996078431372549);">{{row.fee}}</span> 
 | 
                  </template> 
 | 
                </el-table-column> 
 | 
            </el-table> 
 | 
          <el-table 
 | 
            v-if="model.applyType ==1" 
 | 
            :data="tableData1" 
 | 
            border 
 | 
            show-summary 
 | 
            :summary-method="getSummaries" 
 | 
            style="width: 100%; margin-bottom: 20px;"> 
 | 
            <el-table-column 
 | 
                label="保单" 
 | 
                align="center" 
 | 
                width="80"> 
 | 
              <template slot-scope="scope"> 
 | 
                <span>{{scope.$index + 1}}</span> 
 | 
              </template> 
 | 
            </el-table-column> 
 | 
            <el-table-column 
 | 
                align="center" 
 | 
                prop="solutionName" 
 | 
                label="保险方案"> 
 | 
            </el-table-column> 
 | 
            <el-table-column 
 | 
                v-if="model.applyType == 1" 
 | 
                align="center" 
 | 
                prop="applyCode" 
 | 
                label="保单号"> 
 | 
            </el-table-column> 
 | 
            <el-table-column 
 | 
                align="center" 
 | 
                label="批单号"> 
 | 
                <template slot-scope="{row}"> 
 | 
                    <span>{{row.changApplyCode ? row.changApplyCode : '-'}}</span> 
 | 
                </template> 
 | 
            </el-table-column> 
 | 
            <el-table-column 
 | 
                align="center" 
 | 
                prop="fee" 
 | 
                label="金额"> 
 | 
              <template slot-scope="{row}"> 
 | 
                <span  style="color:rgba(249, 86, 1, 0.996078431372549);">{{row.fee}}</span> 
 | 
              </template> 
 | 
            </el-table-column> 
 | 
          </el-table> 
 | 
            <el-table 
 | 
                v-if="model.applyType == 1" 
 | 
                :data="tableData2" 
 | 
                border 
 | 
                show-summary 
 | 
                :summary-method="getSummaries" 
 | 
                style="width: 100%; margin-bottom: 20px;"> 
 | 
                <el-table-column 
 | 
                    label="冲红单" 
 | 
                    align="center" 
 | 
                    width="80"> 
 | 
                    <template slot-scope="scope"> 
 | 
                        <span>{{scope.$index + 1}}</span> 
 | 
                    </template> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="solutionName" 
 | 
                    label="保险方案"> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="taxDoneCode" 
 | 
                    label="发票号"> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="taxCreateDate" 
 | 
                    label="申请开票时间"> 
 | 
                </el-table-column> 
 | 
                <el-table-column 
 | 
                    align="center" 
 | 
                    prop="fee" 
 | 
                    label="发票金额"> 
 | 
                  <template slot-scope="{row}"> 
 | 
                    <span  style="color:rgba(249, 86, 1, 0.996078431372549);">{{row.fee}}</span> 
 | 
                  </template> 
 | 
                </el-table-column> 
 | 
            </el-table> 
 | 
        </div> 
 | 
        <span style="font-size: 14px;" v-if="model.status === 2">退回原因:{{model.cancelInfo}} 开票员-{{model.cancelUserId}} {{model.cancelUserName}}</span> 
 | 
      <el-dialog 
 | 
          title="上传发票" 
 | 
          :visible.sync="visible1" 
 | 
          width="500px" 
 | 
          style="margin-top: 150px" 
 | 
          :show-close="false" 
 | 
          append-to-body 
 | 
          :close-on-click-modal="false" 
 | 
          center> 
 | 
        <div class="form"> 
 | 
          <div class="form_item"> 
 | 
            <div class="form_item_val"> 
 | 
              <el-form :model="form" ref="form" :rules="rules" style="width: 100%;"> 
 | 
                <el-form-item label="填写退回说明:":inline="true"  prop="backInfo"> 
 | 
                  <el-input   v-model="form.backInfo" type="textarea"  placeholder="请输入" /> 
 | 
                </el-form-item> 
 | 
              </el-form> 
 | 
            </div> 
 | 
          </div> 
 | 
          </div> 
 | 
        <span slot="footer" class="dialog-footer"> 
 | 
                <el-button @click="visible1 = false">取 消</el-button> 
 | 
                <el-button type="primary" @click="backDo()">提 交</el-button> 
 | 
            </span> 
 | 
      </el-dialog> 
 | 
      <template v-slot:footer> 
 | 
        <el-button v-if="userInfo.type !== 1 && model.status ==0 && !visible1" type="danger" @click="visible1 = true">退回申请</el-button> 
 | 
        <el-button @click="visible = false">取消</el-button> 
 | 
      </template> 
 | 
    </GlobalWindow> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
import BaseOpera from '@/components/base/BaseOpera' 
 | 
import GlobalWindow from '@/components/common/GlobalWindow' 
 | 
import { getDetail,backApply } from '@/api/business/taxes' 
 | 
import { mapState } from 'vuex' 
 | 
export default { 
 | 
  name: 'OperaCompanyWindow', 
 | 
  extends: BaseOpera, 
 | 
  components: { GlobalWindow }, 
 | 
  data () { 
 | 
    return { 
 | 
      // 表单数据 
 | 
      model: {}, 
 | 
      visible1:false, 
 | 
      form: { 
 | 
        id: null, 
 | 
        backInfo:'' 
 | 
      }, 
 | 
      rules: { 
 | 
        backInfo: [ 
 | 
          { required: true, message: '请输入退回说明' } 
 | 
        ], 
 | 
      }, 
 | 
      tableData: [], 
 | 
      tableData1: [], 
 | 
      tableData2: [] 
 | 
    } 
 | 
  }, 
 | 
    computed: { 
 | 
      ...mapState(['userInfo']) 
 | 
    }, 
 | 
  created () { 
 | 
    this.config({ 
 | 
      api: '/business/taxes', 
 | 
      'field.id': 'id' 
 | 
    }) 
 | 
  }, 
 | 
  methods: { 
 | 
    open (title, target) { 
 | 
      this.title = title 
 | 
      this.visible = true 
 | 
      this.visible1 = false 
 | 
      this.form.backInfo='' 
 | 
      this.model = {} 
 | 
      this.tableData = [] 
 | 
      this.tableData1 = [] 
 | 
      this.tableData2 = [] 
 | 
      this.model = target 
 | 
      this.form.id = target.id 
 | 
      this.getDetails() 
 | 
    }, 
 | 
    backDo(){ 
 | 
      this.$refs.form.validate((valid) => { 
 | 
        if (!valid) { 
 | 
          return 
 | 
        } 
 | 
        this.isWorking = true 
 | 
        backApply(this.form) 
 | 
            .then(response => { 
 | 
              this.visible1 = false 
 | 
              this.getDetails() 
 | 
              this.$emit('success') 
 | 
            }).catch(err => { 
 | 
          this.$tip.apiFailed(err) 
 | 
        }).finally(() => { 
 | 
          this.isWorking = false 
 | 
        }) 
 | 
      }) 
 | 
    }, 
 | 
    getDetails  () { 
 | 
      getDetail(this.model.id).then(res => { 
 | 
        this.model = res 
 | 
        if (res.applyType == 0) { 
 | 
          this.tableData=(res.applyList) 
 | 
        } else { 
 | 
            console.log(res.applyList) 
 | 
            console.log(res.delTaxList) 
 | 
          this.tableData1=(res.applyList) 
 | 
          this.tableData2=(res.delTaxList) 
 | 
        } 
 | 
      }).catch(err => { 
 | 
      }) 
 | 
    }, 
 | 
    getSummaries1 (param) { 
 | 
        const { columns, data } = param 
 | 
        const sums = [] 
 | 
        columns.forEach((column, index) => { 
 | 
            if (index === 0) { 
 | 
                sums[index] = '合计' 
 | 
            } else { 
 | 
                if (index == 3) { 
 | 
                    const values = data.map(item => Number(item[column.property])) 
 | 
                    if (!values.every(value => isNaN(value))) { 
 | 
                        sums[index] = values.reduce((prev, curr) => { 
 | 
                            const value = Number(curr) 
 | 
                            if (!isNaN(value)) { 
 | 
                                return prev + curr 
 | 
                            } else { 
 | 
                                return prev 
 | 
                            } 
 | 
                        }, 0) 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        }) 
 | 
        return  sums 
 | 
    }, 
 | 
    getSummaries (param) { 
 | 
      const { columns, data } = param 
 | 
      const sums = [] 
 | 
      columns.forEach((column, index) => { 
 | 
        if (index === 0) { 
 | 
          sums[index] = '合计' 
 | 
        } else { 
 | 
          if (index == 4) { 
 | 
            const values = data.map(item => Number(item[column.property])) 
 | 
            if (!values.every(value => isNaN(value))) { 
 | 
              sums[index] = values.reduce((prev, curr) => { 
 | 
                const value = Number(curr) 
 | 
                if (!isNaN(value)) { 
 | 
                  return prev + curr 
 | 
                } else { 
 | 
                  return prev 
 | 
                } 
 | 
              }, 0) 
 | 
            } 
 | 
          } 
 | 
        } 
 | 
      }) 
 | 
      return  sums 
 | 
    } 
 | 
  } 
 | 
} 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
    ::v-deep .el-table__footer-wrapper tbody td { 
 | 
      cursor: pointer; 
 | 
      text-align: center; 
 | 
      &:nth-child(5) { 
 | 
        color:rgba(249, 86, 1, 0.996078431372549); 
 | 
      } 
 | 
    } 
 | 
    /*   ::v-deep .el-table__header-wrapper   th:first-child .cell{ 
 | 
          color:rgba(249, 86, 1, 0.996078431372549) !important 
 | 
       } 
 | 
       ::v-deep  table:first-of-type th:first-child .cell{ 
 | 
            //color:rgba(249, 86, 1, 0.996078431372549) !important 
 | 
       } 
 | 
       ::v-deep   .el-table--border th:first-child .cell { 
 | 
         &:nth-child(2) { 
 | 
           color:rgba(249, 86, 1, 0.996078431372549); 
 | 
         } 
 | 
       }*/ 
 | 
  
 | 
  
 | 
    .info { 
 | 
        width: 100%; 
 | 
        .info_label { 
 | 
            width: 100%; 
 | 
            display: flex; 
 | 
            align-items: center; 
 | 
            justify-content: space-between; 
 | 
            margin-bottom: 20px; 
 | 
            span { 
 | 
                font-size: 14px; 
 | 
                font-weight: 500; 
 | 
                color: #000000; 
 | 
            } 
 | 
        } 
 | 
        .info_list { 
 | 
            width: 100%; 
 | 
            display: flex; 
 | 
            align-items: left; 
 | 
            flex-wrap: wrap; 
 | 
            .info_list_item { 
 | 
                width: 50%; 
 | 
                display: flex; 
 | 
                align-items: start; 
 | 
                font-size: 14px; 
 | 
                margin-bottom: 20px; 
 | 
                .info_list_item_label { 
 | 
                    width: 100px; 
 | 
                    flex-shrink: 0; 
 | 
                } 
 | 
                .info_list_item_val { 
 | 
                    flex: 1; 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    .image { 
 | 
                        width: 100px; 
 | 
                        height: 100px; 
 | 
                        display: flex; 
 | 
                        align-items: center; 
 | 
                        justify-content: center; 
 | 
                        overflow: hidden; 
 | 
                        img { 
 | 
                            width: 100%; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
  
 | 
    .form { 
 | 
      width: 100%; 
 | 
      display: flex; 
 | 
      flex-direction: column; 
 | 
      .form_item { 
 | 
        width: 100%; 
 | 
        display: flex; 
 | 
        align-items: center; 
 | 
        margin-bottom: 20px; 
 | 
        &:last-child { 
 | 
          margin-bottom: 0 !important; 
 | 
        } 
 | 
        .form_item_label { 
 | 
          width: 100px; 
 | 
          flex-shrink: 0; 
 | 
          font-size: 14px; 
 | 
          color: black; 
 | 
        } 
 | 
        .form_item_val { 
 | 
          flex: 1; 
 | 
          min-height: 35px; 
 | 
          display: flex; 
 | 
          align-items: center; 
 | 
          input { 
 | 
            width: 100%; 
 | 
            height: 100%; 
 | 
            font-size: 14px; 
 | 
            color: black; 
 | 
            padding: 5px 10px; 
 | 
            outline: none; 
 | 
            box-sizing: border-box; 
 | 
            border: 1px solid #ececec; 
 | 
          } 
 | 
        } 
 | 
      } 
 | 
    } 
 | 
</style> 
 |