index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. <template>
  2. <div class="app-container">
  3. <div class="app-container">
  4. <div class="filter-container">
  5. <el-select
  6. v-model="getdataListParm.parammaps.pastureName"
  7. placeholder="牧场"
  8. style="width:120px"
  9. class="filter-item"
  10. >
  11. <el-option
  12. v-for="item in findAllPasture"
  13. :key="item.id"
  14. :label="item.name"
  15. :value="item.name"
  16. />
  17. </el-select>
  18. <el-input v-model="getdataListParm.parammaps.empCode" placeholder="工号" style="width: 140px;" class="filter-item" />
  19. <el-input v-model="getdataListParm.parammaps.empname" placeholder="姓名" style="width: 140px;" class="filter-item" />
  20. <el-input v-model="getdataListParm.parammaps.position" placeholder="职位" style="width: 140px;" class="filter-item" />
  21. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  22. <el-button v-if="isEmpAdd" class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  23. <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
  24. </div>
  25. <el-table
  26. v-loading="listLoading"
  27. element-loading-text="给我一点时间"
  28. :data="list"
  29. border
  30. fit
  31. highlight-current-row
  32. style="width: 100%;"
  33. :row-style="rowStyle"
  34. :cell-style="cellStyle"
  35. class="elTable"
  36. row-key="id"
  37. default-expand-all
  38. :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
  39. @sort-change="tableSort"
  40. :max-height="myHeight"
  41. >
  42. <el-table-column label="序号" align="center" type="index" width="50px">
  43. <template slot-scope="scope">
  44. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="姓名" min-width="110px" header-align="center" align="center">
  48. <template slot-scope="scope">
  49. <span>{{ scope.row.empname }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="EAS账户名" header-align="center" width="120px" align="center">
  53. <template slot-scope="scope">
  54. <span>{{ scope.row.easName }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="牧场" min-width="100px" header-align="center" align="center">
  58. <template slot-scope="scope">
  59. <span>{{ scope.row.pastureName }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="部门" min-width="100px" header-align="center" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.deptname }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="工号" min-width="100px" header-align="center" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.empCode }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="职位" min-width="100px" header-align="center" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ scope.row.position }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="电话" min-width="130px" header-align="center" align="center">
  78. <template slot-scope="scope">
  79. <span>{{ scope.row.tel }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="状态" min-width="130px" header-align="center" align="center">
  83. <template slot-scope="scope">
  84. <span>{{scope.row.workstr}}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="账号数" sortable prop="isuser" min-width="90px" header-align="center" align="center">
  88. <template slot-scope="scope">
  89. <span>{{ scope.row.isuser }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="操作" header-align="center" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
  93. <template slot-scope="{row}">
  94. <el-button v-if="isEmpUpdate" type="primary" size="mini" @click="form_edit(row)">编辑</el-button>
  95. <el-button v-if="row.status!='已删' && isEmpDel" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination
  100. v-show="total>0"
  101. :total="total"
  102. :page.sync="getdataListParm.offset"
  103. :limit.sync="getdataListParm.pagecount"
  104. @pagination="get_table_data"
  105. />
  106. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
  107. <el-form
  108. ref="dataForm"
  109. v-enterToNext="true"
  110. :rules="rules"
  111. :model="dataform"
  112. label-position="left"
  113. label-width="100px"
  114. style="width: 600px; margin-left:50px;"
  115. >
  116. <el-form-item label="用户名" prop="empname">
  117. <el-input ref="empname" v-model="dataform.empname" />
  118. </el-form-item>
  119. <el-form-item label="EAS账户名" prop="easName">
  120. <el-input ref="easName" v-model="dataform.easName" />
  121. </el-form-item>
  122. <el-form-item label="部门" prop="deptid">
  123. <tree-select
  124. :disabled="disabled"
  125. :height="280"
  126. :width="200"
  127. size="small"
  128. :data="parentDept"
  129. :default-props="defaultProps"
  130. :node-key="nodeKey"
  131. :checked-keys="defaultCheckedKeys"
  132. @popoverHide="popoverHide"
  133. />
  134. </el-form-item>
  135. <el-form-item label="职位" prop="position">
  136. <el-input ref="position" v-model="dataform.position" />
  137. </el-form-item>
  138. <el-form-item label="工号" prop="empCode">
  139. <el-input ref="empCode" v-model="dataform.empCode" />
  140. </el-form-item>
  141. <el-form-item label="状态" prop="work">
  142. <el-select v-model="dataform.work">
  143. <el-option v-for="item in workList" :key="item.id" :label="item.name" :value="item.id" />
  144. </el-select>
  145. </el-form-item>
  146. <el-form-item label="联系方式" prop="tel">
  147. <el-input ref="tel" v-model="dataform.tel" />
  148. </el-form-item>
  149. <el-form-item label="备注" prop="remark">
  150. <el-input ref="remark" v-model="dataform.remark" />
  151. </el-form-item>
  152. <el-form-item label="顺序" prop="sort">
  153. <el-input
  154. ref="sort"
  155. v-model="dataform.sort"
  156. />
  157. </el-form-item>
  158. <!-- <el-form-item label="启用" prop="enable">
  159. <el-switch
  160. ref="enable"
  161. v-model="dataform.enable"
  162. active-color="#13ce66"
  163. inactive-color="#ff4949"
  164. :active-value="1"
  165. :inactive-value="0"
  166. />
  167. </el-form-item> -->
  168. </el-form>
  169. <div slot="footer" class="dialog-footer">
  170. <el-button v-if="dialogStatus==='create'" ref="createb" type="success" @click="add_dialog_save_again()">确认新增</el-button>
  171. <el-button type="primary" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
  172. <el-button @click="dialogFormVisible = false;get_table_data()">关闭</el-button>
  173. </div>
  174. </el-dialog>
  175. </div>
  176. </div>
  177. </template>
  178. <script>
  179. import TreeSelect from '@/components/TreeSelect'
  180. import waves from '@/directive/waves' // waves directive
  181. // eslint-disable-next-line no-unused-vars
  182. import { isIntegerZero } from '@/utils/validate'
  183. import { validatePhoneTwo } from '@/utils/validate'
  184. import enterToNext from '@/directive/enterToNext' // enterToNext directive
  185. import { PostDataByName, GetDataByName, getRecuData,ExecDataByConfig, GetDataByNames, checkButtons, failproccess,GetAccount } from '@/api/common'
  186. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  187. import { MessageBox } from 'element-ui'
  188. import Cookies from 'js-cookie'
  189. import { sortChange, json2excel } from '@/utils/index.js'
  190. export default {
  191. name: 'Emp',
  192. components: { Pagination, TreeSelect },
  193. directives: { waves, enterToNext },
  194. data() {
  195. return {
  196. myHeight:document.documentElement.clientHeight - 85- 150,
  197. isEmpAdd: [],
  198. isEmpUpdate: [],
  199. isEmpDel: [],
  200. disabled: false,
  201. tableKey: 0,
  202. list: [{ sqlname: '', id: 0, sqlstr: '' }],
  203. workList:[{id:1,name:'在职'},{id:0,name:'离职'}],
  204. parentDept: [],
  205. total: 0,
  206. listLoading: true,
  207. requestParam: {
  208. name: 'createapisql',
  209. offset: 0,
  210. pagecount: 0,
  211. parammaps: []
  212. },
  213. dataform: {
  214. position: '',
  215. empname: '',
  216. deptname: '',
  217. deptid: '',
  218. tel: '',
  219. remark: '',
  220. id: '',
  221. sort: '',
  222. parentid: '',
  223. enable: '1',
  224. empCode: '',
  225. easName: ''
  226. },
  227. getDeptParm: { name: 'getdeptrecu', idname: 'value', params: [Cookies.get('pastureid')] },
  228. getdataListParm: {
  229. name: 'getEmpAllL',
  230. page: 1,
  231. offset: 1,
  232. pagecount: 10,
  233. returntype: 'Map',
  234. parammaps: {
  235. empname: '',
  236. empCode: '',
  237. pastureId: Cookies.get('pastureid'),
  238. pastureName: Cookies.get('pasturename')
  239. }
  240. },
  241. getdataListParmSH: {
  242. name: 'getEmpAllL',
  243. page: 0,
  244. offset: 0,
  245. pagecount: 0,
  246. returntype: 'Map',
  247. parammaps: {
  248. empname: '',
  249. empCode: '',
  250. pastureId: Cookies.get('pastureid'),
  251. pastureName: Cookies.get('pasturename')
  252. }
  253. },
  254. rules: {
  255. empname: [{ type: 'string', required: true, message: '必填', trigger: 'change' }],
  256. empCode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
  257. tel: [
  258. {
  259. type: 'number',
  260. required: true,
  261. message: '请输入正确的格式',
  262. trigger: 'change'
  263. }
  264. ],
  265. sort: [{ validator: isIntegerZero, trigger: 'blur' }],
  266. // eslint-disable-next-line no-dupe-keys
  267. tel: [{ validator: validatePhoneTwo, trigger: 'blur' }]
  268. },
  269. // 2-3:下拉框请求后数据加入[]
  270. findAllPasture: [],
  271. // 2-1.请求下拉框接口
  272. requestParams: [
  273. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
  274. ],
  275. dialogFormVisible: false,
  276. selectedRole: '',
  277. dialogStatus: '',
  278. textMap: {
  279. update: '编辑',
  280. create: '新增'
  281. },
  282. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  283. cellStyle: { padding: 0 + 'px' },
  284. defaultProps: {
  285. children: 'children',
  286. label: 'label'
  287. },
  288. nodeKey: 'value',
  289. defaultCheckedKeys: [],
  290. pageNum: 0,
  291. pageSize: 10
  292. }
  293. },
  294. created() {
  295. this.get_table_data()
  296. this.get_auto_buttons()
  297. },
  298. methods: {
  299. tableSort(column) {
  300. sortChange(column, this.list)
  301. },
  302. get_auto_buttons() {
  303. // 新增
  304. const EmpAdd = 'console:emp:add'
  305. const isEmpAdd = checkButtons(this.$store.state.user.buttons, EmpAdd)
  306. this.isEmpAdd = isEmpAdd
  307. // 编辑
  308. const EmpUpdate = 'console:emp:update'
  309. const isEmpUpdate = checkButtons(this.$store.state.user.buttons, EmpUpdate)
  310. this.isEmpUpdate = isEmpUpdate
  311. // 删除
  312. const EmpDel = 'console:emp:del'
  313. const isEmpDel = checkButtons(this.$store.state.user.buttons, EmpDel)
  314. this.isEmpDel = isEmpDel
  315. },
  316. popoverHide(checkedIds, checkedData) {
  317. console.log(checkedIds, checkedData)
  318. this.dataform.pastureId = checkedData.pastureId
  319. this.dataform.deptid = checkedIds
  320. this.dataform.parentid = checkedData.parentid
  321. },
  322. deptenter() {
  323. this.$nextTick(() => {
  324. this.$refs['remark'].focus()
  325. })
  326. },
  327. get_table_data() {
  328. this.listLoading = true
  329. GetDataByName(this.getdataListParm).then(response => {
  330. this.list = response.data.list
  331. this.pageNum = response.data.pageNum
  332. this.pageSize = response.data.pageSize
  333. if (response.data.total) {
  334. this.total = response.data.total
  335. }
  336. this.get_select_list()
  337. this.getDeptList()
  338. // Just to simulate the time of the request
  339. setTimeout(() => {
  340. this.listLoading = false
  341. }, 0.5 * 1000)
  342. })
  343. },
  344. // 2-2:下拉框
  345. get_select_list() {
  346. GetDataByNames(this.requestParams).then(response => {
  347. this.findAllPasture = response.data.findAllPasture.list
  348. })
  349. },
  350. form_search() {
  351. this.listLoading = true
  352. this.getdataListParm.offset = 1
  353. this.get_table_data()
  354. },
  355. getDeptList() {
  356. getRecuData(this.getDeptParm).then(response => {
  357. this.parentDept = response.data
  358. })
  359. },
  360. resetRequestParam() {
  361. this.dataform.easName = ''
  362. this.dataform.empname = ''
  363. this.dataform.deptname = ''
  364. this.dataform.parentid = ''
  365. this.dataform.deptid = ''
  366. this.dataform.position = ''
  367. this.dataform.tel = ''
  368. this.dataform.remark = ''
  369. this.dataform.empCode = ''
  370. this.dataform.id = ''
  371. this.dataform.sort = '0'
  372. this.dataform.enable = '1'
  373. this.dataform.work = 1
  374. this.defaultCheckedKeys = []
  375. },
  376. form_add() {
  377. this.resetRequestParam()
  378. this.dialogStatus = 'create'
  379. this.dialogFormVisible = true
  380. this.$nextTick(() => {
  381. this.$refs['dataForm'].clearValidate()
  382. })
  383. },
  384. add_dialog_save() {
  385. console.log(this.dataform)
  386. this.$refs['dataForm'].validate(valid => {
  387. if (valid) {
  388. if (this.dataform.deptid == '') {
  389. this.$message({ type: 'error', message: '部门必填', duration: 2000 })
  390. return false
  391. }
  392. this.requestParam.name = 'createEmp'
  393. this.requestParam.parammaps = {}
  394. if (this.dataform.easName == '') { this.dataform.easName = this.dataform.empname }
  395. this.requestParam.parammaps.easName = this.dataform.easName
  396. this.requestParam.parammaps.empname = this.dataform.empname
  397. this.requestParam.parammaps.deptid = this.dataform.deptid
  398. this.requestParam.parammaps.tel = this.dataform.tel
  399. this.requestParam.parammaps.position = this.dataform.position
  400. this.requestParam.parammaps.remark = this.dataform.remark
  401. this.requestParam.parammaps.sort = this.dataform.sort
  402. this.requestParam.parammaps.enable = this.dataform.enable
  403. this.requestParam.parammaps.pastureId = this.dataform.pastureId
  404. this.requestParam.parammaps.empCode = this.dataform.empCode
  405. this.requestParam.parammaps.work = this.dataform.work
  406. PostDataByName(this.requestParam).then(response => {
  407. if (response.msg !== 'fail') {
  408. this.get_table_data()
  409. this.dialogFormVisible = false
  410. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  411. } else {
  412. var Duplicate = new RegExp('Duplicate')
  413. if (Duplicate.test(response.data)) {
  414. this.$notify({ title: '', message: '此员工已存在', type: 'warning', duration: 2000 })
  415. } else {
  416. failproccess(response, this.$notify)
  417. }
  418. }
  419. })
  420. }
  421. })
  422. },
  423. add_dialog_save_again() {
  424. this.$refs['dataForm'].validate(valid => {
  425. if (valid) {
  426. if (this.dataform.deptid == '') {
  427. this.$message({ type: 'error', message: '部门必填', duration: 2000 })
  428. return false
  429. }
  430. this.requestParam.name = 'createEmp'
  431. this.requestParam.parammaps = {}
  432. if (this.dataform.easName == '') { this.dataform.easName = this.dataform.empname }
  433. this.requestParam.parammaps.easName = this.dataform.easName
  434. this.requestParam.parammaps.empname = this.dataform.empname
  435. this.requestParam.parammaps.deptid = this.dataform.deptid
  436. this.requestParam.parammaps.tel = this.dataform.tel
  437. this.requestParam.parammaps.position = this.dataform.position
  438. this.requestParam.parammaps.remark = this.dataform.remark
  439. this.requestParam.parammaps.sort = this.dataform.sort
  440. this.requestParam.parammaps.enable = this.dataform.enable
  441. this.requestParam.parammaps.pastureId = this.dataform.pastureId
  442. this.requestParam.parammaps.empCode = this.dataform.empCode
  443. this.requestParam.parammaps.work = this.dataform.work
  444. PostDataByName(this.requestParam).then(response => {
  445. if (response.msg !== 'fail') {
  446. this.get_table_data()
  447. this.resetRequestParam()
  448. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  449. } else {
  450. var Duplicate = new RegExp('Duplicate')
  451. if (Duplicate.test(response.data)) {
  452. this.$notify({ title: '', message: '此员工已存在', type: 'warning', duration: 2000 })
  453. } else {
  454. failproccess(response, this.$notify)
  455. }
  456. }
  457. })
  458. }
  459. })
  460. },
  461. form_edit(row) {
  462. console.log(row)
  463. this.dataform = Object.assign(row, {})
  464. this.defaultCheckedKeys = [this.dataform.deptid]
  465. this.dialogStatus = 'update'
  466. this.dialogFormVisible = true
  467. this.$nextTick(() => {
  468. this.$refs['dataForm'].clearValidate()
  469. })
  470. },
  471. edit_dialog_save() {
  472. this.$refs['dataForm'].validate(valid => {
  473. if (valid) {
  474. // this.requestParam.name = 'updateEmp'
  475. this.requestParam.parammaps = {}
  476. if (this.dataform.easName == '' || this.dataform.easName == undefined) { this.dataform.easName = this.dataform.empname }
  477. // this.requestParam.parammaps.easName = this.dataform.easName
  478. // this.requestParam.parammaps.empname = this.dataform.empname
  479. // this.requestParam.parammaps.deptid = this.dataform.deptid
  480. // this.requestParam.parammaps.tel = this.dataform.tel
  481. // this.requestParam.parammaps.position = this.dataform.position
  482. // this.requestParam.parammaps.remark = this.dataform.remark
  483. // this.requestParam.parammaps.sort = this.dataform.sort
  484. // this.requestParam.parammaps.enable = this.dataform.enable
  485. // this.requestParam.parammaps.pastureId = this.dataform.pastureId
  486. // this.requestParam.parammaps.empCode = this.dataform.empCode
  487. // this.requestParam.parammaps.id = this.dataform.id
  488. // this.requestParam.parammaps.work = this.dataform.work
  489. this.requestParam.common = { 'returnmap': '0' }
  490. this.requestParam.data = []
  491. this.requestParam.data[0] = { 'name': 'updateEmp', 'type': 'e', 'parammaps': {
  492. easName:this.dataform.easName,
  493. empname:this.dataform.empname,
  494. deptid:this.dataform.deptid,
  495. tel:this.dataform.tel,
  496. position:this.dataform.position,
  497. remark:this.dataform.remark,
  498. sort:this.dataform.sort,
  499. enable:this.dataform.enable,
  500. pastureId:this.dataform.pastureId,
  501. empCode:this.dataform.empCode,
  502. id:this.dataform.id,
  503. work:this.dataform.work,
  504. }}
  505. var enable = 0
  506. if(this.dataform.work == 0){
  507. enable = 0
  508. }else{
  509. enable = this.dataform.enable
  510. }
  511. this.requestParam.data[1] = { 'name': 'editUserEnable', 'type': 'e', 'parammaps': {
  512. enable:enable,
  513. empid:this.dataform.id
  514. }}
  515. ExecDataByConfig(this.requestParam).then(() => {
  516. this.get_table_data()
  517. this.resetRequestParam()
  518. this.dialogFormVisible = false
  519. })
  520. }
  521. })
  522. },
  523. handleDownload() {
  524. this.$alert('员工信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  525. this.isPercentage = true
  526. this.percentage = 1
  527. var timer = setInterval(() => {
  528. this.percentage += 5
  529. if (this.percentage > 95) {
  530. this.percentage = 99
  531. clearInterval(timer)
  532. }
  533. this.percentage = this.percentage
  534. }, 1000)
  535. this.getdataListParmSH.parammaps = this.getdataListParm.parammaps
  536. // GetDataByName(this.getdataListParm)
  537. GetAccount(this.getdataListParmSH).then(response => {
  538. this.downLoadList = response.data.list
  539. if (response.data.list !== '') {
  540. this.percentage = 99
  541. setTimeout(() => {
  542. this.isPercentage = false
  543. }, 2000)
  544. }
  545. console.log(this.downLoadList)
  546. const elecExcelDatas = [
  547. {
  548. tHeader: ['牧场', '姓名', '部门', '职位', '电话','状态', '工号'],
  549. filterVal: ['pastureName', 'empname', 'deptname', 'position', 'tel','workstr', 'empCode'],
  550. tableDatas: this.downLoadList,
  551. sheetName: '员工信息'
  552. }
  553. ]
  554. json2excel(elecExcelDatas, '员工信息', true, 'xlsx')
  555. })
  556. },
  557. form_delete(row) {
  558. MessageBox.confirm('名称:' + row.empname, '确认删除?', {
  559. confirmButtonText: '确认',
  560. cancelButtonText: '取消',
  561. type: 'warning'
  562. }).then(() => {
  563. this.requestParam.name = 'deleteEmp'
  564. this.requestParam.parammaps = {}
  565. this.requestParam.parammaps.id = row.id
  566. // this.requestParam.params[1] = this.$store.state.user.pastureid
  567. PostDataByName(this.requestParam).then(response => {
  568. if (response.msg !== 'fail') {
  569. this.get_table_data()
  570. this.resetRequestParam()
  571. this.dialogFormVisible = false
  572. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  573. } else {
  574. this.$notify({ title: '失败', message: '删除失败-' + response.data, type: 'danger', duration: 2000 })
  575. }
  576. })
  577. })
  578. }
  579. }
  580. }
  581. </script>