list.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <a-card size="small" :bordered="false" class="chainTransferInList-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="15">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="入库时间">
  9. <a-range-picker
  10. style="width:100%"
  11. id="chainTransferInList-time"
  12. :disabledDate="disabledDate"
  13. v-model="time"
  14. :format="dateFormat"
  15. :placeholder="['开始时间', '结束时间']" />
  16. </a-form-item>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-item label="调出对象">
  21. <v-select
  22. v-model="queryParam.outTenantName"
  23. ref="outTenantName"
  24. id="chainTransferInList-outTenantName"
  25. code="PAYMENT_TYPE"
  26. placeholder="请选择调出对象"
  27. allowClear></v-select>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="24">
  31. <a-form-item label="调拨产品类型">
  32. <v-select
  33. v-model="queryParam.allocationType"
  34. ref="allocationType"
  35. id="chainTransferInList-allocationType"
  36. code="PAYMENT_TYPE"
  37. placeholder="请选择调拨产品类型"
  38. allowClear></v-select>
  39. </a-form-item>
  40. </a-col>
  41. <template v-if="advanced">
  42. <a-col :md="6" :sm="24">
  43. <a-form-item label="单据状态">
  44. <v-select
  45. v-model="queryParam.state"
  46. ref="state"
  47. id="chainTransferInList-state"
  48. code="PAYMENT_TYPE"
  49. placeholder="请选择单据状态"
  50. allowClear></v-select>
  51. </a-form-item>
  52. </a-col>
  53. </template>
  54. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  55. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferInList-refresh">查询</a-button>
  56. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferInList-reset">重置</a-button>
  57. <a @click="advanced=!advanced" style="margin-left: 8px">
  58. {{ advanced ? '收起' : '展开' }}
  59. <a-icon :type="advanced ? 'up' : 'down'"/>
  60. </a>
  61. </a-col>
  62. </a-row>
  63. </a-form>
  64. </div>
  65. <!-- 列表 -->
  66. <s-table
  67. class="sTable"
  68. ref="table"
  69. size="default"
  70. :rowKey="(record) => record.id"
  71. :columns="columns"
  72. :data="loadData"
  73. :scroll="{ x: 1595 }"
  74. bordered>
  75. <!-- 状态 -->
  76. <template slot="state" slot-scope="text, record">
  77. <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待入库': '待审核' }}</a-tag>
  78. </template>
  79. <!-- 操作 -->
  80. <template slot="action" slot-scope="text, record">
  81. <a-button size="small" type="link" class="button-primary" @click="handleWarehousing(record)" id="chainTransferInList-warehousing-btn">入库</a-button>
  82. <a-divider type="vertical" style="margin: 0;" />
  83. <a-button size="small" type="link" class="button-warning" @click="handleExamine(record)" id="chainTransferInList-examine-btn">审核</a-button>
  84. <a-divider type="vertical" style="margin: 0;" />
  85. <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="chainTransferInList-edit-btn">编辑</a-button>
  86. <a-divider type="vertical" style="margin: 0;" />
  87. <a-button size="small" type="link" @click="handleDetail(record)" id="chainTransferInList-detail-btn">详情</a-button>
  88. </template>
  89. </s-table>
  90. </a-card>
  91. </template>
  92. <script>
  93. import { allocLinkagePutList } from '@/api/allocLinkagePut'
  94. import { STable, VSelect } from '@/components'
  95. export default {
  96. components: { STable, VSelect },
  97. data () {
  98. return {
  99. advanced: false, // 高级搜索 展开/关闭
  100. time: undefined, // 入库时间
  101. queryParam: { // 查询条件
  102. outTenantName: undefined, // 调出对象
  103. allocationType: undefined, // 调拨产品类型
  104. state: undefined // 单据状态
  105. },
  106. disabled: false, // 查询、重置按钮是否可操作
  107. dateFormat: 'YYYY-MM-DD',
  108. columns: [
  109. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  110. { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
  111. { title: '连锁调出单号', dataIndex: 'productName', width: 140, align: 'center' },
  112. { title: '店内单号', dataIndex: 'allocationLinkagePutNo', width: 140, align: 'center' },
  113. { title: '调出对象', dataIndex: 'outTenantName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  114. { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  115. { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  116. { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  117. { title: '入库时间', dataIndex: 'putWarehouseTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  118. { title: '调拨产品类型', dataIndex: 'allocationType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  119. { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
  120. { title: '操作', scopedSlots: { customRender: 'action' }, width: 215, align: 'center', fixed: 'right' }
  121. ],
  122. // 加载数据方法 必须为 Promise 对象
  123. loadData: parameter => {
  124. this.disabled = true
  125. this.queryParam = {}
  126. return allocLinkagePutList(Object.assign(parameter, this.queryParam)).then(res => {
  127. const data = res.data
  128. const no = (data.pageNo - 1) * data.pageSize
  129. for (var i = 0; i < data.list.length; i++) {
  130. data.list[i].no = no + i + 1
  131. }
  132. this.disabled = false
  133. return data
  134. })
  135. },
  136. openModal: false, // 新增编辑产品品牌 弹框
  137. itemId: '' // 当前品牌id
  138. }
  139. },
  140. methods: {
  141. // 不可选日期
  142. disabledDate (date, dateStrings) {
  143. return date && date.valueOf() > Date.now()
  144. },
  145. // 重置
  146. resetSearchForm () {
  147. this.queryParam.outTenantName = undefined
  148. this.queryParam.allocationType = undefined
  149. this.queryParam.state = undefined
  150. this.time = undefined
  151. this.$refs.table.refresh(true)
  152. },
  153. // 入库
  154. handleWarehousing () {},
  155. // 审核
  156. handleExamine () {
  157. const _this = this
  158. this.$confirm({
  159. title: '提示',
  160. content: '确认要审核通过吗?',
  161. centered: true,
  162. onOk () {
  163. // delectRolePower({
  164. // id: row.id
  165. // }).then(res => {
  166. // console.log(res, 'res1111')
  167. // if (res.status == 200) {
  168. // _this.$message.success(res.message)
  169. // _this.$refs.table.refresh()
  170. // }
  171. // })
  172. }
  173. })
  174. },
  175. // 详情
  176. handleDetail (row) {
  177. this.$router.push({ path: `/allocationManagement/chainTransferIn/detail/${row.id}/${row.allocationLinkagePutSn}` })
  178. },
  179. // 新增/编辑
  180. handleEdit (row) {
  181. if (row) { // 编辑
  182. this.$router.push({ path: `/allocationManagement/chainTransferIn/edit/${row.id}` })
  183. } else { // 新增
  184. this.$router.push({ path: '/allocationManagement/chainTransferIn/add' })
  185. }
  186. }
  187. }
  188. }
  189. </script>