From 9ff66017debadfc89bc0c1b796684a4d1dbe2bc3 Mon Sep 17 00:00:00 2001 From: fangyuan <527392886@qq.com> Date: 星期五, 16 十二月 2022 10:00:02 +0800 Subject: [PATCH] 已上报到市批量操作按钮隐藏 --- src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue | 156 +++++++++++++++++++++++++-------------------------- 1 files changed, 77 insertions(+), 79 deletions(-) diff --git a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue index 26fbf54..f17f970 100644 --- a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue +++ b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/book/index.vue @@ -18,17 +18,17 @@ </el-form-item> </div> <!-- 杩濇硶绫诲瀷 --> - <el-form-item label="杩濇硶绫诲瀷:" prop="illegalType" placeholder="璇疯緭鍏ヨ繚娉曠被鍨�"> - <el-input v-model="book.illegalType" placeholder="璇疯緭鍏ヨ繚娉曠被鍨�"></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" 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" 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> <!-- 鏂囦功鍙戞斁鍐呭 --> @@ -37,7 +37,7 @@ </el-form-item> <!-- 瀹為檯鏁存敼鏃堕棿 --> <el-form-item label="瀹為檯鏁存敼鏃堕棿:" prop="rectifyTime"> - <el-date-picker v-model="book.rectifyTime" type="datetime" 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> <!-- 鏁存敼鎯呭喌 --> @@ -51,76 +51,28 @@ <!-- 鏂囦功鐓х墖涓婁紶 --> <el-form-item label="鏂囦功鐓х墖涓婁紶:" prop="writPic"> <div class="upImg"> - <div class="img-list" v-if="book.writPic.length!==0"> - <div class="img" v-for="(item,index) in book.writPic" :key="index"> - <img :src="item" alt=""> - <i class="el-icon-close myicon" @click="handleRemove(index,1)"></i> - </div> - </div> - <div class="upload" v-if="book.writPic.length<4"> - <el-upload :file-list="fileList" class="upload-demo" - action="/sccg/file/medias" multiple :show-file-list="false" - :limit="4" :on-success="handleSuccess1" :headers="getToken()"> - <i class="el-icon-plus"></i> - </el-upload> - </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"> - <div class="img-list" v-if="book.originalPic.length!==0"> - <div class="img" v-for="(item,index) in book.originalPic" :key="index"> - <img :src="item" alt=""> - <i class="el-icon-close myicon" @click="handleRemove(index,2)"></i> - </div> - </div> - <div class="upload" v-if="book.originalPic.length<4"> - <el-upload :file-list="fileList" class="upload-demo" - action="/sccg/file/medias" multiple :show-file-list="false" - :limit="4" :on-success="handleSuccess2" :headers="getToken()"> - <i class="el-icon-plus"></i> - </el-upload> - </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"> - <div class="img-list" v-if="book.rectifiedPic.length!==0"> - <div class="img" v-for="(item,index) in book.rectifiedPic" :key="index"> - <img :src="item" alt=""> - <i class="el-icon-close myicon" @click="handleRemove(index,3)"></i> - </div> - </div> - <div class="upload" v-if="book.rectifiedPic.length<4"> - <el-upload :file-list="fileList" class="upload-demo" - action="/sccg/file/medias" multiple :show-file-list="false" - :limit="4" :on-success="handleSuccess3" :headers="getToken()"> - <i class="el-icon-plus"></i> - </el-upload> - </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"> - <div class="img-list" v-if="book.otherPic.length!==0"> - <div class="img" v-for="(item,index) in book.otherPic" :key="index"> - <img :src="item" alt=""> - <i class="el-icon-close myicon" @click="handleRemove(index,4)"></i> - </div> - </div> - <div class="upload" v-if="book.otherPic.length<4"> - <el-upload :file-list="fileList" class="upload-demo" - action="/sccg/file/medias" multiple :show-file-list="false" - :limit="4" :on-success="handleSuccess4" :headers="getToken()"> - <i class="el-icon-plus"></i> - </el-upload> - </div> + <MyUpload @setPictureUrl="otherPic" @delPictureUrl="delOtherPic" :picture-list="book.otherPic"></MyUpload> <div class="tip">{{book.otherPic.length}} / 4</div> </div> </el-form-item> @@ -129,8 +81,12 @@ </div> </template> <script> -import {getCodeList} from '@/utils/helper' +import {deepClone, getCodeList} from '@/utils/helper' +import MyUpload from "@/components/myUpload" export default { + components: { + MyUpload + }, data() { const checkKind = (rule, value, callback) => { if (value) { @@ -234,11 +190,6 @@ trigger: 'blur', validator: checkId } ], - illegalType: [ - { - trigger: 'blur', validator: checkVio - } - ], sendTime: [ { trigger: 'blur', validator: checkGiveTime @@ -293,14 +244,22 @@ label: '涔︾睄2', value: 2, }, - ] + ], + basecase:"" } }, created() { - const {getBookType} = this - getBookType(); + 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'], + props: ['caseId', 'closeDialog','mycode', 'writ', 'illegalType'], methods: { handleSuccess1(res, file, filelist) { const baseUrl = 'http://140.143.152.226:8410/'; @@ -333,19 +292,58 @@ return { Authorization: tokenHead + token } } }, - // 鍒犻櫎鍥剧墖 - handleRemove(index, flag) { - if (flag === 1) { - this.book.writPic.splice(index, 1); - } else if (flag === 2) { - this.book.originalPic.splice(index, 1); - } else if (flag === 3) { - this.book.rectifiedPic.splice(index, 1); - } else { - this.book.otherPic.splice(index, 1); + + // 璁剧疆涓婁紶鎴愬姛涔嬪悗鐨勫浘鐗囧湴鍧� + writPic({ url }) { + const baseUrl = 'http://140.143.152.226:8410/'; + if (this.book.originalPic.length < 4) { + this.book.writPic.push(baseUrl + url) } - }, + //鍒犻櫎鍥剧墖 + delWritPic({url}){ + const baseUrl = 'http://140.143.152.226:8410/'; + this.book.writPic.splice(this.book.writPic.indexOf(baseUrl + url),1); + }, + + // 璁剧疆涓婁紶鎴愬姛涔嬪悗鐨勫浘鐗囧湴鍧� + otherPic({ url }) { + const baseUrl = 'http://140.143.152.226:8410/'; + if (this.book.otherPic.length < 4) { + this.book.otherPic.push(baseUrl + url) + } + }, + //鍒犻櫎鍥剧墖 + delOtherPic({url}){ + const baseUrl = 'http://140.143.152.226:8410/'; + this.book.otherPic.splice(this.book.otherPic.indexOf(baseUrl + url),1); + }, + + // 璁剧疆涓婁紶鎴愬姛涔嬪悗鐨勫浘鐗囧湴鍧� + rectifiedPic({ url }) { + const baseUrl = 'http://140.143.152.226:8410/'; + if (this.book.otherPic.length < 4) { + this.book.rectifiedPic.push(baseUrl + url) + } + }, + //鍒犻櫎鍥剧墖 + delRectifiedPic({url}){ + const baseUrl = 'http://140.143.152.226:8410/'; + this.book.rectifiedPic.splice(this.book.rectifiedPic.indexOf(baseUrl + url),1); + }, + // 璁剧疆涓婁紶鎴愬姛涔嬪悗鐨勫浘鐗囧湴鍧� + originalPic({ url }) { + const baseUrl = 'http://140.143.152.226:8410/'; + if (this.book.otherPic.length < 4) { + this.book.originalPic.push(baseUrl + url) + } + }, + //鍒犻櫎鍥剧墖 + delOriginalPic({url}){ + const baseUrl = 'http://140.143.152.226:8410/'; + this.book.originalPic.splice(this.book.originalPic.indexOf(baseUrl + url),1); + }, + // 鑾峰彇鏂囦功绉嶇被 async getBookType(){ let arr -- Gitblit v1.8.0