index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="园区名称">
  5. <el-input
  6. v-model="queryParams.gardenName"
  7. placeholder="请输入园区名称"
  8. ></el-input>
  9. </el-form-item>
  10. <el-form-item>
  11. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  12. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  13. </el-form-item>
  14. </el-form>
  15. <el-row :gutter="10" class="mb8">
  16. <el-col :span="1.5">
  17. <el-button
  18. type="primary"
  19. plain
  20. size="mini"
  21. @click="handleAdd"
  22. v-hasPermi="['business:GARDENTRADEDATA:add']"
  23. >新增</el-button>
  24. </el-col>
  25. <!-- <el-col :span="1.5">
  26. <el-button
  27. type="success"
  28. plain
  29. size="mini"
  30. :disabled="single"
  31. @click="handleUpdate"
  32. v-hasPermi="['business:GARDENTRADEDATA:edit']"
  33. >修改</el-button>
  34. </el-col> -->
  35. <el-col :span="1.5">
  36. <el-button
  37. type="danger"
  38. plain
  39. size="mini"
  40. :disabled="multiple"
  41. @click="handleDelete"
  42. v-hasPermi="['business:GARDENTRADEDATA:remove']"
  43. >删除</el-button>
  44. </el-col>
  45. <el-col :span="1.5">
  46. <el-button
  47. type="danger"
  48. plain
  49. size="mini"
  50. @click="importFile"
  51. v-hasPermi="['business:GARDENTRADEDATA:add']"
  52. >导入</el-button>
  53. </el-col>
  54. <!-- <el-col :span="1.5">
  55. <el-button
  56. type="warning"
  57. plain
  58. icon="el-icon-download"
  59. size="mini"
  60. @click="handleExport"
  61. v-hasPermi="['business:GARDENTRADEDATA:export']"
  62. >导出</el-button>
  63. </el-col> -->
  64. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  65. </el-row>
  66. <el-table :data="GARDENTRADEDATAList" @selection-change="handleSelectionChange" fixed>
  67. <el-table-column type="selection" width="55" align="center" />
  68. <el-table-column label="园区名称" align="center" prop="gardenName" width="130">
  69. <template slot-scope="scope">
  70. {{scope.row.gardenName}}
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="企业出口退税额" align="center" prop="companyDrawback" width="130">
  74. <template slot-scope="scope">
  75. {{scope.row.companyDrawback}}
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="园区出口退税总额" align="center" prop="gardenDrawback" width="140">
  79. <template slot-scope="scope">
  80. {{scope.row.gardenDrawback}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="园区运营单位缴税总额" align="center" prop="gardenTax" width="170">
  84. <template slot-scope="scope">
  85. {{scope.row.gardenTax}}
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="企业承接单量" align="center" prop="companyLists" width="130">
  89. <template slot-scope="scope">
  90. {{scope.row.companyLists}}
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="园区承接单总量" align="center" prop="gardenLits" width="130">
  94. <template slot-scope="scope">
  95. {{scope.row.gardenLits}}
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="企业创新获奖量" align="center" prop="companyInnovative" width="130">
  99. <template slot-scope="scope">
  100. {{scope.row.companyInnovative}}
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="园区内创新获奖总量" align="center" prop="gardenInnovative" width="160">
  104. <template slot-scope="scope">
  105. {{scope.row.gardenInnovative}}
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="企业工业用水、用电量" align="center" prop="companyWaterElectric" width="170">
  109. <template slot-scope="scope">
  110. {{scope.row.companyWaterElectric}}
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="园区工业用水、用电总量" align="center" prop="gardenWaterElectric" width="190">
  114. <template slot-scope="scope">
  115. {{scope.row.gardenWaterElectric}}
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  119. <template slot-scope="scope">
  120. <el-button
  121. size="mini"
  122. type="text"
  123. icon="el-icon-edit"
  124. @click="handleUpdate(scope.row)"
  125. v-hasPermi="['business:GARDENTRADEDATA:edit']"
  126. >修改</el-button>
  127. <el-button
  128. size="mini"
  129. type="text"
  130. icon="el-icon-delete"
  131. @click="handleDelete(scope.row)"
  132. v-hasPermi="['business:GARDENTRADEDATA:remove']"
  133. >删除</el-button>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <pagination
  138. v-show="total>0"
  139. :total="total"
  140. :page.sync="queryParams.pageNum"
  141. :limit.sync="queryParams.pageSize"
  142. @pagination="getList"
  143. />
  144. <!-- 添加或修改园区贸易数据对话框 -->
  145. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  146. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  147. </el-form>
  148. <div slot="footer" class="dialog-footer">
  149. <el-button type="primary" @click="submitForm">确 定</el-button>
  150. <el-button @click="cancel">取 消</el-button>
  151. </div>
  152. </el-dialog>
  153. </div>
  154. </template>
  155. <script>
  156. import { listGARDENTRADEDATA, getGARDENTRADEDATA, delGARDENTRADEDATA, addGARDENTRADEDATA, updateGARDENTRADEDATA } from "@/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js";
  157. import importFile from "./importFile.vue";
  158. import edit from "./edit.vue";
  159. export default {
  160. name: "GARDENTRADEDATA",
  161. data() {
  162. return {
  163. // 根路径
  164. baseURL: process.env.VUE_APP_BASE_API,
  165. // 遮罩层
  166. loading: true,
  167. // 选中数组
  168. ids: [],
  169. // 非单个禁用
  170. single: true,
  171. // 非多个禁用
  172. multiple: true,
  173. // 显示搜索条件
  174. showSearch: true,
  175. // 总条数
  176. total: 0,
  177. // 园区贸易数据表格数据
  178. GARDENTRADEDATAList: [],
  179. // 弹出层标题
  180. title: "",
  181. // 是否显示弹出层
  182. open: false,
  183. // 查询参数
  184. queryParams: {
  185. pageNum: 1,
  186. pageSize: 10,
  187. gardenId: null,
  188. deptId: null,
  189. companyDrawback: null,
  190. gardenDrawback: null,
  191. gardenTax: null,
  192. companyLists: null,
  193. gardenLits: null,
  194. companyInnovative: null,
  195. gardenInnovative: null,
  196. companyWaterElectric: null,
  197. gardenWaterElectric: null,
  198. createTime: null,
  199. gardenName: '', // 园区名称
  200. },
  201. // 表单参数
  202. form: {},
  203. // 表单校验
  204. rules: {
  205. gardenId: [
  206. { required: true, message: "园区ID不能为空", trigger: "blur" }
  207. ],
  208. deptId: [
  209. { required: true, message: "保税区ID不能为空", trigger: "blur" }
  210. ],
  211. companyDrawback: [
  212. { required: true, message: "企业出口退税额 不能为空", trigger: "blur" }
  213. ],
  214. gardenDrawback: [
  215. { required: true, message: "园区出口退税总额 不能为空", trigger: "blur" }
  216. ],
  217. gardenTax: [
  218. { required: true, message: "园区运营单位缴税总额 不能为空", trigger: "blur" }
  219. ],
  220. companyLists: [
  221. { required: true, message: "企业承接单量 不能为空", trigger: "blur" }
  222. ],
  223. gardenLits: [
  224. { required: true, message: "园区承接单总量 不能为空", trigger: "blur" }
  225. ],
  226. companyInnovative: [
  227. { required: true, message: "企业创新获奖量 不能为空", trigger: "blur" }
  228. ],
  229. gardenInnovative: [
  230. { required: true, message: "园区内创新获奖总量 不能为空", trigger: "blur" }
  231. ],
  232. companyWaterElectric: [
  233. { required: true, message: "企业工业用水、用电量 不能为空", trigger: "blur" }
  234. ],
  235. gardenWaterElectric: [
  236. { required: true, message: "园区工业用水、用电总量 不能为空", trigger: "blur" }
  237. ],
  238. }
  239. };
  240. },
  241. created() {
  242. this.getList();
  243. },
  244. methods: {
  245. /** 查询园区贸易数据列表 */
  246. getList() {
  247. this.loading = true;
  248. listGARDENTRADEDATA(this.queryParams).then(response => {
  249. this.GARDENTRADEDATAList = response.rows;
  250. this.total = response.total;
  251. this.loading = false;
  252. });
  253. },
  254. // 取消按钮
  255. cancel() {
  256. this.open = false;
  257. this.reset();
  258. },
  259. importFile(){
  260. this.iframe({ obj: importFile, param: {}, title: '导入', width: '500px', height: '50%' });
  261. },
  262. // 表单重置
  263. reset() {
  264. this.form = {
  265. gardenId: null,
  266. deptId: null,
  267. companyDrawback: null,
  268. gardenDrawback: null,
  269. gardenTax: null,
  270. companyLists: null,
  271. gardenLits: null,
  272. companyInnovative: null,
  273. gardenInnovative: null,
  274. companyWaterElectric: null,
  275. gardenWaterElectric: null,
  276. };
  277. this.resetForm("form");
  278. },
  279. /** 搜索按钮操作 */
  280. handleQuery() {
  281. this.queryParams.pageNum = 1;
  282. this.getList();
  283. },
  284. /** 重置按钮操作 */
  285. resetQuery() {
  286. this.queryParams.gardenName = '';
  287. this.resetForm("queryForm");
  288. this.handleQuery();
  289. },
  290. // 多选框选中数据
  291. handleSelectionChange(selection) {
  292. this.ids = selection.map(item => item.gardenId)
  293. this.single = selection.length!==1
  294. this.multiple = !selection.length
  295. },
  296. /** 新增按钮操作 */
  297. handleAdd() {
  298. this.iframe({ obj: edit, param: {}, title: '添加园区贸易数据', width: '750px', height: '70%' });
  299. },
  300. /** 修改按钮操作 */
  301. handleUpdate(row) {
  302. const id = row.gardenId || this.ids;
  303. this.iframe({ obj: edit, param: {id:id}, title: '修改园区贸易数据', width: '750px', height: '70%' });
  304. },
  305. /** 提交按钮 */
  306. submitForm() {
  307. this.$refs["form"].validate(valid => {
  308. if (valid) {
  309. if (this.form.gardenId != null) {
  310. updateGARDENTRADEDATA(this.form).then(response => {
  311. this.$modal.msgSuccess("修改成功");
  312. this.open = false;
  313. this.getList();
  314. });
  315. } else {
  316. addGARDENTRADEDATA(this.form).then(response => {
  317. this.$modal.msgSuccess("新增成功");
  318. this.open = false;
  319. this.getList();
  320. });
  321. }
  322. }
  323. });
  324. },
  325. /** 删除按钮操作 */
  326. handleDelete(row) {
  327. const gardenIds = row.gardenId || this.ids;
  328. this.$modal.confirm('是否确认删除?').then(function() {
  329. return delGARDENTRADEDATA(gardenIds);
  330. }).then(() => {
  331. this.getList();
  332. this.$modal.msgSuccess("删除成功");
  333. }).catch(() => {});
  334. },
  335. /** 导出按钮操作 */
  336. handleExport() {
  337. this.download('business/GARDENTRADEDATA/export', {
  338. ...this.queryParams
  339. }, `GARDENTRADEDATA_${new Date().getTime()}.xlsx`)
  340. }
  341. }
  342. };
  343. </script>