418 lines
11 KiB
Java
418 lines
11 KiB
Java
<!--功能系统维护-->
|
|
<template>
|
|
<div>
|
|
<a-drawer
|
|
:title="$t('gnxtwh')"
|
|
:maskClosable="false"
|
|
:width="1000"
|
|
placement="right"
|
|
:closable="true"
|
|
@close="handleCancel"
|
|
:visible="visible"
|
|
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
|
<div class="table-operator" style='margin-bottom: 20px;float: right'>
|
|
<div @click="addHandleClick"
|
|
class="operator-text">
|
|
<a-icon type="plus"/>
|
|
{{$t('add')}}
|
|
</div>
|
|
</div>
|
|
<a-table
|
|
style='margin-top: 45px'
|
|
class="table"
|
|
:columns="columnshistory"
|
|
:pagination="false"
|
|
:scroll="{x: '100%', y: 'calc(100vh - 330px)'}"
|
|
:data-source="dataSourcehistory"
|
|
:loading="loading"
|
|
>
|
|
<span slot="detailText" slot-scope="text,record">
|
|
<span class="text" :title="text">
|
|
{{text && text.length > 100?text.slice(0,99)+'...':text}}
|
|
</span>
|
|
</span>
|
|
<span slot="operation" slot-scope="text,record">
|
|
<a class="text-operation"
|
|
@click="editClick(record)">{{$t('edit')}}</a>
|
|
<a class="text-operation"
|
|
style='margin-left: 10px'
|
|
v-has="'regulatoryAndTechnicalAssessment:delete'"
|
|
@click="deleteData(record)">{{$t('delete')}}</a>
|
|
</span>
|
|
</a-table>
|
|
<div class="page">
|
|
<a-pagination
|
|
:show-total="total => $t('total')+` ${total} `+$t('strip')"
|
|
show-quick-jumper
|
|
show-size-changer
|
|
:page-size.sync="pageSizehistory"
|
|
:total="total"
|
|
:current="pageNohistory"
|
|
@change="onChangehistory"
|
|
@showSizeChange="SizeChangehistory"
|
|
/>
|
|
</div>
|
|
<div class="drawer-bootom-button" >
|
|
<a-button @click="handleOk" style="margin-right: 16px" type="primary">{{$t('determine')}}</a-button>
|
|
<a-button @click="handleCancel" >{{$t('cancel')}}</a-button>
|
|
</div>
|
|
</a-drawer>
|
|
<a-modal
|
|
:title="title"
|
|
:width="600"
|
|
:visible="visibleadd"
|
|
:confirm-loading="confirmLoading"
|
|
:maskClosable="false"
|
|
@ok="handleaddOk"
|
|
@cancel="handleaddCancel"
|
|
>
|
|
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm" style='margin-left: -40px'>
|
|
<a-row :gutter="24">
|
|
<a-col :span="24">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<!-- <span class="Required">*</span>-->
|
|
<span class="title-text-text" :title="$t('gnxt')">
|
|
{{$t('gnxt')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="gnxt">
|
|
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('gnxt')"
|
|
style='width: 80%;'
|
|
v-model="formInline.gnxt"></a-input>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<div v-for="(item,index) in formInline.dataList" :key="index">
|
|
<div style='margin-left: 26px'>
|
|
<a-row :gutter="24" style='height:0px'>
|
|
<a-col :span="24">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('dykzq') + (index+1)">{{$t('dykzq') + (index+1)}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel"
|
|
:prop="'dataList.'+index+'.dykzq'"
|
|
:rules="[{ required: true, message: $t('dykzq') + $t('cannotEmpty'), trigger: 'blur'},
|
|
{max: 50,message: $t('relevantSections') + $t('cannotExceed') + 50 + $t('Characters'),trigger: 'blur'
|
|
}]">
|
|
<a-input class="box-input"
|
|
:disabled="disabled"
|
|
v-model="item.dykzq"
|
|
style='width: 87%;'
|
|
:placeholder="$t('PleaseEnter')+$t('dykzq')"/>
|
|
</a-form-model-item>
|
|
<div class="header-text">
|
|
<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" :disabled="disabled"/>
|
|
</div>
|
|
</div>
|
|
</a-col>
|
|
</a-row>
|
|
</div>
|
|
|
|
</div>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-modal>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import { getAction, postAction ,deleteAction, putAction } from '@/api/manage'
|
|
import uploadFile from '@/components/uploadFile/file'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
export default {
|
|
name:"addModel",
|
|
components:{
|
|
uploadFile
|
|
},
|
|
data() {
|
|
return {
|
|
loading: false,
|
|
dataSourcehistory:[],
|
|
title:'',
|
|
columnshistory: [
|
|
{
|
|
title: this.$t('gnxt'),
|
|
dataIndex: 'gnxt',
|
|
align: 'left',
|
|
ellipsis: true,
|
|
scopedSlots: { customRender: 'gnxt' },
|
|
width: 180
|
|
},
|
|
{
|
|
title: this.$t('dykzq'),
|
|
dataIndex: 'dykzq',
|
|
align: 'left',
|
|
ellipsis: true,
|
|
scopedSlots: { customRender: 'detailText' }
|
|
},
|
|
{
|
|
title: this.$t('operation'),
|
|
align: 'left',
|
|
fixed: 'right',
|
|
width: 100,
|
|
scopedSlots: { customRender: 'operation' }
|
|
}
|
|
],
|
|
rules: {
|
|
gnxt: [
|
|
{
|
|
required: true,
|
|
message: this.$t('gnxt') + this.$t('cannotEmpty'),
|
|
trigger: 'blur'
|
|
},
|
|
{max: 50,message: this.$t('relevantSections') + this.$t('cannotExceed') + 50 + this.$t('Characters'),trigger: 'blur'
|
|
}
|
|
],
|
|
// dykzq: [
|
|
// {
|
|
// required: true,
|
|
// message: this.$t('dykzq') + this.$t('cannotEmpty'),
|
|
// trigger: 'blur'
|
|
// }
|
|
// ],
|
|
},
|
|
pageSizehistory: 10,
|
|
total: 0,
|
|
pageNohistory: 1,
|
|
visible: false,
|
|
visibleadd: false,
|
|
disabled: false,
|
|
showButton:false,
|
|
formInline: {
|
|
dataList:[
|
|
{
|
|
dykzq:'',
|
|
}
|
|
],
|
|
gnxt:''
|
|
},
|
|
confirmLoading: false,
|
|
acceptcode:'',
|
|
projectNameList: [],
|
|
DeliverableTreeList: [],
|
|
url:{
|
|
addModel:''
|
|
},
|
|
record:{},
|
|
type:'',
|
|
id:'',
|
|
}
|
|
},
|
|
mounted() {
|
|
this.bussLogList()
|
|
},
|
|
methods: {
|
|
...mapGetters(['userInfo']),
|
|
add(){
|
|
this.visible = true
|
|
this.bussLogList()
|
|
},
|
|
addHandleClick(){
|
|
this.title = this.$t('add')
|
|
this.type = 'add'
|
|
this.visibleadd = true
|
|
this.formInline.gnxt = ''
|
|
this.id = ''
|
|
this.formInline.dataList = [{}]
|
|
this.$nextTick(() => {
|
|
this.$refs.ruleForm.clearValidate()
|
|
})
|
|
},
|
|
editClick(item){
|
|
this.title = this.$t('edit')
|
|
this.type = 'edit'
|
|
this.formInline.gnxt = item.gnxt
|
|
this.id = item.id
|
|
let List = item.dykzq.split(',')
|
|
let arr = []
|
|
List.forEach((item,index)=>{
|
|
arr.push({dykzq:List[index]})
|
|
})
|
|
this.formInline.dataList = arr
|
|
this.visibleadd = true
|
|
this.$nextTick(() => {
|
|
this.$refs.ruleForm.clearValidate()
|
|
})
|
|
},
|
|
addClick(index){
|
|
if(this.formInline.dataList.length + 1 > 10){
|
|
this.$message.warning(this.$t('nomorethan'))
|
|
return
|
|
}
|
|
this.formInline.dataList.splice(index + 1, 0, {})
|
|
this.formInline = { ...this.formInline }
|
|
},
|
|
deleteClick(index) {
|
|
this.formInline.dataList.splice(index, 1)
|
|
this.formInline = { ...this.formInline }
|
|
},
|
|
handleOk() {
|
|
this.pageNohistory = 1
|
|
this.visible = false
|
|
},
|
|
handleCancel() {
|
|
this.visible = false
|
|
},
|
|
handleaddOk() {
|
|
let dykzqList = []
|
|
this.formInline.dataList.forEach((item) => {
|
|
dykzqList.push(item.dykzq)
|
|
})
|
|
this.formInline.dykzq = dykzqList.join(',')
|
|
let url = ''
|
|
let action = ''
|
|
if(this.type == 'add'){
|
|
url = 'ota/otaBaSjGnxtwh/add'
|
|
action = postAction
|
|
}else{
|
|
url = 'ota/otaBaSjGnxtwh/edit'
|
|
action = putAction
|
|
}
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
let query = {
|
|
...this.formInline,
|
|
id:this.id
|
|
}
|
|
this.confirmLoading = true
|
|
action(url, query).then((res) => {
|
|
if (res.success) {
|
|
this.$message.success(this.$t('OperationSuccessful'))
|
|
this.visibleadd = false
|
|
this.confirmLoading = false
|
|
this.bussLogList()
|
|
} else {
|
|
this.$message.warning(this.$t('operationFailed'))
|
|
this.confirmLoading = false
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleaddCancel() {
|
|
this.visibleadd = false
|
|
this.formInline = {}
|
|
},
|
|
onChangehistory(page, pageSize) {
|
|
this.pageNohistory = page
|
|
this.bussLogList()
|
|
},
|
|
SizeChangehistory(page, pageSize) {
|
|
this.pageNohistory = 1
|
|
this.pageSizehistory = pageSize
|
|
this.bussLogList()
|
|
},
|
|
bussLogList(val) {
|
|
let query = {
|
|
pageNo: this.pageNohistory,
|
|
pageSize: this.pageSizehistory,
|
|
otaId:localStorage.getItem('otaId')
|
|
}
|
|
this.loading = true
|
|
getAction('ota/otaBaSjGnxtwh/page', query).then((res) => {
|
|
if (res.success) {
|
|
this.dataSourcehistory = res.result.records
|
|
this.total = res.result.total
|
|
this.loading = false
|
|
} else {
|
|
this.loading = false
|
|
}
|
|
})
|
|
},
|
|
// 删除
|
|
deleteData(val) {
|
|
let _this = this
|
|
this.$confirm({
|
|
content: _this.$t('ConfirmDelete'),
|
|
onOk() {
|
|
deleteAction('ota/otaBaSjGnxtwh/delete', { id: val.id }).then((res) => {
|
|
if (res.success) {
|
|
_this.$message.success(_this.$t('OperationSuccessful'))
|
|
_this.bussLogList()
|
|
} else {
|
|
_this.$message.warning(res.message)
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.box-title-text {
|
|
line-height: 1.4;
|
|
display: flex;
|
|
/*align-items: center;*/
|
|
}
|
|
|
|
.title-text {
|
|
width: 250px;
|
|
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%;
|
|
}
|
|
|
|
.itemModel {
|
|
width: calc(100% - 130px);
|
|
display: inline-block;
|
|
margin-top: 2px;
|
|
min-height: 40px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.Required {
|
|
color: red;
|
|
margin-right: 4px;
|
|
}
|
|
|
|
.header-text {
|
|
position: relative;
|
|
top: 11px;
|
|
left: -70px;
|
|
width: 55px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.icon-text {
|
|
font-size: 16px;
|
|
margin-right: 4px;
|
|
}
|
|
.page {
|
|
text-align: right;
|
|
margin-top: 20px;
|
|
}
|
|
</style> |