| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- <template>
- <view class="content-box">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="入库" background-color="#F7F9FA" color="#000"
- @clickLeft="back">
- </uni-nav-bar>
- <view class="list_box">
- <u-list @scrolltolower="scrolltolower">
- <view class="card_box">
- <workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
- <view class="select_box">
- <zxz-uni-data-select :localdata="warehouseList" placeholder="请选择入库仓库" v-model="warehouseId"
- dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
- </view>
- <view class="list_box" v-for="(item, index) in List" :key="index" v-if="clientEnvironmentId != 3">
- <view class="time">打包时间: {{ item.createTime }}</view>
- <packingBom :objData="item.extInfo" :measuringUnit='item.measuringUnit'></packingBom>
- </view>
- <view class="list_box" v-for="(it, index) in tgList" :key="index" v-if="clientEnvironmentId == 3">
- <view class="time">打包时间: {{ it.createTime }}</view>
- <packingTgBom :list='it.extInfo.pickOutInList' :isWarehousing='true'></packingTgBom>
- </view>
- </view>
- </u-list>
- </view>
- <view class="bottom-wrapper">
- <view class="btn_box" @click="save">一键报工</view>
- </view>
- </view>
- </template>
- <script>
- import {
- getByIdReport,
- jobSave
- } from '@/api/pda/jobBooking.js'
- import {
- getWarehouseList,
- listPDAToWarehouse,
- listPDAToWarehouseTG
- } from '@/api/pda/workOrder.js'
- import packingBom from './components/packingBom.vue'
- import workOrderBom from '../feeding/components/workOrderBom.vue'
- import packingTgBom from '../jobBooking/components/packingTgBom.vue'
- export default {
- components: {
- workOrderBom,
- packingBom,
- packingTgBom
- },
- data() {
- return {
- id: null,
- taskId: null,
- objData: {},
- warehouseList: [],
- warehouseId: null,
- List: [],
- tgList: [],
- clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
- .clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
- inWarehouseType: null,
- }
- },
- onLoad(options) {
- this.id = options.workOrderId
- this.taskId = options.taskId
- this.workReportId = options.workReportId
- this.getList()
- this.getWarehouseListFn()
- if (this.clientEnvironmentId == 3) {
- this.getTgWarehouse()
- } else {
- this.getWarehouse()
- }
- },
- methods: {
- getList() {
- getByIdReport(this.id, this.taskId).then(res => {
- this.objData = res
- if (res.workOrderType == 1) {
- this.inWarehouseType = 1
- } else if (res.workOrderType == 2) {
- this.inWarehouseType = 8 // "1入库类型1生产入库2半成品入库"
- }
- this.objData.workReportInfo = {
- formingNum: null,
- formingWeight: null,
- formedNum: null,
- formedWeight: null,
- taskId: this.taskId
- }
- })
- },
- getWarehouseListFn() {
- getWarehouseList().then(res => {
- this.warehouseList = res
- })
- },
- getWarehouse() {
- let param = {
- workOrderId: this.id,
- taskId: this.taskId,
- workReportId: this.workReportId
- }
- listPDAToWarehouse(param).then(res => {
- this.List = res
- })
- },
- getTgWarehouse() {
- let param = {
- workOrderId: this.id,
- taskId: this.taskId,
- workReportId: this.workReportId
- }
- listPDAToWarehouseTG(param).then(res => {
- this.tgList = res
- })
- },
- handleScan() {
- },
- scrolltolower() { },
- save() {
- if (!this.warehouseId) {
- uni.showToast({
- icon: 'none',
- title: '请先选择入库仓库'
- })
- return false
- }
- let storageInfo = {
- warehouseId: this.warehouseId,
- inWarehouseType: this.inWarehouseType,
- toWarehouseList: this.clientEnvironmentId == 3 ? this.tgList : this.List,
- }
- this.objData['storageInfo'] = storageInfo
- jobSave(this.objData).then(res => {
- if( this.workReportId ) {
- uni.navigateBack({
- delta: -2
- });
- } else {
- uni.navigateBack({
- delta: -1
- });
- }
-
- })
- },
- }
- }
- </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;
- }
- }
- .select_box {
- margin-top: 20rpx;
- }
- .list_box {
- margin-top: 40rpx;
- .time {
- font-size: 28rpx;
- }
- }
- </style>
|