documents.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div>
  3. <el-scrollbar >
  4. <div style="margin: auto;">
  5. <div id="quotationFull" 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" @selectQuick="selectQuickQuotation"></quickDate>
  12. <fullScreen ref="quotationFullRef" class="inline-16" domId="quotationFull" @onFull="onFull('报价')" @backFull="backFull('报价')"></fullScreen>
  13. </div>
  14. </div>
  15. <tableLayout style="margin-top: 10px" :layout="quotationTablecols" :data="quotationList" :opwidth="200" :custom="true" :height="isFull ?'calc(100vh - 150px)':tableHeight">
  16. <template v-slot:customcol="scope">
  17. <div v-if="scope.column.columnname === 'status'">
  18. <span style="color:#3874f6" v-if="scope.column.data[[scope.column.columnname]] == '新建'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  19. <span style="color:#52c41a" v-else-if="scope.column.data[[scope.column.columnname]] == '提交'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  20. <span style="color:#333333" v-else-if="scope.column.data[[scope.column.columnname]] == '审核'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  21. <span style="color:#fa8c16" v-else-if="scope.column.data[[scope.column.columnname]] == '复核'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  22. </div>
  23. <p v-else>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  24. </template>
  25. </tableLayout>
  26. <div class="container normal-panel" style="text-align:right">
  27. <el-pagination
  28. background
  29. @size-change="quotationHandleSizeChange"
  30. @current-change="quotationHandleCurrentChange"
  31. :current-page="quotationCurrentPage"
  32. :page-sizes="isFull ?[100,150, 200, 250]:[10,20, 50, 100, 200]"
  33. :page-size="isFull ?100:10"
  34. layout="total,sizes, prev, pager, next, jumper"
  35. :total="quotationTotal">
  36. </el-pagination>
  37. </div>
  38. </div>
  39. <div id="contractFull" style="background: #FFFFFF" :style="{padding:isFull ?'16px':0}">
  40. <div style="display: flex;justify-content: space-between">
  41. <div>
  42. <span style="font-size: 16px;color: #333">{{$t('合同')}}</span>
  43. </div>
  44. <div>
  45. <quickDate class="inline-16" @selectQuick="selectQuickContract"></quickDate>
  46. <fullScreen ref="contractFullRef" class="inline-16" domId="contractFull" @onFull="onFull('合同')" @backFull="backFull('合同')"></fullScreen>
  47. </div>
  48. </div>
  49. <tableLayout style="margin-top: 10px" :layout="contractTablecols" :data="contractList" :opwidth="200" :custom="true" :height="isFull ?'calc(100vh - 150px)':tableHeight">
  50. <template v-slot:customcol="scope">
  51. <div v-if="scope.column.columnname == 'status'">
  52. <span style="color:#3874f6" v-if="scope.column.data[[scope.column.columnname]] == '新建'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  53. <span style="color:#52c41a" v-else-if="scope.column.data[[scope.column.columnname]] == '已提交'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  54. <span style="color:#333333" v-else-if="scope.column.data[[scope.column.columnname]] == '审核'">{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  55. <span style="color:#000000" v-else>{{$t(scope.column.data[[scope.column.columnname]])}}</span>
  56. </div>
  57. <p v-else>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  58. </template>
  59. </tableLayout>
  60. <div class="container normal-panel" style="text-align:right">
  61. <el-pagination
  62. background
  63. @size-change="contractHandleSizeChange"
  64. @current-change="contractHandleCurrentChange"
  65. :current-page="contractCurrentPage"
  66. :page-sizes="isFull ?[100,150, 200, 250]:[10,20, 50, 100, 200]"
  67. :page-size="isFull ?100:10"
  68. layout="total,sizes, prev, pager, next, jumper"
  69. :total="contractTotal">
  70. </el-pagination>
  71. </div>
  72. </div>
  73. </div>
  74. </el-scrollbar>
  75. </div>
  76. </template>
  77. <script>
  78. import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
  79. import tableLayout from '@/components/table/index9'
  80. import fullScreen from "@/views/salesData/components/fullScreen";
  81. export default {
  82. name: "documents",
  83. props:['param','isDep','dataid','isPerson'],
  84. components:{quickDate,tableLayout,fullScreen},
  85. data() {
  86. return {
  87. quotationList:[],
  88. quotationTablecols:[],
  89. contractList:[],
  90. contractTablecols:[],
  91. tableHeight:'',
  92. quotationCurrentPage:0,
  93. quotationTotal:0,
  94. contractCurrentPage:0,
  95. contractTotal:0,
  96. begindate:'',
  97. enddate:'',
  98. contractSelect:'月',
  99. quotationSelect:'月',
  100. sort:[
  101. {
  102. reversed : 0,
  103. sorted: 1,
  104. sortid: 207,
  105. sortname: "新增,更新排序"
  106. },
  107. {
  108. reversed : 0,
  109. sorted: 1,
  110. sortid: 208,
  111. sortname: "跟进排序"
  112. }
  113. ],
  114. isFull:false,
  115. disabled:false
  116. }
  117. },
  118. methods: {
  119. async queryQuotation() {
  120. /* this.isDep ? this.param.content.type = 1 : this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
  121. this.param.content.dataType = 10
  122. /* this.param.content.dataid = this.dataid*/
  123. this.param.content.where.begindate = this.quotationSelect ? '' :this.begindate
  124. this.param.content.where.enddate = this.quotationSelect ? '' : this.enddate
  125. this.param.content.dateType = this.quotationSelect
  126. this.param.content.dataid = this.dataid
  127. this.param.content.type = this.isDep?1:0
  128. this.param.content.sort = [this.sort[1]]
  129. const res = await this.$api.requested(this.param)
  130. this.quotationList = res.data
  131. this.quotationCurrentPage = res.pageNumber
  132. this.quotationTotal = res.total
  133. },
  134. quotationHandleSizeChange(val) {
  135. // console.log(`每页 ${val} 条`);
  136. this.param.content.pageSize = val
  137. this.queryQuotation()
  138. },
  139. quotationHandleCurrentChange(val) {
  140. // console.log(`当前页: ${val}`);
  141. this.param.content.pageNumber = val
  142. this.queryQuotation()
  143. },
  144. async queryContract() {
  145. /* this.isDep ? this.param.content.type = 1 : this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
  146. this.param.content.dataType = 11
  147. /* this.param.content.dataid = this.dataid*/
  148. this.param.content.where.begindate = this.contractSelect ? '' :this.begindate
  149. this.param.content.where.enddate = this.contractSelect ? '' : this.enddate
  150. this.param.content.dateType = this.contractSelect
  151. this.param.content.dataid = this.dataid
  152. this.param.content.type = this.isDep?1:0
  153. this.param.content.sort = [this.sort[1]]
  154. const res = await this.$api.requested(this.param)
  155. this.contractList = res.data
  156. this.contractCurrentPage = res.pageNumber
  157. this.contractTotal = res.total
  158. },
  159. contractHandleSizeChange(val) {
  160. // console.log(`每页 ${val} 条`);
  161. this.param.content.pageSize = val
  162. this.queryContract()
  163. },
  164. contractHandleCurrentChange(val) {
  165. // console.log(`当前页: ${val}`);
  166. this.param.content.pageNumber = val
  167. this.queryContract()
  168. },
  169. /*日期筛选*/
  170. selectQuickQuotation(begindate,enddate,select){
  171. this.begindate = begindate
  172. this.enddate = enddate
  173. this.quotationSelect = select
  174. this.queryQuotation(this.param.content.pageNumber = 1)
  175. },
  176. selectQuickContract(begindate,enddate,select){
  177. this.begindate = begindate
  178. this.enddate = enddate
  179. this.contractSelect = select
  180. this.queryContract(this.param.content.pageNumber = 1)
  181. },
  182. onFull(type){
  183. if (type == '报价'){
  184. this.param.content.dataType = 10
  185. this.param.content.pageNumber = 1
  186. this.param.content.pageSize = 100
  187. this.queryQuotation()
  188. this.isFull = true
  189. }else if (type == '合同'){
  190. this.param.content.dataType = 11
  191. this.param.content.pageNumber = 1
  192. this.param.content.pageSize = 100
  193. this.queryContract()
  194. this.isFull = true
  195. }
  196. },
  197. backFull(type){
  198. if (type == '报价'){
  199. this.param.content.dataType = 10
  200. this.param.content.pageNumber = 1
  201. this.param.content.pageSize = 10
  202. this.queryQuotation()
  203. this.isFull = false
  204. }else if (type == '合同'){
  205. this.param.content.dataType = 11
  206. this.param.content.pageNumber = 1
  207. this.param.content.pageSize = 10
  208. this.queryContract()
  209. this.isFull = false
  210. }
  211. }
  212. },
  213. created() {
  214. this.quotationTablecols = this.tool.tabelCol(this.$route.name).quotationTable.tablecols
  215. this.contractTablecols = this.tool.tabelCol(this.$route.name).contractTable.tablecols
  216. }
  217. }
  218. </script>
  219. <style scoped>
  220. </style>