update 稽查计划&稽查流程 调整前端存储

This commit is contained in:
danshihao
2024-01-04 17:29:16 +08:00
parent 384c0d4a72
commit 9f27d3fff0
16 changed files with 354 additions and 266 deletions
@@ -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()
}
})
}