|
@@ -105,8 +105,8 @@
|
|
|
</a-tabs>
|
|
|
</a-card>
|
|
|
</a-spin>
|
|
|
- <!-- 打印 -->
|
|
|
- <div id="print"></div>
|
|
|
+ <!-- 打印导出 -->
|
|
|
+ <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -115,16 +115,18 @@ import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import { printFun, exportExcel } from '@/libs/JGPrint.js'
|
|
|
import auditDetail from '@/views/common/auditDetail.vue'
|
|
|
+import printModal from './printModal.vue'
|
|
|
import { salesReturnDetail, salesReturnChangeLogList, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
|
|
|
import { salesReturnDetailList } from '@/api/salesReturnDetail'
|
|
|
export default {
|
|
|
name: 'SalesReturnDetail',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, auditDetail },
|
|
|
+ components: { STable, VSelect, auditDetail, printModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
disabled: false,
|
|
|
+ openModal: false,
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -145,6 +147,7 @@ export default {
|
|
|
},
|
|
|
chooseLoadData: [],
|
|
|
detailData: null, // 详情数据
|
|
|
+ nowType: '',
|
|
|
visibleAudit: false,
|
|
|
spinningAudit: false,
|
|
|
curTab: 1,
|
|
@@ -231,19 +234,28 @@ export default {
|
|
|
},
|
|
|
// 打印预览/快捷打印
|
|
|
handlePrint (type) {
|
|
|
- const _this = this
|
|
|
const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.detailData.billStatus)
|
|
|
- const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
|
|
|
- const params = { sn: this.$route.params.sn, status: status }
|
|
|
+ this.nowType = type
|
|
|
+ // 选择是否导出价格
|
|
|
+ if (a) {
|
|
|
+ this.openModal = true
|
|
|
+ } else {
|
|
|
+ this.handleOk({ priceType: 'SALES_RETURN_REASON' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 确定打印或预览
|
|
|
+ handleOk (objs) {
|
|
|
+ const _this = this
|
|
|
+ const params = { sn: this.$route.params.sn, priceType: objs.priceType }
|
|
|
_this.spinning = true
|
|
|
// 导出
|
|
|
- if (type == 'export') {
|
|
|
+ if (this.nowType == 'export') {
|
|
|
exportExcel(salesReturnExport, params, '销售退货', function () {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
} else {
|
|
|
// 打印或预览
|
|
|
- printFun(salesReturnPrint, params, type, '销售退货', () => {
|
|
|
+ printFun(salesReturnPrint, params, this.nowType, '销售退货', () => {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
}
|