list.vue 8.8 KB

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