list.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. <rangeDate ref="rangeDate" @change="dateChange" />
  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:10px">
  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="primary" class="button-info" @click="handleExamine(record, 1)" id="inventoryReview-adopt-btn">通过</a-button>
  66. <a-button size="small" type="primary" class="button-warning" @click="handleExamine(record, 2)" id="inventoryReview-unadopt-btn">不通过</a-button>
  67. <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="inventoryReview-detail-btn">详情</a-button>
  68. </template>
  69. </s-table>
  70. </a-card>
  71. </template>
  72. <script>
  73. import { STable, VSelect } from '@/components'
  74. import rangeDate from '@/views/common/rangeDate.vue'
  75. // import { getRoleList, getServiceList } from '@/api/manage'
  76. export default {
  77. components: { STable, VSelect, rangeDate },
  78. data () {
  79. return {
  80. disabled: false, // 查询、重置按钮是否可操作
  81. // 查询参数
  82. queryParam: {
  83. beginDate: '',
  84. endDate: ''
  85. },
  86. // 表头
  87. columns: [
  88. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  89. { title: '盘点单号', scopedSlots: { customRender: 'purchaseBillNo' }, align: 'center' },
  90. { title: '盘点产品款数', dataIndex: 'totalCategory', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  91. { title: '库存总成本', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  92. { title: '盘盈总数量', dataIndex: 'totalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  93. { title: '盘亏总数量', dataIndex: 'totalssQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  94. { title: '盘点审核时间', dataIndex: 'sauditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  95. { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  96. { title: '财务审核状态', scopedSlots: { customRender: 'auditStatus' }, width: 120, align: 'center' },
  97. { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
  98. ],
  99. // 加载数据方法 必须为 Promise 对象
  100. loadData: parameter => {
  101. this.disabled = true
  102. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  103. // const data = res.data
  104. // const no = (data.pageNo - 1) * data.pageSize
  105. // for (var i = 0; i < data.list.length; i++) {
  106. // data.list[i].no = no + i + 1
  107. // }
  108. // this.disabled = false
  109. // return data
  110. // })
  111. const _this = this
  112. return new Promise(function (resolve, reject) {
  113. const data = {
  114. pageNo: 1,
  115. pageSize: 10,
  116. list: [
  117. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  118. ],
  119. count: 10
  120. }
  121. const no = (data.pageNo - 1) * data.pageSize
  122. for (var i = 0; i < data.list.length; i++) {
  123. data.list[i].no = no + i + 1
  124. }
  125. _this.disabled = false
  126. resolve(data)
  127. })
  128. }
  129. }
  130. },
  131. methods: {
  132. // 时间 change
  133. dateChange (date) {
  134. this.queryParam.beginDate = date[0]
  135. this.queryParam.endDate = date[1]
  136. },
  137. // 详情
  138. handleDetail (row) {
  139. this.$router.push({ path: `/financialManagement/inventoryReview/detail/${row.id}` })
  140. },
  141. // 审核
  142. handleExamine (row, type) {
  143. const _this = this
  144. this.$confirm({
  145. title: '提示',
  146. content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
  147. centered: true,
  148. onOk () {
  149. // delectRolePower({
  150. // id: row.id
  151. // }).then(res => {
  152. // console.log(res, 'res1111')
  153. // if (res.status == 200) {
  154. // _this.$message.success(res.message)
  155. // _this.$refs.table.refresh()
  156. // }
  157. // })
  158. }
  159. })
  160. },
  161. // 重置
  162. resetSearchForm () {
  163. this.$refs.rangeDate.resetDate()
  164. this.queryParam.beginDate = ''
  165. this.queryParam.endDate = ''
  166. this.queryParam.orderBundleNo = ''
  167. this.queryParam.orderBundle.custMobile = ''
  168. this.queryParam.bundleName = ''
  169. this.queryParam.itemName = ''
  170. this.oldTime = undefined
  171. this.newTime = undefined
  172. this.$refs.table.refresh(true)
  173. }
  174. }
  175. }
  176. </script>
  177. <style lang="less">
  178. .inventoryReviewList-wrap{
  179. .sTable{
  180. margin-top: 15px;
  181. }
  182. }
  183. </style>