峰峰执法平台简易案件程序板块 pad端
yang
2022-10-28 6f3cbab6a74ea6dbf419eca60d45715a0090263e
src/views/padSunmaryProcedure/word_mange/mangeGZ.vue
@@ -102,21 +102,21 @@
    </el-row>
  </el-form>
  <div style="text-align: center">
    <el-button v-if="form.registerState=='0'" @click="dataFormSubmit('0')">保存</el-button>
    <el-button type="primary" @click="viewVord(dataForm)">预览</el-button>
    <el-button v-if="form.registerState=='1'"type="success" @click="downloadWord(dataForm)">下载</el-button>
    <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 v-if="form.registerState=='1'" type="success" @click="downloadWord(form)">下载</el-button>
  </div>
</el-main>
</template>
<script>
import { ordercorrec, ordercorrection} from '../../../api/News/pad'
import {createword, ordercorrec, ordercorrection} from '../../../api/News/pad'
export default {
  name: "mangeGZ",
  props:['id'],
  data(){
    return{
        id:'',
      form:{
        unitName:"",
        litigant:"",
@@ -138,7 +138,8 @@
      },
    }
  },
  created() {
  mounted() {
    this.id = this.$store.state.user.id
    this.getDataList()
  },
  methods:{
@@ -148,14 +149,35 @@
      })
    },
    dataFormSubmit(){
      this.form.registerId = this.id
      ordercorrec(this.form).then(res =>{
        if (res.data.code == 0) {
          this.$message.success("操作成功");
        }
      })
    }
    },
    //点击预览
    viewVord(data) {
      // let wordData = this.transforData(data);
      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){
      createword(data).then(res =>{
        // console.log(this.form.id)
        console.log(res,'123456')
        window.android.toPreviewWord(res.data.data)
      }).catch(err=>{
        console.log(err,'错误');
      })
      // WordView.methods.exportDoc(wordData, "/wordes/inquiryCause.docx", "调查询问笔录.docx")
    },
  },
}
</script>