list.vue 7.9 KB

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