ソースを参照

黑屏代码添加title

yuanrf 3 ヶ月 前
コミット
0385fa948c
共有2 個のファイルを変更した34 個の追加15 個の削除を含む
  1. 13 3
      src/components/Resource/OpTicketBlackCode.vue
  2. 21 12
      src/components/Resource/TicketBlackCode.vue

+ 13 - 3
src/components/Resource/OpTicketBlackCode.vue

@@ -54,10 +54,15 @@
                         </el-form-item>
                     </div>
                 </div>
-
             </el-form>
             <el-form :model="OpTicketBlackCodeData" :rules="OpTicketBlackCodeRules" ref="OpTicketBlackCodeData"
                 label-width="100px" class="demo-ruleForm">
+                <div>
+                    <el-form-item label="标题:" prop="title" label-width="160px">
+                        <el-input placeholder="标题" v-model="OpTicketBlackCodeData.title">
+                        </el-input>
+                    </el-form-item>
+                </div>
                 <div>
                     <span style="color: red; padding-left: 100px;">
                         请严格遵守此格式!!! 1.KL1723 SU06DEC AMSBRU 0925 1010 -- -- ERJ190 45M (是中转情况下末尾添加[中转])
@@ -140,7 +145,8 @@ export default {
                 bcPrice: '',
                 ecPrice: '',
                 createUserId: 0,
-                remark: ''
+                remark: '',
+                title: ''
             },
             OpTicketBlackCodeRules: {
                 blackCode: [
@@ -160,6 +166,9 @@ export default {
                     { required: true, message: '请输入机票单价', trigger: ['blur', 'change'] },
                     { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
                 ],
+                title: [
+                    { required: true, message: '该信息为必填信息', trigger: ['blur', 'change'] },
+                ],
             }
         }
     },
@@ -216,6 +225,7 @@ export default {
                         that.OpTicketBlackCodeData.bcPrice = TicketBlackCode.bcPrice
                         that.OpTicketBlackCodeData.ecPrice = TicketBlackCode.ecPrice
                         that.OpTicketBlackCodeData.remark = TicketBlackCode.remark
+                        that.OpTicketBlackCodeData.title = TicketBlackCode.title;
                     }
                 }
 
@@ -236,7 +246,7 @@ export default {
         },
         //点击保存事件
         addBtn() {
-            if (this.DiId == null && this.DiId == undefined && this.DiId == "") {
+            if (!this.DiId) {
                 this.$message.error("请选择团组名称");
                 return;
             }

+ 21 - 12
src/components/Resource/TicketBlackCode.vue

@@ -28,9 +28,10 @@
                     <span style="color:#606266;">{{ DelegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
                     <span style="font-weight: bold;font-size:17px;">起止日期:</span>
                     <span style="color:#606266;">{{ DelegationInfo.visitStartDate }}—{{ DelegationInfo.visitEndDate
-                    }}&nbsp;&nbsp;&nbsp;</span>
+                        }}&nbsp;&nbsp;&nbsp;</span>
                     <span style="font-weight: bold;font-size:17px;">天数/人数:</span>
-                    <span style="color:#606266;">{{ DelegationInfo.visitDays }}天/{{ DelegationInfo.visitPNumber }}人</span>
+                    <span style="color:#606266;">{{ DelegationInfo.visitDays }}天/{{ DelegationInfo.visitPNumber
+                        }}人</span>
                 </div>
             </div>
             <template>
@@ -41,6 +42,14 @@
                             {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
                         </template>
                     </el-table-column>
+                    <el-table-column prop="title" label="标题">
+                        <template slot-scope="scope">
+                            <span v-if="scope.row.title">
+                                {{ scope.row.title }}
+                            </span>
+                            <span v-else style="color: red;">未设置!</span>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="blackCode" label="黑屏代码">
                     </el-table-column>
                     <el-table-column prop="price" label="经济舱现价">
@@ -83,7 +92,7 @@ export default {
             pageSize: 12,// 每页的数据条数
             token: '',
             userId: 0,
-            DiIdSelect:'',
+            DiIdSelect: '',
             DiId: '',
             DelegationSelect: [],
             DelegationInfo: {}
@@ -117,7 +126,7 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     that.DelegationSelect = res.data.data;
-                    if(that.DiId==''){
+                    if (that.DiId == '') {
                         that.DiId = that.DelegationSelect[0].id
                     }
                     // console.log(that.DiId)
@@ -130,7 +139,7 @@ export default {
         },
         //团组下拉框值改变事件
         AirTicketResSelectChange() {
-            this.DiIdSelect='';
+            this.DiIdSelect = '';
             this.QueryTicketBlackCodeByDiId();
         },
         QueryTicketBlackCodeByDiId() {
@@ -143,13 +152,13 @@ export default {
                     Authorization: 'Bearer ' + this.token
                 },
                 data: {
-                    diId: that.DiIdSelect?that.DiIdSelect:that.DiId
+                    diId: that.DiIdSelect ? that.DiIdSelect : that.DiId
                 }
             }).then(function (res) {
                 console.log(res)
 
                 if (res.data.code == 200) {
-                    
+
                     that.tableData = res.data.data.ticketBlackCodes;
                     that.DelegationInfo = res.data.data.delegationInfo
                     that.tableDatas = that.tableData;
@@ -170,18 +179,18 @@ export default {
             this.$router.push({
                 path: "/home/OpTicketBlackCode",
                 query: {
-                    DiId: this.DiIdSelect?this.DiIdSelect:this.DiId,
+                    DiId: this.DiIdSelect ? this.DiIdSelect : this.DiId,
                     id: row.id
                 }
             })
         },
-       
+
         addIf() {
             if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
                 this.$router.push({
                     path: "/home/OpTicketBlackCode",
                     query: {
-                        DiId: this.DiIdSelect?this.DiIdSelect:this.DiId,
+                        DiId: this.DiIdSelect ? this.DiIdSelect : this.DiId,
                     }
                 })
 
@@ -235,11 +244,11 @@ export default {
     },
     mounted() {
         this.DiIdSelect = parseInt(this.$route.query.DiId)
-        if(this.DiIdSelect){
+        if (this.DiIdSelect) {
 
             this.DiId = parseInt(this.$route.query.DiId)
         }
-        console.log(this.DiId,this.DiIdSelect)
+        console.log(this.DiId, this.DiIdSelect)
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
         this.DelegationSelectFun()