| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <template>
- <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
- <template #gHeader>
- <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
- <!-- 使用组件实现返回按钮及返回首页按钮 -->
- <text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
- @tap="goHome"></text>
- <!-- 导航文本此处也可以是其他自定义内容 -->
- <text
- class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">半成品流转操作</text>
- <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
- <!-- 实际宽度请根据自己情况设置 -->
- <view style="width:40px;" />
- </view>
- </template>
- <template #gBody>
- <view class="card-list-flexbox">
- <view class="card">
- <div class="card-panel" style="background-color: #55aa7f;" @click="handleTriggerMpaas('半成品入库')">
- <text class="font-icons"></text>
- <text>半成品入库</text>
- </div>
- </view>
- <view class="card">
- <div class="card-panel" style="background-color: #ffaa00;" @click="handleTriggerMpaas('半成品签收')">
- <text class="font-icons"></text>
- <text>半成品签收</text>
- </div>
- </view>
- <view class="card">
- <div class="card-panel" style="background-color: #00a0e9;" @click="handleTriggerMpaas('已出库列表')">
- <text class="font-icons"></text>
- <text>已出库列表</text>
- </div>
- </view>
- </view>
- <uni-popup ref="errorTip" type="dialog">
- <uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示" :content="errorTipMessage"
- @confirm="handleCloseErrorTipsModal" @close="handleCloseErrorTipsModal" />
- </uni-popup>
- </template>
- </gui-page>
- </template>
- <script>
- import {
- ref,
- defineComponent
- } from 'vue'
- export default defineComponent({
- setup() {
- // #ifdef APP-PLUS
- const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
- // #endif
- const errorTip = ref('')
- const errorTipMessage = ref('')
- const goHome = function() {
- uni.$goHome()
- }
- const handleTriggerMpaas = function(state) {
- switch (state) {
- case '半成品入库':
- uni.navigateTo({
- url: '/pages/workbranch/warehouse/SemiFinishedProducts/SemiFinishedProtuctsEntry'
- })
- // // #ifdef APP-PLUS
- // mpaasScanModule.mpaasScan({
- // // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
- // 'scanType': ['qrCode', 'barCode'],
- // // 是否隐藏相册,默认false不隐藏
- // 'hideAlbum': false
- // },
- // (ret) => {
- // if (ret.resp_code === 1000) {
- // uni.$reqPost('scanProductMiddleDetailEntry', {
- // batchNumber: ret.resp_result
- // })
- // .then(({
- // code,
- // data,
- // msg
- // }) => {
- // if (code === 0) {
- // uni.showToast({
- // title: '半成品入库成功',
- // icon: 'none',
- // duration: 2000
- // })
- // } else {
- // // #ifdef APP-PLUS
- // plus.device.beep(2)
- // // #endif
- // errorTipMessage.value = msg
- // errorTip.value.open()
- // }
- // })
- // }
- // })
- // // #endif
- break
- case '半成品签收':
- uni.navigateTo({
- url: '/pages/workbranch/warehouse/SemiFinishedProducts/SemiFinishedProtuctsSign'
- })
-
- // // #ifdef APP-PLUS
- // mpaasScanModule.mpaasScan({
- // // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
- // 'scanType': ['qrCode', 'barCode'],
- // // 是否隐藏相册,默认false不隐藏
- // 'hideAlbum': false
- // },
- // (ret) => {
- // if (ret.resp_code === 1000) {
- // uni.$reqPost('scanProductMiddleDetailSign', {
- // batchNumber: ret.resp_result
- // })
- // .then(({
- // code,
- // data,
- // msg
- // }) => {
- // if (code === 0) {
- // uni.showToast({
- // title: '半成品签收成功',
- // icon: 'none',
- // duration: 2000
- // })
- // } else {
- // // #ifdef APP-PLUS
- // plus.device.beep(2)
- // // #endif
- // errorTipMessage.value = msg
- // errorTip.value.open()
- // }
- // })
- // }
- // })
- // // #endif
- break
- case '已出库列表':
- uni.navigateTo({
- url: '/pages/workbranch/warehouse/SemiFinishedProducts/list'
- })
- break
- }
- }
- // 关闭错误信息弹窗
- const handleCloseErrorTipsModal = async function() {
- errorTip.value.close()
- }
- return {
- goHome,
- errorTip,
- errorTipMessage,
- handleCloseErrorTipsModal,
- handleTriggerMpaas
- }
- }
- })
- </script>
- <style lang="scss" scoped>
- .gui-header-leader-btns {
- color: black;
- font-size: 24px !important;
- margin-left: 24rpx;
- }
- .card-list-flexbox {
- margin-top: 100px;
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- .card {
- display: flex;
- justify-content: center;
- align-items: center;
- .card-panel {
- width: 85px;
- height: 85px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- border-radius: 8px;
- box-shadow: 1px 1px 2px 3px #e9e9e9;
- text:nth-of-type(2) {
- margin-top: 4px;
- font-size: 12px;
- font-weight: bold;
- color: white;
- }
- }
- }
- }
- .font-icons {
- font-size: 36px;
- color: white;
- }
- </style>
|