companyRel.vue 41 KB

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