| | |
| | | background-size: cover;"> |
| | | <view class="top"> |
| | | <view class="top_left"> |
| | | <text>{{ realTimeWeigh }}</text> |
| | | <!-- <text>{{ globalweigh }}</text> --> |
| | | <!-- <text>{{ realTimeWeigh }}</text> --> |
| | | <text>{{ globalweigh }}</text> |
| | | </view> |
| | | <view class="top_right"> |
| | | <view class=""> |
| | |
| | | class="jiajian" |
| | | v-if="outBuy"></u-button> |
| | | </view> |
| | | <!-- <view class="four" v-if="weighList.orderType !== '外购'">如您需要调整装载货品吨数,请点击返回加减吨</view> --> |
| | | <view style="width: 200rpx;margin: auto;position: relative;" |
| | | v-if="historyBtn"><u-button type="primary" |
| | | text="显示历史皮重" |
| | | @click.stop="displayHistory"></u-button></view> |
| | | <Transition name="slide-fade"> |
| | | <view class="history-skin" |
| | | v-if="historyShow"> |
| | | <view class="history-skin_item" |
| | | v-for="item in tmTaskCoalList"> |
| | | <view class="createTime"> |
| | | 日期:{{item.createTime.slice(0,10)}} |
| | | </view> |
| | | <view class="skin"> |
| | | <view class=""> |
| | | 皮重: |
| | | </view> |
| | | <view class=""> |
| | | {{item.skin}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </Transition> |
| | | <!-- 放空弹窗 --> |
| | | <view class="evacuationModal"> |
| | | <u-modal :show="evacuationModalShow" |
| | |
| | | :showCancelButton="true" |
| | | @confirm="evacuationConfirm" |
| | | @cancel="evacuationCancel"></u-modal> |
| | | </view> |
| | | <!-- 称重异常弹窗 --> |
| | | <view class=""> |
| | | <u-modal :show="abnormalModalShow" |
| | | title="异常原因" |
| | | :showCancelButton="true" |
| | | @confirm="abnormalConfirm" |
| | | @cancel="abnormalCancel" |
| | | confirmText="提交"> |
| | | <view class="slot-content"> |
| | | <u--form labelPosition="top"> |
| | | <u-form-item> |
| | | <u-textarea v-model="abnormalContent" |
| | | confirmType="done" |
| | | placeholder="请输入异常原因" |
| | | height='140' |
| | | count |
| | | border="surround" |
| | | autoHeight></u-textarea> |
| | | </u-form-item> |
| | | </u--form> |
| | | </view> |
| | | </u-modal> |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | isfocus1: false, |
| | | isfocus2: false, |
| | | // 外购第一次称毛重不需要加减吨 |
| | | outBuy: true |
| | | outBuy: true, |
| | | // 皮重异常相关 |
| | | abnormalContent: '', |
| | | avgSkin: null, // 平均皮重 |
| | | tmTaskCoalList: [], |
| | | abnormalModalShow: false, |
| | | historyBtn: false, |
| | | historyShow: false |
| | | }; |
| | | }, |
| | | watch: { |
| | | realTimeWeigh(newV, oldV) { |
| | | if (this.weighList.orderType == '外销' || this.weighList.orderType == '内销' || this.weighList.orderType == |
| | | '转出') { |
| | | if (this.weighList.skin == 0) { |
| | | // this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | | this.temporaryWeighObj.skin = newV; |
| | | } else { |
| | | // this.temporaryWeighObj.hair = this.realTimeWeigh; |
| | | this.temporaryWeighObj.hair = newV; |
| | | this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed(2); |
| | | this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this.temporaryWeighObj |
| | | .clean < 0; |
| | | } |
| | | } else if (this.weighList.orderType == '外购' || this.weighList.orderType == '内购' || this.weighList |
| | | .orderType == '转入') { |
| | | if (this.weighList.hair == 0) { |
| | | this.temporaryWeighObj.hair = newV; |
| | | } else { |
| | | this.temporaryWeighObj.skin = newV; |
| | | this.temporaryWeighObj.clean = (this.weighList.hair - this.temporaryWeighObj.skin).toFixed(2); |
| | | this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this.temporaryWeighObj |
| | | .clean < 0; |
| | | } |
| | | } |
| | | |
| | | }, |
| | | // 监听重量变化 |
| | | globalweigh(newV) { |
| | | this.weighData.weigh = this.realTimeWeigh = newV; |
| | | console.log(this.realTimeWeigh, '真实重量改变了'); |
| | | globalweigh: { |
| | | deep: true, |
| | | handler: function(newV) { |
| | | this.weighData.weigh = this.realTimeWeigh = newV; |
| | | if (this.weighList.orderType == '外销' || this.weighList.orderType == '内销' || this.weighList |
| | | .orderType == |
| | | '转出') { |
| | | if (this.weighList.skin == 0) { |
| | | this.getAverageSkin() |
| | | this.temporaryWeighObj.skin = newV; |
| | | if (this.avgSkin < newV) { |
| | | this.abnormalModalShow = true |
| | | this.historyBtn = true |
| | | } |
| | | } else { |
| | | this.temporaryWeighObj.hair = newV; |
| | | this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed( |
| | | 2); |
| | | this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this |
| | | .temporaryWeighObj |
| | | .clean < 0; |
| | | } |
| | | } else if (this.weighList.orderType == '外购' || this.weighList.orderType == '内购' || this.weighList |
| | | .orderType == '转入') { |
| | | if (this.weighList.hair == 0) { |
| | | this.temporaryWeighObj.hair = newV; |
| | | } else { |
| | | this.temporaryWeighObj.skin = newV; |
| | | this.temporaryWeighObj.clean = (this.weighList.hair - this.temporaryWeighObj.skin).toFixed( |
| | | 2); |
| | | this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this |
| | | .temporaryWeighObj |
| | | .clean < 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onShow() { |
| | |
| | | methods: { |
| | | ...mapMutations(['changeweighHouseCode', 'changeisLogin']), |
| | | init() { |
| | | uni.showLoading({ |
| | | title: "加载中" |
| | | }) |
| | | // 获取称重信息 |
| | | this.$reqGet('weighList', { id: this.takeCoalId }).then(res => { |
| | | console.log(res, '获取称重信息'); |
| | | if (res.code == 0) { |
| | | uni.hideLoading() |
| | | this.weighList = res.data; |
| | | this.weighData.deptId = res.data.deptId; |
| | | this.weighData.tmId = res.data.id; |
| | |
| | | } else { |
| | | this.isInputOrigin = true; |
| | | } |
| | | } else { |
| | | uni.hideLoading() |
| | | this.$u.toast('加载失败') |
| | | } |
| | | }); |
| | | }, |
| | |
| | | if (this.weighData.coalContactHair > 0 && this.weighData.coalContactSkin > 0) { |
| | | this.isInputOrigin = true; |
| | | } |
| | | }, |
| | | getAverageSkin() { |
| | | uni.showLoading({ |
| | | title: "加载中" |
| | | }) |
| | | this.$reqGet('getAvgSkin').then(res => { |
| | | if (res.code === 0) { |
| | | uni.hideLoading() |
| | | this.avgSkin = res.data.avgSkin |
| | | this.tmTaskCoalList = res.data.tmTaskCoalList |
| | | } else { |
| | | uni.hideLoading() |
| | | this.$u.toast('加载失败') |
| | | } |
| | | }) |
| | | }, |
| | | abnormalCancel() { |
| | | this.abnormalModalShow = false |
| | | }, |
| | | abnormalConfirm() { |
| | | uni.showLoading({ |
| | | title: "提交中" |
| | | }) |
| | | this.$reqPost('tmAbnormalTextAdd', { tmId: this.weighData.tmId, abnormalText: this.abnormalContent }, |
| | | 'params').then( |
| | | res => { |
| | | if (res.code == 0) { |
| | | uni.hideLoading() |
| | | this.$u.toast('提交成功') |
| | | this.abnormalModalShow = false |
| | | } else { |
| | | uni.hideLoading() |
| | | this.$u.toast('提交失败') |
| | | this.abnormalModalShow = true |
| | | } |
| | | }) |
| | | }, |
| | | displayHistory() { |
| | | this.historyShow = true |
| | | |
| | | } |
| | | } |
| | | }; |
| | |
| | | |
| | | ::v-deep.weighingDevice { |
| | | width: 100%; |
| | | height: 100vh; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .slot-content { |
| | | width: 96%; |
| | | border: 1rpx solid rgb(220, 223, 230); |
| | | } |
| | | |
| | | .one { |
| | | // flex: 3; |
| | |
| | | margin-top: vww(5); |
| | | text-align: center; |
| | | } |
| | | |
| | | .slide-fade-enter-active { |
| | | transition: all 0.3s ease-out; |
| | | } |
| | | |
| | | .history-skin { |
| | | width: 96%; |
| | | height: vww(300); |
| | | margin: vww(50) auto; |
| | | margin-top: vww(10); |
| | | background: #ffffff; |
| | | box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); |
| | | border-radius: 20rpx; |
| | | overflow: scroll; |
| | | color: #000; |
| | | |
| | | |
| | | .history-skin_item { |
| | | width: 80%; |
| | | height: vww(30); |
| | | @include flex; |
| | | margin: vww(10) auto; |
| | | |
| | | .createTime { |
| | | color: rgb(60, 156, 255); |
| | | } |
| | | |
| | | .skin { |
| | | color: #f81414; |
| | | @include flex; |
| | | width: 180rpx; |
| | | height: vww(30); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .secondary-confirmation__main { |