Browse Source

新增管理页-数据池管理-园区贸易数据

Sanmu8 1 year ago
parent
commit
6aa887e5b3

+ 70 - 0
src/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询园区贸易数据列表
+export function listGARDENTRADEDATA(query) {
+  return request({
+    url: '/gardentradedata/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询园区贸易数据所有列表
+export function listAllGARDENTRADEDATA(query) {
+  return request({
+    url: '/gardentradedata/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询园区贸易数据详细
+export function getGARDENTRADEDATA(gardenId) {
+  return request({
+    url: '/gardentradedata/getInfo/' + gardenId,
+    method: 'get'
+  })
+}
+
+// 新增园区贸易数据
+export function addGARDENTRADEDATA(data) {
+  return request({
+    url: '/gardentradedata/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改园区贸易数据
+export function updateGARDENTRADEDATA(data) {
+  return request({
+    url: '/gardentradedata/edit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除园区贸易数据
+export function delGARDENTRADEDATA(gardenId) {
+  return request({
+    url: '/gardentradedata/remove/' + gardenId,
+    method: 'get'
+  })
+}
+
+// 导入
+export function importData(data) {
+  return request({
+    url: '/gardentradedata/importData',
+    method: 'post',
+    data:data
+  })
+}
+
+// 获取个人用户信息
+export function getUser() {
+  return request({
+    url: '/getInfo',
+    method: 'get'
+  })
+}

+ 207 - 0
src/views/GARDENTRADEDATA/edit.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="cmain">
+    <el-form ref="form" :model="form" :rules="rules" label-width="200px">
+      <el-form-item label="企业出口退税额" prop="companyDrawback">
+        <el-input
+          v-model="form.companyDrawback"
+          placeholder="请输入企业出口退税额"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="园区出口退税总额" prop="gardenDrawback">
+        <el-input
+          v-model="form.gardenDrawback"
+          placeholder="请输入园区出口退税总额"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="园区运营单位缴税总额" prop="gardenTax">
+        <el-input
+          v-model="form.gardenTax"
+          placeholder="请输入园区运营单位缴税总额"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="企业承接单量" prop="companyLists">
+        <el-input
+          v-model="form.companyLists"
+          placeholder="请输入企业承接单量"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="园区承接单总量" prop="gardenLits">
+        <el-input
+          v-model="form.gardenLits"
+          placeholder="请输入园区承接单总量"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="企业创新获奖量" prop="companyInnovative">
+        <el-input
+          v-model="form.companyInnovative"
+          placeholder="请输入企业创新获奖量"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="园区内创新获奖总量" prop="gardenInnovative">
+        <el-input
+          v-model="form.gardenInnovative"
+          placeholder="请输入园区内创新获奖总量"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="企业工业用水、用电量" prop="companyWaterElectric">
+        <el-input
+          v-model="form.companyWaterElectric"
+          placeholder="请输入企业工业用水、用电量"
+        ></el-input>
+      </el-form-item>
+
+      <el-form-item label="园区工业用水、用电总量" prop="gardenWaterElectric">
+        <el-input
+          v-model="form.gardenWaterElectric"
+          placeholder="请输入园区工业用水、用电总量"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div class="mfooter">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getUser,
+  listGARDENTRADEDATA,
+  getGARDENTRADEDATA,
+  delGARDENTRADEDATA,
+  addGARDENTRADEDATA,
+  updateGARDENTRADEDATA,
+} from "@/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js";
+export default {
+  data() {
+    return {
+      deptList: [],
+      form: {},
+      deptId: "",
+      rules: {
+        gardenId: [
+          { required: true, message: "园区ID不能为空", trigger: "blur" },
+        ],
+        deptId: [
+          { required: true, message: "保税区ID不能为空", trigger: "blur" },
+        ],
+        companyDrawback: [
+          {
+            required: true,
+            message: "企业出口退税额 不能为空",
+            trigger: "blur",
+          },
+        ],
+        gardenDrawback: [
+          {
+            required: true,
+            message: "园区出口退税总额 不能为空",
+            trigger: "blur",
+          },
+        ],
+        gardenTax: [
+          {
+            required: true,
+            message: "园区运营单位缴税总额 不能为空",
+            trigger: "blur",
+          },
+        ],
+        companyLists: [
+          { required: true, message: "企业承接单量 不能为空", trigger: "blur" },
+        ],
+        gardenLits: [
+          {
+            required: true,
+            message: "园区承接单总量 不能为空",
+            trigger: "blur",
+          },
+        ],
+        companyInnovative: [
+          {
+            required: true,
+            message: "企业创新获奖量 不能为空",
+            trigger: "blur",
+          },
+        ],
+        gardenInnovative: [
+          {
+            required: true,
+            message: "园区内创新获奖总量 不能为空",
+            trigger: "blur",
+          },
+        ],
+        companyWaterElectric: [
+          {
+            required: true,
+            message: "企业工业用水、用电量 不能为空",
+            trigger: "blur",
+          },
+        ],
+        gardenWaterElectric: [
+          {
+            required: true,
+            message: "园区工业用水、用电总量 不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    layerid: {
+      type: String,
+    },
+  },
+  mounted() {
+    if (this.param.id) {
+      getGARDENTRADEDATA(this.param.id).then((response) => {
+        this.form = response.data;
+      });
+    } else {
+        //如果没传ID过来那就是新增,需要获取当前用户deptId
+      getUser().then((res) => {
+        this.deptId = res.user.deptId;
+      });
+    }
+  },
+  methods: {
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.gardenId != null) {
+            updateGARDENTRADEDATA(this.form).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          } else {
+            addGARDENTRADEDATA(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 48 - 0
src/views/GARDENTRADEDATA/importFile.vue

@@ -0,0 +1,48 @@
+<template>
+  <div class="cmain" style="display: flex;justify-content: center;align-items: center;">
+    <el-upload
+      class="upload-demo"
+      drag
+      action="#"
+      :http-request="AvatarUpload"
+      multiple
+      :auto-upload="true"
+    >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+    </el-upload>
+    <div class="mfooter">
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { importData } from "@/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js";
+export default {
+  data() {
+    return {};
+  },
+  props:{
+    layerid: {
+      type: String
+    }
+  },
+  methods: {
+    AvatarUpload(file) {
+        let formData = new FormData()
+        formData.append('file',file.file)
+        importData(formData).then(res=>{
+            if(res.code == 200){
+              this.$modal.msgSuccess(res.msg);
+              this.$parent.getList();
+              this.$layer.close(this.layerid);
+            }
+        })
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 340 - 0
src/views/GARDENTRADEDATA/index.vue

@@ -0,0 +1,340 @@
+<template>
+  <div class="app-container">
+    <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form> -->
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['business:GARDENTRADEDATA:add']"
+        >新增</el-button>
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['business:GARDENTRADEDATA:edit']"
+        >修改</el-button>
+      </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['business:GARDENTRADEDATA:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          size="mini"
+          @click="importFile"
+          v-hasPermi="['business:GARDENTRADEDATA:add']"
+        >导入</el-button>
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['business:GARDENTRADEDATA:export']"
+        >导出</el-button>
+      </el-col> -->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table :data="GARDENTRADEDATAList" @selection-change="handleSelectionChange" fixed>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="园区名称" align="center" prop="gardenName" width="130">
+        <template slot-scope="scope">
+          {{scope.row.gardenName}}
+        </template>
+      </el-table-column>
+      <el-table-column label="企业出口退税额" align="center" prop="companyDrawback" width="130">
+        <template slot-scope="scope">
+          {{scope.row.companyDrawback}}
+        </template>
+      </el-table-column>
+      <el-table-column label="园区出口退税总额" align="center" prop="gardenDrawback" width="140">
+        <template slot-scope="scope">
+          {{scope.row.gardenDrawback}}
+        </template>
+      </el-table-column>
+      <el-table-column label="园区运营单位缴税总额" align="center" prop="gardenTax" width="170">
+        <template slot-scope="scope">
+          {{scope.row.gardenTax}}
+        </template>
+      </el-table-column>
+      <el-table-column label="企业承接单量" align="center" prop="companyLists" width="130">
+        <template slot-scope="scope">
+          {{scope.row.companyLists}}
+        </template>
+      </el-table-column>
+      <el-table-column label="园区承接单总量" align="center" prop="gardenLits" width="130">
+        <template slot-scope="scope">
+          {{scope.row.gardenLits}}
+        </template>
+      </el-table-column>
+      <el-table-column label="企业创新获奖量" align="center" prop="companyInnovative" width="130">
+        <template slot-scope="scope">
+          {{scope.row.companyInnovative}}
+        </template>
+      </el-table-column>
+      <el-table-column label="园区内创新获奖总量" align="center" prop="gardenInnovative" width="160">
+        <template slot-scope="scope">
+          {{scope.row.gardenInnovative}}
+        </template>
+      </el-table-column>
+      <el-table-column label="企业工业用水、用电量" align="center" prop="companyWaterElectric" width="170">
+        <template slot-scope="scope">
+          {{scope.row.companyWaterElectric}}
+        </template>
+      </el-table-column>
+      <el-table-column label="园区工业用水、用电总量" align="center" prop="gardenWaterElectric" width="190">
+        <template slot-scope="scope">
+          {{scope.row.gardenWaterElectric}}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['business:GARDENTRADEDATA:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['business:GARDENTRADEDATA:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改园区贸易数据对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listGARDENTRADEDATA, getGARDENTRADEDATA, delGARDENTRADEDATA, addGARDENTRADEDATA, updateGARDENTRADEDATA } from "@/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js";
+import importFile from "./importFile.vue";
+import edit from "./edit.vue";
+export default {
+  name: "GARDENTRADEDATA",
+  data() {
+    return {
+      // 根路径
+      baseURL: process.env.VUE_APP_BASE_API,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 园区贸易数据表格数据
+      GARDENTRADEDATAList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        gardenId: null,
+        deptId: null,
+        companyDrawback: null,
+        gardenDrawback: null,
+        gardenTax: null,
+        companyLists: null,
+        gardenLits: null,
+        companyInnovative: null,
+        gardenInnovative: null,
+        companyWaterElectric: null,
+        gardenWaterElectric: null,
+        createTime: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        gardenId: [
+          { required: true, message: "园区ID不能为空", trigger: "blur" }
+        ],
+        deptId: [
+          { required: true, message: "保税区ID不能为空", trigger: "blur" }
+        ],
+        companyDrawback: [
+          { required: true, message: "企业出口退税额 不能为空", trigger: "blur" }
+        ],
+        gardenDrawback: [
+          { required: true, message: "园区出口退税总额 不能为空", trigger: "blur" }
+        ],
+        gardenTax: [
+          { required: true, message: "园区运营单位缴税总额 不能为空", trigger: "blur" }
+        ],
+        companyLists: [
+          { required: true, message: "企业承接单量 不能为空", trigger: "blur" }
+        ],
+        gardenLits: [
+          { required: true, message: "园区承接单总量 不能为空", trigger: "blur" }
+        ],
+        companyInnovative: [
+          { required: true, message: "企业创新获奖量 不能为空", trigger: "blur" }
+        ],
+        gardenInnovative: [
+          { required: true, message: "园区内创新获奖总量 不能为空", trigger: "blur" }
+        ],
+        companyWaterElectric: [
+          { required: true, message: "企业工业用水、用电量 不能为空", trigger: "blur" }
+        ],
+        gardenWaterElectric: [
+          { required: true, message: "园区工业用水、用电总量 不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询园区贸易数据列表 */
+    getList() {
+      this.loading = true;
+      listGARDENTRADEDATA(this.queryParams).then(response => {
+        this.GARDENTRADEDATAList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    importFile(){
+      this.iframe({ obj: importFile, param: {}, title: '导入', width: '500px', height: '50%' });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        gardenId: null,
+        deptId: null,
+        companyDrawback: null,
+        gardenDrawback: null,
+        gardenTax: null,
+        companyLists: null,
+        gardenLits: null,
+        companyInnovative: null,
+        gardenInnovative: null,
+        companyWaterElectric: null,
+        gardenWaterElectric: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.gardenId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.iframe({ obj: edit, param: {}, title: '添加园区贸易数据', width: '750px', height: '70%' });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      const id = row.gardenId || this.ids;
+      this.iframe({ obj: edit, param: {id:id}, title: '修改园区贸易数据', width: '750px', height: '70%' });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.gardenId != null) {
+            updateGARDENTRADEDATA(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addGARDENTRADEDATA(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const gardenIds = row.gardenId || this.ids;
+      this.$modal.confirm('是否确认删除?').then(function() {
+        return delGARDENTRADEDATA(gardenIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('business/GARDENTRADEDATA/export', {
+        ...this.queryParams
+      }, `GARDENTRADEDATA_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>