Browse Source

成本部分修改

yuanrf 1 year ago
parent
commit
200f455c9c
1 changed files with 36 additions and 2 deletions
  1. 36 2
      src/components/Finance/Cost.vue

+ 36 - 2
src/components/Finance/Cost.vue

@@ -408,7 +408,7 @@
                     </el-checkbox-group>
                     <div style="display: flex;font-size: 12px">
                         <div :style="{ 'width': costTypevalue == 'A' ? '100%' : '49%' }">
-                            <div class="biaoge" style="width: 200px;margin-bottom:0px;margin-top: 20px;"
+                            <div style="width: 200px;margin-bottom:0px;margin-top: 20px;"
                                 v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes('签证') && visaCountryInfoArr.length > 0">
 
                                 <el-table :data="visaCountryInfoArr" border style="width: 100%">
@@ -503,7 +503,7 @@
                         <div style="width: 2%;" v-show="costTypevalue != 'A'"></div>
                         <div style="width: 49%;" v-show="costTypevalue != 'A'">
 
-                            <div class="biaoge"
+                            <div class=""
                                 style="width: 200px;margin-bottom:0px;margin-top: 20px;visibility: hidden;"
                                 v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes('签证') && visaCountryInfoArr.length > 0">
 
@@ -3471,6 +3471,40 @@ export default {
         save() {
 
             return new Promise(async (resolve, reject) => {
+
+                if(this.costTypevalue == 'A'){
+                    var sgrfilter = this.costTypeHotelNumbers.filter(x => {
+                        return x.type == 'Default'
+                    })[0];
+                    var pNumber = 0;
+                    //遍历 sgrfilter对象
+                    for (var key in sgrfilter) {
+                        var parNumber = Number(sgrfilter[key]);
+                        if(isNaN(parNumber)){
+                            parNumber = 0;
+                        }else{
+                            if (key == 'tbr'){
+                                pNumber += parNumber * 2;
+                            }
+                            if (key == 'sgr'){
+                                pNumber += parNumber ;
+                            }
+                            if (key == 'jses'){
+                                pNumber += parNumber ;
+                            }
+                            if (key == 'suite'){
+                                pNumber += parNumber;
+                            }
+                        }
+                    }
+
+                    console.log(pNumber,'pNumber-------------');
+                    if(this.grouptitleinfo.visitPNumber != pNumber){
+                        this.$message.error('团组人数与房间人数不一致!')
+                        return resolve(false);
+                    }
+                }
+
                 var that = this;
                 var Data = { diid: this.diid, userid: this.userId };
                 var isTrue = await this.formVerify();