index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <div>
  3. <div class="bar-container">
  4. <el-row>
  5. <el-col :xs="24" :sm="12" :lg="6" :span="6" style="margin-right: 8px;">
  6. <el-input v-if="keyword" v-model="listQuery.keyword" placeholder="关键字搜索..." clearable>
  7. </el-input>
  8. </el-col>
  9. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  10. <el-select v-if="nodeCode" v-model="listQuery.nodeCode" placeholder="流程节点" clearable filterable class="filter-item" >
  11. <el-option v-for="(item, index) in nodes" :key="index" :label="item.name" :value="item.code" />
  12. </el-select>
  13. </el-col>
  14. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  15. <el-date-picker v-if="orderDateSearch" clearable v-model="orderDate" type="daterange" align="center" unlink-panels
  16. range-separator="至" start-placeholder="下单日期(开始)" end-placeholder="下单日期(结束)" :picker-options="pickerOptions"
  17. value-format="yyyy-MM-dd">
  18. </el-date-picker>
  19. </el-col>
  20. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  21. <el-button class="filter-item" type="success" @click="searchList" round>搜索
  22. </el-button>
  23. <el-button class="filter-item" round type="info" @click="resetSearch()">重置
  24. </el-button>
  25. <el-button class="filter-item" @click="moreSearch()" round>更多搜索<i :class="moreSearchIcon"></i>
  26. </el-button>
  27. <slot name="otherButton"></slot>
  28. </el-col>
  29. </el-row>
  30. <div v-if="business==='MAJOR_BUSINESS'" v-show="moreSearchBar" class="moreSearchStyle">
  31. <el-row class="row">
  32. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  33. <el-select v-if="financial" clearable v-model="listQuery.financial" placeholder="金融类型">
  34. <el-option :value="true" label="金融">金融</el-option>
  35. <el-option :value="false" label="非金融">非金融</el-option>
  36. </el-select>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  39. <el-input v-if="clientName" v-model="listQuery.clientName" placeholder="客户名称" clearable >
  40. </el-input>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  43. <el-select v-if="clientManager" clearable filterable v-model="listQuery.clientManagerId" placeholder="客户经理">
  44. <el-option v-for="(item, id) in clientManagers" :key="id" :label="item.name" :value="item.id" />
  45. </el-select>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  48. <el-select v-if="principal" v-model="listQuery.principalId" placeholder="负责人" clearable filterable class="filter-item"
  49. >
  50. <el-option v-for="(item, id) in principals" :key="id" :label="item.name" :value="item.id" />
  51. </el-select>
  52. </el-col>
  53. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  54. <el-select v-if="businessObjectType" clearable v-model="listQuery.businessObjectType" placeholder="评估对象类型">
  55. <el-option value="土地" label="土地">土地</el-option>
  56. <el-option value="房地产" label="房地产">房地产</el-option>
  57. </el-select>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="3" :span="6">
  60. <el-select v-if="department" clearable v-model="listQuery.departmentId" placeholder="接单部门">
  61. <el-option v-for="(d,id) in trunDep" :key="id" :label="d.name" :value="d.id"></el-option>
  62. </el-select>
  63. </el-col>
  64. </el-row>
  65. </div>
  66. <div v-if="business==='PERSONAL_BUSINESS'" v-show="moreSearchBar" class="moreSearchStyle">
  67. <el-row class="row">
  68. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  69. <el-input v-if="clientName" v-model="listQuery.clientName" placeholder="客户名称" clearable >
  70. </el-input>
  71. </el-col>
  72. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  73. <el-input v-if="clientSubName" v-model="listQuery.clientSubName" placeholder="业务来源" clearable >
  74. </el-input>
  75. </el-col>
  76. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  77. <el-input v-if="clientManager" v-model="listQuery.clientManager" placeholder="客户经理" clearable >
  78. </el-input>
  79. </el-col>
  80. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  81. <el-input v-if="outwardStaffName" v-model="listQuery.outwardStaffName" placeholder="外业人员" clearable >
  82. </el-input>
  83. </el-col>
  84. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  85. <el-input v-if="inwardStaffName" v-model="listQuery.inwardStaffName" placeholder="内业人员" clearable >
  86. </el-input>
  87. </el-col>
  88. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  89. <el-input v-if="pricingStaffName" v-model="listQuery.pricingStaffName" placeholder="定价内业" clearable >
  90. </el-input>
  91. </el-col>
  92. <el-col :xs="24" :sm="12" :lg="3" :span="6" style="margin-right: 8px;">
  93. <el-input v-if="handlerName" v-model="listQuery.handlerName" placeholder="处理人" clearable >
  94. </el-input>
  95. </el-col>
  96. </el-row>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. export default {
  103. name: "moreSerachBar",
  104. components: {
  105. },
  106. props: {
  107. listQuery:{
  108. type: Object,
  109. require:true
  110. },
  111. keyword:{
  112. type: Boolean,
  113. require:false,
  114. default:true
  115. },
  116. business:{
  117. type: String,
  118. require:true,
  119. },
  120. financial:{
  121. type: Boolean,
  122. require:false,
  123. default:true
  124. },
  125. nodeCode:{
  126. type: Boolean,
  127. require:false,
  128. default:true
  129. },
  130. clientName:{
  131. type: Boolean,
  132. require:false,
  133. default:true
  134. },
  135. clientManager:{
  136. type: Boolean,
  137. require:false,
  138. default:true
  139. },
  140. principal:{
  141. type: Boolean,
  142. require:false,
  143. default:true
  144. },
  145. department:{
  146. type: Boolean,
  147. require:false,
  148. default:true
  149. },
  150. orderDateSearch:{
  151. type: Boolean,
  152. require:false,
  153. default:true
  154. },
  155. businessObjectType:{
  156. type: Boolean,
  157. require:false,
  158. default:true
  159. },
  160. nodes:{
  161. type: Array,
  162. require:false,
  163. default:function(){
  164. return [];
  165. }
  166. },
  167. clientName:{
  168. type: Boolean,
  169. require:false,
  170. default:true
  171. },
  172. clientSubName:{
  173. type: Boolean,
  174. require:false,
  175. default:true
  176. },
  177. clientManager:{
  178. type: Boolean,
  179. require:false,
  180. default:true
  181. },
  182. outwardStaffName:{
  183. type: Boolean,
  184. require:false,
  185. default:true
  186. },
  187. inwardStaffName:{
  188. type: Boolean,
  189. require:false,
  190. default:true
  191. },
  192. pricingStaffName:{
  193. type: Boolean,
  194. require:false,
  195. default:true
  196. },
  197. handlerName:{
  198. type: Boolean,
  199. require:false,
  200. default:true
  201. },
  202. },
  203. computed: {
  204. },
  205. created() {
  206. if (this.business==='MAJOR_BUSINESS'){
  207. this.getMajorTurnDepartment();
  208. this.getAllotDepartmentUser();
  209. this.getClientManager();
  210. }
  211. },
  212. data() {
  213. return {
  214. pickerOptions: {
  215. shortcuts: [{
  216. text: '最近一周',
  217. onClick(picker) {
  218. const end = new Date();
  219. const start = new Date();
  220. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  221. picker.$emit('pick', [start, end]);
  222. }
  223. }, {
  224. text: '最近一个月',
  225. onClick(picker) {
  226. const end = new Date();
  227. const start = new Date();
  228. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  229. picker.$emit('pick', [start, end]);
  230. }
  231. }, {
  232. text: '最近三个月',
  233. onClick(picker) {
  234. const end = new Date();
  235. const start = new Date();
  236. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  237. picker.$emit('pick', [start, end]);
  238. }
  239. }]
  240. },
  241. moreSearchBar: false,
  242. moreSearchIcon: "el-icon-arrow-right",
  243. orderDate: '',
  244. trunDep: [],
  245. allotDepartment:[],
  246. clientManagers:[],
  247. principals:[],
  248. }
  249. },
  250. methods: {
  251. resetSearch() {
  252. this.orderDate = '';
  253. this.$emit('resetParams');
  254. },
  255. searchList() {
  256. // 重置分页
  257. this.listQuery.page = 1
  258. this.listQuery.size = 10
  259. if (this.orderDate) {
  260. this.listQuery.startDate = this.orderDate[0] + ' 00:00:00';
  261. this.listQuery.endDate = this.orderDate[1] + ' 23:59:59';
  262. }
  263. this.$emit('fliterSearch',this.listQuery);
  264. },
  265. moreSearch() {
  266. this.moreSearchBar = !this.moreSearchBar;
  267. if (this.moreSearchBar) {
  268. this.moreSearchIcon = "el-icon-arrow-down";
  269. } else {
  270. this.moreSearchIcon = "el-icon-arrow-right";
  271. }
  272. },
  273. getMajorTurnDepartment() {
  274. this.$api.department.trunDep("MAJOR_BUSINESS").then(res => {
  275. if (res.code === 200) {
  276. this.trunDep = res.data;
  277. }
  278. })
  279. },
  280. getAllotDepartment(){
  281. this.$api.department.allot(this.business).then(res=>{
  282. if (res.code === 200){
  283. this.allotDepartment = res.data;
  284. }
  285. })
  286. },
  287. getClientManager(){
  288. const post = "客户经理"
  289. this.$api.user.postUser(post).then(res=>{
  290. if (res.code === 200){
  291. this.clientManagers = res.data;
  292. }
  293. })
  294. },
  295. getAllotDepartmentUser(){
  296. const businessType = "MAJOR_BUSINESS"
  297. this.$api.user.allotDepartmentUser(businessType).then(res=>{
  298. if (res.code === 200 && res.data!=null){
  299. this.principals = res.data;
  300. }
  301. })
  302. }
  303. }
  304. }
  305. </script>
  306. <style scoped lang="css">
  307. .row{
  308. margin-top: 10px;
  309. }
  310. .bar-container{
  311. width: 1650px;
  312. }
  313. .moreSearchStyle {
  314. animation: scale-in-ver-top .2s cubic-bezier(.25, .46, .45, .94) both
  315. }
  316. @keyframes scale-in-ver-top {
  317. 0% {
  318. transform: scaleY(0);
  319. transform-origin: 100% 0;
  320. opacity: 1
  321. }
  322. 100% {
  323. transform: scaleY(1);
  324. transform-origin: 100% 0;
  325. opacity: 1
  326. }
  327. }
  328. </style>