update 稽查计划&稽查流程 调整前端存储
This commit is contained in:
+12
-38
@@ -59,7 +59,8 @@ import { getFileInfo } from '@/api/api'
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { addInspectionContentTable, editInspectionContentTable, getFileByInspectId } from '@api/workCenter'
|
||||
import { getFileByInspectId } from '@api/workCenter'
|
||||
import moment from 'moment/moment'
|
||||
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
@@ -99,7 +100,7 @@ export default {
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
index: undefined, // 编辑的表格的下标
|
||||
index: -1, // 编辑的表格的下标
|
||||
iframeSrc: '' // 左侧预览的路径
|
||||
}
|
||||
},
|
||||
@@ -163,7 +164,7 @@ export default {
|
||||
close () {
|
||||
this.visible = false
|
||||
this.model = {}
|
||||
this.index = undefined
|
||||
this.index = -1
|
||||
this.iframeSrc = ''
|
||||
},
|
||||
handleCancel () {
|
||||
@@ -171,53 +172,26 @@ export default {
|
||||
},
|
||||
// 提交并新增
|
||||
handleSubmitAddAdd () {
|
||||
if (this.confirmLoading) return
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.confirmLoading = true
|
||||
const param = Object.assign({}, this.model, values)
|
||||
if (!param.processEsInspectId) {
|
||||
param.processEsInspectId = this.data.id
|
||||
if (!param.createTime) {
|
||||
param.createTime = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
console.log(param)
|
||||
const fn = param.id ? editInspectionContentTable : addInspectionContentTable
|
||||
fn(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok', param, this.index)
|
||||
this.form.resetFields()
|
||||
this.model = {}
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
this.$emit('ok', param, this.index)
|
||||
this.form.resetFields()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOk () {
|
||||
if (this.confirmLoading) return
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.confirmLoading = true
|
||||
const param = Object.assign({}, this.model, values)
|
||||
if (!this.model.processEsInspectId) {
|
||||
param.processEsInspectId = this.data.id
|
||||
if (!param.createTime) {
|
||||
param.createTime = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
console.log(param)
|
||||
const fn = param.id ? editInspectionContentTable : addInspectionContentTable
|
||||
fn(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok', param, this.index)
|
||||
this.close()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
this.$emit('ok', param, this.index)
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user