|
|
@@ -1120,6 +1120,17 @@
|
|
|
width="80"
|
|
|
/>
|
|
|
</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>
|
|
|
</el-dialog>
|
|
|
@@ -3263,10 +3274,10 @@ const warningres = (arr) => {
|
|
|
const nameKey = `name${i}`;
|
|
|
|
|
|
// 如果 code 有值,且对应的 name 没有值,则清空 code 的值
|
|
|
- if (formDatas.value[codeKey] !== '' && formDatas.value[nameKey] === '') {
|
|
|
- formDatas.value[codeKey] = ''; // 清空 code 的值
|
|
|
- console.log(`清空了 ${codeKey} 的值,因为 ${nameKey} 为空`);
|
|
|
- }
|
|
|
+ // if (formDatas.value[codeKey] !== '' && formDatas.value[nameKey] === '') {
|
|
|
+ // formDatas.value[codeKey] = ''; // 清空 code 的值
|
|
|
+ // console.log(`清空了 ${codeKey} 的值,因为 ${nameKey} 为空`);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
let nextIndex = 1;
|
|
|
@@ -3276,7 +3287,7 @@ const warningres = (arr) => {
|
|
|
formDatas.value[`name${nextIndex}`] !== ''
|
|
|
) {
|
|
|
nextIndex++;
|
|
|
- if (nextIndex > 4) { // 这里只处理4个输入框的情况
|
|
|
+ if (nextIndex > 8) { // 这里只处理4个输入框的情况
|
|
|
// 如果所有字段都已经填满,则不做任何事情并退出函数
|
|
|
return;
|
|
|
}
|
|
|
@@ -3672,12 +3683,13 @@ const warningres = (arr) => {
|
|
|
try {
|
|
|
formData.value.code=value
|
|
|
// 调用接口获取巡检项目数据
|
|
|
- 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 });
|
|
|
console.log("机台印版领用")
|
|
|
// 检查接口返回的状态码
|
|
|
if (response.code === 0) {
|
|
|
console.log(response)
|
|
|
- yinbanselectData.value=response.data
|
|
|
+ ybtotal.value = response.data.total
|
|
|
+ yinbanselectData.value=response.data.data
|
|
|
}
|
|
|
} catch (error) {
|
|
|
// 捕获并打印异常
|
|
|
@@ -3685,6 +3697,8 @@ const warningres = (arr) => {
|
|
|
return null;
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ const yinbancode = ref('')
|
|
|
const yinbanNodeClick = (node, check, nodeData) => {
|
|
|
if (node.children && node.children.length > 0) {
|
|
|
// 点击的是父节点,且有子节点
|
|
|
@@ -3694,9 +3708,27 @@ const warningres = (arr) => {
|
|
|
// 点击的是子节点,或者没有子节点
|
|
|
// 执行相应的子节点单击事件处理逻辑
|
|
|
yinbanselectData.value=[]
|
|
|
+ yinbancode.value = 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 onyinban = async() => {
|
|
|
console.log(formData.value)
|
|
|
if(formData.value.产品代号==''){
|
|
|
@@ -3757,6 +3789,7 @@ const warningres = (arr) => {
|
|
|
if(response.code===0){
|
|
|
facilityPrintDetailItem(formData.value.code)
|
|
|
successres('成功!')
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -3812,6 +3845,7 @@ const Plate = ref({ 印数: '' });
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('收回成功')
|
|
|
+ facilityPrintDetailItem(yinbancode.value);
|
|
|
rawcloseDialog()
|
|
|
// 清空选中
|
|
|
yinbanSelection.value = []
|
|
|
@@ -5572,83 +5606,106 @@ onMounted(() => {
|
|
|
|
|
|
//机台班组维护新增
|
|
|
const addBz = async() => {
|
|
|
- //数据初始化
|
|
|
- updateTotal()
|
|
|
- //判断机台和班组是否为空
|
|
|
- if(!selectedOption.value || !BZMC.value){
|
|
|
- warningres('机台或者班组编号不能为空')
|
|
|
- return;
|
|
|
- }
|
|
|
- const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
- //判断车间是否是【SY、PM】
|
|
|
- const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
- console.log(fpsum.value)
|
|
|
- const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
- let hasValidMember = false; // 标志变量,用于检查是否有有效的组员
|
|
|
-
|
|
|
- // 循环检查每个成员
|
|
|
- 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) {
|
|
|
- errorres('没有填写有效的组员或分配系数有误')
|
|
|
- return;
|
|
|
- } else {
|
|
|
- hasValidMember = true; // 如果有有效的百分比值,则设置标志变量为true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 循环结束后检查标志变量
|
|
|
- if (!hasValidMember) {
|
|
|
- // 如果没有有效的组员(即所有百分比值都无效或为空),则显示错误消息
|
|
|
- errorres('没有填写有效的组员或分配系数有误')
|
|
|
- return;
|
|
|
- }else if (shouldCheckLessThanOne && fpsum.value < 1) {//如果有组员,并且 shouldCheckLessThanOne 为 true(不是PM和SY机器),则检查 fpsum.value < 1
|
|
|
- errorres('分配系数相加不能小于1')
|
|
|
- return;
|
|
|
- }else if(fpsum.value > 1) { //所有机器的分配系数之和不能大于1
|
|
|
- errorres('分配系数相加不能大于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: '【'+MAC.value+'/'+JTMC+'】'
|
|
|
- })
|
|
|
- if (response.code === 0) {
|
|
|
- FacilityProduction()
|
|
|
- successres('添加成功')
|
|
|
- }
|
|
|
- }
|
|
|
+ //数据初始化
|
|
|
+ updateTotal()
|
|
|
+ //判断机台和班组是否为空
|
|
|
+ if(!selectedOption.value || !BZMC.value){
|
|
|
+ warningres('机台或者班组编号不能为空')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
+ //判断车间是否是【SY、PM】
|
|
|
+ const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+ let hasValidMember = false; // 标志变量,用于检查是否有有效的组员
|
|
|
+ let hasEmptyBefore = false; // 标记是否已经出现过空项
|
|
|
+
|
|
|
+ // 定义字段顺序 [1,2,3,4,5,6,7,10,9,8]
|
|
|
+ const fieldOrder = [1,2,3,4,5,6,7,8,9,10];
|
|
|
+
|
|
|
+ for (let i = 0; i < fieldOrder.length; i++) {
|
|
|
+ const index = fieldOrder[i];
|
|
|
+ const codeKey = `code${index}`;
|
|
|
+ const nameKey = `name${index}`;
|
|
|
+ const percentageKey = `percentage${index}`;
|
|
|
+
|
|
|
+ const hasCode = formDatas.value[codeKey] && formDatas.value[codeKey].trim() !== '';
|
|
|
+ const hasName = formDatas.value[nameKey] && formDatas.value[nameKey].trim() !== '';
|
|
|
+ const hasPercentage = formDatas.value[percentageKey] !== undefined &&
|
|
|
+ formDatas.value[percentageKey] !== null &&
|
|
|
+ formDatas.value[percentageKey] !== '';
|
|
|
+
|
|
|
+ // 如果当前项为空,标记hasEmptyBefore为true
|
|
|
+ if (!hasCode && !hasName && !hasPercentage) {
|
|
|
+ hasEmptyBefore = true;
|
|
|
+ continue; // 跳过空项的进一步检查
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果当前项有值,但前面已经有空项了,报错
|
|
|
+ if (hasEmptyBefore) {
|
|
|
+ errorres(`请按顺序填写组员信息,第${index}项之前不能有空项`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否有code或name但没有percentage
|
|
|
+ if ((hasCode || hasName) && !hasPercentage) {
|
|
|
+ errorres(`第${index}项的工号/姓名和分配系数必须同时填写`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查percentage是否有效
|
|
|
+ const percentageValue = parseFloat(formDatas.value[percentageKey]);
|
|
|
+ if (isNaN(percentageValue) || percentageValue <= 0 || percentageValue > 1) {
|
|
|
+ errorres(`第${index}项分配系数必须在0到1之间`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ hasValidMember = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 循环结束后检查标志变量
|
|
|
+ if (!hasValidMember) {
|
|
|
+ errorres('至少需要填写一个有效的组员和分配系数');
|
|
|
+ return;
|
|
|
+ } else if (shouldCheckLessThanOne && fpsum.value < 1) {
|
|
|
+ errorres('分配系数相加不能小于1');
|
|
|
+ return;
|
|
|
+ } else if(fpsum.value > 1) {
|
|
|
+ errorres('分配系数相加不能大于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: '【'+MAC.value+'/'+JTMC+'】'
|
|
|
+ })
|
|
|
+
|
|
|
+ if (response.code === 0) {
|
|
|
+ FacilityProduction()
|
|
|
+ successres('添加成功')
|
|
|
+ }
|
|
|
+}
|
|
|
//机台班组维护更新当前班组
|
|
|
const selectBz = async() => {
|
|
|
updateTotal()
|