index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. <!-- 选择出库类型 -->
  41. <u-action-sheet
  42. :show="showOutType"
  43. :actions="outTypeList"
  44. title="请选择出库类型"
  45. @close="showOutType = false"
  46. @select="outTypeSelect"
  47. >
  48. </u-action-sheet>
  49. </view>
  50. </template>
  51. <script>
  52. import { supplierList, sparePartsPutTypeList, checkWarehouseList, warehouseCascadeList, logout } from '@/config/api.js'
  53. export default {
  54. data() {
  55. return {
  56. showOutType: false,
  57. outTypeList:[
  58. {
  59. name: "销售出库",
  60. value: 0
  61. },
  62. {
  63. name: "连锁调出",
  64. value: 1
  65. },
  66. {
  67. name: "店内调出",
  68. value: 2
  69. },
  70. ],
  71. czCode: '',
  72. type: ''
  73. }
  74. },
  75. onLoad() {
  76. this.baseData()
  77. },
  78. computed: {
  79. userData() {
  80. return this.$store.state.vuex_user
  81. }
  82. },
  83. methods: {
  84. // 退出登录
  85. toQuit(){
  86. logout().then(res => {
  87. if(res.status == 200){
  88. this.$store.state.vuex_token = ''
  89. this.$store.state.vuex_user = ''
  90. uni.redirectTo({
  91. url: "/pages/login/index"
  92. })
  93. }
  94. })
  95. },
  96. // 同步基础数据
  97. async baseData(){
  98. // 供应商
  99. const supplier = await supplierList()
  100. this.$store.state.vuex_supplierList = supplier.data || []
  101. // 入库类型
  102. const sparePartsPutType = await sparePartsPutTypeList()
  103. this.$store.state.vuex_sparePartsTypeList = sparePartsPutType.data || []
  104. // 盘点仓库列表
  105. const checkWarehouse = await checkWarehouseList()
  106. this.$store.state.vuex_checkWarehouseList = checkWarehouse.data || []
  107. // 仓库仓位列表
  108. const warehouse = await warehouseCascadeList()
  109. this.$store.state.vuex_warehouseList = warehouse.data || []
  110. },
  111. // 新建入库
  112. toRuku(){
  113. uni.navigateTo({
  114. url: "/pages/stockIn/add"
  115. })
  116. },
  117. // 出库
  118. toChuku(){
  119. this.showOutType = true
  120. },
  121. outTypeSelect(item){
  122. this.showOutType = false
  123. console.log(item)
  124. const url = ['/pages/stockOut/salesOut/list','/pages/stockOut/chainTransferOut/list','/pages/stockOut/storeTransferOut/list']
  125. uni.navigateTo({
  126. url: url[item.value]
  127. })
  128. },
  129. // 新建盘点
  130. toPandian(){
  131. uni.navigateTo({
  132. url: "/pages/stockPan/add"
  133. })
  134. },
  135. // 数据操作
  136. toRecord(){
  137. uni.navigateTo({
  138. url:"/pages/record/index"
  139. })
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss">
  145. .content {
  146. height: 100vh;
  147. .userData{
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. padding: 30rpx;
  152. > view{
  153. display: flex;
  154. align-items: center;
  155. &:last-child{
  156. color: #55aaff;
  157. }
  158. }
  159. }
  160. .card-box{
  161. border: 1px solid #eee;
  162. border-radius: 20upx;
  163. margin: 20rpx 40rpx;
  164. background: #fff;
  165. }
  166. .grid-box{
  167. display: flex;
  168. justify-content: space-around;
  169. padding:0;
  170. > view{
  171. width: 50%;
  172. display: flex;
  173. flex-direction: column;
  174. align-items: center;
  175. border: 1px solid #eee;
  176. .iconfont{
  177. font-size: 120upx;
  178. padding: 20upx 0;
  179. }
  180. .label{
  181. font-size: 32upx;
  182. text-align: center;
  183. padding: 0 0 24upx 0;
  184. }
  185. .icon-ruku{
  186. color: #0055ff;
  187. }
  188. .icon-chukuguanli{
  189. color: #ff5500;
  190. }
  191. .icon-IMSpandianguanli{
  192. color: #00aa00;
  193. }
  194. .icon-xianshi{
  195. color: #55aaff;
  196. }
  197. .icon-caozuozhucebiao{
  198. color: #55aa7f;
  199. }
  200. .icon-lishijilu{
  201. color: #55557f;
  202. }
  203. &:active{
  204. opacity: 0.8;
  205. }
  206. }
  207. .nob{
  208. border: 0;
  209. box-shadow:none;
  210. }
  211. }
  212. .uni-status-height{
  213. height: $uni-status-height;
  214. }
  215. }
  216. </style>