list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <a-card :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" 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="default"
  46. :rowKey="(record) => record.id"
  47. :columns="columns"
  48. :data="loadData"
  49. bordered>
  50. <!-- 采购单号 -->
  51. <template slot="purchaseNo" slot-scope="text, record">
  52. <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
  53. </template>
  54. <!-- 采购入库单号 -->
  55. <template slot="purchaseNos" slot-scope="text, record">
  56. <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
  57. </template>
  58. <!-- 状态 -->
  59. <template slot="state" slot-scope="text, record">
  60. <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
  61. </template>
  62. <!-- 操作 -->
  63. <template slot="action" slot-scope="text, record">
  64. <a-button size="small" type="primary" @click="handleExamine(record, 1)" id="inventoryReview-adopt-btn">通过</a-button>
  65. <a-button size="small" @click="handleExamine(record, 2)" id="inventoryReview-unadopt-btn" style="margin: 0 0 10px 8px">不通过</a-button>
  66. <a-button size="small" type="dashed" @click="handleDetail(record)" id="inventoryReview-detail-btn" style="margin: 0 0 10px 8px">详情</a-button>
  67. </template>
  68. </s-table>
  69. </a-card>
  70. </template>
  71. <script>
  72. import { STable, VSelect } from '@/components'
  73. // import { getRoleList, getServiceList } from '@/api/manage'
  74. export default {
  75. components: { STable, VSelect },
  76. data () {
  77. return {
  78. disabled: false, // 查询、重置按钮是否可操作
  79. // 查询参数
  80. queryParam: {},
  81. // 表头
  82. columns: [
  83. { title: '盘点单号', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
  84. { title: '盘点产品款数', dataIndex: 'totalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  85. { title: '库存总成本', dataIndex: 'totalPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  86. { title: '盘盈总数量', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  87. { title: '盘亏总数量', dataIndex: 'totaslNums', align: 'center' , customRender: function (text) { return ((text || text == 0) ? text : '--') }},
  88. { title: '盘点审核时间', dataIndex: 'creatDates', align: 'center', customRender: function (text) { return text || '--' } },
  89. { title: '财务审核时间', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
  90. { title: '财务审核状态', dataIndex: 'payType', align: 'center', customRender: function (text) { return text || '--' } },
  91. { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
  92. ],
  93. // 加载数据方法 必须为 Promise 对象
  94. loadData: parameter => {
  95. this.disabled = true
  96. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  97. // const data = res.data
  98. // const no = (data.pageNo - 1) * data.pageSize
  99. // for (var i = 0; i < data.list.length; i++) {
  100. // data.list[i].no = no + i + 1
  101. // }
  102. // this.disabled = false
  103. // return data
  104. // })
  105. const _this = this
  106. return new Promise(function(resolve, reject){
  107. const data = {
  108. pageNo: 1,
  109. pageSize: 10,
  110. list: [
  111. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  112. ],
  113. count: 10
  114. }
  115. const no = (data.pageNo - 1) * data.pageSize
  116. for (var i = 0; i < data.list.length; i++) {
  117. data.list[i].no = no + i + 1
  118. }
  119. _this.disabled = false
  120. resolve(data)
  121. })
  122. },
  123. }
  124. },
  125. methods: {
  126. // 详情
  127. handleDetail(row){
  128. this.$router.push({ path: `/financialManagement/inventoryReview/detail/${row.id}`})
  129. },
  130. // 审核
  131. handleExamine(row, type){
  132. const _this = this
  133. this.$confirm({
  134. title: '提示',
  135. content: '操作后不可恢复,确定要进行'+ (type==1 ? ' 通过 ' : ' 不通过 ') +'操作吗?',
  136. okText: '确定',
  137. cancelText: '取消',
  138. centered: true,
  139. onOk () {
  140. // delectRolePower({
  141. // id: row.id
  142. // }).then(res => {
  143. // console.log(res, 'res1111')
  144. // if (res.status == 200) {
  145. // _this.$message.success(res.message)
  146. // _this.$refs.table.refresh()
  147. // }
  148. // })
  149. }
  150. })
  151. },
  152. // 重置
  153. resetSearchForm () {
  154. this.queryParam.orderBundleNo = ''
  155. this.queryParam.orderBundle.custMobile = ''
  156. this.queryParam.bundleName = ''
  157. this.queryParam.itemName = ''
  158. this.oldTime = undefined
  159. this.newTime = undefined
  160. this.$refs.table.refresh(true)
  161. },
  162. }
  163. }
  164. </script>
  165. <style lang="less">
  166. .inventoryReviewList-wrap{
  167. .sTable{
  168. margin-top: 15px;
  169. }
  170. }
  171. </style>