| | |
| | | </u-field> |
| | | </modalBg> |
| | | <saveForm ref="saveForm" /> |
| | | <scan></scan> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import modalBg from '@/components/modal/modal-bg.vue' |
| | | import saveForm from './components/saveForm.vue' |
| | | import scan from "@/components/scan/scan.vue"; |
| | | export default { |
| | | components: { modalBg, saveForm }, |
| | | components: { modalBg, saveForm, scan }, |
| | | data() { |
| | | return { |
| | | checkboxList: [ |
| | |
| | | onReady() { |
| | | this.$refs.uForm.setRules(this.rules); |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | uni.$off('scan') // 每次进来先 移除全局自定义事件监听器 |
| | | uni.$on('scan', function (data) { |
| | | console.log('onscan'); |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log('页面扫码结果:', data.code); |
| | | if (data.code) { |
| | | let codeInfo = JSON.parse(data.code) |
| | | if (codeInfo.WorkNo) { |
| | | // 扫描报工单二维码 |
| | | that.saveForm(codeInfo); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | // 多选处理 |
| | | changeCheckbox(val) { |
| | |
| | | url: '/pages/product/report/orderList' |
| | | }) |
| | | }, |
| | | // 存订单号 |
| | | setNo(val) { |
| | | this.form.value3 = val |
| | | }, |
| | | // 回显扫码的信息-报工单 |
| | | saveForm(val) { |
| | | let { WorkNo, ProcessName, ORDER_NO } = val |
| | | this.form.value1 = WorkNo |
| | | this.form.value2 = ProcessName |
| | | this.form.value3 = ORDER_NO |
| | | } |
| | | } |
| | | } |