瀏覽代碼

op部分修改

yuanrf 1 年之前
父節點
當前提交
4a3a86048c
共有 1 個文件被更改,包括 91 次插入91 次删除
  1. 91 91
      src/components/OP/CarTouristGuideGrounContent.vue

+ 91 - 91
src/components/OP/CarTouristGuideGrounContent.vue

@@ -36,7 +36,7 @@
                 <span style="color:#606266;">{{ delegationInfo.visitDate }}&nbsp;&nbsp;&nbsp;</span>
                 <span style="font-weight: bold;">天数/人数:</span>
                 <span style="color:#606266;">{{ delegationInfo.visitDays }}天/{{
-                    delegationInfo.visitPNumber }}人</span>
+            delegationInfo.visitPNumber }}人</span>
             </div>
             <hr style='background-color:#5555; height:1px; border:none;' />
             <div>
@@ -50,41 +50,45 @@
                         </el-table-column>
                         <el-table-column prop="SIdName" label="费用项目" width="120">
                             <template slot-scope="scope">
-                                <span style="display: none;">{{ scope.row.sId }}</span>{{ scope.row.sIdName }}
+                                <span style="display: none;">{{ scope.row.sId }}</span>{{ scope.row.sidName }}
                             </template>
                         </el-table-column>
-                        <el-table-column prop="SIdName" label="日期" width="160">
+                        <el-table-column prop="datePrice" label="日期" width="160">
                             <template slot-scope="scope">
-                                <el-date-picker
-                                style="width: 100%;"
-                                v-model="scope.row.price"
-                                type="date"
-                                :picker-options="startPickerOptions"
-                                placeholder="选择日期">
+                                <el-date-picker 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>
                         </el-table-column>
                         <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-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:180px;"
                                     @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 v-for="item in currencyList" :key="item.currencyId"
+                                            :label="item.currencyCode" :value="item.currencyId">
                                         </el-option>
                                     </el-select>
                                 </div>
                             </template>
                         </el-table-column>
+                        <el-table-column label="数量" width="100">
+                            <template slot-scope="scope">
+                                <el-input size="small" style="width: 100%;" placeholder="选择单位" v-model="scope.row.count"
+                                    @change="PriceChange">
+                                </el-input>
+                            </template>
+                        </el-table-column>
                         <el-table-column label="单位" width="100">
                             <template slot-scope="scope">
-                                    <el-input size="small" style="width: 100%;" placeholder="请输入金额" v-model="scope.row.price"
-                                        @change="PriceChange"></el-input>
+                                <el-input size="small" style="width: 100%;" placeholder="选择单位" v-model="scope.row.units"
+                                    @change="PriceChange"></el-input>
                             </template>
                         </el-table-column>
                         <el-table-column label="费用明细">
@@ -145,8 +149,8 @@
                                         style="width: 120px;"></el-input>
                                     <el-select v-model="currency" placeholder="币种选择" clearable filterable
                                         style="width:100px" :disabled="true">
-                                        <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
-                                            :value="item.currencyId">
+                                        <el-option v-for="item in currencyList" :key="item.currencyId"
+                                            :label="item.currencyCode" :value="item.currencyId">
                                         </el-option>
                                     </el-select>
                                 </el-form-item>
@@ -169,24 +173,14 @@
     </div>
 </template>
 <script>
-import { dE } from '@fullcalendar/core/internal-common'
 export default {
     data() {
         return {
-            //限制时间
-            startDate:'',//时间
-            minTime:1618891200000,//时间戳,对应时间为:'2021-04-20 12:00:00'
-            maxTime:1619323200000,//时间戳,对应时间为:'2021-04-25 12:00:00'
-            startPickerOptions:{
-                disabledDate: (time) => {
-                    //小于最小时间或者大于最大时间都不可选
-                    return time.getTime() < this.minTime-24*3600000|| time.getTime() > this.maxTime;
-                }
+            startPickerOptions: {
             },
-
-            pageId:'',
+            pageId: '',
             token: '',
-            cTable:'',
+            cTable: '',
             userId: 0,
             id: '',
             diId: '',
@@ -196,7 +190,6 @@ export default {
             delegationInfo: {},
             delegationInfoList: [],//团组下拉框
             currencyList: [],
-            tableInitialization: [],
             payment: [],
             IsAuditGM: 0,
             ContentList: [],
@@ -241,6 +234,7 @@ export default {
                 },
                 data: {
                     userId: that.userId,
+                    id: that.id,
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
@@ -249,23 +243,32 @@ export default {
                     for (let index = 0; index < that.delegationInfoList.length; index++) {
                         if (that.delegationInfoList[index].id == that.diId) {
                             that.delegationInfo = that.delegationInfoList[index];
-
                             break;
                         }
                     }
-                    that.tableInitialization = res.data.data.tableInitialization;
-                    that.tableInitialization.forEach(function (item) {
-                        that.ContentList.push({
-                            id: 0,
-                            sId: item.id,
-                            sIdName: item.name,
-                            price: '0.00',
-                            priceContent: '',
-                            //remark: '',
-                        })
-                    });
+
+                    that.ContentList = res.data.data.carTouristGuides;
                     that.payment = res.data.data.payment;
-                    that.OpCarTouristGuideGroundContenById()
+
+                    var CreditCardPayment = res.data.data.creditCardPayment;
+                    if (CreditCardPayment != null) {
+                        that.OPContenData.payDId = CreditCardPayment.payDId
+                        that.OPContenData.payee = CreditCardPayment.payee
+                        that.currency = CreditCardPayment.paymentCurrency
+                        that.OPContenData.payPercentage = CreditCardPayment.payPercentage
+                        that.countCost = CreditCardPayment.payMoney
+                        that.OPContenData.orbitalPrivateTransfer = CreditCardPayment.orbitalPrivateTransfer
+                    }
+
+                    var start = new Date(res.data.data.start).getTime();
+                    var end = new Date(res.data.data.end).getTime();
+
+                    that.startPickerOptions.disabledDate = (time) => {
+                        return time.getTime() < start || time.getTime() > end;
+                    }
+
+                    that.loading = false;
+                    //that.OpCarTouristGuideGroundContenById()
                 }
 
             })
@@ -286,7 +289,7 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    that.cTable=res.data.data.cTable
+                    that.cTable = res.data.data.cTable
                     that.PostGroupTeamRateByDiIdAndCTableId();
                 }
             })
@@ -309,57 +312,49 @@ export default {
             }).then(function (res) {
                 console.log(res)
                 if (res.data.code == 200) {
-                    that.currencyList=res.data.data.teamRates;
-                    that.currency=that.currencyList[0].currencyId;
+                    that.currencyList = res.data.data.teamRates;
+                    that.currency = that.currencyList[0].currencyId;
                 }
             })
         },
-        OpCarTouristGuideGroundContenById() {
-            var url = "/api/Groups/OpCarTouristGuideGroundContentById"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    id: that.id
-                }
-            }).then(function (res) {
-                if (res.data.code == 200) {
-                    var CreditCardPayment = res.data.data.creditCardPayment;
-                    if (CreditCardPayment != null) {
-                        that.OPContenData.payDId = CreditCardPayment.payDId
-                        that.OPContenData.payee = CreditCardPayment.payee
-                        that.currency = CreditCardPayment.paymentCurrency
-                        that.OPContenData.payPercentage = CreditCardPayment.payPercentage
-                        that.countCost = CreditCardPayment.payMoney
-                        that.OPContenData.orbitalPrivateTransfer = CreditCardPayment.orbitalPrivateTransfer
-                    }
-                    var CarTouristsContent = res.data.data.carTouristsContent;
-                    if (CarTouristsContent.length != 0) {
-                        CarTouristsContent.forEach(function (item) {
-                            that.ContentList.forEach(function (item1) {
-                                if (item.sId == item1.sId) {
-                                    item1.id = item.id
-                                    item1.price = item.price
-                                    item1.priceContent = item.priceContent
-                                    //item1.remark = item.remark
-                                }
+        // OpCarTouristGuideGroundContenById() {
+        //     var url = "/api/Groups/OpCarTouristGuideGroundContentById"
+        //     var that = this
+        //     this.$axios({
+        //         method: 'post',
+        //         url: url,
+        //         headers: {
+        //             Authorization: 'Bearer ' + this.token
+        //         },
+        //         data: {
+        //             id: that.id
+        //         }
+        //     }).then(function (res) {
+        //         if (res.data.code == 200) {
 
-                            })
-                        })
-                    }
+        //             var CarTouristsContent = res.data.data.carTouristsContent;
+        //             if (CarTouristsContent.length != 0) {
+        //                 CarTouristsContent.forEach(function (item) {
+        //                     that.ContentList.forEach(function (item1) {
+        //                         if (item.sId == item1.sId) {
+        //                             item1.id = item.id
+        //                             item1.price = item.price
+        //                             item1.priceContent = item.priceContent
+        //                             //item1.remark = item.remark
+        //                         }
 
-                    that.loading = false
-                }
-            })
-        },
+        //                     })
+        //                 })
+        //             }
+
+        //             that.loading = false
+        //         }
+        //     })
+        // },
         addBtn() {
             if (this.IsAuditGM == 1) {
                 this.$message.error('已通过审核,不可修改!');
-            } else {                
+            } else {
                 if (this.diId == null && this.diId == undefined && this.diId == "") {
                     this.$message.error("请选择团组名称");
                     return;
@@ -377,6 +372,9 @@ export default {
                                     sId: item.sId,
                                     price: item.price,
                                     priceContent: item.priceContent,
+                                    datePrice: item.datePrice,
+                                    count: item.count,
+                                    units: item.units,
                                     //remark: item.remark,
                                 })
                             })
@@ -395,7 +393,7 @@ export default {
                                         message: res.data.msg,
                                         type: 'success'
                                     });
-                                    that.$router.back();
+                                    that.EscAdd();
                                 } else {
                                     that.$message.error(res.data.msg);
                                 }
@@ -429,7 +427,7 @@ export default {
     },
 
     mounted() {
-        this.pageId=localStorage.getItem('indexs').split('-')[1];
+        this.pageId = localStorage.getItem('indexs').split('-')[1];
         console.log(this.pageId)
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
@@ -490,9 +488,11 @@ export default {
 .el-input-number-style .el-input input {
     text-align: left;
 }
-.pice-ys .el-input-number{
+
+.pice-ys .el-input-number {
     width: 250px;
 }
+
 @media screen and (max-width: 1700px) {
     .appraise-box>div {
         width: 48%;