project.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <div>
  3. <el-scrollbar >
  4. <div style="margin: auto;">
  5. <div id="projectAddFull" style="background: #FFFFFF" :style="{padding:isFull ?'16px':0}">
  6. <div style="display: flex;justify-content: space-between">
  7. <div>
  8. <span style="font-size: 16px;color: #333">{{$t(`新增项目`)}}</span>
  9. </div>
  10. <div>
  11. <exportFile class="inline-16" :param="param" :columns="tablecolsAdd" file-name="新增项目"></exportFile>
  12. <quickDate class="inline-16" ref="quickAdd" @selectQuick="selectQuickAdd" :disabled="disabled"></quickDate>
  13. <fullScreen ref="addFullRef" class="inline-16" domId="projectAddFull" @onFull="onFull('新增')" @backFull="backFull('新增')"></fullScreen>
  14. </div>
  15. </div>
  16. <tableLayout style="margin-top: 10px" :layout="tablecolsAdd" :data="listAdd" :opwidth="200" :custom="true" :height="isFull ?'calc(100vh - 150px)':tableHeight">
  17. <template v-slot:customcol="scope">
  18. <p>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  19. </template>
  20. </tableLayout>
  21. <div class="container normal-panel" style="text-align:right">
  22. <el-pagination
  23. background
  24. @size-change="handleSizeChangeAdd"
  25. @current-change="handleCurrentChangeAdd"
  26. :current-page="currentPageAdd"
  27. :page-sizes="isFull ?[100,150, 200, 250]:[10,20, 50, 100, 200]"
  28. :page-size="isFull ?100:10"
  29. layout="total,sizes, prev, pager, next, jumper"
  30. :total="totalAdd">
  31. </el-pagination>
  32. </div>
  33. </div>
  34. <div id="projectUpdFull" style="background: #FFFFFF" :style="{padding:isFull ?'16px':0}">
  35. <div style="display: flex;justify-content: space-between">
  36. <div>
  37. <span style="font-size: 16px;color: #333">{{$t(`更新项目`)}}</span>
  38. </div>
  39. <div>
  40. <exportFile class="inline-16" :param="param" :columns="tablecolsUpdate" file-name="更新项目"></exportFile>
  41. <quickDate class="inline-16" ref="quickUpd" @selectQuick="selectQuickUpd"></quickDate>
  42. <fullScreen ref="updFullRef" class="inline-16" domId="projectUpdFull" @onFull="onFull('更新')" @backFull="backFull('更新')"></fullScreen>
  43. </div>
  44. </div>
  45. <tableLayout style="margin-top: 10px" :layout="tablecolsUpdate" :data="listUpdate" :opwidth="200" :custom="true" :height="isFull ?'calc(100vh - 150px)':tableHeight">
  46. <template v-slot:customcol="scope">
  47. <p>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  48. </template>
  49. </tableLayout>
  50. <div class="container normal-panel" style="text-align:right">
  51. <el-pagination
  52. background
  53. @size-change="handleSizeChangeUpdate"
  54. @current-change="handleCurrentChangeUpdate"
  55. :current-page="currentPageUpdate"
  56. :page-sizes="isFull ?[100,150, 200, 250]:[10,20, 50, 100, 200]"
  57. :page-size="isFull ?100:10"
  58. layout="total,sizes, prev, pager, next, jumper"
  59. :total="totalUpdate">
  60. </el-pagination>
  61. </div>
  62. </div>
  63. <div id="projectFowFull" style="background: #FFFFFF" :style="{padding:isFull ?'16px':0}">
  64. <div style="display: flex;justify-content: space-between">
  65. <div>
  66. <span style="font-size: 16px;color: #333">{{$t(`跟进项目`)}}</span>
  67. </div>
  68. <div>
  69. <exportFile class="inline-16" :param="param" :columns="tablecolsFollow" file-name="跟进项目"></exportFile>
  70. <quickDate class="inline-16" ref="quickFow" @selectQuick="selectQuickFow" :disabled="disabled"></quickDate>
  71. <fullScreen ref="fowFullRef" class="inline-16" domId="projectFowFull" @onFull="onFull('跟进')" @backFull="backFull('跟进')"></fullScreen>
  72. </div>
  73. </div>
  74. <tableLayout style="margin-top: 10px" :layout="tablecolsFollow" :data="listFollow" :opwidth="200" :custom="true" :height="isFull ?'calc(100vh - 150px)':tableHeight">
  75. <template v-slot:customcol="scope">
  76. <p v-if="scope.column.columnname === 'followname'">
  77. <span v-if="scope.column.data.followname.length > 0">
  78. <span v-for="(item,index) in scope.column.data.followname">
  79. <span v-if="index === scope.column.data.followname.length -1">
  80. {{$t(item)}}
  81. </span>
  82. <span v-else>
  83. {{item + ','}}
  84. </span>
  85. </span>
  86. </span>
  87. <span v-else>--</span>
  88. </p>
  89. <p v-else>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  90. </template>
  91. </tableLayout>
  92. <div class="container normal-panel" style="text-align:right">
  93. <el-pagination
  94. background
  95. @size-change="handleSizeChangeFollow"
  96. @current-change="handleCurrentChangeFollow"
  97. :current-page="currentPageFollow"
  98. :page-sizes="isFull ?[100,150, 200, 250]:[10,20, 50, 100, 200]"
  99. :page-size="isFull ?100:10"
  100. layout="total,sizes, prev, pager, next, jumper"
  101. :total="totalFollow">
  102. </el-pagination>
  103. </div>
  104. </div>
  105. </div>
  106. </el-scrollbar>
  107. </div>
  108. </template>
  109. <script>
  110. import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
  111. import tableLayout from '@/components/table/index9'
  112. import fullScreen from "@/views/salesData/components/fullScreen";
  113. import exportFile from "@/components/export_file/index5"
  114. export default {
  115. name: "project",
  116. props:['param','isDep','dataid','isPerson'],
  117. components:{quickDate,tableLayout,fullScreen,exportFile},
  118. data() {
  119. return {
  120. listAdd:[],
  121. tablecolsAdd:[],
  122. listUpdate:[],
  123. tablecolsUpdate:[],
  124. tableHeight:'',
  125. currentPageAdd:0,
  126. totalAdd:0,
  127. currentPageUpdate:0,
  128. totalUpdate:0,
  129. listFollow:[],
  130. tablecolsFollow:[],
  131. currentPageFollow:0,
  132. totalFollow:0,
  133. begindate:'',
  134. enddate:'',
  135. selectAdd:'月',
  136. selectUpd:'月',
  137. selectFow:'月',
  138. sort:[
  139. {
  140. reversed : 0,
  141. sorted: 1,
  142. sortid: 207,
  143. sortname: "新增,更新排序"
  144. },
  145. {
  146. reversed : 0,
  147. sorted: 1,
  148. sortid: 208,
  149. sortname: "跟进排序"
  150. }
  151. ],
  152. isFull:false,
  153. disabled:false
  154. }
  155. },
  156. methods:{
  157. async queryAdd(type){
  158. this.$refs.quickAdd.select = type?type:this.selectAdd
  159. this.param.content.dataType = 7
  160. this.param.content.where.begindate = this.selectAdd ? '' :this.begindate
  161. this.param.content.where.enddate = this.selectAdd ? '' : this.enddate
  162. this.param.content.dateType = type?type:this.selectAdd
  163. this.param.content.dataid = this.dataid
  164. this.param.content.type = this.isDep?1:0
  165. this.param.content.sort = [this.sort[0]]
  166. const res = await this.$api.requested(this.param)
  167. this.listAdd = res.data
  168. this.currentPageAdd = res.pageNumber
  169. this.totalAdd = res.total
  170. },
  171. handleSizeChangeAdd(val) {
  172. // console.log(`每页 ${val} 条`);
  173. this.param.content.pageSize = val
  174. this.queryAdd()
  175. },
  176. handleCurrentChangeAdd(val) {
  177. // console.log(`当前页: ${val}`);
  178. this.param.content.pageNumber = val
  179. this.queryAdd()
  180. },
  181. async queryUpdate(type){
  182. this.$refs.quickUpd.select = type?type:this.selectUpd
  183. this.param.content.dataType = 8
  184. this.param.content.where.begindate = this.selectUpd ? '' :this.begindate
  185. this.param.content.where.enddate = this.selectUpd ? '' : this.enddate
  186. this.param.content.dateType = type?type:this.selectUpd
  187. this.param.content.dataid = this.dataid
  188. this.param.content.type = this.isDep?1:0
  189. this.param.content.sort = [this.sort[0]]
  190. const res = await this.$api.requested(this.param)
  191. this.listUpdate = res.data
  192. this.currentPageUpdate = res.pageNumber
  193. this.totalUpdate = res.total
  194. },
  195. handleSizeChangeUpdate(val) {
  196. // console.log(`每页 ${val} 条`);
  197. this.param.content.pageSize = val
  198. this.queryUpdate()
  199. },
  200. handleCurrentChangeUpdate(val) {
  201. // console.log(`当前页: ${val}`);
  202. this.param.content.pageNumber = val
  203. this.queryUpdate()
  204. },
  205. async queryFollow(type){
  206. this.$refs.quickFow.select = type?type:this.selectFow
  207. this.param.content.dataType = 9
  208. this.param.content.where.begindate = this.selectFow ? '' :this.begindate
  209. this.param.content.where.enddate = this.selectFow ? '' : this.enddate
  210. this.param.content.dateType = type?type:this.selectFow
  211. this.param.content.dataid = this.dataid
  212. this.param.content.type = this.isDep?1:0
  213. this.param.content.sort = [this.sort[1]]
  214. const res = await this.$api.requested(this.param)
  215. this.listFollow = res.data
  216. this.currentPageFollow = res.pageNumber
  217. this.totalFollow = res.total
  218. },
  219. handleSizeChangeFollow(val) {
  220. // console.log(`每页 ${val} 条`);
  221. this.param.content.pageSize = val
  222. this.queryFollow()
  223. },
  224. handleCurrentChangeFollow(val) {
  225. // console.log(`当前页: ${val}`);
  226. this.param.content.pageNumber = val
  227. this.queryFollow()
  228. },
  229. /*日期筛选*/
  230. selectQuickAdd(begindate,enddate,select){
  231. this.begindate = begindate
  232. this.enddate = enddate
  233. this.selectAdd = select
  234. this.param.content.pageNumber = 1
  235. this.queryAdd()
  236. },
  237. selectQuickUpd(begindate,enddate,select){
  238. this.begindate = begindate
  239. this.enddate = enddate
  240. this.selectUpd = select
  241. this.param.content.pageNumber = 1
  242. this.queryUpdate()
  243. },
  244. selectQuickFow(begindate,enddate,select){
  245. this.begindate = begindate
  246. this.enddate = enddate
  247. this.selectFow = select
  248. this.param.content.pageNumber = 1
  249. this.queryFollow()
  250. },
  251. onFull(type){
  252. if (type == '新增'){
  253. this.param.content.dataType = 7
  254. this.param.content.pageNumber = 1
  255. this.param.content.pageSize = 100
  256. this.queryAdd()
  257. this.isFull = true
  258. }else if (type == '更新'){
  259. this.param.content.dataType = 8
  260. this.param.content.pageNumber = 1
  261. this.param.content.pageSize = 100
  262. this.queryUpdate()
  263. this.isFull = true
  264. }else if (type == '跟进'){
  265. this.param.content.dataType = 9
  266. this.param.content.pageNumber = 1
  267. this.param.content.pageSize = 100
  268. this.queryFollow()
  269. this.isFull = true
  270. }
  271. },
  272. backFull(type){
  273. if (type == '新增'){
  274. this.param.content.dataType = 7
  275. this.param.content.pageNumber = 1
  276. this.param.content.pageSize = 10
  277. this.queryAdd()
  278. this.disabled = false
  279. this.isFull = false
  280. }else if (type == '更新'){
  281. this.param.content.dataType = 8
  282. this.param.content.pageNumber = 1
  283. this.param.content.pageSize = 10
  284. this.queryUpdate()
  285. this.isFull = false
  286. }else if (type == '跟进'){
  287. this.param.content.dataType = 9
  288. this.param.content.pageNumber = 1
  289. this.param.content.pageSize = 10
  290. this.queryFollow()
  291. this.disabled = false
  292. this.isFull = false
  293. }
  294. }
  295. },
  296. created() {
  297. this.tablecolsAdd = this.tool.tabelCol(this.$route.name).projectAdd.tablecols
  298. this.tablecolsUpdate = this.tool.tabelCol(this.$route.name).projectUpdate.tablecols
  299. this.tablecolsFollow = this.tool.tabelCol(this.$route.name).projectFollow.tablecols
  300. }
  301. }
  302. </script>
  303. <style scoped>
  304. </style>