| | |
| | | </view> |
| | | </view> |
| | | <u-toast ref="uToast"></u-toast> |
| | | <view class="cardList" v-if="user.useProd == 1"> |
| | | <view class="tabList" v-if="user.useProd == 1"> |
| | | <view class="switchPanel"> |
| | | <view class="switchBtns"> |
| | | <view class="btnItem" @click="changeTab(1)"> |
| | |
| | | <view> |
| | | 入库时间:{{tabNum == 1?hazmat.createTime:product.createTime}} |
| | | </view> |
| | | <view v-if="modalTitle == '取用' || modalTitle == '扫码作废'"> |
| | | <view v-if="modalTitle == '常规取用' || modalTitle == '用尽取用' || modalTitle == '扫码作废'"> |
| | | <span v-if="tabNum == 1">当前包装存量:{{hazmat.remaining}}{{hazmat.hazmatBasic?hazmat.hazmatBasic.unit:''}}</span> |
| | | <span v-else>当前包装存量:{{product.remaining}}{{product.productBasic?product.productBasic.unit:''}}</span> |
| | | </view> |
| | |
| | | </u-form-item> |
| | | </u--form> |
| | | </view> |
| | | <u-button v-if="modalTitle == '取用'" type="primary" style="margin-top: 20px" text="确认取用" @click="confirmTake()"></u-button> |
| | | <u-button v-if="modalTitle == '常规取用'" type="primary" style="margin-top: 20px" text="确认取用" @click="confirmTake1()"></u-button> |
| | | <u-button v-if="modalTitle == '用尽取用'" type="primary" style="margin-top: 20px" text="确认取用" @click="confirmTake2()"></u-button> |
| | | <u-button v-if="modalTitle == '归还'" type="primary" style="margin-top: 20px" text="确认归还" @click="confirmBack()"></u-button> |
| | | <u-button v-if="modalTitle == '用尽登记'" type="warning" style="margin-top: 20px" text="确认用尽登记" @click="confirmCheck()"></u-button> |
| | | <u-button v-if="modalTitle == '销售'" type="primary" style="margin-top: 20px" text="确认销售" @click="confirmSell()"></u-button> |
| | |
| | | } from '../../../api/index.js' |
| | | import VUE_APP_BASE_URL from 'common/constant.js' |
| | | import take from '../../../static/take.png' |
| | | import takeAll from '../../../static/takeAll.png' |
| | | import takeBack from '../../../static/return.png' |
| | | import check from '../../../static/check.png' |
| | | import del from '../../../static/delete.png' |
| | |
| | | cardList1: [ |
| | | { |
| | | icon: take, |
| | | title: '取用', |
| | | title: '常规取用', |
| | | type: 1 |
| | | }, |
| | | { |
| | | icon: takeAll, |
| | | title: '用尽取用', |
| | | type: 5 |
| | | }, |
| | | { |
| | | icon: takeBack, |
| | |
| | | t.modalTitle = title |
| | | uni.scanCode({ |
| | | autoZoom: false, |
| | | scanType: ['qrCode'], |
| | | success: function (res) { |
| | | if(res && res.result){ |
| | | if(res.result.indexOf('SJ') == -1 && res.result.indexOf('CP') == -1){ |
| | | t.$refs.uToast.show({ |
| | | type: 'default', |
| | | message: '没有识别到正确的编码,请重新扫码', |
| | | duration: 2000 |
| | | }) |
| | | return |
| | | } |
| | | if(t.tabNum == 1){ |
| | | getHazmatByCode({code: res.result}).then((re)=>{ |
| | | if(re.code == 200){ |
| | |
| | | }) |
| | | }, |
| | | |
| | | confirmTake(){ |
| | | confirmTake1(){ |
| | | const t = this |
| | | postHazmatUse(t.hazmat.id).then((r)=>{ |
| | | postHazmatUse(t.hazmat.id,0).then((r)=>{ |
| | | if(r.code == 200){ |
| | | t.$refs.uToast.show({ |
| | | type: 'default', |
| | |
| | | }) |
| | | t.closeModal() |
| | | }, |
| | | |
| | | confirmTake2(){ |
| | | const t = this |
| | | postHazmatUse(t.hazmat.id,1).then((r)=>{ |
| | | if(r.code == 200){ |
| | | t.$refs.uToast.show({ |
| | | type: 'default', |
| | | message: r.message |
| | | }) |
| | | }else{ |
| | | t.$refs.uToast.show({ |
| | | type: 'default', |
| | | message: r.message |
| | | }) |
| | | } |
| | | }).catch((err) => { |
| | | uni.showToast({ |
| | | title: err, |
| | | duration: 2000 |
| | | }) |
| | | }) |
| | | t.closeModal() |
| | | }, |
| | | |
| | | confirmBack() { |
| | | const t = this |
| | |
| | | left: 0; |
| | | right: 0; |
| | | width: 100%; |
| | | z-index: 1; |
| | | z-index: 9999; |
| | | } |
| | | .barText{ |
| | | /* text-align: center; */ |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .tabList{ |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | padding: 0 15px; |
| | | margin-top: 15px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | position: -webkit-sticky; |
| | | position: sticky; |
| | | top: 50px; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 9998; |
| | | } |
| | | |
| | | .switchPanel{ |
| | | width: 100%; |
| | | height: 84rpx; |
| | |
| | | box-sizing: border-box; |
| | | border-radius: 8px; |
| | | box-shadow: 0px -6px 10px rgba(255, 255, 255, 1), 0px 4px 15px rgba(0, 0, 0, 0.1),0px 3px 6px rgba(0, 0, 0, 0.05) inset !important; |
| | | background: #f5f7fa; |
| | | |
| | | .switchBtns{ |
| | | width: 100%; |
| | |
| | | border: 2rpx solid #fff; |
| | | } |
| | | } |
| | | |
| | | .cardList{ |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | padding: 0 15px; |
| | | margin-top: 20px; |
| | | margin-top: 15px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | |
| | | box-shadow: none; |
| | | } |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 75px; |
| | | } |
| | | |
| | | .cardTit{ |
| | | font-size: 36rpx; |
| | | font-weight: bold; |