zx 11 달 전
부모
커밋
d6b23dd7bc
4개의 변경된 파일83개의 추가작업 그리고 13개의 파일을 삭제
  1. 12 1
      src/api/store/storeProduct.js
  2. 1 1
      src/components/Pagination/index.vue
  3. 16 9
      src/views/store/components/productOrder.vue
  4. 54 2
      src/views/store/storeProduct/index.vue

+ 12 - 1
src/api/store/storeProduct.js

@@ -41,7 +41,18 @@ export function delStoreProduct(productId) {
     method: 'delete'
   })
 }
-
+export function putOn(productId) {
+  return request({
+    url: '/store/storeProduct/putOn/' + productId,
+    method: 'post'
+  })
+}
+export function pullOff(productId) {
+  return request({
+    url: '/store/storeProduct/pullOff/' + productId,
+    method: 'post'
+  })
+}
 // 导出商品
 export function exportStoreProduct(query) {
   return request({

+ 1 - 1
src/components/Pagination/index.vue

@@ -35,7 +35,7 @@ export default {
     pageSizes: {
       type: Array,
       default() {
-        return [10, 20, 30, 50,100 ]
+        return [10, 20, 30, 50,100,500 ]
       }
     },
     layout: {

+ 16 - 9
src/views/store/components/productOrder.vue

@@ -164,7 +164,7 @@
           凭证信息
         </span>
       </div>
-      <el-image 
+      <el-image
           v-if="certificates != null"
           :src="certificates"
           :preview-src-list="[certificates]"
@@ -271,6 +271,13 @@
                 ¥{{order.payDelivery.toFixed(2)}}
               </span>
           </el-descriptions-item>
+
+          <el-descriptions-item label="服务费"  >
+              <span v-if="order!=null">
+                ¥{{order.serviceFee}}
+              </span>
+          </el-descriptions-item>
+
       </el-descriptions>
 
       <div style="margin-top: 20px">
@@ -290,7 +297,7 @@
           <el-table-column label="支付时间" align="center" prop="payTime" />
       </el-table>
 
-      
+
       <div style="margin-top: 20px">
         <span class="font-small">操作信息</span>
       </div>
@@ -354,7 +361,7 @@
             <el-select filterable style="width: 200px" v-model="editForm.scheduleId" placeholder="请选择档期" clearable size="small" >
               <el-option
                       v-for="item in scheduleOptions"
-                      :key="item.id"  
+                      :key="item.id"
                       :label="item.name"
                       :value="item.id"
                     />
@@ -392,7 +399,7 @@
         <el-form-item label="物流单号" prop="deliveryId"  >
           <el-input v-model="editDyForm.deliveryId" placeholder="请输入物流单号" />
         </el-form-item>
-        
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitEditDyForm">确 定</el-button>
@@ -473,7 +480,7 @@
         </el-row>
       </div>
     </el-dialog>
-    
+
   </div>
 </template>
 
@@ -579,13 +586,13 @@ export default {
         const id = this.order.id;
         getStoreOrderAddress(id).then(response =>{
             this.order.userAddress = response.address;
-        }) 
+        })
       },
       handlePhone(){
         const id = this.order.id;
         getStoreOrderPhone(id).then(response =>{
             this.order.userPhone = response.userPhone;
-        }) 
+        })
       },
     showImageDialog() {
       this.dialogVisible = true;
@@ -777,7 +784,7 @@ export default {
         this.editForm.userAddress = this.order.userAddress.toString();
         this.editForm.scheduleId = this.order.scheduleId;
         // this.editForm.extendOrderId = this.order.extendOrderId.toString();
-        
+
     },
     //推送管易按钮
     addErpOrder(){
@@ -810,7 +817,7 @@ export default {
             }
             if(response.order.status != null){
               this.orderStatus = response.order.status;
-            }  
+            }
             this.user = response.user;
             this.logs = response.logs;
             this.items = response.items;

+ 54 - 2
src/views/store/storeProduct/index.vue

@@ -102,7 +102,26 @@
           v-hasPermi="['store:storePayment:export']"
         >导出</el-button>
       </el-col>
-
+      <el-col :span="1.5">
+        <el-button
+        v-if="activeName==0"
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          @click="putOn"
+          v-hasPermi="['store:storePayment:pullOff']"
+        >上架</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-if="activeName==1"
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          @click="pullOff"
+          v-hasPermi="['store:storePayment:pullOff']"
+        >下架</el-button>
+      </el-col>
 	    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -536,7 +555,7 @@
 </template>
 
 <script>
-import {genFormatAttr, listStoreProduct, getStoreProduct, delStoreProduct, addOrEdit, exportStoreProduct,importTemplate } from "@/api/store/storeProduct";
+import {genFormatAttr, putOn,pullOff,listStoreProduct, getStoreProduct, delStoreProduct, addOrEdit, exportStoreProduct,importTemplate } from "@/api/store/storeProduct";
 import { getAllStoreProductCategory } from "@/api/store/storeProductCategory";
 import { getAllStoreProductRule } from "@/api/store/storeProductRule";
 import { getAllShippingTemplates } from "@/api/store/shippingTemplates";
@@ -1096,6 +1115,39 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(function() {});
     },
+    putOn() {
+       const productIds =this.ids;
+      if(productIds==null||productIds==""){
+         return this.$message("未选择商品");
+      }
+      this.$confirm('是否确认批量上架商品?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return putOn(productIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("上架成功");
+        }).catch(function() {});
+    },
+    pullOff() {
+      const productIds =this.ids;
+      if(productIds==null||productIds==""){
+         return this.$message("未选择商品");
+      }
+
+      this.$confirm('是否确认批量下架商品?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return pullOff(productIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("下架成功");
+        }).catch(function() {});
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;