|
|
@@ -164,7 +164,12 @@
|
|
|
:disabled="!isPaid(scope.row)"
|
|
|
@click="printA4(scope.row)"
|
|
|
>打印A4</el-button>
|
|
|
- <el-button type="text" size="mini" @click="openPrintCard(scope.row)">打印贺卡</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="mini"
|
|
|
+ :disabled="!isPaid(scope.row)"
|
|
|
+ @click="printGreetingCard(scope.row)"
|
|
|
+ >打印贺卡</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="mini"
|
|
|
@@ -197,7 +202,6 @@
|
|
|
<goods-detail-dialog ref="goodsDetailRef" />
|
|
|
<call-delivery-dialog ref="callDeliveryRef" @success="refreshData" />
|
|
|
<begin-refund-dialog ref="beginRefundRef" @success="refreshData" />
|
|
|
- <print-card-dialog ref="printCardRef" />
|
|
|
<refund-record-dialog ref="refundRecordRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -206,7 +210,6 @@
|
|
|
import GoodsDetailDialog from './components/goods-detail-dialog';
|
|
|
import CallDeliveryDialog from './components/call-delivery-dialog';
|
|
|
import BeginRefundDialog from './components/begin-refund-dialog';
|
|
|
-import PrintCardDialog from './components/print-card-dialog';
|
|
|
import RefundRecordDialog from './components/refund-record-dialog';
|
|
|
|
|
|
const STATUS_MAP = { 1: '待付款', 2: '待配送', 3: '配送中', 4: '已完结', 5: '已取消', 6: '已退款' };
|
|
|
@@ -221,7 +224,6 @@ export default {
|
|
|
GoodsDetailDialog,
|
|
|
CallDeliveryDialog,
|
|
|
BeginRefundDialog,
|
|
|
- PrintCardDialog,
|
|
|
RefundRecordDialog
|
|
|
},
|
|
|
data() {
|
|
|
@@ -423,14 +425,11 @@ export default {
|
|
|
if (!this.canRefund(row)) return;
|
|
|
this.$refs.beginRefundRef.open(row);
|
|
|
},
|
|
|
- openPrintCard(row) {
|
|
|
- this.$refs.printCardRef.open(row);
|
|
|
- },
|
|
|
openRefundRecord(row) {
|
|
|
this.$refs.refundRecordRef.open(row);
|
|
|
},
|
|
|
/**
|
|
|
- * 打印 A4:确认后走云打印/配送单打印数据(对齐小程序打票能力,确认文案按图)
|
|
|
+ * 打印 A4 配送单:确认后调链科云打印 /order/cloud-print-delivery-slip
|
|
|
*/
|
|
|
printA4(row) {
|
|
|
if (!this.isPaid(row)) return;
|
|
|
@@ -441,10 +440,35 @@ export default {
|
|
|
confirmButtonClass: 'el-button--success'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- return this.$service.order.onlinePrint({ id: row.id });
|
|
|
+ const loading = this.$loading({ lock: true, text: '正在提交打印...' });
|
|
|
+ return this.$service.order
|
|
|
+ .cloudPrintDeliverySlip({ id: row.id, paperType: 'a4' })
|
|
|
+ .finally(() => loading.close());
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.$message.success('已发送打印');
|
|
|
+ this.$message.success('已提交打印');
|
|
|
+ this.refreshData();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 打印贺卡:确认后调链科云打印 /order/cloud-print-greeting-card
|
|
|
+ */
|
|
|
+ printGreetingCard(row) {
|
|
|
+ this.$confirm('是否打印贺卡?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonClass: 'el-button--success'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const loading = this.$loading({ lock: true, text: '正在提交打印...' });
|
|
|
+ return this.$service.order
|
|
|
+ .cloudPrintGreetingCard({ id: row.id })
|
|
|
+ .finally(() => loading.close());
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('已提交打印');
|
|
|
this.refreshData();
|
|
|
})
|
|
|
.catch(() => {});
|