MrShi
18 小时以前 e4f9739d74323aacf09d139700f22a383910ee97
admin/src/views/business/labelsYunFee.vue
@@ -3,7 +3,7 @@
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="名称" prop="name">
        <el-input v-model="searchForm.name" placeholder="请输入名称" @keypress.enter.native="search"></el-input>
        <el-input v-model="searchForm.name" placeholder="请输入名称" clearable @keypress.enter.native="search"></el-input>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
@@ -44,6 +44,12 @@
            ></el-switch>
          </template>
        </el-table-column>
        <el-table-column prop="param" label="费用信息" min-width="200px">
          <template slot-scope="{row}">
             <span>首重:{{row.weight0||0}}kg;首重运费:{{row.fee0||0}}元;</span><br>
             <span>续重:{{row.weight1||0}}kg;续重运费增加:{{row.fee1||0}}元;</span>
          </template>
        </el-table-column>
        <el-table-column prop="sortnum" label="排序码" min-width="100px"></el-table-column>
        <el-table-column prop="editDate" label="最近更新时间" min-width="100px"></el-table-column>
        <el-table-column
@@ -76,7 +82,7 @@
import Pagination from '@/components/common/Pagination'
import OperaLabelsFeeAreaWindow from '@/components/business/OperaLabelsFeeAreaWindow'
export default {
  name: 'Labels',
  name: 'labelsYunFee',
  extends: BaseTable,
  components: { OperaLabelsFeeAreaWindow, TableLayout, Pagination },
  data () {
@@ -109,6 +115,43 @@
        .then(() => {
          this.handlePageChange()
        })
    },
    handlePageChange (pageIndex) {
      this.__checkApi()
      this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex
      this.isWorking.search = true
      this.api.fetchList({
        page: this.tableData.pagination.pageIndex,
        capacity: this.tableData.pagination.pageSize,
        model: this.searchForm,
        sorts: this.tableData.sorts
      })
        .then(data => {
          this.tableData.list = data.records
          this.tableData.pagination.total = data.total
          if (this.tableData.pagination.pageIndex === 1) {
            this.tableData.totalData = data.countData || {}
          }
          this.tableData.list.forEach((item, index) => {
            if (item.param) {
              try {
                var t = JSON.parse(item.param)
                if (t) {
                  item.weight0 = parseFloat(t.weight0 || 0)
                  item.fee0 = parseFloat(t.fee0 || 0)
                  item.weight1 = parseFloat(t.weight1 || 0)
                  item.fee1 = parseFloat(t.fee1 || 0)
                }
              } catch (e) {}
            }
          })
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking.search = false
        })
    }
  }
}