From ea87c908fb6cdfc3e227a584a53e6730efb8262a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 26 十月 2023 13:41:12 +0800
Subject: [PATCH] 小程序代码
---
minipro_standard/pages/OutOperation/OutOperation.vue | 1588 ++++++++++++++++++++++++++++------------------------------
1 files changed, 774 insertions(+), 814 deletions(-)
diff --git a/minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue b/minipro_standard/pages/OutOperation/OutOperation.vue
similarity index 76%
rename from minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue
rename to minipro_standard/pages/OutOperation/OutOperation.vue
index e072852..0e5f6e4 100644
--- a/minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue
+++ b/minipro_standard/pages/OutOperation/OutOperation.vue
@@ -1,828 +1,788 @@
<template>
- <page-meta :page-style="ban ?'overflow: hidden;': ''"/>
- <view>
- <InOutInfo :info="info" />
- <uni-collapse @change="change" @close="close" @open="open">
- <uni-collapse-item :open="item1.wtransferDetailList.length" v-if="type==7"
- v-for="(item1, index) in warehouseList" :key="index">
- <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
- <image src="../../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
- <view>{{ item1.warehouseName }}</view>
- </view>
- <view class="p30">
- <div class="page_dck">
- <div class="page_dck_title">
- <div class="page_dck_title_x"></div>
- <span>寰呭嚭搴撶墿鏂�</span>
- </div>
- </div>
- <div class="page_content" v-for="(item, index) in item1.wtransferDetailList" :key="index"
- :name="index">
- <div class="page_content_title">
- <div class="page_content_title_top">
- <span>{{ item.materialName + ' | ' + item.materialCode }}</span>
- <span>寰呭嚭<span>{{ item.outPlannum }}</span> {{ item.unitName }}</span>
- </div>
- <div class="page_content_title_bottom">
- <span class="green" v-if="item.qualityType === 0">鍚堟牸<text class="c6" decode>{{ split}}</text></span>
- <span class="warning" v-else-if="item.qualityType === 1">涓嶈壇<text class="c6" decode>{{ split}}</text></span>
- <span class="error" v-else-if="item.qualityType === 2">鎶ュ簾<text class="c6" decode>{{ split}}</text></span>
- <span v-else>-<text class="c6" decode>{{ split}}</text></span>
- <span>{{item.procedureName || '-'}}<text class="c6" decode>{{ split}}</text></span>
- <span>{{item.batch ? item.batch : '-'}}</span>
- </div>
- </div>
- <div class="page_content_list" v-for="(childer, idxs) in item.wstockExtListVOList" :key="idxs">
- <div class="page_content_list_item">
- <div class="page_content_list_item_label">鍑哄簱璐т綅锛�</div>
- <div class="page_content_list_item_nr">{{ childer.locationName }}</div>
- </div>
- <div class="page_content_list_items">
- <div class="page_content_list_item_label">鏁伴噺锛�</div>
- <div class="page_content_list_item_nr">{{ childer.num }}{{ childer.unitName }}</div>
- </div>
- <div class="page_content_list_item">
- <div class="page_content_list_item_label">鎵规鍙凤細</div>
- <div class="page_content_list_item_nr">{{ childer.batch ? childer.batch : '-' }}</div>
- </div>
- </div>
- </div>
- </view>
- </uni-collapse-item>
- <uni-collapse-item v-if="type==8">
- <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
- <image src="../../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
- <view>{{ info.warehouseName }}</view>
- </view>
- <view class="p30">
- <div class="page_dck">
- <div class="page_dck_title">
- <div class="page_dck_title_x"></div>
- <span>寰呭嚭搴撶墿鏂�</span>
- </div>
- </div>
- <div class="page_content" v-for="(item, index) in woutboundDetailsWait" :key="index" :name="index">
- <div class="page_content_title">
- <div class="page_content_title_top">
- <span>{{ item.materialName + ' | ' + item.materialCode }}</span>
- <span>寰呭嚭 <span>{{ item.num }}</span> {{ item.unitName }}</span>
- </div>
- <div class="page_content_title_bottom">
- <span class="green" v-if="item.qualityType === 0">鍚堟牸<text class="c6" decode>{{ split}}</text></span>
- <span class="warning" v-else-if="item.qualityType === 1">涓嶈壇<text class="c6" decode>{{ split}}</text></span>
- <span class="error" v-else-if="item.qualityType === 2">鎶ュ簾<text class="c6" decode>{{ split}}</text></span>
- <span v-else>-<text class="c6" decode>{{ split}}</text></span>
- <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
- <span>{{item.batch ? item.batch : '-'}}</span>
- </div>
- </div>
- <div class="page_content_list" v-for="(items, ind) in item.wstockExtListVOList" :key="ind">
- <div class="page_content_list_item">
- <div class="page_content_list_item_label">鎵规鍙凤細</div>
- <div class="page_content_list_item_nr">{{ items.batch ? items.batch : '-' }}</div>
- </div>
- <div class="page_content_list_items">
- <div class="page_content_list_item_label">鏁伴噺锛�</div>
- <div class="page_content_list_item_nr">{{ items.num }}{{ items.umodel.name }}</div>
- </div>
- <div class="page_content_list_item" v-if="items.lmodel">
- <div class="page_content_list_item_label">鍑哄簱璐т綅锛�</div>
- <div class="page_content_list_item_nr">{{ items.lmodel.unionName }}</div>
- </div>
- </div>
- </div>
- </view>
- </uni-collapse-item>
- </uni-collapse>
-
- <div class="page_h"></div>
- <div class="page_yxwl">
- <div class="page_yxwl_title">
- <div class="left">
- <div class="page_yxwl_title_x"></div>
- <span>宸查�夋嫨鐗╂枡</span>
- </div>
-
- <div class="right" v-if="isZKD" @click="openxz">
- <image src="../../../static/gongdan_ic_shoudong@2x.png" class="img36" mode=""></image>
- <span>鎵嬪姩鍑哄簱</span>
- </div>
- </div>
- <div class="page_yxwl_list" v-if="outboundList.length > 0">
- <div class="page_yxwl_list_item" v-for="(item, index) in outboundList" :key="index">
- <div class="page_yxwl_list_item_top">
- <div class="page_yxwl_list_item_top_left">{{ item.materialName }} | {{ item.materialCode }}
- </div>
-
- </div>
- <div class="page_yxwl_list_item_sx">
- <span class="green" v-if="item.qualityType == 0">鍚堟牸<text class="c6" decode>{{ split}}</text></span>
- <span class="yellow" v-else-if="item.qualityType == 1">涓嶈壇<text class="c6" decode>{{ split}}</text></span>
- <span class="red" v-else-if="item.qualityType == 2">鎶ュ簾<text class="c6" decode>{{ split}}</text></span>
- <span v-else>-<text class="c6" decode>{{ split}}</text></span>
- <span>{{ item.procedureName ? item.procedureName : '-' }}<text class="c6" decode>{{ split}}</text></span>
- <span>{{ item.batch ? item.batch : '-' }}</span>
- </div>
- <div class="page_yxwl_list_item_num">
- <div class="item">
- <div class="label">鍑哄簱璐т綅锛�</div>
- <div class="nr">
- <span>{{ item.locationName }}</span>
- </div>
- </div>
- <div class="item f24">
- <div class="label">鏁伴噺锛�</div>
- <div class="nr">
- <!-- @input="changeNum(item)" -->
- <input type="number" v-model="item.num" placeholder="璇疯緭鍏�">
- <span>{{ item.unitName }}</span>
- </div>
- </div>
- <div class="dele" @click="dele(index)">
- <!-- <img src="@/assets/icon/chuku_ic_delete@2x.png" alt="" /> -->
- <image src="../../../static/chuku_ic_delete@2x.png" class="img48" mode=""></image>
- </div>
- </div>
- </div>
- </div>
- <div class="page_yxwl_kong" v-else>鏆傛棤鏁版嵁</div>
- </div>
- <div class="page_zw"></div>
- <!-- 鎻愪氦鎸夐挳 -->
- <div class="page_footer">
- <div class="page_footer_ck" @click="submit">
- <span>纭鍑哄簱</span>
- </div>
- </div>
- <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @close="ban = false" @selectes="selectMaterail" />
- </view>
-</template>
-
-<script>
- import InOutInfo from '@/components/InOutInfo.vue'
- import SelectTraMultipleMaterial from '@/components/SelectTraMultipleMaterial.vue'
- import {
- QRCodeType
- } from '@/common/config.js'
- import {
- outScanAppliances,
- wTransferForInOut,
- wTransferForInOutUpload,
- wOutBoundForInOut,
- wOutBoundForUpload,
- transferToOutNew
- } from '@/util/api/ExWarehouse'
- import {
- getDB
- } from '@/util/api/agencyAPI'
- export default {
- components: {
- InOutInfo,
- SelectTraMultipleMaterial
- },
+ <view>
+ <InOutInfo :info="info" />
+ <uni-collapse @change="change" @close="close" @open="open">
+ <uni-collapse-item :open="item1.wtransferDetailList.length" v-if="type==7" v-for="(item1, index) in warehouseList" :key="index">
+ <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
+ <image src="../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
+ <view>{{ item1.warehouseName }}</view>
+ </view>
+ <view class="p30">
+ <div class="page_dck">
+ <div class="page_dck_title">
+ <div class="page_dck_title_x"></div>
+ <span>寰呭嚭搴撶墿鏂�</span>
+ </div>
+ </div>
+ <div class="page_content" v-for="(item, index) in item1.wtransferDetailList" :key="index"
+ :name="index">
+ <div class="page_content_title">
+ <div class="page_content_title_top">
+ <span>{{ item.materialName + ' | ' + item.materialCode }}</span>
+ <span>寰呭嚭<span>{{ item.outPlannum }}</span> {{ item.unitName }}</span>
+ </div>
+ <div class="page_content_title_bottom">
+ <span class="green" v-if="item.qualityType === 0">鍚堟牸 <span
+ class="black">/</span> </span>
+ <span class="warning" v-else-if="item.qualityType === 1">涓嶈壇 <span
+ class="black">/</span> </span>
+ <span class="error" v-else-if="item.qualityType === 2">鎶ュ簾 <span
+ class="black">/</span> </span>
+ <span v-else>- / </span>
+ <span>{{item.procedureName ? item.procedureName : '-'}} / </span>
+ <span>{{item.batch ? item.batch : '-'}}</span>
+ </div>
+ </div>
+ <div class="page_content_list" v-for="(childer, idxs) in item.wstockExtListVOList" :key="idxs">
+ <div class="page_content_list_item">
+ <div class="page_content_list_item_label">鍑哄簱璐т綅锛�</div>
+ <div class="page_content_list_item_nr">{{ childer.locationName }}</div>
+ </div>
+ <div class="page_content_list_items">
+ <div class="page_content_list_item_label">鏁伴噺锛�</div>
+ <div class="page_content_list_item_nr">{{ childer.num }}{{ childer.unitName }}</div>
+ </div>
+ <div class="page_content_list_item">
+ <div class="page_content_list_item_label">鎵规鍙凤細</div>
+ <div class="page_content_list_item_nr">{{ childer.batch ? childer.batch : '-' }}</div>
+ </div>
+ </div>
+ </div>
+ </view>
+ </uni-collapse-item>
+ <uni-collapse-item v-if="type==8">
+ <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
+ <image src="../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
+ <view>{{ info.warehouseName }}</view>
+ </view>
+ <view class="p30">
+ <div class="page_dck">
+ <div class="page_dck_title">
+ <div class="page_dck_title_x"></div>
+ <span>寰呭嚭搴撶墿鏂�</span>
+ </div>
+ </div>
+ <div class="page_content" v-for="(item, index) in woutboundDetailsWait" :key="index" :name="index">
+ <div class="page_content_title">
+ <div class="page_content_title_top">
+ <span>{{ item.materialName + ' | ' + item.materialCode }}</span>
+ <span>寰呭嚭 <span>{{ item.num }}</span> {{ item.unitName }}</span>
+ </div>
+ <div class="page_content_title_bottom">
+ <span class="green" v-if="item.qualityType === 0">鍚堟牸 <span
+ class="black">/</span> </span>
+ <span class="warning" v-else-if="item.qualityType === 1">涓嶈壇 <span
+ class="black">/</span> </span>
+ <span class="error" v-else-if="item.qualityType === 2">鎶ュ簾 <span
+ class="black">/</span> </span>
+ <span v-else>- / </span>
+ <span>{{item.procedureName ? item.procedureName : '-'}} / </span>
+ <span>{{item.batch ? item.batch : '-'}}</span>
+ </div>
+ </div>
+ <div class="page_content_list" v-for="(items, ind) in item.wstockExtListVOList" :key="ind">
+ <div class="page_content_list_item">
+ <div class="page_content_list_item_label">鎵规鍙凤細</div>
+ <div class="page_content_list_item_nr">{{ items.batch ? items.batch : '-' }}</div>
+ </div>
+ <div class="page_content_list_items">
+ <div class="page_content_list_item_label">鏁伴噺锛�</div>
+ <div class="page_content_list_item_nr">{{ items.num }}{{ items.umodel.name }}</div>
+ </div>
+ <div class="page_content_list_item" v-if="items.lmodel">
+ <div class="page_content_list_item_label">鍑哄簱璐т綅锛�</div>
+ <div class="page_content_list_item_nr">{{ items.lmodel.unionName }}</div>
+ </div>
+ </div>
+ </div>
+ </view>
+ </uni-collapse-item>
+ </uni-collapse>
+
+ <div class="page_h"></div>
+ <div class="page_yxwl">
+ <div class="page_yxwl_title">
+ <div class="left">
+ <div class="page_yxwl_title_x"></div>
+ <span>宸查�夋嫨鐗╂枡</span>
+ </div>
+
+ <div class="right" v-if="isZKD" @click="openxz">
+ <image src="../../static/gongdan_ic_shoudong@2x.png" class="img36" mode=""></image><span>鎵嬪姩鍑哄簱</span>
+ </div>
+ </div>
+ <div class="page_yxwl_list" v-if="outboundList.length > 0">
+ <div class="page_yxwl_list_item" v-for="(item, index) in outboundList" :key="index">
+ <div class="page_yxwl_list_item_top">
+ <div class="page_yxwl_list_item_top_left">{{ item.materialName }} | {{ item.materialCode }}
+ </div>
+
+ </div>
+ <div class="page_yxwl_list_item_sx">
+ <span class="green" v-if="item.qualityType == 0">鍚堟牸 <span>/</span></span>
+ <span class="yellow" v-else-if="item.qualityType == 1">涓嶈壇 <span>/</span></span>
+ <span class="red" v-else-if="item.qualityType == 2">鎶ュ簾 <span>/</span></span>
+ <span v-else>- / </span>
+ <span> {{ item.procedureName ? item.procedureName : '-' }} / </span>
+ <span> {{ item.batch ? item.batch : '-' }}</span>
+ </div>
+ <div class="page_yxwl_list_item_num">
+ <div class="item">
+ <div class="label">鍑哄簱璐т綅锛�</div>
+ <div class="nr">
+ <span>{{ item.locationName }}</span>
+ </div>
+ </div>
+ <div class="item">
+ <div class="label">鏁伴噺锛�</div>
+ <div class="nr">
+ <!-- @input="changeNum(item)" -->
+ <input type="number" v-model="item.num" placeholder="璇疯緭鍏�">
+ <span>{{ item.unitName }}</span>
+ </div>
+ </div>
+ <div class="dele" @click="dele(index)">
+ <!-- <img src="@/assets/icon/chuku_ic_delete@2x.png" alt="" /> -->
+ <image src="../../static/chuku_ic_delete@2x.png" class="img24" mode=""></image>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="page_yxwl_kong" v-else>鏆傛棤鏁版嵁</div>
+ </div>
+ <div class="page_zw"></div>
+ <!-- 鎻愪氦鎸夐挳 -->
+ <div class="page_footer">
+ <div class="page_footer_ck" @click="submit">
+ <span>纭鍑哄簱</span>
+ </div>
+ </div>
+ <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @selectes="selectMaterail" />
+ </view>
+</template>
+
+<script>
+ import InOutInfo from '@/components/InOutInfo.vue'
+ import SelectTraMultipleMaterial from '@/components/SelectTraMultipleMaterial.vue'
+ import {
+ QRCodeType
+ } from '@/common/config.js'
+ import {
+ outScanAppliances,
+ wTransferForInOut,
+ wTransferForInOutUpload,
+ wOutBoundForInOut,
+ wOutBoundForUpload,
+ transferToOutNew
+ } from '@/util/api/ExWarehouse'
+ import {
+ getDB
+ } from '@/util/api/agencyAPI'
+ import {
+ logout
+ } from '../../util/api'
+ export default {
+ components: {
+ InOutInfo,
+ SelectTraMultipleMaterial
+ },
data() {
-
return {
- ban: false,
- type: '',
- id: '',
- dbid: '',
- isZKD: false,
- show: false,
- info: {
-
+ type: '',
+ id: '',
+ dbid: '',
+ isZKD: false,
+ show: false,
+ info: {
+
},
- split: ' / ',
- mainOrder: '',
- warehouseId: '',
- ids: [],
- warehouseList: [{
-
- }],
- woutboundDetailsWait: [],
- outboundList: []
- };
- },
- onLoad(option) {
- this.type = option.type
- this.id = option.id
- this.isZKD = this.type == QRCodeType.ZKD
- this.dbid = option.dbid
- if (option.dbid) {
- this.getDBs(option.dbid)
- } else {
- this.getInfo()
- }
- },
- methods: {
- // 鍒ゆ柇鏄惁瀹屾垚
- getDBs(dbid) {
- getDB(dbid)
- .then(res => {
- let {
- data
- } = res
- if (data.status == 1) {
- // 宸插畬鎴�
- } else {
- this.getInfo()
- }
- })
- .catch(err => {})
- },
- getInfo() {
- let infoAction
- let data = {
- id: this.id
- }
- if (this.type == QRCodeType.CKD) {
- infoAction = wOutBoundForInOut
- data.wOutboundType = '0'
- } else if (this.type == QRCodeType.ZKD) {
- infoAction = wTransferForInOut
- data.wTransferType = '0'
- }
- infoAction(data).then(res => {
- this.mainOrder = res.data.id
- if (this.isZKD) {
- this.info = res.data.wtransfer
- this.warehouseList = res.data.wtransferWarehouseList
- this.warehouseId = this.warehouseList[0].warehouseId
- } else {
- this.info = res.data.woutbound
- this.woutboundDetailsWait = res.data.woutboundDetailsWait
- this.warehouseId = this.woutboundDetailsWait[0].warehouseId
- }
- }).catch(err => {
- uni.$u.toast(err)
- uni.navigateBack()
- })
- },
- change() {},
- close() {},
- open() {},
- openxz() {
- this.ban = true
- this.$refs.selectTraMultipleMaterial.open({
- transferId: this.id,
- warehouseId: this.warehouseId
- })
- },
- selectMaterail(v) {
- this.ban = false
- let tempList = this.warehouseList[0].wtransferDetailList
- let materials = JSON.parse(JSON.stringify(v.materials))
- tempList.forEach(item => {
- let isOutList = false
- this.outboundList.forEach(selected => {
- if (selected.newId == item.id) {
- isOutList = true
- return
+ warehouseId: '',
+ ids: [],
+ warehouseList: [{
+
+ }],
+ woutboundDetailsWait: [],
+ outboundList: []
+ };
+ },
+ onLoad(option) {
+ this.type = option.type
+ this.id = option.id
+ this.isZKD = this.type == QRCodeType.ZKD
+ this.dbid = option.dbid
+ if (option.dbid) {
+ this.getDBs(option.dbid)
+ } else {
+ this.getInfo()
+ }
+ },
+ methods: {
+ // 鍒ゆ柇鏄惁瀹屾垚
+ getDBs(dbid) {
+ getDB(dbid)
+ .then(res => {
+ let {
+ data
+ } = res
+ if (data.status == 1) {
+ // 宸插畬鎴�
+ } else {
+ this.getInfo()
}
})
- if (!isOutList) {
+ .catch(err => {})
+ },
+ getInfo() {
+ let infoAction
+ let data = {
+ id: this.id
+ }
+ if (this.type == QRCodeType.CKD) {
+ infoAction = wOutBoundForInOut
+ data.wOutboundType = '0'
+ } else if (this.type == QRCodeType.ZKD) {
+ infoAction = wTransferForInOut
+ data.wTransferType = '0'
+ }
+ infoAction(data).then(res => {
+ if (this.isZKD) {
+ this.info = res.data.wtransfer
+ this.warehouseList = res.data.wtransferWarehouseList
+ this.warehouseId = this.warehouseList[0].warehouseId
+ } else {
+ this.info = res.data.woutbound
+ this.woutboundDetailsWait = res.data.woutboundDetailsWait
+ this.warehouseId = this.woutboundDetailsWait[0].warehouseId
+ }
+ }).catch(err => {
+ uni.$u.toast(err)
+ uni.navigateBack()
+ })
+ },
+ change() {},
+ close() {},
+ open() {},
+ openxz() {
+ this.$refs.selectTraMultipleMaterial.open({
+ transferId: this.id,
+ warehouseId: this.warehouseId
+ })
+ },
+ selectMaterail(v) {
+ let tempList = this.warehouseList[0].wtransferDetailList
+ let materials = v.materials
+
+ materials.forEach(materail => {
+
+ tempList.forEach(item => {
item.wstockExtListVOList.forEach(hw => {
- materials.forEach((materail, index) => {
- if (hw.materialId == materail.materialId &&
- hw.procedureId == materail.procedureId &&
- hw.qualityType == materail.qualityType &&
- hw.locationId == materail.locationId &&
- hw.batch == materail.batch
- ) {
- this.addToOutList(materail, item)
- materials.splice(index, 1)
+ if (materail.materialId == hw.materialId && materail.procedureId == hw
+ .procedureId && materail.qualityType == hw.qualityType && materail.batch ==
+ hw.batch) {
+ let isExist = false
+ this.outboundList.forEach(selected => {
+ if (selected.newId == materail.id) {
+ isExist = true
return
+ }
+ })
+ if (isExist) {
+ uni.$u.toast('璇ョ墿鏂欐壒娆″凡瀛樺湪')
+ return
+ }
+ let obj = JSON.parse(JSON.stringify(materail))
+ obj.newId = item.id
+ this.outboundList.push(obj)
+ }
+ })
+
+ })
+ })
+ },
+ dele(index) {
+ this.outboundList.splice(index, 1)
+ },
+ submit() {
+ if (this.type == QRCodeType.ZKD) {
+ if (this.outboundList.length > 0) {
+ let result = this.outboundList.reduce((a, b) => {
+ if (a[b.newId]) {
+ a[b.newId].push(b);
+ } else {
+ a[b.newId] = [b];
+ }
+ return a;
+ }, {});
+ let tempList = this.warehouseList[0].wtransferDetailList
+
+ for (let i = 0; i < tempList.length; i++) {
+ let item = tempList[i]
+ for (let a in result) {
+ if (item.id == a) {
+ let total = 0
+ for (let b = 0; b < result[a].length; b++) {
+ total = Number(total) + Number(result[a][b].num)
+ }
+ if (!total || total <= 0) {
+ uni.$u.toast('鍑哄簱鐗╂枡鏁伴噺蹇呴』澶т簬0')
+ return
+ }
+ console.log(total, item.outPlannum);
+ if (total > item.outPlannum) {
+ uni.$u.toast('鍑哄簱鏁伴噺涓嶈兘澶т簬寰呭嚭搴撴暟閲�')
+ return
+ }
+ }
+ }
+ }
+ let submitTransferOutDetailDTOList = []
+ this.outboundList.forEach(item => {
+ tempList.forEach(child => {
+ if (item.newId == child.id) {
+ submitTransferOutDetailDTOList.push({
+ outNum: item.num,
+ wstockId: item.id,
+ wtransferDetailId: child.id
+ })
}
})
})
-
-
- // if (item.batch) {
- // // 绮剧‘鍖归厤
- // if (materail.materialId == item.materialId &&
- // materail.procedureId == item.procedureId &&
- // materail.qualityType == item.qualityType &&
- // materail.batch == item.batch
- // ) {
- // this.addToOutList(materail, item)
- // materials.splice(index, 1)
- // return
- // }
- // } else {
- // if (materail.materialId == item.materialId &&
- // materail.procedureId == item.procedureId &&
- // materail.qualityType == item.qualityType
- // ) {
- // this.addToOutList(materail, item)
- // materials.splice(index, 1)
- // return
- // }
- // }
-
- }
- })
- },
- addToOutList(materail, item) {
- let isExist = false
- this.outboundList.forEach(selected => {
- if (selected.newId == materail.id) {
- isExist = true
- return
+ transferToOutNew({
+ submitTransferOutDetailDTOList,
+ wtransferId: this.id
+ }).then(res => {
+ if (res.code === 200) {
+ this.$store.dispatch('getUpcomingNum')
+ uni.$u.toast('鎿嶄綔鎴愬姛')
+ uni.redirectTo({
+ url: `/pages/warehousingDetails/warehousingDetails?id=${this.info.id}&dbid=${this.dbid}`
+ })
+ // uni.redirectTo({
+ // url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.info.id}&dbid=${this.dbid}`
+ // })
+ // setTimeout(() => {
+ // router.replace({ name: 'wTransferDetail', query: { id: info.value.wtransfer.id, dbid: route.query.dbid } })
+ // }, 2000)
+ }
+ })
+ } else {
+ uni.$u.toast('璇烽�夋嫨鍑哄簱鐗╂枡')
}
- })
- if (isExist) {
- uni.$u.toast('璇ョ墿鏂欏凡瀛樺湪')
- } else {
- let obj = JSON.parse(JSON.stringify(materail))
- obj.newId = item.id
- this.outboundList.push(obj)
- console.log(this.outboundList);
+ } else if (this.type === QRCodeType.CKD) {
+ wOutBoundForUpload({
+ id: info.value.woutbound.id,
+ wOutboundType: 0
+ }).then(res => {
+ if (res.code === 200) {
+ this.$store.dispatch('getUpcomingNum')
+ uni.$u.toast('鎿嶄綔鎴愬姛')
+ uni.redirectTo({
+ url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.info.id}`
+ })
+ // setTimeout(() => {
+ // // router.go(-1)
+ // router.replace({ name: 'wOutboundDetail', query: { id: info.value.wtransfer.id } })
+ // }, 2000)
+ }
+ })
}
- },
- dele(index) {
- this.outboundList.splice(index, 1)
- },
- submit() {
- if (this.type == QRCodeType.ZKD) {
- if (this.outboundList.length > 0) {
- let result = this.outboundList.reduce((a, b) => {
- if (a[b.newId]) {
- a[b.newId].push(b);
- } else {
- a[b.newId] = [b];
- }
- return a;
- }, {});
- let tempList = this.warehouseList[0].wtransferDetailList
- for (let i = 0; i < tempList.length; i++) {
- let item = tempList[i]
- for (let a in result) {
- if (item.id == a) {
- let total = 0
- for (let b = 0; b < result[a].length; b++) {
- total = Number(total) + Number(result[a][b].num)
- }
- if (!total || total <= 0) {
- uni.$u.toast('鍑哄簱鐗╂枡鏁伴噺蹇呴』澶т簬0')
- return
- }
- console.log(total, item.outPlannum);
- if (total > item.outPlannum) {
- uni.$u.toast('鍑哄簱鏁伴噺涓嶈兘澶т簬寰呭嚭搴撴暟閲�')
- return
- }
- }
- }
- }
- let submitTransferOutDetailDTOList = []
- this.outboundList.forEach(item => {
- tempList.forEach(child => {
- if (item.newId == child.id) {
- submitTransferOutDetailDTOList.push({
- outNum: item.num,
- wstockId: item.id,
- wtransferDetailId: child.id
- })
- }
- })
- })
- transferToOutNew({
- submitTransferOutDetailDTOList,
- wtransferId: this.id
- }).then(res => {
- if (res.code === 200) {
- this.$store.dispatch('getUpcomingNum')
- uni.$u.toast('鎿嶄綔鎴愬姛')
- uni.$emit('success')
- uni.redirectTo({
- url: `/pages_adjust/pages/warehousingDetails/warehousingDetails?id=${this.id}&dbid=${this.dbid}`
- })
- // setTimeout(() => {
- // router.replace({ name: 'wTransferDetail', query: { id: info.value.wtransfer.id, dbid: route.query.dbid } })
- // }, 2000)
- }
- })
- } else {
- uni.$u.toast('璇烽�夋嫨鍑哄簱鐗╂枡')
- }
- } else if (this.type === QRCodeType.CKD) {
- wOutBoundForUpload({
- id: this.id,
- wOutboundType: 0
- }).then(res => {
- if (res.code === 200) {
- this.$store.dispatch('getUpcomingNum')
- uni.$u.toast('鎿嶄綔鎴愬姛')
- uni.$emit('success')
- uni.redirectTo({
- url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.id}`
- })
- // setTimeout(() => {
- // // router.go(-1)
- // router.replace({ name: 'wOutboundDetail', query: { id: info.value.wtransfer.id } })
- // }, 2000)
- }
- })
- }
- }
- }
- }
-</script>
-
-<style lang="scss">
- .page_dck {
- .page_dck_title {
- display: flex;
- align-items: center;
-
- .page_dck_title_x {
- width: 8rpx;
- height: 30rpx;
- background: #4275FC;
- border-radius: 2rpx;
- margin-right: 16rpx;
- }
-
- span {
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- }
- }
- }
-
- .page_content {
- margin-top: 36rpx;
-
- .page_content_title {
- display: flex;
- flex-direction: column;
- margin-bottom: 10rpx;
-
- .page_content_title_top {
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- span {
- &:nth-child(1) {
- font-size: 30rpx;
- font-weight: 500;
- color: #222222;
- }
-
- &:nth-child(2) {
- flex-shrink: 0;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
-
- span {
- font-size: 24rpx;
- color: $nav-color;
- }
- }
- }
- }
-
- .page_content_title_bottom {
- .green {
- color: $nav-stateColor7 !important;
-
- .black {
- color: black !important;
- }
- }
-
- .warning {
- color: $nav-stateColor5 !important;
-
- .black {
- color: black !important;
- }
- }
-
- .error {
- color: $nav-stateColor4 !important;
-
- .black {
- color: black !important;
- }
- }
-
- span {
- font-size: 24rpx;
- font-weight: 400;
- color: #666666;
- }
- }
- }
-
- .lineBorder {
- border: none !important;
- padding-bottom: 0 !important;
- margin-bottom: 24rpx;
- }
-
- .page_content_list {
- width: 100%;
- display: flex;
- align-items: center;
- flex-wrap: wrap;
-
- &:first-child {
- margin: 0;
- }
-
- &:last-child {
- border: none;
- }
-
- .page_content_list_nums {
- width: 30%;
- display: flex;
-
- .page_content_list_num_label {
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- }
-
- .page_content_list_num_nr {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
-
- .page_content_list_num {
- width: 70%;
- display: flex;
-
- .page_content_list_num_label {
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- }
-
- .page_content_list_num_nr {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
-
- .page_content_list_items {
- width: 30%;
- display: flex;
- margin-top: 24rpx;
-
- .page_content_list_item_label {
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- flex-shrink: 0;
- }
-
- .page_content_list_item_nr {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
-
- .page_content_list_item {
- width: 70%;
- display: flex;
-
- .page_content_list_item_label {
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- flex-shrink: 0;
- }
-
- .page_content_list_item_nr {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
- }
- }
-
- .page_h {
- height: 20rpx;
- }
-
- .page_yxwl {
- padding: 30rpx;
- background: #ffffff;
-
- .page_yxwl_title {
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .page_yxwl_title_x {
- width: 8rpx;
- height: 30rpx;
- background: #4275FC;
- border-radius: 2rpx;
- margin-right: 16rpx;
- }
-
- span {
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- }
-
- .left {
- display: flex;
- align-items: center;
-
- .page_yxwl_title_x {
- width: 8rpx;
- height: 30rpx;
- background: #4275FC;
- border-radius: 2rpx;
- margin-right: 16rpx;
- }
-
- span {
- font-size: 32rpx;
- font-weight: 500;
- color: #222222;
- }
- }
-
- .right {
- display: flex;
- align-items: center;
-
- img {
- width: 28rpx;
- height: 28rpx;
- margin-right: 14rpx;
- }
-
- span {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
- }
-
- .page_yxwl_list {
- display: flex;
- flex-direction: column;
- padding-bottom: 30rpx;
- border-bottom: 1rpx solid #ececec;
-
- &:last-child {
- margin-bottom: 0;
- border: none;
- }
-
- .page_yxwl_list_item {
- margin-top: 28rpx;
-
- .page_yxwl_list_item_top {
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .page_yxwl_list_item_top_left {
- font-size: 30rpx;
- font-weight: 500;
- color: #222222;
- }
- }
-
- .page_yxwl_list_item_sx {
- display: flex;
- align-items: center;
- margin-top: 15rpx;
- font-size: 24rpx;
- }
-
- .page_yxwl_list_item_num {
- display: flex;
- position: relative;
- margin-top: 36rpx;
-
- &:first-child {
- margin-top: 0;
- }
-
- .dele {
- position: absolute;
- right: -30rpx;
- width: 48rpx;
- height: 48rpx;
-
- img {
- width: 100%;
- height: 100%;
- }
- }
-
- .item {
- width: 50%;
- display: flex;
- align-items: center;
-
- .label {
- flex-shrink: 0;
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- flex-shrink: 0;
- }
-
- .nr {
- flex: 1;
- display: flex;
- align-items: center;
-
- input {
- width: 130rpx;
- height: 40rpx;
- border-radius: 8rpx;
- border: 1rpx solid #E5E5E5;
- margin-right: 10rpx;
- }
-
- span {
- font-size: 26rpx;
- font-weight: 400;
- color: #222222;
- }
- }
- }
- }
- }
- }
-
- .page_yxwl_kong {
- padding: 50rpx 0;
- font-size: 25rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
-
- .page_zw {
- height: 160rpx;
- }
-
- .page_footer {
- width: calc(100% - 60rpx);
- background: #F7F7F7;
- display: flex;
- align-items: center;
- justify-content: space-between;
- position: fixed;
- bottom: 0;
- left: 30rpx;
- padding-bottom: 68rpx;
- z-index: 9999;
-
- .page_footer_qr {
- flex: 1;
- height: 88rpx;
- background: #fff;
- box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
- border-radius: 8rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: $nav-color;
- display: flex;
- align-items: center;
- justify-content: center;
-
- img {
- width: 30rpx;
- height: 30rpx;
- margin-right: 12rpx;
- }
- }
-
- .page_footer_ck {
- flex: 1;
- height: 88rpx;
- background: $nav-color;
- box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
- border-radius: 8rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ .page_dck {
+ .page_dck_title {
+ display: flex;
+ align-items: center;
+
+ .page_dck_title_x {
+ width: 8rpx;
+ height: 30rpx;
+ background: #4275FC;
+ border-radius: 2rpx;
+ margin-right: 16rpx;
+ }
+
+ span {
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+ }
+ }
+
+ .page_content {
+ margin-top: 36rpx;
+
+ .page_content_title {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 10rpx;
+
+ .page_content_title_top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ span {
+ &:nth-child(1) {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+
+ &:nth-child(2) {
+ flex-shrink: 0;
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #333333;
+
+ span {
+ font-size: 24rpx;
+ color: $nav-color;
+ }
+ }
+ }
+ }
+
+ .page_content_title_bottom {
+ .green {
+ color: $nav-stateColor7 !important;
+
+ .black {
+ color: black !important;
+ }
+ }
+
+ .warning {
+ color: $nav-stateColor5 !important;
+
+ .black {
+ color: black !important;
+ }
+ }
+
+ .error {
+ color: $nav-stateColor4 !important;
+
+ .black {
+ color: black !important;
+ }
+ }
+
+ span {
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ }
+
+ .lineBorder {
+ border: none !important;
+ padding-bottom: 0 !important;
+ margin-bottom: 24rpx;
+ }
+
+ .page_content_list {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+
+ &:first-child {
+ margin: 0;
+ }
+
+ &:last-child {
+ border: none;
+ }
+
+ .page_content_list_nums {
+ width: 30%;
+ display: flex;
+
+ .page_content_list_num_label {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+
+ .page_content_list_num_nr {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+
+ .page_content_list_num {
+ width: 70%;
+ display: flex;
+
+ .page_content_list_num_label {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+
+ .page_content_list_num_nr {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+
+ .page_content_list_items {
+ width: 30%;
+ display: flex;
+ margin-top: 24rpx;
+
+ .page_content_list_item_label {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #666666;
+ flex-shrink: 0;
+ }
+
+ .page_content_list_item_nr {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+
+ .page_content_list_item {
+ width: 70%;
+ display: flex;
+
+ .page_content_list_item_label {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #666666;
+ flex-shrink: 0;
+ }
+
+ .page_content_list_item_nr {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+ }
+ }
+
+ .page_h {
+ height: 20rpx;
+ }
+
+ .page_yxwl {
+ padding: 30rpx;
+ background: #ffffff;
+
+ .page_yxwl_title {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .page_yxwl_title_x {
+ width: 8rpx;
+ height: 30rpx;
+ background: #4275FC;
+ border-radius: 2rpx;
+ margin-right: 16rpx;
+ }
+
+ span {
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+
+ .left {
+ display: flex;
+ align-items: center;
+
+ .page_yxwl_title_x {
+ width: 8rpx;
+ height: 30rpx;
+ background: #4275FC;
+ border-radius: 2rpx;
+ margin-right: 16rpx;
+ }
+
+ span {
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+ }
+
+ .right {
+ display: flex;
+ align-items: center;
+
+ img {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 14rpx;
+ }
+
+ span {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+ }
+
+ .page_yxwl_list {
+ display: flex;
+ flex-direction: column;
+ padding-bottom: 30rpx;
+ border-bottom: 1rpx solid #ececec;
+
+ &:last-child {
+ margin-bottom: 0;
+ border: none;
+ }
+
+ .page_yxwl_list_item {
+ margin-top: 28rpx;
+
+ .page_yxwl_list_item_top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .page_yxwl_list_item_top_left {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #222222;
+ }
+ }
+
+ .page_yxwl_list_item_sx {
+ display: flex;
+ align-items: center;
+ margin-top: 15rpx;
+ }
+
+ .page_yxwl_list_item_num {
+ display: flex;
+ position: relative;
+ margin-top: 36rpx;
+
+ &:first-child {
+ margin-top: 0;
+ }
+
+ .dele {
+ position: absolute;
+ right: -30rpx;
+ width: 48rpx;
+ height: 48rpx;
+
+ img {
+ width: 100%;
+ height: 100%;
+ }
+ }
+
+ .item {
+ width: 50%;
+ display: flex;
+ align-items: center;
+
+ .label {
+ flex-shrink: 0;
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #666666;
+ flex-shrink: 0;
+ }
+
+ .nr {
+ flex: 1;
+ display: flex;
+ align-items: center;
+
+ input {
+ width: 130rpx;
+ height: 40rpx;
+ border-radius: 8rpx;
+ border: 1rpx solid #E5E5E5;
+ margin-right: 10rpx;
+ }
+
+ span {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .page_yxwl_kong {
+ padding: 50rpx 0;
+ font-size: 25rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+
+ .page_zw {
+ height: 160rpx;
+ }
+
+ .page_footer {
+ width: calc(100% - 60rpx);
+ background: #F7F7F7;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ position: fixed;
+ bottom: 0;
+ left: 30rpx;
+ padding-bottom: 68rpx;
+ z-index: 9999;
+ .page_footer_qr {
+ flex: 1;
+ height: 88rpx;
+ background: #fff;
+ box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+ border-radius: 8rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+ color: $nav-color;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ img {
+ width: 30rpx;
+ height: 30rpx;
+ margin-right: 12rpx;
+ }
+ }
+
+ .page_footer_ck {
+ flex: 1;
+ height: 88rpx;
+ background: $nav-color;
+ box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+ border-radius: 8rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+ color: #FFFFFF;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
</style>
--
Gitblit v1.9.3