|
@@ -6,23 +6,25 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="费用单号">
|
|
<a-form-item label="费用单号">
|
|
- <a-input id="expenseManagementList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入费用单号"/>
|
|
|
|
|
|
+ <a-input id="expenseManagementList-accountExpensesNo" v-model.trim="queryParam.accountExpensesNo" allowClear placeholder="请输入费用单号"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="创建时间">
|
|
<a-form-item label="创建时间">
|
|
- <a-range-picker v-model="queryParam.creatDate" id="expenseManagementList-creatDate"/>
|
|
|
|
|
|
+ <a-range-picker v-model="createDate" id="expenseManagementList-creatDate"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="费用类型">
|
|
<a-form-item label="费用类型">
|
|
- <v-select
|
|
|
|
- v-model="queryParam.billStatus"
|
|
|
|
- ref="billStatus"
|
|
|
|
- id="expenseManagementList-billStatus"
|
|
|
|
- code="PAYMENT_TYPE"
|
|
|
|
|
|
+ <a-cascader
|
|
|
|
+ @change="changeCostType"
|
|
|
|
+ change-on-select
|
|
|
|
+ v-model="costType"
|
|
|
|
+ :options="costTypeList"
|
|
|
|
+ :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
|
|
|
|
+ id="productInfoList-costType"
|
|
placeholder="请选择费用类型"
|
|
placeholder="请选择费用类型"
|
|
- allowClear></v-select>
|
|
|
|
|
|
+ allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
@@ -32,7 +34,7 @@
|
|
v-model="queryParam.billStatus"
|
|
v-model="queryParam.billStatus"
|
|
ref="billStatus"
|
|
ref="billStatus"
|
|
id="expenseManagementList-billStatus"
|
|
id="expenseManagementList-billStatus"
|
|
- code="PAYMENT_TYPE"
|
|
|
|
|
|
+ code="BILL_STATUS"
|
|
placeholder="请选择单据状态"
|
|
placeholder="请选择单据状态"
|
|
allowClear></v-select>
|
|
allowClear></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -40,10 +42,10 @@
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="结算状态">
|
|
<a-form-item label="结算状态">
|
|
<v-select
|
|
<v-select
|
|
- v-model="queryParam.billStatus"
|
|
|
|
|
|
+ v-model="queryParam.settleState"
|
|
ref="billStatus"
|
|
ref="billStatus"
|
|
id="expenseManagementList-billStatus"
|
|
id="expenseManagementList-billStatus"
|
|
- code="PAYMENT_TYPE"
|
|
|
|
|
|
+ code="FINANCIAL_STATUS"
|
|
placeholder="请选择结算状态"
|
|
placeholder="请选择结算状态"
|
|
allowClear></v-select>
|
|
allowClear></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -80,14 +82,6 @@
|
|
:data="loadData"
|
|
:data="loadData"
|
|
:scroll="{ x: 1120 }"
|
|
:scroll="{ x: 1120 }"
|
|
bordered>
|
|
bordered>
|
|
- <!-- 采购单号 -->
|
|
|
|
- <template slot="purchaseNo" slot-scope="text, record">
|
|
|
|
- <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
|
|
|
|
- </template>
|
|
|
|
- <!-- 采购入库单号 -->
|
|
|
|
- <template slot="purchaseNos" slot-scope="text, record">
|
|
|
|
- <span style="color: #ed1c24;cursor: pointer;">{{ record.purchaseNo }}</span>
|
|
|
|
- </template>
|
|
|
|
<!-- 状态 -->
|
|
<!-- 状态 -->
|
|
<template slot="state" slot-scope="text, record">
|
|
<template slot="state" slot-scope="text, record">
|
|
<span>{{ record.state == 1 ? '已启用' : '已禁用' }}</span>
|
|
<span>{{ record.state == 1 ? '已启用' : '已禁用' }}</span>
|
|
@@ -109,55 +103,60 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-// import { getRoleList, getServiceList } from '@/api/manage'
|
|
|
|
|
|
+import { settleExpenseQuery, delExpense } from '@/api/settleExpense'
|
|
|
|
+import { costTypeAllQuery } from '@/api/costType'
|
|
import expenseManagementDetailModal from './detailModal.vue'
|
|
import expenseManagementDetailModal from './detailModal.vue'
|
|
|
|
+import moment from 'moment'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, expenseManagementDetailModal },
|
|
components: { STable, VSelect, expenseManagementDetailModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
|
+ costTypeList: [], // 费用类型
|
|
|
|
+ costType: [],
|
|
|
|
+ createDate: [],
|
|
// 查询参数
|
|
// 查询参数
|
|
- queryParam: {},
|
|
|
|
|
|
+ queryParam: {
|
|
|
|
+ accountExpensesNo: '',
|
|
|
|
+ expensesTypeSn: '',
|
|
|
|
+ expensesTypeSn1: '',
|
|
|
|
+ expensesTypeSn2: '',
|
|
|
|
+ billStatus: '',
|
|
|
|
+ settleState: '',
|
|
|
|
+ beginDate: '',
|
|
|
|
+ endDate: ''
|
|
|
|
+ },
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '费用单号', scopedSlots: { customRender: 'purchaseNo' }, width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '创建时间', dataIndex: 'creatDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '费用单号', dataIndex: 'accountExpensesSn', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '费用类型', dataIndex: 'name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '费用类型', dataIndex: 'name', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '单据状态', scopedSlots: { customRender: 'auditStatus' }, width: 110, align: 'center' },
|
|
{ title: '单据状态', scopedSlots: { customRender: 'auditStatus' }, width: 110, align: 'center' },
|
|
- { title: '结算状态', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
|
|
|
|
|
|
+ { title: '结算状态', dataIndex: 'settleState', width: 110, align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 450, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 450, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
|
|
|
|
- // const data = res.data
|
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
|
- // }
|
|
|
|
- // this.disabled = false
|
|
|
|
- // return data
|
|
|
|
- // })
|
|
|
|
- const _this = this
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- const data = {
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- list: [
|
|
|
|
- { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
|
|
|
|
- ],
|
|
|
|
- count: 10
|
|
|
|
- }
|
|
|
|
|
|
+ if (this.createDate.length > 0) {
|
|
|
|
+ this.queryParam.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
|
|
|
|
+ this.queryParam.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')
|
|
|
|
+ }
|
|
|
|
+ return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
+ const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
- _this.disabled = false
|
|
|
|
- resolve(data)
|
|
|
|
|
|
+ this.disabled = false
|
|
|
|
+ // 费用类型
|
|
|
|
+ if (this.costTypeList.length == 0) {
|
|
|
|
+ this.getCostTypeList()
|
|
|
|
+ }
|
|
|
|
+ return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
openModal: false, // 查看详情 弹框
|
|
openModal: false, // 查看详情 弹框
|
|
@@ -165,6 +164,32 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 递归函数
|
|
|
|
+ recursionFun (data) {
|
|
|
|
+ if (data) {
|
|
|
|
+ data.map((item, index) => {
|
|
|
|
+ if (item.children && item.children.length == 0) {
|
|
|
|
+ delete item.children
|
|
|
|
+ } else {
|
|
|
|
+ this.recursionFun(item.children)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取费用类型数据
|
|
|
|
+ getCostTypeList () {
|
|
|
|
+ costTypeAllQuery({}).then(res => {
|
|
|
|
+ // 递归去除空children
|
|
|
|
+ this.recursionFun(res.data)
|
|
|
|
+ this.costTypeList = res.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 费用类型 change
|
|
|
|
+ changeCostType (val, opt) {
|
|
|
|
+ this.queryParam.expensesTypeSn = val[0] ? val[0] : ''
|
|
|
|
+ this.queryParam.expensesTypeSn1 = val[1] ? val[1] : ''
|
|
|
|
+ this.queryParam.expensesTypeSn2 = val[2] ? val[2] : ''
|
|
|
|
+ },
|
|
// 新增/编辑
|
|
// 新增/编辑
|
|
handleEdit (row) {
|
|
handleEdit (row) {
|
|
this.$router.push({ path: `/financialManagement/expenseManagement/add` })
|
|
this.$router.push({ path: `/financialManagement/expenseManagement/add` })
|
|
@@ -222,23 +247,27 @@ export default {
|
|
content: '删除后原数据不可恢复,是否删除?',
|
|
content: '删除后原数据不可恢复,是否删除?',
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
- // dealerProductTypeDel({ id: _this.itemId }).then(res => {
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // _this.$message.success(res.message)
|
|
|
|
- // _this.$refs.table.refresh()
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ delExpense({ id: _this.itemId }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
|
- this.queryParam.bundleName = ''
|
|
|
|
- this.queryParam.itemName = ''
|
|
|
|
- this.oldTime = undefined
|
|
|
|
- this.newTime = undefined
|
|
|
|
|
|
+ this.queryParam.accountExpensesNo = ''
|
|
|
|
+ this.queryParam.expensesTypeSn = ''
|
|
|
|
+ this.queryParam.expensesTypeSn1 = ''
|
|
|
|
+ this.queryParam.expensesTypeSn2 = ''
|
|
|
|
+ this.queryParam.billStatus = ''
|
|
|
|
+ this.queryParam.settleState = ''
|
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
|
+ this.queryParam.endDate = ''
|
|
|
|
+ this.costType = []
|
|
|
|
+ this.createDate = []
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
}
|
|
}
|
|
}
|
|
}
|