index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="统一社会信用代码" prop="uniCode" label-width="200">
  5. <el-input
  6. v-model="queryParams.uniCode"
  7. placeholder="请输入统一社会信用代码"
  8. clearable
  9. @keyup.enter="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  14. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-row :gutter="10" class="mb8">
  18. <el-col :span="1.5">
  19. <el-button
  20. type="warning"
  21. plain
  22. icon="Download"
  23. @click="handleExport"
  24. :disabled="!xcrEnterprisePublicationSupplySubscribedDetailsInvestorsList.length"
  25. v-hasPermi="['basicData:xcrEnterprisePublicationSupplySubscribedDetailsInvestors:export']"
  26. >导出
  27. </el-button>
  28. </el-col>
  29. </el-row>
  30. <el-table v-loading="loading" :data="xcrEnterprisePublicationSupplySubscribedDetailsInvestorsList" height="650" @selection-change="handleSelectionChange">
  31. <el-table-column label="统一社会信用代码" align="center" prop="uniCode" width="200"/>
  32. <el-table-column label="认缴ID" align="center" prop="SUBID" :show-overflow-tooltip='true' width="150"/>
  33. <el-table-column label="出资人ID" align="center" prop="INVID" :show-overflow-tooltip='true' width="150"/>
  34. <el-table-column label="股东/发起人名称" align="center" prop="INV" :show-overflow-tooltip='true' width="150"/>
  35. <el-table-column label="认缴出资额 (单位:万元)" align="center" prop="SUBCONAM" :show-overflow-tooltip='true' width="150"/>
  36. <el-table-column label="认缴出资方式 (CA22)" align="center" prop="CONFORM" :show-overflow-tooltip='true' width="150"/>
  37. <el-table-column label="认缴出资方式" align="center" prop="conformCn" :show-overflow-tooltip='true' width="150"/>
  38. <el-table-column label="认缴出资日期" align="center" prop="CONDATE" width="180">
  39. <template #default="scope">
  40. <span>{{ parseTime(scope.row.CONDATE, '{y}-{m}-{d}') }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="公示日期" align="center" prop="PUBLICDATE" width="180">
  44. <template #default="scope">
  45. <span>{{ parseTime(scope.row.PUBLICDATE, '{y}-{m}-{d}') }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="数据更新时间 (数据初始化或更新时间戳)" align="center" prop="sExtDatatime" width="180">
  49. <template #default="scope">
  50. <span>{{ parseTime(scope.row.sExtDatatime, '{y}-{m}-{d}') }}</span>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <div style="position: fixed;bottom: 20px;right: 10px;">
  55. <pagination
  56. v-show="total>0"
  57. :total="total"
  58. v-model:page="queryParams.pageNum"
  59. v-model:limit="queryParams.pageSize"
  60. @pagination="getList"
  61. />
  62. </div>
  63. <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
  64. <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
  65. :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
  66. :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
  67. <el-icon class="el-icon--upload">
  68. <upload-filled/>
  69. </el-icon>
  70. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  71. <template #tip>
  72. <div class="el-upload__tip text-center">
  73. <span>仅允许导入xls、xlsx格式文件。</span>
  74. </div>
  75. </template>
  76. </el-upload>
  77. <template #footer>
  78. <div class="dialog-footer">
  79. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  80. <el-button @click="upload.open = false">取 消</el-button>
  81. </div>
  82. </template>
  83. </el-dialog>
  84. </div>
  85. </template>
  86. <script setup name="Investors">
  87. import {
  88. listInvestors,
  89. getInvestors,
  90. delInvestors,
  91. delInvestorsBatch
  92. } from "@/api/basicData/xcrEnterprisePublicationSupplySubscribedDetailsInvestors";
  93. import {reactive, ref, toRaw} from "vue";
  94. import {getToken} from "@/utils/auth";
  95. import {ElMessage} from "element-plus";
  96. import {likeQueryMethod} from "@/utils/likeQueryMethod";
  97. const {proxy} = getCurrentInstance();
  98. const xcrEnterprisePublicationSupplySubscribedDetailsInvestorsList = ref([]);
  99. const open = ref(false);
  100. const loading = ref(true);
  101. const showSearch = ref(true);
  102. const ids = ref([]);
  103. const single = ref(true);
  104. const multiple = ref(true);
  105. const total = ref(0);
  106. const title = ref("");
  107. const upload = reactive({
  108. // 是否显示弹出层(用户导入)
  109. open: false,
  110. // 弹出层标题(用户导入)
  111. title: '',
  112. // 是否禁用上传
  113. isUploading: false,
  114. // 设置上传的请求头部
  115. headers: {Authorization: getToken()},
  116. // 上传的地址
  117. url: import.meta.env.VITE_APP_BASE_API + '/xcrEnterprisePublicationSupplySubscribedDetailsInvestors/importData'
  118. })
  119. const handleFileSuccess = (e) => {
  120. if (e.code == 200) {
  121. ElMessage({
  122. type: "success",
  123. message: e.msg
  124. })
  125. getList()
  126. proxy.$refs['uploadRef']?.clearFiles()
  127. } else {
  128. ElMessage({
  129. type: "error",
  130. message: e.msg
  131. })
  132. proxy.$refs['uploadRef']?.clearFiles()
  133. }
  134. }
  135. function submitFileForm() {
  136. proxy.$refs['uploadRef']?.submit();
  137. upload.open = false;
  138. }
  139. function handleImport() {
  140. upload.open = true
  141. }
  142. const data = reactive({
  143. form: {},
  144. queryParams: {
  145. pageNum: 1,
  146. pageSize: 20,
  147. SUBID: null,
  148. INVID: null,
  149. INV: null,
  150. SUBCONAM: null,
  151. CONFORM: null,
  152. conformCn: null,
  153. CONDATE: null,
  154. PUBLICDATE: null,
  155. sExtDatatime: null,
  156. uniCode: ''
  157. },
  158. rules: {
  159. }
  160. });
  161. const {queryParams, form, rules} = toRefs(data);
  162. /** 查询企业公示_出资人认缴明细列表 */
  163. function getList() {
  164. loading.value = true;
  165. let toServerObj = likeQueryMethod('uni_code', queryParams.value.uniCode, queryParams.value.pageNum, queryParams.value.pageSize);
  166. listInvestors(toServerObj).then(response => {
  167. xcrEnterprisePublicationSupplySubscribedDetailsInvestorsList.value = response.records;
  168. total.value = response.total;
  169. loading.value = false;
  170. });
  171. }
  172. // 表单重置
  173. function reset() {
  174. form.value = {
  175. xhCodeId: null,
  176. SUBID: null,
  177. INVID: null,
  178. INV: null,
  179. SUBCONAM: null,
  180. CONFORM: null,
  181. conformCn: null,
  182. CONDATE: null,
  183. PUBLICDATE: null,
  184. sExtDatatime: null,
  185. uniCode: ''
  186. };
  187. proxy.resetForm("xcrEnterprisePublicationSupplySubscribedDetailsInvestorsRef");
  188. }
  189. /** 搜索按钮操作 */
  190. function handleQuery() {
  191. queryParams.value.pageNum = 1;
  192. getList();
  193. }
  194. /** 重置按钮操作 */
  195. function resetQuery() {
  196. proxy.resetForm("queryRef");
  197. handleQuery();
  198. }
  199. // 多选框选中数据
  200. function handleSelectionChange(selection) {
  201. ids.value = selection.map(item => item.xhCodeId);
  202. single.value = selection.length != 1;
  203. multiple.value = !selection.length;
  204. }
  205. /** 删除按钮操作 */
  206. async function handleDelete(row) {
  207. const res = await delInvestors();
  208. if(res.code == 200){
  209. ElMessage({
  210. type:'success',
  211. message:'删除成功'
  212. })
  213. getList();
  214. }
  215. }
  216. /** 批量删除*/
  217. const batchDelete = (row)=>{
  218. const idsToS = row.xhCodeId || ids.value;
  219. (proxy.$modal).confirm('是否确认删除这' + idsToS.length+'条的数据项?').then(function() {
  220. return delInvestorsBatch(toRaw(idsToS));
  221. }).then(() => {
  222. getList();
  223. proxy.$modal.msgSuccess("删除成功");
  224. }).catch(() => {});
  225. }
  226. /** 导出按钮操作 */
  227. function handleExport() {
  228. proxy.download('basicData/xcrEnterprisePublicationSupplySubscribedDetailsInvestors/export', {
  229. ...queryParams.value
  230. }, `企业公示_出资人认缴明细_${new Date().getTime()}.xlsx`)
  231. }
  232. getList();
  233. </script>