index.vue 9.1 KB

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