index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="content">
  3. <view class="uni-status-height"></view>
  4. <view class="userData" v-if="userData">
  5. <view>{{userData.orgName||'用户名'}}</view>
  6. <view @click="toQuit">退出<u-icon name="arrow-right" color="#55aaff"></u-icon></view>
  7. </view>
  8. <view class="card-box">
  9. <view class="grid-box">
  10. <view @click="toRuku">
  11. <text class="iconfont icon-ruku"></text>
  12. <text class="label">散件入库</text>
  13. </view>
  14. <view @click="toCgRuku">
  15. <text class="iconfont icon-caigouruku-huang"></text>
  16. <text class="label">采购入库</text>
  17. </view>
  18. </view>
  19. <view class="grid-box">
  20. <view @click="toPandian">
  21. <text class="iconfont icon-IMSpandianguanli"></text>
  22. <text class="label">库存盘点</text>
  23. </view>
  24. <view @click="toStockQuery">
  25. <text class="iconfont icon-kucunchaxun"></text>
  26. <text class="label">库存查询</text>
  27. </view>
  28. </view>
  29. <view class="grid-box">
  30. <view @click="toChuku">
  31. <text class="iconfont icon-chukuguanli"></text>
  32. <text class="label">出库</text>
  33. </view>
  34. <view @click="toEditCode">
  35. <text class="iconfont icon-xiangmatiaomaluru"></text>
  36. <text class="label">条码维护</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="copright">
  41. <view>系统版本:{{version}}</view>
  42. <view>Copyright © 2023 陕西山海高科信息技术有限公司</view>
  43. </view>
  44. <!-- 选择出库类型 -->
  45. <u-action-sheet
  46. :show="showOutType"
  47. :actions="outTypeList"
  48. title="请选择出库类型"
  49. @close="showOutType = false"
  50. @select="outTypeSelect"
  51. >
  52. </u-action-sheet>
  53. </view>
  54. </template>
  55. <script>
  56. import { supplierList, sparePartsPutTypeList, checkWarehouseList, warehouseCascadeList, logout } from '@/config/api.js'
  57. export default {
  58. data() {
  59. return {
  60. showOutType: false,
  61. outTypeList:[
  62. {
  63. name: "销售出库",
  64. value: 0
  65. },
  66. {
  67. name: "连锁调出",
  68. value: 1
  69. },
  70. {
  71. name: "店内调出",
  72. value: 2
  73. },
  74. ],
  75. czCode: '',
  76. type: ''
  77. }
  78. },
  79. onLoad() {
  80. this.baseData()
  81. },
  82. computed: {
  83. userData() {
  84. return this.$store.state.vuex_user
  85. },
  86. version(){
  87. return getApp().globalData.version.version
  88. }
  89. },
  90. methods: {
  91. // 退出登录
  92. toQuit(){
  93. logout().then(res => {
  94. if(res.status == 200){
  95. this.$store.state.vuex_token = ''
  96. this.$store.state.vuex_user = ''
  97. uni.redirectTo({
  98. url: "/pages/login/index"
  99. })
  100. }
  101. })
  102. },
  103. // 同步基础数据
  104. async baseData(){
  105. // 供应商
  106. const supplier = await supplierList()
  107. this.$store.state.vuex_supplierList = supplier.data || []
  108. // 入库类型
  109. const sparePartsPutType = await sparePartsPutTypeList()
  110. this.$store.state.vuex_sparePartsTypeList = sparePartsPutType.data || []
  111. // 盘点仓库列表
  112. const checkWarehouse = await checkWarehouseList()
  113. this.$store.state.vuex_checkWarehouseList = checkWarehouse.data || []
  114. // 仓库仓位列表
  115. const warehouse = await warehouseCascadeList()
  116. this.$store.state.vuex_warehouseList = warehouse.data.reverse() || []
  117. },
  118. // 新建入库
  119. toRuku(){
  120. uni.navigateTo({
  121. url: "/pages/stockIn/add"
  122. })
  123. },
  124. torukurecord(){
  125. uni.navigateTo({
  126. url: "/pages/stockIn/list"
  127. })
  128. },
  129. // 出库
  130. toChuku(){
  131. this.showOutType = true
  132. },
  133. outTypeSelect(item){
  134. this.showOutType = false
  135. console.log(item)
  136. const url = ['/pages/stockOut/salesOut/list','/pages/stockOut/chainTransferOut/list','/pages/stockOut/storeTransferOut/list']
  137. uni.navigateTo({
  138. url: url[item.value]
  139. })
  140. },
  141. // 新建盘点
  142. toPandian(){
  143. uni.navigateTo({
  144. url: "/pages/stockPan/add"
  145. })
  146. },
  147. toPandianRecord(){
  148. uni.navigateTo({
  149. url: "/pages/stockPan/list"
  150. })
  151. },
  152. // 数据操作
  153. toRecord(){
  154. uni.navigateTo({
  155. url:"/pages/record/index"
  156. })
  157. },
  158. toEditCode(){
  159. uni.navigateTo({
  160. url:"/pages/codeBar/codeBar"
  161. })
  162. },
  163. toStockQuery(){
  164. uni.navigateTo({
  165. url:"/pages/stock/index"
  166. })
  167. },
  168. toCgRuku(){
  169. uni.navigateTo({
  170. url:"/pages/purchasing/list"
  171. })
  172. }
  173. }
  174. }
  175. </script>
  176. <style lang="scss">
  177. .content {
  178. height: 100vh;
  179. .userData{
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. padding: 30rpx;
  184. > view{
  185. display: flex;
  186. align-items: center;
  187. &:last-child{
  188. color: #55aaff;
  189. }
  190. }
  191. }
  192. .copright{
  193. text-align: center;
  194. color: $uni-text-color-grey;
  195. font-size: 20upx;
  196. position: fixed;
  197. left: 0;
  198. bottom: 30upx;
  199. width: 100%;
  200. }
  201. .card-box{
  202. border-radius: 20upx;
  203. margin: 30rpx 40rpx;
  204. background: #fff;
  205. overflow: hidden;
  206. }
  207. .grid-box{
  208. display: flex;
  209. justify-content: space-around;
  210. padding:0;
  211. > view{
  212. width: 50%;
  213. display: flex;
  214. flex-direction: column;
  215. align-items: center;
  216. .iconfont{
  217. font-size: 110upx;
  218. padding: 10upx 0;
  219. }
  220. .label{
  221. font-size: 32upx;
  222. text-align: center;
  223. padding: 0 0 24upx 0;
  224. }
  225. .icon-ruku{
  226. color: #ff0000;
  227. }
  228. .icon-churukujilu{
  229. color: #00aa7f;
  230. }
  231. .icon-chukuguanli{
  232. font-size: 115upx;
  233. color: #ffaa00;
  234. }
  235. .icon-caigouruku-huang{
  236. font-size: 103upx;
  237. color: #00aaff;
  238. }
  239. .icon-IMSpandianguanli{
  240. font-size: 105upx;
  241. color: #0055ff;
  242. }
  243. .icon-pandianjilu{
  244. font-size: 105upx;
  245. color: #aaaa00;
  246. }
  247. .icon-kucunchaxun{
  248. font-size: 108upx;
  249. color: #ff5500;
  250. }
  251. .icon-xiangmatiaomaluru{
  252. font-size: 108upx;
  253. color: #aa55ff;
  254. }
  255. &:active{
  256. opacity: 0.8;
  257. }
  258. }
  259. .nob{
  260. border: 0;
  261. box-shadow:none;
  262. }
  263. }
  264. .uni-status-height{
  265. height: $uni-status-height;
  266. }
  267. }
  268. </style>