list.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <a-card size="small" :bordered="false" class="inventoryReviewList-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-input id="inventoryReviewList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入盘点单号"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="盘点审核时间">
  14. <a-range-picker v-model="queryParam.creatDate" allowClear id="inventoryReviewList-creatDate"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="24">
  18. <a-form-item label="财务审核状态">
  19. <v-select
  20. v-model="queryParam.billStatus"
  21. ref="billStatus"
  22. id="inventoryReviewList-billStatus"
  23. code="PAYMENT_TYPE"
  24. placeholder="请选择财务审核状态"
  25. allowClear></v-select>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="24">
  29. <span class="table-page-search-submitButtons">
  30. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryReviewList-refresh">查询</a-button>
  31. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="inventoryReviewList-reset">重置</a-button>
  32. </span>
  33. </a-col>
  34. </a-row>
  35. </a-form>
  36. </div>
  37. <!-- alert -->
  38. <a-alert type="info" showIcon style="margin-bottom:15px">
  39. <div slot="message">共 <strong>6</strong> 条记录,其中待审核 <strong>14</strong> 条 </div>
  40. </a-alert>
  41. <!-- 列表 -->
  42. <s-table
  43. class="sTable"
  44. ref="table"
  45. size="small"
  46. :rowKey="(record) => record.id"
  47. :columns="columns"
  48. :data="loadData"
  49. :scroll="{ x: 1300 }"
  50. bordered>
  51. <!-- 采购单号 -->
  52. <template slot="purchaseNo" slot-scope="text, record">
  53. <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
  54. </template>
  55. <!-- 采购入库单号 -->
  56. <template slot="purchaseNos" slot-scope="text, record">
  57. <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
  58. </template>
  59. <!-- 状态 -->
  60. <template slot="state" slot-scope="text, record">
  61. <span>{{ record.state == 1 ? '已启用' : '已禁用' }}</span>
  62. </template>
  63. <!-- 操作 -->
  64. <template slot="action" slot-scope="text, record">
  65. <a-button size="small" type="link" @click="handleExamine(record, 1)" id="inventoryReview-adopt-btn">通过</a-button>
  66. <a-divider type="vertical" style="margin: 0;" />
  67. <a-button size="small" type="link" @click="handleExamine(record, 2)" id="inventoryReview-unadopt-btn">不通过</a-button>
  68. <a-divider type="vertical" style="margin: 0;" />
  69. <a-button size="small" type="link" @click="handleDetail(record)" id="inventoryReview-detail-btn">详情</a-button>
  70. </template>
  71. </s-table>
  72. </a-card>
  73. </template>
  74. <script>
  75. import { STable, VSelect } from '@/components'
  76. // import { getRoleList, getServiceList } from '@/api/manage'
  77. export default {
  78. components: { STable, VSelect },
  79. data () {
  80. return {
  81. disabled: false, // 查询、重置按钮是否可操作
  82. // 查询参数
  83. queryParam: {},
  84. // 表头
  85. columns: [
  86. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  87. { title: '盘点单号', scopedSlots: { customRender: 'purchaseBillNo' }, align: 'center' },
  88. { title: '盘点产品款数', dataIndex: 'totalCategory', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  89. { title: '库存总成本', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  90. { title: '盘盈总数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  91. { title: '盘亏总数量', dataIndex: 'totalssQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  92. { title: '盘点审核时间', dataIndex: 'sauditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  93. { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  94. { title: '财务审核状态', scopedSlots: { customRender: 'auditStatus' }, width: 120, align: 'center' },
  95. { title: '操作', scopedSlots: { customRender: 'action' }, width: 190, align: 'center', fixed: 'right' }
  96. ],
  97. // 加载数据方法 必须为 Promise 对象
  98. loadData: parameter => {
  99. this.disabled = true
  100. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  101. // const data = res.data
  102. // const no = (data.pageNo - 1) * data.pageSize
  103. // for (var i = 0; i < data.list.length; i++) {
  104. // data.list[i].no = no + i + 1
  105. // }
  106. // this.disabled = false
  107. // return data
  108. // })
  109. const _this = this
  110. return new Promise(function (resolve, reject) {
  111. const data = {
  112. pageNo: 1,
  113. pageSize: 10,
  114. list: [
  115. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  116. ],
  117. count: 10
  118. }
  119. const no = (data.pageNo - 1) * data.pageSize
  120. for (var i = 0; i < data.list.length; i++) {
  121. data.list[i].no = no + i + 1
  122. }
  123. _this.disabled = false
  124. resolve(data)
  125. })
  126. }
  127. }
  128. },
  129. methods: {
  130. // 详情
  131. handleDetail (row) {
  132. this.$router.push({ path: `/financialManagement/inventoryReview/detail/${row.id}` })
  133. },
  134. // 审核
  135. handleExamine (row, type) {
  136. const _this = this
  137. this.$confirm({
  138. title: '提示',
  139. content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
  140. centered: true,
  141. onOk () {
  142. // delectRolePower({
  143. // id: row.id
  144. // }).then(res => {
  145. // console.log(res, 'res1111')
  146. // if (res.status == 200) {
  147. // _this.$message.success(res.message)
  148. // _this.$refs.table.refresh()
  149. // }
  150. // })
  151. }
  152. })
  153. },
  154. // 重置
  155. resetSearchForm () {
  156. this.queryParam.orderBundleNo = ''
  157. this.queryParam.orderBundle.custMobile = ''
  158. this.queryParam.bundleName = ''
  159. this.queryParam.itemName = ''
  160. this.oldTime = undefined
  161. this.newTime = undefined
  162. this.$refs.table.refresh(true)
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="less">
  168. .inventoryReviewList-wrap{
  169. .sTable{
  170. margin-top: 15px;
  171. }
  172. }
  173. </style>