|  |  |  | 
|---|
|  |  |  | <div class="main_app"> | 
|---|
|  |  |  | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" /> | 
|---|
|  |  |  | <div class="mt20"> | 
|---|
|  |  |  | <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" | 
|---|
|  |  |  | v-permissions="['business:ywpatrolline:create']">新建</el-button> | 
|---|
|  |  |  | <el-button @click="handleEdit()" v-permissions="['business:ywpatrolline:create']">导出</el-button> | 
|---|
|  |  |  | <!--      <el-button v-permissions="['business:ywpatrolline:create']">导出</el-button>--> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table v-loading="loading" :data="list" stripe> | 
|---|
|  |  |  | <el-table-column prop="" label="客户名称" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="合同编号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="序号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="账号编号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="收支类型" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="发生金额" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="收款方式" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="入账日期" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="" label="状态" min-width="100" show-overflow-tooltip> | 
|---|
|  |  |  | <template v-slot="scope"> | 
|---|
|  |  |  | <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"> | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | <el-table-column prop="customerName" label="客户名称" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="contractCode" label="合同编号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column label="房号" min-width="100" show-overflow-tooltip> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <div style="display: flex; flex-direction: column;" v-if="row.roomPathName"> | 
|---|
|  |  |  | <span v-for="(item, index) in row.roomPathName.split(';')" :key="index">{{item}}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="操作" min-width="120" fixed="right"> | 
|---|
|  |  |  | <el-table-column prop="billCode" label="账单编号" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column label="收支类型" min-width="100" show-overflow-tooltip> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <!-- <el-button type="text" @click="handleEdit(row)" icon="el-icon-edit" | 
|---|
|  |  |  | v-permissions="['business:category:update']">编辑</el-button> --> | 
|---|
|  |  |  | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" | 
|---|
|  |  |  | v-permissions="['business:category:delete']">退款</el-button> | 
|---|
|  |  |  | <span v-if="row.revenueType === 0">收入</span> | 
|---|
|  |  |  | <span v-if="row.revenueType === 1">支出</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="actReceivableFee" label="发生金额" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column label="收款方式" min-width="100" show-overflow-tooltip> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.payType === 0">现金</span> | 
|---|
|  |  |  | <span v-if="row.payType === 1">网银转账</span> | 
|---|
|  |  |  | <span v-if="row.payType === 2">POS机</span> | 
|---|
|  |  |  | <span v-if="row.payType === 3">支付宝</span> | 
|---|
|  |  |  | <span v-if="row.payType === 4">微信</span> | 
|---|
|  |  |  | <span v-if="row.payType === 5">转账支票</span> | 
|---|
|  |  |  | <span v-if="row.payType === 6">其他</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="actPayDate" label="入账日期" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="创建日期" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="realname" label="创建人" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column label="状态" min-width="100" fixed="right" show-overflow-tooltip> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-tag type="success" v-if="row.status === 0">开启</el-tag> | 
|---|
|  |  |  | <el-tag type="info" v-if="row.status === 1">关闭</el-tag> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="操作" min-width="190" fixed="right"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.details.open('收支流水详情', row.id)">查看详情</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="closeDW(row.id)" v-if="isShow(row.status, row.contractStatus)">关闭流水</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <div class="mt20"> | 
|---|
|  |  |  | <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <Edit v-if="showEdit" ref="EditRef" @success="getList" @close="showEdit = false" /> | 
|---|
|  |  |  | <!--  详情  --> | 
|---|
|  |  |  | <Details ref="details" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import QueryForm from '@/components/common/QueryForm' | 
|---|
|  |  |  | import Edit from './components/paymentsEdit.vue' | 
|---|
|  |  |  | import { companyGetList, deleteById } from '@/api/business/company' | 
|---|
|  |  |  | import Details from './components/details' | 
|---|
|  |  |  | import { fetchList, close } from '@/api/ywContractRevenue' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | components: { | 
|---|
|  |  |  | Pagination, | 
|---|
|  |  |  | QueryForm, | 
|---|
|  |  |  | Edit | 
|---|
|  |  |  | Details | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | showEdit: false, | 
|---|
|  |  |  | pagination: { | 
|---|
|  |  |  | pageSize: 10, | 
|---|
|  |  |  | page: 1, | 
|---|
|  |  |  | 
|---|
|  |  |  | queryFormConfig: { | 
|---|
|  |  |  | formItems: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'name', | 
|---|
|  |  |  | filed: 'customerName', | 
|---|
|  |  |  | type: 'input', | 
|---|
|  |  |  | label: '客户名称' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'name', | 
|---|
|  |  |  | filed: 'revenueType', | 
|---|
|  |  |  | type: 'select', | 
|---|
|  |  |  | label: '收支类型' | 
|---|
|  |  |  | label: '收支类型', | 
|---|
|  |  |  | options: [ | 
|---|
|  |  |  | { value: 0, label: '收入' }, | 
|---|
|  |  |  | { value: 1, label: '支出' } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'name', | 
|---|
|  |  |  | filed: 'payType', | 
|---|
|  |  |  | type: 'select', | 
|---|
|  |  |  | label: '收款方式' | 
|---|
|  |  |  | label: '收款方式', | 
|---|
|  |  |  | options: [ | 
|---|
|  |  |  | { value: 0, label: '现金' }, | 
|---|
|  |  |  | { value: 1, label: '网银转账' }, | 
|---|
|  |  |  | { value: 2, label: 'POS机' }, | 
|---|
|  |  |  | { value: 3, label: '支付宝' }, | 
|---|
|  |  |  | { value: 4, label: '微信' }, | 
|---|
|  |  |  | { value: 5, label: '转账支票' }, | 
|---|
|  |  |  | { value: 6, label: '其他' } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'name', | 
|---|
|  |  |  | filed: 'payDate', | 
|---|
|  |  |  | type: 'daterange', | 
|---|
|  |  |  | label: '入账日期' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | isShow (status, contractStatus) { | 
|---|
|  |  |  | if (status === 1) return false | 
|---|
|  |  |  | if (contractStatus === '3' || contractStatus === '4') return false | 
|---|
|  |  |  | return true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getList(page) { | 
|---|
|  |  |  | const { pagination, filters } = this | 
|---|
|  |  |  | let form = JSON.parse(JSON.stringify(filters)) | 
|---|
|  |  |  | if (form && form.payDate && form.payDate.length > 0) { | 
|---|
|  |  |  | form.payDateStart = form.payDate[0] | 
|---|
|  |  |  | form.payDateEnd = form.payDate[1] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | companyGetList({ | 
|---|
|  |  |  | fetchList({ | 
|---|
|  |  |  | model: { | 
|---|
|  |  |  | ...filters, | 
|---|
|  |  |  | type: 2 | 
|---|
|  |  |  | ...form | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | capacity: pagination.pageSize, | 
|---|
|  |  |  | page: page || pagination.page, | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | this.list = res.records || [] | 
|---|
|  |  |  | this.list.forEach(item => { | 
|---|
|  |  |  | item.stautsName = item.status == 0 ? '正常' : item.status == 1 ? '损坏' : '报废' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.pagination.total = res.total || 0 | 
|---|
|  |  |  | }, () => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleEdit(row) { | 
|---|
|  |  |  | this.showEdit = true | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.EditRef.isShowModal = true | 
|---|
|  |  |  | if (row && row.id) { | 
|---|
|  |  |  | this.$refs.EditRef.getDetail(row.id) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | closeDW (id) { | 
|---|
|  |  |  | this.$confirm('确认关闭此流水吗?', '提示', { | 
|---|
|  |  |  | confirmButtonText: '确定', | 
|---|
|  |  |  | cancelButtonText: '取消', | 
|---|
|  |  |  | type: 'warning' | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | close(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }).catch(() => { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleDel(row) { | 
|---|
|  |  |  | let message = `确认删除该记录吗?` | 
|---|