contractReviewList.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="">
  3. <TableBase ref="TableRef" border :columns="columns" :requestApi="ContractReview_List_Post" :initParam="data.initParam">
  4. <template #table-header>
  5. <div style="display: flex;justify-content: space-between;flex-wrap: wrap;flex: 1;">
  6. <el-form :inline="true" :model="data.initParam" class="demo-form-inline">
  7. <el-form-item label="项目名称">
  8. <el-input v-model="data.initParam.T_name" placeholder="搜索项目名称" />
  9. </el-form-item>
  10. <el-form-item label="状态">
  11. <el-select v-model="data.initParam.T_audit" placeholder="请选择状态">
  12. <el-option v-for="item in optionReviewList" :key="item.value" :label="item.name" :value="item.value" />
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button type="primary" @click="onclicksearch">查询</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <contractReviewListAdd ref="btnRef" :fromData="data.fromData" @successFun="successFun"></contractReviewListAdd>
  20. </div>
  21. </template>
  22. <template #T_audit="{ row }">
  23. <el-tag :type="
  24. [1,2].includes(row.T_audit)?'warning':
  25. [3,5].includes(row.T_audit)?'primary':
  26. [4,6].includes(row.T_audit)?'danger':''">
  27. {{
  28. row.T_audit=='1'?'待提交审核':
  29. row.T_audit=='2'?'待审核':
  30. row.T_audit=='3'?'财务通过':
  31. row.T_audit=='4'?'财务驳回':
  32. row.T_audit=='5'?'总经理通过':
  33. row.T_audit=='6'?'总经理驳回':''
  34. }}
  35. </el-tag>
  36. </template>
  37. <template #T_have_brokerage_fee="{ row }">
  38. <el-tag :type="row.T_have_brokerage_fee?'primary':'success'">
  39. {{ row.T_have_brokerage_fee?'是':'否' }}
  40. </el-tag>
  41. </template>
  42. <template #right="{ row }">
  43. {{ }}
  44. <el-button link type="primary" size="small" :icon="View" @click="openDrawer('详情', row)">详情</el-button>
  45. <el-button link type="primary" size="small" :disabled="[1,4,6].includes(row.T_audit)?false:true"
  46. icon="Check" @click="SubmitAudit(row)" >提交审核</el-button>
  47. <el-button link type="primary" size="small" :disabled="[1,2,4,6].includes(row.T_audit)?false:true"
  48. :icon="Edit" @click="openDrawer('编辑', row)">编辑</el-button>
  49. <el-button link type="danger" size="small" :disabled="[1,2,4,6].includes(row.T_audit)?false:true"
  50. :icon="Delete" @click="openDelect(row)">删除</el-button>
  51. </template>
  52. </TableBase>
  53. </div>
  54. </template>
  55. <script setup lang='ts'>
  56. import { ref, reactive,computed } from 'vue';
  57. import { View,Check,Edit, Delete } from '@element-plus/icons-vue'
  58. import { ElMessage, ElMessageBox } from 'element-plus'
  59. import { GlobalStore } from '@/stores/index'
  60. import contractReviewListAdd from './modules/contractReviewListAdd.vue'
  61. import { optionReviewList } from './modules/optionsData'
  62. import { ContractReview_Del_Post,ContractReview_Submit_Post} from '@/api/contractReview/index'
  63. import TableBase from '@/components/TableBase/index.vue'
  64. import { ContractReview_List_Post} from '@/api/contractReview/index'
  65. const globalStore = GlobalStore()
  66. const TableRef = ref()
  67. const btnRef = ref()
  68. const successFun = async (data:any)=>{
  69. TableRef.value?.getTableList()
  70. }
  71. const data = reactive({
  72. initParam :{
  73. User_tokey: globalStore.GET_User_tokey,
  74. T_name: '',
  75. T_submit: '',
  76. T_audit: '',
  77. page: 1,
  78. page_z: 10,
  79. },
  80. fromData:{},
  81. })
  82. // 搜索以及参数
  83. const columns = [
  84. { type: 'index', label: '序号', width: 80, align: 'center ' },
  85. { prop: 'T_audit', label: '状态', name: 'T_audit'},
  86. { prop: 'T_name', label: '项目名称' },
  87. { prop: 'T_address', label: '项目地址' },
  88. { prop: 'T_submit_name', label: '项目负责人' },
  89. { prop: 'T_predict_sign_time', label: '预计签约时间' },
  90. { prop: 'T_money', label: '总金额' },
  91. { prop: 'T_discount_money', label: '最终优惠金额' },
  92. { prop: 'T_have_brokerage_fee', label: '是否有居间费', name: 'T_have_brokerage_fee' },
  93. { prop: 'T_brokerage_fee_money', label: '居间费金额' },
  94. { prop: 'operation', label: '操作', fixed: 'right',width:'300px' }
  95. ]
  96. const onclicksearch = (row: any) => {
  97. TableRef.value?.getTableList()
  98. }
  99. /**
  100. * 编辑
  101. * @param tit
  102. * @param row
  103. */
  104. const openDrawer = (tit:string,row: any) => {
  105. btnRef.value.outerVisible = true
  106. btnRef.value.data.drawerTiti = tit
  107. data.fromData = row
  108. }
  109. /**
  110. * 删除
  111. * @param row
  112. */
  113. const openDelect = (row: any) => {
  114. ElMessageBox.confirm('删除操作,是否执行操作?','删除',{
  115. confirmButtonText: '立即删除',
  116. cancelButtonText: '取消',
  117. type: 'warning',
  118. center: true,
  119. }).then(async() => {
  120. const result:any = await ContractReview_Del_Post({T_id:row.Id})
  121. if(result.Code==200){
  122. ElMessage.success('删除成功')
  123. TableRef.value?.getTableList()
  124. }
  125. }).catch(() => {})
  126. }
  127. /**
  128. * 提交审核
  129. */
  130. const SubmitAudit = async(row: any) => {
  131. const result:any = await ContractReview_Submit_Post({T_id:row.Id})
  132. if(result.Code==200){
  133. ElMessage.success('审核提交成功')
  134. TableRef.value?.getTableList()
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. /* @import url(); 引入css类 */
  140. </style>