index.vue 14 KB

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