|
@@ -696,6 +696,7 @@
|
|
|
title="机台印版领用"
|
|
title="机台印版领用"
|
|
|
destroy-on-close
|
|
destroy-on-close
|
|
|
width="1300px"
|
|
width="1300px"
|
|
|
|
|
+ @close="handleyinbanDialogClose"
|
|
|
style="height: 75%;"
|
|
style="height: 75%;"
|
|
|
>
|
|
>
|
|
|
<div style="margin-top:-12px">
|
|
<div style="margin-top:-12px">
|
|
@@ -816,13 +817,24 @@
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <div class="gva-pagination">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ @size-change="ybhandleSizeChange"
|
|
|
|
|
+ @current-change="ybhandleCurrentChange"
|
|
|
|
|
+ :current-page="ybpage"
|
|
|
|
|
+ :page-size="ybpageSize"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="ybtotal">
|
|
|
|
|
+ </el-pagination>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<!-- 退回弹窗 -->
|
|
<!-- 退回弹窗 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
v-model="dialogwithdrawVisible"
|
|
v-model="dialogwithdrawVisible"
|
|
|
- title="印版印数"
|
|
|
|
|
|
|
+ title="印版印数(次数)"
|
|
|
style="width: 20%; margin: 30vh auto;"
|
|
style="width: 20%; margin: 30vh auto;"
|
|
|
>
|
|
>
|
|
|
<el-form-item label="印数">
|
|
<el-form-item label="印数">
|
|
@@ -5254,6 +5266,11 @@ const onyinban = async() => {
|
|
|
yinbanVisible.value = true;
|
|
yinbanVisible.value = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const handleyinbanDialogClose = () =>{
|
|
|
|
|
+ yinbanselectData.value = []
|
|
|
|
|
+}
|
|
|
const onxuncha = async() => {
|
|
const onxuncha = async() => {
|
|
|
xunchaVisible.value=true
|
|
xunchaVisible.value=true
|
|
|
}
|
|
}
|
|
@@ -5286,10 +5303,11 @@ const FacilityInspectionItem = async (value) => {
|
|
|
const facilityPrintDetailItem = async (value) => {
|
|
const facilityPrintDetailItem = async (value) => {
|
|
|
try {
|
|
try {
|
|
|
// 调用接口获取巡检项目数据
|
|
// 调用接口获取巡检项目数据
|
|
|
- const response = await facilityPrintDetail({ workOrder: formData.value.工单编号,code:value,productCode:formData.value.productCode });
|
|
|
|
|
|
|
+ const response = await facilityPrintDetail({ workOrder: formData.value.工单编号,code:value,productCode:formData.value.productCode,page:ybpage.value,limit:ybpageSize.value });
|
|
|
// 检查接口返回的状态码
|
|
// 检查接口返回的状态码
|
|
|
if (response.code === 0) {
|
|
if (response.code === 0) {
|
|
|
- yinbanselectData.value=response.data
|
|
|
|
|
|
|
+ ybtotal.value = response.data.total
|
|
|
|
|
+ yinbanselectData.value=response.data.data
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
// 捕获并打印异常
|
|
// 捕获并打印异常
|
|
@@ -5353,6 +5371,8 @@ const onout = async () => {
|
|
|
|
|
|
|
|
if (response?.code === 0) {
|
|
if (response?.code === 0) {
|
|
|
ElMessage.success("领出成功!");
|
|
ElMessage.success("领出成功!");
|
|
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(`领出失败: ${response?.msg || "未知错误"}`);
|
|
ElMessage.error(`领出失败: ${response?.msg || "未知错误"}`);
|
|
|
}
|
|
}
|
|
@@ -5397,6 +5417,7 @@ const rawenterDialog = async () => {
|
|
|
|
|
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('收回成功')
|
|
ElMessage.success('收回成功')
|
|
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
rawcloseDialog()
|
|
rawcloseDialog()
|
|
|
// 清空选中
|
|
// 清空选中
|
|
|
currentSelection.value = []
|
|
currentSelection.value = []
|
|
@@ -5412,7 +5433,8 @@ const rawenterDialog = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const rawcloseDialog = () => {
|
|
const rawcloseDialog = () => {
|
|
|
- Plate.印数 = ''
|
|
|
|
|
|
|
+ Plate.value.印数 = ''
|
|
|
|
|
+ console.log(Plate)
|
|
|
dialogwithdrawVisible.value = false
|
|
dialogwithdrawVisible.value = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -5443,6 +5465,7 @@ const yinbaninvertSelection = () => {
|
|
|
const dianjianselectData = reactive([])
|
|
const dianjianselectData = reactive([])
|
|
|
const yinbanselectData = ref([])
|
|
const yinbanselectData = ref([])
|
|
|
const xunchaselectData = ref([])
|
|
const xunchaselectData = ref([])
|
|
|
|
|
+const yinbancode = ref('')
|
|
|
const dianjianNodeClick = (node, check, nodeData) => {
|
|
const dianjianNodeClick = (node, check, nodeData) => {
|
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|
|
|
// 点击的是父节点,且有子节点
|
|
// 点击的是父节点,且有子节点
|
|
@@ -5454,9 +5477,27 @@ const yinbanNodeClick = (node, check, nodeData) => {
|
|
|
if (node.children && node.children.length > 0) {
|
|
if (node.children && node.children.length > 0) {
|
|
|
// 点击的是父节点,且有子节点
|
|
// 点击的是父节点,且有子节点
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ yinbancode.value = node.code
|
|
|
facilityPrintDetailItem(node.code)
|
|
facilityPrintDetailItem(node.code)
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+// 印版分页
|
|
|
|
|
+const ybpage = ref(1)
|
|
|
|
|
+const ybtotal = ref(0)
|
|
|
|
|
+const ybpageSize = ref(50)
|
|
|
|
|
+const ybhandleCurrentChange = (val) => {
|
|
|
|
|
+ ybpage.value = val;
|
|
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 修改页面容量 点击多少条/页
|
|
|
|
|
+const ybhandleSizeChange = (val) => {
|
|
|
|
|
+ // page.value = 10;
|
|
|
|
|
+ ybpageSize.value = val;
|
|
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const xunchaNodeClick = (node, check, nodeData) => {
|
|
const xunchaNodeClick = (node, check, nodeData) => {
|
|
|
if(node){
|
|
if(node){
|
|
|
fieldInspectionRecord()
|
|
fieldInspectionRecord()
|
|
@@ -6162,99 +6203,124 @@ onMounted(() => {
|
|
|
|
|
|
|
|
//机台班组维护新增
|
|
//机台班组维护新增
|
|
|
const addBz = async() => {
|
|
const addBz = async() => {
|
|
|
- //数据初始化
|
|
|
|
|
- updateTotal()
|
|
|
|
|
- //判断机台和班组是否为空
|
|
|
|
|
- if(!selectedOption.value || !BZMC.value){
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- message: '机台或者班组编号不能为空'
|
|
|
|
|
- })
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
|
|
- //判断车间是否是【SY、PM】
|
|
|
|
|
- const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
|
|
- const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
|
|
- let hasValidMember = false; // 标志变量,用于检查是否有有效的组员
|
|
|
|
|
- console.log(fpsum.value)
|
|
|
|
|
-
|
|
|
|
|
- // 循环检查每个成员
|
|
|
|
|
- for (let i = 1; i <= relevantKeys.length; i++) {
|
|
|
|
|
- const codeKey = `code${i}`;
|
|
|
|
|
- const nameKey = `name${i}`;
|
|
|
|
|
- const percentageKey = `percentage${i}`;
|
|
|
|
|
- const percentageValue = parseFloat(formDatas.value[percentageKey], 10); //获取分配系数的值
|
|
|
|
|
-
|
|
|
|
|
- if (formDatas.value[codeKey] || formDatas.value[nameKey]) {
|
|
|
|
|
- console.log('有组员');
|
|
|
|
|
- if (isNaN(percentageValue) || percentageValue <= 0 || percentageValue > 1) {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: "error",
|
|
|
|
|
- message: "没有填写有效的组员或分配系数有误",
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- } else {
|
|
|
|
|
- hasValidMember = true; // 如果有有效的百分比值,则设置标志变量为true
|
|
|
|
|
|
|
+ //数据初始化
|
|
|
|
|
+ updateTotal()
|
|
|
|
|
+ //判断机台和班组是否为空
|
|
|
|
|
+ if(!selectedOption.value || !BZMC.value){
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '机台或者班组编号不能为空'
|
|
|
|
|
+ })
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 循环结束后检查标志变量
|
|
|
|
|
-if (!hasValidMember) {
|
|
|
|
|
- // 如果没有有效的组员(即所有百分比值都无效或为空),则显示错误消息
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: "error",
|
|
|
|
|
- message: "没有填写有效的组员或分配系数有误",
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
-}else if (shouldCheckLessThanOne && fpsum.value < 1) {//如果有组员,并且 shouldCheckLessThanOne 为 true(不是PM和SY机器),则检查 fpsum.value < 1
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: "error",
|
|
|
|
|
- message: "分配系数相加不能小于1",
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }else if(fpsum.value > 1) { //所有机器的分配系数之和不能大于1
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: "error",
|
|
|
|
|
- message: "分配系数相加不能大于1",
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const response = await MachineTeamAdd({
|
|
|
|
|
- sczl_jtbh: selectedOption.value.split('|')[0],
|
|
|
|
|
- sczl_bzdh: BZMC.value,
|
|
|
|
|
- sczl_bh1: formDatas.value.code1,
|
|
|
|
|
- sczl_bh2: formDatas.value.code2,
|
|
|
|
|
- sczl_bh3: formDatas.value.code3,
|
|
|
|
|
- sczl_bh4: formDatas.value.code4,
|
|
|
|
|
- sczl_bh5: formDatas.value.code5,
|
|
|
|
|
- sczl_bh6: formDatas.value.code6,
|
|
|
|
|
- sczl_bh7: formDatas.value.code7,
|
|
|
|
|
- sczl_bh8: formDatas.value.code10,
|
|
|
|
|
- sczl_bh9: formDatas.value.code9,
|
|
|
|
|
- sczl_bh10: formDatas.value.code8,
|
|
|
|
|
- sczl_rate1: formDatas.value.percentage1,
|
|
|
|
|
- sczl_rate2: formDatas.value.percentage2,
|
|
|
|
|
- sczl_rate3: formDatas.value.percentage3,
|
|
|
|
|
- sczl_rate4: formDatas.value.percentage4,
|
|
|
|
|
- sczl_rate5: formDatas.value.percentage5,
|
|
|
|
|
- sczl_rate6: formDatas.value.percentage6,
|
|
|
|
|
- sczl_rate7: formDatas.value.percentage7,
|
|
|
|
|
- sczl_rate8: formDatas.value.percentage10,
|
|
|
|
|
- sczl_rate9: formDatas.value.percentage9,
|
|
|
|
|
- sczl_rate10: formDatas.value.percentage8,
|
|
|
|
|
- sys_id: sys_id
|
|
|
|
|
- })
|
|
|
|
|
- if (response.code === 0) {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'success',
|
|
|
|
|
- message: '成功'
|
|
|
|
|
|
|
+ const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
|
|
+ //判断车间是否是【SY、PM】
|
|
|
|
|
+ const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
|
|
+ let hasValidMember = false; // 标志变量,用于检查是否有有效的组员
|
|
|
|
|
+ let hasEmptyBefore = false; // 标记是否已经出现过空项
|
|
|
|
|
+
|
|
|
|
|
+ // 按1-10的顺序验证
|
|
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
|
|
+ const codeKey = `code${i}`;
|
|
|
|
|
+ const percentageKey = `percentage${i}`;
|
|
|
|
|
+
|
|
|
|
|
+ const hasCode = formDatas.value[codeKey] && formDatas.value[codeKey].trim() !== '';
|
|
|
|
|
+ const hasPercentage = formDatas.value[percentageKey] !== undefined &&
|
|
|
|
|
+ formDatas.value[percentageKey] !== null &&
|
|
|
|
|
+ formDatas.value[percentageKey] !== '';
|
|
|
|
|
+
|
|
|
|
|
+ // 如果当前项为空,标记hasEmptyBefore为true
|
|
|
|
|
+ if (!hasCode && !hasPercentage) {
|
|
|
|
|
+ hasEmptyBefore = true;
|
|
|
|
|
+ continue; // 跳过空项的进一步检查
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果当前项有值,但前面已经有空项了,报错
|
|
|
|
|
+ if (hasEmptyBefore) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: `请按顺序填写组员信息,第${i}项之前不能有空项`,
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查对应关系 - code和percentage必须同时有
|
|
|
|
|
+ if (!hasCode || !hasPercentage) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: `第${i}项的工号和分配系数必须同时填写`,
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查百分比值是否有效
|
|
|
|
|
+ const percentageValue = parseFloat(formDatas.value[percentageKey]);
|
|
|
|
|
+ if (isNaN(percentageValue) || percentageValue <= 0 || percentageValue > 1) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: `第${i}项分配系数必须在0到1之间`,
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ hasValidMember = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 循环结束后检查标志变量
|
|
|
|
|
+ if (!hasValidMember) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: "至少需要填写一个有效的组员和分配系数",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else if (shouldCheckLessThanOne && fpsum.value < 1) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: "分配系数相加不能小于1",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else if(fpsum.value > 1) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ message: "分配系数相加不能大于1",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const response = await MachineTeamAdd({
|
|
|
|
|
+ sczl_jtbh: selectedOption.value.split('|')[0],
|
|
|
|
|
+ sczl_bzdh: BZMC.value,
|
|
|
|
|
+ sczl_bh1: formDatas.value.code1,
|
|
|
|
|
+ sczl_bh2: formDatas.value.code2,
|
|
|
|
|
+ sczl_bh3: formDatas.value.code3,
|
|
|
|
|
+ sczl_bh4: formDatas.value.code4,
|
|
|
|
|
+ sczl_bh5: formDatas.value.code5,
|
|
|
|
|
+ sczl_bh6: formDatas.value.code6,
|
|
|
|
|
+ sczl_bh7: formDatas.value.code7,
|
|
|
|
|
+ sczl_bh8: formDatas.value.code10,
|
|
|
|
|
+ sczl_bh9: formDatas.value.code9,
|
|
|
|
|
+ sczl_bh10: formDatas.value.code8,
|
|
|
|
|
+ sczl_rate1: formDatas.value.percentage1,
|
|
|
|
|
+ sczl_rate2: formDatas.value.percentage2,
|
|
|
|
|
+ sczl_rate3: formDatas.value.percentage3,
|
|
|
|
|
+ sczl_rate4: formDatas.value.percentage4,
|
|
|
|
|
+ sczl_rate5: formDatas.value.percentage5,
|
|
|
|
|
+ sczl_rate6: formDatas.value.percentage6,
|
|
|
|
|
+ sczl_rate7: formDatas.value.percentage7,
|
|
|
|
|
+ sczl_rate8: formDatas.value.percentage10,
|
|
|
|
|
+ sczl_rate9: formDatas.value.percentage9,
|
|
|
|
|
+ sczl_rate10: formDatas.value.percentage8,
|
|
|
|
|
+ sys_id: sys_id
|
|
|
})
|
|
})
|
|
|
- FacilityTeam(JTMC)
|
|
|
|
|
- fetchData()
|
|
|
|
|
- // FacilityProduction()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response.code === 0) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '成功'
|
|
|
|
|
+ })
|
|
|
|
|
+ FacilityTeam(JTMC)
|
|
|
|
|
+ fetchData()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const currentBz ={}
|
|
const currentBz ={}
|
|
|
const selectBz = async() => {
|
|
const selectBz = async() => {
|