<template>
|
<GlobalWindow width="100%" :title="title" :visible.sync="visible" :confirm-working="isWorking" @close="close"
|
@confirm="confirm">
|
<div class="main">
|
<div class="main_content">
|
<el-form :model="form" label-position="top" ref="form" :rules="rules">
|
<div class="head">
|
<div class="m_title">流水信息</div>
|
</div>
|
<div class="list">
|
<el-form-item label="关联合同" required>
|
<el-input v-model="form.contractCode" disabled placeholder="请输入" v-trim />
|
</el-form-item>
|
<el-form-item label="费用类型" required>
|
<el-input v-model="form.costTypeName" disabled placeholder="请输入" v-trim />
|
</el-form-item>
|
<el-form-item label="计费周期" required>
|
<el-input v-model="form.date" disabled placeholder="请输入" v-trim />
|
</el-form-item>
|
<el-form-item :label="`应${form.needReceivableFeeCopy > 0 ? '收' : '付'}金额`" required>
|
<el-input v-model="form.receivableFee" disabled placeholder="请输入" v-trim />
|
</el-form-item>
|
<el-form-item :label="`实${form.needReceivableFeeCopy > 0 ? '收' : '付'}金额`" prop="actReceivableFee">
|
<el-input v-model="form.actReceivableFee" placeholder="请输入" v-trim />
|
</el-form-item>
|
<el-form-item label="入账日期" prop="actPayDate">
|
<el-date-picker type="date" v-model="form.actPayDate" value-format="yyyy-MM-dd" placeholder="请选择" />
|
</el-form-item>
|
<el-form-item label="收款方式" prop="payType">
|
<el-select v-model="form.payType" placeholder="请选择">
|
<el-option label="现金" :value="1"></el-option>
|
<el-option label="网银转账" :value="2"></el-option>
|
<el-option label="POS机" :value="3"></el-option>
|
<el-option label="支付宝" :value="4"></el-option>
|
<el-option label="微信" :value="5"></el-option>
|
<el-option label="转账支票" :value="6"></el-option>
|
<el-option label="其它方式" :value="7"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="所属公司" prop="companyName">
|
<el-input disabled v-model="form.companyName" placeholder="请输入" />
|
</el-form-item>
|
<el-form-item label="收支账户" prop="accountId">
|
<el-select v-model="form.accountId" placeholder="请选择" clearable>
|
<el-option v-for="item in agentList" :value="item.id" :label="item.title"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="备注" prop="remark" style="width: 100%;">
|
<el-input type="textarea" :rows="6" v-model="form.remark" placeholder="请输入" />
|
</el-form-item>
|
</div>
|
</el-form>
|
</div>
|
</div>
|
<div class="file_wrap">
|
<div class="head">
|
<div>账单附件</div>
|
<el-upload class="upload-demo" :show-file-list="false" :data="uploadData" :action="uploadImgUrl"
|
:on-success="uploadAvatarSuccess" :before-upload="beforeUpload" :on-error="uploadError">
|
<el-button icon="el-icon-plus" plain>添加附件</el-button>
|
</el-upload>
|
</div>
|
<el-table :data="form.multifileList" stripe>
|
<el-table-column prop="name" label="附件名称" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="userName" label="操作人" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="createTime" label="操作时间" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column label="操作" align="center" min-width="100">
|
<template slot-scope="{ row }">
|
<span class="cu red" @click="dele(row.imgaddr)">删除</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</GlobalWindow>
|
</template>
|
|
<script>
|
import GlobalWindow from '@/components/common/GlobalWindow'
|
import BaseOpera from '@/components/base/BaseOpera'
|
import { ywAccountList } from '@/api/bill'
|
import { create } from '@/api/ywContractRevenue'
|
import { Message, Loading } from 'element-ui'
|
import { mapState } from 'vuex'
|
export default {
|
name: "flowingWater",
|
components: {
|
GlobalWindow
|
},
|
computed: {
|
...mapState(['userInfo'])
|
},
|
extends: BaseOpera,
|
data() {
|
return {
|
form: {
|
billId: '',
|
billType: '',
|
costType: '',
|
contractCode: '',
|
contractId: '',
|
startDate: '',
|
endDate: '',
|
receivableFee: '',
|
date: '',
|
companyId: '',
|
actReceivableFee: '',
|
actPayDate: '',
|
payType: '',
|
companyName: '',
|
remark: '',
|
accountId: '',
|
multifileList: [],
|
costTypeName: '',
|
needReceivableFeeCopy: ''
|
},
|
rules: {
|
receivableFee: [
|
{ required: true, message: '请输入', trigger: 'blur' }
|
],
|
actPayDate: [
|
{ required: true, message: '请选择', trigger: 'blur' }
|
],
|
payType: [
|
{ required: true, message: '请选择', trigger: 'blur' }
|
],
|
accountId: [
|
{ required: true, message: '请选择', trigger: 'blur' }
|
]
|
},
|
loadingInstance: null,
|
uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
|
uploadData: {
|
folder: 'YW_CONTRACT_BILL'
|
},
|
agentList: []
|
}
|
},
|
methods: {
|
confirm () {
|
this.$refs.form.validate((valid) => {
|
if (!valid) return
|
this.isWorking = true
|
create(this.form)
|
.then(() => {
|
this.visible = false
|
this.$tip.apiSuccess('创建成功')
|
this.$emit('success')
|
this.$emit('refresh')
|
})
|
.finally(() => {
|
this.isWorking = false
|
})
|
})
|
},
|
handleRent() {
|
this.$refs.MemberSearchRef.openModal()
|
},
|
houseChange(e) {
|
console.log(e)
|
console.log(this.value)
|
},
|
getDates (companyId) {
|
ywAccountList({
|
companyId,
|
isdeleted: 0,
|
status: 0
|
}).then(res => {
|
this.agentList = res
|
})
|
},
|
dele (imgaddr) {
|
this.form.multifileList.forEach((item, index) => {
|
if (imgaddr === item.imgaddr) {
|
this.form.multifileList.splice(index, 1)
|
}
|
})
|
},
|
beforeUpload(file) {
|
this.loadingInstance = Loading.service({
|
lock: true,
|
text: 'Loading',
|
spinner: 'el-icon-loading',
|
background: 'rgba(0, 0, 0, 0.7)'
|
})
|
},
|
uploadError() {
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
if (this.loadingInstance) {
|
this.loadingInstance.close()
|
}
|
})
|
},
|
getDay () {
|
const now = new Date()
|
const year = now.getFullYear()
|
const month = now.getMonth() + 1 // 加1使其从1开始
|
const day = now.getDate()
|
const hours = now.getHours()
|
const minutes = now.getMinutes()
|
const seconds = now.getSeconds()
|
return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
},
|
uploadAvatarSuccess(file) {
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
if (this.loadingInstance) {
|
this.loadingInstance.close()
|
}
|
})
|
const item = file.data[0]
|
this.form.multifileList.push({ ...item, fileurl: item.imgaddr, name: item.originname, userName: this.userInfo.realname, createTime: this.getDay() })
|
},
|
close() {
|
this.$emit('close')
|
},
|
open(title, target) {
|
this.title = title
|
this.visible = true
|
this.$nextTick(() => {
|
this.$refs.form.resetFields();
|
for (const key in this.form) {
|
this.form[key] = target[key]
|
}
|
})
|
this.getDates(target.companyId)
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '@/assets/style/variables.scss';
|
|
|
.cost_tabs {
|
justify-content: flex-start;
|
border: none;
|
|
.tab {
|
height: 36px;
|
line-height: 36px;
|
font-size: 14px;
|
}
|
}
|
|
.main {
|
display: flex;
|
margin-bottom: 20px;
|
|
.main_content {
|
flex: 1;
|
margin-right: 20px;
|
|
.head {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
|
.tabs {
|
display: flex;
|
margin-bottom: 20px;
|
display: flex;
|
justify-content: center;
|
|
.tab {
|
height: 14px;
|
line-height: 14px;
|
cursor: pointer;
|
border: 1px solid #ebebeb;
|
padding: 12px 24px;
|
}
|
|
.active {
|
font-weight: 500;
|
color: $primary-color;
|
border: 1px solid $primary-color;
|
}
|
}
|
}
|
|
.list {
|
display: flex;
|
flex-wrap: wrap;
|
|
.el-form-item {
|
width: 33.33%;
|
box-sizing: border-box;
|
padding: 0 12px;
|
}
|
}
|
}
|
|
.main_house {
|
width: 320px;
|
padding: 24px 12px;
|
border: 1px solid #c3c6cd;
|
border-radius: 2px;
|
|
.title {
|
font-size: 16px;
|
font-weight: 500;
|
margin-bottom: 30px;
|
}
|
}
|
|
}
|
|
.total {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
height: 32px;
|
background-color: #e7e9f5;
|
|
span {
|
width: 160px;
|
text-align: center;
|
}
|
}
|
|
.file_wrap {
|
|
.head {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
}
|
|
.m_title {
|
font-weight: 500;
|
font-size: 14px;
|
margin-bottom: 15px;
|
margin-top: 10px;
|
}
|
</style>
|