Преглед на файлове

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

liuhj преди 1 година
родител
ревизия
0f29067209
променени са 1 файла, в които са добавени 49 реда и са изтрити 7 реда
  1. 49 7
      src/components/OP/CarTouristGuideGrounContent.vue

+ 49 - 7
src/components/OP/CarTouristGuideGrounContent.vue

@@ -46,14 +46,14 @@
             <hr style='background-color:#5555; height:1px; border:none;' />
             <div>
                 <template>
-                    <el-table :data="ContentList" :border=true style="width: 100%">
+                    <el-table :data="ContentList" :border=true style="width: 100%" :span-method="objectSpanMethod">
                         <el-table-column prop="num" label="序 号" width="55">
                             <template slot-scope="scope">
                                 {{ scope.$index + 1 }}
 
                             </template>
                         </el-table-column>
-                        <el-table-column prop="SIdName" label="费用项目" width="120">
+                        <el-table-column :align="'center'" prop="SIdName" label="费用项目" width="120">
                             <template slot-scope="scope">
                                 <span style="display: none;">{{ scope.row.sId }}</span>{{ scope.row.sidName }}
                             </template>
@@ -85,9 +85,13 @@
                         </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"
+                                <!-- <el-input size="small" style="width: 100%;" placeholder="数量" v-model="scope.row.count"
                                     @change="PriceChange">
-                                </el-input>
+                                </el-input> -->
+                                <div class="el-input-number-style">
+                                    <el-input-number size="small" placeholder="数量" v-model="scope.row.count"
+                                        style="width: 100%;" :controls="false" @change="PriceChange"></el-input-number>
+                                </div>
                             </template>
                         </el-table-column>
                         <el-table-column label="单位" width="200">
@@ -228,10 +232,11 @@ export default {
                     { required: true, message: '请选择付款方式', trigger: ['blur', 'change'] },
                 ]
             },
-            unitsArr: [],
+            unitsArr: [{ id: 0, name: '请选择', remark: '' }],
             checkItems: ["车费", "导游费", "客户午餐费用", "导游景点费", "导游小费", "接送机费", "其他费用", "司机工资", "司机小费", "司机餐补", "车超时费", "导游餐补", "导游房补", "导游交通", "客户早餐费用", "客户晚餐费用", "景点门票费", "饮料/零食/水果", "住补费用", "翻译费"],
             checkList: [],
             sourceList: [],
+            ListCount: 1,
         }
     },
     methods: {
@@ -276,7 +281,7 @@ export default {
                         that.IsAuditGM = CreditCardPayment.isAuditGM;
                     }
 
-                    that.unitsArr = res.data.data.ssdv;
+                    that.unitsArr = that.unitsArr.concat(res.data.data.ssdv);
 
                     var start = new Date(res.data.data.start).getTime();
                     var end = new Date(res.data.data.end).getTime();
@@ -443,7 +448,7 @@ export default {
             var countCost = 0;
             this.ContentList.forEach(function (item) {
                 if (item.price) {
-                    countCost += parseFloat(item.price)
+                    countCost += Number(item.price) * Number(item.count)
                 }
             })
 
@@ -459,6 +464,43 @@ export default {
                 }
             }
             this.PriceChange();
+            var count = 1;
+            if (this.ContentList.length > 0) {
+                var sid = this.ContentList[0].sId;
+                count = this.ContentList.filter(x => x.sId == sid).length;
+            }
+            this.ListCount = count;
+        },
+        objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+            if (columnIndex === 1) {
+
+                if (rowIndex % this.ListCount === 0) {
+                    return {
+                        rowspan: this.ListCount,
+                        colspan: 1
+                    };
+                } else {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                }
+
+                // if (columnIndex === 1) {
+                //     if (rowIndex % 2 === 0) {
+                //         return {
+                //             rowspan: 2,
+                //             colspan: 1
+                //         };
+                //     } else {
+                //         return {
+                //             rowspan: 0,
+                //             colspan: 0
+                //         };
+                //     }
+                // }
+
+            }
         }
     },