Admin
2022-12-05 f88488f015dcf63eeb18a1e285d87250c433b6a1
新增有效期限
已修改2个文件
237 ■■■■ 文件已修改
src/views/selfCheck/index.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialCheck/components/sendWork.vue 211 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/selfCheck/index.vue
@@ -29,14 +29,14 @@
                <el-table-column label="整改情况" prop="rectifyStatus" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <span v-if="scope.row.rectifyStatus==0">无需整改</span>
                        <el-button v-else-if="scope.row.rectifyStatus==1 && unitType==-1" type="text" @click="toRepair(scope.row)">去整改</el-button>
                        <el-button v-else-if="scope.row.rectifyStatus==1" type="text" @click="toRepair(scope.row)">去整改</el-button>
                        <span v-else-if="scope.row.rectifyStatus==2">已整改</span>
                        <span v-else>--</span>
                    </template>
                </el-table-column>
                <el-table-column label="详情" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button v-if="scope.row.selfcheckStatus == 0 && unitType==-1" type="text" @click="toReport(scope.row)">自查填报</el-button>
                        <el-button v-if="scope.row.selfcheckStatus == 0" type="text" @click="toReport(scope.row)">自查填报</el-button>
                        <el-button v-else type="text" @click="toDetail(scope.row)">查看详情</el-button>
                    </template>
                </el-table-column>
@@ -86,12 +86,12 @@
                pageTotal: 0,
                currentPage: 1,
                tableKey: 0,
                unitType: null,
                checkData: []
            }
        },
        created() {
            const t = this
            // t.getCheckUnitType()
            t.getUncheckList()
        },
        mounted() {
@@ -114,15 +114,17 @@
                this.getUncheckList()
            },
            async getCheckUnitType(){
                const t = this
                let res = await getCheckUnitType()
                if(res.data.code === "200"){
                    t.unitType = res.data.result.checkUnitType
                }else{
                    t.unitType = -1
                }
            },
            // async getCheckUnitType(){
            //     const t = this
            //     console.log(t.unitType,5555555)
            //     let res = await getCheckUnitType()
            //     if(res.data.code === "200"){
            //         t.unitType = res.data.result.checkUnitType
            //     }else{
            //         t.unitType = -1
            //     }
            //     console.log(t.unitType,66666666)
            // },
            toReport(row){
                const t = this
src/views/specialCheck/components/sendWork.vue
@@ -6,27 +6,26 @@
        :close-on-click-modal="false"
        width="60%"
        center
        :show-close="false"
        @close="resetForm('workForm')"
    >
        <el-upload
            class="upload-demo"
            action
            :http-request="uploadFile"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-upload="beforeUpload"
            :before-remove="beforeRemove"
            multiple
            :limit="1"
            :on-exceed="handleExceed"
            accept=".pdf, .doc, .docx"
            :file-list="fileList">
            <div style="display: flex;align-items: center">
                <el-button type="primary" style="margin-right: 80px">检查内容上传</el-button>
                <div slot="tip" class="el-upload__tip">只能上传doc/docx文件</div>
            </div>
        </el-upload>
<!--        <el-upload-->
<!--            class="upload-demo"-->
<!--            action-->
<!--            :http-request="uploadFile"-->
<!--            :on-preview="handlePreview"-->
<!--            :on-remove="handleRemove"-->
<!--            :before-upload="beforeUpload"-->
<!--            :before-remove="beforeRemove"-->
<!--            multiple-->
<!--            :limit="1"-->
<!--            :on-exceed="handleExceed"-->
<!--            accept=".pdf, .doc, .docx"-->
<!--            :file-list="fileList">-->
<!--            <div style="display: flex;align-items: center">-->
<!--                <el-button type="primary" style="margin-right: 80px">检查内容上传</el-button>-->
<!--                <div slot="tip" class="el-upload__tip">只能上传doc/docx文件</div>-->
<!--            </div>-->
<!--        </el-upload>-->
        <el-form :model="workForm" :rules="rules" ref="workForm" label-width="80px">
            <el-form-item label="专项检查任务名称:" label-width="180px" prop="taskName">
                <el-input v-model="workForm.taskName"></el-input>
@@ -182,7 +181,7 @@
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button type="warning" @click="cancleSend" plain>取消</el-button>
<!--          <el-button type="warning" @click="cancleSend" plain>取消</el-button>-->
          <el-button @click="resetForm('workForm')">重置</el-button>
          <el-button type="primary" v-stop-re-click @click="confirmSend('workForm')">确认下发</el-button>
        </span>
@@ -191,14 +190,12 @@
<script>
    import {computePageCount} from "@/utils";
    import{sendCheckTask, uploadFile, delateFile} from "@/api/specialCheck"
    import{sendCheckTask} from "@/api/specialCheck"
    export default {
        name: "sendWork",
        data(){
            return{
                dialogVisible:false,
                fileList: [],
                fileType: ['pdf','doc','docx'],
                workForm: {
                    taskName: '',
                    provinceWholesaleCheckTarget: null,
@@ -215,8 +212,7 @@
                    areaWholesaleCheckDeadline: '',
                    areaRetailCheckTarget: null,
                    areaRetailCheckDeadline: '',
                    enterpriseSelfCheckDeadline: '',
                    taskDescFileName: null
                    enterpriseSelfCheckDeadline: ''
                },
                rules: {
                    taskName: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
@@ -240,33 +236,33 @@
        },
        methods:{
            //上传文件的事件
            async uploadFile(item){
                const t = this
                const loading = this.$loading({
                    lock: true,
                    text: '正在上传文件...',
                    spinner: 'el-icon-loading'
                });
                //上传文件的需要formdata类型;所以要转
                let FormDatas = new FormData()
                FormDatas.append('taskDescFile',item.file);
                const res = await uploadFile(FormDatas)
                if(res.data.code == '200'){
                    loading.close();
                    t.$message({
                        type:'success',
                        message: '上传成功'
                    })
                    t.fileList.push(item.file)
                    console.log(t.fileList,'fileList')
                    t.workForm.taskDescFileName = res.data.result
                }else{
                    loading.close();
                    t.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
            // async uploadFile(item){
            //     const t = this
            //     const loading = this.$loading({
            //         lock: true,
            //         text: '正在上传文件...',
            //         spinner: 'el-icon-loading'
            //     });
            //     //上传文件的需要formdata类型;所以要转
            //     let FormDatas = new FormData()
            //     FormDatas.append('taskDescFile',item.file);
            //     const res = await uploadFile(FormDatas)
            //     if(res.data.code == '200'){
            //         loading.close();
            //         t.$message({
            //             type:'success',
            //             message: '上传成功'
            //         })
            //         t.fileList.push(item.file)
            //         console.log(t.fileList,'fileList')
            //         t.workForm.taskDescFileName = res.data.result
            //     }else{
            //         loading.close();
            //         t.$message({
            //             type:'warning',
            //             message:res.data.message
            //         })
            //     }
                // axios({
                //     method: 'post',
                //     url: 'http://192.168.0.29:8100/checkTask/upload/taskDescFile',
@@ -285,9 +281,9 @@
                //         //this.handleSuccess();
                //     }
                // })
            },
            // },
            //上传文件之前
            beforeUpload(file){
            // beforeUpload(file){
                // const t = this
                // if (file.type != "" || file.type != null || file.type != undefined){
                //     //截取文件的后缀,判断文件类型
@@ -309,32 +305,32 @@
                //         return false;
                //     }
                // }
            },
            async handleRemove(file, fileList) {
                const t = this
                const res = await delateFile({taskDescFileName: t.workForm.taskDescFileName})
                if(res.data.code == '200'){
                    t.$message({
                        type:'success',
                        message: '删除成功'
                    })
                    t.fileList = []
                }else{
                    t.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
            },
            handlePreview(file) {
                console.log(file);
            },
            handleExceed(files, fileList) {
                this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
            },
            beforeRemove(file, fileList) {
                return this.$confirm(`确定移除 ${ file.name }?`);
            },
            // },
            // async handleRemove(file, fileList) {
            //     const t = this
            //     const res = await delateFile({taskDescFileName: t.workForm.taskDescFileName})
            //     if(res.data.code == '200'){
            //         t.$message({
            //             type:'success',
            //             message: '删除成功'
            //         })
            //         t.fileList = []
            //     }else{
            //         t.$message({
            //             type:'warning',
            //             message:res.data.message
            //         })
            //     }
            // },
            // handlePreview(file) {
            //     console.log(file);
            // },
            // handleExceed(files, fileList) {
            //     this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
            // },
            // beforeRemove(file, fileList) {
            //     return this.$confirm(`确定移除 ${ file.name }?`);
            // },
            confirmSend(formName){
                const t = this
                t.$refs[formName].validate((valid) => {
@@ -366,7 +362,7 @@
                                    message:res.data.message
                                })
                            }
                            t.fileList = []
                            // t.fileList = []
                            t.dialogVisible = false
                            t.$parent.getSpecialCheckTask();
                        }).catch(() => {
@@ -380,28 +376,28 @@
                    }
                });
            },
            cancleSend(){
               this.resetForm('workForm')
                this.dialogVisible = false
            },
            // cancleSend(){
            //    this.resetForm('workForm')
            //     this.dialogVisible = false
            // },
            async resetForm(formName) {
                const t = this
                if(t.workForm.taskDescFileName !== null){
                    const res = await delateFile({taskDescFileName: t.workForm.taskDescFileName})
                    if(res.data.code == '200'){
                        t.$message({
                            type:'success',
                            message: '已取消下发'
                        })
                    }else{
                        t.$message({
                            type:'warning',
                            message:res.data.message
                        })
                    }
                }
                // if(t.workForm.taskDescFileName !== null){
                //     const res = await delateFile({taskDescFileName: t.workForm.taskDescFileName})
                //     if(res.data.code == '200'){
                //         t.$message({
                //             type:'success',
                //             message: '已取消下发'
                //         })
                //     }else{
                //         t.$message({
                //             type:'warning',
                //             message:res.data.message
                //         })
                //     }
                // }
                t.$refs[formName].resetFields()
                t.fileList = []
                // t.fileList = []
            }
        },
    }
@@ -419,21 +415,6 @@
    .el-divider__text{
        background-color: #fafafa;
        color: #034EA2;
    }
    .upload-demo{
        margin-bottom: 20px;
        background: #fafafa;
        padding: 20px 15px;
        border-radius: 8px;
        .el-upload__tip{
            font-size: 14px;
            color: #999;
        }
        .el-upload-list{
            background-color: #ccc !important;
        }
    }
    .form-part{
        background: #fafafa;