diff --git a/src/views/partner/api/workOrder.js b/src/views/partner/api/workOrder.js index 19313ef..df31b86 100644 --- a/src/views/partner/api/workOrder.js +++ b/src/views/partner/api/workOrder.js @@ -59,6 +59,15 @@ export function offlineCharging(data){ }) } + +export function settlement(data){ + return request({ + url: '/partnerOwn/partner/settlement', + method: 'post', + data:data + + }) +} export function inspectionDetail(id){ return request({ url: '/partnerOwn/partner/inspectionDetail', diff --git a/src/views/partner/workOrder.vue b/src/views/partner/workOrder.vue index 0a8a889..2aaab70 100644 --- a/src/views/partner/workOrder.vue +++ b/src/views/partner/workOrder.vue @@ -99,7 +99,7 @@ - + + + - - + + + +
@@ -809,8 +890,9 @@ + style="width: 100%"> @@ -943,6 +1025,7 @@ placeholder="请输入实付金额" v-model="settleForm.realPayMoney" :precision="2" + disabled :min="0" controls-position="right" style="width: 100%" @@ -1020,7 +1103,7 @@ import { getWeorkNodesById, getCustomerSource, batchSettlement, - getBatchList, + getBatchList, settlement, } from "./api/workOrder"; import print from "vue-print-nb"; import moment from "moment"; @@ -1029,6 +1112,7 @@ import DictTag from "@/components/DictTagOld/index.vue"; import CashierConfirmForm from "@/views/drivingSchool/DriveSchoolPay/form/cashierConfirmForm.vue"; import InspectionCashierConfirmForm from "@/views/partner/form/InspectionCashierConfirmForm.vue"; import FileUpload from "@/components/FileUpload/index.vue"; +import PrintButton from "@/components/PrintButton/index.vue"; export default { name: "Info", @@ -1043,6 +1127,7 @@ export default { print, }, components: { + PrintButton, InspectionCashierConfirmForm, CashierConfirmForm, DictTag, @@ -1127,13 +1212,18 @@ export default { ], goodsPrice: 0, - reduceMoney: "", - payMoney: "", + reduceMoney: 0, + payMoney: 0, payType: "", receivablesAccount: "", payRemark: "", fileUrls: "", inspectionId: "", + settlementForm: { + settlementAmount: 0, + goodsPrice: 0, + settlementReduceMoney: 0, + }, size: "", workId: "", // workerList:[], @@ -1168,8 +1258,10 @@ export default { // 是否显示弹出层 open: false, openxin: false, + openSettlementWork: false, opendetail: false, openhe: false, + tableHtml: undefined, htmlStr: null, detailForm: [], selectInspectionProject: [], @@ -1191,7 +1283,7 @@ export default { rescueStatus: null, rescueAmount: null, businessChannel: null, - dateType:'jcTime' + dateType: 'jcTime' }, // 表单参数 form: {}, @@ -1308,7 +1400,7 @@ export default { pageNum: this.batchQueryParams.pageNum || 1, pageSize: this.batchQueryParams.pageSize || 100, accountingConfirm: '1', - dateType:'jcTime' + dateType: 'jcTime' }; if (this.selectBatchType == "cn") { listWorkOrder(params).then((response) => { @@ -1461,6 +1553,13 @@ export default { } this.payMoney = this.goodsPrice / 100 - this.reduceMoney; }, + jisuanSetlementMoney() { + console.log('执行了算') + if (this.settlementForm.settlementReduceMoney > this.settlementForm.goodsPrice / 100) { + this.settlementForm.settlementReduceMoney = this.settlementForm.goodsPrice / 100; + } + this.settlementForm.settlementAmount = this.settlementForm.goodsPrice / 100 - this.settlementForm.settlementReduceMoney; + }, batchJisuan() { if (this.settleForm.reduceMoney > this.settleForm.goodsPrice) { this.settleForm.reduceMoney = this.settleForm.goodsPrice; @@ -1484,6 +1583,14 @@ export default { }; offlineCharging(data).then((res) => { this.openxin = false; + this.$message.success("收款成功"); + this.getList(); + }); + }, + submitSettlementForm() { + + settlement(this.settlementForm).then((res) => { + this.openSettlementWork = false; this.$message.success("结算成功"); this.getList(); }); @@ -1531,14 +1638,35 @@ export default { inspectionDetail(row.id).then((res) => { this.offline = res.data; this.goodsPrice = res.data.goodsPrice; - this.payMoney = res.data.payMoney ? res.data.payMoney / 100 : null; + if (res.data.payMoney) { + this.payMoney = res.data.payMoney ? res.data.payMoney / 100 : 0; + console.log('执行哈哈哈哈',res.data.payMoney) + } else { + this.payMoney = res.data.settlementAmount ? res.data.settlementAmount / 100 : 0; + console.log('kukuku',res.data.settlementAmount) + } + if (res.data.settlementReduceMoney && res.data.settlementReduceMoney != 0) { + this.reduceMoney = res.data.settlementReduceMoney ? res.data.settlementReduceMoney / 100 : 0; + } else { + this.reduceMoney = res.data.reduceMoney ? res.data.reduceMoney / 100 : 0; + } this.payType = res.data.payType ? res.data.payType : null; + this.receivablesAccount = res.data.receivablesAccount ? res.data.receivablesAccount : null; this.fileUrls = res.data.files ? res.data.files : []; this.payRemark = res.data.payRemark ? res.data.payRemark : null; - console.log(res); + console.log(this.payMoney); }); this.openxin = true; }, + async settlementWork(row) { + this.settlementForm.inspectionId = row.id; + this.settlementForm.settlementReduceMoney = 0 + await inspectionDetail(row.id).then((res) => { + this.settlementForm.goodsPrice = res.data.goodsPrice; + this.settlementForm.settlementAmount = res.data.goodsPrice / 100; + }); + this.openSettlementWork = true; + }, detail(row) { console.log("点击详情", row); //根据id查询详情 @@ -1820,6 +1948,32 @@ export default { `info_${new Date().getTime()}.xls` ); }, + getTableHtml() { + // 获取当前表格 DOM + const tableRef = this.selectBatchType === 'cn' ? this.$refs.batchTableCn : this.$refs.batchTableKj; + if (!tableRef) return ''; + + // 获取表格外层 HTML + const tableDom = tableRef.$el.cloneNode(true); + + // 获取样式表(Element UI 样式) + let styles = ''; + document.querySelectorAll('link[rel="stylesheet"]').forEach(link => { + styles += ``; + }); + console.log('styles', styles) + + return styles + tableDom.outerHTML; + }, + beforePrint() { + this.tableHtml = this.getTableHtml(); // 打印前生成 HTML + console.log('tableHtml', this.tableHtml) + // 如果要打印全量数据,可以这里先拉数据 + return Promise.resolve(); + }, + afterPrint() { + console.log('打印完成'); + } }, };