index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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="toChuku">
  15. <text class="iconfont icon-chukuguanli"></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="toRecord">
  25. <text class="iconfont icon-lishijilu"></text>
  26. <text class="label">操作记录</text>
  27. </view>
  28. </view>
  29. <!-- <view class="grid-box">
  30. <view @click="toSeting">
  31. <text class="iconfont icon-xianshi"></text>
  32. <text class="label">显示设置</text>
  33. </view>
  34. <view @click="toSeting">
  35. <text class="iconfont icon-lishijilu"></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 || []
  117. },
  118. // 新建入库
  119. toRuku(){
  120. uni.navigateTo({
  121. url: "/pages/stockIn/add"
  122. })
  123. },
  124. // 出库
  125. toChuku(){
  126. this.showOutType = true
  127. },
  128. outTypeSelect(item){
  129. this.showOutType = false
  130. console.log(item)
  131. const url = ['/pages/stockOut/salesOut/list','/pages/stockOut/chainTransferOut/list','/pages/stockOut/storeTransferOut/list']
  132. uni.navigateTo({
  133. url: url[item.value]
  134. })
  135. },
  136. // 新建盘点
  137. toPandian(){
  138. uni.navigateTo({
  139. url: "/pages/stockPan/add"
  140. })
  141. },
  142. // 数据操作
  143. toRecord(){
  144. uni.navigateTo({
  145. url:"/pages/record/index"
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="scss">
  152. .content {
  153. height: 100vh;
  154. .userData{
  155. display: flex;
  156. justify-content: space-between;
  157. align-items: center;
  158. padding: 30rpx;
  159. > view{
  160. display: flex;
  161. align-items: center;
  162. &:last-child{
  163. color: #55aaff;
  164. }
  165. }
  166. }
  167. .copright{
  168. text-align: center;
  169. color: $uni-text-color-grey;
  170. font-size: 20upx;
  171. position: fixed;
  172. left: 0;
  173. bottom: 30upx;
  174. width: 100%;
  175. }
  176. .card-box{
  177. border: 1px solid #eee;
  178. border-radius: 20upx;
  179. margin: 20rpx 40rpx;
  180. background: #fff;
  181. }
  182. .grid-box{
  183. display: flex;
  184. justify-content: space-around;
  185. padding:0;
  186. > view{
  187. width: 50%;
  188. display: flex;
  189. flex-direction: column;
  190. align-items: center;
  191. border: 1px solid #eee;
  192. .iconfont{
  193. font-size: 120upx;
  194. padding: 20upx 0;
  195. }
  196. .label{
  197. font-size: 32upx;
  198. text-align: center;
  199. padding: 0 0 24upx 0;
  200. }
  201. .icon-ruku{
  202. color: #0055ff;
  203. }
  204. .icon-chukuguanli{
  205. color: #ff5500;
  206. }
  207. .icon-IMSpandianguanli{
  208. color: #00aa00;
  209. }
  210. .icon-xianshi{
  211. color: #55aaff;
  212. }
  213. .icon-caozuozhucebiao{
  214. color: #55aa7f;
  215. }
  216. .icon-lishijilu{
  217. color: #55557f;
  218. }
  219. &:active{
  220. opacity: 0.8;
  221. }
  222. }
  223. .nob{
  224. border: 0;
  225. box-shadow:none;
  226. }
  227. }
  228. .uni-status-height{
  229. height: $uni-status-height;
  230. }
  231. }
  232. </style>