| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>订单列表</span>
- </div>
- </div>
- <div class="table-body">
- <el-form :inline="true" :model="searchData" class="demo-form-inline">
- <el-col :span="24">
- <el-form-item label="供应链名称">
- <el-input v-model="searchData.name" placeholder="供应链名称"></el-input>
- </el-form-item>
- </el-col>
- <el-form-item>
- <el-button type="primary" size="small" @click="onSubmit">查询</el-button>
- <el-button type="success" size="small" @click="edit(0)">新增</el-button>
- </el-form-item>
- </el-form>
- <!-- 订单信息 -->
- <template>
- <el-table ref="multipleTable" :data="list" @selection-change="handleSelectionChange">
- <!-- 空数据 -->
- <template slot="empty">
- <el-empty description="暂无订单"></el-empty>
- </template>
- <el-table-column type="selection">
- </el-table-column>
- <el-table-column prop="id" align="center" label="ID">
- </el-table-column>
- <el-table-column prop="app_name" align="center" label="供应链名称">
- </el-table-column>
- <el-table-column prop="app_key" align="center" label="APP KEY">
- </el-table-column>
- <el-table-column prop="created_at" label="创建时间" align="center">
- <template slot-scope="scope">
- {{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
- </template>
- </el-table-column>
- <el-table-column prop="right_btn" label="操作" align="center">
- <template slot-scope="scope">
- <el-button @click="edit(scope.row.id)" type="text">编辑</el-button>
- <el-button @click="copy(scope.row.callback_url)" type="text" class="copy_btn">复制回调地址</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 分页 -->
- <el-row type="flex" class="page" justify="end">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="list"></el-pagination>
- </el-row>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- name: '',
- },
- list: [],
- pageCount: 0,
- page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- checked: false,
- type: '',
- sort: '',
- };
- },
- methods: {
- handleSelectionChange(val) {
- this.select_order = val
- },
- // 全选
- allSelect() {
- if (this.checked) {
- this.goods_list.forEach(function(item, index) {
- if (!item.storage) {
- item.is_select = true
- }
- })
- } else {
- this.goods_list.forEach(function(item, index) {
- item.is_select = false
- })
- }
- },
- //搜索
- onSubmit() {
- this.page = 1
- this.getOrderList()
- },
- pagination(currentPage) {
- this.page = currentPage
- this.getOrderList()
- },
- getOrderList() {
- this.listLoading = true;
- var param = {
- r: 'qi-juhe/supplys/index',
- page: this.page,
- limit: 20
- }
- Object.assign(param, param, this.searchData)
- request({
- params: param,
- }).then(e => {
- if (e.data.code === 0) {
- this.list = e.data.data.list
- this.pageCount = e.data.data.page_count
- this.currentPage = e.data.data.pagination.current_page
- } else {
- this.$message.error(e.data.msg)
- }
- this.listLoading = false
- }).catch(e => {
- this.listLoading = false
- })
- },
- // 编辑
- edit(id) {
- navigateTo({
- r: 'qi-juhe/supplys/edit',
- id: id
- })
- },
- // 复制回调地址
- copy (url) {
- var clipboard = new ClipboardJS('.copy_btn', {
- text: function() {
- return url;
- }
- });
- clipboard.on('success', (e) => {
- this.$message.success('复制成功!');
- clipboard.destroy()
- });
- clipboard.on('error', (e) => {
- this.$message.error('复制失败!');
- this.clipboard.destroy()
- });
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1
- this.getOrderList()
- }
- });
- </script>
- <style>
- </style>
|