list.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <a-card size="small" :bordered="false" class="storeTransferOutList-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="storeTransferOutList-bundleNamesss"
  12. :disabledDate="disabledDate"
  13. v-model="createDate"
  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.putPersonName"
  23. ref="putPersonName"
  24. id="storeTransferOutList-putPersonName"
  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.callOutType"
  34. ref="callOutType"
  35. id="storeTransferOutList-callOutType"
  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="storeTransferOutList-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="storeTransferOutList-refresh">查询</a-button>
  56. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-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. <div class="table-operator">
  67. <a-button id="storeTransferOutList-add" type="primary" @click="handleEdit()">新增</a-button>
  68. </div>
  69. <!-- 列表 -->
  70. <s-table
  71. class="sTable"
  72. ref="table"
  73. size="default"
  74. :rowKey="(record) => record.id"
  75. :columns="columns"
  76. :data="loadData"
  77. :scroll="{ x: 1500 }"
  78. bordered>
  79. <!-- 状态 -->
  80. <template slot="state" slot-scope="text, record">
  81. <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待审核' }}</a-tag>
  82. </template>
  83. <!-- 操作 -->
  84. <template slot="action" slot-scope="text, record">
  85. <a-button size="small" type="link" @click="handleExamine(record)" id="storeTransferOutList-examine-btn">审核</a-button>
  86. <a-divider type="vertical" style="margin: 0;" />
  87. <a-button size="small" type="link" @click="handleEdit(record)" id="storeTransferOutList-edit-btn">编辑</a-button>
  88. <a-divider type="vertical" style="margin: 0;" />
  89. <a-button size="small" type="link" @click="handleOut(record)" id="storeTransferOutList-out-btn">出库</a-button>
  90. <a-divider type="vertical" style="margin: 0;" />
  91. <a-button size="small" type="link" @click="handleDetail(record)" id="storeTransferOutList-detail-btn">详情</a-button>
  92. <a-divider type="vertical" style="margin: 0;" />
  93. <a-button size="small" type="link" @click="handleDel(record)" id="storeTransferOutList-del-btn">删除</a-button>
  94. </template>
  95. </s-table>
  96. <!-- 新增/编辑 -->
  97. <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
  98. </a-card>
  99. </template>
  100. <script>
  101. import { storeCallOutList } from '@/api/storeCallOut'
  102. import { STable, VSelect } from '@/components'
  103. import basicInfoModal from './basicInfoModal.vue'
  104. export default {
  105. components: { STable, VSelect, basicInfoModal },
  106. data () {
  107. return {
  108. advanced: false, // 高级搜索 展开/关闭
  109. createDate: undefined, // 创建时间
  110. queryParam: { // 查询条件
  111. putPersonName: undefined, // 调往对象
  112. callOutType: undefined, // 调拨类型
  113. state: undefined // 单据状态
  114. },
  115. disabled: false, // 查询、重置按钮是否可操作
  116. dateFormat: 'YYYY-MM-DD',
  117. columns: [
  118. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  119. { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
  120. { title: '店内调出单号', dataIndex: 'storeCallOutNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  121. { title: '调往对象', dataIndex: 'putPersonName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  122. { title: '调拨类型', dataIndex: 'callOutType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  123. { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  124. { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  125. { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  126. { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  127. { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
  128. { title: '操作', scopedSlots: { customRender: 'action' }, width: 260, align: 'center', fixed: 'right' }
  129. ],
  130. // 加载数据方法 必须为 Promise 对象
  131. loadData: parameter => {
  132. this.disabled = true
  133. this.queryParam = {}
  134. return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
  135. const data = res.data
  136. const no = (data.pageNo - 1) * data.pageSize
  137. for (var i = 0; i < data.list.length; i++) {
  138. data.list[i].no = no + i + 1
  139. }
  140. this.disabled = false
  141. return data
  142. })
  143. },
  144. openModal: false, // 新增编辑 弹框
  145. itemId: '' // 当前品牌id
  146. }
  147. },
  148. methods: {
  149. // 不可选日期
  150. disabledDate (date, dateStrings) {
  151. return date && date.valueOf() > Date.now()
  152. },
  153. // 重置
  154. resetSearchForm () {
  155. this.queryParam.putPersonName = undefined
  156. this.queryParam.callOutType = undefined
  157. this.queryParam.state = undefined
  158. this.createDate = undefined
  159. this.$refs.table.refresh(true)
  160. },
  161. // 基本信息 保存
  162. handleOk () {
  163. this.$router.push({ path: `/allocationManagement/storeTransferOut/add` })
  164. },
  165. // 删除
  166. handleDel (row) {
  167. const _this = this
  168. this.$confirm({
  169. title: '提示',
  170. content: '删除后不可恢复,确定要进行删除吗?',
  171. centered: true,
  172. onOk () {
  173. // delectRolePower({
  174. // id: row.id
  175. // }).then(res => {
  176. // console.log(res, 'res1111')
  177. // if (res.status == 200) {
  178. // _this.$message.success(res.message)
  179. // _this.$refs.table.refresh()
  180. // }
  181. // })
  182. }
  183. })
  184. },
  185. // 出库
  186. handleOut (row) {},
  187. // 审核
  188. handleExamine () {
  189. const _this = this
  190. this.$confirm({
  191. title: '提示',
  192. content: '确认要审核通过吗?',
  193. centered: true,
  194. onOk () {
  195. // delectRolePower({
  196. // id: row.id
  197. // }).then(res => {
  198. // console.log(res, 'res1111')
  199. // if (res.status == 200) {
  200. // _this.$message.success(res.message)
  201. // _this.$refs.table.refresh()
  202. // }
  203. // })
  204. }
  205. })
  206. },
  207. // 详情
  208. handleDetail (row) {
  209. this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.id}/${row.storeCallOutSn}` })
  210. },
  211. // 新增/编辑
  212. handleEdit (row) {
  213. this.openModal = true
  214. }
  215. }
  216. }
  217. </script>