MyApply.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <div class="h100 my-apply">
  3. <div class="apply-main-c">
  4. <div class="form-a bg-k"><diy-el-form :forms="myApplyHomeFilterForm" v-model:model-form="form">
  5. <template #applyBtn>
  6. <el-button type='primary'
  7. class="color-w"
  8. @click="initSearch">查询</el-button>
  9. </template>
  10. </diy-el-form></div>
  11. <div class="main-c bg-k">
  12. <div class="flex1">
  13. <my-table
  14. :is-height-by-auto="false"
  15. :has-operation="true"
  16. :table-data="tableData"
  17. :headers="tableHeader"
  18. >
  19. <template #useTime="{data}">
  20. <span v-if="data.status == '1'">
  21. 一天
  22. </span>
  23. <span v-if="data.status == '2'">
  24. 二天
  25. </span>
  26. <span v-if="data.status == '3'">
  27. 三天
  28. </span>
  29. <span v-if="data.status == '4'">
  30. 四天
  31. </span>
  32. <span v-if="data.status == '5'">
  33. 五天
  34. </span>
  35. <span v-if="data.status == '6'">
  36. 六天
  37. </span>
  38. <span v-if="data.status == '7'">
  39. 七天
  40. </span>
  41. </template>
  42. <template #status="{data}">
  43. <span v-if="data.status == '1'">
  44. 待受理
  45. </span>
  46. <span v-if="data.status == '2'">
  47. 待审核
  48. </span>
  49. <span v-if="data.status == '3'">
  50. 受理不通过
  51. </span>
  52. <span v-if="data.status == '4'">
  53. 审核不通过
  54. </span>
  55. <span v-if="data.status == '5'">
  56. 审核通过
  57. </span>
  58. </template>
  59. <template #operation="{data}">
  60. <!-- <el-link type="primary" class="link-to" @click="openExportDialog('export',data)" v-if="form.type === '1' ">下载</el-link>-->
  61. <el-link type="primary" class="link-to" @click="openExportDialog('export',data)" v-if="form.type === '1' && data.BACKUPS_TABLENAME">下载</el-link>
  62. <el-link type="primary" @click="openDetailDialog(data)">详情</el-link>
  63. </template>
  64. </my-table>
  65. </div>
  66. <ele-pagination
  67. ref="refEl"
  68. :page-sizes="[5,10,25,50,75,100]"
  69. background
  70. @sizeOrPageChange="handleSizeChange"
  71. class="page"
  72. :default-page-size="10"
  73. :layout="'slot,sizes,prev,pager,next'"
  74. :total-count="totalCount"
  75. />
  76. </div>
  77. </div>
  78. <template v-if="isExportDialogIsShow">
  79. <my-apply-export-dialog @exportFile="exportFile" v-model:dialog-visible="isExportDialogIsShow"/>
  80. </template>
  81. <template v-if="isResourceDetailDialogShow">
  82. <resource-detail-dialog :current-op-obj="{
  83. ...currentDetailObj,
  84. isService:form.type ==='2',
  85. serviceUrl:currentDetailObj.S_USERNAME?serviceUrlB() + currentDetailObj.S_USERNAME+'/'+currentDetailObj.S_PASSWORD:''
  86. }" v-model:dialog-visible="isResourceDetailDialogShow"/>
  87. </template>
  88. <template v-if="isPipeResourceDetailDialogShow">
  89. <pipe-resource-detail-dialog :current-op-obj="currentDetailObj" v-model:dialog-visible="isPipeResourceDetailDialogShow"/>
  90. </template>
  91. </div>
  92. </template>
  93. <script>
  94. import DiyElForm from "@/components/common/DiyElForm.vue";
  95. import {myApplyHomeFilterForm} from "@/data/all-forms";
  96. import {computed, nextTick, onBeforeMount, onMounted, ref, watch} from "vue";
  97. import MyTable from "@/components/common/MyTable.vue";
  98. import {
  99. myApplyHomeTableHeaderData, myApplyHomeTableHeaderPipe,
  100. myApplyHomeTableHeaderService
  101. } from "@/data/alll-table-header";
  102. import {
  103. getMyApplyHomeTableDataFw,
  104. getMyApplyHomeTableDataPipe,
  105. getMyApplyHomeTableDataSj,
  106. selectToolResourceApplicationApplyPageList
  107. } from "@/service/my-apply";
  108. import {useDetailOrEdit, usePagination} from "@/unit/use-method/usePagination";
  109. import {useRootStore} from "@/pinia/useStore";
  110. import ElePagination from "@/components/common/ElePagination.vue";
  111. import {Delete, Search, SuccessFilled} from "@element-plus/icons-vue";
  112. import ResourceDetailDialog from "@/views/c-views/personal/ResourceDetailDialog.vue";
  113. import {serviceUrlB} from "@/service/config";
  114. import MyApplyExportDialog from "@/views/c-views/personal/MyApplyExportDialog.vue";
  115. import PipeResourceDetailDialog from "@/views/c-views/personal/PipeResourceDetailDialog.vue";
  116. let baseUrl = import.meta.env.VITE_BASE_API
  117. export default {
  118. name: "MyApply",
  119. methods: {
  120. serviceUrlB() {
  121. return serviceUrlB
  122. }
  123. },
  124. computed: {
  125. SuccessFilled() {
  126. return SuccessFilled
  127. },
  128. Delete() {
  129. return Delete
  130. },
  131. Search() {
  132. return Search
  133. }
  134. },
  135. components: {PipeResourceDetailDialog, MyApplyExportDialog, ResourceDetailDialog, ElePagination, MyTable, DiyElForm},
  136. setup() {
  137. function openDetailDialog(data) {
  138. if(form.value.type ==='3'){
  139. isPipeResourceDetailDialogShow.value = true
  140. }else{
  141. isResourceDetailDialogShow.value = true
  142. }
  143. currentDetailObj.value = data || {}
  144. }
  145. const {changeOperation:changeExportDOperation,currentOpObj:exportDCurrentOpObj,operationType:exportDOperation} = useDetailOrEdit()
  146. const form = ref({
  147. })
  148. function exportFile(type){
  149. let url = null
  150. if(type === 'Excel'){
  151. url = baseUrl + "/gxyw/fileExportVersion?TABLE_NAME="+exportDCurrentOpObj.value.BACKUPS_TABLENAME+"&appkey=" + store.userInfo.gxjh_userkeycode
  152. }else if (type === 'SHP'){
  153. url = baseUrl + "/gxyw/ShpFileZip?SERVER_NAME="+exportDCurrentOpObj.value.BACKUPS_TABLENAME+"&appkey=" + store.userInfo.gxjh_userkeycode
  154. }
  155. window.open(url,'_black')
  156. }
  157. function openExportDialog(op,it){
  158. isExportDialogIsShow.value = true
  159. changeExportDOperation(op,it)
  160. }
  161. const isExportDialogIsShow = ref(false)
  162. const currentDetailObj = ref(null)
  163. const isResourceDetailDialogShow = ref(false)
  164. const isPipeResourceDetailDialogShow = ref(false)
  165. const tableHeader = computed(() => {
  166. if(form.value.type ==='1'){
  167. return myApplyHomeTableHeaderData
  168. }else if(form.value.type ==='2'){
  169. return myApplyHomeTableHeaderService
  170. }else{
  171. return myApplyHomeTableHeaderPipe
  172. }
  173. })
  174. watch(() => form.value['type'],(val) => {
  175. form.value['name']=''
  176. tableData.value = []
  177. getDetailTableData()
  178. })
  179. function getDetailTableData(){
  180. nextTick(() => {
  181. console.log('form.value[\'type\']',form.value['type'] )
  182. let url
  183. if(form.value['type'] == 1){
  184. url = getMyApplyHomeTableDataSj;
  185. }else if(form.value['type'] == 2){
  186. url = getMyApplyHomeTableDataFw;
  187. }else{
  188. url = selectToolResourceApplicationApplyPageList;
  189. }
  190. url({
  191. name:form.value['name'],
  192. pageIndex:pageIndex.value,
  193. pageSize:pageSize.value,
  194. user_id:store.userInfo.gxjh_usercode,
  195. unitcode:store.userInfo.gxjh_unitcode
  196. }).then(res => {
  197. if(form.value['type'] == 3){
  198. tableData.value = res.data.Rows
  199. totalCount.value = res.data.TotalRowCount
  200. }else{
  201. tableData.value = res.msg[0].Rows
  202. totalCount.value = res.msg[0].TotalRowCount
  203. }
  204. })
  205. })
  206. }
  207. const store = useRootStore()
  208. const {pageIndex,pageSize,totalCount,tableData,refEl,handleSizeChange,initSearch} = usePagination(getDetailTableData)
  209. onMounted(() => {
  210. })
  211. return {
  212. myApplyHomeFilterForm,
  213. form,
  214. openDetailDialog,
  215. isResourceDetailDialogShow,
  216. isPipeResourceDetailDialogShow,
  217. currentDetailObj,
  218. tableHeader,
  219. pageIndex,pageSize,totalCount,tableData,refEl,handleSizeChange,initSearch,
  220. openExportDialog,
  221. isExportDialogIsShow,
  222. changeExportDOperation,exportDCurrentOpObj,exportDOperation,
  223. exportFile
  224. }
  225. }
  226. }
  227. </script>
  228. <style scoped lang="scss">
  229. :deep{
  230. .el-dialog__header{
  231. padding-top: 8px;
  232. padding-bottom: 20px;
  233. }
  234. .el-dialog__body{
  235. max-height: 400px;
  236. padding-top: 0px;
  237. overflow-y: auto;
  238. &::-webkit-scrollbar {
  239. width: 4px;
  240. }
  241. &::-webkit-scrollbar-thumb {
  242. border-radius: 10px;
  243. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  244. background: rgba(0,128,255, 0.8);
  245. }
  246. &::-webkit-scrollbar-track {
  247. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  248. border-radius: 0;
  249. background: rgba(0,128,255, 0.2);
  250. }
  251. }
  252. .el-input__wrapper{
  253. background-color:var(--theme-zysq-tab-background-color);
  254. }
  255. .el-input__inner{
  256. color:var(--theme-font-common-color);
  257. }
  258. .el-select-dropdown{
  259. background-color:var(--theme-zysq-tab-background-color);
  260. }
  261. .el-select-dropdown__item{
  262. color:var(--theme-font-common-color);
  263. }
  264. .el-select-dropdown__item:hover,.el-select-dropdown__item.hover{
  265. background-color:var(--theme-background-color);
  266. }
  267. }
  268. .my-apply{
  269. overflow: hidden;
  270. .main-c{
  271. margin-bottom: 20px;
  272. flex: 1;
  273. padding: 20px;
  274. }
  275. .form-a{
  276. padding-top: 20px;
  277. margin-bottom: 20px;
  278. margin-top: 20px;
  279. }
  280. .apply-main-c{
  281. padding-left: 20px;
  282. .main-c{
  283. display: flex;
  284. flex-direction: column;
  285. overflow: hidden;
  286. }
  287. height: 100%;
  288. display: flex;
  289. flex-direction: column;
  290. padding-right: 20px;
  291. }
  292. .title{
  293. font-size: 15px;
  294. padding: 15px;
  295. font-weight: 600;
  296. border-bottom: 1px solid #e7eaec;
  297. }
  298. .btns{
  299. text-align: right;
  300. margin-bottom: 20px;
  301. }
  302. }
  303. </style>