Commit 090611a71d0e6bef9db2731fb97b1eafcfd6c7e0

Authored by “wangming”
1 parent 1859abe1

1

src/views/baseSpecialAction/dynamicModel/list/Form.vue
1 <template> 1 <template>
2 <div> 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 <!-- <template> 20 <!-- <template>
23 <transition name="el-zoom-in-center"> 21 <transition name="el-zoom-in-center">
24 <div class="NCC-preview-main"> 22 <div class="NCC-preview-main">
@@ -82,23 +80,25 @@ export default { @@ -82,23 +80,25 @@ export default {
82 this.printBrowseVisible = true 80 this.printBrowseVisible = true
83 }, 81 },
84 init(formConf, modelId, id, isPreview, useFormPermission) { 82 init(formConf, modelId, id, isPreview, useFormPermission) {
85 -  
86 this.formConf = deepClone(JSON.parse(formConf)) 83 this.formConf = deepClone(JSON.parse(formConf))
87 - var formConf = this.formConf;  
88 this.modelId = modelId 84 this.modelId = modelId
89 this.isPreview = isPreview 85 this.isPreview = isPreview
90 this.useFormPermission = useFormPermission 86 this.useFormPermission = useFormPermission
91 this.dataForm.id = id || '' 87 this.dataForm.id = id || ''
92 - debugger  
93 this.getFormOperates() 88 this.getFormOperates()
94 this.loading = true 89 this.loading = true
95 this.$nextTick(() => { 90 this.$nextTick(() => {
96 if (this.dataForm.id) { 91 if (this.dataForm.id) {
97 getModelInfo(modelId, this.dataForm.id).then(res => { 92 getModelInfo(modelId, this.dataForm.id).then(res => {
  93 + this.dataForm = {
  94 + id: '',
  95 + data: ''
  96 + };
98 this.dataForm = res.data 97 this.dataForm = res.data
99 if (!this.dataForm.data) return 98 if (!this.dataForm.data) return
100 this.formData = JSON.parse(this.dataForm.data) 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 this.$nextTick(() => { 102 this.$nextTick(() => {
103 this.visible = true 103 this.visible = true
104 this.loading = false 104 this.loading = false
@@ -106,7 +106,7 @@ export default { @@ -106,7 +106,7 @@ export default {
106 }) 106 })
107 } else { 107 } else {
108 this.formData = {} 108 this.formData = {}
109 - this.fillFormData(formConf, this.formData) 109 + this.fillFormData(this.formConf, this.formData)
110 this.visible = true 110 this.visible = true
111 this.loading = false 111 this.loading = false
112 } 112 }
@@ -149,6 +149,8 @@ export default { @@ -149,6 +149,8 @@ export default {
149 this.dataForm.data = JSON.stringify(data) 149 this.dataForm.data = JSON.stringify(data)
150 const formMethod = this.dataForm.id ? updateModel : createModel 150 const formMethod = this.dataForm.id ? updateModel : createModel
151 formMethod(this.modelId, this.dataForm).then(res => { 151 formMethod(this.modelId, this.dataForm).then(res => {
  152 + console.info(res);
  153 + alert(res.data.Id);
152 this.$message({ 154 this.$message({
153 message: res.msg, 155 message: res.msg,
154 type: 'success', 156 type: 'success',
src/views/baseSpecialhandle/index.vue
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 </div> 49 </div>
50 </div> 50 </div>
51 </div> 51 </div>
52 - <NCCForm v-show="dialogVisible" ref="NCCForm" @refresh="refresh" /> 52 + <NCCForm v-if="dialogVisible" ref="NCCForm" @refresh="refresh" />
53 <!-- <el-dialog title="专项行动处理" :visible.sync="dialogVisible" fullscreen :modal="false"> 53 <!-- <el-dialog title="专项行动处理" :visible.sync="dialogVisible" fullscreen :modal="false">
54 <iframe 54 <iframe
55 :src="nestedPageUrl" 55 :src="nestedPageUrl"
@@ -135,7 +135,8 @@ export default { @@ -135,7 +135,8 @@ export default {
135 }, 135 },
136 toFillForm(row) { 136 toFillForm(row) {
137 this.dialogVisible = true; 137 this.dialogVisible = true;
138 - var Itemid= "";//数据id,没有的话就是新增 ,有的话就是修改 138 + var Itemid= "588014226493146373";//数据id,没有的话就是新增 ,有的话就是修改
  139 + Itemid="";
139 var modelId=row.formId;//关联的表单id 140 var modelId=row.formId;//关联的表单id
140 var isPreview = false;//固定死,值不变 141 var isPreview = false;//固定死,值不变
141 var useFormPermission = false;//固定死,值不变 142 var useFormPermission = false;//固定死,值不变