Commit 090611a71d0e6bef9db2731fb97b1eafcfd6c7e0

Authored by “wangming”
1 parent 1859abe1

1

src/views/baseSpecialAction/dynamicModel/list/Form.vue
1 1 <template>
2 2 <div>
3   - <template>
4   - <el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false"
5   - :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll
6   - :width="formConf.generalWidth">
7   - <parser :form-conf="formConf" @submit="sumbitForm" :key="key" ref="dynamicForm"
8   - :setFormData="setFormData" :setShowOrHide="setShowOrHide" :setRequired="setRequired"
9   - :setDisabled="setDisabled" :setFieldOptions="setFieldOptions"/>
10   - <span slot="footer" class="dialog-footer">
11   - <template v-if="formConf.hasPrintBtn && formConf.printId && dataForm.id && false">
12   - <el-button type="primary" @click="print">
13   - {{formConf.printButtonText||'打 印'}}
14   - </el-button>
15   - </template>
16   - <el-button @click="visible = false">{{formConf.cancelButtonText||'取 消'}}</el-button>
17   - <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
18   - {{formConf.confirmButtonText||'确 定'}}</el-button>
19   - </span>
20   - </el-dialog>
21   - </template>
  3 +
  4 + <el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" :visible.sync="visible"
  5 + class="NCC-dialog NCC-dialog_center" lock-scroll :width="formConf.generalWidth">
  6 + <parser :form-conf="formConf" @submit="sumbitForm" :key="key" ref="dynamicForm" :setFormData="setFormData"
  7 + :setShowOrHide="setShowOrHide" :setRequired="setRequired" :setDisabled="setDisabled"
  8 + :setFieldOptions="setFieldOptions" v-if="!loading"/>
  9 + <span slot="footer" class="dialog-footer">
  10 + <template v-if="formConf.hasPrintBtn && formConf.printId && dataForm.id && false">
  11 + <el-button type="primary" @click="print">
  12 + {{ formConf.printButtonText || '打 印' }}
  13 + </el-button>
  14 + </template>
  15 + <el-button @click="visible = false">{{ formConf.cancelButtonText || '取 消' }}</el-button>
  16 + <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
  17 + {{ formConf.confirmButtonText || '确 定' }}</el-button>
  18 + </span>
  19 + </el-dialog>
22 20 <!-- <template>
23 21 <transition name="el-zoom-in-center">
24 22 <div class="NCC-preview-main">
... ... @@ -82,23 +80,25 @@ export default {
82 80 this.printBrowseVisible = true
83 81 },
84 82 init(formConf, modelId, id, isPreview, useFormPermission) {
85   -
86 83 this.formConf = deepClone(JSON.parse(formConf))
87   - var formConf = this.formConf;
88 84 this.modelId = modelId
89 85 this.isPreview = isPreview
90 86 this.useFormPermission = useFormPermission
91 87 this.dataForm.id = id || ''
92   - debugger
93 88 this.getFormOperates()
94 89 this.loading = true
95 90 this.$nextTick(() => {
96 91 if (this.dataForm.id) {
97 92 getModelInfo(modelId, this.dataForm.id).then(res => {
  93 + this.dataForm = {
  94 + id: '',
  95 + data: ''
  96 + };
98 97 this.dataForm = res.data
99 98 if (!this.dataForm.data) return
100 99 this.formData = JSON.parse(this.dataForm.data)
101   - this.fillFormData(formConf, this.formData)
  100 + console.log( this.formData);
  101 + this.fillFormData(this.formConf, this.formData)
102 102 this.$nextTick(() => {
103 103 this.visible = true
104 104 this.loading = false
... ... @@ -106,7 +106,7 @@ export default {
106 106 })
107 107 } else {
108 108 this.formData = {}
109   - this.fillFormData(formConf, this.formData)
  109 + this.fillFormData(this.formConf, this.formData)
110 110 this.visible = true
111 111 this.loading = false
112 112 }
... ... @@ -149,6 +149,8 @@ export default {
149 149 this.dataForm.data = JSON.stringify(data)
150 150 const formMethod = this.dataForm.id ? updateModel : createModel
151 151 formMethod(this.modelId, this.dataForm).then(res => {
  152 + console.info(res);
  153 + alert(res.data.Id);
152 154 this.$message({
153 155 message: res.msg,
154 156 type: 'success',
... ...
src/views/baseSpecialhandle/index.vue
... ... @@ -49,7 +49,7 @@
49 49 </div>
50 50 </div>
51 51 </div>
52   - <NCCForm v-show="dialogVisible" ref="NCCForm" @refresh="refresh" />
  52 + <NCCForm v-if="dialogVisible" ref="NCCForm" @refresh="refresh" />
53 53 <!-- <el-dialog title="专项行动处理" :visible.sync="dialogVisible" fullscreen :modal="false">
54 54 <iframe
55 55 :src="nestedPageUrl"
... ... @@ -135,7 +135,8 @@ export default {
135 135 },
136 136 toFillForm(row) {
137 137 this.dialogVisible = true;
138   - var Itemid= "";//数据id,没有的话就是新增 ,有的话就是修改
  138 + var Itemid= "588014226493146373";//数据id,没有的话就是新增 ,有的话就是修改
  139 + Itemid="";
139 140 var modelId=row.formId;//关联的表单id
140 141 var isPreview = false;//固定死,值不变
141 142 var useFormPermission = false;//固定死,值不变
... ...