Browse Source

删除,新增

feature
mk 1 year ago
parent
commit
6ba91207de
  1. 177
      src/views/modules/resourceManagement/enterprise/addForm.vue
  2. 2
      src/views/modules/resourceManagement/enterprise/index.vue

177
src/views/modules/resourceManagement/enterprise/addForm.vue

@ -102,29 +102,36 @@
</el-row> </el-row>
<el-row style="margin-top: 15px;"> <el-row style="margin-top: 15px;">
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">{{item.flag?'已整改隐患':'隐患明细'}}: </span> <el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">{{item.flag?'已整改隐患':'隐患明细'}}: </span>
<div v-if="item.hazardDetails"> <div v-if="item.hiddenDangeList">
<p style="margin-left: 60px;" v-for="(itemC,index) in item.hazardDetails.filter(item=>item.hazardStatus ==1)" >{{index+1}}.{{itemC.hazardDesc}}</p> <p style="margin-left: 60px;" v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus ==1)" >{{index+1}}.{{itemC.hazardDesc}}</p>
</div> </div>
<span>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 15px;" v-if="item.flag"> <el-row style="margin-top: 15px;" v-if="item.flag">
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">未整改隐患: </span> <el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">未整改隐患: </span>
<div v-if="item.hazardDetails"> <div v-if="item.hiddenDangeList">
<p style="margin-left: 60px;" v-for="(itemC,index) in item.hazardDetails.filter(item=>item.hazardStatus == 0)" >{{index+1}}.{{itemC.hazardDesc}}</p> <p style="margin-left: 60px;" v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus == 0)" >{{index+1}}.{{itemC.hazardDesc}}</p>
</div> </div>
<span>--</span> <span v-else>--</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 15px;" v-else> <el-row style="margin-top: 15px;" v-else>
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">整改要求: </span> <el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">整改要求: </span>
<p style="margin-left: 60px;">{{index+1}}.{{item.hazardDetails.find(item=>item.hazardStatus == 2).hazardDesc}}</p> <p style="margin-left: 60px;">{{index+1}}.{{item.hiddenDangeList.find(item=>item.hazardStatus == 2).hazardDesc}}</p>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 15px;"> <el-row style="margin-top: 15px;">
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">附件: </span>{{ <el-col :span="6" style="padding-left: 65px;">
item.attachmentUrl }}</el-col> <span style="color: #888; ">附件: </span>
<span v-for="(itemI,indexI) in item.attachmentUrls" :key="itemI.fileName" style="margin-right:10px;cursor:pointer" @click="handelCLickImage(itemI.attachmentUrl)">{{
itemI.fileName }}
</span>
<div class="imagePreview" v-if="preViewImageFlag" @click="preViewImageFlag = false">
<img :src="preViewImage" alt="">
</div>
</el-col>
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">备注: </span>{{ <el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">备注: </span>{{
item.remark || '--' }}</el-col> item.remark || '--' }}</el-col>
</el-row> </el-row>
@ -140,7 +147,8 @@
<el-form-item label="巡查时间" prop="checkTime"> <el-form-item label="巡查时间" prop="checkTime">
<el-date-picker class="list_item_width_1" size="small" <el-date-picker class="list_item_width_1" size="small"
v-model.trim="patrolForm.checkTime" type="datetime" v-model.trim="patrolForm.checkTime" type="datetime"
format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
@ -169,25 +177,26 @@
<el-form-item label="拟复查时间" prop="reviewTime"> <el-form-item label="拟复查时间" prop="reviewTime">
<el-date-picker class="list_item_width_1" size="small" <el-date-picker class="list_item_width_1" size="small"
v-model.trim="patrolForm.reviewTime" type="datetime" v-model.trim="patrolForm.reviewTime" type="datetime"
format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker> value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="checkResultFlag !== 1"> <el-row v-if="checkResultFlag !== 1">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="隐患明细" prop="principalName" style="white-space: nowrap;overflow: hidden;"> <el-form-item label="隐患明细" prop="hiddenDange" style="white-space: nowrap;overflow: hidden;">
<el-radio-group v-model="hazardDetails" size="small"> <el-checkbox-group v-model="hiddenDangeArr" size="small" >
<el-col v-for="option in checkboxOptions" :key="option.value"> <el-col v-for="option in checkboxOptions" :key="option.value">
<el-checkbox :label="option.value">{{ option.label }}</el-checkbox> <el-checkbox :label="option.value">{{ option.hazardDesc }}</el-checkbox>
</el-col> </el-col>
</el-radio-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row > <el-row >
<el-col :span="18" v-for="(item, index) in inputList" :key="index" style="margin-left: 100px;"> <el-col :span="18" v-for="(item, index) in inputList" :key="index" style="margin-left: 100px;">
<el-form-item label="" prop="textarea" class="input-container"> <el-form-item label="" prop="textarea" class="input-container">
<el-input v-model="item.value" rows="3" placeholder="请输入隐患信息" size="small" class="list_item_width_1"></el-input> <el-input v-model="item.hazardDesc" rows="3" placeholder="请输入隐患信息" size="small" class="list_item_width_1"></el-input>
</el-form-item> </el-form-item>
<el-button @click="removeInput(index)" v-if="inputList.length > 1" <el-button @click="removeInput(index)" v-if="inputList.length > 1"
class="remove-button"> class="remove-button">
@ -198,7 +207,7 @@
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="checkResultFlag === 1"> <el-row v-if="checkResultFlag === 1 || tableData.length === 0">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="整改意见" prop="principalName" style="white-space: nowrap;overflow: hidden;"> <el-form-item label="整改意见" prop="principalName" style="white-space: nowrap;overflow: hidden;">
<el-input v-model="patrolForm.rectificationOpinion" rows="3" size="small" placeholder="请输入整改意见" ></el-input> <el-input v-model="patrolForm.rectificationOpinion" rows="3" size="small" placeholder="请输入整改意见" ></el-input>
@ -208,8 +217,7 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="附件"> <el-form-item label="附件">
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList" <upload-image :defaultFileList="fileList" :limit="3" @change="onChangeFileList"></upload-image>
v-if="true"></upload-image>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
@ -297,90 +305,19 @@ export default {
return { return {
orgOptions:[], orgOptions:[],
orgOptionProps, orgOptionProps,
inputList: [{ value: '' }],// inputList: [{ hazardDesc: '',hazardStatus:'0' }],//
fileList:[], fileList:[],
patrolAdd: false, patrolAdd: false,
checkboxOptions: [ checkboxOptions: [],
{ label: 'Option 1', value: 'option1' }, hiddenDangeArr:[],
{ label: 'Option 2', value: 'option2' },
{ label: '已整改患', value: '已整改隐患' },
],
hazardDetails:[],
tableData: [ tableData: [],
// {
// checkTime: '2019-04-22 09:30',
// checkPersons: '',
// checkResultFlag: '',
// reviewTime: '2019-04-22 09:30',
// hazardDetails:[
// {
// "id": "hd1111",
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "companyId": "c1111",
// "recordId": "r1111",
// "hazardStatus": 0,
// "hazardDesc": "",
// "delFlag": null,
// "revision": 0,
// "createdBy": "zxc",
// "createdTime": "2024-05-03 16:26:37",
// "updatedBy": "zxc",
// "updatedTime": "2024-05-03 16:26:49"
// },
// {
// "id": "hd1112",
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "companyId": "c1111",
// "recordId": "r1111",
// "hazardStatus": 1,
// "hazardDesc": "",
// "delFlag": null,
// "revision": 2,
// "createdBy": "zxc",
// "createdTime": "2024-05-03 16:26:37",
// "updatedBy": "zxc",
// "updatedTime": "2024-05-03 16:26:49"
// },
// {
// "id": "hd1113",
// "customerId": "45687aa479955f9d06204d415238f7cc",
// "companyId": "c1111",
// "recordId": "r1111",
// "hazardStatus": 2,
// "hazardDesc": "",
// "delFlag": null,
// "revision": 0,
// "createdBy": "zxc",
// "createdTime": "2024-05-03 16:26:37",
// "updatedBy": "zxc",
// "updatedTime": "2024-05-03 16:26:49"
// }
// ],
// attachmentUrl: '123456789.jPg',
// remark: ''
// },
// {
// checkTime: '2019-04-22 09:30',
// checkPersons: '',
// checkResultFlag: '',
// reviewTime: '2019-04-22 09:30',
// hazardDetails:[
// {
// hazardStatus:1,
// hazardDesc:'2'
// }
// ],
// attachmentUrl: '123456789.jPg',
// remark: ''
// },
],
btnDisable: false, btnDisable: false,
user: '', user: '',
agencyId: '', agencyId: '',
gridList: [], //list-- gridList: [], //list--
placeTypeList: [], // placeTypeList: [], //
resultArray: [{ value: '0', label: '合格' }, { value: '1', label: '不合格' }], resultArray: [{ value: '1', label: '合格' }, { value: '0', label: '不合格' }],
stafflist: [], stafflist: [],
formData: { formData: {
agencyId:'', agencyId:'',
@ -407,9 +344,9 @@ export default {
checkTime:null, checkTime:null,
checkPersonsIdList:null, checkPersonsIdList:null,
checkResultFlag:null, checkResultFlag:null,
attachmentUrls:[],
reviewTime:null, reviewTime:null,
hazardDetails:null, hiddenDangeList:null,
attachmentUrl:null,
remark:null, remark:null,
}, },
patrolRule:{ patrolRule:{
@ -420,7 +357,9 @@ export default {
}, },
// //
loading: false, loading: false,
searchOptions: [] searchOptions: [],
preViewImage:null,
preViewImageFlag:false
}; };
}, },
watch: {}, watch: {},
@ -447,6 +386,10 @@ export default {
}, },
methods: { methods: {
handelCLickImage(url){
this.preViewImageFlag = true;
this.preViewImage = url;
},
handleChangeAgency(val) { handleChangeAgency(val) {
this.formData.agencyId = val.length ? val[val.length - 1] : val[0]; this.formData.agencyId = val.length ? val[val.length - 1] : val[0];
}, },
@ -467,7 +410,7 @@ export default {
}) })
}, },
addInput() { addInput() {
this.inputList.push({ value: '' }); // this.inputList.push({ hazardDesc: '',hazardStatus:'0' }); //
}, },
removeInput(index) { removeInput(index) {
this.inputList.splice(index, 1); // this.inputList.splice(index, 1); //
@ -480,6 +423,7 @@ export default {
let ob = { let ob = {
fileType: item.raw.type, fileType: item.raw.type,
fileUrl: item.response.data.url, fileUrl: item.response.data.url,
attachmentUrl:item.response.data.url,
fileName:item.response.data.fileName fileName:item.response.data.fileName
} }
this.fileList.push(ob) this.fileList.push(ob)
@ -506,16 +450,21 @@ export default {
// //
async getCompanyDetail(){ async getCompanyDetail(){
const url = `/actual/base/companyInfo/showRecord`; const url = `/actual/base/companyInfo/showRecord`;
const { data, code, msg } = await requestPost(url,{id:this.detailId}); let { data, code, msg } = await requestPost(url,{id:this.detailId});
if (code === 0) { if (code === 0) {
data.forEach(item=>{ data.forEach(item=>{
if(!item.hiddenDangeList){ if(!item.hiddenDangeList){
item.flag = true; item.flag = true;
}else{ }else{
item.flag = item.hazardDetails.findIndex(item=>item.hazardStatus === 2) === -1; item.flag = item.hiddenDangeList.findIndex(item=>item.hazardStatus === 2) === -1;
} }
}) })
console.log(data); if(data[0].hiddenDangeList){
this.checkboxOptions = data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,value:item.id,hazardStatus:0}));
this.fileList = data[0].attachmentUrls;
console.log(this.fileList);
}
this.tableData = data; this.tableData = data;
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -575,8 +524,16 @@ export default {
}else if(this.pageType == 'patrol'){ }else if(this.pageType == 'patrol'){
url = '/actual/base/companyInfo/addRecord'; url = '/actual/base/companyInfo/addRecord';
params = { ...this.patrolForm }; params = { ...this.patrolForm };
for(let i in this.hiddenDangeArr){
this.checkboxOptions.forEach(item => {
if(item.value == this.hiddenDangeArr[i]){
item.hazardStatus = '1';
}
})
}
params.hiddenDangeList =[...this.inputList,...this.checkboxOptions] ;
params.companyId = this.detailId; params.companyId = this.detailId;
params.attachmentUrl = this.fileList[0]; params.attachmentUrls = this.fileList;
} }
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
@ -714,4 +671,18 @@ export default {
font-size: 16px; /* 设置圆点大小 */ font-size: 16px; /* 设置圆点大小 */
border: none; /* 去掉边框 */ border: none; /* 去掉边框 */
} }
.imagePreview {
width:100vw;
height:100vh;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index:5000;
background-color: rgba(12, 12, 12, 0.1);
display: flex;
align-items: center;
justify-content: center;
}
</style> </style>

2
src/views/modules/resourceManagement/enterprise/index.vue

@ -315,7 +315,7 @@ export default {
.catch(err => { }); .catch(err => { });
}, },
async del(id) { async del(id) {
const url = `/actual/base/companyInfo/deleteCompany`; const url = `/actual/base/companyInfo/delete`;
const { data, code, msg } = await requestPost(url, {id}); const { data, code, msg } = await requestPost(url, {id});
if (code === 0) { if (code === 0) {
this.$message.success('删除成功!'); this.$message.success('删除成功!');

Loading…
Cancel
Save