goodsAllocationSet.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="goodsAllocationSet-page">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="goodsAllocationSet-baseInfo">
  5. <template slot="subTitle">
  6. <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
  7. </template>
  8. </a-page-header>
  9. <a-card :bordered="false" size="small" class="goodsAllocationSet-baseInfo">
  10. <a-collapse :activeKey="['1']">
  11. <a-collapse-panel key="1" header="基础信息">
  12. <a-descriptions size="small" :column="3">
  13. <a-descriptions-item label="货架名称">{{ }}</a-descriptions-item>
  14. <a-descriptions-item label="配件经销商">{{ }}</a-descriptions-item>
  15. <a-descriptions-item label="汽车修理厂">{{ }}</a-descriptions-item>
  16. </a-descriptions>
  17. </a-collapse-panel>
  18. </a-collapse>
  19. </a-card>
  20. <a-card :bordered="false" size="small" class="pages-wrap">
  21. <div class="goodsAllocationSet-baseInfo">
  22. <a-button @click="handleExport" type="primary">导入货位</a-button>
  23. </div>
  24. <s-table
  25. class="sTable fixPagination"
  26. ref="table"
  27. size="small"
  28. rowKey="id"
  29. :showPagination="false"
  30. :columns="columns"
  31. :data="loadData"
  32. :defaultLoadData="false"
  33. bordered>
  34. <template slot="name" slot-scope="text, record">
  35. <a-input allowClear placeholder="请输入货位号" v-if="isEdit" style="width: 80%;"/>
  36. <span v-if="!isEdit">{{ record.name }}</span>
  37. </template>
  38. <template slot="status" slot-scope="text, record">
  39. <a-button type="link" @click="handleEdit(record)" v-if="!isEdit">编辑</a-button>
  40. <a-button type="link" @click="handleSave(record,0)" v-if="isEdit">保存</a-button>
  41. <a-button type="link" @click="handleSave(record,1)" v-if="isEdit">取消</a-button>
  42. <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
  43. </template>
  44. </s-table>
  45. </a-card>
  46. </a-spin>
  47. </div>
  48. </template>
  49. <script>
  50. import { STable } from '@/components'
  51. import { getPowerUserList } from '@/api/power-user.js'
  52. export default {
  53. components: { STable },
  54. data () {
  55. return {
  56. spinning: false,
  57. isEdit: false, // 货位号是否为编辑
  58. // 表头
  59. columns: [
  60. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  61. { title: '货位号', dataIndex: 'name', width: '11%', align: 'center', scopedSlots: { customRender: 'name' } },
  62. { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  63. { title: '最后修改时间', dataIndex: '', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  64. { title: '操作', width: '9%', align: 'center', scopedSlots: { customRender: 'status' } }
  65. ],
  66. // 加载数据方法 必须为 Promise 对象
  67. loadData: parameter => {
  68. this.spinning = true
  69. return getPowerUserList(Object.assign(parameter)).then(res => {
  70. let data
  71. if (res.status == 200) {
  72. data = res.data
  73. const no = (data.pageNo - 1) * data.pageSize
  74. for (let i = 0; i < data.list.length; i++) {
  75. const _item = data.list[i]
  76. _item.no = no + i + 1
  77. _item.loginFlag = _item.loginFlag + '' === '1'
  78. }
  79. }
  80. this.spinning = false
  81. return data
  82. })
  83. }
  84. }
  85. },
  86. mounted () {
  87. this.$refs.table.refresh()
  88. },
  89. methods: {
  90. handleBack () {
  91. this.$router.go(-1)
  92. },
  93. handleExport () {
  94. console.log('=========导入货位')
  95. },
  96. handleEdit (row) {
  97. this.isEdit = true
  98. },
  99. handleSave (row, type) {
  100. if (type == 0) {
  101. console.log('====保存')
  102. } else {
  103. console.log('=====取消')
  104. }
  105. this.$nextTick(() => {
  106. this.isEdit = false
  107. this.$refs.table.refresh()
  108. })
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="less">
  114. .goodsAllocationSet-page{
  115. position: relative;
  116. height: 100%;
  117. padding-bottom: 51px;
  118. box-sizing: border-box;
  119. .goodsAllocationSet-baseInfo{
  120. margin-bottom: 10px;
  121. }
  122. }
  123. </style>