zs 2 yıl önce
ebeveyn
işleme
c0ee3d701c

+ 34 - 6
src/views/system/act/goods.vue

@@ -2,12 +2,13 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>活动标题</span> </el-col>
+        <el-col :span="24" class="one"> <span>平台活动商品</span> </el-col>
         <el-col :span="24" class="two">
-          <!-- <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1> -->
+          <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"></search-1>
         </el-col>
         <el-col :span="24" class="thr">
           <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
+          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
         </el-col>
         <el-col :span="24" class="four">
           <data-table
@@ -37,7 +38,7 @@ export default {
   name: 'index',
   props: {},
   components: {
-    // search1: () => import('./parts/search-1.vue'),
+    search1: () => import('./parts/search-2.vue'),
   },
   data: function () {
     const that = this;
@@ -45,8 +46,17 @@ export default {
       // 列表
       opera: [{ label: '删除', method: 'del', confirm: true, type: 'danger' }],
       fields: [
-        { label: '活动标题', model: 'title' },
-        { label: '活动时间', model: 'act_time.value' },
+        { label: '商品名称', model: 'goods.name' },
+        { label: '店铺名称', model: 'shop.name' },
+        {
+          label: '状态',
+          model: 'status',
+          format: (i) => {
+            let data = that.statusList.find((f) => f.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
       ],
       list: [],
       total: 0,
@@ -54,9 +64,12 @@ export default {
       searchForm: {},
       // 多选值
       selected: [],
+      // 状态
+      statusList: [],
     };
   },
   async created() {
+    await this.searchOther();
     await this.search();
   },
   methods: {
@@ -73,7 +86,7 @@ export default {
     },
     // 新增
     toAdd() {
-      this.$router.push({ path: '/system/act/goosDetail' });
+      this.$router.push({ path: '/system/act/goodsDetail' });
     },
     // 删除
     async toDel({ data }) {
@@ -92,6 +105,19 @@ export default {
     handleSelect(data) {
       this.$set(this, `selected`, data);
     },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 是否使用
+      res = await this.dictQuery({ code: 'platformAct_goods_status' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `statusList`, res.data);
+      }
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -124,6 +150,8 @@ export default {
     margin: 0 0 10px 0;
   }
   .thr {
+    display: flex;
+    justify-content: space-between;
     margin: 0 0 10px 0;
   }
 }

+ 1 - 1
src/views/system/act/goodsDetail.vue

@@ -2,7 +2,7 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>平台商品</span> </el-col>
+        <el-col :span="24" class="one"> <span>平台活动商品添加</span> </el-col>
         <el-col :span="24" class="two">
           <el-autocomplete v-model="goods" :fetch-suggestions="querySearchAsync" placeholder="请输入商品名称" @select="handleSelect"></el-autocomplete>
         </el-col>

+ 0 - 5
src/views/system/act/parts/search-1.vue

@@ -8,11 +8,6 @@
               <el-input v-model="form.title" placeholder="请输入活动标题" size="small"></el-input>
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="6">
-            <el-form-item label="编码" prop="value">
-              <el-input v-model="form.value" placeholder="请输入编码" size="small"></el-input>
-            </el-form-item>
-          </el-col> -->
           <el-col :span="24" class="btn">
             <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>

+ 70 - 0
src/views/system/act/parts/search-2.vue

@@ -0,0 +1,70 @@
+<template>
+  <div id="search-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-form :model="form" ref="form" label-width="130px">
+          <el-col :span="6">
+            <el-form-item label="商店名称" prop="shop_name">
+              <el-input v-model="form.shop_name" placeholder="请输入商店名称" size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="商品名称" prop="goods_name">
+              <el-input v-model="form.goods_name" placeholder="请输入商品名称" size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" class="btn">
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>
+          </el-col>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'search-1',
+  props: { form: { type: Object } },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    onSubmit() {
+      this.$emit('onSubmit');
+    },
+    toReset(formName) {
+      this.$refs[formName].resetFields();
+      this.$emit('toReset');
+    },
+  },
+  computed: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .btn {
+    text-align: right;
+  }
+  /deep/.el-form-item {
+    float: left;
+    width: 100%;
+    margin: 0 0 10px 0;
+  }
+}
+</style>