From b6da87d49bb06cd0be0db4b44434afc088ebcad2 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 18 十二月 2025 15:07:02 +0800
Subject: [PATCH] 1
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js | 60
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue | 637 +++++++++-----
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue | 1124 +++++++++++++++++++++++++
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs | 4
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js | 2
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue | 807 ++++++++---------
6 files changed, 1,952 insertions(+), 682 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
index afd3d2e..1607c90 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js"
@@ -4,10 +4,11 @@
import { h,createVNode, render,reactive,ref } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect ,ElOption } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
import gridBody from './extend/allocateOrderDetail.vue'
+import gridHeader from './extend/Pallet.vue'
let extension = {
components: {
//鏌ヨ鐣岄潰鎵╁睍缁勪欢
- gridHeader: '',
+ gridHeader:gridHeader,
gridBody: gridBody,
gridFooter: '',
//鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
@@ -17,32 +18,32 @@
},
tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
buttons: { view: [
- {
- name: '缁勭洏',
- type: 'primary',
- value: '缁勭洏',
- onClick: function () { // 淇1锛氱Щ闄ゆ棤鐢╮ow鍙傛暟锛屽姞鏃ュ織璋冭瘯
- console.log('缁勭洏鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
- const selectedRows = this.$refs.table.getSelected();
+ // {
+ // name: '缁勭洏',
+ // type: 'primary',
+ // value: '缁勭洏',
+ // onClick: function () { // 淇1锛氱Щ闄ゆ棤鐢╮ow鍙傛暟锛屽姞鏃ュ織璋冭瘯
+ // console.log('缁勭洏鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
+ // const selectedRows = this.$refs.table.getSelected();
- // 鏍¢獙1锛氭槸鍚﹂�変腑琛�
- if (selectedRows.length === 0) {
- console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
- ElMessage.warning('璇烽�夋嫨涓�鏉″崟鎹�');
- return;
- }
- // 鏍¢獙2锛氭槸鍚﹂�変腑鍗曡
- if (selectedRows.length > 1) {
- console.log('鏍¢獙涓嶉�氳繃锛氶�変腑澶氳鍗曟嵁');
- ElMessage.warning('鍙兘閫夋嫨涓�鏉″崟鎹�');
- return;
- }
+ // // 鏍¢獙1锛氭槸鍚﹂�変腑琛�
+ // if (selectedRows.length === 0) {
+ // console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
+ // ElMessage.warning('璇烽�夋嫨涓�鏉″崟鎹�');
+ // return;
+ // }
+ // // 鏍¢獙2锛氭槸鍚﹂�変腑鍗曡
+ // if (selectedRows.length > 1) {
+ // console.log('鏍¢獙涓嶉�氳繃锛氶�変腑澶氳鍗曟嵁');
+ // ElMessage.warning('鍙兘閫夋嫨涓�鏉″崟鎹�');
+ // return;
+ // }
- const targetRow = selectedRows[0];
+ // const targetRow = selectedRows[0];
- this.$emit('openPalletDialog', targetRow.orderNo);
- }
- },
+ // this.$emit('openPalletDialog', targetRow.orderNo);
+ // }
+ // },
{
name: '鎾ら攢缁勭洏',
type: 'primary',
@@ -421,7 +422,18 @@
this.$refs.gridBody.open(row);
}
});
+
+ var GroupPalletBtn = this.buttons.find(x => x.value == "GroupPallet");
+ if (GroupPalletBtn != null) {
+ GroupPalletBtn.onClick = () => {
+ // console.log(this.$refs)
+ this.$refs.gridHeader.open();
+ }
+ }
+
+
},
+
onInited() {
//妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue"
new file mode 100644
index 0000000..d401f8b
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue"
@@ -0,0 +1,1124 @@
+<template>
+ <vol-box v-model="show" :title="'缁勭洏鎿嶄綔 - 鍗曟嵁鍙凤細' + orderNo" :height="1000" :width="1100" :padding="20" :modal="true">
+ <div class="barcode-scanner-container">
+
+ <!-- 浠撳簱閫夋嫨 - 绱у噾甯冨眬 -->
+ <div class="location-section compact">
+ <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
+ <el-form-item label="鍏ュ簱浠撳簱" prop="warehouseType" class="location-select compact-item">
+ <el-select v-model="form.warehouseType" placeholder="璇烽�夋嫨浠撳簱" clearable filterable
+ @change="handleWarehouseChange" style="width: 100%" :loading="warehouseLoading" size="medium">
+ <el-option v-for="item in warehouseTypes" :key="item.warehouseType" :label="item.warehouseTypeDesc"
+ :value="item.warehouseType" />
+ </el-select>
+ </el-form-item>
+ </el-form>
+ </div>
+
+ <!-- 浠撳簱鍖哄煙閫夋嫨 - 绱у噾甯冨眬 -->
+ <div class="location-section compact">
+ <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
+ <el-form-item label="浠撳簱鍖哄煙" prop="locationType" class="location-select compact-item">
+ <el-select v-model="form.locationType" placeholder="璇峰厛閫夋嫨浠撳簱" clearable filterable
+ @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium">
+ <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
+ :value="item.locationType" />
+ </el-select>
+ </el-form-item>
+ </el-form>
+ </div>
+
+ <!-- 鎵樼洏淇℃伅鏄剧ず - 绱у噾甯冨眬 -->
+ <div class="tray-info compact" v-if="trayBarcode">
+ <i class="el-icon-s-management"></i> 褰撳墠鏂欑: {{ trayBarcode }}
+ <span class="location-info" v-if="form.warehouseType">
+ | 浠撳簱: {{ currentWarehouseName }}
+ </span>
+ <span class="location-info" v-if="form.locationType">
+ | 浠撳簱鍖哄煙: {{ currentLocationDesc }}
+ </span>
+ </div>
+
+ <!-- 鎵爜鍖哄煙 - 绱у噾甯冨眬 -->
+ <div class="input-section compact">
+ <el-card shadow="hover" class="compact-card">
+ <div slot="header" class="compact-header">
+ <span><i class="el-icon-scanner"></i> 鎵爜鍖哄煙</span>
+ <span class="scan-status">
+ <span class="scan-indicator"></span>
+ {{ form.locationType && form.warehouseType ? '鎵爜灏辩华' : '璇峰厛閫夋嫨浠撳簱鍜屼粨搴撳尯鍩�' }}
+ </span>
+ </div>
+
+ <!-- 鎵樼洏鏉$爜杈撳叆 -->
+ <div class="input-wrapper custom-input-group compact-input">
+ <div class="input-label">鎵樼洏鏉$爜</div>
+ <el-input ref="trayInput" v-model="trayBarcode" placeholder="璇锋壂鎻忔垨杈撳叆鏂欑鐮佸悗鎸夊洖杞﹂敭" clearable
+ :disabled="!form.locationType || !form.warehouseType" @keyup.enter.native="handleTraySubmit"
+ @clear="handleTrayClear" @input="handleTrayInput" class="custom-input" size="medium">
+ <template slot="append">
+ <el-button @click="handleTraySubmit" type="primary" icon="el-icon-position"
+ :disabled="!form.locationType || !trayBarcode || !form.warehouseType" size="medium">
+ 纭
+ </el-button>
+ </template>
+ </el-input>
+ </div>
+
+ <!-- 鐗╂枡鏉$爜杈撳叆 -->
+ <div class="input-wrapper custom-input-group compact-input">
+ <div class="input-label">鐗╂枡鏉$爜</div>
+ <el-input ref="barcodeInput" v-model="barcode" placeholder="璇锋壂鎻忔垨杈撳叆鐗╂枡鏉$爜鍚庢寜鍥炶溅閿�" clearable
+ :disabled="!form.locationType || !trayBarcode || !form.warehouseType"
+ @keyup.enter.native="handleBarcodeSubmit" @clear="handleClear" @input="handleBarcodeInput"
+ class="custom-input" size="medium">
+ <template slot="append">
+ <el-button :loading="loading" @click="handleBarcodeSubmit" type="primary" icon="el-icon-search"
+ :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium">
+ {{ loading ? '鏌ヨ涓�...' : '鏌ヨ' }}
+ </el-button>
+ </template>
+ </el-input>
+ </div>
+
+ <div class="input-tips compact-tips">
+ <p>鎻愮ず锛氳鍏堥�夋嫨浠撳簱 鈫� 閫夋嫨浠撳簱鍖哄煙 鈫� 杈撳叆鏂欑鐮� 鈫� 杈撳叆鐗╂枡鏉$爜</p>
+ <p v-if="!form.warehouseType" class="warning-text">鈿狅笍 璇峰厛閫夋嫨浠撳簱</p>
+ <p v-if="!form.locationType && !form.warehouseType" class="warning-text">鈿狅笍 璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+ <p v-if="form.warehouseType && form.locationType && !trayBarcode" class="warning-text">鈿狅笍 璇峰厛杈撳叆鏂欑鐮�</p>
+ </div>
+
+ </el-card>
+ </div>
+
+ <!-- 鍔犺浇鐘舵�� -->
+ <div v-if="loading" class="loading compact">
+ <el-progress :percentage="100" status="success" :show-text="false" />
+ <p>姝e湪鏌ヨ鐗╂枡淇℃伅...</p>
+ </div>
+
+ <!-- 閿欒鎻愮ず -->
+ <div v-if="error" class="error-message compact">
+ <el-alert :title="error" type="error" show-icon closable @close="error = ''" />
+ </div>
+
+ <!-- 鏈粍鐩樺垪琛� -->
+ <div class="unpallet-section compact">
+ <el-card shadow="hover" class="compact-card unpallet-card">
+ <div slot="header" class="compact-header">
+ <span><i class="el-icon-tickets"></i> 鏈粍鐩樻潯鐮�</span>
+ <span class="list-actions">
+ <el-tag type="primary" size="small">鏈粍鐩� {{ totalStockCount }}</el-tag>
+ </span>
+ </div>
+
+
+ <div class="table-container">
+ <el-table :data="unpalletMaterials" stripe style="width: 100%" height="100%" size="small"
+ v-loading="unpalletBarcodesLoading">
+ <el-table-column type="index" label="搴忓彿" width="60" align="center"></el-table-column>
+ <el-table-column prop="barcode" label="鏉$爜" min-width="140" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" min-width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="batchNo" label="鎵规" min-width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="orderQuantity" label="鏁伴噺" min-width="130" align="right"></el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅" width="80" align="center"></el-table-column>
+ <el-table-column prop="supplyCode" label="渚涘簲鍟�" min-width="130" show-overflow-tooltip></el-table-column>
+ </el-table>
+ </div>
+ </el-card>
+
+ </div>
+
+ <!-- 鐗╂枡鍒楄〃 - 鍥哄畾楂樺害甯︽粴鍔ㄦ潯 -->
+ <div class="material-list compact">
+ <el-card shadow="hover" class="compact-card">
+ <div slot="header" class="compact-header">
+ <span><i class="el-icon-tickets"></i> 缁勭洏鏁版嵁</span>
+ <span class="list-actions">
+ <el-tag type="primary" size="small">鍏� {{ materials.length }} 鏉�</el-tag>
+ <el-tag type="primary" size="small">鏈叆搴撴暟閲� {{ totalStockSum }}{{ uniqueUnit }}</el-tag>
+ <el-tag v-if="trayBarcode" type="success" size="small">鎵樼洏: {{ trayBarcode }}</el-tag>
+ <el-tag v-if="form.warehouseType" type="info" size="small">浠撳簱: {{ currentWarehouseName }}</el-tag>
+ <el-tag v-if="form.locationType" type="info" size="small">鍖哄煙: {{ currentLocationDesc }}</el-tag>
+ </span>
+ </div>
+
+ <div v-if="materials.length === 0" class="empty-state compact">
+ <i class="el-icon-document"></i>
+ <p v-if="!form.warehouseType">璇峰厛閫夋嫨浠撳簱</p>
+ <p v-if="!form.locationType">璇峰厛閫夋嫨浠撳簱鍖哄煙</p>
+ <p v-else-if="!trayBarcode">璇峰厛杈撳叆鏂欑鏉$爜</p>
+ <p v-else>鏆傛棤鐗╂枡鏁版嵁锛岃鎵弿鎴栬緭鍏ョ墿鏂欐潯鐮�</p>
+ </div>
+
+ <div class="table-container" v-else>
+ <el-table :data="materials" stripe style="width: 100%" height="100%" size="small">
+ <el-table-column type="index" label="搴忓彿" width="60" align="center"></el-table-column>
+ <el-table-column prop="barcode" label="鏉$爜" min-width="140" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" min-width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="batchNo" label="鎵规" min-width="150" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="stockQuantity" label="鏁伴噺" min-width="130" align="right"></el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅" width="80" align="center"></el-table-column>
+ <el-table-column prop="supplyCode" label="渚涘簲鍟�" min-width="130" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="warehouseType" label="浠撳簱" min-width="120" show-overflow-tooltip></el-table-column>
+ </el-table>
+ </div>
+ </el-card>
+ </div>
+ </div>
+ <template #footer>
+ <el-button type="danger" size="small" @click="handleDialogClose()">鍏抽棴</el-button>
+ </template>
+ </vol-box>
+</template>
+<script>
+import http from '@/api/http.js';
+import VolBox from '@/components/basic/VolBox.vue';
+
+export default {
+ components: { VolBox },
+ data() {
+ return {
+ show: false,
+ orderNo: "",
+ palletVisible: this.visible,
+ trayBarcodeReg: /^[A-Z]\d{9}$/,
+ trayBarcode: '',
+ barcode: '',
+ materials: [],
+ loading: false,
+ error: '',
+ debugMode: false,
+ currentFocus: 'warehouse',
+
+ unpalletBarcodes: [],
+ unpalletBarcodesLoading: false,
+ unpalletMaterials: [], // 鏈粍鐩樿缁嗘暟鎹垪琛�
+
+ // 鎵爜鏋浉鍏冲彉閲�
+ scanCode: '',
+ lastKeyTime: null,
+ isManualInput: false,
+ isScanning: false,
+ scanTimer: null,
+ manualInputTimer: null,
+ scanTarget: 'tray', // 褰撳墠鎵爜鐩爣: tray 鎴� material
+
+ // 搴撳瓨缁熻鐩稿叧鍙橀噺
+ totalStockSum: 0,
+ totalStockCount: 0,
+ uniqueUnit: '',
+ sumLoading: false,
+ sumError: '',
+ // 浠撳簱鐩稿叧鍙橀噺
+ warehouseTypes: [],
+ warehouseLoading: false,
+ // 浠撳簱鍖哄煙鐩稿叧鍙橀噺
+ locationTypes: [],
+ locationLoading: false,
+ form: {
+ warehouseType: null,
+ locationType: null
+ },
+ rules: {
+ locationType: [
+ {
+ validator: this.validateLocationType,
+ trigger: 'change'
+ }
+ ],
+ trayBarcode: [
+ {
+ pattern: this.trayBarcodeReg,
+ message: '鎵樼洏鍙锋牸寮忛敊璇紙闇�涓�1涓ぇ鍐欏瓧姣�+9涓暟瀛楋紝濡侫000008024锛�',
+ trigger: 'blur'
+ }
+ ],
+ warehouseType: [
+ {
+ message: '璇烽�夋嫨浠撳簱',
+ trigger: 'change'
+ }
+ ]
+ }
+ }
+ },
+
+ computed: {
+ // 褰撳墠閫夋嫨鐨勪粨搴撳悕绉�
+ currentWarehouseName() {
+ const warehouse = this.warehouseTypes.find(item => item.warehouseType === this.form.warehouseType);
+ return warehouse ? warehouse.warehouseTypeDesc : '';
+ },
+ // 褰撳墠閫夋嫨鐨勪粨搴撳尯鍩熸弿杩�
+ currentLocationDesc() {
+ const location = this.locationTypes.find(item => item.locationType === this.form.locationType)
+ return location ? location.locationTypeDesc : ''
+ }
+ },
+ watch: {
+ visible(newVal, oldVal) {
+ this.palletVisible = newVal;
+
+ // 褰撲粠 false 鍙樹负 true 鏃讹紝琛ㄧず寮规鎵撳紑
+ if (newVal === true && oldVal === false) {
+ console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+ this.resetData();
+ this.$nextTick(() => {
+ setTimeout(() => {
+ this.fetchUnpalletMaterialDetails();
+ }, 300);
+ });
+ }
+
+ // 褰撲粠 true 鍙樹负 false 鏃讹紝琛ㄧず寮规鍏抽棴
+ if (newVal === false && oldVal === true) {
+ console.log('寮规鍏抽棴锛岄噸缃暟鎹�');
+ this.resetData();
+ }
+ },
+ palletVisible(newVal) {
+ this.$emit('update:visible', newVal);
+ },
+ docNo(newVal) {
+ if (newVal) {
+ this.palletForm = { palletCode: '', barcode: '' };
+ this.backData = [];
+ this.$refs.palletForm?.reset();
+ this.fetchUnpalletMaterialDetails();
+ }
+ }
+ },
+ mounted() {
+ document.addEventListener('keypress', this.handleKeyPress);
+ },
+ beforeDestroy() {
+ document.removeEventListener('keypress', this.handleKeyPress);
+ this.clearAllTimers();
+ },
+ methods: {
+ open() {
+ this.show = true;
+ this.orderNo = "";
+ this.resetData();
+ this.initLocationTypes();
+ this.initwarehouseTypes();
+ this.fetchUnpalletMaterialDetails();
+ },
+ validateLocationType(rule, value, callback) {
+ if (!this.form.warehouseType) {
+ callback(new Error('璇峰厛閫夋嫨浠撳簱'));
+ } else if (value === null || value === undefined || value === '') {
+ callback(new Error('璇烽�夋嫨浠撳簱鍖哄煙'));
+ } else {
+ callback();
+ }
+ },
+
+ // 鏍规嵁鏉$爜鍒楄〃鑾峰彇璇︾粏鏁版嵁
+ async fetchUnpalletMaterialDetails() {
+ try {
+ const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo=' + this.orderNo, {});
+ if (response.status && Array.isArray(response.data)) {
+ this.unpalletMaterials = response.data;
+ this.unpalletBarcodes = response.data.map(item => item.barcode || '');
+ this.totalStockCount = response.data.length;
+ } else {
+ this.unpalletMaterials = [];
+ }
+ } catch (err) {
+ this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({
+ barcode: barcode,
+ materielCode: '-',
+ batchNo: '-',
+ stockQuantity: '-',
+ unit: '-',
+ supplyCode: '-',
+ warehouseType: '-'
+ }));
+ }
+ },
+ async initLocationTypes() {
+ try {
+ const { data } = await this.http.post("api/LocationInfo/GetLocationTypes")
+ this.locationTypes = data
+ } catch (e) {
+ this.$message.error('鑾峰彇鍖哄煙绫诲瀷澶辫触')
+ }
+ },
+ async initwarehouseTypes() {
+ try {
+ const { data } = await this.http.post("api/Warehouse/GetwarehouseTypes")
+ this.warehouseTypes = data
+ } catch (e) {
+ this.$message.error('鑾峰彇鍖哄煙绫诲瀷澶辫触')
+ }
+ },
+
+ async fetchStockStatistics(orderNo) {
+ // 鍗曟嵁鍙蜂负绌烘椂涓嶆煡璇�
+ if (!orderNo) {
+ this.sumError = '鍗曟嵁鍙蜂负绌猴紝鏃犳硶缁熻';
+ return;
+ }
+
+ this.sumLoading = true;
+ this.sumError = '';
+ try {
+ const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo=' + orderNo, {});
+ if (response.data) {
+ this.totalStockSum = response.data.stockSumQuantity || 0;
+ this.totalStockCount = response.data.stockCount || 0;
+ this.uniqueUnit = response.data.uniqueUnit || '';
+ }
+ } catch (err) {
+ this.sumError = '缁熻鍔犺浇澶辫触';
+ this.totalStockSum = 0;
+ this.totalStockCount = 0;
+ } finally {
+ this.sumLoading = false;
+ }
+ },
+
+ async validateForm() {
+ return new Promise((resolve) => {
+ if (!this.$refs.locationForm) {
+ this.error = '琛ㄥ崟鏈垵濮嬪寲';
+ this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+ resolve(false);
+ return;
+ }
+
+ this.$refs.locationForm.validate((valid) => {
+ if (valid) {
+ this.error = '';
+ resolve(true);
+ } else {
+ if (!this.from.warehouseType) {
+ this.error = '璇峰厛閫夋嫨浠撳簱';
+ }
+ else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
+ this.error = '璇峰厛閫夋嫨浠撳簱鍖哄煙';
+ } else {
+ this.error = '璇锋鏌ヨ〃鍗曞~鍐欐槸鍚︽纭�';
+ }
+ resolve(false);
+ }
+ });
+ });
+ },
+ // 鑱氱劍鍒版墭鐩樿緭鍏ユ
+ focusTrayInput() {
+ if (this.$refs.trayInput && this.$refs.trayInput.$el) {
+ const inputEl = this.$refs.trayInput.$el.querySelector('input');
+ if (inputEl) {
+ inputEl.focus();
+ this.currentFocus = 'tray';
+ this.scanTarget = 'tray';
+ inputEl.select();
+ }
+ }
+ },
+
+ // 鑱氱劍鍒扮墿鏂欒緭鍏ユ
+ focusBarcodeInput() {
+ if (this.$refs.barcodeInput && this.$refs.barcodeInput.$el) {
+ const inputEl = this.$refs.barcodeInput.$el.querySelector('input');
+ if (inputEl) {
+ inputEl.focus();
+ this.currentFocus = 'material';
+ this.scanTarget = 'material';
+ inputEl.select();
+ }
+ }
+ },
+ // 閲嶇疆鎵�鏈夋暟鎹�
+ resetData() {
+ this.trayBarcode = '';
+ this.barcode = '';
+ this.materials = [];
+ this.unpalletBarcodes = [];
+ this.unpalletMaterials = [];
+ this.loading = false;
+ this.error = '';
+ this.scanCode = '';
+ this.lastKeyTime = null;
+ this.isManualInput = false;
+ this.isScanning = false;
+ this.currentFocus = 'warehouse';
+ this.scanTarget = 'tray';
+ this.clearAllTimers();
+ this.totalStockSum = 0;
+ this.totalStockCount = 0;
+ this.sumLoading = false;
+ this.sumError = '';
+ this.form = {
+ warehouseType: null,
+ locationType: null
+ }
+ this.warehouseTypes = [];
+ this.locationTypes = [];
+ // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
+ this.$nextTick(() => {
+ if (this.$refs.locationForm) {
+ this.$refs.locationForm.clearValidate();
+ }
+ });
+ },
+
+ // 娓呴櫎鎵�鏈夎鏃跺櫒
+ clearAllTimers() {
+ if (this.manualInputTimer) {
+ clearTimeout(this.manualInputTimer);
+ this.manualInputTimer = null;
+ }
+ if (this.scanTimer) {
+ clearTimeout(this.scanTimer);
+ this.scanTimer = null;
+ }
+ },
+ handleDialogClose() {
+ this.show = false;
+ this.resetData();
+ },
+
+ // 纭鎸夐挳
+ async handleConfirm() {
+ if (!await this.validateForm()) return;
+
+ if (this.materials.length === 0) {
+ this.$message.warning('璇疯嚦灏戞坊鍔犱竴涓墿鏂�');
+ return;
+ }
+
+ if (!this.trayBarcode) {
+ this.$message.warning('璇疯緭鍏ユ墭鐩樻潯鐮�');
+ return;
+ }
+
+ const result = {
+ warehouseType: this.form.warehouseType,
+ warehouseName: this.currentWarehouseName,
+ locationType: this.form.locationType,
+ locationDesc: this.currentLocationDesc,
+ trayBarcode: this.trayBarcode,
+ materials: this.materials,
+ docNo: this.docNo
+ };
+
+ // 瑙﹀彂鐖剁粍浠剁殑 back-success 浜嬩欢
+ this.$emit('back-success', result);
+ this.palletVisible = false;
+ },
+ // 澶勭悊鎵樼洏杈撳叆
+ handleTrayInput() {
+ // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+ this.isManualInput = true;
+ this.isScanning = false;
+
+ // 娓呴櫎涔嬪墠鐨勮鏃跺櫒
+ if (this.manualInputTimer) {
+ clearTimeout(this.manualInputTimer);
+ }
+
+ // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆涓烘壂鐮佹ā寮�
+ this.manualInputTimer = setTimeout(() => {
+ this.isManualInput = false;
+ }, 1000);
+ },
+
+ // 澶勭悊鐗╂枡杈撳叆
+ handleBarcodeInput() {
+ // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
+ this.isManualInput = true;
+ this.isScanning = false;
+
+ // 娓呴櫎涔嬪墠鐨勮鏃跺櫒
+ if (this.manualInputTimer) {
+ clearTimeout(this.manualInputTimer);
+ }
+
+ // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆涓烘壂鐮佹ā寮�
+ this.manualInputTimer = setTimeout(() => {
+ this.isManualInput = false;
+ }, 1000);
+ },
+
+ // 澶勭悊鎵樼洏鏉$爜鎻愪氦
+ async handleTraySubmit() {
+ // 鍏堢洿鎺ユ鏌ocationType锛岄伩鍏嶈〃鍗曢獙璇佺殑寮傛闂
+ if (!this.form.warehouseType) {
+ this.error = '璇峰厛閫夋嫨浠撳簱';
+ return;
+ }
+ if (!this.form.locationType) {
+ this.error = '璇峰厛閫夋嫨浠撳簱鍖哄煙';
+ //this.$message.warning('璇峰厛閫夋嫨浠撳簱鍖哄煙');
+ return;
+ }
+
+ // 鐒跺悗鍐嶈繘琛屽畬鏁寸殑琛ㄥ崟楠岃瘉
+ if (!await this.validateForm()) return;
+
+ const currentTrayBarcode = this.trayBarcode.trim();
+
+ if (!currentTrayBarcode) {
+ this.error = '璇疯緭鍏ユ垨鎵弿鎵樼洏鏉$爜';
+ return;
+ }
+
+ this.error = '';
+
+ if (!this.trayBarcodeReg.test(currentTrayBarcode)) {
+ // ElMessage.warning({
+ // message: '鎵樼洏鍙锋牸寮忛敊璇�',
+ // type: 'warning',
+ // duration: 3000
+ // })
+ this.$message("鎵樼洏鍙锋牸寮忛敊璇�");
+ this.focusTrayInput();
+ return;
+ }
+
+ // 璁剧疆鎵樼洏鏉$爜鍚庯紝鑷姩鑱氱劍鍒扮墿鏂欒緭鍏ユ
+ this.focusBarcodeInput();
+
+ // this.$message({
+ // message: `鎵樼洏鏉$爜宸茶缃�: ${currentTrayBarcode}`,
+ // type: 'success',
+ // duration: 2000
+ // });
+ this.$message.success(`鎵樼洏鏉$爜宸茶缃�: ${currentTrayBarcode}`);
+ },
+
+ // 娓呴櫎鎵樼洏
+ clearTray() {
+ this.trayBarcode = '';
+ this.materials = [];
+ this.focusTrayInput();
+ this.$message({
+ message: '鎵樼洏鏉$爜宸叉竻闄�',
+ type: 'info',
+ duration: 2000
+ });
+ },
+
+ // 娓呯┖鎵樼洏杈撳叆
+ handleTrayClear() {
+ this.error = '';
+ },
+
+ // 娓呯┖杈撳叆
+ handleClear() {
+ this.error = '';
+ this.scanCode = '';
+ this.isManualInput = false;
+ this.isScanning = false;
+ },
+
+
+ // 澶勭悊鐗╂枡鏉$爜鎻愪氦
+ async handleBarcodeSubmit() {
+ if (!await this.validateForm()) return;
+ const currentBarcode = this.barcode.trim();
+
+ if (!this.trayBarcode) {
+ this.error = '璇峰厛杈撳叆鎵樼洏鏉$爜';
+ this.focusTrayInput();
+ return;
+ }
+
+ if (!currentBarcode) {
+ this.error = '璇疯緭鍏ユ垨鎵弿鐗╂枡鏉$爜';
+ return;
+ }
+
+ this.focusBarcodeInput();
+ this.error = '';
+ this.loading = true;
+
+ try {
+ // 璋冪敤API鏌ヨ鐗╂枡淇℃伅
+ const materialData = await this.fetchMaterialData(currentBarcode);
+ if (!materialData || materialData.length === 0) {
+ return;
+ }
+
+ this.materials = [];
+ materialData.forEach(item => {
+ this.materials.push({
+ ...item,
+ trayCode: this.trayBarcode,
+ locationType: this.form.locationType,
+ locationDesc: this.currentLocationDesc,
+ scanTime: this.formatTime(new Date())
+ });
+ });
+ this.orderNo = materialData[0].orderNo;
+ await this.fetchStockStatistics(materialData[0].orderNo);
+ await this.fetchUnpalletMaterialDetails();
+ // 娓呯┖鐗╂枡杈撳叆妗嗗苟淇濇寔鑱氱劍
+ this.barcode = '';
+ this.scanCode = ''; // 娓呯┖鎵爜缂撳瓨
+ this.isScanning = false;
+
+ setTimeout(() => {
+ this.focusBarcodeInput();
+ }, 100);
+ } catch (err) {
+ this.error = err.message || '鏌ヨ鏉$爜淇℃伅澶辫触锛岃閲嶈瘯';
+ this.focusBarcodeInput();
+ setTimeout(() => {
+ // 閫変腑杈撳叆妗嗗唴鐨勯敊璇唴瀹癸紙纭繚focus瀹屾垚鍚庢墽琛岋級
+ const inputEl = this.$refs.barcodeInput?.$el?.querySelector('input');
+ if (inputEl) inputEl.select();
+ }, 100);
+ } finally {
+ this.loading = false;
+ }
+ },
+
+ // API璇锋眰 - 鏇挎崲涓哄疄闄呯殑API璋冪敤
+ async fetchMaterialData(barcode) {
+ try {
+ const response = await http.post('/api/Inbound/GroupPallet',
+ {
+ palletCode: this.trayBarcode,
+ barcode: barcode,
+ locationTypeDesc: this.currentLocationDesc,
+ locationType: this.form.locationType, // 娣诲姞浠撳簱鍖哄煙淇℃伅
+ warehouseType: this.form.warehouseType
+ }
+ );
+ let materialData;
+
+ if (typeof response.data === 'string') {
+
+ try {
+ materialData = JSON.parse(response.data);
+ } catch (e) {
+
+ }
+ } else {
+ materialData = response.data;
+ }
+ if (!response.status) {
+ this.error = response.message || '鏌ヨ鏉$爜淇℃伅澶辫触锛岃閲嶈瘯';
+ }
+
+ return materialData;
+
+ } catch (error) {
+ console.error('API璋冪敤澶辫触:', error);
+ }
+ },
+
+ // 澶勭悊鎵爜鏋緭鍏�
+ handleKeyPress(event) {
+ // 濡傛灉鏄墜鍔ㄨ緭鍏ユā寮忥紝涓嶅鐞嗘壂鐮佹灙閫昏緫
+ if (this.isManualInput) {
+ return;
+ }
+
+ const key = event.key;
+ const currentTime = new Date().getTime();
+
+ // 蹇界暐鐩存帴鎸変笅鐨勫洖杞﹂敭锛堢敱handleBarcodeSubmit澶勭悊锛�
+ if (key === 'Enter') {
+ if (this.scanCode.length > 0) {
+ // 闃绘榛樿鍥炶溅琛屼负锛岄伩鍏嶈〃鍗曟彁浜�
+ event.preventDefault();
+
+ // 鎵爜瀹屾垚锛岃嚜鍔ㄨЕ鍙戞煡璇�
+ this.isScanning = false;
+
+ // 鏍规嵁褰撳墠鎵爜鐩爣璁剧疆鐩稿簲鐨勮緭鍏ユ鍊�
+ if (this.scanTarget === 'tray') {
+ this.trayBarcode = this.scanCode;
+ this.handleTraySubmit();
+ } else if (this.scanTarget === 'material') {
+ this.barcode = this.scanCode;
+ this.handleBarcodeSubmit();
+ }
+ }
+ this.scanCode = '';
+ this.lastKeyTime = null;
+ return;
+ }
+
+ // 鏋勫缓鎵爜鍐呭锛堝揩閫熻繛缁緭鍏ヨ涓烘壂鐮侊級
+ if (this.lastKeyTime && currentTime - this.lastKeyTime < 50) {
+ this.scanCode += key;
+ this.isScanning = true;
+ } else {
+ this.scanCode = key;
+ this.isScanning = true;
+ }
+
+ // 璁剧疆璁℃椂鍣紝濡傛灉涓�娈垫椂闂村唴娌℃湁杈撳叆锛屽垯閲嶇疆鎵弿鐘舵��
+ if (this.scanTimer) {
+ clearTimeout(this.scanTimer);
+ }
+ this.scanTimer = setTimeout(() => {
+ this.isScanning = false;
+ }, 100);
+
+ this.lastKeyTime = currentTime;
+ },
+
+ // 鏍煎紡鍖栨椂闂�
+ formatTime(date) {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ const hours = String(date.getHours()).padStart(2, '0');
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+ const seconds = String(date.getSeconds()).padStart(2, '0');
+
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+ }
+ }
+}
+</script>
+
+<style scoped>
+.barcode-scanner-container {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 10px;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ gap: 8px;
+}
+
+/* 绱у噾甯冨眬鏍峰紡 */
+.compact {
+ margin-bottom: 0;
+}
+
+.compact-form {
+ margin-bottom: 0;
+}
+
+.compact-item {
+ margin-bottom: 0;
+}
+
+.compact-card {
+ margin-bottom: 0;
+}
+
+.compact-card>>>.el-card__body {
+ padding: 12px;
+}
+
+.compact-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 !important;
+}
+
+.compact-header>>>.el-card__header {
+ padding: 8px 12px;
+}
+
+.compact-input {
+ margin: 8px 0;
+}
+
+.compact-tips {
+ margin-top: 8px;
+ font-size: 11px;
+}
+
+/* 浠撳簱鍖哄煙閫夋嫨 - 绱у噾 */
+.location-section.compact {
+ margin-bottom: 8px;
+}
+
+.location-section.compact>>>.el-form-item {
+ margin-bottom: 0;
+}
+
+/* 鎵樼洏淇℃伅 - 绱у噾 */
+.tray-info.compact {
+ padding: 6px 10px;
+ margin-bottom: 8px;
+ font-size: 13px;
+}
+
+/* 鎵爜鍖哄煙 - 绱у噾 */
+.input-section.compact {
+ margin-bottom: 8px;
+ flex-shrink: 0;
+}
+
+/* 鐗╂枡鍒楄〃 - 鍥哄畾楂樺害甯︽粴鍔� */
+.material-list.compact {
+ flex: 1;
+ min-height: 0;
+ /* 閲嶈锛氬厑璁竑lex瀛愰」鏀剁缉 */
+ display: flex;
+ flex-direction: column;
+}
+
+.material-list.compact>>>.el-card {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+
+.material-list.compact>>>.el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ padding: 0;
+ min-height: 0;
+}
+
+.table-container {
+ flex: 1;
+ min-height: 0;
+ overflow: hidden;
+}
+
+.material-list.compact>>>.el-table {
+ flex: 1;
+}
+
+.material-list.compact>>>.el-table__body-wrapper {
+ overflow-y: auto;
+}
+
+/* 绱у噾鐨勭┖鐘舵�� */
+.empty-state.compact {
+ padding: 20px 0;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.empty-state.compact i {
+ font-size: 36px;
+ margin-bottom: 8px;
+}
+
+.empty-state.compact p {
+ font-size: 13px;
+}
+
+/* 鍏朵粬鍘熸湁鏍峰紡璋冩暣 */
+.page-title {
+ text-align: center;
+ margin-bottom: 15px;
+}
+
+.scan-status {
+ font-size: 12px;
+ color: #67C23A;
+}
+
+.scan-indicator {
+ display: inline-block;
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background-color: #67C23A;
+ margin-right: 5px;
+ animation: pulse 1.5s infinite;
+}
+
+@keyframes pulse {
+ 0% {
+ opacity: 1;
+ }
+
+ 50% {
+ opacity: 0.4;
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
+
+.input-wrapper {
+ position: relative;
+}
+
+.input-tips {
+ margin-top: 6px;
+ color: #909399;
+}
+
+.warning-text {
+ color: #E6A23C;
+ font-weight: bold;
+}
+
+.loading.compact {
+ text-align: center;
+ margin: 10px 0;
+ padding: 5px;
+}
+
+.loading.compact p {
+ margin-top: 5px;
+ color: #409EFF;
+ font-size: 12px;
+}
+
+.error-message.compact {
+ margin: 5px 0;
+}
+
+.error-message.compact>>>.el-alert {
+ padding: 6px 12px;
+}
+
+.list-actions {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+}
+
+.list-actions>>>.el-tag {
+ height: 24px;
+ line-height: 22px;
+ padding: 0 6px;
+}
+
+.clear-all-btn {
+ margin-left: 8px;
+}
+
+.material-code {
+ font-family: 'Courier New', monospace;
+ font-weight: bold;
+ color: #409EFF;
+}
+
+.location-info {
+ color: #606266;
+ font-weight: normal;
+}
+
+.debug-info {
+ background: #f5f7fa;
+ padding: 8px;
+ border-radius: 4px;
+ margin-top: 8px;
+ font-size: 11px;
+ color: #909399;
+}
+
+.small-button {
+ padding: 6px 8px;
+ font-size: 11px;
+}
+
+/* 杈撳叆妗嗙粍鏍峰紡璋冩暣 */
+.custom-input-group {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ margin: 8px 0;
+ border: 1px solid #DCDFE6;
+ border-radius: 4px;
+ overflow: hidden;
+ background: #fff;
+}
+
+.input-label {
+ padding: 0 12px;
+ background: #F5F7FA;
+ border-right: 1px solid #DCDFE6;
+ color: #606266;
+ font-size: 13px;
+ white-space: nowrap;
+ height: 36px;
+ line-height: 36px;
+ flex-shrink: 0;
+ min-width: 70px;
+ text-align: center;
+}
+
+.input-container {
+ display: flex;
+ flex: 1;
+ align-items: center;
+}
+
+.custom-input {
+ flex: 1;
+}
+
+.custom-input>>>.el-input__inner {
+ border: none;
+ border-radius: 0;
+ height: 36px;
+ line-height: 36px;
+ font-size: 13px;
+}
+
+/* 鍝嶅簲寮忚皟鏁� */
+@media (max-width: 768px) {
+ .barcode-scanner-container {
+ padding: 5px;
+ }
+
+ .custom-input-group {
+ flex-direction: column;
+ border: none;
+ }
+
+ .input-label {
+ width: 100%;
+ border-right: none;
+ border-bottom: 1px solid #DCDFE6;
+ margin-bottom: 5px;
+ }
+
+ .input-container {
+ width: 100%;
+ border: 1px solid #DCDFE6;
+ border-radius: 4px;
+ }
+
+ .unpallet-section.compact {
+ margin-bottom: 8px;
+ flex-shrink: 0;
+ }
+
+ .unpallet-card {
+ flex-shrink: 0;
+ }
+
+ .unpallet-barcode-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6px;
+ padding: 8px 0;
+ max-height: 180px;
+ overflow-y: auto;
+ }
+
+ .unpallet-barcode-list>>>.el-tag {
+ cursor: pointer;
+ max-width: calc(33.333% - 4px);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ @media (max-width: 768px) {
+ .unpallet-barcode-list>>>.el-tag {
+ max-width: calc(50% - 4px);
+ }
+ }
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
index 6c0819e..1bdbfaf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
@@ -1,12 +1,6 @@
<template>
- <div>
- <vol-box
- v-model="showDetialBox"
- :lazy="true"
- width="75%"
- height="80%"
- title="鍗曟嵁鏄庣粏淇℃伅"
- >
+ <div>
+ <vol-box v-model="showDetialBox" :lazy="true" width="75%" :padding="15" title="鍗曟嵁鏄庣粏淇℃伅">
<div class="box-head">
<el-alert :closable="false" style="width: 100%">
<el-row>
@@ -14,84 +8,44 @@
<span>宸查�変腑 {{ selection.length }} 椤�</span>
</el-col>
<el-col :span="8">
- <!-- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px"
- @click="lockstocks"
- >閿佸畾搴撳瓨</el-link> -->
-
- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px"
- @click="handleOpenPicking"
- >鎷i��</el-link>
-
- <!-- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px; margin-right: 10px"
- @click="outbound"
- >鐩存帴鍑哄簱</el-link
- > -->
- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px; margin-right: 10px"
- @click="getData"
- >鍒锋柊</el-link
- ></el-col
- >
+ <el-link type="primary" size="small" v-if="isBatch === 0" style="float: right; height: 20px"
+ @click="handleOpenPicking">鎷i��</el-link>
+ <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px"
+ v-if="isBatch === 1" @click="handleOpenBatchPicking">鍒嗘壒鎷i��</el-link>
+ <el-link type="primary" size="small" v-if="isBatch === 0"
+ style="float: right; height: 20px; margin-right: 10px" @click="outbound">鐩存帴鍑哄簱</el-link>
+ <el-link type="primary" size="small" v-if="isBatch === 1"
+ style="float: right; height: 20px; margin-right: 10px" @click="outboundbatch">鍒嗘壒鍑哄簱</el-link>
+ <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px"
+ @click="getData">鍒锋柊</el-link>
+ </el-col>
</el-row>
</el-alert>
</div>
<div class="box-table" style="margin-top: 1%">
- <el-table
- ref="singleTable"
- :data="tableData"
- style="width: 100%; height: 100%"
- highlight-current-row
- @current-change="handleCurrentChange"
- height="500px"
- @row-click="handleRowClick"
- @selection-change="handleSelectionChange"
- >
+ <el-table ref="singleTable" :data="tableData" style="width: 100%; height: 100%" highlight-current-row
+ @current-change="handleCurrentChange" height="500px" @row-click="handleRowClick"
+ @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"> </el-table-column>
- <el-table-column
- label="搴忓彿"
- type="index"
- fixed="left"
- width="55"
- align="center"
- ></el-table-column>
- <el-table-column
- v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
- :key="index"
- :prop="item.prop"
- :label="item.title"
- :width="item.width"
- align="center"
- >
+ <el-table-column label="搴忓彿" type="index" fixed="left" width="55" align="center"></el-table-column>
+ <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" :prop="item.prop"
+ :label="item.title" :width="item.width" align="center">
<template #default="scoped">
<div v-if="item.type == 'icon'">
- <el-tooltip
- class="item"
- effect="dark"
- :content="item.title"
- placement="bottom"
- ><el-link
- type="primary"
- :disabled="getButtonEnable(item.prop, scoped.row)"
- @click="tableButtonClick(scoped.row, item)"
- ><i :class="item.icon" style="font-size: 22px"></i></el-link
- ></el-tooltip>
+ <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom">
+ <el-link type="primary" :disabled="getButtonEnable(item.prop, scoped.row)"
+ @click="tableButtonClick(scoped.row, item)">
+ <i :class="item.icon" style="font-size: 22px"></i>
+ </el-link>
+ </el-tooltip>
</div>
-
<div v-else-if="item.type == 'tag'">
<el-tag size="small">
{{ getDictionary(scoped.row, item) }}
</el-tag>
+ </div>
+ <div v-else>
+ {{ scoped.row[item.prop] }}
</div>
</template>
</el-table-column>
@@ -99,30 +53,39 @@
</div>
</vol-box>
<stock-select ref="child" @parentCall="parentCall"></stock-select>
- <selected-stock
- ref="selectedStock"
- @parentCall="parentCall"
- ></selected-stock>
+ <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock>
</div>
</template>
+
<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
-import StockSelect from "./AllocateStockSelect.vue";
+import StockSelect from "./StockSelect.vue";
import SelectedStock from "./SelectedStock.vue";
-import { h,createVNode, render,reactive } from 'vue';
-import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElMessage } from 'element-plus';
-import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
+import { h, createVNode, render, reactive } from "vue";
+import {
+ ElDialog,
+ ElForm,
+ ElFormItem,
+ ElSelect,
+ ElOption,
+ ElButton,
+ ElInput,
+ ElMessage,
+} from "element-plus";
+
export default {
components: { VolBox, VolForm, StockSelect, SelectedStock },
data() {
return {
row: null,
+ isBatch: 0,
showDetialBox: false,
flag: false,
currentRow: null,
selection: [],
tableData: [],
+ mainBusinessType: null, // 鏂板锛氬瓨鍌ㄤ富鍗曟嵁鐨刡usinessType
tableColumns: [
{
prop: "id",
@@ -142,7 +105,7 @@
prop: "materielCode",
title: "鐗╂枡缂栧彿",
type: "string",
- width: 150,
+ width: 120,
},
{
prop: "materielName",
@@ -160,7 +123,7 @@
prop: "supplyCode",
title: "渚涘簲鍟嗙紪鍙�",
type: "string",
- width: 150,
+ width: 90,
},
{
prop: "orderQuantity",
@@ -181,25 +144,25 @@
width: 90,
},
{
+ prop: "moveQty",
+ title: "鎸枡鏁伴噺",
+ type: "string",
+ width: 90,
+ },
+ {
prop: "unit",
title: "鍗曚綅",
type: "string",
- width: 90,
+ width: 80,
},
{
prop: "orderDetailStatus",
title: "璁㈠崟鏄庣粏鐘舵��",
type: "tag",
- width: 180,
+ width: 90,
bindKey: "orderDetailStatusEnum",
},
- {
- prop: "assignStock",
- title: "鎸囧畾搴撳瓨",
- type: "icon",
- width: 90,
- icon: "el-icon-s-grid",
- },
+
{
prop: "viewDetail",
title: "鍑哄簱璇︾粏",
@@ -242,9 +205,8 @@
order: "desc",
Foots: "",
total: 0,
- // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
sizes: [30, 60, 100, 120],
- size: 30, // 榛樿鍒嗛〉澶у皬
+ size: 30,
Wheres: [],
page: 1,
rows: 30,
@@ -281,14 +243,27 @@
};
},
methods: {
+ toggleAssignStockColumn() {
+ const assignStockColumn = this.tableColumns.find(
+ (item) => item.prop === "assignStock"
+ );
+ if (assignStockColumn) {
+ // businessType涓�22鏃舵樉绀猴紝鍚﹀垯闅愯棌
+ assignStockColumn.hidden = this.mainBusinessType !== '22';
+ }
+ },
open(row) {
this.row = row;
this.showDetialBox = true;
+ console.log("涓诲崟鎹暟鎹細", this.row);
+ this.isBatch = row.isBatch;
+ this.mainBusinessType = row.businessType;
this.getDictionaryData();
this.getData();
+ this.toggleAssignStockColumn();
},
getData() {
- var wheres = [{ name: "orderId", value: this.row.id }];
+ var wheres = [{ name: "orderId", value: this.row.id }];
var param = {
page: this.paginations.page,
rows: this.paginations.rows,
@@ -305,8 +280,9 @@
tableButtonClick(row, column) {
if (column.prop == "assignStock") {
this.$refs.child.open(row);
+ } else if (column.prop == "NoStockOut") {
+ this.$refs.NoStockOut.open(row);
} else {
- //鐐瑰嚮鎵撳紑
this.$refs.selectedStock.open(row);
}
},
@@ -314,9 +290,9 @@
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
- var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+ var keys = this.selection.map((item) => item.id);
this.http
- .post("api/AllocateOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
+ .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
.then((x) => {
if (!x.status) return this.$message.error(x.message);
this.$message.success("鎿嶄綔鎴愬姛");
@@ -326,152 +302,348 @@
});
});
},
- // 鎵撳紑鎷i�夐〉闈�
- handleOpenPicking() {
+ handleOpenPicking() {
this.$router.push({
- path: '/outbound/picking',
- query: { orderId: this.row.id ,orderNo:this.row.orderNo}
- })
+ path: "/outbound/outPicking",
+ query: { orderId: this.row.id, orderNo: this.row.orderNo },
+ });
+ },
+ handleOpenBatchPicking() {
+ this.$router.push({
+ path: "/outbound/outPicking",
+ query: { orderId: this.row.id, orderNo: this.row.orderNo },
+ });
},
outbound() {
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
- const platformOptions = [{label:'绔欏彴2',value:'2-1'},{label:'绔欏彴3',value:'3-1'}];
- const mountNode = document.createElement('div');
+ const platformOptions = [
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ];
+ const mountNode = document.createElement("div");
document.body.appendChild(mountNode);
- // 2. 琛ㄥ崟鏁版嵁锛堥粯璁ら�変腑绔欏彴3锛�
const formData = reactive({
- selectedPlatform: platformOptions[0].value // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
+ selectedPlatform: platformOptions[0].value,
});
- const savedStation = stationManager.getStation();
- console.log(savedStation);
- if (savedStation) {
- formData.selectedPlatform = savedStation;
- }
- // 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
- const vnode = createVNode(ElDialog, {
- title: '鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴',
- width: '500px',
- modelValue: true,
- appendToBody: true,
- 'onUpdate:modelValue': (isVisible) => {
- if (!isVisible) {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- }
- },
- style: {
- padding: '20px 0',
- borderRadius: '8px'
- }
- }, {
- default: () => h(ElForm, {
- model: formData00,
- rules: {
- selectedPlatform: [
- { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
- ]
+ const vnode = createVNode(
+ ElDialog,
+ {
+ title: "鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴",
+ width: "500px",
+ modelValue: true,
+ appendToBody: true,
+ "onUpdate:modelValue": (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
},
- ref: 'outboundForm',
- labelWidth: '100px',
style: {
- padding: '0 30px'
- }
- }, [
- // 鍑哄簱绔欏彴閫夋嫨椤癸紙鏍稿績琛ㄥ崟椤癸級
- h(ElFormItem, {
- label: '鍑哄簱绔欏彴',
- prop: 'selectedPlatform',
- style: {
- marginBottom: '24px'
- }
- }, [
- h(ElSelect, {
- placeholder: '璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�',
- modelValue: formData.selectedPlatform,
- 'onUpdate:modelValue': (val) => {
- formData.selectedPlatform = val;
+ padding: "20px 0",
+ borderRadius: "8px",
+ },
+ },
+ {
+ default: () =>
+ h(
+ ElForm,
+ {
+ model: formData,
+ rules: {
+ selectedPlatform: [
+ { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+ ],
+ },
+ ref: "outboundForm",
+ labelWidth: "100px",
+ style: {
+ padding: "0 30px",
+ },
},
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- }
- }, platformOptions.map(platform =>
- h(ElOption, { label: platform.label, value: platform.value })
- ))
- ]),
- // 搴曢儴鎸夐挳鍖�
- h('div', {
- style: {
- textAlign: 'right',
- marginTop: '8px',
- paddingRight: '4px'
- }
- }, [
- h(ElButton, {
- type: 'text',
- onClick: () => {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
- },
- style: {
- marginRight: '8px',
- color: '#606266'
- }
- }, '鍙栨秷'),
- h(ElButton, {
- type: 'primary',
- onClick: async () => {
- const formRef = vnode.component.refs.outboundForm;
- try {
- // 琛ㄥ崟鏍¢獙
- await formRef.validate();
- } catch (err) {
- return;
- }
+ [
+ h(ElFormItem, {
+ label: "鍑哄簱绔欏彴",
+ prop: "selectedPlatform",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElSelect, {
+ placeholder: "璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�",
+ modelValue: formData.selectedPlatform,
+ "onUpdate:modelValue": (val) => {
+ formData.selectedPlatform = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ }, platformOptions.map((platform) =>
+ h(ElOption, { label: platform.label, value: platform.value })
+ )),
+ ]),
+ h("div", {
+ style: {
+ textAlign: "right",
+ marginTop: "8px",
+ paddingRight: "4px",
+ },
+ }, [
+ h(ElButton, {
+ type: "text",
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info("鍙栨秷鍑哄簱鎿嶄綔");
+ },
+ style: {
+ marginRight: "8px",
+ color: "#606266",
+ },
+ }, "鍙栨秷"),
+ h(ElButton, {
+ type: "primary",
+ onClick: async () => {
+ const formRef = vnode.component.refs.outboundForm;
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
- // 4. 鏋勯�犺姹傚弬鏁帮紙閫変腑鍗曟嵁ID + 閫夋嫨鐨勫嚭搴撶珯鍙帮級
- const keys = this.selection.map((item) => item.id);
- const requestParams = {
- taskIds: keys,
- outboundPlatform: formData.selectedPlatform // 鍑哄簱绔欏彴
- };
+ const keys = this.selection.map((item) => item.id);
+ const requestParams = {
+ detailIds: keys,
+ outboundTargetLocation: formData.selectedPlatform,
+ outboundQuantity: 1,
+ operator: "",
+ orderNo: this.row.orderNo,
+ };
- // 5. 璋冪敤鍑哄簱鎺ュ彛
- this.http
- .post("api/Task/GenerateOutboundTasks", requestParams, "鏁版嵁澶勭悊涓�")
- .then((x) => {
- if (!x.status) return ElMessage.error(x.message);
-
- ElMessage.success("鎿嶄綔鎴愬姛");
- this.showDetialBox = false; // 鍏抽棴璇︽儏妗�
- this.$emit("parentCall", ($vue) => {
- $vue.getData(); // 閫氱煡鐖剁粍浠跺埛鏂�
- });
- // 鍏抽棴寮圭獥
- render(null, mountNode);
- document.body.removeChild(mountNode);
- })
- .catch(() => {
- ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
- });
- },
- style: {
- borderRadius: '4px',
- padding: '8px 20px'
- }
- }, '纭畾鍑哄簱')
- ])
- ])
+ this.http
+ .post(
+ "api/Outbound/ProcessPickingOutbound",
+ requestParams,
+ "鏁版嵁澶勭悊涓�"
+ )
+ .then((x) => {
+ if (!x.status) return ElMessage.error(x.message);
+ ElMessage.success("鎿嶄綔鎴愬姛");
+ this.showDetialBox = false;
+ this.$emit("parentCall", ($vue) => {
+ $vue.getData();
+ });
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ })
+ // .catch(() => {
+ // ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+ // });
+ },
+ style: {
+ borderRadius: "4px",
+ padding: "8px 20px",
+ },
+ }, "纭畾鍑哄簱"),
+ ]),
+ ]),
+ }
+ );
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ },
+ outboundbatch() {
+ if (this.selection.length === 0) {
+ return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+ }
+ if (this.selection.length > 1) {
+ return this.$message.error("鍙兘閫夋嫨涓�鏉″崟鎹槑缁嗚繘琛屽垎鎵瑰嚭搴�");
+ }
+ const platformOptions = [
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ];
+ const mountNode = document.createElement("div");
+ document.body.appendChild(mountNode);
+
+ const formData = reactive({
+ selectedPlatform: platformOptions[0].value,
+ outboundDecimal: "",
});
- // 缁戝畾app涓婁笅鏂囷紝纭繚El缁勪欢姝e父宸ヤ綔
+ const vnode = createVNode(
+ ElDialog,
+ {
+ title: "鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴",
+ width: "500px",
+ modelValue: true,
+ appendToBody: true,
+ "onUpdate:modelValue": (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
+ },
+ style: {
+ padding: "20px 0",
+ borderRadius: "8px",
+ },
+ },
+ {
+ default: () =>
+ h(
+ ElForm,
+ {
+ model: formData,
+ rules: {
+ selectedPlatform: [
+ { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+ ],
+ outboundDecimal: [
+ { required: true, message: "璇疯緭鍏ュ皬鏁版暟鍊�", trigger: "blur" },
+ {
+ validator: (rule, value, callback) => {
+ const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/;
+ if (value && !decimalReg.test(value)) {
+ callback(new Error("璇疯緭鍏ユ湁鏁堢殑灏忔暟锛堟鏁帮紝鏈�澶�2浣嶅皬鏁帮級"));
+ } else {
+ callback();
+ }
+ },
+ trigger: "blur",
+ },
+ ],
+ },
+ ref: "outboundForm",
+ labelWidth: "100px",
+ style: {
+ padding: "0 30px",
+ },
+ },
+ [
+ h(ElFormItem, {
+ label: "鍑哄簱绔欏彴",
+ prop: "selectedPlatform",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElSelect, {
+ placeholder: "璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�",
+ modelValue: formData.selectedPlatform,
+ "onUpdate:modelValue": (val) => {
+ formData.selectedPlatform = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ }, platformOptions.map((platform) =>
+ h(ElOption, { label: platform.label, value: platform.value })
+ )),
+ ]),
+ h(ElFormItem, {
+ label: "鍑哄簱鏁�",
+ prop: "outboundDecimal",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElInput, {
+ type: "number",
+ placeholder: "璇疯緭鍏ュ皬鏁版暟鍊硷紙鏈�澶�2浣嶅皬鏁帮級",
+ modelValue: formData.outboundDecimal,
+ "onUpdate:modelValue": (val) => {
+ formData.outboundDecimal = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ step: "0.01",
+ precision: 2,
+ min: 0.01,
+ }),
+ ]),
+ h("div", {
+ style: {
+ textAlign: "right",
+ marginTop: "8px",
+ paddingRight: "4px",
+ },
+ }, [
+ h(ElButton, {
+ type: "text",
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info("鍙栨秷鍒嗘壒鍑哄簱鎿嶄綔");
+ },
+ style: {
+ marginRight: "8px",
+ color: "#606266",
+ },
+ }, "鍙栨秷"),
+ h(ElButton, {
+ type: "primary",
+ onClick: async () => {
+ const formRef = vnode.component.refs.outboundForm;
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
+
+ const keys = this.selection.map((item) => item.id);
+ const requestParams = {
+ detailIds: keys,
+ outboundTargetLocation: formData.selectedPlatform,
+ outboundQuantity: formData.outboundDecimal,
+ operator: "",
+ orderNo: this.row.orderNo,
+ };
+
+ this.http
+ .post(
+ "api/Outbound/ProcessPickingOutbound",
+ requestParams,
+ "鏁版嵁澶勭悊涓�"
+ )
+ .then((x) => {
+ if (!x.status) return ElMessage.error(x.message);
+ ElMessage.success("鎿嶄綔鎴愬姛");
+ this.showDetialBox = false;
+ this.$emit("parentCall", ($vue) => {
+ $vue.getData();
+ });
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ })
+ .catch(() => {
+ ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+ });
+ },
+ style: {
+ borderRadius: "4px",
+ padding: "8px 20px",
+ },
+ }, "纭畾鍒嗘壒鍑哄簱"),
+ ]),
+ ]),
+ }
+ );
+
vnode.appContext = this.$.appContext;
render(vnode, mountNode);
},
@@ -531,7 +703,6 @@
var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
if (item) {
var dicItem = item.data.find((x) => x.key == row[column.prop]);
- console.log(dicItem);
if (dicItem) {
return dicItem.value;
} else {
@@ -541,10 +712,12 @@
return row[column.prop];
}
}
+ return row[column.prop];
},
},
};
</script>
+
<style scoped>
.text-button {
border: 0px;
@@ -560,14 +733,12 @@
background: oldlace;
}
-.box-table .el-table tbody tr:hover > td {
+.box-table .el-table tbody tr:hover>td {
background-color: #d8e0d4 !important;
- /* color: #ffffff; */
}
-.box-table .el-table tbody tr.current-row > td {
+.box-table .el-table tbody tr.current-row>td {
background-color: #f0f9eb !important;
- /* color: #ffffff; */
}
.el-table .success-row {
@@ -577,4 +748,4 @@
.box-table .el-table {
border: 1px solid #ebeef5;
}
-</style>
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
index 9b7a790..0afde7a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
@@ -1,6 +1,6 @@
//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
import gridHeader from './extend/EmptyTrayInbound.vue'
-import gridBody from './extend/Pallet.vue'
+import gridBody from './extend/AllcatedPallet.vue'
let extension = {
components: {
//鏌ヨ鐣岄潰鎵╁睍缁勪欢
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
index 4b220dc..77d3fad 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
@@ -1,12 +1,6 @@
<template>
<div>
- <vol-box
- v-model="showDetialBox"
- :lazy="true"
- width="75%"
- :padding="15"
- title="鍗曟嵁鏄庣粏淇℃伅"
- >
+ <vol-box v-model="showDetialBox" :lazy="true" width="75%" :padding="15" title="鍗曟嵁鏄庣粏淇℃伅">
<div class="box-head">
<el-alert :closable="false" style="width: 100%">
<el-row>
@@ -14,100 +8,44 @@
<span>宸查�変腑 {{ selection.length }} 椤�</span>
</el-col>
<el-col :span="8">
- <!-- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px"
- @click="lockstocks"
- >閿佸畾搴撳瓨</el-link> -->
-
- <el-link
- type="primary"
- size="small"
- v-if="isBatch === 0"
- style="float: right; height: 20px"
- @click="handleOpenPicking"
- >鎷i��</el-link>
- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px; margin-right: 10px"
- v-if="isBatch === 1"
- @click="handleOpenBatchPicking"
- >鍒嗘壒鎷i��</el-link>
- <el-link
- type="primary"
- size="small"
- v-if="isBatch === 0"
- style="float: right; height: 20px; margin-right: 10px"
- @click="outbound"
- >鐩存帴鍑哄簱</el-link
- >
- <el-link
- type="primary"
- size="small"
- v-if="isBatch === 1"
- style="float: right; height: 20px; margin-right: 10px"
- @click="outboundbatch"
- >鍒嗘壒鍑哄簱</el-link
- >
- <el-link
- type="primary"
- size="small"
- style="float: right; height: 20px; margin-right: 10px"
- @click="getData"
- >鍒锋柊</el-link
- ></el-col
- >
+ <el-link type="primary" size="small" v-if="isBatch === 0" style="float: right; height: 20px"
+ @click="handleOpenPicking">鎷i��</el-link>
+ <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px"
+ v-if="isBatch === 1" @click="handleOpenBatchPicking">鍒嗘壒鎷i��</el-link>
+ <el-link type="primary" size="small" v-if="isBatch === 0"
+ style="float: right; height: 20px; margin-right: 10px" @click="outbound">鐩存帴鍑哄簱</el-link>
+ <el-link type="primary" size="small" v-if="isBatch === 1"
+ style="float: right; height: 20px; margin-right: 10px" @click="outboundbatch">鍒嗘壒鍑哄簱</el-link>
+ <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px"
+ @click="getData">鍒锋柊</el-link>
+ </el-col>
</el-row>
</el-alert>
</div>
<div class="box-table" style="margin-top: 1%">
- <el-table
- ref="singleTable"
- :data="tableData"
- style="width: 100%; height: 100%"
- highlight-current-row
- @current-change="handleCurrentChange"
- height="500px"
- @row-click="handleRowClick"
- @selection-change="handleSelectionChange"
- >
+ <el-table ref="singleTable" :data="tableData" style="width: 100%; height: 100%" highlight-current-row
+ @current-change="handleCurrentChange" height="500px" @row-click="handleRowClick"
+ @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"> </el-table-column>
- <el-table-column
- label="搴忓彿"
- type="index"
- fixed="left"
- width="55"
- align="center"
- ></el-table-column>
- <el-table-column
- v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
- :key="index"
- :prop="item.prop"
- :label="item.title"
- :width="item.width"
- align="center"
- >
+ <el-table-column label="搴忓彿" type="index" fixed="left" width="55" align="center"></el-table-column>
+ <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" :prop="item.prop"
+ :label="item.title" :width="item.width" align="center">
<template #default="scoped">
<div v-if="item.type == 'icon'">
- <el-tooltip
- class="item"
- effect="dark"
- :content="item.title"
- placement="bottom"
- ><el-link
- type="primary"
- :disabled="getButtonEnable(item.prop, scoped.row)"
- @click="tableButtonClick(scoped.row, item)"
- ><i :class="item.icon" style="font-size: 22px"></i></el-link
- ></el-tooltip>
+ <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom">
+ <el-link type="primary" :disabled="getButtonEnable(item.prop, scoped.row)"
+ @click="tableButtonClick(scoped.row, item)">
+ <i :class="item.icon" style="font-size: 22px"></i>
+ </el-link>
+ </el-tooltip>
</div>
-
<div v-else-if="item.type == 'tag'">
<el-tag size="small">
{{ getDictionary(scoped.row, item) }}
</el-tag>
+ </div>
+ <div v-else>
+ {{ scoped.row[item.prop] }}
</div>
</template>
</el-table-column>
@@ -115,35 +53,41 @@
</div>
</vol-box>
<stock-select ref="child" @parentCall="parentCall"></stock-select>
- <selected-stock
- ref="selectedStock"
- @parentCall="parentCall"
- ></selected-stock>
+ <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock>
<NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut>
</div>
</template>
+
<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import StockSelect from "./StockSelect.vue";
import SelectedStock from "./SelectedStock.vue";
import NoStockOut from "./NoStockOut.vue";
-import { h,createVNode, render,reactive } from 'vue';
-import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElInput, ElMessage } from 'element-plus';
-import { th } from 'element-plus/es/locale';
-import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
+import { h, createVNode, render, reactive } from "vue";
+import {
+ ElDialog,
+ ElForm,
+ ElFormItem,
+ ElSelect,
+ ElOption,
+ ElButton,
+ ElInput,
+ ElMessage,
+} from "element-plus";
export default {
- components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut},
+ components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut },
data() {
return {
row: null,
- isBatch :0,
+ isBatch: 0,
showDetialBox: false,
flag: false,
currentRow: null,
selection: [],
tableData: [],
+ mainBusinessType: null, // 鏂板锛氬瓨鍌ㄤ富鍗曟嵁鐨刡usinessType
tableColumns: [
{
prop: "id",
@@ -163,7 +107,7 @@
prop: "materielCode",
title: "鐗╂枡缂栧彿",
type: "string",
- width: 150,
+ width: 120,
},
{
prop: "materielName",
@@ -181,7 +125,7 @@
prop: "supplyCode",
title: "渚涘簲鍟嗙紪鍙�",
type: "string",
- width: 150,
+ width: 90,
},
{
prop: "orderQuantity",
@@ -211,7 +155,7 @@
prop: "unit",
title: "鍗曚綅",
type: "string",
- width: 90,
+ width: 80,
},
{
prop: "orderDetailStatus",
@@ -225,7 +169,7 @@
title: "鎸囧畾搴撳瓨",
type: "icon",
width: 90,
- hidden:true,
+ hidden: true, // 榛樿闅愯棌
icon: "el-icon-s-grid",
},
{
@@ -270,9 +214,8 @@
order: "desc",
Foots: "",
total: 0,
- // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
sizes: [30, 60, 100, 120],
- size: 30, // 榛樿鍒嗛〉澶у皬
+ size: 30,
Wheres: [],
page: 1,
rows: 30,
@@ -309,13 +252,24 @@
};
},
methods: {
+ toggleAssignStockColumn() {
+ const assignStockColumn = this.tableColumns.find(
+ (item) => item.prop === "assignStock"
+ );
+ if (assignStockColumn) {
+ // businessType涓�22鏃舵樉绀猴紝鍚﹀垯闅愯棌
+ assignStockColumn.hidden = this.mainBusinessType !== '22';
+ }
+ },
open(row) {
this.row = row;
this.showDetialBox = true;
- console.log(this.row);
+ console.log("涓诲崟鎹暟鎹細", this.row);
this.isBatch = row.isBatch;
+ this.mainBusinessType = row.businessType;
this.getDictionaryData();
this.getData();
+ this.toggleAssignStockColumn();
},
getData() {
var wheres = [{ name: "orderId", value: this.row.id }];
@@ -337,8 +291,7 @@
this.$refs.child.open(row);
} else if (column.prop == "NoStockOut") {
this.$refs.NoStockOut.open(row);
- }else{
- //鐐瑰嚮鎵撳紑鍑哄簱璇︽儏
+ } else {
this.$refs.selectedStock.open(row);
}
},
@@ -346,7 +299,7 @@
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
- var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+ var keys = this.selection.map((item) => item.id);
this.http
.post("api/OutboundOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
.then((x) => {
@@ -358,344 +311,351 @@
});
});
},
- // 鎵撳紑鎷i�夐〉闈�
- handleOpenPicking() {
+ handleOpenPicking() {
this.$router.push({
- path: '/outbound/picking',
- query: { orderId: this.row.id ,orderNo:this.row.orderNo}
- })
+ path: "/outbound/outPicking",
+ query: { orderId: this.row.id, orderNo: this.row.orderNo },
+ });
},
handleOpenBatchPicking() {
- this.$router.push({
- path: '/outbound/batchpicking',
- query: { orderId: this.row.id ,orderNo:this.row.orderNo}})
+ this.$router.push({
+ path: "/outbound/outPicking",
+ query: { orderId: this.row.id, orderNo: this.row.orderNo },
+ });
},
outbound() {
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
- const platformOptions = [{label:'绔欏彴2',value:'2-1'},{label:'绔欏彴3',value:'3-1'}];
- const mountNode = document.createElement('div');
+ const platformOptions = [
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ];
+ const mountNode = document.createElement("div");
document.body.appendChild(mountNode);
- // 2. 琛ㄥ崟鏁版嵁锛堥粯璁ら�変腑绔欏彴3锛�
const formData = reactive({
- selectedPlatform: platformOptions[0].value // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
+ selectedPlatform: platformOptions[0].value,
});
- const savedStation = stationManager.getStation();
- if (savedStation) {
- formData.selectedPlatform = savedStation;
- }
- // 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
- const vnode = createVNode(ElDialog, {
- title: '鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴',
- width: '500px',
- modelValue: true,
- appendToBody: true,
- 'onUpdate:modelValue': (isVisible) => {
- if (!isVisible) {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- }
- },
- style: {
- padding: '20px 0',
- borderRadius: '8px'
- }
- }, {
- default: () => h(ElForm, {
- model: formData,
- rules: {
- selectedPlatform: [
- { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
- ]
+
+ const vnode = createVNode(
+ ElDialog,
+ {
+ title: "鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴",
+ width: "500px",
+ modelValue: true,
+ appendToBody: true,
+ "onUpdate:modelValue": (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
},
- ref: 'outboundForm',
- labelWidth: '100px',
style: {
- padding: '0 30px'
- }
- }, [
- // 鍑哄簱绔欏彴閫夋嫨椤癸紙鏍稿績琛ㄥ崟椤癸級
- h(ElFormItem, {
- label: '鍑哄簱绔欏彴',
- prop: 'selectedPlatform',
- style: {
- marginBottom: '24px'
- }
- }, [
- h(ElSelect, {
- placeholder: '璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�',
- modelValue: formData.selectedPlatform,
- 'onUpdate:modelValue': (val) => {
- formData.selectedPlatform = val;
+ padding: "20px 0",
+ borderRadius: "8px",
+ },
+ },
+ {
+ default: () =>
+ h(
+ ElForm,
+ {
+ model: formData,
+ rules: {
+ selectedPlatform: [
+ { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+ ],
+ },
+ ref: "outboundForm",
+ labelWidth: "100px",
+ style: {
+ padding: "0 30px",
+ },
},
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- }
- }, platformOptions.map(platform =>
- h(ElOption, { label: platform.label, value: platform.value })
- ))
- ]),
- // 搴曢儴鎸夐挳鍖�
- h('div', {
- style: {
- textAlign: 'right',
- marginTop: '8px',
- paddingRight: '4px'
- }
- }, [
- h(ElButton, {
- type: 'text',
- onClick: () => {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
- },
- style: {
- marginRight: '8px',
- color: '#606266'
- }
- }, '鍙栨秷'),
- h(ElButton, {
- type: 'primary',
- onClick: async () => {
- const formRef = vnode.component.refs.outboundForm;
- try {
- // 琛ㄥ崟鏍¢獙
- await formRef.validate();
- } catch (err) {
- return;
- }
+ [
+ h(ElFormItem, {
+ label: "鍑哄簱绔欏彴",
+ prop: "selectedPlatform",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElSelect, {
+ placeholder: "璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�",
+ modelValue: formData.selectedPlatform,
+ "onUpdate:modelValue": (val) => {
+ formData.selectedPlatform = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ }, platformOptions.map((platform) =>
+ h(ElOption, { label: platform.label, value: platform.value })
+ )),
+ ]),
+ h("div", {
+ style: {
+ textAlign: "right",
+ marginTop: "8px",
+ paddingRight: "4px",
+ },
+ }, [
+ h(ElButton, {
+ type: "text",
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info("鍙栨秷鍑哄簱鎿嶄綔");
+ },
+ style: {
+ marginRight: "8px",
+ color: "#606266",
+ },
+ }, "鍙栨秷"),
+ h(ElButton, {
+ type: "primary",
+ onClick: async () => {
+ const formRef = vnode.component.refs.outboundForm;
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
- // 4. 鏋勯�犺姹傚弬鏁帮紙閫変腑鍗曟嵁ID + 閫夋嫨鐨勫嚭搴撶珯鍙帮級
- const keys = this.selection.map((item) => item.id);
- const requestParams = {
- taskIds: keys,
- outboundPlatform: formData.selectedPlatform // 鍑哄簱绔欏彴
- };
+ const keys = this.selection.map((item) => item.id);
+ const requestParams = {
+ detailIds: keys,
+ outboundTargetLocation: formData.selectedPlatform,
+ outboundQuantity: 1,
+ operator: "",
+ orderNo: this.row.orderNo,
+ };
- // 5. 璋冪敤鍑哄簱鎺ュ彛
- this.http
- .post("api/Task/GenerateOutboundTasks", requestParams, "鏁版嵁澶勭悊涓�")
- .then((x) => {
- if (!x.status) return ElMessage.error(x.message);
-
- ElMessage.success("鎿嶄綔鎴愬姛");
- this.showDetialBox = false; // 鍏抽棴璇︽儏妗�
- this.$emit("parentCall", ($vue) => {
- $vue.getData(); // 閫氱煡鐖剁粍浠跺埛鏂�
- });
- // 鍏抽棴寮圭獥
- render(null, mountNode);
- document.body.removeChild(mountNode);
- })
- .catch(() => {
- ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
- });
- },
- style: {
- borderRadius: '4px',
- padding: '8px 20px'
- }
- }, '纭畾鍑哄簱')
- ])
- ])
- });
+ this.http
+ .post(
+ "api/Outbound/ProcessPickingOutbound",
+ requestParams,
+ "鏁版嵁澶勭悊涓�"
+ )
+ .then((x) => {
+ if (!x.status) return ElMessage.error(x.message);
+ ElMessage.success("鎿嶄綔鎴愬姛");
+ this.showDetialBox = false;
+ this.$emit("parentCall", ($vue) => {
+ $vue.getData();
+ });
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ })
+ // .catch(() => {
+ // ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+ // });
+ },
+ style: {
+ borderRadius: "4px",
+ padding: "8px 20px",
+ },
+ }, "纭畾鍑哄簱"),
+ ]),
+ ]),
+ }
+ );
- // 缁戝畾app涓婁笅鏂囷紝纭繚El缁勪欢姝e父宸ヤ綔
vnode.appContext = this.$.appContext;
render(vnode, mountNode);
},
outboundbatch() {
- if (this.selection.length === 0) {
- return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
- }
- if (this.selection.length>1) {
- return this.$message.error("鍙兘閫夋嫨涓�鏉″崟鎹槑缁嗚繘琛屽垎鎵瑰嚭搴�");
- }
- const platformOptions = [{label:'绔欏彴2',value:'2-1'},{label:'绔欏彴3',value:'3-1'}];
- const mountNode = document.createElement('div');
- document.body.appendChild(mountNode);
-
- // 2. 琛ㄥ崟鏁版嵁锛堥粯璁ら�変腑绔欏彴3锛屾柊澧炲皬鏁板瓧娈碉級
- const formData = reactive({
- selectedPlatform: platformOptions[0].value, // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
- outboundDecimal: '' // 鏂板锛氬皬鏁拌緭鍏ユ瀛楁
- });
-
- // 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
- const vnode = createVNode(ElDialog, {
- title: '鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴',
- width: '500px',
- modelValue: true,
- appendToBody: true,
- 'onUpdate:modelValue': (isVisible) => {
- if (!isVisible) {
- render(null, mountNode);
- document.body.removeChild(mountNode);
+ if (this.selection.length === 0) {
+ return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
- },
- style: {
- padding: '20px 0',
- borderRadius: '8px'
- }
- }, {
- default: () => h(ElForm, {
- model: formData,
- rules: {
- selectedPlatform: [
- { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
- ],
- // 鏂板锛氬皬鏁板瓧娈甸獙璇佽鍒欙紙蹇呭~ + 鏈夋晥灏忔暟鏍煎紡锛�
- outboundDecimal: [
- { required: true, message: '璇疯緭鍏ュ皬鏁版暟鍊�', trigger: 'blur' },
- {
- validator: (rule, value, callback) => {
- // 楠岃瘉瑙勫垯锛氭鏁般�佹敮鎸佸皬鏁扮偣鍚庢渶澶�2浣嶏紙鍙牴鎹渶姹傝皟鏁村皬鏁颁綅鏁帮級
- const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/;
- if (value && !decimalReg.test(value)) {
- callback(new Error('璇疯緭鍏ユ湁鏁堢殑灏忔暟锛堟鏁帮紝鏈�澶�2浣嶅皬鏁帮級'));
- } else {
- callback();
- }
- },
- trigger: 'blur'
- }
- ]
- },
- ref: 'outboundForm',
- labelWidth: '100px',
- style: {
- padding: '0 30px'
+ if (this.selection.length > 1) {
+ return this.$message.error("鍙兘閫夋嫨涓�鏉″崟鎹槑缁嗚繘琛屽垎鎵瑰嚭搴�");
}
- }, [
- // 鍑哄簱绔欏彴閫夋嫨椤癸紙鏍稿績琛ㄥ崟椤癸級
- h(ElFormItem, {
- label: '鍑哄簱绔欏彴',
- prop: 'selectedPlatform',
- style: {
- marginBottom: '24px'
- }
- }, [
- h(ElSelect, {
- placeholder: '璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�',
- modelValue: formData.selectedPlatform,
- 'onUpdate:modelValue': (val) => {
- formData.selectedPlatform = val;
- },
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- }
- }, platformOptions.map(platform =>
- h(ElOption, { label: platform.label, value: platform.value })
- ))
- ]),
- // 鏂板锛氬皬鏁拌緭鍏ユ琛ㄥ崟椤�
- h(ElFormItem, {
- label: '鍑哄簱鏁�', // 鍙牴鎹笟鍔¢渶姹備慨鏀规爣绛惧悕锛堝鈥滃嚭搴撴暟閲忊�濃�滈噸閲忊�濈瓑锛�
- prop: 'outboundDecimal',
- style: {
- marginBottom: '24px'
- }
- }, [
- h(ElInput, {
- type: 'number', // 鏁板瓧绫诲瀷锛屽師鐢熸敮鎸佸皬鏁拌緭鍏�
- placeholder: '璇疯緭鍏ュ皬鏁版暟鍊硷紙鏈�澶�2浣嶅皬鏁帮級',
- modelValue: formData.outboundDecimal,
- 'onUpdate:modelValue': (val) => {
- formData.outboundDecimal = val;
- },
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- },
- step: '0.01', // 姝ラ暱0.01锛岀偣鍑讳笂涓嬬澶存椂鎸�0.01澧炲噺
- precision: 2, // 闄愬埗鏈�澶氳緭鍏�2浣嶅皬鏁帮紙Element Plus灞炴�э級
- min: 0.01, // 鍙�夛細闄愬埗鏈�灏忓�间负0.01锛岄伩鍏嶈緭鍏�0鎴栬礋鏁�
- })
- ]),
- // 搴曢儴鎸夐挳鍖�
- h('div', {
- style: {
- textAlign: 'right',
- marginTop: '8px',
- paddingRight: '4px'
- }
- }, [
- h(ElButton, {
- type: 'text',
- onClick: () => {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- ElMessage.info('鍙栨秷鍒嗘壒鍑哄簱鎿嶄綔');
- },
- style: {
- marginRight: '8px',
- color: '#606266'
- }
- }, '鍙栨秷'),
- h(ElButton, {
- type: 'primary',
- onClick: async () => {
- const formRef = vnode.component.refs.outboundForm;
- try {
- // 琛ㄥ崟鏍¢獙锛堜細鍚屾椂鏍¢獙鍑哄簱绔欏彴鍜屽皬鏁板瓧娈碉級
- await formRef.validate();
- } catch (err) {
- return;
+ const platformOptions = [
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ];
+ const mountNode = document.createElement("div");
+ document.body.appendChild(mountNode);
+
+ const formData = reactive({
+ selectedPlatform: platformOptions[0].value,
+ outboundDecimal: "",
+ });
+
+ const vnode = createVNode(
+ ElDialog,
+ {
+ title: "鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴",
+ width: "500px",
+ modelValue: true,
+ appendToBody: true,
+ "onUpdate:modelValue": (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
}
-console.log(this.selection);
- // 4. 鏋勯�犺姹傚弬鏁帮紙鏂板灏忔暟瀛楁锛�
- const keys = this.selection.map((item) => item.id);
- const requestParams = {
- orderDetailId: keys[0], // 鍒嗘壒鍑哄簱浠呮敮鎸佸崟鏉℃槑缁�
- outboundPlatform: formData.selectedPlatform, // 鍑哄簱绔欏彴
- batchQuantity: formData.outboundDecimal // 鏂板锛氬皬鏁板瓧娈典紶缁欏悗绔�
- };
-
- // 5. 璋冪敤鍑哄簱鎺ュ彛
- this.http
- .post("api/Task/GenerateOutboundBatchTasks", requestParams, "鏁版嵁澶勭悊涓�")
- .then((x) => {
- if (!x.status) return ElMessage.error(x.message);
-
- ElMessage.success("鎿嶄綔鎴愬姛");
- this.showDetialBox = false; // 鍏抽棴璇︽儏妗�
- this.$emit("parentCall", ($vue) => {
- $vue.getData(); // 閫氱煡鐖剁粍浠跺埛鏂�
- });
- // 鍏抽棴寮圭獥
- render(null, mountNode);
- document.body.removeChild(mountNode);
- })
- .catch(() => {
- ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
- });
},
style: {
- borderRadius: '4px',
- padding: '8px 20px'
- }
- }, '纭畾鍒嗘壒鍑哄簱')
- ])
- ])
- });
+ padding: "20px 0",
+ borderRadius: "8px",
+ },
+ },
+ {
+ default: () =>
+ h(
+ ElForm,
+ {
+ model: formData,
+ rules: {
+ selectedPlatform: [
+ { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+ ],
+ outboundDecimal: [
+ { required: true, message: "璇疯緭鍏ュ皬鏁版暟鍊�", trigger: "blur" },
+ {
+ validator: (rule, value, callback) => {
+ const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/;
+ if (value && !decimalReg.test(value)) {
+ callback(new Error("璇疯緭鍏ユ湁鏁堢殑灏忔暟锛堟鏁帮紝鏈�澶�2浣嶅皬鏁帮級"));
+ } else {
+ callback();
+ }
+ },
+ trigger: "blur",
+ },
+ ],
+ },
+ ref: "outboundForm",
+ labelWidth: "100px",
+ style: {
+ padding: "0 30px",
+ },
+ },
+ [
+ h(ElFormItem, {
+ label: "鍑哄簱绔欏彴",
+ prop: "selectedPlatform",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElSelect, {
+ placeholder: "璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�",
+ modelValue: formData.selectedPlatform,
+ "onUpdate:modelValue": (val) => {
+ formData.selectedPlatform = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ }, platformOptions.map((platform) =>
+ h(ElOption, { label: platform.label, value: platform.value })
+ )),
+ ]),
+ h(ElFormItem, {
+ label: "鍑哄簱鏁�",
+ prop: "outboundDecimal",
+ style: {
+ marginBottom: "24px",
+ },
+ }, [
+ h(ElInput, {
+ type: "number",
+ placeholder: "璇疯緭鍏ュ皬鏁版暟鍊硷紙鏈�澶�2浣嶅皬鏁帮級",
+ modelValue: formData.outboundDecimal,
+ "onUpdate:modelValue": (val) => {
+ formData.outboundDecimal = val;
+ },
+ style: {
+ width: "100%",
+ height: "40px",
+ borderRadius: "4px",
+ borderColor: "#dcdfe6",
+ },
+ step: "0.01",
+ precision: 2,
+ min: 0.01,
+ }),
+ ]),
+ h("div", {
+ style: {
+ textAlign: "right",
+ marginTop: "8px",
+ paddingRight: "4px",
+ },
+ }, [
+ h(ElButton, {
+ type: "text",
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info("鍙栨秷鍒嗘壒鍑哄簱鎿嶄綔");
+ },
+ style: {
+ marginRight: "8px",
+ color: "#606266",
+ },
+ }, "鍙栨秷"),
+ h(ElButton, {
+ type: "primary",
+ onClick: async () => {
+ const formRef = vnode.component.refs.outboundForm;
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
- // 缁戝畾app涓婁笅鏂囷紝纭繚El缁勪欢姝e父宸ヤ綔
- vnode.appContext = this.$.appContext;
- render(vnode, mountNode);
-},
-
+ const keys = this.selection.map((item) => item.id);
+ const requestParams = {
+ detailIds: keys,
+ outboundTargetLocation: formData.selectedPlatform,
+ outboundQuantity: formData.outboundDecimal,
+ operator: "",
+ orderNo: this.row.orderNo,
+ };
+ this.http
+ .post(
+ "api/Outbound/ProcessPickingOutbound",
+ requestParams,
+ "鏁版嵁澶勭悊涓�"
+ )
+ .then((x) => {
+ if (!x.status) return ElMessage.error(x.message);
+ ElMessage.success("鎿嶄綔鎴愬姛");
+ this.showDetialBox = false;
+ this.$emit("parentCall", ($vue) => {
+ $vue.getData();
+ });
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ })
+ .catch(() => {
+ ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+ });
+ },
+ style: {
+ borderRadius: "4px",
+ padding: "8px 20px",
+ },
+ }, "纭畾鍒嗘壒鍑哄簱"),
+ ]),
+ ]),
+ }
+ );
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ },
setCurrent(row) {
this.$refs.singleTable.setCurrentRow(row);
},
@@ -752,7 +712,6 @@
var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
if (item) {
var dicItem = item.data.find((x) => x.key == row[column.prop]);
- console.log(dicItem);
if (dicItem) {
return dicItem.value;
} else {
@@ -762,10 +721,12 @@
return row[column.prop];
}
}
+ return row[column.prop];
},
},
};
</script>
+
<style scoped>
.text-button {
border: 0px;
@@ -781,14 +742,12 @@
background: oldlace;
}
-.box-table .el-table tbody tr:hover > td {
+.box-table .el-table tbody tr:hover>td {
background-color: #d8e0d4 !important;
- /* color: #ffffff; */
}
-.box-table .el-table tbody tr.current-row > td {
+.box-table .el-table tbody tr.current-row>td {
background-color: #f0f9eb !important;
- /* color: #ffffff; */
}
.el-table .success-row {
@@ -798,4 +757,4 @@
.box-table .el-table {
border: 1px solid #ebeef5;
}
-</style>
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
index d5718b0..c779ed3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs"
@@ -1583,6 +1583,8 @@
Unit = stockDetail.Unit,
InboundOrderRowNo = stockDetail.InboundOrderRowNo,
SupplyCode = stockDetail.SupplyCode,
+ Creater = stockDetail.Creater,
+ CreateDate = stockDetail.CreateDate,
FactoryArea = stockDetail.FactoryArea,
WarehouseCode = stockDetail.WarehouseCode,
Remark = $"鎷嗗寘鍓嶅師濮嬭褰曪紝鍑哄簱鍗曞彿锛歿orderNo}锛屽嚭搴撳崟涓婚敭锛歿orderId}锛屽師鏉$爜锛歿request.Barcode}锛屽師鏁伴噺锛歿stockDetail.StockQuantity}锛屽嚭搴撴暟閲忥細{actualOutboundQuantity}锛屾搷浣滆�咃細{request.Operator}"
@@ -1652,6 +1654,8 @@
InboundOrderRowNo = stockDetail.InboundOrderRowNo,
SupplyCode = stockDetail.SupplyCode,
FactoryArea = stockDetail.FactoryArea,
+ Creater = stockDetail.Creater,
+ CreateDate = stockDetail.CreateDate,
WarehouseCode = stockDetail.WarehouseCode,
Remark = $"鍑哄簱瀹屾垚鍒犻櫎锛屾潯鐮侊細{request.Barcode}锛屽師鏁伴噺锛歿stockDetail.StockQuantity}锛屽嚭搴撴暟閲忥細{actualOutboundQuantity}锛屾搷浣滆�咃細{request.Operator}"
};
--
Gitblit v1.9.3