|
@@ -177,8 +177,9 @@
|
|
|
<ws-upload
|
|
|
v-if="warehouseType == 1"
|
|
|
ref="upload"
|
|
|
- table-name="maintain_work_order"
|
|
|
+ table-name="warehouseEdit"
|
|
|
oss-key="mainPlan"
|
|
|
+ :file-list="fileList"
|
|
|
:comp-id="compId"
|
|
|
:appendix-ids="appendixIdsAdd"
|
|
|
:vesselId="deptBudgetList.addressUrl"
|
|
@@ -207,6 +208,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { getFileList, saveFiles } from '@/model/upload'
|
|
|
import {
|
|
|
xiala,
|
|
|
billoperatehis,
|
|
@@ -238,6 +240,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
+ fileList: [],
|
|
|
//弹出框
|
|
|
dialogViewSpareMoney: false,
|
|
|
dialogApproveFormVisible: false,
|
|
@@ -362,7 +366,8 @@ export default {
|
|
|
e.center.lat + ',' + e.center.lng
|
|
|
},
|
|
|
uploadSuccess(data, files, url) {
|
|
|
- console.log(data, files, url)
|
|
|
+ this.fileList = files
|
|
|
+ console.log('uploadSuccess ',data, files, url)
|
|
|
},
|
|
|
onChange(files) {
|
|
|
this.fileNum = files
|
|
@@ -479,9 +484,21 @@ export default {
|
|
|
].code
|
|
|
this.selectedOptions = tmp
|
|
|
this.deptBudgetList = response
|
|
|
+ if(this.deptBudgetList.addressUrl){
|
|
|
+ this.fileList = this._getFileList(this.deptBudgetList.addressUrl)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ // 传入appendixIds 从服务器获取文件列表信息
|
|
|
+ _getFileList (appendixIds) {
|
|
|
+ return new Promise(async next => {
|
|
|
+ try {
|
|
|
+ next(await getFileList({ appendixIds }).toPromise() || [])
|
|
|
+ } catch (error) {
|
|
|
+ next()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//提交
|
|
|
submit() {
|
|
|
if (!this.deptBudgetList.warehouseName) {
|
|
@@ -610,6 +627,19 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ const newAppendixs = this.fileList
|
|
|
+ const params = { newAppendixs}
|
|
|
+ saveFiles(params)
|
|
|
+ .toPromise()
|
|
|
+ .then(res => {
|
|
|
+ resolve(res.join())
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.saveFilesError'))
|
|
|
+ reject()
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 关闭 dialog时 处理文件url 初始化upload组件
|