Browse Source

页面调整

sunkuosheng 5 months ago
parent
commit
bf36969ae2
1 changed files with 57 additions and 79 deletions
  1. 57 79
      ruoyi-ui/src/views/organization/jggl/cwxxTb/index.vue

+ 57 - 79
ruoyi-ui/src/views/organization/jggl/cwxxTb/index.vue

@@ -1,56 +1,35 @@
 <template>
-  <div class="app-container">
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="TBSDButton"
-                   v-hasPermi="['system:tb:add']">财务填报
-        </el-button>
-      </el-col>
+  <div class="app-container" v-loading="loading">
+    <el-form class="add-form" ref="form" :model="form" :rules="rules" label-width="180px" :inline="true">
+      <div v-for="(it,ind) in optData" :key="it.label">
+        <h3>{{it.label}}:</h3>
+        <div class="formFlex" style="position: relative">
+          <el-form-item v-for="(i,t) in it.child" :key="i.key" :label="i.label" :prop="i.key" class="flex-item">
+            <el-date-picker
+              v-if="i.type&&i.type==='date'" v-model="form[i.key]" :placeholder="'请选择'+i.label"
+              value-format="yyyyMMdd"
+              type="date">
+            </el-date-picker>
+            <el-cascader v-else-if="i.type&&i.type==='cascader'" :placeholder="'请选择'+i.label" v-model="form[i.key]"
+                         :options="dictOpt[i.dict]" :props="i.props"></el-cascader>
+            <RegionCascaderSelect v-else-if="i.type&&i.type==='RegionCascaderSelect'" v-model="form[i.key]"
+                                  style="width: 100%"></RegionCascaderSelect>
+            <el-select v-else-if="i.type&&i.type==='select'" v-model="form[i.key]" :placeholder="'请选择'+i.label">
+              <el-option v-for="dict in dictOpt[i.dict]" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+            <el-input v-else v-model="form[i.key]" :class="i.dw?'dw':''" :placeholder="'请输入'+i.label">
+              <template v-if="i.dw" slot="append">{{i.dw}}</template>
 
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-
-    <el-table v-loading="loading" :data="xjgrglList">
-      <el-table-column label="序号" align="center">
-        <template slot-scope="scope">
-          {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
-        </template>
-      </el-table-column>
-      <el-table-column label="上报时段" align="center" prop="tblx">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.CWTB003" :value="scope.row.tblx"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="登记时间" align="center" prop="djsj" width="180">
-        <template slot-scope="scope">
-          <span>{{ special(scope.row.djsj) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="登记部门" align="center" prop="djbm"/>
-      <el-table-column label="统一信用代码" align="center" prop="tyxydm"/>
-      <el-table-column label="单位名称" align="center" prop="dwmc"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:tb:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row,scope.$index)"
-            v-hasPermi="['system:tb:remove']"
-          >删除
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+            </el-input>
+            <!--<span v-if="i.ts"  class="textStyle">{{i.ts}}</span>-->
+          </el-form-item>
+        </div>
+      </div>
+    </el-form>
+    <div class="footer">
+      <el-button type="primary" @click="submitForm" :loading="submitFormLoading">保 存</el-button>
+    </div>
 
 
     <el-dialog title="选择填报时段" :visible.sync="innerVisible">
@@ -320,7 +299,8 @@
       }
     },
     created() {
-      this.getList()
+      // this.getList()
+      this.getCwJbxx()
     },
     mounted() {
       this.dictOpt.C0038 = this.dict.tree.C0038
@@ -396,6 +376,17 @@
         this.title = '添加财政报表'
 
       },
+      getCwJbxx(){
+        this.loading = true
+        getJbxx().then(response => {
+          this.loading = false
+          this.form = decryptData_ECB(response.data, ['fddbr', 'dh', 'dz'], [1, 3, 4])
+          this.form.gmjjhyfl =this.form.gmjjhyfl?this.form.gmjjhyfl: '国民经济行业分类';
+          /****** sks 需要改动的地方 start ******/
+          this.copyForm = this.deepCopy(this.form)
+          /****** sks 需要改动的地方 end ******/
+        })
+      },
       /** 新增按钮操作 */
       handleAdd() {
         getCountByJgidTblx({ tblx: this.form.tblx }).then(response => {
@@ -409,7 +400,7 @@
               this.form = decryptData_ECB(response.data, ['fddbr', 'dh', 'dz'], [1, 3, 4])
               this.form.tblx = this.tempTblx
               this.form.gmjjhyfl = '国民经济行业分类'
-              this.form.lx = '社会福利院'
+
             })
             this.open = true
             this.title = '添加 ' + this.translateDict('CWTB003', this.tempTblx) + ' 财政报表'
@@ -432,50 +423,31 @@
       },
       /** 提交按钮 */
       submitForm() {
-        this.$refs['form'].validate(valid => {
+        this.$refs['form'].validate((valid,obj) => {
           if (valid) {
             this.submitFormLoading = true
             console.log(this.form, '<----this.form')
             if (this.form.id != null) {
-              // if (this.checkXjgrForm()) {
-              //   this.$modal.msgWarning("身份证号码与出生日期/性别不符!");
-              //   this.beforeSubmit = true;
-              // } else {
               /****** sks 需要改动的地方 start ******/
               let formData = this.comparisonObject(this.form, this.copyForm)
               if (formData) {
                 updateTb({ ...formData, id: this.form.id }).then(response => {
-                  this.$modal.msgSuccess('修改成功')
-                  this.open = false
-                  this.xjgrglList = this.dataReplacement(this.xjgrglList, this.form.id, formData)
-                  // this.getList();
+                  this.$modal.msgSuccess('保存成功')
                 }).finally(() => this.submitFormLoading = false)
               } else {
-                this.$modal.msgSuccess('修改成功')
-                this.open = false
+                this.$modal.msgSuccess('保存成功')
                 this.submitFormLoading = false
               }
               // }
               /****** sks 需要改动的地方 end ******/
             } else {
-              // if (this.checkXjgrForm()) {
-              //   this.$modal.msgWarning("身份证号码与出生日期/性别不符!");
-              //   this.beforeSubmit = true;
-              // } else {
               addTb({ ...this.form }).then(response => {
-                this.$modal.msgSuccess('新增成功')
-                this.open = false
-                // this.getList();
-                /****** sks 需要改动的地方 start ******/
-                if (this.queryParams.pageSize === this.xjgrglList.length) {
-                  this.xjgrglList.pop()
-                }
-                this.xjgrglList.unshift({ ...this.form, id: response.data })
-                this.total++
-                /****** sks 需要改动的地方 end ******/
+                this.$modal.msgSuccess('保存成功')
               }).finally(() => this.submitFormLoading = false)
               // }
             }
+          }else{
+            this.$modal.msgWarning(Object.values(obj)[0][0].message)
           }
         })
       },
@@ -570,7 +542,13 @@
   .dw ::v-deep .el-input__inner {
     width: 151px !important;
   }
-
+  .footer {
+    position: fixed;
+    bottom: 10px;
+    left: 50%;
+    transform: translateX(-50%);
+    z-index: 9;
+  }
   .textStyle {
     color: rgb(204, 51, 51);
     position: absolute;