浏览代码

修改订单查询

YY 2 年之前
父节点
当前提交
15ccae874d

+ 21 - 2
src/components/orderParts/parts/detail-3.vue

@@ -4,7 +4,16 @@
       <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
         <el-col :span="24" v-if="num == '1'">
           <el-col :span="24" class="one">
-            <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+            <search-1
+              :form="searchForm"
+              :shopList="shopList"
+              :goodsList="goodsList"
+              @onSubmit="search"
+              @querySearch="querySearch"
+              @toReset="toClose"
+              @goodsSearch="goodsSearch"
+            >
+            </search-1>
           </el-col>
           <el-col :span="24" class="one">
             <el-button type="primary" size="mini" @click="toDeliver()">生成发货清单</el-button>
@@ -38,10 +47,11 @@ const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('groupOrder');
 const { mapActions: shop } = createNamespacedHelpers('shop');
+const { mapActions: goods } = createNamespacedHelpers('goods');
 export default {
   name: 'card-1',
   props: { statusList: { type: Array } },
-  components: { search1: () => import('../search-2.vue') },
+  components: { search1: () => import('../search-3.vue') },
   data: function () {
     return {
       loadings: true,
@@ -66,7 +76,10 @@ export default {
       ],
       // 多选值
       selected: [],
+      // 店铺列表
       shopList: [],
+      // 商品列表
+      goodsList: [],
       // 发货清单
       deliverList: [],
       deliver: '0',
@@ -77,6 +90,7 @@ export default {
   },
   methods: {
     ...shop({ shopQuery: 'query' }),
+    ...goods({ goodsQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
@@ -122,6 +136,11 @@ export default {
       let res = await this.shopQuery({ name: value });
       if (this.$checkRes(res)) this.$set(this, 'shopList', res.data);
     },
+    //商品名称远程查询
+    async goodsSearch(value) {
+      let res = await this.goodsQuery({ name: value });
+      if (this.$checkRes(res)) this.$set(this, 'goodsList', res.data);
+    },
   },
   computed: {
     ...mapState(['user']),

+ 1 - 0
src/components/orderParts/search-1.vue

@@ -19,6 +19,7 @@
                 <el-select
                   v-model="form.shop"
                   filterable
+                  clearable
                   remote
                   reserve-keyword
                   placeholder="请输入商铺名称"

+ 125 - 0
src/components/orderParts/search-3.vue

@@ -0,0 +1,125 @@
+<template>
+  <div id="search-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-form :model="form" ref="form" label-width="130px">
+          <el-col>
+            <el-col :span="6">
+              <el-form-item label="订单号" prop="no">
+                <el-input v-model="form.no" placeholder="请输入订单号" size="small"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="商品名称" prop="goods">
+                <el-select v-model="form.goods" clearable filterable remote placeholder="请输入商品名称" :remote-method="goodsSearch" :loading="loading">
+                  <el-option v-for="item in goodsList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="6">
+              <el-form-item label="规格名称" prop="goodsSpec">
+                <el-select v-model="form.goodsSpec" clearable filterable remote placeholder="请输入规格名称" :remote-method="specSearch" :loading="loading">
+                  <el-option v-for="item in specList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="6">
+              <el-form-item label="店铺名称" prop="type">
+                <el-select v-model="form.shop" clearable filterable remote placeholder="请输入商铺名称" :remote-method="querySearch" :loading="loading">
+                  <el-option v-for="item in shopList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-col>
+          <el-col>
+            <el-col :span="7">
+              <el-form-item label="下单日期" prop="buy_time">
+                <el-date-picker
+                  v-model="form.buy_time"
+                  type="daterange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  value-format="yyyy-MM-dd"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </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 },
+    shopList: { type: Array },
+    goodsList: { type: Array },
+    // specList: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {
+      loading: false,
+    };
+  },
+  created() {},
+  methods: {
+    querySearch(value) {
+      this.loading = true;
+      this.$emit('querySearch', value);
+      this.loading = false;
+    },
+    // specSearch(value) {
+    //   this.loading = true;
+    //   this.$emit('specSearch', value);
+    //   this.loading = false;
+    // },
+    goodsSearch(value) {
+      this.loading = true;
+      this.$emit('goodsSearch', value);
+      this.loading = false;
+    },
+    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>

+ 1 - 1
src/components/salesParts/guide_detail.vue

@@ -153,7 +153,7 @@ export default {
       transport: {},
       typeList: [],
       statusList: [],
-      status: [],
+      // status: [],
       form: {},
       info: {},
       // 物流

+ 23 - 5
src/views/platGroup/order/index.vue

@@ -23,7 +23,16 @@
               </el-col>
               <el-col :span="24" v-else-if="activeName != '2'">
                 <el-col :span="24" class="one">
-                  <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+                  <search-1
+                    :form="searchForm"
+                    :shopList="shopList"
+                    :goodsList="goodsList"
+                    @onSubmit="search"
+                    @querySearch="querySearch"
+                    @toReset="toClose"
+                    @goodsSearch="goodsSearch"
+                  >
+                  </search-1>
                 </el-col>
                 <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
                   <template #is_afterSale="{ row }">
@@ -48,6 +57,7 @@ const _ = require('lodash');
 import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions: dictData } = createNamespacedHelpers('dictData');
 const { mapActions: shop } = createNamespacedHelpers('shop');
+const { mapActions: goods } = createNamespacedHelpers('goods');
 const { mapActions } = createNamespacedHelpers('groupOrder');
 export default {
   name: 'index',
@@ -56,7 +66,7 @@ export default {
     card2: () => import('@/components/orderParts/card-4.vue'),
     group_order: () => import('@/components/orderParts/detail/group_order.vue'),
     group_sales: () => import('@/components/orderParts/detail/group_sales.vue'),
-    search1: () => import('@/components/orderParts/search-2.vue'),
+    search1: () => import('@/components/orderParts/search-3.vue'),
   },
   data: function () {
     return {
@@ -67,6 +77,10 @@ export default {
       statusList: [],
       // 店铺列表
       shopList: [],
+      // 商品列表
+      goodsList: [],
+      // 规格列表
+      // specList: [],
       order_id: '',
       sales_id: '',
       status: '',
@@ -97,6 +111,7 @@ export default {
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...shop({ shopQuery: 'query' }),
+    ...goods({ goodsQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
@@ -107,6 +122,7 @@ export default {
         delete condition.buy_time;
       }
       if (this.activeName == '1') info.status = '0';
+      else if (this.activeName == '2') info.status = '1';
       else if (this.activeName == '3') info.status = '2';
       else if (this.activeName == '4') info.status = '3';
       else if (this.activeName == '5') info.status = '-1';
@@ -163,15 +179,17 @@ export default {
       let res = await this.shopQuery({ name: value });
       if (this.$checkRes(res)) this.$set(this, 'shopList', res.data);
     },
+    //商品名称远程查询
+    async goodsSearch(value) {
+      let res = await this.goodsQuery({ name: value });
+      if (this.$checkRes(res)) this.$set(this, 'goodsList', res.data);
+    },
     // 查询其他信息
     async searchOther() {
       let res;
       // 类型
       res = await this.dictQuery({ code: 'order_process' });
       if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
-      // 店铺
-      res = await this.shopQuery();
-      if (this.$checkRes(res)) this.$set(this, `shopList`, res.data);
     },
   },
   computed: {