zhanghua
2025-04-14 829f5116884f98643ffc5b2a548a600d40c0cedb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<template>
  <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"
        >责令改正通知书</span
      >
    </p>
    <p style="line-height: 34pt; text-align: right">
      <input style="width: 80px" v-model="form.subordinate" /><span
        class="font-weight"
        >综执责改通字</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"
        >&#xa0;</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="写明改正的具体内容、要求,注明逾期不改或者拒不改正应承担的法律责任"
        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"
        >&#xa0;</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"
        >&#xa0;</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"
        >&#xa0;</span
      >
    </p>
    <p class="right_span">
      <span style="font-family: 'Times New Roman'; font-size: 14pt"
        >&#xa0;</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">&#xa0;</span>
    </p>
    <p style="margin: 0pt; orphans: 0; text-align: justify; widows: 0">
      <span style="font-family: Calibri; font-size: 10.5pt">&#xa0;</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>
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);
}
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);
          /*向文档中写入数据*/
          doc.render();
 
          /*输出文档*/
          const out = doc.getZip().generate({
            type: "blob",
            mimeType:
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
          });
          // Output the document using Data-URI
          saveAs(out, "责令改正通知书.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>