|
|
@@ -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;
|