Browse Source

Merge remote-tracking branch 'origin/feature/subCheck' into feature/subCheck

master
wanggongfeng 5 years ago
parent
commit
73336179bd
  1. 167
      src/views/modules/kpi/kpisubpositiondetail.vue
  2. 36
      src/views/modules/kpi/subpositioncheckinfo-acceptance.vue
  3. 1
      src/views/modules/kpi/subpositioncheckinfo-trial.vue
  4. 20
      src/views/modules/kpi/subpositioncheckinfo.vue

167
src/views/modules/kpi/kpisubpositiondetail.vue

@ -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>

36
src/views/modules/kpi/subpositioncheckinfo-acceptance.vue

@ -1,13 +1,7 @@
<template>
<el-dialog :visible.sync="visible" :title="'处理'" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<!-- <el-form-item label="审批状态" prop="checkResult" label-width="80px">-->
<!-- <el-select v-model="dataForm.checkResult" placeholder="请选择" clearable>-->
<!-- <el-option label="通过" value="3"> </el-option>-->
<!-- <el-option label="驳回" value="4"> </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="验收内容" prop="checkOpinion" style="overflow:hidden;">
<el-form-item label="验收内容" style="overflow:hidden;">
<template>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="checkedItems" @change="handleCheckedCitiesChange">
@ -17,12 +11,19 @@
</el-checkbox-group>
</template>
</el-form-item>
<el-form-item label="审批" prop="checkResult" label-width="80px" >
<el-radio-group v-model="dataForm.checkResult">
<el-radio :label="3">通过</el-radio>
<el-radio :label="4">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="验收理由" prop="checkOpinion">
<el-input
type="textarea"
:rows="3"
v-model="dataForm.checkOpinion"
maxlength="200"
placeholder="请填写验收理由,200字以内"
style="width:calc(100% - 110px)"></el-input>
</el-form-item>
</el-form>
@ -46,7 +47,9 @@ export default {
},
acceptanceArray:[],
checkedItems:[],
isAble: false
isAble: false,
checkedCount:'',
allCount:''
}
},
computed: {
@ -71,6 +74,7 @@ export default {
init () {
this.visible = true
this.isAble = false
this.checkedItems = []
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.infoId) {
@ -84,9 +88,7 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log(this.dataForm);
this.acceptanceArray = res.data
console.log(this.dataForm);
}).catch(() => {})
},
handleCheckAllChange(val) {
@ -94,18 +96,20 @@ export default {
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
let allLength = this.acceptanceArray.length;
if(checkedCount != allLength){
console.log("未全选");
}
},
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
//
this.allLength = this.acceptanceArray.length;
if(this.dataForm.checkResult===3 && this.checkedItems.length != this.allLength){
this.$message('通过请全选后提交!');
return false
}
this.isAble = true
this.$http['post']('/kpi/subpositioncheckinfo/acceptance', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {

1
src/views/modules/kpi/subpositioncheckinfo-trial.vue

@ -13,6 +13,7 @@
:rows="3"
v-model="dataForm.checkOpinion"
maxlength="200"
placeholder="请填写审核理由,200字以内"
style="width:calc(100% - 110px)"></el-input>
</el-form-item>
</el-form>

20
src/views/modules/kpi/subpositioncheckinfo.vue

@ -47,7 +47,7 @@
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('kpi:subpositioncheckinfo:add')" type="primary" @click="addHandle(null,null)">{{ $t('add') }}</el-button>
<el-button v-if="$hasPermission('kpi:subpositioncheckinfo:add')" type="primary" @click="addNewRecord()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('kpi:subpositioncheckinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
@ -68,10 +68,10 @@
<el-table-column prop="approvalTime" label="审批时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addHandle(scope.row.id,scope.row.status)">{{ '查看' }}</el-button>
<el-button v-if="scope.row.delShow" type="text" size="small" @click="openHandle(scope.row.id)">{{ '修改' }}</el-button>
<el-button v-if="$hasPermission('sub:check:tiral') && scope.row.status==='1'" type="text" size="small" @click="firstTrial(scope.row.id)">{{ '初审' }}</el-button>
<el-button v-if="$hasPermission('sub:check:acceptance') && scope.row.status==='2'" type="text" size="small" @click="acceptance(scope.row.id)">{{ '验收' }}</el-button>
<el-button type="text" size="small" @click="addHandle(scope.row.id,'1')">{{ '查看' }}</el-button>
<el-button v-if="scope.row.delShow" type="text" size="small" @click="updateHandle(scope.row.id)">{{ '修改' }}</el-button>
<el-button v-if="$hasPermission('sub:check:tiral') && scope.row.status==='1'" type="text" size="small" @click="addHandle(scope.row.id,scope.row.status)">{{ '初审' }}</el-button>
<el-button v-if="$hasPermission('sub:check:acceptance') && scope.row.status==='2'" type="text" size="small" @click="addHandle(scope.row.id,scope.row.status)">{{ '验收' }}</el-button>
<el-button v-if="scope.row.delShow" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ '删除' }}</el-button>
<!-- <el-button v-if="$hasPermission('kpi:subpositioncheckinfo:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>-->
<!-- <el-button v-if="$hasPermission('kpi:subpositioncheckinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>-->
@ -149,7 +149,7 @@ export default {
this.options = res.data.options
})
.catch(() => { })
this.initTime()
this.getDataList()
},
components: {
AddOrUpdate,
@ -170,6 +170,14 @@ export default {
this.$parent.selectComponent = 'Kpisubpositiondetail'
this.$router.push({ path: '/kpi-subpositioncheckinforoute', query: { id: id, status: status } })
},
addNewRecord () {
this.$parent.selectComponent = 'Kpisubpositiondetail'
this.$router.push({ path: '/kpi-subpositioncheckinforoute'})
},
updateHandle (id) {
this.$parent.selectComponent = 'Kpisubpositiondetail'
this.$router.push({ path: '/kpi-subpositioncheckinforoute', query: { id: id } })
},
firstTrial (infoId) {
this.trialVisible = true
this.$nextTick(() => {

Loading…
Cancel
Save