lilei 4 gadi atpakaļ
vecāks
revīzija
471668734e

+ 11 - 3
src/views/financialManagement/expenseManagement/list.vue

@@ -11,7 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker v-model="createDate" id="expenseManagementList-creatDate"/>
+              <a-range-picker v-model="createDate" :disabledDate="disabledDate" id="expenseManagementList-creatDate"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -74,7 +74,7 @@
       bordered>
 
       <!-- 状态 -->
-      <template slot="accountExpensesSn" slot-scope="text, record">
+      <template slot="accountExpensesNo" slot-scope="text, record">
         <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ text }}</span>
       </template>
       <!-- 操作 -->
@@ -142,7 +142,7 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '费用单号', dataIndex: 'accountExpensesSn', width: 250, align: 'center', scopedSlots: { customRender: 'accountExpensesSn' } },
+        { title: '费用单号', dataIndex: 'accountExpensesNo', width: 250, align: 'center', scopedSlots: { customRender: 'accountExpensesNo' } },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用类型', dataIndex: 'name', align: 'center', customRender: function (text, record) { return [record.expensesTypeName1, record.expensesTypeName2, record.expensesTypeName3].join(' > ') } },
         { title: '金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
@@ -155,9 +155,13 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 300
         }
+        console.log(this.createDate)
         if (this.createDate.length > 0) {
           this.queryParam.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
           this.queryParam.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
         }
         return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
@@ -181,6 +185,10 @@ export default {
     }
   },
   methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
     //  递归函数
     recursionFun (data) {
       if (data) {