法规清单、认证清单、市场法规清单、市场认证清单增加责任部门

This commit is contained in:
范强强
2023-07-14 17:08:54 +08:00
parent 1f819e0e20
commit c82044af68
5 changed files with 609 additions and 340 deletions
@@ -258,13 +258,15 @@
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="firstLevelDutyTerritory">
<a-form-model-item class="itemModel-multi" prop="dutyDepart">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
optionFilterProp="label"
mode="multiple"
:disabled="disabled"
@change="DutyDepartChange"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
v-model="formInline.dutyDepart">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
@@ -285,11 +287,27 @@
: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"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
optionFilterProp="label"
mode="multiple"
:disabled="disabled"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in dutyTerritoryList"
:key="key"
:label="item.itemText"
:value="item.itemValue">
<span style="display: inline-block;width: 100%" :title=" item.itemText ">
{{ item.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"-->
<!-- :disabled="disabled"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -720,7 +738,14 @@
message: this.$t('areaOfResponsibility') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
],
dutyDepart:[
{
required: true,
message: this.$t('statisticalNodes') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
},
formInline: {},
disabled: false,
@@ -728,6 +753,7 @@
CategoryTreeList: [],
DeliverableTreeList: [],
firstLevelDutyTerritoryList:[],
dutyTerritoryList:[],
}
},
mounted() {
@@ -736,6 +762,23 @@
this.getFirstLevelDutyTerritory()
},
methods: {
DutyDepartChange(event) {
this.formInline.dutyTerritory = []
this.formInline = {...this.formInline}
this.getDutyTerritory(event.join(','))
},
getDutyTerritory(row) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.dutyTerritoryList = res.result || []
} else {
this.dutyTerritoryList = []
}
})
},
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
@@ -773,7 +816,8 @@
this.formInline.designDeliverableType = this.formInline.designDeliverableType ? this.formInline.designDeliverableType.split(',') : []
this.formInline.prehomoDeliverableType = this.formInline.prehomoDeliverableType ? this.formInline.prehomoDeliverableType.split(',') : []
this.formInline.verifyDeliverableType = this.formInline.verifyDeliverableType ? this.formInline.verifyDeliverableType.split(',') : []
this.formInline.firstLevelDutyTerritory = this.formInline.firstLevelDutyTerritory ? this.formInline.firstLevelDutyTerritory.split(',') : []
this.formInline.dutyDepart = this.formInline.dutyDepart ? this.formInline.dutyDepart.split(',') : []
this.formInline.dutyTerritory = this.formInline.dutyTerritory ? this.formInline.dutyTerritory.split(',') : []
this.$refs.ruleForm.clearValidate()
})
},
@@ -787,7 +831,8 @@
this.formInline.designDeliverableType = this.formInline.designDeliverableType ? this.formInline.designDeliverableType.split(',') : []
this.formInline.prehomoDeliverableType = this.formInline.prehomoDeliverableType ? this.formInline.prehomoDeliverableType.split(',') : []
this.formInline.verifyDeliverableType = this.formInline.verifyDeliverableType ? this.formInline.verifyDeliverableType.split(',') : []
this.formInline.firstLevelDutyTerritory = this.formInline.firstLevelDutyTerritory ? this.formInline.firstLevelDutyTerritory.split(',') : []
this.formInline.dutyDepart = this.formInline.dutyDepart ? this.formInline.dutyDepart.split(',') : []
this.formInline.dutyTerritory = this.formInline.dutyTerritory ? this.formInline.dutyTerritory.split(',') : []
this.$refs.ruleForm.clearValidate()
})
},
@@ -1039,4 +1084,7 @@
background: #fff;
border-radius: 0 0 2px 2px;
}
::v-deep .ant-form-item-with-help {
margin-bottom: 25px;
}
</style>
@@ -163,15 +163,16 @@
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi"
:prop="'dataList.'+index+'.firstLevelDutyTerritory'"
:prop="'dataList.'+index+'.dutyDepart'"
:rules="[{ required: true, message: $t('statisticalNodes') + $t('cannotEmpty'), trigger: 'change'},]"
>
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
optionFilterProp="label"
mode="multiple"
@change="DutyDepartChange(index)"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="item.firstLevelDutyTerritory">
v-model="item.dutyDepart">
<a-select-option v-for="(val, key) in firstLevelDutyTerritoryList"
:key="key"
:label="val.key"
@@ -195,12 +196,28 @@
: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')"
@changeQuery="dutyHandleChange(index)"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
optionFilterProp="label"
mode="multiple"
@change="dutyHandleChange(index)"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="item.dutyTerritory">
<a-select-option v-for="(val, key) in item.dutyTerritoryList"
:key="key"
:label="val.itemText"
:value="val.itemValue">
<span style="display: inline-block;width: 100%" :title=" val.itemText ">
{{ val.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input" v-model="item.dutyTerritory"-->
<!-- @input="handleInput('dataList.'+index+'.dutyTerritory')"-->
<!-- @changeQuery="dutyHandleChange(index)"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -413,13 +430,14 @@
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="firstLevelDutyTerritory">
<a-form-model-item class="itemModel-multi" prop="dutyDepart">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
optionFilterProp="label"
@change="DutyDepartChangeOne"
mode="multiple"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
v-model="formInline.dutyDepart">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
@@ -439,15 +457,31 @@
<span class="title-text-text"
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel"
<a-form-model-item class="itemModel-multi"
:prop="'dutyTerritory'"
>
<j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"
@input="handleInput('dutyTerritory')"
@changeQuery="handleChange"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
optionFilterProp="label"
mode="multiple"
@change="handleChange"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in dutyTerritoryList"
:key="key"
:label="item.itemText"
:value="item.itemValue">
<span style="display: inline-block;width: 100%" :title=" item.itemText ">
{{ item.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"-->
<!-- @input="handleInput('dutyTerritory')"-->
<!-- @changeQuery="handleChange"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -662,6 +696,7 @@
personnelVisible: false,
yearNameDataList: [],
firstLevelDutyTerritoryList: [],
dutyTerritoryList: [],
rules: {
serialNumber: [
{
@@ -709,7 +744,7 @@
trigger: 'change'
}
],
firstLevelDutyTerritory: [
dutyDepart: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('cannotEmpty'),
@@ -787,7 +822,23 @@
}
})
},
DutyDepartChangeOne(event) {
this.formInline.dutyTerritory = []
this.formInline = {...this.formInline}
this.getDutyTerritoryOne(event.join(','))
},
getDutyTerritoryOne(row) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.dutyTerritoryList = res.result || []
} else {
this.dutyTerritoryList = []
}
})
},
addModel() {
this.visible = true
this.personnelVisible = true
@@ -804,14 +855,18 @@
this.formInline = {}
this.visible = true
this.personnelVisible = true
value.firstLevelDutyTerritory = value.firstLevelDutyTerritory ? value.firstLevelDutyTerritory.split(',') : []
value.dutyDepart = value.dutyDepart ? value.dutyDepart.split(',') : []
value.dutyTerritory = value.dutyTerritory ? value.dutyTerritory.split(',') : []
this.formInline = JSON.parse(JSON.stringify(value))
// if (this.formInline.deliverableType) {
// this.formInline.deliverableType = this.formInline.deliverableType.split(',')
// }
if (value.dutyTerritory) {
this.queryPersonByProject(value.dutyTerritory)
if (value.dutyDepart && value.dutyDepart.length > 0) {
this.getDutyTerritoryOne(value.dutyDepart.join(','))
}
if (value.dutyTerritory && value.dutyTerritory.length > 0) {
this.queryPersonByProject(value.dutyTerritory.join(','))
}
this.getRegulationNo()
this.title = this.$t('edit')
@@ -844,6 +899,7 @@
Action = postAction
query.dataList.forEach(val => {
delete val.engineeringInterfacePersonList
delete val.dutyTerritoryList
Object.keys(val).forEach(res => {
if (val[res] && val[res] instanceof Array) {
val[res] = val[res].join(',')
@@ -883,6 +939,24 @@
}
})
},
DutyDepartChange(index) {
this.formInline.dataList[index].dutyTerritory = []
this.formInline = { ...this.formInline }
this.getDutyTerritory(this.formInline.dataList[index].dutyDepart.join(','),index)
},
getDutyTerritory(row,index) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.formInline.dataList[index].dutyTerritoryList = res.result || []
} else {
this.formInline.dataList[index].dutyTerritoryList = []
}
this.formInline = {...this.formInline}
})
},
handleInput(value, id, index, array) {
if (array) {
let content = array.filter(res => {
@@ -974,12 +1048,13 @@
},
handleChange(value) {
this.formInline.sdt = undefined
this.queryPersonByProject(this.formInline.dutyTerritory)
this.queryPersonByProject(this.formInline.dutyTerritory.join(','))
},
dutyHandleChange(index) {
this.formInline.dataList[index].sdt = undefined
this.formInline = { ...this.formInline }
this.queryPersonByProject(this.formInline.dataList[index].dutyTerritory, index)
this.handleInput('dataList.' + index + '.dutyTerritory')
this.queryPersonByProject(this.formInline.dataList[index].dutyTerritory.join(','), index)
},
queryPersonByProject(row, index) {
let query = {
@@ -103,13 +103,15 @@
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="firstLevelDutyTerritory">
<a-form-model-item class="itemModel-multi" prop="dutyDepart">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
optionFilterProp="label"
@change="DutyDepartChange"
mode="multiple"
:disabled="formInline.roleCodeIndex == 0 ? false : true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
v-model="formInline.dutyDepart">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
@@ -130,12 +132,29 @@
: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"
@change="dutyTerritoryChange"
:disabled="formInline.roleCodeIndex == 0 ? false : true"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
optionFilterProp="label"
mode="multiple"
@change="dutyTerritoryChange"
:disabled="formInline.roleCodeIndex == 0 ? false : true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in dutyTerritoryList"
:key="key"
:label="item.itemText"
:value="item.itemValue">
<span style="display: inline-block;width: 100%" :title=" item.itemText ">
{{ item.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"-->
<!-- @change="dutyTerritoryChange"-->
<!-- :disabled="formInline.roleCodeIndex == 0 ? false : true"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -606,7 +625,7 @@
trigger: 'change'
}
],
firstLevelDutyTerritory:[
dutyDepart: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('cannotEmpty'),
@@ -696,7 +715,7 @@
message: this.$t('typeOfDeliverables') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
]
},
formInline: {
verifyDeliverableType: [],
@@ -719,6 +738,7 @@
DeliverableTreeList: [],
userInfoQuery: {},
rejectCauseList: [],
dutyTerritoryList: []
}
},
mounted() {
@@ -785,6 +805,23 @@
}
})
},
DutyDepartChange(event) {
this.formInline.dutyTerritory = []
this.formInline = { ...this.formInline }
this.getDutyTerritory(event.join(','))
},
getDutyTerritory(row) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.dutyTerritoryList = res.result || []
} else {
this.dutyTerritoryList = []
}
})
},
dutyTerritoryChange(event) {
this.formInline.regulationOwnerId = undefined
this.formInline.engineeringInterfacePerson = undefined
@@ -792,20 +829,26 @@
this.formInline.designInitiatorId = undefined
this.formInline.prehomoInitiatorId = undefined
this.formInline.verifyInitiatorId = undefined
this.queryPersonByProject(event)
this.queryPersonByProject(event.join(','))
},
queryPersonByProject(row) {
let dutyTerritory = ''
if (row.dutyTerritory) {
dutyTerritory = row.dutyTerritory.join(',')
} else {
dutyTerritory = row
}
let query = {
projectId: this.$route.query.id,
dutyTerritory: row.dutyTerritory || row
dutyTerritory: dutyTerritory
}
getAction(this.url.queryPersonByProject, query).then((res) => {
if (res.success) {
this.regulatoryEngineerList = res.result.lawEngineerList //法规工程师
this.engineeringInterfacePersonList = res.result.engineeringInterfacePersonList //工程接口人
this.certificationEngineerList = res.result.certificationEngineerList //认证工程师
if (row.dutyTerritory) {
if (row.dutyTerritory && row.dutyTerritory.length > 0) {
let _this = this
this.getProject(row, res, function() {
_this.getData(row, res)
@@ -865,9 +908,14 @@
item.designDeliverableType = item.designDeliverableType ? item.designDeliverableType.split(',') : []
item.prehomoDeliverableType = item.prehomoDeliverableType ? item.prehomoDeliverableType.split(',') : []
item.verifyDeliverableType = item.verifyDeliverableType ? item.verifyDeliverableType.split(',') : []
item.firstLevelDutyTerritory = item.firstLevelDutyTerritory ? item.firstLevelDutyTerritory.split(',') : []
item.dutyDepart = item.dutyDepart ? item.dutyDepart.split(',') : []
item.dutyTerritory = item.dutyTerritory ? item.dutyTerritory.split(',') : []
this.getRejectCause(item.id)
if (item.dutyTerritory) {
if (item.dutyDepart && item.dutyDepart.length > 0) {
this.getDutyTerritory(item.dutyDepart.join(','))
}
console.log(item.dutyTerritory)
if (item.dutyTerritory && item.dutyTerritory.length > 0) {
this.queryPersonByProject(item)
} else {
this.formInline = item
@@ -1145,4 +1193,8 @@
background: #fff;
border-radius: 0 0 2px 2px;
}
::v-deep .ant-form-item-with-help {
margin-bottom: 25px;
}
</style>
@@ -49,13 +49,15 @@
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="firstLevelDutyTerritory">
<a-form-model-item class="itemModel-multi" prop="dutyDepart">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
:disabled="disabled"
@change="DutyDepartChange"
optionFilterProp="label"
mode="multiple"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
v-model="formInline.dutyDepart">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
@@ -76,13 +78,28 @@
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dutyTerritory">
<j-dict-select-tag class="box-input"
:disabled="disabled"
@input="handleInput('dutyTerritory')"
v-model="formInline.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
optionFilterProp="label"
mode="multiple"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in dutyTerritoryList"
:key="key"
:label="item.itemText"
:value="item.itemValue">
<span style="display: inline-block;width: 100%" :title=" item.itemText ">
{{ item.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input"-->
<!-- :disabled="disabled"-->
<!-- @input="handleInput('dutyTerritory')"-->
<!-- v-model="formInline.dutyTerritory"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -242,6 +259,7 @@
disabled: false,
formInline: {},
confirmLoading: false,
dutyTerritoryList: [],
projectNameList: [],
DeliverableTreeList: [],
firstLevelDutyTerritoryList: [],
@@ -260,7 +278,7 @@
trigger: 'change'
}
],
firstLevelDutyTerritory: [
dutyDepart: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('areaOfResponsibility'),
@@ -289,6 +307,23 @@
},
methods: {
...mapGetters(['userInfo']),
DutyDepartChange(event) {
this.formInline.dutyTerritory = []
this.formInline = { ...this.formInline }
this.getDutyTerritory(event.join(','))
},
getDutyTerritory(row) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.dutyTerritoryList = res.result || []
} else {
this.dutyTerritoryList = []
}
})
},
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
@@ -322,12 +357,13 @@
if (valid) {
this.formInline.authDummyInventoryBaseId = this.$route.query.id
let query = JSON.parse(JSON.stringify(this.formInline))
query.dataList.forEach(val => {
Object.keys(val).forEach(res => {
if (val[res] && val[res] instanceof Array) {
val[res] = val[res].join(',')
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
if (res == 'dataList') {
} else {
query[res] = query[res].join(',')
}
})
}
})
this.confirmLoading = true
postAction(this.url.addModel, query).then((res) => {
@@ -509,4 +545,7 @@
::v-deep .attestationType .ant-form-explain {
margin-top: -16px;
}
::v-deep .ant-form-item-with-help {
margin-bottom: 25px;
}
</style>
@@ -49,17 +49,19 @@
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="Required" v-if="!disabled">*</span>
<span class="title-text-text"
:title="$t('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="firstLevelDutyTerritory">
<a-form-model-item class="itemModel-multi" prop="dutyDepart">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
class="box-input"
optionFilterProp="label"
mode="multiple"
:disabled="disabled"
@change="DutyDepartChange"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.firstLevelDutyTerritory">
v-model="formInline.dutyDepart">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
@@ -76,15 +78,32 @@
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="!disabled">*</span>
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
<span class="title-text-text"
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dutyTerritory">
<j-dict-select-tag class="box-input"
v-model="formInline.dutyTerritory"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
<a-select :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
class="box-input"
:disabled="disabled"
allowClear
optionFilterProp="label"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in dutyTerritoryList"
:key="key"
:label="item.itemText"
:value="item.itemValue">
<span style="display: inline-block;width: 100%" :title=" item.itemText ">
{{ item.itemText }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input"-->
<!-- v-model="formInline.dutyTerritory"-->
<!-- :disabled="disabled"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
</a-form-model-item>
</div>
</a-col>
@@ -103,7 +122,8 @@
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('certificationType')"
:type="'select'"
:triggerChange="false" :dictCode="'ren4_zheng4_qing1_dan1_-_ren4_zheng4_lei4_xing2'"/>
:triggerChange="false"
:dictCode="'ren4_zheng4_qing1_dan1_-_ren4_zheng4_lei4_xing2'"/>
</a-form-model-item>
</div>
</a-col>
@@ -118,7 +138,7 @@
v-model="formInline.category"
:disabled="disabled"
:title="formInline.category"
:placeholder="$t('PleaseEnter')+$t('category')" />
:placeholder="$t('PleaseEnter')+$t('category')"/>
</a-form-model-item>
</div>
</a-col>
@@ -209,297 +229,332 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
<codeNumber ref="codeNumber" @regulation="regulation" />
<codeNumber ref="codeNumber" @regulation="regulation"/>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess" :disabled="disabled"/>
</div>
</template>
<script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import codeNumber from './codeNumber'
import uploadFile from '@/components/uploadFile/file'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import codeNumber from './codeNumber'
import uploadFile from '@/components/uploadFile/file'
export default {
name:'editModel',
props: ['url'],
components:{
codeNumber,
uploadFile
},
data() {
return {
title: '',
visible: false,
button: true,
confirmLoading: false,
formInline: {},
disabled: false,
DeliverableTreeList: [],
firstLevelDutyTerritoryList:[],
rules: {
serialNumber: [
{
required: true,
message: this.$t('regulationNo') + this.$t('cannotEmpty'),
trigger: 'change'
export default {
name: 'editModel',
props: ['url'],
components: {
codeNumber,
uploadFile
},
data() {
return {
title: '',
visible: false,
button: true,
confirmLoading: false,
formInline: {},
disabled: false,
DeliverableTreeList: [],
dutyTerritoryList: [],
firstLevelDutyTerritoryList: [],
rules: {
serialNumber: [
{
required: true,
message: this.$t('regulationNo') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
dutyDepart: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('areaOfResponsibility'),
trigger: 'change'
}
],
dutyTerritory: [
{
required: true,
message: this.$t('areaOfResponsibility') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
wvtaId: [
{
required: true,
message: 'WVTA ID' + this.$t('cannotEmpty'),
trigger: 'change'
}
],
attestationType: [
{
required: true,
message: this.$t('certificationType') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
category: [
{
required: true,
message: this.$t('category') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
inspectionItem: [
{
required: true,
message: this.$t('inspectionItems') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
configItem: [
{
required: true,
message: this.$t('configurationItem') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 300,
message: this.$t('configurationItem') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
deliverable: [
{
required: true,
message: this.$t('Deliverables') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
}
}
},
mounted() {
this.getDeliverableTree()
this.getFirstLevelDutyTerritory()
},
methods: {
DutyDepartChange(event) {
this.formInline.dutyTerritory = []
this.formInline = { ...this.formInline }
this.getDutyTerritory(event.join(','))
},
getDutyTerritory(row) {
let query = {
dutyDepart: row
}
getAction('/sys/dict/getDutyTeryByDD', query).then((res) => {
if (res.success) {
this.dutyTerritoryList = res.result || []
} else {
this.dutyTerritoryList = []
}
],
firstLevelDutyTerritory: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('areaOfResponsibility'),
trigger: 'change'
})
},
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
this.firstLevelDutyTerritoryList = res.result
} else {
this.firstLevelDutyTerritoryList = []
}
],
dutyTerritory: [
{
required: true,
message: this.$t('areaOfResponsibility') + this.$t('cannotEmpty'),
trigger: 'change'
})
},
handleCancel() {
this.visible = false
},
serialNumberClick() {
this.$refs.codeNumber.add()
},
editModel(item, data) {
this.visible = true
this.title = this.$t('edit')
this.$nextTick(() => {
this.formInline = item || {}
if (this.formInline.deliverableType) {
this.formInline.deliverableType = this.formInline.deliverableType.split(',')
} else {
this.formInline.deliverableType = []
}
],
wvtaId: [
{
required: true,
message: 'WVTA ID' + this.$t('cannotEmpty'),
trigger: 'change'
if (this.formInline.dutyDepart) {
this.formInline.dutyDepart = this.formInline.dutyDepart.split(',')
} else {
this.formInline.dutyDepart = []
}
],
attestationType: [
{
required: true,
message: this.$t('certificationType') + this.$t('cannotEmpty'),
trigger: 'change'
if (this.formInline.dutyTerritory) {
this.formInline.dutyTerritory = this.formInline.dutyTerritory.split(',')
} else {
this.formInline.dutyTerritory = []
}
],
category: [
{
required: true,
message: this.$t('category') + this.$t('cannotEmpty'),
trigger: 'change'
this.$refs.ruleForm.clearValidate()
})
console.log(this.formInline)
if (data == 1) {
this.title = this.$t('view')
this.disabled = true
this.button = false
}
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
this.confirmLoading = true
postAction(this.url.editModel, formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('editModelList')
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
],
inspectionItem: [
{
required: true,
message: this.$t('inspectionItems') + this.$t('cannotEmpty'),
trigger: 'change'
})
},
getDeliverableTree() {
getAction('/sys/category/getCertificationDeliverableTree', {}).then((res) => {
if (res.success) {
this.DeliverableTreeList = res.result
} else {
this.DeliverableTreeList = []
}
],
configItem: [
{
required: true,
message: this.$t('configurationItem') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 300,
message: this.$t('configurationItem') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
})
},
regulation(item, data) {
this.formInline.serialNumber = item
this.formInline.bussDocumentLibraryId = data
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField(['serialNumber'])
})
},
//交付物模板
clickButtonToUpload(item, index, isTrue) {
this.numIndex = index
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
let ids = ''
console.log(index)
if (isTrue) {
ids = this.formInline.dataList[index][item]
} else {
ids = this.formInline[item]
}
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
],
deliverable: [
{
required: true,
message: this.$t('Deliverables') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
if (this.formInline.id) {
this.formInline[this.uploadName] = attIdList.join(',')
} else {
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
}
this.formInline = { ...this.formInline }
}
}
},
mounted() {
this.getDeliverableTree()
this.getFirstLevelDutyTerritory()
},
methods: {
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
this.firstLevelDutyTerritoryList = res.result
} else {
this.firstLevelDutyTerritoryList = []
}
})
},
handleCancel() {
this.visible = false
},
serialNumberClick(){
this.$refs.codeNumber.add()
},
editModel(item,data) {
this.visible = true
this.title = this.$t('edit')
this.$nextTick(() => {
this.formInline = item || {}
if (this.formInline.deliverableType) {
this.formInline.deliverableType = this.formInline.deliverableType.split(',')
}
if (this.formInline.firstLevelDutyTerritory) {
this.formInline.firstLevelDutyTerritory = this.formInline.firstLevelDutyTerritory.split(',')
}
this.$refs.ruleForm.clearValidate()
})
if(data == 1) {
this.title = this.$t('view')
this.disabled = true
this.button = false
}
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
this.confirmLoading = true
postAction(this.url.editModel, formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('editModelList')
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
},
getDeliverableTree() {
getAction('/sys/category/getCertificationDeliverableTree', {}).then((res) => {
if (res.success) {
this.DeliverableTreeList = res.result
} else {
this.DeliverableTreeList = []
}
})
},
regulation(item,data) {
this.formInline.serialNumber = item
this.formInline.bussDocumentLibraryId = data
this.$nextTick(()=>{
this.formInline = {... this.formInline}
this.$refs.ruleForm.validateField(['serialNumber'])
})
},
//交付物模板
clickButtonToUpload(item, index,isTrue) {
this.numIndex = index
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
let ids = ''
console.log(index)
if (isTrue){
ids = this.formInline.dataList[index][item]
}else{
ids = this.formInline[item]
}
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
if (this.formInline.id) {
this.formInline[this.uploadName] = attIdList.join(',')
} else {
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
}
this.formInline = { ...this.formInline }
},
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
}
.Required {
color: red;
margin-right: 4px;
}
.Required {
color: red;
margin-right: 4px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
::v-deep .ant-input-disabled{
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
::v-deep .ant-input-disabled {
color: #040B29;
}
::v-deep .ant-select-disabled .ant-select-selection-selected-value{
color: #040B29!important;
::v-deep .ant-select-disabled .ant-select-selection-selected-value {
color: #040B29 !important;
}
::v-deep .attestationType .ant-form-explain {
margin-top: -16px;
}
::v-deep .ant-form-item-with-help {
margin-bottom: 25px;
}
::v-deep .attestationType .ant-form-explain{
margin-top: -16px;
}
</style>