Browse Source

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

liuhj 1 year ago
parent
commit
e661fd926f
1 changed files with 137 additions and 34 deletions
  1. 137 34
      src/components/OP/HotelReservations.vue

+ 137 - 34
src/components/OP/HotelReservations.vue

@@ -220,7 +220,7 @@
                                     </el-option>
                                 </el-select>
                             </el-form-item>
-                            <el-form-item style="width:25% ;" label="酒店双间" prop="desc">
+                            <el-form-item style="width:25% ;" label="酒店双间" prop="doubleRoomCount">
                                 <el-input style="width:50px ;" size="medium"
                                     v-model="OpHotelReservationsData.doubleRoomCount"></el-input>
                                 <span>间</span>
@@ -269,9 +269,9 @@
                                     style="width: 100;" @change="bankCardPriceChange"></el-input>
 
                             </el-form-item>
-                            <el-form-item label-width="10px" prop="ctdId">
-                                <el-select size="medium" v-model="OpHotelReservationsData.ctdId" placeholder="请选择信用卡"
-                                    @change="bankCardChage">
+                            <el-form-item label-width="10px" prop="cardPriceCurrency">
+                                <el-select size="medium" v-model="OpHotelReservationsData.cardPriceCurrency"
+                                    placeholder="请选择信用卡" @change="bankCardChage">
                                     <el-option v-for="item in bankCard" :key="item.id" :label="item.name" :value="item.id">
                                     </el-option>
                                 </el-select>
@@ -375,9 +375,9 @@
                         <div v-if="OpHotelReservationsData.payDId == 72">
                             <div style="display: flex;">
                                 <div style="width: 25%;">
-                                    <el-form-item label="卡类型:" prop="ctdIdPay" label-width="160px">
-                                        <el-select v-model="ctdIdPay" placeholder="卡类型" style="width: 100%;"
-                                            @change="ctdChange">
+                                    <el-form-item label="卡类型:" prop="ctdId" label-width="160px">
+                                        <el-select v-model="OpHotelReservationsData.ctdId" placeholder="卡类型"
+                                            style="width: 100%;" @change="ctdChange">
                                             <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                                 :value="item.id">
                                             </el-option>
@@ -532,7 +532,6 @@ export default {
             ],
             CardCurrency: '',
             currencySingle: { id: 836, name: 'CNY', remark: '人民币' },
-            ctdIdPay: '',
             OpHotelReservationsData: {
                 status: 1,
                 id: 0,
@@ -561,6 +560,7 @@ export default {
                 roomExplanation: '',
                 attachment: '',
                 cardPrice: 0.00,
+                cardPriceCurrency: '',
                 isCardPrice: 0,
                 predictSingleRoom: 0,
                 predictDoubleRoom: 0,
@@ -615,8 +615,76 @@ export default {
                     { required: true, message: '请选择入住时间', trigger: ['blur', 'change'] }
                 ],
                 checkOutDate: [
+                    { required: true, message: '请输入办理人数', trigger: ['blur', 'change'] },
                     { required: true, message: '请选择离店时间', trigger: ['blur', 'change'] }
                 ],
+                predictSingleRoom: [
+                    { required: true, message: '请输入单间预定间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                predictDoubleRoom: [
+                    { required: true, message: '请输入双间预定间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                predictSuiteRoom: [
+                    { required: true, message: '请输入套房间预定间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                predictOtherRoom: [
+                    { required: true, message: '请输入其他间预定间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                singleRoomCount: [
+                    { required: true, message: '请输入单间数量,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                singleRoomPrice: [
+                    { required: true, message: '请输入单价,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                doubleRoomCount: [
+                    { required: true, message: '请输入双间数量,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                doubleRoomPrice: [
+                    { required: true, message: '请输入单价,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                suiteRoomCount: [
+                    { required: true, message: '请输入其他房间间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                suiteRoomPrice: [
+                    { required: true, message: '请输入单价,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                otherRoomCount: [
+                    { required: true, message: '请输入其他间预定间数,没有则填0', trigger: ['blur', 'change'] },
+                    { pattern: /^[0-9]\d*$/, message: '请输入正确的数字', trigger: ['blur', 'change'] },
+                ],
+                otherRoomPrice: [
+                    { required: true, message: '请输入单价,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                governmentRent: [
+                    { required: true, message: '请输入地税,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                cityTax: [
+                    { required: true, message: '请输入城市税,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                cardPrice: [
+                    { required: true, message: '请输入信用卡金额,没有则填0.00', trigger: ['blur', 'change'] },
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
+                ],
+                // ctdIdPay: [
+                //     { required: true },
+                // ],
+                companyBankNo: [{ required: true, message: '公司银行账号', trigger: ['blur', 'change'] },],
+                otherBankName: [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },],
+                otherSideNo: [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },],
+                otherSideName: [{ required: true, message: '对方姓名', trigger: ['blur', 'change'] },],
             },
         }
     },
@@ -684,6 +752,7 @@ export default {
                     break;
                 }
             }
+
             this.HotelReservationsByDiId();
 
             this.OpHotelReservationsData.status = 1;
@@ -738,8 +807,12 @@ export default {
             this.OpHotelReservationsData.payee = '';
             this.OpHotelReservationsData.orbitalPrivateTransfer = 0;
             this.OpHotelReservationsData.cRemark = ''
+            this.$nextTick(() => {
+                this.$refs.OpHotelReservationsData.clearValidate();
+            })
         },
         HotelReservationsByDiId() {
+
             var url = "/api/Groups/HotelReservationsByDiId"
             var that = this
             this.$axios({
@@ -847,16 +920,8 @@ export default {
                     debugger
                     that.OpHotelReservationsData.ctdId = creditCardPayment.ctdId;
                     if (that.OpHotelReservationsData.ctdId == 0) {
-                        that.ctdIdPay = '';
                         that.OpHotelReservationsData.ctdId = '';
                     }
-                    var a = that.currencyList.filter(x => x.id == that.OpHotelReservationsData.budgetCurrency);
-                    if (a.length > 0) {
-                        that.currencySingle.id = a[0].id;
-                        that.currencySingle.name = a[0].name;
-                        that.currencySingle.remark = a[0].remark;
-                        that.CardCurrency = that.currencySingle.name + '(' + that.currencySingle.remark + ')'
-                    }
                     that.OpHotelReservationsData.companyBankNo = creditCardPayment.companyBankNo;
                     that.OpHotelReservationsData.otherBankName = creditCardPayment.otherBankName;
                     that.OpHotelReservationsData.otherSideNo = creditCardPayment.otherSideNo;
@@ -878,15 +943,18 @@ export default {
                     // var s = that.currencyList.filter(x => x.id == that.OpHotelReservationsData.paymentCurrency);
                     // if (s.length > 0) {
                     //     that.currencySingle.id = s[0].id;
-                    //     that.currencySingle.name = s[0].name;
+                    //     that.currencySingle.name = s[0].name;OpHotelReservationsDataRules
                     //     that.currencySingle.remark = s[0].remark;
                     //     that.CardCurrency = that.currencySingle.name + '(' + that.currencySingle.remark + ')'
                     // }
-                    if (that.OpHotelReservationsData.ctdId == '74') {
+                    debugger
+
+                    that.OpHotelReservationsData.cardPriceCurrency = hotelReservations.cardPriceCurrency
+                    if (that.OpHotelReservationsData.cardPriceCurrency == '74') {
                         that.CardCurrency = "USD(美元)"
-                    } else if (that.OpHotelReservationsData.ctdId == '75') {
+                    } else if (that.OpHotelReservationsData.cardPriceCurrency == '75') {
                         that.CardCurrency = "EUR(欧元)"
-                    } else if (that.OpHotelReservationsData.ctdId != '' && that.OpHotelReservationsData.ctdId != 0) {
+                    } else {
                         that.CardCurrency = "CNY(人民币)"
                     }
 
@@ -897,6 +965,7 @@ export default {
             });
         },
         payChange() {
+            debugger
             this.OpHotelReservationsData.ctdId = '';
             this.OpHotelReservationsData.bankNo = '';
             this.OpHotelReservationsData.cardholderName = '';
@@ -918,6 +987,7 @@ export default {
                 this.OpHotelReservationsDataRules.otherSideNo = []
                 this.OpHotelReservationsDataRules.otherSideName = []
             } else if (this.OpHotelReservationsData.payDId == 83) {
+                debugger
                 this.OpHotelReservationsDataRules.companyBankNo = []
                 this.OpHotelReservationsDataRules.otherBankName = [{ required: true, message: '对方开户行', trigger: ['blur', 'change'] },]
                 this.OpHotelReservationsDataRules.otherSideNo = [{ required: true, message: '对方银行卡号', trigger: ['blur', 'change'] },]
@@ -938,6 +1008,45 @@ export default {
                     this.OpHotelReservationsData.bankNo = this.bankCard[i].remark
                 }
             }
+            var that = this
+            var cardPriceCurrency = 0;
+            if (that.OpHotelReservationsData.ctdId == '74') {
+                cardPriceCurrency = 950
+            } else if (that.OpHotelReservationsData.ctdId == '75') {
+                cardPriceCurrency = 849
+            } else {
+                cardPriceCurrency = 836
+            }
+
+            var url = "/api/Groups/HotelConversionAmounts"
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                },
+                data: {
+                    cTable: 76,
+                    diId: that.OpHotelReservationsData.diId,
+                    cardPrice: that.OpHotelReservationsData.cardPrice,
+                    cardPriceCurrency: cardPriceCurrency,
+                    governmentRent: that.OpHotelReservationsData.governmentRent,
+                    governmentRentCurrency: that.OpHotelReservationsData.governmentRentCurrency,
+                    cityTax: that.OpHotelReservationsData.cityTax,
+                    cityTaxCurrency: that.OpHotelReservationsData.cityTaxCurrency
+                }
+            }).then(function (res) {
+
+                if (res.data.code == 200) {
+                    var CurrencyBy = res.data.data;
+                    that.OpHotelReservationsData.payMoney = CurrencyBy.price;
+                    that.OpHotelReservationsData.paymentCurrency = CurrencyBy.currencyId
+                } else {
+                    that.$message.error('暂未查到该币种团组汇率,请手动填写付款金额');
+                }
+            }).catch(function (error) {
+                //that.$message.error("网络错误,请稍后重试");
+            });
         },
         budgetCurrencyChange(Id) {
 
@@ -977,9 +1086,7 @@ export default {
                     }
 
                 }
-            }).catch(function (error) {
-                that.$message.error("网络错误,请稍后重试");
-            });
+            })
         },
         bankCardChage(id) {
 
@@ -1010,13 +1117,13 @@ export default {
                     this.OpHotelReservationsData.paymentCurrency = 836
                 }
             }
-            this.ctdIdPay = id
+            this.OpHotelReservationsData.cardPriceCurrency = id
 
             var cId = 0;
-            if (this.OpHotelReservationsData.ctdId == '74') {
+            if (this.OpHotelReservationsData.cardPriceCurrency == '74') {
                 this.CardCurrency = "USD(美元)"
                 cId = 950
-            } else if (this.OpHotelReservationsData.ctdId == '75') {
+            } else if (this.OpHotelReservationsData.cardPriceCurrency == '75') {
                 this.CardCurrency = "EUR(欧元)"
                 cId = 849
             } else {
@@ -1041,9 +1148,9 @@ export default {
         HotelConversionAmounts() {
             var that = this
             var cardPriceCurrency = 0;
-            if (that.OpHotelReservationsData.ctdId == '74') {
+            if (that.OpHotelReservationsData.cardPriceCurrency == '74') {
                 cardPriceCurrency = 950
-            } else if (that.OpHotelReservationsData.ctdId == '75') {
+            } else if (that.OpHotelReservationsData.cardPriceCurrency == '75') {
                 cardPriceCurrency = 849
             } else {
                 cardPriceCurrency = 836
@@ -1088,9 +1195,6 @@ export default {
                         that.OpHotelReservationsData.paymentCurrency = 0;
                     }
                     debugger
-                    if (that.ctdIdPay == '') {
-                        that.ctdIdPay = 0;
-                    }
                     if (that.OpHotelReservationsData.payDId == '') {
                         that.OpHotelReservationsData.payDId = 72
                     }
@@ -1122,7 +1226,7 @@ export default {
                             })
                         }
 
-                        that.OpHotelReservationsData.ctdId = that.ctdIdPay;
+                        //that.OpHotelReservationsData.ctdId = that.ctdIdPay;
                         that.OpHotelReservationsData.createUserId = that.userId
                         var url = "/api/Groups/OpHotelReservations"
                         this.$axios({
@@ -1239,7 +1343,7 @@ export default {
                         }
                     })
                 }
-                that.ctdId = that.ctdIdPay;
+                //that.ctdId = that.ctdIdPay;
                 that.OpHotelReservationsData.createUserId = that.userId
                 that.OpHotelReservationsData.attachment = response.data
                 var url = "/api/Groups/OpHotelReservations"
@@ -1282,7 +1386,6 @@ export default {
                         }
                     })
                 }
-                that.ctdId = that.ctdIdPay;
                 that.OpHotelReservationsData.createUserId = that.userId
                 that.OpHotelReservationsData.attachment = ''
                 var url = "/api/Groups/OpHotelReservations"