Home.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  1. <template>
  2. <div class="home" :class="[fontSize]">
  3. <!-- <a-alert :message="message" type="info" /> -->
  4. <a-card size="small" :bordered="false" class="page-cont" :bodyStyle="{padding: '17px 30px 20px'}">
  5. <h3 class="page-tit"><span>客户信息</span></h3>
  6. <ul class="page-list">
  7. <li>商户名称:{{ $store.getters.userInfo.orgName || '--' }}</li>
  8. <li>商户别名:{{ dealerData&&dealerData.dealerAlias || '--' }}</li>
  9. <li>登录账号:{{ $store.getters.userInfo.username || '--' }}</li>
  10. <li>所属角色:{{ dealerData&&dealerData.dealerLevelDictValue || '--' }}</li>
  11. </ul>
  12. </a-card>
  13. <!-- 数据看板 -->
  14. <a-card
  15. v-if="$hasPermissions('M_homePage_data')"
  16. size="small"
  17. :bordered="false"
  18. class="page-cont"
  19. :bodyStyle="{padding: '17px 30px 0'}">
  20. <div style="font-size:16px;font-weight: 500;">
  21. <span>数据概览</span>
  22. <span
  23. :title="!hiddenBizData?'隐藏':'显示'"
  24. @click="hiddenBizData=!hiddenBizData"
  25. style="margin-left: 10px;cursor: pointer;"
  26. >
  27. <svg
  28. v-if="hiddenBizData"
  29. t="1650362667217"
  30. class="icon"
  31. viewBox="0 0 1024 1024"
  32. version="1.1"
  33. xmlns="http://www.w3.org/2000/svg"
  34. p-id="18432"
  35. width="16"
  36. height="16"><path d="M469.333333 681.386667c-36.053333-2.432-71.253333-8.533333-104.96-17.92l-69.802666 149.674666a42.368 42.368 0 0 1-56.533334 20.266667 42.666667 42.666667 0 0 1-20.821333-56.32l66.986667-143.658667a451.712 451.712 0 0 1-148.906667-112.682666 388.693333 388.693333 0 0 1-70.570667-119.338667 42.666667 42.666667 0 1 1 80.128-29.354667 303.445333 303.445333 0 0 0 55.210667 93.098667C270.634667 547.413333 383.018667 597.333333 505.728 597.333333c122.752 0 235.136-49.962667 305.706667-132.181333a303.445333 303.445333 0 0 0 55.210666-93.098667 42.666667 42.666667 0 0 1 80.128 29.354667 388.693333 388.693333 0 0 1-70.570666 119.338667 423.68 423.68 0 0 1-18.773334 20.48l104.362667 104.362666a42.666667 42.666667 0 0 1-0.298667 60.032 42.368 42.368 0 0 1-60.032 0.298667l-109.653333-109.653333c-20.48 14.08-42.24 26.581333-65.024 37.418666l66.901333 143.36a42.666667 42.666667 0 0 1-20.821333 56.362667 42.368 42.368 0 0 1-56.533333-20.266667l-69.717334-149.546666a520.533333 520.533333 0 0 1-91.946666 16.810666v130.645334A42.666667 42.666667 0 0 1 512 853.333333c-23.722667 0-42.666667-18.944-42.666667-42.24v-129.706666z" fill="#8a8a8a" p-id="18433"></path><path d="M176.128 524.373333a42.368 42.368 0 0 1 60.032 0.256 42.666667 42.666667 0 0 1 0.298667 60.074667l-121.216 121.216a42.368 42.368 0 0 1-60.074667-0.298667 42.666667 42.666667 0 0 1-0.298667-60.032l121.258667-121.258666z" fill="#8a8a8a" p-id="18434"></path></svg>
  37. <svg
  38. v-else
  39. t="1650362825006"
  40. class="icon"
  41. viewBox="0 0 1024 1024"
  42. version="1.1"
  43. xmlns="http://www.w3.org/2000/svg"
  44. p-id="21815"
  45. width="16"
  46. height="16"><path d="M512 209.403241c-201.731514 0-374.009206 125.476783-443.808922 302.596759 69.798692 177.119977 242.077408 302.596759 443.808922 302.596759 201.933105 0 374.010229-125.476783 443.808922-302.596759C886.009206 334.880023 713.933105 209.403241 512 209.403241zM512 713.731514c-111.355157 0-201.731514-90.375334-201.731514-201.731514s90.375334-201.731514 201.731514-201.731514 201.731514 90.375334 201.731514 201.731514S623.355157 713.731514 512 713.731514zM512 390.961296c-66.772776 0-121.038704 54.265928-121.038704 121.038704s54.265928 121.038704 121.038704 121.038704 121.038704-54.265928 121.038704-121.038704S578.772776 390.961296 512 390.961296z" p-id="21816" fill="#8a8a8a"></path></svg>
  47. </span>
  48. </div>
  49. <a-row v-if="!hiddenBizData">
  50. <a-col :span="6">
  51. <div class="page-data-module">
  52. <div class="page-data-con">
  53. <p class="page-data-tit">今日总单量(个)/总销售金额(元)</p>
  54. <h3 class="page-data-num main-color">
  55. <a-statistic :valueStyle="{fontSize:'30px',color:'#e70012'}" :value="bizData&&bizData.sales&&(bizData.sales.dayTotalQty || bizData.sales.dayTotalQty==0) ? bizData.sales.dayTotalQty : 0" />
  56. /
  57. <a-statistic :precision="2" :valueStyle="{fontSize:'30px',color:'#e70012'}" :value="bizData&&bizData.sales&&(bizData.sales.dayTotalAmount || bizData.sales.dayTotalAmount==0) ? bizData.sales.dayTotalAmount : 0" />
  58. </h3>
  59. <p class="page-data-item">
  60. <span class="page-data-itemText">本周</span>
  61. <span class="page-data-itemText">
  62. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.sales&&(bizData.sales.weekSalesQty || bizData.sales.weekSalesQty==0) ? bizData.sales.weekSalesQty : 0" />
  63. /
  64. <a-statistic :valueStyle="{fontSize:'14px'}" :precision="2" :value="bizData&&bizData.sales&&(bizData.sales.weekSalesAmount || bizData.sales.weekSalesAmount==0) ? bizData.sales.weekSalesAmount : 0" />
  65. </span>
  66. </p>
  67. <p class="page-data-item">
  68. <span class="page-data-itemText">本月</span>
  69. <span class="page-data-itemText">
  70. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.sales&&(bizData.sales.monthSalesQty || bizData.sales.monthSalesQty==0) ? bizData.sales.monthSalesQty : 0" />
  71. /
  72. <a-statistic :valueStyle="{fontSize:'14px'}" :precision="2" :value="bizData&&bizData.sales&&(bizData.sales.monthSalesAmount || bizData.sales.monthSalesAmount==0) ? bizData.sales.monthSalesAmount : 0" />
  73. </span>
  74. </p>
  75. </div>
  76. <span class="page-data-line"></span>
  77. </div>
  78. </a-col>
  79. <a-col :span="6">
  80. <div class="page-data-module">
  81. <div class="page-data-con">
  82. <p class="page-data-tit">今日总采购单量(个)/总采购金额(元)</p>
  83. <h3 class="page-data-num">
  84. <a-statistic :valueStyle="{fontSize:'30px'}" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.dayTotalQty || bizData.purchaseBill.dayTotalQty==0) ? bizData.purchaseBill.dayTotalQty : 0" />
  85. /
  86. <a-statistic :precision="2" :valueStyle="{fontSize:'30px'}" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.dayDiscountedAmount || bizData.purchaseBill.dayDiscountedAmount==0) ? bizData.purchaseBill.dayDiscountedAmount : 0" />
  87. </h3>
  88. <p class="page-data-item">
  89. <span class="page-data-itemText">本周</span>
  90. <span class="page-data-itemText">
  91. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.weekPurchaseQty || bizData.purchaseBill.weekPurchaseQty==0) ? bizData.purchaseBill.weekPurchaseQty : 0" />
  92. /
  93. <a-statistic :valueStyle="{fontSize:'14px'}" :precision="2" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.weekDiscountedAmount || bizData.purchaseBill.weekDiscountedAmount==0) ? bizData.purchaseBill.weekDiscountedAmount : 0" />
  94. </span>
  95. </p>
  96. <p class="page-data-item">
  97. <span class="page-data-itemText">本月</span>
  98. <span class="page-data-itemText">
  99. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.monthPurchaseQty || bizData.purchaseBill.monthPurchaseQty==0) ? bizData.purchaseBill.monthPurchaseQty : 0" />
  100. /
  101. <a-statistic :valueStyle="{fontSize:'14px'}" :precision="2" :value="bizData&&bizData.purchaseBill&&(bizData.purchaseBill.monthDiscountedAmount || bizData.purchaseBill.monthDiscountedAmount==0) ? bizData.purchaseBill.monthDiscountedAmount : 0" />
  102. </span>
  103. </p>
  104. </div>
  105. <span class="page-data-line"></span>
  106. </div>
  107. </a-col>
  108. <a-col :span="6">
  109. <div class="page-data-module">
  110. <div class="page-data-con">
  111. <p class="page-data-tit">客户总数(个)</p>
  112. <h3 class="page-data-num">
  113. <a-statistic :valueStyle="{fontSize:'30px'}" :value="bizData&&bizData.customer&&(bizData.customer.custCount || bizData.customer.custCount==0) ? bizData.customer.custCount : 0 " />
  114. </h3>
  115. <p class="page-data-item">
  116. <span class="page-data-itemText">本周新增</span>
  117. <span class="page-data-itemText">
  118. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.customer&&(bizData.customer.addCurrentWeekCustCount || bizData.customer.addCurrentWeekCustCount==0) ? bizData.customer.addCurrentWeekCustCount : 0" />
  119. </span>
  120. </p>
  121. <p class="page-data-item">
  122. <span class="page-data-itemText">30天内采购客户</span>
  123. <span class="page-data-itemText">
  124. <a-statistic :valueStyle="{fontSize:'14px'}" :value="bizData&&bizData.customer&&(bizData.customer.salesThirtyDayCustCount || bizData.customer.salesThirtyDayCustCount==0) ? bizData.customer.salesThirtyDayCustCount : 0" />
  125. </span>
  126. </p>
  127. </div>
  128. <span class="page-data-line"></span>
  129. </div>
  130. </a-col>
  131. <a-col :span="6">
  132. <div class="page-data-module">
  133. <div class="page-data-con">
  134. <p class="page-data-tit">总库存(个)</p>
  135. <h3 class="page-data-num" style="line-height: 36px;">
  136. <a-statistic :valueStyle="{fontSize:'30px'}" :value="bizData&&bizData.stock&&(bizData.stock.totalCurrentStockQty || bizData.stock.totalCurrentStockQty==0) ? bizData.stock.totalCurrentStockQty : 0" />
  137. </h3>
  138. <p class="page-data-tit">库存总金额(元)</p>
  139. <h3 class="page-data-num" style="line-height: 36px;margin: 0;">
  140. <a-statistic :precision="2" :valueStyle="{fontSize:'30px'}" :value="bizData&&bizData.stock&&(bizData.stock.totalCurrentStockCost || bizData.stock.totalCurrentStockCost==0) ? bizData.stock.totalCurrentStockCost : 0" />
  141. </h3>
  142. </div>
  143. </div>
  144. </a-col>
  145. </a-row>
  146. <a-row v-else>
  147. <a-col :span="6">
  148. <div class="page-data-module">
  149. <div class="page-data-con">
  150. <p class="page-data-tit">今日总单量(个)/总销售金额(元)</p>
  151. <h3 class="page-data-num main-color">
  152. ****
  153. </h3>
  154. <p class="page-data-item">
  155. <span class="page-data-itemText">本周</span>
  156. <span class="page-data-itemText">
  157. ****
  158. </span>
  159. </p>
  160. <p class="page-data-item">
  161. <span class="page-data-itemText">本月</span>
  162. <span class="page-data-itemText">
  163. ****
  164. </span>
  165. </p>
  166. </div>
  167. <span class="page-data-line"></span>
  168. </div>
  169. </a-col>
  170. <a-col :span="6">
  171. <div class="page-data-module">
  172. <div class="page-data-con">
  173. <p class="page-data-tit">今日总采购单量(个)/总采购金额(元)</p>
  174. <h3 class="page-data-num">
  175. ****
  176. </h3>
  177. <p class="page-data-item">
  178. <span class="page-data-itemText">本周</span>
  179. <span class="page-data-itemText">
  180. ****
  181. </span>
  182. </p>
  183. <p class="page-data-item">
  184. <span class="page-data-itemText">本月</span>
  185. <span class="page-data-itemText">
  186. ****
  187. </span>
  188. </p>
  189. </div>
  190. <span class="page-data-line"></span>
  191. </div>
  192. </a-col>
  193. <a-col :span="6">
  194. <div class="page-data-module">
  195. <div class="page-data-con">
  196. <p class="page-data-tit">客户总数(个)</p>
  197. <h3 class="page-data-num">
  198. ****
  199. </h3>
  200. <p class="page-data-item">
  201. <span class="page-data-itemText">本周新增</span>
  202. <span class="page-data-itemText">
  203. ****
  204. </span>
  205. </p>
  206. <p class="page-data-item">
  207. <span class="page-data-itemText">30天内采购客户</span>
  208. <span class="page-data-itemText">
  209. ****
  210. </span>
  211. </p>
  212. </div>
  213. <span class="page-data-line"></span>
  214. </div>
  215. </a-col>
  216. <a-col :span="6">
  217. <div class="page-data-module">
  218. <div class="page-data-con">
  219. <p class="page-data-tit">总库存(个)</p>
  220. <h3 class="page-data-num" style="line-height: 36px;">
  221. ****
  222. </h3>
  223. <p class="page-data-tit">库存总金额(元)</p>
  224. <h3 class="page-data-num" style="line-height: 36px;margin: 0;">
  225. ****
  226. </h3>
  227. </div>
  228. </div>
  229. </a-col>
  230. </a-row>
  231. </a-card>
  232. <div>
  233. <a-row>
  234. <a-col :span="16">
  235. <a-card size="small" :bordered="false" class="page-cont" :bodyStyle="{padding: '17px 30px 20px'}">
  236. <h3 class="page-tit">
  237. <span>销售/采购/调拨指引</span>
  238. <a-radio-group v-model="curDate" @change="onDateChange">
  239. <a-radio-button value="6">
  240. 最近半年
  241. </a-radio-button>
  242. <a-radio-button value="12">
  243. 最近一年
  244. </a-radio-button>
  245. <a-radio-button value="0">
  246. 全部
  247. </a-radio-button>
  248. </a-radio-group>
  249. </h3>
  250. <div class="page-nav-main">
  251. <!-- 导航指引 start -->
  252. <div class="page-nav-con" v-for="(item, index) in navList" :key="index">
  253. <div class="page-nav-box" v-for="(subItem, subInd) in item" :key="subInd">
  254. <a-badge
  255. :count="countData&&unitItem.permission&&unitItem.orderNum&&$hasPermissions(unitItem.permission) ? countData[unitItem.orderNum] : 0"
  256. class="page-nav-badge"
  257. v-for="(unitItem, unitInd) in subItem"
  258. :key="unitInd"
  259. @click="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission) ? goPage(unitItem,subInd) : null"
  260. :style="{cursor: unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)?'pointer': 'initial'}">
  261. <div :class="['page-nav-item', unitItem.styleC]">
  262. <div class="page-nav-n">
  263. <img v-show="unitItem.icon" :src="unitItem.icon" width="16" height="16" />
  264. <span>{{ unitItem.name }}</span>
  265. </div>
  266. <a-icon type="caret-right" v-show="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)" style="color: #BBBBBB;" />
  267. </div>
  268. </a-badge>
  269. </div>
  270. </div>
  271. <!-- 导航指引 end -->
  272. </div>
  273. </a-card>
  274. </a-col>
  275. <a-col :span="8">
  276. <a-card size="small" :bordered="false" class="page-cont right-con" :bodyStyle="{padding: '17px 30px 20px'}">
  277. <h3 class="page-tit"><span>财务指引</span></h3>
  278. <!-- 财务指引 start -->
  279. <div class="page-nav-con" v-for="(item, index) in navFinancialList" :key="index">
  280. <div class="page-nav-box" v-for="(subItem, subInd) in item" :key="subInd" style="width: 50%;">
  281. <div class="page-nav-badge" v-for="(unitItem, unitInd) in subItem" :key="unitInd" @click="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission) ? goPage(unitItem) : null" :style="{cursor: unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)?'pointer': 'initial'}">
  282. <div :class="['page-nav-item', unitItem.styleC]">
  283. <div class="page-nav-n">
  284. <img v-show="unitItem.icon" :src="unitItem.icon" width="16" height="16" />
  285. <span>{{ unitItem.name }}</span>
  286. </div>
  287. <a-icon type="caret-right" v-show="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)" style="color: #BBBBBB;" />
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. <!-- 财务指引 end -->
  293. </a-card>
  294. <a-card size="small" :bordered="false" class="page-cont right-con" :bodyStyle="{padding: '17px 30px 20px'}">
  295. <h3 class="page-tit"><span>其他指引</span></h3>
  296. <!-- 其他指引 start -->
  297. <div class="page-nav-con" v-for="(item, index) in navOtherList" :key="index">
  298. <div class="page-nav-box" v-for="(subItem, subInd) in item" :key="subInd" style="width: 50%;">
  299. <div class="page-nav-badge" v-for="(unitItem, unitInd) in subItem" :key="unitInd" @click="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission) ? goPage(unitItem):null" :style="{cursor: unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)?'pointer': 'initial'}">
  300. <div :class="['page-nav-item', unitItem.styleC]">
  301. <div class="page-nav-n">
  302. <img v-show="unitItem.icon" :src="unitItem.icon" width="16" height="16" />
  303. <span>{{ unitItem.name }}</span>
  304. </div>
  305. <a-icon type="caret-right" v-show="unitItem.permission&&unitItem.url&&$hasPermissions(unitItem.permission)" style="color: #BBBBBB;" />
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <!-- 其他指引 end -->
  311. </a-card>
  312. </a-col>
  313. </a-row>
  314. </div>
  315. <!-- 重置密码 -->
  316. <a-modal
  317. class="resetPwdModal"
  318. title="重置密码"
  319. width="60%"
  320. centered
  321. :footer="null"
  322. :closable="false"
  323. :maskClosable="false"
  324. :destroyOnClose="true"
  325. @cancel="openResetPwd=false"
  326. v-model="openResetPwd">
  327. <ResetPwd />
  328. </a-modal>
  329. <!-- 新产品上线提醒 -->
  330. <a-modal
  331. class="newProductTips"
  332. :title="'新产品'+(onlineFalg=='1'?'上':'下')+'线提醒'"
  333. :width="800"
  334. centered
  335. :footer="null"
  336. :maskClosable="false"
  337. :destroyOnClose="true"
  338. @cancel="cancelProductTips"
  339. v-model="openNewProduct">
  340. <newProduct :onlineFalg="onlineFalg" @seeMore="seeMore"></newProduct>
  341. </a-modal>
  342. </div>
  343. </template>
  344. <script>
  345. import { mixin, commonMixin } from '@/utils/mixin'
  346. import getDate from '@/libs/getDate.js'
  347. import { mapGetters } from 'vuex'
  348. import ResetPwd from '@/views/user/ResetPwd.vue'
  349. import newProduct from '@/views/productManagement/newProduct/modal.vue'
  350. import { queryNewProductPage } from '@/api/product'
  351. import { bizStateCount, bizData, dealerData } from '@/api/data'
  352. export default {
  353. name: 'Home',
  354. components: { ResetPwd, newProduct },
  355. mixins: [mixin, commonMixin],
  356. data () {
  357. return {
  358. message: '欢迎登录' + process.env.VUE_APP_PRO_NAME,
  359. hiddenBizData: true, // 隐藏数据概览
  360. openResetPwd: false, // 重置密码是否显示
  361. openNewProduct: false,
  362. onlineFalg: '1', // 上下线标识 1为上线,0为下线
  363. queryParams: {
  364. beginDate: getDate.getMonthDays(12).starttime,
  365. endDate: getDate.getMonthDays(12).endtime
  366. },
  367. curDate: '12',
  368. navList: [
  369. [ // 客户
  370. [
  371. {
  372. icon: require('@/assets/home-icon/home_icon_customer.png'),
  373. name: '客户',
  374. styleC: 'blue-color',
  375. url: 'customerInfoList',
  376. permission: 'M_customerInfoList',
  377. orderNum: ''
  378. }
  379. ],
  380. [
  381. {
  382. icon: require('@/assets/home-icon/home_icon_billing.png'),
  383. name: '销售开单',
  384. styleC: 'red-color',
  385. url: 'salesQueryList',
  386. permission: 'M_salesQueryList',
  387. orderNum: ''
  388. },
  389. {
  390. icon: require('@/assets/home-icon/home_icon_return.png'),
  391. name: '销售退货',
  392. styleC: 'red-color',
  393. url: 'salesReturnList',
  394. permission: 'M_salesReturnList',
  395. orderNum: ''
  396. }
  397. ],
  398. [
  399. {
  400. icon: require('@/assets/home-icon/home_icon_verify.png'),
  401. name: '销售审核',
  402. styleC: 'blue-color',
  403. url: 'salesQueryList',
  404. params: { billStatus: 'WAIT_AUDIT' },
  405. permission: 'M_salesQueryList',
  406. orderNum: 'salesWaitAuditCount'
  407. },
  408. {
  409. icon: require('@/assets/home-icon/home_icon_verify.png'),
  410. name: '退货审核',
  411. styleC: 'blue-color',
  412. url: 'salesReturnList',
  413. params: { state: 'WAIT_AUDIT' },
  414. permission: 'M_salesReturnList',
  415. orderNum: 'salesReturnWaitAuditCount'
  416. }
  417. ],
  418. [
  419. {
  420. icon: require('@/assets/home-icon/home_icon_stock.png'),
  421. name: '销售出库',
  422. styleC: 'red-color',
  423. url: 'outboundOrderList',
  424. params: { state: 'WAIT', outBizType: 'SALES' },
  425. permission: 'M_outboundList',
  426. orderNum: 'salesWaitOutWarehouseCount'
  427. },
  428. {
  429. icon: require('@/assets/home-icon/home_icon_finance_pay.png'),
  430. name: '财务付款',
  431. styleC: 'red-color',
  432. url: 'financialPaymentList',
  433. params: { bizType: 'SELL_REFUND', billState: 'UNSETTLE' },
  434. permission: 'M_financialPaymentList',
  435. orderNum: 'salesReturnFinancialWaitCount'
  436. }
  437. ],
  438. [
  439. {
  440. icon: require('@/assets/home-icon/home_icon_finance_payment.png'),
  441. name: '财务收款',
  442. styleC: 'blue-color',
  443. url: 'financialCollectionList',
  444. params: { bizType: 'SELL', billState: 'UNSETTLE' },
  445. permission: 'M_financialCollectionList',
  446. orderNum: 'salesFinancialWaitCount'
  447. },
  448. {}
  449. ]
  450. ],
  451. [ // 供应商(箭冠)
  452. [
  453. {
  454. icon: require('@/assets/home-icon/home_icon_supplier.png'),
  455. name: '供应商(箭冠)',
  456. styleC: 'blue-color',
  457. url: '',
  458. orderNum: ''
  459. }
  460. ],
  461. [
  462. {
  463. icon: require('@/assets/home-icon/home_icon_purchase_billing.png'),
  464. name: '采购开单',
  465. styleC: 'red-color',
  466. url: 'purchaseOrderList',
  467. permission: 'M_purchasingList',
  468. orderNum: ''
  469. },
  470. {
  471. icon: require('@/assets/home-icon/home_icon_purchase_return.png'),
  472. name: '采购退货',
  473. styleC: 'red-color',
  474. url: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'purchaseReturnOutSyncList' : 'purchaseReturnList',
  475. permission: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'M_purchaseReturn_outSnycList' : 'M_purchaseReturnList',
  476. orderNum: ''
  477. }
  478. ],
  479. [
  480. {
  481. icon: require('@/assets/home-icon/home_icon_verify_return.png'),
  482. name: '入库审核',
  483. styleC: 'blue-color',
  484. url: 'warehousingAuditList',
  485. params: { auditState: 'WAIT_PUT_WAREHOUSE_AUDIT' },
  486. permission: 'M_warehousingAuditList',
  487. orderNum: 'purchaseWaitAuditCount'
  488. },
  489. {
  490. icon: require('@/assets/home-icon/home_icon_verify_return.png'),
  491. name: '退货审核',
  492. styleC: 'blue-color',
  493. url: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'purchaseReturnOutSyncList' : 'purchaseReturnList',
  494. params: { state: 'WAIT_AUDIT' },
  495. permission: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'M_purchaseReturn_outSnycList' : 'M_purchaseReturnList',
  496. orderNum: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'purchaseReturnOutSyncWaitAuditCount' : 'purchaseReturnWaitAuditCount'
  497. }
  498. ],
  499. [
  500. {
  501. icon: require('@/assets/home-icon/home_icon_finance_pay.png'),
  502. name: '财务付款',
  503. styleC: 'red-color',
  504. url: 'financialPaymentList',
  505. params: { bizType: 'PURCHASE', billState: 'UNSETTLE' },
  506. permission: 'M_financialPaymentList',
  507. orderNum: 'purchaseFinancialWaitCount'
  508. },
  509. {
  510. icon: require('@/assets/home-icon/home_icon_finance_pay.png'),
  511. name: '财务收款',
  512. styleC: 'red-color',
  513. url: 'financialCollectionList',
  514. params: { bizType: 'PURCHASE_RETURN', billState: 'UNSETTLE' },
  515. permission: 'M_financialCollectionList',
  516. orderNum: this.$hasPermissions('M_purchaseReturn_outSnycList') ? 'purchaseReturnOutSyncFinancialWaitCount' : 'purchaseReturnFinancialWaitCount'
  517. }
  518. ]
  519. ],
  520. [ // 供应商(其他)
  521. [
  522. {
  523. icon: require('@/assets/home-icon/home_icon_supplier.png'),
  524. name: '供应商(其他)',
  525. styleC: 'blue-color',
  526. url: 'supplierInfoList',
  527. permission: 'M_supplierInfoList',
  528. orderNum: ''
  529. }
  530. ],
  531. [
  532. {
  533. icon: require('@/assets/home-icon/home_icon_scatter_warehousing.png'),
  534. name: '散件入库',
  535. styleC: 'red-color',
  536. url: 'bulkWarehousingOrderList',
  537. permission: 'M_bulkWarehousingOrderList',
  538. orderNum: ''
  539. },
  540. {
  541. icon: require('@/assets/home-icon/home_icon_scatter_return.png'),
  542. name: '散件退货',
  543. styleC: 'red-color',
  544. url: 'bulkReturnGoodsList',
  545. permission: 'M_bulkReturnGoodsList',
  546. orderNum: ''
  547. }
  548. ],
  549. [
  550. {
  551. icon: require('@/assets/home-icon/home_icon_verify_return.png'),
  552. name: '待入库',
  553. styleC: 'blue-color',
  554. url: 'bulkWarehousingOrderList',
  555. params: { state: 'WAIT_PUT_WAREHOUSE' },
  556. permission: 'M_bulkWarehousingOrderList',
  557. orderNum: 'sparePartsPurchaseWaitAuditCount'
  558. },
  559. {
  560. icon: require('@/assets/home-icon/home_icon_verify_return.png'),
  561. name: '退货审核',
  562. styleC: 'blue-color',
  563. url: 'bulkReturnGoodsList',
  564. params: { state: 'WAIT_AUDIT' },
  565. permission: 'M_bulkReturnGoodsList',
  566. orderNum: 'sparePartsReturnWaitAuditCount'
  567. }
  568. ],
  569. [
  570. {
  571. icon: require('@/assets/home-icon/home_icon_finance_pay.png'),
  572. name: '财务付款',
  573. styleC: 'red-color',
  574. url: 'financialPaymentList',
  575. params: { bizType: 'PARTS_INPUT', billState: 'UNSETTLE' },
  576. permission: 'M_financialPaymentList',
  577. orderNum: 'sparePartsPurchaseFinancialWaitCount'
  578. },
  579. {
  580. icon: require('@/assets/home-icon/home_icon_stock.png'),
  581. name: '待出库',
  582. styleC: 'red-color',
  583. url: 'bulkReturnGoodsList',
  584. params: { state: 'WAIT_OUT_WAREHOUSE' },
  585. permission: 'M_bulkReturnGoodsList',
  586. orderNum: 'sparePartsReturnWaitOutWarehouseCount'
  587. }
  588. ],
  589. [
  590. {},
  591. {
  592. icon: require('@/assets/home-icon/home_icon_finance_payment.png'),
  593. name: '财务收款',
  594. styleC: 'blue-color',
  595. url: 'financialCollectionList',
  596. params: { bizType: 'SPARE_PARTS_RETURN', billState: 'UNSETTLE' },
  597. permission: 'M_financialCollectionList',
  598. orderNum: 'sparePartsReturnFinancialWaitCount'
  599. }
  600. ]
  601. ],
  602. [ // 调拨
  603. [
  604. {
  605. icon: require('@/assets/home-icon/home_icon_transfer.png'),
  606. name: '调拨',
  607. styleC: 'blue-color',
  608. url: '',
  609. orderNum: ''
  610. }
  611. ],
  612. [
  613. {
  614. icon: require('@/assets/home-icon/home_icon_stor_out.png'),
  615. name: '店内调出',
  616. styleC: 'red-color',
  617. url: 'storeTransferOutList',
  618. permission: 'M_storeTransferOutList',
  619. orderNum: ''
  620. },
  621. {
  622. icon: require('@/assets/home-icon/home_icon_billing.png'),
  623. name: '仓库调拨',
  624. styleC: 'red-color',
  625. url: 'warehouseAllocationList',
  626. permission: 'M_warehouseAllocationList',
  627. orderNum: ''
  628. },
  629. {
  630. icon: require('@/assets/home-icon/home_icon_billing.png'),
  631. name: '连锁调出',
  632. styleC: 'red-color',
  633. url: 'chainTransferOutList',
  634. permission: 'M_chainTransferOutList',
  635. orderNum: ''
  636. }
  637. ],
  638. [
  639. {
  640. icon: require('@/assets/home-icon/home_icon_verify.png'),
  641. name: '调出审核',
  642. styleC: 'blue-color',
  643. url: 'storeTransferOutList',
  644. params: { state: 'WAIT_AUDIT' },
  645. permission: 'M_storeTransferOutList',
  646. orderNum: 'storeCallOutWaitAuditCount'
  647. },
  648. {
  649. icon: require('@/assets/home-icon/home_icon_verify.png'),
  650. name: '调拨审核',
  651. styleC: 'blue-color',
  652. url: 'warehouseAllocationList',
  653. params: { state: 'WAIT_AUDIT' },
  654. permission: 'M_warehouseAllocationList',
  655. orderNum: 'alloWarehouseWaitAuditCount'
  656. },
  657. {
  658. icon: require('@/assets/home-icon/home_icon_verify.png'),
  659. name: '调出审核',
  660. styleC: 'blue-color',
  661. url: 'chainTransferOutList',
  662. params: { state: 'WAIT_AUDIT' },
  663. permission: 'M_chainTransferOutList',
  664. orderNum: 'alloLinkageOutWaitAuditCount'
  665. }
  666. ],
  667. [
  668. {
  669. icon: require('@/assets/home-icon/home_icon_stock.png'),
  670. name: '调出出库',
  671. styleC: 'red-color',
  672. url: 'outboundOrderList',
  673. params: { state: 'WAIT', outBizType: 'SHOP_CALL_OUT' },
  674. permission: 'M_outboundList',
  675. orderNum: 'storeCallOutWaitOutWarehouseCount'
  676. },
  677. {},
  678. {
  679. icon: require('@/assets/home-icon/home_icon_stock.png'),
  680. name: '调出出库',
  681. styleC: 'red-color',
  682. url: 'outboundOrderList',
  683. params: { state: 'WAIT', outBizType: 'LINKAGE_CALL_OUT' },
  684. permission: 'M_outboundList',
  685. orderNum: 'alloLinkageOutWaitOutWarehouseCount'
  686. }
  687. ],
  688. [
  689. {
  690. icon: require('@/assets/home-icon/home_icon_finance_payment.png'),
  691. name: '财务收款',
  692. styleC: 'blue-color',
  693. url: 'financialCollectionList',
  694. params: { bizType: 'STORE_CALL_OUT', billState: 'UNSETTLE' },
  695. permission: 'M_financialCollectionList',
  696. orderNum: 'storeCallOutFinancialWaitCount'
  697. },
  698. {},
  699. {}
  700. ]
  701. ]
  702. ],
  703. countData: null,
  704. bizData: null,
  705. dealerData: null,
  706. navFinancialList: [ // 财务指引
  707. [
  708. [
  709. {
  710. icon: require('@/assets/home-icon/home_icon_receivable.png'),
  711. name: '应收应付',
  712. styleC: 'blue-color',
  713. url: 'companyReceivablePayableList',
  714. permission: 'M_companyReceivablePayableList',
  715. orderNum: ''
  716. },
  717. {
  718. icon: require('@/assets/home-icon/home_icon_finance.png'),
  719. name: '财务收款',
  720. styleC: 'blue-color',
  721. url: 'financialCollectionList',
  722. params: { bizType: 'ALL' },
  723. permission: 'M_financialCollectionList',
  724. orderNum: ''
  725. }
  726. ],
  727. [
  728. {
  729. icon: require('@/assets/home-icon/home_icon_unit.png'),
  730. name: '收付款记录',
  731. styleC: 'blue-color',
  732. url: 'companyCollectionPaymentList',
  733. permission: 'M_companyCollectionPaymentList',
  734. orderNum: ''
  735. },
  736. {
  737. icon: require('@/assets/home-icon/home_icon_pay.png'),
  738. name: '财务付款',
  739. styleC: 'blue-color',
  740. url: 'financialPaymentList',
  741. params: { bizType: 'ALL' },
  742. permission: 'M_financialPaymentList',
  743. orderNum: ''
  744. }
  745. ]
  746. ]
  747. ],
  748. navOtherList: [ // 其他指引
  749. [
  750. [
  751. {
  752. icon: require('@/assets/home-icon/home_icon_stock s.png'),
  753. name: '实时库存',
  754. styleC: 'blue-color',
  755. url: 'inventoryQueryList',
  756. permission: 'M_inventoryInventoryQueryList',
  757. orderNum: ''
  758. }
  759. ],
  760. [
  761. {
  762. icon: require('@/assets/home-icon/home_icon_inventory.png'),
  763. name: '库存盘点',
  764. styleC: 'blue-color',
  765. url: 'inventoryCheckingList',
  766. permission: 'M_inventoryCheckingList',
  767. orderNum: ''
  768. }
  769. ]
  770. ]
  771. ]
  772. }
  773. },
  774. computed: {
  775. ...mapGetters(['mustChangePwd'])
  776. },
  777. watch: {
  778. hiddenBizData (newValue, oldValue) {
  779. if (!newValue) {
  780. this.getBizData()
  781. }
  782. }
  783. },
  784. methods: {
  785. hasNewProduct () {
  786. queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
  787. if (res.status == 200) {
  788. if (res.data.count > 0) {
  789. this.openNewProduct = true
  790. } else {
  791. if (this.onlineFalg == '1') {
  792. this.onlineFalg = '0'
  793. this.hasNewProduct()
  794. }
  795. }
  796. }
  797. })
  798. },
  799. // 查看更多产品
  800. seeMore () {
  801. this.openNewProduct = false
  802. if (this.onlineFalg == '1') { // 上线
  803. this.$router.push({ name: 'productOnlineInfo' })
  804. } else { // 下线
  805. this.$router.push({ name: 'newProductList', params: { onlineFalg: this.onlineFalg } })
  806. }
  807. },
  808. // 关闭弹框
  809. cancelProductTips () {
  810. const _this = this
  811. this.openNewProduct = false
  812. if (this.onlineFalg == '1') {
  813. this.onlineFalg = '0'
  814. setTimeout(() => { _this.hasNewProduct() }, 100)
  815. }
  816. },
  817. // 导航指引合计
  818. getNavCount () {
  819. bizStateCount(this.queryParams).then(res => {
  820. if (res.status == 200) {
  821. this.countData = res.data
  822. } else {
  823. this.countData = null
  824. }
  825. })
  826. },
  827. onDateChange (e) {
  828. console.log(e.target.value)
  829. const v = e.target.value
  830. if (v != 0) {
  831. this.queryParams.beginDate = getDate.getMonthDays(v).starttime
  832. this.queryParams.endDate = getDate.getMonthDays(v).endtime
  833. } else {
  834. this.queryParams.beginDate = undefined
  835. this.queryParams.endDate = undefined
  836. }
  837. this.getNavCount()
  838. },
  839. // 导航跳转
  840. goPage (data, subInd) {
  841. if (data) {
  842. let params = null
  843. // 有待办数据,则跳转带有条件的;若无待办数据,则跳转全部数据
  844. if (data.orderNum && this.countData[data.orderNum] || data.params) {
  845. params = { pageParams: data.params, type: 'todo' }
  846. } else {
  847. params = { pageParams: null, type: subInd == 1 ? 'new' : 'todo' }
  848. }
  849. this.setIsHomeNav(data.url, params)
  850. setTimeout(() => {
  851. this.$router.push({ name: data.url })
  852. }, 100)
  853. }
  854. },
  855. // 数据看板信息
  856. getBizData () {
  857. bizData({}).then(res => {
  858. if (res.status == 200) {
  859. this.bizData = res.data
  860. } else {
  861. this.bizData = null
  862. }
  863. })
  864. },
  865. // 商户信息
  866. getMerchantData () {
  867. dealerData({}).then(res => {
  868. if (res.status == 200) {
  869. this.dealerData = res.data
  870. } else {
  871. this.dealerData = null
  872. }
  873. })
  874. }
  875. },
  876. activated () {
  877. // 请求导航指引合计
  878. this.getNavCount()
  879. this.getMerchantData()
  880. },
  881. beforeRouteEnter (to, from, next) {
  882. next(vm => {
  883. // 判断登录用户是否重置过密码(首次登陆需强制重置密码)
  884. if (vm.mustChangePwd == 0) {
  885. vm.openResetPwd = false
  886. if (from.name == 'login') {
  887. // 判断是否有新产品上线
  888. vm.hasNewProduct()
  889. }
  890. } else {
  891. vm.openResetPwd = true
  892. }
  893. })
  894. }
  895. }
  896. </script>
  897. <style lang="less" scoped>
  898. .ant-card-body{
  899. padding: 17px 30px 20px;
  900. }
  901. .home {
  902. .page-cont{
  903. margin-bottom: 10px;
  904. // 客户信息
  905. .page-tit{
  906. color: #000000;
  907. font-size: 16px;
  908. font-weight: 500;
  909. margin-bottom: 18px;
  910. display: flex;
  911. justify-content: space-between;
  912. align-items: center;
  913. span{
  914. font-weight: bold;
  915. }
  916. }
  917. .page-list{
  918. list-style: none;
  919. margin: 0;
  920. padding: 0;
  921. li{
  922. display: inline-block;
  923. width: 25%;
  924. font-size: 14px;
  925. color: rgba(0, 0, 0);
  926. vertical-align: top;
  927. }
  928. }
  929. // 数据看板
  930. .page-data-module{
  931. display: flex;
  932. justify-content: space-between;
  933. align-items: center;
  934. .page-data-con{
  935. padding: 20px 30px;
  936. flex-grow: 1;
  937. .page-data-tit{
  938. font-size: 14px;
  939. color: rgba(0, 0, 0);
  940. margin: 0;
  941. }
  942. .page-data-num{
  943. font-size: 28px;
  944. font-family: PingFang SC;
  945. color: #000000;
  946. margin-bottom: 5px;
  947. display: flex;
  948. align-items: center;
  949. }
  950. .main-color{
  951. color: rgba(231, 0, 18, 1);
  952. }
  953. .page-data-item{
  954. display: flex;
  955. justify-content: space-between;
  956. align-items: center;
  957. margin-bottom: 3px;
  958. .page-data-itemText{
  959. font-size: 14px;
  960. color: rgba(0, 0, 0);
  961. display: flex;
  962. align-items: center;
  963. }
  964. }
  965. }
  966. .page-data-line{
  967. display: block;
  968. width: 1px;
  969. height: 76px;
  970. background-color: rgba(232, 232, 232, 1);
  971. }
  972. }
  973. // 操作导航引导
  974. .page-nav-con{
  975. display: flex;
  976. align-items: center;
  977. margin-bottom: 20px;
  978. padding-bottom: 20px;
  979. border-bottom: 1px solid #e8e8e8;
  980. &:last-child{
  981. margin-bottom: 0px;
  982. padding-bottom: 0px;
  983. border-bottom: none;
  984. }
  985. .page-nav-box{
  986. display: inline-block;
  987. width: 20%;
  988. .page-nav-badge{
  989. width: 94%;
  990. margin: 5px 0;
  991. .page-nav-item{
  992. border-radius: 8px;
  993. display: flex;
  994. justify-content: space-between;
  995. align-items: center;
  996. padding: 13px 10px;
  997. &:hover{
  998. opacity: 0.8;
  999. transform:scale(0.98)
  1000. }
  1001. .page-nav-n{
  1002. img{
  1003. vertical-align: sub;
  1004. }
  1005. span{
  1006. color: rgba(0, 0, 0);
  1007. font-size: 14px;
  1008. padding-left: 5px;
  1009. }
  1010. }
  1011. }
  1012. .blue-color{
  1013. background-color: #EDF0F9;
  1014. }
  1015. .red-color{
  1016. background-color: #F8F1EF;
  1017. }
  1018. }
  1019. }
  1020. }
  1021. }
  1022. .right-con{
  1023. margin-left: 10px;
  1024. }
  1025. &.small{
  1026. .page-cont{
  1027. .page-tit,
  1028. .page-list li,
  1029. .page-nav-badge .page-nav-n span{
  1030. font-size: 14px!important;
  1031. }
  1032. }
  1033. .page-data-module{
  1034. .page-data-tit,
  1035. .page-data-itemText{
  1036. font-size: 14px!important;
  1037. }
  1038. }
  1039. }
  1040. &.middle{
  1041. .page-cont{
  1042. .page-tit,
  1043. .page-list li,
  1044. .page-nav-badge .page-nav-n span{
  1045. font-size: 14px!important;
  1046. }
  1047. }
  1048. .page-data-module{
  1049. .page-data-tit,
  1050. .page-data-itemText{
  1051. font-size: 14px!important;
  1052. }
  1053. }
  1054. }
  1055. &.large{
  1056. .page-cont{
  1057. .page-tit,
  1058. .page-list li,
  1059. .page-nav-badge .page-nav-n span{
  1060. font-size: 16px!important;
  1061. }
  1062. }
  1063. .page-data-module{
  1064. .page-data-tit,
  1065. .page-data-itemText{
  1066. font-size: 16px!important;
  1067. }
  1068. }
  1069. }
  1070. }
  1071. </style>