|
|
@@ -1,34 +1,32 @@
|
|
|
<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">
|
|
|
<div v-if="!$util.isEmpty(item.orderInfo)">
|
|
|
- <OrderItem :item="item.orderInfo" @orderEventBtn="orderEventBtn"></OrderItem>
|
|
|
+ <OrderItem :item="item.orderInfo" @printOrder="printOrder"></OrderItem>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <OrderItem :item="item" @printOrder="printOrder"></OrderItem>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
- <app-wrapper-empty
|
|
|
- title="暂无数据"
|
|
|
- :is-empty="$util.isEmpty(list.data)"
|
|
|
- />
|
|
|
+ <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";
|
|
|
+import OrderItem from "../home/components/OrderItem"
|
|
|
+import { getListB,cloudPrintOrder} from "@/api/order";
|
|
|
export default {
|
|
|
name: "itemOrder",
|
|
|
components: {
|
|
|
@@ -40,24 +38,7 @@ export default {
|
|
|
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();
|
|
|
@@ -74,42 +55,37 @@ export default {
|
|
|
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() {
|
|
|
-
|
|
|
+ onLoad() {
|
|
|
+ this.getOrderList()
|
|
|
},
|
|
|
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)
|
|
|
- });
|
|
|
+ printOrder(item){
|
|
|
+ let that = this
|
|
|
+ uni.showLoading({title: '打印中...'});
|
|
|
+ cloudPrintOrder({id:item.id}).then((res) => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ if(res.data.hasNoPrint == 1){
|
|
|
+ that.$util.confirmModal({content:'请先设置打印机'},() => {
|
|
|
+ that.$util.pageTo({url: "/admin/shop/print"})
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ item.printNum++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getOrderList() {
|
|
|
+ if(this.option.productId){
|
|
|
+ return getOrderInfoList({ productId:this.option.productId, page: this.list.page }).then((res) => {
|
|
|
+ this.completes(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.option.customId){
|
|
|
+ return getListB({ page: this.list.page,customId:this.option.customId }).then((res) => {
|
|
|
+ this.completes(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
};
|