list.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" 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-receivingBillNo" v-model.trim="queryParam.receivingBillNo" allowClear placeholder="请输入采购入库单号"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="24">
  18. <a-form-item label="入库时间">
  19. <rangeDate ref="rangeDate" :value="auditTime" @change="dateChange" />
  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.auditState"
  27. ref="auditState"
  28. id="warehousingAuditList-auditState"
  29. code="RECEIVING_BILL_STATUS"
  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>{{ (productTotal&&productTotal.totalRecord) || 0 }}</strong> 条记录,其中待审核 <strong>{{ (productTotal&&productTotal.waitAuditRecord) || 0 }}</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: 1420, y: tableHeight }"
  61. bordered>
  62. <!-- 采购入库单号 -->
  63. <template slot="receivingBillNo" slot-scope="text, record">
  64. <span v-if="record.receivingBillNo" style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.receivingBillNo }}</span>
  65. <span v-else>--</span>
  66. </template>
  67. <!-- 操作 -->
  68. <template slot="action" slot-scope="text, record">
  69. <a-button
  70. size="small"
  71. v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT'"
  72. type="link"
  73. class="button-info"
  74. @click="handleExamine(record, 1)"
  75. id="warehousingAudit-adopt-btn">通过</a-button>
  76. <a-button
  77. size="small"
  78. v-if="record.auditState=='WAIT_PUT_WAREHOUSE_AUDIT'"
  79. type="link"
  80. class="button-warning"
  81. @click="handleExamine(record, 2)"
  82. id="warehousingAudit-unadopt-btn">不通过</a-button>
  83. <span v-if="record.auditState!='WAIT_PUT_WAREHOUSE_AUDIT'">--</span>
  84. </template>
  85. </s-table>
  86. </a-card>
  87. </template>
  88. <script>
  89. import moment from 'moment'
  90. import getDate from '@/libs/getDate'
  91. import { STable, VSelect } from '@/components'
  92. import rangeDate from '@/views/common/rangeDate.vue'
  93. import { receivingList, receivingStockInAudit, receivingCount } from '@/api/receiving'
  94. export default {
  95. components: { STable, VSelect, rangeDate },
  96. data () {
  97. return {
  98. advanced: false, // 高级搜索 展开/关闭
  99. disabled: false, // 查询、重置按钮是否可操作
  100. auditTime: [
  101. moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
  102. moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
  103. ], // 入库时间
  104. tableHeight: 0,
  105. // 查询参数
  106. queryParam: {
  107. beginDate: getDate.getThreeMonthDays().starttime,
  108. endDate: getDate.getCurrMonthDays().endtime,
  109. purchaseBillNo: '',
  110. receivingBillNo: '',
  111. auditState: undefined
  112. },
  113. // 表头
  114. columns: [
  115. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  116. { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', customRender: function (text) { return text || '--' } },
  117. { title: '采购入库单号', scopedSlots: { customRender: 'receivingBillNo' }, width: 220, align: 'center' },
  118. { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  119. { title: '入库总数量', dataIndex: 'totalPutQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  120. { title: '入库总成本', dataIndex: 'totalPutAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  121. { title: '签收入库时间', dataIndex: 'stockPutTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  122. { title: '财务入库审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  123. { title: '财务审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
  124. { title: '操作', scopedSlots: { customRender: 'action' }, width: 140, align: 'center', fixed: 'right' }
  125. ],
  126. // 加载数据方法 必须为 Promise 对象
  127. loadData: parameter => {
  128. this.disabled = true
  129. if (this.tableHeight == 0) {
  130. this.tableHeight = window.innerHeight - 370
  131. }
  132. const params = Object.assign(parameter, this.queryParam)
  133. return receivingList(params).then(res => {
  134. const data = res.data
  135. const no = (data.pageNo - 1) * data.pageSize
  136. for (var i = 0; i < data.list.length; i++) {
  137. data.list[i].no = no + i + 1
  138. }
  139. this.disabled = false
  140. this.getTotal(params)
  141. return data
  142. })
  143. },
  144. productTotal: null
  145. }
  146. },
  147. methods: {
  148. // 时间 change
  149. dateChange (date) {
  150. this.queryParam.beginDate = date[0]
  151. this.queryParam.endDate = date[1]
  152. },
  153. // 合计
  154. getTotal (param) {
  155. receivingCount(param).then(res => {
  156. if (res.status == 200 && res.data) {
  157. this.productTotal = res.data
  158. } else {
  159. this.productTotal = null
  160. }
  161. })
  162. },
  163. // 详情
  164. handleDetail (row) {
  165. this.$router.push({ path: `/financialManagement/warehousingAudit/detail/${row.receivingBillSn}` })
  166. },
  167. // 审核
  168. handleExamine (row, type) {
  169. const _this = this
  170. this.$confirm({
  171. title: '提示',
  172. content: '确定要进行' + (type == 1 ? ' 通过 ' : ' 不通过 ') + '操作吗?',
  173. centered: true,
  174. onOk () {
  175. receivingStockInAudit({ id: row.id, auditState: type == 1 ? 'FINISH' : 'PUT_WAREHOUSE_AUDIT_REJECT' }).then(res => {
  176. if (res.status == 200) {
  177. _this.$message.success(res.message)
  178. _this.$refs.table.refresh()
  179. }
  180. })
  181. }
  182. })
  183. },
  184. // 重置
  185. resetSearchForm () {
  186. this.$refs.rangeDate.resetDate(this.auditTime)
  187. this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
  188. this.queryParam.endDate = getDate.getCurrMonthDays().endtime
  189. this.queryParam.purchaseBillNo = ''
  190. this.queryParam.receivingBillNo = ''
  191. this.queryParam.auditState = undefined
  192. this.$refs.table.refresh(true)
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="less">
  198. .warehousingAuditList-wrap{
  199. .sTable{
  200. margin-top: 15px;
  201. }
  202. }
  203. </style>