|
@@ -174,8 +174,70 @@
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
|
|
|
+ <el-tab-pane label="合同正文" name="uploadFile">
|
|
|
+ <!-- 合同正文-->
|
|
|
+ <UpLoadComponent ref="uploadFile"></UpLoadComponent>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="参与签约方" name="contactParty">
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-button style="margin-bottom: 15px" type="primary" :disabled="true" size="medium" @click="insertEvent('contact')" plain>
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ :column-config="{resizable: true}"
|
|
|
+ show-overflow
|
|
|
+ show-footer
|
|
|
+ :key="2"
|
|
|
+ ref="contactTable"
|
|
|
+ class="vxe-table-element"
|
|
|
+ :data="inputForm.cwWorkClientContactDTOList"
|
|
|
+ style=""
|
|
|
+ @cell-click=""
|
|
|
+ @edit-closed=""
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
|
|
|
+ >
|
|
|
+ <vxe-column type="seq" width="60" align="center" title="序号"></vxe-column>
|
|
|
+ <vxe-table-column align="center" field="customerNo" title="客户编号" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.customerNo" placeholder="客户编号" clearable></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="customerName" title="客户名称" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-form-item label="客户名称" prop="clientId">
|
|
|
+ <work-client-select
|
|
|
+ :size="'medium'"
|
|
|
+ :value="clientId"
|
|
|
+ :disabled="method==='view'"
|
|
|
+ @getValue='(clientId,customerName) => {inputForm.clientId=scope.row.clientId;inputForm.clientName=scope.row.customerName}'
|
|
|
+ >
|
|
|
+ </work-client-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-input v-model="scope.row.customerName" placeholder="客户名称" clearable></el-input>-->
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" title="操作" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'contact')">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="合同归档文件" name="archiveFile">
|
|
|
+ <!-- 合同归档文件-->
|
|
|
+ <UpLoadComponent ref="archiveFile"></UpLoadComponent>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
|
|
|
- </el-form>
|
|
|
<el-image-viewer
|
|
|
v-if="showViewer"
|
|
|
:on-close="closeViewer"
|
|
@@ -186,7 +248,8 @@
|
|
|
|
|
|
<script>
|
|
|
import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
|
|
|
- import ContractFileService from '@/api/cw/workContract/ContractFileService'
|
|
|
+ import ContractFileService from '../../../../api/cw/workContract/ContractFileService'
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
import OSSSerive, {
|
|
|
httpRequest,
|
|
|
toHref,
|
|
@@ -226,13 +289,18 @@
|
|
|
contractSpecial: '',
|
|
|
remarks: '',
|
|
|
clientName: '',
|
|
|
- status: ''
|
|
|
+ status: '',
|
|
|
+ contractProperList: [],
|
|
|
+ contractInfoList: [],
|
|
|
+ customerNo: '',
|
|
|
+ customerName: ''
|
|
|
},
|
|
|
inputForm: {
|
|
|
contractNo: '',
|
|
|
contractName: '',
|
|
|
payerSubject: '',
|
|
|
paymentMethod: '',
|
|
|
+ contractInfoId: '',
|
|
|
signingDate: '',
|
|
|
contractAmount: '',
|
|
|
actualContractAmount: '',
|
|
@@ -246,8 +314,11 @@
|
|
|
contractApprovalType: '',
|
|
|
createBy: JSON.parse(localStorage.getItem('user')).name,
|
|
|
createId: JSON.parse(localStorage.getItem('user')).id,
|
|
|
- createDate: ''
|
|
|
+ createDate: '',
|
|
|
+ contractProperList: [],
|
|
|
+ contractInfoList: []
|
|
|
},
|
|
|
+ activeName: 'archiveFile',
|
|
|
filesArra2: [],
|
|
|
fileList: [],
|
|
|
isFlag: true,
|
|
@@ -259,7 +330,8 @@
|
|
|
type: '',
|
|
|
loadProgress: 0, // 动态显示进度条
|
|
|
progressFlag: false, // 关闭进度条
|
|
|
- promi: null
|
|
|
+ promi: null,
|
|
|
+ keyWatch: ''
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -270,15 +342,15 @@
|
|
|
formReadOnly: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ status: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- ElImageViewer
|
|
|
- },
|
|
|
- computed: {
|
|
|
- officeName () {
|
|
|
- return JSON.parse(localStorage.getItem('user')).officeDTO.name
|
|
|
- }
|
|
|
+ ElImageViewer,
|
|
|
+ UpLoadComponent
|
|
|
},
|
|
|
ossService: null,
|
|
|
// workContractService: null,
|
|
@@ -293,25 +365,37 @@
|
|
|
mounted () {
|
|
|
window.onPreview = this.onPreview
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ officeName () {
|
|
|
+ return JSON.parse(localStorage.getItem('user')).officeDTO.name
|
|
|
+ },
|
|
|
+ bus: {
|
|
|
+ get () {
|
|
|
+ this.$refs.archiveFile.setDividerName('附件')
|
|
|
+ return this.businessId
|
|
|
+ },
|
|
|
+ set (val) {
|
|
|
+ this.businessId = val
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
- 'businessId': {
|
|
|
+ 'keyWatch': {
|
|
|
handler (newVal) {
|
|
|
- if (this.businessId && this.businessId !== 'false') {
|
|
|
- this.ossService = new OSSSerive()
|
|
|
- this.init('edit', this.businessId)
|
|
|
+ if (this.commonJS.isNotEmpty(this.bus)) {
|
|
|
+ this.init('', this.bus)
|
|
|
} else {
|
|
|
- // this.$refs.inputForm.resetFields()
|
|
|
- // this.visible = false
|
|
|
- // this.showVi = true
|
|
|
- // this.$refs.uploadComponent.clearUpload()
|
|
|
- this.init('clean', '')
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- immediate: true,
|
|
|
- deep: false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getKeyWatch (keyWatch) {
|
|
|
+ this.keyWatch = keyWatch
|
|
|
+ },
|
|
|
uploadVideoProcess (event, file, fileList) {
|
|
|
this.progressFlag = true // 显示进度条
|
|
|
this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
|
|
@@ -334,6 +418,7 @@
|
|
|
},
|
|
|
init (method, id) {
|
|
|
console.log(method)
|
|
|
+ console.log('id', id)
|
|
|
this.dataList = []
|
|
|
this.dataListNew = []
|
|
|
this.method = method
|
|
@@ -356,7 +441,10 @@
|
|
|
contractApprovalType: '',
|
|
|
createBy: JSON.parse(localStorage.getItem('user')).name,
|
|
|
createId: JSON.parse(localStorage.getItem('user')).id,
|
|
|
- createDate: ''
|
|
|
+ createDate: '',
|
|
|
+ contractProperList: [],
|
|
|
+ contractInfoList: [],
|
|
|
+ cwWorkClientContactDTOList: []
|
|
|
}
|
|
|
this.inputForm.id = id
|
|
|
if (method === 'add') {
|
|
@@ -372,30 +460,49 @@
|
|
|
this.loading = false
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
- if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
- this.loading = true
|
|
|
- this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
|
|
|
- if (this.commonJS.isEmpty(data.id)) {
|
|
|
- this.contractFileService.findById(this.inputForm.id).then(({data}) => {
|
|
|
- this.contractInfoService.findById(data.contractInfoId).then(({data}) => {
|
|
|
- this.saveData(data)
|
|
|
- if (this.formReadOnly) {
|
|
|
- method = 'view'
|
|
|
- }
|
|
|
- })
|
|
|
+ // if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
+ this.loading = true
|
|
|
+ this.contractInfoService.findById(this.inputForm.id).then(data1 => {
|
|
|
+ this.$refs.archiveFile.clearUpload()
|
|
|
+ this.$refs.uploadFile.clearUpload()
|
|
|
+ this.inputForm.contractProperList = data1.data.contractProperList
|
|
|
+ console.log('data1.id', data1.data.id)
|
|
|
+ console.log('data1.data.filedType', data1.data.filedType)
|
|
|
+ if ((data1.data.filedType !== '0' & data1.data.filedType !== undefined) || data1.data.id === undefined) {
|
|
|
+ console.log('data1.22222')
|
|
|
+ this.contractFileService.findById(this.inputForm.id).then(data2 => {
|
|
|
+ this.inputForm.contractProperList = data2.data.contractProperList
|
|
|
+ this.inputForm.contractInfoList = data2.data.contractInfoList
|
|
|
+ console.log('data2', data2)
|
|
|
+ this.contractInfoService.findById(data2.data.contractInfoId).then(data3 => {
|
|
|
+ data3.data.contractProperList = this.inputForm.contractProperList
|
|
|
+ data3.data.contractInfoList = this.inputForm.contractInfoList
|
|
|
+ this.$refs.archiveFile.newUpload(method, data3.data.contractInfoList, 'cwWorkContract', 300, '合同登记文件')
|
|
|
+ this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', 300, '合同归档文件')
|
|
|
+ this.saveData(data3.data, method)
|
|
|
+ if (this.formReadOnly) {
|
|
|
+ method = 'view'
|
|
|
+ }
|
|
|
})
|
|
|
- } else {
|
|
|
- this.saveData(data)
|
|
|
- if (this.formReadOnly) {
|
|
|
- method = 'view'
|
|
|
- }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('进来了22')
|
|
|
+ this.$refs.uploadFile.newUpload('view', data1.data.contractProperList, 'cwWorkContract', 300, '合同登记文件')
|
|
|
+ this.saveData(data1.data, method)
|
|
|
+ if (this.formReadOnly) {
|
|
|
+ method = 'view'
|
|
|
}
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
- saveData (data) {
|
|
|
+ tabHandleClick (event) {
|
|
|
+ // console.log(event)
|
|
|
+ },
|
|
|
+ saveData (data, method) {
|
|
|
+ console.log('data', data)
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
},
|
|
@@ -417,6 +524,8 @@
|
|
|
if (this.status === 'startAndHoldFiled') {
|
|
|
this.inputForm.filedType = '1'
|
|
|
this.inputForm.contractInfoId = this.businessId
|
|
|
+ this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
|
|
|
+ // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
|
|
|
this.contractFileService.save(this.inputForm)
|
|
|
}
|
|
|
this.$refs.inputForm.resetFields()
|
|
@@ -434,12 +543,13 @@
|
|
|
console.log('inputForm', this.inputForm)
|
|
|
this.inputForm.filedType = '2'
|
|
|
this.inputForm.contractInfoId = id
|
|
|
+ this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
|
|
|
+ this.inputForm.contractProperList = this.$refs.uploadFile.getDataList()
|
|
|
this.contractFileService.save(this.inputForm).then(({data}) => {
|
|
|
console.log('data', data)
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
|
- this.businessId = ''
|
|
|
})
|
|
|
},
|
|
|
// 通过
|
|
@@ -447,10 +557,12 @@
|
|
|
let id = this.inputForm.id
|
|
|
this.loading = true
|
|
|
this.inputForm.status = '5'
|
|
|
+ // this.inputForm.contractInfoList = this.$refs.archiveFile.getDataList()
|
|
|
+ // console.log('this.inputForm.contractProperList', this.inputForm.contractProperList)
|
|
|
this.contractInfoService.save(this.inputForm)
|
|
|
- console.log('inputForm', this.inputForm)
|
|
|
- this.inputForm.filedType = '2'
|
|
|
+ this.inputForm.filedType = '5'
|
|
|
this.inputForm.contractInfoId = id
|
|
|
+ // this.inputForm.contractInfoList = this.$refs.uploadFile.getDataList()
|
|
|
this.contractFileService.save(this.inputForm).then(({data}) => {
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
@@ -463,6 +575,7 @@
|
|
|
this.inputForm.clientName = ''
|
|
|
this.visible = false
|
|
|
this.showVi = true
|
|
|
+ this.$refs.archiveFile.clearUpload()
|
|
|
},
|
|
|
httpRequest (file) {
|
|
|
httpRequest(file, fileName(file), 'workContract')
|
|
@@ -569,17 +682,17 @@
|
|
|
updateStatusById (type) {
|
|
|
console.log('type' + type)
|
|
|
if (type === 'agree') {
|
|
|
- this.inputForm.status = '5'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ this.inputForm.filedType = '5'
|
|
|
+ this.contractFileService.updateStatusById(this.inputForm)
|
|
|
}
|
|
|
// 驳回
|
|
|
if (type === 'reject') {
|
|
|
- this.inputForm.status = '4'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ this.inputForm.filedType = '4'
|
|
|
+ this.contractFileService.updateStatusById(this.inputForm)
|
|
|
}
|
|
|
if (type === 'reback') {
|
|
|
- this.inputForm.status = '3'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ this.inputForm.filedType = '3'
|
|
|
+ this.contractFileService.updateStatusById(this.inputForm)
|
|
|
}
|
|
|
},
|
|
|
checkData () {
|