|
@@ -11,6 +11,18 @@
|
|
|
style="width: 230px;margin: 5px;height: 50px;">
|
|
style="width: 230px;margin: 5px;height: 50px;">
|
|
|
</el-input>
|
|
</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-form-item label="机台号:" prop="deliveryDate" class="mab" style="font-size: 30px;margin: 10px;">
|
|
|
|
|
+ <el-input v-model="add_formData['机台号']" disabled style="width: 70px;height: 40px;" id="机台号" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="工序:" prop="deliveryDate" class="mab"style="font-size: 30px;margin: 10px;" label-width="90">
|
|
|
|
|
+ <el-input v-model="add_formData['工序']" disabled style="width: 70px;height: 40px;" id="工序" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="组别:" prop="deliveryDate" class="mab" style="font-size: 30px;margin: 10px;" label-width="90">
|
|
|
|
|
+ <el-input v-model="add_formData['组别']" disabled style="width: 90px;height: 40px;" id="组别" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="人员:" prop="deliveryDate" class="mab" style="font-size: 30px;margin: 10px;" label-width="90">
|
|
|
|
|
+ <el-input v-model="add_formData['人员']" disabled style="width: 90px;height: 40px;" id="人员" />
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row :gutter="24">
|
|
<el-row :gutter="24">
|
|
@@ -161,11 +173,43 @@ export default {
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
|
|
|
|
|
import {ref, reactive} from 'vue'
|
|
import {ref, reactive} from 'vue'
|
|
|
-import {getSpotList,getInfo} from '@/api/mes/job'
|
|
|
|
|
|
|
+import {getSpotList,getInfo,getMachineMac} from '@/api/mes/job'
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
defineOptions({name: 'Company'})
|
|
defineOptions({name: 'Company'})
|
|
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
+const add_formData = reactive({
|
|
|
|
|
+ 机台号: '',
|
|
|
|
|
+ 工序: '',
|
|
|
|
|
+ 组别: '',
|
|
|
|
|
+ 人员: '',
|
|
|
|
|
+ 尺码: '',
|
|
|
|
|
+ 数量: '',
|
|
|
|
|
+ 是否订单尾包: '',
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//全局接口接受的物理地址
|
|
|
|
|
+const Machine = '70-ED-A4-26-5F-32'
|
|
|
|
|
+//全局获取code,接口接收code
|
|
|
|
|
+const _code = '裁切'
|
|
|
|
|
+//全局获取UniqId
|
|
|
|
|
+const UniqId = ref('')
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//物理地址获取机台编号
|
|
|
|
|
+const getMachineMacdata = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const data = await getMachineMac({sys_sbID:Machine,code:_code});
|
|
|
|
|
+ add_formData['机台号'] = data.data['机台号']
|
|
|
|
|
+ add_formData['工序'] = data.data['生产工序']
|
|
|
|
|
+ add_formData['组别'] = data.data['组别']
|
|
|
|
|
+ add_formData['人员'] = data.data['组长']
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+getMachineMacdata();
|
|
|
//全局调用获取当前日期
|
|
//全局调用获取当前日期
|
|
|
const today = new Date();
|
|
const today = new Date();
|
|
|
const year = today.getFullYear();
|
|
const year = today.getFullYear();
|
|
@@ -228,28 +272,16 @@ const scsformdata = reactive({
|
|
|
sctotal:'',
|
|
sctotal:'',
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-//实采相加
|
|
|
|
|
|
|
+//实裁相加
|
|
|
function updateTotal() {
|
|
function updateTotal() {
|
|
|
// 直接指定要累加的属性名
|
|
// 直接指定要累加的属性名
|
|
|
const relevantKeys = ['scs1', 'scs2', 'scs3', 'scs4', 'scs5', 'scs6', 'scs7', 'scs8', 'scs9', 'scs10'];
|
|
const relevantKeys = ['scs1', 'scs2', 'scs3', 'scs4', 'scs5', 'scs6', 'scs7', 'scs8', 'scs9', 'scs10'];
|
|
|
const values = relevantKeys.map(key => parseInt(scsformdata[key], 10) || 0); // 使用 || 0 来处理可能的 NaN 或 undefined/null
|
|
const values = relevantKeys.map(key => parseInt(scsformdata[key], 10) || 0); // 使用 || 0 来处理可能的 NaN 或 undefined/null
|
|
|
scsformdata.sctotal = values.reduce((sum, value) => sum + value, 0);
|
|
scsformdata.sctotal = values.reduce((sum, value) => sum + value, 0);
|
|
|
}
|
|
}
|
|
|
-// const sctotal = async ()=>{
|
|
|
|
|
-// return [
|
|
|
|
|
-// scsformdata.scs1,
|
|
|
|
|
-// scsformdata.scs2,
|
|
|
|
|
-// scsformdata.scs3,
|
|
|
|
|
-// scsformdata.scs4,
|
|
|
|
|
-// scsformdata.scs5,
|
|
|
|
|
-// scsformdata.scs6,
|
|
|
|
|
-// scsformdata.scs7,
|
|
|
|
|
-// scsformdata.scs8,
|
|
|
|
|
-// scsformdata.scs9,
|
|
|
|
|
-// ].reduce((total, currentValue) => total + currentValue, 0);
|
|
|
|
|
-// }
|
|
|
|
|
const add_tableData = ref([]);
|
|
const add_tableData = ref([]);
|
|
|
const _order = ref('');
|
|
const _order = ref('');
|
|
|
|
|
+const _UniqId = ref('');
|
|
|
|
|
|
|
|
//点击【查询】按钮
|
|
//点击【查询】按钮
|
|
|
const add_onSubmit = async ()=>{
|
|
const add_onSubmit = async ()=>{
|
|
@@ -263,7 +295,7 @@ const add_onSubmit = async ()=>{
|
|
|
const getSpotLists = await getSpotList({order:order,code:'裁切'});
|
|
const getSpotLists = await getSpotList({order:order,code:'裁切'});
|
|
|
console.log(getSpotLists)
|
|
console.log(getSpotLists)
|
|
|
add_tableData.value = getSpotLists.data.data;
|
|
add_tableData.value = getSpotLists.data.data;
|
|
|
-
|
|
|
|
|
|
|
+ _UniqId.value = getSpotLists.data.list[0].UniqId
|
|
|
const keys1 = ['cm1', 'cm2', 'cm3', 'cm4','cm5','cm6','cm7','cm8','cm9','cm10','cm11',];
|
|
const keys1 = ['cm1', 'cm2', 'cm3', 'cm4','cm5','cm6','cm7','cm8','cm9','cm10','cm11',];
|
|
|
// const keys2 = ['zds1', 'zds2', 'zds3', 'zds4','zds5','zds6','zds7','zds8','zds9','zds10','zdtotal',];
|
|
// const keys2 = ['zds1', 'zds2', 'zds3', 'zds4','zds5','zds6','zds7','zds8','zds9','zds10','zdtotal',];
|
|
|
if(order.includes('-')){
|
|
if(order.includes('-')){
|
|
@@ -272,11 +304,6 @@ const add_onSubmit = async ()=>{
|
|
|
cmformdata[key] = getSpotLists.data.list[0][key];
|
|
cmformdata[key] = getSpotLists.data.list[0][key];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // for (let key of keys2) {
|
|
|
|
|
- // if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
|
|
|
|
|
- // zdsformdata[key] = getSpotLists.data.list[0][key];
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
const inputElement = document.getElementById('scs1');
|
|
const inputElement = document.getElementById('scs1');
|
|
|
if (inputElement) {
|
|
if (inputElement) {
|
|
@@ -317,21 +344,26 @@ const add_Dialog = async ()=>{
|
|
|
}else{
|
|
}else{
|
|
|
if (_order.value.indexOf('-') !== -1) {
|
|
if (_order.value.indexOf('-') !== -1) {
|
|
|
let params = {}
|
|
let params = {}
|
|
|
- for (let i = 1; i <= 10; i++) {
|
|
|
|
|
- const key = `scs${i}`; // 动态构建键名
|
|
|
|
|
- if (scsformdata.hasOwnProperty(key)) { // 检查 scsformdata 是否包含该属性
|
|
|
|
|
- params[key] = scsformdata[key]; // 将属性复制到 params
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ params.scsl1 = scsformdata.scs1
|
|
|
|
|
+ params.scsl2 = scsformdata.scs2
|
|
|
|
|
+ params.scsl3 = scsformdata.scs3
|
|
|
|
|
+ params.scsl4 = scsformdata.scs4
|
|
|
|
|
+ params.scsl5 = scsformdata.scs5
|
|
|
|
|
+ params.scsl6 = scsformdata.scs6
|
|
|
|
|
+ params.scsl7 = scsformdata.scs7
|
|
|
|
|
+ params.scsl8 = scsformdata.scs8
|
|
|
|
|
+ params.scsl9 = scsformdata.scs9
|
|
|
|
|
+ params.scsl10 = scsformdata.scs10
|
|
|
params.sctotal = scsformdata['sctotal'];
|
|
params.sctotal = scsformdata['sctotal'];
|
|
|
- params.order = _order.value;//子订单编号
|
|
|
|
|
|
|
+ params.order_id = _order.value;//子订单编号
|
|
|
params.rq = currentDates;//时间
|
|
params.rq = currentDates;//时间
|
|
|
|
|
+ params.UniqId = _UniqId.value
|
|
|
console.log(params)
|
|
console.log(params)
|
|
|
- //裁切完工报工
|
|
|
|
|
|
|
+ //裁切完工报工接口
|
|
|
const baogong_getInfo = await getInfo(params);
|
|
const baogong_getInfo = await getInfo(params);
|
|
|
if (baogong_getInfo.code === 0) {
|
|
if (baogong_getInfo.code === 0) {
|
|
|
- ElMessage({type: 'success',message: '报工成功'});
|
|
|
|
|
- const getSpotToLists = await getSpotToList();
|
|
|
|
|
|
|
+ ElMessage({type: 'success',message: '报工成功'});
|
|
|
|
|
+ const getSpotToLists = await getSpotList({order:order_id,code:_code});
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotToLists.data.data);
|
|
add_tableData.splice(0,add_tableData.length,...getSpotToLists.data.data);
|
|
|
add_searchInfo.value = ''
|
|
add_searchInfo.value = ''
|
|
|
} else {
|
|
} else {
|
|
@@ -340,7 +372,6 @@ const add_Dialog = async ()=>{
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage({type: 'warning',message: '请扫描子订单后,再操作此功能'})
|
|
ElMessage({type: 'warning',message: '请扫描子订单后,再操作此功能'})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|