|
@@ -13,7 +13,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
|
|
|
- <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="formReadOnly"
|
|
|
+ <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
label-width="135px" @submit.native.prevent>
|
|
|
<el-row :gutter="15">
|
|
|
<el-col :span="12">
|
|
@@ -252,6 +252,7 @@
|
|
|
<el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
<el-button size="small" v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit('save')">确定</el-button>
|
|
|
</span>
|
|
|
+ <UpLoadComponentDialog ref="upLoadComponentDialog" @getUpload="getUpload"></UpLoadComponentDialog>
|
|
|
<WorkContractChooseCom ref="workContractChooseCom" @getContract="getContract"></WorkContractChooseCom>
|
|
|
<WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
|
|
|
</el-dialog>
|
|
@@ -268,6 +269,7 @@
|
|
|
import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
|
|
|
import WorkContractChooseCom from '../projectRecords/WorkContractChooseCom'
|
|
|
import ProjectReportService from '@/api/cw/reportManagement/ProjectReportService'
|
|
|
+ import UpLoadComponentDialog from '@/views/common/UpLoadComponentDialog'
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -354,9 +356,33 @@
|
|
|
SelectTree,
|
|
|
UserSelect,
|
|
|
WorkClientChooseForm,
|
|
|
- WorkContractChooseCom
|
|
|
+ WorkContractChooseCom,
|
|
|
+ UpLoadComponentDialog
|
|
|
},
|
|
|
methods: {
|
|
|
+ seeFileInfo (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].cwFileInfoList)) {
|
|
|
+ this.inputForm.cwProjectInfoList[index].cwFileInfoList = []
|
|
|
+ }
|
|
|
+ this.$refs.upLoadComponentDialog.newUpload('view', this.inputForm.cwProjectInfoList[index].cwFileInfoList, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ sss (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].cwFileInfoList)) {
|
|
|
+ this.inputForm.cwProjectInfoList[index].cwFileInfoList = []
|
|
|
+ }
|
|
|
+ this.$refs.upLoadComponentDialog.newUpload(null, this.inputForm.cwProjectInfoList[index].cwFileInfoList, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ getUpload (p, index) {
|
|
|
+ p.then((list) => {
|
|
|
+ // list为返回数据
|
|
|
+ this.inputForm.cwProjectInfoList[index].cwFileInfoList = list
|
|
|
+ this.inputForm.cwProjectInfoList[index].fileNumber = list.length
|
|
|
+ this.tableKeyClient = Math.random()
|
|
|
+ console.log('this.inputForm.cwFileInfoList', this.inputForm.cwFileInfoList)
|
|
|
+ console.log('list.length', list.length)
|
|
|
+ console.log(list)
|
|
|
+ })
|
|
|
+ },
|
|
|
getKeyWatch (keyWatch) {
|
|
|
this.keyWatch = keyWatch
|
|
|
},
|
|
@@ -369,7 +395,7 @@
|
|
|
this.title = '项目详情'
|
|
|
this.method = 'view'
|
|
|
}
|
|
|
- this.activeName = 'client'
|
|
|
+ this.activeName = 'newRow'
|
|
|
this.projectRecordsService = new ProjectRecordsService()
|
|
|
this.projectReportService = new ProjectReportService()
|
|
|
this.method = method
|
|
@@ -475,6 +501,23 @@
|
|
|
if (this.commonJS.isEmpty(this.inputForm.createDate)) {
|
|
|
this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
}
|
|
|
+ this.inputForm.cwProjectInfoList.forEach((item, index) => {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].reportDate)) {
|
|
|
+ this.$message.error('报告日期不能为空')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('报告日期不能为空')
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].reportType)) {
|
|
|
+ this.$message.error('报告类型不能为空')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('报告类型不能为空')
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].opinionType)) {
|
|
|
+ this.$message.error('意见类型不能为空')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('意见类型不能为空')
|
|
|
+ }
|
|
|
+ })
|
|
|
this.projectReportService.saveForm(this.inputForm).then(({data}) => {
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.loading = false
|
|
@@ -549,44 +592,45 @@
|
|
|
},
|
|
|
// 新增
|
|
|
// eslint-disable-next-line no-dupe-keys
|
|
|
- insertEvent (type) {
|
|
|
- if (type === 'client') {
|
|
|
- let d = {
|
|
|
- no: '',
|
|
|
- name: '',
|
|
|
- companyLevel: ''
|
|
|
- }
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
|
|
|
- this.inputForm.cwProjectClientInfoDTOList = []
|
|
|
- }
|
|
|
- this.$refs.clientTable.insertAt(d)
|
|
|
- this.inputForm.cwProjectClientInfoDTOList.push(d)
|
|
|
- this.tableKeyClient = Math.random()
|
|
|
- }
|
|
|
- },
|
|
|
+ // insertEvent (type) {
|
|
|
+ // if (type === 'client') {
|
|
|
+ // let d = {
|
|
|
+ // no: '',
|
|
|
+ // name: '',
|
|
|
+ // companyLevel: ''
|
|
|
+ // }
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
|
|
|
+ // this.inputForm.cwProjectClientInfoDTOList = []
|
|
|
+ // }
|
|
|
+ // this.$refs.clientTable.insertAt(d)
|
|
|
+ // this.inputForm.cwProjectClientInfoDTOList.push(d)
|
|
|
+ // this.tableKeyClient = Math.random()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// 删除
|
|
|
removeEvent (row, rowIndex, type) {
|
|
|
if (type === 'client') {
|
|
|
this.$refs.clientTable.remove(row)
|
|
|
- this.inputForm.cwProjectClientInfoDTOList.splice(rowIndex, 1)
|
|
|
+ // this.inputForm.cwProjectClientInfoDTOList.splice(rowIndex, 1)
|
|
|
+ this.inputForm.cwProjectInfoList.splice(rowIndex, 1)
|
|
|
}
|
|
|
},
|
|
|
openWorkClient () {
|
|
|
this.$refs.workClientChooseForm.init()
|
|
|
},
|
|
|
getWorkClientChoose (list) {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
|
|
|
- this.inputForm.cwProjectClientInfoDTOList = []
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList)) {
|
|
|
+ this.inputForm.cwProjectInfoList = []
|
|
|
}
|
|
|
let _this = this
|
|
|
let _list = list
|
|
|
const waitForEach = function () {
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
_list.forEach((item) => {
|
|
|
- _this.inputForm.cwProjectClientInfoDTOList.forEach(client => {
|
|
|
- if (item.no === client.no) {
|
|
|
- _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
|
|
|
- throw new Error('已存在客户 “' + client.name + '”,请重新选择')
|
|
|
+ _this.inputForm.cwProjectInfoList.forEach(client => {
|
|
|
+ if (item.id === client.servedUnitId) {
|
|
|
+ // _this.$message.error('已存在客户 “' + client.servedUnitName + '”,请重新选择')
|
|
|
+ // throw new Error('已存在客户 “' + client.servedUnitName + '”,请重新选择')
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -595,8 +639,21 @@
|
|
|
}
|
|
|
waitForEach().then(() => {
|
|
|
list.forEach(item => {
|
|
|
- this.$refs.clientTable.insertAt(item)
|
|
|
- this.inputForm.cwProjectClientInfoDTOList.push(item)
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ let d = {
|
|
|
+ servedUnitName: item.name, // 被服务单位名称
|
|
|
+ reportNumber: this.inputForm.projectNumber + '-0' + (this.inputForm.cwProjectInfoList.length + 1), // 报告流水号
|
|
|
+ issueReport: '是',
|
|
|
+ sealType: '未盖章',
|
|
|
+ id: this.uuid,
|
|
|
+ servedUnitId: item.id
|
|
|
+ }
|
|
|
+ console.log('新增行数据填入')
|
|
|
+ console.log('item', item)
|
|
|
+ console.log('d', d)
|
|
|
+ this.$refs.clientTable.insertAt(d)
|
|
|
+ this.inputForm.cwProjectInfoList.push(d)
|
|
|
+ console.log('this.inputForm.cwProjectInfoList', this.inputForm.cwProjectInfoList)
|
|
|
this.tableKeyClient = Math.random()
|
|
|
})
|
|
|
})
|
|
@@ -608,6 +665,7 @@
|
|
|
this.inputForm.payerSubject = row.payerSubject
|
|
|
this.inputForm.paymentMethod = row.paymentMethod
|
|
|
this.inputForm.contractId = row.id
|
|
|
+ this.inputForm.cwProjectInfoList = []
|
|
|
},
|
|
|
openContract () {
|
|
|
this.$refs.workContractChooseCom.init()
|