提交代码

dev_xds
姜玉琦 2023-10-18 00:47:40 +08:00
parent 8d5d3ce124
commit 467a91a440
2 changed files with 229 additions and 55 deletions

View File

@ -105,12 +105,13 @@
</el-table-column>
<el-table-column label="所属项目" align="center" prop="problemArea" width="180">
<template slot-scope="scope">
<div v-if="scope.row.problemArea!=null">{{scope.row.problemArea}}</div>
<div v-if="scope.row.id!=null">{{scope.row.problemArea}}</div>
<el-select
v-if="scope.row.problemArea==null"
v-if="scope.row.id==null"
v-model="scope.row.projectId"
placeholder="请选择所属项目"
filterable
@change="changeProject($event,scope.row)"
>
<el-option
v-for="(item, index) in projectOptions"
@ -534,46 +535,54 @@ export default {
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.lordSent = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
});
});
},
selectCopySendUser(val,row){
let data=[];
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.copySendUser
row.copySend = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
});
});
},
selectRecheckSendUser(val,row){
let data=[];
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.recheckSend = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
});
});
},
/** 数据同步 */
dataSynchronization(){
@ -606,7 +615,7 @@ export default {
lordSentUser: null,
copySend: null,
copySendUser: null,
checkState: null,
checkState: 0,
nickedArea: null,
nickedTime: null,
projectType: null,
@ -616,10 +625,30 @@ export default {
createUser:this.$store.getters.name,
createUserName:this.$store.getters.nickname,
createUserDeptName:this.$store.getters.dept.deptName,
createTime:new Date(),
createTime:this.$dt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
isDel: 0
}
this.smzSspProblemmodifyDraftList.push(row);
this.$notify({
title: '新增成功',
message: '已新增一行新数据,提交后生效!',
type: 'success'
});
},
changeProject(val,row){
if(!this.projectIds.includes(val)){
this.projectIds.push(row.projectId);
this.$api.publics.selectProjectAllUnitUser({projectId: val})
.then((d) => {
this.projectUnitUsers.push({projectId:val,data:d.data});
});
}
for(let i=0;i<this.projectOptions.length;i++){
if(this.projectOptions[i].projectId==val){
row.problemArea = this.projectOptions[i].projectName;
break;
}
}
}
}
};

View File

@ -48,20 +48,81 @@
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
<el-button type="success" icon="el-icon-finished" size="mini" @click="batchSubmitForm" :disabled="multiple" >批量提交</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['trouble:sspMarks:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-sort"
size="mini"
@click="dataSynchronization"
:disabled="single"
v-hasPermi="['trouble:sspMarks:add']"
>数据同步</el-button>
</el-col>
<el-col :span="1.5">
<el-tooltip content="Top center" placement="批量提交选择的数据!">
<el-button
type="success"
plain
icon="el-icon-finished"
size="mini"
@click="batchSubmitForm"
:disabled="multiple"
v-hasPermi="['trouble:sspMarks:add']"
>批量提交</el-button>
</el-tooltip>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-alert title="操作说明" class="tips">
<template slot='title'>
<div><strong>数据同步:</strong>将选中行的数据同步到当前项目的其它行</div>
<div><strong>批量提交:</strong>将选中行的数据数据验证通过后一次全部提交</div>
</template>
</el-alert>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-table v-loading="loading" :data="smzSspProblemmodifyDraftList" :row-class-name="rowIndex" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="问题图片" align="center" prop="smarkUrl" width="240">
<el-table-column label="问题图片" header-align="center" align="left" prop="smarkUrl" width="240">
<template slot-scope="scope">
<image-upload v-model="scope.row.smarkUrl" :limit="9" :isShowTip="false" />
</template>
</el-table-column>
<el-table-column label="所属项目" align="center" prop="problemArea" width="150"/>
<el-table-column label="所属项目" align="center" prop="problemArea" width="180">
<template slot-scope="scope">
<div v-if="scope.row.id!=null">{{scope.row.problemArea}}</div>
<el-select
v-if="scope.row.id==null"
v-model="scope.row.projectId"
placeholder="请选择所属项目"
filterable
@change="changeProject($event,scope.row)"
>
<el-option
v-for="(item, index) in projectOptions"
:key="index"
:label="item.projectName"
:value="item.id"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="隐患类型" align="center" prop="dangerType" width="170">
<template slot-scope="scope">
<el-select
@ -382,10 +443,6 @@ export default {
this.$message.error("请选择整改截至时间!");
return false;
}
if(row.lordSent==row.copySend){
this.$message.error("整改人和抄送人不能是同一人!");
return false;
}
if(row.lordSent==row.recheckSend){
this.$message.error("整改人和复检人不能是同一人!");
return false;
@ -404,43 +461,39 @@ export default {
for(let i=0;i<indexs.length;i++){
let row = this.smzSspProblemmodifyDraftList[(indexs[i]-1)];
if(!row.smarkUrl){
this.$message.error("请上传隐患图片!");
this.$message.error("第"+indexs[i]+"行请上传隐患图片!");
return false;
}
if(!row.dangerType){
this.$message.error("请选择隐患类型!");
this.$message.error("第"+indexs[i]+"行请选择隐患类型!");
return false;
}
if(!row.workParts){
this.$message.error("请输入施工部位!");
this.$message.error("第"+indexs[i]+"行请输入施工部位!");
return false;
}
if(!row.changeInfo){
this.$message.error("请输入整改要求!");
this.$message.error("第"+indexs[i]+"行请输入整改要求!");
return false;
}
if(!row.lordSent || !row.lordSentUser){
this.$message.error("请选择整改人!");
this.$message.error("第"+indexs[i]+"行请选择整改人!");
return false;
}
if(!row.copySend || !row.copySendUser){
this.$message.error("请选择抄送人!");
this.$message.error("第"+indexs[i]+"行请选择抄送人!");
return false;
}
if(!row.recheckSend || !row.recheckSendUser){
this.$message.error("请选择复检人!");
this.$message.error("第"+indexs[i]+"行请选择复检人!");
return false;
}
if(!row.nickedTime || !row.nickedTime){
this.$message.error("请选择整改截至时间!");
return false;
}
if(row.lordSent==row.copySend){
this.$message.error("整改人和抄送人不能是同一人!");
this.$message.error("第"+indexs[i]+"行请选择整改截至时间!");
return false;
}
if(row.lordSent==row.recheckSend){
this.$message.error("整改人和复检人不能是同一人!");
this.$message.error("第"+indexs[i]+"行整改人和复检人不能是同一人!");
return false;
}
rows.push(row);
@ -456,12 +509,22 @@ export default {
handleDelete(row) {
const ids = row.id || this.ids;
const indexs = row.index || this.index;
if(this.smzSspProblemmodifyDraftList[indexs-1].id){
this.$modal.confirm('是否确认删除隐患问题编号为"' + indexs + '"的数据项?').then(function() {
return delSmzSspProblemmodifyDraft(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}else{
let that = this;
//
this.$modal.confirm('是否确认删除隐患问题编号为"' + indexs + '"的数据项?').then(function() {
that.smzSspProblemmodifyDraftList.splice(indexs-1,1);
}).then(() => {
that.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
},
/** 行内序号 */
rowIndex({ row, rowIndex }) {
@ -472,47 +535,121 @@ export default {
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.lordSent = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
});
});
},
selectCopySendUser(val,row){
let data=[];
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.copySendUser
row.copySend = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
});
});
},
selectRecheckSendUser(val,row){
let data=[];
for(let i=0;i<this.projectUnitUsers.length;i++){
if(this.projectUnitUsers[i].projectId==row.projectId){
data = this.projectUnitUsers[i].data;
break;
}
}
data.forEach((item) => {
item.userinfoList.forEach((u) => {
for(let i=0;i<data.length;i++){
for(let us=0;us<data[i].userinfoList.length;us++){
let u = data[i].userinfoList[us];
if (u.phonenumber == val) {
row.recheckSend = u.nickName + " [" + u.jobTypeName + "] ";
return false;
}
}
}
},
/** 数据同步 */
dataSynchronization(){
let indexs = this.indexs;
let data = this.smzSspProblemmodifyDraftList;
let row = data[(indexs-1)];
for(let i=0;i<data.length;i++){
if(data[i].index!=row.index && data[i].projectId == row.projectId){
data[i].lordSent = row.lordSent;
data[i].lordSentUser = row.lordSentUser;
data[i].copySend = row.copySend;
data[i].copySendUser = row.copySendUser;
data[i].recheckSend = row.recheckSend;
data[i].recheckSendUser = row.recheckSendUser;
data[i].nickedTime = row.nickedTime;
}
}
this.smzSspProblemmodifyDraftList = data;
},
handleAdd(){
let row = {
index:this.smzSspProblemmodifyDraftList.length+1,
id: null,
projectId: this.projectOptions.length==1?this.projectOptions[0].id:null,
infoType: "1",
problemArea: this.projectOptions.length==1?this.projectOptions[0].projectName:null,
workParts: null,
changeInfo: null,
lordSent: null,
lordSentUser: null,
copySend: null,
copySendUser: null,
checkState: 0,
nickedArea: null,
nickedTime: null,
projectType: null,
processName: null,
projectName: null,
nickedInfo: null,
createUser:this.$store.getters.name,
createUserName:this.$store.getters.nickname,
createUserDeptName:this.$store.getters.dept.deptName,
createTime:this.$dt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
isDel: 0
}
this.smzSspProblemmodifyDraftList.push(row);
this.$notify({
title: '新增成功',
message: '已新增一行新数据,提交后生效!',
type: 'success'
});
},
changeProject(val,row){
if(!this.projectIds.includes(val)){
this.projectIds.push(row.projectId);
this.$api.publics.selectProjectAllUnitUser({projectId: val})
.then((d) => {
this.projectUnitUsers.push({projectId:val,data:d.data});
});
}
for(let i=0;i<this.projectOptions.length;i++){
if(this.projectOptions[i].projectId==val){
row.problemArea = this.projectOptions[i].projectName;
break;
}
}
}
}
};
</script>
@ -530,4 +667,12 @@ export default {
padding-left: 0px !important;
margin-left: 0px !important;
}
.tips{
padding: 8px 16px;
background-color: #ecf8ff !important;
border-radius: 4px;
border-left: 5px solid #50bfff;
margin: 20px 0;
color:#666666 !important;
}
</style>