This commit is contained in:
		
							parent
							
								
									33fadf2819
								
							
						
					
					
						commit
						e70e0e9c0b
					
				| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					import $http from "@/utils/httpRequest.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const preSale = {
 | 
				
			||||||
 | 
					  //优惠券列表
 | 
				
			||||||
 | 
					  preSaleProducts: (data) => {
 | 
				
			||||||
 | 
					    return $http.request({
 | 
				
			||||||
 | 
					      url: `/merchant-api/product/advance/sell/page`,
 | 
				
			||||||
 | 
					      method: "post",
 | 
				
			||||||
 | 
					      data,
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -138,13 +138,40 @@ export default {
 | 
				
			||||||
      parentId: 0,
 | 
					      parentId: 0,
 | 
				
			||||||
      parentName: null,
 | 
					      parentName: null,
 | 
				
			||||||
      name: "预售管理",
 | 
					      name: "预售管理",
 | 
				
			||||||
      url: "pre-sale/index",
 | 
					      url: "",
 | 
				
			||||||
      perms: "",
 | 
					      perms: "",
 | 
				
			||||||
      type: 0,
 | 
					      type: 0,
 | 
				
			||||||
      elIcon: "el-icon-data-analysis",
 | 
					      elIcon: "el-icon-data-analysis",
 | 
				
			||||||
      orderNum: 0,
 | 
					      orderNum: 0,
 | 
				
			||||||
      open: null,
 | 
					      open: null,
 | 
				
			||||||
      list: [],
 | 
					      list: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          menuId: getUUID(),
 | 
				
			||||||
 | 
					          parentId: 0,
 | 
				
			||||||
 | 
					          parentName: null,
 | 
				
			||||||
 | 
					          name: "预售商品",
 | 
				
			||||||
 | 
					          url: "presale/products/index",
 | 
				
			||||||
 | 
					          perms: "",
 | 
				
			||||||
 | 
					          type: 1,
 | 
				
			||||||
 | 
					          elIcon: "el-icon-postcard",
 | 
				
			||||||
 | 
					          orderNum: 0,
 | 
				
			||||||
 | 
					          open: null,
 | 
				
			||||||
 | 
					          list: [],
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          menuId: getUUID(),
 | 
				
			||||||
 | 
					          parentId: 0,
 | 
				
			||||||
 | 
					          parentName: null,
 | 
				
			||||||
 | 
					          name: "预售订单",
 | 
				
			||||||
 | 
					          url: "presale/order/index",
 | 
				
			||||||
 | 
					          perms: "",
 | 
				
			||||||
 | 
					          type: 1,
 | 
				
			||||||
 | 
					          elIcon: "el-icon-postcard",
 | 
				
			||||||
 | 
					          orderNum: 0,
 | 
				
			||||||
 | 
					          open: null,
 | 
				
			||||||
 | 
					          list: [],
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // {
 | 
					    // {
 | 
				
			||||||
    //     "menuId": getUUID(),
 | 
					    //     "menuId": getUUID(),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
<template>
 | 
					 | 
				
			||||||
  <div>
 | 
					 | 
				
			||||||
    预售管理
 | 
					 | 
				
			||||||
  </div>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div style="height: calc(100vh - 200px)">
 | 
				
			||||||
 | 
					    预售订单
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					export default {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style lang="scss" scoped></style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,432 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <div v-if="isShopId" style="height: calc(100vh - 200px)">
 | 
				
			||||||
 | 
					      <obj-table-plus
 | 
				
			||||||
 | 
					        ref="oTable"
 | 
				
			||||||
 | 
					        style="height: 100%"
 | 
				
			||||||
 | 
					        :tableCols="tableCols"
 | 
				
			||||||
 | 
					        :tableProp="tableProp"
 | 
				
			||||||
 | 
					        @query="queryList"
 | 
				
			||||||
 | 
					        v-model="dataList"
 | 
				
			||||||
 | 
					        :tableEvent="tableEvent"
 | 
				
			||||||
 | 
					        :enableAutoQuery="false"
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        <template slot="tableTop">
 | 
				
			||||||
 | 
					          <el-form :inline="true" :model="formInline" class="demo-form-inline">
 | 
				
			||||||
 | 
					            <el-row v-if="marketList.length > 0">
 | 
				
			||||||
 | 
					              <el-col :span="24">
 | 
				
			||||||
 | 
					                <el-form-item label="菜市场">
 | 
				
			||||||
 | 
					                  <el-select
 | 
				
			||||||
 | 
					                    @change="getData"
 | 
				
			||||||
 | 
					                    v-model="formInline.marketId"
 | 
				
			||||||
 | 
					                    placeholder="请选择菜市场"
 | 
				
			||||||
 | 
					                  >
 | 
				
			||||||
 | 
					                    <el-option
 | 
				
			||||||
 | 
					                      v-for="item in marketList"
 | 
				
			||||||
 | 
					                      :key="item.marketId"
 | 
				
			||||||
 | 
					                      :label="item.marketName"
 | 
				
			||||||
 | 
					                      :value="item.marketId"
 | 
				
			||||||
 | 
					                    ></el-option>
 | 
				
			||||||
 | 
					                  </el-select>
 | 
				
			||||||
 | 
					                </el-form-item>
 | 
				
			||||||
 | 
					                <el-form-item label="店铺">
 | 
				
			||||||
 | 
					                  <el-select
 | 
				
			||||||
 | 
					                    v-model="formInline.shopId"
 | 
				
			||||||
 | 
					                    placeholder="请选择店铺"
 | 
				
			||||||
 | 
					                  >
 | 
				
			||||||
 | 
					                    <el-option
 | 
				
			||||||
 | 
					                      v-for="item in storeList"
 | 
				
			||||||
 | 
					                      :key="item.shopId"
 | 
				
			||||||
 | 
					                      :label="item.shopName"
 | 
				
			||||||
 | 
					                      :value="item.shopId"
 | 
				
			||||||
 | 
					                    ></el-option>
 | 
				
			||||||
 | 
					                  </el-select> </el-form-item
 | 
				
			||||||
 | 
					              ></el-col>
 | 
				
			||||||
 | 
					            </el-row>
 | 
				
			||||||
 | 
					            <el-form-item label="商品ID">
 | 
				
			||||||
 | 
					              <el-input
 | 
				
			||||||
 | 
					                v-model="formInline.name"
 | 
				
			||||||
 | 
					                placeholder="商品ID搜索"
 | 
				
			||||||
 | 
					              ></el-input>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item label="商品名称">
 | 
				
			||||||
 | 
					              <el-input
 | 
				
			||||||
 | 
					                v-model="formInline.name"
 | 
				
			||||||
 | 
					                placeholder="商品名称搜索"
 | 
				
			||||||
 | 
					              ></el-input>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item label="状态">
 | 
				
			||||||
 | 
					              <el-select v-model="formInline.status" placeholder="请选择状态">
 | 
				
			||||||
 | 
					                <el-option
 | 
				
			||||||
 | 
					                  v-for="item in statusList"
 | 
				
			||||||
 | 
					                  :key="item.value"
 | 
				
			||||||
 | 
					                  :label="item.label"
 | 
				
			||||||
 | 
					                  :value="item.value"
 | 
				
			||||||
 | 
					                ></el-option>
 | 
				
			||||||
 | 
					              </el-select>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item>
 | 
				
			||||||
 | 
					              <el-button type="primary" @click="$refs.oTable.reload()"
 | 
				
			||||||
 | 
					                >查询</el-button
 | 
				
			||||||
 | 
					              >
 | 
				
			||||||
 | 
					              <el-button type="primary" @click="Reset">重置</el-button>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					          </el-form>
 | 
				
			||||||
 | 
					          <el-tabs v-model="activeName" @tab-click="handleClick">
 | 
				
			||||||
 | 
					            <el-tab-pane
 | 
				
			||||||
 | 
					              v-for="item in statusList"
 | 
				
			||||||
 | 
					              :key="item.value"
 | 
				
			||||||
 | 
					              :label="item.label"
 | 
				
			||||||
 | 
					              :name="item.value"
 | 
				
			||||||
 | 
					            ></el-tab-pane>
 | 
				
			||||||
 | 
					          </el-tabs>
 | 
				
			||||||
 | 
					          <div class="mb-2">
 | 
				
			||||||
 | 
					            <el-button @click="addEarlyWarning" type="primary" size="small"
 | 
				
			||||||
 | 
					              >库存预警设置</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button
 | 
				
			||||||
 | 
					              :disabled="selectList.length <= 0"
 | 
				
			||||||
 | 
					              type="danger"
 | 
				
			||||||
 | 
					              size="small"
 | 
				
			||||||
 | 
					              @click="deleteProduct"
 | 
				
			||||||
 | 
					              >批量删除</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <el-button type="primary" size="small" @click="addProduct"
 | 
				
			||||||
 | 
					              >添加商品</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					      </obj-table-plus>
 | 
				
			||||||
 | 
					      <!-- 添加或编辑 -->
 | 
				
			||||||
 | 
					      <add-or-update
 | 
				
			||||||
 | 
					        @queryList="$refs.oTable.reload()"
 | 
				
			||||||
 | 
					        ref="addOrUpdate"
 | 
				
			||||||
 | 
					      ></add-or-update>
 | 
				
			||||||
 | 
					      <!-- 改价格 -->
 | 
				
			||||||
 | 
					      <!-- <AddPrice ref="AddPrice" @queryList="$refs.oTable.reload()"></AddPrice> -->
 | 
				
			||||||
 | 
					      <!-- 改库存 -->
 | 
				
			||||||
 | 
					      <!-- <addStock ref="addStock" @queryList="$refs.oTable.reload()"></addStock> -->
 | 
				
			||||||
 | 
					      <!-- 打折扣 -->
 | 
				
			||||||
 | 
					      <earlyWarning
 | 
				
			||||||
 | 
					        ref="earlyWarning"
 | 
				
			||||||
 | 
					        @queryList="$refs.oTable.reload()"
 | 
				
			||||||
 | 
					      ></earlyWarning>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div style="height: calc(100vh - 200px)" v-else>
 | 
				
			||||||
 | 
					      <el-empty :image-size="200" description="您不是摊主哦"></el-empty>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					// import AddDiscount from "./popup/add-discount.vue";
 | 
				
			||||||
 | 
					// import AddPrice from "./popup/add-price.vue";
 | 
				
			||||||
 | 
					import AddOrUpdate from "./popup/add-or-update.vue";
 | 
				
			||||||
 | 
					import earlyWarning from "./popup/early-warning.vue";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					  components: { earlyWarning, AddOrUpdate },
 | 
				
			||||||
 | 
					  data() {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      activeName: "5",
 | 
				
			||||||
 | 
					      dataList: [],
 | 
				
			||||||
 | 
					      formInline: {
 | 
				
			||||||
 | 
					        name: "",
 | 
				
			||||||
 | 
					        marketId: "",
 | 
				
			||||||
 | 
					        shopId: "",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      marketList: [],
 | 
				
			||||||
 | 
					      tableProp: {
 | 
				
			||||||
 | 
					        "auto-resize": true,
 | 
				
			||||||
 | 
					        border: true,
 | 
				
			||||||
 | 
					        height: "auto",
 | 
				
			||||||
 | 
					        "row-id": "id",
 | 
				
			||||||
 | 
					        "show-overflow": false,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      statusList: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "全部",
 | 
				
			||||||
 | 
					          value: "5",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "未开始",
 | 
				
			||||||
 | 
					          value: "0",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "进行中",
 | 
				
			||||||
 | 
					          value: "1",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "已结束",
 | 
				
			||||||
 | 
					          value: "2",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "已关闭",
 | 
				
			||||||
 | 
					          value: "3",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
 | 
					      productFilterType: "SALE",
 | 
				
			||||||
 | 
					      selectList: [],
 | 
				
			||||||
 | 
					      isShopId: "",
 | 
				
			||||||
 | 
					      storeList: [],
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  created() {
 | 
				
			||||||
 | 
					    if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) {
 | 
				
			||||||
 | 
					      this.isShopId = true;
 | 
				
			||||||
 | 
					      this.formInline.marketId = JSON.parse(
 | 
				
			||||||
 | 
					        sessionStorage.getItem("userInfo")
 | 
				
			||||||
 | 
					      ).markets[0].marketId;
 | 
				
			||||||
 | 
					      this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
 | 
				
			||||||
 | 
					      console.log(this.marketList);
 | 
				
			||||||
 | 
					      this.getData();
 | 
				
			||||||
 | 
					    } else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
 | 
				
			||||||
 | 
					      (this.formInline.shopId = JSON.parse(
 | 
				
			||||||
 | 
					        sessionStorage.getItem("userInfo")
 | 
				
			||||||
 | 
					      ).shopId),
 | 
				
			||||||
 | 
					        (this.isShopId = true);
 | 
				
			||||||
 | 
					      this.$nextTick(() => {
 | 
				
			||||||
 | 
					        this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      this.isShopId = false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    getData() {
 | 
				
			||||||
 | 
					      this.$api.mer_admin
 | 
				
			||||||
 | 
					        .storeList({ marketId: this.formInline.marketId })
 | 
				
			||||||
 | 
					        .then((res) => {
 | 
				
			||||||
 | 
					          this.storeList = res.data.data;
 | 
				
			||||||
 | 
					          this.formInline.shopId = res.data.data[0].shopId;
 | 
				
			||||||
 | 
					          this.$nextTick(() => {
 | 
				
			||||||
 | 
					            this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    addProduct() {
 | 
				
			||||||
 | 
					      this.$refs.addOrUpdate.toggle().add();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    deleteProduct() {
 | 
				
			||||||
 | 
					      console.log(this.selectList);
 | 
				
			||||||
 | 
					      let integers = this.selectList.map((item) => {
 | 
				
			||||||
 | 
					        return item.id;
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					      this.$confirm("此操作将删除该商品, 是否继续?", "提示", {
 | 
				
			||||||
 | 
					        confirmButtonText: "确定",
 | 
				
			||||||
 | 
					        cancelButtonText: "取消",
 | 
				
			||||||
 | 
					        type: "warning",
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					        .then(() => {
 | 
				
			||||||
 | 
					          console.log("111");
 | 
				
			||||||
 | 
					          this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
 | 
				
			||||||
 | 
					            this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        .catch(() => {
 | 
				
			||||||
 | 
					          this.$message({
 | 
				
			||||||
 | 
					            type: "info",
 | 
				
			||||||
 | 
					            message: "已取消删除",
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    queryList(pageNo, pageSize) {
 | 
				
			||||||
 | 
					      this.$api.preSale
 | 
				
			||||||
 | 
					        .preSaleProducts({
 | 
				
			||||||
 | 
					          pageNumber: pageNo,
 | 
				
			||||||
 | 
					          pageSize: pageSize,
 | 
				
			||||||
 | 
					          ...this.formInline,
 | 
				
			||||||
 | 
					          advanceSellStatus: this.activeName,
 | 
				
			||||||
 | 
					          merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
 | 
				
			||||||
 | 
					          productQuerySortParam: [],
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        .then((res) => {
 | 
				
			||||||
 | 
					          console.log(res);
 | 
				
			||||||
 | 
					          this.$refs.oTable.complete(
 | 
				
			||||||
 | 
					            res.data.data.data,
 | 
				
			||||||
 | 
					            Number(res.data.data.total)
 | 
				
			||||||
 | 
					          );
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        .catch((err) => {
 | 
				
			||||||
 | 
					          this.$refs.oTable.complete(false);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Reset() {
 | 
				
			||||||
 | 
					      this.formInline = {
 | 
				
			||||||
 | 
					        name: "",
 | 
				
			||||||
 | 
					        marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
 | 
				
			||||||
 | 
					          .marketId,
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    handleClick(e) {
 | 
				
			||||||
 | 
					      this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    addEarlyWarning() {
 | 
				
			||||||
 | 
					      this.$refs.earlyWarning.toggle().add();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  computed: {
 | 
				
			||||||
 | 
					    tableCols() {
 | 
				
			||||||
 | 
					      return [
 | 
				
			||||||
 | 
					        { type: "checkbox", width: "60px", fixed: "left" },
 | 
				
			||||||
 | 
					        // { type: "seq", width: "60px", align: "center", title: "序号" },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "商品ID",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "name",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "商品图",
 | 
				
			||||||
 | 
					          field: "productPhotoList",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          width: "80px",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.productPhotoList.length > 0) {
 | 
				
			||||||
 | 
					              return (
 | 
				
			||||||
 | 
					                <el-image
 | 
				
			||||||
 | 
					                  preview-src-list={row.productPhotoList.map((item) => {
 | 
				
			||||||
 | 
					                    return item.url;
 | 
				
			||||||
 | 
					                  })}
 | 
				
			||||||
 | 
					                  src={row.productPhotoList[0].url}
 | 
				
			||||||
 | 
					                ></el-image>
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              return <span>暂无商品图</span>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "定金支付时间",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "name",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "尾款支付时间",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "minSalePrice",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.minSalePrice == row.maxSalePrice) {
 | 
				
			||||||
 | 
					              return <span>¥{row.minSalePrice}</span>;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              return (
 | 
				
			||||||
 | 
					                <span>
 | 
				
			||||||
 | 
					                  ¥{row.minSalePrice}~¥{row.maxSalePrice}
 | 
				
			||||||
 | 
					                </span>
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "预售价",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "discountActivity",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.discountActivity) {
 | 
				
			||||||
 | 
					              return <span>{row.discountActivity.ruleObject.discount}折</span>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "定金",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "saleNum",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "尾款",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "stockNum",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "状态",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "status",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.status == "DOWN") {
 | 
				
			||||||
 | 
					              return <span>未开始</span>;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              return <span>上架</span>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "操作",
 | 
				
			||||||
 | 
					          fixed: "right",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          width: "300px",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            let edit = () => {
 | 
				
			||||||
 | 
					              console.log(row);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					              this.$refs.addOrUpdate.toggle(row).update();
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            let priceAdjustment = () => {
 | 
				
			||||||
 | 
					              console.log(row);
 | 
				
			||||||
 | 
					              this.$refs.AddPrice.toggle(row).update();
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            let changeInventory = () => {
 | 
				
			||||||
 | 
					              this.$refs.addStock.toggle(row).update();
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            let setDiscounts = () => {
 | 
				
			||||||
 | 
					              this.$refs.AddDiscount.toggle(row).update();
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            return (
 | 
				
			||||||
 | 
					              <div>
 | 
				
			||||||
 | 
					                <el-button
 | 
				
			||||||
 | 
					                  size="mini"
 | 
				
			||||||
 | 
					                  disabled={row.status != "DOWN"}
 | 
				
			||||||
 | 
					                  type="primary"
 | 
				
			||||||
 | 
					                  onClick={priceAdjustment}
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                  查看
 | 
				
			||||||
 | 
					                </el-button>
 | 
				
			||||||
 | 
					                <el-button
 | 
				
			||||||
 | 
					                  size="mini"
 | 
				
			||||||
 | 
					                  disabled={row.status != "DOWN"}
 | 
				
			||||||
 | 
					                  type="primary"
 | 
				
			||||||
 | 
					                  onClick={edit}
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                  编辑
 | 
				
			||||||
 | 
					                </el-button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <el-button
 | 
				
			||||||
 | 
					                  size="mini"
 | 
				
			||||||
 | 
					                  disabled={row.status != "DOWN"}
 | 
				
			||||||
 | 
					                  type="primary"
 | 
				
			||||||
 | 
					                  onClick={changeInventory}
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                  关闭
 | 
				
			||||||
 | 
					                </el-button>
 | 
				
			||||||
 | 
					                <el-button
 | 
				
			||||||
 | 
					                  size="mini"
 | 
				
			||||||
 | 
					                  disabled={row.status != "DOWN"}
 | 
				
			||||||
 | 
					                  type="primary"
 | 
				
			||||||
 | 
					                  onClick={setDiscounts}
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                  删除
 | 
				
			||||||
 | 
					                </el-button>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    tableEvent() {
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        "checkbox-all": ({ records, reserves }) => {
 | 
				
			||||||
 | 
					          this.selectList = [...records, ...reserves];
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        "checkbox-change": ({ records, reserves }) => {
 | 
				
			||||||
 | 
					          this.selectList = [...records, ...reserves];
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style lang="scss" scoped></style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,277 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <obj-modal
 | 
				
			||||||
 | 
					      ref="modal"
 | 
				
			||||||
 | 
					      labelWidth="150px"
 | 
				
			||||||
 | 
					      :modalConfig="modalConfig"
 | 
				
			||||||
 | 
					      :modalData="modalData"
 | 
				
			||||||
 | 
					      :modalHandles="modalHandles"
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      <div slot="dialog__content">
 | 
				
			||||||
 | 
					        <el-form
 | 
				
			||||||
 | 
					          :model="ruleForm"
 | 
				
			||||||
 | 
					          :rules="rules"
 | 
				
			||||||
 | 
					          ref="ruleForm"
 | 
				
			||||||
 | 
					          label-width="150px"
 | 
				
			||||||
 | 
					          class="demo-ruleForm"
 | 
				
			||||||
 | 
					        >
 | 
				
			||||||
 | 
					          <el-row>
 | 
				
			||||||
 | 
					            <el-col :span="12">
 | 
				
			||||||
 | 
					              <el-form-item label="订金支付时间:" prop="name">
 | 
				
			||||||
 | 
					                <el-date-picker
 | 
				
			||||||
 | 
					                  @change="getOrderTime"
 | 
				
			||||||
 | 
					                  v-model="orderTime"
 | 
				
			||||||
 | 
					                  type="datetimerange"
 | 
				
			||||||
 | 
					                  range-separator="至"
 | 
				
			||||||
 | 
					                  start-placeholder="开始日期"
 | 
				
			||||||
 | 
					                  end-placeholder="结束日期"
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                </el-date-picker> </el-form-item
 | 
				
			||||||
 | 
					            ></el-col>
 | 
				
			||||||
 | 
					            <el-col :span="12">
 | 
				
			||||||
 | 
					              <el-form-item label="尾款支付时间:" prop="name">
 | 
				
			||||||
 | 
					                <el-date-picker
 | 
				
			||||||
 | 
					                  v-model="arrears"
 | 
				
			||||||
 | 
					                  type="datetimerange"
 | 
				
			||||||
 | 
					                  range-separator="至"
 | 
				
			||||||
 | 
					                  start-placeholder="开始日期"
 | 
				
			||||||
 | 
					                  end-placeholder="结束日期"
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                </el-date-picker> </el-form-item
 | 
				
			||||||
 | 
					            ></el-col>
 | 
				
			||||||
 | 
					          </el-row>
 | 
				
			||||||
 | 
					          <el-form-item label="预计发货时间:" prop="name">
 | 
				
			||||||
 | 
					            <el-date-picker
 | 
				
			||||||
 | 
					              v-model="delivery"
 | 
				
			||||||
 | 
					              type="datetimerange"
 | 
				
			||||||
 | 
					              range-separator="至"
 | 
				
			||||||
 | 
					              start-placeholder="开始日期"
 | 
				
			||||||
 | 
					              end-placeholder="结束日期"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            </el-date-picker>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					          <el-form-item label="定金可退:" prop="name">
 | 
				
			||||||
 | 
					            <el-radio v-model="ruleForm.radio" label="1">是</el-radio>
 | 
				
			||||||
 | 
					            <el-radio v-model="ruleForm.radio" label="2">否</el-radio>
 | 
				
			||||||
 | 
					            <span>
 | 
				
			||||||
 | 
					              选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金
 | 
				
			||||||
 | 
					            </span>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					          <el-form-item label="选择商品:" prop="name">
 | 
				
			||||||
 | 
					            <el-button type="primary" @click="selectProduct"
 | 
				
			||||||
 | 
					              >点击请选择商品</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					            <span> 备注:一次最多添加五个商品 </span>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					        </el-form>
 | 
				
			||||||
 | 
					        <div style="padding: 0 0 0 20px; font-size: 16px; font-weight: 600">
 | 
				
			||||||
 | 
					          已选择商品
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div style="padding: 20px">
 | 
				
			||||||
 | 
					          <div style="border-top: 1px solid #ccc; padding: 10px 0 0 0">
 | 
				
			||||||
 | 
					            <div style="font-size: 16px; margin-bottom: 20px">
 | 
				
			||||||
 | 
					              <span>商品ID:</span>
 | 
				
			||||||
 | 
					              <span style="margin-left: 20px">商品名称:</span>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <el-table
 | 
				
			||||||
 | 
					              border
 | 
				
			||||||
 | 
					              ref="multipleTable"
 | 
				
			||||||
 | 
					              :data="tableData"
 | 
				
			||||||
 | 
					              tooltip-effect="dark"
 | 
				
			||||||
 | 
					              style="width: 100%"
 | 
				
			||||||
 | 
					              @selection-change="handleSelectionChange"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="是否预售" width="80">
 | 
				
			||||||
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                  <el-checkbox v-model="scope.row.isShow"></el-checkbox>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					              </el-table-column>
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="SKU-ID" prop="date" />
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="规格" prop="name" />
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="属性" prop="address" />
 | 
				
			||||||
 | 
					              <el-table-column
 | 
				
			||||||
 | 
					                align="center"
 | 
				
			||||||
 | 
					                label="销售价"
 | 
				
			||||||
 | 
					                prop="address"
 | 
				
			||||||
 | 
					                width="120"
 | 
				
			||||||
 | 
					              />
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="*是否预售" width="200">
 | 
				
			||||||
 | 
					                <template slot="header">
 | 
				
			||||||
 | 
					                  <span style="color: red">*是否预售</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                  <el-input
 | 
				
			||||||
 | 
					                    v-if="scope.row.isShow"
 | 
				
			||||||
 | 
					                    v-model="scope.row.presalePrice"
 | 
				
			||||||
 | 
					                    placeholder="请输入销售价"
 | 
				
			||||||
 | 
					                  ></el-input>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					              </el-table-column>
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="*定金" width="200">
 | 
				
			||||||
 | 
					                <template slot="header">
 | 
				
			||||||
 | 
					                  <span style="color: red">*定金</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                  <el-input
 | 
				
			||||||
 | 
					                    v-if="scope.row.isShow"
 | 
				
			||||||
 | 
					                    v-model="scope.row.presalePrice"
 | 
				
			||||||
 | 
					                    placeholder="请输入订金"
 | 
				
			||||||
 | 
					                  ></el-input>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					              </el-table-column>
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="尾款" width="200">
 | 
				
			||||||
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                  <span v-if="scope.row.isShow">{{
 | 
				
			||||||
 | 
					                    scope.row.presalePrice
 | 
				
			||||||
 | 
					                  }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					              </el-table-column>
 | 
				
			||||||
 | 
					              <el-table-column align="center" label="*预售库存" width="200">
 | 
				
			||||||
 | 
					                <template slot="header">
 | 
				
			||||||
 | 
					                  <span style="color: red">*预售库存</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					                <template slot-scope="scope">
 | 
				
			||||||
 | 
					                  <el-input
 | 
				
			||||||
 | 
					                    v-if="scope.row.isShow"
 | 
				
			||||||
 | 
					                    v-model="scope.row.presalePrice"
 | 
				
			||||||
 | 
					                    placeholder="请输入预售库存"
 | 
				
			||||||
 | 
					                  ></el-input>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					              </el-table-column>
 | 
				
			||||||
 | 
					            </el-table>
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </obj-modal>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { debounce, cloneDeep } from "lodash";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					  components: {},
 | 
				
			||||||
 | 
					  data() {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      isAdd: true,
 | 
				
			||||||
 | 
					      //表格属性
 | 
				
			||||||
 | 
					      modalConfig: {
 | 
				
			||||||
 | 
					        title: "库存预警设置",
 | 
				
			||||||
 | 
					        show: false,
 | 
				
			||||||
 | 
					        width: "1200px",
 | 
				
			||||||
 | 
					        fullscreen: true,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      modalData: {},
 | 
				
			||||||
 | 
					      ruleForm: {
 | 
				
			||||||
 | 
					        name: "",
 | 
				
			||||||
 | 
					        value: "1",
 | 
				
			||||||
 | 
					        radio: "1",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      orderTime: [], //订单支付时间
 | 
				
			||||||
 | 
					      arrears: [], //尾款时间
 | 
				
			||||||
 | 
					      delivery: [], //发货时间
 | 
				
			||||||
 | 
					      tableData: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          date: "2016-05-03",
 | 
				
			||||||
 | 
					          name: "王小虎",
 | 
				
			||||||
 | 
					          address: "红",
 | 
				
			||||||
 | 
					          isShow: false,
 | 
				
			||||||
 | 
					          presalePrice: "",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          date: "2016-05-02",
 | 
				
			||||||
 | 
					          name: "王小虎",
 | 
				
			||||||
 | 
					          address: "弄",
 | 
				
			||||||
 | 
					          isShow: false,
 | 
				
			||||||
 | 
					          presalePrice: "",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          date: "2016-05-04",
 | 
				
			||||||
 | 
					          name: "王小虎",
 | 
				
			||||||
 | 
					          address: "8 弄",
 | 
				
			||||||
 | 
					          isShow: true,
 | 
				
			||||||
 | 
					          presalePrice: "",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
 | 
					      rules: {
 | 
				
			||||||
 | 
					        name: [{ required: true, message: "请输入属性名称", trigger: "blur" }],
 | 
				
			||||||
 | 
					        value: [
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            required: true,
 | 
				
			||||||
 | 
					            message: "请输入属性内容",
 | 
				
			||||||
 | 
					            trigger: "blur",
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    queryTableData(pageNo, pageSize) {},
 | 
				
			||||||
 | 
					    toggle(e) {
 | 
				
			||||||
 | 
					      if (this.modalConfig.show == false) {
 | 
				
			||||||
 | 
					        this.modalConfig.show = true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        this.modalConfig.show = false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if (e) {
 | 
				
			||||||
 | 
					        this.init(cloneDeep(e.row));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        add: (data) => {
 | 
				
			||||||
 | 
					          this.modalConfig.title = "新增预售";
 | 
				
			||||||
 | 
					          this.isAdd = true;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        update: () => {
 | 
				
			||||||
 | 
					          this.modalConfig.title = "编辑预售";
 | 
				
			||||||
 | 
					          this.isAdd = false;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    init(row) {
 | 
				
			||||||
 | 
					      this.modalData = row;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    //订单支付时间
 | 
				
			||||||
 | 
					    getOrderTime(e) {
 | 
				
			||||||
 | 
					      if (e) {
 | 
				
			||||||
 | 
					        ruleForm.startTime = e[0];
 | 
				
			||||||
 | 
					        ruleForm.endTime = e[1];
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        ruleForm.startTime = "";
 | 
				
			||||||
 | 
					        ruleForm.endTime = "";
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    selectProduct() {
 | 
				
			||||||
 | 
					      console.log("选择商品");
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    handleSelectionChange(e) {
 | 
				
			||||||
 | 
					      console.log(e);
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  computed: {
 | 
				
			||||||
 | 
					    modalHandles() {
 | 
				
			||||||
 | 
					      return [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "取消",
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.toggle();
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "确认",
 | 
				
			||||||
 | 
					          type: "primary",
 | 
				
			||||||
 | 
					          // submit: true,
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.$refs.ruleForm.validate((valid) => {
 | 
				
			||||||
 | 
					              if (valid) {
 | 
				
			||||||
 | 
					                this.$emit("getAttribute", this.ruleForm);
 | 
				
			||||||
 | 
					                this.toggle();
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  asyncComputed: {},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,230 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <obj-modal
 | 
				
			||||||
 | 
					    ref="modal"
 | 
				
			||||||
 | 
					    labelWidth="150px"
 | 
				
			||||||
 | 
					    :modalConfig="modalConfig"
 | 
				
			||||||
 | 
					    :modalData="modalData"
 | 
				
			||||||
 | 
					    :modalHandles="modalHandles"
 | 
				
			||||||
 | 
					  >
 | 
				
			||||||
 | 
					    <template slot="dialog__content">
 | 
				
			||||||
 | 
					      <obj-table-plus
 | 
				
			||||||
 | 
					        ref="oTable"
 | 
				
			||||||
 | 
					        style="height: 70vh"
 | 
				
			||||||
 | 
					        :tableCols="tableCols"
 | 
				
			||||||
 | 
					        :tableProp="tableProp"
 | 
				
			||||||
 | 
					        @query="queryList"
 | 
				
			||||||
 | 
					        v-model="dataList"
 | 
				
			||||||
 | 
					        :tableEvent="tableEvent"
 | 
				
			||||||
 | 
					        :enableAutoQuery="false"
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        <!-- <template slot="tableTop">
 | 
				
			||||||
 | 
					        <el-form :inline="true" :model="formInline" class="demo-form-inline">
 | 
				
			||||||
 | 
					          <el-form-item v-if="marketList.length > 0" label="菜市场">
 | 
				
			||||||
 | 
					            <el-select
 | 
				
			||||||
 | 
					              @change="getData"
 | 
				
			||||||
 | 
					              v-model="formInline.marketId"
 | 
				
			||||||
 | 
					              placeholder="请选择菜市场"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					              <el-option
 | 
				
			||||||
 | 
					                v-for="item in marketList"
 | 
				
			||||||
 | 
					                :key="item.marketId"
 | 
				
			||||||
 | 
					                :label="item.marketName"
 | 
				
			||||||
 | 
					                :value="item.marketId"
 | 
				
			||||||
 | 
					              ></el-option>
 | 
				
			||||||
 | 
					            </el-select>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					          <el-form-item v-if="marketList.length > 0" label="店铺">
 | 
				
			||||||
 | 
					            <el-select v-model="formInline.shopId" placeholder="请选择店铺">
 | 
				
			||||||
 | 
					              <el-option
 | 
				
			||||||
 | 
					                v-for="item in storeList"
 | 
				
			||||||
 | 
					                :key="item.shopId"
 | 
				
			||||||
 | 
					                :label="item.shopName"
 | 
				
			||||||
 | 
					                :value="item.shopId"
 | 
				
			||||||
 | 
					              ></el-option>
 | 
				
			||||||
 | 
					            </el-select>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					          <el-form-item>
 | 
				
			||||||
 | 
					            <el-button type="primary" @click="$refs.oTable.reload()"
 | 
				
			||||||
 | 
					              >查询</el-button
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					        </el-form>
 | 
				
			||||||
 | 
					      </template> -->
 | 
				
			||||||
 | 
					      </obj-table-plus>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					  </obj-modal>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { debounce, cloneDeep } from "lodash";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					  data() {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      isAdd: true,
 | 
				
			||||||
 | 
					      //表格属性
 | 
				
			||||||
 | 
					      modalConfig: {
 | 
				
			||||||
 | 
					        title: "请点击选择商品",
 | 
				
			||||||
 | 
					        show: false,
 | 
				
			||||||
 | 
					        width: "1000px",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      modalData: {},
 | 
				
			||||||
 | 
					      dataList: [], //表格数据
 | 
				
			||||||
 | 
					      tableProp: {
 | 
				
			||||||
 | 
					        "auto-resize": true,
 | 
				
			||||||
 | 
					        border: true,
 | 
				
			||||||
 | 
					        height: "auto",
 | 
				
			||||||
 | 
					        "row-id": "id",
 | 
				
			||||||
 | 
					        "show-overflow": false,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      selectList: {},
 | 
				
			||||||
 | 
					      tableEvent: {
 | 
				
			||||||
 | 
					        "current-change": async (e) => {
 | 
				
			||||||
 | 
					          console.log(e.row);
 | 
				
			||||||
 | 
					          this.selectList = e.row;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      formInline: {},
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    queryList(pageNo, pageSize) {
 | 
				
			||||||
 | 
					      this.$api.mer_admin
 | 
				
			||||||
 | 
					        .getProductPage({
 | 
				
			||||||
 | 
					          p: {
 | 
				
			||||||
 | 
					            pageNumber: pageNo,
 | 
				
			||||||
 | 
					            pageSize: pageSize,
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          ...this.formInline,
 | 
				
			||||||
 | 
					          productFilterType: "SALE",
 | 
				
			||||||
 | 
					          merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
 | 
				
			||||||
 | 
					          productQuerySortParam: [],
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        .then((res) => {
 | 
				
			||||||
 | 
					          console.log(res);
 | 
				
			||||||
 | 
					          this.$refs.oTable.complete(
 | 
				
			||||||
 | 
					            res.data.data.data,
 | 
				
			||||||
 | 
					            Number(res.data.data.total)
 | 
				
			||||||
 | 
					          );
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        .catch((err) => {
 | 
				
			||||||
 | 
					          this.$refs.oTable.complete(false);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    toggle(e) {
 | 
				
			||||||
 | 
					      if (this.modalConfig.show == false) {
 | 
				
			||||||
 | 
					        this.modalConfig.show = true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        this.modalConfig.show = false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if (e) {
 | 
				
			||||||
 | 
					        this.init(cloneDeep(e));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        add: (row) => {
 | 
				
			||||||
 | 
					          this.formInline = row;
 | 
				
			||||||
 | 
					          this.isAdd = true;
 | 
				
			||||||
 | 
					          this.$nextTick(() => {
 | 
				
			||||||
 | 
					            this.$refs.oTable.reload();
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        update: () => {
 | 
				
			||||||
 | 
					          this.isAdd = false;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    init(row) {},
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  computed: {
 | 
				
			||||||
 | 
					    tableCols() {
 | 
				
			||||||
 | 
					      return [
 | 
				
			||||||
 | 
					        { type: "seq", width: "60px", align: "center", title: "序号" },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "商品图",
 | 
				
			||||||
 | 
					          field: "productPhotoList",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          width: "100px",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.productPhotoList.length > 0) {
 | 
				
			||||||
 | 
					              return (
 | 
				
			||||||
 | 
					                <el-image
 | 
				
			||||||
 | 
					                  preview-src-list={row.productPhotoList.map((item) => {
 | 
				
			||||||
 | 
					                    return item.url;
 | 
				
			||||||
 | 
					                  })}
 | 
				
			||||||
 | 
					                  src={row.productPhotoList[0].url}
 | 
				
			||||||
 | 
					                ></el-image>
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              return <span>暂无商品图</span>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "商品名称",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "name",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "商品售价",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "minSalePrice",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.minSalePrice == row.maxSalePrice) {
 | 
				
			||||||
 | 
					              return <span>¥{row.minSalePrice}</span>;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              return (
 | 
				
			||||||
 | 
					                <span>
 | 
				
			||||||
 | 
					                  ¥{row.minSalePrice}~¥{row.maxSalePrice}
 | 
				
			||||||
 | 
					                </span>
 | 
				
			||||||
 | 
					              );
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "折扣",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "discountActivity",
 | 
				
			||||||
 | 
					          type: "jsx",
 | 
				
			||||||
 | 
					          render: ({ row }) => {
 | 
				
			||||||
 | 
					            if (row.discountActivity) {
 | 
				
			||||||
 | 
					              return <span>{row.discountActivity.ruleObject.discount}折</span>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "销量",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "saleNum",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          title: "库存",
 | 
				
			||||||
 | 
					          align: "center",
 | 
				
			||||||
 | 
					          field: "stockNum",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    modalHandles() {
 | 
				
			||||||
 | 
					      return [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "取消",
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.toggle();
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "确认",
 | 
				
			||||||
 | 
					          type: "primary",
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.$emit("getProduct", this.selectList);
 | 
				
			||||||
 | 
					            this.toggle();
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,123 @@
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <obj-modal
 | 
				
			||||||
 | 
					      ref="modal"
 | 
				
			||||||
 | 
					      labelWidth="150px"
 | 
				
			||||||
 | 
					      :modalConfig="modalConfig"
 | 
				
			||||||
 | 
					      :modalData="modalData"
 | 
				
			||||||
 | 
					      :modalHandles="modalHandles"
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      <div slot="dialog__content">
 | 
				
			||||||
 | 
					        <el-form
 | 
				
			||||||
 | 
					          :model="ruleForm"
 | 
				
			||||||
 | 
					          :rules="rules"
 | 
				
			||||||
 | 
					          ref="ruleForm"
 | 
				
			||||||
 | 
					          label-width="150px"
 | 
				
			||||||
 | 
					          class="demo-ruleForm"
 | 
				
			||||||
 | 
					        >
 | 
				
			||||||
 | 
					          <el-form-item label="预售剩余库存:" prop="name">
 | 
				
			||||||
 | 
					            <span style="font-size: 20px; margin-right: 20px">≤</span>
 | 
				
			||||||
 | 
					            <el-input-number
 | 
				
			||||||
 | 
					              v-model="ruleForm.name"
 | 
				
			||||||
 | 
					              :min="1"
 | 
				
			||||||
 | 
					              :max="9999"
 | 
				
			||||||
 | 
					              :precision="0"
 | 
				
			||||||
 | 
					              :step="1"
 | 
				
			||||||
 | 
					              label="请输入数量"
 | 
				
			||||||
 | 
					            ></el-input-number>
 | 
				
			||||||
 | 
					            <span style="font-size: 20px; margin-left: 14px">时通知我</span>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					          <el-form-item label="通知方式:" prop="value">
 | 
				
			||||||
 | 
					            <el-radio v-model="ruleForm.value" label="1">系统通知</el-radio>
 | 
				
			||||||
 | 
					            <el-radio v-model="ruleForm.value" label="2">短信通知</el-radio>
 | 
				
			||||||
 | 
					          </el-form-item>
 | 
				
			||||||
 | 
					        </el-form>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </obj-modal>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { debounce, cloneDeep } from "lodash";
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					  components: {},
 | 
				
			||||||
 | 
					  data() {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      isAdd: true,
 | 
				
			||||||
 | 
					      //表格属性
 | 
				
			||||||
 | 
					      modalConfig: {
 | 
				
			||||||
 | 
					        title: "库存预警设置",
 | 
				
			||||||
 | 
					        show: false,
 | 
				
			||||||
 | 
					        width: "800px",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      modalData: {},
 | 
				
			||||||
 | 
					      ruleForm: {
 | 
				
			||||||
 | 
					        name: "",
 | 
				
			||||||
 | 
					        value: "1",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      rules: {
 | 
				
			||||||
 | 
					        name: [{ required: true, message: "请输入属性名称", trigger: "blur" }],
 | 
				
			||||||
 | 
					        value: [
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            required: true,
 | 
				
			||||||
 | 
					            message: "请输入属性内容",
 | 
				
			||||||
 | 
					            trigger: "blur",
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    queryTableData(pageNo, pageSize) {},
 | 
				
			||||||
 | 
					    toggle(e) {
 | 
				
			||||||
 | 
					      if (this.modalConfig.show == false) {
 | 
				
			||||||
 | 
					        this.modalConfig.show = true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        this.modalConfig.show = false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if (e) {
 | 
				
			||||||
 | 
					        this.init(cloneDeep(e.row));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        add: (data) => {
 | 
				
			||||||
 | 
					          this.modalConfig.title = "库存预警设置";
 | 
				
			||||||
 | 
					          this.isAdd = true;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        update: () => {
 | 
				
			||||||
 | 
					          this.isAdd = false;
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    init(row) {
 | 
				
			||||||
 | 
					      this.modalData = row;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  computed: {
 | 
				
			||||||
 | 
					    modalHandles() {
 | 
				
			||||||
 | 
					      return [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "取消",
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.toggle();
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          label: "确认",
 | 
				
			||||||
 | 
					          type: "primary",
 | 
				
			||||||
 | 
					          // submit: true,
 | 
				
			||||||
 | 
					          handle: () => {
 | 
				
			||||||
 | 
					            this.$refs.ruleForm.validate((valid) => {
 | 
				
			||||||
 | 
					              if (valid) {
 | 
				
			||||||
 | 
					                this.$emit("getAttribute", this.ruleForm);
 | 
				
			||||||
 | 
					                this.toggle();
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  asyncComputed: {},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
		Loading…
	
		Reference in New Issue