index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <div style="background: #f8f8f8;">
  3. <normalLayout>
  4. <template #refresh>
  5. <el-button size="mini" type="text" style="margin-right: 15px;color: #3874f6;font-size: 14px" @click="toTop">{{ $t('返回顶部') }}</el-button>
  6. <!-- <i class="el-icon-refresh-right"></i>-->
  7. </template>
  8. <template #content>
  9. <div style="overflow: auto;height: calc(100vh - 220px);" ref="rollRef" @scroll="handleScroll">
  10. <div style="margin: 10px 24px 10px 24px;" >
  11. <div class="inline-16">
  12. <label class="search__label" >{{$t('部门')}}:</label>
  13. <el-cascader ref="selectdep" size="small" v-model="depment" :options="deplist" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}" @change="selectDep" clearable ></el-cascader>
  14. </div>
  15. <div class="inline-16">
  16. <label class="search__label" >{{$t('业务员')}}:</label>
  17. <el-select v-model="person" filterable :placeholder="$t('请选择')" size="small" @change="selectPerson">
  18. <el-option
  19. v-for="item in personnelList"
  20. :key="item.index"
  21. :label="$t(item.name)"
  22. :value="item.userid">
  23. </el-option>
  24. </el-select>
  25. </div>
  26. <div class="mt-10 inline-16">
  27. <p class="search__label">{{$t('状态')}}:</p>
  28. <el-select v-model="isleave" clearable style="margin-right:10px" size="small" :placeholder="$t('请选择状态')" @change="leaveChange" >
  29. <el-option :label="$t('在职')" value="1"></el-option>
  30. <el-option :label="$t('离职')" value="2"></el-option>
  31. </el-select>
  32. </div>
  33. </div>
  34. <!-- 数字看板 -->
  35. <digitalSigns ref="digitalSigns" :windowWidth="windowWidth" :depment="depment" :person="person" ></digitalSigns>
  36. <!-- 客户账户余额分析 -->
  37. <customerAccountBalanceAnalysis ref="customerAccountBalanceAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull" ></customerAccountBalanceAnalysis>
  38. <!-- 客户业务员销售 -->
  39. <div class="div-box-new-margin" >
  40. <div class="div-border-box">
  41. <el-tabs v-model="activeName" @tab-click="handleClick">
  42. <el-tab-pane label="客户销售TOP10" name="客户销售">
  43. <customerSales :dataid="departmentid" ref="customer"></customerSales>
  44. </el-tab-pane>
  45. <el-tab-pane label="业务员销售TOP10" name="业务员销售">
  46. <salespersonSales :dataid="departmentid" ref="salesperson"></salespersonSales>
  47. </el-tab-pane>
  48. </el-tabs>
  49. </div>
  50. </div>
  51. <!-- 报价分析 -->
  52. <quotationAnalysis ref="quotationAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></quotationAnalysis>
  53. <!-- 订单趋势分析 -->
  54. <orderTrendAnalysis ref="orderTrendAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></orderTrendAnalysis>
  55. <!-- 订单类型占比分析 -->
  56. <orderType ref="orderType" :dataid="departmentid" :scrollHeight="scrollData" :windowWidth="windowWidth" @backFull="backFull"></orderType>
  57. <!--订单产品类别占比分析-->
  58. <orderProductCategory ref="orderProductCategory" :dataid="departmentid" :scrollHeight="scrollData" :windowWidth="windowWidth" @backFull="backFull"></orderProductCategory>
  59. <!-- 出货趋势分析 -->
  60. <shippingTrendAnalysis ref="shippingTrendAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></shippingTrendAnalysis>
  61. <!-- 近12月延期出货情况分析 -->
  62. <delayedShipmentAnalysis ref="delayedShipmentAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></delayedShipmentAnalysis>
  63. <!-- 未出货已延期情况分析 -->
  64. <unshippedExtensionAnalysis ref="unshippedExtensionAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></unshippedExtensionAnalysis>
  65. <!-- 开票金额趋势分析 -->
  66. <invoiceAmountAnalysis ref="invoiceAmountAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></invoiceAmountAnalysis>
  67. <!-- 近12月出货未开票金额趋势分析 -->
  68. <uninvoiceAmountAnalysis ref="uninvoiceAmountAnalysis" :dataid="departmentid" :windowWidth="windowWidth" :scrollHeight="scrollData" @backFull="backFull"></uninvoiceAmountAnalysis>
  69. <!-- 出货未开票分析 -->
  70. <shippingUninvoiceAnalysis ref="shippingUninvoiceAnalysis" :scrollHeight="scrollData" :windowWidth="windowWidth" @backFull="backFull"></shippingUninvoiceAnalysis>
  71. <!-- 财务回款分析 -->
  72. <financialCollectionAnalysis ref="financialCollectionAnalysis" :scrollHeight="scrollData" :windowWidth="windowWidth" @backFull="backFull"></financialCollectionAnalysis>
  73. </div>
  74. </template>
  75. </normalLayout>
  76. </div>
  77. </template>
  78. <script>
  79. import digitalSigns from "@/views/salesData/modules/digitalSigns";
  80. import customerSales from "@/views/salesData/modules/customerSales";
  81. import salespersonSales from "@/views/salesData/modules/salespersonSales";
  82. import quotationAnalysis from "@/views/salesData/modules/quotationAnalysis";
  83. import orderTrendAnalysis from "@/views/salesData/modules/orderTrendAnalysis";
  84. import orderType from "@/views/salesData/modules/orderType";
  85. import orderProductCategory from "@/views/salesData/modules/orderProductCategory";
  86. import shippingTrendAnalysis from "@/views/salesData/modules/shippingTrendAnalysis";
  87. import delayedShipmentAnalysis from "@/views/salesData/modules/delayedShipmentAnalysis";
  88. import invoiceAmountAnalysis from "@/views/salesData/modules/invoiceAmountAnalysis";
  89. import uninvoiceAmountAnalysis from "@/views/salesData/modules/uninvoiceAmountAnalysis";
  90. import shippingUninvoiceAnalysis from "@/views/salesData/modules/shippingUninvoiceAnalysis";
  91. import financialCollectionAnalysis from "@/views/salesData/modules/financialCollectionAnalysis";
  92. import customerAccountBalanceAnalysis from "@/views/salesData/modules/customerAccountBalanceAnalysis";
  93. import unshippedExtensionAnalysis from './modules/unshippedExtensionAnalysis'
  94. import normalLayout from '@/components/normal-basic-layout/normalNew'
  95. export default {
  96. name: "index",
  97. components:{normalLayout,digitalSigns,customerSales,salespersonSales,quotationAnalysis,orderTrendAnalysis,orderType,orderProductCategory,
  98. shippingTrendAnalysis,delayedShipmentAnalysis,invoiceAmountAnalysis,uninvoiceAmountAnalysis,shippingUninvoiceAnalysis,
  99. financialCollectionAnalysis,customerAccountBalanceAnalysis,unshippedExtensionAnalysis
  100. },
  101. data(){
  102. return {
  103. depment:'',
  104. person:'',
  105. departmentid:'',
  106. isleave:'1',
  107. deplist:[],
  108. personnelList:[],
  109. activeName: '客户销售',
  110. depmentParam:{
  111. "id": 20230620102004,
  112. "content": {
  113. "isleave":'1'
  114. }
  115. },
  116. windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
  117. scrollData:''
  118. }
  119. },
  120. methods:{
  121. async departmentrtment() {
  122. const res = await this.$api.requested(this.depmentParam)
  123. this.deplist = this.createMenu(res.data.dep)
  124. this.personnelList = res.data.hr
  125. this.person = JSON.parse(window.sessionStorage.getItem('active_account')).name
  126. this.depment = ''
  127. this.departmentid = ''
  128. const userid = JSON.parse(sessionStorage.getItem('active_account')).userid
  129. this.otherMethod(userid)
  130. },
  131. /*其他页面调用*/
  132. otherMethod(dataid){
  133. const userName = JSON.parse(sessionStorage.getItem('active_account')).name
  134. /*数字看板*/
  135. this.$refs.digitalSigns.$refs.order.param.content.dataid = dataid
  136. this.$refs.digitalSigns.$refs.order.param.content.type = 0
  137. this.$refs.digitalSigns.$refs.order.listData()
  138. this.$refs.digitalSigns.$refs.shipment.param.content.dataid = dataid
  139. this.$refs.digitalSigns.$refs.shipment.param.content.type = 0
  140. this.$refs.digitalSigns.$refs.shipment.listData()
  141. this.$refs.digitalSigns.$refs.invoicing.param.content.dataid = dataid
  142. this.$refs.digitalSigns.$refs.invoicing.param.content.type = 0
  143. this.$refs.digitalSigns.$refs.invoicing.listData()
  144. this.$refs.digitalSigns.$refs.returned.param.content.dataid = dataid
  145. this.$refs.digitalSigns.$refs.returned.param.content.type = 0
  146. this.$refs.digitalSigns.$refs.returned.listData()
  147. /*账户余额分析*/
  148. /*this.$refs.customerAccountBalanceAnalysis.$refs.departmentSalesperson.depment = dataid*/
  149. this.$refs.customerAccountBalanceAnalysis.person = userName
  150. this.$refs.customerAccountBalanceAnalysis.deplist = this.deplist
  151. this.$refs.customerAccountBalanceAnalysis.personnelList = this.personnelList
  152. this.$refs.customerAccountBalanceAnalysis.listData(dataid)
  153. /*客户销售*/
  154. this.$refs.customer.param.content.dataid = dataid
  155. this.$refs.salesperson.param.content.dataid = dataid
  156. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.person = userName
  157. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.deplist = this.deplist
  158. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  159. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.person = userName
  160. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.deplist = this.deplist
  161. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  162. this.$refs.customer.listData(dataid,'1')
  163. this.$refs.salesperson.listData(dataid,'1')
  164. this.activeName = '客户销售'
  165. /*报价分析*/
  166. this.$refs.quotationAnalysis.listData(dataid,'1')
  167. this.$refs.quotationAnalysis.queryQuotation(dataid,'1')
  168. /*this.$refs.quotationAnalysis.$refs.departmentSalesperson.depment = dataid*/
  169. this.$refs.quotationAnalysis.$refs.departmentSalesperson.person = userName
  170. this.$refs.quotationAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  171. this.$refs.quotationAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  172. /*订单趋势分析*/
  173. this.$refs.orderTrendAnalysis.listData(dataid,'1')
  174. /*this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.depment = dataid*/
  175. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.person = userName
  176. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  177. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  178. /*订单类型占比分析*/
  179. this.$refs.orderType.listData(dataid)
  180. this.$refs.orderType.$refs.departmentSalesperson.person = userName
  181. this.$refs.orderType.$refs.departmentSalesperson.deplist = this.deplist
  182. this.$refs.orderType.$refs.departmentSalesperson.personnelList = this.personnelList
  183. /*订单产品类别占比分析*/
  184. this.$refs.orderProductCategory.listData(dataid)
  185. this.$refs.orderProductCategory.$refs.departmentSalesperson.person = userName
  186. this.$refs.orderProductCategory.$refs.departmentSalesperson.deplist = this.deplist
  187. this.$refs.orderProductCategory.$refs.departmentSalesperson.personnelList = this.personnelList
  188. /*出货趋势分析*/
  189. this.$refs.shippingTrendAnalysis.listData(dataid)
  190. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.person = userName
  191. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  192. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  193. /*近12月延期出货情况分析*/
  194. this.$refs.delayedShipmentAnalysis.listData(dataid)
  195. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.person = userName
  196. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  197. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  198. /*未出货已延期情况分析*/
  199. this.$refs.unshippedExtensionAnalysis.listData(dataid)
  200. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.person = userName
  201. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  202. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  203. /*开票金额趋势分析*/
  204. this.$refs.invoiceAmountAnalysis.listData(dataid)
  205. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.person = userName
  206. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  207. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  208. /*近12月出货未开票金额趋势分析*/
  209. this.$refs.uninvoiceAmountAnalysis.listData(dataid)
  210. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.person = userName
  211. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  212. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  213. /*出货未开票分析*/
  214. this.$refs.shippingUninvoiceAnalysis.listData(dataid)
  215. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.person = userName
  216. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  217. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  218. /*财务回款分析 */
  219. this.$refs.financialCollectionAnalysis.listData(dataid)
  220. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.person = userName
  221. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  222. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  223. },
  224. /*其他页面调用*/
  225. otherModel(dataid,type,isleave,leave){
  226. /*数字看板*/
  227. this.$refs.digitalSigns.$refs.order.param.content.type = type
  228. this.$refs.digitalSigns.$refs.order.param.content.dataid = dataid
  229. this.$refs.digitalSigns.$refs.order.param.content.where.isleave = isleave
  230. this.$refs.digitalSigns.$refs.order.listData()
  231. this.$refs.digitalSigns.$refs.shipment.param.content.type = type
  232. this.$refs.digitalSigns.$refs.shipment.param.content.dataid = dataid
  233. this.$refs.digitalSigns.$refs.shipment.param.content.where.isleave = isleave
  234. this.$refs.digitalSigns.$refs.shipment.listData()
  235. this.$refs.digitalSigns.$refs.invoicing.param.content.type = type
  236. this.$refs.digitalSigns.$refs.invoicing.param.content.dataid = dataid
  237. this.$refs.digitalSigns.$refs.invoicing.param.content.where.isleave = isleave
  238. this.$refs.digitalSigns.$refs.invoicing.listData()
  239. this.$refs.digitalSigns.$refs.returned.param.content.type = type
  240. this.$refs.digitalSigns.$refs.returned.param.content.dataid = dataid
  241. this.$refs.digitalSigns.$refs.returned.param.content.where.isleave = isleave
  242. this.$refs.digitalSigns.$refs.returned.listData()
  243. /*账户余额分析*/
  244. this.$refs.customerAccountBalanceAnalysis.param.content.type = type
  245. this.$refs.customerAccountBalanceAnalysis.queryModel(dataid,isleave)
  246. this.$refs.customerAccountBalanceAnalysis.depment = type == '1'?dataid:''
  247. this.$refs.customerAccountBalanceAnalysis.person = leave?'':type == '0'?dataid:''
  248. this.$refs.customerAccountBalanceAnalysis.deplist = this.deplist
  249. this.$refs.customerAccountBalanceAnalysis.personnelList = this.personnelList
  250. /*客户销售*/
  251. this.$refs.customer.param.content.dataid = dataid
  252. this.$refs.customer.param.content.type = type
  253. this.$refs.customer.param.content.pageNumber = 1
  254. this.$refs.customer.param.content.pageSize = 10
  255. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  256. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  257. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.deplist = this.deplist
  258. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  259. this.$refs.customer.listData(dataid,isleave)
  260. this.$refs.salesperson.param.content.dataid = dataid
  261. this.$refs.salesperson.param.content.type = type
  262. this.$refs.salesperson.param.content.pageNumber = 1
  263. this.$refs.salesperson.param.content.pageSize = 10
  264. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  265. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  266. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.deplist = this.deplist
  267. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  268. this.$refs.salesperson.listData(dataid,isleave)
  269. /*报价分析*/
  270. this.$refs.quotationAnalysis.param.content.type = type
  271. this.$refs.quotationAnalysis.plotParam.content.type = type
  272. this.$refs.quotationAnalysis.listData(dataid,isleave)
  273. this.$refs.quotationAnalysis.queryQuotationModel(dataid,isleave)
  274. this.$refs.quotationAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  275. this.$refs.quotationAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  276. this.$refs.quotationAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  277. this.$refs.quotationAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  278. /*订单趋势分析*/
  279. this.$refs.orderTrendAnalysis.param.content.type = type
  280. this.$refs.orderTrendAnalysis.queryModel(dataid,isleave)
  281. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  282. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  283. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  284. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  285. /*订单类型占比分析*/
  286. this.$refs.orderType.param.content.type = type
  287. this.$refs.orderType.queryModel(dataid,isleave)
  288. this.$refs.orderType.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  289. this.$refs.orderType.$refs.departmentSalesperson.deplist = this.deplist
  290. this.$refs.orderType.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  291. this.$refs.orderType.$refs.departmentSalesperson.personnelList = this.personnelList
  292. /*订单产品类别占比分析*/
  293. this.$refs.orderProductCategory.param.content.type = type
  294. this.$refs.orderProductCategory.queryModel(dataid,isleave)
  295. this.$refs.orderProductCategory.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  296. this.$refs.orderProductCategory.$refs.departmentSalesperson.deplist = this.deplist
  297. this.$refs.orderProductCategory.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  298. this.$refs.orderProductCategory.$refs.departmentSalesperson.personnelList = this.personnelList
  299. /*出货趋势分析*/
  300. this.$refs.shippingTrendAnalysis.param.content.type = type
  301. this.$refs.shippingTrendAnalysis.queryModel(dataid,isleave)
  302. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  303. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  304. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  305. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  306. /*近12月延期出货情况分析*/
  307. this.$refs.delayedShipmentAnalysis.param.content.type = type
  308. this.$refs.delayedShipmentAnalysis.queryModel(dataid,isleave)
  309. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  310. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  311. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  312. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  313. /*未出货已延期情况分析*/
  314. this.$refs.unshippedExtensionAnalysis.param.content.type = type
  315. this.$refs.unshippedExtensionAnalysis.queryModel(dataid,isleave)
  316. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  317. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  318. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  319. this.$refs.unshippedExtensionAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  320. /*开票金额趋势分析*/
  321. this.$refs.invoiceAmountAnalysis.param.content.type = type
  322. this.$refs.invoiceAmountAnalysis.queryModel(dataid,isleave)
  323. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  324. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  325. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  326. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  327. /*近12月出货未开票金额趋势分析*/
  328. this.$refs.uninvoiceAmountAnalysis.param.content.type = type
  329. this.$refs.uninvoiceAmountAnalysis.queryModel(dataid,isleave)
  330. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  331. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  332. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  333. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  334. /*出货未开票分析*/
  335. this.$refs.shippingUninvoiceAnalysis.param.content.type = type
  336. this.$refs.shippingUninvoiceAnalysis.queryModel(dataid,isleave)
  337. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  338. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  339. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  340. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  341. /*财务回款分析 */
  342. this.$refs.financialCollectionAnalysis.param.content.type = type
  343. this.$refs.financialCollectionAnalysis.tableParam.content.type = type
  344. this.$refs.financialCollectionAnalysis.queryModel(dataid,isleave)
  345. this.$refs.financialCollectionAnalysis.tableData(dataid,isleave)
  346. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.depment = type == '1'?dataid:''
  347. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.deplist = this.deplist
  348. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.person = leave?'':type == '0'?dataid:''
  349. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  350. },
  351. createMenu (array) {
  352. var that = this
  353. let arr = []
  354. function convertToElementTree(node) {
  355. // 新节点
  356. if (node.subdep.length === 0){
  357. var elNode = {
  358. label: node["depname"],
  359. parentid:node['parentid'],
  360. parentname:node['parentname'],
  361. departmentid:node["departmentid"],
  362. value:node["departmentid"],
  363. remarks:node["remarks"],
  364. isused:node["isused"],
  365. changedate:node['changedate'],
  366. changeby:node['changeby'],
  367. createdate:node['createdate'],
  368. createby:node['createby'],
  369. depno:node['depno'],
  370. disabled:that.pageOnlyRead,
  371. }
  372. }else {
  373. var elNode = {
  374. label: node["depname"],
  375. parentid:node['parentid'],
  376. parentname:node['parentname'],
  377. departmentid:node["departmentid"],
  378. value:node["departmentid"],
  379. remarks:node["remarks"],
  380. isused:node["isused"],
  381. changedate:node['changedate'],
  382. changeby:node['changeby'],
  383. createdate:node['createdate'],
  384. createby:node['createby'],
  385. depno:node['depno'],
  386. disabled:that.pageOnlyRead,
  387. children: []
  388. }
  389. }
  390. if (node.subdep && node.subdep.length > 0) {
  391. // 如果存在子节点
  392. for (var index = 0; index < node.subdep.length; index++) {
  393. // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
  394. elNode.children.push(convertToElementTree(node.subdep[index]));
  395. }
  396. }
  397. return elNode;
  398. }
  399. array.forEach((element) => {
  400. arr.push(convertToElementTree(element))
  401. });
  402. return arr
  403. },
  404. selectDep(val) {
  405. if (val.length === 0){
  406. const userid = JSON.parse(sessionStorage.getItem('active_account')).userid
  407. this.otherModel(userid,'0')
  408. }else {
  409. this.person = ''
  410. this.dataid = ''
  411. this.departmentid = val[val.length -1]
  412. this.otherModel(this.departmentid,'1',this.isleave)
  413. }
  414. },
  415. selectPerson(val){
  416. this.depment = ''
  417. this.departmentid = ''
  418. this.dataid = val
  419. this.otherModel(val,'0',this.isleave)
  420. },
  421. leaveChange(){
  422. const type = this.depment?'1':'0'
  423. this.person = ''
  424. const dataid = type == '0'?-1:this.departmentid
  425. this.otherModel(dataid,type,this.isleave,'状态')
  426. this.personData()
  427. },
  428. /*获取新的业务员列表*/
  429. async personData(){
  430. let param = {
  431. id: 20230620102004,
  432. content: {
  433. isleave:this.isleave
  434. },
  435. }
  436. const res = await this.$api.requested(param)
  437. this.personnelList = res.data.hr
  438. this.$refs.customerAccountBalanceAnalysis.personnelList = this.personnelList
  439. this.$refs.customer.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  440. this.$refs.salesperson.$refs.sales.$refs.departmentSalesperson.personnelList = this.personnelList
  441. this.$refs.quotationAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  442. this.$refs.orderTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  443. this.$refs.orderType.$refs.departmentSalesperson.personnelList = this.personnelList
  444. this.$refs.orderProductCategory.$refs.departmentSalesperson.personnelList = this.personnelList
  445. this.$refs.shippingTrendAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  446. this.$refs.delayedShipmentAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  447. this.$refs.invoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  448. this.$refs.uninvoiceAmountAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  449. this.$refs.shippingUninvoiceAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  450. this.$refs.financialCollectionAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
  451. },
  452. handleClick(tab, event) {
  453. console.log(this.activeName);
  454. if (this.activeName === '客户销售'){
  455. this.$refs.customer.listData(this.$refs.customer.param.content.dataid,this.$refs.customer.param.content.where.isleave)
  456. }else {
  457. this.$refs.salesperson.listData(this.$refs.salesperson.param.content.dataid,this.$refs.customer.param.content.where.isleave)
  458. }
  459. },
  460. /*返回顶部*/
  461. toTop() {
  462. this.$refs.rollRef.scrollTop = 0
  463. },
  464. backFull(val){
  465. if (val){
  466. this.$refs.rollRef.scrollTop = val
  467. }
  468. },
  469. handleScroll(){
  470. this.scrollData = this.$refs.rollRef.scrollTop
  471. }
  472. },
  473. watch: {
  474. windowWidth (val) {
  475. console.log("实时屏幕宽度:",val );
  476. }
  477. },
  478. mounted() {
  479. this.departmentrtment()
  480. var that = this;
  481. // <!--把window.onresize事件挂在到mounted函数上-->
  482. window.onresize = () => {
  483. return (() => {
  484. window.fullWidth = document.documentElement.clientWidth;
  485. that.windowWidth = window.fullWidth; // 宽
  486. })()
  487. };
  488. },
  489. }
  490. </script>
  491. <style scoped>
  492. </style>