zhanghua
2024-03-31 2abaf1a68cc38303724d7aa74d2d3ed81af6466f
src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue
@@ -2,78 +2,136 @@
    <div class="book">
        <div class="book-title">文种书类</div>
        <div class="book-form">
            <el-form ref="bookForm" label-width="120px" :model="book" :rules="bookRules" autoComplete="on">
            <el-form
                ref="bookForm"
                label-width="120px"
                :model="book"
                :rules="bookRules"
                autoComplete="on"
            >
                <div class="book-item">
                    <!-- 文书种类 -->
                    <el-form-item label="文书种类:" prop="writType">
                        <el-select v-model="book.writType" placeholder="请输入文书种类">
                            <el-option v-for="item in kindList" :key="item.id" :label="item.name"
                                :value="item.id">
                        <el-select
                            v-model="book.writType"
                            placeholder="请输入文书种类"
                        >
                            <el-option
                                v-for="item in kindList"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 文书编号 -->
                    <el-form-item label="文书编号:" prop="writCode">
                        <el-input v-model="book.writCode" placeholder="请输入文书编号"></el-input>
                        <el-input
                            v-model="book.writCode"
                            placeholder="请输入文书编号"
                        ></el-input>
                    </el-form-item>
                </div>
                <!-- 违法类型 -->
                <el-form-item label="违法类型:" prop="illegalType" >
                    <el-input v-model="basecase" ></el-input>
                <el-form-item label="违法类型:" prop="illegalType">
                    <el-input v-model="basecase"></el-input>
                </el-form-item>
                <!-- 文书发放时间 -->
                <el-form-item label="文书发放时间:" prop="sendTime">
                    <el-date-picker v-model="book.sendTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择年月日">
                    <el-date-picker
                        v-model="book.sendTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择年月日"
                    >
                    </el-date-picker>
                </el-form-item>
                <!-- 文书限定时间 -->
                <el-form-item label="文书限定时间" prop="limitTime">
                    <el-date-picker v-model="book.limitTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择年月日">
                    <el-date-picker
                        v-model="book.limitTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择年月日"
                    >
                    </el-date-picker>
                </el-form-item>
                <!-- 文书发放内容 -->
                <el-form-item label="文书发放内容:" prop="sendContent">
                    <el-input v-model="book.sendContent" placeholder="请输入文书发放内容"></el-input>
                    <el-input
                        v-model="book.sendContent"
                        placeholder="请输入文书发放内容"
                    ></el-input>
                </el-form-item>
                <!-- 实际整改时间 -->
                <el-form-item label="实际整改时间:" prop="rectifyTime">
                    <el-date-picker v-model="book.rectifyTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择年月日">
                    <el-date-picker
                        v-model="book.rectifyTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择年月日"
                    >
                    </el-date-picker>
                </el-form-item>
                <!-- 整改情况 -->
                <el-form-item label="整改情况:" prop="rectifySituation">
                    <el-input v-model="book.rectifySituation" placeholder="请输入整改情况"></el-input>
                    <el-input
                        v-model="book.rectifySituation"
                        placeholder="请输入整改情况"
                    ></el-input>
                </el-form-item>
                <!-- 备注 -->
                <el-form-item label="备注:" prop="remark">
                    <el-input v-model="book.remark" placeholder="请输入备注"></el-input>
                    <el-input
                        v-model="book.remark"
                        placeholder="请输入备注"
                    ></el-input>
                </el-form-item>
                <!-- 文书照片上传 -->
                <el-form-item label="文书照片上传:" prop="writPic">
                    <div class="upImg">
                        <MyUpload  @setPictureUrl="writPic" @delPictureUrl="delWritPic" :picture-list="book.writPic"></MyUpload>
                        <div class="tip">{{book.writPic.length}} / 4</div>
                        <MyUpload
                            @setPictureUrl="writPic"
                            @delPictureUrl="delWritPic"
                            :picture-list="book.writPic"
                        ></MyUpload>
                        <div class="tip">{{ book.writPic.length }} / 4</div>
                    </div>
                </el-form-item>
                <!-- 整改前照片 -->
                <el-form-item label="整改前照片:" prop="originalPic">
                     <div class="upImg">
                        <MyUpload  @setPictureUrl="originalPic" @delPictureUrl="delOriginalPic" :picture-list="book.originalPic"></MyUpload>
                        <div class="tip">{{book.originalPic.length}} / 4</div>
                    <div class="upImg">
                        <MyUpload
                            @setPictureUrl="originalPic"
                            @delPictureUrl="delOriginalPic"
                            :picture-list="book.originalPic"
                        ></MyUpload>
                        <div class="tip">{{ book.originalPic.length }} / 4</div>
                    </div>
                </el-form-item>
                <!-- 整改后照片 -->
                <el-form-item label="整改后照片:" prop="rectifiedPic">
                    <div class="upImg">
                        <MyUpload  @setPictureUrl="rectifiedPic" @delPictureUrl="delRectifiedPic" :picture-list="book.rectifiedPic"></MyUpload>
                        <div class="tip">{{book.rectifiedPic.length}} / 4</div>
                        <MyUpload
                            @setPictureUrl="rectifiedPic"
                            @delPictureUrl="delRectifiedPic"
                            :picture-list="book.rectifiedPic"
                        ></MyUpload>
                        <div class="tip">
                            {{ book.rectifiedPic.length }} / 4
                        </div>
                    </div>
                </el-form-item>
                <!-- 其他照片 -->
                <el-form-item label="其他:" prop="otherPic">
                    <div class="upImg">
                        <MyUpload  @setPictureUrl="otherPic" @delPictureUrl="delOtherPic" :picture-list="book.otherPic"></MyUpload>
                        <div class="tip">{{book.otherPic.length}} / 4</div>
                        <MyUpload
                            @setPictureUrl="otherPic"
                            @delPictureUrl="delOtherPic"
                            :picture-list="book.otherPic"
                        ></MyUpload>
                        <div class="tip">{{ book.otherPic.length }} / 4</div>
                    </div>
                </el-form-item>
            </el-form>
@@ -81,9 +139,9 @@
    </div>
</template>
<script>
import {deepClone, getCodeList} from '@/utils/helper'
import { deepClone, getCodeList } from '@/utils/helper'
import MyUpload from "@/components/myUpload"
import { FILE_ORIGINAL_URL } from "@/utils";
import { FILE_ORIGINAL_PATH } from "@/utils";
export default {
    components: {
        MyUpload
@@ -153,21 +211,21 @@
            }
        }
        const checkRectPic = (rule, value, callback) => {
            if (value.length!==0) {
            if (value.length !== 0) {
                callback();
            } else {
                callback(new Error('整改后照片不能为空'));
            }
        }
        const checkWritPic = (rule, value, callback) => {
            if (value.length!==0) {
            if (value.length !== 0) {
                callback();
            } else {
                callback(new Error('文书照片不能为空'));
            }
        }
        const checkOrgPic = (rule, value, callback) => {
            if (value.length !==0) {
            if (value.length !== 0) {
                callback();
            } else {
                callback(new Error('整改前照片不能为空'));
@@ -246,21 +304,21 @@
                    value: 2,
                },
            ],
            basecase:""
            basecase: ""
        }
    },
    created() {
      this.getBookType();
      this.basecase = this.illegalType;
      if (this.writ) {
        this.book = deepClone(this.writ);
        this.book.originalPic = this.writ.originalPic.split(',');
        this.book.writPic = this.writ.writPic.split(',');
        this.book.otherPic = this.writ.otherPic.split(',');
        this.book.rectifiedPic = this.writ.rectifiedPic.split(',');
      }
        this.getBookType();
        this.basecase = this.illegalType;
        if (this.writ) {
            this.book = deepClone(this.writ);
            this.book.originalPic = this.writ.originalPic.split(',');
            this.book.writPic = this.writ.writPic.split(',');
            this.book.otherPic = this.writ.otherPic.split(',');
            this.book.rectifiedPic = this.writ.rectifiedPic.split(',');
        }
    },
    props: ['caseId', 'closeDialog','mycode', 'writ', 'illegalType'],
    props: ['caseId', 'closeDialog', 'mycode', 'writ', 'illegalType'],
    methods: {
        handleSuccess1(res, file, filelist) {
            const baseUrl = '';
@@ -293,69 +351,65 @@
                return { Authorization: tokenHead + token }
            }
        },
            // 设置上传成功之后的图片地址
            writPic({ url }) {
        // 设置上传成功之后的图片地址
        writPic({ url }) {
            const baseUrl = '';
            if (this.book.originalPic.length < 4) {
                url = url.replace("http://111.1.140.92:28081/sccg/API/img?fileUrl=","")
                this.book.writPic.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${url}`)
                this.book.writPic.push(FILE_ORIGINAL_PATH + url)
            }
        },
        //删除图片
        delWritPic({url}){
        delWritPic({ url }) {
            const baseUrl = '';
            this.book.writPic.splice(this.book.writPic.indexOf(baseUrl + url),1);
            this.book.writPic.splice(this.book.writPic.indexOf(baseUrl + url), 1);
        },
 // 设置上传成功之后的图片地址
        // 设置上传成功之后的图片地址
        otherPic({ url }) {
            const baseUrl = '';
            if (this.book.otherPic.length < 4) {
                url = url.replace("http://111.1.140.92:28081/sccg/API/img?fileUrl=","")
                this.book.otherPic.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${url}`)
                this.book.otherPic.push(FILE_ORIGINAL_PATH + url)
            }
        },
        //删除图片
        delOtherPic({url}){
        delOtherPic({ url }) {
            const baseUrl = '';
            this.book.otherPic.splice(this.book.otherPic.indexOf(baseUrl + url),1);
            this.book.otherPic.splice(this.book.otherPic.indexOf(baseUrl + url), 1);
        },
         // 设置上传成功之后的图片地址
         rectifiedPic({ url }) {
        // 设置上传成功之后的图片地址
        rectifiedPic({ url }) {
            const baseUrl = '';
            if (this.book.otherPic.length < 4) {
                url = url.replace("http://111.1.140.92:28081/sccg/API/img?fileUrl=","")
                this.book.rectifiedPic.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${url}`)
                this.book.rectifiedPic.push(FILE_ORIGINAL_PATH + url)
            }
        },
        //删除图片
        delRectifiedPic({url}){
        delRectifiedPic({ url }) {
            const baseUrl = '';
            this.book.rectifiedPic.splice(this.book.rectifiedPic.indexOf(baseUrl + url),1);
            this.book.rectifiedPic.splice(this.book.rectifiedPic.indexOf(baseUrl + url), 1);
        },
         // 设置上传成功之后的图片地址
         originalPic({ url }) {
        // 设置上传成功之后的图片地址
        originalPic({ url }) {
            const baseUrl = '';
            if (this.book.otherPic.length < 4) {
                url = url.replace("http://111.1.140.92:28081/sccg/API/img?fileUrl=","")
                this.book.originalPic.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${url}`)
                this.book.originalPic.push(FILE_ORIGINAL_PATH + url)
            }
        },
        //删除图片
        delOriginalPic({url}){
        delOriginalPic({ url }) {
            const baseUrl = '';
            this.book.originalPic.splice(this.book.originalPic.indexOf(baseUrl + url),1);
            this.book.originalPic.splice(this.book.originalPic.indexOf(baseUrl + url), 1);
        },
        // 获取文书种类
        async getBookType(){
            let arr
        async getBookType() {
            let arr
            arr = await getCodeList('15');
            this.kindList = arr;
        }