index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="sensitive-words">
  3. <pageSearch ref="searchTableRef" :searchConfig="searchConfig">
  4. <template #checkAgency="scope">
  5. <el-tree-select
  6. v-model="scope.value"
  7. :data="treeData"
  8. node-key="strId"
  9. filterable
  10. @change="newVal => onMessageChange(scope, newVal)"
  11. placeholder="请选择检查机构"
  12. />
  13. </template>
  14. </pageSearch>
  15. <pageContent ref="tableListRef" :total="total" :contentConfig="contentConfig" :pageList="tableData">
  16. <template #button>
  17. <el-button type="primary" @click="handleExport()">导出</el-button>
  18. </template>
  19. <template #operate="scope">
  20. <el-button type="primary" plain @click="handleCheck(scope.row.shipId)"> 查看 </el-button>
  21. <el-button type="primary" plain @click="handlePublish(scope.row.shipId)"> 发布通报 </el-button>
  22. <el-button type="primary" @click="handleStatus(scope.row.shipId, '2', '不予通报')">
  23. 不予通报
  24. </el-button>
  25. </template>
  26. </pageContent>
  27. </div>
  28. </template>
  29. <script setup lang="ts">
  30. import { useRouter } from 'vue-router';
  31. import contentConfig from './config/content.config';
  32. import pageContent from '@/components/components/pageContent.vue';
  33. import searchConfig from './config/search.config';
  34. import pageSearch from '@/components/components/pageSearch.vue';
  35. import useSystemStore from '@/store/main';
  36. import { outTypeList } from '@/libs/commonMeth';
  37. import useDeptStore from '@/store/modules/dept';
  38. import { TreeOptions } from '@/types/global';
  39. const systemStore = useSystemStore();
  40. import {
  41. categoryOnm,
  42. bj_notification_type,
  43. bj_ship_delayed,
  44. bj_hand_opinion,
  45. bj_ship_port_registration,
  46. bj_initial_review_mark,
  47. } from '@/plugins/dictData';
  48. const bj_ship_type = outTypeList('bj_ship_type'); // 船舶种类
  49. const total = ref(0);
  50. const pageSize = ref([10, 20, 30]);
  51. const tableData = ref([]);
  52. const tableListRef = ref();
  53. const router = useRouter();
  54. // 操作弹框
  55. import usePageModal from '@/components/components/hooks/usePageDetails';
  56. const { modalRef, handleNewDataClick, handleEditDataClick, handleCheckDataClick, handlePageDetail } =
  57. usePageModal();
  58. const handleCheck = async (id?: string) => {
  59. router.push({
  60. path: '/notificationInfoInquiry/securityCheckDetail',
  61. query: { id: id },
  62. });
  63. };
  64. const handleExport = () => {
  65. ElMessage.success('小编在努力开发中。。。');
  66. return;
  67. };
  68. const onMessageChange = (scope, newVal) => {
  69. scope.onInput(newVal);
  70. };
  71. // 通报发布
  72. const handlePublish = releasedId => {
  73. ElMessage.success('小编在努力开发中。。。');
  74. return;
  75. router.push({
  76. path: '/notificationInfoInquiry/publish',
  77. query: { type: 'edit', releasedId: releasedId },
  78. });
  79. };
  80. const searchTableRef = ref();
  81. // 状态按钮
  82. function handleStatus(value: string, status: string, str: string) {
  83. ElMessage.success('小编在努力开发中。。。');
  84. return;
  85. // ElMessageBox.confirm(`是否${str}这条数据?`, '状态提示', {
  86. // confirmButtonText: '确定',
  87. // cancelButtonText: '取消',
  88. // type: 'warning',
  89. // })
  90. // .then(async () => {
  91. // const postData: any = await changeInventoryStatus(value, status);
  92. // if (postData.code === 200) {
  93. // tableListRef.value[0].fetchPageListData();
  94. // ElMessage.success('操作成功!');
  95. // } else {
  96. // ElMessage.error('操作失败!');
  97. // }
  98. // })
  99. // .catch(() => {
  100. // ElMessage({
  101. // type: 'info',
  102. // message: '取消操作',
  103. // });
  104. // });
  105. }
  106. // 删除按钮
  107. function handleDelete(value: any) {
  108. ElMessageBox.confirm('是否删除这条数据?', '删除提示', {
  109. confirmButtonText: '确定',
  110. cancelButtonText: '取消',
  111. type: 'warning',
  112. })
  113. .then(() => {
  114. systemStore.deletePageDataAction(contentConfig.pageName, value);
  115. })
  116. .catch(() => {
  117. ElMessage({
  118. type: 'info',
  119. message: '取消删除',
  120. });
  121. });
  122. }
  123. // 筛选-状态赋值
  124. async function searchItem() {
  125. searchConfig.formItems.forEach(item => {
  126. if (item.prop === 'notificationType') {
  127. item.options = bj_notification_type;
  128. }
  129. if (item.prop === 'conm') {
  130. item.options = categoryOnm;
  131. }
  132. if (item.prop === 'initial_review_mark') {
  133. item.options = bj_initial_review_mark;
  134. }
  135. if (item.prop === 'portOfRegistry') {
  136. item.options = bj_ship_port_registration;
  137. }
  138. if (item.prop === 'ship_delayed') {
  139. item.options = bj_ship_delayed;
  140. }
  141. if (item.prop === 'hand_opinion') {
  142. item.options = bj_hand_opinion;
  143. }
  144. });
  145. }
  146. searchItem();
  147. const treeData = ref<TreeOptions[]>();
  148. const deptStore = useDeptStore();
  149. onMounted(async () => {
  150. // 加载组织架构
  151. if (!deptStore.hasDeptData) {
  152. await deptStore.loadDeptDataFromCache();
  153. }
  154. treeData.value = deptStore.deptData;
  155. });
  156. </script>
  157. <style scoped lang="scss">
  158. .sensitive-words {
  159. margin: 20px;
  160. // background-color: #fff;
  161. }
  162. .status {
  163. cursor: pointer;
  164. position: relative;
  165. .status-tip {
  166. position: absolute;
  167. top: 2px;
  168. left: 60px;
  169. }
  170. }
  171. .dialog-tip {
  172. text-align: center;
  173. }
  174. </style>