峰峰执法平台简易案件程序板块 pad端
zhangxiaoxu123
2022-10-26 ce3c9d345a27d3a86e6c096d927f3ee619b6e68f
src/views/padSunmaryProcedure/word_mange/mangeJD.vue
@@ -111,9 +111,9 @@
    </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>
@@ -124,9 +124,9 @@
export default {
  name: "mangeJD",
  props: ['id'],
  data() {
    return {
        id:'',
      form: {
        unitName: "",
        litigant: "",
@@ -138,7 +138,8 @@
      }
    }
  },
  created() {
  mounted() {
    this.id = this.$store.state.user.id
    this.init();
  },
  methods: {
@@ -149,15 +150,40 @@
    },
    //点击保存数据
    dataFormSubmit() {
      this.form.startTime = this.value1[0]
      this.form.endTime = this.value1[1]
      this.form.registerId = this.id
      /*this.form.startTime = this.value1[0]
      this.form.endTime = this.value1[1]*/
      //this.form.registerId = this.id
      inquiry(this.form).then(res => {
        if (res.data.code == 0) {
          this.$message.success("保存成功");
        }
      })
    }
    },
    //点击预览
    viewVord(data) {
      // let wordData = this.transforData(data);
      this.$router.push({
        path: '/WordYulan',
        query: {
          wordData: data,
          src: '/wordes/penaltyDecision.docx',
          name: '处罚决定书',
        }
      })
    },
    //点击下载
    downloadWord(data) {
      this.$router.push({
        path: '/WordYulan',
        query: {
          id:this.id,
          downWordData: data,
          src: '/wordes/penaltyDecision.docx',
          name: '处罚决定书',
        }
      })
      // WordView.methods.exportDoc(wordData, "/wordes/inquiryCause.docx", "调查询问笔录.docx")
    },
  },
}
</script>