index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <div class="app-container">
  8. <div class="filter-container">
  9. <el-input
  10. v-model="getDeptListParm.parammaps.warehoseCode"
  11. placeholder="库位编号"
  12. clearable
  13. style="width: 200px;"
  14. class="filter-item"
  15. />
  16. <el-button
  17. v-waves
  18. class="filter-item"
  19. type="primary"
  20. icon="el-icon-search"
  21. @click="form_search"
  22. >搜索</el-button>
  23. <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add">
  24. 新增
  25. </el-button>
  26. <el-upload
  27. style="display: inline-block;"
  28. :headers="headers"
  29. :data="uploadData"
  30. :action="uploadExcelUrl"
  31. :show-file-list="false"
  32. :before-upload="beforeImportExcel"
  33. :on-success="handleImportExcelSuccess"
  34. >
  35. <el-button
  36. v-if="isWarehouseImport"
  37. v-waves
  38. class="filter-item"
  39. type="warning"
  40. icon="el-icon-upload2"
  41. @click="form_search"
  42. >导入</el-button>
  43. </el-upload>
  44. <el-button
  45. :disabled="isokDisable"
  46. class="filter-item"
  47. style="margin-left: 10px;"
  48. type="success"
  49. icon="el-icon-edit"
  50. @click="handleDownload"
  51. >导出</el-button>
  52. </div>
  53. <!-- :tree-props="{children: 'children'}" -->
  54. <el-table
  55. v-loading="listLoading"
  56. element-loading-text="给我一点时间"
  57. :data="list"
  58. border
  59. fit
  60. highlight-current-row
  61. style="width: 100%;"
  62. :row-style="rowStyle"
  63. :cell-style="cellStyle"
  64. class="elTable"
  65. row-key="id"
  66. @sort-change="tableSort"
  67. >
  68. <el-table-column label="序号" align="center" type="index" width="50px">
  69. <template slot-scope="scope">
  70. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="库位名称" header-align="left" min-width="200px">
  74. <template slot-scope="scope">
  75. <!-- <span>{{ scope.row.warehoseCode }}({{ scope.row.warehosetName }}) </span> -->
  76. <span>{{ scope.row.warehoseCode }} </span>
  77. </template>
  78. </el-table-column>
  79. <!-- <el-table-column label="层级" min-width="80px" header-align="center" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.section }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="子类数" min-width="80px" header-align="center" align="center">
  85. <template slot-scope="scope">
  86. <span>{{ scope.row.childrens }}</span>
  87. </template>
  88. </el-table-column> -->
  89. <el-table-column label="入库数" sortable prop="pls" min-width="100px" header-align="center" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.pls }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="出库数" sortable prop="pts" min-width="100px" header-align="center" align="center">
  95. <template slot-scope="scope">
  96. <span>{{ scope.row.pts }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="备件数" sortable prop="prs" min-width="100px" header-align="center" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.prs }}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="盘点" header-align="center" width="50px">
  105. <template slot-scope="scope">
  106. <span>{{ scope.row.cps }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="启用" min-width="80px" header-align="center" align="center">
  110. <template slot-scope="scope">
  111. <el-switch
  112. v-model="scope.row.enable"
  113. active-color="#13ce66"
  114. inactive-color="#ff4949"
  115. :active-value="1"
  116. :inactive-value="0"
  117. @change="handleEnableChange(scope.$index, scope.row)"
  118. />
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="操作" header-align="center" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
  122. <template slot-scope="{row}">
  123. <el-button type="primary" size="mini" @click="form_edit(row)"> 编辑 </el-button>
  124. <el-button v-if="row.childrens === 0 && row.cps === 0 && row.prs === 0 && row.pts === 0 && row.pls === 0" size="mini" type="danger" @click="form_delete(row)"> 删除 </el-button>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <pagination
  129. v-show="total>0"
  130. :total="total"
  131. :page.sync="getDeptListParm.offset"
  132. :limit.sync="getDeptListParm.pagecount"
  133. @pagination="getList"
  134. />
  135. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
  136. <el-form ref="dataForm" :rules="rules" :model="deptform" label-position="left" label-width="100px" style="width: 90%; margin-left:50px;">
  137. <el-row>
  138. <el-col :span="8">
  139. <el-form-item label="库位编码" prop="warehoseCode">
  140. <el-input ref="warehoseCode" v-model="deptform.warehoseCode" />
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <el-row>
  145. <el-col :span="8">
  146. <el-form-item label="备注" prop="remark">
  147. <el-input ref="remark" v-model="deptform.remark" :autosize="{ minRows: 2, maxRows: 10}" type="textarea" placeholder="请输入" />
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. <el-row>
  152. <el-col :span="8">
  153. <el-form-item label="启用" prop="enable">
  154. <el-switch ref="enable" v-model="deptform.enable" :active-value="1" :inactive-value="0" />
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. </el-form>
  159. <div slot="footer" class="dialog-footer">
  160. <el-button v-if="dialogStatus==='create'" :disabled="isokDisable" type="success" @click="add_dialog_save_again()"> 保存并新增 </el-button>
  161. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()"> 保存并关闭 </el-button>
  162. <el-button @click="dialogFormVisible = false;getList();"> 取消并关闭 </el-button>
  163. </div>
  164. </el-dialog>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import TreeSelect from '@/components/TreeSelect'
  170. import waves from '@/directive/waves' // waves directive
  171. import { PostDataByName, GetDataByName, transData, failproccess, formatJson, checkButtons, GetAccount } from '@/api/common'
  172. import { MessageBox } from 'element-ui'
  173. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  174. import { getToken } from '@/utils/auth'
  175. import Cookies from 'js-cookie'
  176. import { parseTime, sortChange } from '@/utils/index.js'
  177. export default {
  178. name: 'Dept',
  179. components: { TreeSelect, Pagination },
  180. directives: { waves },
  181. data() {
  182. return {
  183. isWarehouseImport: [],
  184. isokDisable: false,
  185. disabled: false,
  186. tableKey: 0,
  187. total: 0,
  188. list: [{ 'deptname': '公司', 'id': 1, 'parentid': -1, 'remark': '' }],
  189. parentDept: [],
  190. listLoading: true,
  191. requestParam: {
  192. name: 'createdept'
  193. },
  194. deptform: {
  195. id: '',
  196. tempPtypeCode: '',
  197. temptypeCode: '',
  198. warehosetName: '',
  199. warehoseCode: '',
  200. remark: '',
  201. pid: '',
  202. pastureId: '',
  203. section: '',
  204. isWhPostion: '',
  205. sort: 0,
  206. enable: ''
  207. },
  208. getDeptListParm: {
  209. name: 'getWarehouselist',
  210. page: 1,
  211. offset: 1,
  212. pagecount: 10,
  213. returntype: 'Map',
  214. parammaps: {
  215. pastureId: this.$store.state.user.pastureid,
  216. warehoseCode: ''
  217. }
  218. },
  219. pageNum: 0,
  220. pageSize: 0,
  221. getDeptParm: { name: 'getdeptrecu',
  222. idname: 'value',
  223. params: [-1] },
  224. rules: {
  225. temptypeCode: [{ type: 'string', required: true, message: '库位编码必填', trigger: 'blur' }],
  226. warehosetName: [{ type: 'string', required: true, message: '库位名称必填', trigger: 'blur' }]
  227. },
  228. dialogFormVisible: false,
  229. parentWHVisible: true,
  230. dialogStatus: '',
  231. textMap: {
  232. update: '编辑',
  233. create: '新增'
  234. },
  235. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  236. cellStyle: { padding: 0 + 'px' },
  237. defaultProps: {
  238. children: 'children',
  239. label: 'typeNameCode'
  240. },
  241. nodeKey: 'id',
  242. defaultCheckedKeys: [],
  243. buttons: [],
  244. isPercentage: false,
  245. percentage: 1
  246. }
  247. },
  248. computed: {
  249. // 设置请求头
  250. headers() {
  251. return {
  252. // 设置token
  253. token: getToken()
  254. }
  255. },
  256. uploadData() {
  257. return {
  258. name: 'insertwarehouseprovider',
  259. importParams: '牧场,库位,供应商',
  260. sheetname: 'SheetJS'
  261. }
  262. },
  263. // 设置上传地址
  264. uploadExcelUrl() {
  265. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  266. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  267. }
  268. },
  269. created() {
  270. this.getList()
  271. const that = this
  272. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  273. that.buttons = response.data.list
  274. that.get_auto_buttons()
  275. })
  276. },
  277. methods: {
  278. tableSort(column) {
  279. sortChange(column, this.list)
  280. },
  281. get_auto_buttons() {
  282. // 新增
  283. const WarehouseImport = 'basic:warehouse:upload'
  284. const isWarehouseImport = checkButtons(this.$store.state.user.buttons, WarehouseImport)
  285. this.isWarehouseImport = isWarehouseImport
  286. },
  287. popoverHide(checkedIds, checkedData) {
  288. this.deptform.pid = checkedIds
  289. if (checkedIds !== null) {
  290. // this.deptform.warehoseCode = checkedData.warehoseCode
  291. } else {
  292. this.deptform.pid = -1
  293. }
  294. this.getMaxCode()
  295. },
  296. deptenter() {
  297. /* this.$nextTick(() => {
  298. this.$refs['remark'].focus()
  299. }) */
  300. },
  301. getList() {
  302. this.listLoading = true // 列表加载
  303. GetDataByName(this.getDeptListParm).then(response => {
  304. this.list = response.data
  305. console.log(this.list)
  306. if (response.data.list !== null) {
  307. this.list = transData(response.data.list, 'id', 'pid', 'children')
  308. this.pageNum = response.data.pageNum
  309. this.pageSize = response.data.pageSize
  310. console.log(this.list)
  311. }
  312. if (response.data.total) {
  313. this.total = response.data.total
  314. console.log(this.total)
  315. }
  316. this.parentDept = this.list
  317. // this.getDeptList()
  318. // Just to simulate the time of the request
  319. setTimeout(() => {
  320. this.listLoading = false
  321. }, 0.5 * 1000)
  322. })
  323. },
  324. form_search() {
  325. this.listLoading = true
  326. this.getDeptListParm.offset = 1
  327. this.getList()
  328. },
  329. querySearchWarehoseCode(queryString, cb) {
  330. console.log('库位编号模糊查询输入值', queryString)
  331. this.getDeptListParm.parammaps['warehoseCode'] = queryString
  332. GetDataByName(this.getDeptListParm).then(response => {
  333. console.log('库位模糊查询搜索data', response.data.list)
  334. cb(response.data.list)
  335. })
  336. },
  337. handleSelectWarehoseCode(item) {
  338. console.log('库位编号模糊查询选中值', item.id)
  339. },
  340. resetRequestParam() {
  341. this.requestParam = {
  342. name: 'createwh',
  343. params: []
  344. }
  345. this.deptform.id = ''
  346. this.deptform.temptypeCode = ''
  347. this.deptform.tempPtypeCode = ''
  348. this.deptform.warehosetName = ''
  349. this.deptform.warehoseCode = ''
  350. this.deptform.remark = ''
  351. this.deptform.pid = -1
  352. this.deptform.pastureId = this.$store.state.user.pastureid
  353. this.deptform.section = ''
  354. this.deptform.isWhPostion = '0'
  355. this.deptform.sort = '0'
  356. this.deptform.enable = '1'
  357. },
  358. form_add() {
  359. this.resetRequestParam()
  360. this.dialogStatus = 'create'
  361. this.defaultCheckedKeys = []
  362. this.dialogFormVisible = true
  363. this.deptform.pid = -1
  364. this.deptform.enable = 1
  365. this.getMaxCode()
  366. this.parentWHVisible = true
  367. this.$nextTick(() => {
  368. this.$refs['dataForm'].clearValidate()
  369. })
  370. },
  371. getMaxCode() {
  372. this.requestParam.name = 'getWHMaxcodeByPid' // 请求接口名称
  373. this.requestParam.parammaps = {}
  374. this.requestParam.parammaps.pid = this.deptform.pid // 父级id
  375. this.requestParam.parammaps.pastureId = this.deptform.pastureId // 牧场id
  376. GetDataByName(this.requestParam).then(response => {
  377. if (response.data.list.length > 0) {
  378. if (response.data.list[0].parentcode !== '') { // 响应数据的父编码不为空
  379. this.deptform.tempPtypeCode = response.data.list[0].parentcode // 赋值给前输入框
  380. }
  381. if (this.requestParam.parammaps.pid === -1) { // 如果没有父级
  382. this.deptform.tempPtypeCode = ''
  383. }
  384. console.log(this.deptform)
  385. }
  386. })
  387. },
  388. add_dialog_save() { // 新建数据
  389. this.isokDisable = true // 禁用按钮
  390. setTimeout(() => {
  391. this.isokDisable = false // 延时1秒后启用按钮
  392. }, 1000)
  393. this.$refs['dataForm'].validate((valid) => {
  394. if (valid) {
  395. this.requestParam.name = 'createwh'
  396. this.deptform.isWhPostion = 1
  397. this.requestParam.parammaps = this.deptform
  398. if (this.deptform.pid === null || this.deptform.pid === '') {
  399. this.requestParam.parammaps.pid = -1
  400. } else {
  401. this.requestParam.parammaps.pid = this.deptform.pid
  402. }
  403. PostDataByName(this.requestParam).then(response => {
  404. if (response.msg !== 'fail') {
  405. this.getList()
  406. this.dialogFormVisible = false
  407. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  408. } else {
  409. failproccess(response, this.$notify)
  410. }
  411. })
  412. }
  413. })
  414. },
  415. add_dialog_save_again() {
  416. this.isokDisable = true
  417. setTimeout(() => {
  418. this.isokDisable = false
  419. }, 1000)
  420. this.$refs['dataForm'].validate((valid) => {
  421. this.requestParam.name = 'createwh'
  422. this.deptform.isWhPostion = 1
  423. this.requestParam.parammaps = this.deptform
  424. if (this.deptform.pid === null || this.deptform.pid === '') {
  425. this.requestParam.parammaps.pid = -1
  426. } else {
  427. this.requestParam.parammaps.pid = this.deptform.pid
  428. }
  429. PostDataByName(this.requestParam).then(response => {
  430. if (response.msg !== 'fail') {
  431. this.deptform.remark = ''
  432. this.deptform.warehoseCode = ''
  433. this.$notify({ title: '成功', message: '新增成功', type: 'success', duration: 2000 })
  434. } else {
  435. failproccess(response, this.$notify)
  436. }
  437. })
  438. })
  439. },
  440. // 更新
  441. form_edit(row) {
  442. this.defaultCheckedKeys = [row.pid]
  443. this.deptform.id = row.id
  444. this.deptform.warehosetName = row.warehosetName
  445. this.deptform.warehoseCode = row.warehoseCode
  446. this.deptform.remark = row.remark
  447. this.deptform.pid = row.pid
  448. this.deptform.pastureId = this.$store.state.user.pastureid
  449. this.deptform.section = row.section
  450. this.deptform.isWhPostion = row.isWhPostion
  451. this.deptform.sort = row.sort
  452. this.deptform.enable = row.enable
  453. this.deptform.tempPtypeCode = this.deptform.warehoseCode.substr(0, this.deptform.warehoseCode.lastIndexOf('.') + 1)
  454. this.deptform.temptypeCode = this.deptform.warehoseCode.substr(this.deptform.warehoseCode.lastIndexOf('.') + 1)
  455. this.parentWHVisible = row.pid > 0
  456. this.dialogStatus = 'update'
  457. this.dialogFormVisible = true
  458. this.$nextTick(() => {
  459. this.$refs['dataForm'].clearValidate()
  460. /* this.$refs['deptname'].focus() */
  461. })
  462. },
  463. // 提交更新
  464. edit_dialog_save() {
  465. this.isokDisable = true
  466. setTimeout(() => {
  467. this.isokDisable = false
  468. }, 1000)
  469. this.$refs['dataForm'].validate((valid) => {
  470. if (valid) {
  471. this.requestParam.name = 'updatewh'
  472. this.deptform.warehoseCode = this.deptform.warehoseCode
  473. // this.deptform.warehoseCode = this.deptform.tempPtypeCode + this.deptform.temptypeCode
  474. this.requestParam.parammaps = this.deptform
  475. PostDataByName(this.requestParam).then(response => {
  476. if (response.msg !== 'fail') {
  477. this.getList()
  478. this.dialogFormVisible = false
  479. this.$notify({
  480. title: '成功',
  481. message: '修改成功',
  482. type: 'success',
  483. duration: 2000
  484. })
  485. } else {
  486. failproccess(response, this.$notify)
  487. }
  488. })
  489. }
  490. })
  491. },
  492. handleEnableChange(index, row) {
  493. this.requestParam.name = 'updatewh'
  494. if (row.sort === null) {
  495. row.sort = 0
  496. }
  497. this.requestParam.parammaps = row
  498. PostDataByName(this.requestParam).then(response => {
  499. if (response.msg !== 'fail') {
  500. this.$notify({
  501. title: '成功',
  502. message: '修改成功',
  503. type: 'success',
  504. duration: 2000
  505. })
  506. } else {
  507. failproccess(response, this.$notify)
  508. }
  509. })
  510. },
  511. // 导入
  512. beforeImportExcel(file) {
  513. const isLt2M = file.size / 1024 / 1024 < 2
  514. if (!isLt2M) {
  515. this.$message.error('上传文件大小不能超过 2MB!')
  516. }
  517. return isLt2M
  518. },
  519. handleImportExcelSuccess(res, file) {
  520. this.getList()
  521. if (res.msg === 'ok') {
  522. this.$message({
  523. title: '成功',
  524. message: '导入成功:' + res.data.success + '条!',
  525. type: 'success',
  526. duration: 2000
  527. })
  528. if (res.data.err_count > 0) {
  529. this.$notify({
  530. title: '失败',
  531. message: '导入失败:' + res.data.err_count + '条!',
  532. type: 'danger',
  533. duration: 2000
  534. })
  535. import('@/vendor/Export2Excel').then(excel => {
  536. const list1 = res.data.result
  537. const tHeader = ['牧场', '库位', '供应商', '错误信息']
  538. const filterVal = ['牧场', '库位', '供应商', 'error_msg']
  539. const data1 = this.formatJson(filterVal, list1)
  540. excel.export_json_to_excel({
  541. header: tHeader,
  542. data: data1,
  543. filename: '库位管理',
  544. autoWidth: true,
  545. bookType: 'xlsx'
  546. })
  547. })
  548. }
  549. } else {
  550. this.$notify({
  551. title: '失败',
  552. message: '上传失败',
  553. type: 'danger',
  554. duration: 2000
  555. })
  556. }
  557. },
  558. formatJson(filterVal, jsonData) {
  559. return jsonData.map(v =>
  560. filterVal.map(j => {
  561. if (j === 'timestamp') {
  562. return parseTime(v[j])
  563. } else {
  564. return v[j]
  565. }
  566. })
  567. )
  568. },
  569. // 导出
  570. handleDownload() {
  571. this.$alert('库位管理正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  572. this.isPercentage = true
  573. this.percentage = 1
  574. var timer = setInterval(() => {
  575. this.percentage += 5
  576. if (this.percentage > 95) {
  577. this.percentage = 99
  578. clearInterval(timer)
  579. }
  580. this.percentage = this.percentage
  581. }, 1000)
  582. this.isokDisable = true
  583. setTimeout(() => {
  584. this.isokDisable = false
  585. }, 1000)
  586. GetAccount(this.getDeptListParm).then(response => {
  587. this.$nextTick(() => {
  588. import('@/vendor/Export2Excel').then(excel => {
  589. const list1 = response.data.list
  590. if (response.data.list !== '') {
  591. this.percentage = 99
  592. setTimeout(() => {
  593. this.isPercentage = false
  594. }, 2000)
  595. }
  596. const tHeader = [
  597. '库位编号', '库位名称', '层级', '子类数', '入库数', '出库数', '备件数', '盘点', '是否库位', '启用'
  598. ]
  599. const filterVal = [
  600. 'warehoseCode', 'warehosetName', 'section', 'childrens', 'pls', 'pts', 'prs', 'cps', 'isWhPostion', 'enable'
  601. ]
  602. const data1 = formatJson(filterVal, list1)
  603. excel.export_json_to_excel({
  604. header: tHeader,
  605. data: data1,
  606. filename: '库位管理',
  607. autoWidth: true,
  608. bookType: 'xlsx'
  609. })
  610. })
  611. })
  612. })
  613. },
  614. form_delete(row) {
  615. MessageBox.confirm('是否删除当前库位信息?', {
  616. confirmButtonText: '确认',
  617. cancelButtonText: '取消',
  618. type: 'warning'
  619. }).then(() => {
  620. this.requestParam.name = 'deletewh'
  621. this.requestParam.parammaps = {
  622. id: row.id
  623. }
  624. PostDataByName(this.requestParam).then(response => {
  625. if (response.msg !== 'fail') {
  626. this.getList()
  627. this.dialogFormVisible = false
  628. this.$notify({
  629. title: '成功',
  630. message: '修改成功',
  631. type: 'success',
  632. duration: 2000
  633. })
  634. } else {
  635. failproccess(response, this.$notify)
  636. }
  637. })
  638. })
  639. }
  640. }
  641. }
  642. </script>