文档工具-虚拟认证清单维护-添加

This commit is contained in:
刘彦泽
2023-03-13 11:59:24 +08:00
parent c7ad0fa512
commit 624dd21fc5
2 changed files with 151 additions and 61 deletions
@@ -15,14 +15,22 @@
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('regulationNo')">{{$t('regulationNo')}}</span>
<span class="title-text-text" :title="$t ('regulationNo')">{{$t('regulationNo')}}</span>
</div>
<a-form-model-item class="itemModel" prop="regulationNo">
<j-dict-select-tag class="box-input"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('regulationNo')"
:type="'select'"
:triggerChange="false"/>
<a-form-model-item class="itemModel" prop="serialNumber">
<a-select showSearch
allowClear
:placeholder="$t('PleaseSelect')+$t('regulationNo')"
@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.serialNumber ">
{{ item.serialNumber}}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
@@ -32,12 +40,13 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-form-model-item class="itemModel" prop="dutyTerritory">
<j-dict-select-tag class="box-input"
:disabled="disabled"
v-model="formInline.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false"/>
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
@@ -49,9 +58,9 @@
<span class="Required">*</span>
<span class="title-text-text" :title="'WVTA ID'">WVTA ID</span>
</div>
<a-form-model-item class="itemModel">
<a-form-model-item class="itemModel" prop="wvtaId">
<a-input class="box-input"
v-model='formInline.dddd'
v-model='formInline.wvtaId'
:disabled="disabled"
:placeholder="$t('PleaseEnter')+'WVTA ID'"/>
</a-form-model-item>
@@ -59,15 +68,12 @@
</a-col>
</a-row>
<div v-for="(item,index) in formInline.dataList" :key="index">
<div class="header-text">
<span>{{$t('itemInformation')}}</span>
<div class="box-title-text" style="margin-left: 10px">
<a-button @click='addClick(index)' style="margin-right: .8rem" icon="plus">
</a-button>
<a-button v-if="formInline.dataList.length > 1" @click="deleteClick(index)" type="primary" icon="minus">
</a-button>
<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>
</div>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
@@ -75,13 +81,14 @@
<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="'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"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('category')"
:type="'select'"
:triggerChange="false"/>
v-model="item.category"
:placeholder="$t('PleaseEnter')+$t('category')"/>
</a-form-model-item>
</div>
</a-col>
@@ -91,13 +98,10 @@
<span class="Required">*</span>
<span class="title-text-text" :title="$t('inspectionItems')">{{$t('inspectionItems')}}</span>
</div>
<a-form-model-item class="itemModel" prop="inspectionItems">
<j-dict-select-tag class="box-input"
v-model="item.inspectionItems"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('inspectionItems')"
:type="'select'"
:triggerChange="false"/>
<a-form-model-item class="itemModel" prop="inspectionItem">
<a-input class="box-input"
v-model="item.inspectionItem"
:placeholder="$t('PleaseEnter')+$t('inspectionItems')"/>
</a-form-model-item>
</div>
</a-col>
@@ -107,15 +111,40 @@
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('Deliverables')">{{$t('Deliverables')}}</span>
<span class="title-text-text" :title="$t('configurationItem')">{{$t('configurationItem')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Deliverables">
<j-dict-select-tag class="box-input"
v-model="item.Deliverables"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('Deliverables')"
:type="'select'"
:triggerChange="false"/>
<a-form-model-item class="itemModel"
:prop="'dataList.'+index+'.configItem'"
:rules="[{ required: true, message: $t('configurationItem') + $t('cannotEmpty'), trigger: 'blur'},
{max: 300,message: $t('configurationItem') + $t('cannotExceed') + 300 + $t('Characters'),trigger: 'blur'
}]">
<a-input class="box-input"
v-model="item.configItem"
:placeholder="$t('PleaseEnter')+$t('configurationItem')"/>
</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('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel"
: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>
@@ -132,6 +161,7 @@
<script>
import { getAction, postAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name:"addModel",
@@ -142,18 +172,55 @@ export default {
disabled: false,
formInline: {},
confirmLoading: false,
projectNameList: [],
DeliverableTreeList: [],
rules: {
regulationNo: [
// {
// required: true,
// message: this.$t('regulationNo') + this.$t('cannotEmpty'),
// trigger: 'change'
// }
]
serialNumber: [
{
required: true,
message: this.$t('entryName') + this.$t('regulationNo'),
trigger: 'change'
}
],
dutyTerritory: [
{
required: true,
message: this.$t('entryName') + this.$t('areaOfResponsibility'),
trigger: 'change'
}
],
wvtaId: [
{
required: true,
message: 'WVTA ID' + this.$t('regulationNo'),
trigger: 'change'
},
{
max: 300,
message: 'WVTA ID' + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
inspectionItem: [
{ required: true,
message: this.$t('inspectionItems') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 300,
message: this.$t('inspectionItems') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
},
}
},
mounted() {
this.getDeliverableTree()
this.getRegulationNo()
},
methods: {
...mapGetters(['userInfo']),
addModel() {
this.visible = true
this.formInline = {}
@@ -170,13 +237,6 @@ export default {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = JSON.parse(JSON.stringify(this.formInline))
query.dataList.forEach(val => {
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
})
this.confirmLoading = true
postAction(this.url.addModel, query).then((res) => {
if (res.success) {
@@ -199,7 +259,36 @@ export default {
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.number, 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
},
getDeliverableTree() {
getAction('/sys/category/getDeliverableTree', {}).then((res) => {
if (res.success) {
this.DeliverableTreeList = res.result
} else {
this.DeliverableTreeList = []
}
})
},
}
}
</script>
@@ -246,12 +335,7 @@ export default {
.header-text {
font-size: 16px;
font-weight: bold;
margin-left: 15px;
/*border-bottom: 1px #d9d9d9 dashed;*/
height: 30px;
margin-bottom: 30px;
display: flex;
font-weight: 500;
}
.drawer-bootom-button {
@@ -266,4 +350,9 @@ export default {
background: #fff;
border-radius: 0 0 2px 2px;
}
.icon-text {
font-size: 16px;
margin-right: 4px;
}
</style>
@@ -266,6 +266,7 @@ export default {
deleteBatch: '/authDummy/authDummyInventoryInfoEO/deleteBatch',//批量删除
editModel: '/authDummy/authDummyInventoryInfoEO/edit',//编辑
setBatch: '/authDummy/authDummyInventoryInfoEO/setBatch',//批量设置
number: '/project/projectLawsInventoryEO/list',
},
queryParam: {},
orderByField: '',