| | |
| | | <template> |
| | | <view class="page"> |
| | | <view class="packing-registration-bg" /> |
| | | <u-navbar title="订单下发" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" |
| | | back-icon-color="#000" /> |
| | | <u-navbar |
| | | title="订单下发" |
| | | :background="background" |
| | | :border-bottom="false" |
| | | :title-bold="true" |
| | | title-color="#000" |
| | | back-icon-color="#000" |
| | | /> |
| | | <view class="packing-registration-param"> |
| | | <view class="packing-registration-param-view"> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | <text class="item-one item-two" @click="seachPersonnelNo()">{{ |
| | | registerInfo.moNo == "" ? "点击选择" : registerInfo.moNo |
| | | }}</text> |
| | | <u-icon name="arrow-right" color="#687792" size="28" @click="seachPersonnelNo()" |
| | | v-show="registerInfo.moNo == ''"></u-icon> |
| | | <u-icon |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | @click="seachPersonnelNo()" |
| | | v-show="registerInfo.moNo == ''" |
| | | ></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | <text class="item-one item-two" @click="seachComp()">{{ |
| | | registerInfo.value2 == "" ? "点击选择" : registerInfo.value2 |
| | | }}</text> |
| | | <u-icon name="arrow-right" color="#687792" size="28" @click="seachComp()" |
| | | v-show="registerInfo.value2 == ''"></u-icon> |
| | | <u-icon |
| | | name="arrow-right" |
| | | color="#687792" |
| | | size="28" |
| | | @click="seachComp()" |
| | | v-show="registerInfo.value2 == ''" |
| | | ></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | </view> |
| | | <view class="wrap"> |
| | | <scroll-view class="packing-registration-scroll-list" scroll-y="true"> |
| | | <u-cell-group class="packing-registration-scroll-list-group" :border="false"> |
| | | <u-cell-group |
| | | class="packing-registration-scroll-list-group" |
| | | :border="false" |
| | | > |
| | | <!-- <div class="tip" style="text-align: center;" v-if="hasScanSnList.length==0">-请扫码-</div> --> |
| | | <view class="content" v-for="(item, index) in hasScanSnList" :key="index" :index="index"> |
| | | <view |
| | | class="content" |
| | | v-for="(item, index) in hasScanSnList" |
| | | :key="index" |
| | | :index="index" |
| | | > |
| | | <view class="content-header"> |
| | | <view class="content-header-title">{{ index + 1 }}</view> |
| | | </view> |
| | |
| | | </scroll-view> |
| | | <scan></scan> |
| | | </view> |
| | | <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true" @confirm="confirm" |
| | | @cancel="cancel"> |
| | | <u-modal |
| | | v-model="showModal" |
| | | title="" |
| | | :show-cancel-button="true" |
| | | :show-confirm-button="true" |
| | | @confirm="confirm" |
| | | @cancel="cancel" |
| | | > |
| | | <view class="popup-content"> |
| | | <view class="packing-registration-param"> |
| | | <view class="packing-registration-param-view"> |
| | |
| | | <text class="item-one">批号</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <text class="item-one item-two">{{ modalList.value }}</text> |
| | | <text class="item-one item-two">{{ modalList.moNO }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | }, |
| | | // 弹窗列表 |
| | | modalList: { |
| | | value: "", |
| | | value1: "", |
| | | partNo: "", |
| | | moNo: "", |
| | | }, |
| | | // 主页面列表 |
| | | registerInfo: { |
| | |
| | | }, |
| | | // 下发记录列表 |
| | | hasScanSnList: [], |
| | | codeInfoId: "", |
| | | }; |
| | | }, |
| | | onShow() { |
| | | let that = this; |
| | | uni.$off("scan"); // 每次进来先 移除全局自定义事件监听器 |
| | | if ((registerInfo.moNO = null)) { |
| | | if (registerInfo.moNO == null) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "请先选择子件!", |
| | |
| | | } |
| | | uni.$on("scan", function(data) { |
| | | console.log("onscan"); |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log("扫码结果:", data.code); |
| | | if (data.code) { |
| | | let codeInfo = JSON.parse(data.code); |
| | | this.codeInfoId = codeInfo.id; |
| | | if (codeInfo.moOn) { |
| | | // 扫描报工单二维码 |
| | | that.scanHandle(data.code); |
| | | that.$forceUpdate(); |
| | | that.getHandelList(); |
| | | } |
| | | } |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log("扫码结果:", data.code); |
| | | }); |
| | | }, |
| | | methods: { |
| | | getHandelList() { |
| | | this.$u.api.workReporting |
| | | .getProductMainV1({ |
| | | current: 1, |
| | | size: -1, |
| | | id: this.codeInfoId, |
| | | }) |
| | | .then((res) => { |
| | | this.hasScanSnList = res.data.productOutputList; |
| | | }); |
| | | }, |
| | | // 点击确认后获取下发记录 |
| | | confirm() { |
| | | // 处理确认逻辑 |
| | | this.showModal = false; |
| | | this.$u.api.workReporting |
| | | ._({}).then((res) => { |
| | | this.$u.api.workReporting._(this.modalList).then((res) => { |
| | | console.log("res", res); |
| | | this.hasScanSnList = res.data.records; |
| | | this.showModal = false; |
| | | |
| | | this.getHandelList(); |
| | | }); |
| | | }, |
| | | // 模态框取消 |
| | |
| | | }, |
| | | //子件 |
| | | seachComp() { |
| | | if (this.registerInfo.value1 == null || this.registerInfo.value1 == "") { |
| | | if (this.registerInfo.moNO == null) { |
| | | this.$u.toast("请选择订单号"); |
| | | return; |
| | | } |
| | |
| | | }); |
| | | }, |
| | | // 扫码后数据回显 |
| | | scanHandle(scanresult) { |
| | | this.$u.api.workReporting |
| | | ._({}).then((res) => { |
| | | this.modalList = res.data.records; |
| | | scanHandle(val) { |
| | | let { moNo } = val; |
| | | this.modalList.moNo = moNo; |
| | | this.showModal = true; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |