| | |
| | | :disabled="addAndSubtractCoalDisabled" |
| | | @click="addAndSubtractCoal" |
| | | class="jiajian" |
| | | v-if="outBuy"></u-button> |
| | | v-if="outBuy||!isSkinWeigh"></u-button> |
| | | </view> |
| | | <view class="four"> |
| | | <view v-show="isConfirmWeighLoading" |
| | | style="color: #ff6363;width: auto;margin: 0 auto;"> |
| | | 超出毛重,磅房人员确认中,请勿离开此页面 |
| | | </view> |
| | | <!-- <view class="four"> |
| | | <u-button type="primary" |
| | | text="刷新" |
| | | @click.stop="RefreshHandle" |
| | | icon="reload" |
| | | throttle-time="800" |
| | | :loading="refreshLoading"></u-button> |
| | | </view> |
| | | </view> --> |
| | | <!-- 放空弹窗 --> |
| | | <view class="evacuationModal"> |
| | | <u-modal :show="evacuationModalShow" |
| | |
| | | title="异常原因" |
| | | :showCancelButton="true" |
| | | @confirm="abnormalConfirm" |
| | | @cancel="abnormalCancel" |
| | | confirmText="提交"> |
| | | <view class="slot-content"> |
| | | <u--form labelPosition="top" |
| | |
| | | </view> |
| | | </u-modal> |
| | | </view> |
| | | <!-- 确认后称重提示弹窗 --> |
| | | <view class=""> |
| | | <u-modal :show="confirmWeighVisiable" |
| | | title="提示" |
| | | :content="confirmWeighContent" |
| | | @confirm="confirmWeighConfirm"></u-modal> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | let socket = null; |
| | | import { webSocketUrl } from '@/api/request.js'; |
| | | import { mapState, mapMutations } from 'vuex'; |
| | | import combinedTitle from '@/components/combined-title/combined-title.vue'; |
| | |
| | | this.changeWeigh('') |
| | | this.realTimeWeigh = 0 |
| | | }, |
| | | onShow() { |
| | | this.timer = setTimeout(() => { |
| | | if (!this.globalweigh) { |
| | | console.log('称重时自动重连'); |
| | | this.socketTask.close(); |
| | | this.changesocketTask(null); |
| | | this.changereconnectNum({ connectNum: 1, isWeigh: true }) |
| | | this.$store.dispatch('websocketInit'); |
| | | } |
| | | }, 3000) |
| | | }, |
| | | onHide() { |
| | | clearTimeout(this.timer) |
| | | }, |
| | | onUnload() { |
| | | clearTimeout(this.timer) |
| | | }, |
| | | components: { |
| | | combinedTitle |
| | | }, |
| | |
| | | coalContactClean: 0, |
| | | coalContactHair: 0, |
| | | coalContactSkin: 0, |
| | | isMerge: 0 //1是 0不是 默认0 是否合卡 |
| | | isMerge: '0', //1是 0不是 默认0 是否合卡 |
| | | isBackground: '0' |
| | | }, |
| | | takeCoalId: null, |
| | | weighHouseCode: '', |
| | |
| | | mergeStateShow: false, //合卡弹窗 |
| | | checkboxValue1: [], |
| | | isExceedOrigin: false, //是否超出原发毛重 |
| | | refreshLoading: false |
| | | refreshLoading: false, |
| | | timer: null |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | .orderType == |
| | | '转出') { |
| | | if (this.weighList.skin == 0) { |
| | | this.isSkinWeigh = true |
| | | this.isSkinWeigh = true //称皮没有返回装卸 |
| | | this.outBuy = false //称皮没有返回装卸 |
| | | this.temporaryWeighObj.skin = newV; |
| | | let xx = new BigNumber(this.avgSkin) |
| | | let yy = new BigNumber(newV) |
| | |
| | | this.avgSkin !== 0 |
| | | } else { |
| | | this.isSkinWeigh = false; |
| | | this.outBuy = true; |
| | | this.temporaryWeighObj.hair = newV; |
| | | this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed( |
| | | 2); |
| | |
| | | .orderType == '转入') { |
| | | if (this.weighList.hair == 0) { |
| | | this.isSkinWeigh = false; |
| | | this.outBuy = true; |
| | | this.temporaryWeighObj.hair = newV; |
| | | if (this.weighList.orderType == '外购') { |
| | | let xx = new BigNumber(newV) |
| | | let yy = new BigNumber(this.weighList.hairTwo) |
| | | if (xx.minus(yy) > 0.3) { |
| | | this.$u.toast('超出原发信息毛重,请等待管理人员处理') |
| | | this.isExceedOrigin = true |
| | | } |
| | | } |
| | | // if (this.weighList.orderType == '外购') { |
| | | // let xx = new BigNumber(newV) |
| | | // let yy = new BigNumber(this.weighList.hairTwo) |
| | | // if (xx.minus(yy) > 0.3) { |
| | | // this.$u.toast('超出原发信息毛重,请等待管理人员处理') |
| | | // this.isExceedOrigin = true |
| | | // this.saveWeigh() |
| | | // } |
| | | // } |
| | | } else { |
| | | this.isSkinWeigh = true; |
| | | this.isSkinWeigh = true; //称皮没有返回装卸 |
| | | this.outBuy = false //称皮没有返回装卸 |
| | | this.temporaryWeighObj.skin = newV; |
| | | let xx = new BigNumber(this.avgSkin) |
| | | let yy = new BigNumber(newV) |
| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | confirmWeighVisiable(v) { |
| | | if (v) { |
| | | uni.hideLoading() |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(['globalweigh', 'globalinfraredStatus', 'globalisconnect', 'globalisUploadimg', 'globalisLogin', |
| | | 'is_open_socket' |
| | | 'is_open_socket', 'socketTask', 'confirmWeighVisiable', 'confirmWeighContent' |
| | | ]), |
| | | coalContactClean() { |
| | | let xx = BigNumber(this.weighData.coalContactHair) |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh']), |
| | | ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh', 'changeconfirmWeighVisiable', |
| | | 'changesocketTask', 'changereconnectNum' |
| | | ]), |
| | | RefreshHandle() { |
| | | if (this.globalisconnect) return this.$u.toast('已连接,无需刷新') |
| | | this.refreshLoading = true |
| | |
| | | // 确认称重接口 |
| | | saveWeigh() { |
| | | this.weighData.coalContactClean = this.coalContactClean; |
| | | console.log(this.weighData); |
| | | this.$reqPost('saveWeigh', this.weighData, 'json') |
| | | .then(res => { |
| | | console.log(res, '称重接口'); |
| | |
| | | }); |
| | | this.isConfirmWeighLoading = false; |
| | | }, 1000); |
| | | } else if (res.code === 3) { |
| | | uni.showLoading({ |
| | | title: '磅房人员确认中', |
| | | }) |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '称重失败,请稍后重试'); |
| | | this.isConfirmWeighLoading = false |
| | |
| | | this.orderSurplusLess = true |
| | | } |
| | | }, |
| | | confirmWeighConfirm() { |
| | | this.changeconfirmWeighVisiable(false) |
| | | this.isConfirmWeighLoading = false |
| | | setTimeout(() => { |
| | | this.$u.toast('即将返回上一页'), |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | }, 800) |
| | | } |
| | | } |
| | | }; |
| | | </script> |