list.vue 7.5 KB

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