显示订单需要获取传递参数
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
html, body, #app {
|
||||
height: 100%;
|
||||
margin: 0,0,0,0;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
:host, :root {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import './assets/main.css'
|
||||
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createI18n } from 'vue-i18n'
|
||||
@@ -8,6 +8,8 @@ import router from './router'
|
||||
|
||||
import '@tabler/core/dist/css/tabler.min.css'
|
||||
|
||||
import './assets/main.css'
|
||||
|
||||
|
||||
import en from './i18n/en.json'
|
||||
import zhCN from './i18n/zh-CN.json'
|
||||
|
||||
@@ -77,6 +77,11 @@ const router = createRouter({
|
||||
path: "/purchase/addorder",
|
||||
name: "purchase/addorder",
|
||||
component: () => import("@/views/purchase/addorder.vue"),
|
||||
},
|
||||
{
|
||||
path: "/purchase/showorder/:id",
|
||||
name: "purchase/showorder",
|
||||
component: () => import("@/views/purchase/showorder.vue"),
|
||||
},
|
||||
{
|
||||
path: "/warehouse",
|
||||
|
||||
@@ -13,5 +13,7 @@ const mos = ref();
|
||||
<template>
|
||||
|
||||
|
||||
|
||||
|
||||
<MyOffcanvas ref="mos" />
|
||||
</template>
|
||||
|
||||
@@ -6,6 +6,9 @@ const mos = ref();
|
||||
import { my_network_func } from "@/my_network_func";
|
||||
import { myfuncs } from "@/myfunc";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const all_items = ref(0);
|
||||
@@ -21,6 +24,17 @@ const page_end = ref(0);
|
||||
const page_input = ref();
|
||||
const page_items_items = ref("10");
|
||||
|
||||
function jump_to_order(order_id) {
|
||||
//console.log(order_id);
|
||||
|
||||
var order_str=order_id.toString()
|
||||
|
||||
const resolved = router.resolve({
|
||||
path: "/purchase/showorder/" + order_str,
|
||||
});
|
||||
window.open(resolved.href, "_blank");
|
||||
}
|
||||
|
||||
//获取订单列表
|
||||
function get_orders() {
|
||||
my_network_func.postJson(
|
||||
@@ -138,8 +152,6 @@ watch(locale, () => {
|
||||
<template>
|
||||
<div class="page-body">
|
||||
<div class="container-xl">
|
||||
<div class="row row-cards">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ t("purchase.purchase_list") }}</h3>
|
||||
@@ -147,17 +159,6 @@ watch(locale, () => {
|
||||
<div class="card-body border-bottom py-3">
|
||||
<div class="d-flex">
|
||||
<div class="text-secondary">
|
||||
<!-- {{ t("purchase.show") }}
|
||||
<div class="mx-2 d-inline-block">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control form-control-sm"
|
||||
value="8"
|
||||
size="3"
|
||||
aria-label="Invoices count"
|
||||
/>
|
||||
</div>
|
||||
{{ t("purchase.entries") }} -->
|
||||
<router-link to="/purchase/addorder" class="btn btn-info m-1">
|
||||
{{ t("purchase.add_part") }}
|
||||
</router-link>
|
||||
@@ -166,6 +167,7 @@ watch(locale, () => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- //搜索dom -->
|
||||
<div class="ms-auto text-secondary">
|
||||
{{ t("purchase.search") }}
|
||||
<div class="ms-2 d-inline-block mr-2">
|
||||
@@ -181,9 +183,7 @@ watch(locale, () => {
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
class="table card-table table-vcenter text-nowrap datatable"
|
||||
>
|
||||
<table class="table card-table table-vcenter text-nowrap datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-1">
|
||||
@@ -214,18 +214,18 @@ watch(locale, () => {
|
||||
</th>
|
||||
<th class="col-3">{{ t("purchase.item_name") }}</th>
|
||||
<th class="col-3">{{ t("purchase.purpose") }}</th>
|
||||
<!-- <th class="w-1">{{ t("purchase.unit") }}</th> -->
|
||||
<th class="w-1">{{ t("purchase.quantity") }}</th>
|
||||
<!-- <th class="w-1">{{ t("purchase.unit_price") }}</th>
|
||||
<th class="w-1">{{ t("purchase.total_price") }}</th> -->
|
||||
<th class="w-1">{{ t("purchase.created_at") }}</th>
|
||||
<th class="w-1">{{ t("purchase.updated_at") }}</th>
|
||||
<th class="w-1">{{ t("purchase.status") }}</th>
|
||||
<th class="w-1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="value in all_orders">
|
||||
<tr
|
||||
v-for="value in all_orders"
|
||||
class="element"
|
||||
@click="jump_to_order(value.ID)"
|
||||
>
|
||||
<td>
|
||||
<input
|
||||
class="form-check-input m-0 align-middle"
|
||||
@@ -240,64 +240,13 @@ watch(locale, () => {
|
||||
{{ value.Title }}
|
||||
</td>
|
||||
<td>{{ value.Remark }}</td>
|
||||
<td>
|
||||
<!-- <div class="datagrid-content">
|
||||
<div class="avatar-list avatar-list-stacked">
|
||||
<span
|
||||
class="avatar avatar-xs rounded"
|
||||
style="
|
||||
background-image: url(./static/avatars/000m.jpg);
|
||||
"
|
||||
></span>
|
||||
<span class="avatar avatar-xs rounded">JL</span>
|
||||
<span
|
||||
class="avatar avatar-xs rounded"
|
||||
style="
|
||||
background-image: url(./static/avatars/002m.jpg);
|
||||
"
|
||||
></span>
|
||||
<span
|
||||
class="avatar avatar-xs rounded"
|
||||
style="
|
||||
background-image: url(./static/avatars/003m.jpg);
|
||||
"
|
||||
></span>
|
||||
<span
|
||||
class="avatar avatar-xs rounded"
|
||||
style="
|
||||
background-image: url(./static/avatars/000f.jpg);
|
||||
"
|
||||
></span>
|
||||
<span class="avatar avatar-xs rounded">+3</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</td>
|
||||
<td>1</td>
|
||||
<td>
|
||||
{{ myfuncs.formatLocalizedDate(value.CreatedAt, locale) }}
|
||||
</td>
|
||||
<td>{{ myfuncs.formatLocalizedDate(value.UpdatedAt) }}</td>
|
||||
<td></td>
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>
|
||||
<input
|
||||
class="form-check-input m-0 align-middle"
|
||||
type="checkbox"
|
||||
aria-label="Select invoice"
|
||||
/>
|
||||
</td>
|
||||
<td><span class="text-muted">001</span></td>
|
||||
<td>办公室用纸</td>
|
||||
<td>办公用品</td>
|
||||
<td>包</td>
|
||||
<td>10</td>
|
||||
<td>15.00</td>
|
||||
<td>150.00</td>
|
||||
<td>2024-06-01</td>
|
||||
<td>2024-06-05</td>
|
||||
<td><span class="badge bg-success me-1"></span> 已完成</td>
|
||||
<td class="text-end"></td>
|
||||
</tr> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -462,8 +411,12 @@ watch(locale, () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MyOffcanvas ref="mos" />
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.element:hover {
|
||||
background-color: #4299e11c;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<script setup>
|
||||
import { onMounted, watch, ref, reactive } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
const dynamicParam = router
|
||||
|
||||
onMounted(() => {
|
||||
console.log(dynamicParam);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
</template>
|
||||
Reference in New Issue
Block a user