|
@@ -227,18 +227,15 @@
|
|
|
|
|
|
<script>
|
|
|
import UserSelect from '@/components/userSelect'
|
|
|
- // import UpLoadComponentDialog from '@/views/common/UpLoadComponentDialog'
|
|
|
+ import CommonApi from '@/api/cw/common/CommonApi'
|
|
|
import MaterialManagementDialog from '../file/MaterialManagementDialog'
|
|
|
- // import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
|
|
|
import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
|
|
|
- // import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
|
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
import SelectUserTree from '@/views/modules/utils/treeUserSelect'
|
|
|
import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
import XEUtils from 'xe-utils'
|
|
|
import UserService from '@/api/sys/UserService'
|
|
|
import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
|
|
|
- // import CwReimbursementTypePullForm from '@/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm'
|
|
|
import MaterialTypePullForm from '../info/MaterialTypePullForm'
|
|
|
import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
|
|
|
export default {
|
|
@@ -285,25 +282,20 @@
|
|
|
purchaseDate: '',
|
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
|
+ procInsId: '',
|
|
|
// amountInfos: [],
|
|
|
files: [] // 附件信息
|
|
|
},
|
|
|
keyWatch: ''
|
|
|
}
|
|
|
},
|
|
|
- // ReimbursementApprovalService: null,
|
|
|
MaterialManagementService: null,
|
|
|
- // reimbursementApprovalTypeService: null,
|
|
|
userService: null,
|
|
|
+ commonApi: null,
|
|
|
created () {
|
|
|
- // this.reimbursementApprovalService = new ReimbursementApprovalService()
|
|
|
this.materialManagementService = new MaterialManagementService()
|
|
|
- // this.inputForm.userId = this.userId
|
|
|
- // this.inputForm.handledBy = this.name
|
|
|
- // this.inputForm.purchaseDate = new Date()
|
|
|
- // this.inputForm.deptName = this.officeName
|
|
|
this.userService = new UserService()
|
|
|
- // this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
|
|
|
+ this.commonApi = new CommonApi()
|
|
|
},
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -326,7 +318,6 @@
|
|
|
SelectUserTree,
|
|
|
SelectTree,
|
|
|
CwProgramPageForm,
|
|
|
- // CwReimbursementTypePullForm,
|
|
|
MaterialTypePullForm,
|
|
|
UserPullForm
|
|
|
},
|
|
@@ -384,6 +375,7 @@
|
|
|
purchaseDate: new Date(),
|
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
|
+ procInsId: '',
|
|
|
// amountInfos: [],
|
|
|
files: [] // 附件信息
|
|
|
}
|
|
@@ -450,36 +442,6 @@
|
|
|
if (method !== 'edit' && method !== 'view') {
|
|
|
this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
|
|
|
}
|
|
|
- // if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
- // this.loading = true
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
- // this.inputForm = this.recover(this.inputForm, data)
|
|
|
- // if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
|
|
|
- // this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
|
|
|
- // }
|
|
|
- // if (this.commonJS.isNotEmpty(data.purchaserAgentId)) {
|
|
|
- // this.purchaserAgentId = data.purchaserAgentId
|
|
|
- // }
|
|
|
- // if (this.commonJS.isNotEmpty(data.procurementTypeId)) {
|
|
|
- // this.procurementTypeId = data.procurementTypeId
|
|
|
- // }
|
|
|
- // let i = this.inputForm.detailInfos.length
|
|
|
- // for (let j = 0; j < i; j++) {
|
|
|
- // if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
|
|
|
- // if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
|
|
|
- // this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
|
- // this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
- // }
|
|
|
- // if (method !== 'edit' && method !== 'view') {
|
|
|
- // this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
|
|
|
- // }
|
|
|
})
|
|
|
},
|
|
|
getUpload (p, index) {
|
|
@@ -524,14 +486,6 @@
|
|
|
}).catch(() => {
|
|
|
this.loading = false
|
|
|
})
|
|
|
- // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
- // this.close()
|
|
|
- // this.$message.success(data)
|
|
|
- // this.$emit('refreshDataList')
|
|
|
- // this.loading = false
|
|
|
- // }).catch(() => {
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -550,7 +504,6 @@
|
|
|
}
|
|
|
if (type === 'amount') {
|
|
|
this.$refs.amountTable.remove(row)
|
|
|
- // this.inputForm.amountInfos.splice(rowIndex, 1)
|
|
|
}
|
|
|
},
|
|
|
// 新增
|
|
@@ -569,6 +522,16 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ reapplyForm (callback) {
|
|
|
+ this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startForm(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 暂存
|
|
|
async saveForm (callback) {
|
|
|
this.loading = true
|
|
@@ -589,14 +552,6 @@
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
|
})
|
|
|
- // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
- // callback()
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.loading = false
|
|
|
- // }).catch(() => {
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
},
|
|
|
// 送审
|
|
|
async startForm (callback) {
|
|
@@ -655,14 +610,6 @@
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
|
})
|
|
|
- // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
- // callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.loading = false
|
|
|
- // }).catch(() => {
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -679,34 +626,75 @@
|
|
|
this.inputForm.files = []
|
|
|
}
|
|
|
this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
- await this.userService.is().then(({data}) => {
|
|
|
- if (data) {
|
|
|
- this.inputForm.status = '5'
|
|
|
+ console.log('this.inputForm.procInsId', this.inputForm.procInsId)
|
|
|
+ this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data)) {
|
|
|
+ console.log('进来了', data)
|
|
|
+ if (data === '公司领导审批') {
|
|
|
+ this.inputForm.status = '5'
|
|
|
+ }
|
|
|
}
|
|
|
+ this.materialManagementService.save(this.inputForm).then(({data}) => {
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
})
|
|
|
- this.materialManagementService.save(this.inputForm).then(({data}) => {
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- // this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
|
|
|
- // callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- // this.loading = false
|
|
|
- // }).catch(() => {
|
|
|
- // this.loading = false
|
|
|
- // })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 修改状态
|
|
|
- updateStatusById (type) {
|
|
|
- if (type === 'reject') {
|
|
|
- this.inputForm.status = '4'
|
|
|
- // this.reimbursementApprovalService.updateStatusById(this.inputForm)
|
|
|
- this.materialManagementService.updateStatusById(this.inputForm)
|
|
|
+ async updateStatusById (type, callback) {
|
|
|
+ if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (type === 'reject') {
|
|
|
+ // 驳回
|
|
|
+ this.inputForm.status = '4'
|
|
|
+ }
|
|
|
+ if (type === 'reback') {
|
|
|
+ // 撤回
|
|
|
+ this.inputForm.status = '3'
|
|
|
+ }
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ let param = {status: this.inputForm.status, id: this.inputForm.id}
|
|
|
+ this.materialManagementService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 'hold') {
|
|
|
+ this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // 终止
|
|
|
+ let param = {status: '1', id: this.inputForm.id}
|
|
|
+ this.materialManagementService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ // 修改状态
|
|
|
+ // updateStatusById (type) {
|
|
|
+ // if (type === 'reject') {
|
|
|
+ // this.inputForm.status = '4'
|
|
|
+ // // this.reimbursementApprovalService.updateStatusById(this.inputForm)
|
|
|
+ // this.materialManagementService.updateStatusById(this.inputForm)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
footerMethod ({ columns, data }) {
|
|
|
const footerData = [
|
|
|
columns.map((column, columnIndex) => {
|
|
@@ -778,14 +766,6 @@
|
|
|
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
return str
|
|
|
},
|
|
|
- // isExict (row) {
|
|
|
- // this.reimbursementApprovalService.checkNumber(row.number).then(({data}) => {
|
|
|
- // if (data) {
|
|
|
- // this.$message.error('该发票号已存在')
|
|
|
- // row.number = ''
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
countAmount (row) {
|
|
|
let amount
|
|
|
let taxAmount
|