|
@@ -1,20 +1,24 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
<layout>
|
|
<layout>
|
|
|
- <layout-header>
|
|
|
|
|
|
|
+ <!-- <layout-header> -->
|
|
|
<div class="gva-table-box">
|
|
<div class="gva-table-box">
|
|
|
- <h1 style="margin: 0%;margin-bottom: 10px;">出库报工</h1>
|
|
|
|
|
- <el-row :gutter="24" style="margin-bottom: 20px;">
|
|
|
|
|
- <el-input v-model="add_searchInfo" placeholder="扫描订单编号获取订单信息" @keyup.enter="add_onSubmit"id="searchInput" style="width: 230px;margin: 5px;height: 50px;"></el-input>
|
|
|
|
|
|
|
+ <h1 style="margin: 0%;margin-bottom: 6px;">出库报工</h1>
|
|
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 6px;">
|
|
|
|
|
+ <el-input v-model="add_searchInfo" placeholder="请扫描子订单编号"
|
|
|
|
|
+ @keyup.enter="add_onSubmit"
|
|
|
|
|
+ id="searchInput"
|
|
|
|
|
+ style="width: 230px;margin: 5px;height: 50px;">
|
|
|
|
|
+ </el-input>
|
|
|
<el-button type="primary" icon="search" @click="add_onSubmit" style="margin: 5px;height: 50px;">查询</el-button>
|
|
<el-button type="primary" icon="search" @click="add_onSubmit" style="margin: 5px;height: 50px;">查询</el-button>
|
|
|
<el-button type="primary" icon="" @click="Restore_onSubmit" style="margin: 5px;height: 50px;">恢复未出库</el-button>
|
|
<el-button type="primary" icon="" @click="Restore_onSubmit" style="margin: 5px;height: 50px;">恢复未出库</el-button>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
- </layout-header>
|
|
|
|
|
|
|
+ <!-- </layout-header> -->
|
|
|
<layout>
|
|
<layout>
|
|
|
<layout-content >
|
|
<layout-content >
|
|
|
<div class="gva-table-box">
|
|
<div class="gva-table-box">
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 55vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table ref="multipleTable" style="width: 100%;height: 64vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:data="add_tableData" border row-key="ID"
|
|
:data="add_tableData" border row-key="ID"
|
|
@@ -32,7 +36,7 @@
|
|
|
<el-table-column sortable align="left" label="是否出库" prop="是否出库" width="200"/>
|
|
<el-table-column sortable align="left" label="是否出库" prop="是否出库" width="200"/>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
<div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
|
- <el-button type="primary" @click="add_Dialog" style="width: 110px;height: 60px;font-size: 20px;">确认出库</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="add_Dialog" style="width: 110px;height: 60px;font-size: 20px;display: none;">确认出库</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</layout-content>
|
|
</layout-content>
|
|
@@ -46,7 +50,13 @@ import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
import {ref, reactive} from 'vue'
|
|
import {ref, reactive} from 'vue'
|
|
|
import {getSpotList,getSpotTab} from '@/api/mes/job'
|
|
import {getSpotList,getSpotTab} from '@/api/mes/job'
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
|
|
+import { get } from 'scriptjs';
|
|
|
defineOptions({name: 'Company'})
|
|
defineOptions({name: 'Company'})
|
|
|
|
|
+import { useUserStore } from '@/pinia/modules/user'
|
|
|
|
|
+
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
+const _username = ref('')
|
|
|
|
|
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
|
|
|
|
|
|
|
|
//全局调用获取当前日期
|
|
//全局调用获取当前日期
|
|
|
const today = new Date();
|
|
const today = new Date();
|
|
@@ -59,7 +69,7 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
const currentDates = `${year}-${month}-${day}`;
|
|
const currentDates = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
-const add_searchInfo = ref('')//搜索
|
|
|
|
|
|
|
+const add_searchInfo = ref('DC2409004-01')//搜索
|
|
|
const add_tableData = reactive([])//表格
|
|
const add_tableData = reactive([])//表格
|
|
|
const _orderid = ref('')//订单自编号
|
|
const _orderid = ref('')//订单自编号
|
|
|
const searcs = ref('')
|
|
const searcs = ref('')
|
|
@@ -69,39 +79,127 @@ const add_tableRowClick = async (row)=>{
|
|
|
console.log(row)
|
|
console.log(row)
|
|
|
_orderid.value = row.子订单编号
|
|
_orderid.value = row.子订单编号
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//点击【查询】按钮
|
|
//点击【查询】按钮
|
|
|
const add_onSubmit = async ()=>{
|
|
const add_onSubmit = async ()=>{
|
|
|
- if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ const inputElement = document.querySelector('#searchInput');
|
|
|
|
|
+ if (inputElement) {
|
|
|
|
|
+ inputElement.focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100); // 延迟100毫秒
|
|
|
|
|
+
|
|
|
|
|
+ if(add_searchInfo.value === ''){
|
|
|
const WorkListdata = [];
|
|
const WorkListdata = [];
|
|
|
|
|
+ searcs.value = '';
|
|
|
add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
|
- ElMessage({type: 'warning',message: '搜索内容不能为空' })
|
|
|
|
|
|
|
+ ElMessage({type: 'warning',message: '请扫描子订单编号' })
|
|
|
}else{
|
|
}else{
|
|
|
if (add_searchInfo.value.includes('-')) {
|
|
if (add_searchInfo.value.includes('-')) {
|
|
|
- //默认为空 第一次代表查询,如果搜索有值代表需要出库
|
|
|
|
|
- if(searcs.value === ''){
|
|
|
|
|
|
|
+ if(searcs.value == ''){
|
|
|
console.log("查询子订单编号数据")
|
|
console.log("查询子订单编号数据")
|
|
|
- const order = add_searchInfo.value;
|
|
|
|
|
- const getSpotLists = await getSpotList({order:order,code:'出库'});
|
|
|
|
|
- console.log(getSpotLists)
|
|
|
|
|
|
|
+ const getSpotLists = await getSpotList({order:add_searchInfo.value,code:'出库'});
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
|
|
+ add_searchInfo.value = ''
|
|
|
searcs.value = 1;
|
|
searcs.value = 1;
|
|
|
- }else{
|
|
|
|
|
- add_Dialog();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(searcs.value == 1){
|
|
|
|
|
+ if(add_tableData[0]['子订单编号'] === add_searchInfo.value){
|
|
|
|
|
+ console.log("出库")
|
|
|
|
|
+ add_Dialog();
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ElMessage({type: 'warning',message: '两次扫码不一致,请重新扫描子订单出库' })
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ const WorkListdata = [];
|
|
|
|
|
+ add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
|
|
|
+ add_searchInfo.value = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- console.log("查询订单编号数据")
|
|
|
|
|
- const order = add_searchInfo.value;
|
|
|
|
|
- const getSpotLists = await getSpotList({order:order,code:'出库'});
|
|
|
|
|
- console.log(getSpotLists)
|
|
|
|
|
|
|
+ console.log("查询订单编号数据")
|
|
|
|
|
+ const WorkListdata = [];
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ const getSpotLists = await getSpotList({order:add_searchInfo.value,code:'出库'});
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
- searcs.value = '';
|
|
|
|
|
|
|
+ add_searchInfo.value = ''
|
|
|
}
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
|
|
- const inputElement = document.querySelector('#searchInput');
|
|
|
|
|
- if (inputElement) {
|
|
|
|
|
- inputElement.focus();
|
|
|
|
|
- }
|
|
|
|
|
- }, 100); // 延迟100毫秒
|
|
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+//确认出库按钮
|
|
|
|
|
+const add_Dialog = async () => {
|
|
|
|
|
+ if(add_tableData[0]['子订单编号'] === add_searchInfo.value){
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ order_id: add_searchInfo.value,
|
|
|
|
|
+ code_ck_rq: currentDates,
|
|
|
|
|
+ code: '出库',
|
|
|
|
|
+ sys_id: _username.value,
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log(params)
|
|
|
|
|
+ const ck_gettab = await getSpotTab(params);// 发起出库请求
|
|
|
|
|
+ if (ck_gettab.code === 0) {// 出库成功后的处理
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ ElMessage({ type: 'success', message: '出库成功' });
|
|
|
|
|
+ const getSpotLists = await getSpotList({ order: add_searchInfo.value, code: '出库' });// 获取并更新表格数据
|
|
|
|
|
+ add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
|
|
+ add_searchInfo.value = ''
|
|
|
|
|
+ }else {
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ const getSpotLists = await getSpotList({ order: add_searchInfo.value, code: '出库' }); // 出库失败,重新获取数据
|
|
|
|
|
+ add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ ElMessage({type: 'warning',message: '两次扫码不一致,请重新扫描子订单出库' })
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ const WorkListdata = [];
|
|
|
|
|
+ add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
|
|
|
+ add_searchInfo.value = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (add_tableData.length > 1) {
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ ElMessage({ type: 'warning', message: '出库出现多条数据'});
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const orderData = add_tableData[0];
|
|
|
|
|
+ if (add_tableData[0]['子订单编号'] !== add_searchInfo.value) {
|
|
|
|
|
+ const WorkListdata = [];
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ const getSpotLists = await getSpotList({order:add_searchInfo.value,code:'出库'});
|
|
|
|
|
+ add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ order_id: orderData['子订单编号'],
|
|
|
|
|
+ code_ck_rq: currentDates,
|
|
|
|
|
+ code: '出库',
|
|
|
|
|
+ sys_id: _username.value,
|
|
|
|
|
+ };
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 发起出库请求
|
|
|
|
|
+ const ck_gettab = await getSpotTab(params);
|
|
|
|
|
+ if (ck_gettab.code === 0) {
|
|
|
|
|
+ // 出库成功后的处理
|
|
|
|
|
+ add_searchInfo.value = '';
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ ElMessage({ type: 'success', message: '出库成功' });
|
|
|
|
|
+ // 获取并更新表格数据
|
|
|
|
|
+ const getSpotLists = await getSpotList({ order: orderData['子订单编号'], code: '出库' });
|
|
|
|
|
+ add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ searcs.value = '';
|
|
|
|
|
+ // 出库失败,重新获取数据
|
|
|
|
|
+ const getSpotLists = await getSpotList({ order: add_searchInfo.value, code: '出库' });
|
|
|
|
|
+ add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error("出库请求失败", error);
|
|
|
|
|
+ ElMessage({ type: 'error', message: '出库请求失败,请稍后重试' });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -114,6 +212,7 @@ const Restore_onSubmit = async ()=>{
|
|
|
params.order_id = _orderid.value;
|
|
params.order_id = _orderid.value;
|
|
|
params.code_ck_rq = currentDates;
|
|
params.code_ck_rq = currentDates;
|
|
|
params.code = '恢复';
|
|
params.code = '恢复';
|
|
|
|
|
+ params.sys_id = _username.value;
|
|
|
const ck_gettab = await getSpotTab(params);
|
|
const ck_gettab = await getSpotTab(params);
|
|
|
if (ck_gettab.code === 0) {
|
|
if (ck_gettab.code === 0) {
|
|
|
searcs.value = '';
|
|
searcs.value = '';
|
|
@@ -123,6 +222,12 @@ const Restore_onSubmit = async ()=>{
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ const inputElement = document.querySelector('#searchInput');
|
|
|
|
|
+ if (inputElement) {
|
|
|
|
|
+ inputElement.focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100); // 延迟100毫秒
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//复选框选择
|
|
//复选框选择
|
|
@@ -135,50 +240,6 @@ const handleSelectionChange = (selection, type) => {
|
|
|
console.log(ckSelection.value)
|
|
console.log(ckSelection.value)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//确认出库按钮
|
|
|
|
|
-const add_Dialog = async ()=>{
|
|
|
|
|
- console.log(add_tableData[0]['子订单编号'])
|
|
|
|
|
- if (add_tableData[0]['子订单编号'] === add_searchInfo.value) {
|
|
|
|
|
- let params = {}
|
|
|
|
|
- params.order_id = add_tableData[0]['子订单编号'];
|
|
|
|
|
- params.code_ck_rq = currentDates;
|
|
|
|
|
- const ck_gettab = await getSpotTab(params);
|
|
|
|
|
- if (ck_gettab.code === 0) {
|
|
|
|
|
- searcs.value = '';
|
|
|
|
|
- ElMessage({type: 'success',message: '出库成功'});
|
|
|
|
|
- add_searchInfo.value = ''
|
|
|
|
|
- const getSpotLists = await getSpotList({order:add_tableData[0]['子订单编号'],code:'出库'});
|
|
|
|
|
- console.log(getSpotLists)
|
|
|
|
|
- add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- const order = add_searchInfo.value;
|
|
|
|
|
- const getSpotLists = await getSpotList({order:order,code:'出库'});
|
|
|
|
|
- add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
|
|
- // if(ckSelection.value === ''){
|
|
|
|
|
- // if(_orderid.value === ''){
|
|
|
|
|
- // ElMessage({type: 'warning',message: '请勾选出库订单后,再操作此功能'})
|
|
|
|
|
- // }else{
|
|
|
|
|
- //复选框中子订单编号去重
|
|
|
|
|
- // let params = {}
|
|
|
|
|
- // // params.order_id = ckSelection.value;//复选框数据
|
|
|
|
|
- // params.order_id = _orderid.value;//表格行点击数据
|
|
|
|
|
- // params.code_ck_rq = currentDates;//日期
|
|
|
|
|
- // //调用出库修改接口
|
|
|
|
|
- // const ck_gettab = await getSpotTab(params);
|
|
|
|
|
- // if (ck_gettab.code === 0) {
|
|
|
|
|
- // add_searchInfo.value = ''
|
|
|
|
|
- // ElMessage({type: 'success',message: '出库成功'});
|
|
|
|
|
- // //调用查询出库数据
|
|
|
|
|
- // const getSpotLists = await getSpotList({order:_orderid.value,code:'出库'});
|
|
|
|
|
- // add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // ElMessage({ type: 'error',message: '出库失败'})
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// =========== 分页 ===========
|
|
// =========== 分页 ===========
|
|
|
// 分页相关的响应式变量
|
|
// 分页相关的响应式变量
|
|
|
const page = ref(1)
|
|
const page = ref(1)
|
|
@@ -293,4 +354,8 @@ const tableDataCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
.mab{
|
|
.mab{
|
|
|
margin-bottom: 5px;
|
|
margin-bottom: 5px;
|
|
|
}
|
|
}
|
|
|
|
|
+ ::v-deep .el-input__wrapper #searchInput {
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ color: red;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|