|
@@ -167,67 +167,18 @@
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <el-divider content-position="left"><i class="el-icon-document"></i> 合同附件信息</el-divider>
|
|
|
|
- <el-upload ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status' ;" action=""
|
|
|
|
- :limit="999" :http-request="httpRequest"
|
|
|
|
- multiple
|
|
|
|
- :on-exceed="(files, fileList) =>{
|
|
|
|
- $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
|
- }"
|
|
|
|
- :on-remove="handleRemove"
|
|
|
|
- :show-file-list="false"
|
|
|
|
- :on-change="changes"
|
|
|
|
- :on-progress="uploadVideoProcess"
|
|
|
|
- :file-list="filesArra2">
|
|
|
|
- <el-button type="info" size="mini">点击上传</el-button>
|
|
|
|
- </el-upload>
|
|
|
|
- <div style="height: calc(100% - 80px);margin-top: 10px">
|
|
|
|
- <!-- 进度条 -->
|
|
|
|
- <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
|
|
|
|
- <vxe-table
|
|
|
|
- style="margin-left: 5em"
|
|
|
|
- border="inner"
|
|
|
|
- auto-resize
|
|
|
|
- resizable
|
|
|
|
- height="200px"
|
|
|
|
- :loading="loading"
|
|
|
|
- size="small"
|
|
|
|
- ref="projectTable"
|
|
|
|
- show-header-overflow
|
|
|
|
- show-overflow
|
|
|
|
- highlight-hover-row
|
|
|
|
- :menu-config="{}"
|
|
|
|
- :print-config="{}"
|
|
|
|
- @sort-change="sortChangeHandle"
|
|
|
|
- :sort-config="{remote:true}"
|
|
|
|
- :data="dataListNew"
|
|
|
|
- :checkbox-config="{}">
|
|
|
|
- <vxe-column type="seq" width="40"></vxe-column>
|
|
|
|
- <vxe-column title="文件名称" field="name">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
|
|
|
|
- </template>
|
|
|
|
- </vxe-column>
|
|
|
|
- <vxe-column title="创建人" field="createBy"></vxe-column>
|
|
|
|
- <vxe-column title="创建时间" field="createDate"></vxe-column>
|
|
|
|
- <vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button type="text" icon="el-icon-delete" size="small" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
|
|
|
|
- <el-button type="text" icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
|
|
|
|
- </template>
|
|
|
|
- </vxe-column>
|
|
|
|
- </vxe-table>
|
|
|
|
- </div>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<el-image-viewer
|
|
<el-image-viewer
|
|
v-if="showViewer"
|
|
v-if="showViewer"
|
|
:on-close="closeViewer"
|
|
:on-close="closeViewer"
|
|
:url-list="[url]"
|
|
:url-list="[url]"
|
|
zIndex="9999"/>
|
|
zIndex="9999"/>
|
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
import WorkContractService from '@/api/sys/WorkContractService'
|
|
import WorkContractService from '@/api/sys/WorkContractService'
|
|
import WorkClientService from '@/api/sys/WorkClientService'
|
|
import WorkClientService from '@/api/sys/WorkClientService'
|
|
import WorkClientSelect from '@/components/workClientInfoSelect'
|
|
import WorkClientSelect from '@/components/workClientInfoSelect'
|
|
@@ -270,6 +221,7 @@
|
|
contractSpecial: '',
|
|
contractSpecial: '',
|
|
remarks: '',
|
|
remarks: '',
|
|
clientName: '',
|
|
clientName: '',
|
|
|
|
+ workAttachmentList: [],
|
|
status: ''
|
|
status: ''
|
|
},
|
|
},
|
|
inputForm: {
|
|
inputForm: {
|
|
@@ -319,6 +271,7 @@
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
ElImageViewer,
|
|
ElImageViewer,
|
|
|
|
+ UpLoadComponent,
|
|
WorkClientSelect
|
|
WorkClientSelect
|
|
},
|
|
},
|
|
ossService: null,
|
|
ossService: null,
|
|
@@ -336,8 +289,10 @@
|
|
'businessId': {
|
|
'businessId': {
|
|
handler (newVal) {
|
|
handler (newVal) {
|
|
if (this.businessId) {
|
|
if (this.businessId) {
|
|
- this.ossService = new OSSSerive()
|
|
|
|
- this.init('edit', this.businessId)
|
|
|
|
|
|
+ if (this.businessId !== 'false') {
|
|
|
|
+ this.ossService = new OSSSerive()
|
|
|
|
+ this.init('edit', this.businessId)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
@@ -372,13 +327,6 @@
|
|
init (method, id) {
|
|
init (method, id) {
|
|
this.dataList = []
|
|
this.dataList = []
|
|
this.dataListNew = []
|
|
this.dataListNew = []
|
|
- this.ossService.findFileList(id).then(({data}) => {
|
|
|
|
- data.forEach((item) => {
|
|
|
|
- item.name = item.attachmentName
|
|
|
|
- this.dataList.push(item)
|
|
|
|
- this.dataListNew.push(item)
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
this.method = method
|
|
this.method = method
|
|
this.inputForm = {
|
|
this.inputForm = {
|
|
clientId: '',
|
|
clientId: '',
|
|
@@ -404,6 +352,7 @@
|
|
rowurl: '',
|
|
rowurl: '',
|
|
src: '',
|
|
src: '',
|
|
showVi: true,
|
|
showVi: true,
|
|
|
|
+ workAttachmentList: [],
|
|
status: ''
|
|
status: ''
|
|
}
|
|
}
|
|
this.inputForm.id = id
|
|
this.inputForm.id = id
|
|
@@ -419,69 +368,47 @@
|
|
this.visible = true
|
|
this.visible = true
|
|
this.loading = false
|
|
this.loading = false
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.upload.clearFiles()
|
|
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
this.loading = true
|
|
this.loading = true
|
|
this.workContractService.findById(this.inputForm.id).then(({data}) => {
|
|
this.workContractService.findById(this.inputForm.id).then(({data}) => {
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
this.inputForm.contractFees = []
|
|
this.inputForm.contractFees = []
|
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract')
|
|
|
|
+ this.loading = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- this.loading = false
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 表单提交
|
|
// 表单提交
|
|
// 暂存
|
|
// 暂存
|
|
async saveForm1 () {
|
|
async saveForm1 () {
|
|
- this.$refs['inputForm'].validate(async (valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.loading = true
|
|
|
|
- this.inputForm.workAttachmentList = []
|
|
|
|
- this.dataListNew.forEach((item) => {
|
|
|
|
- if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
|
- item.url = item.raw.url
|
|
|
|
- }
|
|
|
|
- item.attachmentFlag = 'workContract'
|
|
|
|
- item.fileSize = item.size
|
|
|
|
- item.attachmentName = item.name
|
|
|
|
- this.inputForm.workAttachmentList.push(item)
|
|
|
|
- })
|
|
|
|
- this.inputForm.status = '1'
|
|
|
|
- let _p = null
|
|
|
|
- await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
|
|
- this.loading = false
|
|
|
|
- _p = new Promise((resolve, reject) => {
|
|
|
|
- resolve({
|
|
|
|
- 'businessTable': data.businessTable,
|
|
|
|
- 'businessId': data.businessId,
|
|
|
|
- 'inputForm': this.inputForm
|
|
|
|
- })
|
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
|
- })
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
|
- this.loading = false
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
+ this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
|
|
+ this.inputForm.status = '1'
|
|
|
|
+ let _p = null
|
|
|
|
+ await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ _p = new Promise((resolve, reject) => {
|
|
|
|
+ resolve({
|
|
|
|
+ 'businessTable': data.businessTable,
|
|
|
|
+ 'businessId': data.businessId,
|
|
|
|
+ 'inputForm': this.inputForm
|
|
})
|
|
})
|
|
- return _p
|
|
|
|
- }
|
|
|
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
|
+ this.loading = false
|
|
})
|
|
})
|
|
|
|
+ return _p
|
|
},
|
|
},
|
|
// 送审
|
|
// 送审
|
|
saveForm (callback) {
|
|
saveForm (callback) {
|
|
this.$refs['inputForm'].validate(async (valid) => {
|
|
this.$refs['inputForm'].validate(async (valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
- this.inputForm.workAttachmentList = []
|
|
|
|
- this.dataListNew.forEach((item) => {
|
|
|
|
- if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
|
- item.url = item.raw.url
|
|
|
|
- }
|
|
|
|
- item.attachmentFlag = 'workContract'
|
|
|
|
- item.fileSize = item.size
|
|
|
|
- item.attachmentName = item.name
|
|
|
|
- this.inputForm.workAttachmentList.push(item)
|
|
|
|
- })
|
|
|
|
|
|
+ this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
this.inputForm.status = '2'
|
|
this.inputForm.status = '2'
|
|
await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
@@ -498,6 +425,7 @@
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
this.visible = false
|
|
this.visible = false
|
|
this.showVi = true
|
|
this.showVi = true
|
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
},
|
|
},
|
|
httpRequest (file) {
|
|
httpRequest (file) {
|
|
httpRequest(file, fileName(file), 'workContract')
|
|
httpRequest(file, fileName(file), 'workContract')
|
|
@@ -601,9 +529,7 @@
|
|
async rowClick (event) {
|
|
async rowClick (event) {
|
|
let id = this.gridData[event.rowIndex].id
|
|
let id = this.gridData[event.rowIndex].id
|
|
this.inputForm.clientId = id
|
|
this.inputForm.clientId = id
|
|
- console.log('id', id)
|
|
|
|
await this.workClientService.findById(id).then((data) => {
|
|
await this.workClientService.findById(id).then((data) => {
|
|
- console.log('data', data)
|
|
|
|
this.inputForm.clientName = data.data.workClientInfo.name
|
|
this.inputForm.clientName = data.data.workClientInfo.name
|
|
})
|
|
})
|
|
this.visable = false
|
|
this.visable = false
|
|
@@ -611,7 +537,6 @@
|
|
async getPopTable () {
|
|
async getPopTable () {
|
|
let name = this.inputForm.clientName
|
|
let name = this.inputForm.clientName
|
|
await this.workClientService.list(name).then(({data}) => {
|
|
await this.workClientService.list(name).then(({data}) => {
|
|
- console.log('data', data)
|
|
|
|
this.gridData = data.records
|
|
this.gridData = data.records
|
|
})
|
|
})
|
|
this.$refs.pops.updatePopper()
|
|
this.$refs.pops.updatePopper()
|
|
@@ -628,6 +553,20 @@
|
|
this.inputForm.contractFee = fee.substring(1, fee.length)
|
|
this.inputForm.contractFee = fee.substring(1, fee.length)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ updateStatusById (type) {
|
|
|
|
+ if (type === 'agree') {
|
|
|
|
+ this.inputForm.status = '5'
|
|
|
|
+ this.workContractService.updateStatusById(this.inputForm)
|
|
|
|
+ }
|
|
|
|
+ if (type === 'reject') {
|
|
|
|
+ this.inputForm.status = '4'
|
|
|
|
+ this.workContractService.updateStatusById(this.inputForm)
|
|
|
|
+ }
|
|
|
|
+ if (type === 'reback') {
|
|
|
|
+ this.inputForm.status = '3'
|
|
|
|
+ this.workContractService.updateStatusById(this.inputForm)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|