Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

admin.vue 35KB

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