对接认证清单增删改查

This commit is contained in:
范强强
2023-03-06 11:46:52 +08:00
parent e70d1f19c6
commit e0a76d942e
5 changed files with 335 additions and 109 deletions
+1
View File
@@ -1394,4 +1394,5 @@ module.exports = {
nameOfManufacturer:'Name Of Manufacturer',
regulationNo:'Regulation No',
itemInformation:'Item Information',
modifyHistory:'Modify History',
}
+1
View File
@@ -1495,4 +1495,5 @@ module.exports = {
nameOfManufacturer:'生产企业名称',
regulationNo:'法规编号',
itemInformation:'条目信息',
modifyHistory:'修改历史',
}
@@ -20,12 +20,13 @@
</div>
<a-form-model-item class="itemModel" prop="serialNumber">
<a-select :placeholder="$t('PleaseSelect')+$t('regulationNo')"
v-model="formInline.serialNumber">
@change="serialNumberChange"
v-model="formInline.bussDocumentLibraryId">
<a-select-option v-for="(item, key) in projectNameList"
:key="key"
:value="item.id">
<span style="display: inline-block;width: 100%" :title=" item.projectName ">
{{ item.projectName}}
<span style="display: inline-block;width: 100%" :title=" item.serialNumber ">
{{ item.serialNumber}}
</span>
</a-select-option>
</a-select>
@@ -46,12 +47,167 @@
</div>
</a-col>
</a-row>
<div v-for="(item,index) in formInline.dataList" :key="index">
<div class="header-text">
{{$t('itemInformation')}}
<a-icon class="icon-text" @click="addClick(index)" type="plus-circle"/>
<a-icon class="icon-text" @click="deleteClick(index)" type="minus-circle"/>
<div v-if="!formInline.id">
<div v-for="(item,index) in formInline.dataList" :key="index">
<div class="header-text">
{{$t('itemInformation')}}
<a-icon class="icon-text" @click="addClick(index)" type="plus-circle"/>
<a-icon class="icon-text" v-if="formInline.dataList.length > 1" @click="deleteClick(index)"
type="minus-circle"/>
</div>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('category')">{{$t('category')}}</span>
</div>
<a-form-model-item
class="itemModel"
:prop="'dataList.'+index+'.category'"
:rules="[{ required: true, message: $t('category') + $t('cannotEmpty'), trigger: 'blur'},
{max: 300,message: $t('category') + $t('cannotExceed') + 300 + $t('Characters'),trigger: 'blur'
}]"
>
<a-input class="box-input"
v-model="item.category"
:placeholder="$t('PleaseEnter')+$t('category')"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('inspectionItems')">{{$t('inspectionItems')}}</span>
</div>
<a-form-model-item class="itemModel"
:prop="'dataList.'+index+'.inspectionItem'"
:rules="[{ required: true, message: $t('inspectionItems') + $t('cannotEmpty'), trigger: 'blur'},
{max: 300,message: $t('inspectionItems') + $t('cannotExceed') + 300 + $t('Characters'),trigger: 'blur'
}]">
<a-input class="box-input"
v-model="item.inspectionItem"
:placeholder="$t('PleaseEnter')+$t('inspectionItems')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel-multi"
style="display: inline-block"
:prop="'dataList.'+index+'.deliverableType'"
:rules="[{ required: true, message: $t('typeOfDeliverables') + $t('cannotEmpty'), trigger: 'change'},]"
>
<a-tree-select
tree-node-filter-prop="title"
v-model="item.deliverableType"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="DeliverableTreeList"
tree-checkable
:placeholder="$t('PleaseSelect')+$t('typeOfDeliverables')"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('deliverableTemplate')">{{$t('deliverableTemplate')}}</span>
</div>
<a-form-model-item class="itemModel" prop="deliverableTemplate">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('deliverableTemplate',index)">
{{ (item.deliverableTemplate === 'null' || item.deliverableTemplate === ''
||
item.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel"
:prop="'dataList.'+index+'.dutyTerritory'"
:rules="[{ required: true, message: $t('areaOfResponsibility') + $t('cannotEmpty'), trigger: 'change'},]"
>
<j-dict-select-tag class="box-input" v-model="item.dutyTerritory"
@input="handleInput('dataList.'+index+'.dutyTerritory')"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
</div>
<a-form-model-item class="itemModel-multi"
:prop="'dataList.'+index+'.sdtName'"
:rules="[{ required: true, message: $t('engineeringInterfacePerson') + $t('cannotEmpty'), trigger: 'change'},]"
>
<PersonnelSelection
:query="{db_field_name:'sdt',db_field_txt:$t('engineeringInterfacePerson'),subscript:index}"
:personneQuery="item"
:isSingleChoice="true"
@change="PersonnelSelectionChange"
:disabled="disabled"
v-model="item.sdtName"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel-multi"
:prop="'dataList.'+index+'.dutyPersonName'"
:rules="[{ required: true, message: $t('personLiable') + $t('cannotEmpty'), trigger: 'change'},]"
>
<PersonnelSelection
:query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable'),subscript:index}"
:personneQuery="item"
:isSingleChoice="true"
@change="PersonnelSelectionChange"
:disabled="disabled"
v-model="item.dutyPersonName"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</div>
</div>
<div v-else>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
@@ -59,7 +215,10 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('category')">{{$t('category')}}</span>
</div>
<a-form-model-item class="itemModel" prop="category">
<a-form-model-item
class="itemModel"
prop="category"
>
<a-input class="box-input"
v-model="formInline.category"
:placeholder="$t('PleaseEnter')+$t('category')"/>
@@ -72,7 +231,8 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('inspectionItems')">{{$t('inspectionItems')}}</span>
</div>
<a-form-model-item class="itemModel" prop="inspectionItem">
<a-form-model-item class="itemModel"
:prop="'inspectionItem'">
<a-input class="box-input"
v-model="formInline.inspectionItem"
:placeholder="$t('PleaseEnter')+$t('inspectionItems')"/>
@@ -88,7 +248,10 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel" prop="deliverableType">
<a-form-model-item class="itemModel-multi"
style="display: inline-block"
:prop="'deliverableType'"
>
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline.deliverableType"
@@ -130,11 +293,14 @@
<span class="title-text-text"
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="dutyTerritory">
<j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-form-model-item class="itemModel"
:prop="'dutyTerritory'"
>
<j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"
@input="handleInput('dutyTerritory')"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
@@ -144,10 +310,13 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
</div>
<a-form-model-item class="itemModel-multi" :prop="'sdtName'">
<a-form-model-item class="itemModel-multi"
:prop="'sdtName'"
>
<PersonnelSelection
:query="{db_field_name:'sdt',db_field_txt:$t('engineeringInterfacePerson')}"
:personneQuery="formInline"
:isSingleChoice="true"
@change="PersonnelSelectionChange"
:disabled="disabled"
v-model="formInline.sdtName"/>
@@ -163,10 +332,13 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel-multi" :prop="'dutyPersonName'">
<a-form-model-item class="itemModel-multi"
:prop="'dutyPersonName'"
>
<PersonnelSelection
:query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable')}"
:personneQuery="formInline"
:isSingleChoice="true"
@change="PersonnelSelectionChange"
:disabled="disabled"
v-model="formInline.dutyPersonName"/>
@@ -175,7 +347,6 @@
</a-col>
</a-row>
</div>
<!-- <a-row :gutter="24">-->
<!-- <a-col :span="24">-->
<!-- <div class="box-title-text">-->
@@ -213,7 +384,6 @@
PersonnelSelection,
uploadFile
},
props: ['url'],
data() {
return {
formInline: {},
@@ -242,11 +412,7 @@
}
],
category: [
{
required: true,
message: this.$t('category') + this.$t('regulationNo'),
trigger: 'change'
},
{ required: true, message: this.$t('category') + this.$t('cannotEmpty'), trigger: 'blur' },
{
max: 300,
message: this.$t('category') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
@@ -254,11 +420,7 @@
}
],
inspectionItem: [
{
required: true,
message: this.$t('inspectionItems') + this.$t('regulationNo'),
trigger: 'change'
},
{ required: true, message: this.$t('inspectionItems') + this.$t('cannotEmpty'), trigger: 'blur' },
{
max: 300,
message: this.$t('inspectionItems') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
@@ -266,11 +428,7 @@
}
],
deliverableType: [
{
required: true,
message: this.$t('typeOfDeliverables') + this.$t('cannotEmpty'),
trigger: 'change'
}
{ required: true, message: this.$t('typeOfDeliverables') + this.$t('cannotEmpty'), trigger: 'change' }
],
dutyTerritory: [
{
@@ -299,10 +457,17 @@
title: '',
DeliverableTreeList: [],
uploadName: '',
numIndex: 0,
url: {
add: '/project/projectCertificationInventoryEO/batchAdd',
edit: '/project/projectCertificationInventoryEO/edit',
list: '/project/projectLawsInventoryEO/list'
}
}
},
mounted() {
this.getDeliverableTree()
this.getRegulationNo()
},
methods: {
...mapGetters(['userInfo']),
@@ -315,18 +480,23 @@
}
})
},
addModel() {
this.visible = true
this.title = this.$t('add')
this.formInline = {}
this.getRegulationNo()
this.formInline.dataList = [{}]
this.formInline = {...this.formInline}
this.formInline = { ...this.formInline }
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
editModel(value) {
this.formInline = {}
this.visible = true
this.formInline = value
this.getRegulationNo()
this.title = this.$t('edit')
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
@@ -340,26 +510,35 @@
if (valid) {
let url = ''
let Action
let query = JSON.parse(JSON.stringify(this.formInline))
if (this.formInline.id) {
url = this.url.edit
Action = putAction
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
query.projectLibraryId = this.$route.query.id
} else {
url = this.url.add
Action = postAction
query.dataList.forEach(val => {
Object.keys(val).forEach(res => {
if (val[res] && val[res] instanceof Array) {
val[res] = val[res].join(',')
}
})
})
query.projectLibraryId = this.$route.query.id
}
let query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
this.confirmLoading = true
Action(url, query).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('addModelList')
this.$emit('addModelForm')
} else {
this.$message.warning(res.message)
this.confirmLoading = false
@@ -374,11 +553,16 @@
this.$refs.ruleForm.validateField([value])
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
PersonnelSelectionChange(value, id, index) {
if (this.formInline.id) {
this.formInline[value] = id
} else {
this.formInline.dataList[index][value] = id
}
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) {
clickButtonToUpload(item, index) {
this.numIndex = index
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
@@ -399,13 +583,41 @@
})
}
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
if (this.formInline.id) {
this.formInline[this.uploadName] = attIdList.join(',')
} else {
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
}
this.formInline = { ...this.formInline }
},
addClick(index){
this.formInline.dataList.splice(1,index,{})
this.formInline = {...this.formInline}
addClick(index) {
this.formInline.dataList.splice(index + 1, 0, {})
this.formInline = { ...this.formInline }
},
deleteClick(index) {
this.formInline.dataList.splice(index, 1)
this.formInline = { ...this.formInline }
},
getRegulationNo() {
let query = {
projectLibraryId: this.$route.query.id,
roleCode: 0
}
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.projectNameList = res.result || []
} else {
this.projectNameList = []
}
})
},
serialNumberChange(value) {
let content = this.projectNameList.filter(res => {
return res.id === value
})
this.formInline.bussDocumentLibraryId = content[0].id
this.formInline.serialNumber = content[0].serialNumber
}
}
}
</script>
@@ -539,6 +751,10 @@
font-size: 16px;
margin-right: 4px;
}
::v-deep .ant-form-item-with-help {
margin-bottom: 25px;
}
</style>
<style>
.ant-input-disabled {
@@ -37,11 +37,12 @@
<div class="title-text">
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"
@input="handleInput('dutyTerritory')"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
@@ -57,7 +58,7 @@
class="box-input"
allowClear
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.configurationItem">
v-model="formInline.sdt">
<a-select-option v-for="(item, key) in engineeringInterfacePersonList"
:key="item.key"
:value="item.value">
@@ -75,12 +76,12 @@
<span class="title-text-text" :title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel-multi">
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('personLiable')}"
<PersonnelSelection :query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.studioEngineerName"/>
v-model="formInline.dutyPersonName"/>
</a-form-model-item>
</div>
</a-col>
@@ -147,11 +148,11 @@
})
},
handleOk() {
if (this.formInline.dutyTerritory) {
this.handleOkTwo()
} else {
// if (this.formInline.dutyTerritory) {
// this.handleOkTwo()
// } else {
this.handleOkOne()
}
// }
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
@@ -142,41 +142,17 @@
:columns="columns"
>
<span slot="operation" slot-scope="text,record">
<a class="text-operation"
v-if="(record.inventoryAffirmStatus == 'List to confirm' &&
((record.roleCode == 1 && !record.regulationOwnerSubmitStatus) ||
(record.roleCode == 2 && !record.homologationEngineerSubmitStatus) ||
(record.roleCode == 4 && !record.regulationOwnerSubmitStatus && !record.homologationEngineerSubmitStatus)))
|| (record.roleCode == 0 && record.taskAffirmStatus != 'List to confirm')"
@click="edit(record)">
<a class="text-operation" @click="edit(record)">
{{ $t('edit') }}
</a>
<a class="text-operation"
v-else
@click="viewClick(record)">
{{ $t('view') }}
@click="modifyHistoryClick(record)">
{{ $t('modifyHistory') }}
</a>
<a class="text-operation"
v-if="(record.inventoryAffirmStatus == 'Not started' || record.inventoryAffirmStatus == 'Rejected') && record.roleCode == 0"
@click="deleteLib(record)">
{{ $t('deleteLib') }}
</a>
<a class="text-operation"
@click="resultReportedClick(record)">
{{ $t('resultReported') }}
</a>
</span>
<span slot="operationOne" slot-scope="text,record">
<a class="text-operation"
@click="viewClick(record)">
{{ $t('view') }}
</a>
</span>
<span slot="titleName" slot-scope="text,record" :title="text">
<span class="textName">
{{ text }}
</span>
</span>
</a-table>
</div>
@@ -216,8 +192,9 @@
list: '/project/projectCertificationInventoryEO/page',
exportTemplate: '',
exportData: '',
deleteBatch: '',
setBatch: ''
deleteBatch: '/project/projectCertificationInventoryEO/deleteBatch',
setBatch: '/project/projectCertificationInventoryEO/setBatch',
deleteOne: '/project/projectCertificationInventoryEO/delete'
},
processStatusList: [],
dataSource: [],
@@ -348,6 +325,9 @@
isDisplayNum: 2
}
},
mounted() {
this.getList()
},
methods: {
searchQuery() {
this.selectedRowKeys = []
@@ -393,7 +373,7 @@
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSource = res.result || []
this.dataSource = res.result.records || []
this.loading = false
this.JLoading = false
} else {
@@ -406,7 +386,11 @@
this.$refs.transferListRef.transferModel()
},
BatchSettingClick() {
this.$refs.batSettingRef.edit()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0){
this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys)))
}else{
this.$message.warning(this.$t('selectLeastOne'))
}
},
certificationClick() {
this.$refs.certificationDirectoryRef.addModel()
@@ -433,26 +417,26 @@
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let _this = this
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
let isTrue = false
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
if (this.dataSource[i].inventoryAffirmStatus == 'Not started' || this.dataSource[i].inventoryAffirmStatus == 'Rejected') {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('onlyDeleted'))
return
}
}
}
}
let isTrue = true
// for (let i = 0; i < this.dataSource.length; i++) {
// for (let j = 0; j < selectedRowKeys.length; j++) {
// if (this.dataSource[i].id == selectedRowKeys[j]) {
// if (this.dataSource[i].inventoryAffirmStatus == 'Not started' || this.dataSource[i].inventoryAffirmStatus == 'Rejected') {
// isTrue = true
// } else {
// isTrue = false
// this.$message.warning(this.$t('onlyDeleted'))
// return
// }
// }
// }
// }
if (isTrue) {
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
postAction(_this.url.deleteBatch, {
deleteAction(_this.url.deleteBatch, {
ids: idList.join(','),
projectLibraryId: _this.$route.query.id
}).then((res) => {
@@ -490,9 +474,32 @@
this.getList()
},
batSettingForm() {
this.getList()
this.selectedRowKeys = []
},
addModelForm() {
this.getList()
},
edit(item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteOne, { id: val.id, projectLibraryId: _this.$route.query.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
modifyHistoryClick() {
}
}