Commit 17bd0157 authored by 13841799530's avatar 13841799530
Browse files

接口联调

parent 9095144c
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -66,8 +66,15 @@ export default {
  mounted() {},
  mounted() {},
  methods: {
  methods: {
     onSubmit(values) {
     onSubmit(values) {
         this.$toast.loading({
            message:'登录中...',
            forbidClick: true,
            loadingType: 'spinner',
            duration: 0
        })
        getFun('check/token',values).then((Response)=>{
        getFun('check/token',values).then((Response)=>{
            if(Response.code==0){
            if(Response.code==0){
                this.$toast.clear()
                postFun('mobile/user').then((Response2)=>{
                postFun('mobile/user').then((Response2)=>{
                    var userInfo={
                    var userInfo={
                        avatar:Response2.data.avatar,
                        avatar:Response2.data.avatar,
@@ -77,11 +84,6 @@ export default {
                    /* 存储用户信息 */
                    /* 存储用户信息 */
                    setUserInfo(userInfo)
                    setUserInfo(userInfo)
                })
                })
                this.$notify({
                    message:'登录成功',
                    background:'green',
                    duration: 1000
                })
                setToken(Response.data)
                setToken(Response.data)
                this.$router.push('/message-center')
                this.$router.push('/message-center')
            }
            }
+11 −2
Original line number Original line Diff line number Diff line
@@ -52,8 +52,18 @@ export default {
    methods: {
    methods: {
        list(){
        list(){
            this.checkedList=[]
            this.checkedList=[]
            this.$toast.loading({
                message:'加载中...',
                forbidClick: true,
                loadingType: 'spinner',
                duration: 0
            })
            getFun('check/carry/user/list').then((Response)=>{
            getFun('check/carry/user/list').then((Response)=>{
                this.$toast.clear()
                this.checkedList=Response.data
                this.checkedList=Response.data
            }).catch(()=>{
                this.$toast.clear()
                this.$toast.fail('加载失败,请稍后再试')
            })
            })
        },
        },
        onSearch(){
        onSearch(){
@@ -62,9 +72,8 @@ export default {
            })
            })
        },
        },
        cardLocation(item){
        cardLocation(item){
            console.log(item)
            sessionStorage.setItem('id',item.id)
            sessionStorage.setItem('id',item.id)
            this.$router.push('/problem')
            this.$router.push({name:'problem',params:{id:item.id}})//此id来判断是否加载问题上报新数据
        }
        }
    }
    }
}
}
+39 −23
Original line number Original line Diff line number Diff line
@@ -12,7 +12,7 @@
    <div>
    <div>
        <LHeader v-bind:text="text"></LHeader>
        <LHeader v-bind:text="text"></LHeader>
        <van-tabs v-model="active">
        <van-tabs v-model="active">
            <van-tab title="有限空间类">
            <van-tab  v-for="(item,index) in tableData"  :key="index" :title="item.title">
                <table border="1" cellspacing="0">
                <table border="1" cellspacing="0">
                    <thead>
                    <thead>
                        <tr>
                        <tr>
@@ -24,27 +24,27 @@
                        </tr>
                        </tr>
                    </thead>
                    </thead>
                    <tbody>
                    <tbody>
                        <tr v-for="(item,index) in list" :key="index">
                        <tr v-for="(item2,index2) in item.list" :key="index2">
                            <td align="center" v-text="index+1" style="width:10%" ></td>
                            <td align="center" v-text="index2+1" style="width:10%" ></td>
                            <td align="center" v-text="item.checkItem" style="width:15%"></td>
                            <td align="center" v-text="item2.checkItem" style="width:15%"></td>
                            <td align="center" v-text="item.checkContent" style="width:20%"></td>
                            <td align="center" v-text="item2.checkContent" style="width:20%"></td>
                            <td align="center" v-text="item.checkBasis" style="width:30%"></td>
                            <td align="center" v-text="item2.checkBasis" style="width:30%"></td>
                            <td align="center">
                            <td align="center">
                                <van-radio-group v-model="item.checkStatus" :disabled="item.isDisabled">
                                <van-radio-group v-model="item2.checkStatus" :disabled="item2.isDisabled">
                                    <van-radio name="0" >合格</van-radio>
                                    <van-radio name="0" >合格</van-radio>
                                    <van-radio name="1" @click="noGrage(item)" >不合格</van-radio>
                                    <van-radio name="1" @click="noGrage(item2)" >不合格</van-radio>
                                </van-radio-group>
                                </van-radio-group>
                            </td>
                            </td>
                        </tr>
                        </tr>
                    </tbody>
                    </tbody>
                </table>
                </table>
            </van-tab>
            </van-tab>
            <van-tab title="文明施工类">
            <!-- <van-tab title="文明施工类">
               
               
            </van-tab>
            </van-tab>
            <van-tab title="消防安全类">
            <van-tab title="消防安全类">
               
               
            </van-tab>
            </van-tab> -->
        </van-tabs>
        </van-tabs>
    </div>
    </div>
</template>
</template>
@@ -58,38 +58,54 @@ export default {
    },
    },
    data() {
    data() {
        return {
        return {
            tableData:[],
            id:'',
            list:[],
            list:[],
            active:0,
            active:0,
            text:'问题上报表',
            text:'问题上报表',
        }
        }
    },
    },
    mounted() {
    mounted() {
        if(this.$route.query.id){
            this.id=this.$route.query.id
        }
        this.init()
        this.init()
    },
    },
    methods: {
    methods: {
        init(){
        init(){
            this.list=[]
            this.list=[]
            getFun('check/carry/list/problem').then((Response)=>{
            this.$toast.loading({
                this.list=Response.data
                message:'加载中...',
                forbidClick: true,
                loadingType: 'spinner',
                duration: 0
            })
            getFun('check/carry/list/problem',{planId:this.id}).then((Response)=>{
                this.tableData=Response.data
                this.$toast.clear()
                //根据选择的合格状态来填入单选框禁用状态,'1'为禁用,'0'为启用
                //根据选择的合格状态来填入单选框禁用状态,'1'为禁用,'0'为启用
                this.list.forEach((item)=>{
                this.tableData.forEach((item)=>{
                    if(item.checkStatus=='1'){
                    item.list.forEach((item2)=>{
                        item.isDisabled=true
                        if(item2.checkStatus=='1'){
                    }else if(item.checkStatus=='0'){
                            item2.isDisabled=true
                        item.isDisabled=false
                        }else if(item2.checkStatus=='0'){
                            item2.isDisabled=false
                        }
                        }
                    })
                    })
                })
                })
                console.log(this.tableData)
            })
        },
        },
        noGrage(item){
        noGrage(item2){
            console.log(item2)
            //通过禁用状态来判断是否可以跳转
            //通过禁用状态来判断是否可以跳转
            if(item.isDisabled==false){
            if(item2.isDisabled==false){
                this.$router.push({
                this.$router.push({
                    name: 'list',
                    name: 'list',
                    query:{
                    query:{
                        checkitem:item.checkItem,//检查项目
                        checkitem:item2.checkItem,//检查项目
                        checkContent:item.checkContent,//检查内容
                        checkContent:item2.checkContent,//检查内容
                        checkBasis:item.checkBasis,//法律依据
                        checkBasis:item2.checkBasis,//法律依据
                    }
                    }
                })
                })
            }
            }
+35 −9
Original line number Original line Diff line number Diff line
@@ -19,9 +19,9 @@
            <div>检查地点:{{nums.address}}</div>
            <div>检查地点:{{nums.address}}</div>
        </div>
        </div>
        <div class="button-more">
        <div class="button-more">
            <van-button type="primary" round size="large" @click="problem">检查问题上报{{nums.TroubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="problem">检查问题上报{{nums.troubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="formwork">检查清单模板{{nums.addTroubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="formwork">检查清单模板{{nums.listNumber}}</van-button>
            <van-button type="primary" round size="large" @click="note">检查问题记录{{nums.listNumber}}</van-button>
            <van-button type="primary" round size="large" @click="note">检查问题记录{{nums.addTroubleNumber}}</van-button>
            <van-button type="primary" round size="large" @click="end">结束上报</van-button>
            <van-button type="primary" round size="large" @click="end">结束上报</van-button>
        </div>
        </div>
    </div>
    </div>
@@ -37,19 +37,39 @@ export default {
    },
    },
    data() {
    data() {
        return {
        return {
            id:'',
            nums:{},
            nums:{},
            text:'问题上报'
            text:'问题上报'
        }
        }
    },
    },
    mounted() {
    mounted() {
        //请求新数据
        if(this.$route.params.id){
            this.id=sessionStorage.getItem('id')
            this.init()
            this.init()
        }
        //缓存数据
        else if(sessionStorage.getItem('id')){
            this.id=sessionStorage.getItem('id')
            this.nums=JSON.parse(sessionStorage.getItem('nums'))
        }
    },
    },
    methods: {
    methods: {
        init(){
        init(){
            var id=sessionStorage.getItem('id')
            this.$toast.loading({
                message:'加载中...',
                forbidClick: true,
                loadingType: 'spinner',
                duration: 0
            })
            this.nums=[];
            this.nums=[];
            getFun('check/carry/count',{planId:id}).then((Response)=>{
            getFun('check/carry/count',{planId:this.id}).then((Response)=>{
                this.$toast.clear()
                this.nums=Response.data
                this.nums=Response.data
                sessionStorage.setItem('nums',JSON.stringify(this.nums))
            }).catch(()=>{
                this.$toast.clear()
                this.$toast.fail('加载失败,请稍后再试')
            })
            })
        },
        },
        end(){
        end(){
@@ -57,11 +77,17 @@ export default {
                title: '提示',
                title: '提示',
                message: '确定结束检查上报?',
                message: '确定结束检查上报?',
            }).then(()=>{
            }).then(()=>{
                postFun('check/carry/trouble/finish',{planId:this.id}).then((Response)=>{
                    this.$toast.clear()
                    this.$router.push('/checked')
                    this.$router.push('/checked')
                }).catch(()=>{
                    this.$toast.clear()
                    this.$toast.fail('加载失败,请稍后再试')
                })
            })
            })
        },
        },
        problem(){
        problem(){
            this.$router.push('/list')
            this.$router.push({name:'list',query:{id:this.id}})
        },
        },
        note(){
        note(){
            this.$router.push({
            this.$router.push({
@@ -72,7 +98,7 @@ export default {
            })
            })
        },
        },
        formwork(){
        formwork(){
            this.$router.push('/formwork')
            this.$router.push({name:'formwork',query:{id:this.id}})
        }
        }
    }
    }
}
}
+21 −5
Original line number Original line Diff line number Diff line
@@ -102,10 +102,14 @@ export default {
                { text:'平台应用事业前端组',value:3}, 
                { text:'平台应用事业前端组',value:3}, 
                { text:'项目经理部',value:4}],
                { text:'项目经理部',value:4}],
            text:'检查问题',
            text:'检查问题',
            jumpObj:{}
            jumpObj:{},
            id:'',
        }
        }
    },
    },
    mounted() {
    mounted() {
        if(this.$route.query.id){
            this.id=this.$route.query.id
        }
        if(this.$route.name=='list'&&this.$route.query.checkitem){
        if(this.$route.name=='list'&&this.$route.query.checkitem){
            this.problemName=this.$route.query.checkitem,//检查项目
            this.problemName=this.$route.query.checkitem,//检查项目
            this.problemDescribe=this.$route.query.checkContent,//检查内容
            this.problemDescribe=this.$route.query.checkContent,//检查内容
@@ -125,21 +129,33 @@ export default {
        onSubmit(value){
        onSubmit(value){
            console.log(value)
            console.log(value)
            var obj={
            var obj={
                planId:1,
                planId:this.id,
                title:value['问题名称'],//问题名称
                title:value['问题名称'],//问题名称
                address:value['问题位置'],//问题位置
                address:value['问题位置'],//问题位置
                deptId:this.valueId,//责任单位
                deptId:this.valueId,//责任单位
                context:value['问题描述'],//问题描述
                context:value['问题描述'],//问题描述
                checkBasis:value['法律依据']//法律依据
                checkBasis:value['法律依据']//法律依据
            }
            }
            console.log(obj)
            this.$dialog.confirm({
            this.$dialog.confirm({
                title: '提示',
                title: '提示',
                message: '确定提交检查问题?',
                message: '确定提交检查问题?',
            }).then(()=>{
            }).then(()=>{
                postFun('check/carry/trouble',value).then((Response)=>{
                this.$toast.loading({
                    
                    message:'提交中...',
                    forbidClick: true,
                    loadingType: 'spinner',
                    duration: 0
                })
                postFun('check/carry/trouble',obj).then((Response)=>{
                    this.$toast.clear()
                    this.$toast.success({
                        message:'提交成功',
                        duration: 2000
                    })
                    history.go(-1)
                    history.go(-1)
                }).catch(()=>{
                    this.$toast.clear()
                    this.$toast.fail('提交失败,请稍后再试')
                })
                })
            }).catch(()=>{
            }).catch(()=>{


Loading