峰峰执法平台简易案件程序板块 pad端
yang
2022-11-02 77bbb07044f0e139c20c979c39682c751b7ea0d4
src/views/padSunmaryProcedure/word_mange/mangeBL.vue
@@ -1,5 +1,5 @@
<template>
  <el-main style="width: 100%;font-size: 18px;">
  <el-main>
    <el-form ref="form" :model="form" label-width="85px" size="24">
      <el-form-item label="案由">
        <el-input v-model="form.causePoint" placeholder="请填写案由"></el-input>
@@ -130,14 +130,14 @@
    </el-form>
    <div style="text-align: center">
      <el-button v-if="form.registerState=='0'||form.registerState==null" @click="dataFormSubmit('0')">保存</el-button>
      <el-button type="primary" @click="viewVord(form)">预览</el-button>
      <el-button type="primary" @click="viewVord(form.id)">预览</el-button>
      <el-button type="success" @click="downloadWord(form)">下载</el-button>
    </div>
  </el-main>
</template>
<script>
import {inquiry, inquiryquestion} from '../../../api/News/pad'
import {createword, inquiry, inquiryquestion} from '../../../api/News/pad'
export default {
  name: "mangeBL",
@@ -149,6 +149,7 @@
        causePoint: "",
        startTime: "",
        endTime: "",
        site:"",
        interrogeeName: "",
        interrogeeSex: "",
        interrogeeAge: "",
@@ -175,6 +176,7 @@
  },
  mounted() {
    this.id = this.$store.state.user.id
    console.log(this.id,'id')
    this.getDataList()
    window.getSignUrl =this.getSignUrl;
    window.getFingerUrl =this.getFingerUrl;
@@ -186,6 +188,7 @@
  methods: {
    getDataList() {
        inquiryquestion(this.id).then(res => {
          console.log(res,'res')
            this.form = res.data.data
            this.value1.push(res.data.data.startTime)
            this.value1.push(res.data.data.endTime)
@@ -225,28 +228,23 @@
    },
    //点击预览
    viewVord(data) {
      // let wordData = this.transforData(data);
      this.$router.push({
        path: '/WordYulan',
        query: {
          wordData: data,
          src:'/wordes/inquiryCause.docx',
          name:'调查询问笔录',
        }
      createword(data).then(res =>{
        // console.log(this.form.id)
        console.log(res,'123456')
        window.android.toPreviewWord(res.data.data)
      }).catch(err=>{
        console.log(err,'错误');
      })
    },
    //点击下载
    downloadWord(data){
      this.$router.push({
        path: '/WordYulan',
        query: {
          downWordData: data,
          src:'/wordes/inquiryCause.docx',
          name:'调查询问笔录',
        }
      })
      // WordView.methods.exportDoc(wordData, "/wordes/inquiryCause.docx", "调查询问笔录.docx")
    },
      createword(data).then(res =>{
        // console.log(this.form.id)
        console.log(res,'123456')
        window.android.toDownLoadWord(res.data.data)
      }).catch(err=>{
        console.log(err,'错误');
      })    },
    // 遍历数据
    transforData(obj) {
      let s = JSON.stringify(obj);