|
|
@ -28,8 +28,8 @@ |
|
|
|
:file-list="item1.images" |
|
|
|
:limit=6 |
|
|
|
:on-preview="handlePictureCardPreview" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-success="handleAvatarSuccess" |
|
|
|
:on-remove="(file,fileList) =>handleRemove(file,fileList, index,0,2)" |
|
|
|
:on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,index1,2)" |
|
|
|
:on-error="handelError" |
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
style="width:480px"> |
|
|
@ -48,8 +48,8 @@ |
|
|
|
:before-remove="beforeFileRemove" |
|
|
|
:file-list="item1.files" |
|
|
|
:before-upload="beforeAvatarFileUpload" |
|
|
|
:on-remove="handleFileRemove" |
|
|
|
:on-success="handleAvatarFileSuccess" |
|
|
|
:on-remove="(file,fileList) =>handleFileRemove(file,fileList, index,0,2)" |
|
|
|
:on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,index1,2)" |
|
|
|
:on-error="handelError" |
|
|
|
:on-preview="handleFileCardPreview" |
|
|
|
style="width:480px"> |
|
|
@ -78,8 +78,8 @@ |
|
|
|
:file-list="item.images" |
|
|
|
:limit=6 |
|
|
|
:on-preview="handlePictureCardPreview" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-success="handleAvatarSuccess" |
|
|
|
:on-remove="(file,fileList) =>handleRemove(file,fileList, index,0,1)" |
|
|
|
:on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,0,1)" |
|
|
|
:on-error="handelError" |
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
style="width:480px"> |
|
|
@ -98,8 +98,8 @@ |
|
|
|
:before-remove="beforeFileRemove" |
|
|
|
:file-list="item.files" |
|
|
|
:before-upload="beforeAvatarFileUpload" |
|
|
|
:on-remove="handleFileRemove" |
|
|
|
:on-success="handleAvatarFileSuccess" |
|
|
|
:on-remove="(file,fileList) =>handleFileRemove(file,fileList, index,0,1)" |
|
|
|
:on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,0,1)" |
|
|
|
:on-error="handelError" |
|
|
|
:on-preview="handleFileCardPreview" |
|
|
|
style="width:480px"> |
|
|
@ -111,8 +111,8 @@ |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-form> |
|
|
|
<el-form-item label="关联网格:" prop="content" label-width="90px" style="font-weight:bold"> |
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm"> |
|
|
|
<el-form-item label="关联网格:" prop="grids" label-width="90px" style="font-weight:bold"> |
|
|
|
<el-select |
|
|
|
v-model="dataForm.grids" |
|
|
|
multiple |
|
|
@ -131,15 +131,16 @@ |
|
|
|
<el-form> |
|
|
|
<el-form-item style="margin-left:35px;"> |
|
|
|
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button> |
|
|
|
<el-button v-if="this.state === '0'" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
<el-button v-if="state === '2'" type="primary" @click="">初审</el-button> |
|
|
|
<el-button v-if="state === '3'" type="primary" @click="">验收</el-button> |
|
|
|
<el-button v-if="status === '0'" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
<el-button v-if="status === '1'" type="primary" @click="firstTrial()">初审</el-button> |
|
|
|
<el-button v-if="status === '2'" type="primary" @click="acceptance()">验收</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
<!-- 初审弹框 --> |
|
|
|
<trial v-if="trialVisible" ref="subpositioncheckinfoTrial" @refreshDataList="backToUserRelationList"></trial> |
|
|
|
<subpositioncheckinfo-trial v-if="trialVisible" ref="subpositioncheckinfoTrial" v-on:connectResponse="connectResponse"></subpositioncheckinfo-trial> |
|
|
|
<subpositioncheckinfo-acceptance v-if="acceptanceVisible" ref="subpositioncheckinfoAcceptance" v-on:connectResponse="connectResponse"></subpositioncheckinfo-acceptance> |
|
|
|
</el-card> |
|
|
|
</template> |
|
|
|
|
|
|
@ -148,6 +149,8 @@ import Cookies from "js-cookie"; |
|
|
|
import debounce from "lodash/debounce"; |
|
|
|
import MapSelect from "@/views/modules/workRecord/map-select"; |
|
|
|
import trial from "./subpositioncheckinfo-trial" |
|
|
|
import SubpositioncheckinfoTrial from './subpositioncheckinfo-trial' |
|
|
|
import SubpositioncheckinfoAcceptance from './subpositioncheckinfo-acceptance' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "kpisubpositiondetail", |
|
|
@ -159,8 +162,11 @@ export default { |
|
|
|
subDetail:[], |
|
|
|
files:[], |
|
|
|
images: [], |
|
|
|
infoId:'' |
|
|
|
}, |
|
|
|
options :[], |
|
|
|
trialVisible:false, |
|
|
|
acceptanceVisible:false, |
|
|
|
isAble:false, |
|
|
|
pageDisabled:false, |
|
|
|
gridIds:[], |
|
|
@ -179,15 +185,16 @@ export default { |
|
|
|
hideUpload: false, |
|
|
|
fileloading: false, |
|
|
|
checkDiction:[], |
|
|
|
state:'0', |
|
|
|
//出身弹框列表 |
|
|
|
trialVisible:false, |
|
|
|
status:'0', |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
grids: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
], |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -195,8 +202,8 @@ export default { |
|
|
|
created: function () { |
|
|
|
// this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}` |
|
|
|
// this.uploadFileUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadAllFile?token=${Cookies.get('token')}` |
|
|
|
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}` |
|
|
|
this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}` |
|
|
|
this.uploadUrl = `http://localhost:9094/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}` |
|
|
|
this.uploadFileUrl = `http://localhost:9094/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}` |
|
|
|
this.getOptions(); |
|
|
|
this.init(); |
|
|
|
|
|
|
@ -212,13 +219,11 @@ export default { |
|
|
|
methods: { |
|
|
|
init () { |
|
|
|
this.dataForm.id = this.$route.query.id |
|
|
|
this.state = this.$route.query.state === undefined? '0':this.$route.query.state; |
|
|
|
if (this.state === '1'){ |
|
|
|
this.status = this.$route.query.status === undefined? '0':this.$route.query.status; |
|
|
|
if (this.status === '1'){ |
|
|
|
this.isAble = true; |
|
|
|
this.pageDisabled = true; |
|
|
|
} |
|
|
|
// this.$route.query.id |
|
|
|
// '980b98f007278c1452867b7c208f3f75' |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.dataForm.id) { |
|
|
|
this.$http.get(`/kpi/subdetail/getInfogrid/${this.dataForm.id}`).then(({ data: res }) => { |
|
|
@ -235,6 +240,24 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// dialog回调函数 |
|
|
|
connectResponse (connectResponse) { |
|
|
|
this.backToUserRelationList() |
|
|
|
}, |
|
|
|
firstTrial () { |
|
|
|
this.trialVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.subpositioncheckinfoTrial.dataForm.infoId = this.dataForm.id |
|
|
|
this.$refs.subpositioncheckinfoTrial.init() |
|
|
|
}) |
|
|
|
}, |
|
|
|
acceptance () { |
|
|
|
this.acceptanceVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.subpositioncheckinfoAcceptance.dataForm.infoId = this.dataForm.id |
|
|
|
this.$refs.subpositioncheckinfoAcceptance.init() |
|
|
|
}) |
|
|
|
}, |
|
|
|
beforeAvatarUpload (file) { |
|
|
|
if (this.dataForm.length === 6) { |
|
|
|
this.$message.error('最多上传6张图片!') |
|
|
@ -253,7 +276,7 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
}, |
|
|
|
handleAvatarSuccess (res, file) { |
|
|
|
handleAvatarSuccess (res, file,fileList,index,index1,type) { |
|
|
|
this.loading = false |
|
|
|
this.isAble = false |
|
|
|
if (res === null || res.data === null || res.data.imgUrl === null) { |
|
|
@ -261,7 +284,14 @@ export default { |
|
|
|
this.handleErrorRemove(file) |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName }) |
|
|
|
if (type ===2){ |
|
|
|
this.checkDiction[index].childDiction[index1].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName }) |
|
|
|
}else { |
|
|
|
this.checkDiction[index].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, fileName: res.data.fileName }) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hideUpload = this.dataForm.images.length >= 6 |
|
|
|
}, |
|
|
|
handelError () { |
|
|
@ -280,14 +310,26 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
handleRemove (file, fileList) { |
|
|
|
for (var i = 0; i < this.dataForm.images.length; i++) { |
|
|
|
let item = this.dataForm.images[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.dataForm.images.splice(i, 1) |
|
|
|
handleRemove (file, fileList,index,index1,type) { |
|
|
|
if(type ===2){ |
|
|
|
for (var i = 0; i < this.checkDiction[index].childDiction[index1].images.length; i++) { |
|
|
|
let item = this.checkDiction[index].childDiction[index1].images[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.checkDiction[index].childDiction[index1].images.splice(i, 1) |
|
|
|
this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 |
|
|
|
} |
|
|
|
this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 |
|
|
|
} |
|
|
|
} |
|
|
|
this.hideUpload = this.dataForm.images.length >= 6 |
|
|
|
}else { |
|
|
|
for (var i = 0; i < this.checkDiction[index].images.length; i++) { |
|
|
|
let item = this.checkDiction[index].images[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.checkDiction[index].images.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
this.hideUpload = this.checkDiction[index].images.length >= 6 |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
handlePictureCardPreview (file) { |
|
|
|
this.dialogImageUrl = file.url |
|
|
@ -304,22 +346,38 @@ export default { |
|
|
|
} |
|
|
|
this.isAutoRemoveFile = true |
|
|
|
}, |
|
|
|
handleAvatarFileSuccess (res, file) { |
|
|
|
handleAvatarFileSuccess (res, file,fileList,index,index1,type) { |
|
|
|
this.fileloading = false |
|
|
|
this.isAble = false |
|
|
|
if (res === null || res.data === null || res.data.imgUrl === null) { |
|
|
|
this.$message.error('文件上传失败!') |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName, name: res.data.fileName }) |
|
|
|
if (type ===2){ |
|
|
|
this.checkDiction[index].childDiction[index1].files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName }) |
|
|
|
}else { |
|
|
|
this.checkDiction[index].files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName }) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleFileRemove (file, fileList) { |
|
|
|
for (var i = 0; i < this.dataForm.files.length; i++) { |
|
|
|
let item = this.dataForm.files[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.dataForm.files.splice(i, 1) |
|
|
|
handleFileRemove (file, fileList,index,index1,type) { |
|
|
|
if (type == 2){ |
|
|
|
for (var i = 0; i < this.checkDiction[index].childDiction[index1].files.length; i++) { |
|
|
|
let item = this.checkDiction[index].childDiction[index1].files[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.checkDiction[index].childDiction[index1].files.splice(i, 1) |
|
|
|
} |
|
|
|
this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 |
|
|
|
} |
|
|
|
}else { |
|
|
|
for (var i = 0; i < this.checkDiction[index].files.length; i++) { |
|
|
|
let item = this.checkDiction[index].files[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
this.checkDiction[index].images.splice(i, 1) |
|
|
|
} |
|
|
|
this.hideUpload = this.checkDiction[index].files.length >= 6 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
beforeAvatarFileUpload (file) { |
|
|
|
this.fileloading = true |
|
|
@ -375,11 +433,6 @@ export default { |
|
|
|
|
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
//初审 |
|
|
|
trial(){ |
|
|
|
this.trialVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
//封装考核内容提报详情表数据 |
|
|
@ -394,37 +447,32 @@ export default { |
|
|
|
//描述 |
|
|
|
console.log(j) |
|
|
|
let childDesribe = j.describe; |
|
|
|
//图片 |
|
|
|
let childUrl = j.images.url === undefined? [] :j.images.url; |
|
|
|
//缩略图 |
|
|
|
let thumbnail = j.images.thumbnail === undefined ? [] :j.images.thumbnail; |
|
|
|
//文件 |
|
|
|
let childFile =j.files.name === undefined ? [] : j.files; |
|
|
|
let childFile =j.files === [] ? [] : j.files; |
|
|
|
//图片 |
|
|
|
let childFileImage =j.images === [] ? [] : j.images; |
|
|
|
let littleId = j.id; |
|
|
|
let m = { |
|
|
|
id:j.infoId, |
|
|
|
pCheckItemName :bigId, |
|
|
|
checkItemName: littleId, |
|
|
|
desribe: childDesribe, |
|
|
|
imageUrl: childUrl, |
|
|
|
thumbnail:thumbnail, |
|
|
|
files: childFile |
|
|
|
files: childFile, |
|
|
|
images:childFileImage |
|
|
|
} |
|
|
|
subChild.push(m) |
|
|
|
} |
|
|
|
}else { |
|
|
|
let childDesribe = i.describe; |
|
|
|
let childUrl = i.images.url === undefined ?[]:i.images.url; |
|
|
|
let thumbnail = i.images.thumbnail === undefined ? [] :j.images.thumbnail; |
|
|
|
let childFile = i.files === undefined ?[]:i.files; |
|
|
|
let childFile = i.files === [] ?[]:i.files; |
|
|
|
let childFileImage =i.images === [] ? [] : i.images; |
|
|
|
let ai = { |
|
|
|
id:i.infoId, |
|
|
|
desribe:childDesribe, |
|
|
|
pCheckItemName :bigId, |
|
|
|
checkItemName: '', |
|
|
|
imageUrl :childUrl, |
|
|
|
thumbnail:thumbnail, |
|
|
|
files:childFile |
|
|
|
files:childFile, |
|
|
|
images:childFileImage |
|
|
|
} |
|
|
|
subChild.push(ai) |
|
|
|
} |
|
|
@ -449,7 +497,8 @@ export default { |
|
|
|
}, |
|
|
|
components: { |
|
|
|
MapSelect, |
|
|
|
trial |
|
|
|
SubpositioncheckinfoTrial, |
|
|
|
SubpositioncheckinfoAcceptance |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|