| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205 |
- <template>
- <el-tabs type="border-card">
- <el-tab-pane label="我的链属">
- <el-card class="fiche">
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
- <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
- <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
- </div>
- <hr style="margin-top: 16px;">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="企业名称" prop="companyName">
- <el-input
- maxlength="30"
- v-model="queryParams.companyName"
- placeholder="请输入企业名称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="社会统一代码" prop="scySocialCode" >
- <el-input
- maxlength="30"
- v-model="queryParams.scySocialCode"
- placeholder="请输入社会统一代码"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="链属状态" prop="scrStatus">
- <el-select v-model="queryParams.scrStatus"
- placeholder="链属状态"
- clearable
- size="small"
- style="width: 215px">
- <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">
- <el-select v-model="queryParams.scpStatus"
- placeholder="认证状态"
- clearable
- size="small"
- style="width: 215px">
- <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">
- <el-select v-model="queryParams.scrType"
- placeholder="链属关系"
- clearable
- size="small"
- style="width: 215px">
- <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-card>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['service:rel:add']"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['service:relImport:importData']"
- style="background-color: #23C6C8;
- border-color:#23C6C8"
- >导入</el-button>
- </el-col>
- </el-row>
- <el-table v-loading="loading" :data="companyRelList" stripe border>
- <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:update']"
- >重邀</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-card class="fiche">
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getSpare">收起</right-toolbar>
- <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleSpareQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @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="100px">
- <el-form-item label="企业名称" prop="companyName">
- <el-input
- maxlength="30"
- v-model="spareParams.companyName"
- placeholder="请输入企业名称"
- clearable
- size="small"
- @keyup.enter.native="handleSpareQuery"
- />
- </el-form-item>
- <el-form-item label="社会统一代码" prop="scySocialCode" >
- <el-input
- maxlength="30"
- style="width: 230px"
- v-model="spareParams.scySocialCode"
- placeholder="请输入社会统一代码"
- clearable
- size="small"
- @keyup.enter.native="handleSpareQuery"
- />
- </el-form-item>
- <el-form-item label="链属关系" prop="scrType">
- <el-select v-model="spareParams.scrType"
- placeholder="请选择链属关系"
- clearable
- size="small"
- style="width: 215px">
- <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-card>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['service:rel:add']"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['service:relImport:importData']"
- style="background-color: #23C6C8;
- border-color:#23C6C8"
- >导入</el-button>
- </el-col>
- </el-row>
- <!-- 未认证企业信息列表 -->
- <el-table v-loading="loading" :data="spareOwnlist" stripe border>
- <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" width="202" prop="scpName" show-overflow-tooltip/>
- <el-table-column label="社会统一代码" align="center" width="151" prop="scpSocialCode" show-overflow-tooltip/>
- <el-table-column label="链属关系" align="center" width="91" 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" width="80" prop="scpStatus" :formatter="scpStatusFormat" />
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
- <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="140px" :inline="true">
- <el-form-item label="企业编号" prop="scyId" style="display:none" >
- <el-input v-model="form.scyId" disabled />
- </el-form-item>
- <el-form-item label="链属关系" prop="scrReceiveType">
- <el-select v-model="form.scrReceiveType"
- placeholder="请选择链属关系"
- clearable
- size="small"
- style="width: 215px">
- <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">
- <el-select
- v-model="form.scyName"
- filterable
- allow-create
- clearable
- @clear="clearRemote"
- remote
- reserve-keyword
- @change="choice"
- placeholder="请输入关键词"
- :remote-method="remoteMethod"
- >
- <el-option
- v-for="item in companyList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode">
- <el-input v-model="form.scySocialCode" placeholder="请输入企业统一代码" maxlength="18" show-word-limit />
- </el-form-item>
- <el-form-item label="联系人" prop="scrContarct">
- <el-input v-model="form.scrContarct" placeholder="请输入联系人" maxlength="10" show-word-limit />
- </el-form-item>
- <el-form-item label="联系人手机号" prop="scrContarctPhone">
- <el-input v-model="form.scrContarctPhone" placeholder="请输入联系人手机号" maxlength="11" show-word-limit />
- </el-form-item>
- <el-form-item label="邮箱" prop="scrContarctEmail">
- <el-input v-model="form.scrContarctEmail" placeholder="请输入邮箱" maxlength="60" show-word-limit />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </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 :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
- <el-upload
- 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
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- 将文件拖到此处,或
- <em>点击上传</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- <el-link type="info" style="font-size:12px" @click="importTemplate" >下载模板</el-link>
- </div>
- <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
- <el-button @click="upload.open = false">取 消</el-button>
- </div>
- </el-dialog>
-
- </el-tabs>
- </template>
- <script>
- import {
- listRel, sparelist, listCompany, addRel, updateRel, listAllCompany,
- delRel, removeSpare, listCompanyQuery, getUser, againInvite
- } 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 {
- //操作员企业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: /^[\u4E00-\u9FFF0-9A-Z《》()()]+$/,
- 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})||([1-9]\d{15})$/,
- 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.getList();
- this.getSpare();
- this.getCompanyList();
- this.getUser();
- },
- 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.getList();
- this.getSpare();
- this.getCompanyList();
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- /** 查询链属列表 */
- getList() {
- this.loading = true;
- 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){
- debugger
- let scyId = item;
- if(scyId){
- listCompanyQuery(scyId).then(response => {
- if(response.data.length > 0){
- this.$set(this.form, "scySocialCode", response.data[0].scySocialCode);
- }else{
- this.$set(this.form, "scySocialCode", '');
- }
- if(response.data.length > 0){
- this.$set(this.form, "scyId", response.data[0].scyId);
- this.idShow = true;
- }else{
- this.$set(this.form, "scyId", '');
- this.idShow = false;
- }
- })
- }
- },
- // 取消按钮
- 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.getList();
- },
- /** 未认证搜索按钮操作 */
- 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.reset();
- 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,"提交表单")
- addRel(self.form).then(response => {
- this.msgSuccess("新增成功");
- loading.close();
- this.open = false;
- this.getList();
- 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.getList();
- 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.getList();
- 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 updateRel(launchScrId,state);
- }).then(() => {
- this.msgSuccess("邀请成功");
- this.getList();
- 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.getList();
- 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.getList();
- 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.getList();
- 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.getList();
- 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.getList();
- 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.getList();
- 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.getList();
- 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;
- if(this.scyTypeNow == '01'){
- this.handleRel = true;
- }else {
- this.handleRel = false;
- }
- })
- }
- }
- };
- </script>
|