From c9ad1f34a86e54b1c690c623ba661cd4131a3d71 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 28 十一月 2024 18:43:32 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei

---
 admin/src/views/finance/components/bullEditFu.vue |  383 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 383 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/finance/components/bullEditFu.vue b/admin/src/views/finance/components/bullEditFu.vue
new file mode 100644
index 0000000..82f2833
--- /dev/null
+++ b/admin/src/views/finance/components/bullEditFu.vue
@@ -0,0 +1,383 @@
+<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="鍏宠仈鍚堝悓" prop="contractId">
+                            <el-select v-model="form.contractId" @change="changeContract" placeholder="璇烽�夋嫨">
+                                <el-option v-for="(item, index) in contract" :key="index" :value="item.id" :label="item.code"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="浠樻鏂�" prop="renterName">
+                            <el-input v-model="form.renterName" disabled placeholder="璇疯緭鍏ュ簲鏀堕噾棰�" v-trim />
+                        </el-form-item>
+                        <el-form-item label="鎴挎簮" prop="ywContractRoomList">
+                            <el-select v-model="form.ywContractRoomList" multiple placeholder="璇烽�夋嫨">
+                                <el-option
+                                    v-for="(item, index) in houseList"
+                                    :key="index"
+                                    :value="item.id"
+                                    :label="item.projectName + item.buildingName + item.floorName + item.roomName" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="璐圭敤绫诲瀷" prop="costType">
+                            <el-select v-model="form.costType" placeholder="璇烽�夋嫨">
+                                <el-option :value="0" label="绉熻祦璐�"></el-option>
+                                <el-option :value="1" label="鐗╀笟璐�"></el-option>
+                                <el-option :value="2" label="绉熻祦鎶奸噾"></el-option>
+                                <el-option :value="3" label="鐗╀笟璇侀噾"></el-option>
+                                <el-option :value="4" label="姘寸數璐�"></el-option>
+                                <el-option :value="5" label="鏉傞」璐�"></el-option>
+                                <el-option :value="6" label="鍏朵粬"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="璁¤垂鍛ㄦ湡" prop="date">
+                            <el-date-picker
+                                type="daterange"
+                                range-separator="鑷�"
+                                v-model="form.date"
+                                @change="changeDate"
+                                start-placeholder="寮�濮嬫棩鏈�"
+                                end-placeholder="缁撴潫鏃ユ湡"
+                                value-format="yyyy-MM-dd"
+                                placeholder="璇烽�夋嫨" />
+                        </el-form-item>
+                        <el-form-item label="搴斾粯閲戦" prop="totleFee">
+                            <el-input v-model="form.totleFee" placeholder="璇疯緭鍏ュ簲鏀堕噾棰�" v-trim />
+                        </el-form-item>
+                        <el-form-item label="搴斾粯鏃ユ湡" prop="planPayDate">
+                            <el-date-picker type="date" v-model="form.planPayDate" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
+                        </el-form-item>
+                        <el-form-item label="鎵�灞炲叕鍙�" prop="companyId">
+                            <el-select v-model="form.companyId" placeholder="璇烽�夋嫨">
+                                <el-option
+                                    v-for="(item, index) in comparyList"
+                                    :key="index"
+                                    :value="item.id"
+                                    :label="item.name" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item style="width: 100%;" label="璐﹀崟澶囨敞" prop="remark">
+                            <el-input type="textarea" :rows="5" 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="originname" 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 { rules } from './config'
+  import { create } from '@/api/bill'
+  import { list as listAll } from '@/api/contract'
+  import { companyList } from '@/api/company'
+  import { Message, Loading } from 'element-ui'
+  import { getContractRoom } from '@/api/house'
+  import { mapState } from 'vuex'
+  export default {
+    name: 'bullEditFu',
+    components: {
+      GlobalWindow
+    },
+    computed: {
+      ...mapState(['userInfo'])
+    },
+    extends: BaseOpera,
+    data () {
+      return {
+        form: {
+          contractId: '',
+          renterName: '',
+          renterId: '',
+          costType: '',
+          type: '',
+          companyId: '',
+          remark: '',
+          startDate: '',
+          endDate: '',
+          totleFee: '',
+          planPayDate: '',
+          multifileList: [],
+          ywContractRoomList: [],
+          date: [],
+          RoomName: ''
+        },
+        rules,
+        loadingInstance: null,
+        uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
+        fileList: [],
+        uploadData: {
+          folder: 'YW_CONTRACT_BILL'
+        },
+        contract: [],
+        payerList: [],
+        comparyList: [],
+        houseList: []
+      }
+    },
+    methods: {
+      open (title, target) {
+        this.title = title
+        this.form.multifileList = []
+        this.getListAll()
+        this.getCompanyList()
+        this.visible = true
+        // 鏂板缓
+        if (target == null) {
+          this.$nextTick(() => {
+            this.$refs.form.resetFields()
+            this.form[this.configData['field.id']] = null
+          })
+          return
+        }
+        // 缂栬緫
+        this.$nextTick(() => {
+          for (const key in this.form) {
+            this.form[key] = target[key]
+          }
+        })
+      },
+      changeContract (e) {
+        this.form.renterName = this.contract.filter(item => {
+          if (item.id === e) {
+            return item
+          }
+        })[0].renterName
+        this.getHouseDate()
+      },
+      getHouseDate () {
+        getContractRoom({ contractId: this.form.contractId, type: 0 })
+          .then(res => {
+            this.houseList = res
+          })
+      },
+      confirm () {
+        this.$refs.form.validate((valid) => {
+          if (!valid) return
+          this.isWorking = true
+          let obj = JSON.parse(JSON.stringify(this.form))
+          obj.ywContractRoomList = obj.ywContractRoomList.map(id => {
+            return { roomId: id }
+          })
+          obj.feeType = 0
+          obj.billType = 1
+          create(obj)
+            .then(() => {
+              this.visible = false
+              this.$tip.apiSuccess('鏂板缓鎴愬姛')
+              this.$emit('success')
+            })
+            .finally(() => {
+              this.isWorking = false
+            })
+        })
+      },
+      dele (imgaddr) {
+        this.form.multifileList.forEach((item, index) => {
+          if (imgaddr === item.imgaddr) {
+            this.form.multifileList.splice(index, 1)
+          }
+        })
+      },
+      openHouse () {
+        this.$refs.selectHouse.open('閫夋嫨鎴挎簮', { contractId: this.form.contractId, type: 0 })
+      },
+      getCompanyList () {
+        companyList({})
+          .then(res => {
+            this.comparyList = res
+          })
+      },
+      getListAll () {
+        listAll({})
+          .then(res => {
+            console.log(res)
+            this.contract = res
+          })
+      },
+      changeDate (e) {
+        if (!e || e.length === 0) {
+          this.form.startDate = ''
+          this.form.endDate = ''
+        } else {
+          this.form.startDate = e[0]
+          this.form.endDate = e[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(() => {
+          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')
+      }
+    }
+  }
+</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;
+                    align-items: center;
+                    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 {
+        padding: 20px 16px;
+        border: 1px solid #c3c6cd;
+        border-radius: 2px;
+        
+        .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>

--
Gitblit v1.9.3