companyRel.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. <template>
  2. <el-tabs type="border-card">
  3. <el-tab-pane label="我的链属">
  4. <el-card class="fiche">
  5. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
  6. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  7. <div style="float: right;margin-right:1%">
  8. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  9. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
  10. <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
  11. </div>
  12. <hr style="margin-top: 16px;">
  13. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  14. <el-form-item label="企业名称" prop="companyName">
  15. <el-input
  16. maxlength="30"
  17. v-model="queryParams.companyName"
  18. placeholder="请输入企业名称"
  19. clearable
  20. size="small"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="社会统一代码" prop="scySocialCode" >
  25. <el-input
  26. maxlength="30"
  27. v-model="queryParams.scySocialCode"
  28. placeholder="请输入社会统一代码"
  29. clearable
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="链属状态" prop="scrStatus">
  35. <el-select v-model="queryParams.scrStatus"
  36. placeholder="链属状态"
  37. clearable
  38. size="small"
  39. style="width: 215px">
  40. <el-option
  41. v-for="dict in scrStatusOptions"
  42. :key="dict.dictValue"
  43. :label="dict.dictLabel"
  44. :value="dict.dictValue"
  45. ></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="链属关系" prop="scrType">
  49. <el-select v-model="queryParams.scrType"
  50. placeholder="链属关系"
  51. clearable
  52. size="small"
  53. style="width: 215px">
  54. <el-option
  55. v-for="dict in scrTypeOptions"
  56. :key="dict.dictValue"
  57. :label="dict.dictLabel"
  58. :value="dict.dictValue"
  59. ></el-option>
  60. </el-select>
  61. </el-form-item>
  62. </el-form>
  63. </el-card>
  64. <el-row :gutter="10" class="mb8">
  65. <el-col :span="1.5">
  66. <el-button
  67. type="primary"
  68. icon="el-icon-plus"
  69. size="mini"
  70. @click="handleAdd"
  71. v-hasPermi="['service:rel:add']"
  72. >新增</el-button>
  73. </el-col>
  74. <el-col :span="1.5">
  75. <el-button
  76. type="warning"
  77. icon="el-icon-upload2"
  78. size="mini"
  79. @click="handleImport"
  80. v-hasPermi="['service:relImport:importData']"
  81. style="background-color: #23C6C8;
  82. border-color:#23C6C8"
  83. >导入</el-button>
  84. </el-col>
  85. </el-row>
  86. <el-table v-loading="loading" :data="companyRelList" stripe border>
  87. <el-table-column label="序号" type="index" width="50" align="center">
  88. <template slot-scope="scope">
  89. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="社会统一代码" align="center" prop="companyCode" v-if="uncheckList.companyCode" show-overflow-tooltip>
  93. <template slot-scope="scope">
  94. <span v-if="scope.row.launch">{{scope.row.receiveScySocialCode}}</span>
  95. <span v-else>{{scope.row.launchScySocialCode}}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="企业名称" align="center" prop="companyName" v-if="uncheckList.companyName" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. <span v-if="scope.row.launch">{{scope.row.receiveScyName}}</span>
  101. <span v-else>{{scope.row.launchScyName}}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="链属关系" align="center" prop="companyType" v-if="uncheckList.companyType">
  105. <template slot-scope="scope">
  106. <span v-if="scope.row.launch">{{companyTypeFormat(scope.row.launchScrReceiveType)}}</span>
  107. <span v-else>{{companyTypeFormat(scope.row.launchScrLaunchType)}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="联系人" align="center" prop="launchScrContarct" v-if="uncheckList.launchScrContarct">
  111. </el-table-column>
  112. <el-table-column label="联系电话" align="center" prop="launchScrContarctPhone" v-if="uncheckList.launchScrContarctPhone">
  113. </el-table-column>
  114. <el-table-column label="邮箱" align="center" prop="launchScrContarctEmail" v-if="uncheckList.launchScrContarctEmail" show-overflow-tooltip>
  115. </el-table-column>
  116. <el-table-column label="状态" align="center" prop="launchScrStatus" v-if="uncheckList.launchScrStatus" :formatter="launchScrStatusFormat">
  117. </el-table-column>
  118. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  119. <template slot-scope="scope">
  120. <el-button
  121. size="mini"
  122. type="text"
  123. @click="handleCompanyQuery(scope.row)"
  124. v-hasPermi="['service:rel:query']"
  125. >详情</el-button>
  126. <el-button
  127. v-if="scope.row.launch && scope.row.launchScrReceiveType == '00' && scope.row.launchScrStatus =='01'"
  128. v-else="scope.row.launchScrLaunchType == '00' && scope.row.launchScrStatus =='01'"
  129. size="mini"
  130. type="text"
  131. @click="handleDelete(scope.row)"
  132. v-hasPermi="['service:rel:delete']"
  133. >解绑</el-button>
  134. <el-button
  135. v-if="scope.row.launch && scope.row.launchScrReceiveType == '00' && scope.row.launchScrStatus =='00'"
  136. v-else="scope.row.launchScrLaunchType == '00' && scope.row.launchScrStatus =='00'"
  137. size="mini"
  138. type="text"
  139. @click="handleSuccess(scope.row)"
  140. v-hasPermi="['service:rel:update']"
  141. >确认链属</el-button>
  142. <el-button
  143. v-if="scope.row.launch && scope.row.launchScrReceiveType == '00' && scope.row.launchScrStatus =='00'"
  144. v-else="scope.row.launchScrLaunchType == '00' && scope.row.launchScrStatus =='00'"
  145. size="mini"
  146. type="text"
  147. @click="handleRefuse(scope.row)"
  148. v-hasPermi="['service:rel:update']"
  149. >拒绝</el-button>
  150. </template>
  151. </el-table-column>
  152. </el-table>
  153. <pagination
  154. v-show="total > 0"
  155. :total="total"
  156. :page.sync="queryParams.pageNum"
  157. :limit.sync="queryParams.pageSize"
  158. @pagination="getList"
  159. />
  160. </el-tab-pane>
  161. <el-tab-pane label="链属未认证">
  162. <!-- 未认证列表 -->
  163. <el-card class="fiche">
  164. <right-toolbar :showSearch.sync="showSearch" @queryTable="getSpare">收起</right-toolbar>
  165. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  166. <div style="float: right;margin-right:1%">
  167. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleSpareQuery">搜索</el-button>
  168. <el-button icon="el-icon-refresh" size="mini" @click="resetSpareQuery" style="float: ;">重置</el-button>
  169. </div>
  170. <hr style="margin-top: 16px;">
  171. <el-form :model="spareParams" ref="querySpareForm" :inline="true" v-show="showSearch" label-width="100px">
  172. <el-form-item label="企业名称" prop="companyName">
  173. <el-input
  174. maxlength="30"
  175. v-model="spareParams.companyName"
  176. placeholder="请输入企业名称"
  177. clearable
  178. size="small"
  179. @keyup.enter.native="handleSpareQuery"
  180. />
  181. </el-form-item>
  182. <el-form-item label="社会统一代码" prop="scySocialCode" >
  183. <el-input
  184. maxlength="30"
  185. v-model="spareParams.scySocialCode"
  186. placeholder="请输入社会统一代码"
  187. clearable
  188. size="small"
  189. @keyup.enter.native="handleSpareQuery"
  190. />
  191. </el-form-item>
  192. <el-form-item label="链属关系" prop="scrType">
  193. <el-select v-model="spareParams.scrType"
  194. placeholder="请选择链属关系"
  195. clearable
  196. size="small"
  197. style="width: 215px">
  198. <el-option
  199. v-for="dict in scrTypeOptions"
  200. :key="dict.dictValue"
  201. :label="dict.dictLabel"
  202. :value="dict.dictValue"
  203. ></el-option>
  204. </el-select>
  205. </el-form-item>
  206. </el-form>
  207. </el-card>
  208. <el-row :gutter="10" class="mb8">
  209. <el-col :span="1.5">
  210. <el-button
  211. type="primary"
  212. icon="el-icon-plus"
  213. size="mini"
  214. @click="handleAdd"
  215. v-hasPermi="['service:rel:add']"
  216. >新增</el-button>
  217. </el-col>
  218. <el-col :span="1.5">
  219. <el-button
  220. type="warning"
  221. icon="el-icon-upload2"
  222. size="mini"
  223. @click="handleImport"
  224. v-hasPermi="['service:relImport:importData']"
  225. style="background-color: #23C6C8;
  226. border-color:#23C6C8"
  227. >导入</el-button>
  228. </el-col>
  229. </el-row>
  230. <!-- 未认证企业信息列表 -->
  231. <el-table v-loading="loading" :data="spareOwnlist" stripe border>
  232. <el-table-column label="序号" type="index" width="50" align="center">
  233. <template slot-scope="scope">
  234. <span>{{(spareParams.pageNum - 1) * spareParams.pageSize + scope.$index + 1}}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="企业名称" align="center" width="202" prop="scpName" show-overflow-tooltip/>
  238. <el-table-column label="社会统一代码" align="center" width="151" prop="scpSocialCode" show-overflow-tooltip/>
  239. <el-table-column label="链属关系" align="center" width="91" prop="scpType" :formatter="scpTypeFormat" />
  240. <el-table-column label="联系人" align="center" width="83" prop="scpContarct" />
  241. <el-table-column label="联系电话" align="center" width="109" prop="scpContarctPhone" show-overflow-tooltip />
  242. <el-table-column label="邮箱" align="center" width="187" prop="scpContarctEmail" show-overflow-tooltip/>
  243. <el-table-column label="状态" align="center" width="80" prop="scpStatus" :formatter="scpStatusFormat" />
  244. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  245. <template slot-scope="scope">
  246. <el-button
  247. v-if="scope.row.scpInvite == '1'"
  248. size="mini"
  249. type="text"
  250. @click="handleInvite(scope.row)"
  251. v-hasPermi="['service:spare:invite']"
  252. >重邀</el-button>
  253. <el-button
  254. size="mini"
  255. type="text"
  256. @click="handleSpareDelete(scope.row)"
  257. v-hasPermi="['service:rel:delete']"
  258. >解绑</el-button>
  259. </template>
  260. </el-table-column>
  261. </el-table>
  262. <pagination
  263. v-show="spareTitol > 0"
  264. :total="spareTitol"
  265. :page.sync="spareParams.pageNum"
  266. :limit.sync="spareParams.pageSize"
  267. @pagination="getSpare"
  268. />
  269. </el-tab-pane>
  270. <!-- 添加链属框 -->
  271. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  272. <el-form ref="form" :model="form" :rules="rules" label-width="140px" :inline="true">
  273. <el-form-item label="企业编号" prop="scyId" style="display:none" >
  274. <el-input v-model="form.scyId" disabled />
  275. </el-form-item>
  276. <el-form-item label="链属关系" prop="scrReceiveType">
  277. <el-select v-model="form.scrReceiveType"
  278. placeholder="请选择链属关系"
  279. clearable
  280. size="small"
  281. style="width: 215px">
  282. <el-option
  283. v-for="dict in scrTypeOptions"
  284. :key="dict.dictValue"
  285. :label="dict.dictLabel"
  286. :value="dict.dictValue"
  287. ></el-option>
  288. </el-select>
  289. </el-form-item>
  290. <el-form-item label="企业名称" prop="scyName">
  291. <el-select
  292. v-model="form.scyName"
  293. filterable
  294. allow-create
  295. clearable
  296. @clear="clearRemote"
  297. remote
  298. reserve-keyword
  299. @change="choice"
  300. placeholder="请输入关键词"
  301. :remote-method="remoteMethod"
  302. >
  303. <el-option
  304. v-for="item in companyList"
  305. :key="item.value"
  306. :label="item.label"
  307. :value="item.value">
  308. </el-option>
  309. </el-select>
  310. </el-form-item>
  311. <el-form-item label="企业统一代码" prop="scySocialCode">
  312. <el-input v-model="form.scySocialCode" placeholder="请输入企业统一代码" maxlength="18" show-word-limit />
  313. </el-form-item>
  314. <el-form-item label="联系人" prop="scrContarct">
  315. <el-input v-model="form.scrContarct" placeholder="请输入联系人" maxlength="10" show-word-limit />
  316. </el-form-item>
  317. <el-form-item label="联系人手机号" prop="scrContarctPhone">
  318. <el-input v-model="form.scrContarctPhone" placeholder="请输入联系人手机号" maxlength="11" show-word-limit />
  319. </el-form-item>
  320. <el-form-item label="邮箱" prop="scrContarctEmail">
  321. <el-input v-model="form.scrContarctEmail" placeholder="请输入邮箱" maxlength="60" show-word-limit />
  322. </el-form-item>
  323. </el-form>
  324. <div slot="footer" class="dialog-footer">
  325. <el-button type="primary" @click="submitForm">确 定</el-button>
  326. <el-button @click="cancel">取 消</el-button>
  327. </div>
  328. </el-dialog>
  329. <!-- 企业详情对话框 -->
  330. <el-dialog :title="titleDetail" :visible.sync="openDetail" width="800px" append-to-body >
  331. <el-form ref="formDetail" :model="formDetail" label-width="140px" :inline="true">
  332. <el-form-item label="企业名称" prop="scyName" >
  333. <el-input v-model="formDetail.scyName" placeholder="请输入企业名称" disabled style="width:560px" maxlength="20" show-word-limit/>
  334. </el-form-item>
  335. <el-form-item label="企业统一代码" prop="scySocialCode">
  336. <el-input v-model="formDetail.scySocialCode" placeholder="请输入企业统一代码" disabled maxlength="18" show-word-limit/>
  337. </el-form-item>
  338. <el-form-item label="联系人" prop="scyLegal">
  339. <el-input v-model="formDetail.scyLegal" placeholder="请输入联系人" disabled maxlength="5" show-word-limit/>
  340. </el-form-item>
  341. <el-form-item label="联系人手机号" prop="scyPhone">
  342. <el-input v-model="formDetail.scyPhone" placeholder="请输入联系人手机号" disabled maxlength="11" show-word-limit/>
  343. </el-form-item>
  344. </el-form>
  345. <div slot="footer" class="dialog-footer">
  346. <el-button @click="cancelDetail">取 消</el-button>
  347. </div>
  348. </el-dialog>
  349. <!-- 导入窗口 -->
  350. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  351. <el-upload
  352. ref="upload"
  353. :limit="1"
  354. accept=".xlsx, .xls"
  355. :headers="upload.headers"
  356. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  357. :disabled="upload.isUploading"
  358. :on-progress="handleFileUploadProgress"
  359. :on-success="handleFileSuccess"
  360. :auto-upload="false"
  361. drag
  362. >
  363. <i class="el-icon-upload"></i>
  364. <div class="el-upload__text">
  365. 将文件拖到此处,或
  366. <em>点击上传</em>
  367. </div>
  368. <div class="el-upload__tip" slot="tip">
  369. <el-link type="info" style="font-size:12px" @click="importTemplate" >下载模板</el-link>
  370. </div>
  371. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  372. </el-upload>
  373. <div slot="footer" class="dialog-footer">
  374. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  375. <el-button @click="upload.open = false">取 消</el-button>
  376. </div>
  377. </el-dialog>
  378. </el-tabs>
  379. </template>
  380. <script>
  381. import {
  382. listRel, sparelist, listCompany, addRel, updateRel, listAllCompany,
  383. delRel, removeSpare, listCompanyQuery, getUser, againInvite
  384. } from "@/api/service/rel/companyRel";
  385. import { uploadFileNew } from "@/api/common/file";
  386. import { getToken } from "@/utils/auth";
  387. import {columnQuery,columnfilter} from "@/api/common/columnSetting";
  388. import ColumnSetting from '../../../components/Table/columnSetting.vue';
  389. import Cookies from 'js-cookie'
  390. export default {
  391. name: "companyRel",
  392. components: {
  393. ColumnSetting
  394. },
  395. data() {
  396. return {
  397. //操作员企业Id
  398. loginId : '',
  399. userId : "",
  400. // 遮罩层
  401. loading: true,
  402. // 选中数组
  403. ids: [],
  404. // 非单个禁用
  405. single: true,
  406. rel : true,
  407. spare : false,
  408. // 非多个禁用
  409. multiple: true,
  410. // 显示搜索条件
  411. showSearch: true,
  412. // 总条数
  413. total: 0,
  414. spareTitol: 0,
  415. // 公司数据
  416. companyList: [],
  417. //链属表格数据
  418. companyRelList: [],
  419. //链属未认证列表数据
  420. spareOwnlist : [],
  421. // 状态数据字典
  422. scrStatusOptions: [],
  423. scrTypeOptions : [],
  424. scpStatusOptions : [],
  425. listCom : [],
  426. comlist : [],
  427. // 弹出层标题
  428. title: "",
  429. templateTitle:'',
  430. titleDetail:'',
  431. // 是否显示弹出层
  432. open: false,
  433. templateOpen : false,
  434. openDetail:false,
  435. idShow: true,
  436. // 导入参数
  437. upload: {
  438. // 是否显示弹出层(导入)
  439. open: false,
  440. // 弹出层标题(导入)
  441. title: "",
  442. // 是否禁用上传
  443. isUploading: false,
  444. // 是否更新已经存在的用户数据
  445. updateSupport: 0,
  446. // 设置上传的请求头部
  447. headers: { Authorization: "Bearer " + getToken() },
  448. // 上传的地址
  449. url: process.env.VUE_APP_BASE_API + "/sc-service/relImport/importData",
  450. },
  451. // 链属查询参数
  452. queryParams: {
  453. pageNum: 1,
  454. pageSize: 10,
  455. companyName: null,
  456. scySocialCode: null,
  457. scrStatus: null,
  458. scrType: null
  459. },
  460. //未认证列表查询参数
  461. spareParams:{
  462. pageNum: 1,
  463. pageSize: 10,
  464. scySocialCode : null,
  465. companyName : null,
  466. scrType : null
  467. },
  468. //企业列表查询参数
  469. companyQueryParams: {
  470. pageNum: 1,
  471. pageSize: 10,
  472. scyName: null
  473. },
  474. //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
  475. tableList: [
  476. {
  477. label: 'companyCode',
  478. value: '社会统一代码'
  479. },
  480. {
  481. label: 'companyName',
  482. value: '企业名称'
  483. },
  484. {
  485. label: 'companyType',
  486. value: '链属关系'
  487. },
  488. {
  489. label: 'launchScrContarct',
  490. value: '联系人'
  491. },
  492. {
  493. label: 'launchScrContarctPhone',
  494. value: '联系电话'
  495. },
  496. {
  497. label: 'launchScrContarctEmail',
  498. value: '邮箱'
  499. },
  500. {
  501. label: 'launchScrStatus',
  502. value: '状态'
  503. },
  504. ],
  505. checkList: [],//筛选列选中的数据列表--显示隐藏列用
  506. uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
  507. selfDom : this,
  508. tableId:"/sc-service/rel/list",
  509. // 表单参数
  510. form: {
  511. scyId : null,
  512. scrReceiveType : null,
  513. scyName : null,
  514. scySocialCode : null,
  515. scrContarct : null,
  516. scrContarctPhone : null,
  517. scrContarctEmail : null
  518. },
  519. templateForm:{
  520. scyId : null
  521. },
  522. formDetail:{
  523. scyName : null,
  524. scySocialCode : null,
  525. scyLegal : null,
  526. scyPhone : null
  527. },
  528. companyId:null,
  529. // 表单校验
  530. rules: {
  531. scyName: [
  532. { required: true, message: "公司名称不能为空", trigger: ["blur", "change"] },
  533. ],
  534. scrReceiveType:[
  535. { required: true, message: "链属关系不能为空", trigger: ["blur", "change"] },
  536. ],
  537. scrContarctPhone: [
  538. {
  539. pattern: /^((\d{3}-\d{7,8}|\d{4}-\d{7,8})|(1[3465789]\d{9}))$/,
  540. message: "手机号格式不正确",
  541. trigger: "blur",
  542. }
  543. ],
  544. scySocialCode: [
  545. { required: true, message: "企业统一代码不能为空", trigger: ["blur", "change"] },
  546. {
  547. pattern: /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/,
  548. message: "企业统一代码格式不正确",
  549. trigger: "blur"
  550. }
  551. ],
  552. scrContarctEmail : [
  553. {
  554. pattern:/^([a-z0-9A-Z]+[-|_|\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-zA-Z]{2,}$/,
  555. message: "邮箱格式不正确",
  556. trigger: "blur"
  557. }
  558. ]
  559. },
  560. templateRules: {
  561. scyId:[
  562. { required: true, message: "核心企业不能为空", trigger: "blur" }
  563. ]
  564. },
  565. };
  566. },
  567. created() {
  568. this.getDicts("sys_scr_status").then(response => {
  569. this.scrStatusOptions = response.data;
  570. });
  571. this.getDicts("sys_scr_type").then(response => {
  572. this.scrTypeOptions = response.data;
  573. });
  574. this.getDicts("sys_scp_status").then(response => {
  575. this.scpStatusOptions = response.data;
  576. });
  577. this.getList();
  578. this.getSpare();
  579. this.getCompanyList();
  580. this.getUser();
  581. },
  582. activated() {
  583. this.getDicts("sys_scr_status").then(response => {
  584. this.scrStatusOptions = response.data;
  585. });
  586. this.getDicts("sys_scr_type").then(response => {
  587. this.scrTypeOptions = response.data;
  588. });
  589. this.getDicts("sys_scp_status").then(response => {
  590. this.scpStatusOptions = response.data;
  591. });
  592. this.getList();
  593. this.getSpare();
  594. this.getCompanyList();
  595. this.getUser();
  596. },
  597. mounted() {
  598. this.columnQuery();
  599. },
  600. methods: {
  601. //获取当前客户是否之前设置过列展示隐藏
  602. columnQuery(){
  603. //获取页面路径
  604. var psfPagePath = window.location.pathname;
  605. //用请求后台的url作为唯一标识
  606. var psfTableName = this.tableId;
  607. var columnForm = {};
  608. columnForm.psfPagePath = psfPagePath;
  609. columnForm.psfTableName = psfTableName;
  610. columnQuery(columnForm).then(response => {
  611. if(response.data && response.data.psfShowData){
  612. this.checkList = response.data.psfShowData;
  613. }
  614. this.filter();
  615. })
  616. },
  617. //控制隐藏显示的函数
  618. filter(checkList) {
  619. if (!!checkList) {
  620. this.checkList = checkList;
  621. }
  622. columnfilter(this.selfDom);
  623. },
  624. // 菜单状态字典翻译
  625. companyTypeFormat(companyType) {
  626. return this.selectDictLabel(this.scrTypeOptions, companyType);
  627. },
  628. scpTypeFormat(row, column) {
  629. return this.selectDictLabel(this.scrTypeOptions, row.scpType);
  630. },
  631. scpStatusFormat(row, column) {
  632. return this.selectDictLabel(this.scpStatusOptions, row.scpStatus);
  633. },
  634. launchScrStatusFormat(row, column) {
  635. return this.selectDictLabel(this.scrStatusOptions, row.launchScrStatus);
  636. },
  637. //平台导出模板
  638. submitTemplateForm(){
  639. this.$refs["templateForm"].validate(valid => {
  640. let fd = new FormData();
  641. for(var key in self.form){
  642. fd.append(key, self.form[key]);
  643. }
  644. if (valid) {
  645. this.download('/sc-service/relImport/importTemplate', {
  646. ...this.templateForm
  647. }, `链属模板_${new Date().getTime()}.xls`)
  648. this.cancelTemplateForm();
  649. }
  650. })
  651. },
  652. //取消导出模板选择企业
  653. cancelTemplateForm(){
  654. this.templateOpen = false;
  655. this.templateForm = {};
  656. },
  657. /** 导入按钮操作 */
  658. handleImport() {
  659. this.upload.title = "链属导入";
  660. this.upload.open = true;
  661. },
  662. /** 下载模板操作 */
  663. importTemplate() {
  664. this.download('/sc-service/relImport/importTemplate', {
  665. ...this.queryParams
  666. }, `链属模板_${new Date().getTime()}.xls`)
  667. },
  668. /* 平台下载模板操作 */
  669. importAdminTemplate(){
  670. this.templateTitle = "核心企业";
  671. this.templateOpen = true;
  672. },
  673. // 文件上传中处理
  674. handleFileUploadProgress(event, file, fileList) {
  675. this.upload.isUploading = true;
  676. },
  677. // 文件上传成功处理
  678. handleFileSuccess(response, file, fileList) {
  679. this.upload.open = false;
  680. this.upload.isUploading = false;
  681. this.$refs.upload.clearFiles();
  682. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  683. this.getList();
  684. this.getSpare();
  685. this.getCompanyList();
  686. },
  687. // 提交上传文件
  688. submitFileForm() {
  689. this.$refs.upload.submit();
  690. },
  691. /** 查询链属列表 */
  692. getList() {
  693. this.loading = true;
  694. listRel(this.queryParams).then(response => {
  695. let list = response.data.records;
  696. this.loginId = response.msg;
  697. for (let i = 0; i < list.length; i++) {
  698. if (list[i].launchCompanyId == response.msg) {
  699. list[i].receive = false;
  700. list[i].launch = true;
  701. }else if(list[i].launchReceiveScrCompanyId == response.msg){
  702. list[i].launch = false;
  703. list[i].receive = true;
  704. }
  705. }
  706. this.companyRelList = list;
  707. console.log(12312313123)
  708. console.log(this.companyRelList)
  709. this.total = response.data.total;
  710. this.loading = false;
  711. }
  712. );
  713. },
  714. // 未认证列表
  715. getSpare() {
  716. this.loading = true;
  717. sparelist(this.spareParams).then(response => {
  718. this.spareOwnlist = response.data.records;
  719. this.spareTitol = response.data.total;
  720. this.loading = false;
  721. }
  722. );
  723. },
  724. //查询所有企业
  725. getCompanyList(){
  726. this.loading = true;
  727. listAllCompany().then(response => {
  728. this.comlist = response.data;
  729. this.listCom = this.comlist.map(item => {
  730. return { value: item.scyId, label: item.scyName };
  731. });
  732. })
  733. },
  734. clearRemote(){
  735. let query = '';
  736. this.form.scyId = '';
  737. this.form.scySocialCode = '';
  738. this.idShow = true;
  739. this.remoteMethod(query);
  740. },
  741. //选择企业
  742. remoteMethod(query) {
  743. if (query) {
  744. this.loading = true;
  745. setTimeout(() => {
  746. this.loading = false;
  747. this.companyList = this.listCom.filter(item => {
  748. return item.label.toLowerCase()
  749. .indexOf(query.toLowerCase()) > -1;
  750. });
  751. }, 200);
  752. } else {
  753. this.companyList = [];
  754. }
  755. },
  756. //选择企业后反显
  757. choice(item){
  758. debugger
  759. let scyId = item;
  760. if(scyId){
  761. listCompanyQuery(scyId).then(response => {
  762. if(response.data.length > 0){
  763. this.$set(this.form, "scySocialCode", response.data[0].scySocialCode);
  764. }else{
  765. this.$set(this.form, "scySocialCode", '');
  766. }
  767. if(response.data.length > 0){
  768. this.$set(this.form, "scyId", response.data[0].scyId);
  769. this.idShow = true;
  770. }else{
  771. this.$set(this.form, "scyId", '');
  772. this.idShow = false;
  773. }
  774. })
  775. }
  776. },
  777. // 取消按钮
  778. cancel() {
  779. this.open = false;
  780. this.clearRemote();
  781. this.reset();
  782. },
  783. cancelDetail(){
  784. this.openDetail = false;
  785. this.reset();
  786. },
  787. // 表单重置
  788. reset() {
  789. this.clearRemote();
  790. this.resetForm("form");
  791. this.resetForm("formDetail");
  792. },
  793. /** 搜索按钮操作 */
  794. handleQuery() {
  795. this.queryParams.pageNum = 1;
  796. this.getList();
  797. },
  798. /** 未认证搜索按钮操作 */
  799. handleSpareQuery() {
  800. this.spareParams.pageNum = 1;
  801. this.getSpare();
  802. },
  803. /** 重置按钮操作 */
  804. resetQuery() {
  805. this.resetForm("queryForm");
  806. this.handleQuery();
  807. },
  808. /** 未认证重置按钮操作 */
  809. resetSpareQuery() {
  810. this.resetForm("querySpareForm");
  811. this.handleSpareQuery();
  812. },
  813. /** 新增按钮操作 */
  814. handleAdd() {
  815. this.reset();
  816. this.open = true;
  817. this.title = "新增链属";
  818. },
  819. //查询企业详情
  820. handleCompanyQuery(row){
  821. this.reset();
  822. if(row.receive == true){
  823. const scyId = row.launchCompanyId;
  824. listCompanyQuery(scyId).then(response => {
  825. if(response.data[0].scyStatus == '00'){
  826. Cookies.set("/rel/detailComPany/" + scyId + '/', this.$route.fullPath)
  827. this.$router.push("/rel/detailComPany/" + scyId + '/');
  828. }else{
  829. this.formDetail = response.data[0];
  830. this.openDetail = true;
  831. this.titleDetail = "详情企业信息";
  832. }
  833. });
  834. }else if(row.launch == true){
  835. const scyId = row.launchReceiveScrCompanyId;
  836. listCompanyQuery(scyId).then(response => {
  837. if(response.data[0].scyStatus == '00'){
  838. Cookies.set("/rel/detailComPany/" + scyId + '/', this.$route.fullPath)
  839. this.$router.push("/rel/detailComPany/" + scyId + '/');
  840. }else{
  841. this.formDetail = response.data[0];
  842. this.openDetail = true;
  843. this.titleDetail = "详情企业信息";
  844. }
  845. });
  846. }
  847. },
  848. /** 提交按钮 */
  849. submitForm() {
  850. var self = this;
  851. this.$refs["form"].validate(valid => {
  852. let fd = new FormData();
  853. for(var key in self.form){
  854. fd.append(key, self.form[key]);
  855. }
  856. if (valid) {
  857. const loading = this.$loading({
  858. lock: true,
  859. text: "Loading",
  860. spinner: "el-icon-loading",
  861. background: "rgba(0, 0, 0, 0.7)",
  862. })
  863. addRel(self.form).then(response => {
  864. this.msgSuccess("新增成功");
  865. this.open = false;
  866. this.getList();
  867. this.getSpare();
  868. this.getCompanyList();
  869. });
  870. loading.close();
  871. }
  872. });
  873. },
  874. /* 同意链属 */
  875. handleSuccess(row){
  876. const launchScrId = row.launchScrId || this.ids;
  877. if (row.launchCompanyId == this.loginId) {
  878. const scyName = row.receiveScyName;
  879. this.$confirm('确认与"' + scyName + '"的链属关系?', "警告", {
  880. confirmButtonText: "确定",
  881. cancelButtonText: "取消",
  882. type: "warning"
  883. }).then(function() {
  884. const state = "01";
  885. return updateRel(launchScrId,state);
  886. }).then(() => {
  887. this.msgSuccess("链属成功");
  888. this.getList();
  889. this.getSpare();
  890. this.getCompanyList();
  891. })
  892. .catch(() => {
  893. this.$message({
  894. type: "warning",
  895. message: "已取消链属",
  896. });
  897. });
  898. }else if(row.launchReceiveScrCompanyId == this.loginId){
  899. const scyName = row.launchScyName;
  900. this.$confirm('确认与"' + scyName + '"的链属关系?', "警告", {
  901. confirmButtonText: "确定",
  902. cancelButtonText: "取消",
  903. type: "warning"
  904. }).then(function() {
  905. const state = "01";
  906. return updateRel(launchScrId,state);
  907. }).then(() => {
  908. this.msgSuccess("链属成功");
  909. this.getList();
  910. this.getSpare();
  911. this.getCompanyList();
  912. })
  913. .catch(() => {
  914. this.$message({
  915. type: "warning",
  916. message: "已取消链属",
  917. });
  918. });
  919. }
  920. },
  921. /* 拒绝链属 */
  922. handleRefuse(row){
  923. const launchScrId = row.launchScrId || this.ids;
  924. if (row.launchCompanyId == this.loginId) {
  925. const scyName = row.receiveScyName;
  926. this.$confirm('拒绝与"' + scyName + '"的链属关系?', "警告", {
  927. confirmButtonText: "确定",
  928. cancelButtonText: "取消",
  929. type: "warning"
  930. }).then(function() {
  931. const state = "02";
  932. return updateRel(launchScrId,state);
  933. }).then(() => {
  934. this.msgSuccess("拒绝成功");
  935. this.getList();
  936. this.getSpare();
  937. this.getCompanyList();
  938. })
  939. .catch(() => {
  940. this.$message({
  941. type: "warning",
  942. message: "已拒绝链属",
  943. });
  944. });
  945. }else if(row.launchReceiveScrCompanyId == this.loginId){
  946. const scyName = row.launchScyName;
  947. this.$confirm('拒绝与"' + scyName + '"的链属关系?', "警告", {
  948. confirmButtonText: "确定",
  949. cancelButtonText: "取消",
  950. type: "warning"
  951. }).then(function() {
  952. const state = "02";
  953. return updateRel(launchScrId,state);
  954. }).then(() => {
  955. this.msgSuccess("拒绝成功");
  956. this.getList();
  957. this.getSpare();
  958. this.getCompanyList();
  959. })
  960. .catch(() => {
  961. this.$message({
  962. type: "warning",
  963. message: "已拒绝链属",
  964. });
  965. });
  966. }
  967. },
  968. /** 解绑按钮操作 */
  969. handleDelete(row) {
  970. const launchScrId = row.launchScrId || this.ids;
  971. if (row.launchCompanyId == this.loginId) {
  972. const scyName = row.receiveScyName;
  973. this.$confirm('是否确认解绑与"' + scyName + '"的链属关系?', "警告", {
  974. confirmButtonText: "确定",
  975. cancelButtonText: "取消",
  976. type: "warning"
  977. }).then(function() {
  978. return delRel(launchScrId);
  979. }).then(() => {
  980. this.msgSuccess("解绑成功");
  981. this.getList();
  982. this.getSpare();
  983. this.getCompanyList();
  984. })
  985. .catch(() => {
  986. this.$message({
  987. type: "warning",
  988. message: "已取消解绑",
  989. });
  990. });
  991. }else if(row.launchReceiveScrCompanyId == this.loginId){
  992. const scyName = row.launchScyName;
  993. this.$confirm('是否确认解绑与"' + scyName + '"的链属关系?', "警告", {
  994. confirmButtonText: "确定",
  995. cancelButtonText: "取消",
  996. type: "warning"
  997. }).then(function() {
  998. return delRel(launchScrId);
  999. }).then(() => {
  1000. this.msgSuccess("解绑成功");
  1001. this.getList();
  1002. this.getSpare();
  1003. this.getCompanyList();
  1004. })
  1005. .catch(() => {
  1006. this.$message({
  1007. type: "warning",
  1008. message: "已取消解绑",
  1009. });
  1010. });
  1011. }
  1012. },
  1013. /* 解绑链属企业信息数据 */
  1014. handleSpareDelete(row) {
  1015. const scpId = row.scpId || this.ids;
  1016. const scpName = row.scpName;
  1017. this.$confirm('是否确认解绑"' + scpName + '"的信息?', "警告", {
  1018. confirmButtonText: "确定",
  1019. cancelButtonText: "取消",
  1020. type: "warning"
  1021. }).then(function() {
  1022. return removeSpare(scpId);
  1023. }).then(() => {
  1024. this.getSpare();
  1025. this.msgSuccess("解绑成功");
  1026. })
  1027. .catch(() => {
  1028. this.$message({
  1029. type: "warning",
  1030. message: "已取消解绑",
  1031. });
  1032. });
  1033. },
  1034. //重邀操作
  1035. handleInvite(row){
  1036. const loading = this.$loading({
  1037. lock: true,
  1038. text: "Loading",
  1039. spinner: "el-icon-loading",
  1040. background: "rgba(0, 0, 0, 0.7)",
  1041. })
  1042. againInvite(row).then(response => {
  1043. this.getList();
  1044. this.getSpare();
  1045. this.getCompanyList();
  1046. }).then(() => {
  1047. this.msgSuccess("重邀成功");
  1048. this.getList();
  1049. this.getSpare();
  1050. this.getCompanyList();
  1051. loading.close();
  1052. }).catch((e) => {
  1053. loading.close();
  1054. });
  1055. },
  1056. //获取操作员Id
  1057. getUser(){
  1058. getUser().then(response => {
  1059. this.userId = response.data;
  1060. })
  1061. }
  1062. }
  1063. };
  1064. </script>