Files
laws_weilai/jero-web/src/views/projectManagement/components/cuibanModel.vue
T

189 lines
4.8 KiB
Java

<!--催办-->
<template>
<a-modal
:title="title"
:width="700"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="visible = false"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('taskType')">{{$t('taskType')}}</span>
</div>
<!-- mode="multiple"-->
<a-form-model-item class="itemModel" prop="type">
<a-select v-model="formInline.type"
class='box-input'
:placeholder="$t('PleaseSelect') + $t('taskType')"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear>
<a-select-option v-for="(item, key) in cuibanList" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</template>
<script>
import { postAction, putAction, getAction } from '@/api/manage'
export default {
name: 'TaskListModel',
data() {
return {
formInline: {},
selectionRowsArray:[],
rules: {
type: [
{
required: true,
message: this.$t('PleaseSelect') + this.$t('taskType'),
trigger: 'change'
}
]
},
title:'',
visible: false,
confirmLoading: false,
studioList: [],
cuibanList:[
{ label: this.$t('confirmationOfDesignConformity'), value: '2' },
{ label: this.$t('PrehomoConfirmation'), value: '3' },
{ label: this.$t('verificationAndConformityconfirmation'), value: '4' },
],
ids:'',
disabled: false,
url: {
edit: '/project/projectTaskInventoryEO/edit',
addOrUpdate: '/project/projectTaskInventoryConditionAssessmentEO/addOrUpdate',
list: '/project/projectTaskInventoryConditionAssessmentEO/list'
}
}
},
mounted() {
},
methods: {
getData(val) {
this.visible = true
this.title = this.$t('CuiBan')
this.selectionRowsArray = val
this.$nextTick(() => {
this.formInline = {}
this.$refs.ruleForm.clearValidate()
})
},
getList(val) {
getAction(this.url.list, { projectLawsInventoryId: val.projectLawsInventoryId }).then((res) => {
if (res.success) {
this.studioList = res.result || []
} else {
this.studioList = []
}
})
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
handleOk() {
if (this.disabled) {
this.visible = false
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
let ProjectTaskUrgVo = {}
let projectLawsInventoryId = []
this.selectionRowsArray.forEach((item) => {
if(item.projectLawsInventoryId){
projectLawsInventoryId.push(item.projectLawsInventoryId)
}
})
ProjectTaskUrgVo = {
projectLawsInventoryIds: projectLawsInventoryId.join(','),
type: this.formInline.type,
}
this.confirmLoading = true
postAction('/project/projectLawsInventoryEO/taskUrg', ProjectTaskUrgVo).then((res) => {
if (res.success) {
this.visible = false
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.$emit('cibanModel')
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
}
})
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text {
width: 134px;
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: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.title-text-text {
margin-top: 9px;
}
.headerText {
margin-left: 30px;
color: #040B29;
font-weight: 400;
}
</style>