Bladeren bron

大屏 界面修改

zhanghao 3 weken geleden
bovenliggende
commit
699baad479
3 gewijzigde bestanden met toevoegingen van 15 en 6 verwijderingen
  1. BIN
      public/template.docx
  2. 12 6
      src/views/screen/engineering/issueSubDia.vue
  3. 3 0
      src/views/screen/engineering/main.vue

BIN
public/template.docx


+ 12 - 6
src/views/screen/engineering/issueSubDia.vue

@@ -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();

+ 3 - 0
src/views/screen/engineering/main.vue

@@ -162,6 +162,7 @@
           :constructionUnit="constructionUnit"
           :supervisionUnit="supervisionUnit"
           :monitorInfo="this.monitorInfo"
+          :projectName="projectName"
           :projectId="curCompanMonth"
           :imgUrl="this.imgUrl">
         </issue-sub-dia>
@@ -284,6 +285,7 @@ export default {
       curCompanyear:'',
       getProList:'',
       curCompanMonth:null,
+      projectName: null,
       showRes:0,
       showC:false,
       showIssue:0,
@@ -498,6 +500,7 @@ export default {
 
     onChooseProject(e){
       this.curCompanMonth = e.id;
+      this.projectName = e.projectName
       this.constructionUnit = e.constructionUnit
       this.supervisionUnit = e.supervisionUnit
       this.showC = false