Sfoglia il codice sorgente

修改政策兑现样式

wrh 2 anni fa
parent
commit
910b7db4e7

+ 126 - 115
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/policyDelivery/components/PolicyDeliveryEdit.vue

@@ -1,9 +1,11 @@
 <template>
-  <el-dialog title="" :close-on-click-modal="false" class="detailDialog" :modal-append-to-body="false" append-to-body width="40%" :visible.sync="dialog.visible" @closed="afterFormClosed">
+  <el-dialog title="" top="10px" :close-on-click-modal="false" class="detailDialog" :modal-append-to-body="false"
+    append-to-body width="40%" :visible.sync="dialog.visible" @closed="afterFormClosed">
     <div slot="title" style="height: 10px;">
       <div class="addTitle">{{ dialog.title }}</div>
     </div>
-    <el-form ref="refForm" v-loading="form.loading" :model="form" :rules="rules" label-width="80px">
+    <el-form ref="refForm" style="height: 500px;overflow-y: scroll;" v-loading="form.loading" :model="form"
+      :rules="rules" label-width="80px">
       <el-form-item prop="title" label="标题">
         <el-input v-model="form.title" placeholder="标题" maxlength="255" />
       </el-form-item>
@@ -52,105 +54,21 @@
 </template>
 
 <script>
-import { isEmpty } from '@/utils/tool'
-import policyDeliveryApi from '@/api/policyDelivery'
+  import {
+    isEmpty
+  } from '@/utils/tool'
+  import policyDeliveryApi from '@/api/policyDelivery'
+  // import Tinymce from '@/components/Tinymce'
 
-export default {
-  name: 'PolicyDeliveryEdit',
-  components: {},
-  data() {
-    return {
-      data: [], // 数据
-      form: {
-        id: '', // id
-        title: '', // 标题
-        unit: '', // 单位
-        measures: '', // 惠企措施
-        policyBasis: '', // 政策依据
-        applicableConditions: '', // 适用条件
-        processingMethod: '', // 办理方式
-        processingTime: '', // 办理时间
-        inquiryPhone: '', // 咨询电话
-        procedure: '', // 办理流程
-        processingMaterials: '', // 办理材料
-        type: '', // 类型
-        industrySectors: '', // 行业领域
-        freeApplication: '', // 免申即享
-        loading: false
-      },
-      rules: {
-        name: [
-          { required: true, message: '请输入名称', trigger: 'blur' }
-        ]
-      },
-      dialog: {
-        title: '',
-        visible: false
-      }
-    }
-  },
-  computed: {},
-  methods: {
-    submitForm() {
-      this.$refs.refForm.validate().then(() => {
-        if (isEmpty(this.form.id)) {
-          policyDeliveryApi.policyDeliveryAdd({
-            ...this.form
-          }).then(res => {
-            if (res.data.result) {
-              this.$message({
-                type: 'success',
-                message: '添加成功!'
-              })
-              this.dialog.visible = false
-              this.$emit('update-table')
-            } else {
-              this.$message({
-                type: 'info',
-                message: res.data.msg
-              })
-            }
-          })
-        } else {
-          policyDeliveryApi.policyDeliveryUpdate({
-            ...this.form
-          }).then(res => {
-            if (res.data.result) {
-              this.$message({
-                type: 'success',
-                message: '修改成功!'
-              })
-              this.dialog.visible = false
-              this.$emit('update-table')
-            } else {
-              this.$message({
-                type: 'info',
-                message: res.data.msg
-              })
-            }
-          })
-        }
-      }).catch(() => {
-        console.log('验证失败')
-      })
+  export default {
+    name: 'PolicyDeliveryEdit',
+    components: {
+      // Tinymce
     },
-    showEditForm(id) {
-      this.dialog.visible = true
-      this.form.loading = true
-      this.form.loading = false
-      if (id) {
-        this.dialog.title = '编辑'
-        this.form.id = id
-        const params = {
-          id: id
-        }
-        policyDeliveryApi.policyDeliveryInfo({ params }).then((res) => {
-          const ret = res.data.data || []
-          this.form = ret
-        })
-      } else {
-        this.dialog.title = '新增'
-        this.form = {
+    data() {
+      return {
+        data: [], // 数据
+        form: {
           id: '', // id
           title: '', // 标题
           unit: '', // 单位
@@ -166,29 +84,122 @@ export default {
           industrySectors: '', // 行业领域
           freeApplication: '', // 免申即享
           loading: false
+        },
+        rules: {
+          name: [{
+            required: true,
+            message: '请输入名称',
+            trigger: 'blur'
+          }]
+        },
+        dialog: {
+          title: '',
+          visible: false
         }
       }
     },
-    afterFormClosed() {
-      this.$refs.refForm.resetFields()
-      this.form.id = null
+    computed: {},
+    methods: {
+      submitForm() {
+        this.$refs.refForm.validate().then(() => {
+          if (isEmpty(this.form.id)) {
+            policyDeliveryApi.policyDeliveryAdd({
+              ...this.form
+            }).then(res => {
+              if (res.data.result) {
+                this.$message({
+                  type: 'success',
+                  message: '添加成功!'
+                })
+                this.dialog.visible = false
+                this.$emit('update-table')
+              } else {
+                this.$message({
+                  type: 'info',
+                  message: res.data.msg
+                })
+              }
+            })
+          } else {
+            policyDeliveryApi.policyDeliveryUpdate({
+              ...this.form
+            }).then(res => {
+              if (res.data.result) {
+                this.$message({
+                  type: 'success',
+                  message: '修改成功!'
+                })
+                this.dialog.visible = false
+                this.$emit('update-table')
+              } else {
+                this.$message({
+                  type: 'info',
+                  message: res.data.msg
+                })
+              }
+            })
+          }
+        }).catch(() => {
+          console.log('验证失败')
+        })
+      },
+      showEditForm(id) {
+        this.dialog.visible = true
+        this.form.loading = true
+        this.form.loading = false
+        if (id) {
+          this.dialog.title = '编辑'
+          this.form.id = id
+          const params = {
+            id: id
+          }
+          policyDeliveryApi.policyDeliveryInfo({
+            params
+          }).then((res) => {
+            const ret = res.data.data || []
+            this.form = ret
+          })
+        } else {
+          this.dialog.title = '新增'
+          this.form = {
+            id: '', // id
+            title: '', // 标题
+            unit: '', // 单位
+            measures: '', // 惠企措施
+            policyBasis: '', // 政策依据
+            applicableConditions: '', // 适用条件
+            processingMethod: '', // 办理方式
+            processingTime: '', // 办理时间
+            inquiryPhone: '', // 咨询电话
+            procedure: '', // 办理流程
+            processingMaterials: '', // 办理材料
+            type: '', // 类型
+            industrySectors: '', // 行业领域
+            freeApplication: '', // 免申即享
+            loading: false
+          }
+        }
+      },
+      afterFormClosed() {
+        this.$refs.refForm.resetFields()
+        this.form.id = null
+      }
     }
   }
-}
 </script>
 
 <style lang="less" scoped>
-.menu-edit {
-  .color {
-    position: absolute;
-    right: 2px;
-    top: 2px;
-    z-index: 3;
+  .menu-edit {
+    .color {
+      position: absolute;
+      right: 2px;
+      top: 2px;
+      z-index: 3;
+    }
   }
-}
 
-.addTitle {
-        font-size: 18px;
-        font-weight: bold;
-    }
-</style>
+  .addTitle {
+    font-size: 18px;
+    font-weight: bold;
+  }
+</style>