|
|
@@ -265,7 +265,7 @@ import { getUserDet } from '@/api/member';
|
|
|
import { createExpressOrder, cancelExpressOrder as cancelSFExpressOrder } from '@/api/express';
|
|
|
import { cancelDeliveryOrder } from '@/api/express/delivery';
|
|
|
import { createCallExpressOrder, cancelCallExpressOrder,getOrderFee } from '@/api/shop/shop-express';
|
|
|
-import { printWlLabel } from '@/api/order';
|
|
|
+import { printWlLabel, cloudPrintOrder } from '@/api/order';
|
|
|
import { iconSrc } from '@/utils/iconSrc';
|
|
|
export default {
|
|
|
name: 'OrderItem',
|
|
|
@@ -320,6 +320,11 @@ export default {
|
|
|
updateFiled(info) {
|
|
|
this.$emit('listendUpdateFiled', info);
|
|
|
},
|
|
|
+ bumpItemCount(item, key) {
|
|
|
+ const value = (Number(item[key]) || 0) + 1
|
|
|
+ this.$set(item, key, value)
|
|
|
+ this.updateFiled({ id: item.id, key, value })
|
|
|
+ },
|
|
|
directFh(info) {
|
|
|
this.$emit('directFh', info);
|
|
|
},
|
|
|
@@ -331,13 +336,26 @@ export default {
|
|
|
this.$emit('fillNoFh', info);
|
|
|
},
|
|
|
printOrder(item) {
|
|
|
- let that = this;
|
|
|
+ const that = this
|
|
|
+ const doPrint = () => {
|
|
|
+ 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 {
|
|
|
+ that.bumpItemCount(item, 'printNum')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (item.printNum && Number(item.printNum) > 0) {
|
|
|
- this.$util.confirmModal({ content: '请检查是否发过货,确认补打?' }, () => {
|
|
|
- that.$emit('printOrder', item);
|
|
|
- });
|
|
|
+ this.$util.confirmModal({ content: '请检查是否发过货,确认补打?' }, doPrint)
|
|
|
} else {
|
|
|
- that.$emit('printOrder', item);
|
|
|
+ doPrint()
|
|
|
}
|
|
|
},
|
|
|
printWlFlag(item) {
|
|
|
@@ -346,12 +364,12 @@ export default {
|
|
|
printWlLabel({ id: item.id }).then(res => {
|
|
|
if (res.code == 1) {
|
|
|
that.$msg(res.msg)
|
|
|
- that.$set(item, 'printWlNum', (Number(item.printWlNum) || 0) + 1)
|
|
|
+ that.bumpItemCount(item, 'printWlNum')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
if (item.printWlNum && Number(item.printWlNum) > 0) {
|
|
|
- this.$util.confirmModal({ content: '确认补打物流标?' }, doPrint)
|
|
|
+ this.$util.confirmModal({ content: '确认是否补打物流标签?' }, doPrint)
|
|
|
} else {
|
|
|
doPrint()
|
|
|
}
|