12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436 |
- <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.scpInvite == '1' && 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>
|