|
@@ -7,6 +7,9 @@
|
|
<a id="collectionPayment-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="collectionPayment-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
|
|
<p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template slot="extra">
|
|
|
|
+ <Print :disabled="chooseLoadData.length==0" @handlePrint="handlePrint"></Print>
|
|
|
|
+ </template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<!-- 已选单据 -->
|
|
<!-- 已选单据 -->
|
|
<a-card size="small" :bordered="false" class="collectionPayment-cont">
|
|
<a-card size="small" :bordered="false" class="collectionPayment-cont">
|
|
@@ -76,12 +79,11 @@
|
|
<a-col span="12">
|
|
<a-col span="12">
|
|
<a-form-model-item prop="amountSettled">
|
|
<a-form-model-item prop="amountSettled">
|
|
<template slot="label">
|
|
<template slot="label">
|
|
- 应结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
|
|
|
|
+ 本次结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
</template>
|
|
</template>
|
|
<a-input-number
|
|
<a-input-number
|
|
id="collectionPayment-amountSettled"
|
|
id="collectionPayment-amountSettled"
|
|
- v-model="amountSettled"
|
|
|
|
- disabled
|
|
|
|
|
|
+ v-model="form.amountSettled"
|
|
:precision="2"
|
|
:precision="2"
|
|
placeholder=""
|
|
placeholder=""
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
@@ -103,7 +105,7 @@
|
|
<a-col span="12">
|
|
<a-col span="12">
|
|
<a-form-model-item prop="actualSettlementAmount">
|
|
<a-form-model-item prop="actualSettlementAmount">
|
|
<template slot="label">
|
|
<template slot="label">
|
|
- 实结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
|
|
|
|
+ 本次实际结算金额(<span :class="isPositive ? 'green':'red'">{{ isPositive ? '收款' : '付款' }}</span>)
|
|
</template>
|
|
</template>
|
|
<a-input-number
|
|
<a-input-number
|
|
id="collectionPayment-actualSettlementAmount"
|
|
id="collectionPayment-actualSettlementAmount"
|
|
@@ -151,10 +153,12 @@ import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import chooseBillModal from './chooseBillModal.vue'
|
|
import chooseBillModal from './chooseBillModal.vue'
|
|
import { settleStyleQueryAll } from '@/api/settleStyle'
|
|
import { settleStyleQueryAll } from '@/api/settleStyle'
|
|
-import { settleUnitSave } from '@/api/settle'
|
|
|
|
|
|
+import { settleUnitSave, settleDetailPrint, settleDetailExport } from '@/api/settle'
|
|
|
|
+import Print from '@/views/common/print.vue'
|
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
export default {
|
|
export default {
|
|
name: 'CollectionPaymentDetail',
|
|
name: 'CollectionPaymentDetail',
|
|
- components: { STable, VSelect, chooseBillModal },
|
|
|
|
|
|
+ components: { STable, VSelect, chooseBillModal, Print },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -182,11 +186,13 @@ export default {
|
|
wrapperCol: { span: 16 }
|
|
wrapperCol: { span: 16 }
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
|
|
+ amountSettled: 0,
|
|
discountAmount: 0, // 折让金额
|
|
discountAmount: 0, // 折让金额
|
|
settleStyleSn: undefined,
|
|
settleStyleSn: undefined,
|
|
remark: ''
|
|
remark: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
|
|
+ amountSettled: [{ required: true, message: '请输入本次结算金额,系统将自动分配到已选单据上', trigger: 'change' }],
|
|
discountAmount: [{ required: true, message: '请输入折让金额', trigger: 'blur' }],
|
|
discountAmount: [{ required: true, message: '请输入折让金额', trigger: 'blur' }],
|
|
settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }]
|
|
settleStyleSn: [{ required: true, message: '请选择结算方式', trigger: 'change' }]
|
|
},
|
|
},
|
|
@@ -195,6 +201,20 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ // 打印预览/快捷打印
|
|
|
|
+ handlePrint (type, printerType) {
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ let url = settleDetailPrint
|
|
|
|
+ const params = { sn: this.$route.params.sn }
|
|
|
|
+ if (type == 'export') { // 导出
|
|
|
|
+ url = settleDetailExport
|
|
|
|
+ }
|
|
|
|
+ // 打印或导出
|
|
|
|
+ hdPrint(printerType, type, url, params, '销售单', function () {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 本次结算金额合计
|
|
// 本次结算金额合计
|
|
currentTotalBalance () {
|
|
currentTotalBalance () {
|
|
let val = 0
|
|
let val = 0
|
|
@@ -226,16 +246,13 @@ export default {
|
|
val += (Number(item.settleAmount) * 1000)
|
|
val += (Number(item.settleAmount) * 1000)
|
|
})
|
|
})
|
|
val = val / 1000
|
|
val = val / 1000
|
|
- if (val < 0) {
|
|
|
|
- this.isPositive = false
|
|
|
|
- } else {
|
|
|
|
- this.isPositive = true
|
|
|
|
- }
|
|
|
|
|
|
+ this.isPositive = val > 0
|
|
|
|
+ this.form.amountSettled = Math.abs(val)
|
|
return Math.abs(val)
|
|
return Math.abs(val)
|
|
},
|
|
},
|
|
// 实结算金额
|
|
// 实结算金额
|
|
actualSettlementAmount () {
|
|
actualSettlementAmount () {
|
|
- const val = (this.amountSettled * 1000 - this.form.discountAmount * 1000) / 1000
|
|
|
|
|
|
+ const val = (this.form.amountSettled * 1000 - this.form.discountAmount * 1000) / 1000
|
|
return val
|
|
return val
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -262,7 +279,7 @@ export default {
|
|
form.settleClientSn = _this.$route.params.sn || undefined
|
|
form.settleClientSn = _this.$route.params.sn || undefined
|
|
form.settleClientType = _this.chooseLoadData[0].settleClientType
|
|
form.settleClientType = _this.chooseLoadData[0].settleClientType
|
|
form.settleType = _this.isPositive ? 'R' : 'P'
|
|
form.settleType = _this.isPositive ? 'R' : 'P'
|
|
- form.settleAmount = _this.amountSettled
|
|
|
|
|
|
+ form.settleAmount = _this.form.amountSettled
|
|
form.realSettleAmount = _this.actualSettlementAmount
|
|
form.realSettleAmount = _this.actualSettlementAmount
|
|
form.detailList = []
|
|
form.detailList = []
|
|
_this.chooseLoadData.map(item => {
|
|
_this.chooseLoadData.map(item => {
|