From 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期三, 16 七月 2025 22:39:23 +0800 Subject: [PATCH] 添加时间筛选 --- src/views/operate/writManager/components/instruct_notification/edit.vue | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 285 insertions(+), 4 deletions(-) diff --git a/src/views/operate/writManager/components/instruct_notification/edit.vue b/src/views/operate/writManager/components/instruct_notification/edit.vue index 0baa302..6ca923c 100644 --- a/src/views/operate/writManager/components/instruct_notification/edit.vue +++ b/src/views/operate/writManager/components/instruct_notification/edit.vue @@ -1,8 +1,289 @@ <template> - <div></div> + <div class="content"> + <p style="text-align: center"> + <input + placeholder="濉啓琛屾斂鎵ф硶鏈哄叧鍚嶇О" + v-model="form.org_name" + style="font-family: 鏂规灏忔爣瀹嬬畝浣�; font-size: 22pt; text-align: center" + /> + </p> + <p style="text-align: center"> + <span style="font-family: 鏂规灏忔爣瀹嬬畝浣�; font-size: 22pt" + >璐d护鏀规閫氱煡涔�</span + > + </p> + <p style="line-height: 34pt; text-align: right"> + <input style="width: 80px" v-model="form.subordinate" /><span + class="font-weight" + >缁兼墽璐f敼閫氬瓧</span + ><span class="font-weight">銆�</span + ><input + style="width: 40px; text-align: center" + v-model="form.word" + /><span class="font-weight">銆�</span><span class="font-weight">绗�</span + ><input + style="width: 40px; text-align: center" + v-model="form.number" + /><span class="font-weight">鍙�</span> + </p> + <p style="margin: 0pt; orphans: 0; text-align: justify; widows: 0"> + <span + style="color: #060606; font-family: 'Times New Roman'; font-size: 14pt" + > </span + > + </p> + <p style="line-height: 26pt"> + <span>褰撲簨浜猴細</span><span class="underline">聽 </span> + <input + placeholder="褰撲簨浜哄鍚嶆垨鑰呭悕绉�" + style="width: 260px" + v-model="form.name" + /> + </p> + <p style="line-height: 26pt"> + <span>鍦皗{ "\u3000" }}鍧�锛�</span><span class="underline">聽 </span> + <input + placeholder="褰撲簨浜哄搴綇鍧�鎴栬�呬綇鎵�鍦�" + style="width: 260px" + v-model="form.address" + /> + </p> + <p style="line-height: 26pt; text-indent: 24pt"> + <span>缁忔煡锛屼綘锛堝崟浣嶏級</span><span class="underline">聽 </span + ><input + placeholder="鍐欐槑褰撲簨浜虹殑杩濇硶浜嬪疄鍖呮嫭杩濇硶鐨勬椂闂淬�佸湴鐐瑰拰鍏蜂綋杩濇硶琛屼负鍐呭绛�" + style="width: 760px" + v-model="form.illegal_content" + /><span>銆�</span><span>浣狅紙鍗曚綅锛夌殑涓婅堪琛屼负宸茬粡杩濆弽浜�</span> + + <input + placeholder="" + style="width: 770px" + v-model="form.deregulationist" + /> + <span>鐨勮瀹�</span><span>銆�</span> + </p> + <p style="line-height: 26pt; text-indent: 24pt"> + <span style="color: #060606; font-family: 浠垮畫_GB2312; font-size: 14pt" + >渚濇嵁</span + > + <input + placeholder="" + style="width: 700px" + v-model="form.according_to_law" + /> + <span style="color: #060606; font-family: 浠垮畫_GB2312; font-size: 14pt" + >鐨勮瀹氾紝鐜拌矗浠や綘锛堝崟浣嶏級</span + > + <input + placeholder="鍐欐槑鏀规鐨勫叿浣撳唴瀹广�佽姹傦紝娉ㄦ槑閫炬湡涓嶆敼鎴栬�呮嫆涓嶆敼姝e簲鎵挎媴鐨勬硶寰嬭矗浠�" + style="width: 760px" + v-model="form.correction" + /> + <span style="color: #060606; font-family: 浠垮畫_GB2312; font-size: 14pt" + >銆�</span + > + </p> + <p + style="line-height: 26pt; margin: 0pt 1.4pt 0pt 0pt; text-indent: 22.9pt" + > + <span style="font-family: 'Times New Roman'; font-size: 14pt" + > </span + > + </p> + <p + style="line-height: 26pt; margin: 0pt 1.4pt 0pt 0pt; text-indent: 22.9pt" + > + <span style="font-family: 'Times New Roman'; font-size: 14pt" + > </span + > + </p> + <p + style="line-height: 26pt; margin: 0pt 1.4pt 0pt 0pt; text-indent: 22.9pt" + > + <span style="font-family: 'Times New Roman'; font-size: 14pt" + > </span + > + </p> + <p class="right_span"> + <span style="font-family: 'Times New Roman'; font-size: 14pt" + > </span + > + </p> + <p class="right_span"> + <input v-model="form.org_name" style="text-align: right" /> + </p> + <p class="right_span"> + <input v-model="form.year" style="width: 80px; text-align: center" /><span>骞�</span> + <input v-model="form.month" style="width: 40px; text-align: center" /><span>鏈�</span> + <input v-model="form.day" style="width: 40px; text-align: center" /><span>鏃�</span> + </p> + <p style="text-indent: 11.4pt"> + <span style="font-family: Calibri; font-size: 10.5pt"> </span> + </p> + <p style="margin: 0pt; orphans: 0; text-align: justify; widows: 0"> + <span style="font-family: Calibri; font-size: 10.5pt"> </span> + </p> + + <div class="optionBtn"> + <el-button + type="primary" + class="btn submit" + @click.native.prevent="handleSubmit" + >淇� 瀛� + </el-button> + + <el-button + type="primary" + class="btn submit" + @click.native.prevent="handlePrint" + >鎵� 鍗� + </el-button> + + <el-button + type="primary" + class="btn submit" + @click.native.prevent="handleExport" + >瀵煎嚭word + </el-button> + </div> + </div> </template> <script> -export default { - +import { createNamespacedHelpers } from "vuex"; +const { mapActions } = createNamespacedHelpers("writ"); +import JSZipUtils from "jszip-utils"; +import Docxtemplater from "docxtemplater"; +import PizZip from "pizzip"; +import { saveAs } from "file-saver"; +function loadFile(url, callback) { + JSZipUtils.getBinaryContent(url, callback); } -</script> \ No newline at end of file +export default { + data() { + return { + form: { + org_name: "", //琛屾斂鏈哄叧鍚嶇О + subordinate: "", + word: "", + number: "", + name: "", + address: "", + illegal_content: "", + deregulationist: "", + according_to_law: "", + correction: "", + year: "", + month: "", + day: "", + }, + }; + }, + created() { + if (this.writ && this.writ.value) { + this.form = JSON.parse(this.writ.value); + } + }, + methods: { + ...mapActions(["updateWrit"]), + + handleSubmit() { + var data = { + baseCaseId: this.writ.baseCaseId, + value: JSON.stringify(this.form), + }; + this.updateWrit(data).then((res) => { + this.$message({ + type: "success", + message: "淇濆瓨鎴愬姛", + }); + this.$emit("closeDialog", { flag: false, index: 1 }); + }); + }, + handlePrint(e) {}, + handleExport(e) { + let that = this; + loadFile( + /*鑾峰彇doc妯$増*/ + "/instruct_to_correct_notification.docx", //"https://docxtemplater.com/tag-example.docx" + function (error, content) { + // eslint-disable-next-line no-debugger + + if (error) { + throw error; + } + const zip = new PizZip(content); + const doc = new Docxtemplater(zip, { + paragraphLoop: true, + linebreaks: true, + }); + + doc.setData(that.form); + /*鍚戞枃妗d腑鍐欏叆鏁版嵁*/ + doc.render(); + + /*杈撳嚭鏂囨。*/ + const out = doc.getZip().generate({ + type: "blob", + mimeType: + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + }); + // Output the document using Data-URI + saveAs(out, "璐d护鏀规閫氱煡涔�.docx"); + } + ); + }, + }, + props: ["writ", "changeDialog"], +}; +</script> +<style scoped> +.content { + width: 805px; + margin: auto; + line-height: 2 !important; +} + +p { + margin: 0pt; + orphans: 0; + /* text-align: justify; */ + widows: 0; +} +span { + font-family: 浠垮畫_GB2312; + font-size: 14pt; +} +.font-weight { + font-weight: bold; +} +.underline { + text-decoration: underline; +} + +.right_span { + line-height: 26pt; + margin: 0pt 7pt 0pt 0pt; + orphans: 0; + text-align: right; + widows: 0; +} + +input { + outline-style: none; + border: 0px; + border-bottom: 1px solid #000; + padding: 5px; + font-size: 14pt; + font-family: "Microsoft soft"; +} + +.optionBtn { + display: flex; + margin-top: 20px; + justify-content: center; +} +.btn { + padding: 12px 50px; +} +</style> \ No newline at end of file -- Gitblit v1.8.0