[update] 标准符合性排查流程
This commit is contained in:
+39
-17
@@ -156,7 +156,7 @@
|
|||||||
:can-drag="true"
|
:can-drag="true"
|
||||||
:scroll="{x: '100%'}"
|
:scroll="{x: '100%'}"
|
||||||
ref="table"
|
ref="table"
|
||||||
rowKey="id"
|
rowKey="uid"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:dataSource="dataSource"
|
:dataSource="dataSource"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
|
|
||||||
<!-- 操作栏 -->
|
<!-- 操作栏 -->
|
||||||
<div slot="action" slot-scope="{record}" class="action-span-cell">
|
<div slot="action" slot-scope="{record}" class="action-span-cell">
|
||||||
<a @click="handleDelete(record.id)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
|
<a @click="handleDelete(record.uid)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</j-table>
|
</j-table>
|
||||||
@@ -206,6 +206,10 @@ import { downloadFile } from '../../../../api/manage'
|
|||||||
import MarketRegulationsListSelection from '../../../../components/selection/MarketRegulationsListSelection'
|
import MarketRegulationsListSelection from '../../../../components/selection/MarketRegulationsListSelection'
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
|
|
||||||
|
const uidGenerator = () => {
|
||||||
|
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EngineerInitBaseInfo',
|
name: 'EngineerInitBaseInfo',
|
||||||
components: {
|
components: {
|
||||||
@@ -422,28 +426,43 @@ export default {
|
|||||||
this.getCountryOption()
|
this.getCountryOption()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
// 拿到外面传进来的businessInfoDTO
|
||||||
initData (data) {
|
initData (data) {
|
||||||
// 给表单赋值
|
// 给表单赋值
|
||||||
this.formInline = Object.assign({}, data)
|
this.formInline = Object.assign({}, data.standardInfo)
|
||||||
|
// 给表格赋值
|
||||||
|
const dataSource = data.detailInfoList.map(item => {
|
||||||
|
return { ...item, uid: uidGenerator() }
|
||||||
|
})
|
||||||
|
this.dataSource = JSON.parse(JSON.stringify(dataSource))
|
||||||
|
this.dataList = JSON.parse(JSON.stringify(dataSource))
|
||||||
this.isGetDataAfter = true
|
this.isGetDataAfter = true
|
||||||
},
|
},
|
||||||
// 外层要获取数据
|
// 外层要获取数据
|
||||||
getData () {
|
getData () {
|
||||||
// 把数据抛出,在线编辑不知道要不要抛
|
// 组合businessInfoDTO,抛出
|
||||||
const data = { standardInfo: {} }
|
const data = {}
|
||||||
data.standardInfo.id = {standardInfo: {id: this.model.standardInfo.id}}
|
data.standardInfo = Object.assign({}, this.formInline)
|
||||||
|
data.detailInfoList = JSON.parse(JSON.stringify(this.dataList))
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
// 外层获取数据要过校验,返回false表示没有通过校验
|
// 外层获取数据要过校验,返回false表示没有通过校验
|
||||||
async getDataValidate () {
|
async getDataValidate () {
|
||||||
let data = { standardInfo: {} }
|
let data = {}
|
||||||
if (!this.model.standardInfo.id) {
|
await this.$refs.ruleForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (!this.dataList || this.dataList.length < 1) {
|
||||||
|
// 提示请先生成数据
|
||||||
this.$message.warning(this.$t('workCenter.regulatoryComplianceCheckProcess.pleaseGenerate'))
|
this.$message.warning(this.$t('workCenter.regulatoryComplianceCheckProcess.pleaseGenerate'))
|
||||||
data = false
|
data = false
|
||||||
} else {
|
} else {
|
||||||
data.standardInfo.id = this.model.standardInfo.id
|
data.standardInfo = Object.assign({}, this.formInline)
|
||||||
|
data.detailInfoList = JSON.parse(JSON.stringify(this.dataList))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
data = false
|
||||||
|
}
|
||||||
|
})
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
getCountryOption () {
|
getCountryOption () {
|
||||||
@@ -580,8 +599,11 @@ export default {
|
|||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
this.isGenerateAfter = true
|
this.isGenerateAfter = true
|
||||||
// 获取下方列表信息
|
// 获取下方列表信息
|
||||||
this.dataSource = JSON.parse(JSON.stringify(res.result))
|
const dataSource = res.result.map(item => {
|
||||||
this.dataList = JSON.parse(JSON.stringify(res.result))
|
return { ...item, uid: uidGenerator() }
|
||||||
|
})
|
||||||
|
this.dataSource = JSON.parse(JSON.stringify(dataSource))
|
||||||
|
this.dataList = JSON.parse(JSON.stringify(dataSource))
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
@@ -645,8 +667,8 @@ export default {
|
|||||||
title: this.$t('confirmBatchDeletion'),
|
title: this.$t('confirmBatchDeletion'),
|
||||||
content: this.$t('deleteAData'),
|
content: this.$t('deleteAData'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.dataSource = this.dataSource.filter(item => !this.selectedRowKeys.includes(item.id))
|
this.dataSource = this.dataSource.filter(item => !this.selectedRowKeys.includes(item.uid))
|
||||||
this.dataList = this.dataList.filter(item => !this.selectedRowKeys.includes(item.id))
|
this.dataList = this.dataList.filter(item => !this.selectedRowKeys.includes(item.uid))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -659,13 +681,13 @@ export default {
|
|||||||
// 分页、排序、筛选变化时触发
|
// 分页、排序、筛选变化时触发
|
||||||
this.ipagination = pagination
|
this.ipagination = pagination
|
||||||
},
|
},
|
||||||
handleDelete (id) {
|
handleDelete (uid) {
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: this.$t('confirmDeletion'),
|
title: this.$t('confirmDeletion'),
|
||||||
content: this.$t('areYouSure'),
|
content: this.$t('areYouSure'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.dataSource = this.dataSource.filter(item => item.id !== id)
|
this.dataSource = this.dataSource.filter(item => item.uid !== uid)
|
||||||
this.dataList = this.dataList.filter(item => item.id !== id)
|
this.dataList = this.dataList.filter(item => item.uid !== uid)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user