From 79ff2197ea16c150e3537970442ee76317d02b3e Mon Sep 17 00:00:00 2001
From: zhoucong <123456>
Date: 星期五, 29 四月 2022 15:45:23 +0800
Subject: [PATCH] fix
---
src/views/accidentHidden/fillProgress.vue | 288 +++++++++++++++++++++++++++++++++++++++---------
src/api/sgyhpczl/majorHidden.js | 41 ++++++
src/views/accidentHidden/majorHidden.vue | 30 +++-
3 files changed, 297 insertions(+), 62 deletions(-)
diff --git a/src/api/sgyhpczl/majorHidden.js b/src/api/sgyhpczl/majorHidden.js
index bd20148..b556dca 100644
--- a/src/api/sgyhpczl/majorHidden.js
+++ b/src/api/sgyhpczl/majorHidden.js
@@ -86,3 +86,44 @@
data
});
}
+
+export function saveProcess(data) {
+ return request({
+ headers:{
+ 'token': getTokenAndVerify().token,
+ 'verify':getTokenAndVerify().verify
+ },
+ url: "/taboi/danger/progress_save",
+ contentType: "application/json",
+ method: 'POST',
+ data
+ });
+}
+
+export function viewProcess(data) {
+ var arr=[]
+ arr.push({field:"yh_id",value:data.form.id,type:'OPT'})
+ data.query_condition=arr
+ return request({
+ headers:{
+ 'token': getTokenAndVerify().token,
+ 'verify':getTokenAndVerify().verify
+ },
+ url: "/taboi/danger/progress_list?yh_id="+data.form.id,
+ contentType: "application/json",
+ method: 'POST',
+ data
+ });
+}
+
+export function deleteProcess(id) {
+ return request({
+ headers:{
+ 'token': getTokenAndVerify().token,
+ 'verify':getTokenAndVerify().verify
+ },
+ url: "/taboi/danger/progress_del_do?id="+id,
+ contentType: "application/json",
+ method: 'POST',
+ });
+}
diff --git a/src/views/accidentHidden/fillProgress.vue b/src/views/accidentHidden/fillProgress.vue
index 6695adb..63130a0 100644
--- a/src/views/accidentHidden/fillProgress.vue
+++ b/src/views/accidentHidden/fillProgress.vue
@@ -1,22 +1,20 @@
<template>
<div class="app-container">
<div>
- <Titlename title="列表页面"></Titlename>
+ <Titlename title="进度列表页面"></Titlename>
<div class="whole">
<el-form ref="form" :model="form" label-width="100px">
<el-form-item style="text-align: right;">
- <el-button class="btn" type="primary" size="small" icon="el-icon-plus" @click="onSubmit">添加</el-button>
- <el-button size="small">批量删除</el-button>
+ <el-button class="btn" type="primary" size="small" icon="el-icon-plus" @click="addProgress">添加</el-button>
+ <el-button size="small" @click="deleteBatch">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
type="selection"
:data="tableData"
style="width: 1600px"
+ @selection-change="changeBox"
border
- @cell-mouse-enter="handleCellEnter"
- @cell-mouse-leave="handleCellLeave"
- @cell-click="handleCellClick"
>
<el-table-column
type="selection"
@@ -24,98 +22,280 @@
width="55">
</el-table-column>
<el-table-column
- prop="fillingTime"
+ prop="FillinTime"
align="center"
width="220"
label="填报时间">
- <div class="item" slot-scope="scope">
-<!-- <el-input class="item__input" v-model="scope.row.fillingTime" placeholder="请输入内容"></el-input>-->
- <el-date-picker
- class="item__input"
- v-model="scope.row.fillingTime"
- type="date"
- ref="saveDateInput"
- placeholder="选择日期" clearable>
- </el-date-picker>
- <div class="item__txt">{{scope.row.fillingTime}}</div>
- </div>
+
</el-table-column>
<el-table-column
- prop="filledBy"
+ prop="FillinPople"
align="center"
width="300"
label="填报人">
- <div class="item" slot-scope="scope">
- <el-input class="item__input" v-model="scope.row.filledBy" placeholder="请输入内容"></el-input>
- <div class="item__txt">{{scope.row.filledBy}}</div>
- </div>
+
</el-table-column>
<el-table-column
- prop="progress"
+ prop="RectProgrees"
label="整改形象进度"
width="300"
align="center">
- <div class="item" slot-scope="scope">
- <el-input class="item__input" v-model="scope.row.progress" placeholder="请输入内容" clearable></el-input>
- <div class="item__txt">{{scope.row.progress}}</div>
- </div>
</el-table-column>
<el-table-column
- prop="remarks"
+ prop="Remark "
label="备注"
align="center">
- <div class="item" slot-scope="scope">
- <el-input type="textarea" class="item__input" v-model="scope.row.remarks" placeholder="请输入内容" clearable></el-input>
- <div class="item__txt">{{scope.row.remarks}}</div>
- </div>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="200">
<template slot-scope="scope">
- <el-button type="text" size="small">编辑</el-button>
- <el-button @click="save(scope.row)" type="text" size="small">保存</el-button>
- <el-button type="text" size="small" style="color: #f56c6c">删除</el-button>
+ <el-button type="text" size="small" @click="updateClick(scope.row)">编辑</el-button>
+ <!-- <el-button @click="save(scope.row)" type="text" size="small">保存</el-button>-->
+ <el-button type="text" size="small" style="color: #f56c6c" @click="deleteClick(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
+ <div style="text-align: right">
+ <el-pagination
+ v-show="recordTotal > 0"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="currentPage"
+ :page-sizes="[10, 20, 30, 50]"
+ :page-size="pageSize"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="recordTotal"
+ >
+ </el-pagination>
+ </div>
</div>
</div>
+
+ <el-dialog
+ :title="title"
+ :visible.sync="dialogVisible"
+ :close-on-click-modal="false"
+ width="40%">
+ <el-form ref="form" :rules="rules" :model="form" label-width="100px">
+ <el-row>
+ <el-col :span="9">
+ <el-form-item label="填报时间" prop="FillinTime">
+ <el-date-picker
+ v-model="form.FillinTime"
+ type="date"
+ value-format="yyyy-MM-dd"
+ placeholder="选择日期"
+ style="width: 100%"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="9" :offset="4">
+ <el-form-item label="填报人" prop="FillinPople">
+ <el-input v-model="form.FillinPople" class="multiline"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="9">
+ <el-form-item label="进度" prop="RectProgrees">
+ <el-input v-model="form.RectProgrees" type="textarea" :rows="3" class="multiline"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row>
+ <el-col :span="9">
+ <el-form-item label="备注" prop="Remark ">
+ <el-input v-model="form.Remark " type="textarea" :rows="3" class="multiline"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="22">
+ <el-form-item style="text-align: center">
+ <el-button type="primary" class="btns" @click="submitProgress('form')"
+ >保存</el-button
+ >
+ <el-button @click="dialogVisible=false">关闭</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-dialog>
</div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
+ import {saveProcess,viewProcess,deleteProcess} from '@/api/sgyhpczl/majorHidden.js'
+ import { deepClone } from '@/utils'
export default {
components: {Titlename},
name: "fillProgress",
data(){
return{
- // tableData: [],
- tableData: [{
- fillingTime: '2016-05-02',
- progress: '无进度',
- remarks: '222222222',
- filledBy:'王小虎'
- }, {
- fillingTime: '2016-05-02',
- progress: '无进度',
- remarks: '222222222',
- filledBy:'王小虎'
- }],
- // // 需要编辑的属性
- // editProp: ['fillingTime', 'progress', 'remarks'],
- // // 保存进入编辑的cell
- // clickCellMap: {},
- // 需要编辑的属性
+ selectedList:[],
+ rules:{
+ FillinTime: [{ required: true, message: '不能为空', trigger: 'blur' },],
+ FillinPople: [{ required: true, message: '不能为空', trigger: 'blur' },],
+ RectProgrees: [{ required: true, message: '不能为空', trigger: 'blur' },],
+ },
+ form:{},
+ title:'新增',
+ dialogVisible:false,
+ id:'',
+ type:'',
+ listQuery:{
+ page:1,
+ limit:10,
+ form:{
+ id:''
+ },
+ },
+ recordTotal: 0,
+ tableData: [],
+ currentPage: 1,
+ pageSize: 10,
editProp: ['fillingTime', 'progress', 'remarks','filledBy'],
- // 保存进入编辑的cell
clickCellMap: {}
}
},
+ mounted() {
+ this.id = this.$route.query.id;
+ this.listQuery.form.id = this.$route.query.id;
+ this.type = this.$route.query.type;
+ this.getPageList()
+ },
methods: {
+ deleteBatch(){
+ if(this.selectedList==null ||this.selectedList.length==0 ){
+ this.$message({type:'warning', message:'至少选中一条数据', duration:3000})
+ return
+ }
+ var ids=this.selectedList.map((obj) => {
+ return obj.id
+ }).join(",")
+ this.$confirm('确认删除吗','提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(()=>{
+ deleteProcess(ids).then(() => {
+ this.getPageList()
+ this.$notify({
+ title: "成功",
+ message: "删除成功",
+ type: "success",
+ duration: 2000,
+ });
+ });
+ })
+ .catch(error =>{
+ });
+ },
+ changeBox(val){
+ this.selectedList = []
+ val.forEach((item) => {
+ this.selectedList.push(item)
+ })
+ },
+ deleteClick(row){
+ this.$confirm('确认删除吗','提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(()=>{
+ deleteProcess(row.id).then(() => {
+ this.getPageList()
+ this.$notify({
+ title: "成功",
+ message: "删除成功",
+ type: "success",
+ duration: 2000,
+ });
+ });
+ })
+ .catch(error =>{
+ });
+ },
+ updateClick(row){
+ this.form=deepClone(row)
+ this.title='编辑'
+ this.dialogVisible=true
+ },
+ addProgress(){
+ this.form={
+ yh_id:this.id
+ }
+ this.title='新增'
+ this.dialogVisible=true
+ },
+ submitProgress(formName){
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ if(this.title=='新增'){
+ saveProcess(this.form).then(res=>{
+ if(res.data.ok==1){
+ this.getPageList()
+ this.dialogVisible=false
+ this.$message({type:'success', message:'新增成功', duration:3000})
+ }else {
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ }else {
+ saveProcess(this.form).then(res=>{
+ if(res.data.ok==1){
+ this.getPageList()
+ this.dialogVisible=false
+ this.$message({type:'success', message:'编辑成功', duration:3000})
+ }else {
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ }
+ this.dialogVisible=false
+
+ } else {
+ return false;
+ }
+ });
+ },
+ getPageList(){
+ this.listQuery.page=1
+ viewProcess(this.listQuery).then(res=>{
+ if (res.data.ok==1) {
+ this.tableData = res.data.data.items
+ this.recordTotal=res.data.data.total
+ }else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ handleSizeChange(val){
+ this.listQuery.limit = val
+ this.getPageListForPagination();
+ },
+ handleCurrentChange(val){
+ this.listQuery.page = val
+ this.getPageListForPagination();
+ },
+ getPageListForPagination(){
+ viewProcess(this.listQuery).then(res=>{
+ if (res.data.ok==1) {
+ this.tableData = res.data.data.items
+ this.recordTotal=res.data.data.total
+ }else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
/** 鼠标移入cell */
handleCellEnter (row, column, cell, event) {
const property = column.property
diff --git a/src/views/accidentHidden/majorHidden.vue b/src/views/accidentHidden/majorHidden.vue
index 665b6c2..ab2fffe 100644
--- a/src/views/accidentHidden/majorHidden.vue
+++ b/src/views/accidentHidden/majorHidden.vue
@@ -147,13 +147,13 @@
<el-radio-button label="整改完成">整改完成</el-radio-button>
</el-radio-group>
</el-col>
- <el-col :offset="4" :span="10" style="text-align:right;">
+ <!--<el-col :offset="4" :span="10" style="text-align:right;">
<el-button class="btns" type="primary" icon="el-icon-search" size="small">查看进度</el-button>
<el-button class="btns" type="primary" icon="el-icon-edit" size="small" @click="fillProgress()">填写进度</el-button>
- </el-col>
+ </el-col>-->
</el-row>
<el-table :data="tableData" style="width: 100%">
- <el-table-column type="selection" width="55" align="center"></el-table-column>
+ <!-- <el-table-column type="selection" width="55" align="center"></el-table-column>-->
<el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
<el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
<el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
@@ -174,6 +174,12 @@
</el-table-column>
</el-table-column>
<el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
+ <el-table-column prop="DTRisk_level" label="操作" align="center" width="250">
+ <template slot-scope="scope">
+ <el-button class="btns" type="primary" icon="el-icon-search" size="mini" @click="viewProgress(scope.row)">查看进度</el-button>
+ <el-button class="btns" type="primary" icon="el-icon-edit" size="mini" @click="fillProgress(scope.row)">填写进度</el-button>
+ </template>
+ </el-table-column>
</el-table>
<div style="text-align: right">
<el-pagination
@@ -198,7 +204,9 @@
return {
reList:[{label:"未关联",value:0}],
options: [],
- form:{},
+ form:{
+
+ },
llrList:[],
JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
JCBMList:[],
@@ -212,7 +220,8 @@
page:1,
limit:10,
form:{
- ht_community:"众泰煤焦化"
+ ht_community:"众泰煤焦化",
+ alter_status:'正在整改'
},
},
currentPage: 1,
@@ -302,7 +311,7 @@
})
},
reset(){
- this.listQuery.form={ht_community:"众泰煤焦化"}
+ this.listQuery.form={ht_community:"众泰煤焦化", alter_status:'正在整改'}
this.getPageList()
},
handleSizeChange(val){
@@ -360,9 +369,14 @@
}
})
},
- fillProgress(){
+ viewProgress(row){
this.$router.push({
- path:"/fillProgress"
+ path:"/fillProgress?type=1&id="+row.id
+ })
+ },
+ fillProgress(row){
+ this.$router.push({
+ path:"/fillProgress?id="+row.id
})
},
}
--
Gitblit v1.9.2