|
@@ -60,9 +60,6 @@
|
|
|
</div>
|
|
|
<el-button style="width: 100px;margin-top: 10px;margin-right: 10px;border: 1px solid #00FFFF;border-radius: 2px;" @click="add">提交</el-button>
|
|
|
<el-button style="width: 100px;margin-top: 10px;background: rgba(15, 86, 86, 0.54);color: #00ffff;border: 1px solid #00FFFF;border-radius: 2px;" @click="close">取消</el-button>
|
|
|
- <el-button style="width: 100px;margin-top: 10px;background: rgba(15, 86, 86, 0.54);color: #00ffff;border: 1px solid #00FFFF;border-radius: 2px;">取消</el-button>
|
|
|
-
|
|
|
- <button @click="generateWord" v-show="true">生成Word文件</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -71,10 +68,17 @@
|
|
|
<script>
|
|
|
import { add } from "@/api/screen/service";
|
|
|
import pinyin from "../data/pinyin.js";
|
|
|
+import PizZip from 'pizzip'
|
|
|
+import Docxtemplater from 'docxtemplater'
|
|
|
+import ImageModule from 'docxtemplater-image-module-free'
|
|
|
|
|
|
export default {
|
|
|
name: "IssueSubDia",
|
|
|
props: {
|
|
|
+ projectName:{
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
constructionUnit:{
|
|
|
type: String,
|
|
|
default: ''
|
|
@@ -139,11 +143,11 @@ export default {
|
|
|
// 设置填充模板的数据
|
|
|
const templateData = {
|
|
|
createTime: formattedDate,
|
|
|
- projectName: "项目1",
|
|
|
+ projectName: this.projectName,
|
|
|
constructionUnit: this.constructionUnit,
|
|
|
supervisionUnit: this.supervisionUnit,
|
|
|
- description: "好好干",
|
|
|
- need: "日子甜",
|
|
|
+ description: this.description,
|
|
|
+ need: this.need,
|
|
|
image: this.imageSrc,
|
|
|
};
|
|
|
|
|
@@ -195,6 +199,8 @@ export default {
|
|
|
formData.append("file", this.file);
|
|
|
formData.append("issue", new Blob([JSON.stringify(issueData)], { type: "application/json" }));
|
|
|
|
|
|
+ this.generateWord();
|
|
|
+
|
|
|
add(formData).then((res) => {
|
|
|
if (Number(res.code) === 200) {
|
|
|
this.close();
|