edit.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="cmain">
  3. <el-form ref="form" :model="form" :rules="rules" label-width="200px">
  4. <el-form-item label="企业出口退税额" prop="companyDrawback">
  5. <el-input
  6. type="number"
  7. v-model="form.companyDrawback"
  8. placeholder="请输入企业出口退税额"
  9. ></el-input>
  10. </el-form-item>
  11. <el-form-item label="园区出口退税总额" prop="gardenDrawback">
  12. <el-input
  13. type="number"
  14. v-model="form.gardenDrawback"
  15. placeholder="请输入园区出口退税总额"
  16. ></el-input>
  17. </el-form-item>
  18. <el-form-item label="园区运营单位缴税总额" prop="gardenTax">
  19. <el-input
  20. type="number"
  21. v-model="form.gardenTax"
  22. placeholder="请输入园区运营单位缴税总额"
  23. ></el-input>
  24. </el-form-item>
  25. <el-form-item label="企业承接单量" prop="companyLists">
  26. <el-input
  27. type="number"
  28. v-model="form.companyLists"
  29. placeholder="请输入企业承接单量"
  30. ></el-input>
  31. </el-form-item>
  32. <el-form-item label="园区承接单总量" prop="gardenLits">
  33. <el-input
  34. type="number"
  35. v-model="form.gardenLits"
  36. placeholder="请输入园区承接单总量"
  37. ></el-input>
  38. </el-form-item>
  39. <el-form-item label="企业创新获奖量" prop="companyInnovative">
  40. <el-input
  41. type="number"
  42. v-model="form.companyInnovative"
  43. placeholder="请输入企业创新获奖量"
  44. ></el-input>
  45. </el-form-item>
  46. <el-form-item label="园区内创新获奖总量" prop="gardenInnovative">
  47. <el-input
  48. type="number"
  49. v-model="form.gardenInnovative"
  50. placeholder="请输入园区内创新获奖总量"
  51. ></el-input>
  52. </el-form-item>
  53. <el-form-item label="企业工业用水、用电量" prop="companyWaterElectric">
  54. <el-input
  55. type="number"
  56. v-model="form.companyWaterElectric"
  57. placeholder="请输入企业工业用水、用电量"
  58. ></el-input>
  59. </el-form-item>
  60. <el-form-item label="园区工业用水、用电总量" prop="gardenWaterElectric">
  61. <el-input
  62. type="number"
  63. v-model="form.gardenWaterElectric"
  64. placeholder="请输入园区工业用水、用电总量"
  65. ></el-input>
  66. </el-form-item>
  67. </el-form>
  68. <div class="mfooter">
  69. <el-button type="primary" @click="submitForm">确 定</el-button>
  70. <el-button @click="$layer.close(layerid)">取 消</el-button>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import {
  76. getUser,
  77. listGARDENTRADEDATA,
  78. getGARDENTRADEDATA,
  79. delGARDENTRADEDATA,
  80. addGARDENTRADEDATA,
  81. updateGARDENTRADEDATA,
  82. } from "@/api/portal/GARDENTRADEDATA/GARDENTRADEDATA.js";
  83. export default {
  84. data() {
  85. return {
  86. deptList: [],
  87. form: {},
  88. deptId: "",
  89. rules: {
  90. gardenId: [
  91. { required: true, message: "园区ID不能为空", trigger: "blur" },
  92. ],
  93. deptId: [
  94. { required: true, message: "保税区ID不能为空", trigger: "blur" },
  95. ],
  96. companyDrawback: [
  97. { required: true, message: "企业出口退税额 不能为空", trigger: "blur", },
  98. { pattern: /^[1-9]\d*$/, message: "企业出口退税额年龄必须为整数值" },
  99. ],
  100. gardenDrawback: [
  101. { required: true, message: "园区出口退税总额 不能为空", trigger: "blur", },
  102. { pattern: /^[1-9]\d*$/, message: "园区出口退税总额必须为整数值" },
  103. ],
  104. gardenTax: [
  105. { required: true, message: "园区运营单位缴税总额 不能为空", trigger: "blur", },
  106. { pattern: /^[1-9]\d*$/, message: "园区运营单位缴税总额必须为整数值" },
  107. ],
  108. companyLists: [
  109. { required: true, message: "企业承接单量 不能为空", trigger: "blur" },
  110. { pattern: /^[1-9]\d*$/, message: "企业承接单量必须为整数值" },
  111. ],
  112. gardenLits: [
  113. { required: true, message: "园区承接单总量 不能为空", trigger: "blur", },
  114. { pattern: /^[1-9]\d*$/, message: "园区承接单总量年龄必须为整数值" },
  115. ],
  116. companyInnovative: [
  117. { required: true, message: "企业创新获奖量 不能为空", trigger: "blur", },
  118. { pattern: /^[1-9]\d*$/, message: "企业创新获奖量必须为整数值" },
  119. ],
  120. gardenInnovative: [
  121. { required: true, message: "园区内创新获奖总量 不能为空", trigger: "blur", },
  122. { pattern: /^[1-9]\d*$/, message: "园区内创新获奖总量必须为整数值" },
  123. ],
  124. companyWaterElectric: [
  125. { required: true, message: "企业工业用水、用电量 不能为空", trigger: "blur", },
  126. { pattern: /^[1-9]\d*$/, message: "必须为整数值" },
  127. ],
  128. gardenWaterElectric: [
  129. { required: true, message: "园区工业用水、用电总量 不能为空", trigger: "blur", },
  130. { pattern: /^[1-9]\d*$/, message: "必须为整数值" },
  131. ],
  132. },
  133. };
  134. },
  135. props: {
  136. param: {
  137. type: Object,
  138. default: () => {
  139. return {};
  140. },
  141. },
  142. layerid: {
  143. type: String,
  144. },
  145. },
  146. mounted() {
  147. if (this.param.id) {
  148. getGARDENTRADEDATA(this.param.id).then((response) => {
  149. this.form = response.data;
  150. });
  151. } else {
  152. //如果没传ID过来那就是新增,需要获取当前用户deptId
  153. getUser().then((res) => {
  154. this.deptId = res.user.deptId;
  155. });
  156. }
  157. },
  158. methods: {
  159. /** 提交按钮 */
  160. submitForm() {
  161. this.$refs["form"].validate((valid) => {
  162. if (valid) {
  163. if (this.form.gardenId != null) {
  164. updateGARDENTRADEDATA(this.form).then((response) => {
  165. this.$modal.msgSuccess("修改成功");
  166. this.$layer.close(this.layerid);
  167. this.$parent.getList();
  168. });
  169. } else {
  170. addGARDENTRADEDATA(this.form).then((response) => {
  171. this.$modal.msgSuccess("新增成功");
  172. this.$layer.close(this.layerid);
  173. this.$parent.getList();
  174. });
  175. }
  176. }
  177. });
  178. },
  179. },
  180. };
  181. </script>
  182. <style></style>