list.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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
  20. style="width:100%"
  21. id="warehousingAuditList-creatDate"
  22. :disabledDate="disabledDate"
  23. v-model="createDate"
  24. :format="dateFormat"
  25. :placeholder="['开始时间', '结束时间']" />
  26. </a-form-item>
  27. </a-col>
  28. <template v-if="advanced">
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="财务审核状态">
  31. <v-select
  32. v-model="queryParam.billStatus"
  33. ref="billStatus"
  34. id="warehousingAuditList-billStatus"
  35. code="PAYMENT_TYPE"
  36. placeholder="请选择财务审核状态"
  37. allowClear></v-select>
  38. </a-form-item>
  39. </a-col>
  40. </template>
  41. <a-col :md="6" :sm="24">
  42. <span class="table-page-search-submitButtons">
  43. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingAuditList-refresh">查询</a-button>
  44. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="warehousingAuditList-reset">重置</a-button>
  45. <a @click="advanced=!advanced" style="margin-left: 8px">
  46. {{ advanced ? '收起' : '展开' }}
  47. <a-icon :type="advanced ? 'up' : 'down'"/>
  48. </a>
  49. </span>
  50. </a-col>
  51. </a-row>
  52. </a-form>
  53. </div>
  54. <!-- alert -->
  55. <a-alert type="info" showIcon style="margin-bottom:15px">
  56. <div slot="message">共 <strong>6</strong> 条记录,其中待审核 <strong>14</strong> 条 </div>
  57. </a-alert>
  58. <!-- 列表 -->
  59. <s-table
  60. class="sTable"
  61. ref="table"
  62. size="default"
  63. :rowKey="(record) => record.id"
  64. :columns="columns"
  65. :data="loadData"
  66. :scroll="{ x: 1460 }"
  67. bordered>
  68. <!-- 采购单号 -->
  69. <template slot="purchaseBillNo" slot-scope="text, record">
  70. <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseBillNo }}</span>
  71. </template>
  72. <!-- 采购入库单号 -->
  73. <template slot="purchaseNos" slot-scope="text, record">
  74. <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
  75. </template>
  76. <!-- 操作 -->
  77. <template slot="action" slot-scope="text, record">
  78. <a-button size="small" type="link" class="button-info" @click="handleExamine(record, 1)" id="warehousingAudit-adopt-btn">通过</a-button>
  79. <a-button size="small" type="link" class="button-warning" @click="handleExamine(record, 2)" id="warehousingAudit-unadopt-btn">不通过</a-button>
  80. <a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="warehousingAudit-detail-btn">详情</a-button>
  81. </template>
  82. </s-table>
  83. </a-card>
  84. </template>
  85. <script>
  86. import moment from 'moment'
  87. import { STable, VSelect } from '@/components'
  88. import getDate from '@/libs/getDate'
  89. import { stockPutList } from '@/api/stockPut'
  90. export default {
  91. components: { STable, VSelect },
  92. data () {
  93. return {
  94. advanced: false, // 高级搜索 展开/关闭
  95. disabled: false, // 查询、重置按钮是否可操作
  96. createDate: [
  97. moment(getDate.getLastThreeMonthDays().starttime, this.dateFormat),
  98. moment(getDate.getLastThreeMonthDays().endtime, this.dateFormat)
  99. ], // 创建时间
  100. dateFormat: 'YYYY-MM-DD',
  101. tableHeight: 0,
  102. // 查询参数
  103. queryParam: {},
  104. // 表头
  105. columns: [
  106. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  107. { title: '采购单号', dataIndex: 'putBizNo', align: 'center' },
  108. { title: '采购入库单号', scopedSlots: { customRender: 'purchaseNos' }, width: 220, align: 'center' },
  109. { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  110. { title: '入库总数量', dataIndex: 'productTotalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  111. { title: '入库总成本', dataIndex: 'productTotalCost', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  112. { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  113. { title: '财务审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  114. { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center' },
  115. { title: '操作', scopedSlots: { customRender: 'action' }, width: 180, align: 'center', fixed: 'right' }
  116. ],
  117. // 加载数据方法 必须为 Promise 对象
  118. loadData: parameter => {
  119. this.disabled = true
  120. if (this.tableHeight == 0) {
  121. this.tableHeight = window.innerHeight - 440
  122. }
  123. // 创建时间
  124. if (this.createDate && this.createDate.length > 0) {
  125. this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
  126. this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
  127. } else {
  128. this.queryParam.beginDate = undefined
  129. this.queryParam.endDate = undefined
  130. }
  131. return stockPutList(Object.assign(parameter, this.queryParam)).then(res => {
  132. const data = res.data
  133. const no = (data.pageNo - 1) * data.pageSize
  134. for (var i = 0; i < data.list.length; i++) {
  135. data.list[i].no = no + i + 1
  136. }
  137. this.disabled = false
  138. return data
  139. })
  140. }
  141. }
  142. },
  143. methods: {
  144. // 不可选日期
  145. disabledDate (date, dateStrings) {
  146. return date && date.valueOf() > Date.now()
  147. },
  148. // 详情
  149. handleDetail (row) {
  150. this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.id}` })
  151. },
  152. // 审核
  153. handleExamine (row, type) {
  154. const _this = this
  155. this.$confirm({
  156. title: '提示',
  157. content: '操作后不可恢复,确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
  158. centered: true,
  159. onOk () {
  160. // delectRolePower({
  161. // id: row.id
  162. // }).then(res => {
  163. // console.log(res, 'res1111')
  164. // if (res.status == 200) {
  165. // _this.$message.success(res.message)
  166. // _this.$refs.table.refresh()
  167. // }
  168. // })
  169. }
  170. })
  171. },
  172. // 重置
  173. resetSearchForm () {
  174. this.queryParam.orderBundleNo = ''
  175. this.queryParam.orderBundle.custMobile = ''
  176. this.queryParam.bundleName = ''
  177. this.queryParam.itemName = ''
  178. this.oldTime = undefined
  179. this.newTime = undefined
  180. this.$refs.table.refresh(true)
  181. }
  182. }
  183. }
  184. </script>
  185. <style lang="less">
  186. .warehousingAuditList-wrap{
  187. .sTable{
  188. margin-top: 15px;
  189. }
  190. }
  191. </style>