将单据的查看和编辑改为从后台单独查询

This commit is contained in:
季圣华
2022-12-18 22:55:27 +08:00
parent 2113691a41
commit 234f58bfad
4 changed files with 77 additions and 51 deletions

View File

@@ -1454,39 +1454,45 @@
}) })
}, },
show(record, type) { show(record, type) {
this.billType = type //查询单条单据信息
//附件下载 findBillDetailByNumber({ number: record.number }).then((res) => {
this.fileList = record.fileName if (res && res.code === 200) {
this.visible = true let item = res.data
this.modalStyle = 'top:20px;height: 95%;' this.billType = type
this.model = Object.assign({}, record) //附件下载
if(this.model.backAmount) { this.fileList = item.fileName
this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2) this.visible = true
} else { this.modalStyle = 'top:20px;height: 95%;'
this.model.getAmount = this.model.changeAmount this.model = Object.assign({}, item)
} if (this.model.backAmount) {
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - (this.model.deposit + this.model.changeAmount)).toFixed(2) this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
this.$nextTick(() => { } else {
this.form.setFieldsValue(pick(this.model,'id')) this.model.getAmount = this.model.changeAmount
}); }
let showType = 'basic' this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - (this.model.deposit + this.model.changeAmount)).toFixed(2)
if(record.status === '3') { this.$nextTick(() => {
showType = 'basic' this.form.setFieldsValue(pick(this.model, 'id'))
} else if(record.purchaseStatus === '3') { });
showType = 'purchase' let showType = 'basic'
} if (item.status === '3') {
let params = { showType = 'basic'
headerId: this.model.id, } else if (item.purchaseStatus === '3') {
mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性 showType = 'purchase'
linkType: showType, }
isReadOnly: '1' let params = {
} headerId: this.model.id,
let url = this.readOnly ? this.url.detailList : this.url.detailList; mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
this.requestSubTableData(record, type, url, params); linkType: showType,
this.initPlatform() isReadOnly: '1'
this.getSystemConfig() }
this.getBillListByLinkNumber(this.model.number) let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.getFinancialBillNoByBillId(this.model.id) this.requestSubTableData(item, type, url, params);
this.initPlatform()
this.getSystemConfig()
this.getBillListByLinkNumber(this.model.number)
this.getFinancialBillNoByBillId(this.model.id)
}
})
}, },
requestSubTableData(record, type, url, params, success) { requestSubTableData(record, type, url, params, success) {
this.loading = true this.loading = true

View File

@@ -1,7 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import {getAction } from '@/api/manage' import {getAction } from '@/api/manage'
import { FormTypes } from '@/utils/JEditableTableUtil' import { FormTypes } from '@/utils/JEditableTableUtil'
import {findBySelectSup, findBySelectCus, findBySelectRetail, getUserList, getAccount} from '@/api/api' import {findBillDetailByNumber, findBySelectSup, findBySelectCus, findBySelectRetail, getUserList, getAccount} from '@/api/api'
export const BillListMixin = { export const BillListMixin = {
data () { data () {
@@ -59,7 +59,13 @@ export const BillListMixin = {
if(this.btnEnableList.indexOf(2)===-1) { if(this.btnEnableList.indexOf(2)===-1) {
this.$refs.modalForm.isCanCheck = false this.$refs.modalForm.isCanCheck = false
} }
this.handleEdit(record); //查询单条单据信息
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
let item = res.data
this.handleEdit(item)
}
})
} else { } else {
this.$message.warning("抱歉,只有未审核的单据才能编辑!") this.$message.warning("抱歉,只有未审核的单据才能编辑!")
} }

View File

@@ -399,6 +399,7 @@
<script> <script>
import pick from 'lodash.pick' import pick from 'lodash.pick'
import { getAction, postAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import { findFinancialDetailByNumber } from '@/api/api'
import JUpload from '@/components/jeecg/JUpload' import JUpload from '@/components/jeecg/JUpload'
export default { export default {
name: 'FinancialDetail', name: 'FinancialDetail',
@@ -476,20 +477,26 @@
}, },
methods: { methods: {
show(record, type) { show(record, type) {
this.financialType = type //查询单条财务信息
//附件下载 findFinancialDetailByNumber({ billNo: record.billNo }).then((res) => {
this.fileList = record.fileName if (res && res.code === 200) {
this.visible = true let item = res.data
this.modalStyle = 'top:20px;height: 95%;' this.financialType = type
this.model = Object.assign({}, record) //附件下载
this.$nextTick(() => { this.fileList = item.fileName
this.form.setFieldsValue(pick(this.model,'id')) this.visible = true
}); this.modalStyle = 'top:20px;height: 95%;'
let params = { this.model = Object.assign({}, item)
headerId: this.model.id, this.$nextTick(() => {
} this.form.setFieldsValue(pick(this.model, 'id'))
let url = this.readOnly ? this.url.detailList : this.url.detailList; });
this.requestSubTableData(url, params); let params = {
headerId: this.model.id,
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params);
}
})
}, },
requestSubTableData(url, params, success) { requestSubTableData(url, params, success) {
this.loading = true this.loading = true

View File

@@ -1,4 +1,5 @@
import {findBySelectSup, findBySelectCus, findBySelectOrgan, findBySelectRetail, getUserList, getPersonByType, getAccount} from '@/api/api' import {findFinancialDetailByNumber, findBySelectSup, findBySelectCus, findBySelectOrgan, findBySelectRetail,
getUserList, getPersonByType, getAccount} from '@/api/api'
import Vue from 'vue' import Vue from 'vue'
export const FinancialListMixin = { export const FinancialListMixin = {
@@ -43,7 +44,13 @@ export const FinancialListMixin = {
if(this.btnEnableList.indexOf(2)===-1) { if(this.btnEnableList.indexOf(2)===-1) {
this.$refs.modalForm.isCanCheck = false this.$refs.modalForm.isCanCheck = false
} }
this.handleEdit(record); //查询单条财务信息
findFinancialDetailByNumber({ billNo: record.billNo }).then((res) => {
if (res && res.code === 200) {
let item = res.data
this.handleEdit(item)
}
})
} else { } else {
this.$message.warning("抱歉,只有未审核的单据才能编辑!") this.$message.warning("抱歉,只有未审核的单据才能编辑!")
} }