Browse Source

地接超支修改

yuanrf 8 months ago
parent
commit
0a3de84dbf
2 changed files with 120 additions and 44 deletions
  1. 26 5
      src/components/Finance/Cost.vue
  2. 94 39
      src/components/OP/CarTouristGuideGrounContent.vue

+ 26 - 5
src/components/Finance/Cost.vue

@@ -6250,7 +6250,7 @@ export default {
                 //console.log("保存成功,已退出!");
             }).catch(e => {
                 //console.log(e);
-                //console.log("保存失败,仅停止自动保存!");
+                console.log("保存失败,仅停止自动保存!");
                 clearInterval(this.autoSave);
             })
         },
@@ -6407,6 +6407,30 @@ export default {
         pinyingxing(val) {
             return pinyin(val, { toneType: 'none' }).toUpperCase();
         },
+        UserMount(){
+            Array.prototype.whereToList = function (callback) {   
+                if(!callback) return this; 
+                if (typeof callback !== 'function') return this; 
+                var list = [] ; 
+                for (let index = 0; index < this.length; index++) {
+                    if(callback(this[index])){
+                        list.push(this[index]) 
+                    }    
+                }  
+                return list; 
+            };
+
+            Array.prototype.firstWhere = function (callback) {   
+                if(!callback) return this; 
+                if (typeof callback !== 'function') return this; 
+                for (let index = 0; index < this.length; index++) {
+                    if(callback(this[index])){
+                        return this[index] 
+                    }    
+                }  
+                return null; 
+            };
+        },
     },
     updated() {
         this.$emit('transfer', true)
@@ -6442,16 +6466,13 @@ export default {
             this.loadData(-1);
         }
 
+        this.UserMount();
         window.Vue = this;
     },
     beforeDestroy() {
         this.clearTimer()
     },
     computed: {
-        defaultCostTypeHotelNumber() {
-            const defaultItems = this.costTypeHotelNumbers.filter(item => item.type == 'Default');
-            return defaultItems[0];
-        },
         filterdialogSearchInput() {
             var that = this;
             return this.dialogTableData.filter(function (x) {

+ 94 - 39
src/components/OP/CarTouristGuideGrounContent.vue

@@ -125,7 +125,7 @@
                 </el-table-column>
                 <el-table-column width="70" label="门票描述">
                     <template slot-scope="scope">
-                        {{scope.row.ticketRemark}}
+                        {{ scope.row.ticketRemark }}
                     </template>
                 </el-table-column>
                 <el-table-column width="70" label="零用金">
@@ -188,9 +188,9 @@
             <el-button type="primary" class="oprompt" slot="reference">移上提示成本</el-button>
         </el-popover>
         <el-skeleton :rows="28" animated :loading="loading">
-            <div style="display: flex;justify-content: space-between;">
-                <div style="width: 70%;display: flex;">
-                    <div style="width: 25%;margin-right: 10px;">
+            <div style="display: flex;">
+                <div style="width: 78%;display: flex;">
+                    <div style="width: 35%;margin-right: 10px;">
                         <el-select v-model="diId" placeholder="团组选择" clearable filterable style="width: 100%;"
                             :disabled="true">
                             <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
@@ -198,7 +198,7 @@
                             </el-option>
                         </el-select>
                     </div>
-                    <div style="width: 25%;">
+                    <div style="width: 35%;">
                         <el-select v-model="currency" placeholder="币种选择" clearable filterable style="width: 70%;">
                             <el-option v-for="item in currencyList" :key="item.currencyId"
                                 :label="item.currencyName + '(' + item.currencyCode + ')'" :value="item.currencyId">
@@ -206,10 +206,29 @@
                         </el-select>
                     </div>
                 </div>
+                <div style="width: 50%;display: flex">
+                    <div style="display: flex;justify-content: center;align-items: center">
+                        超支币种:
+                    </div>
+
+                    <div>
+                        <el-select v-model="rate.toCurr" placeholder="币种选择" clearable filterable style="width: 95%;">
+                            <el-option v-for="item in currencyList" :key="item.currencyId"
+                                :label="item.currencyName + '(' + item.currencyCode + ')'" :value="item.currencyId">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div>
+                        <el-input-number type="text" placeholder="汇率" v-model="rate.rate"
+                            :controls="false"></el-input-number>
+                    </div>
+                </div>
             </div>
             <div style="display: flex;justify-content: space-between;margin: 10px 0;" class="checkbox-style">
                 <el-checkbox-group v-model="checkList" @change="checkBoxChange">
-                    <el-checkbox :class="item.includes('超')?'myRedCheckBox':''" :style="item.includes('超')?'color:red;':''" v-for="(item, index) in checkItems" :key="index" :label=item></el-checkbox>
+                    <el-checkbox :class="item.includes('超') ? 'myRedCheckBox' : ''"
+                        :style="item.includes('超') ? 'color:red;' : ''" v-for="(item, index) in checkItems" :key="index"
+                        :label=item></el-checkbox>
                 </el-checkbox-group>
             </div>
             <div style="margin:10px 0;color:#706266;font-size:15px;">
@@ -242,8 +261,8 @@
                         </el-table-column>
                         <el-table-column prop="datePrice" label="日期" width="170">
                             <template slot-scope="scope">
-                                <el-date-picker size="small" style="width: 100%;" v-model="scope.row.datePrice" type="date"
-                                    :picker-options="startPickerOptions" value-format="yyyy-MM-dd HH:mm:ss"
+                                <el-date-picker size="small" style="width: 100%;" v-model="scope.row.datePrice"
+                                    type="date" :picker-options="startPickerOptions" value-format="yyyy-MM-dd HH:mm:ss"
                                     placeholder="选择日期">
                                 </el-date-picker>
                             </template>
@@ -251,17 +270,34 @@
                         <el-table-column label="金额/币种" width="400">
                             <template slot-scope="scope">
                                 <div class="el-input-number-style pice-ys">
-                                    <el-input-number size="small" placeholder="请输入金额" v-model="scope.row.price"
-                                        :controls="false" @change="PriceChange"></el-input-number>
-
-                                    <!-- <el-input placeholder="请输入金额" v-model="scope.row.price" clearable style="width:170px;"
-                                    @change="PriceChange" /> -->
-                                    <el-select size="small" v-model="currency" placeholder="币种选择" clearable filterable
-                                        style="width:120px" :disabled="true">
-                                        <el-option v-for="item in currencyList" :key="item.currencyId"
-                                            :label="item.currencyCode" :value="item.currencyId">
-                                        </el-option>
-                                    </el-select>
+                                    <div v-if="showPopoverIds.includes(scope.row.sId)">
+                                        <el-popover placement="top-start" title="三公费用" width="300" trigger="hover">
+                                            <span style="color: green;">{{ nationalTravelFee ? `一人一顿费用
+                                                ${Number(nationalTravelFee.foodCost) / 2}
+                                                ${nationalTravelFee.currencyStr} (${(Number(nationalTravelFee.foodCost)
+                                                    / 2 / rate.rate).toFixed(2)} ${currencyList.filter(x => x.currencyId ==
+                                                        currency)[0].currencyCode})` : '暂无' }}</span>
+                                            <el-input-number size="small" placeholder="请输入金额" slot="reference"
+                                                v-model="scope.row.price" :controls="false"
+                                                @change="PriceChange"></el-input-number>
+                                        </el-popover>
+                                        <el-select size="small" v-model="currency" placeholder="币种选择" clearable
+                                            filterable style="width:120px" :disabled="true">
+                                            <el-option v-for="item in currencyList" :key="item.currencyId"
+                                                :label="item.currencyCode" :value="item.currencyId">
+                                            </el-option>
+                                        </el-select>
+                                    </div>
+                                    <div v-else>
+                                        <el-input-number size="small" placeholder="请输入金额" v-model="scope.row.price"
+                                            :controls="false" @change="PriceChange"></el-input-number>
+                                        <el-select size="small" v-model="currency" placeholder="币种选择" clearable
+                                            filterable style="width:120px" :disabled="true">
+                                            <el-option v-for="item in currencyList" :key="item.currencyId"
+                                                :label="item.currencyCode" :value="item.currencyId">
+                                            </el-option>
+                                        </el-select>
+                                    </div>
                                 </div>
                             </template>
                         </el-table-column>
@@ -281,7 +317,8 @@
                                 <!-- <el-input size="small" style="width: 100%;" placeholder="选择单位" v-model="scope.row.units"
                                     @change="PriceChange"></el-input> -->
                                 <el-select size="small" v-model="scope.row.units" filterable placeholder="选择单位">
-                                    <el-option v-for="item in unitsArr" :key="item.id" :label="item.name" :value="item.id">
+                                    <el-option v-for="item in unitsArr" :key="item.id" :label="item.name"
+                                        :value="item.id">
                                     </el-option>
                                 </el-select>
                             </template>
@@ -368,7 +405,6 @@
     </div>
 </template>
 <script>
-import { el } from '@fullcalendar/core/internal-common'
 export default {
     data() {
         return {
@@ -422,6 +458,12 @@ export default {
             ListCount: 1,
             budgeting: [],
             saveDisabled: false,
+            nationalTravelFee: null,
+            showPopoverIds: [989, 93, 988],
+            rate: {
+                toCurr: 836,
+                rate: 1
+            }
         }
     },
     methods: {
@@ -512,7 +554,16 @@ export default {
 
                     that.checkList = res.data.data.checkedItem;
                     that.checkBoxChange();
+
                     //that.OpCarTouristGuideGroundContenById()
+                    that.nationalTravelFee = res.data.data.nationalTravelFee;
+                    that.rate = res.data.data.rate;
+
+                    if (that.rate.rate == 0 && that.rate.toCurr == 0) {
+                        that.rate.rate = 1;
+                        that.rate.toCurr = that.nationalTravelFee.currency;
+                    }
+
                 } else {
                     this.$message.error('初始化失败' + res.data.msg);
                 }
@@ -637,6 +688,8 @@ export default {
                                     //remark: item.remark,
                                 })
                             })
+                            that.OPContenData.rate = that.rate.rate;
+                            that.OPContenData.toCurr = that.rate.toCurr
 
                             this.saveDisabled = true;
                             var url = "/api/Groups/OpCarTouristGuideGroundContent"
@@ -828,29 +881,31 @@ export default {
     background-color: #007dff;
     border-color: #007dff;
 }
+
 /* 设置带边框的checkbox,选中后边框的颜色 */
 .myRedCheckBox.is-bordered.is-checked {
     border-color: #FF0000;
-  }
-  
-  /* 设置选中后的文字颜色 */
-  .myRedCheckBox .el-checkbox__input.is-checked+.el-checkbox__label {
+}
+
+/* 设置选中后的文字颜色 */
+.myRedCheckBox .el-checkbox__input.is-checked+.el-checkbox__label {
     color: #FF0000;
-  }
-  
-  /* 设置选中后对勾框的边框和背景颜色 */
-  .myRedCheckBox .el-checkbox__input.is-checked .el-checkbox__inner, .myRedCheckBox .el-checkbox__input.is-indeterminate .el-checkbox__inner {
+}
+
+/* 设置选中后对勾框的边框和背景颜色 */
+.myRedCheckBox .el-checkbox__input.is-checked .el-checkbox__inner,
+.myRedCheckBox .el-checkbox__input.is-indeterminate .el-checkbox__inner {
     border-color: #FF0000;
-    background-color:#FF0000;
-  }
-  
-  /* 设置checkbox获得焦点后,对勾框的边框颜色 */
-  .myRedCheckBox .el-checkbox__input.is-focus .el-checkbox__inner{
+    background-color: #FF0000;
+}
+
+/* 设置checkbox获得焦点后,对勾框的边框颜色 */
+.myRedCheckBox .el-checkbox__input.is-focus .el-checkbox__inner {
     border-color: #FF0000;
-  }
-  
-  /* 设置鼠标经过对勾框,对勾框边框的颜色 */
-  .myRedCheckBox .el-checkbox__inner:hover{
+}
+
+/* 设置鼠标经过对勾框,对勾框边框的颜色 */
+.myRedCheckBox .el-checkbox__inner:hover {
     border-color: #FF0000;
-  }
+}
 </style>