project.vue 11 KB

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