auditZtx.vue 19 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
<template>
  <div class="">
    <div class="from-Card">
      <el-form
        ref="queryRef" size="small" :model="queryParams" :inline="true" label-width="100px"
        label-position="top"
      >
        <el-row justify="" style="width: 100%; ">

          <el-col :span="4">
            <el-form-item label="缴费名称" prop="certName">
              <el-input v-model.trim="queryParams.certName" style="width: 100%;" @keyup.enter="searchFN" />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="缴费单位" prop="memberName">
              <el-input v-model.trim="queryParams.memberName" style="width: 100%;" @keyup.enter="searchFN" />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="审核状态" prop="auditStatus">
              <el-select v-model.trim="queryParams.auditStatus" style="width: 100%;" placeholder="" @change="searchFN">
                <el-option label="全部" value="" />
                <el-option label="审核中" value="0" />
                <el-option label="审核通过" value="1" />
                <el-option label="审核拒绝" value="2" />
                <el-option label="撤回" value="3" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="会员证" prop="sendJiaoFeiFlag">
              <el-select v-model.trim="queryParams.sendJiaoFeiFlag" style="width: 100%;" placeholder="" @change="searchFN">
                <el-option label="全部" value="" />
                <el-option label="已下发" value="1" />
                <el-option label="未下发" value="0" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="结算编号" prop="flowCode">
              <el-input v-model.trim="queryParams.flowCode" style="width: 100%;" @keyup.enter="searchFN" />
            </el-form-item>
          </el-col>
          <el-col :span="4" :hidden="showCollect">
            <el-form-item label="缴费编号" prop="originCode">
              <el-input v-model.trim="queryParams.originCode" style="width: 100%;" @keyup.enter="searchFN" />
            </el-form-item>
          </el-col>
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="提交日期" prop="isBlack">
              <el-date-picker
                v-model.trim="commitTime"
                style="width: 100%;" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" range-separator="至"
                start-placeholder="开始时间" end-placeholder="结束时间"
                @change="searchFN"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8" :hidden="showCollect">
            <el-form-item label="审核日期" prop="isBlack">
              <el-date-picker
                v-model.trim="overDateRange"
                style="width: 100%;" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" range-separator="至"
                start-placeholder="开始时间" end-placeholder="结束时间"
                @change="searchFN"
              />
            </el-form-item>
          </el-col>
          <div class="po-r-btns">
            <el-button size="small" type="primary" icon="Search" @click="searchFN">搜索</el-button>
            <el-button size="small" icon="Refresh" @click="resetQuery">重置</el-button>
            <el-button
              v-if="showCollect" size="small" type="primary" link icon="ArrowDown"
              @click="showCollect=!showCollect"
            >展开</el-button>
            <el-button
              v-else size="small" type="primary" link icon="ArrowUp"
              @click="showCollect=!showCollect"
            >收起</el-button>
          </div>

        </el-row>

      </el-form>
      <el-row justify="space-between">
        <div>
          <el-button :disabled="multiple" :icon="DocumentChecked" color="#13B5B1" style="--el-color-black:#fff;" @click="batchAudit">批量审核</el-button>
          <el-button :disabled="multiple" :icon="Position" type="primary" @click="issuesFN">批量下发会员证</el-button>
          <el-button :disabled="multiple" :icon="Download" type="primary" @click="downloadsFN">批量下载会员证</el-button>
        </div>
      </el-row>
    </div>

    <div class="table">
      <el-table
        v-loading="loading" border :data="infoList" style="width: 100%"
        :row-class-name="tableRowClassName" @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" align="center" :selectable="selectable" />
        <el-table-column type="index" label="序号" width="55" align="center" />
        <el-table-column
          label="结算编号"
          align="center"
          prop="content.wfCode"
          min-width="150"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          min-width="140" label="缴费名称" align="center"
          prop="content.certName" :show-overflow-tooltip="true"
        />
        <el-table-column
          min-width="140" label="缴费单位" align="center"
          prop="content.memberName" :show-overflow-tooltip="true"
        />
        <el-table-column
          width="110" label="团体会员合计" align="center"
          prop="content.allCount"
        />
        <el-table-column width="90" label="新会员合计" align="center" prop="content.newCount" />
        <el-table-column width="80" label="年限合计" align="center" prop="content.renewYear" />
        <el-table-column width="100" label="费用合计" align="center" prop="content.allFee">
          <template #default="scope">
            <div>
              {{ (scope.row?.content?.allFee*1).toFixed(2) }}
            </div>
          </template>
        </el-table-column>

        <el-table-column label="提交日期" align="center" prop="content.commitTime" width="100">
          <template #default="scope">
            <span>{{ parseTime(scope.row.content.commitTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="审核日期" align="center" prop="content.commitTime" width="100">
          <template #default="scope">
            <span>{{ parseTime(scope.row.overDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="会员证" align="center" prop="content.sendJiaoFeiFlag" width="100">
          <template #default="scope">
            <span v-if="scope.row.content.sendJiaoFeiFlag==1" class="text-success">已下发</span>
            <span v-else class="text-warning">未下发</span>
          </template>
        </el-table-column>
        <el-table-column
          label="缴费状态"
          align="center"
          prop="balance"
          min-width="100"
        >
          <template #default="props">
            <div v-if="props.row.doc?.settleFlag==0" class="text-success">已结算 </div>
            <div v-if="props.row.doc?.settleFlag==1&&props.row.doc.payFlag==0" class="text-navy">已上传凭证</div>
            <div v-if="props.row.doc?.settleFlag==1&&props.row.doc.payFlag==1" class="text-danger">未上传凭证</div>
          </template>
        </el-table-column>
        <el-table-column label="审核状态" align="center" width="100" prop="auditStatus">
          <template #default="scope">
            <div v-if="scope.row.auditStatus == 0">审核中</div>
            <div v-if="scope.row.auditStatus == 1" class="text-success">审核通过</div>
            <div v-if="scope.row.auditStatus == 2" class="text-danger">审核拒绝</div>
            <div v-if="scope.row.auditStatus == 3" class="text-warning">审核撤回</div>
          </template>
        </el-table-column>
        <el-table-column
          label="审核进度"
          align="center"
          prop=""
          min-width="120"
        >
          <template #default="props">
            <schedule v-if="props.row.auditStatus == 1||props.row.auditStatus == 0" :audit-process="props.row.auditProcess" />
          </template>
        </el-table-column>
        <!-- <el-table-column label="原因" width="100" align="center" prop="" :show-overflow-tooltip="true">
          <template #default="scope">
            <div v-if="scope.row.reason">{{ scope.row.reason }}</div>
            <div v-if="!scope.row.reason">/</div>
          </template>
        </el-table-column> -->
        <!-- <el-table-column v-if="deptType == 1" label="缴费通知单" width="110" align="center" prop="years">
          <template #default="scope">
            <div v-if="scope.row.content.sendJiaoFeiDanFlag == 0">已下发</div>
            <div v-if="scope.row.content.sendJiaoFeiDanFlag == 1">未下发</div>
            <div v-if="!scope.row.content.sendJiaoFeiDanFlag">/</div>
          </template>
        </el-table-column> -->
        <el-table-column width="260" label="操作" align="center">
          <template #default="scope">
            <el-button type="primary" @click="handleView(scope.row)">查看</el-button>

            <el-button :disabled="!(scope.row.auditStatus == 0)" color="#13B5B1" style="--el-color-black:#fff;" @click="handleAudit(scope.row)">审核</el-button>
            <el-dropdown v-if="deptType==1" class="poptdmore">
              <el-button type="primary" plain>更多
                <el-icon class="el-icon--right">
                  <arrow-down />
                </el-icon>
              </el-button>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item>
                    <el-button style="width: 6em;" :disabled="!(scope.row.isView == 1&&scope.row.auditStatus == 1&&scope.row.canTui==1 )" type="danger" @click="sendBack(scope.row)">撤回</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button style="width: 6em;" :disabled="!(scope.row.isView == 1&&scope.row.content.sendJiaoFeiFlag!=1)" type="primary" @click="issueFN(scope.row)">下发会员证</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item>
                    <el-button style="width: 6em;" :disabled="!(scope.row.content.sendJiaoFeiFlag==1)" type="primary" @click="downloadFN(scope.row)">下载会员证</el-button>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>

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

      <div v-show="total>0" class="totalCost">
        费用合计:<span>{{ statistical.totalCost?.toFixed(2) }} </span>
        团体会员合计:<span>{{ statistical.allCount }} </span>
        新会员合计:<span>{{ statistical.newCount }} </span>
        年限合计:<span>{{ statistical.renewYear }} </span>
      </div>

      <pagination
        v-show="total > 0"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        :total="total"
        @pagination="getList"
      />
    </div>


    <!-- 审核 -->
    <el-dialog
      v-model.trim="show" title="团体会员认证审核" :close-on-click-modal="true"
      width="600"
      @close="close"
    >
      <el-form :model="form" label-width="100">
        <el-form-item v-if="!isBack" label="审批结果" prop="flag">
          <el-radio-group v-model.trim="form.flag">
            <el-radio label="1">审批通过</el-radio>
            <el-radio label="0">审批拒绝</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item :label="'备注'" prop="reason">
          <el-input v-model.trim="form.reason" type="textarea" rows="5" />
        </el-form-item>
      </el-form>

      <template #footer>
        <div style="text-align: center;">
          <el-button type="primary" @click="doApproval"> 提交</el-button>
          <el-button @click="show = false"> </el-button>
        </div>
      </template>
    </el-dialog>

    <views ref="viewsRef" @approval="getList" />
  </div>
</template>

<script setup name="f">
import { ref, getCurrentInstance, reactive, toRefs, computed, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { audit, verifyList, withDraw, setCanDown } from '@/api/groupMember/authentication.js'
import views from '@/views/groupMember/authentication/viewsMerge.vue'
import { DocumentChecked, Download, Position } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
import schedule from '@/views/member/components/schedule.vue'

const deptType = computed(() => useUserStore().deptType)
// console.log(deptType.value)
const overDateRange = ref([])
const statistical = ref({})
const router = useRouter()
const { proxy } = getCurrentInstance()
const infoList = ref([])
const loading = ref(false)
const show = ref(false)
const batchList = ref()
const list = ref([])
const multiple = ref(true)
const showCollect = ref(true)
const total = ref(0)
const flag = ref(false)
const commitTime = ref([])
const data = reactive({
  form: {
    flag: '1'
  },
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    noEmpty: 1,
    auditStatus: '0'
  }
})

const { queryParams, form } = toRefs(data)

onMounted(() => {
  if (deptType.value == 4 || deptType.value == 5) {
    flag.value = true
  } else {
    flag.value = false
  }
})

function searchFN() {
  queryParams.value.pageNum = 1
  getList()
}

// /** 查询团体会员列表 */
getList()
function getList() {
  if (commitTime.value?.length > 0) queryParams.value.commitTimeRange = commitTime.value.toString()
  if (overDateRange.value?.length > 0) queryParams.value.overDateRange = overDateRange.value.toString()
  loading.value = true

  statistical.value = {
    totalCost: 0,
    allCount: 0,
    newCount: 0,
    renewYear: 0
  }

  verifyList(queryParams.value).then(response => {
    infoList.value = response.rows
    infoList.value.forEach(item => {
      item.content = JSON.parse(item.content)
      item.doc = JSON.parse(item.doc)

      statistical.value.totalCost += (item.content.allFee * 1)
      statistical.value.allCount += (item.content.allCount * 1)
      statistical.value.newCount += (item.content.newCount * 1)
      statistical.value.renewYear += (item.content.renewYear * 1)
    })
    total.value = response.total
    loading.value = false
  })
}

// 撤回
function sendBack(row) {
  // console.log(row)
  proxy.$modal.confirm('是否确认撤回团体会员名称为"' + row.content.certName + '"的数据项?').then(function() {
    return withDraw({ recordId: row.recordId, reason: row.reason })
  }).then(() => {
    getList()
    proxy.$modal.msgSuccess('操作成功!')
  }).catch((err) => {
    console.log(err)
  }).finally((a) => {
    console.log(a)
  })
}

// 查看
function handleView(row) {
  proxy.$refs['viewsRef'].open(row)
}
// 审核
function handleAudit(row) {
  list.value = [row.recordId]
  form.value = {
    flag: '1'
  }
  show.value = true
}

// // 发送缴费通知单
// async function handleInform(row) {
//   const arr = [row.documentCode]
//   const res = await sendPayNotice(arr)
//   if (res.code == 200) {
//     proxy.$modal.msgSuccess('操作成功!')
//   } else {
//     proxy.$modal.msgError('操作失败!')
//   }
//   getList()
// }

/** 搜索按钮操作 */
function handleQuery() {
  getList()
}

/** 重置按钮操作 */
function resetQuery() {
  queryParams.value = {
    pageNum: 1,
    pageSize: 10,
    noEmpty: 1
  }
  commitTime.value = []
  overDateRange.value = []
  getList()
}

// 多选框选中数据
function handleSelectionChange(selection) {
  list.value = selection.map(item => item.recordId)
  batchList.value = selection
  multiple.value = !selection.length
}

// // 批量下发缴费通知单
// async function batchPay() {
//   const arr = []
//   const batchList = JSON.parse(JSON.stringify(list.value))
//   batchList.forEach(item => {
//     arr.push(item.documentCode)
//   })
//   const res = await sendPayNotice(arr)
//   if (res.code == 200) {
//     proxy.$modal.msgSuccess('操作成功!')
//   } else {
//     proxy.$modal.msgError('操作失败!')
//   }
//   getList()
// }

// 批量审核
async function batchAudit() {
  const flag = batchList.value.some(item => {
    if (item.auditStatus != 0) {
      return proxy.$message.warning(`缴费名称为${item.content.certName}的数据项不符合审核!`)
    }
  })
  if (flag) return
  form.value = {
    flag: '1'
  }
  show.value = true
}

// 批量审批
async function doApproval() {
  if (!form.value.flag) {
    return proxy.$modal.msgError('请选择审核状态!')
  }
  if (form.value.flag == 0 && !form.value.reason) {
    return proxy.$modal.msgError('请输入拒绝理由')
  }
  form.value.recordIds = list.value
  const res = await audit(form.value)
  if (res.code == 200) {
    show.value = false
    getList()
    return proxy.$modal.msgSuccess('操作成功!')
  } else {
    return proxy.$modal.msgError('操作失败!')
  }
}

// 批量下发会员证
async function issuesFN() {
  const flag = batchList.value.some(item => {
    if (item.content.sendJiaoFeiFlag == 1) {
      return proxy.$message.warning(`缴费名称为${item.content.certName}的数据项已下发会员证!`)
    }
    if (item.content.sendJiaoFeiFlag == 1 && item.auditStatus != 1) {
      return proxy.$message.warning(`缴费名称为${item.content.certName}的数据项不符合下发会员证!`)
    }
  })
  if (flag) return
  const res = await setCanDown(list.value)
  if (res.code == 200) {
    getList()
    proxy.$modal.msgSuccess('操作成功!')
  }
}

// 下发会员证
async function issueFN(row) {
  const res = await setCanDown([row.recordId])
  if (res.code == 200) {
    getList()
    proxy.$modal.msgSuccess('操作成功!')
  }
}

// 批量下载会员证
function downloadsFN() {
  const flag = batchList.value.some(item => {
    if (item.auditStatus != 1) {
      return proxy.$message.warning(`缴费名称为${item.content.certName}的数据项不符合下载会员证!`)
    }
  })
  if (flag) return
  const routerData = router.resolve({
    path: '/download',
    query: {
      arr: list.value,
      type: 'batchGroupMember'
    }
  })
  window.open(routerData.href, '_blank')

  // proxy.download(
  //   `/member/certified/downloadPersonCert/${list.value}`, {}, '会员证.zip'
  // )
}

// 下载会员证
function downloadFN(row) {
  const routerData = router.resolve({
    path: '/download',
    query: {
      arr: [row.recordId],
      type: 'batchGroupMember'
    }
  })
  window.open(routerData.href, '_blank')
  // proxy.download(
  //   `/member/certified/downloadPersonCert/${[row.recordId]}`, {}, '会员证'
  // )
}

// // 背景色
const tableRowClassName = ({
  row,
  rowIndex
}) => {
  if (row.auditStatus == 1) {
    return 'success-row'
  }
}

</script>

<style lang="scss" scoped>
:deep(.el-tabs__item.is-active) {
  color: #fff;
  background-color: #920f20;
}

.text-center {
  display: flex;
  margin-top: 10px;
  margin-bottom: 40px;
}

.text-center>div {
  margin-left: 20px;
}

.text-center span {
  color: #920f20;
  font-size: 20px;
  font-weight: 600;
}

.content{
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
}


</style>