indexPage.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
  7. @tap="goHome">&#xe6c5;</text>
  8. <!-- 导航文本此处也可以是其他自定义内容 -->
  9. <text
  10. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">半成品流转操作</text>
  11. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  12. <!-- 实际宽度请根据自己情况设置 -->
  13. <view style="width:40px;" />
  14. </view>
  15. </template>
  16. <template #gBody>
  17. <view class="card-list-flexbox">
  18. <view class="card">
  19. <div class="card-panel" style="background-color: #55aa7f;" @click="handleTriggerMpaas('半成品入库')">
  20. <text class="font-icons">&#xe660;</text>
  21. <text>半成品入库</text>
  22. </div>
  23. </view>
  24. <view class="card">
  25. <div class="card-panel" style="background-color: #ffaa00;" @click="handleTriggerMpaas('半成品签收')">
  26. <text class="font-icons">&#xe660;</text>
  27. <text>半成品签收</text>
  28. </div>
  29. </view>
  30. <view class="card">
  31. <div class="card-panel" style="background-color: #00a0e9;" @click="handleTriggerMpaas('已出库列表')">
  32. <text class="font-icons">&#xe660;</text>
  33. <text>已出库列表</text>
  34. </div>
  35. </view>
  36. </view>
  37. <uni-popup ref="errorTip" type="dialog">
  38. <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
  39. @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
  40. </uni-popup>
  41. </template>
  42. </gui-page>
  43. </template>
  44. <script>
  45. import {
  46. ref,
  47. defineComponent
  48. } from 'vue'
  49. export default defineComponent({
  50. setup() {
  51. // #ifdef APP-PLUS
  52. const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
  53. // #endif
  54. const errorTip = ref('')
  55. const errorTipMessage = ref('')
  56. const goHome = function() {
  57. uni.$goHome()
  58. }
  59. const handleTriggerMpaas = function(state) {
  60. switch (state) {
  61. case '半成品入库':
  62. uni.navigateTo({
  63. url: '/pages/workbranch/warehouse/SemiFinishedProducts/SemiFinishedProtuctsEntry'
  64. })
  65. // // #ifdef APP-PLUS
  66. // mpaasScanModule.mpaasScan({
  67. // // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  68. // 'scanType': ['qrCode', 'barCode'],
  69. // // 是否隐藏相册,默认false不隐藏
  70. // 'hideAlbum': false
  71. // },
  72. // (ret) => {
  73. // if (ret.resp_code === 1000) {
  74. // uni.$reqPost('scanProductMiddleDetailEntry', {
  75. // batchNumber: ret.resp_result
  76. // })
  77. // .then(({
  78. // code,
  79. // data,
  80. // msg
  81. // }) => {
  82. // if (code === 0) {
  83. // uni.showToast({
  84. // title: '半成品入库成功',
  85. // icon: 'none',
  86. // duration: 2000
  87. // })
  88. // } else {
  89. // // #ifdef APP-PLUS
  90. // plus.device.beep(2)
  91. // // #endif
  92. // errorTipMessage.value = msg
  93. // errorTip.value.open()
  94. // }
  95. // })
  96. // }
  97. // })
  98. // // #endif
  99. break
  100. case '半成品签收':
  101. uni.navigateTo({
  102. url: '/pages/workbranch/warehouse/SemiFinishedProducts/SemiFinishedProtuctsSign'
  103. })
  104. // // #ifdef APP-PLUS
  105. // mpaasScanModule.mpaasScan({
  106. // // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
  107. // 'scanType': ['qrCode', 'barCode'],
  108. // // 是否隐藏相册,默认false不隐藏
  109. // 'hideAlbum': false
  110. // },
  111. // (ret) => {
  112. // if (ret.resp_code === 1000) {
  113. // uni.$reqPost('scanProductMiddleDetailSign', {
  114. // batchNumber: ret.resp_result
  115. // })
  116. // .then(({
  117. // code,
  118. // data,
  119. // msg
  120. // }) => {
  121. // if (code === 0) {
  122. // uni.showToast({
  123. // title: '半成品签收成功',
  124. // icon: 'none',
  125. // duration: 2000
  126. // })
  127. // } else {
  128. // // #ifdef APP-PLUS
  129. // plus.device.beep(2)
  130. // // #endif
  131. // errorTipMessage.value = msg
  132. // errorTip.value.open()
  133. // }
  134. // })
  135. // }
  136. // })
  137. // // #endif
  138. break
  139. case '已出库列表':
  140. uni.navigateTo({
  141. url: '/pages/workbranch/warehouse/SemiFinishedProducts/list'
  142. })
  143. break
  144. }
  145. }
  146. // 关闭错误信息弹窗
  147. const handleCloseErrorTipsModal = async function() {
  148. errorTip.value.close()
  149. }
  150. return {
  151. goHome,
  152. errorTip,
  153. errorTipMessage,
  154. handleCloseErrorTipsModal,
  155. handleTriggerMpaas
  156. }
  157. }
  158. })
  159. </script>
  160. <style lang="scss" scoped>
  161. .gui-header-leader-btns {
  162. color: black;
  163. font-size: 24px !important;
  164. margin-left: 24rpx;
  165. }
  166. .card-list-flexbox {
  167. margin-top: 100px;
  168. display: grid;
  169. grid-template-columns: 1fr 1fr 1fr;
  170. .card {
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. .card-panel {
  175. width: 85px;
  176. height: 85px;
  177. display: flex;
  178. flex-direction: column;
  179. justify-content: center;
  180. align-items: center;
  181. border-radius: 8px;
  182. box-shadow: 1px 1px 2px 3px #e9e9e9;
  183. text:nth-of-type(2) {
  184. margin-top: 4px;
  185. font-size: 12px;
  186. font-weight: bold;
  187. color: white;
  188. }
  189. }
  190. }
  191. }
  192. .font-icons {
  193. font-size: 36px;
  194. color: white;
  195. }
  196. </style>