admin.vue 36KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <div>
  6. <!-- <el-button
  7. type="primary"
  8. size="small"
  9. icon="el-icon-circle-plus-outline"
  10. style="float:left"
  11. @click="toGet">CA企业认证</el-button> -->
  12. <el-button
  13. type="primary"
  14. size="small"
  15. icon="el-icon-circle-plus-outline"
  16. style="float:left"
  17. @click="openForm(0)">新增</el-button>
  18. <el-button
  19. type="primary"
  20. size="small"
  21. @click="BatchDelete"
  22. >医药师登记</el-button>
  23. <el-button
  24. type="primary"
  25. size="small"
  26. icon="el-icon-circle-plus-outline"
  27. style="float:left"
  28. @click="toJiaBan">加班</el-button>
  29. <!-- <el-button
  30. type="primary"
  31. size="small"
  32. icon="el-icon-circle-plus-outline"
  33. style="float:left"
  34. @click="toTest">短信</el-button> -->
  35. <!-- <el-button
  36. type="primary"
  37. size="small"
  38. icon="el-icon-circle-plus-outline"
  39. style="float:left"
  40. @click="toTestOne">创建个人用户实名</el-button>
  41. <el-button
  42. type="primary"
  43. size="small"
  44. icon="el-icon-circle-plus-outline"
  45. style="float:left"
  46. @click="toTestFive">创建企业用户并实名</el-button>
  47. <el-button
  48. type="primary"
  49. size="small"
  50. icon="el-icon-circle-plus-outline"
  51. style="float:left"
  52. @click="toTestFour">添加企业成员</el-button>
  53. <el-button
  54. type="primary"
  55. size="small"
  56. icon="el-icon-circle-plus-outline"
  57. style="float:left"
  58. @click="toTestTwo">创建个人印章</el-button>
  59. <el-button
  60. type="primary"
  61. size="small"
  62. icon="el-icon-circle-plus-outline"
  63. style="float:left"
  64. @click="toTestThree">创建合同</el-button> -->
  65. <!-- <el-button
  66. type="primary"
  67. size="small"
  68. icon="el-icon-circle-plus-outline"
  69. style="float:left"
  70. @click="toTestSeven">添加合同签署人</el-button> -->
  71. <!-- <el-button
  72. type="primary"
  73. size="small"
  74. icon="el-icon-circle-plus-outline"
  75. style="float:left"
  76. @click="toTestTen"
  77. >
  78. 短信验证码
  79. </el-button> -->
  80. <!-- <el-button
  81. type="primary"
  82. size="small"
  83. icon="el-icon-circle-plus-outline"
  84. style="float:left"
  85. @click="toTestNight">后台签署</el-button>
  86. -->
  87. <!-- <el-button
  88. type="primary"
  89. size="small"
  90. icon="el-icon-circle-plus-outline"
  91. style="float:left"
  92. @click="toTestElement">创建企业用章</el-button> -->
  93. <!-- <el-button
  94. type="primary"
  95. size="small"
  96. icon="el-icon-circle-plus-outline"
  97. style="float:left"
  98. @click="toTestThrityMent">生成PDF</el-button> -->
  99. <!-- <el-button
  100. type="primary"
  101. size="small"
  102. icon="el-icon-circle-plus-outline"
  103. style="float:left"
  104. @click="toTestTwo">创建个人印章</el-button> -->
  105. <!-- <el-button
  106. type="primary"
  107. size="small"
  108. icon="el-icon-circle-plus-outline"
  109. style="float:left"
  110. @click="toTestThree">创建合同</el-button>
  111. <el-button
  112. type="primary"
  113. size="small"
  114. icon="el-icon-circle-plus-outline"
  115. style="float:left"
  116. @click="toTestSeven">添加合同签署人</el-button>
  117. <el-button
  118. type="primary"
  119. size="small"
  120. icon="el-icon-circle-plus-outline"
  121. style="float:left"
  122. @click="toTestTen"
  123. >
  124. 获取短信验证码
  125. </el-button>
  126. <el-button
  127. type="primary"
  128. size="small"
  129. icon="el-icon-circle-plus-outline"
  130. style="float:left"
  131. @click="toTestNight">后台签署</el-button>
  132. <el-button
  133. type="primary"
  134. size="small"
  135. icon="el-icon-circle-plus-outline"
  136. style="float:left"
  137. @click="toTestThrity">合同详情查询</el-button>
  138. <el-button
  139. type="primary"
  140. size="small"
  141. icon="el-icon-circle-plus-outline"
  142. style="float:left"
  143. @click="toWatch">合同在线预览</el-button>
  144. <el-button
  145. type="primary"
  146. size="small"
  147. icon="el-icon-circle-plus-outline"
  148. style="float:left"
  149. @click="toEnd">结束签署</el-button> -->
  150. <!-- <el-button
  151. type="primary"
  152. size="small"
  153. icon="el-icon-circle-plus-outline"
  154. style="float:left"
  155. @click="toSendInformaton">发送短信验证码</el-button> -->
  156. <!--<el-button
  157. type="primary"
  158. size="small"
  159. icon="el-icon-circle-plus-outline"
  160. style="float:left"
  161. @click="toSavePDFInformation">生成PDF</el-button>-->
  162. <!-- <el-button
  163. type="primary"
  164. size="small"
  165. icon="el-icon-circle-plus-outline"
  166. style="float:left"
  167. @click="toCheckPDFInformation">PDF验证</el-button> -->
  168. </div>
  169. </div>
  170. <div class="app-container">
  171. <el-table
  172. :row-style="{ color: '#303133' }"
  173. :header-cell-style="{
  174. backgroundColor: 'rgb(245, 247, 250)',
  175. color: '#606266'
  176. }"
  177. style="width:100%;"
  178. ref="table"
  179. border
  180. :data="admins"
  181. v-loading="is_loading_admins"
  182. @selection-change="handleSelectionChange"
  183. >
  184. <el-table-column
  185. align="center"
  186. type="selection"
  187. width="55">
  188. </el-table-column>
  189. <el-table-column
  190. label="用户名"
  191. prop="user_name"
  192. min-width="160"
  193. align="center"
  194. ></el-table-column>
  195. <el-table-column label="医保医师编码" prop="doctor_number" min-width="160" align="center">
  196. <template slot-scope="scope">
  197. <span v-if="scope.row.doctor_number== 0"></span>
  198. <span v-if="scope.row.doctor_number!= 0">{{scope.row.doctor_number}}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column
  202. label="最后登录IP"
  203. prop="ip"
  204. min-width="150"
  205. align="center"
  206. ></el-table-column>
  207. <el-table-column
  208. label="最后登录时间"
  209. prop="last_login_time"
  210. min-width="170"
  211. align="center"
  212. >
  213. <template slot-scope="scope">
  214. <span>{{
  215. scope.row.last_login_time == 0
  216. ? ""
  217. : _parseTime(scope.row.last_login_time, "{y}-{m}-{d} {h}:{i}")
  218. }}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column
  222. label="角色"
  223. prop="role_name"
  224. min-width="160"
  225. align="center"
  226. ></el-table-column>
  227. <el-table-column label="状态" min-width="100" align="center">
  228. <template slot-scope="scope">
  229. <div
  230. v-if="scope.row.status == 1"
  231. style="color: #67C23A; font-size:20px;"
  232. >
  233. <li class="el-icon-success"></li>
  234. </div>
  235. <div v-else style="color: #F56C6C; font-size:20px;">
  236. <li class="el-icon-error"></li>
  237. </div>
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="操作" width="240" align="center">
  241. <template slot-scope="scope">
  242. <!-- <span>
  243. <el-button type="primary" size="small" @click="toRenZhen(scope.row.user_id,scope.row.user_name)">
  244. <span>CA个人认证</span>
  245. </el-button>
  246. </span> -->
  247. <!-- <span>
  248. <el-button type="primary" size="small" @click="toQianShu(scope.row.user_id,scope.row.user_name)">
  249. <span>创建签署人用户</span>
  250. </el-button>
  251. </span>
  252. <span>
  253. <el-button type="primary" size="small" @click="toYinZhang(scope.row.user_id,scope.row.user_name)">
  254. <span>创建个人印章</span>
  255. </el-button>
  256. </span> -->
  257. <!--
  258. <span>
  259. <el-button type="primary" size="small" @click="toShouQuan(scope.row.user_id,scope.row.user_name)">
  260. <span>创建企业印章</span>
  261. </el-button>
  262. </span> -->
  263. <el-tooltip
  264. class="item"
  265. effect="dark"
  266. content="编辑"
  267. placement="top"
  268. >
  269. <el-button
  270. type="primary"
  271. icon="el-icon-edit-outline"
  272. size="small"
  273. @click="openForm(scope.row.user_id)"
  274. ></el-button>
  275. </el-tooltip>
  276. <!-- </router-link> -->
  277. <el-tooltip
  278. class="item"
  279. effect="dark"
  280. content="移除"
  281. placement="top"
  282. >
  283. <el-button
  284. type="danger"
  285. size="small"
  286. icon="el-icon-delete"
  287. v-if="
  288. scope.row.status == 1 &&
  289. org.creator != scope.row.user_id &&
  290. scope.row.user_id != local_user_id
  291. "
  292. @click="disableAdminAction(scope.row)"
  293. ></el-button>
  294. </el-tooltip>
  295. <el-tooltip
  296. class="item"
  297. effect="dark"
  298. content="恢复"
  299. placement="top"
  300. >
  301. <el-button
  302. size="small"
  303. type="info"
  304. icon="el-icon-refresh"
  305. v-if="
  306. scope.row.status == 0 &&
  307. org.creator != scope.row.user_id &&
  308. scope.row.user_id != local_user_id
  309. "
  310. @click="recoverAdminAction(scope.row)"
  311. ></el-button>
  312. </el-tooltip>
  313. <span v-if="scope.row.user_type == 2">
  314. <el-button type="primary" size="small" icon="el-icon-refresh-left" @click="toReturn(scope.row.user_id,scope.row.is_mark)">
  315. <span v-if="scope.row.is_mark ==0">登记</span>
  316. <span v-if="scope.row.is_mark ==1">撤销</span>
  317. </el-button>
  318. </span>
  319. </template>
  320. </el-table-column>
  321. </el-table>
  322. <el-row style="margin-top: 15px;" v-if="admin_total_count > 10">
  323. <el-col :span="24">
  324. <el-pagination
  325. :total="admin_total_count"
  326. :current-page.sync="current_page"
  327. @current-change="pageChange"
  328. :page-size="10"
  329. layout="total, prev, pager, next, jumper"
  330. ></el-pagination>
  331. </el-col>
  332. </el-row>
  333. <admin-info-form ref="admininfoform"></admin-info-form>
  334. </div>
  335. <el-dialog
  336. title="CA企业认证"
  337. :visible.sync="dialogVisible"
  338. width="50%">
  339. <span>
  340. <el-form>
  341. <el-row>
  342. <el-col>
  343. <el-form-item label="企业类型:">
  344. <el-select
  345. v-model="form.org_type"
  346. filterable
  347. clearable
  348. allow-create
  349. placeholder="选择"
  350. >
  351. <el-option
  352. v-for="item in businessList"
  353. :key="item.id"
  354. :label="item.name "
  355. :value="item.id"
  356. ></el-option>
  357. </el-select>
  358. </el-form-item>
  359. </el-col>
  360. <el-col>
  361. <el-form-item label="企业名称:">
  362. <el-input style="width:200px" v-model="form.enterprise_name" placeholder="请按营业执照上面的公司填写名称"></el-input>
  363. </el-form-item>
  364. </el-col>
  365. <el-col>
  366. <el-form-item label="统一社会信用代码:">
  367. <el-input style="width:200px" v-model="form.code" placeholder="请输入统一社会信息代码"></el-input>
  368. </el-form-item>
  369. </el-col>
  370. <el-col>
  371. <el-form-item label="组织机构代码:">
  372. <el-input style="width:200px" v-model="form.org_code" placeholder="请输入统一社会信息代码"></el-input>
  373. </el-form-item>
  374. </el-col>
  375. <el-col>
  376. <el-form-item label="法定代表人:">
  377. <el-input style="width:200px" v-model="form.legal_person_name" placeholder="请输入统一社会信息代码"></el-input>
  378. </el-form-item>
  379. </el-col>
  380. <el-col>
  381. <el-form-item label="法定代表人身份证:">
  382. <el-input style="width:200px" v-model="form.legal_id_card_num" placeholder="请输入统一社会信息代码"></el-input>
  383. </el-form-item>
  384. </el-col>
  385. <el-col>
  386. <el-form-item label="法人手机号码:">
  387. <el-input style="width:200px" v-model="form.legal_phone" placeholder="请输入法人手机号码"></el-input>
  388. </el-form-item>
  389. </el-col>
  390. </el-row>
  391. </el-form>
  392. </span>
  393. <span slot="footer" class="dialog-footer">
  394. <el-button @click="dialogVisible = false">取 消</el-button>
  395. <el-button type="primary" @click="saveEnterprise">立即认证</el-button>
  396. </span>
  397. </el-dialog>
  398. <el-dialog
  399. title="CA个人认证"
  400. :visible.sync="persionDialogVisible"
  401. width="50%">
  402. <span>
  403. <el-form>
  404. <el-row>
  405. <el-col>
  406. <el-form-item label="姓名:">
  407. <el-input style="width:200px" v-model="personForm.display_name" placeholder="请输入姓名"></el-input>
  408. </el-form-item>
  409. </el-col>
  410. <el-col>
  411. <el-form-item label="身份证号:">
  412. <el-input style="width:200px" v-model="personForm.id_card_num" placeholder="请输入身份证号"></el-input>
  413. </el-form-item>
  414. </el-col>
  415. <el-col>
  416. <el-form-item label="手机号:">
  417. <el-input style="width:200px" v-model="personForm.phone" placeholder="请输入手机号"></el-input>
  418. </el-form-item>
  419. </el-col>
  420. <el-col>
  421. <el-form-item label="验证码:">
  422. <el-input style="width:100px" v-model="form.code" placeholder="请输入验证码"></el-input>
  423. <el-button type="primary" size="small" @click="getCode">获取验证码</el-button>
  424. </el-form-item>
  425. </el-col>
  426. </el-row>
  427. </el-form>
  428. </span>
  429. <span slot="footer" class="dialog-footer">
  430. <el-button @click="persionDialogVisible = false">取 消</el-button>
  431. <el-button type="primary" @click="savePersonEnterprise">立即认证</el-button>
  432. </span>
  433. </el-dialog>
  434. </div>
  435. </template>
  436. <script>
  437. import { adminMainView, getAdmins, setAdminStatus,toSign,toTestOne,toTestTwo,toTestThree,toTestFour,toTestFive,toTestSeven,toTestEight,toTestNight,toTestTen,toTestElement,toTestThrityMent,saveEnterprise,getEnterPriseById,getMobileCode,savePersionEnterPrise,getPerseEnterPriseById,CreatePersionSeal,CreateNewEnterPrise,toTestThrity,toEndEnterPrise,getEnterPriseDetail
  438. ,CreateQianshuUserName,CreateSKDSendInformation,toSavePDFInformation,toCheckPDFInformation,getdruginfoInformation} from "@/api/role/admin";
  439. import { getRoles } from "@/api/role/role";
  440. import { UploadPrintOrder } from "@/api/role/admin"
  441. import { parseTime } from "@/utils";
  442. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  443. import AdminInfoForm from "./components/AdminInfoForm";
  444. import axios from 'axios'
  445. export default {
  446. name: "adminManage",
  447. data() {
  448. return {
  449. crumbs: [
  450. { path: false, name: "管理中心" },
  451. { path: false, name: "员工管理" }
  452. ],
  453. is_loading_admins: true,
  454. admins: [], // [{user_id, user_name, role_name, title_name, ip, last_login_time, status}]
  455. admin_total_count: 0,
  456. current_page: 1,
  457. roles: [],
  458. is_exist_role: false,
  459. org: null,
  460. isSubSuperAdmin: false,
  461. local_user_id: 0,
  462. selectDrug:[],
  463. dialogVisible:false,
  464. persionDialogVisible:false,
  465. businessList:[
  466. {id:1,name:"企业"},
  467. {id:2,name:"个体工商户"},
  468. {id:3,name:"政府机构"}
  469. ],
  470. form:{
  471. id:0,
  472. org_type:"",
  473. enterprise_name:"",
  474. code:"",
  475. org_code:"",
  476. legal_person_name:"",
  477. legal_id_card_num:"",
  478. legal_phone:"",
  479. },
  480. personForm:{
  481. id:0,
  482. display_name:"",
  483. phone:"",
  484. id_card_num:"",
  485. admin_user_id:"",
  486. code:"",
  487. }
  488. };
  489. },
  490. components: {
  491. BreadCrumb,
  492. AdminInfoForm
  493. },
  494. created: function() {
  495. this.local_user_id = this.$store.getters.xt_user.user.id;
  496. let page = 1;
  497. this.getRoles(page);
  498. adminMainView()
  499. .then(rs => {
  500. this.is_loading_admins = false;
  501. var resp = rs.data;
  502. if (resp.state === 1) {
  503. var adminData = resp.data.admins
  504. console.log("数据",adminData)
  505. this.admins.push(...adminData);
  506. this.admin_total_count = resp.data.total_count;
  507. this.is_exist_role = resp.data.is_exist_role;
  508. this.current_page = 1;
  509. this.org = resp.data.org;
  510. this.isSubSuperAdmin = resp.data.isSubSuperAdmin;
  511. //能进入当前页面的角色只有超级管理员和子管理员,如果当前角色是子管理员,需要把超级管理员和其他子管理员的信息去除,子管理员不能编辑超级管理员和其他子管理员信息,
  512. if (this.isSubSuperAdmin) {
  513. //去除管理员信息
  514. for (let i = 0; i < this.admins.length; i++) {
  515. if (this.admins[i].user_id == this.org.creator) {
  516. this.admins.splice(i, 1);
  517. i--;
  518. }
  519. }
  520. //去除其他子管理员信息
  521. for (let i = 0; i < this.admins.length; i++) {
  522. if (
  523. this.admins[i].user_id != this.local_user_id &&
  524. this.admins[i].is_sub_super_admin
  525. ) {
  526. //将自己排除在外
  527. console.log(this.admins[i]);
  528. this.admins.splice(i, 1);
  529. i--;
  530. }
  531. }
  532. }
  533. } else {
  534. this.$message.error(resp.msg);
  535. }
  536. })
  537. .catch(err => {
  538. this.is_loading_admins = false;
  539. this.$message.error(err);
  540. });
  541. },
  542. computed: {
  543. should_update_admins() {
  544. return this.$store.getters.xt_role_temps.did_admins_changed;
  545. }
  546. },
  547. methods: {
  548. getRoles(page) {
  549. getRoles(page)
  550. .then(rs => {
  551. this.loading_roles = false;
  552. const resp = rs.data;
  553. if (resp.state === 1) {
  554. this.roles.push(...resp.data.roles);
  555. } else {
  556. this.$message.error(resp.msg);
  557. }
  558. })
  559. .catch(err => {
  560. this.loading_roles = false;
  561. this.$message.error(err);
  562. });
  563. },
  564. openForm(adminId) {
  565. this.$refs["admininfoform"].open(adminId, this.roles);
  566. },
  567. _parseTime(time, format) {
  568. return parseTime(time, format);
  569. },
  570. requestAdminsWithPage: function(page) {
  571. this.admins.splice(0, this.admins.length);
  572. this.is_loading_admins = true;
  573. getAdmins(page)
  574. .then(rs => {
  575. this.is_loading_admins = false;
  576. const resp = rs.data;
  577. console.log(resp);
  578. if (resp.state === 1) {
  579. var admindata = resp.data.admins
  580. this.admins.push(...admindata);
  581. this.admin_total_count = resp.data.total_count;
  582. } else {
  583. this.$message.error(resp.msg);
  584. }
  585. })
  586. .catch(err => {
  587. this.is_loading_admins = false;
  588. this.$message.error(err);
  589. });
  590. },
  591. addAdminAction: function() {
  592. this.$router.push({ path: "/role/admin/create" });
  593. },
  594. disableAdminAction: function(row) {
  595. this.$msgbox({
  596. title: "提示",
  597. message: "是否确定要移除该用户",
  598. showCancelButton: true,
  599. confirmButtonText: "确定",
  600. cancelButtonText: "取消",
  601. type: "warning",
  602. beforeClose: (action, instance, done) => {
  603. if (action === "confirm") {
  604. instance.confirmButtonLoading = true;
  605. instance.confirmButtonText = "删除中...";
  606. setAdminStatus(row.user_id, false)
  607. .then(rs => {
  608. done();
  609. instance.confirmButtonLoading = false;
  610. const resp = rs.data;
  611. if (resp.state === 1) {
  612. row.status = 0;
  613. } else {
  614. this.$message.error(resp.msg);
  615. }
  616. })
  617. .catch(err => {
  618. done();
  619. instance.confirmButtonLoading = false;
  620. this.$message.error(err);
  621. });
  622. } else {
  623. done();
  624. }
  625. }
  626. });
  627. },
  628. recoverAdminAction: function(row) {
  629. const loading = this.$loading({
  630. lock: true,
  631. text: "正在恢复管理员...",
  632. spinner: "el-icon-loading",
  633. background: "rgba(0, 0, 0, 0.7)"
  634. });
  635. setAdminStatus(row.user_id, true)
  636. .then(rs => {
  637. loading.close();
  638. const resp = rs.data;
  639. if (resp.state === 1) {
  640. row.status = 1;
  641. } else {
  642. this.$message.error(resp.msg);
  643. }
  644. })
  645. .catch(err => {
  646. loading.close();
  647. this.$message.error(err);
  648. });
  649. },
  650. pageChange: function(nextPage) {
  651. this.requestAdminsWithPage(nextPage);
  652. },
  653. // toLogin(){
  654. // var that = this
  655. // axios.get('http://127.0.0.1:9532/sz/api/doctor/get').then(function(response) {
  656. // if (response.data.state == 0) {
  657. // that.$message.error(response.data.msg)
  658. // return false
  659. // } else {
  660. // that.$message({ message: '登记成功', type: 'success' })
  661. // }
  662. // }).catch(function(error) {
  663. // })
  664. // },
  665. BatchDelete() {
  666. if (this.selectDrug.length == 0) {
  667. this.$message.error("请选择要登记的信息");
  668. return false;
  669. }
  670. this.$confirm(
  671. "确认要登记所选记录吗? <br>",
  672. "备案提示",
  673. {
  674. dangerouslyUseHTMLString: true,
  675. confirmButtonText: "确定",
  676. cancelButtonText: "取消",
  677. type: "warning"
  678. }
  679. ).then(() => {
  680. var ids = [];
  681. var idMap = {};
  682. console.log("3333333",this.selectDrug)
  683. for (const index in this.selectDrug) {
  684. ids.push(this.selectDrug[index].user_id);
  685. idMap[this.selectDrug[index].user_id] = this.selectDrug[index].user_id;
  686. }
  687. var idss = ids.join(',')
  688. let params = {
  689. ids:idss,
  690. admin_user_id:this.$store.getters.xt_user.user.id
  691. }
  692. console.log("prams222",params)
  693. var that = this
  694. axios.get('http://127.0.0.1:9532/sz/api/doctor/get',{ params: params }).then(function(response) {
  695. if (response.data.state == 0) {
  696. that.$message.error(response.data.data.msg)
  697. return false
  698. } else {
  699. that.$message.error(response.data.data.msg)
  700. if(response.data.data.msg == ""){
  701. that.$message.success("登记成功!")
  702. that.adminMainView()
  703. }
  704. if(response.data.data.msg!=""){
  705. that.$message.error(response.data.data.msg)
  706. that.adminMainView()
  707. }
  708. }
  709. }).catch(function(error) {
  710. })
  711. });
  712. },
  713. toReturn(id,is_mark){
  714. var that = this
  715. let params = {
  716. 'id':id,
  717. "is_mark":is_mark,
  718. "admin_user_id":this.$store.getters.xt_user.user.id
  719. }
  720. axios.get('http://127.0.0.1:9532/sz/api/medical/get',{params:params}).then(function(response) {
  721. if (response.data.state == 0) {
  722. that.$message.error(response.data.data.msg)
  723. return false
  724. } else {
  725. if(response.data.data.msg == ""){
  726. that.$message.success("登记成功!")
  727. that.adminMainView()
  728. }
  729. if(response.data.data.msg!=""){
  730. that.$message.error(response.data.data.msg)
  731. that.adminMainView()
  732. }
  733. }
  734. }).catch(function(error) {
  735. })
  736. },
  737. handleSelectionChange(val) {
  738. this.selectDrug = val;
  739. },
  740. toTest(){
  741. toSign().then(response=>{
  742. if(response.data.state ==1){
  743. var sign = response.data.data.sign
  744. console.log("sign",sign)
  745. }
  746. })
  747. },
  748. toTestOne(){
  749. toTestOne().then(response=>{
  750. if(response.data.state==1){
  751. var sign = response.data.data.sign
  752. console.log("sign",sign)
  753. }
  754. })
  755. },
  756. toTestTwo(){
  757. toTestTwo().then(response=>{
  758. if(response.data.state ==1){
  759. var sign = response.data.data.sign
  760. console.log("sign",sign)
  761. }
  762. })
  763. },
  764. toTestThree(){
  765. toTestThree().then(response=>{
  766. if(response.data.state ==1){
  767. var sign = response.data.data.sign
  768. console.log("sign",sign)
  769. }
  770. })
  771. },
  772. toTestFour(){
  773. toTestFour().then(response=>{
  774. if(response.data.state==1){
  775. var sign = response.data.data.sign
  776. console.log("sign",sign)
  777. }
  778. })
  779. },
  780. toTestFive(){
  781. toTestFive().then(response=>{
  782. if(response.data.state==1){
  783. var sign = response.data.data.sign
  784. console.log("sign",sign)
  785. }
  786. })
  787. },
  788. toTestSeven(){
  789. toTestSeven().then(response=>{
  790. if(response.data.state ==1){
  791. var sign = response.data.data.sign
  792. console.log("sign",sign)
  793. }
  794. })
  795. },
  796. toTestEight(){
  797. toTestEight().then(response=>{
  798. if(response.data.state== 1){
  799. var sign = response.data.data.sign
  800. console.log("sign",sign)
  801. this.$message.success("保存")
  802. }
  803. })
  804. },
  805. toTestNight(){
  806. toTestNight().then(response=>{
  807. if(response.data.state == 1){
  808. var sign = response.data.data.sign
  809. console.log("sign",sign)
  810. this.$message.success("保存")
  811. var maprequest = response.data.data.maprequest
  812. console.log("maprequest",maprequest)
  813. }
  814. })
  815. },
  816. toTestTen(){
  817. toTestTen().then(response=>{
  818. if(response.data.state == 1){
  819. var sign = response.data.data.sign
  820. console.log("sign",sign)
  821. this.$message.success("保存")
  822. }
  823. })
  824. },
  825. toTestElement(){
  826. toTestElement().then(response=>{
  827. if(response.data.state == 1){
  828. var sign = response.data.data.sign
  829. console.log("sign",sign)
  830. this.$message.success("保存")
  831. }
  832. })
  833. },
  834. toTestThrityMent(){
  835. toTestThrityMent().then(response=>{
  836. var sign = response.data.data.sign
  837. console.log("sign",sign)
  838. this.$message.success("保存")
  839. })
  840. },
  841. saveEnterprise(){
  842. var params = {
  843. id:this.form.id,
  844. org_type:parseInt(this.form.org_type),
  845. enterprise_name:this.form.enterprise_name,
  846. code:this.form.code,
  847. org_code:this.form.org_code,
  848. legal_person_name:this.form.legal_person_name,
  849. legal_id_card_num:this.form.legal_id_card_num,
  850. legal_phone:this.form.legal_phone,
  851. }
  852. console.log("paramswowo",params)
  853. saveEnterprise(params).then(response=>{
  854. if(response.data.state==1){
  855. var enterPrise = response.data.data.enterPrise
  856. this.dialogVisible = false
  857. this.$message.success("保存成功!")
  858. }
  859. })
  860. },
  861. toGet(){
  862. getEnterPriseById().then(response=>{
  863. if(response.data.state == 1){
  864. this.dialogVisible = true
  865. var enterPrise = response.data.data.enterPrise
  866. this.form.id = enterPrise.id
  867. this.form.org_type = enterPrise.org_type?enterPrise.org_type:""
  868. this.form.enterprise_name = enterPrise.enterprise_name
  869. this.form.code = enterPrise.code
  870. this.form.org_code = enterPrise.org_code
  871. this.form.legal_person_name = enterPrise.legal_person_name
  872. this.form.legal_id_card_num = enterPrise.legal_id_card_num
  873. this.form.legal_phone = enterPrise.legal_phone
  874. }
  875. })
  876. },
  877. toRenZhen(admin_user_id,user_name){
  878. getPerseEnterPriseById(admin_user_id).then(response=>{
  879. if(response.data.state== 1){
  880. var lastPerson = response.data.data.lastPerson
  881. this.personForm.id = lastPerson.id
  882. this.personForm.display_name = user_name
  883. this.personForm.phone = lastPerson.phone
  884. this.personForm.id_card_num = lastPerson.id_card_num
  885. this.personForm.admin_user_id =lastPerson.admin_user_id
  886. this.persionDialogVisible = true
  887. }
  888. })
  889. },
  890. getCode(){
  891. var params = {
  892. phone:this.personForm.phone,
  893. }
  894. console.log("paramsowowo",params)
  895. getMobileCode(params).then(response=>{
  896. if(response.data.state == 1){
  897. var sign = response.data.data.sign
  898. console.log("sign",sign)
  899. this.$message.success("发送成功!")
  900. }
  901. })
  902. },
  903. savePersonEnterprise(){
  904. var params = {
  905. id:this.personForm.id,
  906. display_name:this.personForm.display_name,
  907. phone:this.personForm.phone,
  908. id_card_num:this.personForm.id_card_num,
  909. admin_user_id:this.personForm.admin_user_id,
  910. code:this.personForm.code,
  911. }
  912. console.log("param2o2o2o2",params)
  913. savePersionEnterPrise(params).then(response=>{
  914. if(response.data.state == 1){
  915. var personEnterPrse = response.data.data.personEnterPrse
  916. this.$message.success("认证成功")
  917. this.persionDialogVisible = false
  918. }
  919. })
  920. },
  921. toYinZhang(admin_user_id){
  922. CreatePersionSeal(admin_user_id).then(response=>{
  923. if(response.data.state == 1){
  924. var personSeal = response.data.data.personSeal
  925. this.$message.success("创建成功")
  926. }
  927. })
  928. },
  929. toShouQuan(admin_user_id){
  930. CreateNewEnterPrise(admin_user_id).then(response=>{
  931. if(response.data.state == 1){
  932. var newEnterPrise = response.data.data.newEnterPrise
  933. this.$message.success("保存成功!")
  934. }
  935. })
  936. },
  937. toTestThrity(){
  938. toTestThrity().then(response=>{
  939. if(response.data.state == 1){
  940. var sign = response.data.data.sign
  941. console.log("signwoowow",sign)
  942. }
  943. })
  944. },
  945. toEnd(){
  946. toEndEnterPrise().then(response=>{
  947. if(response.data.state == 1){
  948. var sign = response.data.data.sign
  949. this.$message.success("保存成功")
  950. }
  951. })
  952. },
  953. toWatch(){
  954. getEnterPriseDetail().then(response=>{
  955. if(response.data.state == 1){
  956. var sign = response.data.data.sign
  957. this.$message.success("保存成功")
  958. }
  959. })
  960. },
  961. toQianShu(admin_user_id){
  962. CreateQianshuUserName(admin_user_id).then(response=>{
  963. if(response.data.state==1){
  964. var sign = response.data.data.sign
  965. var userId = response.data.data.userId
  966. this.$message.success("签署成功!")
  967. }
  968. })
  969. },
  970. toSendInformaton(){
  971. CreateSKDSendInformation().then(response=>{
  972. if(response.data.state==1){
  973. var information = response.data.data.information
  974. var orderId = response.data.data.orderId
  975. }
  976. })
  977. },
  978. toSavePDFInformation(){
  979. toSavePDFInformation().then(response=>{
  980. if(response.data.state == 1){
  981. var information = response.data.data.information
  982. var orderId = response.data.data.orderId
  983. // var base64Img = 'data:image/png;base64'+","+orderId
  984. // console.log("base64Img",base64Img)
  985. // var imgFile = this.base64ImgtoFile(base64Img)
  986. // this.downloadBlob(imgFile, 'test.png')
  987. // console.log("imgFilewoowow",imgFile)
  988. const blob = this.base64ToBlob(orderId, 'application/pdf');
  989. this.openPdf(blob);
  990. }
  991. })
  992. },
  993. openPdf(blob) {
  994. const objectUrl = URL.createObjectURL(blob);
  995. const a = document.createElement('a');
  996. a.href = objectUrl;
  997. a.target = '_blank';
  998. a.click();
  999. URL.revokeObjectURL(objectUrl);
  1000. },
  1001. base64ToBlob(base64Data, contentType) {
  1002. contentType = contentType || '';
  1003. const sliceSize = 1024;
  1004. const byteCharacters = window.atob(base64Data);
  1005. const bytesLength = byteCharacters.length;
  1006. const slicesCount = Math.ceil(bytesLength / sliceSize);
  1007. const byteArrays = new Array(slicesCount);
  1008. for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
  1009. const begin = sliceIndex * sliceSize;
  1010. const end = Math.min(begin + sliceSize, bytesLength);
  1011. const bytes = new Array(end - begin);
  1012. for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
  1013. bytes[i] = byteCharacters[offset].charCodeAt(0);
  1014. }
  1015. byteArrays[sliceIndex] = new Uint8Array(bytes);
  1016. }
  1017. return new Blob(byteArrays, {
  1018. type: contentType
  1019. });
  1020. },
  1021. downloadBlob(blob, filename) {
  1022. const url = URL.createObjectURL(blob);
  1023. const a = document.createElement('a');
  1024. a.href = url;
  1025. a.download = filename;
  1026. a.click();
  1027. URL.revokeObjectURL(url);
  1028. },
  1029. toCheckPDFInformation(){
  1030. toCheckPDFInformation().then(response=>{
  1031. if(response.data.data == 1){
  1032. var information = response.data.data.information
  1033. }
  1034. })
  1035. },
  1036. base64ImgtoFile(dataurl, filename = 'file') {
  1037. let arr = dataurl.split(',')
  1038. let mime = arr[0].match(/:(.*?);/)[1]
  1039. let suffix = mime.split('/')[1]
  1040. let bstr = atob(arr[1])
  1041. let n = bstr.length
  1042. let u8arr = new Uint8Array(n)
  1043. while (n--) {
  1044. u8arr[n] = bstr.charCodeAt(n)
  1045. }
  1046. return new File([u8arr], `${filename}.${suffix}`, {
  1047. type: mime
  1048. })
  1049. },
  1050. // toDrugInfo(){
  1051. // getdruginfoInformation().then(response=>{
  1052. // if(response.data.state==1){
  1053. // }
  1054. // })
  1055. // }
  1056. toJiaBan(){
  1057. UploadPrintOrder().then(response=>{
  1058. if(response.data.state ==1){
  1059. }
  1060. })
  1061. }
  1062. },
  1063. watch: {
  1064. should_update_admins(should_change) {
  1065. if (should_change) {
  1066. this.requestAdminsWithPage(this.current_page);
  1067. }
  1068. }
  1069. }
  1070. };
  1071. </script>
  1072. <style rel="stylesheet/scss" lang="scss" scoped>
  1073. .el-button + .el-button {
  1074. margin-left: 0 !important;
  1075. }
  1076. </style>
  1077. <style>
  1078. .el-table td,
  1079. .el-table th.is-leaf,
  1080. .el-table--border,
  1081. .el-table--group {
  1082. border-color: #d0d3da;
  1083. }
  1084. .el-table--border::after,
  1085. .el-table--group::after,
  1086. .el-table::before {
  1087. background-color: #d0d3da;
  1088. }
  1089. </style>