| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438 |
- <template>
- <div class="app-container zap-main">
- <el-row v-if="activeName === '0'" class="zap-table-search">
- <right-toolbar style="margin-top: 4px;" :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
- <span class="zap-table-search__title">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" @click="resetQuery" style="float: ;">重置</el-button>
- <column-setting
- class="zap-column-setting"
- :checkList="checkList"
- :tableList="tableList"
- :selfDom="selfDom"
- :tableId="tableId"
- ></column-setting>
- </div>
- <hr style="margin-top: 16px;" />
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="auto"
- >
- <el-form-item label="企业名称" prop="companyName" size="large">
- <el-input
- maxlength="30"
- v-model="queryParams.companyName"
- placeholder="请输入企业名称"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="社会统一代码" prop="scySocialCode" size="large">
- <el-input
- maxlength="30"
- v-model="queryParams.scySocialCode"
- placeholder="请输入社会统一代码"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="链属状态" prop="scrStatus" size="large">
- <el-select v-model="queryParams.scrStatus" placeholder="链属状态" clearable>
- <el-option
- v-for="dict in scrStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="认证状态" prop="scpStatus" size="large">
- <el-select v-model="queryParams.scpStatus" placeholder="认证状态" clearable>
- <el-option
- v-for="dict in scpStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="链属关系" prop="scrType" size="large">
- <el-select v-model="queryParams.scrType" placeholder="链属关系" clearable>
- <el-option
- v-for="dict in scrTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </el-row>
- <!-- 未认证列表 -->
- <el-row v-else-if="activeName === '1'" class="zap-table-search">
- <right-toolbar
- style="margin-top: 4px;"
- :showSearch.sync="showSearch"
- @queryTable="getSpare"
- >收起</right-toolbar>
- <span class="zap-table-search__title">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" @click="handleSpareQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" @click="resetSpareQuery" style="float: ;">重置</el-button>
- </div>
- <hr style="margin-top: 16px;" />
- <el-form
- :model="spareParams"
- ref="querySpareForm"
- :inline="true"
- v-show="showSearch"
- label-width="auto"
- >
- <el-form-item label="企业名称" prop="companyName" size="large">
- <el-input
- maxlength="30"
- v-model="spareParams.companyName"
- placeholder="请输入企业名称"
- clearable
- @keyup.enter.native="handleSpareQuery"
- />
- </el-form-item>
- <el-form-item label="社会统一代码" prop="scySocialCode" size="large">
- <el-input
- maxlength="30"
- v-model="spareParams.scySocialCode"
- placeholder="请输入社会统一代码"
- clearable
- @keyup.enter.native="handleSpareQuery"
- />
- </el-form-item>
- <el-form-item label="链属关系" prop="scrType" size="large">
- <el-select v-model="spareParams.scrType" placeholder="请选择链属关系" clearable>
- <el-option
- v-for="dict in scrTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </el-row>
- <el-row class="zap-margin-top">
- <div class="zap-credit__tabs zap-credit__content">
- <div class="zap-credit__buttons">
- <el-button
- type="primary"
- icon="el-icon-plus"
- @click="handleAdd"
- v-hasPermi="['service:rel:add']"
- >新增</el-button>
- <el-button
- type="success"
- icon="el-icon-upload2"
- @click="handleImport"
- v-hasPermi="['service:relImport:importData']"
- >导入</el-button>
- </div>
- <el-tabs v-model="activeName">
- <el-tab-pane label="我的链属">
- <el-table class="zap-margin-top" v-loading="loading" :data="companyRelList" stripe>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="社会统一代码"
- align="center"
- prop="companyCode"
- v-if="uncheckList.companyCode"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span v-if="scope.row.launch">{{scope.row.receiveScySocialCode}}</span>
- <span v-if="scope.row.receive">{{scope.row.launchScySocialCode}}</span>
- <span v-if="scope.row.spare">{{scope.row.scpSocialCode}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="企业名称"
- align="center"
- prop="companyName"
- v-if="uncheckList.companyName"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <span v-if="scope.row.launch">{{scope.row.receiveScyName}}</span>
- <span v-if="scope.row.receive">{{scope.row.launchScyName}}</span>
- <span v-if="scope.row.spare">{{scope.row.scpName}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="链属关系"
- align="center"
- prop="companyType"
- v-if="uncheckList.companyType"
- >
- <template slot-scope="scope">
- <span
- v-if="scope.row.launch"
- >{{companyTypeFormat(scope.row.launchScrReceiveType)}}</span>
- <span
- v-if="scope.row.receive"
- >{{companyTypeFormat(scope.row.launchScrLaunchType)}}</span>
- <span v-if="scope.row.spare">{{companyTypeFormat(scope.row.scpType)}}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- label="联系人"
- align="center"
- prop="scpContarct"
- v-if="uncheckList.scpContarct"
- ></el-table-column>
- <el-table-column
- label="联系电话"
- align="center"
- prop="scpContarctPhone"
- v-if="uncheckList.scpContarctPhone"
- ></el-table-column>
- <el-table-column
- label="邮箱"
- align="center"
- prop="scpContarctEmail"
- v-if="uncheckList.scpContarctEmail"
- show-overflow-tooltip
- ></el-table-column> -->
- <el-table-column
- label="链属状态"
- align="center"
- prop="launchScrStatus"
- v-if="uncheckList.launchScrStatus"
- :formatter="launchScrStatusFormat"
- ></el-table-column>
- <el-table-column
- label="认证状态"
- align="center"
- prop="scpStatus"
- v-if="uncheckList.scpStatus"
- :formatter="scpStatusFormat"
- ></el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="150"
- >
- <template slot-scope="scope">
- <el-button
- v-if="!scope.row.spare"
- size="mini"
- type="text"
- @click="handleCompanyQuery(scope.row)"
- v-hasPermi="['service:rel:query']"
- >详情</el-button>
- <el-button
- v-if="scope.row.launch && scope.row.launchScrStatus == '02'"
- size="mini"
- type="text"
- @click="handleRelInvite(scope.row)"
- v-hasPermi="['service:rel:again']"
- >重邀</el-button>
- <el-button
- v-if="handleRel && scope.row.launchScrStatus == '01'"
- size="mini"
- type="text"
- @click="handleDelete(scope.row)"
- v-hasPermi="['service:rel:delete']"
- >解绑</el-button>
- <el-button
- v-if="scope.row.spare && scope.row.scpStatus == '00'"
- size="mini"
- type="text"
- @click="handleSpareDelete(scope.row)"
- v-hasPermi="['service:spare:removeSpare']"
- >解绑</el-button>
- <el-button
- v-if="
- scope.row.scpInvite == '1' && scope.row.scpStatus == '00'
- && scope.row.scpContarct && scope.row.scpContarctPhone
- "
- size="mini"
- type="text"
- @click="handleInvite(scope.row)"
- v-hasPermi="['service:spare:invite']"
- >重邀</el-button>
- <el-button
- v-if="handleRel && scope.row.launchScrStatus =='00' && scope.row.receive"
- size="mini"
- type="text"
- @click="handleSuccess(scope.row)"
- v-hasPermi="['service:rel:update']"
- >确认链属</el-button>
- <el-button
- v-if="handleRel && scope.row.launchScrStatus =='00' && scope.row.receive"
- size="mini"
- type="text"
- @click="handleRefuse(scope.row)"
- v-hasPermi="['service:rel:update']"
- >拒绝</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </el-tab-pane>
- <el-tab-pane label="链属未认证">
- <!-- 未认证企业信息列表 -->
- <el-table v-loading="loading" :data="spareOwnlist" stripe>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{(spareParams.pageNum - 1) * spareParams.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="企业名称"
- align="center"
- prop="scpName"
- show-overflow-tooltip
- />
- <el-table-column
- label="社会统一代码"
- align="center"
- prop="scpSocialCode"
- show-overflow-tooltip
- />
- <el-table-column
- label="链属关系"
- align="center"
- prop="scpType"
- :formatter="scpTypeFormat"
- />
- <!-- <el-table-column label="联系人" align="center" width="83" prop="scpContarct" /> -->
- <!-- <el-table-column
- label="联系电话"
- align="center"
- width="109"
- prop="scpContarctPhone"
- show-overflow-tooltip
- />
- <el-table-column
- label="邮箱"
- align="center"
- width="187"
- prop="scpContarctEmail"
- show-overflow-tooltip
- /> -->
- <el-table-column
- label="状态"
- align="center"
- prop="scpStatus"
- :formatter="scpStatusFormat"
- />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.scpInvite == '1' && scope.row.scpContarct && scope.row.scpContarctPhone"
- size="mini"
- type="text"
- @click="handleInvite(scope.row)"
- v-hasPermi="['service:spare:invite']"
- >重邀</el-button>
- <el-button
- size="mini"
- type="text"
- @click="handleSpareDelete(scope.row)"
- v-hasPermi="['service:spare:removeSpare']"
- >解绑</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="spareTitol > 0"
- :total="spareTitol"
- :page.sync="spareParams.pageNum"
- :limit.sync="spareParams.pageSize"
- @pagination="getSpare"
- />
- </el-tab-pane>
- <!-- 添加链属框 -->
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="auto" :inline="true">
- <el-form-item label="企业编号" prop="scyId" style="display:none" size="large">
- <el-input v-model="form.scyId" disabled />
- </el-form-item>
- <el-form-item label="链属关系" prop="scrReceiveType" size="large">
- <el-select v-model="form.scrReceiveType" placeholder="请选择链属关系" clearable>
- <el-option
- v-for="dict in scrTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="企业名称" prop="scyName" size="large">
- <el-select
- v-model="form.scyName"
- filterable
- allow-create
- clearable
- @clear="clearRemote"
- @change="choice"
- remote
- reserve-keyword
- placeholder="请输入关键词"
- :remote-method="remoteMethod"
- >
- <el-option
- v-for="item in companyList"
- :key="item.value"
- :label="item.label"
- :value="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode" size="large">
- <el-input
- v-model="form.scySocialCode"
- placeholder="请输入企业统一代码"
- maxlength="18"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="联系人" prop="scrContarct" size="large">
- <el-input
- v-model="form.scrContarct"
- placeholder="请输入联系人"
- maxlength="10"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="联系人手机号" prop="scrContarctPhone" size="large">
- <el-input
- v-model="form.scrContarctPhone"
- placeholder="请输入联系人手机号"
- maxlength="11"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="邮箱" prop="scrContarctEmail" size="large">
- <el-input
- v-model="form.scrContarctEmail"
- placeholder="请输入邮箱"
- maxlength="60"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <el-row style="height: 109px;" type="flex" align="middle" justify="center">
- <el-button type="primary" plain @click="cancel">取 消</el-button>
- <el-button type="primary" @click="submitForm">确 定</el-button>
- </el-row>
- </el-dialog>
- <!-- 企业详情对话框 -->
- <el-dialog :title="titleDetail" :visible.sync="openDetail" width="800px" append-to-body>
- <el-form ref="formDetail" :model="formDetail" label-width="140px" :inline="true">
- <el-form-item label="企业名称" prop="scyName">
- <el-input
- v-model="formDetail.scyName"
- placeholder="请输入企业名称"
- disabled
- style="width:560px"
- maxlength="20"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode">
- <el-input
- v-model="formDetail.scySocialCode"
- placeholder="请输入企业统一代码"
- disabled
- maxlength="18"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="联系人" prop="scyLegal">
- <el-input
- v-model="formDetail.scyLegal"
- placeholder="请输入联系人"
- disabled
- maxlength="5"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="联系人手机号" prop="scyPhone">
- <el-input
- v-model="formDetail.scyPhone"
- placeholder="请输入联系人手机号"
- disabled
- maxlength="11"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelDetail">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 导入窗口 -->
- <el-dialog
- class="zap-upload-invoice"
- :visible.sync="upload.open"
- width="600px"
- :show-close="false"
- append-to-body
- >
- <el-row
- slot="title"
- class="zap-upload-invoice__title"
- type="flex"
- align="middle"
- justify="space-between"
- >
- <span class="title">{{upload.title}}</span>
- <i class="el-icon-close" @click="upload.open = false"></i>
- </el-row>
- <el-row class="zap-upload-invoice__top">
- <span class="zap-upload-invoice__top-text">提示:仅允许导入“xls”或“xlsx”格式文件!</span>
- </el-row>
- <el-row type="flex" align="middle" justify="center">
- <el-upload
- class="zap-upload-invoice__form"
- ref="upload"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
- <div class="zap-upload-invoce__inner">
- <i class="el-icon-upload" style="font-size: 64px;color: #21b24b"></i>
- <div class="zap-upload-invoice__text">
- 将文件拖到此处,或
- <span>点击上传</span>
- </div>
- <div class="zap-upload-invoice__tip">按住Ctrl可同时多选,单个文件不能超过2mb</div>
- <div class="zap-upload-invoice__tip">严禁上传包含色情、暴力、反动等相关违法信息的文件。</div>
- </div>
- <div class="el-upload__tip" slot="tip">
- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
- </div>
- </el-upload>
- </el-row>
- <el-row style="height: 109px;" type="flex" align="middle" justify="center">
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
- <el-button @click="upload.open = false">取 消</el-button>
- </el-row>
- </el-dialog>
- </el-tabs>
- </div>
- </el-row>
- </div>
- </template>
- <script>
- import {
- listRel,
- sparelist,
- listCompany,
- addRel,
- updateRel,
- listAllCompany,
- againRel,
- delRel,
- removeSpare,
- listCompanyQuery,
- getUser,
- againInvite,
- getListRel
- } from "@/api/service/rel/companyRel";
- import { uploadFileNew } from "@/api/common/file";
- import { getToken } from "@/utils/auth";
- import { columnQuery, columnfilter } from "@/api/common/columnSetting";
- import ColumnSetting from "../../../components/Table/columnSetting.vue";
- import Cookies from "js-cookie";
- export default {
- name: "companyRel",
- components: {
- ColumnSetting
- },
- data() {
- return {
- activeName: "",
- //操作员企业Id
- loginId: "",
- userId: "",
- scyTypeNow: "",
- handleRel: false,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- rel: true,
- spare: false,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- spareTitol: 0,
- // 公司数据
- companyList: [],
- //链属表格数据
- companyRelList: [],
- //链属未认证列表数据
- spareOwnlist: [],
- // 状态数据字典
- scrStatusOptions: [],
- scrTypeOptions: [],
- scpStatusOptions: [],
- listCom: [],
- comlist: [],
- // 弹出层标题
- title: "",
- templateTitle: "",
- titleDetail: "",
- // 是否显示弹出层
- open: false,
- templateOpen: false,
- openDetail: false,
- idShow: true,
- // 导入参数
- upload: {
- // 是否显示弹出层(导入)
- open: false,
- // 弹出层标题(导入)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/sc-service/relImport/importData"
- },
- // 链属查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- companyName: null,
- scySocialCode: null,
- scrStatus: null,
- scrType: null,
- scpStatus: null
- },
- //未认证列表查询参数
- spareParams: {
- pageNum: 1,
- pageSize: 10,
- scySocialCode: null,
- companyName: null,
- scrType: null
- },
- //企业列表查询参数
- companyQueryParams: {
- pageNum: 1,
- pageSize: 10,
- scyName: null
- },
- //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
- tableList: [
- {
- label: "companyCode",
- value: "社会统一代码"
- },
- {
- label: "companyName",
- value: "企业名称"
- },
- {
- label: "companyType",
- value: "链属关系"
- },
- // {
- // label: "scpContarct",
- // value: "联系人"
- // },
- // {
- // label: "scpContarctPhone",
- // value: "联系电话"
- // },
- // {
- // label: "scpContarctEmail",
- // value: "邮箱"
- // },
- {
- label: "launchScrStatus",
- value: "链属状态"
- },
- {
- label: "scpStatus",
- value: "认证状态"
- }
- ],
- checkList: [], //筛选列选中的数据列表--显示隐藏列用
- uncheckList: {}, //控制筛选列显示隐藏--显示隐藏列用
- selfDom: this,
- tableId: "/sc-service/rel/list",
- // 表单参数
- form: {
- scyId: null,
- scrReceiveType: null,
- scyName: null,
- scySocialCode: null,
- scrContarct: null,
- scrContarctPhone: null,
- scrContarctEmail: null
- },
- templateForm: {
- scyId: null
- },
- formDetail: {
- scyName: null,
- scySocialCode: null,
- scyLegal: null,
- scyPhone: null
- },
- companyId: null,
- // 表单校验
- rules: {
- scyName: [
- {
- required: true,
- message: "企业名称不能为空",
- trigger: ["blur", "change"]
- },
- {
- pattern: /^[0-9A-Z\u4E00-\u9FFF《》()()-]+$/,
- message: "企业名称不能带有特殊字符",
- trigger: ["blur", "change"]
- }
- ],
- scrReceiveType: [
- {
- required: true,
- message: "链属关系不能为空",
- trigger: ["blur", "change"]
- }
- ],
- scrContarct: [
- {
- pattern: /^[A-Za-z\u4e00-\u9fa5]+$/,
- message: "联系人不能带有特殊字符",
- trigger: ["blur", "change"]
- }
- ],
- scrContarctPhone: [
- {
- pattern: /^((\d{3}-\d{7,8}|\d{4}-\d{7,8})|(1[3465789]\d{9}))$/,
- message: "手机号格式不正确",
- trigger: ["blur", "change"]
- }
- ],
- scySocialCode: [
- { required: true, message: "企业统一代码不能为空", trigger: "blur" },
- {
- pattern: /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/,
- message: "企业统一代码格式不正确",
- trigger: ["blur", "change"]
- }
- ],
- scrContarctEmail: [
- {
- pattern: /^([a-z0-9A-Z]+[-|_|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/,
- message: "邮箱格式不正确",
- trigger: ["blur", "change"]
- }
- ]
- },
- templateRules: {
- scyId: [
- { required: true, message: "核心企业不能为空", trigger: "blur" }
- ]
- }
- };
- },
- created() {
- this.getDicts("sys_scr_status").then(response => {
- this.scrStatusOptions = response.data;
- });
- this.getDicts("sys_scr_type").then(response => {
- this.scrTypeOptions = response.data;
- });
- this.getDicts("sys_scp_status").then(response => {
- this.scpStatusOptions = response.data;
- });
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- },
- mounted() {
- this.columnQuery();
- },
- methods: {
- //获取当前客户是否之前设置过列展示隐藏
- columnQuery() {
- //获取页面路径
- var psfPagePath = window.location.pathname;
- //用请求后台的url作为唯一标识
- var psfTableName = this.tableId;
- var columnForm = {};
- columnForm.psfPagePath = psfPagePath;
- columnForm.psfTableName = psfTableName;
- columnQuery(columnForm).then(response => {
- if (response.data && response.data.psfShowData) {
- this.checkList = response.data.psfShowData;
- }
- this.filter();
- });
- },
- //控制隐藏显示的函数
- filter(checkList) {
- if (!!checkList) {
- this.checkList = checkList;
- }
- columnfilter(this.selfDom);
- },
- // 菜单状态字典翻译
- companyTypeFormat(companyType) {
- return this.selectDictLabel(this.scrTypeOptions, companyType);
- },
- scpTypeFormat(row, column) {
- return this.selectDictLabel(this.scrTypeOptions, row.scpType);
- },
- scpStatusFormat(row, column) {
- return this.selectDictLabel(this.scpStatusOptions, row.scpStatus);
- },
- launchScrStatusFormat(row, column) {
- return this.selectDictLabel(this.scrStatusOptions, row.launchScrStatus);
- },
- //平台导出模板
- submitTemplateForm() {
- this.$refs["templateForm"].validate(valid => {
- let fd = new FormData();
- for (var key in self.form) {
- fd.append(key, self.form[key]);
- }
- if (valid) {
- this.download(
- "/sc-service/relImport/importTemplate",
- {
- ...this.templateForm
- },
- `链属模板_${new Date().getTime()}.xls`
- );
- this.cancelTemplateForm();
- }
- });
- },
- //取消导出模板选择企业
- cancelTemplateForm() {
- this.templateOpen = false;
- this.templateForm = {};
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = "链属导入";
- this.upload.open = true;
- },
- /** 下载模板操作 */
- importTemplate() {
- this.download(
- "/sc-service/relImport/importTemplate",
- {
- ...this.queryParams
- },
- `链属模板_${new Date().getTime()}.xls`
- );
- },
- /* 平台下载模板操作 */
- importAdminTemplate() {
- this.templateTitle = "核心企业";
- this.templateOpen = true;
- },
- // 文件上传中处理
- handleFileUploadProgress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
- this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- /** 查询链属列表 */
- getList() {
- this.loading = true;
- if (this.companyId == "000000") {
- getListRel(this.queryParams).then(response => {
- let list = response.data.records;
- this.loginId = response.msg;
- for (let i = 0; i < list.length; i++) {
- if (list[i].launchCompanyId == response.msg) {
- list[i].receive = false;
- list[i].launch = true;
- list[i].spare = false;
- } else if (list[i].launchReceiveScrCompanyId == response.msg) {
- list[i].launch = false;
- list[i].receive = true;
- list[i].spare = false;
- } else if (list[i].scpCompanyId == response.msg) {
- list[i].launch = false;
- list[i].receive = false;
- list[i].spare = true;
- }
- }
- this.companyRelList = list;
- console.log(12312313123);
- console.log(this.companyRelList);
- this.total = response.data.total;
- this.loading = false;
- });
- } else {
- listRel(this.queryParams).then(response => {
- let list = response.data.records;
- this.loginId = response.msg;
- for (let i = 0; i < list.length; i++) {
- if (list[i].launchCompanyId == response.msg) {
- list[i].receive = false;
- list[i].launch = true;
- list[i].spare = false;
- } else if (list[i].launchReceiveScrCompanyId == response.msg) {
- list[i].launch = false;
- list[i].receive = true;
- list[i].spare = false;
- } else if (list[i].scpCompanyId == response.msg) {
- list[i].launch = false;
- list[i].receive = false;
- list[i].spare = true;
- }
- }
- this.companyRelList = list;
- console.log(12312313123);
- console.log(this.companyRelList);
- this.total = response.data.total;
- this.loading = false;
- });
- }
- },
- // 未认证列表
- getSpare() {
- this.loading = true;
- sparelist(this.spareParams).then(response => {
- this.spareOwnlist = response.data.records;
- this.spareTitol = response.data.total;
- this.loading = false;
- });
- },
- //查询所有企业
- getCompanyList() {
- this.loading = true;
- listAllCompany().then(response => {
- this.comlist = response.data;
- this.listCom = this.comlist.map(item => {
- return { value: item.scyId, label: item.scyName };
- });
- });
- },
- clearRemote() {
- let query = "";
- this.form.scyId = "";
- this.form.scyName = "";
- this.form.scySocialCode = "";
- this.idShow = true;
- this.remoteMethod(query);
- },
- //选择企业
- remoteMethod(query) {
- if (query) {
- this.loading = true;
- setTimeout(() => {
- this.loading = false;
- this.companyList = this.listCom.filter(item => {
- return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
- });
- }, 200);
- } else {
- this.companyList = [];
- }
- },
- //选择企业后反显
- choice(item) {
- if (item) {
- let scyId;
- for (var company of this.companyList) {
- if (company.label == item) {
- scyId = company.value;
- break;
- }
- }
- if (scyId) {
- listCompanyQuery(scyId).then(response => {
- if (response.data.length > 0) {
- this.$set(this.form, "scyName", response.data[0].scyName);
- this.$set(
- this.form,
- "scySocialCode",
- response.data[0].scySocialCode
- );
- }
- });
- }
- }
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.clearRemote();
- this.reset();
- },
- cancelDetail() {
- this.openDetail = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.clearRemote();
- this.resetForm("form");
- this.resetForm("formDetail");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getUser();
- },
- /** 未认证搜索按钮操作 */
- handleSpareQuery() {
- this.spareParams.pageNum = 1;
- this.getSpare();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- /** 未认证重置按钮操作 */
- resetSpareQuery() {
- this.resetForm("querySpareForm");
- this.handleSpareQuery();
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "新增链属";
- },
- //查询企业详情
- handleCompanyQuery(row) {
- this.resetForm("queryForm");
- this.resetForm("querySpareForm");
- if (row.receive == true) {
- const scyId = row.launchCompanyId;
- listCompanyQuery(scyId).then(response => {
- if (response.data[0].scyStatus == "00") {
- Cookies.set(
- "/rel/detailComPany/" + scyId + "/",
- this.$route.fullPath
- );
- this.$router.push("/rel/detailComPany/" + scyId + "/");
- } else {
- this.formDetail = response.data[0];
- this.openDetail = true;
- this.titleDetail = "详情企业信息";
- }
- });
- } else if (row.launch == true) {
- const scyId = row.launchReceiveScrCompanyId;
- listCompanyQuery(scyId).then(response => {
- if (response.data[0].scyStatus == "00") {
- Cookies.set(
- "/rel/detailComPany/" + scyId + "/",
- this.$route.fullPath
- );
- this.$router.push("/rel/detailComPany/" + scyId + "/");
- } else {
- this.formDetail = response.data[0];
- this.openDetail = true;
- this.titleDetail = "详情企业信息";
- }
- });
- }
- },
- /** 提交按钮 */
- submitForm() {
- var self = this;
- this.$refs["form"].validate(valid => {
- let fd = new FormData();
- for (var key in self.form) {
- fd.append(key, self.form[key]);
- }
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- // for (var company of this.companyList) {
- // if (company.value == self.form.scyId) {
- // self.form.scyName = company.label;
- // break;
- // }
- // }
- console.log(self.form, "提交表单");
- debugger;
- addRel(self.form)
- .then(response => {
- this.msgSuccess("新增成功");
- loading.close();
- this.open = false;
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(response => {
- loading.close();
- });
- }
- });
- },
- /* 同意链属 */
- handleSuccess(row) {
- const launchScrId = row.launchScrId || this.ids;
- if (row.launchCompanyId == this.loginId) {
- const scyName = row.receiveScyName;
- this.$confirm('确认与"' + scyName + '"的链属关系?', "确认链属", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "success"
- })
- .then(function() {
- const state = "01";
- return updateRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("链属成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消链属"
- });
- });
- } else if (row.launchReceiveScrCompanyId == this.loginId) {
- const scyName = row.launchScyName;
- this.$confirm('确认与"' + scyName + '"的链属关系?', "确认链属", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "success"
- })
- .then(function() {
- const state = "01";
- return updateRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("链属成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消链属"
- });
- });
- }
- },
- //重邀拒绝链属
- handleRelInvite(row) {
- const launchScrId = row.launchScrId || this.ids;
- if (row.launchCompanyId == this.loginId) {
- const scyName = row.receiveScyName;
- this.$confirm('邀请与"' + scyName + '"的链属关系?', "邀请", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "info"
- })
- .then(function() {
- const state = "00";
- return againRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("邀请成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消邀请"
- });
- });
- } else if (row.launchReceiveScrCompanyId == this.loginId) {
- const scyName = row.launchScyName;
- this.$confirm('邀请与"' + scyName + '"的链属关系?', "邀请", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "info"
- })
- .then(function() {
- const state = "01";
- return updateRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("邀请成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消邀请"
- });
- });
- }
- },
- /* 拒绝链属 */
- handleRefuse(row) {
- const launchScrId = row.launchScrId || this.ids;
- if (row.launchCompanyId == this.loginId) {
- const scyName = row.receiveScyName;
- this.$confirm('拒绝与"' + scyName + '"的链属关系?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- const state = "02";
- return updateRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("拒绝成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已拒绝链属"
- });
- });
- } else if (row.launchReceiveScrCompanyId == this.loginId) {
- const scyName = row.launchScyName;
- this.$confirm('拒绝与"' + scyName + '"的链属关系?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- const state = "02";
- return updateRel(launchScrId, state);
- })
- .then(() => {
- this.msgSuccess("拒绝成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已拒绝链属"
- });
- });
- }
- },
- /** 解绑按钮操作 */
- handleDelete(row) {
- const launchScrId = row.launchScrId || this.ids;
- if (row.launchCompanyId == this.loginId) {
- const scyName = row.receiveScyName;
- this.$confirm('是否确认解绑与"' + scyName + '"的链属关系?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- return delRel(launchScrId);
- })
- .then(() => {
- this.msgSuccess("解绑成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消解绑"
- });
- });
- } else if (row.launchReceiveScrCompanyId == this.loginId) {
- const scyName = row.launchScyName;
- this.$confirm('是否确认解绑与"' + scyName + '"的链属关系?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- return delRel(launchScrId);
- })
- .then(() => {
- this.msgSuccess("解绑成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消解绑"
- });
- });
- }
- },
- /* 解绑链属企业信息数据 */
- handleSpareDelete(row) {
- const scpId = row.scpId || this.ids;
- const scpName = row.scpName;
- this.$confirm('是否确认解绑"' + scpName + '"的信息?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- return removeSpare(scpId);
- })
- .then(() => {
- this.msgSuccess("解绑成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消解绑"
- });
- });
- },
- //重邀操作
- handleInvite(row) {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- againInvite(row)
- .then(response => {})
- .then(() => {
- this.msgSuccess("重邀成功");
- this.getUser();
- this.getSpare();
- this.getCompanyList();
- loading.close();
- })
- .catch(e => {
- loading.close();
- });
- },
- //获取操作员Id
- getUser() {
- getUser().then(response => {
- this.userId = response.data.userId;
- this.scyTypeNow = response.data.scyType;
- this.companyId = response.data.companyId;
- if (this.scyTypeNow == "01") {
- this.handleRel = true;
- } else {
- this.handleRel = false;
- }
- this.getList();
- });
- }
- }
- };
- </script>
- </style><style lang="scss" scoped>
- ::v-deep .el-tabs__item {
- width: 105px;
- height: 55px;
- padding: 0;
- line-height: 55px;
- text-align: center;
- font-size: 16px;
- }
- .zap-credit__content {
- position: relative;
- padding: 0 13px 25px;
- background-color: #ffffff;
- }
- .zap-credit__tabs {
- position: relative;
- }
- .zap-credit__buttons {
- position: absolute;
- top: 0;
- right: 13px;
- display: flex;
- align-items: center;
- height: 55px;
- z-index: 99;
- }
- </style>
|