|
@@ -0,0 +1,310 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-form ref="form" :model="form" style="width: 100%;padding: 5px" :rules="rules">
|
|
|
+ <el-row>
|
|
|
+ <el-col style="padding-bottom: 10px">
|
|
|
+ <span class="card_title">新增</span>
|
|
|
+ <el-card shadow="always" style="padding: 15px 5px 5px 15px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>款项内容</span></el-col>
|
|
|
+ <el-col :span="9" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="form.contentType"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dc_data.CONTENT_TYPE"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>支付方式</span></el-col>
|
|
|
+ <el-col :span="9" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="form.paymentMethod"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dc_data.PAYMENT_METHODS"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3" class="col-txt"><span>到账日期</span></el-col>
|
|
|
+ <el-col :span="9" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.payTime"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ type="date"
|
|
|
+ placeholder="年月日"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>到账银行账号</span></el-col>
|
|
|
+ <el-col :span="9" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ v-model="bankObject"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ placeholder=""
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ @change="bankChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in bankOptions"
|
|
|
+ :key="item.value"
|
|
|
+ popper-class="statistic_base"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ :label="item.bankName + (item.bankBranchName?item.bankBranchName:'') + item.bankNumber"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3" class="col-txt"><span>到账金额</span></el-col>
|
|
|
+ <el-col :span="9" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="form.payMoney" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>备注</span></el-col>
|
|
|
+ <el-col :span="21" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2, maxRows: 100}" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>缴费凭证</span></el-col>
|
|
|
+ <el-col :span="15" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ action="/server/wx/fileController/uploadImage"
|
|
|
+ :http-request="uploadPhoto"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ multiple
|
|
|
+ :file-list="fileList"
|
|
|
+ >
|
|
|
+ <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>
|
|
|
+ <div slot="file" slot-scope="{file}" style="overflow:hidden;white-space: nowrap;text-overflow:ellipsis">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="file.name" placement="top-start">
|
|
|
+ <a :href="file.url">{{ file.name }}</a>
|
|
|
+ </el-tooltip>
|
|
|
+ <span class="el-upload-list__item-actions">
|
|
|
+ <i class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>经办时间</span></el-col>
|
|
|
+ <el-col :span="3" class="col-input"><span>{{ dateStr }}</span></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="3" class="col-txt"><span>经办人</span></el-col>
|
|
|
+ <el-col :span="3" class="col-input"><span>{{ username }}</span></el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div style="text-align: right">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmSubmit()">提 交</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Base from '@/views/base/base'
|
|
|
+import BaseData from '@/views/base/baseData'
|
|
|
+import { upload } from '@/static/utils/channel'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'AddPayment',
|
|
|
+ components: { },
|
|
|
+ mixins: [Base, BaseData],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dc_key: ['CONTENT_TYPE', 'PAYMENT_METHODS'],
|
|
|
+ form: {
|
|
|
+
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+
|
|
|
+ },
|
|
|
+ AllData: [],
|
|
|
+ loading: false,
|
|
|
+ bankOptions: [],
|
|
|
+ bankObject: '',
|
|
|
+ dateStr: '',
|
|
|
+ username: '',
|
|
|
+ isView: false,
|
|
|
+ fileList: [],
|
|
|
+ contractId: '',
|
|
|
+ houseId: '',
|
|
|
+ customerManagementId: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const myDate = new Date()
|
|
|
+ const dateStr = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate()
|
|
|
+ const username = this.$common.currUser().username
|
|
|
+ this.dateStr = dateStr
|
|
|
+ this.username = username
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData(data) {
|
|
|
+ console.log('data', data)
|
|
|
+ this.isView = data.isView
|
|
|
+ this.contractId = data.contractId
|
|
|
+ this.houseId = data.houseId
|
|
|
+ this.customerManagementId = data.customerManagementId
|
|
|
+
|
|
|
+ this.getBankOptions()
|
|
|
+ this.initDict(this.dc_key).then(res => {
|
|
|
+ if (data.id) {
|
|
|
+ this.getById(data)
|
|
|
+ } else {
|
|
|
+ this.getBankTaxRateByFloor()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getById(data) {
|
|
|
+ const postData = {
|
|
|
+ id: data.id
|
|
|
+ }
|
|
|
+ this.baseRequest('', postData).then(res => {
|
|
|
+ this.form = res.data
|
|
|
+ if (this.form.paymentVoucher) {
|
|
|
+ this.fileList = JSON.parse(this.form.paymentVoucher)
|
|
|
+ }
|
|
|
+ if (res.data.createdName) {
|
|
|
+ this.username = res.data.createdName
|
|
|
+ }
|
|
|
+ if (res.data.createdAt) {
|
|
|
+ this.dateStr = res.data.createdAt
|
|
|
+ }
|
|
|
+ this.bankObject = res.data.bankName + res.data.bankBranchName + res.data.bankNumber
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmSubmit: function() {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const soaUrl = 'add'
|
|
|
+ const extraData = {
|
|
|
+ fileList: JSON.stringify(_this.fileList),
|
|
|
+ contractId: this.contractId,
|
|
|
+ houseId: this.houseId,
|
|
|
+ customerManagementId: this.customerManagementId,
|
|
|
+ payType: '1'
|
|
|
+ }
|
|
|
+ const postData = Object.assign({}, _this.form, extraData)
|
|
|
+ this.baseRequest(soaUrl, postData).then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ _this.$message({
|
|
|
+ message: '新增成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ _this.cancel()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ _this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.$emit('cancel')
|
|
|
+ },
|
|
|
+ // 删除单个行
|
|
|
+ handleDelete(index) {
|
|
|
+ this.AllData.splice(index, 1)
|
|
|
+ },
|
|
|
+ getBankOptions() {
|
|
|
+ this.bankRequest('listAll', {}).then(res => {
|
|
|
+ this.bankOptions = res.data || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bankChange(val) {
|
|
|
+ console.log(val)
|
|
|
+ this.form.bankName = val.bankName
|
|
|
+ this.form.bankBranchName = val.bankBranchName
|
|
|
+ this.form.bankNumber = val.bankNumber
|
|
|
+ },
|
|
|
+ getBankTaxRateByFloor() {
|
|
|
+ this.fundRequest('getBankTaxRateByFloor', { contractId: this.contractId }).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.bankObject = res.data.bankFullName
|
|
|
+ this.form.bankName = res.data.bankName
|
|
|
+ this.form.bankBranchName = res.data.bankBranchName
|
|
|
+ this.form.bankNumber = res.data.bankNumber
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadPhoto: function(param) {
|
|
|
+ upload(param, true).then((res) => {
|
|
|
+ this.fileList.push(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ baseRequest(opUrl, postData) {
|
|
|
+ return this.$channel.globeRequest('PayLogController', opUrl, postData, 'project')
|
|
|
+ },
|
|
|
+ bankRequest(opUrl, postData) {
|
|
|
+ return this.$channel.globeRequest('InvoiceBankController', opUrl, postData, 'project')
|
|
|
+ },
|
|
|
+ fundRequest(opUrl, postData) {
|
|
|
+ return this.$channel.globeRequest('MaintenanceFundsManagementController', opUrl, postData, 'project')
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|