Files
laws_weilai/jero-web/src/components/TaskCutOffTime/indexonekey.vue
T
2022-08-04 16:00:08 +08:00

369 lines
9.9 KiB
Java

<template>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='formAdd'
ref='ruleForm'
:model='form'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<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('cutoffTime')">
{{$t('cutoffTime')}}</span>
</div>
<a-form-model-item class="itemModel" prop="legalTaskConfirmation">
<a-date-picker class="box-input"
style='width: 160px'
:placeholder="$t('PleaseSelect')+$t('cutoffTime')"
@change="onChange" @ok="onOk"
format="YYYY-MM-DD"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="form.legalTaskConfirmation"
:disabled="false"/>
</a-form-model-item>
</div>
<!-- <a-col :span='24'>-->
<!-- <span style='display: flex;justify-content: center;margin-bottom: 20px;'> <span style='margin-top: 6px;margin-right: 7px'>{{$t('cutoffTime')}}</span>-->
<!-- <a-date-picker :placeholder="$t('PleaseSelect')+$t('cutoffTime')" @change="onChange" @ok="onOk" />-->
<!-- </span>-->
<!-- </a-col>-->
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class='drawer-bootom-button'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
</div>
<!-- 错误数据提示-->
<a-modal
:title="$t('operationFailed')"
:width="860"
v-model="visibleoperationFailed"
:maskClosable="false"
:footer="null"
class='modelbox'
@cancel='cancleoperationFailed'
:body-style="bodystyle"
>
<a-row :gutter="24">
<a-col :span="24">
<div style='font-size: 18px;margin-bottom: 20px;display: flex;justify-content: center'
class="box-title-text-index" v-for='(item,key) in NotSelectedRowKeysValue'>
<span v-html='item'></span>
<!-- <div>{{$t('NiOnumberis')}}{{ item.nioNumber }},{{$t('Statusis')}}-->
<!-- <span style='color: red'>{{ item.state }}</span>,{{$t('NoOperationPermissionForthisbutton')}}。-->
<!-- </div>-->
</div>
</a-col>
</a-row>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn" type="primary" @click="cancleoperationFailed">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
<JLoading :loading="textLoading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading>
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import moment from 'moment'
import eventBUs from '../../common/event'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
visibleoperationFailed:false,
newVisible: false,
NotSelectedRowKeysValue:[],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
rules: {
legalTaskConfirmation:[
{ required: true, message: this.$t('PleaseSelect')+this.$t('cutoffTime'), trigger: 'change' }
]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
pickerDate: '',
bodystyle:{}
}
},
props: {
selectedRowKeysArray: {
type: String,
default: '',
require: true
}
},
mounted() {
this.loadData()
this.bodystyle = {
height: '480px',
overflow: 'hidden',
overflowY: 'scroll',
}
},
methods: {
loadData() {
this.loading = true
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.form
}
getAction(`sys/user/page`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result.records]
this.total = res.result.total
}
}).finally(() => {
this.loading = false
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisibleTaskCutOffTimeAll', false)
},
handleTableChange(val) {
},
//保存
handleSubmit() {
// let _this = this
// let param = {ids: this.selectedRowKeysArray, deadline: `${this.pickerDate}`, }
// this.confirmLoading = true
// postAction('/params/collectManifest/updateDeadlineBatch', param).then((res) => {
// if (res.success) {
// this.$emit('areaVisibleTaskCutOffTime', false)
// this.$message.success(_this.$t('OperationSuccessful'))
// this.confirmLoading = false
// } else {
// this.$message.warning(_this.$t('operationFailed'))
// this.confirmLoading = false
// }
// })
this.$refs.ruleForm.validate(valid => {
if(valid){
let long = localStorage.getItem('language')
let cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
// let _array = []
// this.selectedRowKeysValue.forEach((item, index) => {
// _array.push(item.id)
// })
let _this = this
let param = {
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
cut: this.cut,
deadline: `${this.pickerDate}`
}
this.textLoading = true
axios({
url: '/jero-boot/params/collectManifest/issueCollectionAll',
method: 'post',
data: param,
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
if (res.data.success) {
// _this.$message.success(this.$t('OperationSuccessful'))
if(res.data.result.length == 0){
this.visibleoperationFailed = false
_this.$message.success(this.$t('OperationSuccessful'))
this.$emit('areaVisibleTaskCutOffTimeAll', false)
this.$emit('GetgetTableList')
this.textLoading = false
}else{
this.NotSelectedRowKeysValue = res.data.result
this.visibleoperationFailed = true
this.textLoading = false
}
// this.$emit('areaVisibleTaskCutOffTime', false)
// this.$emit('GetgetTableList')
} else {
_this.$message.warning(this.$t('operationFailed'))
}
})
.catch((error) => {
this.textLoading = false
})
}
})
},
// 错误数据的弹框
cancleoperationFailed() {
this.visibleoperationFailed = false
this.$emit('areaVisibleTaskCutOffTimeAll', false)
this.$emit('GetgetTableList')
// this.GetgetTableList()
},
onChange(val) {
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
},
onOk(val) {
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
},
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.box-title-text-index {
line-height: 1.4;
display: flex;
}
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
<style scoped>
.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;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.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;
}
/deep/.add-input{
min-height: 135px!important;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
.page{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>