| | |
| | | plain |
| | | @click="evacuation" |
| | | throttleTime="500" |
| | | :disabled="!isEvacuation" |
| | | :loading="TwoEvacuationLoading" |
| | | v-if='weighList.skin||weighList.hair'></u-button> |
| | | <!-- 外销订单称皮时,返回加减吨按钮置灰。称毛时可用.外购订单,不出现返回加减吨的按钮 --> |
| | | <u-button type="primary" |
| | | text="确定称重" |
| | | :disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh ||!mergeState||isExceedOrigin" |
| | | :disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh ||!mergeState||globalWarning" |
| | | :loading="isConfirmWeighLoading" |
| | | loadingText="确认" |
| | | @click="confirmWeigh" |
| | |
| | | :disabled="addAndSubtractCoalDisabled" |
| | | @click="addAndSubtractCoal" |
| | | class="jiajian" |
| | | v-if="outBuy"></u-button> |
| | | v-if="outBuy||!isSkinWeigh" |
| | | :loading="addAndSubtractCoalLoading"></u-button> |
| | | </view> |
| | | <view class="four"> |
| | | <u-button type="primary" |
| | | text="刷新" |
| | | @click.stop="RefreshHandle" |
| | | icon="reload" |
| | | throttle-time="800" |
| | | :loading="refreshLoading"></u-button> |
| | | <view v-show="isExceedOrigin" |
| | | style="color: #ff6363;width: auto;margin: 0 auto;"> |
| | | <text v-if="weighList.orderType == '外购'">超出原发毛重,磅房人员确认中,请勿离开此页面</text> |
| | | <text v-else>超出最大毛重,磅房人员确认中,请勿离开此页面</text> |
| | | </view> |
| | | <view v-show="afterEvacuationStatus" |
| | | style="color: #ff6363;width: auto;margin: 0 auto;"> |
| | | <text>{{afterEvacuationText}}</text> |
| | | </view> |
| | | <!-- 放空弹窗 --> |
| | | <view class="evacuationModal"> |
| | |
| | | <view class=""> |
| | | <u-modal :show="abnormalModalShow" |
| | | title="异常原因" |
| | | :showCancelButton="true" |
| | | :showCancelButton="false" |
| | | @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() { |
| | | if (this.timer) { |
| | | clearTimeout(this.timer) |
| | | } |
| | | 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: '', |
| | |
| | | mergeState: true, //合卡状态 |
| | | mergeStateShow: false, //合卡弹窗 |
| | | checkboxValue1: [], |
| | | isExceedOrigin: false, //是否超出原发毛重 |
| | | refreshLoading: false |
| | | isExceedOrigin: false, //是否超出毛重 |
| | | refreshLoading: false, |
| | | timer: null, |
| | | afterEvacuationStatus: null, //放空后提煤单状态状态为21时提示‘等待磅房确认’ |
| | | afterEvacuationText: '', |
| | | TwoEvacuationLoading: false, |
| | | addAndSubtractCoalLoading: false |
| | | }; |
| | | }, |
| | | 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 |
| | | } |
| | | } |
| | | } 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) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapState(['globalweigh', 'globalinfraredStatus', 'globalisconnect', 'globalisUploadimg', 'globalisLogin', |
| | | 'is_open_socket' |
| | | 'is_open_socket', 'socketTask', 'confirmWeighVisiable', 'confirmWeighContent', 'globalWarning' |
| | | ]), |
| | | coalContactClean() { |
| | | let xx = BigNumber(this.weighData.coalContactHair) |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh']), |
| | | RefreshHandle() { |
| | | if (this.globalisconnect) return this.$u.toast('已连接,无需刷新') |
| | | this.refreshLoading = true |
| | | if (!this.globalisconnect && !this.globalisUploadimg && this.globalisLogin) { |
| | | if (!this.is_open_socket) { |
| | | this.$store.dispatch('websocketInit') |
| | | this.changeisconnect(true); |
| | | this.refreshLoading = false |
| | | this.$u.toast('刷新成功') |
| | | } |
| | | } |
| | | }, |
| | | ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh', 'changeconfirmWeighVisiable', |
| | | 'changesocketTask', 'changereconnectNum' |
| | | ]), |
| | | init() { |
| | | uni.showLoading({ |
| | | title: "加载中" |
| | |
| | | // 确认称重接口 |
| | | saveWeigh() { |
| | | this.weighData.coalContactClean = this.coalContactClean; |
| | | console.log(this.weighData); |
| | | this.$reqPost('saveWeigh', this.weighData, 'json') |
| | | .then(res => { |
| | | console.log(res, '称重接口'); |
| | | if (res.code == 0) { |
| | | this.$u.toast('称重成功'); |
| | | this.$u.toast('称重成功,即将返回上一页'); |
| | | this.isConfirmWeighLoading = false; |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | this.isConfirmWeighLoading = false; |
| | | }, 1000); |
| | | } else if (res.code === 3) { |
| | | this.isExceedOrigin = true |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '称重失败,请稍后重试'); |
| | | this.isConfirmWeighLoading = false |
| | |
| | | }, |
| | | // 加减煤 |
| | | addAndSubtractCoal() { |
| | | this.addAndSubtractCoalLoading = true |
| | | this.$reqPost('addAndSubtractCoal', { |
| | | deptId: this.weighData.deptId, |
| | | sceneId: this.weighData.sceneId, |
| | |
| | | weigh: this.weighData.weigh |
| | | }, 'json').then(res => { |
| | | if (res.code == 0) { |
| | | this.addAndSubtractCoalLoading = false |
| | | this.$u.toast('操作成功,即将返回上一页'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | |
| | | }); |
| | | this.isConfirmWeighLoading = false; |
| | | }, 1000); |
| | | console.log(res, '加减煤'); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '操作失败'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | // 放空弹窗确认 |
| | | evacuationConfirm() { |
| | | this.TwoEvacuationLoading = true; |
| | | this.$reqPost('getTwoEvacuation', this.weighData, 'json').then(res => { |
| | | console.log(res, '第二次放空'); |
| | | if (res.code == 0) { |
| | | this.$u.toast('操作成功,即将返回上一页'); |
| | | if (res.msg.length > 4) { //大于4是等待后台确认 |
| | | this.TwoEvacuationLoading = true; |
| | | this.evacuationModalShow = false; |
| | | this.afterEvacuationStatus = res.data.status === 21 || res.data.status === 22 |
| | | this.afterEvacuationText = res.msg |
| | | |
| | | } else { //小于4成功 |
| | | this.TwoEvacuationLoading = false; |
| | | this.evacuationModalShow = false; |
| | | this.$u.toast('操作成功,即将返回上一页'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, 1000); |
| | | this.evacuationModalShow = false; |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '操作失败'); |
| | | this.evacuationModalShow = true; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.orderSurplusLess = true |
| | | } |
| | | }, |
| | | confirmWeighConfirm() { |
| | | this.changeconfirmWeighVisiable(false) |
| | | this.isConfirmWeighLoading = false |
| | | this.TwoEvacuationLoading = false; |
| | | setTimeout(() => { |
| | | this.$u.toast('即将返回上一页'), |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | }, 800) |
| | | } |
| | | } |
| | | }; |
| | | </script> |