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