You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1102 lines
34 KiB

2 years ago
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
1 year ago
​
1 year ago
1 year ago
2 years ago
​
1 year ago
​
3 months ago
1 year ago
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
2 months ago
​
​
​
​
​
3 months ago
​
1 year ago
1 year ago
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
12 months ago
1 year ago
​
​
​
​
1 year ago
​
​
​
1 year ago
​
3 months ago
​
​
​
3 months ago
3 months ago
​
​
​
​
​
3 months ago
3 months ago
​
​
​
​
3 months ago
3 months ago
​
​
​
​
3 months ago
3 months ago
​
​
​
​
3 months ago
3 months ago
3 months ago
​
​
​
3 months ago
3 months ago
3 months ago
​
​
​
3 months ago
3 months ago
​
​
​
​
3 months ago
3 months ago
​
​
​
​
3 months ago
3 months ago
2 months ago
​
​
​
​
3 months ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
1 month ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
3 months ago
​
1 year ago
​
3 months ago
1 year ago
​
​
​
​
3 months ago
​
​
1 year ago
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
12 months ago
​
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
​
​
3 months ago
1 year ago
​
​
1 year ago
3 months ago
​
​
11 months ago
3 months ago
12 months ago
​
​
11 months ago
12 months ago
3 months ago
​
​
​
​
1 year ago
1 year ago
1 year ago
3 months ago
1 year ago
​
​
​
​
1 year ago
​
​
​
3 months ago
1 year ago
​
​
​
​
11 months ago
3 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
​
​
​
​
​
​
1 year ago
2 years ago
1 year ago
​
2 years ago
​
​
​
​
1 year ago
​
2 years ago
​
​
1 year ago
​
​
​
​
​
2 years ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
1 year ago
3 months ago
1 year ago
1 year ago
1 year ago
2 years ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
3 months ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
3 months ago
​
1 year ago
​
3 months ago
​
​
​
​
​
​
​
1 year ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
​
​
​
1 year ago
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
1 year ago
1 year ago
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
1 year ago
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
1 year ago
1 year ago
​
2 years ago
1 year ago
​
2 years ago
​
1 year ago
1 year ago
​
​
1 year ago
​
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
1 year ago
​
​
​
1 year ago
1 year ago
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
2 years ago
1 year ago
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
​
​
​
1 year ago
1 year ago
1 year ago
1 year ago
​
​
​
​
​
1 year ago
2 years ago
1 year ago
​
​
1 year ago
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
1 year ago
2 years ago
  1. <template>
  2. <div class="pda-container">
  3. <!-- 头部栏 -->
  4. <div class="header-bar">
  5. <div class="warehouse-selector" @click="toggleWarehouseDropdown">
  6. <span class="warehouse-text">{{ selectedWarehouseName || '选择仓库' }}</span>
  7. <i class="el-icon-arrow-down" :class="{ 'rotate': showWarehouseDropdown }"></i>
  8. <div class="warehouse-dropdown" v-show="showWarehouseDropdown">
  9. <div class="dropdown-item loading" v-if="warehouseLoading">
  10. <i class="el-icon-loading"></i>
  11. 加载中...
  12. </div>
  13. <div
  14. v-else
  15. v-for="item in warehouseList"
  16. :key="item.warehouseid"
  17. class="dropdown-item"
  18. :class="{ 'active': selectedWarehouse === item.warehouseid }"
  19. @click.stop="selectWarehouse(item)">
  20. {{ item.warehousename }}
  21. </div>
  22. <div class="dropdown-item empty" v-if="!warehouseLoading && warehouseList.length === 0">
  23. 暂无可用仓库
  24. </div>
  25. </div>
  26. </div>
  27. <div style="font-size: 18px">{{username}}</div>
  28. <div class="logout-button" @click="logoutHandle()">
  29. <i class="el-icon-close"></i>
  30. <span>退出</span>
  31. </div>
  32. </div>
  33. <!-- 功能区域 -->
  34. <div class="content-area">
  35. <!-- section层级也支持site授权,默认*全工厂可见,按需改为具体site编码 - rqrq -->
  36. <!-- 收货入库 -->
  37. <div class="section" v-site-auth="'*'">
  38. <div class="section-header">
  39. <span class="bullet">•</span>
  40. <span class="section-title">收货入库</span>
  41. </div>
  42. <div class="button-grid">
  43. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('porecv')">
  44. <div class="menu-icon purchase">
  45. <van-icon name="shopping-cart-o" size="24" />
  46. </div>
  47. <div class="menu-text">采购入库</div>
  48. </div>
  49. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('productionInboundProduction')">
  50. <div class="menu-icon production-inbound">
  51. <van-icon name="cart" size="24" />
  52. </div>
  53. <div class="menu-text">生产入库</div>
  54. </div>
  55. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('productionreturn')">
  56. <div class="menu-icon production-return">
  57. <van-icon name="revoke" size="24" />
  58. </div>
  59. <div class="menu-text">生产退料</div>
  60. </div>
  61. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('salereturn')">
  62. <div class="menu-icon sales-return">
  63. <van-icon name="revoke" size="24" />
  64. </div>
  65. <div class="menu-text">销售退货</div>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- 拣货出库 -->
  70. <div class="section" v-site-auth="'*'">
  71. <div class="section-header">
  72. <span class="bullet">•</span>
  73. <span class="section-title">拣货出库</span>
  74. </div>
  75. <div class="button-grid">
  76. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('inventory-move')">
  77. <div class="menu-icon inventory-move">
  78. <van-icon name="exchange" size="24" />
  79. </div>
  80. <div class="menu-text">移库</div>
  81. </div>
  82. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('inventory-move-cross-site')">
  83. <div class="menu-icon inventory-move">
  84. <van-icon name="guide-o" size="24" />
  85. </div>
  86. <div class="menu-text">跨site移库</div>
  87. </div>
  88. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('otherinout')">
  89. <div class="menu-icon other">
  90. <van-icon name="exchange" size="24" />
  91. </div>
  92. <div class="menu-text">其他出入库</div>
  93. </div>
  94. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('productionissue')">
  95. <div class="menu-icon production-issue">
  96. <van-icon name="send-gift-o" size="24" />
  97. </div>
  98. <div class="menu-text">生产领料</div>
  99. </div>
  100. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('mrissue')">
  101. <div class="menu-icon mr">
  102. <van-icon name="orders-o" size="24" />
  103. </div>
  104. <div class="menu-text">MR发料</div>
  105. </div>
  106. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('outsource')">
  107. <div class="menu-icon outsourcing">
  108. <van-icon name="logistics" size="24" />
  109. </div>
  110. <div class="menu-text">委外发料</div>
  111. </div>
  112. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('customerissue')">
  113. <!-- <div class="menu-item disabled" @click="handleDisabledFeature('customerissue')"> -->
  114. <div class="menu-icon sales-delivery">
  115. <van-icon name="logistics" size="24" />
  116. </div>
  117. <div class="menu-text">销售出库</div>
  118. </div>
  119. <!-- <div class="menu-item disabled" @click="handleDisabledFeature('transportation')">
  120. <div class="menu-icon transport">
  121. <van-icon name="guide-o" size="24" />
  122. </div>
  123. <div class="menu-text">运输任务</div>
  124. </div> -->
  125. </div>
  126. </div>
  127. <!-- 海安立库操作(固定开放工厂54)- rqrq -->
  128. <div class="section" v-site-auth="'54'">
  129. <div class="section-header">
  130. <span class="bullet">•</span>
  131. <span class="section-title">立库日常操作</span>
  132. </div>
  133. <div class="button-grid">
  134. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianCallOutToStation')">
  135. <div class="menu-icon purchase">
  136. <van-icon name="shopping-cart-o" size="24" />
  137. </div>
  138. <div class="menu-text">立库取货</div>
  139. </div>
  140. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletPacking')">
  141. <div class="menu-icon purchase">
  142. <van-icon name="shopping-cart-o" size="24" />
  143. </div>
  144. <div class="menu-text">组盘入库</div>
  145. </div>
  146. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletSorting')">
  147. <div class="menu-icon purchase">
  148. <van-icon name="shopping-cart-o" size="24" />
  149. </div>
  150. <div class="menu-text">分拣组盘</div>
  151. </div>
  152. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletSearch')">
  153. <div class="menu-icon purchase">
  154. <van-icon name="shopping-cart-o" size="24" />
  155. </div>
  156. <div class="menu-text">查看托盘</div>
  157. </div>
  158. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletChangeStation')">
  159. <div class="menu-icon purchase">
  160. <van-icon name="shopping-cart-o" size="24" />
  161. </div>
  162. <div class="menu-text">托盘运输</div>
  163. </div>
  164. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianEmptyPalletAssembly')">
  165. <div class="menu-icon purchase">
  166. <van-icon name="shopping-cart-o" size="24" />
  167. </div>
  168. <div class="menu-text">空托盘入库</div>
  169. </div>
  170. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianCancelWcsPallet')">
  171. <div class="menu-icon purchase">
  172. <van-icon name="shopping-cart-o" size="24" />
  173. </div>
  174. <div class="menu-text">取消组盘</div>
  175. </div>
  176. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletMerge')">
  177. <div class="menu-icon purchase">
  178. <van-icon name="shopping-cart-o" size="24" />
  179. </div>
  180. <div class="menu-text">栈板合托</div>
  181. </div>
  182. <!-- 海安齐套运输入口,沿用当前仓库选择校验,业务site由新页面显式传递。- rqrq -->
  183. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianCacheTransport')">
  184. <div class="menu-icon transport"><van-icon name="logistics" size="24" /></div>
  185. <div class="menu-text">齐套运输</div>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="section" v-site-auth="'54'">
  190. <div class="section-header">
  191. <span class="bullet">•</span>
  192. <span class="section-title">立库特殊操作</span>
  193. </div>
  194. <div class="button-grid">
  195. <!-- <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianCallOut')">-->
  196. <!-- <div class="menu-icon purchase">-->
  197. <!-- <van-icon name="shopping-cart-o" size="24" />-->
  198. <!-- </div>-->
  199. <!-- <div class="menu-text">Call料</div>-->
  200. <!-- </div>-->
  201. <!-- <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletAssembly')">-->
  202. <!-- <div class="menu-icon purchase">-->
  203. <!-- <van-icon name="shopping-cart-o" size="24" />-->
  204. <!-- </div>-->
  205. <!-- <div class="menu-text">直接组盘</div>-->
  206. <!-- </div>-->
  207. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletManualMove')">
  208. <div class="menu-icon purchase">
  209. <van-icon name="shopping-cart-o" size="24" />
  210. </div>
  211. <div class="menu-text">栈板人工移动</div>
  212. </div>
  213. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianWmsCancelReserve')">
  214. <div class="menu-icon inventory">
  215. <van-icon name="orders-o" size="24" />
  216. </div>
  217. <!-- WMS标签状态统一展示为预定,reserve字段和Y/N判断保持原有业务含义 - rqrq -->
  218. <div class="menu-text">取消预定</div>
  219. </div>
  220. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianManualCount54')">
  221. <div class="menu-icon purchase">
  222. <van-icon name="shopping-cart-o" size="24" />
  223. </div>
  224. <div class="menu-text">立库手工盘点</div>
  225. </div>
  226. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletSpecialEdit')">
  227. <div class="menu-icon purchase">
  228. <van-icon name="edit" size="24" />
  229. </div>
  230. <div class="menu-text">栈板特殊修改</div>
  231. </div>
  232. <!-- 海安专属标签特殊销账:独立页面,不复用老标签查询主流程 - rqrq -->
  233. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianLabelWriteOff')">
  234. <div class="menu-icon inventory">
  235. <van-icon name="orders-o" size="24" />
  236. </div>
  237. <div class="menu-text">标签特殊销账</div>
  238. </div>
  239. <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianPalletRelocate')">
  240. <div class="menu-icon purchase">
  241. <van-icon name="logistics" size="24" />
  242. </div>
  243. <div class="menu-text">栈板重移库</div>
  244. </div>
  245. <!-- <div class="menu-item" v-site-auth="'54'" @click="navigateWithWarehouseCheck('haianCallOutForHetuo')">-->
  246. <!-- <div class="menu-icon purchase">-->
  247. <!-- <van-icon name="shopping-cart-o" size="24" />-->
  248. <!-- </div>-->
  249. <!-- <div class="menu-text">合托Call板</div>-->
  250. <!-- </div>-->
  251. </div>
  252. </div>
  253. <div class="section" v-site-auth="'55'">
  254. <div class="section-header">
  255. <span class="bullet">•</span>
  256. <span class="section-title">立库常规操作</span>
  257. </div>
  258. <div class="button-grid">
  259. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('callOutToStation')">
  260. <div class="menu-icon purchase">
  261. <van-icon name="shopping-cart-o" size="24" />
  262. </div>
  263. <div class="menu-text">立库取货</div>
  264. </div>
  265. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletPacking')">
  266. <div class="menu-icon purchase">
  267. <van-icon name="shopping-cart-o" size="24" />
  268. </div>
  269. <div class="menu-text">组盘入库</div>
  270. </div>
  271. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletSorting')">
  272. <div class="menu-icon purchase">
  273. <van-icon name="shopping-cart-o" size="24" />
  274. </div>
  275. <div class="menu-text">分拣组盘</div>
  276. </div>
  277. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletSearch')">
  278. <div class="menu-icon purchase">
  279. <van-icon name="shopping-cart-o" size="24" />
  280. </div>
  281. <div class="menu-text">查看托盘</div>
  282. </div>
  283. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletChangeStation')">
  284. <div class="menu-icon purchase">
  285. <van-icon name="shopping-cart-o" size="24" />
  286. </div>
  287. <div class="menu-text">托盘运输</div>
  288. </div>
  289. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('emptyPalletAssembly')">
  290. <div class="menu-icon purchase">
  291. <van-icon name="shopping-cart-o" size="24" />
  292. </div>
  293. <div class="menu-text">空托盘入库</div>
  294. </div>
  295. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('cancelWcsPallet')">
  296. <div class="menu-icon purchase">
  297. <van-icon name="shopping-cart-o" size="24" />
  298. </div>
  299. <div class="menu-text">取消组盘</div>
  300. </div>
  301. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletMerge')">
  302. <div class="menu-icon purchase">
  303. <van-icon name="shopping-cart-o" size="24" />
  304. </div>
  305. <div class="menu-text">栈板合托</div>
  306. </div>
  307. </div>
  308. </div>
  309. <div class="section" v-site-auth="'55'">
  310. <div class="section-header">
  311. <span class="bullet">•</span>
  312. <span class="section-title">立库特殊操作</span>
  313. </div>
  314. <div class="button-grid">
  315. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('callOut')">
  316. <div class="menu-icon purchase">
  317. <van-icon name="shopping-cart-o" size="24" />
  318. </div>
  319. <div class="menu-text">Call料</div>
  320. </div>
  321. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletAssembly')">
  322. <div class="menu-icon purchase">
  323. <van-icon name="shopping-cart-o" size="24" />
  324. </div>
  325. <div class="menu-text">直接组盘</div>
  326. </div>
  327. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletManualMove')">
  328. <div class="menu-icon purchase">
  329. <van-icon name="shopping-cart-o" size="24" />
  330. </div>
  331. <div class="menu-text">栈板人工移动</div>
  332. </div>
  333. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('wmsCancelReserve')">
  334. <div class="menu-icon inventory">
  335. <van-icon name="orders-o" size="24" />
  336. </div>
  337. <div class="menu-text">取消预定</div>
  338. </div>
  339. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('palletSortingNoAgv')">
  340. <div class="menu-icon purchase">
  341. <van-icon name="shopping-cart-o" size="24" />
  342. </div>
  343. <div class="menu-text">无AGV分拣</div>
  344. </div>
  345. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('callOutForHetuo')">
  346. <div class="menu-icon purchase">
  347. <van-icon name="shopping-cart-o" size="24" />
  348. </div>
  349. <div class="menu-text">合托Call板</div>
  350. </div>
  351. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('manualCount')">
  352. <div class="menu-icon purchase">
  353. <van-icon name="shopping-cart-o" size="24" />
  354. </div>
  355. <div class="menu-text">立库手工盘点</div>
  356. </div>
  357. </div>
  358. </div>
  359. <!-- 库内管理 -->
  360. <div class="section" v-site-auth="'*'">
  361. <div class="section-header">
  362. <span class="bullet">•</span>
  363. <span class="section-title">库内管理</span>
  364. </div>
  365. <div class="button-grid">
  366. <!-- <div class="menu-item disabled" @click="handleDisabledFeature('attributechange')">
  367. <div class="menu-icon attribute">
  368. <van-icon name="setting-o" size="24" />
  369. </div>
  370. <div class="menu-text">属性变动</div>
  371. </div>-->
  372. <div class="menu-item" v-site-auth="'*'" @click="navigateWithWarehouseCheck('labelQuery')">
  373. <div class="menu-icon inventory">
  374. <van-icon name="orders-o" size="24" />
  375. </div>
  376. <div class="menu-text">标签查询</div>
  377. </div>
  378. <div class="menu-item" v-site-auth="'55'" @click="navigateWithWarehouseCheck('labelCalibration')">
  379. <div class="menu-icon inventory">
  380. <van-icon name="orders-o" size="24" />
  381. </div>
  382. <div class="menu-text">标签校准</div>
  383. </div>
  384. <!-- <div class="menu-item disabled" @click="handleDisabledFeature('stocktaking')">-->
  385. <!-- <div class="menu-icon inventory">-->
  386. <!-- <van-icon name="records" size="24" />-->
  387. <!-- </div>-->
  388. <!-- <div class="menu-text">盘点</div>-->
  389. <!-- </div>-->
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </template>
  395. <script>
  396. import { getUserAuthorizedWarehouses } from "@/api/warehouse.js"
  397. export default {
  398. data() {
  399. return {
  400. username: localStorage.getItem('userName'),
  401. warehouseList: [],
  402. selectedWarehouse: localStorage.getItem('selectedWarehouse') || '',
  403. selectedWarehouseName: '',
  404. warehouseLoading: false,
  405. showWarehouseDropdown: false
  406. }
  407. },
  408. directives: {
  409. // 站点授权指令:* 或 当前site 命中才渲染菜单 - rqrq
  410. siteAuth: {
  411. inserted(el, binding, vnode) {
  412. if (vnode.context && vnode.context.applySiteAuthForElement) {
  413. vnode.context.applySiteAuthForElement(el, binding)
  414. }
  415. },
  416. componentUpdated(el, binding, vnode) {
  417. if (vnode.context && vnode.context.applySiteAuthForElement) {
  418. vnode.context.applySiteAuthForElement(el, binding)
  419. }
  420. }
  421. }
  422. },
  423. computed: {
  424. documentClientHeight: {
  425. get() {
  426. return this.$store.state.common.documentClientHeight
  427. },
  428. set(val) {
  429. this.$store.commit('common/updateDocumentClientHeight', val)
  430. }
  431. },
  432. sidebarFold: {
  433. get() {
  434. return this.$store.state.common.sidebarFold
  435. }
  436. },
  437. userId: {
  438. get() {
  439. return this.$store.state.user.id
  440. },
  441. set(val) {
  442. this.$store.commit('user/updateId', val)
  443. }
  444. },
  445. userName: {
  446. get() {
  447. return this.$store.state.user.name
  448. },
  449. set(val) {
  450. this.$store.commit('user/updateName', val)
  451. }
  452. },
  453. site: {
  454. get() {
  455. const storeSite = this.$store.state.user.site
  456. const normalizedStoreSite = storeSite === null || storeSite === undefined ? '' : String(storeSite).trim()
  457. if (normalizedStoreSite && normalizedStoreSite !== '0') {
  458. return normalizedStoreSite
  459. }
  460. return (localStorage.getItem('site') || '').trim()
  461. },
  462. set(val) {
  463. this.$store.commit('user/updateSite', val)
  464. }
  465. },
  466. languageDefault: {
  467. get() {
  468. return this.$store.state.user.languageDefault
  469. },
  470. set(val) {
  471. this.$store.commit('user/updateLanguageDefault', val)
  472. }
  473. },
  474. userDisplay: {
  475. get() {
  476. return this.$store.state.user.userDisplay
  477. },
  478. set(val) {
  479. this.$store.commit('user/updateUserDisplay', val)
  480. }
  481. },
  482. },
  483. mounted() {
  484. // 点击外部关闭下拉框
  485. document.addEventListener('click', this.handleDocumentClick)
  486. },
  487. beforeDestroy() {
  488. document.removeEventListener('click', this.handleDocumentClick)
  489. },
  490. created() {
  491. this.syncStoreSiteFromCache()
  492. this.getUserInfo()
  493. this.getWarehouseList();
  494. },
  495. methods: {
  496. // 将缓存site同步到store,保证菜单渲染和接口取值一致 - rqrq
  497. syncStoreSiteFromCache() {
  498. const cacheSite = (localStorage.getItem('site') || '').trim()
  499. if (cacheSite) {
  500. this.$store.commit('user/updateSite', cacheSite)
  501. }
  502. },
  503. // 标准化菜单授权site配置:空值按*处理,支持逗号分隔多site - rqrq
  504. normalizeMenuSiteAuthValue(siteAuthValue) {
  505. const rawValue = siteAuthValue === null || siteAuthValue === undefined ? '*' : String(siteAuthValue).trim()
  506. return rawValue === '' ? '*' : rawValue
  507. },
  508. // 菜单授权规则:*全工厂可见,非*必须命中当前site才显示 - rqrq
  509. isMenuVisibleForCurrentSite(siteAuthValue) {
  510. const normalizedAuthValue = this.normalizeMenuSiteAuthValue(siteAuthValue)
  511. if (normalizedAuthValue === '*') {
  512. return true
  513. }
  514. const currentSite = this.site
  515. if (!currentSite) {
  516. return false
  517. }
  518. const authSiteList = normalizedAuthValue
  519. .split(',')
  520. .map(item => item.trim())
  521. .filter(item => item !== '')
  522. return authSiteList.includes('*') || authSiteList.includes(String(currentSite).trim())
  523. },
  524. // 指令落地:根据site授权值直接控制菜单节点显示 - rqrq
  525. applySiteAuthForElement(el, binding) {
  526. const isVisible = this.isMenuVisibleForCurrentSite(binding.value)
  527. el.style.display = isVisible ? '' : 'none'
  528. },
  529. // 处理禁用功能点击
  530. handleDisabledFeature(featureName) {
  531. this.$message({
  532. type: 'warning',
  533. message: `开发中,敬请期待...`,
  534. duration: 8000 // 停留 5 秒
  535. });
  536. },
  537. // 处理点击事件
  538. handleDocumentClick(event) {
  539. // 检查点击是否在仓库选择器内部
  540. const warehouseSelector = this.$el.querySelector('.warehouse-selector');
  541. if (warehouseSelector && !warehouseSelector.contains(event.target)) {
  542. this.showWarehouseDropdown = false;
  543. }
  544. },
  545. // 获取仓库列表
  546. getWarehouseList() {
  547. const currentSite = this.site;
  548. if (!currentSite) {
  549. this.$message.error('请先选择工厂');
  550. this.$router.push({ name: 'login' });
  551. return;
  552. }
  553. this.warehouseLoading = true;
  554. getUserAuthorizedWarehouses({ site: currentSite }).then(({data}) => {
  555. this.warehouseLoading = false;
  556. if (data && data.code === 0) {
  557. this.warehouseList = data.data || [];
  558. // 如果只有一个仓库,自动选中
  559. if (this.warehouseList.length === 1) {
  560. this.selectWarehouse(this.warehouseList[0]);
  561. }
  562. // 如果之前有选择的仓库,检查是否还在列表中并设置名称
  563. else if (this.selectedWarehouse) {
  564. const warehouse = this.warehouseList.find(w => w.warehouseid === this.selectedWarehouse);
  565. if (warehouse) {
  566. this.selectedWarehouseName = warehouse.warehousename;
  567. } else {
  568. this.selectedWarehouse = '';
  569. this.selectedWarehouseName = '';
  570. localStorage.removeItem('selectedWarehouse');
  571. }
  572. }
  573. } else {
  574. this.$message.error(data.msg || '获取仓库列表失败');
  575. }
  576. }).catch(error => {
  577. this.warehouseLoading = false;
  578. console.error('获取仓库列表失败:', error);
  579. this.$message.error('获取仓库列表失败');
  580. })
  581. },
  582. // 切换下拉框显示
  583. toggleWarehouseDropdown(event) {
  584. event.stopPropagation(); // 阻止事件冒泡
  585. this.showWarehouseDropdown = !this.showWarehouseDropdown;
  586. },
  587. // 关闭下拉框
  588. closeWarehouseDropdown() {
  589. this.showWarehouseDropdown = false;
  590. },
  591. // 选择仓库
  592. selectWarehouse(warehouse) {
  593. this.selectedWarehouse = warehouse.warehouseid;
  594. this.selectedWarehouseName = warehouse.warehousename;
  595. localStorage.setItem('selectedWarehouse', warehouse.warehouseid);
  596. this.showWarehouseDropdown = false;
  597. //this.$message.success(`已切换到仓库:${warehouse.warehousename}`);
  598. },
  599. // 检查是否已选择仓库
  600. checkWarehouseSelection() {
  601. if (!this.selectedWarehouse) {
  602. this.$message.warning('请先选择仓库');
  603. return false;
  604. }
  605. return true;
  606. },
  607. // 带仓库检查的路由跳转
  608. navigateWithWarehouseCheck(routeName) {
  609. if (this.checkWarehouseSelection()) {
  610. this.$router.push(routeName);
  611. }
  612. },
  613. // 退出
  614. logoutHandle() {
  615. this.$confirm('确定退出?', '提示', {
  616. confirmButtonText: '确认',
  617. cancelButtonText: '取消',
  618. type: 'warning'
  619. }).then(() => {
  620. this.$http({
  621. url: this.$http.adornUrl('/sys/logout'),
  622. method: 'post',
  623. data: this.$http.adornData()
  624. }).then(({data}) => {
  625. if (data && data.code === 0) {
  626. this.$router.push({name: 'login'})
  627. }
  628. })
  629. }).catch(() => {
  630. })
  631. }, // 获取当前管理员信息
  632. getUserInfo() {
  633. this.$http({
  634. url: this.$http.adornUrl('/sys/user/info'),
  635. method: 'get',
  636. params: this.$http.adornParams()
  637. }).then(({data}) => {
  638. if (data && data.code === 0) {
  639. this.loading = false
  640. this.userId = data.user.userId
  641. this.userName = data.user.username
  642. // 再次确保user对象建立后store中可直接读取当前site - rqrq
  643. this.$store.commit('user/updateSite', this.site)
  644. this.languageDefault = data.user.languageDefault
  645. this.userDisplay = data.user.userDisplay
  646. let userSubSiteCodeList = []
  647. try {
  648. const cacheValue = JSON.parse(localStorage.getItem('userSubSiteCodeList') || '[]')
  649. userSubSiteCodeList = Array.isArray(cacheValue) ? cacheValue : []
  650. } catch (e) {
  651. userSubSiteCodeList = []
  652. }
  653. this.$store.commit('user/updateSubSiteCodeList', userSubSiteCodeList)
  654. }
  655. })
  656. },
  657. },
  658. }
  659. </script>
  660. <style>
  661. .pda-container {
  662. width: 100vw;
  663. height: 100vh;
  664. display: flex;
  665. flex-direction: column;
  666. background: #f5f5f5;
  667. font-family: 'Arial', sans-serif;
  668. }
  669. /* 头部栏 */
  670. .header-bar {
  671. display: flex;
  672. justify-content: space-between;
  673. align-items: center;
  674. padding: 8px 16px;
  675. background: #17B3A3;
  676. color: white;
  677. height: 40px;
  678. min-height: 40px;
  679. max-height: 40px;
  680. }
  681. /* 仓库选择器样式 */
  682. .warehouse-selector {
  683. position: relative;
  684. display: flex;
  685. align-items: center;
  686. cursor: pointer;
  687. padding: 0;
  688. user-select: none;
  689. }
  690. .warehouse-text {
  691. color: white;
  692. font-size: 16px;
  693. font-weight: 500;
  694. margin-right: 8px;
  695. }
  696. .warehouse-selector .el-icon-arrow-down {
  697. color: white;
  698. font-size: 14px;
  699. transition: transform 0.2s ease;
  700. }
  701. .warehouse-selector .el-icon-arrow-down.rotate {
  702. transform: rotate(180deg);
  703. }
  704. /* 下拉框样式 */
  705. .warehouse-dropdown {
  706. position: absolute;
  707. top: 100%;
  708. left: 0;
  709. min-width: 120px;
  710. background: white;
  711. border-radius: 4px;
  712. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  713. z-index: 9999;
  714. margin-top: 4px;
  715. overflow: hidden;
  716. border: 1px solid #e0e0e0;
  717. }
  718. .dropdown-item {
  719. padding: 12px 16px;
  720. cursor: pointer;
  721. font-size: 14px;
  722. color: #333;
  723. transition: background-color 0.2s ease;
  724. }
  725. .dropdown-item:hover {
  726. background: #f5f5f5;
  727. }
  728. .dropdown-item.active {
  729. //background: #17B3A3;
  730. color: #17B3A3;
  731. }
  732. .dropdown-item.loading {
  733. text-align: center;
  734. color: #666;
  735. cursor: default;
  736. }
  737. .dropdown-item.loading:hover {
  738. background: white;
  739. }
  740. .dropdown-item.loading i {
  741. margin-right: 6px;
  742. animation: spin 1s linear infinite;
  743. }
  744. @keyframes spin {
  745. from { transform: rotate(0deg); }
  746. to { transform: rotate(360deg); }
  747. }
  748. .dropdown-item.empty {
  749. text-align: center;
  750. color: #999;
  751. cursor: default;
  752. }
  753. .dropdown-item.empty:hover {
  754. background: white;
  755. }
  756. .logout-button {
  757. background: rgba(255, 255, 255, 0.15);
  758. color: white;
  759. padding: 6px 12px;
  760. border-radius: 16px;
  761. cursor: pointer;
  762. display: flex;
  763. align-items: center;
  764. font-size: 13px;
  765. font-weight: 400;
  766. transition: all 0.3s ease;
  767. min-width: 55px;
  768. justify-content: center;
  769. border: 1px solid rgba(255, 255, 255, 0.3);
  770. backdrop-filter: blur(10px);
  771. position: relative;
  772. overflow: hidden;
  773. }
  774. .logout-button::before {
  775. content: '';
  776. position: absolute;
  777. top: 0;
  778. left: -100%;
  779. width: 100%;
  780. height: 100%;
  781. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  782. transition: left 0.5s ease;
  783. }
  784. .logout-button:hover {
  785. background: rgba(255, 255, 255, 0.25);
  786. border-color: rgba(255, 255, 255, 0.5);
  787. transform: translateY(-1px);
  788. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  789. }
  790. .logout-button:hover::before {
  791. left: 100%;
  792. }
  793. .logout-button:active {
  794. transform: translateY(0);
  795. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  796. }
  797. .logout-button i {
  798. margin-right: 6px;
  799. font-size: 14px;
  800. flex-shrink: 0;
  801. }
  802. .logout-button span {
  803. white-space: nowrap;
  804. }
  805. /* 内容区域 */
  806. .content-area {
  807. flex: 1;
  808. padding: 10px;
  809. overflow-y: auto;
  810. }
  811. /* 功能区域 */
  812. .section {
  813. margin-bottom: 15px;
  814. }
  815. .section-header {
  816. display: flex;
  817. align-items: center;
  818. margin-bottom: 9px;
  819. padding: 6px 0;
  820. border-bottom: 1.5px solid #17B3A3;
  821. }
  822. .bullet {
  823. color: #17B3A3;
  824. font-size: 16px;
  825. margin-right: 8px;
  826. font-weight: bold;
  827. }
  828. .section-title {
  829. color: #17B3A3;
  830. font-size: 15px;
  831. font-weight: bold;
  832. }
  833. /* 按钮网格 */
  834. .button-grid {
  835. display: grid;
  836. grid-template-columns: repeat(4, 1fr) !important;
  837. gap: 8px;
  838. }
  839. /* 菜单项 */
  840. .menu-item {
  841. background: white;
  842. border-radius: 12px;
  843. padding: 12px 6px 10px;
  844. text-align: center;
  845. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  846. transition: transform 0.2s;
  847. cursor: pointer;
  848. display: flex;
  849. flex-direction: column;
  850. align-items: center;
  851. justify-content: center;
  852. min-height: 80px;
  853. }
  854. .menu-item:active {
  855. transform: scale(0.95);
  856. }
  857. .menu-item.disabled {
  858. opacity: 0.6;
  859. position: relative;
  860. }
  861. .menu-item.disabled::after {
  862. content: '开发中';
  863. position: absolute;
  864. top: 6px;
  865. right: 6px;
  866. background: #ff9500;
  867. color: white;
  868. font-size: 8px;
  869. padding: 2px 4px;
  870. border-radius: 6px;
  871. font-weight: bold;
  872. z-index: 1;
  873. }
  874. .menu-icon {
  875. width: 38px;
  876. height: 38px;
  877. border-radius: 50%;
  878. display: flex;
  879. align-items: center;
  880. justify-content: center;
  881. margin: 0 auto 8px;
  882. color: white;
  883. flex-shrink: 0;
  884. }
  885. .menu-icon.purchase {
  886. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  887. }
  888. .menu-icon.production-return {
  889. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  890. }
  891. .menu-icon.production-inbound {
  892. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  893. }
  894. .menu-icon.sales-return {
  895. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  896. }
  897. .menu-icon.purchase-return {
  898. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  899. }
  900. .menu-icon.production-issue {
  901. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  902. }
  903. .menu-icon.mr {
  904. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  905. }
  906. .menu-icon.outsourcing {
  907. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  908. }
  909. .menu-icon.customer-issue {
  910. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  911. }
  912. .menu-icon.sales-delivery {
  913. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  914. }
  915. .menu-icon.transport {
  916. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  917. }
  918. .menu-icon.attribute {
  919. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  920. }
  921. .menu-icon.inventory {
  922. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  923. }
  924. .menu-icon.other {
  925. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  926. }
  927. .menu-icon.hu {
  928. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  929. }
  930. .menu-icon.inventory-move {
  931. background: linear-gradient(135deg, #17B3A3 0%, #1dc5ef 100%);
  932. }
  933. .menu-text {
  934. font-size: 11px;
  935. color: #333;
  936. font-weight: bold;
  937. line-height: 1.2;
  938. margin-top: 2px;
  939. white-space: nowrap;
  940. overflow: hidden;
  941. text-overflow: ellipsis;
  942. max-width: 100%;
  943. }
  944. /* 响应式设计 */
  945. @media screen and (max-width: 480px) {
  946. .header-bar {
  947. padding: 8px 12px;
  948. }
  949. .warehouse-text {
  950. font-size: 14px;
  951. }
  952. .logout-button {
  953. padding: 5px 10px;
  954. font-size: 12px;
  955. min-width: 50px;
  956. border-radius: 14px;
  957. }
  958. .logout-button i {
  959. margin-right: 4px;
  960. font-size: 12px;
  961. }
  962. .warehouse-dropdown {
  963. min-width: 120px;
  964. }
  965. .content-area {
  966. padding: 8px;
  967. }
  968. .section-header {
  969. padding: 2px 10px;
  970. }
  971. .section-title {
  972. font-size: 13px;
  973. }
  974. .button-grid {
  975. grid-template-columns: repeat(2, 1fr);
  976. gap: 10px;
  977. }
  978. .menu-item {
  979. padding: 8px 4px 6px;
  980. min-height: 70px;
  981. }
  982. .menu-icon {
  983. width: 35px;
  984. height: 35px;
  985. margin-bottom: 6px;
  986. }
  987. .menu-text {
  988. font-size: 10px;
  989. line-height: 1.1;
  990. margin-top: 2px;
  991. }
  992. .menu-item.disabled::after {
  993. top: 4px;
  994. right: 4px;
  995. font-size: 7px;
  996. padding: 1px 3px;
  997. border-radius: 4px;
  998. }
  999. }
  1000. @media screen and (min-width: 481px) and (max-width: 767px) {
  1001. .button-grid {
  1002. grid-template-columns: repeat(3, 1fr);
  1003. }
  1004. .menu-item {
  1005. padding: 10px 5px 8px;
  1006. min-height: 75px;
  1007. }
  1008. .menu-icon {
  1009. width: 38px;
  1010. height: 38px;
  1011. margin-bottom: 7px;
  1012. }
  1013. .menu-text {
  1014. font-size: 10.5px;
  1015. }
  1016. }
  1017. @media screen and (min-width: 768px) {
  1018. .button-grid {
  1019. grid-template-columns: repeat(4, 1fr);
  1020. }
  1021. }
  1022. </style>