index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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="!guaranteeList.length"
  25. v-hasPermi="['basicData:xcrExternalGuarantee:export']"
  26. >导出
  27. </el-button>
  28. </el-col>
  29. </el-row>
  30. <el-table v-loading="loading" :data="guaranteeList" height="650" @selection-change="handleSelectionChange">
  31. <el-table-column label="对外担保标识ID" align="center" prop="MOREID" :show-overflow-tooltip='true'/>
  32. <el-table-column label="年报ID" align="center" prop="ANCHEID" :show-overflow-tooltip='true'/>
  33. <el-table-column label="债权人" align="center" prop="MORE" :show-overflow-tooltip='true'/>
  34. <el-table-column label="债务人" align="center" prop="MORTGAGOR" :show-overflow-tooltip='true'/>
  35. <el-table-column label="主债权种类 1、合同,2、其他" align="center" prop="PRICLASECKIND" :show-overflow-tooltip='true'/>
  36. <el-table-column label="主债权数额" align="center" prop="PRICLASECAM" :show-overflow-tooltip='true'/>
  37. <el-table-column label="履行债务的期限自 YYYYMMDD" align="center" prop="PEFPERFORM" width="180">
  38. <template #default="scope">
  39. <span>{{ parseTime(scope.row.PEFPERFORM, '{y}-{m}-{d}') }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="履行债务的期限至 YYYYMMDD" align="center" prop="PEFPERTO" width="180">
  43. <template #default="scope">
  44. <span>{{ parseTime(scope.row.PEFPERTO, '{y}-{m}-{d}') }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="保证的期间 1、期限,2、未约定" align="center" prop="GUARANPERIOD" :show-overflow-tooltip='true'/>
  48. <el-table-column label="对外担保是否公示 1、是,2、否" align="center" prop="MOREDIS" :show-overflow-tooltip='true'/>
  49. <el-table-column label="${comment}" align="center" prop="ENTCHEYEAR" :show-overflow-tooltip='true'/>
  50. <el-table-column label="保证的方式 1、一般保证,2、连带保证,3、未约定" align="center" prop="GATYPE" :show-overflow-tooltip='true'/>
  51. <el-table-column label="数据初始化或更新时间戳" align="center" prop="sExtDatatime" width="180">
  52. <template #default="scope">
  53. <span>{{ parseTime(scope.row.sExtDatatime, '{y}-{m}-{d}') }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="统一社会信用代码" align="center" prop="uniCode" width="200"/>
  57. </el-table>
  58. <div style="position: fixed;bottom: 20px;right: 10px;">
  59. <pagination
  60. v-show="total>0"
  61. :total="total"
  62. v-model:page="queryParams.pageNum"
  63. v-model:limit="queryParams.pageSize"
  64. @pagination="getList"
  65. />
  66. </div>
  67. <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
  68. <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
  69. :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
  70. :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
  71. <el-icon class="el-icon--upload">
  72. <upload-filled/>
  73. </el-icon>
  74. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  75. <template #tip>
  76. <div class="el-upload__tip text-center">
  77. <span>仅允许导入xls、xlsx格式文件。</span>
  78. </div>
  79. </template>
  80. </el-upload>
  81. <template #footer>
  82. <div class="dialog-footer">
  83. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  84. <el-button @click="upload.open = false">取 消</el-button>
  85. </div>
  86. </template>
  87. </el-dialog>
  88. </div>
  89. </template>
  90. <script setup name="Guarantee">
  91. import {
  92. listGuarantee,
  93. getGuarantee,
  94. delGuarantee,
  95. delGuaranteeBatch
  96. } from "@/api/basicData/xcrExternalGuarantee";
  97. import {reactive, ref, toRaw} from "vue";
  98. import {getToken} from "@/utils/auth";
  99. import {ElMessage} from "element-plus";
  100. import {likeQueryMethod} from "@/utils/likeQueryMethod";
  101. const {proxy} = getCurrentInstance();
  102. const guaranteeList = ref([]);
  103. const open = ref(false);
  104. const loading = ref(true);
  105. const showSearch = ref(true);
  106. const ids = ref([]);
  107. const single = ref(true);
  108. const multiple = ref(true);
  109. const total = ref(0);
  110. const title = ref("");
  111. const upload = reactive({
  112. // 是否显示弹出层(用户导入)
  113. open: false,
  114. // 弹出层标题(用户导入)
  115. title: '',
  116. // 是否禁用上传
  117. isUploading: false,
  118. // 设置上传的请求头部
  119. headers: {Authorization: getToken()},
  120. // 上传的地址
  121. url: import.meta.env.VITE_APP_BASE_API + '/xcrExternalGuarantee/importData'
  122. })
  123. const handleFileSuccess = (e) => {
  124. if (e.code == 200) {
  125. ElMessage({
  126. type: "success",
  127. message: e.msg
  128. })
  129. getList()
  130. proxy.$refs['uploadRef']?.clearFiles()
  131. } else {
  132. ElMessage({
  133. type: "error",
  134. message: e.msg
  135. })
  136. proxy.$refs['uploadRef']?.clearFiles()
  137. }
  138. }
  139. function submitFileForm() {
  140. proxy.$refs['uploadRef']?.submit();
  141. upload.open = false;
  142. }
  143. function handleImport() {
  144. upload.open = true
  145. }
  146. const data = reactive({
  147. form: {},
  148. queryParams: {
  149. pageNum: 1,
  150. pageSize: 20,
  151. MOREID: null,
  152. ANCHEID: null,
  153. MORE: null,
  154. MORTGAGOR: null,
  155. PRICLASECKIND: null,
  156. PRICLASECAM: null,
  157. PEFPERFORM: null,
  158. PEFPERTO: null,
  159. GUARANPERIOD: null,
  160. MOREDIS: null,
  161. ENTCHEYEAR: null,
  162. GATYPE: null,
  163. sExtDatatime: null,
  164. uniCode: ''
  165. },
  166. rules: {
  167. }
  168. });
  169. const {queryParams, form, rules} = toRefs(data);
  170. /** 查询企业年报对外提供保证担保信息列表 */
  171. function getList() {
  172. loading.value = true;
  173. let toServerObj = likeQueryMethod('uni_code', queryParams.value.uniCode, queryParams.value.pageNum, queryParams.value.pageSize);
  174. listGuarantee(toServerObj).then(response => {
  175. guaranteeList.value = response.records;
  176. total.value = response.total;
  177. loading.value = false;
  178. });
  179. }
  180. // 表单重置
  181. function reset() {
  182. form.value = {
  183. xhCodeId: null,
  184. MOREID: null,
  185. ANCHEID: null,
  186. MORE: null,
  187. MORTGAGOR: null,
  188. PRICLASECKIND: null,
  189. PRICLASECAM: null,
  190. PEFPERFORM: null,
  191. PEFPERTO: null,
  192. GUARANPERIOD: null,
  193. MOREDIS: null,
  194. ENTCHEYEAR: null,
  195. GATYPE: null,
  196. sExtDatatime: null,
  197. uniCode: ''
  198. };
  199. proxy.resetForm("guaranteeRef");
  200. }
  201. /** 搜索按钮操作 */
  202. function handleQuery() {
  203. queryParams.value.pageNum = 1;
  204. getList();
  205. }
  206. /** 重置按钮操作 */
  207. function resetQuery() {
  208. proxy.resetForm("queryRef");
  209. handleQuery();
  210. }
  211. // 多选框选中数据
  212. function handleSelectionChange(selection) {
  213. ids.value = selection.map(item => item.xhCodeId);
  214. single.value = selection.length != 1;
  215. multiple.value = !selection.length;
  216. }
  217. /** 删除按钮操作 */
  218. async function handleDelete(row) {
  219. const res = await delGuarantee();
  220. if(res.code == 200){
  221. ElMessage({
  222. type:'success',
  223. message:'删除成功'
  224. })
  225. getList();
  226. }
  227. }
  228. /** 批量删除*/
  229. const batchDelete = (row)=>{
  230. const idsToS = row.xhCodeId || ids.value;
  231. (proxy.$modal).confirm('是否确认删除这' + idsToS.length+'条的数据项?').then(function() {
  232. return delGuaranteeBatch(toRaw(idsToS));
  233. }).then(() => {
  234. getList();
  235. proxy.$modal.msgSuccess("删除成功");
  236. }).catch(() => {});
  237. }
  238. /** 导出按钮操作 */
  239. function handleExport() {
  240. proxy.download('basicData/xcrExternalGuarantee/export', {
  241. ...queryParams.value
  242. }, `企业年报对外提供保证担保信息_${new Date().getTime()}.xlsx`)
  243. }
  244. getList();
  245. </script>