|
@@ -80,6 +80,7 @@
|
|
|
:key="tableKeyProject"
|
|
|
class="vxe-table-element"
|
|
|
:data="inputForm.cwFillingbatchProjects"
|
|
|
+ :edit-rules="validContactRules"
|
|
|
style="margin-left: 5em"
|
|
|
highlight-current-row
|
|
|
:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
|
|
@@ -106,9 +107,9 @@
|
|
|
<el-input :disabled="scope.row.level !== '1' || status === 'taskFormDetail'" placeholder="案卷号" v-model="scope.row.achiveNo" ></el-input>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column title="状态" field="projectStatus" align="center" :edit-render="{name: '$select', options: $dictUtils.getDictList('cw_project_achieves_status')}" v-if="status === 'audit' || status === 'taskFormDetail'">
|
|
|
+ <vxe-column title="状态" field="projectStatus" align="center" :edit-render="{name: '$select', options: $dictUtils.getDictList('cw_project_achieves_status')}" v-if="status === 'audit' || status === 'taskFormDetail'" show-overflow="projectStatus">
|
|
|
<template v-slot:edit="scope">
|
|
|
- <vxe-select v-model="scope.row.projectStatus" :disabled="scope.row.level !== '1' || status === 'taskFormDetail'" placeholder="状态">
|
|
|
+ <vxe-select v-model="scope.row.projectStatus" :disabled="scope.row.level !== '1' || status === 'taskFormDetail'" style="width: 100%;height: 100%" placeholder="状态" transfer>
|
|
|
<vxe-option
|
|
|
v-for="item in $dictUtils.getDictList('cw_project_achieves_status')"
|
|
|
:key="item.value"
|
|
@@ -123,7 +124,7 @@
|
|
|
<el-button v-if="scope.row.level === '1'" :disabled="status === 'audit' || status === 'taskFormDetail'" text type="primary" @click="add(scope.row)">添加</el-button>
|
|
|
<el-button v-if="scope.row.level !== '1'" :disabled="status === 'audit' || status === 'taskFormDetail'" text type="primary" @click="edit(scope.row)">修改</el-button>
|
|
|
<el-button text type="primary" v-if="scope.row.level === '1'" :disabled ="scope.row.level === '1' && commonJS.isNotEmpty(scope.row.children)" @click="removeEvent(scope.row,scope.$rowIndex)">删除</el-button>
|
|
|
- <el-button text type="primary" v-if="scope.row.level !== '1'" :disabled="status === 'audit' || status === 'taskFormDetail'" @click="removeEvent(scope.row,scope.$rowIndex)">删除</el-button>
|
|
|
+ <el-button text type="primary" v-if="scope.row.level !== '1'" :disabled="status === 'audit' || status === 'taskFormDetail'" @click="removeChildEvent(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -175,8 +176,12 @@
|
|
|
programRow: '',
|
|
|
err: '',
|
|
|
keyWatch: '',
|
|
|
- tableKeyProject:''
|
|
|
-
|
|
|
+ tableKeyProject:'',
|
|
|
+ validContactRules: {
|
|
|
+ projectStatus: [
|
|
|
+ {required: true, message: '状态不可以为空'}
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -283,16 +288,21 @@
|
|
|
} else {
|
|
|
for (let i = 0; i < this.inputForm.cwFillingbatchProjects.length; i++) {
|
|
|
if (this.inputForm.cwFillingbatchProjects[i].level === '1'){
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.cwFillingbatchProjects[i].achiveNo)){
|
|
|
- this.loading = false
|
|
|
- this.$message.error('第'+(i+1)+'行的案卷号未填写')
|
|
|
- throw new Error('第'+(i+1)+'行的案卷号未填写')
|
|
|
- }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.cwFillingbatchProjects[i].projectStatus)){
|
|
|
this.loading = false
|
|
|
this.$message.error('第'+(i+1)+'行的项目状态未选择')
|
|
|
throw new Error('第'+(i+1)+'行的项目状态未选择')
|
|
|
+ }else {
|
|
|
+ if (this.inputForm.cwFillingbatchProjects[i].projectStatus === '5'){
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwFillingbatchProjects[i].achiveNo)){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('第'+(i+1)+'行的案卷号未填写')
|
|
|
+ throw new Error('第'+(i+1)+'行的案卷号未填写')
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -503,6 +513,26 @@
|
|
|
this.$refs.batchTable.remove(row)
|
|
|
this.inputForm.cwFillingbatchProjects.splice(rowIndex, 1)
|
|
|
},
|
|
|
+ removeChildEvent(row){
|
|
|
+ this.inputForm.cwFillingbatchProjects= this.remoteChild(this.inputForm.cwFillingbatchProjects,row.id)
|
|
|
+ console.log('this.inputForm.cwFillingbatchProjects',this.inputForm.cwFillingbatchProjects)
|
|
|
+ },
|
|
|
+ remoteChild(list,id){
|
|
|
+ list=list.filter(item=>{
|
|
|
+ let flag = item.id!=id //过滤非匹配id
|
|
|
+
|
|
|
+ if(flag){
|
|
|
+ if(item.children.length>0){
|
|
|
+ item.children = this.remoteChild(item.children,id)
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return flag
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ return list
|
|
|
+ },
|
|
|
edit(row){
|
|
|
this.$refs.fileForm.init('edit',row)
|
|
|
},
|