Browse Source

添加标注

liuhj 1 week ago
parent
commit
218e3c4f82
2 changed files with 193 additions and 23 deletions
  1. 192 22
      src/components/Finance/ConferenceCost.vue
  2. 1 1
      src/components/statistics/Reportstbale.vue

+ 192 - 22
src/components/Finance/ConferenceCost.vue

@@ -1,10 +1,10 @@
 <template>
-    <div class="conferencecost-all">
+    <div class="conferencecost-all" v-loading.fullscreen.lock="conferencecostLoading">
         <div class="conferencecost-header">
             <div class="conferencecost-header-left">
                 <div class="conferencecost-header-left-item">
                     <label style="width:40px;">会务: </label>
-                    <el-select @change="conferenceidchange" size="small" v-model="conferenceid" clearable placeholder="请选择">
+                    <el-select @change="conferenceidchange" size="small" v-model="conferenceid" filterable clearable placeholder="请选择">
                         <el-option v-for="item in conferenceidarr" :key="item.id" :label="item.teamName"
                             :value="item.id">
                         </el-option>
@@ -18,13 +18,13 @@
             </div>
             <div class="conferencecost-header-right">
                 <el-select size="small" v-model="conferenceid" clearable placeholder="请选择">
-                    <el-option v-for="item in conferenceidarr" :key="item.value" :label="item.label"
+                    <el-option v-for="item in a" :key="item.value" :label="item.label"
                         :value="item.value">
                     </el-option>
                 </el-select>
                 <el-button size="small" type="primary">生成表格</el-button>
-                <el-button size="small" type="primary">保存</el-button>
-                <el-button size="small" type="primary">审核通过</el-button>
+                <el-button size="small" @click="ConferenceAffairsSave" type="primary">保存</el-button>
+                <el-button size="small" @click="ConferenceAffairsAudit(1)" type="primary">审核通过</el-button>
             </div>
         </div>
         <div class="conferencecost-content">
@@ -109,15 +109,18 @@
                     </template>
                 </el-table-column>
                 <el-table-column prop="reviewStatus" label="审核状态" width="100">
+                    <template slot-scope="scope">
+                        {{ scope.row.reviewStatus === 0 ? '未审核' : scope.row.reviewStatus === 1 ? '已通过' : '已撤销' }}
+                    </template>
                 </el-table-column>
                 <el-table-column label="操作" width="100px">
-                    <!-- <template slot-scope="scope"> -->
+                    <template slot-scope="scope">
                         <div class="conferencecost-content-btn">
-                            <el-button size="mini" type="danger">移 除</el-button>
-                            <el-button size="mini" type="primary">通 过</el-button>
-                            <el-button size="mini" type="danger">撤 销</el-button>
+                            <el-button size="mini" @click="removeRow(scope.$index, scope.row)" type="danger">移 除</el-button>
+                            <el-button size="mini" @click="ConferenceAffairsAudits(1,scope.row.id)" type="primary">通 过</el-button>
+                            <el-button size="mini" @click="ConferenceAffairsAudits(-1,scope.row.id)" type="danger">撤 销</el-button>
                         </div>
-                    <!-- </template> -->
+                    </template>
                 </el-table-column>
             </el-table>
             <div class="Addline">
@@ -138,12 +141,37 @@
                 报价总计:{{ conferenceAffairsCost.baoJiaAll }} {{ danwei }}
             </div>
         </div>
+        <div class="conferencecost-allocation">
+            <div class="conferencecost-allocation-select">
+                注:其中
+                <el-input-number style="width:120px;" :precision="2" size="mini" :controls="false" v-model="conferenceAffairsCost.allocationAmount"></el-input-number>
+                <el-select @change="allocationGroupIdchange" style="width:120px;" size="mini" v-model="conferenceAffairsCost.allocationCurrency" clearable>
+                    <el-option v-for="item in options" :key="item.currencyId" :label="item.currencyCode"
+                        :value="item.currencyId">
+                    </el-option>
+                </el-select>
+                ,会分摊到
+                <el-select filterable style="width:200px;" size="mini" v-model="conferenceAffairsCost.allocationGroupId" clearable>
+                    <el-option v-for="item in conferenceidarr" :key="item.id" :label="item.teamName"
+                        :value="item.id">
+                    </el-option>
+                </el-select>
+            </div>
+            <div class="conferencecost-Interestrate">
+                该会务利润率超过
+                <el-input-number style="width:120px;" :precision="2" size="mini" :controls="false" v-model="liom"></el-input-number>%
+                需要增派几人去现场执行
+            </div>
+        </div>
     </div>
 </template>
 <script>
+import { debounce } from '../../store/statice'
 export default {
     data() {
         return {
+            a:[],
+            liom:0,
             danwei: '',
             conferenceAffairsCost:{
                 city:'',//服务地区
@@ -152,7 +180,7 @@ export default {
                 allocationCurrency:'',//分配币种
                 allocationRate:'',//分配时汇率
                 allocationGroupId:'',//分配团组Id
-                id:'',
+                id:0,
                 remark:'',
                 costAll:'',//成本总计
                 baoJiaAll:'',//报价总计
@@ -187,7 +215,9 @@ export default {
             userId: '',
             restriction:true,
             rateStatistics:[],
-
+            multipleSelection: [],
+            conferenceAffairsCostChildids:[],
+            conferencecostLoading:false,
         }
     },
     updated() {
@@ -219,7 +249,7 @@ export default {
                 if (_this.rateStatistics.length > 1) {
                     _this.danwei = 'CNY';
                 }else {
-                    _this.danwei = _this.rateStatistics[0].currencyCode;
+                    _this.danwei = _this.rateStatistics.length==1? _this.rateStatistics[0].currencyCode : 'CNY';
                 }
                 _this.updateTotals();
             },
@@ -233,7 +263,12 @@ export default {
             return val.toFixed(2);
         },
         handleSelectionChange(val) {
+            this.conferenceAffairsCostChildids = [];
             this.multipleSelection = val;
+            console.log(this.multipleSelection);
+            for (let i = 0; i < this.multipleSelection.length; i++) {
+                this.conferenceAffairsCostChildids.push(this.multipleSelection[i].id);
+            }
         },
         //获取基础数据
         ConferenceAffairsInIt(){
@@ -258,6 +293,7 @@ export default {
         },
         //获取数据
         ConferenceAffairsInIts(){
+            this.conferencecostLoading=true;
             var url = "/api/Groups/ConferenceAffairsInIt"
             var that = this
             this.$axios({
@@ -276,6 +312,8 @@ export default {
                 that.tableDatas=AffairsInIt.conferenceAffairsCostChi;
                 that.typearr=AffairsInIt.typeData;
                 that.units=AffairsInIt.units;
+                that.conferenceAffairsCost=AffairsInIt.conferenceAffairsCost;
+                that.conferencecostLoading=false;
             })
         },
         //币种切换
@@ -301,13 +339,13 @@ export default {
                 costPrice:0,//成本费用
                 currency:'',//币种
                 rate:0,//当时汇率
-                count:0,//数量
+                count:0,//数量333
                 unit:'',//单位
                 coefficient:0,//系数
                 baoJiaPrice:0,//报价金额
                 addedValue:'',//附加值
                 details:'',//明细
-                reviewStatus:'',//审核状态
+                reviewStatus:0,//审核状态
                 diid:this.conferenceid,//团组Id
                 id:0,//主表Id
                 remark:'',//备注
@@ -347,8 +385,122 @@ export default {
                 // return sum + (Number(item.baoJiaPrice) || 0);
             }, 0).toFixed(2);
         },
+        //分配HUI率切换
+        allocationGroupIdchange(val) {
+            console.log(val);
+            console.log(val);
+            
+            var obj = this.options.find(function (i) {
+                return i.currencyId === val;
+            });
+            if (obj) {
+                this.conferenceAffairsCost.allocationRate = obj.rate;
+            }
+        },
+        //移除
+        removeRow(index,row) {
+            console.log(index,row.id);
+            
+            // this.tableDatas.splice(index, 1);
+            //this.updateTotals();//jisuan总计
+            var url = "/api/Groups/ConferenceAffairSinglesDelete"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    userId:21,
+                    ids: [row.id],
+                }
+            }).then(function (res) {
+                if (res.data.code== 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg,
+                    });
+                    that.updateTotals()
+                    that.ConferenceAffairsInIts();
+                }else{
+                    that.$message({
+                        type: 'error',
+                        message: res.data.msg
+                    });
+                }
+            })
+        },
+        //单条审核api
+        ConferenceAffairsAudits: debounce(function (reviewStatus, id){
+            var url = "/api/Groups/ConferenceAffairsAudit"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    conferenceAffairsCostChildids: [id],
+                    reviewStatus: reviewStatus,
+                }
+            }).then(function (res) {
+                if (res.data.code== 200) {
+                    that.$message({
+                        type: 'success',                                
+                        message: res.data.msg
+                    });
+                    that.ConferenceAffairsInIts();
+                }else{
+                    that.$message({
+                        type: 'error',
+                        message: res.data.msg
+                    });
+                }
+            })
+        },1000, true),
+        //多条审核api
+        ConferenceAffairsAudit: debounce(function (reviewStatus) {
+            if (this.conferenceAffairsCostChildids.length === 0) {
+                this.$message({
+                    type: 'warning',
+                    message: '请至少选择一条记录进行审核!'
+                });
+                return;
+            }
+            var url = "/api/Groups/ConferenceAffairsAudit"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    conferenceAffairsCostChildids: that.conferenceAffairsCostChildids,
+                    reviewStatus: reviewStatus,
+                }
+            }).then(function (res) {
+                if (res.data.code== 200) {
+                    that.$message({
+                        type: 'success',
+                        message: '审核成功!'
+                    });
+                    that.ConferenceAffairsInIts();
+                }else{
+                    that.$message({
+                        type: 'error',
+                        message: res.data.msg
+                    });
+                }
+            })
+        },1000, true),
         //保存api
-        ConferenceAffairsSave(){
+        ConferenceAffairsSave: debounce(function (){
+            this.conferenceAffairsCost.diid = this.conferenceid;
+            this.conferenceAffairsCost.baoJiaAll = Number(this.conferenceAffairsCost.baoJiaAll);
+            this.conferenceAffairsCost.costAll =  Number(this.conferenceAffairsCost.costAll);
             var url = "/api/Groups/ConferenceAffairsSave"
             var that = this
             this.$axios({
@@ -364,13 +516,20 @@ export default {
                     groupId: that.conferenceid,
                 }
             }).then(function (res) {
-                let AffairsInIt=res.data.data;
-                that.options=AffairsInIt.currenyList.teamRates;
-                that.tableDatas=AffairsInIt.conferenceAffairsCostChi;
-                that.typearr=AffairsInIt.typeData;
-                that.units=AffairsInIt.units;
+                if (res.data.code== 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg,
+                    });
+                    that.ConferenceAffairsInIts();
+                }else{
+                    that.$message({
+                        type: 'error',
+                        message: res.data.msg
+                    });
+                }
             })
-        },
+        },1000, true),
     },
     mounted(){
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
@@ -434,4 +593,15 @@ export default {
 .conferencecost-all .conferencecost-content .el-table__header-wrapper,.el-table__body-wrapper{
     font-size:12px
 }
+.conferencecost-allocation{
+    margin-top: 15px;
+}
+.conferencecost-Interestrate{
+    margin-top: 10px;
+}
+.conferencecost-foot,.conferencecost-allocation{
+    font-size: 14px;
+    color: #909399;
+    font-weight: 600;
+}
 </style> 

+ 1 - 1
src/components/statistics/Reportstbale.vue

@@ -89,7 +89,7 @@
                                 </template>
                             </el-table-column>
                             <el-table-column
-                            label="应收金额"
+                            label="应收金额(CNY)"
                             width="180">
                                 <template slot-scope="scope">
                                     {{ scope.row.itemSumPrice.toFixed(2)}}