index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <el-input v-model="table.getdataListParm.parammaps.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
  5. <el-input v-model="table.getdataListParm.parammaps.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
  6. <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="是否启用" class="filter-item" style="width: 120px;" clearable>
  7. <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id" />
  8. </el-select>
  9. <el-date-picker v-model="table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" :range-separator="$t('common.to')" :start-placeholder="$t('common.startTime')"" :end-placeholder="$t('common.endTime')" style="width: 250px;" />
  10. <!-- 临时注释 -->
  11. <!-- <el-select v-model="table.getdataListParm.parammaps.enable" placeholder="公众号关注状态" class="filter-item" style="width: 150px;" clearable>
  12. <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select> -->
  14. <!-- 临时注释 -->
  15. <el-button class="successBorder" @click="form_search">{{$t('common.query')}}</el-button>
  16. <el-button class="successBorder" @click="handleRefresh">{{$t('common.reset')}}</el-button>
  17. </div>
  18. <div class="operation">
  19. <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success" @click="handleCreate">新增</el-button>
  20. <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger" @click="form_delete">删除</el-button>
  21. </div>
  22. <div class="table">
  23. <el-table
  24. :key="table.tableKey"
  25. v-loading="table.listLoading"
  26. element-loading-text="给我一点时间"
  27. :data="table.list"
  28. border
  29. fit
  30. highlight-current-row
  31. style="width: 100%;"
  32. :row-style="rowStyle"
  33. :cell-style="cellStyle"
  34. class="elTable table-fixed"
  35. @selection-change="handleSelectionChange"
  36. >
  37. <el-table-column type="selection" align="center" width="50" />
  38. <el-table-column label="序号" align="center" type="index" width="50px">
  39. <template slot-scope="scope">
  40. <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
  41. </template>
  42. </el-table-column>
  43. <!-- <el-table-column :label="$t('auth.signIn')" min-width="180px" align="center"> -->
  44. <el-table-column label="用户名称" min-width="180px" align="center">
  45. <template slot-scope="scope">
  46. <span v-if="scope.row.NoEdit">{{ scope.row.username }}</span>
  47. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.username" placeholder="建议使用手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="员工姓名" min-width="130px" align="center">
  51. <template slot-scope="scope">
  52. <span v-if="scope.row.NoEdit">{{ scope.row.empname }}</span>
  53. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.empname" placeholder="1-32字符" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:95%;padding:10px 0;" />
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="手机号" min-width="180px" align="center">
  57. <template slot-scope="scope">
  58. <span v-if="scope.row.NoEdit">{{ scope.row.phone }}</span>
  59. <el-input v-if="scope.row.Edit" v-model.trim="scope.row.phone" placeholder="请输入11位手机号" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="11" style="width:95%;padding:10px 0;" />
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="角色" min-width="150px" align="center">
  63. <template slot-scope="scope">
  64. <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
  65. <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
  66. <el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
  67. </el-select>
  68. </template>
  69. </el-table-column>
  70. <!-- 临时注释 -->
  71. <!-- <el-table-column label="公众号关注状态" min-width="150px" align="center">
  72. <template slot-scope="scope">
  73. <span v-if="scope.row.NoEdit">{{ scope.row.rolename }}</span>
  74. <el-select v-if="scope.row.Edit" v-model="scope.row.roleid" placeholder="角色" class="filter-item" style="width:90%;padding:10px 0;" filterable @change="changeRolename">
  75. <el-option v-for="item in attentionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  76. </el-select>
  77. </template>
  78. </el-table-column> -->
  79. <!-- 临时注释 -->
  80. <el-table-column label="创建时间" min-width="110px" align="center">
  81. <template slot-scope="scope">
  82. <span>{{ scope.row.createdtime }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="创建人" min-width="110px" align="center">
  86. <template slot-scope="scope">
  87. <span>{{ scope.row.createmp }}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="是否启用" min-width="110px" align="center">
  91. <template slot-scope="scope">
  92. <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
  93. </template>
  94. </el-table-column>
  95. <el-table-column :label="$t('errorAnalysis.cz')" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  96. <template slot-scope="{row}">
  97. <!-- 新增 -->
  98. <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
  99. <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
  100. <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
  101. <!-- 扫码接收消息 -->
  102. <!-- 临时注释 -->
  103. <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleScanningCode(row)">扫码接收消息</a>
  104. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  105. <!-- 临时注释 -->
  106. <!-- 重置密码 -->
  107. <a v-if="row.isUpdate && isRoleEdit" class="correcting" size="mini" style="width: 80px;" @click="handleResetPassword(row)">重置密码</a>
  108. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  109. <!-- 编辑 -->
  110. <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
  111. <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
  112. <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
  113. <!-- 编辑保存 -->
  114. <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" class="miniSuccess" icon="el-icon-folder-checked" @click="updateData(row)" />
  115. <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
  116. <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <pagination v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
  121. </div>
  122. <el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
  123. <div class="QRcode">
  124. <div class="content">
  125. <div class="title">
  126. <p>微信接收系统待办、预警等消息,必须先扫码关注公众号;</p>
  127. <p>请将下方二维码分享给需要接收信息的用户扫码</p>
  128. </div>
  129. <div style="font-weight: 600;">关注微信:</div>
  130. <img :src="imgUrl" alt="">
  131. </div>
  132. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
  133. <el-button class="save" :disabled="isokDisable" @click="QRcode.dialogFormVisible = false;">确认</el-button>
  134. </div>
  135. </div>
  136. </el-dialog>
  137. </div>
  138. </template>
  139. <script>
  140. import { GetDataByName, PostDataByName, failproccess, GetDataByNames, ExecDataByConfig, checkButtons } from '@/api/common'
  141. import Cookies from 'js-cookie'
  142. import { parseTime } from '@/utils/index.js'
  143. import { MessageBox } from 'element-ui'
  144. import Pagination from '@/components/Pagination'
  145. export default {
  146. name: 'User',
  147. components: { Pagination },
  148. data() {
  149. return {
  150. isRoleEdit: [],
  151. requestParams: [
  152. { name: 'getRoleAll', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
  153. ],
  154. enableList: [{ id: 1, name: '是' }, { id: 0, name: '否' }], // 是否启用
  155. attentionStatusList: [{ id: 1, name: '已关注公众号' }, { id: 0, name: '未关注公众号' }],
  156. roleList: [], // 角色
  157. table: {
  158. getdataListParm: {
  159. name: 'getuserallL',
  160. page: 1,
  161. offset: 1,
  162. pagecount: parseInt(Cookies.get('pageCount')),
  163. returntype: 'Map',
  164. parammaps: {
  165. pastureid: Cookies.get('pastureid'),
  166. empCode: '',
  167. empname: '',
  168. enable: '',
  169. startTime: '',
  170. stopTime: '',
  171. inputDatetime: ''
  172. }
  173. },
  174. tableKey: 0,
  175. list: [],
  176. total: 0,
  177. listLoading: true,
  178. temp: {}
  179. },
  180. requestParam: {},
  181. isokDisable: false,
  182. selectList: [],
  183. QRcode:{
  184. dialogStatus: '',
  185. dialogFormVisible:false,
  186. },
  187. textMap: {
  188. QRcode:'提示'
  189. },
  190. rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
  191. cellStyle: { padding: 0 + 'px' },
  192. imgUrl:''
  193. }
  194. },
  195. created() {
  196. this.getList()
  197. this.getDownList()
  198. this.getButtons()
  199. },
  200. methods: {
  201. getButtons() {
  202. const Edit = 'User'
  203. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  204. this.isRoleEdit = isRoleEdit
  205. },
  206. getDownList() {
  207. GetDataByNames(this.requestParams).then(response => {
  208. this.roleList = response.data.getRoleAll.list
  209. })
  210. },
  211. getList() {
  212. this.table.listLoading = true
  213. GetDataByName(this.table.getdataListParm).then(response => {
  214. console.log('table数据', response.data.list)
  215. if (response.data.list !== null) {
  216. for (let i = 0; i < response.data.list.length; i++) {
  217. this.$set(response.data.list[i], 'Edit', false) // 编辑
  218. this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
  219. this.$set(response.data.list[i], 'isCreate', false) // 新增操作
  220. this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
  221. this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
  222. }
  223. this.table.list = response.data.list
  224. this.table.pageNum = response.data.pageNum
  225. this.table.pageSize = response.data.pageSize
  226. } else {
  227. this.table.list = []
  228. }
  229. this.table.total = response.data.total
  230. setTimeout(() => {
  231. this.table.listLoading = false
  232. }, 100)
  233. })
  234. },
  235. handleEnableChange() {
  236. console.log('点击了是否启用')
  237. },
  238. form_search() {
  239. console.log('点击了查询')
  240. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  241. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  242. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  243. } else {
  244. this.table.getdataListParm.parammaps.inputDatetime = ''
  245. this.table.getdataListParm.parammaps.startTime = ''
  246. this.table.getdataListParm.parammaps.stopTime = ''
  247. }
  248. this.table.getdataListParm.offset = 1
  249. this.getList()
  250. },
  251. handleRefresh() {
  252. console.log('点击了重置')
  253. this.table.getdataListParm.parammaps.empCode = ''
  254. this.table.getdataListParm.parammaps.empname = ''
  255. this.table.getdataListParm.parammaps.enable = ''
  256. this.table.getdataListParm.parammaps.startTime = ''
  257. this.table.getdataListParm.parammaps.stopTime = ''
  258. this.table.getdataListParm.parammaps.inputDatetime = ''
  259. this.table.getdataListParm.offset = 1
  260. this.getList()
  261. },
  262. handleCreate() {
  263. // 编辑true/不可编辑false
  264. // 新增操true,编辑false,编辑保存false
  265. for (let i = 0; i < this.table.list.length; i++) {
  266. if (this.table.list[i].Edit === true) {
  267. console.log(123)
  268. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  269. return false
  270. }
  271. }
  272. this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'createdtime': parseTime(new Date(), '{y}-{m}-{d}'), 'createmp': Cookies.get('employename'), 'username': '', 'roleid': '' })
  273. },
  274. changeRolename(item) {
  275. this.table.temp.rolename = this.roleList.find(obj => obj.id === item).rolename
  276. },
  277. createData(row) {
  278. console.log('点击了新增保存', row)
  279. this.table.temp.pastureid = Cookies.get('pastureid')
  280. this.table.temp.empname = row.empname
  281. this.table.temp.username = row.username
  282. this.table.temp.phone = row.phone
  283. this.table.temp.createmp = row.createmp
  284. this.table.temp.enable = row.enable
  285. this.table.temp.roleid = row.roleid
  286. // 检验用户名称/角色是否为空
  287. if (this.table.temp.username == '' && this.table.temp.roleid == '') {
  288. this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
  289. return false
  290. } else if (this.table.temp.username == '') {
  291. this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
  292. return false
  293. } else if (this.table.temp.roleid == '') {
  294. this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
  295. return false
  296. }
  297. // 检验手机号是否为11位数字
  298. if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
  299. const phone = /^\d{11}$/
  300. if (!phone.test(this.table.temp.phone)) {
  301. this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
  302. return false
  303. }
  304. }
  305. this.isokDisable = true
  306. setTimeout(() => {
  307. this.isokDisable = false
  308. }, 1000)
  309. this.requestParam.name = 'createUser'
  310. this.table.temp.isgroups = Cookies.get('ispastureuse')
  311. this.requestParam.parammaps = this.table.temp
  312. PostDataByName(this.requestParam).then(response => {
  313. console.log('新增保存发送参数', this.requestParam)
  314. if (response.msg !== 'fail') {
  315. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  316. this.getList()
  317. } else {
  318. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  319. }
  320. })
  321. },
  322. createCancel(row) {
  323. console.log('点击了新增取消')
  324. for (let i = 0; i < this.table.list.length; i++) {
  325. if (row.myId === this.table.list[i].myId) {
  326. var listIndex = this.table.list.indexOf(this.table.list[i])
  327. }
  328. if (listIndex > -1) {
  329. this.table.list.splice(listIndex, 1)
  330. return
  331. }
  332. }
  333. },
  334. handleUpdate(row) {
  335. for (let i = 0; i < this.table.list.length; i++) {
  336. if (this.table.list[i].Edit == true) {
  337. this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
  338. return false
  339. }
  340. }
  341. // 编辑true,不可编辑false
  342. row.Edit = true
  343. row.NoEdit = false
  344. // 新增false,编辑false,编辑保存true
  345. row.isCreate = false
  346. row.isUpdate = false
  347. row.isUpdateSave = true
  348. row.roleid = String(row.roleid)
  349. this.table.temp.roleid = row.roleid
  350. this.table.temp.rolename = row.rolename
  351. },
  352. updateData(row) {
  353. console.log('点击了编辑保存', row)
  354. this.table.temp.pastureid = row.pastureid
  355. this.table.temp.empname = row.empname
  356. this.table.temp.username = row.username
  357. this.table.temp.phone = row.phone
  358. this.table.temp.createmp = row.createmp
  359. this.table.temp.enable = row.enable
  360. this.table.temp.roleid = row.roleid
  361. this.table.temp.id = row.id
  362. // 校验用户名称/角色是否为空
  363. if (this.table.temp.username == '' && this.table.temp.roleid == '') {
  364. this.$message({ type: 'error', message: '用户名称/角色不能为空', duration: 2000 })
  365. return false
  366. } else if (this.table.temp.username == '') {
  367. this.$message({ type: 'error', message: '用户名称不能为空', duration: 2000 })
  368. return false
  369. } else if (this.table.temp.roleid == '') {
  370. this.$message({ type: 'error', message: '角色不能为空', duration: 2000 })
  371. return false
  372. }
  373. console.log(this.table.temp.phone)
  374. // 检验手机号是否为11位数字
  375. if (this.table.temp.phone !== undefined && this.table.temp.phone !== '') {
  376. const phone = /^\d{11}$/
  377. if (!phone.test(this.table.temp.phone)) {
  378. this.$message({ type: 'error', message: '请输入11位手机号', duration: 2000 })
  379. return false
  380. }
  381. }
  382. this.isokDisable = true
  383. setTimeout(() => {
  384. this.isokDisable = false
  385. }, 1000)
  386. this.requestParam.name = 'updateUser'
  387. this.requestParam.parammaps = this.table.temp
  388. PostDataByName(this.requestParam).then(response => {
  389. console.log('新增保存发送参数', this.requestParam)
  390. if (response.msg !== 'fail') {
  391. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  392. this.getList()
  393. } else {
  394. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  395. }
  396. })
  397. },
  398. updateCancel(row) {
  399. console.log('点击了编辑取消')
  400. // 编辑false,不可编辑true
  401. row.Edit = false
  402. row.NoEdit = true
  403. // 新增false,编辑true,编辑保存false
  404. row.isCreate = false
  405. row.isUpdate = true
  406. row.isUpdateSave = false
  407. this.getList()
  408. },
  409. handleRowDelete(row) {
  410. console.log('点击了行内删除')
  411. MessageBox.confirm('是否确认删除此信息?', {
  412. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  413. }).then(() => {
  414. this.selectList = []
  415. this.requestParam.name = 'deleteUser'
  416. this.requestParam.parammaps = {}
  417. this.requestParam.parammaps.pastureid = row.pastureid
  418. this.requestParam.parammaps.id = row.id
  419. PostDataByName(this.requestParam).then(response => {
  420. if (response.msg === 'fail') {
  421. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  422. } else {
  423. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  424. this.getList()
  425. }
  426. })
  427. }).catch(() => {
  428. this.$message({ type: 'info', message: '已取消删除' })
  429. })
  430. },
  431. handleSelectionChange(val) {
  432. console.log('勾选数据', val)
  433. this.selectList = val
  434. },
  435. form_delete() {
  436. console.log('点击了删除')
  437. if (this.selectList.length == 0) {
  438. this.$message({ type: 'error', message: '请选择用户信息', duration: 2000 })
  439. } else {
  440. MessageBox.confirm('是否确认删除此信息?', {
  441. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  442. }).then(() => {
  443. console.log(this.selectList)
  444. this.requestParam.common = { 'returnmap': '0' }
  445. this.requestParam.data = []
  446. this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
  447. this.requestParam.data[0].children = []
  448. this.requestParam.data[0].children[0] = { 'name': 'deleteUser', 'type': 'e', 'parammaps': {
  449. id: '@insertSpotList.id',
  450. pastureid: '@insertSpotList.pastureid'
  451. }}
  452. ExecDataByConfig(this.requestParam).then(response => {
  453. console.log('删除保存发送参数', this.requestParam)
  454. if (response.msg === 'fail') {
  455. this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
  456. } else {
  457. this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
  458. this.getList()
  459. }
  460. })
  461. })
  462. }
  463. },
  464. handleResetPassword(row) {
  465. MessageBox.confirm('是否确认将此用户密码重置为默认密码123456?', {
  466. confirmButtonText: '确认',
  467. cancelButtonText: '取消',
  468. type: 'warning'
  469. }).then(() => {
  470. this.requestParam.name = 'initPassword'
  471. this.requestParam.parammaps = {}
  472. this.requestParam.parammaps.pastureid = row.pastureid
  473. this.requestParam.parammaps.id = row.id
  474. PostDataByName(this.requestParam).then(() => {
  475. this.getList()
  476. this.resetRequestParam()
  477. this.dialogFormVisible = false
  478. this.$notify({
  479. title: '成功',
  480. message: '重置密码成功',
  481. type: 'success',
  482. duration: 2000
  483. })
  484. })
  485. })
  486. },
  487. handleScanningCode(row){
  488. this.QRcode.dialogStatus = 'QRcode'
  489. this.QRcode.dialogFormVisible = true
  490. this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_str=tmrwatch.'+ Cookies.get('pastureid')+'.'+ row.username + '.'+row.empname
  491. console.log(this.imgUrl)
  492. }
  493. }
  494. }
  495. </script>
  496. <style lang="scss" scoped>
  497. // .search{margin-top:10px;}
  498. .QRcode{display:flex;justify-content: center; align-items:center;}
  499. .content{
  500. /* margin-top: 100px; */
  501. width: 500px;
  502. }
  503. .content img{
  504. max-width:300px;
  505. }
  506. </style>