index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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="!informationList.length"
  25. v-hasPermi="['basicData:xcrEnterpriseBasicInformation:export']"
  26. >导出
  27. </el-button>
  28. </el-col>
  29. </el-row>
  30. <el-table v-loading="loading" :data="informationList" height="650" @selection-change="handleSelectionChange">
  31. <el-table-column label="主体身份代码" align="center" prop="PRIPID" :show-overflow-tooltip='true'/>
  32. <el-table-column label="统一社会信用代码" align="center" prop="UNISCID" :show-overflow-tooltip='true'/>
  33. <el-table-column label="企业" align="center" prop="ENTNAME" :show-overflow-tooltip='true'/>
  34. <el-table-column label="注册号" align="center" prop="REGNO" :show-overflow-tooltip='true'/>
  35. <el-table-column label="市场主体类型" align="center" prop="ENTTYPE" :show-overflow-tooltip='true'/>
  36. <el-table-column label="市场主体类型" align="center" prop="enttypeCn" :show-overflow-tooltip='true'/>
  37. <el-table-column label="行业门类" align="center" prop="INDUSTRYPHY" :show-overflow-tooltip='true'/>
  38. <el-table-column label="行业代码" align="center" prop="INDUSTRYCO" :show-overflow-tooltip='true'/>
  39. <el-table-column label="成立日期" align="center" prop="ESTDATE" width="180">
  40. <template #default="scope">
  41. <span>{{ parseTime(scope.row.ESTDATE, '{y}-{m}-{d}') }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="登记机关" align="center" prop="REGORG" :show-overflow-tooltip='true'/>
  45. <el-table-column label="登记机关" align="center" prop="regorgCn" :show-overflow-tooltip='true'/>
  46. <el-table-column label="业务范围类型" align="center" prop="OPSCOTYPE" :show-overflow-tooltip='true'/>
  47. <el-table-column label="业务范围类型" align="center" prop="opscotypeCn" :show-overflow-tooltip='true'/>
  48. <el-table-column label="经营范围" align="center" prop="OPSCOPE" :show-overflow-tooltip='true'/>
  49. <el-table-column label="经营(驻在)期限自" align="center" prop="OPFROM" width="180">
  50. <template #default="scope">
  51. <span>{{ parseTime(scope.row.OPFROM, '{y}-{m}-{d}') }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="经营(驻在)期限至" align="center" prop="OPTO" width="180">
  55. <template #default="scope">
  56. <span>{{ parseTime(scope.row.OPTO, '{y}-{m}-{d}') }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="登记状态" align="center" prop="REGSTATE" :show-overflow-tooltip='true'/>
  60. <el-table-column label="登记状态" align="center" prop="regstateCn" :show-overflow-tooltip='true'/>
  61. <el-table-column label="住所所在行政区划" align="center" prop="DOMDISTRICT" :show-overflow-tooltip='true'/>
  62. <el-table-column label="住所" align="center" prop="DOM" :show-overflow-tooltip='true'/>
  63. <el-table-column label="注册资本(金)" align="center" prop="REGCAP" :show-overflow-tooltip='true'/>
  64. <el-table-column label="注册资本(金)币种" align="center" prop="REGCAPCUR" :show-overflow-tooltip='true'/>
  65. <el-table-column label="注册资本(金)币种" align="center" prop="regcapcurCn" :show-overflow-tooltip='true'/>
  66. <el-table-column label="注册资本(金)折万美元" align="center" prop="REGCAPUSD" :show-overflow-tooltip='true'/>
  67. <el-table-column label="实收资本" align="center" prop="RECCAP" :show-overflow-tooltip='true'/>
  68. <el-table-column label="实收资本折万美元" align="center" prop="RECCAPUSD" :show-overflow-tooltip='true'/>
  69. <el-table-column label="国别(地区)" align="center" prop="COUNTRY" :show-overflow-tooltip='true'/>
  70. <el-table-column label="从业人员/农专成员总数" align="center" prop="EMPNUM" :show-overflow-tooltip='true'/>
  71. <el-table-column label="是否城镇" align="center" prop="TOWN" :show-overflow-tooltip='true'/>
  72. <el-table-column label="法定代表人" align="center" prop="NAME" :show-overflow-tooltip='true'/>
  73. <el-table-column label="统计企业类型" align="center" prop="REPORTTYPE" :show-overflow-tooltip='true'/>
  74. <el-table-column label="核准日期" align="center" prop="APPRDATE" width="180">
  75. <template #default="scope">
  76. <span>{{ parseTime(scope.row.APPRDATE, '{y}-{m}-{d}') }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="数据更新时间" align="center" prop="sExtDatatime" width="180">
  80. <template #default="scope">
  81. <span>{{ parseTime(scope.row.sExtDatatime, '{y}-{m}-{d}') }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="统一社会信用代码" align="center" prop="uniCode" width="200"/>
  85. <el-table-column label="${comment}" align="center" prop="etpsId" :show-overflow-tooltip='true'/>
  86. </el-table>
  87. <div style="position: fixed;bottom: 20px;right: 10px;">
  88. <pagination
  89. v-show="total>0"
  90. :total="total"
  91. v-model:page="queryParams.pageNum"
  92. v-model:limit="queryParams.pageSize"
  93. @pagination="getList"
  94. />
  95. </div>
  96. <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
  97. <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
  98. :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
  99. :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
  100. <el-icon class="el-icon--upload">
  101. <upload-filled/>
  102. </el-icon>
  103. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  104. <template #tip>
  105. <div class="el-upload__tip text-center">
  106. <span>仅允许导入xls、xlsx格式文件。</span>
  107. </div>
  108. </template>
  109. </el-upload>
  110. <template #footer>
  111. <div class="dialog-footer">
  112. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  113. <el-button @click="upload.open = false">取 消</el-button>
  114. </div>
  115. </template>
  116. </el-dialog>
  117. </div>
  118. </template>
  119. <script setup name="Information">
  120. import {
  121. listInformation,
  122. getInformation,
  123. delInformation,
  124. delInformationBatch
  125. } from "@/api/basicData/xcrEnterpriseBasicInformation";
  126. import {reactive, ref, toRaw} from "vue";
  127. import {getToken} from "@/utils/auth";
  128. import {ElMessage} from "element-plus";
  129. import {likeQueryMethod} from "@/utils/likeQueryMethod";
  130. const {proxy} = getCurrentInstance();
  131. const informationList = ref([]);
  132. const open = ref(false);
  133. const loading = ref(true);
  134. const showSearch = ref(true);
  135. const ids = ref([]);
  136. const single = ref(true);
  137. const multiple = ref(true);
  138. const total = ref(0);
  139. const title = ref("");
  140. const upload = reactive({
  141. // 是否显示弹出层(用户导入)
  142. open: false,
  143. // 弹出层标题(用户导入)
  144. title: '',
  145. // 是否禁用上传
  146. isUploading: false,
  147. // 设置上传的请求头部
  148. headers: {Authorization: getToken()},
  149. // 上传的地址
  150. url: import.meta.env.VITE_APP_BASE_API + '/xcrEnterpriseBasicInformation/importData'
  151. })
  152. const handleFileSuccess = (e) => {
  153. if (e.code == 200) {
  154. ElMessage({
  155. type: "success",
  156. message: e.msg
  157. })
  158. getList()
  159. proxy.$refs['uploadRef']?.clearFiles()
  160. } else {
  161. ElMessage({
  162. type: "error",
  163. message: e.msg
  164. })
  165. proxy.$refs['uploadRef']?.clearFiles()
  166. }
  167. }
  168. function submitFileForm() {
  169. proxy.$refs['uploadRef']?.submit();
  170. upload.open = false;
  171. }
  172. function handleImport() {
  173. upload.open = true
  174. }
  175. const data = reactive({
  176. form: {},
  177. queryParams: {
  178. pageNum: 1,
  179. pageSize: 20,
  180. PRIPID: null,
  181. UNISCID: null,
  182. ENTNAME: null,
  183. REGNO: null,
  184. ENTTYPE: null,
  185. enttypeCn: null,
  186. INDUSTRYPHY: null,
  187. INDUSTRYCO: null,
  188. ESTDATE: null,
  189. REGORG: null,
  190. regorgCn: null,
  191. OPSCOTYPE: null,
  192. opscotypeCn: null,
  193. OPSCOPE: null,
  194. OPFROM: null,
  195. OPTO: null,
  196. REGSTATE: null,
  197. regstateCn: null,
  198. DOMDISTRICT: null,
  199. DOM: null,
  200. REGCAP: null,
  201. REGCAPCUR: null,
  202. regcapcurCn: null,
  203. REGCAPUSD: null,
  204. RECCAP: null,
  205. RECCAPUSD: null,
  206. COUNTRY: null,
  207. EMPNUM: null,
  208. TOWN: null,
  209. NAME: null,
  210. REPORTTYPE: null,
  211. APPRDATE: null,
  212. sExtDatatime: null,
  213. uniCode: '',
  214. etpsId: null
  215. },
  216. rules: {
  217. }
  218. });
  219. const {queryParams, form, rules} = toRefs(data);
  220. /** 查询企业基本信息列表 */
  221. function getList() {
  222. loading.value = true;
  223. let toServerObj = likeQueryMethod('uni_code', queryParams.value.uniCode, queryParams.value.pageNum, queryParams.value.pageSize);
  224. listInformation(toServerObj).then(response => {
  225. informationList.value = response.records;
  226. total.value = response.total;
  227. loading.value = false;
  228. });
  229. }
  230. // 表单重置
  231. function reset() {
  232. form.value = {
  233. xhCodeId: null,
  234. PRIPID: null,
  235. UNISCID: null,
  236. ENTNAME: null,
  237. REGNO: null,
  238. ENTTYPE: null,
  239. enttypeCn: null,
  240. INDUSTRYPHY: null,
  241. INDUSTRYCO: null,
  242. ESTDATE: null,
  243. REGORG: null,
  244. regorgCn: null,
  245. OPSCOTYPE: null,
  246. opscotypeCn: null,
  247. OPSCOPE: null,
  248. OPFROM: null,
  249. OPTO: null,
  250. REGSTATE: null,
  251. regstateCn: null,
  252. DOMDISTRICT: null,
  253. DOM: null,
  254. REGCAP: null,
  255. REGCAPCUR: null,
  256. regcapcurCn: null,
  257. REGCAPUSD: null,
  258. RECCAP: null,
  259. RECCAPUSD: null,
  260. COUNTRY: null,
  261. EMPNUM: null,
  262. TOWN: null,
  263. NAME: null,
  264. REPORTTYPE: null,
  265. APPRDATE: null,
  266. sExtDatatime: null,
  267. uniCode: '',
  268. etpsId: null
  269. };
  270. proxy.resetForm("informationRef");
  271. }
  272. /** 搜索按钮操作 */
  273. function handleQuery() {
  274. queryParams.value.pageNum = 1;
  275. getList();
  276. }
  277. /** 重置按钮操作 */
  278. function resetQuery() {
  279. proxy.resetForm("queryRef");
  280. handleQuery();
  281. }
  282. // 多选框选中数据
  283. function handleSelectionChange(selection) {
  284. ids.value = selection.map(item => item.xhCodeId);
  285. single.value = selection.length != 1;
  286. multiple.value = !selection.length;
  287. }
  288. /** 删除按钮操作 */
  289. async function handleDelete(row) {
  290. const res = await delInformation();
  291. if(res.code == 200){
  292. ElMessage({
  293. type:'success',
  294. message:'删除成功'
  295. })
  296. getList();
  297. }
  298. }
  299. /** 批量删除*/
  300. const batchDelete = (row)=>{
  301. const idsToS = row.xhCodeId || ids.value;
  302. (proxy.$modal).confirm('是否确认删除这' + idsToS.length+'条的数据项?').then(function() {
  303. return delInformationBatch(toRaw(idsToS));
  304. }).then(() => {
  305. getList();
  306. proxy.$modal.msgSuccess("删除成功");
  307. }).catch(() => {});
  308. }
  309. /** 导出按钮操作 */
  310. function handleExport() {
  311. proxy.download('basicData/xcrEnterpriseBasicInformation/export', {
  312. ...queryParams.value
  313. }, `企业基本信息_${new Date().getTime()}.xlsx`)
  314. }
  315. getList();
  316. </script>