| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <template>
- <view class="content-box">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
- color="#000" @clickLeft="back"></uni-nav-bar>
- <view class="list_box">
- <u-list @scrolltolower="scrolltolower">
- <view v-for="(item,index) in List" :key="index" class="card_box">
- <workOrderBom :item='item' @handleScan='handleWordScan'></workOrderBom>
- <turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' :newTurnover='item.newTurnover'
- @handleScan='handleScan'></turnoverBom>
-
- </view>
- </u-list>
- </view>
- <view class="bottom-wrapper">
- <view class="btn_box" @click="save">更换周转车</view>
- </view>
- </view>
- </template>
- <script>
- import workOrderBom from '../../feeding/components/workOrderBom.vue'
- import turnoverBom from '../components/turnoverBom.vue'
- import {
- getVehicle,
- } from '@/api/pda/workOrder.js'
- import {
- batchSave
- } from '@/api/pda/feeding.js'
- export default {
- components: {
- workOrderBom,
- turnoverBom
- },
- data() {
- return {
- title: '',
- workOrderId: null,
- List: [],
- taskId: null
- }
- },
- onLoad(options) {
- this.title = options.taskName ? options.taskName + '-更换周转车' : '更换周转车'
- this.workOrderId = options.workOrderId;
- this.taskId = options.taskId
- this.taskName = options.taskName
- this.getList()
- },
- methods: {
- scrolltolower() {},
- save() {
- batchSave(this.List).then(res => {
- })
- },
- getList() {
- getVehicle({
- workOrderId: this.workOrderId,
- taskId: this.taskId
- }).then(res => {
- this.List = []
- if (res.turnover && res.turnover.length) {
- res.newTurnover = []
- res.turnover.forEach(e => {
- e.extInfo.positionList.length && e.extInfo.positionList.forEach(o => {
- o['check'] = false
- o['isend'] = false
- o['newQuantity'] = o.quantity
- })
- })
- }
- this.List.push(res)
- console.log(this.List)
- })
- },
- handleWordScan(id, type) {
- uni.showToast({
- icon: 'none',
- title: '不支持更换工单'
- })
- },
- handleScan(id, type) {
- console.log(id)
- console.log(type)
- // this.scanData('SCJHGD20240117002', type, id)
- // return false
- let _this = this
- uni.scanCode({
- success: function(res) {
- _this.scanData(res.result, type, id)
- }
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .content-box {
- height: 100vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 4rpx 0;
- .u-list {
- height: 100% !important;
- }
- .card_box {
- padding: 16rpx 24rpx;
- }
- }
- .bottom-wrapper {
- .btn_box {
- width: 750rpx;
- height: 88rpx;
- line-height: 88rpx;
- background: $theme-color;
- text-align: center;
- font-size: 36rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- }
- .operate_box {
- padding: 10rpx 160rpx;
- /deep/ .u-button {
- width: 160rpx;
- }
- }
- </style>
|