|
@@ -5,6 +5,19 @@
|
|
|
<div class="order-action-text" @click="item.action">{{ item.text }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ class="edit-dialog"
|
|
|
+ title="编辑订单"
|
|
|
+ width="90%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :visible.sync="editdialogVisible">
|
|
|
+ <CreateOrder ref="editOrderRef" type="edit" :order-code="orderCode"/>
|
|
|
+ <div class="button-group" slot="footer">
|
|
|
+ <el-button size="medium" class="submit-button submit" type="primary" :loading="dialogSubmitLoading" @click="doCloseCreateModel('submit')">提交</el-button>
|
|
|
+ <el-button size="medium" class="submit-button stash" type="primary" plain :loading="dialogSubmitLoading" @click="doCloseCreateModel('stash')">暂存</el-button>
|
|
|
+ <el-button size="medium" class="submit-button cancel" plain @click="doCloseCreateModel('close')">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<Dialog
|
|
|
ref="cancelOrderDialog"
|
|
|
customClass="cancel-order-dialog"
|
|
@@ -35,19 +48,37 @@
|
|
|
<span>该订单不支持下载电子协议</span>
|
|
|
</div>
|
|
|
</Dialog>
|
|
|
+ <!-- 客户扫码自助开票 -->
|
|
|
+ <new-set-order-info :show-content="2" :show-dialog="showDialog" :order-info="orderDetail?.orderData" title="客户自助扫码开票"
|
|
|
+ @close="closeComDialog">
|
|
|
+ </new-set-order-info>
|
|
|
+ <!-- 开票二维码 -->
|
|
|
+ <new-set-order-info ref="invoiceRef" :show-content="4" :show-dialog="showInvoiceDialog" :order-info="orderDetail"
|
|
|
+ title="开票二维码" @close="closeComDialog">
|
|
|
+ <div style="display:flex;flex-direction:column;" slot="content">
|
|
|
+ <span>订单编号:{{selectInvoice.invoice_order_code}}</span>
|
|
|
+ <span>开票金额合计:{{selectInvoice.invoice_money / 100}}元</span>
|
|
|
+ </div>
|
|
|
+ </new-set-order-info>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapActions } from 'vuex'
|
|
|
import Dialog from '@/components/Dialog'
|
|
|
+import CreateOrder from '../create.vue'
|
|
|
+import { ajaxGetContractPdf } from '@/api/modules/'
|
|
|
+import newSetOrderInfo from '../newSetOrderInfo.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'OrderActions',
|
|
|
components: {
|
|
|
- Dialog
|
|
|
+ Dialog,
|
|
|
+ CreateOrder,
|
|
|
+ newSetOrderInfo
|
|
|
},
|
|
|
props: {
|
|
|
- orders: {
|
|
|
+ orderDetail: {
|
|
|
type: Object,
|
|
|
default() {
|
|
|
return {}
|
|
@@ -101,13 +132,54 @@ export default {
|
|
|
// }
|
|
|
],
|
|
|
cancelOrderVisible: false,
|
|
|
- downloadProtocolVisible: false
|
|
|
+ downloadProtocolVisible: false,
|
|
|
+ editdialogVisible: false,
|
|
|
+ dialogSubmitLoading: false,
|
|
|
+ orderCode: '',
|
|
|
+ showDialog: false,
|
|
|
+ showInvoiceDialog: false,
|
|
|
+ orDetails: {},
|
|
|
+ selectInvoice: {}
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ const { id } = this.$route.params
|
|
|
+ this.orderCode = id
|
|
|
+ },
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
+ ...mapActions('order', ['resetPageInfo']),
|
|
|
+ // 编辑订单相关逻辑开始
|
|
|
+
|
|
|
editOrder() {
|
|
|
+ this.editdialogVisible = true;
|
|
|
+ },
|
|
|
+ doCloseCreateModel(type = 'close') {
|
|
|
+ switch (type) {
|
|
|
+ case 'close':
|
|
|
+ this.editdialogVisible = false;
|
|
|
+ this.resetPageInfo()
|
|
|
+ break;
|
|
|
+ case 'submit':
|
|
|
+ case 'stash':
|
|
|
+ this.dialogSubmitLoading = true;
|
|
|
+ const method = type === 'submit' ? 'submit' : 'stash';
|
|
|
+ this.$refs.editOrderRef[method]()
|
|
|
+ .then(() => {
|
|
|
+ this.editdialogVisible = false;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.warn(e);
|
|
|
+ // 这里可以根据需要处理错误,例如显示错误信息
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.dialogSubmitLoading = false;
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
},
|
|
|
+ // 编辑订单相关逻辑结束
|
|
|
|
|
|
// 作废订单相关逻辑开始
|
|
|
cancelOrder() {
|
|
@@ -124,9 +196,13 @@ export default {
|
|
|
// 作废订单相关逻辑结束
|
|
|
|
|
|
// 下载电子协议相关逻辑开始
|
|
|
- downloadProtocol() {
|
|
|
- console.log('downloadProtocol')
|
|
|
- this.downloadProtocolVisible = true
|
|
|
+ async downloadProtocol() {
|
|
|
+ const { error_code: code, data} = await ajaxGetContractPdf({ orderCode: this.orderCode })
|
|
|
+ if (code === 0) {
|
|
|
+ console.log('downloadProtocol', data)
|
|
|
+ } else {
|
|
|
+ this.downloadProtocolVisible = true
|
|
|
+ }
|
|
|
},
|
|
|
downloadProtocolConfirm() {
|
|
|
this.downloadProtocolVisible = false
|
|
@@ -138,8 +214,18 @@ export default {
|
|
|
wxAliPay() {
|
|
|
console.log('wxAliPay')
|
|
|
},
|
|
|
+ // 客户扫码自助开票相关逻辑开始
|
|
|
+ /**
|
|
|
+ * 扫描发票二维码的方法
|
|
|
+ */
|
|
|
+ // 关闭弹框
|
|
|
+ closeComDialog() {
|
|
|
+ this.showDialog = false
|
|
|
+ this.showInvoiceDialog = false
|
|
|
+ },
|
|
|
scanCodeInvoice() {
|
|
|
- console.log('scanCodeInvoice')
|
|
|
+ console.log('scanCodeInvoice')
|
|
|
+ this.showDialog = true;
|
|
|
},
|
|
|
// archiveProtocol() {
|
|
|
// console.log('archiveProtocol')
|
|
@@ -179,6 +265,10 @@ export default {
|
|
|
color: #686868;
|
|
|
}
|
|
|
}
|
|
|
+ .button-group {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
::v-deep {
|
|
|
.download-protocol-dialog.el-dialog {
|
|
|
.dialog-footer {
|