main
严飞永 3 weeks ago
parent 4e4fa7a24b
commit 8ab9afd553

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,319 +0,0 @@
<!-- 任务审核页面 -->
<template>
<div class="audit-pages-box" id="L-size-main">
<div class="content-info" id="L-header">
<div class="info-title">任务审核</div>
<div class="top-info">
<el-row class="top-row">
<el-col :span="8">
任务编号<span>20240101001</span>
</el-col>
<el-col :span="8">
任务名称<span>XXXXX资产核查任务</span>
</el-col>
<el-col :span="8">
任务状态<span>待审核</span>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
任务期限<span>2024-11-11 09:00:00</span>
</el-col>
<el-col :span="8">
任务下发时间<span>2024-11-11 09:00:00</span>
</el-col>
</el-row>
</div>
</div>
<div class="info-cut-off-rule" id="L-tab">
<div class="left-tab" :class="index == 1 ? 'active-tab':''" @click="activeTab(1)"></div>
<div :class="index == 2 ? 'active-tab':''" @click="activeTab(2)"></div>
</div>
<div class="info-bottom-box">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline" v-if="index == 1">
<el-row>
<el-col :span="7">
<el-form-item label="核查单位:">
<el-select v-model="formInline.unit" placeholder="请选择">
<el-option label="item.label" value="item.value">
</el-option>
<!-- <el-option
v-for="dict in dict.type.bms_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="审核状态:">
<el-select v-model="formInline.status" placeholder="请选择">
<el-option label="item.label" value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item>
<el-button size="default" type="primary" @click="handleQuery()"></el-button>
<el-button size="default" @click="resetQuery()"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form :inline="true" :model="formInlineTwo" size="small" class="demo-form-inline" v-if="index == 2">
<el-row>
<el-col :span="7">
<el-form-item label="单位名称:">
<el-input v-model="formInlineTwo.unitName" placeholder="请输入"></el-input>
<!-- <el-select v-model="formInline.unit" placeholder="请选择"> -->
<!-- <el-option
v-for="dict in dict.type.bms_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option> -->
<!-- </el-select> -->
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item>
<el-button size="default" type="primary" @click="handleQuery()"></el-button>
<el-button size="default" @click="resetQuery()"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<section v-if="index == 1">
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="资产名称" key="name" prop="name" align="center" />
<el-table-column label="资产类型" key="type" prop="type" align="center">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
</template> -->
</el-table-column>
<el-table-column label="核查单位" key="unit" prop="unit" align="center" />
<el-table-column label="审核状态" key="status" width="200px" prop="status" class-name="table-status" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status === 0" style="color: #67C23A;">
审核通过
</span>
<span v-if="scope.row.status === 1" style="color: #F56C6C;">
审核不通过
</span>
<span v-if="scope.row.status === 2" style="color: #E6A23C;">
待审核
</span>
</template>
</el-table-column>
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(scope.row)">
<img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" style="color: #1485EF;">查看</span>
</div>
<div v-if="scope.row.status == 1" style="display: flex;align-items: center;cursor: pointer;margin-left: 5px;" @click="delInfo(scope.row)" >
<img src="@/assets/images/icon-shenhe@2x.png" alt="" style="width: 15px;margin-right: 5px;">
<span class="del-info" style="color: #1485EF;">审核</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
</section>
<section v-if="index == 2">
<el-table v-loading="loading" :data="tableDataTwo" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="单位名称" key="unitName" width="200px" prop="unitName" align="center" />
<el-table-column label="核查资产数量" key="hczcsl" prop="hczcsl" align="center" />
<el-table-column label="完成数量" key="wcsl" prop="wcsl" align="center">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
</template> -->
</el-table-column>
<el-table-column label="未完成数量" key="wwcsl" prop="wwcsl" align="center" />
<el-table-column label="未完成比例" key="wwcbl" width="200px" prop="wwcbl" align="center">
<template slot-scope="scope">
<span style="color: #192A92;">{{ scope.row.wwcbl }}</span>
</template>
</el-table-column>
</el-table>
</section>
<my-pagination
id="L-pagination"
:total="total"
:page="pagination.current"
:limit="pagination.size"
@pagination="getPagination"
:current-page.sync="pagination.current"
></my-pagination>
</div>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
export default {
components:{myPagination},
data() {
return {
index:1,
formInline:{
unit:"",
type:"",
status:"",
},
formInlineTwo:{
unitName:"",
},
total:0,
pagination:{
current:1,
size:10,
},
tableData:[
{
number:20230001,
name:"XXX资产",
type:"1类资产",
unit:"太仓市XXX局",
status:0,
},{
number:20230001,
name:"XXX资产",
type:"1类资产",
unit:"太仓市XXX局",
status:1,
},{
number:20230001,
name:"XXX资产",
type:"1类资产",
unit:"太仓市XXX局",
status:2,
},
],
tableDataTwo:[
{
unitName:"太仓市XXX局",
hczcsl:"100",
wcsl:"80",
wwcsl:"20",
wwcbl:"20%"
},{
unitName:"太仓市XXX局",
hczcsl:"100",
wcsl:"80",
wwcsl:"20",
wwcbl:"20%"
},{
unitName:"太仓市XXX局",
hczcsl:"100",
wcsl:"80",
wwcsl:"20",
wwcbl:"20%"
},
],
loading:false,
tabHeader: undefined,
}
},
mounted(){
this.getList();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods:{
//
resetQuery(){
this.pagination = {
current: 1,
size: 10,
}
if(this.index == 1) {
this.formInline = {
unit:"",
type:"",
status:"",
}
this.getList();
} else if(this.index == 2) {
this.formInlineTwo = {
unitName:"",
}
this.getListTwo();
}
},
//
handleQuery(){
this.pagination = {
current: 1,
size: 10,
}
if(this.index == 1) {
this.pagination = { ...this.pagination,...this.formInline };
this.getList();
} else if(this.index == 2) {
this.getListTwo();
}
},
//
getPagination(){
this.pagination.current = pages.page;
this.pagination.size = pages.limit;
if(this.index == 1) {
this.getList();
} else if(this.index == 2) {
this.getListTwo();
}
},
// tab
activeTab(id){
this.index = id
if(id == 1) {
this.formInline = {
unit:"",
type:"",
status:"",
}
this.getList();
} else {
this.formInlineTwo = {
unitName:"",
}
this.getList();
}
},
getList(){},
getListTwo(){},
goAudit(){
this.$router.push({name: 'taskAuditInfo',query: {
pageType: "info",
}})
},
// table
tableRowClassName({row, rowIndex}){
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
cancalDebounce(){
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const tab = document.getElementById('L-tab'); // ID
const pagination = document.getElementById('L-pagination'); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const tabHeight = tab.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - tabHeight - 140;
}
},
}
</script>

@ -1,386 +0,0 @@
<!-- 任务管理 -->
<template>
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline">
<el-row>
<el-col :span="8">
<el-form-item label="任务名称:">
<el-input v-model="formInline.name" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="任务编号:">
<el-input v-model="formInline.type" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="任务完成时间:">
<el-date-picker v-model="formInline.time" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="请选择">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="任务状态:">
<el-select v-model="formInline.status" placeholder="请选择">
<el-option label="item.label" value="item.value">
</el-option>
<!-- <el-option
v-for="dict in dict.type.bms_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="16" style="text-align: right;padding-right: 20px;">
<el-form-item>
<el-button size="default" @click="resetQuery('queryFrom')"></el-button>
<el-button size="default" type="primary" @click="handleQuery('queryFrom')"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<main>
<div class="search-title">
<span class="search-title-span">任务列表</span>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="default" @click="handleExport"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="default" @click="handleAdd"></el-button>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="任务编号" key="number" width="200px" prop="number" align="center" />
<el-table-column label="任务名称" key="name" prop="name" align="center" />
<el-table-column label="任务下发时间" key="type" prop="type" align="center">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
</template> -->
</el-table-column>
<el-table-column label="任务期限" key="unit" prop="unit" align="center" />
<el-table-column label="任务完成时间" key="time" prop="time" align="center" />
<el-table-column label="任务状态" key="status" width="200px" prop="status" class-name="table-status"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.status === 0" style="color: #F58A0C;">
待审核
</span>
<span v-if="scope.row.status === 1" style="color: #F50C0C;">
审核驳回
</span>
<span v-if="scope.row.status === 3" style="color: #16B771;">
正常完成
</span>
<span v-if="scope.row.status === 4" style="color: #1485EF;">
超期完成
</span>
</template>
</el-table-column>
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<div style="display: flex;align-items: center;">
<img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" @click="goInfo(scope.row)"
style="color: #1485EF;cursor: pointer;">查看</span>
</div>
<div v-if="scope.row.status == 0" style="display: flex;align-items: center;margin-left: 5px;">
<img src="@/assets/images/icon-shenhe@2x.png" alt="" style="width: 15px;margin-right: 5px;">
<span class="del-info" @click="delInfo(scope.row)"
style="color: #1485EF;cursor: pointer;">审核</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
</section>
<my-pagination id="L-pagination" :total="total" :page="pagination.current" :limit="pagination.size"
@pagination="getPagination" :current-page.sync="pagination.current"></my-pagination>
</main>
<my-dialog title="新增任务" @close="renwuclose" ref="renwuclose" class="taskDialogBox" width="30%">
<el-row>
<el-col :span="18">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="ruleForm.taskName" placeholder="请输入单位名称"></el-input>
</el-form-item>
<el-form-item label="核查单位" prop="unit" class="select-box">
<el-col :span="24">
<el-select v-model="ruleForm.unit" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-col>
<el-col class="btn-box">
<el-button type="primary" @click="addliebiao"></el-button>
</el-col>
</el-form-item>
<el-form-item label="任务期限" prop="time">
<el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.time"
style="width: 100%;"></el-date-picker>
</el-form-item>
<el-form-item class="newTask-form-item">
<el-button @click="resetForm('ruleForm')"></el-button>
<el-button type="primary" @click="submitForm('ruleForm')"></el-button>
</el-form-item>
</el-form>
</el-col>
<el-col :span="6"></el-col>
</el-row>
</my-dialog>
<my-dialog title="单位列表" @close="importClose" ref="taskDialog" class="taskDialogBox" width="80%">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline">
<el-row>
<el-col :span="7">
<el-form-item label="任务编号:">
<el-input v-model="formInline.type" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="任务名称:">
<el-input v-model="formInline.name" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="任务状态:">
<el-select v-model="formInline.status" placeholder="请选择">
<el-option label="item.label" value="item.value">
</el-option>
<!-- <el-option
v-for="dict in dict.type.bms_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;padding-right: 20px;">
<el-form-item class="unit-form">
<el-button size="default" @click="resetQuery('queryFrom')"></el-button>
<el-button size="default" type="primary" @click="handleQuery('queryFrom')"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<section>
<el-table v-loading="liebiaoloading" :data="liebiaotableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="任务编号" key="number" width="200px" prop="number" align="center" />
<el-table-column label="任务名称" key="name" prop="name" align="center" />
<el-table-column label="任务下发时间" key="type" prop="type" align="center">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.project_middle_type" :value="scope.row.projectMiddleType"/>
</template> -->
</el-table-column>
<el-table-column label="任务期限" key="unit" prop="unit" align="center" />
</el-table>
</section>
<my-pagination id="L-pagination" :total="liebiaototal" :page="liebiaopagination.current" :limit="liebiaopagination.size"
@pagination="getPagination" :current-page.sync="liebiaopagination.current"></my-pagination>
</my-dialog>
</div>
</template>
<script>
import myPagination from "@/views/components/Pagination/index.vue"
import myDialog from "@/views/components/myDialog/index.vue"
export default {
// dicts: ['jjh_project_type', 'bms_approval_status', "project_middle_type", "project_small_type", "project_categories"],
components: { myPagination, myDialog },
data() {
return {
formInline: {
name: "",
type: "",
time: [],
number: "",
status: "",
},
total: 0,
pagination: {
current: 1,
size: 10,
},
liebiaotableData:[],
liebiaopagination: {
current: 1,
size: 10,
},
liebiaototal:0,
liebiaoloading:false,
tableData: [
{
number: 20230001,
name: "XXX任务",
type: "2023-07-30 16:30:21",
unit: "2023-07-30",
time: "2023-07-30 16:30:21",
status: 0,
}, {
number: 20230001,
name: "XXX任务",
type: "2023-07-30 16:30:21",
unit: "2023-07-30",
time: "2023-07-30 16:30:21",
status: 1,
}, {
number: 20230001,
name: "XXX任务",
type: "2023-07-30 16:30:21",
unit: "2023-07-30",
time: "2023-07-30 16:30:21",
status: 3,
}, {
number: 20230001,
name: "XXX任务",
type: "2023-07-30 16:30:21",
unit: "2023-07-30",
time: "2023-07-30 16:30:21",
status: 4,
},
],
loading: false,
tabHeader: undefined,
ruleForm: {
taskName: "",
unit: "",
time: "",
},
rules: {
name: [
{ required: true, message: '请输入活动名称', trigger: 'blur' },
],
region: [
{ required: true, message: '请选择活动区域', trigger: 'change' }
],
date1: [
{ type: 'date', required: true, message: '请选择日期', trigger: 'change' }
],
}
}
},
mounted() {
this.getInfo();
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods: {
//
getInfo() {
// this.loading = true;
// jProject(this.pagination).then(res=>{
// this.loading = false;
// this.total = res.data.total;
// this.tableData = res.data.records;
// })
},
//
resetQuery() {
this.formInline = {
name: "",
type: "",
time: [],
number: "",
status: "",
}
this.pagination = {
current: 1,
size: 10,
}
this.getList();
},
//
handleQuery() {
this.pagination = {
current: 1,
size: 10
}
if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0]
this.formInline.endTime = this.formInline.time[1]
}
this.pagination = { ...this.pagination, ...this.formInline };
this.getList();
},
//
getPagination(pages) {
this.pagination.current = pages.page;
this.pagination.size = pages.limit;
this.getList();
},
//
handleImport() { },
//
handleExport() { },
//
handleAdd() {
this.$refs.taskDialog.open()
},
//
addliebiao(){
this.$refs.renwuclose.open()
},
//
renwuclose(){},
//
importClose() { },
//
goInfo() {
this.$router.push({
name: 'TaskInfo', query: {
pageType: "info",
}
})
},
//
edit() {
},
//
delInfo() {
this.$router.push({
name: 'taskAudit', query: {
pageType: "info",
}
})
},
// table
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
//
cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 110;
}
},
}
</script>

@ -1,469 +0,0 @@
<!-- 任务管理 -->
<template>
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline">
<el-row>
<el-col :span="7">
<el-form-item label="任务名称:">
<el-input v-model="formInline.taskName" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="任务状态:">
<el-select v-model="formInline.taskStatus" placeholder="请选择">
<el-option label="已关闭" value="0" />
<el-option label="进行中" value="1" />
<el-option label="正常完成" value="2" />
<el-option label="超期完成" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="任务完成时间:">
<el-date-picker v-model="formInline.time" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="请选择">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item>
</el-form-item>
</el-col>
<el-col :span="16" style="text-align: right;padding-right: 20px;">
<el-form-item>
<el-button size="small" @click="resetQuery"></el-button>
<el-button size="small" type="primary" @click="handleQuery"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<main>
<div class="search-title">
<span class="search-title-span">任务列表</span>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" :icon="Plus" size="small" @click="handleAdd"></el-button>
</el-col>
</el-row>
</div>
<section>
<el-table v-loading="loading" :data="tableData" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName">
<el-table-column type="index" width="60" label="序号" align="center" />
<el-table-column label="任务名称" key="taskName" prop="taskName" align="center" />
<el-table-column label="任务下发时间" key="taskTime" prop="taskTime" align="center" />
<el-table-column label="任务期限" key="taskDeadline" prop="taskDeadline" align="center" />
<el-table-column label="任务完成时间" key="taskFinishTime" prop="taskFinishTime" align="center" />
<el-table-column label="任务状态" key="taskStatus" width="200px" prop="taskStatus" class-name="table-status"
align="center">
<template #default="{ row }">
<span v-if="row.taskStatus == 0" style="color: #F56C6C;"></span>
<span v-if="row.taskStatus == 1" style="color: #E6A23C;"></span>
<span v-if="row.taskStatus == 2" style="color: #67C23A;"></span>
<span v-if="row.taskStatus == 3" style="color:#67C23A;"></span>
<span v-if="row.taskStatus == 4" style="color: #F56C6C;"></span>
<span v-if="row.taskStatus == 5" style="color: #F56C6C;"></span>
</template>
</el-table-column>
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
<template #default="{ row }">
<div style="display: flex;align-items: center;justify-content: center;">
<div style="display: flex;align-items: center;cursor: pointer;" @click="goInfo(row)">
<el-icon class="mr-1"><View /></el-icon>
<span class="look-info" style="color: #1485EF;">查看</span>
</div>
<div style="display: flex;align-items: center;cursor: pointer;margin-left: 10px;"
@click="delInfo(row)" v-if="row.taskStatus == 1 && row.taskStatus != 0">
<el-icon class="mr-1"><Edit /></el-icon>
<span class="del-info" style="color: #1485EF;">审核</span>
</div>
<div style="display: flex;align-items: center;cursor: pointer;margin-left: 10px;"
@click="guanbijiekou(row)" v-if="row.taskStatus == 1 && row.taskStatus != 0">
<el-icon class="mr-1"><Delete /></el-icon>
<span class="del-info" style="color: #1485EF;">关闭</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
</section>
<my-pagination id="L-pagination" :total="total" :page="pagination.current" :limit="pagination.size"
@pagination="getPagination" :current-page.sync="pagination.current"></my-pagination>
</main>
<my-dialog title="新增任务" @close="importClose" ref="taskDialog" class="taskDialogBox" width="43%">
<el-row>
<el-col :span="21">
<el-form :model="ruleForm" :rules="rules" ref="ruleFormRef" label-width="120px">
<el-form-item label="任务名称" prop="taskName">
<el-input v-model="ruleForm.taskName" placeholder="请输入任务名称"></el-input>
</el-form-item>
<el-form-item label="核查资产类型" prop="type">
<el-checkbox-group v-model="ruleForm.type" @change="checkboxChange">
<el-checkbox label="0">web资产</el-checkbox>
<el-checkbox label="1">小程序资产</el-checkbox>
<el-checkbox label="2">公众号资产</el-checkbox>
<el-checkbox label="3">电子邮件资产</el-checkbox>
<el-checkbox label="4">移动应用程序资产</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="核查单位" prop="dwmc" class="select-box">
<el-col>
<el-select v-model="ruleForm.dwmc" placeholder="请选择核查单位" multiple collapse-tags @remove-tag="isclear">
</el-select>
</el-col>
<el-col class="btn-box">
<el-button type="primary" @click="addliebiao"><el-icon><Expand /></el-icon></el-button>
</el-col>
</el-form-item>
<el-form-item label="任务期限" prop="taskDeadline">
<el-date-picker type="datetime" placeholder="选择日期" v-model="ruleForm.taskDeadline" style="width: 100%;"
value-format="yyyy-MM-dd HH:mm:ss" default-time="23:59:59"
:disabled-date="disabledDate"></el-date-picker>
</el-form-item>
<el-form-item class="newTask-form-item">
<el-button @click="resetForm"></el-button>
<el-button type="primary" @click="submitForm" :loading="btnloading">发布</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</my-dialog>
<div class="newTask-liebiao">
<my-dialog title="单位列表" ref="liebiaoDialog" @close="liebiaoClose" class="taskDialogBox" width="80%">
<danweiList ref="danweiList" @adddanweilist="adddanweilist" @liebiaoClose="liebiaoClose"></danweiList>
</my-dialog>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, View, Edit, Delete, Expand } from '@element-plus/icons-vue'
import myPagination from "@/views/components/Pagination/index.vue"
import myDialog from "@/views/components/myDialog/index.vue"
import danweiList from "@/views/system/user/danweiList.vue"
import { addassetTaskadd, getassetTask, getassetTaskid, assetTaskclose } from "@/api/renwuApi/index.js"
const router = useRouter()
const taskDialog = ref(null)
const liebiaoDialog = ref(null)
const danweiList = ref(null)
const ruleFormRef = ref(null)
const loading = ref(false)
const btnloading = ref(false)
const total = ref(0)
const tabHeader = ref(undefined)
const tabclicklist = ref([])
const formInline = reactive({
name: "",
type: "",
time: [],
number: "",
status: "",
})
const pagination = reactive({
current: 1,
size: 10,
})
const tableData = ref([])
const ruleForm = reactive({
taskName: "",
dwmc: [],
taskDeadline: "",
type: []
})
const rules = {
taskName: [{ required: true, message: '请输入', trigger: 'change' }],
dwmc: [{ required: true, message: '请选择', trigger: 'change' }],
taskDeadline: [{ required: true, message: '请选择日期', trigger: 'change' }],
type: [{ required: true, message: '请选择', trigger: 'change' }]
}
const chanckList = [
{ lable: "0", conent: "web资产" },
{ lable: "1", conent: "小程序资产" },
{ lable: "2", conent: "公众号资产" },
{ lable: "3", conent: "电子邮件资产" },
{ lable: "4", conent: "移动应用程序资产" },
]
// Methods
const isclear = (value) => {
tabclicklist.value = tabclicklist.value.filter(user => user.nickName != value)
}
const disabledDate = (time) => {
return time.getTime() < Date.now() - 8.64e7
}
const checkboxChange = () => {
ruleForm.dwmc = []
tabclicklist.value = []
nextTick(() => {
ruleFormRef.value?.clearValidate()
})
}
const resetForm = () => {
Object.assign(ruleForm, {
dwmc: [],
taskName: "",
taskDeadline: "",
type: []
})
taskDialog.value?.close()
tabclicklist.value = []
btnloading.value = false
}
const fonsisis = (data) => {
const specificTime = new Date(data)
const currentTime = new Date()
return currentTime <= specificTime
}
const submitForm = async () => {
if (!fonsisis(ruleForm.taskDeadline)) {
ElMessage.error('选择时间不能小于当前时间')
return
}
if (!ruleFormRef.value) return
await ruleFormRef.value.validate(async (valid) => {
if (valid) {
btnloading.value = true
try {
const submitData = {
...ruleForm,
dwmc: ruleForm.dwmc.join(","),
type: ruleForm.type.join(",")
}
await addassetTaskadd(submitData)
resetForm()
await getInfo()
ElMessage.success("新增成功")
} catch (error) {
console.error(error)
} finally {
btnloading.value = false
}
}
})
}
const adddanweilist = (val) => {
if (val) {
ruleForm.dwmc = val.map(element => element.nickName)
} else {
ruleForm.dwmc = []
}
tabclicklist.value = val
}
const getInfo = async () => {
loading.value = true
try {
const res = await getassetTask(pagination)
total.value = res.data.total
tableData.value = res.data.records
} catch (error) {
console.error(error)
} finally {
loading.value = false
}
}
const resetQuery = () => {
Object.assign(formInline, {
name: "",
type: "",
time: [],
number: "",
status: "",
})
Object.assign(pagination, {
current: 1,
size: 10,
})
localStorage.removeItem("ismypagination")
getInfo()
}
const addliebiao = () => {
if (ruleForm.type.length > 0) {
liebiaoDialog.value?.open()
nextTick(() => {
danweiList.value?.getType(ruleForm.type)
if (tabclicklist.value) {
setTimeout(() => {
danweiList.value?.dakai(tabclicklist.value)
}, 100)
}
})
} else {
ElMessage.warning('请先选择核查资产类型')
}
}
const liebiaoClose = () => {
if (danweiList.value) {
danweiList.value.queryParams = {
current: 1,
size: 10,
userName: undefined,
nickName: undefined,
dwlx: undefined,
}
}
liebiaoDialog.value?.close()
}
const handleQuery = () => {
Object.assign(pagination, {
current: 1,
size: 10
})
if (formInline.time.length > 0) {
formInline.begainTime = formInline.time[0]
formInline.endTime = formInline.time[1]
}
Object.assign(pagination, formInline)
formInline.isfanhui = false
localStorage.setItem("ismypagination", JSON.stringify(formInline))
getInfo()
}
const getPagination = (pages) => {
pagination.current = pages.page
pagination.size = pages.limit
getInfo()
}
const handleAdd = () => {
taskDialog.value?.open()
nextTick(() => {
ruleFormRef.value?.clearValidate()
})
}
const importClose = () => {
resetForm()
}
const goInfo = (row) => {
getassetTaskid(row.id)
router.push({
name: 'TaskInfo',
query: {
pageType: "look",
id: row.id
}
})
}
const delInfo = (row) => {
router.push({
name: 'TaskInfo',
query: {
pageType: "info",
id: row.id
}
})
}
const guanbijiekou = (row) => {
ElMessageBox.confirm('此操作将关闭任务, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
try {
const res = await assetTaskclose({ taskId: row.id, taskName: row.taskName })
if (res.code == 200) {
ElMessage.success('关闭成功!')
await getInfo()
}
} catch (error) {
console.error(error)
}
}).catch(() => {
ElMessage.info('已取消关闭')
})
}
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? 'evenNumber-row' : ''
}
const cancalDebounce = () => {
const element = document.getElementById('L-size-main')
const header = document.getElementById('L-header')
const pagination = document.getElementById('L-pagination')
if (element && header && pagination) {
const elementHeight = element.offsetHeight
const headerHeight = header.offsetHeight
const paginationtHeight = pagination.offsetHeight
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110
}
}
// Lifecycle hooks
onMounted(() => {
if (localStorage.getItem('ismypagination')) {
const storedPagination = JSON.parse(localStorage.getItem('ismypagination'))
if (storedPagination.isfanhui) {
Object.assign(formInline, storedPagination)
handleQuery()
} else {
localStorage.removeItem("ismypagination")
}
}
localStorage.removeItem("ismypaginationTow")
localStorage.removeItem("activeName")
getInfo()
cancalDebounce()
window.addEventListener('resize', cancalDebounce)
})
onUnmounted(() => {
window.removeEventListener('resize', cancalDebounce)
})
</script>
<style lang="scss" scoped>
.mr-1 {
margin-right: 4px;
}
.el-icon-s-unfold {
font-size: 16px;
}
.el-icon-delete {
color: #409EFF;
font-size: 16px;
font-weight: 600;
margin-right: 5px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -8,13 +8,27 @@
@close="resetCancel"
:width="width"
append-to-body
align-center
>
<slot></slot>
<div v-if="footer" slot="footer" class="dialog-footer">
<div
v-if="footer"
slot="footer"
class="dialog-footer"
>
<el-form size="small">
<el-form-item class="dialog-from-item">
<el-button size="default" @click="resetCancel">{{ closeText }}</el-button>
<el-button type="primary" size="default" @click="resetConfirm"></el-button>
<el-button
size="default"
@click="resetCancel"
>{{ closeText }}</el-button
>
<el-button
type="primary"
size="default"
@click="resetConfirm"
>确定</el-button
>
</el-form-item>
</el-form>
</div>
@ -22,59 +36,59 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref } from "vue";
// Props
const props = defineProps({
title: {
type: String,
default: ''
default: "",
},
myclass: {
type: Boolean,
default: false
default: false,
},
closeText: {
type: String,
default: '取消'
default: "取消",
},
width: {
type: String,
default: '50%'
default: "50%",
},
footer: {
type: Boolean,
default: false
}
})
default: false,
},
});
// Emits
const emit = defineEmits(['close', 'confirm'])
const emit = defineEmits(["close", "confirm"]);
// Dialog visible state ()
const dialogFormVisible = ref(false)
const dialogFormVisible = ref(false);
// Methods
const open = () => {
dialogFormVisible.value = true
}
dialogFormVisible.value = true;
};
const close = () => {
dialogFormVisible.value = false
}
dialogFormVisible.value = false;
};
//
const resetCancel = () => {
emit('close')
}
emit("close");
};
//
const resetConfirm = () => {
emit('confirm')
}
emit("confirm");
};
// 使
defineExpose({ open, close })
defineExpose({ open, close });
</script>
<style lang="scss" scoped>
@ -82,13 +96,12 @@ defineExpose({ open, close })
border-radius: 10px;
.el-dialog__header {
border-bottom: 1px solid #DDDDDD;
border-bottom: 1px solid #dddddd;
padding: 10px 20px;
background: #F2F4F6;
border-top-left-radius: 10px; /* 上左角圆角 */
background: #f2f4f6;
border-top-left-radius: 10px; /* 上左角圆角 */
border-top-right-radius: 10px; /* 上右角圆角 */
span {
// font-family: PingFang-SC, PingFang-SC;
font-weight: 800;
@ -104,7 +117,7 @@ defineExpose({ open, close })
width: 5px;
border-radius: 5px;
height: 100%;
background-color: #1485EF;
background-color: #1485ef;
}
}
}
@ -114,7 +127,7 @@ defineExpose({ open, close })
}
.el-dialog__footer {
border-top: 1px solid #DDDDDD;
border-top: 1px solid #dddddd;
.dialog-footer {
.el-form {
@ -135,7 +148,7 @@ defineExpose({ open, close })
:deep(.custom-my-class) {
margin-top: 15vh !important;
}
:deep(.el-dialog__body){
:deep(.el-dialog__body) {
padding-top: 10px !important;
}
</style>

@ -1,34 +1,82 @@
<template>
<div class="L-main L-mainTow" id="L-size-main">
<div class="content-search" id="L-header">
<div
class="L-main L-mainTow"
id="L-size-main"
>
<div
class="content-search"
id="L-header"
>
<div class="search-title">查询条件</div>
<el-form :inline="true" :model="queryParams" ref="queryForm" size="small" >
<el-form
:inline="true"
:model="queryParams"
ref="queryForm"
size="default"
>
<el-row>
<el-col :span="7">
<el-form-item label="单位名称:" prop="nickName">
<el-input v-model="queryParams.nickName" placeholder="请输入单位名称" clearable
@keyup.enter.native="handleQuery" />
<el-form-item
label="单位名称:"
prop="nickName"
>
<el-input
v-model="queryParams.nickName"
placeholder="请输入单位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="单位类型:" prop="dwlx">
<el-select v-model="queryParams.dwlx" placeholder="请选择单位类型" clearable>
<el-option v-for="dict in dict.type.dwlx" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-form-item
label="单位类型:"
prop="dwlx"
>
<el-select
v-model="queryParams.dwlx"
placeholder="请选择单位类型"
clearable
>
<el-option
v-for="dict in dict.type.dwlx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="统一社会信用代码:" class="tyshxydm-class" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入统一社会信用代码" clearable
@keyup.enter.native="handleQuery" />
<el-form-item
label="统一社会信用代码:"
class="tyshxydm-class"
prop="userName"
>
<el-input
v-model="queryParams.userName"
placeholder="请输入统一社会信用代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="3" style="text-align: right;padding-right: 20px;">
<el-col
:span="3"
style="text-align: right; padding-right: 20px"
>
<el-form-item class="unit-form">
<el-button size="default" @click="resetQuery"></el-button>
<el-button size="default" type="primary" @click="handleQuery"></el-button>
<el-button
size="default"
@click="resetQuery"
>重置</el-button
>
<el-button
size="default"
type="primary"
@click="handleQuery"
>查询</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -37,271 +85,270 @@
<main>
<div class="search-title">
<span class="search-title-span">单位列表</span>
</div>
<section>
<el-table ref="multipleTable" v-loading="loading" :data="userList" :height="tabHeader" :max-height="tabHeader"
:row-class-name="tableRowClassName" @selection-change="handleSelectionChange" row-key="userName">
<el-table-column type="selection" width="55" :reserve-selection="true">
<el-table
ref="multipleTable"
v-loading="loading"
:data="userList"
:height="tabHeader"
:max-height="tabHeader"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
row-key="userName"
>
<el-table-column
type="selection"
width="55"
:reserve-selection="true"
/>
<el-table-column
type="index"
label="序号"
width="70"
align="center"
/>
<el-table-column
label="单位名称"
align="center"
key="nickName"
prop="nickName"
>
<template #default="scope">{{ scope.row.nickName }}</template>
</el-table-column>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="单位名称" align="center" key="nickName" prop="nickName">
<template slot-scope="scope">{{ scope.row.nickName }}</template>
</el-table-column>
<el-table-column label="单位类型" align="center" key="dwlx" prop="dwlx">
<template slot-scope="scope">
<dict-tag :options="dict.type.dwlx" :value="scope.row.dwlx" />
<el-table-column
label="单位类型"
align="center"
key="dwlx"
prop="dwlx"
>
<template #default="scope">
<dict-tag
:options="dict.type.dwlx"
:value="scope.row.dwlx"
/>
</template>
</el-table-column>
<el-table-column label="统一社会信用代码" align="center" key="userName" prop="userName">
<template slot-scope="scope">{{ scope.row.userName }}</template>
<el-table-column
label="统一社会信用代码"
align="center"
key="userName"
prop="userName"
>
<template #default="scope">{{ scope.row.userName }}</template>
</el-table-column>
<el-table-column label="所属区域" align="center" key="ssqycounty" prop="ssqycounty">
<template slot-scope="scope">{{ getSsqu(scope.row) }}</template>
<el-table-column
label="所属区域"
align="center"
key="ssqycounty"
prop="ssqycounty"
>
<template #default="scope">{{ getSsqu(scope.row) }}</template>
</el-table-column>
<el-table-column label="所属行业" align="center" key="sshy" prop="sshy">
<template slot-scope="scope">
<dict-tag :options="dict.type.sshy" :value="scope.row.sshy" />
<!-- {{ scope.row.sshy }} -->
<el-table-column
label="所属行业"
align="center"
key="sshy"
prop="sshy"
>
<template #default="scope">
<dict-tag
:options="dict.type.sshy"
:value="scope.row.sshy"
/>
</template>
</el-table-column>
<el-table-column label="单位地址" align="center" key="dwxxdz" prop="dwxxdz">
<template slot-scope="scope">{{ scope.row.dwxxdz }}</template>
<el-table-column
label="单位地址"
align="center"
key="dwxxdz"
prop="dwxxdz"
>
<template #default="scope">{{ scope.row.dwxxdz }}</template>
</el-table-column>
</el-table>
</section>
<my-pagination id="L-pagination" :total="total" :page="queryParams.current" :limit="queryParams.size"
@pagination="getPagination" :current-page.sync="queryParams.current"></my-pagination>
<my-pagination
id="L-pagination"
:total="total"
:page="queryParams.current"
:limit="queryParams.size"
@pagination="getPagination"
:current-page.sync="queryParams.current"
></my-pagination>
</main>
<div class="bottomclass">
<el-button size="default" @click="resetCancel"></el-button>
<el-button type="primary" size="default" @click="resetConfirm"></el-button>
<el-button
size="default"
@click="resetCancel"
>取消</el-button
>
<el-button
type="primary"
size="default"
@click="resetConfirm"
>确定</el-button
>
</div>
</div>
</template>
<script>
// import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listUnitdw, delUnit } from "@/api/auditPagesApi/index";
<script setup>
import { ref, onMounted, onUnmounted } from "vue";
import { listUnitdw } from "@/api/auditPagesApi/index";
import { getToken } from "@/utils/auth";
import myPagination from "@/views/components/Pagination/index.vue"
export default {
name: "User",
dicts: ['dwlx', 'sshy'],
components: { Treeselect, myPagination },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
userList: [],
//
title: "",
//
deptOptions: undefined,
//
open: false,
//
deptName: undefined,
//
initPassword: undefined,
//
postOptions: [],
//
roleOptions: [],
//
form: {},
defaultProps: {
children: "children",
label: "label"
},
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/tc/unit/importData"
},
//
queryParams: {
current: 1,
size: 10,
userName: undefined,
nickName: undefined,
dwlx: undefined,
type:"0",
},
//
// propsemits
const emit = defineEmits(["liebiaoClose", "adddanweilist"]);
tabHeader: undefined,
tabclicklist: []
};
},
watch: {
//
const loading = ref(true);
const userList = ref([]);
const total = ref(0);
const tabHeader = ref(undefined);
const tabclicklist = ref([]);
const queryForm = ref(null);
const multipleTable = ref(null);
//
deptName(val) {
this.$refs.tree.filter(val);
const queryParams = ref({
current: 1,
size: 10,
userName: undefined,
nickName: undefined,
dwlx: undefined,
type: "0",
});
}
},
created() {
// this.getType();
// this.getConfigKey("sys.user.initPassword").then(response => {
// this.initPassword = response.msg;
// });
//
const dict = {
type: {
dwlx: [],
sshy: [],
},
mounted() {
this.cancalDebounce();
window.addEventListener('resize', this.cancalDebounce);
},
destroyed() {
window.removeEventListener('resize', this.cancalDebounce);
},
methods: {
getSsqu(row) {
if(row.ssqyprovince && row.ssqycity && row.ssqycounty) {
return row.ssqyprovince + "/" + row.ssqycity + '/' + row.ssqycounty
} else if(row.ssqyprovince && row.ssqycity) {
return row.ssqyprovince + "/" + row.ssqycity
} else if(row.ssqyprovince) {
return row.ssqyprovince
} else {
return
}
},
dakai(val) {
console.log(val);
};
this.toggleSelection(val)
},
resetCancel() {
this.$emit('liebiaoClose')
this.toggleSelection()
this.$emit('adddanweilist', [])
//
const getSsqu = (row) => {
if (row.ssqyprovince && row.ssqycity && row.ssqycounty) {
return row.ssqyprovince + "/" + row.ssqycity + "/" + row.ssqycounty;
} else if (row.ssqyprovince && row.ssqycity) {
return row.ssqyprovince + "/" + row.ssqycity;
} else if (row.ssqyprovince) {
return row.ssqyprovince;
}
return "";
};
},
resetConfirm() {
this.$emit('adddanweilist', this.tabclicklist)
this.$emit('liebiaoClose')
this.toggleSelection()
const resetCancel = () => {
emit("liebiaoClose");
toggleSelection();
emit("adddanweilist", []);
};
},
// /table
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
if (val) {
this.tabclicklist = val
}
const resetConfirm = () => {
emit("adddanweilist", tabclicklist.value);
emit("liebiaoClose");
toggleSelection();
};
const toggleSelection = (rows) => {
if (rows) {
rows.forEach((row) => {
multipleTable.value.toggleRowSelection(row);
});
} else {
multipleTable.value.clearSelection();
}
};
},
const handleSelectionChange = (val) => {
tabclicklist.value = val || [];
};
// table
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return 'evenNumber-row';
}
return '';
},
getType(type){
this.queryParams.type = type.join(",")
this.getList()
},
/** 查询用户列表 */
getList(type) {
if(this.queryParams.type){
this.queryParams.type = this.queryParams.type
}
this.loading = true;
this.queryParams.isSearch = 1
listUnitdw(this.queryParams).then(response => {
this.userList = response.data.records;
this.total = response.data.total;
this.loading = false;
}
);
},
//
getPagination(pages) {
this.queryParams.current = pages.page;
this.queryParams.size = pages.limit;
this.getList();
},
//
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? "evenNumber-row" : "";
};
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.current = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
if(this.queryParams.type){
this.queryParams.type = this.queryParams.type
}
this.resetForm("queryForm");
this.toggleSelection()
this.handleQuery();
},
const getType = (type) => {
queryParams.value.type = type.join(",");
getList();
};
const dakai = (val) => {
console.log(val);
toggleSelection(val);
};
// getType
defineExpose({
getType,
dakai,
});
//
cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID
const header = document.getElementById('L-header'); // ID
const pagination = document.getElementById('L-pagination'); // ID
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight - 120;
}
const getList = async () => {
loading.value = true;
queryParams.value.isSearch = 1;
try {
const response = await listUnitdw(queryParams.value);
userList.value = response.data.records;
total.value = response.data.total;
} finally {
loading.value = false;
}
};
const getPagination = (pages) => {
queryParams.value.current = pages.page;
queryParams.value.size = pages.limit;
getList();
};
const handleQuery = () => {
queryParams.value.current = 1;
getList();
};
const resetQuery = () => {
queryForm.value.resetFields();
toggleSelection();
handleQuery();
};
const cancalDebounce = () => {
const element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 120;
};
//
onMounted(() => {
getList();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
</script>
<style lang="scss" scoped>
:deep(.danweiList){
:deep(.danweiList) {
padding: 0 20px;
}
:deep(.content-search){
:deep(.content-search) {
padding-top: 10px;
}
.L-mainTow {
background-color: #ffffff !important;
background-color: #ffffff !important;
}
:deep(.search-title){
:deep(.search-title) {
border: none !important;
}
</style>
</style>

@ -307,7 +307,7 @@
prop="dwmc"
class="select-box"
>
<el-col>
<div style="display: flex; width: 100%;gap: 10px;">
<el-select
v-model="ruleForm.dwmc"
placeholder="请选择核查单位"
@ -316,14 +316,12 @@
@remove-tag="isclear"
>
</el-select>
</el-col>
<el-col class="btn-box">
<el-button
type="primary"
@click="addliebiao"
><i class="el-icon-s-unfold"></i
></el-button>
</el-col>
:icon="Expand"
></el-button>
</div>
</el-form-item>
<el-form-item
label="任务期限"
@ -364,7 +362,7 @@
width="80%"
>
<danweiList
ref="danweiList"
ref="danweiListRef"
@adddanweilist="adddanweilist"
@liebiaoClose="liebiaoClose"
></danweiList>
@ -373,367 +371,357 @@
</div>
</template>
<script>
<script setup>
import { ref, onMounted, onUnmounted, getCurrentInstance } from "vue";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import myPagination from "@/views/components/Pagination/index.vue";
import myDialog from "@/views/components/myDialog/index.vue";
import danweiList from "@/views/system/user/danweiList.vue";
import { Plus,Expand } from "@element-plus/icons-vue";
import {
addassetTaskadd,
getassetTask,
getassetTaskid,
assetTaskclose,
} from "@/api/renwuApi/index.js";
import { Plus } from "@element-plus/icons-vue";
export default {
// components: { myPagination, myDialog, danweiList },
setup() {
const router = useRouter();
const { proxy } = getCurrentInstance();
// Refs
const taskDialog = ref(null);
const liebiaoDialog = ref(null);
const danweiList = ref(null);
const ruleFormRef = ref(null);
const pickerOptions = {
disabledDate(time) {
const date = new Date();
const oneday = date.getTime();
return time.getTime() < new Date().getTime() - 86400000;
},
selectableRange: (() => {
let data = new Date();
let hour = data.getHours();
let minute = data.getMinutes();
let second = data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`];
})(),
};
const btnloading = ref(false);
const formInline = ref({
name: "",
type: "",
time: [],
number: "",
status: "",
});
const total = ref(0);
const pagination = ref({
current: 1,
size: 10,
});
const tableData = ref([]);
const loading = ref(false);
const tabHeader = ref(undefined);
const ruleForm = ref({
taskName: "",
dwmc: [],
taskDeadline: "",
type: [],
});
const rules = ref({
taskName: [{ required: true, message: "请输入", trigger: "change" }],
dwmc: [{ required: true, message: "请选择", trigger: "change" }],
taskDeadline: [
{ required: true, message: "请选择日期", trigger: "change" },
],
type: [{ required: true, message: "请选择", trigger: "change" }],
});
const tabclicklist = ref([]);
const chanckList = ref([
{ lable: "0", conent: "web资产" },
{ lable: "1", conent: "小程序资产" },
{ lable: "2", conent: "公众号资产" },
{ lable: "3", conent: "电子邮件资产" },
{ lable: "4", conent: "移动应用程序资产" },
]);
// Methods
const isclear = (value) => {
tabclicklist.value = tabclicklist.value.filter(
(user) => user.nickName != value
);
};
const router = useRouter();
const checkboxChange = () => {
ruleForm.value.dwmc = [];
tabclicklist.value = [];
setTimeout(() => {
ruleFormRef.value.clearValidate();
}, 0);
};
// Refs
const taskDialog = ref(null);
const liebiaoDialog = ref(null);
const danweiListRef = ref(null);
const ruleFormRef = ref(null);
const { proxy } = getCurrentInstance();
const resetForm = () => {
ruleForm.value = {
dwmc: [],
taskName: "",
taskDeadline: "",
type: [],
};
taskDialog.value.close();
tabclicklist.value = [];
btnloading.value = false;
};
const pickerOptions = {
disabledDate(time) {
const date = new Date();
const oneday = date.getTime();
return time.getTime() < new Date().getTime() - 86400000;
},
selectableRange: (() => {
let data = new Date();
let hour = data.getHours();
let minute = data.getMinutes();
let second = data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`];
})(),
};
const fonsisis = (data) => {
const specificTime = new Date(data);
const currentTime = new Date();
return currentTime <= specificTime;
};
const btnloading = ref(false);
const formInline = ref({
name: "",
type: "",
time: [],
number: "",
status: "",
});
const total = ref(0);
const pagination = ref({
current: 1,
size: 10,
});
const tableData = ref([]);
const loading = ref(false);
const tabHeader = ref(undefined);
const ruleForm = ref({
taskName: "",
dwmc: [],
taskDeadline: "",
type: [],
});
const rules = ref({
taskName: [{ required: true, message: "请输入", trigger: "change" }],
dwmc: [{ required: true, message: "请选择", trigger: "change" }],
taskDeadline: [{ required: true, message: "请选择日期", trigger: "change" }],
type: [{ required: true, message: "请选择", trigger: "change" }],
});
const tabclicklist = ref([]);
const chanckList = ref([
{ lable: "0", conent: "web资产" },
{ lable: "1", conent: "小程序资产" },
{ lable: "2", conent: "公众号资产" },
{ lable: "3", conent: "电子邮件资产" },
{ lable: "4", conent: "移动应用程序资产" },
]);
// Methods
const isclear = (value) => {
tabclicklist.value = tabclicklist.value.filter(
(user) => user.nickName != value
);
};
const submitForm = async () => {
if (!fonsisis(ruleForm.value.taskDeadline)) {
ElMessage.error("选择时间不能小于当前时间");
return false;
}
const checkboxChange = () => {
ruleForm.value.dwmc = [];
tabclicklist.value = [];
setTimeout(() => {
ruleFormRef.value.clearValidate();
}, 0);
};
try {
await ruleFormRef.value.validate();
btnloading.value = true;
const resetForm = () => {
ruleForm.value = {
dwmc: [],
taskName: "",
taskDeadline: "",
type: [],
};
taskDialog.value.close();
tabclicklist.value = [];
btnloading.value = false;
};
const formData = {
...ruleForm.value,
dwmc: ruleForm.value.dwmc.join(","),
type: ruleForm.value.type.join(","),
};
const fonsisis = (data) => {
const specificTime = new Date(data);
const currentTime = new Date();
return currentTime <= specificTime;
};
await addassetTaskadd(formData);
resetForm();
getInfo();
ElMessage.success("新增成功");
} catch (error) {
console.log("error submit!!", error);
} finally {
btnloading.value = false;
}
};
const submitForm = async () => {
if (!fonsisis(ruleForm.value.taskDeadline)) {
ElMessage.error("选择时间不能小于当前时间");
return false;
}
const adddanweilist = (val) => {
if (val) {
ruleForm.value.dwmc = val.map((element) => element.nickName);
} else {
ruleForm.value.dwmc = [];
}
tabclicklist.value = val || [];
};
try {
await ruleFormRef.value.validate();
btnloading.value = true;
const getInfo = async () => {
loading.value = true;
try {
const res = await getassetTask(pagination.value);
total.value = res.data.total;
tableData.value = res.data.records;
} finally {
loading.value = false;
}
const formData = {
...ruleForm.value,
dwmc: ruleForm.value.dwmc.join(","),
type: ruleForm.value.type.join(","),
};
const resetQuery = () => {
formInline.value = {
name: "",
type: "",
time: [],
number: "",
status: "",
};
pagination.value = {
current: 1,
size: 10,
};
localStorage.removeItem("ismypagination");
getInfo();
};
await addassetTaskadd(formData);
resetForm();
getInfo();
ElMessage.success("新增成功");
} catch (error) {
console.log("error submit!!", error);
} finally {
btnloading.value = false;
}
};
const addliebiao = () => {
if (ruleForm.value.type.length > 0) {
liebiaoDialog.value.open();
setTimeout(() => {
danweiList.value.getType(ruleForm.value.type);
if (tabclicklist.value) {
setTimeout(() => {
danweiList.value.dakai(tabclicklist.value);
}, 100);
}
}, 10);
} else {
ElMessage("请先选择核查资产类型");
}
};
const adddanweilist = (val) => {
if (val) {
ruleForm.value.dwmc = val.map((element) => element.nickName);
} else {
ruleForm.value.dwmc = [];
}
tabclicklist.value = val || [];
};
const liebiaoClose = () => {
danweiList.value.queryParams = {
current: 1,
size: 10,
userName: undefined,
nickName: undefined,
dwlx: undefined,
};
liebiaoDialog.value.close();
};
const getInfo = async () => {
loading.value = true;
try {
const res = await getassetTask(pagination.value);
total.value = res.data.total;
tableData.value = res.data.records;
} finally {
loading.value = false;
}
};
const handleQuery = () => {
pagination.value = {
current: 1,
size: 10,
};
const resetQuery = () => {
formInline.value = {
name: "",
type: "",
time: [],
number: "",
status: "",
};
pagination.value = {
current: 1,
size: 10,
};
localStorage.removeItem("ismypagination");
getInfo();
};
if (formInline.value.time.length > 0) {
formInline.value.begainTime = formInline.value.time[0];
formInline.value.endTime = formInline.value.time[1];
const addliebiao = () => {
if (ruleForm.value.type.length > 0) {
liebiaoDialog.value.open();
setTimeout(() => {
danweiListRef.value.getType(ruleForm.value.type);
if (tabclicklist.value) {
setTimeout(() => {
danweiListRef.value.dakai(tabclicklist.value);
}, 100);
}
}, 10);
} else {
ElMessage("请先选择核查资产类型");
}
};
pagination.value = { ...pagination.value, ...formInline.value };
formInline.value.isfanhui = false;
localStorage.setItem("ismypagination", JSON.stringify(formInline.value));
getInfo();
};
const getPagination = (pages) => {
pagination.value.current = pages.page;
pagination.value.size = pages.limit;
getInfo();
};
const handleAdd = () => {
taskDialog.value.open();
setTimeout(() => {
ruleFormRef.value.clearValidate();
}, 100);
};
const liebiaoClose = () => {
danweiListRef.value.queryParams = {
current: 1,
size: 10,
userName: undefined,
nickName: undefined,
dwlx: undefined,
};
liebiaoDialog.value.close();
};
const importClose = () => {
resetForm();
};
const handleQuery = () => {
pagination.value = {
current: 1,
size: 10,
};
if (formInline.value.time.length > 0) {
formInline.value.begainTime = formInline.value.time[0];
formInline.value.endTime = formInline.value.time[1];
}
pagination.value = { ...pagination.value, ...formInline.value };
formInline.value.isfanhui = false;
localStorage.setItem("ismypagination", JSON.stringify(formInline.value));
getInfo();
};
const goInfo = (row) => {
getassetTaskid(row.id);
proxy.setActiveMenu("/taskManagement");
router.push({
path: "/taskManagement-info",
query: {
pageType: "look",
id: row.id,
},
});
};
const getPagination = (pages) => {
pagination.value.current = pages.page;
pagination.value.size = pages.limit;
getInfo();
};
const delInfo = (row) => {
router.push({
name: "TaskInfo",
query: {
pageType: "info",
id: row.id,
},
});
};
const handleAdd = () => {
taskDialog.value.open();
setTimeout(() => {
ruleFormRef.value.clearValidate();
}, 100);
};
const guanbijiekou = (row) => {
ElMessageBox.confirm("此操作将关闭任务, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
try {
await assetTaskclose({ taskId: row.id, taskName: row.taskName });
ElMessage.success("关闭成功!");
getInfo();
} catch (error) {
console.error(error);
}
})
.catch(() => {
ElMessage.info("已取消关闭");
});
};
const importClose = () => {
resetForm();
};
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? "evenNumber-row" : "";
};
const goInfo = (row) => {
getassetTaskid(row.id);
proxy.setActiveMenu("/taskManagement");
router.push({
path: "/taskManagement-info",
query: {
pageType: "look",
id: row.id,
},
});
};
const cancalDebounce = () => {
const element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
};
const delInfo = (row) => {
router.push({
name: "TaskInfo",
query: {
pageType: "info",
id: row.id,
},
});
};
// Lifecycle hooks
onMounted(() => {
if (localStorage.getItem("ismypagination")) {
const storedData = JSON.parse(localStorage.getItem("ismypagination"));
if (storedData.isfanhui) {
formInline.value = storedData;
handleQuery();
} else {
localStorage.removeItem("ismypagination");
}
const guanbijiekou = (row) => {
ElMessageBox.confirm("此操作将关闭任务, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
try {
await assetTaskclose({ taskId: row.id, taskName: row.taskName });
ElMessage.success("关闭成功!");
getInfo();
} catch (error) {
console.error(error);
}
localStorage.removeItem("ismypaginationTow");
localStorage.removeItem("activeName");
getInfo();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
})
.catch(() => {
ElMessage.info("已取消关闭");
});
};
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
const tableRowClassName = ({ rowIndex }) => {
return rowIndex % 2 !== 0 ? "evenNumber-row" : "";
};
return {
// Refs
taskDialog,
liebiaoDialog,
danweiList,
ruleFormRef,
// Data
pickerOptions,
btnloading,
formInline,
total,
pagination,
tableData,
loading,
tabHeader,
ruleForm,
rules,
tabclicklist,
chanckList,
// Methods
isclear,
checkboxChange,
resetForm,
fonsisis,
submitForm,
adddanweilist,
getInfo,
resetQuery,
addliebiao,
liebiaoClose,
handleQuery,
getPagination,
handleAdd,
importClose,
goInfo,
delInfo,
guanbijiekou,
tableRowClassName,
cancalDebounce,
};
},
const cancalDebounce = () => {
const element = document.getElementById("L-size-main");
const header = document.getElementById("L-header");
const pagination = document.getElementById("L-pagination");
const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight;
tabHeader.value = elementHeight - headerHeight - paginationtHeight - 110;
};
// Lifecycle hooks
onMounted(() => {
if (localStorage.getItem("ismypagination")) {
const storedData = JSON.parse(localStorage.getItem("ismypagination"));
if (storedData.isfanhui) {
formInline.value = storedData;
handleQuery();
} else {
localStorage.removeItem("ismypagination");
}
}
localStorage.removeItem("ismypaginationTow");
localStorage.removeItem("activeName");
getInfo();
cancalDebounce();
window.addEventListener("resize", cancalDebounce);
});
onUnmounted(() => {
window.removeEventListener("resize", cancalDebounce);
});
// Expose to template
defineExpose({
taskDialog,
liebiaoDialog,
danweiList,
ruleFormRef,
pickerOptions,
btnloading,
formInline,
total,
pagination,
tableData,
loading,
tabHeader,
ruleForm,
rules,
tabclicklist,
chanckList,
Plus,
isclear,
checkboxChange,
resetForm,
fonsisis,
submitForm,
adddanweilist,
getInfo,
resetQuery,
addliebiao,
liebiaoClose,
handleQuery,
getPagination,
handleAdd,
importClose,
goInfo,
delInfo,
guanbijiekou,
tableRowClassName,
cancalDebounce,
});
</script>
<style lang="scss" scoped>
@ -748,3 +736,16 @@ export default {
margin-right: 5px;
}
</style>
<style lang="scss" scoped>
.el-icon-s-unfold {
font-size: 16px;
}
.el-icon-delete {
color: #409eff;
font-size: 16px;
font-weight: 600;
margin-right: 5px;
}
</style>

Loading…
Cancel
Save