|
@@ -0,0 +1,106 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="index">
|
|
|
|
+ <div class="w_0100">
|
|
|
|
+ <div class="w_1200">
|
|
|
|
+ <div class="servicemain">
|
|
|
|
+ <div class="infocontext">
|
|
|
|
+ <contextfabu v-on="$listeners" :demandForm="demandForm" @demandSubmit="sumbit" :columnList="columnList"></contextfabu>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import contextfabu from '@/layout/enterprise/contextfabu.vue';
|
|
|
|
+const { mapActions: mapMarkettype } = createNamespacedHelpers('markettype');
|
|
|
|
+const { mapActions: mapMarketproduct } = createNamespacedHelpers('marketproduct');
|
|
|
|
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
|
|
|
|
+export default {
|
|
|
|
+ name: 'index',
|
|
|
|
+ props: {},
|
|
|
|
+ components: {
|
|
|
|
+ contextfabu,
|
|
|
|
+ },
|
|
|
|
+ data: () => {
|
|
|
|
+ return {
|
|
|
|
+ demandForm: {},
|
|
|
|
+ columnList: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.maarkettype();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapMarkettype({ markettypeList: 'query' }),
|
|
|
|
+ ...mapMarketproduct({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update' }),
|
|
|
|
+ async sumbit(demandForm) {
|
|
|
|
+ this.demandForm.status = '0';
|
|
|
|
+
|
|
|
|
+ let data = this.demandForm;
|
|
|
|
+ console.log(data);
|
|
|
|
+
|
|
|
|
+ console.log(data);
|
|
|
|
+ data.userid = this.user.uid;
|
|
|
|
+ let res;
|
|
|
|
+ let msg;
|
|
|
|
+
|
|
|
|
+ if (data.id) {
|
|
|
|
+ res = await this.productUpdate(data);
|
|
|
|
+ msg = `${this.keyWord}修改成功`;
|
|
|
|
+ } else {
|
|
|
|
+ res = await this.productCreate(data);
|
|
|
|
+ msg = `${this.keyWord}添加成功等待审核`;
|
|
|
|
+ }
|
|
|
|
+ if (this.$checkRes(res, msg)) this.$router.push({ path: '/market/index' });
|
|
|
|
+ },
|
|
|
|
+ // 查询类型
|
|
|
|
+ async maarkettype({ category = 123, ...info } = {}) {
|
|
|
|
+ const res = await this.markettypeList({ category, ...info });
|
|
|
|
+ console.log(res.data);
|
|
|
|
+
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `columnList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ id() {
|
|
|
|
+ return this.$route.query.id;
|
|
|
|
+ },
|
|
|
|
+ keyWord() {
|
|
|
|
+ let meta = this.$route.meta;
|
|
|
|
+ let main = meta.title || '';
|
|
|
|
+ return main;
|
|
|
|
+ },
|
|
|
|
+ pageTitle() {
|
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.w_1200 {
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ width: 80%;
|
|
|
|
+ min-height: 600px;
|
|
|
|
+}
|
|
|
|
+.serviceOne {
|
|
|
|
+ margin: 20px 0 0 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.infocontext {
|
|
|
|
+ min-height: 100px;
|
|
|
|
+ box-shadow: 0 0 10px #2d64b3;
|
|
|
|
+ width: 100%;
|
|
|
|
+ float: left;
|
|
|
|
+
|
|
|
|
+ margin: 25px 0 10px 0;
|
|
|
|
+}
|
|
|
|
+</style>
|