峰峰执法平台简易案件程序板块 pad端
yang
2022-10-17 4107256a8d1fa9a2db0969122bfc760994b12421
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<template>
<el-main>
  <el-form ref="form" :model="form" label-width="130px">
    <el-row>
      <el-col :span="12">
        <el-form-item label="文号">
          <el-input type="text"
                    v-model="form.unitName"
                    clearable
                    placeholder="文件号"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="当事人">
          <el-input type="text"
                    v-model="form.litigant"
                    clearable
                    placeholder="当事人"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-form-item label="违法行为">
      <el-input v-model="form.breakLowContent"></el-input>
    </el-form-item>
    <el-form-item label="存放地点">
      <el-input v-model="form.storageLocation" placeholder="存放地点或场所"></el-input>
    </el-form-item>
 
    <el-row>
      <el-col :span="12">
        <el-form-item label="执法人1">
          <el-input type="text"
                    v-model="form.lawPersonOne"
                    clearable
                    placeholder="执法人1"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="执法证号">
          <el-input type="text"
                    v-model="form.lawcertOne"
                    clearable
                    placeholder="执法证号"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="执法人2">
          <el-input type="text"
                    v-model="form.lawPersonTwo"
                    clearable
                    placeholder="执法人2"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="执法证号">
          <el-input type="text"
                    v-model="form.lawcertTwo"
                    clearable
                    placeholder="执法证号"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="签字日期">
          <el-date-picker
            v-model="form.signatureTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="扣章日期">
          <el-date-picker
            v-model="form.executionTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="抽样方式">
          <el-input type="text"
                    v-model="form.way"
                    clearable
                    placeholder="抽样方式"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
 
    <el-form-item label-width="0">
      <el-button @click="openForm">添加物品</el-button>
      <el-table
        :data="form.goodsDis"
        style="width: 100%">
        <el-table-column
          label="序号"
          type="index"/>
        <el-table-column
          prop="name"
          label="名称">
        </el-table-column>
        <el-table-column
          prop="exhibitNum"
          label="数量">
        </el-table-column>
        <el-table-column
          prop="exhibitSize"
          label="规格(型号)">
        </el-table-column>
 
        <el-table-column
          prop="number"
          label="基数">
        </el-table-column>
        <el-table-column
          prop="remark"
          label="备注">
        </el-table-column>
        <el-table-column
          label="操作">
          <template slot-scope="scope">
            <el-button type="text" @click="deleteByRow(scope.$index)">
              <img src="../../../../../assets/lawImg/deleteIconRed.png" alt="">
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-form-item>
    <samplingEvidenceForm v-if="isShow" :isShow="isShow" @cancell="cancell"></samplingEvidenceForm>
    <WordView ref="wordInfo" :isShowYulan="showView" @cancel="cancelWord"></WordView>
  </el-form>
  <div style="text-align: center">
    <el-button v-if="isFinish!='2'" plain @click="dataFormSubmit('0')">保存</el-button>
    <el-button v-if="isFinish!='2'" type="warning" plain @click="dataFormSubmit('1')">定稿</el-button>
    <el-button type="primary" plain @click="viewVord(form)">预览</el-button>
    <el-button type="success" plain @click="downloadWord(form)">下载</el-button>
  </div>
</el-main>
</template>
 
<script>
import samplingEvidenceForm from "@/views/News/word-manage/externalFile/samplingEvidence/samplingEvidenceForm";
import {getObj, saveObj} from "@/api/News/samplingEvidenceForm";
import WordView from "@/views/News/word-view";
 
export default {
  name: "index",
  props: ['isShowYulan', 'id', 'isFinish', 'processId', 'title'],
  components:{
    samplingEvidenceForm,
    WordView
  },
  data() {
    return {
      isShow: false,
      showView: false,
      form: {
        unitName:"",//文号
        light:"",//当事人
        name: '',
        dataTime:"",//当事人签字日期
        dataEndTime:"",//扣章日期
      }
    }
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      getObj(this.id).then((res) => {
        // 转换null为""
        let v = res.data.data;
        for (let attr in v) {
          if (v[attr] == null) {
            v[attr] = "";
          }
        }
        let str = JSON.stringify(v);
        let data = JSON.parse(str);
        this.form = data;
      });
    },
    dataFormSubmit(type) {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          let obj = this;
          if ("1" == type) {
            this.$confirm('保存为定稿将不能修改,是否继续?', '提示', {
              confirmButtonText: '是',
              cancelButtonText: '否',
              type: 'warning'
            }).then(function () {
              obj.form.registerState = type;
              obj.form.registerId = obj.id;
              obj.form.processId = obj.processId;
              saveObj(obj.form).then((res) => {
                // this.submitLoading = false;
                obj.$message.success('操作成功');
                obj.cancel();
                obj.$emit('getDataList');
              })
            })
          } else {
            obj.form.registerState = type;
            obj.form.registerId = obj.id;
            obj.form.processId = obj.processId;
            saveObj(obj.form).then((res) => {
              // this.submitLoading = false;
              obj.$message.success("操作成功");
              obj.cancel();
              obj.$emit('getDataList');
            })
          }
        }
      })
    },
    cancel() {
      this.$emit('cancel', false);
    },
    openForm() {
      this.isShow = true;
    },
    cancell(e, d) {
      this.isShow = e;
      if(d !=undefined){
        this.dataForm.goodsList.push(d)
      }
    },
    viewVord(data) {
      if(data.registerState == null || data.registerState == ""){
        //预览前先进行保存
        data.registerState = '0';
        data.registerId = this.id;
        data.processId = this.processId;
        saveObj(data).then((res) => {
        })
      }
      //↓↓↓↓↓↓以下部分根据具体业务修改↓↓↓↓↓↓
      //格式转换
      // let wordData = this.transforData(data);
      //↑↑↑↑↑↑以上部分根据具体业务修改↑↑↑↑↑↑
      this.showView = true;
      this.$nextTick(() => {
        this.$refs.wordInfo.init(data, "/wordes/samplingEvidenceForm.docx");
      })
    },
    downloadWord(data) {
      if(data.registerState == null || data.registerState == ""){
        //预览前先进行保存
        data.registerState = '0';
        data.registerId = this.id;
        data.processId = this.processId;
        saveObj(data).then((res) => {
        })
      }
      // let wordData = this.transforData(data);
      WordView.methods.exportDoc(data, "/wordes/samplingEvidenceForm.docx", this.title+'.docx');
    },
    cancelWord() {
      this.showView = false;
    },
  }
}
</script>
 
<style scoped>
 
</style>