소스 검색

订单明细

shish 4 년 전
부모
커밋
91b0a9474e

+ 26 - 26
ghsApp/src/admin/home/components/OrderItem.vue

@@ -40,7 +40,7 @@
         <div class="list-bottom">
             <div class="list-button">
                 <view v-for="s in item.buttonList" :key="s.type">
-                <button @click.stop="clickBtn(s, item)" v-if="s.show == 1" :disabled="s.disable === 1" class="admin-button-com bule" :class="s.disable === 1 ? 'active' : ''">
+                <button @click.stop="orderEventBtn(s, item)" v-if="s.show == 1" :disabled="s.disable === 1" class="admin-button-com bule" :class="s.disable === 1 ? 'active' : ''">
                                     {{ s.type === "print" ? s.name+`(${item.printNum})` : s.name}}
                 </button>
                 </view>
@@ -65,33 +65,33 @@ export default {
 		};
 	},
 	methods: {
-		clickBtn(s,item) {
-			this.$emit('clickBtn', s,item)
+		orderEventBtn(s,item) {
+			this.$emit('orderEventBtn', s,item)
 		},
-        statusFormat(status) {
-            switch (status) {
-                case "1":
-                return "待确认";
-                break;
-                case "2":
-                return "待配送";
-                break;
-                case "3":
-                return "配送中";
-                break;
-                case "4":
-                return "已完成";
-                break;
-                case "5":
-                return "已取消";
-                break;
-                case "6":
-                return "已退款";
-                break;
-                default:
-                return "";
-            }
+    statusFormat(status) {
+        switch (status) {
+            case "1":
+            return "待确认";
+            break;
+            case "2":
+            return "待配送";
+            break;
+            case "3":
+            return "配送中";
+            break;
+            case "4":
+            return "已完成";
+            break;
+            case "5":
+            return "已取消";
+            break;
+            case "6":
+            return "已退款";
+            break;
+            default:
+            return "";
         }
+    }
 	}
 };
 </script>

+ 3 - 148
ghsApp/src/admin/home/order.vue

@@ -38,7 +38,7 @@
       <block v-if="!$util.isEmpty(list.data)">
         <div class="list" v-for="(item, index) in list.data" :key="index" @click="pageTo({url: '/pagesOrder/detail',query: {id: item.id,},})">
 
-          <OrderItem :item="item" @clickBtn="clickBtn"></OrderItem>
+          <OrderItem :item="item" @orderEventBtn="orderEventBtn"></OrderItem>
 
         </div>
       </block>
@@ -71,12 +71,12 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
-import { cloudPrintOrder } from "@/api/order";
 import { getListB, freeShipping,confirmFinish,cancel } from "@/api/order";
 import AppSearchModule from "@/components/module/app-search";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import rangeDatePick from "@/components/pyh-rdtpicker/pyh-rdtpicker.vue";
 import BLE from "@/mixins/BLE";
+import orderMixin from "@/mixins/order";
 import OrderItem from "./components/OrderItem";
 export default {
   name: "order-list",
@@ -89,7 +89,7 @@ export default {
     DorpdownSelect,
     OrderItem,
   },
-  mixins: [list,BLE],
+  mixins: [list,BLE,orderMixin],
   computed: { ...mapGetters(["getLoginInfo", "getDictionariesInfo"]) },
   data() {
     return {
@@ -211,134 +211,6 @@ export default {
     timeCancel(e) {
       this.isShow = false;
     },
-   // 操作按钮
-  clickBtn(s, item) {
-      let that = this
-      this.orderId=item.id;
-      if (s.type === "selfGet") {
-        this.operateData = item;
-        let self = this;
-        uni.showModal({
-          title: "提示",
-          content: "确认客户已自取",
-          confirmText: "确认",
-          success: function (res) {
-            if (res.confirm) {
-              self.freeShipModalClick();
-            }
-          },
-        });
-        //发货
-      } else if (s.type === "send") {
-        this.pageTo({
-          url: "/pagesOrder/ship",
-          query: {
-            id: item.id,
-          },
-        });
-      }else if (s.type === "print") {
-        uni.showLoading({title: '打印中...'});
-        cloudPrintOrder({id:item.id}).then((res) => {
-          uni.hideLoading()
-          if(res.code == 1){
-            if(res.data.hasNoPrint == 1){
-              uni.showModal({
-                title: "提示",
-                content: "您还没有设置打印机",
-                cancelText: "取消",
-                confirmText: "去设置",
-                success: function (res) {
-                  if (res.confirm) {
-                    that.$util.pageTo({url: "/admin/shop/print"})
-                  }
-                },
-              })
-              return false
-            }
-            item.printNum++
-          }
-        })
-			}else if(s.type == 'confirm'){
-				let self = this;
-				uni.showActionSheet({
-					itemList: ['请选择结算方式:', '欠款', '已收款'],
-					success: function (res) {
-            if(res.tapIndex == 0){
-              return false
-            }
-						let payWay = 0
-						let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
-						//1欠款 2已收款
-						let clearType = res.tapIndex == 1 ? 1 : 2;
-						//选择的已收款,还需要选择收款方式
-						if(clearType == 2){
-							uni.showActionSheet({
-								itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
-								success: function (respond) {
-									let currentIndex = respond.tapIndex
-									let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
-									if(currentIndex == 0){
-                    return false
-                  }
-									payWay = inWay[currentIndex].id
-									let params = {id:item.id,clearType:clearType,payWay:payWay}
-									self.toConfrim(params,title)
-								}
-							})
-						}else{
-							let params = {id:item.id,clearType:clearType,payWay:payWay}
-							self.toConfrim(params,title)
-						}
-					}
-				});
-      }else if(s.type == 'cancel'){
-				let self = this;
-				uni.showModal({
-					title: '提示',
-					content: '确认取消?',
-					success: function (res) {
-						if (res.confirm) {
-							cancel({id:item.id}).then((res) => {
-								uni.showToast({title:res.msg,icon:'none'})
-								this._list();
-							})
-
-						}
-					}
-				});
-			}
-		},
-		toConfrim(params,title){
-      let that = this
-			uni.showModal({
-				title: '订单完成',
-				content: title,
-				success: function (res) {
-					if (res.confirm) {
-						that.toConfirmRequest(params)
-					}
-				}
-			});
-		},
-		toConfirmRequest(params){
-      let that = this
-			confirmFinish(params).then((res) => {
-        uni.showToast({title:res.msg,icon:'none'})
-        if(res.code == 1){
-          //订单变成完成
-          that.list.data.forEach((item, index,array) => {
-            if(item.id == params.id){
-              array[index].status = '4'
-              array[index].buttonList.forEach((it,ind,arr)=>{
-                if(it.type == 'confirm'){
-                  arr[ind].disable = 1
-                }
-              })
-            }
-          });
-        }
-			})
-		},
     selectSussess(val) {
       console.log(val);
       if (val.select == "自定义") {
@@ -383,23 +255,6 @@ export default {
         this._list();
       }
     },
-    // 免发货
-    freeShipModalClick(e) {
-      freeShipping({ id: this.operateData.id }).then((res) => {
-        this._list();
-        this.$msg("操作成功!");
-      });
-    },
-    // 查看配送
-    seeSendFn(item) {
-      this.$util.pageTo({
-        url: "/admin/order/ship",
-        query: {
-          id: item.id,
-          pageStatus: 5,
-        },
-      });
-    },
     // 关闭弹窗
     modalCancel() {
       this.freeShipModal = false;

+ 1 - 2
ghsApp/src/admin/item/components/ItemStock.vue

@@ -54,8 +54,7 @@ export default {
 	},
 	methods: {
 		goToOrderDetail(id){
-			this.$msg('开发中')
-			//this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})
+			this.$util.pageTo({url: "/admin/order/itemOrder?id="+id})
 		},
 		goToStockDetail(id){
 			this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})

+ 201 - 0
ghsApp/src/admin/order/itemOrder.vue

@@ -0,0 +1,201 @@
+<template>
+  <div class="app-main app-content">
+
+    <div class="list-wrap">
+      <block v-if="!$util.isEmpty(list.data)">
+        <div class="list" v-for="(item, index) in list.data" :key="index" @click="pageTo({url: '/pagesOrder/detail',query: {id: item.id,},})">
+
+          <OrderItem :item="item" @orderEventBtn="orderEventBtn"></OrderItem>
+
+        </div>
+      </block>
+      <block v-else>
+        <app-wrapper-empty
+          title="暂无数据"
+          :is-empty="$util.isEmpty(list.data)"
+        />
+      </block>
+    </div>
+  </div>
+</template>
+
+<script>
+const Month = new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : new Date().getMonth() + 1;
+const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import ModalModule from "@/components/plugin/modal";
+import { list } from "@/mixins";
+import { mapGetters } from "vuex";
+import { getOrderInfoList } from "@/api/order-item";
+import orderMixin from "@/mixins/order";
+import OrderItem from "../home/components/OrderItem";
+export default {
+  name: "itemOrder",
+  components: {
+    AppWrapperEmpty,
+    ModalModule,
+    OrderItem,
+  },
+  mixins: [list,orderMixin],
+  computed: { ...mapGetters(["getLoginInfo", "getDictionariesInfo"]) },
+  data() {
+    return {
+    	orderId:'',
+      seekVal: "",
+      isShow: false, //是否显选择时间段
+      customizationTime: [], //时间段
+      customizationTimeType: "", //时间段
+      menuObj: "", //时间筛选列表
+      tabIndex: 0,
+      selectItemId: "",
+      operateIndex: null,
+      operateData: {},
+      freeShipModal: false,
+      classifyForm: {
+        categoryId: "",
+        usageId: "",
+      },
+      searchType:0,
+      searchTypeName:'客户',
+    };
+  },
+  onPullDownRefresh() {
+    this.resetList();
+    this.getOrderList().then((res) => {
+      uni.stopPullDownRefresh();
+    });
+  },
+  onReachBottom() {
+    if (!this.list.finished) {
+      this.getOrderList().then((res) => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
+  mounted() {
+  },
+  onLoad(option) {
+    let dateDefaultOption = [];
+    let list = this.getDictionariesInfo.dateDefaultOption;
+    if (!this.$util.isEmpty(list)){
+      for (let i = 0; i < list.length; i++) {
+        dateDefaultOption.push({ name: list[i].name, id: list[i].value });
+      }
+    }
+    this.menuObj = {
+      title: "时间",
+      titleChild: "时间",
+      list: dateDefaultOption,
+    };
+    let tabIndex = uni.getStorageSync("switchTabQuery") || null;
+    if (tabIndex) {
+      uni.removeStorageSync("switchTabQuery");
+      this.tabIndex = parseInt(tabIndex.tabIndex);
+    }
+    this.getOrderList();
+  },
+  onShow() {
+
+  },
+  methods: {
+    getOrderList(type, timeArr) {
+      return getOrderInfoList({
+        searchTime: type,
+        startTime: timeArr ? timeArr[0] : "",
+        endTime: timeArr ? timeArr[1] : "",
+        productId:this.option.id,
+        page: this.list.page,
+      }).then((res) => {
+        this.completes(res)
+      });
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.admin-button-com {
+  width: 140px;
+  height: 60px;
+  padding: 0;
+  line-height: 60px;
+  text-align: center;
+  font-size: 26px;
+  &.active {
+    border: 1px solid #ccc;
+  }
+}
+page{
+	width: 750rpx;
+	overflow: hidden;
+}
+.app-content {
+	width: 100%;
+  padding-bottom: 1px;
+	overflow: hidden;
+  .select-dn_bx {
+    padding-left: 18px;
+  }
+  .app-tabs {
+    position: fixed;
+    width: 100%;
+    z-index: 9;
+  }
+  .input-wrap_box {
+    background-color: #fff;
+    position: fixed;
+    top: 0;
+    z-index: 10;
+    width: 100%;
+    height: 100px;
+    display: flex;
+    align-items: center;
+    padding: 0 30px;
+    & > view:nth-child(2) {
+      flex: 1;
+    }
+  }
+  .list-wrap {
+    padding-top: 20rpx;
+    .list {
+      background-color: #fff;
+      margin-bottom: 20px;
+    }
+  }
+}
+.upload-confirm-wrap {
+  max-height: 600px;
+  overflow-y: auto;
+  .modal-tit {
+    @include disFlex(center, center);
+    font-size: 40px;
+    margin-top: 30px;
+    margin-bottom: 50px;
+    .iconfont {
+      color: #09bb07;
+      margin-right: 20px;
+      font-size: 50px;
+    }
+  }
+  .sel-wrap {
+    color: $fontColor2;
+    font-size: 32px;
+    .sel-tit {
+      text-align: left;
+    }
+    .sel-btn {
+      @include disFlex(center, flex-start);
+      flex-wrap: wrap;
+      padding: 10px 0 40px;
+      .admin-button-com {
+        margin-right: 20px;
+        margin-top: 20px;
+        padding-top: 16px;
+        padding-bottom: 16px;
+        border-radius: 4px;
+      }
+    }
+  }
+}
+</style>

+ 6 - 1
ghsApp/src/api/order-item/index.js

@@ -3,4 +3,9 @@ import https from "@/plugins/luch-request_0.0.7/request";
 //获取订单的花材
 export const getOrderProduct = data => {
 	return https.get("/order-item/get-order-product", data);
-};
+};
+
+//根据花材获取订单
+export const getOrderInfoList = data => {
+	return https.get("/order-item/get-order-info-list", data);
+};

+ 162 - 0
ghsApp/src/mixins/order.js

@@ -0,0 +1,162 @@
+import { cloudPrintOrder } from "@/api/order";
+export default {
+    data(){
+        return {
+        }
+    },
+    computed:{
+
+    },
+    mounted () {
+    },
+	watch:{
+	},
+    methods: {
+    toConfrim(params,title){
+        let that = this
+            uni.showModal({
+                title: '订单完成',
+                content: title,
+                success: function (res) {
+                    if (res.confirm) {
+                        that.toConfirmRequest(params)
+                    }
+                }
+            });
+    },
+    toConfirmRequest(params){
+        let that = this
+        confirmFinish(params).then((res) => {
+        uni.showToast({title:res.msg,icon:'none'})
+        if(res.code == 1){
+        //订单变成完成
+        that.list.data.forEach((item, index,array) => {
+            if(item.id == params.id){
+            array[index].status = '4'
+            array[index].buttonList.forEach((it,ind,arr)=>{
+                if(it.type == 'confirm'){
+                arr[ind].disable = 1
+                }
+            })
+            }
+        });
+        }
+            })
+    },
+    // 免发货
+    freeShipModalClick(e) {
+        freeShipping({ id: this.operateData.id }).then((res) => {
+          this._list();
+          this.$msg("操作成功!");
+        });
+      },
+      // 查看配送
+      seeSendFn(item) {
+        this.$util.pageTo({
+          url: "/admin/order/ship",
+          query: {
+            id: item.id,
+            pageStatus: 5,
+          },
+        });
+      },
+        orderEventBtn(s, item) {
+            let that = this
+            this.orderId=item.id;
+            if (s.type === "selfGet") {
+              this.operateData = item;
+              let self = this;
+              uni.showModal({
+                title: "提示",
+                content: "确认客户已自取",
+                confirmText: "确认",
+                success: function (res) {
+                  if (res.confirm) {
+                    self.freeShipModalClick();
+                  }
+                },
+              });
+              //发货
+            } else if (s.type === "send") {
+              this.pageTo({
+                url: "/pagesOrder/ship",
+                query: {
+                  id: item.id,
+                },
+              });
+            }else if (s.type === "print") {
+              uni.showLoading({title: '打印中...'});
+              cloudPrintOrder({id:item.id}).then((res) => {
+                uni.hideLoading()
+                if(res.code == 1){
+                  if(res.data.hasNoPrint == 1){
+                    uni.showModal({
+                      title: "提示",
+                      content: "您还没有设置打印机",
+                      cancelText: "取消",
+                      confirmText: "去设置",
+                      success: function (res) {
+                        if (res.confirm) {
+                          that.$util.pageTo({url: "/admin/shop/print"})
+                        }
+                      },
+                    })
+                    return false
+                  }else{
+                    item.printNum++
+                    console.log('aaaa',item)
+                  }
+                }
+              })
+                  }else if(s.type == 'confirm'){
+                      let self = this;
+                      uni.showActionSheet({
+                          itemList: ['请选择结算方式:', '欠款', '已收款'],
+                          success: function (res) {
+                  if(res.tapIndex == 0){
+                    return false
+                  }
+                              let payWay = 0
+                              let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
+                              //1欠款 2已收款
+                              let clearType = res.tapIndex == 1 ? 1 : 2;
+                              //选择的已收款,还需要选择收款方式
+                              if(clearType == 2){
+                                  uni.showActionSheet({
+                                      itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
+                                      success: function (respond) {
+                                          let currentIndex = respond.tapIndex
+                                          let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
+                                          if(currentIndex == 0){
+                          return false
+                        }
+                                          payWay = inWay[currentIndex].id
+                                          let params = {id:item.id,clearType:clearType,payWay:payWay}
+                                          self.toConfrim(params,title)
+                                      }
+                                  })
+                              }else{
+                                  let params = {id:item.id,clearType:clearType,payWay:payWay}
+                                  self.toConfrim(params,title)
+                              }
+                          }
+                      });
+            }else if(s.type == 'cancel'){
+                      let self = this;
+                      uni.showModal({
+                          title: '提示',
+                          content: '确认取消?',
+                          success: function (res) {
+                              if (res.confirm) {
+                                  cancel({id:item.id}).then((res) => {
+                                      uni.showToast({title:res.msg,icon:'none'})
+                                      this._list();
+                                  })
+      
+                              }
+                          }
+                      });
+                  }
+        },
+    }
+}

+ 6 - 0
ghsApp/src/pages.json

@@ -535,6 +535,12 @@
 				{"path": "list","style": {"navigationBarTitleText": "红包"}},
 				{"path": "rechargeList","style": {"navigationBarTitleText": "充值记录"}}
 			]
+		},
+		{
+			"root": "admin/order",
+			"pages": [
+				{"path": "itemOrder","style": {"navigationBarTitleText": "订单列表"}}
+			]
 		}
 	],
 	"globalStyle": {