Browse Source

修改门票日期

zs 1 year ago
parent
commit
a90fcf05a2
2 changed files with 12 additions and 2 deletions
  1. 1 1
      src/views/basic/ticket/detail.vue
  2. 11 1
      src/views/basic/ticket/index.vue

+ 1 - 1
src/views/basic/ticket/detail.vue

@@ -74,7 +74,7 @@ let fields: Ref<any[]> = ref([
   { label: '出游人群', model: 'person', type: 'select' },
   { label: '服务特色', model: 'type', type: 'select' },
   { label: '地点', model: 'address', type: 'textarea' },
-  { label: '日期', model: 'date', type: 'date' },
+  { label: '日期', model: 'date', type: 'daterange' },
   { label: '开放时间', model: 'open_time' },
   { label: '图片', model: 'file', custom: true },
   { label: '购买须知', model: 'buy_explain', custom: true },

+ 11 - 1
src/views/basic/ticket/index.vue

@@ -20,6 +20,11 @@
         </el-col>
         <el-col :span="24" class="thr">
           <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @edit="toEdit" @del="toDel">
+            <template #date="{ item, row }">
+              <template v-if="item.model === 'date'">
+                <span>{{ getProps(row, item.model) }}</span>
+              </template>
+            </template>
             <template #is_use="{ row }">
               <el-switch
                 v-model="row.is_use"
@@ -51,6 +56,7 @@
 
 <script setup lang="ts">
 // 基础
+import _ from 'lodash';
 import store from '@/stores/counter';
 import type { Ref } from 'vue';
 import { ref, onMounted, getCurrentInstance } from 'vue';
@@ -74,7 +80,7 @@ let skip = 0;
 let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '名称', model: 'name', isSearch: true },
-  { label: '日期', model: 'date' },
+  { label: '日期', model: 'date', custom: true },
   { label: '销售金额', model: 'money' },
   { label: '出游人群', model: 'person', type: 'select', isSearch: true, format: (i: any) => getDict(i, personList.value) },
   { label: '服务特色', model: 'type', type: 'select', isSearch: true, format: (i: any) => getDict(i, typeList.value) },
@@ -127,6 +133,10 @@ const getDict = (value: any, model) => {
     else return '暂无';
   }
 };
+const getProps = (data: any, prop: any) => {
+  const date = _.get(data, prop);
+  return date.join('-');
+};
 // 审核
 const toExam = async (data: any) => {
   let res: IQueryResult = await ticketAxios.fetch(data._id);