Explorar o código

添加盲票时新增字段以及搜索范围

DELL %!s(int64=3) %!d(string=hai) anos
pai
achega
99ce9998df

+ 1 - 1
src/views/business/goods/index.vue

@@ -114,7 +114,7 @@
           <span v-if="row.exchangeShow == '0'">不支持</span>
         </template>
       </el-table-column>
-      <el-table-column label="兑换盲豆数量" prop="exchangePrice" sortable="custom" min-width="125" />
+      <el-table-column label="盲豆兑换数量" prop="exchangePrice" sortable="custom" min-width="125" />
       <el-table-column label="销量" prop="exchangedQty" sortable="custom" />
       <el-table-column label="库存" prop="quantity" sortable="custom" />
       <el-table-column label="状态" prop="status">

+ 71 - 32
src/views/business/ticket/components/GoodsAdd.vue

@@ -7,21 +7,35 @@
       :before-close="close"
     >
       <div class="dialog-search">
-        <div>商品名称:</div>
+        <div style="margin:0 0 10px 20px">商品名称:</div>
         <el-input
           v-model="goodsTitle"
           placeholder="请输入商品名称"
           clearable
           size="small"
-          style="width: 220px" @clear="queryParams.pageNum = 1;getGoodsList()"
-          @keyup.enter.native="queryParams.pageNum = 1;getGoodsList()"
+          style="width: 220px" @clear="pageParams.pageNum = 1;getGoodsList()"
+          @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"
         />
         <div style="margin-left: 20px">商品价格:</div>
-<!--        <el-input v-model="minValue" placeholder="最低价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getList()" />-->
-        <el-input style="width: 220px" v-model="queryParams.minValue"  @clear="queryParams.pageNum = 1;getGoodsList()" placeholder="最低价格" clearable @keyup.enter.native="queryParams.pageNum = 1;getGoodsList()"/>
+        <el-input style="width: 220px" v-model="queryParams.minValue" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最低价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
         <div style="width: 20px;text-align: center">-</div>
-<!--        <el-input v-model="maxValue" placeholder="最高价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getList()" />-->
-        <el-input style="width: 220px" v-model="queryParams.maxValue"  @clear="queryParams.pageNum = 1;getGoodsList()" placeholder="最高价格" clearable @keyup.enter.native="queryParams.pageNum = 1;getGoodsList()"/>
+        <el-input style="width: 220px" v-model="queryParams.maxValue" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最高价格" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
+        <br>
+        <div style="margin:0 0 10px 20px">盲豆兑换数量:</div>
+        <el-input style="width: 220px" v-model="queryParams.minExchange" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最低盲豆数量" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
+        <div style="width: 20px;text-align: center">-</div>
+        <el-input style="width: 220px" v-model="queryParams.maxExchange" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最高盲豆数量" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
+        <br>
+        <div style="margin:0 0 10px 20px">商品成本:</div>
+        <el-input style="width: 220px" v-model="queryParams.minCost" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最低成本" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
+        <div style="width: 20px;text-align: center">-</div>
+        <el-input style="width: 220px" v-model="queryParams.maxCost" @clear="pageParams.pageNum = 1;getGoodsList()"
+                  placeholder="最高成本" clearable @keyup.enter.native="pageParams.pageNum = 1;getGoodsList()"/>
 
         <div class="ge"></div>
         <el-button
@@ -29,7 +43,8 @@
           icon="el-icon-search"
           size="mini"
           @click="getGoodsList()"
-          >查询</el-button
+        >查询
+        </el-button
         >
       </div>
       <el-table
@@ -44,7 +59,7 @@
           align="center"
           fixed="left"
         />
-        <el-table-column label="商品ID" prop="goodsId" />
+        <el-table-column label="商品ID" prop="goodsId"/>
         <el-table-column label="商品图片">
           <template slot-scope="{ row }">
             <div v-if="row.picUrl">
@@ -58,15 +73,31 @@
             <p v-else>-</p>
           </template>
         </el-table-column>
-        <el-table-column label="商品名称" prop="title" min-width="85" />
+        <el-table-column label="商品名称" prop="title" min-width="85"/>
 
         <el-table-column label="商品价格" min-width="85">
           <template slot-scope="scope">
             <div>¥{{ $numberFormat(scope.row.value) }}</div>
           </template>
         </el-table-column>
-        <el-table-column label="商品库存" prop="quantity" width="80" />
+
+        <el-table-column label="盲豆兑换数量" prop="exchangePrice" min-width="85"/>
+
+        <el-table-column label="商品成本" min-width="85">
+          <template slot-scope="scope">
+            <div>¥{{ $numberFormat(scope.row.cost) }}</div>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="是否支持兑换" prop="exchangeShow" min-width="85">
+          <template slot-scope="scope">
+            <div>{{scope.row.exchangeShow == 1 ? '支持兑换':'不支持兑换' }}</div>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="商品库存" prop="quantity" width="80"/>
       </el-table>
+      <div style="width: 700px;"></div>
       <pagination
         v-show="goodsTotal > 0"
         :total="goodsTotal"
@@ -75,8 +106,9 @@
         @pagination="getGoodsList"
       />
       <div class="dialog-btn">
-        <el-button size="small" @click="close"> 取 消 </el-button>
-        <div class="ge"></div>
+        <div style="width: 20px;"></div>
+        <el-button size="small" @click="close"> 取 消</el-button>
+        <div style="width: 20px;"></div>
         <el-button type="primary" size="small" @click="confirmGoods">
           确 认
         </el-button>
@@ -85,9 +117,10 @@
   </div>
 </template>
 <script>
-import { publicFileGetUrl } from "@/api/common";
-import { getGoodsList } from "@/api/business/goods";
-import { accMul } from '@/utils/util'
+import {publicFileGetUrl} from "@/api/common";
+import {getGoodsList} from "@/api/business/goods";
+import {accMul} from '@/utils/util'
+
 export default {
   name: "GoodsAdd",
   props: {
@@ -100,7 +133,7 @@ export default {
     return {
       loading: false,
       goodsTitle: "", // 商品名称
-      queryParams:{},
+      queryParams: {},
 
       goodsList: [], // 商品列表
       goodsTotal: 0, // 商品总数
@@ -118,13 +151,23 @@ export default {
     // 商品列表
     getGoodsList() {
       this.loading = true;
+
       getGoodsList(
         "pageNum=" +
-          this.pageParams.pageNum +
-          "&pageSize=" +
-          this.pageParams.pageSize +
-          "&",
-        { title: this.goodsTitle,  status: "on", minValue: this.queryParams.minValue?accMul(this.queryParams.minValue, 100):this.queryParams.minValue, maxValue: this.queryParams.maxValue?accMul(this.queryParams.maxValue, 100):this.queryParams.maxValue,}
+        this.pageParams.pageNum +
+        "&pageSize=" +
+        this.pageParams.pageSize +
+        "&",
+        {
+          title: this.goodsTitle,
+          status: "on",
+          minValue: this.queryParams.minValue ? accMul(this.queryParams.minValue, 100) : this.queryParams.minValue,
+          maxValue: this.queryParams.maxValue ? accMul(this.queryParams.maxValue, 100) : this.queryParams.maxValue,
+          minExchange:this.queryParams.minExchange,
+          maxExchange:this.queryParams.maxExchange,
+          minCost: this.queryParams.minCost ? accMul(this.queryParams.minCost, 100) : this.queryParams.minCost,
+          maxCost: this.queryParams.maxCost ? accMul(this.queryParams.maxCost, 100) : this.queryParams.maxCost,
+        }
       ).then((res) => {
         this.goodsList = res.rows.map((item) => {
           return {
@@ -163,21 +206,17 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+div {
+  display: inline-block;
+}
 .dialog-search {
-  display: flex;
+  //display: flex;
   line-height: 32px;
   margin-bottom: 20px;
+
   .ge {
     width: 20px;
   }
 }
-.dialog-btn {
-  display: flex;
-  align-content: center;
-  justify-content: flex-end;
-  padding: 40px 0 0;
-  .ge {
-    width: 20px;
-  }
-}
+
 </style>