|
@@ -1,48 +1,44 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
|
|
|
+ <admin-frame topType="2" :rightArrow="false" :leftArrow="false" :usePage="false" :useNav="false">
|
|
|
<template v-slot:info>
|
|
|
- <list-1 :list="list" @detail="detail"></list-1>
|
|
|
+ <form-1 :form="form" @onSubmit="onSubmit"></form-1>
|
|
|
</template>
|
|
|
</admin-frame>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import list1 from './parts/list-1.vue';
|
|
|
+import form1 from './parts/form-1.vue';
|
|
|
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
|
|
|
+const { mapActions: patenttechol } = createNamespacedHelpers('patenttechol');
|
|
|
+const moment = require('moment');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
adminFrame,
|
|
|
- list1,
|
|
|
+ form1,
|
|
|
},
|
|
|
data: function () {
|
|
|
return {
|
|
|
- list: [],
|
|
|
- limit: 5,
|
|
|
- total: 0,
|
|
|
+ form: {},
|
|
|
};
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.search();
|
|
|
- },
|
|
|
+ async created() {},
|
|
|
methods: {
|
|
|
- ...patenttrans(['query']),
|
|
|
- async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
|
- let res = await this.query({ skip, limit, ...info });
|
|
|
+ ...patenttechol(['create']),
|
|
|
+ async onSubmit(data) {
|
|
|
+ data.status = '0';
|
|
|
+ data.order_num = 'HC' + moment(new Date()).valueOf();
|
|
|
+ let res = await this.create(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
+ this.$toast({ type: `success`, message: `操作成功` });
|
|
|
+ } else {
|
|
|
+ this.$toast({ type: `error`, message: `${res.errmsg}` });
|
|
|
}
|
|
|
},
|
|
|
- // 详情
|
|
|
- detail(data) {
|
|
|
- this.$router.push({ path: '/market/demand/detail', query: { id: data.id } });
|
|
|
- },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|