list.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <a-card :bordered="false" class="expenseManagementList-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="expenseManagementList-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="expenseManagementList-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="expenseManagementList-billStatus"
  23. code="PAYMENT_TYPE"
  24. placeholder="请选择费用类型"
  25. allowClear></v-select>
  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="expenseManagementList-billStatus"
  35. code="PAYMENT_TYPE"
  36. placeholder="请选择单据状态"
  37. allowClear></v-select>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-item label="结算状态">
  42. <v-select
  43. v-model="queryParam.billStatus"
  44. ref="billStatus"
  45. id="expenseManagementList-billStatus"
  46. code="PAYMENT_TYPE"
  47. placeholder="请选择结算状态"
  48. allowClear></v-select>
  49. </a-form-item>
  50. </a-col>
  51. </template>
  52. <a-col :md="6" :sm="24">
  53. <span class="table-page-search-submitButtons">
  54. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="expenseManagementList-refresh">查询</a-button>
  55. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="expenseManagementList-reset">重置</a-button>
  56. <a @click="advanced=!advanced" style="margin-left: 8px">
  57. {{ advanced ? '收起' : '展开' }}
  58. <a-icon :type="advanced ? 'up' : 'down'"/>
  59. </a>
  60. </span>
  61. </a-col>
  62. </a-row>
  63. </a-form>
  64. </div>
  65. <!-- 操作按钮 -->
  66. <div class="table-operator">
  67. <a-button id="expenseManagementList-add" type="primary" @click="handleEdit()">新增费用单</a-button>
  68. </div>
  69. <!-- alert -->
  70. <a-alert type="info" showIcon style="margin-bottom:15px">
  71. <div slot="message">共 <strong>6</strong> 条记录,金额共计 <strong>¥14</strong></div>
  72. </a-alert>
  73. <!-- 列表 -->
  74. <s-table
  75. class="sTable"
  76. ref="table"
  77. size="default"
  78. :rowKey="(record) => record.id"
  79. :columns="columns"
  80. :data="loadData"
  81. bordered>
  82. <!-- 采购单号 -->
  83. <template slot="purchaseNo" slot-scope="text, record">
  84. <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
  85. </template>
  86. <!-- 采购入库单号 -->
  87. <template slot="purchaseNos" slot-scope="text, record">
  88. <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
  89. </template>
  90. <!-- 状态 -->
  91. <template slot="state" slot-scope="text, record">
  92. <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
  93. </template>
  94. <!-- 操作 -->
  95. <template slot="action" slot-scope="text, record">
  96. <a-button size="small" type="primary" @click="handleExamine(record, 1)" id="expenseManagement-adopt-btn">通过</a-button>
  97. <a-button size="small" @click="handleExamine(record, 2)" id="expenseManagement-unadopt-btn" style="margin: 0 0 10px 8px">不通过</a-button>
  98. <a-button size="small" type="primary" @click="handleEdit(record)" id="expenseManagement-edit-btn" style="margin: 0 0 10px 8px">编辑</a-button>
  99. <a-button size="small" type="primary" @click="handleSubmit(record)" id="expenseManagement-submit-btn" style="margin: 0 0 10px 8px">提交</a-button>
  100. <a-button size="small" type="dashed" @click="handleDetail(record)" id="expenseManagement-detail-btn" style="margin: 0 0 10px 8px">详情</a-button>
  101. <a-button size="small" type="danger" @click="handleDel(record)" id="expenseManagement-del-btn" style="margin: 0 0 0 8px">删除</a-button>
  102. </template>
  103. </s-table>
  104. <!-- 详情 -->
  105. <expense-management-detail-modal :openModal="openModal" :itemId="itemId" @close="openModal=false" />
  106. </a-card>
  107. </template>
  108. <script>
  109. import { STable, VSelect } from '@/components'
  110. // import { getRoleList, getServiceList } from '@/api/manage'
  111. import expenseManagementDetailModal from './detailModal.vue'
  112. export default {
  113. components: { STable, VSelect, expenseManagementDetailModal },
  114. data () {
  115. return {
  116. disabled: false, // 查询、重置按钮是否可操作
  117. advanced: false, // 高级搜索 展开/关闭
  118. // 查询参数
  119. queryParam: {},
  120. // 表头
  121. columns: [
  122. { title: '费用单号', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
  123. { title: '创建时间', dataIndex: 'creatDates', align: 'center', customRender: function (text) { return text || '--' } },
  124. { title: '费用类型', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
  125. { title: '金额', dataIndex: 'totalPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  126. { title: '单据状态', dataIndex: 'totalP', align: 'center', customRender: function (text) { return text || '--' } },
  127. { title: '结算状态', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return text || '--' } },
  128. { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
  129. ],
  130. // 加载数据方法 必须为 Promise 对象
  131. loadData: parameter => {
  132. this.disabled = true
  133. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).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. // return data
  141. // })
  142. const _this = this
  143. return new Promise(function(resolve, reject){
  144. const data = {
  145. pageNo: 1,
  146. pageSize: 10,
  147. list: [
  148. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  149. ],
  150. count: 10
  151. }
  152. const no = (data.pageNo - 1) * data.pageSize
  153. for (var i = 0; i < data.list.length; i++) {
  154. data.list[i].no = no + i + 1
  155. }
  156. _this.disabled = false
  157. resolve(data)
  158. })
  159. },
  160. openModal: false, // 查看详情 弹框
  161. itemId: '', // 当前id
  162. }
  163. },
  164. methods: {
  165. // 新增/编辑
  166. handleEdit(row){
  167. this.$router.push({ path: `/financialManagement/expenseManagement/add`})
  168. },
  169. // 提交
  170. handleSubmit(row){
  171. const _this = this
  172. _this.itemId = item.id
  173. _this.$confirm({
  174. title: '提示',
  175. content: '确定要进行提交操作吗?',
  176. centered: true,
  177. onOk () {
  178. // dealerProductTypeDel({ id: _this.itemId }).then(res => {
  179. // if (res.status == 200) {
  180. // _this.$message.success(res.message)
  181. // _this.$refs.table.refresh()
  182. // }
  183. // })
  184. }
  185. })
  186. },
  187. // 详情
  188. handleDetail(row){
  189. this.itemId = row.id
  190. this.openModal = true
  191. // this.$router.push({ path: `/financialManagement/expenseManagement/detail/${row.id}`})
  192. },
  193. // 审核
  194. handleExamine(row, type){
  195. const _this = this
  196. this.$confirm({
  197. title: '提示',
  198. content: '操作后不可恢复,确定要进行'+ (type==1 ? ' 通过 ' : ' 不通过 ') +'操作吗?',
  199. okText: '确定',
  200. cancelText: '取消',
  201. centered: true,
  202. onOk () {
  203. // delectRolePower({
  204. // id: row.id
  205. // }).then(res => {
  206. // console.log(res, 'res1111')
  207. // if (res.status == 200) {
  208. // _this.$message.success(res.message)
  209. // _this.$refs.table.refresh()
  210. // }
  211. // })
  212. }
  213. })
  214. },
  215. // 删除
  216. handleDel (row) {
  217. const _this = this
  218. _this.itemId = row.id
  219. _this.$confirm({
  220. title: '提示',
  221. content: '删除后原数据不可恢复,是否删除?',
  222. centered: true,
  223. onOk () {
  224. // dealerProductTypeDel({ id: _this.itemId }).then(res => {
  225. // if (res.status == 200) {
  226. // _this.$message.success(res.message)
  227. // _this.$refs.table.refresh()
  228. // }
  229. // })
  230. }
  231. })
  232. },
  233. // 重置
  234. resetSearchForm () {
  235. this.queryParam.orderBundleNo = ''
  236. this.queryParam.orderBundle.custMobile = ''
  237. this.queryParam.bundleName = ''
  238. this.queryParam.itemName = ''
  239. this.oldTime = undefined
  240. this.newTime = undefined
  241. this.$refs.table.refresh(true)
  242. },
  243. }
  244. }
  245. </script>
  246. <style lang="less">
  247. .expenseManagementList-wrap{
  248. .sTable{
  249. margin-top: 15px;
  250. }
  251. }
  252. </style>