|
|
@@ -22,8 +22,7 @@
|
|
|
<el-table ref="multipleTable" style="width: 100%;height: 64vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="add_tableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
+ :data="add_tableData" border row-key="ID" size="small"
|
|
|
:cell-class-name="tableDataCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="add_updateCompanyFunc"
|
|
|
@row-click="add_tableRowClick" :show-overflow-tooltip="true"
|
|
|
@@ -35,6 +34,7 @@
|
|
|
<el-table-column sortable align="left" label="款式" prop="款式" width="100"/>
|
|
|
<el-table-column sortable align="left" label="色系名称" prop="颜色" width="150"/>
|
|
|
<el-table-column sortable align="left" label="是否出库" prop="是否出库" width="120"/>
|
|
|
+ <el-table-column sortable align="left" label="出库时间" prop="ck_rq" width="120"/>
|
|
|
</el-table>
|
|
|
<div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
|
</div>
|
|
|
@@ -44,20 +44,20 @@
|
|
|
</layout>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
import {ref, reactive} from 'vue'
|
|
|
import {getSpotList,getSpotTab} from '@/api/mes/job'
|
|
|
import {ElMessage} from "element-plus";
|
|
|
-import { get } from 'scriptjs';
|
|
|
+// import { get } from 'scriptjs';
|
|
|
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 year = today.getFullYear();
|
|
|
@@ -68,37 +68,34 @@ const minutes = String(today.getMinutes()).padStart(2, '0');
|
|
|
const seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
const currentDates = `${year}-${month}-${day}`;
|
|
|
-
|
|
|
+//自动聚焦光标input
|
|
|
const getMachineMacdata = async () => {
|
|
|
setTimeout(() => {
|
|
|
- const inputElement = document.getElementById('searchInput');
|
|
|
- if (inputElement) {
|
|
|
- inputElement.focus();
|
|
|
- }
|
|
|
- }, 100); // 延迟100毫秒
|
|
|
+ const inputElement = document.getElementById('searchInput');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100); // 延迟100毫秒
|
|
|
}
|
|
|
getMachineMacdata();
|
|
|
|
|
|
+//全局调用参数
|
|
|
const add_searchInfo = ref('')//搜索
|
|
|
const add_tableData = reactive([])//表格
|
|
|
-const _orderid = ref('')//订单自编号
|
|
|
-const searcs = ref('')
|
|
|
+const _orderid = ref('')//订单子编号
|
|
|
+const searcs = ref('')//默认记录扫描两次出库
|
|
|
|
|
|
//表格行点击
|
|
|
const add_tableRowClick = async (row)=>{
|
|
|
- add_searchInfo.value = row.子订单编号
|
|
|
+// add_searchInfo.value = row.子订单编号
|
|
|
console.log(row)
|
|
|
_orderid.value = row.子订单编号
|
|
|
}
|
|
|
|
|
|
//点击【查询】按钮
|
|
|
const add_onSubmit = async ()=>{
|
|
|
- setTimeout(() => {
|
|
|
- const inputElement = document.querySelector('#searchInput');
|
|
|
- if (inputElement) {
|
|
|
- inputElement.focus();
|
|
|
- }
|
|
|
- }, 100); // 延迟100毫秒
|
|
|
+ //自动聚焦光标input
|
|
|
+ getMachineMacdata();
|
|
|
|
|
|
if(add_searchInfo.value === ''){
|
|
|
const WorkListdata = [];
|
|
|
@@ -106,19 +103,19 @@ const add_onSubmit = async ()=>{
|
|
|
add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
|
ElMessage({type: 'warning',message: '请扫描子订单编号' })
|
|
|
}else{
|
|
|
- if (add_searchInfo.value.includes('-')) {
|
|
|
- if(searcs.value == ''){
|
|
|
+ if (add_searchInfo.value.includes('-')) {//子订单编号
|
|
|
+ if(searcs.value == ''){ //第一次扫码 查询数据
|
|
|
console.log("查询子订单编号数据")
|
|
|
- const getSpotLists = await getSpotList({order:add_searchInfo.value,code:'出库'});
|
|
|
+ const getSpotLists = await getSpotList({order:add_searchInfo.value,code:'出库'});//出库报工修改
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
add_searchInfo.value = ''
|
|
|
searcs.value = 1;
|
|
|
return;
|
|
|
}
|
|
|
- if(searcs.value == 1){
|
|
|
+ if(searcs.value == 1){//第二次扫码,如果两次相同代表可以出库
|
|
|
if(add_tableData[0]['子订单编号'] === add_searchInfo.value){
|
|
|
console.log("出库")
|
|
|
- add_Dialogs();
|
|
|
+ add_Dialogs();//调用出库按钮
|
|
|
searcs.value = '';
|
|
|
}else{
|
|
|
ElMessage({type: 'warning',message: '两次扫码不一致,请重新扫描子订单出库' })
|
|
|
@@ -128,45 +125,48 @@ const add_onSubmit = async ()=>{
|
|
|
add_searchInfo.value = ''
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- 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_searchInfo.value = ''
|
|
|
+ } else {//订单编号
|
|
|
+ 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_searchInfo.value = ''
|
|
|
}
|
|
|
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
//确认出库按钮
|
|
|
const add_Dialog = async () => {
|
|
|
- let params = {
|
|
|
- order_id: _orderid.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: _orderid.value, code: '出库' });// 获取并更新表格数据
|
|
|
- add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
- add_searchInfo.value = ''
|
|
|
- }else {
|
|
|
- searcs.value = '';
|
|
|
- const getSpotLists = await getSpotList({ order: _orderid.value, code: '出库' }); // 出库失败,重新获取数据
|
|
|
+ // console.log("确认出库按钮")
|
|
|
+ let params = {}
|
|
|
+ if(_orderid.value === ''){
|
|
|
+ params.order_id = add_tableData[0]['子订单编号'];
|
|
|
+ }else{
|
|
|
+ params.order_id = _orderid.value;
|
|
|
+ }
|
|
|
+ params.code = '出库';
|
|
|
+ params.sys_id = _username.value;
|
|
|
+ const ck_gettab = await getSpotTab(params);// 发起出库请求
|
|
|
+ if (ck_gettab.code === 0) {// 出库成功后的处理
|
|
|
+ searcs.value = '';
|
|
|
+ ElMessage({ type: 'success', message: '出库成功'});
|
|
|
+ const getSpotLists = await getSpotList({order:params.order_id,code: '出库'});// 获取并更新表格数据
|
|
|
+ add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
+ add_searchInfo.value = ''
|
|
|
+ }else {
|
|
|
+ searcs.value = '';
|
|
|
+ const getSpotLists = await getSpotList({order: params.order_id, code: '出库'}); // 出库失败,重新获取数据
|
|
|
add_tableData.splice(0, add_tableData.length, ...getSpotLists.data.data);
|
|
|
}
|
|
|
}
|
|
|
-//扫码确认出库按钮
|
|
|
+
|
|
|
+//确认出库按钮
|
|
|
const add_Dialogs = async () => {
|
|
|
if(add_tableData[0]['子订单编号'] === add_searchInfo.value){
|
|
|
let params = {
|
|
|
order_id: add_searchInfo.value,
|
|
|
- code_ck_rq: currentDates,
|
|
|
code: '出库',
|
|
|
sys_id: _username.value,
|
|
|
};
|
|
|
@@ -192,7 +192,7 @@ const add_Dialogs = async () => {
|
|
|
}
|
|
|
return false;
|
|
|
|
|
|
-
|
|
|
+//下面代码代表多条出库
|
|
|
if (add_tableData.length > 1) {
|
|
|
searcs.value = '';
|
|
|
ElMessage({ type: 'warning', message: '出库出现多条数据'});
|
|
|
@@ -208,7 +208,6 @@ const add_Dialogs = async () => {
|
|
|
}
|
|
|
let params = {
|
|
|
order_id: orderData['子订单编号'],
|
|
|
- code_ck_rq: currentDates,
|
|
|
code: '出库',
|
|
|
sys_id: _username.value,
|
|
|
};
|
|
|
@@ -254,12 +253,8 @@ const Restore_onSubmit = async ()=>{
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.data);
|
|
|
}
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- const inputElement = document.querySelector('#searchInput');
|
|
|
- if (inputElement) {
|
|
|
- inputElement.focus();
|
|
|
- }
|
|
|
- }, 100); // 延迟100毫秒
|
|
|
+ //自动聚焦光标input
|
|
|
+ getMachineMacdata();
|
|
|
}
|
|
|
|
|
|
//复选框选择
|