contractReviewList.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. },
  78. fromData:{},
  79. })
  80. // 搜索以及参数
  81. const columns = [
  82. { type: 'index', label: '序号', width: 80, align: 'center ' },
  83. { prop: 'T_audit', label: '状态', name: 'T_audit'},
  84. { prop: 'T_name', label: '项目名称' },
  85. { prop: 'T_address', label: '项目地址' },
  86. { prop: 'T_submit_name', label: '项目负责人' },
  87. { prop: 'T_predict_sign_time', label: '预计签约时间' },
  88. { prop: 'T_money', label: '总金额' },
  89. { prop: 'T_discount_money', label: '最终优惠金额' },
  90. { prop: 'T_have_brokerage_fee', label: '是否有居间费', name: 'T_have_brokerage_fee' },
  91. { prop: 'T_brokerage_fee_money', label: '居间费金额' },
  92. { prop: 'operation', label: '操作', fixed: 'right',width:'300px' }
  93. ]
  94. const onclicksearch = (row: any) => {
  95. TableRef.value?.getTableList()
  96. }
  97. /**
  98. * 编辑
  99. * @param tit
  100. * @param row
  101. */
  102. const openDrawer = (tit:string,row: any) => {
  103. btnRef.value.outerVisible = true
  104. btnRef.value.data.drawerTiti = tit
  105. data.fromData = row
  106. }
  107. /**
  108. * 删除
  109. * @param row
  110. */
  111. const openDelect = (row: any) => {
  112. ElMessageBox.confirm('删除操作,是否执行操作?','删除',{
  113. confirmButtonText: '立即删除',
  114. cancelButtonText: '取消',
  115. type: 'warning',
  116. center: true,
  117. }).then(async() => {
  118. const result:any = await ContractReview_Del_Post({T_id:row.Id})
  119. if(result.Code==200){
  120. ElMessage.success('删除成功')
  121. TableRef.value?.getTableList()
  122. }
  123. }).catch(() => {})
  124. }
  125. /**
  126. * 提交审核
  127. */
  128. const SubmitAudit = async(row: any) => {
  129. const result:any = await ContractReview_Submit_Post({T_id:row.Id})
  130. if(result.Code==200){
  131. ElMessage.success('审核提交成功')
  132. TableRef.value?.getTableList()
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. /* @import url(); 引入css类 */
  138. </style>