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

admin.vue 36KB

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