CCL_QMS检验
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10685 lines
388 KiB

​
​
​
1 month ago
​
​
​
​
​
​
​
6 months ago
​
6 months ago
​
​
​
​
​
6 months ago
1 month ago
6 months ago
6 months ago
1 month ago
​
1 month ago
​
​
​
​
​
​
​
5 months ago
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
5 months ago
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
5 months ago
​
​
​
​
5 months ago
​
5 months ago
5 months ago
5 months ago
​
​
5 months ago
5 months ago
5 months ago
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
5 months ago
3 months ago
5 months ago
​
5 months ago
​
3 months ago
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
5 months ago
​
6 months ago
​
3 months ago
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
6 months ago
6 months ago
6 months ago
​
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
6 months ago
3 months ago
6 months ago
​
​
​
3 months ago
6 months ago
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
5 months ago
​
​
​
6 months ago
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
2 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
6 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
3 months ago
6 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
6 months ago
​
3 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
5 months ago
​
6 months ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
1 month ago
​
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
1 month ago
​
3 months ago
​
​
​
​
6 months ago
​
3 months ago
​
​
​
​
6 months ago
5 months ago
3 months ago
​
​
6 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
3 months ago
​
6 months ago
3 months ago
6 months ago
​
​
​
​
3 months ago
​
3 months ago
​
​
​
6 months ago
3 months ago
​
3 months ago
3 months ago
6 months ago
5 months ago
3 months ago
5 months ago
3 months ago
3 months ago
​
​
​
​
​
​
​
​
6 months ago
​
​
​
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
5 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
3 months ago
6 months ago
​
​
3 months ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
3 months ago
​
​
5 months ago
6 months ago
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
​
​
​
5 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
6 months ago
​
3 months ago
5 months ago
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
6 months ago
3 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
6 months ago
​
​
​
3 months ago
​
6 months ago
3 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
6 months ago
​
​
​
3 months ago
​
​
​
​
6 months ago
​
3 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
6 months ago
​
3 months ago
6 months ago
6 months ago
3 months ago
​
​
6 months ago
​
​
​
​
​
​
​
3 months ago
6 months ago
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
6 months ago
​
3 months ago
​
​
​
​
6 months ago
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
3 months ago
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
5 months ago
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
6 months ago
​
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
​
​
6 months ago
​
​
6 months ago
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
5 months ago
6 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
6 months ago
5 months ago
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
5 months ago
6 months ago
5 months ago
​
​
​
​
​
​
​
​
​
6 months ago
5 months ago
​
6 months ago
5 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
5 months ago
6 months ago
​
​
​
5 months ago
6 months ago
​
​
​
5 months ago
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
6 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
5 months ago
6 months ago
5 months ago
​
​
​
​
​
​
​
​
​
6 months ago
5 months ago
​
6 months ago
5 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
6 months ago
​
​
5 months ago
6 months ago
​
​
​
5 months ago
6 months ago
​
5 months ago
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
3 months ago
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="$t('qc.method.colSite')">
  6. <el-select v-model="searchData.site" :placeholder="$t('qc.common.selectPlaceholder')" clearable filterable
  7. style="width: 140px">
  8. <el-option v-for="i in siteList" :key="i.site" :label="i.sitename ? (i.site + ' ' + i.sitename) : i.site"
  9. :value="i.site">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <!-- <el-form-item :label="'BU'">
  14. <el-select v-model="searchData.bu" :placeholder="$t('qc.common.selectPlaceholder')" clearable
  15. style="width: 120px">
  16. <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc" :value="i.buNo">
  17. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  18. <span
  19. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  20. {{ i.buDesc }}
  21. </span>
  22. </el-option>
  23. </el-select>
  24. </el-form-item> -->
  25. <el-form-item :label="$t('qc.table.materialCode')">
  26. <el-input v-model="searchData.partNo" clearable style="width: 100px"></el-input>
  27. </el-form-item>
  28. <!-- <el-form-item :label="'SKU'">
  29. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  30. </el-form-item> -->
  31. <el-form-item :label="$t('qc.table.materialName')">
  32. <el-input v-model="searchData.partDesc" clearable style="width: 180px"></el-input>
  33. </el-form-item>
  34. <el-form-item :label="$t('qc.table.partType')">
  35. <el-input v-model="searchData.partType" clearable style="width: 120px"></el-input>
  36. </el-form-item>
  37. <el-form-item :label="$t('qc.table.spec')">
  38. <el-input v-model="searchData.spec" clearable style="width: 120px"></el-input>
  39. </el-form-item>
  40. <el-form-item :label="' '">
  41. <el-button type="primary" :loading="searchLoading"
  42. @click="getDataList()">{{ $t('qc.common.search') }}</el-button>
  43. </el-form-item>
  44. <el-form-item :label="' '">
  45. <el-button @click="exportExcel()" type="primary"
  46. style="margin-left: 2px">{{ $t('qc.common.export') }}</el-button>
  47. </el-form-item>
  48. <el-form-item :label="' '">
  49. <el-button v-if="!authSync" type="primary" :loading="syncLoading" @click="syncPartCatalog()"
  50. style="margin-left: 2px">{{ $t('qc.partAttributePage.dataSync') }}</el-button>
  51. </el-form-item>
  52. <el-form-item :label="' '">
  53. <el-button v-if="!authSave" type="primary" @click="openDieMoldAddModal()"
  54. style="margin-left: 2px">{{ $t('qc.partAttributePage.addDieMold') }}</el-button>
  55. </el-form-item>
  56. <el-form-item :label="' '">
  57. <el-button v-if="!authItemImport" type="primary" icon="el-icon-upload" @click="openPartSpecBatchUpload()"
  58. style="margin-left: 2px">{{ $t('qc.partAttributePage.projectImport') }}</el-button>
  59. </el-form-item>
  60. <el-form-item :label="' '">
  61. <el-button type="primary" icon="el-icon-upload" @click="openPartFileCollectBatchUpload()"
  62. style="margin-left: 2px">{{ $t('qc.partAttributePage.fileCollectBatchImport') }}</el-button>
  63. </el-form-item>
  64. </el-form>
  65. <!-- 展示列表 -->
  66. <el-table :height="height" :data="dataList" border v-loading="searchLoading" ref="partTable" class="part-table"
  67. :row-style="rowStyle" :row-class-name="partTableRowClassName" @row-click="partClickRow"
  68. @current-change="changeCurrentRow" style="width: 100%;">
  69. <el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable"
  70. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  71. :align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth"
  72. :label="item.columnLabel">
  73. <template slot-scope="scope">
  74. <span v-if="!item.columnHidden">
  75. <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  76. <span v-else>
  77. {{ scope.row[item.columnProp] }}
  78. </span>
  79. </span>
  80. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  81. style="width: 100px; height: 80px" /></span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column fixed="right" header-align="center" align="center" width="100"
  85. :label="$t('qc.common.operation')">
  86. <template slot-scope="scope">
  87. <el-link style="cursor: pointer" @click="updateModal(scope.row)">{{ $t('qc.common.edit') }}</el-link>
  88. <el-link style="cursor: pointer"
  89. @click="updateModal2(scope.row)">{{ $t('qc.partAttributePage.detail') }}</el-link>
  90. <!-- <el-link v-if="!authFile" style="cursor: pointer" @click="sopFileList(scope.row)">SOP文件</el-link>-->
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <!-- 分页栏 -->
  95. <el-pagination style="margin-top: 0px" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
  96. :current-page="pageIndex" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage"
  97. layout="total, sizes, prev, pager, next, jumper">
  98. </el-pagination>
  99. <!-- 物料属性新增/修改 -->
  100. <el-dialog :title="$t('qc.partAttributePage.dialogPartEdit')" :close-on-click-modal="false" v-drag
  101. :visible.sync="modalFlag" width="900px" class="part-edit-dialog">
  102. <div class="dialog-content">
  103. <el-form :model="modalData" :rules="rules" label-position="top">
  104. <!-- 基本信息区域 -->
  105. <div class="form-section">
  106. <div class="section-title">{{ $t('qc.partAttributePage.sectionBasicInfo') }}</div>
  107. <el-row :gutter="20">
  108. <el-col :span="6">
  109. <el-form-item :label="$t('qc.table.materialCode')">
  110. <el-input v-model="modalData.partNo" disabled></el-input>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="10">
  114. <el-form-item :label="$t('qc.table.materialName')">
  115. <el-input v-model="modalData.partDesc" disabled></el-input>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="4">
  119. <el-form-item :label="$t('qc.partAttributePage.umId')">
  120. <el-input v-model="modalData.umId" disabled></el-input>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="4">
  124. <el-form-item :label="$t('qc.common.status')">
  125. <el-select v-model="modalData.active" :disabled="modalDisableFlag" style="width: 100%">
  126. <el-option :label="$t('qc.partAttributePage.statusActive')" value="Y"></el-option>
  127. <el-option :label="$t('qc.partAttributePage.statusInactive')" value="N"></el-option>
  128. </el-select>
  129. </el-form-item>
  130. </el-col>
  131. </el-row>
  132. <el-row :gutter="20">
  133. <el-col :span="6">
  134. <el-form-item :label="$t('qc.partAttributePage.partCategory')">
  135. <el-input v-model="modalData.partType" disabled></el-input>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="10">
  139. <el-form-item :label="$t('qc.partAttributePage.partDescEn')">
  140. <el-input v-model="modalData.partDescEn" disabled></el-input>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="8">
  144. <el-form-item :label="$t('qc.table.spec')">
  145. <el-input v-model="modalData.spec" disabled></el-input>
  146. </el-form-item>
  147. </el-col>
  148. </el-row>
  149. </div>
  150. <!-- 有效期管理区域 -->
  151. <!-- <div class="form-section">
  152. <div class="section-title">有效期管理</div>
  153. <el-row :gutter="20">
  154. <el-col :span="8">
  155. <el-form-item label=" ">
  156. <el-checkbox v-model="modalData.expirationFlag" :disabled="modalDisableFlag" true-label="Y">启用物料有效期管理</el-checkbox>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="8" style="margin-top: 8px">
  160. <el-form-item label="有效期天数">
  161. <el-input-number :controls="false" :step="0" v-model="modalData.expirationDay" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="8" style="margin-top: 8px">
  165. <el-form-item label="有效期预警天数">
  166. <el-input-number :controls="false" :step="0" v-model="modalData.expirationWarningDay" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  167. </el-form-item>
  168. </el-col>
  169. </el-row>
  170. <el-row :gutter="20" style="margin-top: -20px">
  171. <el-col :span="8">
  172. <el-form-item label=" ">
  173. <el-checkbox v-model="modalData.adhesiveActivePeriodFlag" :disabled="modalDisableFlag" true-label="Y">启用物料活性期管理</el-checkbox>
  174. </el-form-item>
  175. </el-col>
  176. <el-col :span="8" style="margin-top: 8px">
  177. <el-form-item label="解冻时长(h)">
  178. <el-input-number :controls="false" :step="0" v-model="modalData.thawingDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="8" style="margin-top: 8px">
  182. <el-form-item label="累计暴露时长(h)">
  183. <el-input-number :controls="false" :step="0" v-model="modalData.accumulatedExposureDuration" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  184. </el-form-item>
  185. </el-col>
  186. </el-row>
  187. </div> -->
  188. <!-- 仓库配置区域 -->
  189. <!-- <div class="form-section">
  190. <div class="section-title">仓库配置</div>
  191. <el-row :gutter="20">
  192. <el-col :span="4">
  193. <el-form-item label="超入比例%">
  194. <el-input-number :controls="false" :step="0" v-model="modalData.exceedInRatio" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="10">
  198. <el-form-item>
  199. <span v-if="modalDisableFlag" slot="label">入库默认仓库</span>
  200. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(20, 1)"><a href="#">入库默认仓库</a></span>
  201. <el-input v-model="modalData.inboundWarehouseId" :disabled="modalDisableFlag" @change="inWarehouseBlur(20)" style="width: 25%"></el-input>
  202. <el-input v-model="modalData.inboundWarehouseName" disabled style="width: 70%"></el-input>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="10">
  206. <el-form-item>
  207. <span v-if="modalDisableFlag" slot="label">入库默认库位</span>
  208. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(22)"><a href="#">入库默认库位</a></span>
  209. <el-input v-model="modalData.inboundLocationId" :disabled="modalDisableFlag" @change="locationBlur(22)" style="width: 25%"></el-input>
  210. <el-input v-model="modalData.inboundLocationName" disabled style="width: 70%"></el-input>
  211. </el-form-item>
  212. </el-col>
  213. </el-row>
  214. <el-row :gutter="20">
  215. <el-col :span="4">
  216. <el-form-item label="超领比例%">
  217. <el-input-number :controls="false" :step="0" v-model="modalData.exceedOutRatio" :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="10">
  221. <el-form-item>
  222. <span v-if="modalDisableFlag" slot="label">领料默认仓库</span>
  223. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(20, 2)"><a href="#">领料默认仓库</a></span>
  224. <el-input-group>
  225. <el-input v-model="modalData.outboundWarehouseId" :disabled="modalDisableFlag" @change="outWarehouseBlur(20)" style="width: 25%"></el-input>
  226. <el-input v-model="modalData.outboundWarehouseName" disabled style="width: 70%"></el-input>
  227. </el-input-group>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="4">
  231. <el-form-item label="领料方式">
  232. <el-select v-model="modalData.issueMethod" :disabled="modalDisableFlag" placeholder="请选择" style="width: 100%">
  233. <el-option label="按单领料" value="按单领料"></el-option>
  234. <el-option label="入库倒冲" value="入库倒冲"></el-option>
  235. </el-select>
  236. </el-form-item>
  237. </el-col>
  238. </el-row>
  239. </div> -->
  240. <!-- 检验配置区域 -->
  241. <div class="form-section">
  242. <div class="section-title">{{ $t('qc.partAttributePage.sectionInspectionConfig') }}</div>
  243. <el-row :gutter="20" style="margin-top: 5px">
  244. <el-col :span="4">
  245. <el-checkbox v-model="modalData.iqcExempt" :disabled="modalDisableFlag"
  246. true-label="Y">{{ $t('qc.partAttributePage.iqcInspection') }}</el-checkbox>
  247. </el-col>
  248. <!-- <el-col :span="4">
  249. <el-checkbox v-model="modalData.faiExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.faiInspection') }}</el-checkbox>
  250. </el-col> -->
  251. <el-col :span="4">
  252. <el-checkbox v-model="modalData.ipqcExempt" :disabled="modalDisableFlag"
  253. true-label="Y">{{ $t('qc.partAttributePage.ipqcInspection') }}</el-checkbox>
  254. </el-col>
  255. <!-- <el-col :span="4">
  256. <el-checkbox v-model="modalData.pqcExempt" :disabled="modalDisableFlag" true-label="Y">{{ $t('qc.partAttributePage.pqcInspection') }}</el-checkbox>
  257. </el-col> -->
  258. <el-col :span="4">
  259. <el-checkbox v-model="modalData.fqcExempt" :disabled="modalDisableFlag"
  260. true-label="Y">{{ $t('qc.partAttributePage.fqcInspection') }}</el-checkbox>
  261. </el-col>
  262. <el-col :span="4">
  263. <el-checkbox v-model="modalData.oqcExempt" :disabled="modalDisableFlag"
  264. true-label="Y">{{ $t('qc.partAttributePage.oqcInspection') }}</el-checkbox>
  265. </el-col>
  266. <el-col :span="4">
  267. <el-checkbox v-model="modalData.sqcExempt" :disabled="modalDisableFlag"
  268. true-label="Y">{{ $t('qc.partAttributePage.sqcInspection') }}</el-checkbox>
  269. </el-col>
  270. </el-row>
  271. <!-- <el-row :gutter="20" style="margin-top: 5px">-->
  272. <!-- <el-col :span="6">-->
  273. <!-- <el-form-item label="默认值">-->
  274. <!-- <el-input v-model="modalData.standardValue" :disabled="modalDisableFlag"></el-input>-->
  275. <!-- </el-form-item>-->
  276. <!-- </el-col>-->
  277. <!-- <el-col :span="6">-->
  278. <!-- <el-form-item label="标准值">-->
  279. <!-- <el-input v-model="modalData.defaultValue" :disabled="modalDisableFlag"></el-input>-->
  280. <!-- </el-form-item>-->
  281. <!-- </el-col>-->
  282. <!-- <el-col :span="6">-->
  283. <!-- <el-form-item label="上限值">-->
  284. <!-- <el-input v-model="modalData.maxValue" :disabled="modalDisableFlag"></el-input>-->
  285. <!-- </el-form-item>-->
  286. <!-- </el-col>-->
  287. <!-- <el-col :span="6">-->
  288. <!-- <el-form-item label="下限值">-->
  289. <!-- <el-input v-model="modalData.minValue" :disabled="modalDisableFlag"></el-input>-->
  290. <!-- </el-form-item>-->
  291. <!-- </el-col>-->
  292. <!-- </el-row>-->
  293. </div>
  294. <!-- 巡检配置区域 -->
  295. <div class="form-section">
  296. <div class="section-title" style="display: flex; justify-content: space-between; align-items: center;">
  297. <span>{{ $t('qc.partAttributePage.sectionPatrolConfig') }}</span>
  298. <el-button type="primary" size="mini" @click="openPatrolConfigDialog"
  299. :disabled="modalDisableFlag">{{ $t('qc.partAttributePage.specialPatrolConfig') }}</el-button>
  300. </div>
  301. <el-row :gutter="20">
  302. <el-col :span="8">
  303. <el-form-item :label="$t('qc.partAttributePage.firstInspectionDurationH')">
  304. <el-input-number :controls="false" :step="0" v-model="modalData.firstInspectionDuration"
  305. :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="8">
  309. <el-form-item :label="$t('qc.partAttributePage.nextInspectionDurationH')">
  310. <el-input-number :controls="false" :step="0" v-model="modalData.nextInspectionDuration"
  311. :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="8">
  315. <el-form-item :label="$t('qc.partAttributePage.totalInspectionDurationH')">
  316. <el-input-number :controls="false" :step="0" v-model="modalData.totalInspectionDuration"
  317. :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. </div>
  322. <!-- 缺陷跟踪区域 -->
  323. <div class="form-section">
  324. <div class="section-title" style="display: flex; justify-content: space-between; align-items: center;">
  325. <span>{{ $t('qc.partAttributePage.sectionDefectTracking') }}</span>
  326. </div>
  327. <el-row :gutter="20">
  328. <el-col :span="6">
  329. <el-form-item :label="$t('qc.partAttributePage.defectThreshold')">
  330. <el-input-number :controls="false" :step="0" v-model="modalData.defectThreshold"
  331. :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  332. </el-form-item>
  333. </el-col>
  334. <el-col :span="6">
  335. <el-form-item :label="$t('qc.partAttributePage.recoveryBatchCount')">
  336. <el-input-number :controls="false" :step="0" v-model="modalData.recoveryBatchCount"
  337. :disabled="modalDisableFlag" style="width: 100%"></el-input-number>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="6">
  341. <el-form-item :label="$t('qc.partAttributePage.currentDefectCount')">
  342. <el-input-number :controls="false" :step="0" v-model="modalData.currentDefectCount" disabled
  343. style="width: 100%"></el-input-number>
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="6">
  347. <el-form-item :label="$t('qc.partAttributePage.remainingTrackingBatches')">
  348. <el-input-number :controls="false" :step="0" v-model="modalData.remainingTrackingBatches" disabled
  349. style="width: 100%"></el-input-number>
  350. </el-form-item>
  351. </el-col>
  352. </el-row>
  353. </div>
  354. </el-form>
  355. </div>
  356. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  357. <el-button v-if="!modalDisableFlag" type="primary" :loading="saveLoading"
  358. @click="saveData()">{{ $t('qc.common.save') }}</el-button>
  359. <el-button type="primary" @click="modalFlag = false">{{ $t('qc.common.close') }}</el-button>
  360. </el-footer>
  361. </el-dialog>
  362. <!-- 新增刀模 -->
  363. <el-dialog :title="$t('qc.partAttributePage.dialogDieMoldAdd')" :close-on-click-modal="false" v-drag
  364. :visible.sync="dieMoldAddModalFlag" width="580px" class="part-edit-dialog">
  365. <div class="dialog-content">
  366. <el-form :model="dieMoldAddData" :rules="dieMoldAddRules" ref="dieMoldAddForm" label-position="top">
  367. <el-row :gutter="20">
  368. <el-col :span="8">
  369. <el-form-item :label="'BU'" prop="bu">
  370. <el-select v-model="dieMoldAddData.bu" :placeholder="$t('qc.common.selectPlaceholder')" clearable
  371. style="width: 100%" @change="onDieMoldAddBuChange">
  372. <el-option v-for="i in buList" :key="i.site + '_' + i.buNo"
  373. :label="i.sitename + ' ' + i.buDesc" :value="i.buNo">
  374. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  375. <span
  376. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  377. {{ i.buDesc }}
  378. </span>
  379. </el-option>
  380. </el-select>
  381. </el-form-item>
  382. </el-col>
  383. <el-col :span="8">
  384. <el-form-item :label="$t('qc.partAttributePage.dieMoldFlag')">
  385. <el-input v-model="dieMoldAddData.handle" disabled></el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="8">
  389. <el-form-item :label="$t('qc.table.partType')">
  390. <el-input v-model="dieMoldAddData.partType" disabled></el-input>
  391. </el-form-item>
  392. </el-col>
  393. </el-row>
  394. <el-row :gutter="20">
  395. <el-col :span="8">
  396. <el-form-item :label="$t('qc.iqcPage.dieMoldCode')" prop="partNo">
  397. <el-input v-model="dieMoldAddData.partNo" clearable></el-input>
  398. </el-form-item>
  399. </el-col>
  400. <el-col :span="16">
  401. <el-form-item :label="$t('qc.iqcPage.dieMoldName')" prop="partDesc">
  402. <el-input v-model="dieMoldAddData.partDesc" clearable></el-input>
  403. </el-form-item>
  404. </el-col>
  405. <el-col :span="8">
  406. <el-form-item :label="$t('qc.partAttributePage.umId')">
  407. <el-select v-model="dieMoldAddData.umId" :placeholder="$t('qc.common.selectPlaceholder')"
  408. clearable filterable style="width: 100%">
  409. <el-option v-for="i in umList" :key="i.umId" :label="i.umName" :value="i.umId">
  410. </el-option>
  411. </el-select>
  412. </el-form-item>
  413. </el-col>
  414. <el-col :span="8">
  415. <el-form-item :label="$t('qc.table.spec')">
  416. <el-input v-model="dieMoldAddData.spec" clearable></el-input>
  417. </el-form-item>
  418. </el-col>
  419. </el-row>
  420. <el-row :gutter="20">
  421. <el-col :span="24">
  422. <el-form-item :label="$t('qc.table.remark')">
  423. <el-input type="textarea" :rows="2" v-model="dieMoldAddData.remark" clearable></el-input>
  424. </el-form-item>
  425. </el-col>
  426. </el-row>
  427. </el-form>
  428. </div>
  429. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  430. <el-button type="primary" :loading="dieMoldAddSaveLoading"
  431. @click="saveDieMoldPart()">{{ $t('qc.common.save') }}</el-button>
  432. <el-button type="primary" @click="dieMoldAddModalFlag = false">{{ $t('qc.common.close') }}</el-button>
  433. </el-footer>
  434. </el-dialog>
  435. <!-- 巡检特殊配置对话框 -->
  436. <el-dialog :title="$t('qc.partAttributePage.dialogPatrolSpecial')" :close-on-click-modal="false" v-drag
  437. :visible.sync="patrolConfigDialogFlag" width="900px" append-to-body>
  438. <div style="margin-bottom: 10px;">
  439. <el-button type="primary" size="small" icon="el-icon-plus"
  440. @click="addPatrolConfig">{{ $t('qc.common.add') }}</el-button>
  441. <el-button type="danger" size="small" icon="el-icon-delete" @click="deletePatrolConfig"
  442. :disabled="patrolConfigSelections.length === 0">{{ $t('qc.common.delete') }}</el-button>
  443. <el-button type="success" size="small" icon="el-icon-upload2"
  444. @click="openPatrolConfigImport">{{ $t('qc.common.upload') }}</el-button>
  445. </div>
  446. <el-table :data="patrolConfigList" border height="400px" v-loading="patrolConfigLoading"
  447. @selection-change="patrolConfigSelectionChange" @row-click="patrolConfigRowClick" highlight-current-row
  448. style="width: 100%">
  449. <el-table-column type="selection" width="50" align="center"></el-table-column>
  450. <el-table-column prop="operationDesc" :label="$t('qc.table.process')" header-align="center" align="left"
  451. min-width="150">
  452. <template slot-scope="scope">
  453. <el-select v-model="scope.row.operationDesc" size="small"
  454. :placeholder="$t('qc.partAttributePage.selectOperation')" filterable clearable style="width: 100%">
  455. <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option>
  456. </el-select>
  457. </template>
  458. </el-table-column>
  459. <el-table-column prop="firstInspectionDuration" :label="$t('qc.partAttributePage.firstInspectionDurationH')"
  460. header-align="center" align="right" width="140">
  461. <template slot-scope="scope">
  462. <el-input-number :controls="false" :step="0" v-model="scope.row.firstInspectionDuration" size="small"
  463. style="width: 100%"></el-input-number>
  464. </template>
  465. </el-table-column>
  466. <el-table-column prop="nextInspectionDuration" :label="$t('qc.partAttributePage.nextInspectionDurationH')"
  467. header-align="center" align="right" width="140">
  468. <template slot-scope="scope">
  469. <el-input-number :controls="false" :step="0" v-model="scope.row.nextInspectionDuration" size="small"
  470. style="width: 100%"></el-input-number>
  471. </template>
  472. </el-table-column>
  473. <el-table-column prop="totalInspectionDuration" :label="$t('qc.partAttributePage.totalInspectionDurationH')"
  474. header-align="center" align="right" width="140">
  475. <template slot-scope="scope">
  476. <el-input-number :controls="false" :step="0" v-model="scope.row.totalInspectionDuration" size="small"
  477. style="width: 100%"></el-input-number>
  478. </template>
  479. </el-table-column>
  480. <el-table-column prop="defaultFlag" :label="$t('qc.partAttributePage.isDefault')" header-align="center"
  481. align="center" width="100">
  482. <template slot-scope="scope">
  483. <el-switch v-model="scope.row.defaultFlag" active-value="Y" inactive-value="N"
  484. @change="handleDefaultFlagChange(scope.row)"></el-switch>
  485. </template>
  486. </el-table-column>
  487. <el-table-column :label="$t('qc.common.operation')" header-align="center" align="center" width="80">
  488. <template slot-scope="scope">
  489. <el-button type="text" size="small"
  490. @click="savePatrolConfigRow(scope.row)">{{ $t('qc.common.save') }}</el-button>
  491. </template>
  492. </el-table-column>
  493. </el-table>
  494. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  495. <el-button type="primary" @click="batchSavePatrolConfig"
  496. :loading="patrolConfigSaveLoading">{{ $t('qc.common.save') }}</el-button>
  497. <el-button @click="patrolConfigDialogFlag = false">{{ $t('qc.common.close') }}</el-button>
  498. </el-footer>
  499. </el-dialog>
  500. <!-- 巡检配置导入 -->
  501. <patrol-config-upload ref="patrolConfigUpload" @refreshPatrolConfig="getPatrolConfigList"
  502. v-drag></patrol-config-upload>
  503. <!-- 页签 -->
  504. <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card"
  505. @tab-click="tabClick" class="customer-tab">
  506. <!-- BOM页签 -->
  507. <!-- <el-tab-pane label="BOM" name="bom">
  508. <bom-list-component
  509. v-if="activeTable === 'bom'"
  510. :part-no="partCurrentRow.partNo"
  511. :site="partCurrentRow.site"
  512. :bu-no="partCurrentRow.buNo"
  513. :table-height="secondHeight - 78">
  514. </bom-list-component>
  515. </el-tab-pane> -->
  516. <!-- Routing页签 -->
  517. <!-- <el-tab-pane label="Routing" name="routing">
  518. <routing-list-component
  519. v-if="activeTable === 'routing'"
  520. :part-no="partCurrentRow.partNo"
  521. :site="partCurrentRow.site"
  522. :bu-no="partCurrentRow.buNo"
  523. :table-height="secondHeight - 78">
  524. </routing-list-component>
  525. </el-tab-pane> -->
  526. <!-- SOP清单 -->
  527. <!-- <el-tab-pane label="SOP清单" name="partSop">
  528. <sop-list-component
  529. v-if="activeTable === 'partSop'"
  530. :part-no="partCurrentRow.partNo"
  531. :site="partCurrentRow.site"
  532. :bu-no="partCurrentRow.buNo"
  533. :table-height="secondHeight - 98">
  534. </sop-list-component>
  535. </el-tab-pane> -->
  536. <!-- 质量检验模板页签 -->
  537. <!-- <el-tab-pane :label="$t('qc.partAttributePage.tabQcTemplate')" name="qcTemplate">
  538. <el-form label-position="top" style="margin-left: 2px;">
  539. <el-button type="primary" @click="addFastModal()"
  540. icon="el-icon-plus">{{ $t('qc.partAttributePage.addTemplate') }}</el-button>
  541. <el-button v-if="!editBatchVisible"
  542. @click="editBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button>
  543. <el-button v-if="editBatchVisible" @click="batchModel"
  544. :loading="batchLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button>
  545. <el-button v-if="!editBatchVisible" type="danger" @click="batchDeleteTemplates"
  546. :disabled="selectedTemplates.length === 0"
  547. :loading="templateDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button>
  548. </el-form>
  549. <el-table ref="templateTable" :data="detailListPaged" :height="secondHeight - 100" border
  550. @selection-change="handleTemplateSelectionChange" style="width: 100%;">
  551. <el-table-column type="selection" width="55" align="center">
  552. </el-table-column>
  553. <el-table-column v-for="(item,index) in columnDetailList" :key="index" :sortable="item.columnSortable"
  554. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  555. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  556. :label="item.columnLabel">
  557. <template slot-scope="scope">
  558. <template v-if="item.columnProp === 'ipqcInspectionMethod'">
  559. <span v-if="editBatchVisible && scope.row.inspectionTypeNo === '101'">
  560. <el-select v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')"
  561. clearable size="mini" style="width: 100%">
  562. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  563. :label="method.label" :value="method.value"></el-option>
  564. </el-select>
  565. </span>
  566. <span v-else>{{ formatIpqcMethod(scope.row.ipqcInspectionMethod) }}</span>
  567. </template>
  568. <template v-else>
  569. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  570. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  571. style="width: 100px; height: 80px" /></span>
  572. </template>
  573. </template>
  574. </el-table-column>
  575. <el-table-column prop="samplingLevelDesc" header-align="center" align="center" min-width="180"
  576. :label="$t('qc.partAttributePage.samplingLevel')">
  577. <template slot-scope="scope">
  578. <span v-if="editBatchVisible">
  579. <el-button type="text" @click="chooseLevel(scope.row)"
  580. style="width:18%;padding: 3px 7px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  581. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  582. </span>
  583. <span v-else>
  584. <span>{{scope.row[scope.column.property]}}</span>
  585. </span>
  586. </template>
  587. </el-table-column>
  588. <el-table-column prop="inspectionCycle" header-align="center" align="center" min-width="100"
  589. :label="$t('qc.table.inspectionCycleH')">
  590. <template slot-scope="scope">
  591. <span v-if="editBatchVisible">
  592. <el-input :controls="false" v-model="scope.row.inspectionCycle"
  593. @input="value=>scope.row.inspectionCycle= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
  594. style="height: 11px; width: 98%;">
  595. </el-input>
  596. </span>
  597. <span v-else>
  598. <span>{{scope.row[scope.column.property]}}</span>
  599. </span>
  600. </template>
  601. </el-table-column>
  602. <el-table-column prop="samplingProgrammeDesc" header-align="center" align="center" min-width="180"
  603. :label="$t('qc.partAttributePage.samplingProgramme')">
  604. <template slot-scope="scope">
  605. <span v-if="editBatchVisible">
  606. <el-button type="text" @click="chooseProgrammeRow(scope.row)"
  607. style="width:18%;padding: 3px 7px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  608. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  609. </span>
  610. <span v-else>
  611. <span>{{scope.row[scope.column.property]}}</span>
  612. </span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column prop="aql" header-align="center" align="center" min-width="80" label="AQL">
  616. <template slot-scope="scope">
  617. <span v-if="editBatchVisible">
  618. <el-input :controls="false" v-model="scope.row.aql"
  619. @input="value=>scope.row.aql= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
  620. style="height: 11px; width: 98%;">
  621. </el-input>
  622. </span>
  623. <span v-else>
  624. <span>{{scope.row[scope.column.property]}}</span>
  625. </span>
  626. </template>
  627. </el-table-column>
  628. <el-table-column prop="ac" header-align="center" align="center" min-width="80" label="AC">
  629. <template slot-scope="scope">
  630. <span v-if="editBatchVisible">
  631. <el-input :controls="false" v-model="scope.row.ac"
  632. @input="value=>scope.row.ac= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
  633. style="height: 11px; width: 98%;">
  634. </el-input>
  635. </span>
  636. <span v-else>
  637. <span>{{scope.row[scope.column.property]}}</span>
  638. </span>
  639. </template>
  640. </el-table-column>
  641. <el-table-column prop="re" header-align="center" align="center" min-width="80" label="RE">
  642. <template slot-scope="scope">
  643. <span v-if="editBatchVisible">
  644. <el-input :controls="false" v-model="scope.row.re"
  645. @input="value=>scope.row.re= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
  646. style="height: 11px; width: 98%;">
  647. </el-input>
  648. </span>
  649. <span v-else>
  650. <span>{{scope.row[scope.column.property]}}</span>
  651. </span>
  652. </template>
  653. </el-table-column>
  654. <el-table-column prop="templateRemark" header-align="center" align="center" :label="$t('qc.table.remark')">
  655. </el-table-column>
  656. <el-table-column fixed="right" header-align="center" align="center" width="80"
  657. :label="$t('qc.common.operation')">
  658. <template slot-scope="scope">
  659. <el-button type="text" size="small" @click="deletePartAttributeDetails(scope.row)" style="color: #f56c6c;"
  660. :loading="scope.row.deleting">{{ $t('qc.common.delete') }}</el-button>
  661. </template>
  662. </el-table-column>
  663. </el-table>
  664. <el-pagination @size-change="templateSizeChangeHandle" @current-change="templateCurrentChangeHandle"
  665. :current-page="templatePageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="templatePageSize"
  666. :total="detailList.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 0px;">
  667. </el-pagination>
  668. </el-tab-pane> -->
  669. <!-- 检验标准维护 -->
  670. <el-tab-pane :label="$t('qc.partAttributePage.tabQcSpec')" name="qcSpec">
  671. <div class="qc-spec-type-bar">
  672. <span v-for="i in qcSpecTypeOptions" :key="i.inspectionTypeNo" class="qc-spec-type-item"
  673. :class="{ 'is-active': qcSpecFilterType === String(i.inspectionTypeNo) }"
  674. @click="qcSpecFilterType = String(i.inspectionTypeNo)">{{ i.inspectionTypeName }}</span>
  675. </div>
  676. <el-form :inline="true" label-position="top" class="qc-spec-toolbar-form" style="margin-left: 2px;">
  677. <!-- IQC:供应商 -->
  678. <el-form-item v-if="qcSpecFilterShowManufacturer" :label="$t('qc.table.supplier')">
  679. <el-select v-model="qcSpecFilterManufacturer" :placeholder="$t('qc.common.selectPlaceholder')"
  680. @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px">
  681. <el-option :label="$t('qc.common.all')" value=""></el-option>
  682. <el-option v-for="item in qcSpecManufacturerFilterOptions" :key="item" :label="item"
  683. :value="item"></el-option>
  684. </el-select>
  685. </el-form-item>
  686. <!-- IPQC:IPQC检验方式 -->
  687. <el-form-item v-if="qcSpecFilterShowIpqcMethod" :label="$t('qc.partAttributePage.colIpqcMethod')">
  688. <el-select v-model="qcSpecFilterIpqcMethod" :placeholder="$t('qc.common.selectPlaceholder')"
  689. @change="onQcSpecIpqcMethodFilterChange" clearable style="width: 120px">
  690. <el-option :label="$t('qc.common.all')" value=""></el-option>
  691. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  692. :label="method.label" :value="method.value"></el-option>
  693. </el-select>
  694. </el-form-item>
  695. <!-- IPQC / FQC / OQC:工序、机台 -->
  696. <el-form-item v-if="qcSpecFilterShowOperation" :label="$t('qc.table.process')">
  697. <el-select v-model="qcSpecFilterOperation" :placeholder="$t('qc.common.selectPlaceholder')"
  698. @change="onQcSpecOperationFilterChange" clearable filterable style="width: 140px">
  699. <el-option :label="$t('qc.common.all')" value=""></el-option>
  700. <el-option v-for="item in qcSpecOperationFilterOptions" :key="item" :label="item" :value="item"></el-option>
  701. </el-select>
  702. </el-form-item>
  703. <el-form-item v-if="qcSpecFilterShowResource" :label="$t('qc.table.machine')">
  704. <el-select v-model="qcSpecFilterResource" :placeholder="$t('qc.common.selectPlaceholder')"
  705. @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px">
  706. <el-option :label="$t('qc.common.all')" value=""></el-option>
  707. <el-option v-for="item in qcSpecResourceFilterOptions" :key="item" :label="item" :value="item"></el-option>
  708. </el-select>
  709. </el-form-item>
  710. <!-- IPQC / FQC / OQC / SQC:客户名称 -->
  711. <el-form-item v-if="qcSpecFilterShowCustomer" :label="$t('qc.table.customerName')">
  712. <el-select v-model="qcSpecFilterCustomer" :placeholder="$t('qc.common.selectPlaceholder')"
  713. @change="onQcSpecDimensionFilterChange" clearable filterable style="width: 140px">
  714. <el-option :label="$t('qc.common.all')" value=""></el-option>
  715. <el-option v-for="item in qcSpecCustomerFilterOptions" :key="item" :label="item" :value="item"></el-option>
  716. </el-select>
  717. </el-form-item>
  718. <el-form-item label=" ">
  719. <el-button type="primary" @click="addQcSpecModal()" icon="el-icon-plus">{{ $t('qc.common.add') }}</el-button>
  720. <el-button v-if="!authItemImport" type="primary" @click="qcSpecUploadModal()"
  721. icon="el-icon-upload">{{ $t('qc.partAttributePage.projectImport') }}</el-button>
  722. <el-button @click="openQcSpecCopyDialog()" icon="el-icon-document-copy"
  723. :disabled="!partCurrentRow.partNo">{{ $t('qc.common.copy') }}</el-button>
  724. <el-button @click="openQcSpecUpdateDialog()" icon="el-icon-refresh"
  725. :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecAttributeUpdate') }}</el-button>
  726. <el-button v-if="!editQcSpecBatchVisible" type="danger" @click="batchDeleteQcSpec"
  727. :disabled="!qcSpecSelections || qcSpecSelections.length === 0"
  728. :loading="qcSpecDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button>
  729. <el-button v-if="!editQcSpecBatchVisible"
  730. @click="editQcSpecBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button>
  731. <el-button v-if="!editQcSpecBatchVisible" @click="openQcSpecBatchFillDialog"
  732. :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecBatchFill') }}</el-button>
  733. <el-button v-if="!editQcSpecBatchVisible" @click="openQcSpecSyncDialog()"
  734. :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.qcSpecDataSync') }}</el-button>
  735. <el-button v-if="editQcSpecBatchVisible" @click="batchQcSpecModel"
  736. :loading="batchQcSpecLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button>
  737. <el-button v-if="editQcSpecBatchVisible" @click="cancelQcSpecBatchModel"
  738. :disabled="batchQcSpecLoading">{{ $t('qc.common.cancel') }}</el-button>
  739. </el-form-item>
  740. </el-form>
  741. <el-table :data="qcSpecTableList" ref="qcSpecTable" @row-click="qcSpecClickRow" highlight-current-row
  742. :key="'qc-spec-table-' + qcSpecFilterType + '-' + qcSpecColumnLayoutKey"
  743. :row-key="getQcSpecRowKey" :row-class-name="qcSpecRowClassName" v-loading="qcSpecDragSaving"
  744. @selection-change="qcSpecSelectionChange"
  745. :height="secondHeight - 122" border style="width: 100%;" class="qc-spec-table">
  746. <el-table-column type="selection" width="45" align="center" :selectable="() => !editQcSpecBatchVisible">
  747. </el-table-column>
  748. <el-table-column v-for="(item, index) in qcSpecVisibleColumnList" :key="item.columnProp || index"
  749. :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign"
  750. :show-overflow-tooltip="item.showOverflowTooltip && !(item.editType && editQcSpecBatchVisible)"
  751. :align="item.align" :fixed="item.fixed == '' ? false : item.fixed"
  752. :min-width="item.columnWidth" :label="item.columnLabel">
  753. <template slot-scope="scope">
  754. <span v-if="item.editType === 'ipqcSelect' && editQcSpecBatchVisible && scope.row.inspectionTypeNo === '101'">
  755. <el-select v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')"
  756. clearable size="mini" style="width: 100%">
  757. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  758. :label="method.label" :value="method.value"></el-option>
  759. </el-select>
  760. </span>
  761. <span v-else-if="item.editType === 'valueType'">{{ formatQcValueType(scope.row) }}</span>
  762. <span v-else-if="item.editType === 'programmePicker' && editQcSpecBatchVisible" class="qc-spec-cell-picker">
  763. <el-button type="text" class="qc-spec-cell-picker-btn"
  764. @click="chooseProgrammeRow(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  765. <el-input v-model="scope.row.samplingProgrammeDesc" readonly size="mini"
  766. class="qc-spec-cell-picker-input"></el-input>
  767. </span>
  768. <span v-else-if="item.editType === 'levelPicker' && editQcSpecBatchVisible" class="qc-spec-cell-picker">
  769. <el-button type="text" class="qc-spec-cell-picker-btn"
  770. @click="chooseLevel(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  771. <el-input v-model="scope.row.samplingLevelDesc" readonly size="mini"
  772. class="qc-spec-cell-picker-input"></el-input>
  773. </span>
  774. <el-input v-else-if="item.editType === 'samplingQty' && editQcSpecBatchVisible"
  775. v-model="scope.row.defaultSamplingQuantity" size="mini"
  776. @input="onQcSpecSamplingQtyInput(scope.row)"></el-input>
  777. <el-input v-else-if="item.editType === 'samplingRatio' && editQcSpecBatchVisible"
  778. v-model="scope.row.defaultSamplingProportion" size="mini"
  779. @input="onQcSpecSamplingRatioInput(scope.row)"></el-input>
  780. <span v-else-if="item.editType === 'operationPicker' && qcSpecCanSelectOperation(scope.row)">
  781. <el-button type="text" @click="openQcSpecOperationPicker(scope.row)"
  782. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  783. <span>{{ scope.row.operation }}</span>
  784. </span>
  785. <span v-else-if="item.editType === 'resourcePicker' && qcSpecCanSelectResource(scope.row)">
  786. <el-button type="text" @click="openQcSpecResourcePicker(scope.row)"
  787. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  788. <span>{{ scope.row.resourceDesc || scope.row.resourceID }}</span>
  789. </span>
  790. <span v-else-if="item.editType === 'manufacturerPicker' && qcSpecCanSelectManufacturer(scope.row)">
  791. <el-button type="text" @click="openQcSpecManufacturerPicker(scope.row)"
  792. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  793. <span>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span>
  794. </span>
  795. <span v-else-if="item.editType === 'customerPicker' && qcSpecCanSelectCustomer(scope.row)">
  796. <el-button type="text" @click="openQcSpecCustomerPicker(scope.row)"
  797. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  798. <span>{{ scope.row.customerName || scope.row.customerID }}</span>
  799. </span>
  800. <el-input v-else-if="item.editType === 'textInput' && editQcSpecBatchVisible"
  801. v-model="scope.row[item.columnProp]" size="mini"></el-input>
  802. <span v-else-if="!item.columnHidden">{{ qcSpecColumnText(scope.row, item) }}</span>
  803. </template>
  804. </el-table-column>
  805. <el-table-column header-align="center" align="center" width="140" :label="$t('qc.common.operation')" fixed="right">
  806. <template slot-scope="scope">
  807. <el-link style="cursor: pointer"
  808. @click="openQcSpecWarningDialog(scope.row)">{{ $t('qc.partAttributePage.warningConfig') }}</el-link>
  809. <el-link style="cursor: pointer" @click="deleteQcSpec(scope.row)">{{ $t('qc.common.delete') }}</el-link>
  810. </template>
  811. </el-table-column>
  812. </el-table>
  813. </el-tab-pane>
  814. <!-- 物料缺陷跟踪 -->
  815. <el-tab-pane :label="$t('qc.partAttributePage.tabDefectTracking')" name="defectTracking">
  816. <el-form label-position="top" style="margin-left: 2px;">
  817. <el-button type="primary" @click="addDefectTrackingModal()"
  818. icon="el-icon-plus">{{ $t('qc.common.add') }}</el-button>
  819. <el-button v-if="!editBatchVisible"
  820. @click="editDefectTrackingBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button>
  821. <el-button v-if="editBatchVisible" @click="batchDefectTrackingModel"
  822. :loading="batchLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button>
  823. <el-button v-if="editBatchVisible" @click="cancelDefectTrackingBatchModel"
  824. :disabled="batchLoading">{{ $t('qc.common.cancel') }}</el-button>
  825. </el-form>
  826. <el-table :data="defectTrackingList" :height="secondHeight - 68" border style="width: 100%;">
  827. <el-table-column v-for="(item,index) in columnDefectTrackingList" :key="index" :sortable="item.columnSortable"
  828. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  829. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  830. :label="item.columnLabel">
  831. <template slot-scope="scope">
  832. <span v-if="item.editType === 'positiveInt' && editBatchVisible">
  833. <el-input :controls="false" v-model="scope.row[item.columnProp]"
  834. @input="value => onDefectTrackingPositiveIntInput(scope.row, item.columnProp, value)"
  835. style="height: 11px; width: 98%;">
  836. </el-input>
  837. </span>
  838. <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  839. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  840. style="width: 100px; height: 80px" /></span>
  841. </template>
  842. </el-table-column>
  843. <el-table-column header-align="center" align="center" width="80" :label="$t('qc.common.operation')">
  844. <template slot-scope="scope">
  845. <el-button type="text" size="small" @click="deleteDefectTracking(scope.row)"
  846. style="color: #f56c6c;">{{ $t('qc.common.delete') }}</el-button>
  847. </template>
  848. </el-table-column>
  849. </el-table>
  850. </el-tab-pane>
  851. <!-- 文件采集配置 -->
  852. <el-tab-pane :label="$t('qc.partAttributePage.tabFileCollect')" name="fileCollect">
  853. <el-form :inline="true" label-position="top" :model="fileCollectQuery" style="margin-left: 2px;">
  854. <el-form-item :label="$t('qc.itemPage.deviceCode')">
  855. <el-input v-model="fileCollectQuery.equipmentNo" clearable style="width: 120px"
  856. @keyup.enter.native="searchFileCollect"></el-input>
  857. </el-form-item>
  858. <el-form-item :label="$t('qc.itemPage.deviceName')">
  859. <el-input v-model="fileCollectQuery.equipmentDesc" clearable style="width: 140px"
  860. @keyup.enter.native="searchFileCollect"></el-input>
  861. </el-form-item>
  862. <el-form-item :label="$t('qc.table.itemCode')">
  863. <el-input v-model="fileCollectQuery.itemNo" clearable style="width: 120px"
  864. @keyup.enter.native="searchFileCollect"></el-input>
  865. </el-form-item>
  866. <el-form-item label=" ">
  867. <el-button type="primary" @click="searchFileCollect">{{ $t('qc.common.search') }}</el-button>
  868. <el-button type="primary" @click="openFileCollectBatchAdd" icon="el-icon-plus"
  869. :disabled="!partCurrentRow.partNo">{{ $t('qc.common.add') }}</el-button>
  870. <el-button type="primary" @click="fileCollectUploadModal()" icon="el-icon-upload"
  871. :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.fileCollectImport') }}</el-button>
  872. <!-- <el-button type="primary" @click="openFileCollectReplace"
  873. :disabled="!partCurrentRow.partNo">{{ $t('qc.partAttributePage.fileCollectReplace') }}</el-button> -->
  874. <el-button type="danger" @click="batchDeleteFileCollect" :disabled="fileCollectSelections.length === 0"
  875. :loading="fileCollectDeleteLoading">{{ $t('qc.partAttributePage.batchDeleteTemplates') }}</el-button>
  876. <el-button v-if="!editFileCollectBatchVisible" :disabled="!partCurrentRow.partNo"
  877. @click="editFileCollectBatchModel">{{ $t('qc.partAttributePage.batchEdit') }}</el-button>
  878. <el-button v-if="editFileCollectBatchVisible" type="primary" @click="batchFileCollectModel"
  879. :loading="fileCollectSaveLoading">{{ $t('qc.partAttributePage.batchSave') }}</el-button>
  880. <el-button v-if="editFileCollectBatchVisible" @click="cancelFileCollectBatchModel"
  881. :disabled="fileCollectSaveLoading">{{ $t('qc.common.cancel') }}</el-button>
  882. <el-button type="primary" icon="el-icon-download" @click="downloadFileCollectorProgram"
  883. :loading="fileCollectorDownloadLoading">{{ $t('qc.partAttributePage.downloadFileCollector') }}</el-button>
  884. </el-form-item>
  885. </el-form>
  886. <el-table ref="fileCollectTable" :data="fileCollectList" :height="secondHeight - 100" border
  887. v-loading="fileCollectLoading" @selection-change="handleFileCollectSelectionChange" style="width: 100%;">
  888. <el-table-column type="selection" width="50" align="center"></el-table-column>
  889. <el-table-column v-for="(item, index) in columnFileCollectList" :key="index"
  890. :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign"
  891. :show-overflow-tooltip="item.showOverflowTooltip && !(item.editType && editFileCollectBatchVisible)"
  892. :align="item.align" :fixed="item.fixed == '' ? false : item.fixed"
  893. :min-width="item.columnWidth" :width="item.fixedWidth || null" :label="item.columnLabel">
  894. <template slot-scope="scope">
  895. <span v-if="item.editType === 'staffPicker' && editFileCollectBatchVisible">
  896. <el-button type="text" @click="openFileCollectStaffPicker(scope.row)"
  897. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  898. <span>{{ scope.row.staffAccount }}</span>
  899. </span>
  900. <span v-else-if="item.editType === 'itemPicker' && editFileCollectBatchVisible">
  901. <el-button type="text" @click="openFileCollectItemPicker(scope.row)"
  902. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  903. <span>{{ scope.row.itemNo }}</span>
  904. </span>
  905. <span v-else-if="item.editType === 'operationPicker' && editFileCollectBatchVisible">
  906. <el-button type="text" @click="openFileCollectOperationPicker(scope.row)"
  907. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  908. <span>{{ scope.row.operation }}</span>
  909. <el-button v-if="qcSpecHasValue(scope.row.operation)" type="text" icon="el-icon-close"
  910. class="qc-spec-pending-clear-btn"
  911. @click="clearFileCollectOperation(scope.row)"></el-button>
  912. </span>
  913. <el-input v-else-if="item.editType === 'textInput' && editFileCollectBatchVisible"
  914. v-model="scope.row[item.columnProp]" size="mini"></el-input>
  915. <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  916. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  917. style="width: 100px; height: 80px" /></span>
  918. </template>
  919. </el-table-column>
  920. </el-table>
  921. <el-pagination @size-change="fileCollectSizeChange" @current-change="fileCollectCurrentChange"
  922. :current-page="fileCollectPageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="fileCollectPageSize"
  923. :total="fileCollectTotal" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 0px;">
  924. </el-pagination>
  925. </el-tab-pane>
  926. <!-- 标签模版设置 -->
  927. <!-- <el-tab-pane label="标签模版设置" name="labelTemplate">
  928. <el-form label-position="top" style="margin-left: 2px;">
  929. <el-button type="primary" @click="addLabelTemplateModal()" icon="el-icon-plus">新增</el-button>
  930. </el-form>
  931. <el-table
  932. :data="labelTemplateList"
  933. :height="secondHeight - 68"
  934. border
  935. style="width: 100%;">
  936. <el-table-column
  937. v-for="(item,index) in columnLabelTemplateList" :key="index"
  938. :sortable="item.columnSortable"
  939. :prop="item.columnProp"
  940. :header-align="item.headerAlign"
  941. :show-overflow-tooltip="item.showOverflowTooltip"
  942. :align="item.align"
  943. :fixed="item.fixed==''?false:item.fixed"
  944. :min-width="item.columnWidth"
  945. :label="item.columnLabel">
  946. <template slot-scope="scope">
  947. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  948. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  949. </template>
  950. </el-table-column>
  951. <el-table-column
  952. header-align="center"
  953. align="center"
  954. width="100"
  955. label="操作">
  956. <template slot-scope="scope">
  957. <el-link style="cursor: pointer" @click="updateLabelTemplateModal(scope.row)">编辑</el-link>
  958. <el-link style="cursor: pointer" @click="deleteLabelTemplate(scope.row)">删除</el-link>
  959. </template>
  960. </el-table-column>
  961. </el-table>
  962. </el-tab-pane> -->
  963. </el-tabs>
  964. <!-- 检验模板->快速新增 -->
  965. <el-dialog :title="$t('qc.common.add')" @close="refreshDetailList" :close-on-click-modal="false" v-drag
  966. :visible.sync="fastAddFlag" width="1100px">
  967. <div style="font-size: 12px">
  968. <el-form :inline="true" label-position="top" :model="detailData">
  969. <el-form-item :label="$t('qc.table.templateCode')">
  970. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  971. </el-form-item>
  972. <el-form-item :label="$t('qc.table.templateName')">
  973. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  974. </el-form-item>
  975. <el-form-item :label="$t('qc.table.inspectionType')">
  976. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType"
  977. :placeholder="$t('qc.common.selectPlaceholder')">
  978. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  979. :value="i.inspectionTypeNo">
  980. </el-option>
  981. </el-select>
  982. </el-form-item>
  983. <el-form-item :label="' '">
  984. <el-button type="primary" @click="checkInspectionType2">{{ $t('qc.common.search') }}</el-button>
  985. </el-form-item>
  986. <el-form-item :label="' '" style="margin-left: 63px">
  987. <el-button type="primary" @click="getOperationList"
  988. v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107'"
  989. style="width: 63px">{{ $t('qc.table.process') }}</el-button>
  990. <el-button type="primary" @click="getManufacturerList" v-if="this.detailData.inspectionTypeNo === '105'"
  991. style="width: 63px">{{ $t('qc.table.supplier') }}</el-button>
  992. <el-button type="primary" @click="getCustomerList" v-if="this.detailData.inspectionTypeNo === '109'"
  993. style="width: 63px">{{ $t('qc.table.customerName') }}</el-button>
  994. </el-form-item>
  995. <el-form-item :label="' '" style="margin-left: 195px">
  996. <el-button type="primary" @click="getAllResourceList"
  997. v-if="this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107'"
  998. style="width: 63px">{{ $t('qc.table.machine') }}</el-button>
  999. </el-form-item>
  1000. </el-form>
  1001. </div>
  1002. <el-container>
  1003. <el-header style="width: 1080px;height: 200px;padding: 0 0 0 0">
  1004. <el-row :gutter="5">
  1005. <el-col :span="span1">
  1006. <span style="font-size: 12px">{{ $t('qc.partAttributePage.optionalTemplate') }}</span>
  1007. <el-table height="210px" :data="itemList1" v-loading="itemList1Loading" border ref="itemTable1"
  1008. @row-click="itemClickRow1" @selection-change="selectionItem1" highlight-current-row style="width: 100%">
  1009. <el-table-column type="selection" header-align="center" align="center" width="50">
  1010. </el-table-column>
  1011. <el-table-column prop="templateId" header-align="center" align="center" min-width="80"
  1012. :label="$t('qc.table.templateCode')">
  1013. </el-table-column>
  1014. <el-table-column prop="templateName" header-align="center" align="left" min-width="200"
  1015. :label="$t('qc.table.templateName')">
  1016. </el-table-column>
  1017. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60"
  1018. :label="$t('qc.table.inspectionType')">
  1019. </el-table-column>
  1020. </el-table>
  1021. </el-col>
  1022. <el-col
  1023. v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '109' || detailData.inspectionTypeNo === '107'"
  1024. :span="span2" style="margin-top: 25px">
  1025. <el-table v-if="detailData.inspectionTypeNo === '105'" height="210px" :data="selectionManufacturer2"
  1026. border highlight-current-row style="width: 100%">
  1027. <el-table-column prop="manufacturerID" header-align="center" align="center" min-width="100"
  1028. :label="$t('qc.partAttributePage.colSupplierId')">
  1029. </el-table-column>
  1030. <el-table-column prop="manufacturerName" header-align="center" align="left" min-width="150"
  1031. :label="$t('qc.partAttributePage.colSupplierNameCol')">
  1032. </el-table-column>
  1033. </el-table>
  1034. <el-table v-else-if="detailData.inspectionTypeNo === '109'" height="210px" :data="selectionCustomer2"
  1035. border highlight-current-row style="width: 100%">
  1036. <el-table-column prop="customerID" header-align="center" align="center" min-width="100"
  1037. :label="$t('qc.table.customerCode')">
  1038. </el-table-column>
  1039. <el-table-column prop="customerName" header-align="center" align="left" min-width="150"
  1040. :label="$t('qc.table.customerName')">
  1041. </el-table-column>
  1042. </el-table>
  1043. <el-table v-else height="210px" :data="operationSelections" border highlight-current-row
  1044. style="width: 100%">
  1045. <el-table-column prop="operationDesc" header-align="center" align="center"
  1046. :label="$t('qc.table.process')">
  1047. </el-table-column>
  1048. </el-table>
  1049. </el-col>
  1050. <el-col v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '107'" :span="span3"
  1051. style="margin-top: 25px">
  1052. <el-table height="210px" :data="resourceSelections" border highlight-current-row style="width: 100%">
  1053. <el-table-column prop="resourceId" header-align="center" align="center" min-width="100"
  1054. :label="$t('qc.partAttributePage.resourceId')">
  1055. </el-table-column>
  1056. <el-table-column prop="resourceDesc" header-align="center" align="left" min-width="150"
  1057. :label="$t('qc.partAttributePage.resourceName')">
  1058. </el-table-column>
  1059. </el-table>
  1060. </el-col>
  1061. </el-row>
  1062. </el-header>
  1063. <el-main style="width: 880px;height: 25px;margin-top: 50px;padding: 0 0 0 0;text-align:center">
  1064. <div>
  1065. <el-button type="primary" @click="addItem"
  1066. :loading="addItemLoading">{{ $t('qc.partAttributePage.addBtn') }}<i
  1067. class="el-icon-caret-bottom el-icon--right" v-if="!addItemLoading"></i></el-button>
  1068. <el-button type="primary" @click="deleteItem"
  1069. :loading="deleteItemLoading">{{ $t('qc.partAttributePage.removeBtn') }}<i
  1070. class="el-icon-caret-top el-icon--right" v-if="!deleteItemLoading"></i></el-button>
  1071. </div>
  1072. </el-main>
  1073. <el-footer style="width: 1080px;height: 222px;padding: 0 0 0 0;margin-top: -4px">
  1074. <span style="font-size: 12px">{{ $t('qc.partAttributePage.existingTemplate') }}</span>
  1075. <div class="rq">
  1076. <el-table height="200px" :data="itemList2" v-loading="itemList2Loading" border ref="itemTable2"
  1077. @row-click="itemClickRow2" @selection-change="selectionItem2" highlight-current-row style="width: 100%">
  1078. <el-table-column type="selection" header-align="center" align="center" width="50">
  1079. </el-table-column>
  1080. <el-table-column prop="templateId" header-align="center" align="center" min-width="80"
  1081. :label="$t('qc.table.templateCode')">
  1082. </el-table-column>
  1083. <el-table-column prop="templateName" header-align="center" align="center" min-width="200"
  1084. :label="$t('qc.table.templateName')">
  1085. </el-table-column>
  1086. <el-table-column prop="operation" header-align="center" align="center" min-width="100"
  1087. :label="$t('qc.table.process')">
  1088. </el-table-column>
  1089. <el-table-column prop="resourceID" header-align="center" align="center" min-width="100"
  1090. :label="$t('qc.table.machine')">
  1091. </el-table-column>
  1092. <el-table-column prop="manufacturerName" header-align="center" align="center" min-width="200"
  1093. :label="$t('qc.table.supplier')">
  1094. </el-table-column>
  1095. <el-table-column prop="customerName" header-align="center" align="center" min-width="200"
  1096. :label="$t('qc.table.customerName')">
  1097. </el-table-column>
  1098. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60"
  1099. :label="$t('qc.table.inspectionType')">
  1100. </el-table-column>
  1101. </el-table>
  1102. </div>
  1103. </el-footer>
  1104. </el-container>
  1105. <el-footer style="height:35px;margin-top: 18px;text-align:center">
  1106. <el-button type="primary" @click="fastAddFlag = false">{{ $t('qc.common.close') }}</el-button>
  1107. </el-footer>
  1108. </el-dialog>
  1109. <!-- 工序 -->
  1110. <el-dialog :title="$t('qc.partAttributePage.dialogOperationList')" :close-on-click-modal="false" v-drag
  1111. :visible.sync="operationModelFlag" width="420px" append-to-body @close="onOperationDialogClose">
  1112. <div class="rq">
  1113. <el-form :inline="true" label-position="top" :model="operationData">
  1114. <el-form-item :label="$t('qc.partAttributePage.operationColon')">
  1115. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  1116. </el-form-item>
  1117. <el-form-item :label="' '">
  1118. <el-button type="primary" @click="getOperationList2">{{ $t('qc.common.search') }}</el-button>
  1119. </el-form-item>
  1120. </el-form>
  1121. <el-table :height="300" :data="operationList" ref="operationTable"
  1122. @row-click="operationClickRow" @row-dblclick="operationDblClickRow"
  1123. @selection-change="selectionOperationChangeHandle" @select="operationSelect" :row-key="getRowKeys"
  1124. :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;">
  1125. <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center"
  1126. :reserve-selection="true" width="50">
  1127. </el-table-column>
  1128. <el-table-column prop="operationDesc" header-align="center" align="center" :label="$t('qc.table.process')">
  1129. </el-table-column>
  1130. </el-table>
  1131. <el-pagination
  1132. class="operation-dialog-pagination"
  1133. small
  1134. :pager-count="5"
  1135. style="margin-top: 10px"
  1136. @current-change="operationCurrentChange"
  1137. :current-page="operationPageIndex"
  1138. :page-size="operationPageSize"
  1139. :total="operationTotalPage"
  1140. layout="total, prev, pager, next">
  1141. </el-pagination>
  1142. </div>
  1143. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1144. <el-button type="primary" @click="confirmOperation">{{ $t('qc.common.confirm') }}</el-button>
  1145. </el-footer>
  1146. </el-dialog>
  1147. <!-- 机台 -->
  1148. <el-dialog :title="$t('qc.partAttributePage.dialogResourceList')" :close-on-click-modal="false" v-drag
  1149. :visible.sync="resourceModelFlag" width="420px" append-to-body @close="onResourceDialogClose">
  1150. <div class="rq">
  1151. <el-form :inline="true" label-position="top" :model="resourceData">
  1152. <el-form-item :label="$t('qc.partAttributePage.resourceId')">
  1153. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  1154. </el-form-item>
  1155. <el-form-item :label="$t('qc.partAttributePage.resourceName')">
  1156. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  1157. </el-form-item>
  1158. <el-form-item :label="' '">
  1159. <el-button type="primary" @click="getAllResourceList2">{{ $t('qc.common.search') }}</el-button>
  1160. </el-form-item>
  1161. </el-form>
  1162. <el-table :height="300" :data="resourceList" ref="resourceTable"
  1163. @row-click="resourceClickRow" @row-dblclick="resourceDblClickRow"
  1164. @selection-change="selectionResourceChangeHandle" @select="resourceSelect" :row-key="getRowKeys2"
  1165. :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;">
  1166. <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center"
  1167. :reserve-selection="true" width="50">
  1168. </el-table-column>
  1169. <el-table-column prop="resourceId" header-align="center" align="center"
  1170. :label="$t('qc.partAttributePage.resourceId')">
  1171. </el-table-column>
  1172. <el-table-column prop="resourceDesc" header-align="center" align="center"
  1173. :label="$t('qc.partAttributePage.resourceName')">
  1174. </el-table-column>
  1175. </el-table>
  1176. </div>
  1177. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1178. <el-button type="primary" @click="confirmResource">{{ $t('qc.common.confirm') }}</el-button>
  1179. </el-footer>
  1180. </el-dialog>
  1181. <!-- 供应商 -->
  1182. <el-dialog :title="$t('qc.partAttributePage.dialogManufacturerList')" :close-on-click-modal="false" v-drag
  1183. :visible.sync="manufacturerModelFlag" width="520px" append-to-body>
  1184. <div class="rq">
  1185. <el-form :inline="true" label-position="top" :model="manufacturerData">
  1186. <el-form-item :label="$t('qc.partAttributePage.manufacturerIdColon')">
  1187. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 100px"></el-input>
  1188. </el-form-item>
  1189. <el-form-item :label="$t('qc.partAttributePage.manufacturerNameColon')">
  1190. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 100px"></el-input>
  1191. </el-form-item>
  1192. <el-form-item :label="' '">
  1193. <el-button type="primary" @click="getManufacturerList2">{{ $t('qc.common.search') }}</el-button>
  1194. </el-form-item>
  1195. </el-form>
  1196. <el-table :height="300" :data="manufacturerList" ref="manufacturerTable" @row-click="manufacturerClickRow"
  1197. @row-dblclick="manufacturerDblClickRow" @selection-change="selectionManufacturerChangeHandle"
  1198. :row-key="getRowKeys3" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;">
  1199. <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center"
  1200. :reserve-selection="true" width="50">
  1201. </el-table-column>
  1202. <el-table-column prop="manufacturerID" header-align="center" align="left" width="90"
  1203. :label="$t('qc.partAttributePage.colSupplierId')" show-overflow-tooltip>
  1204. </el-table-column>
  1205. <el-table-column prop="manufacturerName" header-align="center" align="left" min-width="120"
  1206. :label="$t('qc.partAttributePage.colSupplierNameCol')" show-overflow-tooltip>
  1207. </el-table-column>
  1208. </el-table>
  1209. <el-pagination
  1210. class="manufacturer-dialog-pagination"
  1211. small
  1212. :pager-count="5"
  1213. style="margin-top: 10px"
  1214. @current-change="manufacturerCurrentChange"
  1215. :current-page="manufacturerPageIndex"
  1216. :page-size="manufacturerPageSize"
  1217. :total="manufacturerTotalPage"
  1218. layout="total, prev, pager, next">
  1219. </el-pagination>
  1220. </div>
  1221. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1222. <el-button type="primary" @click="confirmManufacturer">{{ $t('qc.common.confirm') }}</el-button>
  1223. <el-button type="primary" @click="manufacturerModelFlag = false">{{ $t('qc.common.close') }}</el-button>
  1224. </el-footer>
  1225. </el-dialog>
  1226. <!-- 客户 -->
  1227. <el-dialog :title="$t('qc.partAttributePage.dialogCustomerList')" :close-on-click-modal="false" v-drag
  1228. :visible.sync="customerModelFlag" width="520px" append-to-body>
  1229. <div class="rq">
  1230. <el-form :inline="true" label-position="top" :model="customerData">
  1231. <el-form-item :label="$t('qc.partAttributePage.customerIdColon')">
  1232. <el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input>
  1233. </el-form-item>
  1234. <el-form-item :label="$t('qc.partAttributePage.customerNameColon')">
  1235. <el-input v-model="customerData.customerName" clearable style="width: 120px"></el-input>
  1236. </el-form-item>
  1237. <el-form-item :label="' '">
  1238. <el-button type="primary" @click="getCustomerList2">{{ $t('qc.common.search') }}</el-button>
  1239. </el-form-item>
  1240. </el-form>
  1241. <el-table :height="300" :data="customerList" ref="customerTable" @row-click="customerClickRow"
  1242. @row-dblclick="customerDblClickRow" @selection-change="selectionCustomerChangeHandle"
  1243. :row-key="getRowKeys4" :highlight-current-row="!!qcSpecPickerRow" border style="width: 100%;">
  1244. <el-table-column v-if="!qcSpecPickerRow" type="selection" header-align="center" align="center"
  1245. :reserve-selection="true" width="50">
  1246. </el-table-column>
  1247. <el-table-column prop="customerID" header-align="center" align="center" :label="$t('qc.table.customerCode')">
  1248. </el-table-column>
  1249. <el-table-column prop="customerName" header-align="center" align="center"
  1250. :label="$t('qc.table.customerName')">
  1251. </el-table-column>
  1252. </el-table>
  1253. <el-pagination
  1254. class="customer-dialog-pagination"
  1255. small
  1256. :pager-count="5"
  1257. style="margin-top: 10px"
  1258. @size-change="customerSizeChange"
  1259. @current-change="customerCurrentChange"
  1260. :current-page="customerPageIndex"
  1261. :page-sizes="[10, 20, 50, 100]"
  1262. :page-size="customerPageSize"
  1263. :total="customerTotalPage"
  1264. layout="total, sizes, prev, pager, next">
  1265. </el-pagination>
  1266. </div>
  1267. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1268. <el-button type="primary" @click="confirmCustomer">{{ $t('qc.common.confirm') }}</el-button>
  1269. <el-button type="primary" @click="customerModelFlag = false">{{ $t('qc.common.close') }}</el-button>
  1270. </el-footer>
  1271. </el-dialog>
  1272. <!-- sop文件清单 -->
  1273. <el-dialog :title="$t('qc.partAttributePage.dialogSopFileList')" :close-on-click-modal="false" v-drag
  1274. :visible.sync="sopFileModelFlag" width="800px">
  1275. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  1276. <el-form-item :label="' '">
  1277. <el-button type="primary" @click="uploadSopFile">{{ $t('qc.partAttributePage.uploadFile') }}</el-button>
  1278. </el-form-item>
  1279. <el-form-item :label="$t('qc.table.inspectionType')" style="margin-left: 448px">
  1280. <el-select v-model="sopData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')">
  1281. <el-option :label="$t('qc.common.all')" value=""></el-option>
  1282. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  1283. :value="i.inspectionTypeNo">
  1284. </el-option>
  1285. </el-select>
  1286. </el-form-item>
  1287. <el-form-item :label="' '">
  1288. <el-button type="primary" @click="getFileContentList">{{ $t('qc.common.search') }}</el-button>
  1289. </el-form-item>
  1290. </el-form>
  1291. <el-table :height="350" :data="sopList" border style="width: 100%; ">
  1292. <el-table-column v-for="(item,index) in sopColumnList" :key="index" :sortable="item.columnSortable"
  1293. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  1294. :align="item.align" :fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth"
  1295. :label="item.columnLabel">
  1296. <template slot-scope="scope">
  1297. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1298. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1299. style="width: 100px; height: 80px" /></span>
  1300. </template>
  1301. </el-table-column>
  1302. <el-table-column fixed="right" header-align="center" align="center" width="100"
  1303. :label="$t('qc.common.operation')">
  1304. <template slot-scope="scope">
  1305. <el-link style="cursor: pointer" @click="downloadFile(scope.row)">{{ $t('qc.common.download') }}</el-link>
  1306. <el-link style="cursor: pointer" @click="deleteFile(scope.row)">{{ $t('qc.common.delete') }}</el-link>
  1307. </template>
  1308. </el-table-column>
  1309. </el-table>
  1310. </el-dialog>
  1311. <!-- 物料缺陷跟踪新增 -->
  1312. <el-dialog :title="$t('qc.partAttributePage.dialogDefectTracking')" :close-on-click-modal="false" v-drag
  1313. :visible.sync="defectTrackingModal" width="490px">
  1314. <el-form :inline="true" label-position="top" :model="defectTrackingData"
  1315. style="margin-left: 7px;margin-top: -5px;">
  1316. <el-form-item>
  1317. <span v-if="defectTrackingDisableFlag" slot="label">{{ $t('qc.table.supplier') }}</span>
  1318. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(506)"><a
  1319. href="#">{{ $t('qc.table.supplier') }}</a></span>
  1320. <el-input v-model="defectTrackingData.supplierId" :disabled="defectTrackingDisableFlag"
  1321. @change="supplierBlur(506)" style="width: 100px"></el-input>
  1322. <el-input v-model="defectTrackingData.supplierName" disabled style="width: 340px"></el-input>
  1323. </el-form-item>
  1324. </el-form>
  1325. <el-form :inline="true" label-position="top" style="margin-left: 7px">
  1326. <el-form-item :label="$t('qc.partAttributePage.defectThreshold')">
  1327. <el-input-number :controls="false" :step="0" v-model="defectTrackingData.defectThreshold"
  1328. style="width: 100px"></el-input-number>
  1329. </el-form-item>
  1330. <el-form-item :label="$t('qc.partAttributePage.recoveryBatchCount')">
  1331. <el-input-number :controls="false" :step="0" v-model="defectTrackingData.recoveryBatchCount"
  1332. style="width: 100px"></el-input-number>
  1333. </el-form-item>
  1334. </el-form>
  1335. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  1336. <el-button type="primary" @click="saveDefectTracking()">{{ $t('qc.common.save') }}</el-button>
  1337. <el-button type="primary" @click="defectTrackingModal = false">{{ $t('qc.common.close') }}</el-button>
  1338. </el-footer>
  1339. </el-dialog>
  1340. <!-- 标签模版设置新增 -->
  1341. <el-dialog :title="$t('qc.partAttributePage.dialogLabelTemplate')" :close-on-click-modal="false" v-drag
  1342. :visible.sync="labelTemplateModal" width="380px">
  1343. <el-form :inline="true" label-position="top" :model="labelTemplateData"
  1344. style="margin-left: 7px;margin-top: -5px;">
  1345. <el-form-item>
  1346. <span v-if="labelTemplateDisableFlag" slot="label">{{ $t('qc.partAttributePage.colLabelType') }}</span>
  1347. <span v-else style="cursor: pointer" slot="label" @click="getBaseList(1099, 2)"><a
  1348. href="#">{{ $t('qc.partAttributePage.colLabelType') }}</a></span>
  1349. <el-input v-model="labelTemplateData.labelTypeTb" :disabled="labelTemplateDisableFlag"
  1350. @change="labelTemplateBlur(1099)" style="width: 100px"></el-input>
  1351. <el-input v-model="labelTemplateData.labelType" disabled style="width: 230px"></el-input>
  1352. </el-form-item>
  1353. </el-form>
  1354. <el-form :inline="true" label-position="top" :model="labelTemplateData" style="margin-left: 7px;">
  1355. <el-form-item :label="$t('qc.partAttributePage.colDefaultFlag')">
  1356. <el-select v-model="labelTemplateData.defaultFlag" style="width: 100px">
  1357. <el-option :label="$t('qc.partAttributePage.defaultOption')" value="1"></el-option>
  1358. <el-option :label="$t('qc.partAttributePage.nonDefaultOption')" value="0"></el-option>
  1359. </el-select>
  1360. </el-form-item>
  1361. <el-form-item :label="$t('qc.table.process')" style="margin-left: -10px">
  1362. <el-select v-model="labelTemplateData.operationDesc" :placeholder="$t('qc.partAttributePage.selectOperation')"
  1363. filterable clearable style="width: 230px">
  1364. <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option>
  1365. </el-select>
  1366. </el-form-item>
  1367. </el-form>
  1368. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  1369. <el-button type="primary" @click="saveLabelTemplate()">{{ $t('qc.common.save') }}</el-button>
  1370. <el-button type="primary" @click="labelTemplateModal = false">{{ $t('qc.common.close') }}</el-button>
  1371. </el-footer>
  1372. </el-dialog>
  1373. <!-- 检验标准维护新增 -->
  1374. <el-dialog :title="$t('qc.partAttributePage.dialogAddQcSpec')" :close-on-click-modal="false" v-drag
  1375. :visible.sync="qcSpecAddFlag" width="92%" top="4vh" append-to-body
  1376. :before-close="beforeCloseQcSpecAddDialog" @close="onQcSpecAddDialogClose"
  1377. custom-class="config-dialog qc-spec-copy-dialog qc-spec-add-dialog">
  1378. <div class="qc-spec-copy-content">
  1379. <el-form :inline="true" size="small" class="qc-spec-copy-search-form">
  1380. <el-form-item :label="$t('qc.method.colBu')">
  1381. <el-select v-model="qcSpecSearchData.buNo" :placeholder="$t('qc.common.selectPlaceholder')" clearable
  1382. style="width: 160px">
  1383. <el-option v-for="i in qcSpecAddBuList" :key="i.site + '_' + i.buNo"
  1384. :label="i.sitename + ' ' + i.buDesc" :value="i.buNo">
  1385. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  1386. <span
  1387. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  1388. {{ i.buDesc }}
  1389. </span>
  1390. </el-option>
  1391. </el-select>
  1392. </el-form-item>
  1393. <el-form-item :label="$t('qc.table.inspectionType')">
  1394. <el-select v-model="qcSpecSearchData.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')"
  1395. style="width: 140px">
  1396. <el-option :label="$t('qc.common.all')" value=""></el-option>
  1397. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  1398. :value="i.inspectionTypeNo"></el-option>
  1399. </el-select>
  1400. </el-form-item>
  1401. <el-form-item :label="$t('qc.table.itemCode')">
  1402. <el-input v-model="qcSpecSearchData.itemNo" clearable style="width: 140px"
  1403. @keyup.enter.native="getQcSpecItemList"></el-input>
  1404. </el-form-item>
  1405. <el-form-item :label="$t('qc.table.itemName')">
  1406. <el-input v-model="qcSpecSearchData.itemDesc" clearable style="width: 180px"
  1407. @keyup.enter.native="getQcSpecItemList"></el-input>
  1408. </el-form-item>
  1409. <el-form-item>
  1410. <el-button type="primary" icon="el-icon-search" @click="getQcSpecItemList()"
  1411. size="small">{{ $t('qc.common.search') }}</el-button>
  1412. </el-form-item>
  1413. </el-form>
  1414. <div class="qc-spec-copy-available">
  1415. <div class="qc-spec-copy-section-header">
  1416. <span class="qc-spec-copy-section-title">{{ $t('qc.iqcPage.optionalItemList') }}</span>
  1417. <el-button type="primary" size="small" icon="el-icon-plus"
  1418. :disabled="!qcSpecItemSelections1 || qcSpecItemSelections1.length === 0" @click="openQcSpecAddFillDialog">
  1419. {{ $t('qc.partAttributePage.qcSpecAddSelected', { count: qcSpecItemSelections1.length }) }}
  1420. </el-button>
  1421. </div>
  1422. <div class="qc-spec-copy-table-wrap">
  1423. <el-table :data="qcSpecItemList1" ref="qcSpecItemTable1" border height="100%"
  1424. @row-click="qcSpecItemClickRow1" @selection-change="qcSpecSelectionItem1"
  1425. :row-key="getQcSpecAddItemKey" highlight-current-row>
  1426. <el-table-column type="selection" width="45" align="center"
  1427. :selectable="isQcSpecAddItemSelectable"></el-table-column>
  1428. <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" min-width="90"
  1429. show-overflow-tooltip></el-table-column>
  1430. <el-table-column prop="inspectionTypeName" :label="$t('qc.table.inspectionType')" min-width="90"
  1431. show-overflow-tooltip></el-table-column>
  1432. <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" min-width="110"
  1433. show-overflow-tooltip></el-table-column>
  1434. <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" min-width="160"
  1435. show-overflow-tooltip></el-table-column>
  1436. <el-table-column prop="methodName" :label="$t('qc.table.inspectionMethod')" min-width="120"
  1437. show-overflow-tooltip></el-table-column>
  1438. <el-table-column prop="methodRemark" :label="$t('qc.method.colMethodRemark')" min-width="140"
  1439. show-overflow-tooltip></el-table-column>
  1440. <el-table-column prop="valueType" :label="$t('qc.table.valueType')" min-width="90"
  1441. align="center" show-overflow-tooltip>
  1442. <template slot-scope="scope">
  1443. {{ formatQcValueType(scope.row) }}
  1444. </template>
  1445. </el-table-column>
  1446. <el-table-column prop="defaultValue" :label="$t('qc.table.standardValue')" min-width="80"
  1447. align="center"></el-table-column>
  1448. <el-table-column prop="maxValue" :label="$t('qc.table.upperValue')" min-width="70"
  1449. align="right"></el-table-column>
  1450. <el-table-column prop="minValue" :label="$t('qc.table.lowerValue')" min-width="70"
  1451. align="right"></el-table-column>
  1452. <el-table-column :label="$t('qc.partAttributePage.qcSpecCopyStatus')" width="90" align="center">
  1453. <template slot-scope="scope">
  1454. <el-tag v-if="isQcSpecAddItemPending(scope.row)" type="info" size="mini">
  1455. {{ $t('qc.partAttributePage.qcSpecCopyAdded') }}
  1456. </el-tag>
  1457. </template>
  1458. </el-table-column>
  1459. </el-table>
  1460. </div>
  1461. </div>
  1462. <div class="qc-spec-copy-selected">
  1463. <div class="qc-spec-copy-section-header qc-spec-copy-added-header">
  1464. <span class="qc-spec-copy-section-title">
  1465. {{ $t('qc.partAttributePage.qcSpecAddPendingItems', { count: qcSpecPendingList.length }) }}
  1466. </span>
  1467. <el-button type="danger" plain size="small" icon="el-icon-delete"
  1468. :disabled="qcSpecPendingList.length === 0" @click="clearQcSpecPendingList">
  1469. {{ $t('qc.partAttributePage.qcSpecCopyClearAdded') }}
  1470. </el-button>
  1471. </div>
  1472. <div class="qc-spec-copy-table-wrap">
  1473. <el-table :data="qcSpecPendingList" ref="qcSpecPendingTable" border height="100%"
  1474. :row-key="getQcSpecPendingRowKey">
  1475. <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" min-width="90"
  1476. show-overflow-tooltip></el-table-column>
  1477. <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" min-width="110"
  1478. show-overflow-tooltip></el-table-column>
  1479. <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" min-width="150"
  1480. show-overflow-tooltip></el-table-column>
  1481. <el-table-column prop="inspectionTypeName" :label="$t('qc.table.inspectionType')" min-width="90"
  1482. show-overflow-tooltip></el-table-column>
  1483. <el-table-column prop="ipqcInspectionMethod" :label="$t('qc.partAttributePage.colIpqcMethod')"
  1484. min-width="120" show-overflow-tooltip>
  1485. <template slot-scope="scope">
  1486. <el-select v-if="String(scope.row.inspectionTypeNo) === '101'"
  1487. v-model="scope.row.ipqcInspectionMethod" :placeholder="$t('qc.common.selectPlaceholder')"
  1488. clearable size="mini" style="width: 100%">
  1489. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  1490. :label="method.label" :value="method.value"></el-option>
  1491. </el-select>
  1492. <span v-else>{{ formatIpqcMethod(scope.row.ipqcInspectionMethod) }}</span>
  1493. </template>
  1494. </el-table-column>
  1495. <el-table-column prop="valueType" :label="$t('qc.table.valueType')" min-width="90"
  1496. align="center" show-overflow-tooltip>
  1497. <template slot-scope="scope">
  1498. {{ formatQcValueType(scope.row) }}
  1499. </template>
  1500. </el-table-column>
  1501. <el-table-column prop="defaultValue" :label="$t('qc.table.standardValue')" min-width="100">
  1502. <template slot-scope="scope">
  1503. <el-input v-model="scope.row.defaultValue" size="mini"></el-input>
  1504. </template>
  1505. </el-table-column>
  1506. <el-table-column prop="maxValue" :label="$t('qc.table.upperValue')" min-width="90">
  1507. <template slot-scope="scope">
  1508. <el-input v-model="scope.row.maxValue" size="mini"></el-input>
  1509. </template>
  1510. </el-table-column>
  1511. <el-table-column prop="minValue" :label="$t('qc.table.lowerValue')" min-width="90">
  1512. <template slot-scope="scope">
  1513. <el-input v-model="scope.row.minValue" size="mini"></el-input>
  1514. </template>
  1515. </el-table-column>
  1516. <el-table-column prop="samplingProgrammeDesc" :label="$t('qc.partAttributePage.samplingProgramme')"
  1517. min-width="180">
  1518. <template slot-scope="scope">
  1519. <span class="qc-spec-cell-picker">
  1520. <el-button type="text" class="qc-spec-cell-picker-btn"
  1521. @click="chooseProgrammeRow(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1522. <el-input v-model="scope.row.samplingProgrammeDesc" readonly size="mini"
  1523. class="qc-spec-cell-picker-input"></el-input>
  1524. </span>
  1525. </template>
  1526. </el-table-column>
  1527. <el-table-column prop="samplingLevelDesc" :label="$t('qc.partAttributePage.samplingLevel')"
  1528. min-width="180">
  1529. <template slot-scope="scope">
  1530. <span class="qc-spec-cell-picker">
  1531. <el-button type="text" class="qc-spec-cell-picker-btn"
  1532. @click="chooseLevel(scope.row)">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1533. <el-input v-model="scope.row.samplingLevelDesc" readonly size="mini"
  1534. class="qc-spec-cell-picker-input"></el-input>
  1535. </span>
  1536. </template>
  1537. </el-table-column>
  1538. <el-table-column prop="defaultSamplingQuantity" :label="$t('qc.template.colDefaultSamplingQty')"
  1539. min-width="110">
  1540. <template slot-scope="scope">
  1541. <el-input v-model="scope.row.defaultSamplingQuantity" size="mini"
  1542. @input="onQcSpecSamplingQtyInput(scope.row)"></el-input>
  1543. </template>
  1544. </el-table-column>
  1545. <el-table-column prop="defaultSamplingProportion" :label="$t('qc.template.colDefaultSamplingRatio')"
  1546. min-width="110">
  1547. <template slot-scope="scope">
  1548. <el-input v-model="scope.row.defaultSamplingProportion" size="mini"
  1549. @input="onQcSpecSamplingRatioInput(scope.row)"></el-input>
  1550. </template>
  1551. </el-table-column>
  1552. <el-table-column prop="operation" :label="$t('qc.table.process')" min-width="130"
  1553. show-overflow-tooltip>
  1554. <template slot-scope="scope">
  1555. <span v-if="qcSpecRowAllowsOperation(scope.row)">
  1556. <el-button type="text" @click="openQcSpecLinkedOperationPicker(scope.row)"
  1557. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1558. <span>{{ scope.row.operation }}</span>
  1559. <el-button v-if="qcSpecHasValue(scope.row.operation)" type="text" icon="el-icon-close"
  1560. class="qc-spec-pending-clear-btn"
  1561. @click="clearQcSpecPendingLinkedField(scope.row, 'operation')"></el-button>
  1562. </span>
  1563. <span v-else>{{ scope.row.operation }}</span>
  1564. </template>
  1565. </el-table-column>
  1566. <el-table-column prop="resourceID" :label="$t('qc.table.machine')" min-width="150"
  1567. show-overflow-tooltip>
  1568. <template slot-scope="scope">
  1569. <span v-if="qcSpecRowAllowsResource(scope.row)">
  1570. <el-button type="text" @click="openQcSpecLinkedResourcePicker(scope.row)"
  1571. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1572. <span>{{ scope.row.resourceDesc || scope.row.resourceID }}</span>
  1573. <el-button
  1574. v-if="qcSpecHasValue(scope.row.resourceID) || qcSpecHasValue(scope.row.resourceDesc)"
  1575. type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn"
  1576. @click="clearQcSpecPendingLinkedField(scope.row, 'resource')"></el-button>
  1577. </span>
  1578. <span v-else>{{ scope.row.resourceDesc || scope.row.resourceID }}</span>
  1579. </template>
  1580. </el-table-column>
  1581. <el-table-column prop="manufacturerName" :label="$t('qc.table.supplier')" min-width="150"
  1582. show-overflow-tooltip>
  1583. <template slot-scope="scope">
  1584. <span v-if="qcSpecRowAllowsManufacturer(scope.row)">
  1585. <el-button type="text" @click="openQcSpecLinkedManufacturerPicker(scope.row)"
  1586. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1587. <span>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span>
  1588. <el-button
  1589. v-if="qcSpecHasValue(scope.row.manufacturerID) || qcSpecHasValue(scope.row.manufacturerName)"
  1590. type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn"
  1591. @click="clearQcSpecPendingLinkedField(scope.row, 'manufacturer')"></el-button>
  1592. </span>
  1593. <span v-else>{{ scope.row.manufacturerName || scope.row.manufacturerID }}</span>
  1594. </template>
  1595. </el-table-column>
  1596. <el-table-column prop="customerName" :label="$t('qc.table.customerName')" min-width="150"
  1597. show-overflow-tooltip>
  1598. <template slot-scope="scope">
  1599. <span v-if="qcSpecRowAllowsCustomer(scope.row)">
  1600. <el-button type="text" @click="openQcSpecLinkedCustomerPicker(scope.row)"
  1601. style="padding: 3px 4px">{{ $t('qc.partAttributePage.selectBtn') }}</el-button>
  1602. <span>{{ scope.row.customerName || scope.row.customerID }}</span>
  1603. <el-button
  1604. v-if="qcSpecHasValue(scope.row.customerID) || qcSpecHasValue(scope.row.customerName)"
  1605. type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn"
  1606. @click="clearQcSpecPendingLinkedField(scope.row, 'customer')"></el-button>
  1607. </span>
  1608. <span v-else>{{ scope.row.customerName || scope.row.customerID }}</span>
  1609. </template>
  1610. </el-table-column>
  1611. <el-table-column :label="$t('qc.common.operation')" width="80" align="center">
  1612. <template slot-scope="scope">
  1613. <el-tooltip :content="$t('qc.partAttributePage.qcSpecAddRemovePending')" placement="top">
  1614. <el-button type="text" icon="el-icon-delete" class="qc-spec-copy-remove-button"
  1615. @click="removeQcSpecPendingItem(scope.row)"></el-button>
  1616. </el-tooltip>
  1617. </template>
  1618. </el-table-column>
  1619. </el-table>
  1620. </div>
  1621. </div>
  1622. </div>
  1623. <span slot="footer" class="dialog-footer">
  1624. <el-button type="primary" @click="confirmQcSpecAdd" :loading="qcSpecAddSaveLoading"
  1625. size="small">{{ $t('qc.common.confirm') }}</el-button>
  1626. <el-button @click="qcSpecAddFlag = false" size="small">{{ $t('qc.common.cancel') }}</el-button>
  1627. </span>
  1628. </el-dialog>
  1629. <!-- 新增质检项目-填写工序/机台/供应商/客户 -->
  1630. <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecAddFill')" :close-on-click-modal="false" v-drag
  1631. :visible.sync="qcSpecAddFillDialogFlag" width="720px" append-to-body custom-class="config-dialog">
  1632. <div class="qc-spec-batch-fill-content">
  1633. <el-form label-position="top" :model="qcSpecAddApplyData">
  1634. <el-row :gutter="20">
  1635. <el-col :span="8">
  1636. <el-form-item :label="$t('qc.table.inspectionType')" required>
  1637. <el-select v-model="qcSpecAddApplyData.inspectionTypeNo"
  1638. :placeholder="$t('qc.common.selectPlaceholder')" size="small" disabled style="width: 100%">
  1639. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  1640. :value="i.inspectionTypeNo"></el-option>
  1641. </el-select>
  1642. </el-form-item>
  1643. </el-col>
  1644. <el-col v-if="qcSpecAddApplyIsIpqc" :span="8">
  1645. <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')">
  1646. <el-select v-model="qcSpecAddApplyData.ipqcInspectionMethod"
  1647. :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%">
  1648. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  1649. :label="method.label" :value="method.value"></el-option>
  1650. </el-select>
  1651. </el-form-item>
  1652. </el-col>
  1653. <el-col :span="8">
  1654. <el-form-item>
  1655. <span slot="label">
  1656. <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanOperation }"
  1657. @click="openQcSpecAddApplyOperationPicker">{{ $t('qc.table.process') }}</a>
  1658. </span>
  1659. <div class="qc-spec-add-apply-input">
  1660. <el-input v-model="qcSpecAddApplyData.operation" readonly size="small"
  1661. :disabled="!qcSpecAddApplyCanOperation"
  1662. :class="{ 'is-clearable': qcSpecAddApplyCanOperation && qcSpecHasValue(qcSpecAddApplyData.operation) }"></el-input>
  1663. <i v-if="qcSpecAddApplyCanOperation && qcSpecHasValue(qcSpecAddApplyData.operation)"
  1664. class="el-icon-circle-close qc-spec-add-apply-clear"
  1665. @click.stop="clearQcSpecAddApplyOperation"></i>
  1666. </div>
  1667. </el-form-item>
  1668. </el-col>
  1669. <el-col :span="8">
  1670. <el-form-item>
  1671. <span slot="label">
  1672. <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanResource }"
  1673. @click="openQcSpecAddApplyResourcePicker">{{ $t('qc.table.machine') }}</a>
  1674. </span>
  1675. <div class="qc-spec-add-apply-input">
  1676. <el-input :value="qcSpecAddApplyData.resourceDesc || qcSpecAddApplyData.resourceID" readonly
  1677. size="small" :disabled="!qcSpecAddApplyCanResource"
  1678. :class="{ 'is-clearable': qcSpecAddApplyCanResource && (qcSpecHasValue(qcSpecAddApplyData.resourceID) || qcSpecHasValue(qcSpecAddApplyData.resourceDesc)) }"></el-input>
  1679. <i
  1680. v-if="qcSpecAddApplyCanResource && (qcSpecHasValue(qcSpecAddApplyData.resourceID) || qcSpecHasValue(qcSpecAddApplyData.resourceDesc))"
  1681. class="el-icon-circle-close qc-spec-add-apply-clear"
  1682. @click.stop="clearQcSpecAddApplyResource"></i>
  1683. </div>
  1684. </el-form-item>
  1685. </el-col>
  1686. <el-col :span="12">
  1687. <el-form-item>
  1688. <span slot="label">
  1689. <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanManufacturer }"
  1690. @click="openQcSpecAddApplyManufacturerPicker">{{ $t('qc.table.supplier') }}</a>
  1691. </span>
  1692. <div class="qc-spec-add-apply-input">
  1693. <el-input :value="qcSpecAddApplyData.manufacturerName || qcSpecAddApplyData.manufacturerID"
  1694. readonly size="small" :disabled="!qcSpecAddApplyCanManufacturer"
  1695. :class="{ 'is-clearable': qcSpecAddApplyCanManufacturer && (qcSpecHasValue(qcSpecAddApplyData.manufacturerID) || qcSpecHasValue(qcSpecAddApplyData.manufacturerName)) }"></el-input>
  1696. <i
  1697. v-if="qcSpecAddApplyCanManufacturer && (qcSpecHasValue(qcSpecAddApplyData.manufacturerID) || qcSpecHasValue(qcSpecAddApplyData.manufacturerName))"
  1698. class="el-icon-circle-close qc-spec-add-apply-clear"
  1699. @click.stop="clearQcSpecAddApplyManufacturer"></i>
  1700. </div>
  1701. </el-form-item>
  1702. </el-col>
  1703. <el-col :span="12">
  1704. <el-form-item>
  1705. <span slot="label">
  1706. <a class="qc-spec-add-apply-link" :class="{ 'is-disabled': !qcSpecAddApplyCanCustomer }"
  1707. @click="openQcSpecAddApplyCustomerPicker">{{ $t('qc.table.customerName') }}</a>
  1708. </span>
  1709. <div class="qc-spec-add-apply-input">
  1710. <el-input :value="qcSpecAddApplyData.customerName || qcSpecAddApplyData.customerID" readonly
  1711. size="small" :disabled="!qcSpecAddApplyCanCustomer"
  1712. :class="{ 'is-clearable': qcSpecAddApplyCanCustomer && (qcSpecHasValue(qcSpecAddApplyData.customerID) || qcSpecHasValue(qcSpecAddApplyData.customerName)) }"></el-input>
  1713. <i
  1714. v-if="qcSpecAddApplyCanCustomer && (qcSpecHasValue(qcSpecAddApplyData.customerID) || qcSpecHasValue(qcSpecAddApplyData.customerName))"
  1715. class="el-icon-circle-close qc-spec-add-apply-clear"
  1716. @click.stop="clearQcSpecAddApplyCustomer"></i>
  1717. </div>
  1718. </el-form-item>
  1719. </el-col>
  1720. </el-row>
  1721. </el-form>
  1722. </div>
  1723. <span slot="footer" class="dialog-footer">
  1724. <el-button type="primary" size="small" @click="confirmQcSpecAddFill">{{ $t('qc.common.confirm') }}</el-button>
  1725. <el-button size="small" @click="qcSpecAddFillDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button>
  1726. </span>
  1727. </el-dialog>
  1728. <QcSpecUpload ref="qcSpecUpload" @refreshQcSpecList="refreshQcSpecList()" v-drag></QcSpecUpload>
  1729. <!-- 复制/更新质检项目到其它物料 -->
  1730. <el-dialog :title="qcSpecPartTransferDialogTitle" :close-on-click-modal="false" v-drag
  1731. :visible.sync="qcSpecCopyDialogFlag" width="92%" top="4vh" append-to-body
  1732. custom-class="config-dialog qc-spec-copy-dialog">
  1733. <div class="qc-spec-copy-content">
  1734. <el-form :inline="true" size="small" class="qc-spec-copy-search-form">
  1735. <el-form-item :label="$t('qc.table.materialCode')">
  1736. <el-input v-model="qcSpecCopySearchData.partNo" clearable style="width: 150px"
  1737. @keyup.enter.native="searchQcSpecCopyPartList"></el-input>
  1738. </el-form-item>
  1739. <el-form-item :label="$t('qc.table.materialName')">
  1740. <el-input v-model="qcSpecCopySearchData.partDesc" clearable style="width: 190px"
  1741. @keyup.enter.native="searchQcSpecCopyPartList"></el-input>
  1742. </el-form-item>
  1743. <el-form-item>
  1744. <el-button type="primary" icon="el-icon-search" :loading="qcSpecCopyLoading"
  1745. @click="searchQcSpecCopyPartList">{{ $t('qc.common.search') }}</el-button>
  1746. </el-form-item>
  1747. </el-form>
  1748. <div class="qc-spec-copy-available">
  1749. <div class="qc-spec-copy-section-header">
  1750. <span class="qc-spec-copy-section-title">{{ $t('qc.partAttributePage.qcSpecCopyAvailableParts') }}</span>
  1751. <el-button type="primary" size="small" icon="el-icon-plus"
  1752. :disabled="qcSpecCopyPartSelections.length === 0" @click="addQcSpecCopySelectedParts">
  1753. {{ $t('qc.partAttributePage.qcSpecCopyAddSelected', { count: qcSpecCopyPartSelections.length }) }}
  1754. </el-button>
  1755. </div>
  1756. <div class="qc-spec-copy-table-wrap">
  1757. <el-table :data="qcSpecCopyPartList" ref="qcSpecCopyPartTable" border height="100%"
  1758. v-loading="qcSpecCopyLoading" @selection-change="qcSpecCopyPartSelectionChange"
  1759. @row-click="qcSpecCopyPartClickRow" :row-key="getQcSpecCopyPartRowKey">
  1760. <el-table-column type="selection" width="45" align="center" :reserve-selection="true"
  1761. :selectable="isQcSpecCopyPartSelectable"></el-table-column>
  1762. <el-table-column prop="partNo" :label="$t('qc.table.materialCode')" min-width="120"
  1763. show-overflow-tooltip></el-table-column>
  1764. <el-table-column prop="partDesc" :label="$t('qc.table.materialName')" min-width="180"
  1765. show-overflow-tooltip></el-table-column>
  1766. <el-table-column prop="partType" :label="$t('qc.table.partType')" min-width="100"
  1767. show-overflow-tooltip></el-table-column>
  1768. <el-table-column prop="spec" :label="$t('qc.table.spec')" min-width="120"
  1769. show-overflow-tooltip></el-table-column>
  1770. <el-table-column :label="$t('qc.partAttributePage.qcSpecCopyStatus')" width="110" align="center">
  1771. <template slot-scope="scope">
  1772. <el-tag v-if="isQcSpecCopyPartAdded(scope.row)" type="info" size="mini">
  1773. {{ $t('qc.partAttributePage.qcSpecCopyAdded') }}
  1774. </el-tag>
  1775. <el-tag v-else-if="isQcSpecCopySourcePart(scope.row)" type="warning" size="mini">
  1776. {{ $t('qc.partAttributePage.qcSpecCopySourcePart') }}
  1777. </el-tag>
  1778. </template>
  1779. </el-table-column>
  1780. </el-table>
  1781. </div>
  1782. <el-pagination class="qc-spec-copy-pagination" @size-change="qcSpecCopySizeChange"
  1783. @current-change="qcSpecCopyCurrentChange" :current-page="qcSpecCopyPageIndex"
  1784. :page-sizes="[10, 20, 50, 100]" :page-size="qcSpecCopyPageSize" :total="qcSpecCopyTotalPage"
  1785. layout="total, sizes, prev, pager, next, jumper">
  1786. </el-pagination>
  1787. </div>
  1788. <div class="qc-spec-copy-selected">
  1789. <div class="qc-spec-copy-section-header qc-spec-copy-added-header">
  1790. <span class="qc-spec-copy-section-title">
  1791. {{ $t('qc.partAttributePage.qcSpecCopyAddedParts', { count: qcSpecCopyAddedParts.length }) }}
  1792. </span>
  1793. <el-button type="danger" plain size="small" icon="el-icon-delete"
  1794. :disabled="qcSpecCopyAddedParts.length === 0" @click="clearQcSpecCopyAddedParts">
  1795. {{ $t('qc.partAttributePage.qcSpecCopyClearAdded') }}
  1796. </el-button>
  1797. </div>
  1798. <div class="qc-spec-copy-table-wrap">
  1799. <el-table :data="qcSpecCopyAddedParts" ref="qcSpecCopyAddedTable" border height="100%"
  1800. :row-key="getQcSpecCopyPartRowKey">
  1801. <el-table-column prop="partNo" :label="$t('qc.table.materialCode')" min-width="120"
  1802. show-overflow-tooltip></el-table-column>
  1803. <el-table-column prop="partDesc" :label="$t('qc.table.materialName')" min-width="180"
  1804. show-overflow-tooltip></el-table-column>
  1805. <el-table-column prop="partType" :label="$t('qc.table.partType')" min-width="100"
  1806. show-overflow-tooltip></el-table-column>
  1807. <el-table-column prop="spec" :label="$t('qc.table.spec')" min-width="120"
  1808. show-overflow-tooltip></el-table-column>
  1809. <el-table-column :label="$t('qc.common.operation')" width="80" align="center">
  1810. <template slot-scope="scope">
  1811. <el-tooltip :content="$t('qc.partAttributePage.qcSpecCopyRemoveAdded')" placement="top">
  1812. <el-button type="text" icon="el-icon-delete" class="qc-spec-copy-remove-button"
  1813. @click="removeQcSpecCopyAddedPart(scope.row)"></el-button>
  1814. </el-tooltip>
  1815. </template>
  1816. </el-table-column>
  1817. </el-table>
  1818. </div>
  1819. </div>
  1820. </div>
  1821. <span slot="footer" class="dialog-footer">
  1822. <el-button type="primary" @click="confirmQcSpecPartTransfer" :loading="qcSpecCopyConfirmLoading"
  1823. size="small">{{ $t('qc.common.confirm') }}</el-button>
  1824. <el-button @click="qcSpecCopyDialogFlag = false" size="small">{{ $t('qc.common.cancel') }}</el-button>
  1825. </span>
  1826. </el-dialog>
  1827. <!-- 质检项目批量设置 -->
  1828. <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecBatchFill')" :close-on-click-modal="false" v-drag
  1829. :visible.sync="qcSpecBatchFillDialogFlag" width="720px" append-to-body custom-class="config-dialog">
  1830. <div class="qc-spec-batch-fill-content">
  1831. <el-form label-position="top" :model="qcSpecBatchFillData">
  1832. <el-row :gutter="20">
  1833. <el-col :span="6">
  1834. <el-form-item :label="$t('qc.method.colBu')" required>
  1835. <el-select v-model="qcSpecBatchFillData.buNo" :placeholder="$t('qc.common.selectPlaceholder')"
  1836. size="small" style="width: 100%">
  1837. <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc"
  1838. :value="i.buNo">
  1839. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  1840. <span
  1841. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  1842. {{ i.buDesc }}
  1843. </span>
  1844. </el-option>
  1845. </el-select>
  1846. </el-form-item>
  1847. </el-col>
  1848. <el-col :span="6">
  1849. <el-form-item :label="$t('qc.table.inspectionType')" required>
  1850. <el-select v-model="qcSpecBatchFillData.inspectionTypeNo"
  1851. :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%"
  1852. @change="onQcSpecBatchFillInspectionTypeChange">
  1853. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  1854. :value="i.inspectionTypeNo"></el-option>
  1855. </el-select>
  1856. </el-form-item>
  1857. </el-col>
  1858. <el-col :span="6">
  1859. <el-form-item>
  1860. <span slot="label" @click="chooseQcSpecBatchFillProgramme"><a>{{ $t('qc.partAttributePage.samplingProgramme') }}</a></span>
  1861. <el-input v-model="qcSpecBatchFillData.samplingProgrammeDesc" readonly size="small"></el-input>
  1862. </el-form-item>
  1863. </el-col>
  1864. <el-col :span="6">
  1865. <el-form-item>
  1866. <span slot="label" @click="chooseQcSpecBatchFillLevel"><a>{{ $t('qc.partAttributePage.samplingLevel') }}</a></span>
  1867. <el-input v-model="qcSpecBatchFillData.samplingLevelDesc" readonly size="small"></el-input>
  1868. </el-form-item>
  1869. </el-col>
  1870. <el-col :span="6">
  1871. <el-form-item :label="$t('qc.template.colDefaultSamplingQty')">
  1872. <el-input v-model="qcSpecBatchFillData.defaultSamplingQuantity" size="small"
  1873. @input="onQcSpecBatchFillQtyInput"></el-input>
  1874. </el-form-item>
  1875. </el-col>
  1876. <el-col :span="6">
  1877. <el-form-item :label="$t('qc.template.colDefaultSamplingRatio')">
  1878. <el-input v-model="qcSpecBatchFillData.defaultSamplingProportion" size="small"
  1879. @input="onQcSpecBatchFillRatioInput"></el-input>
  1880. </el-form-item>
  1881. </el-col>
  1882. <el-col :span="6">
  1883. <el-form-item>
  1884. <span slot="label" @click="openQcSpecBatchFillOperationPicker"><a>{{ $t('qc.table.process') }}</a></span>
  1885. <el-input v-model="qcSpecBatchFillData.operation" readonly size="small"></el-input>
  1886. </el-form-item>
  1887. </el-col>
  1888. <el-col :span="6">
  1889. <el-form-item>
  1890. <span slot="label" @click="openQcSpecBatchFillResourcePicker"><a>{{ $t('qc.table.machine') }}</a></span>
  1891. <el-input :value="qcSpecBatchFillData.resourceDesc || qcSpecBatchFillData.resourceID" readonly
  1892. size="small"></el-input>
  1893. </el-form-item>
  1894. </el-col>
  1895. <el-col :span="12">
  1896. <el-form-item>
  1897. <span slot="label" @click="openQcSpecBatchFillManufacturerPicker"><a>{{ $t('qc.table.supplier') }}</a></span>
  1898. <el-input :value="qcSpecBatchFillData.manufacturerName || qcSpecBatchFillData.manufacturerID" readonly
  1899. size="small"></el-input>
  1900. </el-form-item>
  1901. </el-col>
  1902. <el-col :span="12">
  1903. <el-form-item>
  1904. <span slot="label" @click="openQcSpecBatchFillCustomerPicker"><a>{{ $t('qc.table.customerName') }}</a></span>
  1905. <el-input :value="qcSpecBatchFillData.customerName || qcSpecBatchFillData.customerID" readonly
  1906. size="small"></el-input>
  1907. </el-form-item>
  1908. </el-col>
  1909. <el-col v-if="qcSpecBatchFillTypeIsIpqc" :span="6">
  1910. <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')">
  1911. <el-select v-model="qcSpecBatchFillData.ipqcInspectionMethod"
  1912. :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%">
  1913. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  1914. :label="method.label" :value="method.value"></el-option>
  1915. </el-select>
  1916. </el-form-item>
  1917. </el-col>
  1918. </el-row>
  1919. </el-form>
  1920. </div>
  1921. <div slot="footer" class="dialog-footer">
  1922. <el-button type="primary" @click="confirmQcSpecBatchFill(true)" :loading="qcSpecBatchFillLoading">
  1923. {{ $t('qc.partAttributePage.qcSpecBatchFillSaveOverwrite') }}
  1924. </el-button>
  1925. <el-button type="primary" @click="confirmQcSpecBatchFill(false)" :loading="qcSpecBatchFillLoading">
  1926. {{ $t('qc.partAttributePage.qcSpecBatchFillSaveSkipExisting') }}
  1927. </el-button>
  1928. <el-button @click="qcSpecBatchFillDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button>
  1929. </div>
  1930. </el-dialog>
  1931. <!-- 质检项目数据同步 -->
  1932. <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecDataSync')" :close-on-click-modal="false" v-drag
  1933. :visible.sync="qcSpecSyncDialogFlag" width="720px" append-to-body custom-class="config-dialog">
  1934. <div class="qc-spec-sync-content">
  1935. <el-form label-position="top" :model="qcSpecSyncData">
  1936. <el-row :gutter="20">
  1937. <el-col :span="8">
  1938. <el-form-item :label="$t('qc.method.colBu')" required>
  1939. <el-select v-model="qcSpecSyncData.buNo" :placeholder="$t('qc.common.selectPlaceholder')"
  1940. size="small" style="width: 100%">
  1941. <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc"
  1942. :value="i.buNo">
  1943. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  1944. <span
  1945. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  1946. {{ i.buDesc }}
  1947. </span>
  1948. </el-option>
  1949. </el-select>
  1950. </el-form-item>
  1951. </el-col>
  1952. <el-col :span="8">
  1953. <el-form-item :label="$t('qc.table.inspectionType')" required>
  1954. <el-select v-model="qcSpecSyncData.inspectionTypeNo"
  1955. :placeholder="$t('qc.common.selectPlaceholder')" size="small" style="width: 100%"
  1956. @change="onQcSpecSyncInspectionTypeChange">
  1957. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  1958. :value="i.inspectionTypeNo"></el-option>
  1959. </el-select>
  1960. </el-form-item>
  1961. </el-col>
  1962. <el-col v-if="qcSpecSyncTypeIsIpqc" :span="8">
  1963. <el-form-item :label="$t('qc.partAttributePage.colIpqcMethod')">
  1964. <el-select v-model="qcSpecSyncData.ipqcInspectionMethod"
  1965. :placeholder="$t('qc.common.selectPlaceholder')" size="small" clearable style="width: 100%">
  1966. <el-option v-for="method in ipqcMethodOptions" :key="method.value"
  1967. :label="method.label" :value="method.value"></el-option>
  1968. </el-select>
  1969. </el-form-item>
  1970. </el-col>
  1971. </el-row>
  1972. <el-row :gutter="20" class="qc-spec-sync-fields">
  1973. <el-col :span="8">
  1974. <el-checkbox v-model="qcSpecSyncData.syncValueType">
  1975. {{ $t('qc.partAttributePage.qcSpecSyncFieldValueType') }}
  1976. </el-checkbox>
  1977. </el-col>
  1978. <el-col :span="8">
  1979. <el-checkbox v-model="qcSpecSyncData.syncDefaultValue">
  1980. {{ $t('qc.partAttributePage.qcSpecSyncFieldDefaultValue') }}
  1981. </el-checkbox>
  1982. </el-col>
  1983. <el-col :span="8">
  1984. <el-checkbox v-model="qcSpecSyncData.syncSamplingPlanLevel">
  1985. {{ $t('qc.partAttributePage.qcSpecSyncFieldSamplingPlanLevel') }}
  1986. </el-checkbox>
  1987. </el-col>
  1988. <el-col :span="8">
  1989. <el-checkbox v-model="qcSpecSyncData.syncMaxValue">
  1990. {{ $t('qc.partAttributePage.qcSpecSyncFieldMaxValue') }}
  1991. </el-checkbox>
  1992. </el-col>
  1993. <el-col :span="8">
  1994. <el-checkbox v-model="qcSpecSyncData.syncMinValue">
  1995. {{ $t('qc.partAttributePage.qcSpecSyncFieldMinValue') }}
  1996. </el-checkbox>
  1997. </el-col>
  1998. </el-row>
  1999. <div v-if="qcSpecSyncData.syncValueType" class="qc-spec-sync-hint">
  2000. {{ $t('qc.partAttributePage.qcSpecSyncValueTypeHint') }}
  2001. </div>
  2002. </el-form>
  2003. </div>
  2004. <div slot="footer" class="dialog-footer">
  2005. <el-button type="primary" @click="confirmQcSpecSync(true)" :loading="qcSpecSyncLoading">
  2006. {{ $t('qc.partAttributePage.qcSpecBatchFillSaveOverwrite') }}
  2007. </el-button>
  2008. <el-button type="primary" @click="confirmQcSpecSync(false)" :loading="qcSpecSyncLoading">
  2009. {{ $t('qc.partAttributePage.qcSpecBatchFillSaveSkipExisting') }}
  2010. </el-button>
  2011. <el-button @click="qcSpecSyncDialogFlag = false">{{ $t('qc.common.cancel') }}</el-button>
  2012. </div>
  2013. </el-dialog>
  2014. <!-- 检验标准预警配置 -->
  2015. <el-dialog :title="$t('qc.partAttributePage.dialogQcSpecWarning')" :close-on-click-modal="false" v-drag
  2016. :visible.sync="qcSpecWarningDialogFlag" width="1050px" append-to-body custom-class="config-dialog">
  2017. <div class="qc-spec-warning-dialog">
  2018. <div class="qc-spec-warning-header">
  2019. <span class="qc-spec-warning-item-info" v-if="qcSpecWarningCurrentRow">
  2020. {{ $t('qc.partAttributePage.qcSpecWarningItemInfo', { itemNo: qcSpecWarningCurrentRow.itemNo, itemDesc: qcSpecWarningCurrentRow.itemDesc }) }}
  2021. </span>
  2022. <el-button type="primary" size="small" icon="el-icon-plus"
  2023. @click="addQcSpecWarningRow">{{ $t('qc.common.add') }}</el-button>
  2024. </div>
  2025. <el-table :data="qcSpecWarningList" border height="360px" v-loading="qcSpecWarningLoading"
  2026. style="width: 100%; margin-top: 10px;">
  2027. <el-table-column :label="$t('qc.partAttributePage.warningLevel')" header-align="center" align="center"
  2028. min-width="120">
  2029. <template slot-scope="scope">
  2030. <el-select v-model="scope.row.warningLevel" size="small" :placeholder="$t('qc.common.selectPlaceholder')"
  2031. style="width: 100%">
  2032. <el-option v-for="item in qcSpecWarningDictOptions.warningLevel" :key="item.dictValue"
  2033. :label="item.dictLabel" :value="item.dictValue">
  2034. </el-option>
  2035. </el-select>
  2036. </template>
  2037. </el-table-column>
  2038. <el-table-column :label="$t('qc.partAttributePage.colorIndicator')" header-align="center" align="center"
  2039. width="90">
  2040. <template slot-scope="scope">
  2041. <el-color-picker v-model="scope.row.colorCode" size="small" color-format="hex"
  2042. :predefine="['#FFB6C1', '#FFD700', '#F56C6C', '#E6A23C', '#67C23A', '#409EFF']">
  2043. </el-color-picker>
  2044. </template>
  2045. </el-table-column>
  2046. <el-table-column :label="$t('qc.partAttributePage.triggerMode')" header-align="center" align="center"
  2047. min-width="130">
  2048. <template slot-scope="scope">
  2049. <el-select v-model="scope.row.triggerMode" size="small" :placeholder="$t('qc.common.selectPlaceholder')"
  2050. style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)">
  2051. <el-option v-for="item in qcSpecWarningDictOptions.triggerMode" :key="item.dictValue"
  2052. :label="item.dictLabel" :value="item.dictValue">
  2053. </el-option>
  2054. </el-select>
  2055. </template>
  2056. </el-table-column>
  2057. <el-table-column :label="$t('qc.partAttributePage.compareLogic')" header-align="center" align="center"
  2058. min-width="130">
  2059. <template slot-scope="scope">
  2060. <el-select v-model="scope.row.compareLogic" size="small" :placeholder="$t('qc.common.selectPlaceholder')"
  2061. style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)">
  2062. <el-option v-for="item in qcSpecWarningDictOptions.compareLogic" :key="item.dictValue"
  2063. :label="item.dictLabel" :value="item.dictValue">
  2064. </el-option>
  2065. </el-select>
  2066. </template>
  2067. </el-table-column>
  2068. <el-table-column :label="$t('qc.partAttributePage.threshold')" header-align="center" align="center"
  2069. width="100">
  2070. <template slot-scope="scope">
  2071. <el-input-number :controls="false" :step="0" v-model="scope.row.thresholdValue" size="small"
  2072. style="width: 100%" @change="updateQcSpecWarningDesc(scope.row)">
  2073. </el-input-number>
  2074. </template>
  2075. </el-table-column>
  2076. <el-table-column :label="$t('qc.partAttributePage.warningDesc')" header-align="center" align="left"
  2077. min-width="220">
  2078. <template slot-scope="scope">
  2079. <span>{{ scope.row.warningDesc }}</span>
  2080. </template>
  2081. </el-table-column>
  2082. <el-table-column :label="$t('qc.common.operation')" header-align="center" align="center" width="70">
  2083. <template slot-scope="scope">
  2084. <el-button type="text" size="small" @click="removeQcSpecWarningRow(scope.$index)"
  2085. style="color: #f56c6c;">{{ $t('qc.common.delete') }}</el-button>
  2086. </template>
  2087. </el-table-column>
  2088. </el-table>
  2089. <div class="qc-spec-warning-footer">
  2090. <el-button type="primary" @click="saveQcSpecWarningList"
  2091. :loading="qcSpecWarningSaveLoading">{{ $t('qc.common.save') }}</el-button>
  2092. <el-button @click="qcSpecWarningDialogFlag = false">{{ $t('qc.common.close') }}</el-button>
  2093. </div>
  2094. </div>
  2095. </el-dialog>
  2096. <!-- 文件采集配置-批量新增 -->
  2097. <el-dialog :title="$t('qc.common.add')" :close-on-click-modal="false" v-drag :visible.sync="fileCollectBatchAddFlag"
  2098. width="520px" class="file-collect-add-dialog">
  2099. <div class="file-collect-add-content">
  2100. <el-form :model="fileCollectBatchAddData" label-position="top">
  2101. <div class="roll-info-card">
  2102. <div class="info-header">
  2103. <i class="el-icon-s-operation"></i>
  2104. <span>{{ $t('qc.partAttributePage.fileCollectAddSectionColumn') }}</span>
  2105. </div>
  2106. <div class="info-content">
  2107. <el-row :gutter="15">
  2108. <el-col :span="8">
  2109. <el-form-item :label="$t('qc.partAttributePage.addColumnCount')" required class="form-item-enhanced">
  2110. <el-input-number v-model="fileCollectBatchAddData.addColumnCount" :min="1" :max="500"
  2111. :controls="false" style="width: 100%"></el-input-number>
  2112. </el-form-item>
  2113. </el-col>
  2114. <el-col :span="8">
  2115. <el-form-item :label="$t('qc.partAttributePage.startValue')" required class="form-item-enhanced">
  2116. <el-input-number v-model="fileCollectBatchAddData.startValue" :min="1" :controls="false"
  2117. style="width: 100%"></el-input-number>
  2118. </el-form-item>
  2119. </el-col>
  2120. <el-col :span="8">
  2121. <el-form-item :label="' '" class="form-item-enhanced form-item-checkbox">
  2122. <el-checkbox v-model="fileCollectBatchAddData.autoIncrementColumn">
  2123. {{ $t('qc.partAttributePage.autoIncrementColumn') }}
  2124. </el-checkbox>
  2125. </el-form-item>
  2126. </el-col>
  2127. </el-row>
  2128. </div>
  2129. </div>
  2130. <div class="roll-info-card">
  2131. <div class="info-header">
  2132. <i class="el-icon-connection"></i>
  2133. <span>{{ $t('qc.partAttributePage.fileCollectAddSectionBind') }}</span>
  2134. </div>
  2135. <div class="info-content">
  2136. <el-form-item required class="form-item-enhanced">
  2137. <span slot="label" class="field-link-label" @click="openFileCollectEquipmentPicker">
  2138. {{ $t('qc.itemPage.deviceCode') }}
  2139. </span>
  2140. <el-row :gutter="12">
  2141. <el-col :span="10">
  2142. <el-input v-model="fileCollectBatchAddData.equipmentNo" readonly></el-input>
  2143. </el-col>
  2144. <el-col :span="14">
  2145. <el-input v-model="fileCollectBatchAddData.equipmentDesc" readonly></el-input>
  2146. </el-col>
  2147. </el-row>
  2148. </el-form-item>
  2149. <el-form-item class="form-item-enhanced">
  2150. <span slot="label" class="field-link-label" @click="openFileCollectStaffPicker">
  2151. {{ $t('qc.partAttributePage.staffAccount') }}
  2152. </span>
  2153. <el-row :gutter="12">
  2154. <el-col :span="10">
  2155. <el-input v-model="fileCollectBatchAddData.staffAccount" readonly></el-input>
  2156. </el-col>
  2157. <el-col :span="14">
  2158. <el-input v-model="fileCollectBatchAddData.staffName" readonly></el-input>
  2159. </el-col>
  2160. </el-row>
  2161. </el-form-item>
  2162. <el-form-item class="form-item-enhanced">
  2163. <span slot="label" class="field-link-label" @click="openFileCollectBatchAddOperationPicker">
  2164. {{ $t('qc.table.process') }}
  2165. </span>
  2166. <el-row :gutter="12">
  2167. <el-col :span="10">
  2168. <el-input v-model="fileCollectBatchAddData.operation" readonly>
  2169. <el-button v-if="qcSpecHasValue(fileCollectBatchAddData.operation)" slot="suffix"
  2170. type="text" icon="el-icon-close" class="qc-spec-pending-clear-btn"
  2171. @click.stop="fileCollectBatchAddData.operation = ''"></el-button>
  2172. </el-input>
  2173. </el-col>
  2174. </el-row>
  2175. </el-form-item>
  2176. </div>
  2177. </div>
  2178. <div class="total-info-card">
  2179. <div class="total-row">
  2180. <span class="total-label">{{ $t('qc.partAttributePage.fileCollectAddPreview') }}</span>
  2181. <span class="total-value">{{ fileCollectBatchAddData.addColumnCount || 0 }}</span>
  2182. </div>
  2183. </div>
  2184. </el-form>
  2185. </div>
  2186. <span slot="footer" class="file-collect-add-footer">
  2187. <button type="button" class="action-btn secondary" :disabled="fileCollectBatchAddLoading"
  2188. @click="confirmFileCollectBatchAdd">
  2189. <i v-if="fileCollectBatchAddLoading" class="el-icon-loading"></i>
  2190. {{ $t('qc.partAttributePage.addBtn') }}
  2191. </button>
  2192. <button type="button" class="action-btn secondary" @click="fileCollectBatchAddFlag = false">
  2193. {{ $t('qc.common.close') }}
  2194. </button>
  2195. </span>
  2196. </el-dialog>
  2197. <!-- 文件采集配置-替换列名 -->
  2198. <el-dialog :title="$t('qc.partAttributePage.fileCollectReplace')" :close-on-click-modal="false" v-drag
  2199. :visible.sync="fileCollectReplaceFlag" width="420px">
  2200. <el-form :model="fileCollectReplaceData" label-position="top">
  2201. <el-form-item :label="$t('qc.partAttributePage.replaceFrom')">
  2202. <el-input v-model="fileCollectReplaceData.replaceFrom"
  2203. :placeholder="$t('qc.partAttributePage.replaceFromPlaceholder')"></el-input>
  2204. </el-form-item>
  2205. <el-form-item :label="$t('qc.partAttributePage.replaceTo')">
  2206. <el-input v-model="fileCollectReplaceData.replaceTo"></el-input>
  2207. </el-form-item>
  2208. <el-form-item>
  2209. <span style="font-size: 12px; color: #909399;">{{ $t('qc.partAttributePage.replaceScopeHint') }}</span>
  2210. </el-form-item>
  2211. </el-form>
  2212. <div style="text-align: center; margin-top: 10px;">
  2213. <el-button type="primary" @click="confirmFileCollectReplace"
  2214. :loading="fileCollectReplaceLoading">{{ $t('qc.common.confirm') }}</el-button>
  2215. <el-button @click="fileCollectReplaceFlag = false">{{ $t('qc.common.cancel') }}</el-button>
  2216. </div>
  2217. </el-dialog>
  2218. <!-- 文件采集配置-选择设备 -->
  2219. <el-dialog :title="$t('qc.partAttributePage.selectEquipmentDialog')" :close-on-click-modal="false" v-drag
  2220. :visible.sync="fileCollectEquipmentFlag" width="900px" append-to-body>
  2221. <el-form :inline="true" label-position="top" :model="fileCollectEquipmentQuery">
  2222. <el-form-item :label="$t('qc.itemPage.deviceCode')">
  2223. <el-input v-model="fileCollectEquipmentQuery.equipmentNo" clearable style="width: 120px"></el-input>
  2224. </el-form-item>
  2225. <el-form-item :label="$t('qc.itemPage.deviceName')">
  2226. <el-input v-model="fileCollectEquipmentQuery.equipmentDesc" clearable style="width: 120px"></el-input>
  2227. </el-form-item>
  2228. <el-form-item :label="'IP'">
  2229. <el-input v-model="fileCollectEquipmentQuery.IP" clearable style="width: 120px"></el-input>
  2230. </el-form-item>
  2231. <el-form-item :label="$t('qc.deviceMaintenancePage.collectMethod')">
  2232. <el-input v-model="fileCollectEquipmentQuery.suffix" clearable style="width: 100px"></el-input>
  2233. </el-form-item>
  2234. <el-form-item :label="' '">
  2235. <el-button type="primary" @click="searchFileCollectEquipment">{{ $t('qc.common.search') }}</el-button>
  2236. </el-form-item>
  2237. </el-form>
  2238. <el-table
  2239. :height="320"
  2240. :data="fileCollectEquipmentList"
  2241. ref="fileCollectEquipmentTable"
  2242. v-loading="fileCollectEquipmentLoading"
  2243. @row-click="fileCollectEquipmentClickRow"
  2244. @row-dblclick="fileCollectEquipmentDblClickRow"
  2245. @selection-change="fileCollectEquipmentSelectionChange"
  2246. border
  2247. style="width: 100%;">
  2248. <el-table-column type="selection" width="50" align="center"></el-table-column>
  2249. <el-table-column prop="equipmentNo" :label="$t('qc.itemPage.deviceCode')" header-align="center" align="center" min-width="100" show-overflow-tooltip></el-table-column>
  2250. <el-table-column prop="equipmentDesc" :label="$t('qc.itemPage.deviceName')" header-align="center" align="left" min-width="140" show-overflow-tooltip></el-table-column>
  2251. <el-table-column prop="fileNo" :label="$t('qc.deviceMaintenancePage.collectId')" header-align="center" align="center" width="90"></el-table-column>
  2252. <el-table-column prop="IP" label="IP" header-align="center" align="center" min-width="110" show-overflow-tooltip></el-table-column>
  2253. <el-table-column prop="suffix" :label="$t('qc.deviceMaintenancePage.collectMethod')" header-align="center" align="center" width="90"></el-table-column>
  2254. </el-table>
  2255. <div style="text-align: center; margin-top: 12px;">
  2256. <el-button type="primary" @click="confirmFileCollectEquipment">{{ $t('qc.common.confirm') }}</el-button>
  2257. <el-button @click="fileCollectEquipmentFlag = false">{{ $t('qc.common.close') }}</el-button>
  2258. </div>
  2259. </el-dialog>
  2260. <!-- 文件采集配置-选择项目 -->
  2261. <el-dialog :title="$t('qc.itemPage.uiDialogItemList')" :close-on-click-modal="false" v-drag
  2262. :visible.sync="fileCollectItemFlag" width="920px" append-to-body @close="fileCollectPickerRow = null">
  2263. <el-form :inline="true" label-position="top" :model="fileCollectItemQuery">
  2264. <el-form-item :label="$t('qc.method.colBu')">
  2265. <el-select v-model="fileCollectItemBuKey" :placeholder="$t('qc.common.selectPlaceholder')" clearable
  2266. style="width: 160px" @change="onFileCollectItemBuChange">
  2267. <el-option v-for="i in buList" :key="i.site + '_' + i.buNo" :label="i.sitename + ' ' + i.buDesc"
  2268. :value="i.buNo">
  2269. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  2270. <span
  2271. style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  2272. {{ i.buDesc }}
  2273. </span>
  2274. </el-option>
  2275. </el-select>
  2276. </el-form-item>
  2277. <el-form-item :label="$t('qc.table.inspectionType')" required>
  2278. <el-select v-model="fileCollectItemQuery.inspectionTypeNo" :placeholder="$t('qc.common.selectPlaceholder')"
  2279. clearable style="width: 120px">
  2280. <el-option v-for="i in options" :key="i.inspectionTypeNo" :label="i.inspectionTypeName"
  2281. :value="i.inspectionTypeNo"></el-option>
  2282. </el-select>
  2283. </el-form-item>
  2284. <el-form-item :label="$t('qc.table.itemCode')">
  2285. <el-input v-model="fileCollectItemQuery.itemNo" clearable style="width: 120px"></el-input>
  2286. </el-form-item>
  2287. <el-form-item :label="$t('qc.table.itemName')">
  2288. <el-input v-model="fileCollectItemQuery.itemDesc" clearable style="width: 120px"></el-input>
  2289. </el-form-item>
  2290. <el-form-item :label="' '">
  2291. <el-button type="primary" @click="searchFileCollectItem">{{ $t('qc.common.search') }}</el-button>
  2292. </el-form-item>
  2293. </el-form>
  2294. <el-table
  2295. :height="300"
  2296. :data="fileCollectItemList"
  2297. ref="fileCollectItemTable"
  2298. v-loading="fileCollectItemLoading"
  2299. @row-click="fileCollectItemClickRow"
  2300. @row-dblclick="fileCollectItemDblClickRow"
  2301. highlight-current-row
  2302. border
  2303. style="width: 100%;">
  2304. <el-table-column prop="buDesc" :label="$t('qc.method.colBu')" header-align="center" align="left"
  2305. min-width="90" show-overflow-tooltip></el-table-column>
  2306. <el-table-column prop="itemNo" :label="$t('qc.table.itemCode')" header-align="center" align="center" min-width="100"></el-table-column>
  2307. <el-table-column prop="itemDesc" :label="$t('qc.table.itemName')" header-align="center" align="left" min-width="160" show-overflow-tooltip></el-table-column>
  2308. <el-table-column prop="methodName" :label="$t('qc.table.inspectionMethod')" header-align="center" align="left" min-width="100" show-overflow-tooltip></el-table-column>
  2309. </el-table>
  2310. <div style="text-align: center; margin-top: 12px;">
  2311. <el-button type="primary" @click="confirmFileCollectItem">{{ $t('qc.common.confirm') }}</el-button>
  2312. <el-button @click="fileCollectItemFlag = false">{{ $t('qc.common.close') }}</el-button>
  2313. </div>
  2314. </el-dialog>
  2315. <!-- 文件采集配置-选择责任人 -->
  2316. <el-dialog :title="$t('qc.iqcPage.personList')" :close-on-click-modal="false" v-drag
  2317. :visible.sync="fileCollectStaffFlag" width="820px" append-to-body @close="fileCollectPickerRow = null">
  2318. <el-form :inline="true" label-position="top" :model="fileCollectStaffQuery">
  2319. <el-form-item :label="$t('qc.iqcPage.userCode')">
  2320. <el-input v-model="fileCollectStaffQuery.adminID" clearable style="width: 120px"></el-input>
  2321. </el-form-item>
  2322. <el-form-item :label="$t('qc.iqcPage.userName')">
  2323. <el-input v-model="fileCollectStaffQuery.adminName" clearable style="width: 120px"></el-input>
  2324. </el-form-item>
  2325. <el-form-item :label="' '">
  2326. <el-button type="primary" @click="searchFileCollectStaff">{{ $t('qc.common.search') }}</el-button>
  2327. </el-form-item>
  2328. </el-form>
  2329. <el-table
  2330. :height="300"
  2331. :data="fileCollectStaffList"
  2332. ref="fileCollectStaffTable"
  2333. v-loading="fileCollectStaffLoading"
  2334. @row-click="fileCollectStaffClickRow"
  2335. @row-dblclick="fileCollectStaffDblClickRow"
  2336. highlight-current-row
  2337. border
  2338. style="width: 100%;">
  2339. <el-table-column prop="adminID" :label="$t('qc.iqcPage.userCode')" header-align="center" align="center" min-width="100"></el-table-column>
  2340. <el-table-column prop="adminName" :label="$t('qc.iqcPage.userName')" header-align="center" align="center" min-width="120"></el-table-column>
  2341. <el-table-column prop="email" :label="$t('qc.method.email')" header-align="center" align="center" min-width="140" show-overflow-tooltip></el-table-column>
  2342. </el-table>
  2343. <div style="text-align: center; margin-top: 12px;">
  2344. <el-button type="primary" @click="confirmFileCollectStaff">{{ $t('qc.common.confirm') }}</el-button>
  2345. <el-button @click="fileCollectStaffFlag = false">{{ $t('qc.common.close') }}</el-button>
  2346. </div>
  2347. </el-dialog>
  2348. <QcSamplingPickerDialog
  2349. ref="samplingProgrammePicker"
  2350. picker-type="programme"
  2351. :bu-list="buList"
  2352. @select="onSamplingProgrammeSelect" />
  2353. <QcSamplingPickerDialog
  2354. ref="samplingLevelPicker"
  2355. picker-type="level"
  2356. :bu-list="buList"
  2357. @select="onSamplingLevelSelect" />
  2358. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  2359. <!-- 上传sop文件的modal -->
  2360. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
  2361. <!-- 导入 -->
  2362. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  2363. <!-- 文件采集配置导入 -->
  2364. <FileCollectUpload ref="fileCollectUpload" @refreshFileCollectList="refreshFileCollectList()" v-drag></FileCollectUpload>
  2365. <!-- 主表多物料质检项目导入 -->
  2366. <QcPartSpecBatchUpload ref="qcPartSpecBatchUpload" @refreshQcSpecList="onPartSpecBatchImported" v-drag></QcPartSpecBatchUpload>
  2367. <!-- 主表多物料文件采集配置导入 -->
  2368. <QcPartFileCollectBatchUpload ref="qcPartFileCollectBatchUpload" @refreshFileCollectList="onPartFileCollectBatchImported" v-drag></QcPartFileCollectBatchUpload>
  2369. </div>
  2370. </template>
  2371. <script>
  2372. import {
  2373. qcPartAttributeSearch, // 查询物料属性
  2374. qcPartAttributeEdit, // 修改物料属性
  2375. qcPartDieMoldAdd, // 新增刀模
  2376. qcPartCatalogSync, // 物料目录数据同步
  2377. searchPartAttributeDetails, // 查询物料属性模板
  2378. savePartAttributeDetails, // 新增物料属性模板
  2379. deletePartAttributeDetails, // 删除物料属性模板
  2380. saveAttributeDetailed, // 新增物料属性模板详情
  2381. getPartTemplateLists, // 获取模板列表
  2382. inspectionTypeSearch, // 搜索所有检验类型
  2383. getOperationDescList, // 查询工序列表
  2384. getManufacturerList, // 查询供应商列表
  2385. getAllResourceList, // 查询机台列表
  2386. getSiteAndBuByUserName,
  2387. getSiteAndBuByUserName2,
  2388. umSearch, // 查询单位列表
  2389. searchPartInfo, // 查询物料信息
  2390. getPartDefectTracking, // 查询跟踪缺陷
  2391. saveDefectTracking, // 新增跟踪缺陷
  2392. deleteDefectTracking, // 删除跟踪缺陷
  2393. updateDefectTracking, // 编辑跟踪缺陷
  2394. getPartLabelTemplate, // 查询标签模版设置
  2395. saveLabelTemplate, // 新增标签模版设置
  2396. deleteLabelTemplate, // 删除标签模版设置
  2397. updateLabelTemplate, // 编辑标签模版设置
  2398. getCustomerList, // 查询客户列表
  2399. getPatrolConfigList, // 查询巡检特殊配置列表
  2400. savePatrolConfig, // 新增巡检特殊配置
  2401. updatePatrolConfig, // 更新巡检特殊配置
  2402. deletePatrolConfig, // 删除巡检特殊配置
  2403. getAllOperationDescList, // 查询所有工序列表
  2404. patrolConfigUpload, // 巡检配置批量导入
  2405. qcSpecSearch,
  2406. qcSpecSave,
  2407. qcSpecCheckDuplicate,
  2408. qcSpecUpdate,
  2409. qcSpecBatchFill,
  2410. qcSpecSyncFromItem,
  2411. qcSpecDelete,
  2412. batchUpdateQcSpecRowNo,
  2413. copyQcSpecToParts,
  2414. updateQcSpecToParts,
  2415. getQcSpecItemList,
  2416. getQcSpecWarningList,
  2417. saveQcSpecWarningList,
  2418. qcPartFileCollectSearch,
  2419. qcPartFileCollectBatchAdd,
  2420. qcPartFileCollectBatchSave,
  2421. qcPartFileCollectBatchDelete,
  2422. qcPartFileCollectReplace,
  2423. qcItemSearch,
  2424. getResponsibleOperatorList,
  2425. queryEquipmentFolderLocationList,
  2426. downloadFileCollectorProgram as downloadFileCollectorProgramApi,
  2427. } from '@/api/qc/qc.js'
  2428. import { getDictDataByTypes } from '@/api/sys/dict.js'
  2429. import {
  2430. getTableDefaultListLanguage,
  2431. getTableUserListLanguage,
  2432. } from '@/api/table.js'
  2433. import { formatQcValueType as formatQcValueTypeLabel, normalizeQcValueTypeDb } from '@/utils/qcValueTypeDisplay'
  2434. import Chooselist from '@/views/modules/common/Chooselist_eam'
  2435. import {
  2436. getFileContentList,
  2437. downLoadObjectFile,
  2438. } from '@/api/eam/eam_object_list.js'
  2439. import {
  2440. userFavoriteList,
  2441. saveUserFavorite,
  2442. removeUserFavorite,
  2443. } from '@/api/userFavorite.js'
  2444. import { deleteObjectFile } from '@/api/eam/eam.js'
  2445. import excel from '@/utils/excel-util.js'
  2446. import { saveAs } from 'file-saver'
  2447. import { verifyData } from '@/api/chooselist/chooselist.js'
  2448. import qcUpload from './qc_upload'
  2449. import qcSOPUploadFile from './qc_SOP_upload_file'
  2450. import SopListComponent from './sopListComponent'
  2451. import BomListComponent from './bomListComponent'
  2452. import RoutingListComponent from './routingListComponent'
  2453. import PatrolConfigUpload from './patrol_config_upload'
  2454. import QcSpecUpload from './qc_spec_upload'
  2455. import FileCollectUpload from './file_collect_upload'
  2456. import QcPartSpecBatchUpload from './qc_part_spec_batch_upload'
  2457. import QcPartFileCollectBatchUpload from './qc_part_file_collect_batch_upload'
  2458. import QcSamplingPickerDialog from './components/QcSamplingPickerDialog'
  2459. import Sortable from 'sortablejs'
  2460. export default {
  2461. components: {
  2462. qcSOPUploadFile,
  2463. Chooselist,
  2464. qcUpload,
  2465. SopListComponent,
  2466. BomListComponent,
  2467. RoutingListComponent,
  2468. PatrolConfigUpload,
  2469. QcSpecUpload,
  2470. FileCollectUpload,
  2471. QcPartSpecBatchUpload,
  2472. QcPartFileCollectBatchUpload,
  2473. QcSamplingPickerDialog,
  2474. },
  2475. data() {
  2476. return {
  2477. // 检验标准维护
  2478. qcSpecList: [],
  2479. qcSpecTableList: [],
  2480. qcSpecSortable: null,
  2481. qcSpecSyncTimer: null,
  2482. qcSpecRowKeyMap: null,
  2483. qcSpecSortedCache: null,
  2484. qcSpecSortedCacheSource: null,
  2485. qcSpecListSkipSchedule: false,
  2486. qcSpecDragSaving: false,
  2487. qcSpecFilterType: '105',
  2488. qcSpecFilterIpqcMethod: '',
  2489. qcSpecFilterOperation: '',
  2490. qcSpecFilterResource: '',
  2491. qcSpecFilterManufacturer: '',
  2492. qcSpecFilterCustomer: '',
  2493. qcSpecCurrentRow: null,
  2494. editQcSpecBatchVisible: false,
  2495. batchQcSpecLoading: false,
  2496. qcSpecDeleteLoading: false,
  2497. qcSpecBatchFillDialogFlag: false,
  2498. qcSpecBatchFillLoading: false,
  2499. qcSpecSyncDialogFlag: false,
  2500. qcSpecSyncLoading: false,
  2501. qcSpecSyncData: {
  2502. buNo: '',
  2503. inspectionTypeNo: '',
  2504. ipqcInspectionMethod: '',
  2505. syncValueType: true,
  2506. syncDefaultValue: true,
  2507. syncMaxValue: true,
  2508. syncMinValue: true,
  2509. syncSamplingPlanLevel: true,
  2510. },
  2511. qcSpecBatchFillData: {
  2512. buNo: '',
  2513. inspectionTypeNo: '',
  2514. ipqcInspectionMethod: '',
  2515. samplingProgrammeNo: '',
  2516. samplingProgrammeDesc: '',
  2517. samplingLevelNo: '',
  2518. samplingLevelDesc: '',
  2519. defaultSamplingQuantity: null,
  2520. defaultSamplingProportion: null,
  2521. operation: '',
  2522. resourceID: '',
  2523. resourceDesc: '',
  2524. manufacturerID: '',
  2525. manufacturerName: '',
  2526. customerID: '',
  2527. customerName: '',
  2528. },
  2529. qcSpecAddFlag: false,
  2530. qcSpecSearchData: {
  2531. inspectionTypeNo: '',
  2532. itemNo: '',
  2533. itemDesc: '',
  2534. site: '',
  2535. buNo: '',
  2536. partNo: '',
  2537. },
  2538. qcSpecItemList1: [],
  2539. qcSpecItemList2: [],
  2540. qcSpecItemSelections1: [],
  2541. qcSpecItemSelections2: [],
  2542. qcSpecPendingList: [],
  2543. qcSpecAddSaveLoading: false,
  2544. qcSpecAddFillDialogFlag: false,
  2545. qcSpecAddSelecting: false,
  2546. qcSpecAddApplyData: {
  2547. inspectionTypeNo: '',
  2548. ipqcInspectionMethod: '',
  2549. operation: '',
  2550. resourceID: '',
  2551. resourceDesc: '',
  2552. manufacturerID: '',
  2553. manufacturerName: '',
  2554. customerID: '',
  2555. customerName: '',
  2556. },
  2557. qcSpecWarningDialogFlag: false,
  2558. qcSpecWarningLoading: false,
  2559. qcSpecWarningSaveLoading: false,
  2560. qcSpecWarningList: [],
  2561. qcSpecWarningCurrentRow: null,
  2562. qcSpecWarningDictOptions: {
  2563. warningLevel: [],
  2564. triggerMode: [],
  2565. compareLogic: [],
  2566. },
  2567. qcSpecPickerRow: null,
  2568. qcSpecSelections: [],
  2569. qcSpecPartTransferMode: 'copy',
  2570. qcSpecCopyDialogFlag: false,
  2571. qcSpecCopyLoading: false,
  2572. qcSpecCopyConfirmLoading: false,
  2573. qcSpecCopySearchData: {
  2574. site: '',
  2575. buNo: '',
  2576. userName: '',
  2577. partNo: '',
  2578. partDesc: '',
  2579. page: 1,
  2580. limit: 20,
  2581. },
  2582. qcSpecCopyPartList: [],
  2583. qcSpecCopyPartSelections: [],
  2584. qcSpecCopyAddedParts: [],
  2585. qcSpecCopyPageIndex: 1,
  2586. qcSpecCopyPageSize: 20,
  2587. qcSpecCopyTotalPage: 0,
  2588. // 文件采集配置
  2589. fileCollectList: [],
  2590. editFileCollectBatchVisible: false,
  2591. fileCollectLoading: false,
  2592. fileCollectSaveLoading: false,
  2593. fileCollectDeleteLoading: false,
  2594. fileCollectorDownloadLoading: false,
  2595. fileCollectBatchAddLoading: false,
  2596. fileCollectReplaceLoading: false,
  2597. fileCollectSelections: [],
  2598. fileCollectPageIndex: 1,
  2599. fileCollectPageSize: 20,
  2600. fileCollectTotal: 0,
  2601. fileCollectQuery: {
  2602. equipmentNo: '',
  2603. equipmentDesc: '',
  2604. itemNo: '',
  2605. },
  2606. fileCollectBatchAddFlag: false,
  2607. fileCollectReplaceFlag: false,
  2608. fileCollectBatchAddData: {
  2609. addColumnCount: 1,
  2610. autoIncrementColumn: true,
  2611. startValue: 1,
  2612. equipmentFolderId: null,
  2613. equipmentNo: '',
  2614. equipmentDesc: '',
  2615. staffAccount: '',
  2616. staffName: '',
  2617. operation: '',
  2618. },
  2619. fileCollectReplaceData: {
  2620. replaceFrom: '',
  2621. replaceTo: '',
  2622. },
  2623. fileCollectEquipmentFlag: false,
  2624. fileCollectEquipmentLoading: false,
  2625. fileCollectEquipmentList: [],
  2626. fileCollectEquipmentSelections: [],
  2627. fileCollectEquipmentQuery: {
  2628. page: 1,
  2629. pageCount: 500,
  2630. site: '',
  2631. buNo: '',
  2632. equipmentNo: '',
  2633. equipmentDesc: '',
  2634. IP: '',
  2635. suffix: '',
  2636. },
  2637. fileCollectStaffFlag: false,
  2638. fileCollectStaffLoading: false,
  2639. fileCollectStaffList: [],
  2640. fileCollectStaffSelections: [],
  2641. fileCollectStaffQuery: {
  2642. flag: '2',
  2643. bu: '',
  2644. adminID: '',
  2645. adminName: '',
  2646. userName: '',
  2647. },
  2648. fileCollectPickerRow: null,
  2649. fileCollectItemFlag: false,
  2650. fileCollectItemLoading: false,
  2651. fileCollectItemList: [],
  2652. fileCollectItemSelections: [],
  2653. fileCollectExcludeItemNos: [],
  2654. fileCollectItemBuKey: '',
  2655. fileCollectItemQuery: {
  2656. site: '',
  2657. buNo: '',
  2658. inspectionTypeNo: '',
  2659. itemNo: '',
  2660. itemDesc: '',
  2661. itemType: 'D',
  2662. userName: '',
  2663. page: 1,
  2664. limit: 500,
  2665. },
  2666. columnsProp: ['createBy', 'updateBy'],
  2667. // 是否收藏
  2668. favorite: false,
  2669. // 导出 start
  2670. exportData: [],
  2671. exportName: '',
  2672. exportHeader: [],
  2673. exportFooter: [],
  2674. exportList: [],
  2675. // 导出 end
  2676. tagNo: '',
  2677. tagType: '',
  2678. searchData: {
  2679. site: '',
  2680. userName: this.$store.state.user.name,
  2681. partNo: '',
  2682. partDesc: '',
  2683. cinvSourceCode: '',
  2684. sku: '',
  2685. familyID: '',
  2686. partType: '',
  2687. buDesc: '',
  2688. buNo: '',
  2689. bu: '',
  2690. attributeType: 'A',
  2691. page: 1,
  2692. limit: 10,
  2693. },
  2694. height: 200,
  2695. pageIndex: 1,
  2696. pageSize: 20,
  2697. totalPage: 0,
  2698. modalFlag: false,
  2699. modalDisableFlag: false,
  2700. dieMoldAddModalFlag: false,
  2701. dieMoldAddSaveLoading: false,
  2702. dieMoldAddData: {
  2703. bu: '',
  2704. site: '',
  2705. buNo: '',
  2706. partNo: '',
  2707. partDesc: '',
  2708. partType: '刀模',
  2709. spec: '',
  2710. umId: '',
  2711. remark: '',
  2712. handle: 'Y',
  2713. active: 'Y',
  2714. createBy: this.$store.state.user.name,
  2715. },
  2716. dieMoldAddRules: {
  2717. bu: [{ required: true, message: ' ', trigger: ['blur', 'change'] }],
  2718. partNo: [{ required: true, message: ' ', trigger: ['blur', 'change'] }],
  2719. partDesc: [{ required: true, message: ' ', trigger: ['blur', 'change'] }],
  2720. },
  2721. // 巡检特殊配置相关
  2722. patrolConfigDialogFlag: false,
  2723. patrolConfigLoading: false,
  2724. patrolConfigList: [],
  2725. patrolConfigSelections: [],
  2726. operationDescList: [], // 工序列表
  2727. patrolConfigSaveLoading: false, // 批量保存loading
  2728. modalData: {
  2729. site: '',
  2730. bu: '',
  2731. buNo: '',
  2732. flag: '',
  2733. partNo: '',
  2734. partDesc: '',
  2735. partTypeDB: '',
  2736. partType: '',
  2737. umId: '',
  2738. spec: '',
  2739. expirationFlag: '',
  2740. expirationDay: '',
  2741. expirationWarningDay: '',
  2742. exceedInRatio: '',
  2743. exceedOutRatio: '',
  2744. inboundWarehouseId: '',
  2745. inboundWarehouseName: '',
  2746. outboundWarehouseId: '',
  2747. outboundWarehouseName: '',
  2748. issueMethod: '',
  2749. inboundLocationId: '',
  2750. inboundLocationName: '',
  2751. active: '',
  2752. iqcExempt: '',
  2753. faiExempt: '',
  2754. ipqcExempt: '',
  2755. pqcExempt: '',
  2756. fqcExempt: '',
  2757. oqcExempt: '',
  2758. firstInspectionDuration: '',
  2759. nextInspectionDuration: '',
  2760. totalInspectionDuration: '',
  2761. lastUpdateBy: this.$store.state.user.name,
  2762. partDescEn: '',
  2763. standardValue: '',
  2764. defaultValue: '',
  2765. maxValue: '',
  2766. minValue: '',
  2767. adhesiveActivePeriodFlag: '',
  2768. thawingDuration: '',
  2769. accumulatedExposureDuration: '',
  2770. defectThreshold: 0,
  2771. recoveryBatchCount: 0,
  2772. currentDefectCount: 0,
  2773. remainingTrackingBatches: 0,
  2774. trackingFlag: 'N',
  2775. lastDefectCount: 0,
  2776. lastTriggerTime: null,
  2777. },
  2778. detailData: {
  2779. site: '',
  2780. buNo: '',
  2781. partNo: '',
  2782. attributeNo: '',
  2783. partDesc: '',
  2784. cinvSourceCode: '',
  2785. sku: '',
  2786. attributeType: 'A',
  2787. inspectionTypeNo: '',
  2788. templateId: '',
  2789. templateName: '',
  2790. userName: this.$store.state.user.name,
  2791. createBy: this.$store.state.user.name,
  2792. },
  2793. defectTrackingData: {
  2794. site: '',
  2795. buNo: '',
  2796. partNo: '',
  2797. supplierId: '',
  2798. supplierName: '',
  2799. defectThreshold: '',
  2800. recoveryBatchCount: '',
  2801. currentDefectCount: '',
  2802. lastDefectCount: '',
  2803. },
  2804. labelTemplateData: {
  2805. flag: '',
  2806. site: '',
  2807. buNo: '',
  2808. partNo: '',
  2809. labelTypeTb: '',
  2810. labelType: '',
  2811. operationDesc: '',
  2812. defaultFlag: '',
  2813. createBy: '',
  2814. },
  2815. dataList: [],
  2816. detailList: [],
  2817. defectTrackingList: [],
  2818. labelTemplateList: [],
  2819. selectedTemplates: [], // 选中的质量检验模板
  2820. dataListLoading: false,
  2821. templateDeleteLoading: false, // 批量删除loading
  2822. templatePageIndex: 1, // 质量检验模板当前页
  2823. templatePageSize: 20, // 质量检验模板每页条数
  2824. // 展示列集
  2825. columnList: [
  2826. {
  2827. userId: this.$store.state.user.name,
  2828. functionId: 301003,
  2829. serialNumber: '301003Table1Site',
  2830. tableId: '301003Table1',
  2831. tableName: '物料属性设置表',
  2832. columnProp: 'site',
  2833. headerAlign: 'center',
  2834. align: 'center',
  2835. columnLabel: '工厂编号',
  2836. columnHidden: false,
  2837. columnImage: false,
  2838. columnSortable: false,
  2839. sortLv: 0,
  2840. status: true,
  2841. fixed: '',
  2842. columnWidth: 100,
  2843. },
  2844. /* {
  2845. userId: this.$store.state.user.name,
  2846. functionId: 301003,
  2847. serialNumber: '301003Table1BuDesc',
  2848. tableId: '301003Table1',
  2849. tableName: '物料属性设置表',
  2850. columnProp: 'buDesc',
  2851. headerAlign: 'center',
  2852. align: 'center',
  2853. columnLabel: 'BU',
  2854. columnHidden: false,
  2855. columnImage: false,
  2856. columnSortable: false,
  2857. sortLv: 0,
  2858. status: true,
  2859. fixed: '',
  2860. columnWidth: 100,
  2861. }, */
  2862. {
  2863. userId: this.$store.state.user.name,
  2864. functionId: 301003,
  2865. serialNumber: '301003Table1PartNo',
  2866. tableId: '301003Table1',
  2867. tableName: '物料属性设置表',
  2868. columnProp: 'partNo',
  2869. headerAlign: 'center',
  2870. align: 'center',
  2871. columnLabel: '物料编码',
  2872. columnHidden: false,
  2873. columnImage: false,
  2874. columnSortable: false,
  2875. sortLv: 0,
  2876. status: true,
  2877. fixed: '',
  2878. columnWidth: 120,
  2879. },
  2880. /* {
  2881. userId: this.$store.state.user.name,
  2882. functionId: 301003,
  2883. serialNumber: '301003Table1SKU',
  2884. tableId: '301003Table1',
  2885. tableName: '物料属性设置表',
  2886. columnProp: 'sku',
  2887. headerAlign: 'center',
  2888. align: 'center',
  2889. columnLabel: 'SKU',
  2890. columnHidden: false,
  2891. columnImage: false,
  2892. columnSortable: false,
  2893. sortLv: 0,
  2894. status: true,
  2895. fixed: '',
  2896. columnWidth: 120,
  2897. }, */
  2898. {
  2899. userId: this.$store.state.user.name,
  2900. functionId: 301003,
  2901. serialNumber: '301003Table1PartDesc',
  2902. tableId: '301003Table1',
  2903. tableName: '物料属性设置表',
  2904. columnProp: 'partDesc',
  2905. headerAlign: 'center',
  2906. align: 'left',
  2907. columnLabel: '物料名称',
  2908. columnHidden: false,
  2909. columnImage: false,
  2910. columnSortable: false,
  2911. sortLv: 0,
  2912. status: true,
  2913. fixed: '',
  2914. columnWidth: 300,
  2915. },
  2916. {
  2917. userId: this.$store.state.user.name,
  2918. functionId: 301003,
  2919. serialNumber: '301003Table1FamilyName',
  2920. tableId: '301003Table1',
  2921. tableName: '物料属性设置表',
  2922. columnProp: 'partType',
  2923. headerAlign: 'center',
  2924. align: 'left',
  2925. columnLabel: '物料类别',
  2926. columnHidden: false,
  2927. columnImage: false,
  2928. columnSortable: false,
  2929. sortLv: 0,
  2930. status: true,
  2931. fixed: '',
  2932. columnWidth: 150,
  2933. },
  2934. {
  2935. userId: this.$store.state.user.name,
  2936. functionId: 301003,
  2937. serialNumber: '301003Table1Spec',
  2938. tableId: '301003Table1',
  2939. tableName: '物料属性设置表',
  2940. columnProp: 'spec',
  2941. headerAlign: 'center',
  2942. align: 'left',
  2943. columnLabel: '规格型号',
  2944. columnHidden: false,
  2945. columnImage: false,
  2946. columnSortable: false,
  2947. sortLv: 0,
  2948. status: true,
  2949. fixed: '',
  2950. columnWidth: 300,
  2951. },
  2952. {
  2953. userId: this.$store.state.user.name,
  2954. functionId: 301003,
  2955. serialNumber: '301003Table1UmName',
  2956. tableId: '301003Table1',
  2957. tableName: '物料属性设置表',
  2958. columnProp: 'umName',
  2959. headerAlign: 'center',
  2960. align: 'left',
  2961. columnLabel: '单位',
  2962. columnHidden: false,
  2963. columnImage: false,
  2964. columnSortable: false,
  2965. sortLv: 0,
  2966. status: true,
  2967. fixed: '',
  2968. columnWidth: 100,
  2969. },
  2970. {
  2971. userId: this.$store.state.user.name,
  2972. functionId: 301003,
  2973. serialNumber: '301003Table1AttributeRemark',
  2974. tableId: '301003Table1',
  2975. tableName: '物料属性设置表',
  2976. columnProp: 'attributeRemark',
  2977. headerAlign: 'center',
  2978. align: 'left',
  2979. columnLabel: '备注',
  2980. columnHidden: false,
  2981. columnImage: false,
  2982. columnSortable: false,
  2983. sortLv: 0,
  2984. status: true,
  2985. fixed: '',
  2986. columnWidth: 200,
  2987. },
  2988. {
  2989. userId: this.$store.state.user.name,
  2990. functionId: 301003,
  2991. serialNumber: '301003Table1CreateTime',
  2992. tableId: '301003Table1',
  2993. tableName: '物料属性设置表',
  2994. columnProp: 'createTime',
  2995. headerAlign: 'center',
  2996. align: 'center',
  2997. columnLabel: '创建时间',
  2998. columnHidden: false,
  2999. columnImage: false,
  3000. columnSortable: false,
  3001. sortLv: 0,
  3002. status: true,
  3003. fixed: '',
  3004. columnWidth: 170,
  3005. },
  3006. {
  3007. userId: this.$store.state.user.name,
  3008. functionId: 301003,
  3009. serialNumber: '301003Table1CreateBy',
  3010. tableId: '301003Table1',
  3011. tableName: '物料属性设置表',
  3012. columnProp: 'createBy',
  3013. headerAlign: 'center',
  3014. align: 'center',
  3015. columnLabel: '创建人',
  3016. columnHidden: false,
  3017. columnImage: false,
  3018. columnSortable: false,
  3019. sortLv: 0,
  3020. status: true,
  3021. fixed: '',
  3022. columnWidth: 100,
  3023. },
  3024. {
  3025. userId: this.$store.state.user.name,
  3026. functionId: 301003,
  3027. serialNumber: '301003Table1UpdateDate',
  3028. tableId: '301003Table1',
  3029. tableName: '物料属性设置表',
  3030. columnProp: 'updateDate',
  3031. headerAlign: 'center',
  3032. align: 'center',
  3033. columnLabel: '更新时间',
  3034. columnHidden: false,
  3035. columnImage: false,
  3036. columnSortable: false,
  3037. sortLv: 0,
  3038. status: true,
  3039. fixed: '',
  3040. columnWidth: 170,
  3041. },
  3042. {
  3043. userId: this.$store.state.user.name,
  3044. functionId: 301003,
  3045. serialNumber: '301003Table1UpdateBy',
  3046. tableId: '301003Table1',
  3047. tableName: '物料属性设置表',
  3048. columnProp: 'updateBy',
  3049. headerAlign: 'center',
  3050. align: 'center',
  3051. columnLabel: '更新人',
  3052. columnHidden: false,
  3053. columnImage: false,
  3054. columnSortable: false,
  3055. sortLv: 0,
  3056. status: true,
  3057. fixed: '',
  3058. columnWidth: 100,
  3059. },
  3060. ],
  3061. columnDetailList: [
  3062. {
  3063. userId: this.$store.state.user.name,
  3064. functionId: 301003,
  3065. serialNumber: '301003Table2TemplateId',
  3066. tableId: '301003Table2',
  3067. tableName: '检验模板清单表',
  3068. columnProp: 'templateId',
  3069. headerAlign: 'center',
  3070. align: 'left',
  3071. columnLabel: '模板编码',
  3072. columnHidden: false,
  3073. columnImage: false,
  3074. columnSortable: false,
  3075. sortLv: 0,
  3076. status: true,
  3077. fixed: '',
  3078. columnWidth: 120,
  3079. },
  3080. {
  3081. userId: this.$store.state.user.name,
  3082. functionId: 301003,
  3083. serialNumber: '301003Table2TemplateName',
  3084. tableId: '301003Table2',
  3085. tableName: '检验模板清单表',
  3086. columnProp: 'templateName',
  3087. headerAlign: 'center',
  3088. align: 'left',
  3089. columnLabel: '模板名称',
  3090. columnHidden: false,
  3091. columnImage: false,
  3092. columnSortable: false,
  3093. sortLv: 0,
  3094. status: true,
  3095. fixed: '',
  3096. columnWidth: 200,
  3097. },
  3098. {
  3099. userId: this.$store.state.user.name,
  3100. functionId: 301003,
  3101. serialNumber: '301003Table2InspectionTypeName',
  3102. tableId: '301003Table2',
  3103. tableName: '检验模板清单表',
  3104. columnProp: 'inspectionTypeName',
  3105. headerAlign: 'center',
  3106. align: 'center',
  3107. columnLabel: '检验类型',
  3108. columnHidden: false,
  3109. columnImage: false,
  3110. columnSortable: false,
  3111. sortLv: 0,
  3112. status: true,
  3113. fixed: '',
  3114. columnWidth: 100,
  3115. },
  3116. {
  3117. userId: this.$store.state.user.name,
  3118. functionId: 301003,
  3119. serialNumber: '301003Table2IpqcInspectionMethod',
  3120. tableId: '301003Table2',
  3121. tableName: '检验模板清单表',
  3122. columnProp: 'ipqcInspectionMethod',
  3123. headerAlign: 'center',
  3124. align: 'center',
  3125. columnLabel: 'IPQC检验方式',
  3126. columnHidden: false,
  3127. columnImage: false,
  3128. columnSortable: false,
  3129. sortLv: 0,
  3130. status: true,
  3131. fixed: '',
  3132. columnWidth: 120,
  3133. },
  3134. {
  3135. userId: this.$store.state.user.name,
  3136. functionId: 301003,
  3137. serialNumber: '301003Table2TemplateVersion',
  3138. tableId: '301003Table2',
  3139. tableName: '检验模板清单表',
  3140. columnProp: 'templateVersion',
  3141. headerAlign: 'center',
  3142. align: 'right',
  3143. columnLabel: '版本号',
  3144. columnHidden: false,
  3145. columnImage: false,
  3146. columnSortable: false,
  3147. sortLv: 0,
  3148. status: true,
  3149. fixed: '',
  3150. columnWidth: 100,
  3151. },
  3152. {
  3153. userId: this.$store.state.user.name,
  3154. functionId: 301003,
  3155. serialNumber: '301003Table2DefaultSamplingQuantity',
  3156. tableId: '301003Table2',
  3157. tableName: '检验模板清单表',
  3158. columnProp: 'defaultSamplingQuantity',
  3159. headerAlign: 'center',
  3160. align: 'right',
  3161. columnLabel: '默认抽样数量',
  3162. columnHidden: false,
  3163. columnImage: false,
  3164. columnSortable: false,
  3165. sortLv: 0,
  3166. status: true,
  3167. fixed: '',
  3168. columnWidth: 100,
  3169. },
  3170. {
  3171. userId: this.$store.state.user.name,
  3172. functionId: 301003,
  3173. serialNumber: '301003Table2DefaultSamplingProportion',
  3174. tableId: '301003Table2',
  3175. tableName: '检验模板清单表',
  3176. columnProp: 'defaultSamplingProportion',
  3177. headerAlign: 'center',
  3178. align: 'right',
  3179. columnLabel: '默认抽样比例',
  3180. columnHidden: false,
  3181. columnImage: false,
  3182. columnSortable: false,
  3183. sortLv: 0,
  3184. status: true,
  3185. fixed: '',
  3186. columnWidth: 100,
  3187. },
  3188. {
  3189. userId: this.$store.state.user.name,
  3190. functionId: 301003,
  3191. serialNumber: '301003Table2OperationDesc',
  3192. tableId: '301003Table2',
  3193. tableName: '检验模板清单表',
  3194. columnProp: 'operation',
  3195. headerAlign: 'center',
  3196. align: 'left',
  3197. columnLabel: '工序',
  3198. columnHidden: false,
  3199. columnImage: false,
  3200. columnSortable: false,
  3201. sortLv: 0,
  3202. status: true,
  3203. fixed: '',
  3204. columnWidth: 120,
  3205. },
  3206. {
  3207. userId: this.$store.state.user.name,
  3208. functionId: 301003,
  3209. serialNumber: '301003Table2ResourceDesc',
  3210. tableId: '301003Table2',
  3211. tableName: '检验模板清单表',
  3212. columnProp: 'resourceID',
  3213. headerAlign: 'center',
  3214. align: 'left',
  3215. columnLabel: '机台',
  3216. columnHidden: false,
  3217. columnImage: false,
  3218. columnSortable: false,
  3219. sortLv: 0,
  3220. status: true,
  3221. fixed: '',
  3222. columnWidth: 120,
  3223. },
  3224. {
  3225. userId: this.$store.state.user.name,
  3226. functionId: 301003,
  3227. serialNumber: '301003Table2ManufacturerName',
  3228. tableId: '301003Table2',
  3229. tableName: '检验模板清单表',
  3230. columnProp: 'manufacturerName',
  3231. headerAlign: 'center',
  3232. align: 'left',
  3233. columnLabel: '供应商',
  3234. columnHidden: false,
  3235. columnImage: false,
  3236. columnSortable: false,
  3237. sortLv: 0,
  3238. status: true,
  3239. fixed: '',
  3240. columnWidth: 200,
  3241. },
  3242. {
  3243. userId: this.$store.state.user.name,
  3244. functionId: 301003,
  3245. serialNumber: '301003Table2CustomerName',
  3246. tableId: '301003Table2',
  3247. tableName: '检验模板清单表',
  3248. columnProp: 'customerName',
  3249. headerAlign: 'center',
  3250. align: 'left',
  3251. columnLabel: '客户名称',
  3252. columnHidden: false,
  3253. columnImage: false,
  3254. columnSortable: false,
  3255. sortLv: 0,
  3256. status: true,
  3257. fixed: '',
  3258. columnWidth: 200,
  3259. },
  3260. ],
  3261. columnQcSpecList: [
  3262. {
  3263. userId: this.$store.state.user.name,
  3264. functionId: 301003,
  3265. serialNumber: '301003Table6RowNo',
  3266. tableId: '301003Table6',
  3267. tableName: '质检项目设置',
  3268. columnProp: 'rowNo',
  3269. headerAlign: 'center',
  3270. align: 'center',
  3271. columnLabel: '排序',
  3272. columnHidden: false,
  3273. columnImage: false,
  3274. columnSortable: false,
  3275. showOverflowTooltip: true,
  3276. sortLv: 0,
  3277. status: true,
  3278. fixed: '',
  3279. columnWidth: 70,
  3280. },
  3281. {
  3282. userId: this.$store.state.user.name,
  3283. functionId: 301003,
  3284. serialNumber: '301003Table6BuDesc',
  3285. tableId: '301003Table6',
  3286. tableName: '质检项目设置',
  3287. columnProp: 'buDesc',
  3288. headerAlign: 'center',
  3289. align: 'left',
  3290. columnLabel: 'BU',
  3291. columnHidden: false,
  3292. columnImage: false,
  3293. columnSortable: false,
  3294. showOverflowTooltip: true,
  3295. sortLv: 0,
  3296. status: true,
  3297. fixed: '',
  3298. columnWidth: 100,
  3299. },
  3300. {
  3301. userId: this.$store.state.user.name,
  3302. functionId: 301003,
  3303. serialNumber: '301003Table6ItemNo',
  3304. tableId: '301003Table6',
  3305. tableName: '质检项目设置',
  3306. columnProp: 'itemNo',
  3307. headerAlign: 'center',
  3308. align: 'left',
  3309. columnLabel: '项目编码',
  3310. columnHidden: false,
  3311. columnImage: false,
  3312. columnSortable: false,
  3313. showOverflowTooltip: true,
  3314. sortLv: 0,
  3315. status: true,
  3316. fixed: '',
  3317. columnWidth: 100,
  3318. },
  3319. {
  3320. userId: this.$store.state.user.name,
  3321. functionId: 301003,
  3322. serialNumber: '301003Table6ItemDesc',
  3323. tableId: '301003Table6',
  3324. tableName: '质检项目设置',
  3325. columnProp: 'itemDesc',
  3326. headerAlign: 'center',
  3327. align: 'left',
  3328. columnLabel: '项目名称',
  3329. columnHidden: false,
  3330. columnImage: false,
  3331. columnSortable: false,
  3332. showOverflowTooltip: true,
  3333. sortLv: 0,
  3334. status: true,
  3335. fixed: '',
  3336. columnWidth: 150,
  3337. },
  3338. {
  3339. userId: this.$store.state.user.name,
  3340. functionId: 301003,
  3341. serialNumber: '301003Table6MethodName',
  3342. tableId: '301003Table6',
  3343. tableName: '质检项目设置',
  3344. columnProp: 'methodName',
  3345. headerAlign: 'center',
  3346. align: 'left',
  3347. columnLabel: '检验方法',
  3348. columnHidden: false,
  3349. columnImage: false,
  3350. columnSortable: false,
  3351. showOverflowTooltip: true,
  3352. sortLv: 0,
  3353. status: true,
  3354. fixed: '',
  3355. columnWidth: 100,
  3356. },
  3357. {
  3358. userId: this.$store.state.user.name,
  3359. functionId: 301003,
  3360. serialNumber: '301003Table6MethodRemark',
  3361. tableId: '301003Table6',
  3362. tableName: '质检项目设置',
  3363. columnProp: 'methodRemark',
  3364. headerAlign: 'center',
  3365. align: 'left',
  3366. columnLabel: '方法说明',
  3367. columnHidden: false,
  3368. columnImage: false,
  3369. columnSortable: false,
  3370. showOverflowTooltip: true,
  3371. sortLv: 0,
  3372. status: true,
  3373. fixed: '',
  3374. columnWidth: 120,
  3375. },
  3376. {
  3377. userId: this.$store.state.user.name,
  3378. functionId: 301003,
  3379. serialNumber: '301003Table6InspectionTypeName',
  3380. tableId: '301003Table6',
  3381. tableName: '质检项目设置',
  3382. columnProp: 'inspectionTypeName',
  3383. headerAlign: 'center',
  3384. align: 'left',
  3385. columnLabel: '检验类型',
  3386. columnHidden: false,
  3387. columnImage: false,
  3388. columnSortable: false,
  3389. showOverflowTooltip: true,
  3390. sortLv: 0,
  3391. status: true,
  3392. fixed: '',
  3393. columnWidth: 90,
  3394. },
  3395. {
  3396. userId: this.$store.state.user.name,
  3397. functionId: 301003,
  3398. serialNumber: '301003Table6IpqcInspectionMethod',
  3399. tableId: '301003Table6',
  3400. tableName: '质检项目设置',
  3401. columnProp: 'ipqcInspectionMethod',
  3402. headerAlign: 'center',
  3403. align: 'center',
  3404. columnLabel: 'IPQC检验方式',
  3405. columnHidden: false,
  3406. columnImage: false,
  3407. columnSortable: false,
  3408. showOverflowTooltip: true,
  3409. editType: 'ipqcSelect',
  3410. visibleWhen: 'ipqcMethod',
  3411. sortLv: 0,
  3412. status: true,
  3413. fixed: '',
  3414. columnWidth: 110,
  3415. },
  3416. {
  3417. userId: this.$store.state.user.name,
  3418. functionId: 301003,
  3419. serialNumber: '301003Table6ValueType',
  3420. tableId: '301003Table6',
  3421. tableName: '质检项目设置',
  3422. columnProp: 'valueType',
  3423. headerAlign: 'center',
  3424. align: 'center',
  3425. columnLabel: '数据类型',
  3426. columnHidden: false,
  3427. columnImage: false,
  3428. columnSortable: false,
  3429. showOverflowTooltip: true,
  3430. editType: 'valueType',
  3431. sortLv: 0,
  3432. status: true,
  3433. fixed: '',
  3434. columnWidth: 90,
  3435. },
  3436. {
  3437. userId: this.$store.state.user.name,
  3438. functionId: 301003,
  3439. serialNumber: '301003Table6DefaultValue',
  3440. tableId: '301003Table6',
  3441. tableName: '质检项目设置',
  3442. columnProp: 'defaultValue',
  3443. headerAlign: 'center',
  3444. align: 'left',
  3445. columnLabel: '标准值',
  3446. columnHidden: false,
  3447. columnImage: false,
  3448. columnSortable: false,
  3449. editType: 'textInput',
  3450. sortLv: 0,
  3451. status: true,
  3452. fixed: '',
  3453. columnWidth: 100,
  3454. },
  3455. {
  3456. userId: this.$store.state.user.name,
  3457. functionId: 301003,
  3458. serialNumber: '301003Table6MaxValue',
  3459. tableId: '301003Table6',
  3460. tableName: '质检项目设置',
  3461. columnProp: 'maxValue',
  3462. headerAlign: 'center',
  3463. align: 'right',
  3464. columnLabel: '上限值',
  3465. columnHidden: false,
  3466. columnImage: false,
  3467. columnSortable: false,
  3468. editType: 'textInput',
  3469. sortLv: 0,
  3470. status: true,
  3471. fixed: '',
  3472. columnWidth: 90,
  3473. },
  3474. {
  3475. userId: this.$store.state.user.name,
  3476. functionId: 301003,
  3477. serialNumber: '301003Table6MinValue',
  3478. tableId: '301003Table6',
  3479. tableName: '质检项目设置',
  3480. columnProp: 'minValue',
  3481. headerAlign: 'center',
  3482. align: 'right',
  3483. columnLabel: '下限值',
  3484. columnHidden: false,
  3485. columnImage: false,
  3486. columnSortable: false,
  3487. editType: 'textInput',
  3488. sortLv: 0,
  3489. status: true,
  3490. fixed: '',
  3491. columnWidth: 90,
  3492. },
  3493. {
  3494. userId: this.$store.state.user.name,
  3495. functionId: 301003,
  3496. serialNumber: '301003Table6SamplingProgrammeDesc',
  3497. tableId: '301003Table6',
  3498. tableName: '质检项目设置',
  3499. columnProp: 'samplingProgrammeDesc',
  3500. headerAlign: 'center',
  3501. align: 'center',
  3502. columnLabel: '抽样方案',
  3503. columnHidden: false,
  3504. columnImage: false,
  3505. columnSortable: false,
  3506. showOverflowTooltip: true,
  3507. editType: 'programmePicker',
  3508. sortLv: 0,
  3509. status: true,
  3510. fixed: '',
  3511. columnWidth: 180,
  3512. },
  3513. {
  3514. userId: this.$store.state.user.name,
  3515. functionId: 301003,
  3516. serialNumber: '301003Table6SamplingLevelDesc',
  3517. tableId: '301003Table6',
  3518. tableName: '质检项目设置',
  3519. columnProp: 'samplingLevelDesc',
  3520. headerAlign: 'center',
  3521. align: 'center',
  3522. columnLabel: '检验水平',
  3523. columnHidden: false,
  3524. columnImage: false,
  3525. columnSortable: false,
  3526. showOverflowTooltip: true,
  3527. editType: 'levelPicker',
  3528. sortLv: 0,
  3529. status: true,
  3530. fixed: '',
  3531. columnWidth: 180,
  3532. },
  3533. {
  3534. userId: this.$store.state.user.name,
  3535. functionId: 301003,
  3536. serialNumber: '301003Table6DefaultSamplingQuantity',
  3537. tableId: '301003Table6',
  3538. tableName: '质检项目设置',
  3539. columnProp: 'defaultSamplingQuantity',
  3540. headerAlign: 'center',
  3541. align: 'right',
  3542. columnLabel: '默认抽样数量',
  3543. columnHidden: false,
  3544. columnImage: false,
  3545. columnSortable: false,
  3546. editType: 'samplingQty',
  3547. sortLv: 0,
  3548. status: true,
  3549. fixed: '',
  3550. columnWidth: 110,
  3551. },
  3552. {
  3553. userId: this.$store.state.user.name,
  3554. functionId: 301003,
  3555. serialNumber: '301003Table6DefaultSamplingProportion',
  3556. tableId: '301003Table6',
  3557. tableName: '质检项目设置',
  3558. columnProp: 'defaultSamplingProportion',
  3559. headerAlign: 'center',
  3560. align: 'right',
  3561. columnLabel: '默认抽样比例',
  3562. columnHidden: false,
  3563. columnImage: false,
  3564. columnSortable: false,
  3565. editType: 'samplingRatio',
  3566. sortLv: 0,
  3567. status: true,
  3568. fixed: '',
  3569. columnWidth: 110,
  3570. },
  3571. {
  3572. userId: this.$store.state.user.name,
  3573. functionId: 301003,
  3574. serialNumber: '301003Table6Operation',
  3575. tableId: '301003Table6',
  3576. tableName: '质检项目设置',
  3577. columnProp: 'operation',
  3578. headerAlign: 'center',
  3579. align: 'left',
  3580. columnLabel: '工序',
  3581. columnHidden: false,
  3582. columnImage: false,
  3583. columnSortable: false,
  3584. showOverflowTooltip: true,
  3585. editType: 'operationPicker',
  3586. visibleWhen: 'operation',
  3587. sortLv: 0,
  3588. status: true,
  3589. fixed: '',
  3590. columnWidth: 120,
  3591. },
  3592. {
  3593. userId: this.$store.state.user.name,
  3594. functionId: 301003,
  3595. serialNumber: '301003Table6ResourceID',
  3596. tableId: '301003Table6',
  3597. tableName: '质检项目设置',
  3598. columnProp: 'resourceID',
  3599. headerAlign: 'center',
  3600. align: 'left',
  3601. columnLabel: '机台',
  3602. columnHidden: false,
  3603. columnImage: false,
  3604. columnSortable: false,
  3605. showOverflowTooltip: true,
  3606. editType: 'resourcePicker',
  3607. visibleWhen: 'resource',
  3608. sortLv: 0,
  3609. status: true,
  3610. fixed: '',
  3611. columnWidth: 140,
  3612. },
  3613. {
  3614. userId: this.$store.state.user.name,
  3615. functionId: 301003,
  3616. serialNumber: '301003Table6ManufacturerName',
  3617. tableId: '301003Table6',
  3618. tableName: '质检项目设置',
  3619. columnProp: 'manufacturerName',
  3620. headerAlign: 'center',
  3621. align: 'left',
  3622. columnLabel: '供应商',
  3623. columnHidden: false,
  3624. columnImage: false,
  3625. columnSortable: false,
  3626. showOverflowTooltip: true,
  3627. editType: 'manufacturerPicker',
  3628. visibleWhen: 'manufacturer',
  3629. sortLv: 0,
  3630. status: true,
  3631. fixed: '',
  3632. columnWidth: 140,
  3633. },
  3634. {
  3635. userId: this.$store.state.user.name,
  3636. functionId: 301003,
  3637. serialNumber: '301003Table6CustomerName',
  3638. tableId: '301003Table6',
  3639. tableName: '质检项目设置',
  3640. columnProp: 'customerName',
  3641. headerAlign: 'center',
  3642. align: 'left',
  3643. columnLabel: '客户名称',
  3644. columnHidden: false,
  3645. columnImage: false,
  3646. columnSortable: false,
  3647. showOverflowTooltip: true,
  3648. editType: 'customerPicker',
  3649. visibleWhen: 'customer',
  3650. sortLv: 0,
  3651. status: true,
  3652. fixed: '',
  3653. columnWidth: 140,
  3654. },
  3655. {
  3656. userId: this.$store.state.user.name,
  3657. functionId: 301003,
  3658. serialNumber: '301003Table6Custom1',
  3659. tableId: '301003Table6',
  3660. tableName: '质检项目设置',
  3661. columnProp: 'custom1',
  3662. headerAlign: 'center',
  3663. align: 'left',
  3664. columnLabel: '自定义1',
  3665. columnHidden: false,
  3666. columnImage: false,
  3667. columnSortable: false,
  3668. showOverflowTooltip: true,
  3669. editType: 'textInput',
  3670. sortLv: 0,
  3671. status: true,
  3672. fixed: '',
  3673. columnWidth: 120,
  3674. },
  3675. {
  3676. userId: this.$store.state.user.name,
  3677. functionId: 301003,
  3678. serialNumber: '301003Table6Custom2',
  3679. tableId: '301003Table6',
  3680. tableName: '质检项目设置',
  3681. columnProp: 'custom2',
  3682. headerAlign: 'center',
  3683. align: 'left',
  3684. columnLabel: '自定义2',
  3685. columnHidden: false,
  3686. columnImage: false,
  3687. columnSortable: false,
  3688. showOverflowTooltip: true,
  3689. editType: 'textInput',
  3690. sortLv: 0,
  3691. status: true,
  3692. fixed: '',
  3693. columnWidth: 120,
  3694. },
  3695. {
  3696. userId: this.$store.state.user.name,
  3697. functionId: 301003,
  3698. serialNumber: '301003Table6Custom3',
  3699. tableId: '301003Table6',
  3700. tableName: '质检项目设置',
  3701. columnProp: 'custom3',
  3702. headerAlign: 'center',
  3703. align: 'left',
  3704. columnLabel: '自定义3',
  3705. columnHidden: false,
  3706. columnImage: false,
  3707. columnSortable: false,
  3708. showOverflowTooltip: true,
  3709. editType: 'textInput',
  3710. sortLv: 0,
  3711. status: true,
  3712. fixed: '',
  3713. columnWidth: 120,
  3714. },
  3715. {
  3716. userId: this.$store.state.user.name,
  3717. functionId: 301003,
  3718. serialNumber: '301003Table6CreateBy',
  3719. tableId: '301003Table6',
  3720. tableName: '质检项目设置',
  3721. columnProp: 'createBy',
  3722. headerAlign: 'center',
  3723. align: 'center',
  3724. columnLabel: '创建人',
  3725. columnHidden: false,
  3726. columnImage: false,
  3727. columnSortable: false,
  3728. sortLv: 0,
  3729. status: true,
  3730. fixed: '',
  3731. columnWidth: 100,
  3732. },
  3733. {
  3734. userId: this.$store.state.user.name,
  3735. functionId: 301003,
  3736. serialNumber: '301003Table6CreateTime',
  3737. tableId: '301003Table6',
  3738. tableName: '质检项目设置',
  3739. columnProp: 'createTime',
  3740. headerAlign: 'center',
  3741. align: 'center',
  3742. columnLabel: '创建时间',
  3743. columnHidden: false,
  3744. columnImage: false,
  3745. columnSortable: false,
  3746. sortLv: 0,
  3747. status: true,
  3748. fixed: '',
  3749. columnWidth: 150,
  3750. },
  3751. ],
  3752. columnDefectTrackingList: [
  3753. {
  3754. userId: this.$store.state.user.name,
  3755. functionId: 301003,
  3756. serialNumber: '301003Table4SupplierId',
  3757. tableId: '301003Table4',
  3758. tableName: '物料缺陷跟踪',
  3759. columnProp: 'supplierId',
  3760. headerAlign: 'center',
  3761. align: 'left',
  3762. columnLabel: '供应商编码',
  3763. columnHidden: false,
  3764. columnImage: false,
  3765. columnSortable: false,
  3766. sortLv: 0,
  3767. status: true,
  3768. fixed: '',
  3769. columnWidth: 100,
  3770. },
  3771. {
  3772. userId: this.$store.state.user.name,
  3773. functionId: 301003,
  3774. serialNumber: '301003Table4SupplierName',
  3775. tableId: '301003Table4',
  3776. tableName: '物料缺陷跟踪',
  3777. columnProp: 'supplierName',
  3778. headerAlign: 'center',
  3779. align: 'left',
  3780. columnLabel: '供应商名称',
  3781. columnHidden: false,
  3782. columnImage: false,
  3783. columnSortable: false,
  3784. showOverflowTooltip: true,
  3785. sortLv: 0,
  3786. status: true,
  3787. fixed: '',
  3788. columnWidth: 200,
  3789. },
  3790. {
  3791. userId: this.$store.state.user.name,
  3792. functionId: 301003,
  3793. serialNumber: '301003Table4DefectThreshold',
  3794. tableId: '301003Table4',
  3795. tableName: '物料缺陷跟踪',
  3796. columnProp: 'defectThreshold',
  3797. headerAlign: 'center',
  3798. align: 'center',
  3799. columnLabel: '缺陷阈值',
  3800. columnHidden: false,
  3801. columnImage: false,
  3802. columnSortable: false,
  3803. editType: 'positiveInt',
  3804. sortLv: 0,
  3805. status: true,
  3806. fixed: '',
  3807. columnWidth: 100,
  3808. },
  3809. {
  3810. userId: this.$store.state.user.name,
  3811. functionId: 301003,
  3812. serialNumber: '301003Table4RecoveryBatchCount',
  3813. tableId: '301003Table4',
  3814. tableName: '物料缺陷跟踪',
  3815. columnProp: 'recoveryBatchCount',
  3816. headerAlign: 'center',
  3817. align: 'center',
  3818. columnLabel: '恢复批次数',
  3819. columnHidden: false,
  3820. columnImage: false,
  3821. columnSortable: false,
  3822. editType: 'positiveInt',
  3823. sortLv: 0,
  3824. status: true,
  3825. fixed: '',
  3826. columnWidth: 100,
  3827. },
  3828. {
  3829. userId: this.$store.state.user.name,
  3830. functionId: 301003,
  3831. serialNumber: '301003Table4CurrentDefectCount',
  3832. tableId: '301003Table4',
  3833. tableName: '物料缺陷跟踪',
  3834. columnProp: 'currentDefectCount',
  3835. headerAlign: 'center',
  3836. align: 'center',
  3837. columnLabel: '当前缺陷数',
  3838. columnHidden: false,
  3839. columnImage: false,
  3840. columnSortable: false,
  3841. sortLv: 0,
  3842. status: true,
  3843. fixed: '',
  3844. columnWidth: 100,
  3845. },
  3846. {
  3847. userId: this.$store.state.user.name,
  3848. functionId: 301003,
  3849. serialNumber: '301003Table4LastDefectCount',
  3850. tableId: '301003Table4',
  3851. tableName: '物料缺陷跟踪',
  3852. columnProp: 'lastDefectCount',
  3853. headerAlign: 'center',
  3854. align: 'center',
  3855. columnLabel: '上次缺陷数',
  3856. columnHidden: false,
  3857. columnImage: false,
  3858. columnSortable: false,
  3859. sortLv: 0,
  3860. status: true,
  3861. fixed: '',
  3862. columnWidth: 100,
  3863. },
  3864. {
  3865. userId: this.$store.state.user.name,
  3866. functionId: 301003,
  3867. serialNumber: '301003Table4RemainingTrackingBatches',
  3868. tableId: '301003Table4',
  3869. tableName: '物料缺陷跟踪',
  3870. columnProp: 'remainingTrackingBatches',
  3871. headerAlign: 'center',
  3872. align: 'center',
  3873. columnLabel: '剩余跟踪批次',
  3874. columnHidden: false,
  3875. columnImage: false,
  3876. columnSortable: false,
  3877. sortLv: 0,
  3878. status: true,
  3879. fixed: '',
  3880. columnWidth: 100,
  3881. },
  3882. {
  3883. userId: this.$store.state.user.name,
  3884. functionId: 301003,
  3885. serialNumber: '301003Table4LastTriggerTime',
  3886. tableId: '301003Table4',
  3887. tableName: '物料缺陷跟踪',
  3888. columnProp: 'lastTriggerTime',
  3889. headerAlign: 'center',
  3890. align: 'center',
  3891. columnLabel: '最近触发时间',
  3892. columnHidden: false,
  3893. columnImage: false,
  3894. columnSortable: false,
  3895. sortLv: 0,
  3896. status: true,
  3897. fixed: '',
  3898. columnWidth: 140,
  3899. },
  3900. ],
  3901. columnFileCollectList: [
  3902. {
  3903. userId: this.$store.state.user.name,
  3904. functionId: 301003,
  3905. serialNumber: '301003Table5BuNo',
  3906. tableId: '301003Table5',
  3907. tableName: '文件采集配置',
  3908. columnProp: 'buNo',
  3909. headerAlign: 'center',
  3910. align: 'left',
  3911. columnLabel: 'BU',
  3912. columnHidden: false,
  3913. columnImage: false,
  3914. columnSortable: false,
  3915. showOverflowTooltip: true,
  3916. sortLv: 0,
  3917. status: true,
  3918. fixed: '',
  3919. columnWidth: 90,
  3920. },
  3921. {
  3922. userId: this.$store.state.user.name,
  3923. functionId: 301003,
  3924. serialNumber: '301003Table5EquipmentNo',
  3925. tableId: '301003Table5',
  3926. tableName: '文件采集配置',
  3927. columnProp: 'equipmentNo',
  3928. headerAlign: 'center',
  3929. align: 'left',
  3930. columnLabel: '设备编码',
  3931. columnHidden: false,
  3932. columnImage: false,
  3933. columnSortable: false,
  3934. showOverflowTooltip: true,
  3935. sortLv: 0,
  3936. status: true,
  3937. fixed: '',
  3938. columnWidth: 110,
  3939. },
  3940. {
  3941. userId: this.$store.state.user.name,
  3942. functionId: 301003,
  3943. serialNumber: '301003Table5EquipmentDesc',
  3944. tableId: '301003Table5',
  3945. tableName: '文件采集配置',
  3946. columnProp: 'equipmentDesc',
  3947. headerAlign: 'center',
  3948. align: 'left',
  3949. columnLabel: '设备名称',
  3950. columnHidden: false,
  3951. columnImage: false,
  3952. columnSortable: false,
  3953. showOverflowTooltip: true,
  3954. sortLv: 0,
  3955. status: true,
  3956. fixed: '',
  3957. columnWidth: 140,
  3958. },
  3959. {
  3960. userId: this.$store.state.user.name,
  3961. functionId: 301003,
  3962. serialNumber: '301003Table5StaffAccount',
  3963. tableId: '301003Table5',
  3964. tableName: '文件采集配置',
  3965. columnProp: 'staffAccount',
  3966. headerAlign: 'center',
  3967. align: 'center',
  3968. columnLabel: '人员账号',
  3969. columnHidden: false,
  3970. columnImage: false,
  3971. columnSortable: false,
  3972. editType: 'staffPicker',
  3973. sortLv: 0,
  3974. status: true,
  3975. fixed: '',
  3976. columnWidth: 120,
  3977. },
  3978. {
  3979. userId: this.$store.state.user.name,
  3980. functionId: 301003,
  3981. serialNumber: '301003Table5StaffName',
  3982. tableId: '301003Table5',
  3983. tableName: '文件采集配置',
  3984. columnProp: 'staffName',
  3985. headerAlign: 'center',
  3986. align: 'center',
  3987. columnLabel: '人员姓名',
  3988. columnHidden: false,
  3989. columnImage: false,
  3990. columnSortable: false,
  3991. showOverflowTooltip: true,
  3992. sortLv: 0,
  3993. status: true,
  3994. fixed: '',
  3995. columnWidth: 100,
  3996. },
  3997. {
  3998. userId: this.$store.state.user.name,
  3999. functionId: 301003,
  4000. serialNumber: '301003Table5ItemNo',
  4001. tableId: '301003Table5',
  4002. tableName: '文件采集配置',
  4003. columnProp: 'itemNo',
  4004. headerAlign: 'center',
  4005. align: 'left',
  4006. columnLabel: '项目编码',
  4007. columnHidden: false,
  4008. columnImage: false,
  4009. columnSortable: false,
  4010. editType: 'itemPicker',
  4011. sortLv: 0,
  4012. status: true,
  4013. fixed: '',
  4014. columnWidth: 120,
  4015. },
  4016. {
  4017. userId: this.$store.state.user.name,
  4018. functionId: 301003,
  4019. serialNumber: '301003Table5ItemDesc',
  4020. tableId: '301003Table5',
  4021. tableName: '文件采集配置',
  4022. columnProp: 'itemDesc',
  4023. headerAlign: 'center',
  4024. align: 'left',
  4025. columnLabel: '项目名称',
  4026. columnHidden: false,
  4027. columnImage: false,
  4028. columnSortable: false,
  4029. showOverflowTooltip: true,
  4030. sortLv: 0,
  4031. status: true,
  4032. fixed: '',
  4033. columnWidth: 130,
  4034. },
  4035. {
  4036. userId: this.$store.state.user.name,
  4037. functionId: 301003,
  4038. serialNumber: '301003Table5Operation',
  4039. tableId: '301003Table5',
  4040. tableName: '文件采集配置',
  4041. columnProp: 'operation',
  4042. headerAlign: 'center',
  4043. align: 'left',
  4044. columnLabel: '工序',
  4045. columnHidden: false,
  4046. columnImage: false,
  4047. columnSortable: false,
  4048. showOverflowTooltip: true,
  4049. editType: 'operationPicker',
  4050. sortLv: 0,
  4051. status: true,
  4052. fixed: '',
  4053. columnWidth: 140,
  4054. },
  4055. {
  4056. userId: this.$store.state.user.name,
  4057. functionId: 301003,
  4058. serialNumber: '301003Table5FileColumnNo',
  4059. tableId: '301003Table5',
  4060. tableName: '文件采集配置',
  4061. columnProp: 'fileColumnNo',
  4062. headerAlign: 'center',
  4063. align: 'right',
  4064. columnLabel: '文件列号',
  4065. columnHidden: false,
  4066. columnImage: false,
  4067. columnSortable: false,
  4068. sortLv: 0,
  4069. status: true,
  4070. fixed: '',
  4071. columnWidth: 90,
  4072. fixedWidth: 90,
  4073. },
  4074. {
  4075. userId: this.$store.state.user.name,
  4076. functionId: 301003,
  4077. serialNumber: '301003Table5OriginalColumnName',
  4078. tableId: '301003Table5',
  4079. tableName: '文件采集配置',
  4080. columnProp: 'originalColumnName',
  4081. headerAlign: 'center',
  4082. align: 'left',
  4083. columnLabel: '文件原列名',
  4084. columnHidden: false,
  4085. columnImage: false,
  4086. columnSortable: false,
  4087. editType: 'textInput',
  4088. sortLv: 0,
  4089. status: true,
  4090. fixed: '',
  4091. columnWidth: 120,
  4092. },
  4093. {
  4094. userId: this.$store.state.user.name,
  4095. functionId: 301003,
  4096. serialNumber: '301003Table5Remark',
  4097. tableId: '301003Table5',
  4098. tableName: '文件采集配置',
  4099. columnProp: 'remark',
  4100. headerAlign: 'center',
  4101. align: 'left',
  4102. columnLabel: '备注',
  4103. columnHidden: false,
  4104. columnImage: false,
  4105. columnSortable: false,
  4106. editType: 'textInput',
  4107. sortLv: 0,
  4108. status: true,
  4109. fixed: '',
  4110. columnWidth: 100,
  4111. },
  4112. ],
  4113. columnLabelTemplateList: [
  4114. {
  4115. columnProp: 'labelTypeTb',
  4116. headerAlign: 'center',
  4117. align: 'left',
  4118. columnLabel: '标签编码',
  4119. columnHidden: false,
  4120. columnImage: false,
  4121. columnSortable: false,
  4122. sortLv: 0,
  4123. status: true,
  4124. fixed: '',
  4125. columnWidth: 100,
  4126. },
  4127. {
  4128. columnProp: 'labelType',
  4129. headerAlign: 'center',
  4130. align: 'left',
  4131. columnLabel: '标签类型',
  4132. columnHidden: false,
  4133. columnImage: false,
  4134. columnSortable: false,
  4135. sortLv: 0,
  4136. status: true,
  4137. fixed: '',
  4138. columnWidth: 120,
  4139. },
  4140. {
  4141. columnProp: 'operationDesc',
  4142. headerAlign: 'center',
  4143. align: 'left',
  4144. columnLabel: '工序',
  4145. columnHidden: false,
  4146. columnImage: false,
  4147. columnSortable: false,
  4148. sortLv: 0,
  4149. status: true,
  4150. fixed: '',
  4151. columnWidth: 120,
  4152. },
  4153. {
  4154. columnProp: 'defaultFlagDesc',
  4155. headerAlign: 'center',
  4156. align: 'center',
  4157. columnLabel: '默认标识',
  4158. columnHidden: false,
  4159. columnImage: false,
  4160. columnSortable: false,
  4161. sortLv: 0,
  4162. status: true,
  4163. fixed: '',
  4164. columnWidth: 100,
  4165. },
  4166. ],
  4167. // 快速添加
  4168. fastAddFlag: false,
  4169. itemList1: [],
  4170. itemList2: [],
  4171. itemList1Loading: false, // 可选模板列表loading
  4172. itemList2Loading: false, // 已有模板列表loading
  4173. addItemLoading: false, // 添加按钮loading
  4174. deleteItemLoading: false, // 删除按钮loading
  4175. itemListRow1: {},
  4176. itemListRow2: {},
  4177. tempLevelRow: {},
  4178. tempProgrammeRow: {},
  4179. options: [],
  4180. itemSelections1: [],
  4181. itemSelections2: [],
  4182. rules: {
  4183. partNoType: [
  4184. {
  4185. required: true,
  4186. message: ' ',
  4187. trigger: ['blur', 'change'],
  4188. },
  4189. ],
  4190. partDescType: [
  4191. {
  4192. required: true,
  4193. message: ' ',
  4194. trigger: ['blur', 'change'],
  4195. },
  4196. ],
  4197. bu: [
  4198. {
  4199. required: true,
  4200. message: ' ',
  4201. trigger: ['blur', 'change'],
  4202. },
  4203. ],
  4204. },
  4205. // 工序
  4206. operationList: [],
  4207. operationPageIndex: 1,
  4208. operationPageSize: 20,
  4209. operationTotalPage: 0,
  4210. resourceList: [],
  4211. operationModelFlag: false,
  4212. resourceModelFlag: false,
  4213. dataListOperationSelections: [],
  4214. operationData: {
  4215. site:'',
  4216. operationDesc: '',
  4217. },
  4218. resourceData: {
  4219. site: '',
  4220. resourceId: '',
  4221. resourceDesc: '',
  4222. },
  4223. operation: '',
  4224. resourceId: '',
  4225. selectionManufacturer: [],
  4226. selectionManufacturer2: [],
  4227. // 供应商
  4228. manufacturerList: [],
  4229. manufacturerModelFlag: false,
  4230. dataListManufacturerSelections: [],
  4231. manufacturerData: {
  4232. site: '',
  4233. manufacturerID: '',
  4234. manufacturerName: '',
  4235. },
  4236. manufacturerPageIndex: 1,
  4237. manufacturerPageSize: 20,
  4238. manufacturerTotalPage: 0,
  4239. // 单选框绑定的值
  4240. operationCurrent: -1,
  4241. resourceCurrent: -1,
  4242. sopData: {
  4243. site: '',
  4244. buNo: '',
  4245. partNo: '',
  4246. inspectionTypeNo: '',
  4247. inspectionTypeName: '',
  4248. },
  4249. sopList: [],
  4250. sopFileModelFlag: false,
  4251. sopColumnList: [
  4252. {
  4253. columnProp: 'fileName',
  4254. headerAlign: 'center',
  4255. align: 'center',
  4256. columnLabel: '文件名称',
  4257. columnHidden: false,
  4258. columnImage: false,
  4259. columnSortable: false,
  4260. sortLv: 0,
  4261. status: true,
  4262. fixed: '',
  4263. },
  4264. {
  4265. columnProp: 'createdBy',
  4266. headerAlign: 'center',
  4267. align: 'center',
  4268. columnLabel: '上传人',
  4269. columnHidden: false,
  4270. columnImage: false,
  4271. columnSortable: true,
  4272. sortLv: 0,
  4273. status: true,
  4274. fixed: false,
  4275. },
  4276. {
  4277. columnProp: 'createDate',
  4278. headerAlign: 'center',
  4279. align: 'center',
  4280. columnLabel: '上传时间',
  4281. columnHidden: false,
  4282. columnImage: false,
  4283. columnSortable: true,
  4284. sortLv: 0,
  4285. status: true,
  4286. fixed: false,
  4287. },
  4288. {
  4289. columnProp: 'orderRef3',
  4290. headerAlign: 'center',
  4291. align: 'center',
  4292. columnLabel: '检验类型',
  4293. columnHidden: false,
  4294. columnImage: false,
  4295. columnSortable: true,
  4296. sortLv: 0,
  4297. status: true,
  4298. fixed: false,
  4299. },
  4300. ],
  4301. userBuList: [],
  4302. buList: [],
  4303. umList: [],
  4304. partInfoList: [],
  4305. partDetailData: {
  4306. bu: '',
  4307. partNo: '',
  4308. partDesc: '',
  4309. seqNo: '',
  4310. sku: '',
  4311. cinvSourceCode: '',
  4312. },
  4313. authSearch: false,
  4314. authSave: false,
  4315. authUpdate: false,
  4316. authDelete: false,
  4317. authDetail: false,
  4318. authFile: false,
  4319. authSync: false,
  4320. authItemImport: false,
  4321. syncLoading: false,
  4322. menuId: this.$route.meta.menuId,
  4323. activeTable: 'qcSpec',
  4324. partCurrentRow: {},
  4325. secondHeight: 200,
  4326. searchLoading: false,
  4327. saveLoading: false,
  4328. editBatchVisible: false,
  4329. batchLoading: false,
  4330. defectTrackingModal: false,
  4331. defectTrackingDisableFlag: false,
  4332. labelTemplateModal: false,
  4333. labelTemplateDisableFlag: false,
  4334. selectionCustomer: [],
  4335. selectionCustomer2: [],
  4336. dataListCustomerSelections: [],
  4337. span1: 12,
  4338. span2: 12,
  4339. span3: 12,
  4340. operationSelections: [],
  4341. resourceSelections: [],
  4342. customerData: {
  4343. site: '',
  4344. customerID: '',
  4345. customerName: '',
  4346. },
  4347. customerPageIndex: 1,
  4348. customerPageSize: 20,
  4349. customerTotalPage: 0,
  4350. customerModelFlag: false,
  4351. customerList: [],
  4352. }
  4353. },
  4354. mounted() {
  4355. window.addEventListener('resize', this.handleViewportResize)
  4356. this.$nextTick(() => {
  4357. this.handleViewportResize()
  4358. this.initQcSpecSortable()
  4359. })
  4360. },
  4361. activated() {
  4362. window.addEventListener('resize', this.handleViewportResize)
  4363. this.$nextTick(() => this.handleViewportResize())
  4364. },
  4365. deactivated() {
  4366. window.removeEventListener('resize', this.handleViewportResize)
  4367. this.clearQcSpecSyncTimers()
  4368. },
  4369. beforeDestroy() {
  4370. window.removeEventListener('resize', this.handleViewportResize)
  4371. this.clearQcSpecSyncTimers()
  4372. this.destroyQcSpecSortable()
  4373. },
  4374. watch: {
  4375. '$i18n.locale'() {
  4376. this.initPartAttributeI18n()
  4377. // 动态列接口带 languageCode,语言切换后需重新拉取
  4378. this.reloadDynamicColumns()
  4379. },
  4380. qcSpecList() {
  4381. this.qcSpecSortedCache = null
  4382. if (this.qcSpecListSkipSchedule) return
  4383. this.scheduleQcSpecTableSync()
  4384. },
  4385. qcSpecFilterType() {
  4386. this.clearQcSpecDimensionFilters()
  4387. this.resetQcSpecTableSelection()
  4388. this.scheduleQcSpecTableSync()
  4389. },
  4390. qcSpecFilterIpqcMethod() {
  4391. this.scheduleQcSpecTableSync()
  4392. },
  4393. qcSpecFilterOperation() {
  4394. this.scheduleQcSpecTableSync()
  4395. },
  4396. qcSpecFilterResource() {
  4397. this.scheduleQcSpecTableSync()
  4398. },
  4399. qcSpecFilterManufacturer() {
  4400. this.scheduleQcSpecTableSync()
  4401. },
  4402. qcSpecFilterCustomer() {
  4403. this.scheduleQcSpecTableSync()
  4404. },
  4405. activeTable(val) {
  4406. if (val === 'qcSpec') {
  4407. this.$nextTick(() => this.initQcSpecSortable())
  4408. } else {
  4409. this.clearQcSpecSyncTimers()
  4410. this.destroyQcSpecSortable()
  4411. }
  4412. },
  4413. editQcSpecBatchVisible(val) {
  4414. if (this.qcSpecSortable) {
  4415. this.qcSpecSortable.option('disabled', val)
  4416. } else if (!val) {
  4417. this.$nextTick(() => this.initQcSpecSortable())
  4418. }
  4419. },
  4420. qcSpecColumnLayoutKey() {
  4421. if (this.activeTable !== 'qcSpec') return
  4422. this.$nextTick(() => this.initQcSpecSortable())
  4423. },
  4424. },
  4425. created() {
  4426. // 按钮控制
  4427. this.getButtonAuthData()
  4428. // 获取用户的 site 和 bu
  4429. this.getSiteAndBuByUserName()
  4430. this.getSiteAndBuByUserName2()
  4431. this.umSearch()
  4432. // 校验用户是否收藏
  4433. // this.favoriteIsOk()
  4434. this.initPartAttributeI18n()
  4435. // 获取检验类型
  4436. this.inspectionTypeSearch()
  4437. // 动态列
  4438. // this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  4439. // this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  4440. this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1)
  4441. // 与 columnDefectTrackingList.tableId(如 301003Table4)保持一致
  4442. this.getTableUserColumn(this.$route.meta.menuId + 'Table4', 4)
  4443. // 与 columnFileCollectList.tableId(如 301003Table5)保持一致
  4444. this.getTableUserColumn(this.$route.meta.menuId + 'Table5', 5)
  4445. // 与 columnQcSpecList.tableId(如 301003Table6)保持一致
  4446. this.getTableUserColumn(this.$route.meta.menuId + 'Table6', 6)
  4447. if (!this.authSearch) {
  4448. // 获取数据列表
  4449. this.getDataList()
  4450. }
  4451. },
  4452. computed: {
  4453. ipqcMethodOptions() {
  4454. return [
  4455. { value: '首件检', label: this.$t('qc.table.firstInspection') },
  4456. { value: '自检', label: this.$t('qc.table.selfInspection') },
  4457. { value: '巡检', label: this.$t('qc.table.patrolInspection') },
  4458. { value: '末件检', label: this.$t('qc.table.finalInspection') },
  4459. ]
  4460. },
  4461. siteList() {
  4462. const seen = {}
  4463. const list = []
  4464. ;(this.buList || []).forEach((item) => {
  4465. const site = item && item.site
  4466. if (!site || seen[site]) {
  4467. return
  4468. }
  4469. seen[site] = true
  4470. list.push({
  4471. site,
  4472. sitename: item.sitename || item.siteName || '',
  4473. })
  4474. })
  4475. return list
  4476. },
  4477. // 质量检验模板分页数据
  4478. detailListPaged() {
  4479. const start = (this.templatePageIndex - 1) * this.templatePageSize
  4480. const end = start + this.templatePageSize
  4481. return this.detailList.slice(start, end)
  4482. },
  4483. qcSpecBatchFillTypeIsIpqc() {
  4484. return this.qcSpecBatchFillData.inspectionTypeNo === '101'
  4485. },
  4486. qcSpecSyncTypeIsIpqc() {
  4487. return this.qcSpecSyncData.inspectionTypeNo === '101'
  4488. },
  4489. /** 质检项目新增:仅展示与当前物料同 site 的 BU,避免跨工厂选项目 */
  4490. qcSpecAddBuList() {
  4491. const partSite = this.partCurrentRow && this.partCurrentRow.site
  4492. if (partSite === undefined || partSite === null || partSite === '') {
  4493. return []
  4494. }
  4495. return (this.buList || []).filter(
  4496. (i) => String(i.site) === String(partSite)
  4497. )
  4498. },
  4499. qcSpecAddApplyIsIqc() {
  4500. return String(this.qcSpecAddApplyData.inspectionTypeNo) === '105'
  4501. },
  4502. qcSpecAddApplyIsIpqc() {
  4503. return String(this.qcSpecAddApplyData.inspectionTypeNo) === '101'
  4504. },
  4505. qcSpecAddApplyCanOperation() {
  4506. return !!this.qcSpecAddApplyData.inspectionTypeNo && !this.qcSpecAddApplyIsIqc
  4507. },
  4508. qcSpecAddApplyCanResource() {
  4509. return this.qcSpecAddApplyCanOperation
  4510. },
  4511. qcSpecAddApplyCanManufacturer() {
  4512. return this.qcSpecAddApplyIsIqc
  4513. },
  4514. qcSpecAddApplyCanCustomer() {
  4515. return this.qcSpecAddApplyCanOperation
  4516. },
  4517. /** 质检项目筛选:按当前检验类型显示对应条件 */
  4518. qcSpecFilterShowManufacturer() {
  4519. return String(this.qcSpecFilterType) === '105'
  4520. },
  4521. qcSpecFilterShowIpqcMethod() {
  4522. return String(this.qcSpecFilterType) === '101'
  4523. },
  4524. qcSpecFilterShowOperation() {
  4525. return ['101', '107', '109'].includes(String(this.qcSpecFilterType))
  4526. },
  4527. qcSpecFilterShowResource() {
  4528. return ['101', '107', '109'].includes(String(this.qcSpecFilterType))
  4529. },
  4530. qcSpecFilterShowCustomer() {
  4531. return ['101', '107', '109'].includes(String(this.qcSpecFilterType))
  4532. },
  4533. qcSpecListByFilterType() {
  4534. const filterType = String(this.qcSpecFilterType || '')
  4535. const list = this.qcSpecList || []
  4536. if (!filterType) return list
  4537. return list.filter((item) => String(item.inspectionTypeNo || '') === filterType)
  4538. },
  4539. qcSpecOperationFilterOptions() {
  4540. return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) =>
  4541. (item.operation || '').trim()
  4542. )
  4543. },
  4544. qcSpecResourceFilterOptions() {
  4545. return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) =>
  4546. this.getQcSpecResourceFilterValue(item)
  4547. )
  4548. },
  4549. qcSpecManufacturerFilterOptions() {
  4550. return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) =>
  4551. this.getQcSpecManufacturerFilterValue(item)
  4552. )
  4553. },
  4554. qcSpecCustomerFilterOptions() {
  4555. return this.buildQcSpecFilterOptions(this.qcSpecListByFilterType, (item) =>
  4556. this.getQcSpecCustomerFilterValue(item)
  4557. )
  4558. },
  4559. qcSpecVisibleColumnList() {
  4560. const showMap = {
  4561. ipqcMethod: this.qcSpecFilterShowIpqcMethod,
  4562. operation: this.qcSpecFilterShowOperation,
  4563. resource: this.qcSpecFilterShowResource,
  4564. manufacturer: this.qcSpecFilterShowManufacturer,
  4565. customer: this.qcSpecFilterShowCustomer,
  4566. }
  4567. return (this.columnQcSpecList || [])
  4568. .filter((col) => {
  4569. if (col.status === false || col.columnHidden) return false
  4570. if (!col.visibleWhen) return true
  4571. return !!showMap[col.visibleWhen]
  4572. })
  4573. .slice()
  4574. .sort((a, b) => Number(a.sortLv || 0) - Number(b.sortLv || 0))
  4575. },
  4576. qcSpecColumnLayoutKey() {
  4577. return (this.qcSpecVisibleColumnList || [])
  4578. .map((col) => col.columnProp)
  4579. .join(',')
  4580. },
  4581. /** 质检项目设置:IQC 与 IPQC 互换位置,IQC 排最前 */
  4582. qcSpecTypeOptions() {
  4583. const opts = [...(this.options || [])]
  4584. const iqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '105')
  4585. const ipqcIdx = opts.findIndex((item) => String(item.inspectionTypeNo) === '101')
  4586. if (iqcIdx < 0 || ipqcIdx < 0 || iqcIdx === ipqcIdx) {
  4587. return opts
  4588. }
  4589. const result = [...opts]
  4590. const iqc = result[iqcIdx]
  4591. const ipqc = result[ipqcIdx]
  4592. result[iqcIdx] = ipqc
  4593. result[ipqcIdx] = iqc
  4594. return result
  4595. },
  4596. qcSpecPartTransferDialogTitle() {
  4597. return this.qcSpecPartTransferMode === 'update'
  4598. ? this.$t('qc.partAttributePage.dialogQcSpecUpdate')
  4599. : this.$t('qc.partAttributePage.dialogQcSpecCopy')
  4600. },
  4601. },
  4602. methods: {
  4603. formatQcValueType (row) {
  4604. return formatQcValueTypeLabel(row, this.$t.bind(this))
  4605. },
  4606. formatIpqcMethod(value) {
  4607. const method = this.ipqcMethodOptions.find(option => option.value === value)
  4608. return method ? method.label : value
  4609. },
  4610. qcSpecColumnText(row, item) {
  4611. if (!row || !item) return ''
  4612. if (item.columnProp === 'ipqcInspectionMethod') {
  4613. return this.formatIpqcMethod(row.ipqcInspectionMethod)
  4614. }
  4615. if (item.columnProp === 'resourceID') {
  4616. return row.resourceDesc || row.resourceID
  4617. }
  4618. return row[item.columnProp]
  4619. },
  4620. // Keep both data grids usable on short screens and recalculate after viewport changes.
  4621. handleViewportResize() {
  4622. const viewportHeight = document.documentElement.clientHeight || window.innerHeight
  4623. const availableHeight = Math.max(viewportHeight - 170, 460)
  4624. const firstTableHeight = Math.max(180, Math.floor(availableHeight * 0.35))
  4625. this.height = firstTableHeight
  4626. this.secondHeight = Math.max(280, availableHeight - firstTableHeight)
  4627. },
  4628. initPartAttributeI18n() {
  4629. const t = (k) => this.$t('qc.partAttributePage.' + k)
  4630. const tt = (k) => this.$t('qc.table.' + k)
  4631. const tm = (k) => this.$t('qc.method.' + k)
  4632. const tpl = (k) => this.$t('qc.template.' + k)
  4633. const mainMap = {
  4634. site: () => t('colSite'),
  4635. buDesc: () => 'BU',
  4636. partNo: () => tt('materialCode'),
  4637. sku: () => 'SKU',
  4638. partDesc: () => tt('materialName'),
  4639. partType: () => tt('partType'),
  4640. spec: () => tt('spec'),
  4641. umName: () => tt('unit'),
  4642. attributeRemark: () => tt('remark'),
  4643. createTime: () => tm('colCreateTime'),
  4644. createBy: () => tm('colCreateBy'),
  4645. updateDate: () => tm('colUpdateTime'),
  4646. updateBy: () => tm('colUpdateBy'),
  4647. }
  4648. const detailMap = {
  4649. templateId: () => tt('templateCode'),
  4650. templateName: () => tt('templateName'),
  4651. inspectionTypeName: () => tt('inspectionType'),
  4652. ipqcInspectionMethod: () => t('colIpqcMethod'),
  4653. templateVersion: () => tpl('colVersion'),
  4654. defaultSamplingQuantity: () => tpl('colDefaultSamplingQty'),
  4655. defaultSamplingProportion: () => tpl('colDefaultSamplingRatio'),
  4656. operation: () => tt('process'),
  4657. resourceID: () => tt('machine'),
  4658. manufacturerName: () => tt('supplier'),
  4659. customerName: () => tt('customerName'),
  4660. }
  4661. const qcSpecMap = {
  4662. rowNo: () => t('colSort'),
  4663. buDesc: () => tm('colBu'),
  4664. itemNo: () => tt('itemCode'),
  4665. itemDesc: () => tt('itemName'),
  4666. methodName: () => tt('inspectionMethod'),
  4667. methodRemark: () => tm('colMethodRemark'),
  4668. inspectionTypeName: () => tt('inspectionType'),
  4669. ipqcInspectionMethod: () => t('colIpqcMethod'),
  4670. valueType: () => tt('valueType'),
  4671. defaultValue: () => tt('standardValue'),
  4672. maxValue: () => tt('upperValue'),
  4673. minValue: () => tt('lowerValue'),
  4674. samplingProgrammeDesc: () => t('samplingProgramme'),
  4675. samplingLevelDesc: () => t('samplingLevel'),
  4676. defaultSamplingQuantity: () => tpl('colDefaultSamplingQty'),
  4677. defaultSamplingProportion: () => tpl('colDefaultSamplingRatio'),
  4678. operation: () => tt('process'),
  4679. resourceID: () => tt('machine'),
  4680. manufacturerName: () => tt('supplier'),
  4681. customerName: () => tt('customerName'),
  4682. custom1: () => t('colCustom1'),
  4683. custom2: () => t('colCustom2'),
  4684. custom3: () => t('colCustom3'),
  4685. createBy: () => tm('colCreateBy'),
  4686. createTime: () => tm('colCreateTime'),
  4687. }
  4688. const defectMap = {
  4689. supplierId: () => t('colSupplierId'),
  4690. supplierName: () => t('colSupplierNameCol'),
  4691. defectThreshold: () => t('defectThreshold'),
  4692. recoveryBatchCount: () => t('recoveryBatchCount'),
  4693. currentDefectCount: () => t('currentDefectCount'),
  4694. lastDefectCount: () => t('lastDefectCount'),
  4695. remainingTrackingBatches: () => t('remainingTrackingBatches'),
  4696. lastTriggerTime: () => t('lastTriggerTime'),
  4697. }
  4698. const fileCollectMap = {
  4699. buNo: () => 'BU',
  4700. equipmentNo: () => this.$t('qc.itemPage.deviceCode'),
  4701. equipmentDesc: () => this.$t('qc.itemPage.deviceName'),
  4702. staffAccount: () => t('staffAccount'),
  4703. staffName: () => this.$t('qc.iqcPage.userName'),
  4704. itemNo: () => tt('itemCode'),
  4705. itemDesc: () => tt('itemName'),
  4706. operation: () => tt('process'),
  4707. fileColumnNo: () => t('fileColumnNo'),
  4708. originalColumnName: () => t('originalFileColumnName'),
  4709. remark: () => tt('remark'),
  4710. }
  4711. const labelMap = {
  4712. labelTypeTb: () => t('colLabelCode'),
  4713. labelType: () => t('colLabelType'),
  4714. operationDesc: () => tt('process'),
  4715. defaultFlagDesc: () => t('colDefaultFlag'),
  4716. }
  4717. const sopMap = {
  4718. fileName: () => tt('fileName'),
  4719. createdBy: () => tt('uploadBy'),
  4720. createDate: () => tt('uploadTime'),
  4721. orderRef3: () => tt('inspectionType'),
  4722. }
  4723. const apply = (list, map, tableName) => {
  4724. if (!list) return
  4725. list.forEach((col) => {
  4726. if (tableName) col.tableName = tableName
  4727. const fn = map[col.columnProp]
  4728. if (fn) col.columnLabel = fn()
  4729. })
  4730. }
  4731. apply(this.columnList, mainMap, t('tableNameMain'))
  4732. apply(this.columnDetailList, detailMap, t('tableNameTemplate'))
  4733. apply(this.columnQcSpecList, qcSpecMap, t('tabQcSpec'))
  4734. apply(this.columnDefectTrackingList, defectMap, t('tabDefectTracking'))
  4735. apply(this.columnFileCollectList, fileCollectMap, t('tabFileCollect'))
  4736. apply(this.columnLabelTemplateList, labelMap)
  4737. apply(this.sopColumnList, sopMap)
  4738. this.exportName =
  4739. t('exportPrefix') + this.dayjs().format('YYYYMMDDHHmmss')
  4740. this.exportHeader = [t('exportHeader')]
  4741. },
  4742. // ================= 文件采集配置 =================
  4743. downloadFileCollectorProgram() {
  4744. const fileName = 'QMS_File_Collector.zip'
  4745. this.fileCollectorDownloadLoading = true
  4746. downloadFileCollectorProgramApi(fileName)
  4747. .then(({ data }) => {
  4748. saveAs(data, fileName)
  4749. })
  4750. .catch(() => {
  4751. this.$message.error(this.$t('qc.partAttributePage.downloadFileCollectorFail'))
  4752. })
  4753. .finally(() => {
  4754. this.fileCollectorDownloadLoading = false
  4755. })
  4756. },
  4757. searchFileCollect() {
  4758. this.fileCollectPageIndex = 1
  4759. this.refreshFileCollectList()
  4760. },
  4761. refreshFileCollectList() {
  4762. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  4763. this.fileCollectList = []
  4764. this.fileCollectTotal = 0
  4765. this.editFileCollectBatchVisible = false
  4766. return
  4767. }
  4768. this.editFileCollectBatchVisible = false
  4769. this.fileCollectLoading = true
  4770. const query = this.fileCollectQuery || {}
  4771. qcPartFileCollectSearch({
  4772. site: this.partCurrentRow.site,
  4773. buNo: this.partCurrentRow.buNo,
  4774. partNo: this.partCurrentRow.partNo,
  4775. equipmentNo: (query.equipmentNo || '').trim(),
  4776. equipmentDesc: (query.equipmentDesc || '').trim(),
  4777. itemNo: (query.itemNo || '').trim(),
  4778. page: this.fileCollectPageIndex,
  4779. limit: this.fileCollectPageSize,
  4780. })
  4781. .then(({ data }) => {
  4782. if (data && data.code === 0 && data.page) {
  4783. this.fileCollectList = data.page.list || []
  4784. this.fileCollectTotal = data.page.totalCount || 0
  4785. this.fileCollectPageIndex = data.page.currPage || 1
  4786. this.fileCollectPageSize = data.page.pageSize || 20
  4787. }
  4788. })
  4789. .finally(() => {
  4790. this.fileCollectLoading = false
  4791. })
  4792. },
  4793. fileCollectUploadModal() {
  4794. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  4795. this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate'))
  4796. return
  4797. }
  4798. const currentData = {
  4799. site: this.partCurrentRow.site,
  4800. partNo: this.partCurrentRow.partNo,
  4801. createBy: this.$store.state.user.name,
  4802. }
  4803. this.$nextTick(() => {
  4804. this.$refs.fileCollectUpload.init(currentData)
  4805. })
  4806. },
  4807. fileCollectSizeChange(val) {
  4808. this.fileCollectPageSize = val
  4809. this.fileCollectPageIndex = 1
  4810. this.refreshFileCollectList()
  4811. },
  4812. fileCollectCurrentChange(val) {
  4813. this.fileCollectPageIndex = val
  4814. this.refreshFileCollectList()
  4815. },
  4816. handleFileCollectSelectionChange(val) {
  4817. this.fileCollectSelections = val
  4818. },
  4819. openFileCollectBatchAdd() {
  4820. if (!this.partCurrentRow.partNo) {
  4821. this.$message.warning(
  4822. this.$t('qc.partAttributePage.selectPartForTemplate')
  4823. )
  4824. return
  4825. }
  4826. this.fileCollectBatchAddData = {
  4827. addColumnCount: 1,
  4828. autoIncrementColumn: true,
  4829. startValue: 1,
  4830. equipmentFolderId: null,
  4831. equipmentNo: '',
  4832. equipmentDesc: '',
  4833. staffAccount: '',
  4834. staffName: '',
  4835. operation: '',
  4836. }
  4837. this.fileCollectBatchAddFlag = true
  4838. },
  4839. openFileCollectBatchAddOperationPicker() {
  4840. if (!this.partCurrentRow.partNo) return
  4841. this.openQcSpecLinkedOperationPicker(this.fileCollectBatchAddData)
  4842. },
  4843. openFileCollectEquipmentPicker() {
  4844. if (!this.partCurrentRow.partNo) return
  4845. this.fileCollectEquipmentQuery = {
  4846. page: 1,
  4847. pageCount: 500,
  4848. site: this.partCurrentRow.site,
  4849. buNo: this.partCurrentRow.buNo,
  4850. equipmentNo: '',
  4851. equipmentDesc: '',
  4852. IP: '',
  4853. suffix: '',
  4854. }
  4855. this.fileCollectEquipmentSelections = []
  4856. this.fileCollectEquipmentFlag = true
  4857. this.searchFileCollectEquipment()
  4858. },
  4859. searchFileCollectEquipment() {
  4860. this.fileCollectEquipmentLoading = true
  4861. queryEquipmentFolderLocationList(this.fileCollectEquipmentQuery)
  4862. .then(({ data }) => {
  4863. if (data && data.code === 0) {
  4864. this.fileCollectEquipmentList = data.rows || []
  4865. this.$nextTick(() => {
  4866. if (!this.$refs.fileCollectEquipmentTable) return
  4867. this.$refs.fileCollectEquipmentTable.clearSelection()
  4868. const selectedNo = this.fileCollectBatchAddData.equipmentNo
  4869. if (selectedNo) {
  4870. this.fileCollectEquipmentList.forEach((row) => {
  4871. if (row.equipmentNo === selectedNo) {
  4872. this.$refs.fileCollectEquipmentTable.toggleRowSelection(row, true)
  4873. }
  4874. })
  4875. }
  4876. })
  4877. } else {
  4878. this.fileCollectEquipmentList = []
  4879. }
  4880. })
  4881. .finally(() => {
  4882. this.fileCollectEquipmentLoading = false
  4883. })
  4884. },
  4885. fileCollectEquipmentClickRow(row) {
  4886. this.$refs.fileCollectEquipmentTable.clearSelection()
  4887. this.$refs.fileCollectEquipmentTable.toggleRowSelection(row, true)
  4888. },
  4889. fileCollectEquipmentDblClickRow(row) {
  4890. this.fileCollectEquipmentSelections = [row]
  4891. this.confirmFileCollectEquipment()
  4892. },
  4893. fileCollectEquipmentSelectionChange(val) {
  4894. if (val.length > 1) {
  4895. const last = val[val.length - 1]
  4896. this.$refs.fileCollectEquipmentTable.clearSelection()
  4897. this.$refs.fileCollectEquipmentTable.toggleRowSelection(last, true)
  4898. this.fileCollectEquipmentSelections = [last]
  4899. } else {
  4900. this.fileCollectEquipmentSelections = val
  4901. }
  4902. },
  4903. confirmFileCollectEquipment() {
  4904. if (this.fileCollectEquipmentSelections.length === 0) {
  4905. this.$message.warning(this.$t('qc.partAttributePage.selectEquipment'))
  4906. return
  4907. }
  4908. const row = this.fileCollectEquipmentSelections[0]
  4909. this.fileCollectBatchAddData.equipmentFolderId = row.id
  4910. this.fileCollectBatchAddData.equipmentNo = row.equipmentNo
  4911. this.fileCollectBatchAddData.equipmentDesc = row.equipmentDesc
  4912. this.fileCollectEquipmentFlag = false
  4913. },
  4914. openFileCollectStaffPicker(row) {
  4915. if (!this.partCurrentRow.partNo) return
  4916. this.fileCollectPickerRow = row || null
  4917. this.fileCollectStaffQuery = {
  4918. flag: '2',
  4919. bu: this.partCurrentRow.site + '_' + this.partCurrentRow.buNo,
  4920. adminID: '',
  4921. adminName: '',
  4922. userName: this.$store.state.user.name,
  4923. }
  4924. this.fileCollectStaffSelections = []
  4925. this.fileCollectStaffFlag = true
  4926. this.searchFileCollectStaff()
  4927. },
  4928. searchFileCollectStaff() {
  4929. this.fileCollectStaffLoading = true
  4930. getResponsibleOperatorList(this.fileCollectStaffQuery)
  4931. .then(({ data }) => {
  4932. if (data && data.code === 0) {
  4933. this.fileCollectStaffList = data.rows || []
  4934. this.$nextTick(() => {
  4935. if (!this.$refs.fileCollectStaffTable) return
  4936. const target = this.fileCollectPickerRow || this.fileCollectBatchAddData
  4937. const account = target.staffAccount
  4938. if (account) {
  4939. const match = this.fileCollectStaffList.find((row) => row.adminID === account)
  4940. if (match) {
  4941. this.$refs.fileCollectStaffTable.setCurrentRow(match)
  4942. this.fileCollectStaffSelections = [match]
  4943. }
  4944. }
  4945. })
  4946. } else {
  4947. this.fileCollectStaffList = []
  4948. }
  4949. })
  4950. .finally(() => {
  4951. this.fileCollectStaffLoading = false
  4952. })
  4953. },
  4954. fileCollectStaffClickRow(row) {
  4955. this.fileCollectStaffSelections = [row]
  4956. this.$refs.fileCollectStaffTable.setCurrentRow(row)
  4957. },
  4958. fileCollectStaffDblClickRow(row) {
  4959. this.fileCollectStaffSelections = [row]
  4960. this.confirmFileCollectStaff()
  4961. },
  4962. confirmFileCollectStaff() {
  4963. if (this.fileCollectStaffSelections.length === 0) {
  4964. this.$message.warning(this.$t('qc.entry.selectPersons'))
  4965. return
  4966. }
  4967. const row = this.fileCollectStaffSelections[0]
  4968. const target = this.fileCollectPickerRow || this.fileCollectBatchAddData
  4969. target.staffAccount = row.adminID
  4970. target.staffName = row.adminName
  4971. this.fileCollectStaffFlag = false
  4972. this.fileCollectPickerRow = null
  4973. },
  4974. openFileCollectItemPicker(row) {
  4975. if (!this.partCurrentRow.partNo || !row) return
  4976. this.fileCollectPickerRow = row
  4977. const preferredBuNo = row.buNo || this.partCurrentRow.buNo || ''
  4978. const preferredSite = this.partCurrentRow.site || ''
  4979. // buList.buNo 本身已是 site_bu(如 41_Flexo)
  4980. const preferredKey =
  4981. preferredBuNo.indexOf('_') >= 0
  4982. ? preferredBuNo
  4983. : preferredBuNo
  4984. ? `${preferredSite}_${preferredBuNo}`
  4985. : ''
  4986. const matchedBu =
  4987. (this.buList || []).find((i) => i.buNo === preferredKey) ||
  4988. (this.buList || []).find((i) => this.parseBuNo(i.buNo) === preferredBuNo) ||
  4989. null
  4990. const buKey = matchedBu
  4991. ? matchedBu.buNo
  4992. : preferredKey || (this.buList.length > 0 ? this.buList[0].buNo : '')
  4993. const site = matchedBu
  4994. ? matchedBu.site
  4995. : preferredSite || (this.buList.length > 0 ? this.buList[0].site : '')
  4996. this.fileCollectItemBuKey = buKey
  4997. this.fileCollectItemQuery = {
  4998. site: site,
  4999. buNo: this.parseBuNo(buKey) || preferredBuNo,
  5000. inspectionTypeNo: '105',
  5001. itemNo: '',
  5002. itemDesc: '',
  5003. itemType: 'D',
  5004. userName: this.$store.state.user.name,
  5005. page: 1,
  5006. limit: 500,
  5007. }
  5008. this.fileCollectItemList = []
  5009. this.fileCollectItemSelections = []
  5010. this.fileCollectItemFlag = true
  5011. this.loadFileCollectExcludeItemNos().then(() => {
  5012. this.searchFileCollectItem()
  5013. })
  5014. },
  5015. onFileCollectItemBuChange(val) {
  5016. if (!val) {
  5017. this.fileCollectItemQuery.buNo = ''
  5018. return
  5019. }
  5020. const matched = (this.buList || []).find((i) => i.buNo === val)
  5021. if (matched) {
  5022. this.fileCollectItemQuery.site = matched.site
  5023. this.fileCollectItemQuery.buNo = this.parseBuNo(matched.buNo)
  5024. } else {
  5025. this.fileCollectItemQuery.buNo = this.parseBuNo(val)
  5026. }
  5027. },
  5028. openFileCollectOperationPicker(row) {
  5029. if (!this.editFileCollectBatchVisible || !row) return
  5030. this.openQcSpecLinkedOperationPicker(row)
  5031. },
  5032. clearFileCollectOperation(row) {
  5033. if (!row) return
  5034. row.operation = ''
  5035. },
  5036. loadFileCollectExcludeItemNos() {
  5037. const currentItemNo = ((this.fileCollectPickerRow && this.fileCollectPickerRow.itemNo) || '').trim()
  5038. return qcPartFileCollectSearch({
  5039. site: this.partCurrentRow.site,
  5040. buNo: this.partCurrentRow.buNo,
  5041. partNo: this.partCurrentRow.partNo,
  5042. page: 1,
  5043. limit: 9999,
  5044. }).then(({ data }) => {
  5045. const list = (data && data.code === 0 && data.page && data.page.list) || []
  5046. const itemNos = new Set()
  5047. list.forEach((item) => {
  5048. const no = (item.itemNo || '').trim()
  5049. if (no && no !== currentItemNo) {
  5050. itemNos.add(no)
  5051. }
  5052. })
  5053. ;(this.fileCollectList || []).forEach((item) => {
  5054. if (item === this.fileCollectPickerRow) return
  5055. const no = (item.itemNo || '').trim()
  5056. if (no && no !== currentItemNo) {
  5057. itemNos.add(no)
  5058. }
  5059. })
  5060. this.fileCollectExcludeItemNos = Array.from(itemNos)
  5061. })
  5062. },
  5063. searchFileCollectItem() {
  5064. const inspectionTypeNo = (this.fileCollectItemQuery.inspectionTypeNo || '').trim()
  5065. if (!inspectionTypeNo) {
  5066. this.$message.warning(this.$t('qc.method.selectInspectionType'))
  5067. return
  5068. }
  5069. this.fileCollectItemLoading = true
  5070. qcItemSearch(this.fileCollectItemQuery)
  5071. .then(({ data }) => {
  5072. if (data && data.code === 0 && data.page) {
  5073. const excludeSet = new Set(this.fileCollectExcludeItemNos || [])
  5074. const currentItemNo = ((this.fileCollectPickerRow && this.fileCollectPickerRow.itemNo) || '').trim()
  5075. let list = (data.page.list || []).filter((item) => {
  5076. const itemNo = (item.itemNo || '').trim()
  5077. if (!itemNo) return false
  5078. if (itemNo === currentItemNo) return true
  5079. return !excludeSet.has(itemNo)
  5080. })
  5081. this.fileCollectItemList = list
  5082. this.$nextTick(() => {
  5083. if (!this.$refs.fileCollectItemTable) return
  5084. if (currentItemNo) {
  5085. const match = this.fileCollectItemList.find((row) => row.itemNo === currentItemNo)
  5086. if (match) {
  5087. this.$refs.fileCollectItemTable.setCurrentRow(match)
  5088. this.fileCollectItemSelections = [match]
  5089. }
  5090. }
  5091. })
  5092. } else {
  5093. this.fileCollectItemList = []
  5094. }
  5095. })
  5096. .finally(() => {
  5097. this.fileCollectItemLoading = false
  5098. })
  5099. },
  5100. fileCollectItemClickRow(row) {
  5101. this.fileCollectItemSelections = [row]
  5102. this.$refs.fileCollectItemTable.setCurrentRow(row)
  5103. },
  5104. fileCollectItemDblClickRow(row) {
  5105. this.fileCollectItemSelections = [row]
  5106. this.confirmFileCollectItem()
  5107. },
  5108. confirmFileCollectItem() {
  5109. if (this.fileCollectItemSelections.length === 0) {
  5110. this.$message.warning(this.$t('qc.partAttributePage.selectAvailableItems'))
  5111. return
  5112. }
  5113. const selected = this.fileCollectItemSelections[0]
  5114. if (this.fileCollectPickerRow) {
  5115. this.fileCollectPickerRow.itemNo = selected.itemNo
  5116. this.fileCollectPickerRow.itemDesc = selected.itemDesc || ''
  5117. this.fileCollectPickerRow.buNo = selected.buNo || ''
  5118. }
  5119. this.fileCollectItemFlag = false
  5120. this.fileCollectPickerRow = null
  5121. },
  5122. confirmFileCollectBatchAdd() {
  5123. if (!this.fileCollectBatchAddData.equipmentNo) {
  5124. this.$message.warning(this.$t('qc.partAttributePage.selectEquipment'))
  5125. return
  5126. }
  5127. this.fileCollectBatchAddLoading = true
  5128. qcPartFileCollectBatchAdd({
  5129. site: this.partCurrentRow.site,
  5130. buNo: this.partCurrentRow.buNo,
  5131. partNo: this.partCurrentRow.partNo,
  5132. addColumnCount: this.fileCollectBatchAddData.addColumnCount,
  5133. autoIncrementColumn: this.fileCollectBatchAddData.autoIncrementColumn,
  5134. startValue: this.fileCollectBatchAddData.startValue,
  5135. equipmentFolderId: this.fileCollectBatchAddData.equipmentFolderId,
  5136. equipmentNo: this.fileCollectBatchAddData.equipmentNo,
  5137. equipmentDesc: this.fileCollectBatchAddData.equipmentDesc,
  5138. staffAccount: this.fileCollectBatchAddData.staffAccount,
  5139. staffName: this.fileCollectBatchAddData.staffName,
  5140. operation: this.fileCollectBatchAddData.operation,
  5141. createBy: this.$store.state.user.name,
  5142. })
  5143. .then(({ data }) => {
  5144. if (data && data.code === 0) {
  5145. this.$message.success(this.$t('qc.partAttributePage.addSuccess'))
  5146. this.fileCollectBatchAddFlag = false
  5147. this.refreshFileCollectList()
  5148. } else {
  5149. this.$message.error(data.msg)
  5150. }
  5151. })
  5152. .finally(() => {
  5153. this.fileCollectBatchAddLoading = false
  5154. })
  5155. },
  5156. editFileCollectBatchModel() {
  5157. if (!this.partCurrentRow.partNo) {
  5158. this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate'))
  5159. return
  5160. }
  5161. this.editFileCollectBatchVisible = true
  5162. },
  5163. cancelFileCollectBatchModel() {
  5164. this.refreshFileCollectList()
  5165. },
  5166. lookupFileCollectItem(row) {
  5167. const itemNo = (row.itemNo || '').trim()
  5168. if (!itemNo) {
  5169. row.itemNo = ''
  5170. row.itemDesc = ''
  5171. row.buNo = ''
  5172. return Promise.resolve()
  5173. }
  5174. row.itemNo = itemNo
  5175. return qcItemSearch({
  5176. site: this.partCurrentRow.site,
  5177. userName: this.$store.state.user.name,
  5178. itemNo,
  5179. itemType: 'D',
  5180. buNo: this.partCurrentRow.buNo,
  5181. page: 1,
  5182. limit: 50,
  5183. })
  5184. .then(({ data }) => {
  5185. const list = (data && data.page && data.page.list) || []
  5186. const found = list.find((item) => item.itemNo === itemNo)
  5187. if (found) {
  5188. row.itemNo = found.itemNo
  5189. row.itemDesc = found.itemDesc || ''
  5190. row.buNo = found.buNo || ''
  5191. } else {
  5192. row.itemNo = ''
  5193. row.itemDesc = ''
  5194. row.buNo = ''
  5195. }
  5196. })
  5197. .catch(() => {
  5198. row.itemNo = ''
  5199. row.itemDesc = ''
  5200. row.buNo = ''
  5201. })
  5202. },
  5203. onFileCollectItemNoBlur(row) {
  5204. this.lookupFileCollectItem(row)
  5205. },
  5206. batchFileCollectModel() {
  5207. this.saveFileCollectList()
  5208. },
  5209. saveFileCollectList() {
  5210. if (!this.partCurrentRow.partNo) return
  5211. this.fileCollectSaveLoading = true
  5212. Promise.all(this.fileCollectList.map((row) => this.lookupFileCollectItem(row)))
  5213. .then(() =>
  5214. qcPartFileCollectBatchSave({
  5215. site: this.partCurrentRow.site,
  5216. buNo: this.partCurrentRow.buNo,
  5217. partNo: this.partCurrentRow.partNo,
  5218. updateBy: this.$store.state.user.name,
  5219. rowList: this.fileCollectList,
  5220. })
  5221. )
  5222. .then(({ data }) => {
  5223. if (data && data.code === 0) {
  5224. this.editFileCollectBatchVisible = false
  5225. this.$message.success(this.$t('qc.partAttributePage.batchSaveSuccess'))
  5226. this.refreshFileCollectList()
  5227. } else {
  5228. this.$message.error(data.msg)
  5229. }
  5230. })
  5231. .finally(() => {
  5232. this.fileCollectSaveLoading = false
  5233. })
  5234. },
  5235. batchDeleteFileCollect() {
  5236. if (this.fileCollectSelections.length === 0) {
  5237. this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne'))
  5238. return
  5239. }
  5240. this.$confirm(
  5241. this.$t('qc.partAttributePage.batchDeleteFileCollectCount', {
  5242. count: this.fileCollectSelections.length,
  5243. }),
  5244. this.$t('qc.common.tip'),
  5245. {
  5246. confirmButtonText: this.$t('qc.common.confirm'),
  5247. cancelButtonText: this.$t('qc.common.cancel'),
  5248. type: 'warning',
  5249. }
  5250. ).then(() => {
  5251. this.fileCollectDeleteLoading = true
  5252. qcPartFileCollectBatchDelete({
  5253. site: this.partCurrentRow.site,
  5254. //buNo: this.partCurrentRow.buNo,
  5255. partNo: this.partCurrentRow.partNo,
  5256. idList: this.fileCollectSelections.map((r) => r.id),
  5257. })
  5258. .then(({ data }) => {
  5259. if (data && data.code === 0) {
  5260. this.$message.success(
  5261. this.$t('qc.partAttributePage.batchDeleteSuccess')
  5262. )
  5263. this.$refs.fileCollectTable.clearSelection()
  5264. this.fileCollectSelections = []
  5265. this.refreshFileCollectList()
  5266. } else {
  5267. this.$message.error(data.msg)
  5268. }
  5269. })
  5270. .finally(() => {
  5271. this.fileCollectDeleteLoading = false
  5272. })
  5273. })
  5274. },
  5275. openFileCollectReplace() {
  5276. if (!this.partCurrentRow.partNo) {
  5277. this.$message.warning(
  5278. this.$t('qc.partAttributePage.selectPartForTemplate')
  5279. )
  5280. return
  5281. }
  5282. this.fileCollectReplaceData = { replaceFrom: '', replaceTo: '' }
  5283. this.fileCollectReplaceFlag = true
  5284. },
  5285. confirmFileCollectReplace() {
  5286. const idList =
  5287. this.fileCollectSelections.length > 0
  5288. ? this.fileCollectSelections.map((r) => r.id)
  5289. : null
  5290. this.fileCollectReplaceLoading = true
  5291. qcPartFileCollectReplace({
  5292. site: this.partCurrentRow.site,
  5293. buNo: this.partCurrentRow.buNo,
  5294. partNo: this.partCurrentRow.partNo,
  5295. replaceFrom: this.fileCollectReplaceData.replaceFrom,
  5296. replaceTo: this.fileCollectReplaceData.replaceTo,
  5297. idList: idList,
  5298. updateBy: this.$store.state.user.name,
  5299. })
  5300. .then(({ data }) => {
  5301. if (data && data.code === 0) {
  5302. this.$message.success(this.$t('qc.common.operationSuccess'))
  5303. this.fileCollectReplaceFlag = false
  5304. this.refreshFileCollectList()
  5305. } else {
  5306. this.$message.error(data.msg)
  5307. }
  5308. })
  5309. .finally(() => {
  5310. this.fileCollectReplaceLoading = false
  5311. })
  5312. },
  5313. // ================= 检验标准维护相关方法 =================
  5314. qcSpecUploadModal() {
  5315. let currentData = {
  5316. site: this.partCurrentRow.site,
  5317. buNo: this.partCurrentRow.buNo,
  5318. partNo: this.partCurrentRow.partNo,
  5319. createBy: this.$store.state.user.name,
  5320. }
  5321. this.$nextTick(() => {
  5322. this.$refs.qcSpecUpload.init(currentData)
  5323. })
  5324. },
  5325. openPartSpecBatchUpload() {
  5326. this.$nextTick(() => {
  5327. this.$refs.qcPartSpecBatchUpload.init({
  5328. createBy: this.$store.state.user.name,
  5329. })
  5330. })
  5331. },
  5332. onPartSpecBatchImported() {
  5333. this.refreshQcSpecList()
  5334. },
  5335. openPartFileCollectBatchUpload() {
  5336. this.$nextTick(() => {
  5337. this.$refs.qcPartFileCollectBatchUpload.init({
  5338. createBy: this.$store.state.user.name,
  5339. })
  5340. })
  5341. },
  5342. onPartFileCollectBatchImported() {
  5343. this.refreshFileCollectList()
  5344. },
  5345. refreshQcSpecList(skipSearchPartAttributeDetails = false) {
  5346. if (!this.partCurrentRow || !this.partCurrentRow.partNo) return Promise.resolve()
  5347. if (!skipSearchPartAttributeDetails) {
  5348. this.loadDetailListForQcSpec()
  5349. }
  5350. return qcSpecSearch({
  5351. site: this.partCurrentRow.site,
  5352. partNo: this.partCurrentRow.partNo,
  5353. }).then(({ data }) => {
  5354. if (data && data.code === 0) {
  5355. this.qcSpecList = data.rows || []
  5356. this.assignQcSpecRowKeys(this.qcSpecList)
  5357. this.validateQcSpecFilters()
  5358. this.syncQcSpecCurrentRow()
  5359. }
  5360. })
  5361. },
  5362. resetQcSpecFilters() {
  5363. this.clearQcSpecDimensionFilters()
  5364. this.qcSpecFilterType = this.getDefaultQcSpecFilterType()
  5365. this.resetQcSpecTableSelection()
  5366. },
  5367. clearQcSpecDimensionFilters() {
  5368. this.qcSpecFilterIpqcMethod = ''
  5369. this.qcSpecFilterOperation = ''
  5370. this.qcSpecFilterResource = ''
  5371. this.qcSpecFilterManufacturer = ''
  5372. this.qcSpecFilterCustomer = ''
  5373. },
  5374. getDefaultQcSpecFilterType() {
  5375. const opts = this.qcSpecTypeOptions
  5376. if (!opts.length) return ''
  5377. const iqc = opts.find((item) => String(item.inspectionTypeNo) === '105')
  5378. return iqc ? '105' : String(opts[0].inspectionTypeNo)
  5379. },
  5380. ensureDefaultQcSpecFilterType() {
  5381. const opts = this.options || []
  5382. if (!opts.length) {
  5383. this.qcSpecFilterType = ''
  5384. return
  5385. }
  5386. const current = String(this.qcSpecFilterType || '')
  5387. const exists = opts.some(
  5388. (item) => String(item.inspectionTypeNo) === current
  5389. )
  5390. if (!current || !exists) {
  5391. this.qcSpecFilterType = this.getDefaultQcSpecFilterType()
  5392. }
  5393. },
  5394. resetFileCollectQuery() {
  5395. this.fileCollectQuery = {
  5396. equipmentNo: '',
  5397. equipmentDesc: '',
  5398. itemNo: '',
  5399. }
  5400. this.fileCollectPageIndex = 1
  5401. },
  5402. buildQcSpecFilterOptions(list, getter) {
  5403. const valueSet = new Set()
  5404. ;(list || []).forEach((item) => {
  5405. const value = (getter(item) || '').trim()
  5406. if (value) {
  5407. valueSet.add(value)
  5408. }
  5409. })
  5410. return [...valueSet].sort((a, b) => a.localeCompare(b, 'zh-CN'))
  5411. },
  5412. getQcSpecResourceFilterValue(item) {
  5413. if (!item) return ''
  5414. return String(item.resourceDesc || item.resourceID || '').trim()
  5415. },
  5416. getQcSpecManufacturerFilterValue(item) {
  5417. if (!item) return ''
  5418. return String(item.manufacturerName || item.manufacturerID || '').trim()
  5419. },
  5420. getQcSpecCustomerFilterValue(item) {
  5421. if (!item) return ''
  5422. return String(item.customerName || item.customerID || '').trim()
  5423. },
  5424. validateQcSpecFilters() {
  5425. this.ensureDefaultQcSpecFilterType()
  5426. if (
  5427. this.qcSpecFilterOperation &&
  5428. !this.qcSpecOperationFilterOptions.includes(this.qcSpecFilterOperation)
  5429. ) {
  5430. this.qcSpecFilterOperation = ''
  5431. }
  5432. if (
  5433. this.qcSpecFilterResource &&
  5434. !this.qcSpecResourceFilterOptions.includes(this.qcSpecFilterResource)
  5435. ) {
  5436. this.qcSpecFilterResource = ''
  5437. }
  5438. if (
  5439. this.qcSpecFilterManufacturer &&
  5440. !this.qcSpecManufacturerFilterOptions.includes(this.qcSpecFilterManufacturer)
  5441. ) {
  5442. this.qcSpecFilterManufacturer = ''
  5443. }
  5444. if (
  5445. this.qcSpecFilterCustomer &&
  5446. !this.qcSpecCustomerFilterOptions.includes(this.qcSpecFilterCustomer)
  5447. ) {
  5448. this.qcSpecFilterCustomer = ''
  5449. }
  5450. },
  5451. syncQcSpecCurrentRow() {
  5452. if (!this.qcSpecCurrentRow) return
  5453. const currentItemNo = this.qcSpecCurrentRow.itemNo
  5454. const currentInspectionTypeNo = this.qcSpecCurrentRow.inspectionTypeNo
  5455. const row = this.qcSpecTableList.find(
  5456. (item) =>
  5457. item.itemNo === currentItemNo &&
  5458. item.inspectionTypeNo === currentInspectionTypeNo
  5459. )
  5460. this.qcSpecCurrentRow = row || null
  5461. this.$nextTick(() => {
  5462. if (this.$refs.qcSpecTable) {
  5463. this.$refs.qcSpecTable.setCurrentRow(this.qcSpecCurrentRow)
  5464. }
  5465. })
  5466. },
  5467. onQcSpecIpqcMethodFilterChange() {
  5468. this.resetQcSpecTableSelection()
  5469. },
  5470. onQcSpecOperationFilterChange() {
  5471. this.resetQcSpecTableSelection()
  5472. },
  5473. onQcSpecDimensionFilterChange() {
  5474. this.resetQcSpecTableSelection()
  5475. },
  5476. resetQcSpecTableSelection() {
  5477. this.qcSpecCurrentRow = null
  5478. this.$nextTick(() => {
  5479. if (this.$refs.qcSpecTable) {
  5480. this.$refs.qcSpecTable.setCurrentRow()
  5481. }
  5482. })
  5483. },
  5484. assignQcSpecRowKeys(list) {
  5485. this.qcSpecRowKeyMap = new WeakMap()
  5486. const baseCount = {}
  5487. ;(list || []).forEach((row, index) => {
  5488. const base = [
  5489. row.itemNo || '',
  5490. row.inspectionTypeNo != null ? row.inspectionTypeNo : '',
  5491. row.rowNo != null && row.rowNo !== '' ? row.rowNo : index,
  5492. ].join('_')
  5493. const count = baseCount[base] || 0
  5494. baseCount[base] = count + 1
  5495. const key = count === 0 ? base : `${base}__${count}`
  5496. this.qcSpecRowKeyMap.set(row, key)
  5497. })
  5498. },
  5499. getQcSpecRowKey(row) {
  5500. if (!row) return ''
  5501. if (this.qcSpecRowKeyMap && this.qcSpecRowKeyMap.has(row)) {
  5502. return this.qcSpecRowKeyMap.get(row)
  5503. }
  5504. if (row.rowNo !== null && row.rowNo !== undefined && row.rowNo !== '') {
  5505. return `${row.itemNo}_${row.inspectionTypeNo}_${row.rowNo}`
  5506. }
  5507. return `${row.itemNo}_${row.inspectionTypeNo}`
  5508. },
  5509. qcSpecRowClassName() {
  5510. return this.editQcSpecBatchVisible ? '' : 'qc-spec-row-draggable'
  5511. },
  5512. getQcSpecSortRowNo(row) {
  5513. if (!row || row.rowNo === null || row.rowNo === undefined || row.rowNo === '') {
  5514. return 99
  5515. }
  5516. return Number(row.rowNo)
  5517. },
  5518. sortQcSpecByRowNo(list) {
  5519. return [...list].sort((a, b) => {
  5520. const diff = this.getQcSpecSortRowNo(a) - this.getQcSpecSortRowNo(b)
  5521. if (diff !== 0) return diff
  5522. return (a.itemNo || '').localeCompare(b.itemNo || '')
  5523. })
  5524. },
  5525. getQcSpecSortedSourceList() {
  5526. if (this.qcSpecSortedCacheSource === this.qcSpecList && this.qcSpecSortedCache) {
  5527. return this.qcSpecSortedCache
  5528. }
  5529. const sorted = this.sortQcSpecByRowNo(this.qcSpecList || [])
  5530. this.qcSpecSortedCache = sorted
  5531. this.qcSpecSortedCacheSource = this.qcSpecList
  5532. return sorted
  5533. },
  5534. clearQcSpecSyncTimers() {
  5535. if (this.qcSpecSyncTimer) {
  5536. clearTimeout(this.qcSpecSyncTimer)
  5537. this.qcSpecSyncTimer = null
  5538. }
  5539. },
  5540. scheduleQcSpecTableSync() {
  5541. if (this.qcSpecSyncTimer) {
  5542. clearTimeout(this.qcSpecSyncTimer)
  5543. }
  5544. this.qcSpecSyncTimer = setTimeout(() => {
  5545. this.qcSpecSyncTimer = null
  5546. this.applyQcSpecTableFilter()
  5547. }, 120)
  5548. },
  5549. applyQcSpecTableFilter() {
  5550. if (this.activeTable === 'qcSpec') {
  5551. this.destroyQcSpecSortable()
  5552. }
  5553. let list = this.getQcSpecSortedSourceList()
  5554. const filterType = String(this.qcSpecFilterType || '')
  5555. if (filterType) {
  5556. list = list.filter(
  5557. (item) => String(item.inspectionTypeNo || '') === filterType
  5558. )
  5559. }
  5560. if (filterType === '101' && this.qcSpecFilterIpqcMethod) {
  5561. list = list.filter(
  5562. (item) => item.ipqcInspectionMethod === this.qcSpecFilterIpqcMethod
  5563. )
  5564. }
  5565. if (this.qcSpecFilterShowOperation && this.qcSpecFilterOperation) {
  5566. list = list.filter(
  5567. (item) => (item.operation || '') === this.qcSpecFilterOperation
  5568. )
  5569. }
  5570. if (this.qcSpecFilterShowResource && this.qcSpecFilterResource) {
  5571. list = list.filter(
  5572. (item) => this.getQcSpecResourceFilterValue(item) === this.qcSpecFilterResource
  5573. )
  5574. }
  5575. if (this.qcSpecFilterShowManufacturer && this.qcSpecFilterManufacturer) {
  5576. list = list.filter(
  5577. (item) =>
  5578. this.getQcSpecManufacturerFilterValue(item) === this.qcSpecFilterManufacturer
  5579. )
  5580. }
  5581. if (this.qcSpecFilterShowCustomer && this.qcSpecFilterCustomer) {
  5582. list = list.filter(
  5583. (item) => this.getQcSpecCustomerFilterValue(item) === this.qcSpecFilterCustomer
  5584. )
  5585. }
  5586. this.qcSpecTableList = list.slice()
  5587. if (this.activeTable === 'qcSpec' && !this.editQcSpecBatchVisible) {
  5588. this.$nextTick(() => {
  5589. this.initQcSpecSortable()
  5590. })
  5591. }
  5592. },
  5593. destroyQcSpecSortable() {
  5594. if (this.qcSpecSortable) {
  5595. this.qcSpecSortable.destroy()
  5596. this.qcSpecSortable = null
  5597. }
  5598. },
  5599. initQcSpecSortable() {
  5600. if (this.activeTable !== 'qcSpec' || this.editQcSpecBatchVisible) return
  5601. const table = this.$refs.qcSpecTable
  5602. if (!table || !table.$el) return
  5603. const tbody = table.$el.querySelector('.el-table__body-wrapper tbody')
  5604. if (!tbody || !tbody.children.length) return
  5605. if (this.qcSpecSortable) {
  5606. this.qcSpecSortable.option('disabled', this.editQcSpecBatchVisible)
  5607. return
  5608. }
  5609. this.qcSpecSortable = Sortable.create(tbody, {
  5610. animation: 150,
  5611. ghostClass: 'qc-spec-sortable-ghost',
  5612. draggable: 'tr',
  5613. filter: '.el-button, .el-input, .el-select, input, textarea, button, a, .el-checkbox',
  5614. preventOnFilter: true,
  5615. disabled: this.editQcSpecBatchVisible,
  5616. onEnd: this.handleQcSpecDragEnd,
  5617. })
  5618. },
  5619. buildQcSpecGlobalOrderAfterDrag(reorderedDisplayList) {
  5620. if (!this.qcSpecFilterType) {
  5621. return [...reorderedDisplayList]
  5622. }
  5623. const rowKey = (row) => {
  5624. if (row.rowNo !== null && row.rowNo !== undefined && row.rowNo !== '') {
  5625. return `${row.itemNo}__${row.inspectionTypeNo}__${row.rowNo}`
  5626. }
  5627. return `${row.itemNo}__${row.inspectionTypeNo}`
  5628. }
  5629. const displayKeys = new Set(reorderedDisplayList.map(rowKey))
  5630. const globalSorted = this.sortQcSpecByRowNo(this.qcSpecList)
  5631. const result = []
  5632. let displayIdx = 0
  5633. globalSorted.forEach((row) => {
  5634. if (displayKeys.has(rowKey(row))) {
  5635. result.push(reorderedDisplayList[displayIdx++])
  5636. } else {
  5637. result.push(row)
  5638. }
  5639. })
  5640. return result
  5641. },
  5642. applyQcSpecRowOrder(orderedList) {
  5643. const updates = []
  5644. orderedList.forEach((row, idx) => {
  5645. const newRowNo = idx + 1
  5646. const oldRowNo = row.rowNo
  5647. if (oldRowNo !== newRowNo) {
  5648. updates.push({
  5649. site: row.site,
  5650. buNo: row.buNo,
  5651. partNo: row.partNo,
  5652. itemNo: row.itemNo,
  5653. inspectionTypeNo: row.inspectionTypeNo,
  5654. rowNo: newRowNo,
  5655. oldRowNo: oldRowNo,
  5656. })
  5657. }
  5658. row.rowNo = newRowNo
  5659. })
  5660. this.qcSpecSortedCache = null
  5661. this.qcSpecListSkipSchedule = true
  5662. this.qcSpecList = orderedList
  5663. this.assignQcSpecRowKeys(this.qcSpecList)
  5664. this.qcSpecListSkipSchedule = false
  5665. this.applyQcSpecTableFilter()
  5666. if (updates.length === 0) {
  5667. return
  5668. }
  5669. this.qcSpecDragSaving = true
  5670. batchUpdateQcSpecRowNo({ itemList: updates })
  5671. .then(({ data }) => {
  5672. if (data && data.code === 0) {
  5673. this.$message.success(this.$t('qc.common.operationSuccess'))
  5674. this.syncQcSpecCurrentRow()
  5675. } else {
  5676. this.$message.error((data && data.msg) || this.$t('qc.common.saveFailed'))
  5677. this.refreshQcSpecList(true)
  5678. }
  5679. })
  5680. .catch(() => {
  5681. this.$message.error(this.$t('qc.common.saveFailed'))
  5682. this.refreshQcSpecList(true)
  5683. })
  5684. .finally(() => {
  5685. this.qcSpecDragSaving = false
  5686. })
  5687. },
  5688. handleQcSpecDragEnd(evt) {
  5689. if (this.editQcSpecBatchVisible) return
  5690. const { oldIndex, newIndex } = evt
  5691. if (oldIndex === newIndex) return
  5692. const reorderedDisplayList = [...this.qcSpecTableList]
  5693. const movedItem = reorderedDisplayList.splice(oldIndex, 1)[0]
  5694. reorderedDisplayList.splice(newIndex, 0, movedItem)
  5695. const newGlobalOrder = this.buildQcSpecGlobalOrderAfterDrag(reorderedDisplayList)
  5696. this.applyQcSpecRowOrder(newGlobalOrder)
  5697. },
  5698. qcSpecClickRow(row) {
  5699. this.qcSpecCurrentRow = row
  5700. this.$refs.qcSpecTable.setCurrentRow(row)
  5701. },
  5702. qcSpecSelectionChange(val) {
  5703. this.qcSpecSelections = val || []
  5704. },
  5705. openQcSpecCopyDialog() {
  5706. this.openQcSpecPartTransferDialog('copy')
  5707. },
  5708. openQcSpecUpdateDialog() {
  5709. this.openQcSpecPartTransferDialog('update')
  5710. },
  5711. openQcSpecPartTransferDialog(mode) {
  5712. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  5713. return
  5714. }
  5715. if (!this.qcSpecSelections || this.qcSpecSelections.length === 0) {
  5716. this.$message.warning(
  5717. mode === 'update'
  5718. ? this.$t('qc.partAttributePage.selectQcSpecUpdateRow')
  5719. : this.$t('qc.partAttributePage.selectQcSpecCopyRow')
  5720. )
  5721. return
  5722. }
  5723. this.qcSpecPartTransferMode = mode === 'update' ? 'update' : 'copy'
  5724. this.qcSpecCopySearchData = {
  5725. site: this.partCurrentRow.site,
  5726. buNo: this.partCurrentRow.buNo,
  5727. userName: this.$store.state.user.name,
  5728. partNo: '',
  5729. partDesc: '',
  5730. page: 1,
  5731. limit: this.qcSpecCopyPageSize,
  5732. }
  5733. this.qcSpecCopyPageIndex = 1
  5734. this.qcSpecCopyPartList = []
  5735. this.qcSpecCopyPartSelections = []
  5736. this.qcSpecCopyAddedParts = []
  5737. this.qcSpecCopyDialogFlag = true
  5738. this.$nextTick(() => {
  5739. if (this.$refs.qcSpecCopyPartTable) {
  5740. this.$refs.qcSpecCopyPartTable.clearSelection()
  5741. this.$refs.qcSpecCopyPartTable.doLayout()
  5742. }
  5743. if (this.$refs.qcSpecCopyAddedTable) {
  5744. this.$refs.qcSpecCopyAddedTable.doLayout()
  5745. }
  5746. this.getQcSpecCopyPartList()
  5747. })
  5748. },
  5749. getQcSpecCopyPartRowKey(row) {
  5750. return `${row.site}_${row.buNo}_${row.partNo}`
  5751. },
  5752. isQcSpecCopyPartAdded(row) {
  5753. const rowKey = this.getQcSpecCopyPartRowKey(row)
  5754. return this.qcSpecCopyAddedParts.some((item) => this.getQcSpecCopyPartRowKey(item) === rowKey)
  5755. },
  5756. isQcSpecCopySourcePart(row) {
  5757. return !!(
  5758. this.partCurrentRow &&
  5759. row &&
  5760. row.partNo === this.partCurrentRow.partNo &&
  5761. (!row.site || !this.partCurrentRow.site || row.site === this.partCurrentRow.site)
  5762. )
  5763. },
  5764. isQcSpecCopyPartSelectable(row) {
  5765. return !this.isQcSpecCopyPartAdded(row)
  5766. },
  5767. qcSpecCopyPartClickRow(row) {
  5768. if (!this.isQcSpecCopyPartSelectable(row)) {
  5769. return
  5770. }
  5771. this.$refs.qcSpecCopyPartTable.toggleRowSelection(row)
  5772. },
  5773. qcSpecCopyPartSelectionChange(val) {
  5774. const currentPageKeys = new Set(
  5775. this.qcSpecCopyPartList.map((item) => this.getQcSpecCopyPartRowKey(item))
  5776. )
  5777. const selectedCurrentPageRows = (val || []).filter((item) =>
  5778. currentPageKeys.has(this.getQcSpecCopyPartRowKey(item)) && this.isQcSpecCopyPartSelectable(item)
  5779. )
  5780. const otherPageRows = this.qcSpecCopyPartSelections.filter((item) =>
  5781. !currentPageKeys.has(this.getQcSpecCopyPartRowKey(item)) && this.isQcSpecCopyPartSelectable(item)
  5782. )
  5783. this.qcSpecCopyPartSelections = otherPageRows.concat(selectedCurrentPageRows)
  5784. },
  5785. restoreQcSpecCopyPartSelection() {
  5786. if (!this.$refs.qcSpecCopyPartTable) {
  5787. return
  5788. }
  5789. const selectedKeys = new Set(
  5790. this.qcSpecCopyPartSelections.map((item) => this.getQcSpecCopyPartRowKey(item))
  5791. )
  5792. this.qcSpecCopyPartList.forEach((item) => {
  5793. this.$refs.qcSpecCopyPartTable.toggleRowSelection(
  5794. item,
  5795. selectedKeys.has(this.getQcSpecCopyPartRowKey(item))
  5796. )
  5797. })
  5798. },
  5799. addQcSpecCopySelectedParts() {
  5800. const addedKeys = new Set(
  5801. this.qcSpecCopyAddedParts.map((item) => this.getQcSpecCopyPartRowKey(item))
  5802. )
  5803. const newParts = this.qcSpecCopyPartSelections.filter((item) => {
  5804. const rowKey = this.getQcSpecCopyPartRowKey(item)
  5805. if (addedKeys.has(rowKey)) {
  5806. return false
  5807. }
  5808. addedKeys.add(rowKey)
  5809. return true
  5810. })
  5811. this.qcSpecCopyAddedParts = this.qcSpecCopyAddedParts.concat(newParts)
  5812. this.qcSpecCopyPartSelections = []
  5813. if (this.$refs.qcSpecCopyPartTable) {
  5814. this.$refs.qcSpecCopyPartTable.clearSelection()
  5815. }
  5816. },
  5817. removeQcSpecCopyAddedPart(row) {
  5818. const rowKey = this.getQcSpecCopyPartRowKey(row)
  5819. this.qcSpecCopyAddedParts = this.qcSpecCopyAddedParts.filter(
  5820. (item) => this.getQcSpecCopyPartRowKey(item) !== rowKey
  5821. )
  5822. },
  5823. clearQcSpecCopyAddedParts() {
  5824. this.qcSpecCopyAddedParts = []
  5825. },
  5826. searchQcSpecCopyPartList() {
  5827. this.qcSpecCopyPageIndex = 1
  5828. this.qcSpecCopySearchData.page = 1
  5829. this.getQcSpecCopyPartList()
  5830. },
  5831. getQcSpecCopyPartList() {
  5832. this.qcSpecCopySearchData.page = this.qcSpecCopyPageIndex
  5833. this.qcSpecCopySearchData.limit = this.qcSpecCopyPageSize
  5834. this.qcSpecCopyLoading = true
  5835. qcPartAttributeSearch(this.qcSpecCopySearchData)
  5836. .then(({ data }) => {
  5837. if (data && data.code === 0) {
  5838. this.qcSpecCopyPartList = data.page.list || []
  5839. this.qcSpecCopyPageIndex = data.page.currPage
  5840. this.qcSpecCopyPageSize = data.page.pageSize
  5841. this.qcSpecCopyTotalPage = data.page.totalCount
  5842. this.$nextTick(() => {
  5843. this.restoreQcSpecCopyPartSelection()
  5844. if (this.$refs.qcSpecCopyPartTable) {
  5845. this.$refs.qcSpecCopyPartTable.doLayout()
  5846. }
  5847. if (this.$refs.qcSpecCopyAddedTable) {
  5848. this.$refs.qcSpecCopyAddedTable.doLayout()
  5849. }
  5850. })
  5851. } else {
  5852. this.$message.error(data.msg)
  5853. }
  5854. })
  5855. .finally(() => {
  5856. this.qcSpecCopyLoading = false
  5857. })
  5858. },
  5859. qcSpecCopySizeChange(val) {
  5860. this.qcSpecCopyPageSize = val
  5861. this.qcSpecCopyPageIndex = 1
  5862. this.getQcSpecCopyPartList()
  5863. },
  5864. qcSpecCopyCurrentChange(val) {
  5865. this.qcSpecCopyPageIndex = val
  5866. this.getQcSpecCopyPartList()
  5867. },
  5868. confirmQcSpecPartTransfer() {
  5869. if (!this.qcSpecCopyAddedParts || this.qcSpecCopyAddedParts.length === 0) {
  5870. this.$message.warning(this.$t('qc.partAttributePage.selectQcSpecCopyAddedTarget'))
  5871. return
  5872. }
  5873. const isUpdate = this.qcSpecPartTransferMode === 'update'
  5874. const itemCount = this.qcSpecSelections.length
  5875. const targetCount = this.qcSpecCopyAddedParts.length
  5876. this.$confirm(
  5877. isUpdate
  5878. ? this.$t('qc.partAttributePage.qcSpecUpdateConfirm', { itemCount, targetCount })
  5879. : this.$t('qc.partAttributePage.qcSpecCopyConfirm', { itemCount, targetCount }),
  5880. this.$t('qc.common.tip'),
  5881. {
  5882. confirmButtonText: this.$t('qc.common.confirm'),
  5883. cancelButtonText: this.$t('qc.common.cancel'),
  5884. type: 'warning',
  5885. }
  5886. ).then(() => {
  5887. this.qcSpecCopyConfirmLoading = true
  5888. const payload = {
  5889. site: this.partCurrentRow.site,
  5890. buNo: this.partCurrentRow.buNo,
  5891. partNo: this.partCurrentRow.partNo,
  5892. createBy: this.$store.state.user.name,
  5893. targetPartList: this.qcSpecCopyAddedParts.map((item) => ({
  5894. partNo: item.partNo,
  5895. })),
  5896. itemList: this.qcSpecSelections.map((item) => ({
  5897. itemNo: item.itemNo,
  5898. inspectionTypeNo: item.inspectionTypeNo,
  5899. buNo: item.buNo,
  5900. defaultValue: item.defaultValue,
  5901. maxValue: item.maxValue,
  5902. minValue: item.minValue,
  5903. ipqcInspectionMethod: item.ipqcInspectionMethod,
  5904. samplingLevelNo: item.samplingLevelNo,
  5905. samplingProgrammeNo: item.samplingProgrammeNo,
  5906. operation: item.operation,
  5907. resourceID: item.resourceID,
  5908. manufacturerID: item.manufacturerID,
  5909. defaultSamplingQuantity: item.defaultSamplingQuantity,
  5910. defaultSamplingProportion: item.defaultSamplingProportion,
  5911. customerID: item.customerID,
  5912. })),
  5913. }
  5914. const request = isUpdate ? updateQcSpecToParts(payload) : copyQcSpecToParts(payload)
  5915. request
  5916. .then(({ data }) => {
  5917. if (data && data.code === 0) {
  5918. this.$message.success(
  5919. isUpdate
  5920. ? this.$t('qc.partAttributePage.qcSpecUpdateSuccess')
  5921. : this.$t('qc.partAttributePage.qcSpecCopySuccess')
  5922. )
  5923. this.qcSpecCopyDialogFlag = false
  5924. this.qcSpecSelections = []
  5925. if (this.$refs.qcSpecTable) {
  5926. this.$refs.qcSpecTable.clearSelection()
  5927. }
  5928. this.refreshQcSpecList()
  5929. } else {
  5930. this.$message.error(data.msg)
  5931. }
  5932. })
  5933. .finally(() => {
  5934. this.qcSpecCopyConfirmLoading = false
  5935. })
  5936. }).catch(() => {})
  5937. },
  5938. confirmQcSpecCopy() {
  5939. this.confirmQcSpecPartTransfer()
  5940. },
  5941. loadDetailListForQcSpec() {
  5942. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  5943. this.detailList = []
  5944. return Promise.resolve()
  5945. }
  5946. return searchPartAttributeDetails({
  5947. site: this.partCurrentRow.site,
  5948. buNo: this.partCurrentRow.buNo,
  5949. attributeNo: this.partCurrentRow.partNo,
  5950. attributeType: 'A',
  5951. userName: this.$store.state.user.name,
  5952. }).then(({ data }) => {
  5953. if (data && data.code === 0) {
  5954. this.detailList = data.rows || []
  5955. }
  5956. })
  5957. },
  5958. fillQcSpecFromTemplate(item) {
  5959. const templates = this.detailList || []
  5960. if (!templates.length) {
  5961. return this.normalizeQcSpecSamplingExclusive({ ...item })
  5962. }
  5963. let match = templates.find(
  5964. (t) => t.inspectionTypeNo === item.inspectionTypeNo
  5965. )
  5966. if (!match) {
  5967. match = templates[0]
  5968. }
  5969. const preferItemLevel = this.qcSpecHasValue(item.samplingLevelNo)
  5970. const preferItemProgramme = this.qcSpecHasValue(item.samplingProgrammeNo)
  5971. const preferItemQty = this.qcSpecHasValue(item.defaultSamplingQuantity)
  5972. const preferItemRatio = this.qcSpecHasValue(item.defaultSamplingProportion)
  5973. const filled = {
  5974. ...item,
  5975. ipqcInspectionMethod:
  5976. match.ipqcInspectionMethod || item.ipqcInspectionMethod,
  5977. samplingLevelNo: preferItemLevel
  5978. ? item.samplingLevelNo
  5979. : match.samplingLevelNo,
  5980. samplingLevelDesc: preferItemLevel
  5981. ? item.samplingLevelDesc
  5982. : match.samplingLevelDesc,
  5983. samplingProgrammeNo: preferItemProgramme
  5984. ? item.samplingProgrammeNo
  5985. : match.samplingProgrammeNo,
  5986. samplingProgrammeDesc: preferItemProgramme
  5987. ? item.samplingProgrammeDesc
  5988. : match.samplingProgrammeDesc,
  5989. operation: match.operation,
  5990. resourceID: match.resourceID,
  5991. manufacturerID: match.manufacturerID,
  5992. manufacturerName: match.manufacturerName,
  5993. customerID: match.customerID,
  5994. customerName: match.customerName,
  5995. defaultSamplingQuantity: preferItemQty
  5996. ? item.defaultSamplingQuantity
  5997. : match.defaultSamplingQuantity,
  5998. defaultSamplingProportion: preferItemRatio
  5999. ? item.defaultSamplingProportion
  6000. : match.defaultSamplingProportion,
  6001. }
  6002. return this.normalizeQcSpecSamplingExclusive(filled)
  6003. },
  6004. qcSpecHasValue(val) {
  6005. return val !== null && val !== undefined && String(val).trim() !== ''
  6006. },
  6007. isQcSpecNumberValueType(row) {
  6008. return normalizeQcValueTypeDb(row) === 'N'
  6009. },
  6010. qcSpecHasLevelProgramme(row) {
  6011. if (!row) return false
  6012. return (
  6013. this.qcSpecHasValue(row.samplingLevelNo) ||
  6014. this.qcSpecHasValue(row.samplingLevelDesc) ||
  6015. this.qcSpecHasValue(row.samplingProgrammeNo) ||
  6016. this.qcSpecHasValue(row.samplingProgrammeDesc)
  6017. )
  6018. },
  6019. clearQcSpecSamplingQty(row) {
  6020. row.defaultSamplingQuantity = null
  6021. },
  6022. clearQcSpecSamplingRatio(row) {
  6023. row.defaultSamplingProportion = null
  6024. },
  6025. clearQcSpecLevelProgramme(row) {
  6026. row.samplingLevelNo = ''
  6027. row.samplingLevelDesc = ''
  6028. row.samplingProgrammeNo = ''
  6029. row.samplingProgrammeDesc = ''
  6030. },
  6031. /** 默认抽样数量 / 默认抽样比例 / 检验水平+抽样方案 三者互斥 */
  6032. normalizeQcSpecSamplingExclusive(row) {
  6033. if (!row) return row
  6034. if (this.qcSpecHasLevelProgramme(row)) {
  6035. this.clearQcSpecSamplingQty(row)
  6036. this.clearQcSpecSamplingRatio(row)
  6037. } else if (this.qcSpecHasValue(row.defaultSamplingQuantity)) {
  6038. this.clearQcSpecSamplingRatio(row)
  6039. this.clearQcSpecLevelProgramme(row)
  6040. } else if (this.qcSpecHasValue(row.defaultSamplingProportion)) {
  6041. this.clearQcSpecSamplingQty(row)
  6042. this.clearQcSpecLevelProgramme(row)
  6043. }
  6044. return row
  6045. },
  6046. isQcSpecSamplingContext(row) {
  6047. return (
  6048. !!row &&
  6049. ((this.editQcSpecBatchVisible && this.activeTable === 'qcSpec') ||
  6050. this.qcSpecAddFlag)
  6051. )
  6052. },
  6053. onQcSpecSamplingQtyInput(row) {
  6054. if (!this.isQcSpecSamplingContext(row)) return
  6055. if (this.qcSpecHasValue(row.defaultSamplingQuantity)) {
  6056. this.clearQcSpecSamplingRatio(row)
  6057. this.clearQcSpecLevelProgramme(row)
  6058. }
  6059. },
  6060. onQcSpecSamplingRatioInput(row) {
  6061. if (!this.isQcSpecSamplingContext(row)) return
  6062. if (this.qcSpecHasValue(row.defaultSamplingProportion)) {
  6063. this.clearQcSpecSamplingQty(row)
  6064. this.clearQcSpecLevelProgramme(row)
  6065. }
  6066. },
  6067. applyQcSpecExclusiveByLevelProgramme(row) {
  6068. if (!this.isQcSpecSamplingContext(row)) return
  6069. if (this.qcSpecHasLevelProgramme(row)) {
  6070. this.clearQcSpecSamplingQty(row)
  6071. this.clearQcSpecSamplingRatio(row)
  6072. }
  6073. },
  6074. /** IQC 检验类型编码 */
  6075. isQcSpecIqcType(row) {
  6076. return row && String(row.inspectionTypeNo) === '105'
  6077. },
  6078. qcSpecRowAllowsOperation(row) {
  6079. return !!row && !this.isQcSpecIqcType(row)
  6080. },
  6081. qcSpecRowAllowsResource(row) {
  6082. return this.qcSpecRowAllowsOperation(row)
  6083. },
  6084. qcSpecRowAllowsManufacturer(row) {
  6085. return this.isQcSpecIqcType(row)
  6086. },
  6087. qcSpecRowAllowsCustomer(row) {
  6088. return this.qcSpecRowAllowsOperation(row)
  6089. },
  6090. /** 批量编辑:非 IQC 可选工序 */
  6091. qcSpecCanSelectOperation(row) {
  6092. return this.editQcSpecBatchVisible && this.qcSpecRowAllowsOperation(row)
  6093. },
  6094. /** 批量编辑:非 IQC 可选机台 */
  6095. qcSpecCanSelectResource(row) {
  6096. return this.editQcSpecBatchVisible && this.qcSpecRowAllowsResource(row)
  6097. },
  6098. /** 批量编辑:IQC 可选供应商 */
  6099. qcSpecCanSelectManufacturer(row) {
  6100. return this.editQcSpecBatchVisible && this.qcSpecRowAllowsManufacturer(row)
  6101. },
  6102. /** 批量编辑:非 IQC 可选客户 */
  6103. qcSpecCanSelectCustomer(row) {
  6104. return this.editQcSpecBatchVisible && this.qcSpecRowAllowsCustomer(row)
  6105. },
  6106. /** 机台查询 site:模板新增用 detailData,质检项目用 partCurrentRow */
  6107. resolveResourceSite() {
  6108. return (
  6109. this.detailData.site ||
  6110. (this.partCurrentRow && this.partCurrentRow.site) ||
  6111. this.resourceData.site ||
  6112. ''
  6113. )
  6114. },
  6115. openQcSpecManufacturerPicker(row) {
  6116. if (!this.qcSpecCanSelectManufacturer(row)) return
  6117. this.openQcSpecLinkedManufacturerPicker(row)
  6118. },
  6119. openQcSpecCustomerPicker(row) {
  6120. if (!this.qcSpecCanSelectCustomer(row)) return
  6121. this.openQcSpecLinkedCustomerPicker(row)
  6122. },
  6123. openQcSpecOperationPicker(row) {
  6124. if (!this.qcSpecCanSelectOperation(row)) return
  6125. this.openQcSpecLinkedOperationPicker(row)
  6126. },
  6127. openQcSpecResourcePicker(row) {
  6128. if (!this.qcSpecCanSelectResource(row)) return
  6129. this.openQcSpecLinkedResourcePicker(row)
  6130. },
  6131. addQcSpecModal() {
  6132. const partSite = this.partCurrentRow.site || ''
  6133. const partBuNo = this.partCurrentRow.buNo || ''
  6134. const siteBuList = this.qcSpecAddBuList
  6135. const preferredKey =
  6136. partBuNo.indexOf('_') >= 0
  6137. ? partBuNo
  6138. : partBuNo
  6139. ? `${partSite}_${partBuNo}`
  6140. : ''
  6141. const matchedBu =
  6142. siteBuList.find((i) => i.buNo === preferredKey) ||
  6143. siteBuList.find((i) => this.parseBuNo(i.buNo) === partBuNo) ||
  6144. siteBuList[0] ||
  6145. null
  6146. this.qcSpecSearchData.site = partSite
  6147. this.qcSpecSearchData.buNo = matchedBu ? matchedBu.buNo : ''
  6148. this.qcSpecSearchData.partNo = this.partCurrentRow.partNo
  6149. this.qcSpecSearchData.inspectionTypeNo = ''
  6150. this.qcSpecSearchData.itemNo = ''
  6151. this.qcSpecSearchData.itemDesc = ''
  6152. this.qcSpecItemList1 = []
  6153. this.qcSpecItemList2 = []
  6154. this.qcSpecItemSelections1 = []
  6155. this.qcSpecItemSelections2 = []
  6156. this.qcSpecPendingList = []
  6157. this.qcSpecAddFillDialogFlag = false
  6158. this.resetQcSpecAddApplyData()
  6159. this.loadDetailListForQcSpec().then(() => {
  6160. this.getQcSpecItemList()
  6161. this.qcSpecAddFlag = true
  6162. this.$nextTick(() => {
  6163. if (this.$refs.qcSpecItemTable1) {
  6164. this.$refs.qcSpecItemTable1.doLayout()
  6165. }
  6166. if (this.$refs.qcSpecPendingTable) {
  6167. this.$refs.qcSpecPendingTable.doLayout()
  6168. }
  6169. })
  6170. })
  6171. },
  6172. getQcSpecAddItemKey(row) {
  6173. if (!row) return ''
  6174. return `${row.site || ''}_${row.buNo || ''}_${row.itemNo || ''}_${row.inspectionTypeNo || ''}`
  6175. },
  6176. getQcSpecPendingRowKey(row) {
  6177. if (!row) return ''
  6178. return row._pendingKey || this.getQcSpecAddItemKey(row)
  6179. },
  6180. createQcSpecPendingKey(row) {
  6181. return `${this.getQcSpecAddItemKey(row)}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
  6182. },
  6183. isQcSpecAddItemPending(row) {
  6184. const rowKey = this.getQcSpecAddItemKey(row)
  6185. return this.qcSpecPendingList.some((item) => this.getQcSpecAddItemKey(item) === rowKey)
  6186. },
  6187. getQcSpecAddLockedInspectionType() {
  6188. if (this.qcSpecItemSelections1 && this.qcSpecItemSelections1.length) {
  6189. return this.qcSpecItemSelections1[0].inspectionTypeNo
  6190. }
  6191. return ''
  6192. },
  6193. isSameQcSpecAddInspectionType(row, inspectionTypeNo) {
  6194. return String(row && row.inspectionTypeNo) === String(inspectionTypeNo)
  6195. },
  6196. isQcSpecAddItemSelectable(row) {
  6197. const lockedType = this.getQcSpecAddLockedInspectionType()
  6198. if (!lockedType) return true
  6199. return this.isSameQcSpecAddInspectionType(row, lockedType)
  6200. },
  6201. normalizeQcSpecAddSelection(val) {
  6202. const rows = val || []
  6203. if (rows.length === 0) return []
  6204. const lockedType = rows[0].inspectionTypeNo
  6205. return rows.filter((row) => this.isSameQcSpecAddInspectionType(row, lockedType))
  6206. },
  6207. restoreQcSpecAddSelection(rows) {
  6208. this.qcSpecAddSelecting = true
  6209. this.$nextTick(() => {
  6210. const table = this.$refs.qcSpecItemTable1
  6211. if (table) {
  6212. table.clearSelection()
  6213. rows.forEach((row) => table.toggleRowSelection(row, true))
  6214. }
  6215. this.qcSpecItemSelections1 = rows
  6216. this.$nextTick(() => {
  6217. this.qcSpecAddSelecting = false
  6218. })
  6219. })
  6220. },
  6221. getQcSpecItemList() {
  6222. // 查询始终锁定当前物料 site,防止跨工厂 BU 覆盖条件
  6223. this.qcSpecSearchData.site = (this.partCurrentRow && this.partCurrentRow.site) || ''
  6224. getQcSpecItemList(this.qcSpecSearchData).then(({ data }) => {
  6225. if (data && data.code === 0) {
  6226. this.qcSpecItemList1 = data.rows || []
  6227. }
  6228. })
  6229. },
  6230. qcSpecItemClickRow1(row) {
  6231. if (!this.isQcSpecAddItemSelectable(row)) {
  6232. this.$message.warning(
  6233. this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly')
  6234. )
  6235. return
  6236. }
  6237. this.$refs.qcSpecItemTable1.toggleRowSelection(row)
  6238. },
  6239. qcSpecItemClickRow2(row) {
  6240. this.$refs.qcSpecItemTable2.toggleRowSelection(row)
  6241. },
  6242. qcSpecSelectionItem1(val) {
  6243. if (this.qcSpecAddSelecting) return
  6244. const normalized = this.normalizeQcSpecAddSelection(val)
  6245. if (normalized.length !== (val || []).length) {
  6246. this.$message.warning(
  6247. this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly')
  6248. )
  6249. this.restoreQcSpecAddSelection(normalized)
  6250. return
  6251. }
  6252. this.qcSpecItemSelections1 = normalized
  6253. },
  6254. qcSpecSelectionItem2(val) {
  6255. this.qcSpecItemSelections2 = val
  6256. },
  6257. createEmptyQcSpecAddApplyData() {
  6258. return {
  6259. inspectionTypeNo: '',
  6260. ipqcInspectionMethod: '',
  6261. operation: '',
  6262. resourceID: '',
  6263. resourceDesc: '',
  6264. manufacturerID: '',
  6265. manufacturerName: '',
  6266. customerID: '',
  6267. customerName: '',
  6268. }
  6269. },
  6270. resetQcSpecAddApplyData() {
  6271. this.qcSpecAddApplyData = this.createEmptyQcSpecAddApplyData()
  6272. },
  6273. onQcSpecAddApplyTypeChange() {
  6274. if (!this.qcSpecAddApplyData.inspectionTypeNo) {
  6275. this.qcSpecAddApplyData.ipqcInspectionMethod = ''
  6276. this.qcSpecAddApplyData.operation = ''
  6277. this.qcSpecAddApplyData.resourceID = ''
  6278. this.qcSpecAddApplyData.resourceDesc = ''
  6279. this.qcSpecAddApplyData.manufacturerID = ''
  6280. this.qcSpecAddApplyData.manufacturerName = ''
  6281. this.qcSpecAddApplyData.customerID = ''
  6282. this.qcSpecAddApplyData.customerName = ''
  6283. return
  6284. }
  6285. if (!this.qcSpecAddApplyIsIpqc) {
  6286. this.qcSpecAddApplyData.ipqcInspectionMethod = ''
  6287. }
  6288. if (this.qcSpecAddApplyIsIqc) {
  6289. this.qcSpecAddApplyData.operation = ''
  6290. this.qcSpecAddApplyData.resourceID = ''
  6291. this.qcSpecAddApplyData.resourceDesc = ''
  6292. this.qcSpecAddApplyData.customerID = ''
  6293. this.qcSpecAddApplyData.customerName = ''
  6294. } else {
  6295. this.qcSpecAddApplyData.manufacturerID = ''
  6296. this.qcSpecAddApplyData.manufacturerName = ''
  6297. }
  6298. },
  6299. clearQcSpecAddApplyOperation() {
  6300. this.qcSpecAddApplyData.operation = ''
  6301. this.clearQcSpecAddApplyResource()
  6302. },
  6303. clearQcSpecAddApplyResource() {
  6304. this.qcSpecAddApplyData.resourceID = ''
  6305. this.qcSpecAddApplyData.resourceDesc = ''
  6306. },
  6307. clearQcSpecAddApplyManufacturer() {
  6308. this.qcSpecAddApplyData.manufacturerID = ''
  6309. this.qcSpecAddApplyData.manufacturerName = ''
  6310. },
  6311. clearQcSpecAddApplyCustomer() {
  6312. this.qcSpecAddApplyData.customerID = ''
  6313. this.qcSpecAddApplyData.customerName = ''
  6314. },
  6315. clearQcSpecPendingLinkedField(row, field) {
  6316. if (!row) return
  6317. if (field === 'operation') {
  6318. this.$set(row, 'operation', '')
  6319. this.$set(row, 'resourceID', '')
  6320. this.$set(row, 'resourceDesc', '')
  6321. return
  6322. }
  6323. if (field === 'resource') {
  6324. this.$set(row, 'resourceID', '')
  6325. this.$set(row, 'resourceDesc', '')
  6326. return
  6327. }
  6328. if (field === 'manufacturer') {
  6329. this.$set(row, 'manufacturerID', '')
  6330. this.$set(row, 'manufacturerName', '')
  6331. return
  6332. }
  6333. if (field === 'customer') {
  6334. this.$set(row, 'customerID', '')
  6335. this.$set(row, 'customerName', '')
  6336. }
  6337. },
  6338. openQcSpecAddApplyOperationPicker() {
  6339. if (!this.qcSpecAddApplyCanOperation) return
  6340. this.openQcSpecLinkedOperationPicker(this.qcSpecAddApplyData)
  6341. },
  6342. openQcSpecAddApplyResourcePicker() {
  6343. if (!this.qcSpecAddApplyCanResource) return
  6344. this.openQcSpecLinkedResourcePicker(this.qcSpecAddApplyData)
  6345. },
  6346. openQcSpecAddApplyManufacturerPicker() {
  6347. if (!this.qcSpecAddApplyCanManufacturer) return
  6348. this.openQcSpecLinkedManufacturerPicker(this.qcSpecAddApplyData)
  6349. },
  6350. openQcSpecAddApplyCustomerPicker() {
  6351. if (!this.qcSpecAddApplyCanCustomer) return
  6352. this.openQcSpecLinkedCustomerPicker(this.qcSpecAddApplyData)
  6353. },
  6354. fillQcSpecUnmaintainedFields(row, source) {
  6355. if (!row || !source) return 0
  6356. if (
  6357. source.inspectionTypeNo &&
  6358. String(row.inspectionTypeNo) !== String(source.inspectionTypeNo)
  6359. ) {
  6360. return 0
  6361. }
  6362. let applied = 0
  6363. if (
  6364. String(row.inspectionTypeNo) === '101' &&
  6365. this.qcSpecHasValue(source.ipqcInspectionMethod) &&
  6366. !this.qcSpecHasValue(row.ipqcInspectionMethod)
  6367. ) {
  6368. this.$set(row, 'ipqcInspectionMethod', source.ipqcInspectionMethod)
  6369. applied++
  6370. }
  6371. if (this.qcSpecRowAllowsOperation(row) && this.qcSpecHasValue(source.operation) && !this.qcSpecHasValue(row.operation)) {
  6372. this.$set(row, 'operation', source.operation)
  6373. applied++
  6374. }
  6375. if (
  6376. this.qcSpecRowAllowsResource(row) &&
  6377. this.qcSpecHasValue(source.resourceID) &&
  6378. !this.qcSpecHasValue(row.resourceID)
  6379. ) {
  6380. this.$set(row, 'resourceID', source.resourceID)
  6381. this.$set(row, 'resourceDesc', source.resourceDesc || '')
  6382. applied++
  6383. }
  6384. if (
  6385. this.qcSpecRowAllowsManufacturer(row) &&
  6386. this.qcSpecHasValue(source.manufacturerID) &&
  6387. !this.qcSpecHasValue(row.manufacturerID)
  6388. ) {
  6389. this.$set(row, 'manufacturerID', source.manufacturerID)
  6390. this.$set(row, 'manufacturerName', source.manufacturerName || '')
  6391. applied++
  6392. }
  6393. if (
  6394. this.qcSpecRowAllowsCustomer(row) &&
  6395. this.qcSpecHasValue(source.customerID) &&
  6396. !this.qcSpecHasValue(row.customerID)
  6397. ) {
  6398. this.$set(row, 'customerID', source.customerID)
  6399. this.$set(row, 'customerName', source.customerName || '')
  6400. applied++
  6401. }
  6402. return applied
  6403. },
  6404. applyQcSpecAddFillFields(row, source) {
  6405. if (!row || !source) return
  6406. if (
  6407. source.inspectionTypeNo &&
  6408. String(row.inspectionTypeNo) !== String(source.inspectionTypeNo)
  6409. ) {
  6410. return
  6411. }
  6412. if (
  6413. String(row.inspectionTypeNo) === '101' &&
  6414. this.qcSpecHasValue(source.ipqcInspectionMethod)
  6415. ) {
  6416. this.$set(row, 'ipqcInspectionMethod', source.ipqcInspectionMethod)
  6417. }
  6418. if (this.qcSpecRowAllowsOperation(row) && this.qcSpecHasValue(source.operation)) {
  6419. this.$set(row, 'operation', source.operation)
  6420. }
  6421. if (this.qcSpecRowAllowsResource(row) && this.qcSpecHasValue(source.resourceID)) {
  6422. this.$set(row, 'resourceID', source.resourceID)
  6423. this.$set(row, 'resourceDesc', source.resourceDesc || '')
  6424. }
  6425. if (
  6426. this.qcSpecRowAllowsManufacturer(row) &&
  6427. this.qcSpecHasValue(source.manufacturerID)
  6428. ) {
  6429. this.$set(row, 'manufacturerID', source.manufacturerID)
  6430. this.$set(row, 'manufacturerName', source.manufacturerName || '')
  6431. }
  6432. if (this.qcSpecRowAllowsCustomer(row) && this.qcSpecHasValue(source.customerID)) {
  6433. this.$set(row, 'customerID', source.customerID)
  6434. this.$set(row, 'customerName', source.customerName || '')
  6435. }
  6436. },
  6437. resolveQcSpecAddFillInspectionType() {
  6438. if (this.qcSpecSearchData.inspectionTypeNo) {
  6439. return this.qcSpecSearchData.inspectionTypeNo
  6440. }
  6441. const types = [
  6442. ...new Set(
  6443. (this.qcSpecItemSelections1 || [])
  6444. .map((item) => item.inspectionTypeNo)
  6445. .filter((type) => type !== null && type !== undefined && type !== '')
  6446. ),
  6447. ]
  6448. return types.length === 1 ? types[0] : ''
  6449. },
  6450. openQcSpecAddFillDialog() {
  6451. if (this.qcSpecItemSelections1.length === 0) {
  6452. this.$message.warning(
  6453. this.$t('qc.partAttributePage.selectAvailableItems')
  6454. )
  6455. return
  6456. }
  6457. const normalized = this.normalizeQcSpecAddSelection(this.qcSpecItemSelections1)
  6458. if (normalized.length !== this.qcSpecItemSelections1.length) {
  6459. this.$message.warning(
  6460. this.$t('qc.partAttributePage.qcSpecAddSameInspectionTypeOnly')
  6461. )
  6462. this.restoreQcSpecAddSelection(normalized)
  6463. return
  6464. }
  6465. this.resetQcSpecAddApplyData()
  6466. this.qcSpecAddApplyData.inspectionTypeNo = this.resolveQcSpecAddFillInspectionType()
  6467. this.onQcSpecAddApplyTypeChange()
  6468. this.qcSpecAddFillDialogFlag = true
  6469. },
  6470. confirmQcSpecAddFill() {
  6471. this.addQcSpecItem()
  6472. this.qcSpecAddFillDialogFlag = false
  6473. this.resetQcSpecAddApplyData()
  6474. },
  6475. addQcSpecItem() {
  6476. if (this.qcSpecItemSelections1.length === 0) {
  6477. this.$message.warning(
  6478. this.$t('qc.partAttributePage.selectAvailableItems')
  6479. )
  6480. return
  6481. }
  6482. this.qcSpecItemSelections1.forEach((item) => {
  6483. const filled = this.fillQcSpecFromTemplate({ ...item })
  6484. this.applyQcSpecAddFillFields(filled, this.qcSpecAddApplyData)
  6485. this.$set(filled, '_pendingKey', this.createQcSpecPendingKey(filled))
  6486. this.qcSpecPendingList.push(filled)
  6487. })
  6488. this.qcSpecItemSelections1 = []
  6489. this.$nextTick(() => {
  6490. if (this.$refs.qcSpecItemTable1) {
  6491. this.$refs.qcSpecItemTable1.clearSelection()
  6492. }
  6493. })
  6494. },
  6495. removeQcSpecPendingItem(row) {
  6496. const rowKey = this.getQcSpecPendingRowKey(row)
  6497. this.qcSpecPendingList = this.qcSpecPendingList.filter(
  6498. (item) => this.getQcSpecPendingRowKey(item) !== rowKey
  6499. )
  6500. },
  6501. clearQcSpecPendingList() {
  6502. if (this.qcSpecPendingList.length === 0) return
  6503. this.qcSpecPendingList = []
  6504. },
  6505. confirmQcSpecAdd() {
  6506. if (this.qcSpecPendingList.length === 0) {
  6507. this.$message.warning(this.$t('qc.partAttributePage.qcSpecAddEmptyPending'))
  6508. return
  6509. }
  6510. for (let i = 0; i < this.qcSpecPendingList.length; i++) {
  6511. const item = this.qcSpecPendingList[i]
  6512. this.normalizeQcSpecSamplingExclusive(item)
  6513. if (this.isQcSpecNumberValueType(item)) {
  6514. if (
  6515. !this.qcSpecHasValue(item.maxValue) &&
  6516. !this.qcSpecHasValue(item.minValue)
  6517. ) {
  6518. this.$message.warning(
  6519. this.$t('qc.partAttributePage.qcSpecAddNumberLimitRequired', {
  6520. name: item.itemDesc || item.itemNo,
  6521. })
  6522. )
  6523. return
  6524. }
  6525. if (
  6526. this.qcSpecHasValue(item.maxValue) &&
  6527. this.qcSpecHasValue(item.minValue) &&
  6528. Number(item.maxValue) < Number(item.minValue)
  6529. ) {
  6530. this.$message.warning(
  6531. this.$t('qc.partAttributePage.maxLessThanMin', {
  6532. name: item.itemDesc || item.itemNo,
  6533. })
  6534. )
  6535. return
  6536. }
  6537. }
  6538. const groupCount = [
  6539. this.qcSpecHasLevelProgramme(item),
  6540. this.qcSpecHasValue(item.defaultSamplingQuantity),
  6541. this.qcSpecHasValue(item.defaultSamplingProportion),
  6542. ].filter(Boolean).length
  6543. if (groupCount > 1) {
  6544. this.$message.warning(
  6545. this.$t('qc.partAttributePage.qcSpecSamplingExclusive')
  6546. )
  6547. return
  6548. }
  6549. }
  6550. const payload = {
  6551. site: this.partCurrentRow.site,
  6552. partNo: this.partCurrentRow.partNo,
  6553. createBy: this.$store.state.user.name,
  6554. itemList: this.qcSpecPendingList,
  6555. }
  6556. this.qcSpecAddSaveLoading = true
  6557. // 先按类型维度校验重复(IQC/IPQC/FQC/OQC/SQC),通过后再保存
  6558. qcSpecCheckDuplicate(payload)
  6559. .then(({ data }) => {
  6560. if (!data || data.code !== 0) {
  6561. this.qcSpecAddSaveLoading = false
  6562. if (data && data.msg) {
  6563. this.$message.error(data.msg)
  6564. }
  6565. return Promise.reject(new Error('qcSpecCheckDuplicate failed'))
  6566. }
  6567. return qcSpecSave(payload)
  6568. })
  6569. .then((res) => {
  6570. if (!res) return
  6571. this.qcSpecAddSaveLoading = false
  6572. const { data } = res
  6573. if (data && data.code === 0) {
  6574. this.qcSpecPendingList = []
  6575. this.qcSpecAddFlag = false
  6576. this.$message.success(this.$t('qc.partAttributePage.qcSpecAddSaveSuccess'))
  6577. this.refreshQcSpecList()
  6578. } else if (data && data.msg) {
  6579. this.$message.error(data.msg)
  6580. }
  6581. })
  6582. .catch(() => {
  6583. this.qcSpecAddSaveLoading = false
  6584. })
  6585. },
  6586. beforeCloseQcSpecAddDialog(done) {
  6587. if (!this.qcSpecPendingList.length) {
  6588. done()
  6589. return
  6590. }
  6591. this.$confirm(
  6592. this.$t('qc.partAttributePage.qcSpecAddDiscardPending'),
  6593. this.$t('qc.common.tip'),
  6594. {
  6595. confirmButtonText: this.$t('qc.common.confirm'),
  6596. cancelButtonText: this.$t('qc.common.cancel'),
  6597. type: 'warning',
  6598. }
  6599. )
  6600. .then(() => done())
  6601. .catch(() => {})
  6602. },
  6603. onQcSpecAddDialogClose() {
  6604. this.qcSpecPendingList = []
  6605. this.qcSpecAddFillDialogFlag = false
  6606. this.resetQcSpecAddApplyData()
  6607. this.refreshQcSpecList()
  6608. },
  6609. resetQcSpecBatchFillData() {
  6610. this.qcSpecBatchFillData = {
  6611. buNo: '',
  6612. inspectionTypeNo: '',
  6613. ipqcInspectionMethod: '',
  6614. samplingProgrammeNo: '',
  6615. samplingProgrammeDesc: '',
  6616. samplingLevelNo: '',
  6617. samplingLevelDesc: '',
  6618. defaultSamplingQuantity: null,
  6619. defaultSamplingProportion: null,
  6620. operation: '',
  6621. resourceID: '',
  6622. resourceDesc: '',
  6623. manufacturerID: '',
  6624. manufacturerName: '',
  6625. customerID: '',
  6626. customerName: '',
  6627. }
  6628. },
  6629. openQcSpecBatchFillDialog() {
  6630. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  6631. this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate'))
  6632. return
  6633. }
  6634. this.resetQcSpecBatchFillData()
  6635. if (this.buList.length > 0) {
  6636. this.qcSpecBatchFillData.buNo = this.buList[0].buNo
  6637. }
  6638. if (this.qcSpecFilterType) {
  6639. this.qcSpecBatchFillData.inspectionTypeNo = this.qcSpecFilterType
  6640. }
  6641. if (
  6642. this.qcSpecBatchFillData.inspectionTypeNo === '101' &&
  6643. this.qcSpecFilterIpqcMethod
  6644. ) {
  6645. this.qcSpecBatchFillData.ipqcInspectionMethod = this.qcSpecFilterIpqcMethod
  6646. }
  6647. this.qcSpecBatchFillDialogFlag = true
  6648. },
  6649. onQcSpecBatchFillInspectionTypeChange() {
  6650. if (!this.qcSpecBatchFillTypeIsIpqc) {
  6651. this.qcSpecBatchFillData.ipqcInspectionMethod = ''
  6652. }
  6653. },
  6654. chooseQcSpecBatchFillProgramme() {
  6655. this.openSamplingProgrammePicker(this.qcSpecBatchFillData)
  6656. },
  6657. chooseQcSpecBatchFillLevel() {
  6658. this.openSamplingLevelPicker(this.qcSpecBatchFillData)
  6659. },
  6660. buildSamplingPickerRow(row) {
  6661. if (!row) {
  6662. return null
  6663. }
  6664. return {
  6665. ...row,
  6666. site: row.site || (this.partCurrentRow && this.partCurrentRow.site) || ''
  6667. }
  6668. },
  6669. openSamplingProgrammePicker(row) {
  6670. this.tempProgrammeRow = row
  6671. this.$refs.samplingProgrammePicker.open({
  6672. row: this.buildSamplingPickerRow(row),
  6673. fallbackBuNo: (this.partCurrentRow && this.partCurrentRow.buNo) || '',
  6674. defaultNo: (row && row.samplingProgrammeNo) || ''
  6675. })
  6676. },
  6677. openSamplingLevelPicker(row) {
  6678. this.tempLevelRow = row
  6679. this.$refs.samplingLevelPicker.open({
  6680. row: this.buildSamplingPickerRow(row),
  6681. fallbackBuNo: (this.partCurrentRow && this.partCurrentRow.buNo) || '',
  6682. defaultNo: (row && row.samplingLevelNo) || ''
  6683. })
  6684. },
  6685. onSamplingProgrammeSelect(val) {
  6686. if (!this.tempProgrammeRow) {
  6687. return
  6688. }
  6689. this.tempProgrammeRow.samplingProgrammeNo = val.samplingProgrammeNo
  6690. this.tempProgrammeRow.samplingProgrammeDesc = val.samplingProgrammeDesc
  6691. if (
  6692. this.qcSpecBatchFillDialogFlag &&
  6693. this.tempProgrammeRow === this.qcSpecBatchFillData
  6694. ) {
  6695. this.onQcSpecBatchFillLevelProgrammeChange()
  6696. } else {
  6697. this.applyQcSpecExclusiveByLevelProgramme(this.tempProgrammeRow)
  6698. }
  6699. },
  6700. onSamplingLevelSelect(val) {
  6701. if (!this.tempLevelRow) {
  6702. return
  6703. }
  6704. this.tempLevelRow.samplingLevelNo = val.samplingLevelNo
  6705. this.tempLevelRow.samplingLevelDesc = val.samplingLevelDesc
  6706. if (
  6707. this.qcSpecBatchFillDialogFlag &&
  6708. this.tempLevelRow === this.qcSpecBatchFillData
  6709. ) {
  6710. this.onQcSpecBatchFillLevelProgrammeChange()
  6711. } else {
  6712. this.applyQcSpecExclusiveByLevelProgramme(this.tempLevelRow)
  6713. }
  6714. },
  6715. onQcSpecBatchFillLevelProgrammeChange() {
  6716. if (this.qcSpecHasLevelProgramme(this.qcSpecBatchFillData)) {
  6717. this.clearQcSpecSamplingQty(this.qcSpecBatchFillData)
  6718. this.clearQcSpecSamplingRatio(this.qcSpecBatchFillData)
  6719. }
  6720. },
  6721. onQcSpecBatchFillQtyInput() {
  6722. if (this.qcSpecHasValue(this.qcSpecBatchFillData.defaultSamplingQuantity)) {
  6723. this.clearQcSpecSamplingRatio(this.qcSpecBatchFillData)
  6724. this.clearQcSpecLevelProgramme(this.qcSpecBatchFillData)
  6725. }
  6726. },
  6727. onQcSpecBatchFillRatioInput() {
  6728. if (this.qcSpecHasValue(this.qcSpecBatchFillData.defaultSamplingProportion)) {
  6729. this.clearQcSpecSamplingQty(this.qcSpecBatchFillData)
  6730. this.clearQcSpecLevelProgramme(this.qcSpecBatchFillData)
  6731. }
  6732. },
  6733. openQcSpecLinkedOperationPicker(target) {
  6734. if (!target) return
  6735. this.qcSpecPickerRow = target
  6736. this.operationSelections = []
  6737. this.operationData.site = this.partCurrentRow.site
  6738. this.operationData.operationDesc = target.operation || ''
  6739. this.operationPageIndex = 1
  6740. this.fetchOperationList(true, true)
  6741. },
  6742. openQcSpecLinkedResourcePicker(target) {
  6743. if (!target) return
  6744. this.qcSpecPickerRow = target
  6745. this.resourceSelections = []
  6746. this.resourceData.site = this.resolveResourceSite()
  6747. this.resourceData.resourceId = ''
  6748. this.resourceData.resourceDesc = ''
  6749. getAllResourceList(this.resourceData).then(({ data }) => {
  6750. if (data && data.code === 0) {
  6751. this.resourceList = data.rows || []
  6752. this.resourceModelFlag = true
  6753. this.$nextTick(() => {
  6754. if (!this.$refs.resourceTable) return
  6755. if (target.resourceID) {
  6756. const match = this.resourceList.find(
  6757. (r) => r.resourceId === target.resourceID
  6758. )
  6759. if (match) {
  6760. this.$refs.resourceTable.setCurrentRow(match)
  6761. this.resourceSelections = [match]
  6762. }
  6763. }
  6764. })
  6765. } else {
  6766. this.$message.error(data.msg)
  6767. }
  6768. })
  6769. },
  6770. openQcSpecLinkedManufacturerPicker(target) {
  6771. if (!target) return
  6772. this.qcSpecPickerRow = target
  6773. this.dataListManufacturerSelections = []
  6774. this.manufacturerData.site = this.partCurrentRow.site
  6775. this.manufacturerData.manufacturerID = ''
  6776. this.manufacturerData.manufacturerName = ''
  6777. this.manufacturerPageIndex = 1
  6778. this.fetchManufacturerList(true, false)
  6779. },
  6780. openQcSpecLinkedCustomerPicker(target) {
  6781. if (!target) return
  6782. this.qcSpecPickerRow = target
  6783. this.dataListCustomerSelections = []
  6784. this.customerData.site = this.partCurrentRow.site
  6785. this.customerData.customerID = ''
  6786. this.customerData.customerName = ''
  6787. this.customerPageIndex = 1
  6788. this.fetchCustomerList(true, false)
  6789. },
  6790. openQcSpecBatchFillOperationPicker() {
  6791. this.openQcSpecLinkedOperationPicker(this.qcSpecBatchFillData)
  6792. },
  6793. openQcSpecBatchFillResourcePicker() {
  6794. this.openQcSpecLinkedResourcePicker(this.qcSpecBatchFillData)
  6795. },
  6796. openQcSpecBatchFillManufacturerPicker() {
  6797. this.openQcSpecLinkedManufacturerPicker(this.qcSpecBatchFillData)
  6798. },
  6799. openQcSpecBatchFillCustomerPicker() {
  6800. this.openQcSpecLinkedCustomerPicker(this.qcSpecBatchFillData)
  6801. },
  6802. buildQcSpecBatchFillPayload(overwrite) {
  6803. const d = this.qcSpecBatchFillData
  6804. const payload = {
  6805. site: this.partCurrentRow.site,
  6806. partNo: this.partCurrentRow.partNo,
  6807. buNo: d.buNo,
  6808. inspectionTypeNo: d.inspectionTypeNo,
  6809. overwriteAll: overwrite,
  6810. }
  6811. if (this.qcSpecHasValue(d.samplingProgrammeNo)) {
  6812. payload.samplingProgrammeNo = d.samplingProgrammeNo
  6813. }
  6814. if (this.qcSpecHasValue(d.samplingLevelNo)) {
  6815. payload.samplingLevelNo = d.samplingLevelNo
  6816. }
  6817. if (this.qcSpecHasValue(d.defaultSamplingQuantity)) {
  6818. payload.defaultSamplingQuantity = d.defaultSamplingQuantity
  6819. }
  6820. if (this.qcSpecHasValue(d.defaultSamplingProportion)) {
  6821. payload.defaultSamplingProportion = d.defaultSamplingProportion
  6822. }
  6823. if (this.qcSpecHasValue(d.operation)) {
  6824. payload.operation = d.operation
  6825. }
  6826. if (this.qcSpecHasValue(d.resourceID)) {
  6827. payload.resourceID = d.resourceID
  6828. }
  6829. if (this.qcSpecHasValue(d.manufacturerID)) {
  6830. payload.manufacturerID = d.manufacturerID
  6831. }
  6832. if (this.qcSpecHasValue(d.customerID)) {
  6833. payload.customerID = d.customerID
  6834. }
  6835. if (d.inspectionTypeNo === '101' && this.qcSpecHasValue(d.ipqcInspectionMethod)) {
  6836. payload.ipqcInspectionMethod = d.ipqcInspectionMethod
  6837. }
  6838. return payload
  6839. },
  6840. validateQcSpecBatchFillForm() {
  6841. const d = this.qcSpecBatchFillData
  6842. if (!d.buNo) {
  6843. this.$message.warning(this.$t('qc.common.pleaseSelectBu'))
  6844. return false
  6845. }
  6846. if (!d.inspectionTypeNo) {
  6847. this.$message.warning(this.$t('qc.method.selectInspectionType'))
  6848. return false
  6849. }
  6850. const groupCount = [
  6851. this.qcSpecHasLevelProgramme(d),
  6852. this.qcSpecHasValue(d.defaultSamplingQuantity),
  6853. this.qcSpecHasValue(d.defaultSamplingProportion),
  6854. ].filter(Boolean).length
  6855. if (groupCount > 1) {
  6856. this.$message.warning(
  6857. this.$t('qc.partAttributePage.qcSpecSamplingExclusive')
  6858. )
  6859. return false
  6860. }
  6861. const hasFillField =
  6862. groupCount > 0 ||
  6863. this.qcSpecHasValue(d.operation) ||
  6864. this.qcSpecHasValue(d.resourceID) ||
  6865. this.qcSpecHasValue(d.manufacturerID) ||
  6866. this.qcSpecHasValue(d.customerID) ||
  6867. (d.inspectionTypeNo === '101' && this.qcSpecHasValue(d.ipqcInspectionMethod))
  6868. if (!hasFillField) {
  6869. this.$message.warning(this.$t('qc.partAttributePage.qcSpecBatchFillNoField'))
  6870. return false
  6871. }
  6872. return true
  6873. },
  6874. confirmQcSpecBatchFill(overwrite) {
  6875. if (!this.validateQcSpecBatchFillForm()) return
  6876. this.qcSpecBatchFillLoading = true
  6877. qcSpecBatchFill(this.buildQcSpecBatchFillPayload(overwrite))
  6878. .then(({ data }) => {
  6879. this.qcSpecBatchFillLoading = false
  6880. if (data && data.code === 0) {
  6881. this.qcSpecBatchFillDialogFlag = false
  6882. this.refreshQcSpecList()
  6883. this.$message.success(
  6884. this.$t('qc.partAttributePage.batchSaveSuccess')
  6885. )
  6886. } else {
  6887. this.$message.error(data.msg)
  6888. }
  6889. })
  6890. .catch(() => {
  6891. this.qcSpecBatchFillLoading = false
  6892. })
  6893. },
  6894. openQcSpecSyncDialog() {
  6895. if (!this.partCurrentRow || !this.partCurrentRow.partNo) {
  6896. this.$message.warning(this.$t('qc.partAttributePage.selectPartForTemplate'))
  6897. return
  6898. }
  6899. this.resetQcSpecSyncData()
  6900. if (this.partCurrentRow.buNo) {
  6901. this.qcSpecSyncData.buNo = this.partCurrentRow.buNo
  6902. }
  6903. if (this.qcSpecFilterType) {
  6904. this.qcSpecSyncData.inspectionTypeNo = this.qcSpecFilterType
  6905. }
  6906. if (
  6907. this.qcSpecSyncData.inspectionTypeNo === '101' &&
  6908. this.qcSpecFilterIpqcMethod
  6909. ) {
  6910. this.qcSpecSyncData.ipqcInspectionMethod = this.qcSpecFilterIpqcMethod
  6911. }
  6912. this.qcSpecSyncDialogFlag = true
  6913. },
  6914. resetQcSpecSyncData() {
  6915. this.qcSpecSyncData = {
  6916. buNo: '',
  6917. inspectionTypeNo: '',
  6918. ipqcInspectionMethod: '',
  6919. syncValueType: true,
  6920. syncDefaultValue: true,
  6921. syncMaxValue: true,
  6922. syncMinValue: true,
  6923. syncSamplingPlanLevel: true,
  6924. }
  6925. },
  6926. onQcSpecSyncInspectionTypeChange() {
  6927. if (!this.qcSpecSyncTypeIsIpqc) {
  6928. this.qcSpecSyncData.ipqcInspectionMethod = ''
  6929. }
  6930. },
  6931. hasQcSpecSyncEffectiveField() {
  6932. const d = this.qcSpecSyncData
  6933. return (
  6934. d.syncDefaultValue ||
  6935. d.syncMaxValue ||
  6936. d.syncMinValue ||
  6937. d.syncSamplingPlanLevel
  6938. )
  6939. },
  6940. validateQcSpecSyncForm() {
  6941. const d = this.qcSpecSyncData
  6942. if (!d.buNo) {
  6943. this.$message.warning(this.$t('qc.common.pleaseSelectBu'))
  6944. return false
  6945. }
  6946. if (!d.inspectionTypeNo) {
  6947. this.$message.warning(this.$t('qc.method.selectInspectionType'))
  6948. return false
  6949. }
  6950. if (!this.hasQcSpecSyncEffectiveField()) {
  6951. this.$message.warning(this.$t('qc.partAttributePage.qcSpecSyncNoField'))
  6952. return false
  6953. }
  6954. return true
  6955. },
  6956. buildQcSpecSyncPayload(overwrite) {
  6957. const d = this.qcSpecSyncData
  6958. return {
  6959. site: this.partCurrentRow.site,
  6960. partNo: this.partCurrentRow.partNo,
  6961. buNo: d.buNo,
  6962. inspectionTypeNo: d.inspectionTypeNo,
  6963. ipqcInspectionMethod: d.ipqcInspectionMethod,
  6964. overwriteAll: overwrite,
  6965. syncValueType: d.syncValueType,
  6966. syncDefaultValue: d.syncDefaultValue,
  6967. syncMaxValue: d.syncMaxValue,
  6968. syncMinValue: d.syncMinValue,
  6969. syncSamplingPlanLevel: d.syncSamplingPlanLevel,
  6970. }
  6971. },
  6972. confirmQcSpecSync(overwrite) {
  6973. if (!this.validateQcSpecSyncForm()) return
  6974. this.qcSpecSyncLoading = true
  6975. qcSpecSyncFromItem(this.buildQcSpecSyncPayload(overwrite))
  6976. .then(({ data }) => {
  6977. this.qcSpecSyncLoading = false
  6978. if (data && data.code === 0) {
  6979. this.qcSpecSyncDialogFlag = false
  6980. this.refreshQcSpecList()
  6981. this.$message.success(
  6982. this.$t('qc.partAttributePage.qcSpecDataSyncSuccess', {
  6983. count: data.count != null ? data.count : 0,
  6984. })
  6985. )
  6986. } else {
  6987. this.$message.error(
  6988. (data && data.msg) ||
  6989. this.$t('qc.partAttributePage.qcSpecDataSyncFail')
  6990. )
  6991. }
  6992. })
  6993. .catch(() => {
  6994. this.qcSpecSyncLoading = false
  6995. })
  6996. },
  6997. editQcSpecBatchModel() {
  6998. this.editQcSpecBatchVisible = true
  6999. this.destroyQcSpecSortable()
  7000. },
  7001. cancelQcSpecBatchModel() {
  7002. this.editQcSpecBatchVisible = false
  7003. this.refreshQcSpecList()
  7004. },
  7005. batchQcSpecModel() {
  7006. for (let i = 0; i < this.qcSpecList.length; i++) {
  7007. let item = this.qcSpecList[i]
  7008. this.normalizeQcSpecSamplingExclusive(item)
  7009. const groupCount = [
  7010. this.qcSpecHasLevelProgramme(item),
  7011. this.qcSpecHasValue(item.defaultSamplingQuantity),
  7012. this.qcSpecHasValue(item.defaultSamplingProportion),
  7013. ].filter(Boolean).length
  7014. if (groupCount > 1) {
  7015. this.$message.warning(
  7016. this.$t('qc.partAttributePage.qcSpecSamplingExclusive')
  7017. )
  7018. return
  7019. }
  7020. if (
  7021. item.maxValue !== '' &&
  7022. item.maxValue !== null &&
  7023. item.minValue !== '' &&
  7024. item.minValue !== null
  7025. ) {
  7026. if (Number(item.maxValue) < Number(item.minValue)) {
  7027. this.$message.warning(
  7028. this.$t('qc.partAttributePage.maxLessThanMin', {
  7029. name: item.itemDesc,
  7030. })
  7031. )
  7032. return
  7033. }
  7034. }
  7035. }
  7036. this.batchQcSpecLoading = true
  7037. let inData = {
  7038. site: this.partCurrentRow.site,
  7039. buNo: this.partCurrentRow.buNo,
  7040. partNo: this.partCurrentRow.partNo,
  7041. itemList: this.qcSpecList,
  7042. }
  7043. qcSpecUpdate(inData)
  7044. .then(({ data }) => {
  7045. this.batchQcSpecLoading = false
  7046. if (data && data.code === 0) {
  7047. this.editQcSpecBatchVisible = false
  7048. this.refreshQcSpecList()
  7049. this.$message.success(
  7050. this.$t('qc.partAttributePage.batchSaveSuccess')
  7051. )
  7052. } else {
  7053. this.$message.error(data.msg)
  7054. }
  7055. })
  7056. .catch(() => {
  7057. this.batchQcSpecLoading = false
  7058. })
  7059. },
  7060. getQcSpecWarningBuNo() {
  7061. const specRow = this.qcSpecWarningCurrentRow
  7062. if (specRow && specRow.buNo) {
  7063. return specRow.buNo
  7064. }
  7065. return this.partCurrentRow ? this.partCurrentRow.buNo : ''
  7066. },
  7067. openQcSpecWarningDialog(row) {
  7068. this.qcSpecWarningCurrentRow = row
  7069. this.qcSpecWarningList = []
  7070. this.qcSpecWarningDialogFlag = true
  7071. this.loadQcSpecWarningDictOptions().then(() => {
  7072. this.loadQcSpecWarningList()
  7073. })
  7074. },
  7075. loadQcSpecWarningDictOptions() {
  7076. const site = this.partCurrentRow
  7077. ? this.partCurrentRow.site
  7078. : this.modalData
  7079. ? this.modalData.site
  7080. : ''
  7081. return getDictDataByTypes({
  7082. site: site || '',
  7083. dictTypes: [
  7084. 'qc_spec_warning_level',
  7085. 'qc_spec_trigger_mode',
  7086. 'qc_spec_compare_logic',
  7087. ],
  7088. })
  7089. .then(({ data }) => {
  7090. if (data && data.code === 0) {
  7091. const dictMap = data.dictMap || {}
  7092. this.qcSpecWarningDictOptions.warningLevel =
  7093. dictMap.qc_spec_warning_level || []
  7094. this.qcSpecWarningDictOptions.triggerMode =
  7095. dictMap.qc_spec_trigger_mode || []
  7096. this.qcSpecWarningDictOptions.compareLogic =
  7097. dictMap.qc_spec_compare_logic || []
  7098. }
  7099. })
  7100. .catch(() => {})
  7101. },
  7102. normalizeQcSpecWarningRow(row) {
  7103. row.warningLevel = this.mapDictValue(
  7104. row.warningLevel,
  7105. this.qcSpecWarningDictOptions.warningLevel
  7106. )
  7107. row.triggerMode = this.mapDictValue(
  7108. row.triggerMode,
  7109. this.qcSpecWarningDictOptions.triggerMode
  7110. )
  7111. row.compareLogic = this.mapDictValue(
  7112. row.compareLogic,
  7113. this.qcSpecWarningDictOptions.compareLogic
  7114. )
  7115. },
  7116. mapDictValue(val, options) {
  7117. if (!val || !options || !options.length) return val
  7118. if (options.some((item) => item.dictValue === val)) return val
  7119. const found = options.find((item) => item.dictLabel === val)
  7120. return found ? found.dictValue : val
  7121. },
  7122. loadQcSpecWarningList() {
  7123. if (!this.qcSpecWarningCurrentRow || !this.partCurrentRow) return
  7124. this.qcSpecWarningLoading = true
  7125. getQcSpecWarningList({
  7126. site: this.partCurrentRow.site,
  7127. buNo: this.getQcSpecWarningBuNo(),
  7128. partNo: this.partCurrentRow.partNo,
  7129. itemNo: this.qcSpecWarningCurrentRow.itemNo,
  7130. inspectionTypeNo: this.qcSpecWarningCurrentRow.inspectionTypeNo,
  7131. })
  7132. .then(({ data }) => {
  7133. if (data && data.code === 0) {
  7134. this.qcSpecWarningList = (data.rows || []).map((item) => {
  7135. this.normalizeQcSpecWarningRow(item)
  7136. this.updateQcSpecWarningDesc(item)
  7137. return item
  7138. })
  7139. } else {
  7140. this.$message.error(data.msg || this.$t('qc.common.queryFailed'))
  7141. }
  7142. this.qcSpecWarningLoading = false
  7143. })
  7144. .catch(() => {
  7145. this.qcSpecWarningLoading = false
  7146. })
  7147. },
  7148. addQcSpecWarningRow() {
  7149. const row = {
  7150. warningLevel: '',
  7151. colorCode: '',
  7152. triggerMode: '',
  7153. compareLogic: '',
  7154. thresholdValue: undefined,
  7155. warningDesc: '',
  7156. }
  7157. this.qcSpecWarningList.push(row)
  7158. },
  7159. removeQcSpecWarningRow(index) {
  7160. this.qcSpecWarningList.splice(index, 1)
  7161. },
  7162. updateQcSpecWarningDesc(row) {
  7163. row.warningDesc = this.buildQcSpecWarningDesc(row)
  7164. },
  7165. buildQcSpecWarningDesc(row) {
  7166. if (!row || !row.compareLogic) return ''
  7167. const threshold = row.thresholdValue
  7168. if (threshold === '' || threshold === null || threshold === undefined)
  7169. return ''
  7170. const logic = row.compareLogic
  7171. let op = ''
  7172. let limitType = ''
  7173. let sign = ''
  7174. if (logic === 'upper_gt') {
  7175. op = '>'
  7176. limitType = '上限'
  7177. sign = '+'
  7178. } else if (logic === 'lower_lt') {
  7179. op = '<'
  7180. limitType = '下限'
  7181. sign = '-'
  7182. } else {
  7183. op =
  7184. logic.indexOf('大于') >= 0
  7185. ? '>'
  7186. : logic.indexOf('小于') >= 0
  7187. ? '<'
  7188. : ''
  7189. limitType =
  7190. logic.indexOf('上限') >= 0
  7191. ? '上限'
  7192. : logic.indexOf('下限') >= 0
  7193. ? '下限'
  7194. : ''
  7195. sign =
  7196. logic.indexOf('上限') >= 0
  7197. ? '+'
  7198. : logic.indexOf('下限') >= 0
  7199. ? '-'
  7200. : ''
  7201. }
  7202. const unit =
  7203. row.triggerMode === 'ratio' ||
  7204. (row.triggerMode && row.triggerMode.indexOf('比例') >= 0)
  7205. ? '%'
  7206. : ''
  7207. if (!op || !limitType) return ''
  7208. return `当实测值 ${op} (公差${limitType} ${sign} ${threshold}${unit}) 时预警`
  7209. },
  7210. saveQcSpecWarningList() {
  7211. if (!this.qcSpecWarningCurrentRow || !this.partCurrentRow) return
  7212. for (let i = 0; i < this.qcSpecWarningList.length; i++) {
  7213. const item = this.qcSpecWarningList[i]
  7214. this.updateQcSpecWarningDesc(item)
  7215. if (
  7216. !item.warningLevel ||
  7217. !item.colorCode ||
  7218. !item.triggerMode ||
  7219. !item.compareLogic ||
  7220. item.thresholdValue === '' ||
  7221. item.thresholdValue === null ||
  7222. item.thresholdValue === undefined
  7223. ) {
  7224. this.$message.warning(
  7225. this.$t('qc.partAttributePage.qcSpecWarningRowRequired', {
  7226. row: i + 1,
  7227. })
  7228. )
  7229. return
  7230. }
  7231. }
  7232. this.qcSpecWarningSaveLoading = true
  7233. saveQcSpecWarningList({
  7234. site: this.partCurrentRow.site,
  7235. buNo: this.getQcSpecWarningBuNo(),
  7236. partNo: this.partCurrentRow.partNo,
  7237. itemNo: this.qcSpecWarningCurrentRow.itemNo,
  7238. inspectionTypeNo: this.qcSpecWarningCurrentRow.inspectionTypeNo,
  7239. createBy: this.$store.state.user.name,
  7240. warningList: this.qcSpecWarningList,
  7241. })
  7242. .then(({ data }) => {
  7243. this.qcSpecWarningSaveLoading = false
  7244. if (data && data.code === 0) {
  7245. this.$message.success(this.$t('qc.common.saveSuccess'))
  7246. this.loadQcSpecWarningList()
  7247. } else {
  7248. this.$message.error(data.msg || this.$t('qc.common.saveFailed'))
  7249. }
  7250. })
  7251. .catch(() => {
  7252. this.qcSpecWarningSaveLoading = false
  7253. })
  7254. },
  7255. deleteQcSpec(row) {
  7256. this.$confirm(
  7257. this.$t('qc.partAttributePage.deleteQcSpecConfirm'),
  7258. this.$t('qc.common.tip'),
  7259. {
  7260. confirmButtonText: this.$t('qc.common.confirm'),
  7261. cancelButtonText: this.$t('qc.common.cancel'),
  7262. type: 'warning',
  7263. }
  7264. ).then(() => {
  7265. qcSpecDelete({
  7266. site: this.partCurrentRow.site,
  7267. buNo: row.buNo,
  7268. partNo: this.partCurrentRow.partNo,
  7269. itemNo: row.itemNo,
  7270. inspectionTypeNo: row.inspectionTypeNo,
  7271. rowNo: row.rowNo,
  7272. }).then(({ data }) => {
  7273. if (data && data.code === 0) {
  7274. this.refreshQcSpecList()
  7275. this.$message.success(this.$t('qc.common.deleteSuccess'))
  7276. } else {
  7277. this.$message.error(data.msg)
  7278. }
  7279. })
  7280. })
  7281. },
  7282. batchDeleteQcSpec() {
  7283. if (!this.qcSpecSelections || this.qcSpecSelections.length === 0) {
  7284. this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne'))
  7285. return
  7286. }
  7287. this.$confirm(
  7288. this.$t('qc.partAttributePage.batchDeleteQcSpecCount', {
  7289. count: this.qcSpecSelections.length,
  7290. }),
  7291. this.$t('qc.common.tip'),
  7292. {
  7293. confirmButtonText: this.$t('qc.common.confirm'),
  7294. cancelButtonText: this.$t('qc.common.cancel'),
  7295. type: 'warning',
  7296. }
  7297. ).then(() => {
  7298. this.qcSpecDeleteLoading = true
  7299. const deletePromises = this.qcSpecSelections.map((row) => {
  7300. return qcSpecDelete({
  7301. site: this.partCurrentRow.site,
  7302. buNo: row.buNo,
  7303. partNo: this.partCurrentRow.partNo,
  7304. itemNo: row.itemNo,
  7305. inspectionTypeNo: row.inspectionTypeNo,
  7306. rowNo: row.rowNo,
  7307. })
  7308. })
  7309. Promise.all(deletePromises)
  7310. .then((results) => {
  7311. const allSuccess = results.every(
  7312. ({ data }) => data && data.code === 0
  7313. )
  7314. if (allSuccess) {
  7315. this.$message.success(
  7316. this.$t('qc.partAttributePage.batchDeleteSuccess')
  7317. )
  7318. } else {
  7319. this.$message.warning(
  7320. this.$t('qc.partAttributePage.partialDeleteFail')
  7321. )
  7322. }
  7323. if (this.$refs.qcSpecTable) {
  7324. this.$refs.qcSpecTable.clearSelection()
  7325. }
  7326. this.qcSpecSelections = []
  7327. this.refreshQcSpecList()
  7328. })
  7329. .catch(() => {
  7330. this.$message.error(this.$t('qc.partAttributePage.batchDeleteFail'))
  7331. this.refreshQcSpecList()
  7332. })
  7333. .finally(() => {
  7334. this.qcSpecDeleteLoading = false
  7335. })
  7336. })
  7337. },
  7338. // ================= 巡检特殊配置相关方法 =================
  7339. // 打开巡检特殊配置对话框
  7340. openPatrolConfigDialog() {
  7341. this.patrolConfigDialogFlag = true
  7342. this.getPatrolConfigList()
  7343. this.loadOperationDescList()
  7344. },
  7345. // 获取工序列表
  7346. loadOperationDescList() {
  7347. const params = {
  7348. site: this.partCurrentRow.site || this.modalData.site,
  7349. }
  7350. getAllOperationDescList(params).then(({ data }) => {
  7351. if (data && data.code === 0) {
  7352. this.operationDescList = data.rows || []
  7353. }
  7354. })
  7355. },
  7356. // 获取巡检特殊配置列表
  7357. getPatrolConfigList() {
  7358. this.patrolConfigLoading = true
  7359. const params = {
  7360. site: this.modalData.site,
  7361. buNo: this.modalData.buNo,
  7362. partNo: this.modalData.partNo,
  7363. }
  7364. getPatrolConfigList(params)
  7365. .then(({ data }) => {
  7366. if (data && data.code === 0) {
  7367. this.patrolConfigList = data.rows || []
  7368. } else {
  7369. this.$message.error(
  7370. data.msg || this.$t('qc.common.patrolConfigFail')
  7371. )
  7372. }
  7373. this.patrolConfigLoading = false
  7374. })
  7375. .catch(() => {
  7376. this.patrolConfigLoading = false
  7377. })
  7378. },
  7379. // 巡检配置选择变化
  7380. patrolConfigSelectionChange(selections) {
  7381. this.patrolConfigSelections = selections
  7382. },
  7383. // 巡检配置行点击
  7384. patrolConfigRowClick(row) {
  7385. // 可以在这里添加行点击逻辑
  7386. },
  7387. // 新增巡检配置
  7388. addPatrolConfig() {
  7389. this.patrolConfigList.push({
  7390. site: this.modalData.site,
  7391. buNo: this.modalData.buNo,
  7392. partNo: this.modalData.partNo,
  7393. operationDesc: '',
  7394. firstInspectionDuration: 0,
  7395. nextInspectionDuration: 0,
  7396. totalInspectionDuration: 0,
  7397. defaultFlag: 'N',
  7398. isNew: true,
  7399. })
  7400. },
  7401. // 保存单行巡检配置
  7402. savePatrolConfigRow(row) {
  7403. if (!row.operationDesc) {
  7404. this.$message.warning(this.$t('qc.partAttributePage.enterOperation'))
  7405. return
  7406. }
  7407. const params = {
  7408. site: row.site,
  7409. buNo: row.buNo,
  7410. partNo: row.partNo,
  7411. operationDesc: row.operationDesc,
  7412. firstInspectionDuration: row.firstInspectionDuration,
  7413. nextInspectionDuration: row.nextInspectionDuration,
  7414. totalInspectionDuration: row.totalInspectionDuration,
  7415. defaultFlag: row.defaultFlag,
  7416. }
  7417. if (row.isNew) {
  7418. savePatrolConfig(params).then(({ data }) => {
  7419. if (data && data.code === 0) {
  7420. this.$message.success(this.$t('qc.common.saveSuccess'))
  7421. this.getPatrolConfigList()
  7422. } else {
  7423. this.$message.error(data.msg || this.$t('qc.common.saveFailed'))
  7424. }
  7425. })
  7426. } else {
  7427. updatePatrolConfig(params).then(({ data }) => {
  7428. if (data && data.code === 0) {
  7429. this.$message.success(this.$t('qc.partAttributePage.updateSuccess'))
  7430. this.getPatrolConfigList()
  7431. } else {
  7432. this.$message.error(
  7433. data.msg || this.$t('qc.partAttributePage.updateFail')
  7434. )
  7435. }
  7436. })
  7437. }
  7438. },
  7439. // 删除巡检配置
  7440. deletePatrolConfig() {
  7441. if (this.patrolConfigSelections.length === 0) {
  7442. this.$message.warning(
  7443. this.$t('qc.partAttributePage.selectDataToDeletePatrol')
  7444. )
  7445. return
  7446. }
  7447. this.$confirm(
  7448. this.$t('qc.partAttributePage.confirmDeletePatrolConfig'),
  7449. this.$t('qc.common.tip'),
  7450. {
  7451. confirmButtonText: this.$t('qc.common.confirm'),
  7452. cancelButtonText: this.$t('qc.common.cancel'),
  7453. type: 'warning',
  7454. }
  7455. )
  7456. .then(() => {
  7457. const deleteList = this.patrolConfigSelections.filter(
  7458. (item) => !item.isNew
  7459. )
  7460. if (deleteList.length === 0) {
  7461. // 只有新增的未保存数据,直接从列表中移除
  7462. this.patrolConfigSelections.forEach((item) => {
  7463. const index = this.patrolConfigList.indexOf(item)
  7464. if (index > -1) {
  7465. this.patrolConfigList.splice(index, 1)
  7466. }
  7467. })
  7468. this.patrolConfigSelections = []
  7469. return
  7470. }
  7471. const params = {
  7472. list: deleteList.map((item) => ({
  7473. site: item.site,
  7474. buNo: item.buNo,
  7475. partNo: item.partNo,
  7476. operationDesc: item.operationDesc,
  7477. })),
  7478. }
  7479. deletePatrolConfig(params).then(({ data }) => {
  7480. if (data && data.code === 0) {
  7481. this.$message.success(this.$t('qc.common.deleteSuccess'))
  7482. this.getPatrolConfigList()
  7483. } else {
  7484. this.$message.error(data.msg || this.$t('qc.common.deleteFailed'))
  7485. }
  7486. })
  7487. })
  7488. .catch(() => {})
  7489. },
  7490. // 处理默认标识变化
  7491. handleDefaultFlagChange(row) {
  7492. if (row.defaultFlag === 'Y') {
  7493. // 如果设置为默认,将其他行的默认标识设为N
  7494. this.patrolConfigList.forEach((item) => {
  7495. if (item !== row) {
  7496. item.defaultFlag = 'N'
  7497. }
  7498. })
  7499. }
  7500. },
  7501. // 批量保存巡检配置
  7502. batchSavePatrolConfig() {
  7503. if (this.patrolConfigList.length === 0) {
  7504. this.$message.warning(
  7505. this.$t('qc.partAttributePage.noPatrolDataToSave')
  7506. )
  7507. return
  7508. }
  7509. // 验证数据
  7510. for (let i = 0; i < this.patrolConfigList.length; i++) {
  7511. const item = this.patrolConfigList[i]
  7512. if (!item.operationDesc) {
  7513. this.$message.warning(
  7514. this.$t('qc.partAttributePage.rowOperationRequired', { row: i + 1 })
  7515. )
  7516. return
  7517. }
  7518. }
  7519. this.patrolConfigSaveLoading = true
  7520. let successCount = 0
  7521. let errorCount = 0
  7522. const promises = this.patrolConfigList.map((row) => {
  7523. const params = {
  7524. site: row.site,
  7525. buNo: row.buNo,
  7526. partNo: row.partNo,
  7527. operationDesc: row.operationDesc,
  7528. firstInspectionDuration: row.firstInspectionDuration,
  7529. nextInspectionDuration: row.nextInspectionDuration,
  7530. totalInspectionDuration: row.totalInspectionDuration,
  7531. defaultFlag: row.defaultFlag || 'N',
  7532. }
  7533. if (row.isNew) {
  7534. return savePatrolConfig(params)
  7535. .then(({ data }) => {
  7536. if (data && data.code === 0) {
  7537. successCount++
  7538. row.isNew = false
  7539. } else {
  7540. errorCount++
  7541. }
  7542. })
  7543. .catch(() => {
  7544. errorCount++
  7545. })
  7546. } else {
  7547. return updatePatrolConfig(params)
  7548. .then(({ data }) => {
  7549. if (data && data.code === 0) {
  7550. successCount++
  7551. } else {
  7552. errorCount++
  7553. }
  7554. })
  7555. .catch(() => {
  7556. errorCount++
  7557. })
  7558. }
  7559. })
  7560. Promise.all(promises).then(() => {
  7561. this.patrolConfigSaveLoading = false
  7562. if (errorCount === 0) {
  7563. this.$message.success(this.$t('qc.common.saveSuccess'))
  7564. } else {
  7565. this.$message.warning(
  7566. this.$t('qc.partAttributePage.savePartialResult', {
  7567. success: successCount,
  7568. fail: errorCount,
  7569. })
  7570. )
  7571. }
  7572. this.getPatrolConfigList()
  7573. })
  7574. },
  7575. // 打开巡检配置导入对话框
  7576. openPatrolConfigImport() {
  7577. const params = {
  7578. site: this.modalData.site,
  7579. buNo: this.modalData.buNo,
  7580. partNo: this.modalData.partNo,
  7581. }
  7582. this.$refs.patrolConfigUpload.init(params)
  7583. },
  7584. // 获取用户的bu
  7585. getSiteAndBuByUserName() {
  7586. let tempData = {
  7587. username: this.$store.state.user.name,
  7588. }
  7589. getSiteAndBuByUserName(tempData).then(({ data }) => {
  7590. if (data.code === 0) {
  7591. this.userBuList = data.rows
  7592. }
  7593. })
  7594. },
  7595. getSiteAndBuByUserName2() {
  7596. let tempData = {
  7597. username: this.$store.state.user.name,
  7598. }
  7599. getSiteAndBuByUserName2(tempData).then(({ data }) => {
  7600. if (data.code === 0) {
  7601. this.buList = data.rows
  7602. }
  7603. })
  7604. },
  7605. umSearch() {
  7606. umSearch({ active: 'Y' }).then(({ data }) => {
  7607. if (data && data.code === 0) {
  7608. this.umList = data.rows || []
  7609. }
  7610. })
  7611. },
  7612. // 查询检验类型
  7613. inspectionTypeSearch() {
  7614. let tempData = {
  7615. site: this.$store.state.user.site,
  7616. }
  7617. inspectionTypeSearch(tempData).then(({ data }) => {
  7618. if (data.code === 0) {
  7619. this.options = data.rows
  7620. this.ensureDefaultQcSpecFilterType()
  7621. }
  7622. })
  7623. },
  7624. chooseLevel(row) {
  7625. this.openSamplingLevelPicker(row)
  7626. },
  7627. chooseProgrammeRow(row) {
  7628. this.openSamplingProgrammePicker(row)
  7629. },
  7630. // 获取数据列表
  7631. getDataList() {
  7632. this.searchData.limit = this.pageSize
  7633. this.searchData.page = this.pageIndex
  7634. this.searchLoading = true
  7635. qcPartAttributeSearch(this.searchData)
  7636. .then(({ data }) => {
  7637. if (data.code === 0) {
  7638. this.dataList = data.page.list
  7639. this.pageIndex = data.page.currPage
  7640. this.pageSize = data.page.pageSize
  7641. this.totalPage = data.page.totalCount
  7642. // 判断是否全部存在数据
  7643. if (this.dataList.length > 0) {
  7644. // 设置选中行
  7645. this.$refs.partTable.setCurrentRow(this.dataList[0])
  7646. this.partClickRow(this.dataList[0])
  7647. } else {
  7648. this.partCurrentRow = {}
  7649. this.refreshCurrentTabTable()
  7650. }
  7651. }
  7652. })
  7653. .finally(() => {
  7654. this.searchLoading = false
  7655. })
  7656. },
  7657. // 每页数
  7658. sizeChangeHandle(val) {
  7659. this.pageSize = val
  7660. this.pageIndex = 1
  7661. this.getDataList()
  7662. },
  7663. // 当前页
  7664. currentChangeHandle(val) {
  7665. this.pageIndex = val
  7666. this.getDataList()
  7667. },
  7668. updateModal(row) {
  7669. this.modalData = {
  7670. site: row.site,
  7671. bu: row.site + '_' + row.buNo,
  7672. buNo: row.buNo,
  7673. partNo: row.partNo,
  7674. partDesc: row.partDesc,
  7675. partTypeDB: row.partTypeDB,
  7676. partType: row.partType,
  7677. umId: row.umId,
  7678. spec: row.spec,
  7679. expirationFlag: row.expirationFlag,
  7680. expirationDay: row.expirationDay,
  7681. expirationWarningDay: row.expirationWarningDay,
  7682. exceedInRatio: row.exceedInRatio,
  7683. exceedOutRatio: row.exceedOutRatio,
  7684. inboundWarehouseId: row.inboundWarehouseId,
  7685. inboundWarehouseName: row.inboundWarehouseName,
  7686. outboundWarehouseId: row.outboundWarehouseId,
  7687. outboundWarehouseName: row.outboundWarehouseName,
  7688. inboundLocationId: row.inboundLocationId,
  7689. inboundLocationName: row.inboundLocationName,
  7690. active: row.active,
  7691. iqcExempt: row.iqcExempt,
  7692. faiExempt: row.faiExempt,
  7693. ipqcExempt: row.ipqcExempt,
  7694. pqcExempt: row.pqcExempt,
  7695. fqcExempt: row.fqcExempt,
  7696. oqcExempt: row.oqcExempt,
  7697. firstInspectionDuration: row.firstInspectionDuration,
  7698. nextInspectionDuration: row.nextInspectionDuration,
  7699. totalInspectionDuration: row.totalInspectionDuration,
  7700. lastUpdateBy: this.$store.state.user.name,
  7701. partDescEn: row.partDescEn,
  7702. standardValue: row.standardValue,
  7703. defaultValue: row.defaultValue,
  7704. maxValue: row.maxValue,
  7705. minValue: row.minValue,
  7706. adhesiveActivePeriodFlag: row.adhesiveActivePeriodFlag,
  7707. thawingDuration: row.thawingDuration,
  7708. accumulatedExposureDuration: row.accumulatedExposureDuration,
  7709. issueMethod: row.issueMethod,
  7710. defectThreshold: row.defectThreshold,
  7711. recoveryBatchCount: row.recoveryBatchCount,
  7712. currentDefectCount: row.currentDefectCount,
  7713. remainingTrackingBatches: row.remainingTrackingBatches,
  7714. trackingFlag: row.trackingFlag,
  7715. lastDefectCount: row.lastDefectCount,
  7716. lastTriggerTime: row.lastTriggerTime,
  7717. }
  7718. this.modalDisableFlag = false
  7719. this.modalFlag = true
  7720. },
  7721. updateModal2(row) {
  7722. this.modalData = {
  7723. site: row.site,
  7724. bu: row.site + '_' + row.buNo,
  7725. buNo: row.buNo,
  7726. partNo: row.partNo,
  7727. partDesc: row.partDesc,
  7728. partTypeDB: row.partTypeDB,
  7729. partType: row.partType,
  7730. umId: row.umId,
  7731. spec: row.spec,
  7732. expirationFlag: row.expirationFlag,
  7733. expirationDay: row.expirationDay,
  7734. expirationWarningDay: row.expirationWarningDay,
  7735. exceedInRatio: row.exceedInRatio,
  7736. exceedOutRatio: row.exceedOutRatio,
  7737. inboundWarehouseId: row.inboundWarehouseId,
  7738. inboundWarehouseName: row.inboundWarehouseName,
  7739. outboundWarehouseId: row.outboundWarehouseId,
  7740. outboundWarehouseName: row.outboundWarehouseName,
  7741. inboundLocationId: row.inboundLocationId,
  7742. inboundLocationName: row.inboundLocationName,
  7743. active: row.active,
  7744. iqcExempt: row.iqcExempt,
  7745. faiExempt: row.faiExempt,
  7746. ipqcExempt: row.ipqcExempt,
  7747. pqcExempt: row.pqcExempt,
  7748. fqcExempt: row.fqcExempt,
  7749. oqcExempt: row.oqcExempt,
  7750. firstInspectionDuration: row.firstInspectionDuration,
  7751. nextInspectionDuration: row.nextInspectionDuration,
  7752. totalInspectionDuration: row.totalInspectionDuration,
  7753. lastUpdateBy: this.$store.state.user.name,
  7754. partDescEn: row.partDescEn,
  7755. standardValue: row.standardValue,
  7756. defaultValue: row.defaultValue,
  7757. maxValue: row.maxValue,
  7758. minValue: row.minValue,
  7759. adhesiveActivePeriodFlag: row.adhesiveActivePeriodFlag,
  7760. thawingDuration: row.thawingDuration,
  7761. accumulatedExposureDuration: row.accumulatedExposureDuration,
  7762. issueMethod: row.issueMethod,
  7763. defectThreshold: row.defectThreshold,
  7764. recoveryBatchCount: row.recoveryBatchCount,
  7765. currentDefectCount: row.currentDefectCount,
  7766. remainingTrackingBatches: row.remainingTrackingBatches,
  7767. trackingFlag: row.trackingFlag,
  7768. lastDefectCount: row.lastDefectCount,
  7769. lastTriggerTime: row.lastTriggerTime,
  7770. }
  7771. this.modalDisableFlag = true
  7772. this.modalFlag = true
  7773. },
  7774. saveData() {
  7775. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  7776. this.$message.warning(this.$t('qc.partAttributePage.selectPartName'))
  7777. return
  7778. }
  7779. this.saveLoading = true
  7780. qcPartAttributeEdit(this.modalData)
  7781. .then(({ data }) => {
  7782. if (data && data.code === 0) {
  7783. this.getDataList()
  7784. this.modalFlag = false
  7785. this.$message.success(this.$t('qc.common.operationSuccess'))
  7786. } else {
  7787. this.$message.error(data.msg)
  7788. }
  7789. })
  7790. .finally(() => {
  7791. this.saveLoading = false
  7792. })
  7793. },
  7794. // 列表表格选择替换
  7795. tabClick(tab, event) {
  7796. // 刷新列表数据
  7797. this.refreshCurrentTabTable()
  7798. },
  7799. // 当前值发生变化的时候修改
  7800. changeCurrentRow(row, oldRow) {
  7801. // 判断是否是获取焦点的事件
  7802. if (row) {
  7803. const partChanged = !oldRow || row.partNo !== oldRow.partNo || row.site !== oldRow.site
  7804. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  7805. if (partChanged) {
  7806. this.resetQcSpecFilters()
  7807. this.resetFileCollectQuery()
  7808. }
  7809. //刷新当前页表(主表行点击时不调用 searchPartAttributeDetails)
  7810. this.refreshCurrentTabTable(true)
  7811. }
  7812. },
  7813. partTableRowClassName({ row }) {
  7814. if (this.partCurrentRow && this.partCurrentRow.partNo === row.partNo) {
  7815. return 'part-row-selected'
  7816. }
  7817. return ''
  7818. },
  7819. rowStyle() {
  7820. return { cursor: 'pointer' }
  7821. },
  7822. // 单机选中物料信息
  7823. partClickRow(row, column) {
  7824. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  7825. },
  7826. // 刷新页签的table数据
  7827. refreshCurrentTabTable(skipSearchPartAttributeDetails = false) {
  7828. if (this.activeTable === 'bom') {
  7829. } else if (this.activeTable === 'routing') {
  7830. } else if (this.activeTable === 'qcTemplate') {
  7831. this.detailModal(skipSearchPartAttributeDetails)
  7832. } else if (this.activeTable === 'defectTracking') {
  7833. this.getPartDefectTracking()
  7834. } else if (this.activeTable === 'qcSpec') {
  7835. this.refreshQcSpecList(skipSearchPartAttributeDetails)
  7836. } else if (this.activeTable === 'fileCollect') {
  7837. this.refreshFileCollectList()
  7838. } else if (this.activeTable === 'labelTemplate') {
  7839. this.getPartLabelTemplate()
  7840. }
  7841. },
  7842. // ==================== 物料模板 ====================
  7843. // 打开物料模板清单
  7844. detailModal(skipSearchPartAttributeDetails = false) {
  7845. this.detailData.site = this.partCurrentRow.site
  7846. this.detailData.buNo = this.partCurrentRow.buNo
  7847. this.detailData.partNo = this.partCurrentRow.partNo
  7848. this.detailData.attributeNo = this.partCurrentRow.partNo
  7849. this.detailData.partDesc = this.partCurrentRow.partDesc
  7850. this.detailData.userName = this.$store.state.user.name
  7851. if (skipSearchPartAttributeDetails) {
  7852. // 主表行点击时不调用 searchPartAttributeDetails
  7853. return
  7854. }
  7855. searchPartAttributeDetails(this.detailData).then(({ data }) => {
  7856. this.detailList = data.rows
  7857. this.templatePageIndex = 1 // 重置到第一页
  7858. })
  7859. },
  7860. checkInspectionType() {
  7861. // 刷新模板列表
  7862. this.refreshTemplateLists()
  7863. // 根据检验类型调整布局
  7864. if (
  7865. this.detailData.inspectionTypeNo === '101' ||
  7866. this.detailData.inspectionTypeNo === '107'
  7867. ) {
  7868. this.span1 = 12
  7869. this.span2 = 6
  7870. this.span3 = 6
  7871. } else if (
  7872. this.detailData.inspectionTypeNo === '105' ||
  7873. this.detailData.inspectionTypeNo === '109'
  7874. ) {
  7875. this.span1 = 12
  7876. this.span2 = 12
  7877. } else {
  7878. this.span1 = 24
  7879. }
  7880. },
  7881. checkInspectionType2() {
  7882. this.refreshTemplateLists()
  7883. },
  7884. // 刷新可选模板列表和已有模板列表(统一方法,带loading)
  7885. refreshTemplateLists() {
  7886. this.itemList1Loading = true
  7887. this.itemList2Loading = true
  7888. getPartTemplateLists(this.detailData)
  7889. .then(({ data }) => {
  7890. if (data) {
  7891. this.itemList1 = data.row1 || []
  7892. this.itemList2 = data.row2 || []
  7893. }
  7894. })
  7895. .catch((err) => {
  7896. console.error('加载模板列表失败:', err)
  7897. })
  7898. .finally(() => {
  7899. this.itemList1Loading = false
  7900. this.itemList2Loading = false
  7901. })
  7902. },
  7903. // 批量编辑模态框
  7904. editBatchModel() {
  7905. if (this.editBatchVisible) {
  7906. this.editBatchVisible = false
  7907. } else {
  7908. this.editBatchVisible = true
  7909. }
  7910. },
  7911. // 批量保存
  7912. batchModel() {
  7913. let params = []
  7914. params = this.detailList
  7915. this.batchLoading = true
  7916. saveAttributeDetailed(params)
  7917. .then(({ data }) => {
  7918. if (data && data.code === 0) {
  7919. this.detailModal()
  7920. this.$message.success(data.msg)
  7921. this.editBatchVisible = false
  7922. } else {
  7923. this.$message.error(data.msg)
  7924. }
  7925. })
  7926. .finally(() => {
  7927. this.batchLoading = false
  7928. })
  7929. },
  7930. // 快速新增
  7931. addFastModal() {
  7932. // 检查是否已选择物料
  7933. if (!this.detailData.partNo || !this.detailData.site) {
  7934. this.$message.warning(
  7935. this.$t('qc.partAttributePage.selectPartForTemplate')
  7936. )
  7937. return
  7938. }
  7939. // 检查检验类型是否已加载
  7940. if (!this.options || this.options.length === 0) {
  7941. this.$message.warning(
  7942. this.$t('qc.partAttributePage.inspectionTypeLoading')
  7943. )
  7944. return
  7945. }
  7946. // 初始化选择状态
  7947. this.itemSelections1 = []
  7948. this.itemSelections2 = []
  7949. // 设置默认检验类型为第一个
  7950. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  7951. // 根据检验类型调整布局
  7952. if (
  7953. this.detailData.inspectionTypeNo === '101' ||
  7954. this.detailData.inspectionTypeNo === '107'
  7955. ) {
  7956. this.span1 = 12
  7957. this.span2 = 6
  7958. this.span3 = 6
  7959. } else if (
  7960. this.detailData.inspectionTypeNo === '105' ||
  7961. this.detailData.inspectionTypeNo === '109'
  7962. ) {
  7963. this.span1 = 12
  7964. this.span2 = 12
  7965. } else {
  7966. this.span1 = 24
  7967. }
  7968. // 清空工序和机台选择
  7969. this.operationSelections = []
  7970. this.resourceSelections = []
  7971. this.dataListOperationSelections = []
  7972. this.operationData.operationDesc = ''
  7973. this.resourceData.resourceId = ''
  7974. this.resourceData.resourceDesc = ''
  7975. // 清空供应商和客户选择
  7976. this.selectionManufacturer = []
  7977. this.selectionManufacturer2 = []
  7978. this.dataListManufacturerSelections = []
  7979. this.selectionCustomer = []
  7980. this.selectionCustomer2 = []
  7981. this.dataListCustomerSelections = []
  7982. // 打开对话框
  7983. this.fastAddFlag = true
  7984. // 对话框打开后再加载模板列表(使用$nextTick确保对话框已渲染)
  7985. this.$nextTick(() => {
  7986. this.refreshTemplateLists()
  7987. })
  7988. },
  7989. // 可选项目
  7990. itemClickRow1(row) {
  7991. this.$refs.itemTable1.toggleRowSelection(row)
  7992. },
  7993. // 已有项目
  7994. itemClickRow2(row) {
  7995. this.$refs.itemTable2.toggleRowSelection(row)
  7996. },
  7997. selectionItem1(val) {
  7998. this.itemSelections1 = val
  7999. },
  8000. selectionItem2(val) {
  8001. this.itemSelections2 = val
  8002. },
  8003. // 添加模板
  8004. addItem() {
  8005. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  8006. this.$message.warning(
  8007. this.$t('qc.partAttributePage.selectOptionalTemplate')
  8008. )
  8009. return
  8010. }
  8011. // IPQC/FQC类型:如果想选择机台,必须要选择工序
  8012. if (
  8013. this.detailData.inspectionTypeNo === '101' ||
  8014. this.detailData.inspectionTypeNo === '102' ||
  8015. this.detailData.inspectionTypeNo === '103' ||
  8016. this.detailData.inspectionTypeNo === '104' ||
  8017. this.detailData.inspectionTypeNo === '106' ||
  8018. this.detailData.inspectionTypeNo === '107'
  8019. ) {
  8020. if (
  8021. this.resourceSelections.length > 0 &&
  8022. this.operationSelections.length === 0
  8023. ) {
  8024. this.$message.warning(
  8025. this.$t('qc.partAttributePage.machineRequiresOperation')
  8026. )
  8027. return
  8028. }
  8029. }
  8030. // 开始loading
  8031. this.addItemLoading = true
  8032. // 构建请求参数
  8033. let inData = {
  8034. site: this.detailData.site,
  8035. buNo: this.detailData.buNo,
  8036. attributeNo: this.detailData.partNo,
  8037. itemList: this.itemSelections1,
  8038. // IPQC/FQC类型:传递工序列表和机台列表(多选)
  8039. operationList: this.operationSelections.map(
  8040. (item) => item.operationDesc
  8041. ),
  8042. resourceIDList: this.resourceSelections.map((item) => item.resourceId),
  8043. // IQC类型:传递供应商列表(可为空)
  8044. manufacturerList: this.selectionManufacturer || [],
  8045. // OQC类型:传递客户列表(可为空)
  8046. customerList: this.selectionCustomer || [],
  8047. attributeType: this.detailData.attributeType,
  8048. inspectionTypeNo: this.detailData.inspectionTypeNo,
  8049. }
  8050. savePartAttributeDetails(inData)
  8051. .then(({ data }) => {
  8052. if (data && data.code === 0) {
  8053. this.$message.success(this.$t('qc.partAttributePage.addSuccess'))
  8054. // 刷新可选模板列表和已有模板列表
  8055. this.refreshTemplateLists()
  8056. // 清空选中状态
  8057. this.itemSelections1 = []
  8058. this.operationSelections = []
  8059. this.resourceSelections = []
  8060. this.selectionManufacturer = []
  8061. this.selectionManufacturer2 = []
  8062. this.selectionCustomer = []
  8063. this.selectionCustomer2 = []
  8064. } else {
  8065. this.$message.error(data.msg)
  8066. }
  8067. })
  8068. .catch((err) => {
  8069. this.$message.error(
  8070. this.$t('qc.partAttributePage.addFailPrefix') +
  8071. (err.message || this.$t('qc.common.unknownError'))
  8072. )
  8073. })
  8074. .finally(() => {
  8075. this.addItemLoading = false
  8076. })
  8077. },
  8078. // 删除模板
  8079. deleteItem() {
  8080. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  8081. this.$message.warning(
  8082. this.$t('qc.partAttributePage.selectExistingTemplate')
  8083. )
  8084. return
  8085. }
  8086. // 开始loading
  8087. this.deleteItemLoading = true
  8088. let inData = {
  8089. attributeNo: this.detailData.partNo,
  8090. itemList: this.itemSelections2,
  8091. attributeType: this.detailData.attributeType,
  8092. site: this.detailData.site,
  8093. buNo: this.detailData.buNo,
  8094. }
  8095. deletePartAttributeDetails(inData)
  8096. .then(({ data }) => {
  8097. if (data && data.code === 0) {
  8098. this.$message.success(this.$t('qc.common.deleteSuccess'))
  8099. // 刷新可选模板列表和已有模板列表
  8100. this.refreshTemplateLists()
  8101. this.itemSelections2 = []
  8102. } else {
  8103. this.$message.error(data.msg)
  8104. }
  8105. })
  8106. .catch((err) => {
  8107. this.$message.error(
  8108. this.$t('qc.common.deleteFailed') +
  8109. ': ' +
  8110. (err.message || this.$t('qc.common.unknownError'))
  8111. )
  8112. })
  8113. .finally(() => {
  8114. this.deleteItemLoading = false
  8115. })
  8116. },
  8117. // 关闭后刷新列表
  8118. refreshDetailList() {
  8119. searchPartAttributeDetails(this.detailData).then(({ data }) => {
  8120. this.detailList = data.rows
  8121. })
  8122. },
  8123. // 删除物料属性中的模板
  8124. deletePartAttributeDetails(row) {
  8125. this.$confirm(
  8126. this.$t('qc.template.deleteTemplateConfirm'),
  8127. this.$t('qc.common.tip'),
  8128. {
  8129. confirmButtonText: this.$t('qc.common.confirm'),
  8130. cancelButtonText: this.$t('qc.common.cancel'),
  8131. type: 'warning',
  8132. }
  8133. ).then(() => {
  8134. this.$set(row, 'deleting', true)
  8135. deletePartAttributeDetails(row)
  8136. .then(({ data }) => {
  8137. if (data && data.code === 0) {
  8138. searchPartAttributeDetails(this.detailData).then(({ data }) => {
  8139. this.detailList = data.rows
  8140. })
  8141. this.$message.success(this.$t('qc.common.operationSuccess'))
  8142. } else {
  8143. this.$message.error(data.msg)
  8144. }
  8145. this.$set(row, 'deleting', false)
  8146. })
  8147. .catch(() => {
  8148. this.$set(row, 'deleting', false)
  8149. })
  8150. })
  8151. },
  8152. // 质量检验模板多选变化
  8153. handleTemplateSelectionChange(val) {
  8154. this.selectedTemplates = val
  8155. },
  8156. // 批量删除质量检验模板
  8157. batchDeleteTemplates() {
  8158. if (this.selectedTemplates.length === 0) {
  8159. this.$message.warning(this.$t('qc.partAttributePage.selectAtLeastOne'))
  8160. return
  8161. }
  8162. this.$confirm(
  8163. this.$t('qc.partAttributePage.batchDeleteTemplateCount', {
  8164. count: this.selectedTemplates.length,
  8165. }),
  8166. this.$t('qc.common.tip'),
  8167. {
  8168. confirmButtonText: this.$t('qc.common.confirm'),
  8169. cancelButtonText: this.$t('qc.common.cancel'),
  8170. type: 'warning',
  8171. }
  8172. ).then(() => {
  8173. this.templateDeleteLoading = true
  8174. // 创建删除请求的Promise数组
  8175. const deletePromises = this.selectedTemplates.map((row) => {
  8176. return deletePartAttributeDetails(row)
  8177. })
  8178. // 并发执行所有删除请求
  8179. Promise.all(deletePromises)
  8180. .then((results) => {
  8181. // 检查是否所有请求都成功
  8182. const allSuccess = results.every(
  8183. ({ data }) => data && data.code === 0
  8184. )
  8185. if (allSuccess) {
  8186. this.$message.success(
  8187. this.$t('qc.partAttributePage.batchDeleteSuccess')
  8188. )
  8189. } else {
  8190. this.$message.warning(
  8191. this.$t('qc.partAttributePage.partialDeleteFail')
  8192. )
  8193. }
  8194. // 刷新列表
  8195. searchPartAttributeDetails(this.detailData).then(({ data }) => {
  8196. this.detailList = data.rows
  8197. })
  8198. // 清空选中状态
  8199. this.$refs.templateTable.clearSelection()
  8200. this.selectedTemplates = []
  8201. this.templateDeleteLoading = false
  8202. })
  8203. .catch(() => {
  8204. this.$message.error(this.$t('qc.partAttributePage.batchDeleteFail'))
  8205. // 刷新列表
  8206. searchPartAttributeDetails(this.detailData).then(({ data }) => {
  8207. this.detailList = data.rows
  8208. })
  8209. this.templateDeleteLoading = false
  8210. })
  8211. })
  8212. },
  8213. // 质量检验模板每页数
  8214. templateSizeChangeHandle(val) {
  8215. this.templatePageSize = val
  8216. this.templatePageIndex = 1
  8217. },
  8218. // 质量检验模板当前页
  8219. templateCurrentChangeHandle(val) {
  8220. this.templatePageIndex = val
  8221. },
  8222. // ==================== 物料缺陷跟踪 ====================
  8223. // 查询物料缺陷跟踪
  8224. getPartDefectTracking() {
  8225. let templateData = {
  8226. site: this.partCurrentRow.site,
  8227. buNo: this.partCurrentRow.buNo,
  8228. partNo: this.partCurrentRow.partNo,
  8229. }
  8230. getPartDefectTracking(templateData).then(({ data }) => {
  8231. this.defectTrackingList = data.rows
  8232. })
  8233. },
  8234. // 新增物料缺陷跟踪
  8235. addDefectTrackingModal() {
  8236. this.defectTrackingData = {
  8237. site: this.partCurrentRow.site,
  8238. buNo: this.partCurrentRow.buNo,
  8239. partNo: this.partCurrentRow.partNo,
  8240. supplierId: '',
  8241. supplierName: '',
  8242. defectThreshold: '',
  8243. recoveryBatchCount: '',
  8244. currentDefectCount: '',
  8245. lastDefectCount: '',
  8246. }
  8247. this.defectTrackingModal = true
  8248. this.defectTrackingDisableFlag = false
  8249. },
  8250. // 新增物料缺陷跟踪
  8251. saveDefectTracking() {
  8252. if (
  8253. this.defectTrackingData.supplierId === '' ||
  8254. this.defectTrackingData.supplierId == null
  8255. ) {
  8256. this.$message.warning(this.$t('qc.partAttributePage.selectSupplier'))
  8257. return
  8258. }
  8259. this.saveLoading = true
  8260. saveDefectTracking(this.defectTrackingData)
  8261. .then(({ data }) => {
  8262. if (data && data.code === 0) {
  8263. this.getPartDefectTracking()
  8264. this.defectTrackingModal = false
  8265. this.$message.success(this.$t('qc.common.operationSuccess'))
  8266. } else {
  8267. this.$message.error(data.msg)
  8268. }
  8269. })
  8270. .finally(() => {
  8271. this.saveLoading = false
  8272. })
  8273. },
  8274. // 删除物料缺陷跟踪
  8275. deleteDefectTracking(row) {
  8276. this.$confirm(
  8277. this.$t('qc.partAttributePage.deleteDefectTrackingConfirm'),
  8278. this.$t('qc.common.tip'),
  8279. {
  8280. confirmButtonText: this.$t('qc.common.confirm'),
  8281. cancelButtonText: this.$t('qc.common.cancel'),
  8282. type: 'warning',
  8283. }
  8284. ).then(() => {
  8285. deleteDefectTracking(row).then(({ data }) => {
  8286. if (data && data.code === 0) {
  8287. this.getPartDefectTracking()
  8288. this.$message.success(this.$t('qc.common.operationSuccess'))
  8289. } else {
  8290. this.$message.error(data.msg)
  8291. }
  8292. })
  8293. })
  8294. },
  8295. onDefectTrackingPositiveIntInput(row, prop, value) {
  8296. if (!row || !prop) return
  8297. const matched = String(value == null ? '' : value).match(/^[1-9]\d*$/)
  8298. row[prop] = matched ? matched[0] : ''
  8299. },
  8300. // 批量编辑
  8301. editDefectTrackingBatchModel() {
  8302. if (this.editBatchVisible) {
  8303. this.editBatchVisible = false
  8304. } else {
  8305. this.editBatchVisible = true
  8306. }
  8307. },
  8308. cancelDefectTrackingBatchModel() {
  8309. this.editBatchVisible = false
  8310. this.getPartDefectTracking()
  8311. },
  8312. // 批量保存
  8313. batchDefectTrackingModel() {
  8314. let params = []
  8315. params = this.defectTrackingList
  8316. this.batchLoading = true
  8317. updateDefectTracking(params)
  8318. .then(({ data }) => {
  8319. if (data && data.code === 0) {
  8320. this.getPartDefectTracking()
  8321. this.$message.success(data.msg)
  8322. this.editBatchVisible = false
  8323. } else {
  8324. this.$message.error(data.msg)
  8325. }
  8326. })
  8327. .finally(() => {
  8328. this.batchLoading = false
  8329. })
  8330. },
  8331. // ==================== 标签模版设置 ====================
  8332. // 查询标签模版设置
  8333. getPartLabelTemplate() {
  8334. let templateData = {
  8335. site: this.partCurrentRow.site,
  8336. buNo: this.partCurrentRow.buNo,
  8337. partNo: this.partCurrentRow.partNo,
  8338. }
  8339. getPartLabelTemplate(templateData).then(({ data }) => {
  8340. this.labelTemplateList = data.rows
  8341. })
  8342. },
  8343. // 新增标签模版设置
  8344. addLabelTemplateModal() {
  8345. this.labelTemplateData = {
  8346. flag: '1',
  8347. site: this.partCurrentRow.site,
  8348. buNo: this.partCurrentRow.buNo,
  8349. partNo: this.partCurrentRow.partNo,
  8350. labelTypeTb: '',
  8351. labelType: '',
  8352. operationDesc: '',
  8353. defaultFlag: '',
  8354. createdBy: this.$store.state.user.name,
  8355. }
  8356. this.loadOperationDescList()
  8357. this.labelTemplateModal = true
  8358. this.labelTemplateDisableFlag = false
  8359. },
  8360. // 编辑标签模版设置
  8361. updateLabelTemplateModal(row) {
  8362. this.labelTemplateData = {
  8363. flag: '2',
  8364. site: row.site,
  8365. buNo: row.buNo,
  8366. partNo: row.partNo,
  8367. labelTypeTb: row.labelTypeTb,
  8368. labelType: row.labelType,
  8369. operationDesc: row.operationDesc || '',
  8370. defaultFlag: row.defaultFlag,
  8371. }
  8372. this.loadOperationDescList()
  8373. this.labelTemplateModal = true
  8374. this.labelTemplateDisableFlag = true
  8375. },
  8376. // 新增标签模版设置
  8377. saveLabelTemplate() {
  8378. if (
  8379. this.labelTemplateData.labelTypeTb === '' ||
  8380. this.labelTemplateData.labelTypeTb == null
  8381. ) {
  8382. this.$message.warning(this.$t('qc.partAttributePage.selectLabelType'))
  8383. return
  8384. }
  8385. // 检查是否设置为默认,且已存在其他默认标签
  8386. if (this.labelTemplateData.defaultFlag === '1') {
  8387. // 查找已存在的默认标签(排除当前编辑的记录)
  8388. const existingDefault = this.labelTemplateList.find(
  8389. (item) =>
  8390. item.defaultFlag === '1' &&
  8391. item.labelTypeTb !== this.labelTemplateData.labelTypeTb
  8392. )
  8393. if (existingDefault) {
  8394. this.$confirm(
  8395. this.$t('qc.partAttributePage.defaultLabelChangeConfirm', {
  8396. label: existingDefault.labelType,
  8397. }),
  8398. this.$t('qc.common.tip'),
  8399. {
  8400. confirmButtonText: this.$t('qc.common.confirm'),
  8401. cancelButtonText: this.$t('qc.common.cancel'),
  8402. type: 'warning',
  8403. }
  8404. )
  8405. .then(() => {
  8406. // 先将已存在的默认标签改为非默认
  8407. const clearDefaultData = {
  8408. site: existingDefault.site,
  8409. buNo: existingDefault.buNo,
  8410. partNo: existingDefault.partNo,
  8411. labelTypeTb: existingDefault.labelTypeTb,
  8412. labelType: existingDefault.labelType,
  8413. defaultFlag: '0',
  8414. }
  8415. updateLabelTemplate(clearDefaultData).then(({ data }) => {
  8416. if (data && data.code === 0) {
  8417. // 清除成功后再保存当前标签
  8418. this.doSaveLabelTemplate()
  8419. } else {
  8420. this.$message.error(
  8421. this.$t('qc.partAttributePage.clearDefaultLabelFail') +
  8422. data.msg
  8423. )
  8424. }
  8425. })
  8426. })
  8427. .catch(() => {
  8428. // 用户取消
  8429. })
  8430. return
  8431. }
  8432. }
  8433. this.doSaveLabelTemplate()
  8434. },
  8435. // 执行保存标签模版
  8436. doSaveLabelTemplate() {
  8437. this.saveLoading = true
  8438. if (this.labelTemplateData.flag === '1') {
  8439. saveLabelTemplate(this.labelTemplateData)
  8440. .then(({ data }) => {
  8441. if (data && data.code === 0) {
  8442. this.getPartLabelTemplate()
  8443. this.labelTemplateModal = false
  8444. this.$message.success(this.$t('qc.common.operationSuccess'))
  8445. } else {
  8446. this.$message.error(data.msg)
  8447. }
  8448. })
  8449. .finally(() => {
  8450. this.saveLoading = false
  8451. })
  8452. } else {
  8453. updateLabelTemplate(this.labelTemplateData)
  8454. .then(({ data }) => {
  8455. if (data && data.code === 0) {
  8456. this.getPartLabelTemplate()
  8457. this.labelTemplateModal = false
  8458. this.$message.success(this.$t('qc.common.operationSuccess'))
  8459. } else {
  8460. this.$message.error(data.msg)
  8461. }
  8462. })
  8463. .finally(() => {
  8464. this.saveLoading = false
  8465. })
  8466. }
  8467. },
  8468. // 删除标签模版设置
  8469. deleteLabelTemplate(row) {
  8470. this.$confirm(
  8471. this.$t('qc.partAttributePage.deleteLabelTemplateConfirm'),
  8472. this.$t('qc.common.tip'),
  8473. {
  8474. confirmButtonText: this.$t('qc.common.confirm'),
  8475. cancelButtonText: this.$t('qc.common.cancel'),
  8476. type: 'warning',
  8477. }
  8478. ).then(() => {
  8479. deleteLabelTemplate(row).then(({ data }) => {
  8480. if (data && data.code === 0) {
  8481. this.getPartLabelTemplate()
  8482. this.$message.success(this.$t('qc.common.operationSuccess'))
  8483. } else {
  8484. this.$message.error(data.msg)
  8485. }
  8486. })
  8487. })
  8488. },
  8489. // 仓库输入校验
  8490. inWarehouseBlur(tagNo) {
  8491. let tempData = {
  8492. tagno: tagNo,
  8493. conditionSql:
  8494. " and WareHouseID = '" +
  8495. this.modalData.inboundWarehouseId +
  8496. "'" +
  8497. " and site = '" +
  8498. this.modalData.site +
  8499. "'" +
  8500. " and bu_no = '" +
  8501. this.modalData.buNo +
  8502. "'",
  8503. }
  8504. verifyData(tempData).then(({ data }) => {
  8505. if (data && data.code === 0) {
  8506. if (data.baseListData.length > 0) {
  8507. this.modalData.inboundWarehouseId = data.baseListData[0].WareHouseID
  8508. this.modalData.inboundWarehouseName =
  8509. data.baseListData[0].WareHouseName
  8510. } else {
  8511. this.modalData.inboundWarehouseName = ''
  8512. }
  8513. }
  8514. })
  8515. },
  8516. // 仓库输入校验
  8517. outWarehouseBlur(tagNo) {
  8518. let tempData = {
  8519. tagno: tagNo,
  8520. conditionSql:
  8521. " and WareHouseID = '" +
  8522. this.modalData.outboundWarehouseId +
  8523. "'" +
  8524. " and site = '" +
  8525. this.modalData.site +
  8526. "'" +
  8527. " and bu_no = '" +
  8528. this.modalData.buNo +
  8529. "'",
  8530. }
  8531. verifyData(tempData).then(({ data }) => {
  8532. if (data && data.code === 0) {
  8533. if (data.baseListData.length > 0) {
  8534. this.modalData.outboundWarehouseId =
  8535. data.baseListData[0].WareHouseID
  8536. this.modalData.outboundWarehouseName =
  8537. data.baseListData[0].WareHouseName
  8538. } else {
  8539. this.modalData.outboundWarehouseName = ''
  8540. }
  8541. }
  8542. })
  8543. },
  8544. // 库位输入校验
  8545. locationBlur(tagNo) {
  8546. let tempData = {
  8547. tagno: tagNo,
  8548. conditionSql:
  8549. " and LocationID = '" +
  8550. this.modalData.inboundLocationId +
  8551. "'" +
  8552. " and site = '" +
  8553. this.modalData.site +
  8554. "'" +
  8555. " and bu_no = '" +
  8556. this.modalData.buNo +
  8557. "'",
  8558. }
  8559. verifyData(tempData).then(({ data }) => {
  8560. if (data && data.code === 0) {
  8561. if (data.baseListData.length > 0) {
  8562. this.modalData.inboundLocationId = data.baseListData[0].LocationID
  8563. this.modalData.inboundLocationName =
  8564. data.baseListData[0].LocationName
  8565. } else {
  8566. this.modalData.inboundLocationName = ''
  8567. }
  8568. }
  8569. })
  8570. },
  8571. // 库位输入校验
  8572. supplierBlur(tagNo) {
  8573. let tempData = {
  8574. tagno: tagNo,
  8575. conditionSql:
  8576. " and SupplierID = '" +
  8577. this.defectTrackingData.supplierId +
  8578. "'" +
  8579. " and site = '" +
  8580. this.defectTrackingData.site +
  8581. "'",
  8582. }
  8583. verifyData(tempData).then(({ data }) => {
  8584. if (data && data.code === 0) {
  8585. if (data.baseListData.length > 0) {
  8586. this.defectTrackingData.supplierId = data.baseListData[0].SupplierID
  8587. this.defectTrackingData.supplierName =
  8588. data.baseListData[0].SupplierName
  8589. } else {
  8590. this.defectTrackingData.supplierName = ''
  8591. }
  8592. }
  8593. })
  8594. },
  8595. // 标签类型输入校验
  8596. labelTemplateBlur() {
  8597. let tempData = {
  8598. tagno: tagNo,
  8599. conditionSql:
  8600. " and ReportID = '" + this.labelTemplateData.labelTypeTb + "'",
  8601. }
  8602. verifyData(tempData).then(({ data }) => {
  8603. if (data && data.code === 0) {
  8604. if (data.baseListData.length > 0) {
  8605. this.labelTemplateData.labelTypeTb = data.baseListData[0].ReportID
  8606. this.labelTemplateData.labelType = data.baseListData[0].ReportFamily
  8607. } else {
  8608. this.labelTemplateData.labelType = ''
  8609. }
  8610. }
  8611. })
  8612. },
  8613. // 获取基础数据列表S
  8614. getBaseList(val, type) {
  8615. this.tagNo = val
  8616. this.tagType = type
  8617. this.$nextTick(() => {
  8618. let strVal = ''
  8619. if (val === 20 && type === 1) {
  8620. strVal = this.modalData.inboundWarehouseId
  8621. this.$refs.baseList.init(val, strVal)
  8622. }
  8623. if (val === 20 && type === 2) {
  8624. strVal = this.modalData.outboundWarehouseId
  8625. this.$refs.baseList.init(val, strVal)
  8626. }
  8627. if (val === 506) {
  8628. strVal = this.defectTrackingData.supplierId
  8629. this.$refs.baseList.init(val, strVal)
  8630. }
  8631. if (val === 1099) {
  8632. strVal = this.labelTemplateData.labelTypeTb
  8633. this.$refs.baseList.init(val, strVal)
  8634. }
  8635. })
  8636. },
  8637. // 列表方法的回调
  8638. getBaseData(val) {
  8639. if (this.tagNo === 20 && this.tagType === 1) {
  8640. this.modalData.inboundWarehouseId = val.WareHouseID
  8641. this.modalData.inboundWarehouseName = val.WareHouseName
  8642. }
  8643. if (this.tagNo === 20 && this.tagType === 2) {
  8644. this.modalData.outboundWarehouseId = val.WareHouseID
  8645. this.modalData.outboundWarehouseName = val.WareHouseName
  8646. }
  8647. if (this.tagNo === 506) {
  8648. this.defectTrackingData.supplierId = val.SupplierID
  8649. this.defectTrackingData.supplierName = val.SupplierName
  8650. }
  8651. if (this.tagNo === 1099) {
  8652. this.labelTemplateData.labelTypeTb = val.ReportID
  8653. this.labelTemplateData.labelType = val.ReportFamily
  8654. }
  8655. },
  8656. // 校验用户是否收藏
  8657. favoriteIsOk() {
  8658. let userFavorite = {
  8659. userId: this.$store.state.user.id,
  8660. languageCode: this.$i18n.locale,
  8661. }
  8662. userFavoriteList(userFavorite).then(({ data }) => {
  8663. for (let i = 0; i < data.list.length; i++) {
  8664. if (this.$route.meta.menuId === data.list[i].menuId) {
  8665. this.favorite = true
  8666. }
  8667. }
  8668. })
  8669. },
  8670. // 收藏 OR 取消收藏
  8671. favoriteFunction() {
  8672. let userFavorite = {
  8673. userId: this.$store.state.user.id,
  8674. functionId: this.$route.meta.menuId,
  8675. }
  8676. if (this.favorite) {
  8677. removeUserFavorite(userFavorite).then(({ data }) => {
  8678. this.$message.success(data.msg)
  8679. this.favorite = false
  8680. })
  8681. } else {
  8682. // 收藏
  8683. saveUserFavorite(userFavorite).then(({ data }) => {
  8684. this.$message.success(data.msg)
  8685. this.favorite = true
  8686. })
  8687. }
  8688. },
  8689. async exportExcel() {
  8690. this.searchData.limit = -1
  8691. this.searchData.page = 1
  8692. excel.exportTable({
  8693. url: '/pms/qc/qcPartAttributeSearch',
  8694. columnMapping: this.columnList,
  8695. params: this.searchData,
  8696. fileName: this.exportName + '.xlsx',
  8697. rowFetcher: (res) => {
  8698. return res.data
  8699. },
  8700. })
  8701. },
  8702. // 导入
  8703. qcUpload() {
  8704. let currentData = {
  8705. flag: 'partAttribute',
  8706. createBy: this.$store.state.user.name,
  8707. site: this.$store.state.user.site,
  8708. }
  8709. //打开组件 去做新增业务
  8710. this.$nextTick(() => {
  8711. this.$refs.qcUpload.init(currentData)
  8712. })
  8713. },
  8714. // 获取工序列表
  8715. getOperationList() {
  8716. this.operationPageIndex = 1
  8717. this.fetchOperationList(true, true)
  8718. },
  8719. // 获取机台列表
  8720. getAllResourceList() {
  8721. this.resourceData.site = this.resolveResourceSite()
  8722. getAllResourceList(this.resourceData).then(({ data }) => {
  8723. if (data && data.code === 0) {
  8724. this.resourceList = data.rows
  8725. this.resourceModelFlag = true
  8726. } else {
  8727. this.$message.error(data.msg)
  8728. }
  8729. })
  8730. },
  8731. // 条件查询获取工序列表
  8732. getOperationList2() {
  8733. this.operationPageIndex = 1
  8734. this.fetchOperationList(false, false)
  8735. },
  8736. fetchOperationList(openDialog, restoreSelection) {
  8737. const payload = {
  8738. ...this.operationData,
  8739. page: this.operationPageIndex,
  8740. limit: this.operationPageSize,
  8741. }
  8742. getOperationDescList(payload).then(({ data }) => {
  8743. if (data && data.code === 0) {
  8744. this.operationList = (data.page && data.page.list) || []
  8745. this.operationPageIndex = data.page.currPage
  8746. this.operationPageSize = data.page.pageSize
  8747. this.operationTotalPage = data.page.totalCount
  8748. if (restoreSelection || this.qcSpecPickerRow) {
  8749. this.$nextTick(() => {
  8750. if (!this.$refs.operationTable) return
  8751. if (this.qcSpecPickerRow) {
  8752. const operationDesc = this.qcSpecPickerRow.operation
  8753. if (operationDesc) {
  8754. const match = this.operationList.find(
  8755. (o) => o.operationDesc === operationDesc
  8756. )
  8757. if (match) {
  8758. this.$refs.operationTable.setCurrentRow(match)
  8759. this.operationSelections = [match]
  8760. }
  8761. }
  8762. return
  8763. }
  8764. this.$refs.operationTable.clearSelection()
  8765. if (this.operationSelections && this.operationSelections.length > 0) {
  8766. const selectedDescs = this.operationSelections.map((o) => o.operationDesc)
  8767. this.operationList.forEach((val) => {
  8768. if (selectedDescs.includes(val.operationDesc)) {
  8769. this.$refs.operationTable.toggleRowSelection(val, true)
  8770. }
  8771. })
  8772. }
  8773. })
  8774. }
  8775. if (openDialog) {
  8776. this.operationModelFlag = true
  8777. }
  8778. } else {
  8779. this.operationList = []
  8780. this.operationTotalPage = 0
  8781. if (openDialog && data && data.msg) {
  8782. this.$message.error(data.msg)
  8783. }
  8784. }
  8785. })
  8786. },
  8787. operationCurrentChange(val) {
  8788. this.operationPageIndex = val
  8789. this.fetchOperationList(false, true)
  8790. },
  8791. // 条件查询获取机台列表
  8792. getAllResourceList2() {
  8793. this.resourceData.site = this.resolveResourceSite()
  8794. getAllResourceList(this.resourceData).then(({ data }) => {
  8795. if (data && data.code === 0) {
  8796. this.resourceList = data.rows
  8797. this.resourceCurrent = -1
  8798. } else {
  8799. this.$message.error(data.msg)
  8800. }
  8801. })
  8802. },
  8803. // 点击行选中工序
  8804. operationClickRow(row) {
  8805. if (this.qcSpecPickerRow) {
  8806. this.operationSelections = [row]
  8807. this.$refs.operationTable.setCurrentRow(row)
  8808. return
  8809. }
  8810. this.$refs.operationTable.toggleRowSelection(row)
  8811. },
  8812. operationDblClickRow(row) {
  8813. if (!this.qcSpecPickerRow) return
  8814. this.operationSelections = [row]
  8815. this.confirmOperation()
  8816. },
  8817. // 点击行选中机台
  8818. resourceClickRow(row) {
  8819. if (this.qcSpecPickerRow) {
  8820. this.resourceSelections = [row]
  8821. this.$refs.resourceTable.setCurrentRow(row)
  8822. return
  8823. }
  8824. this.$refs.resourceTable.toggleRowSelection(row)
  8825. },
  8826. resourceDblClickRow(row) {
  8827. if (!this.qcSpecPickerRow) return
  8828. this.resourceSelections = [row]
  8829. this.confirmResource()
  8830. },
  8831. // 多选工序
  8832. selectionOperationChangeHandle(val) {
  8833. this.operationSelections = val
  8834. },
  8835. // 工序选择:检验项目设置为单选(无复选框),模板新增仍为多选
  8836. operationSelect(selection, row) {
  8837. if (!this.qcSpecPickerRow || !this.$refs.operationTable) return
  8838. this.operationSelections = [row]
  8839. this.$refs.operationTable.setCurrentRow(row)
  8840. },
  8841. getRowKeys(row) {
  8842. return row.operationDesc
  8843. },
  8844. // 多选机台
  8845. selectionResourceChangeHandle(val) {
  8846. this.resourceSelections = val
  8847. },
  8848. // 机台选择:检验项目设置为单选(无复选框),模板新增仍为多选
  8849. resourceSelect(selection, row) {
  8850. if (!this.qcSpecPickerRow || !this.$refs.resourceTable) return
  8851. this.resourceSelections = [row]
  8852. this.$refs.resourceTable.setCurrentRow(row)
  8853. },
  8854. getRowKeys2(row) {
  8855. return row.resourceId
  8856. },
  8857. operationRowClassName({ row, rowIndex }) {
  8858. row.index = rowIndex // 在原有的数据上加一个index
  8859. },
  8860. resourceRowClassName({ row, rowIndex }) {
  8861. row.index = rowIndex // 在原有的数据上加一个index
  8862. },
  8863. onOperationDialogClose() {
  8864. if (this.qcSpecPickerRow) {
  8865. this.qcSpecPickerRow = null
  8866. this.operationSelections = []
  8867. }
  8868. },
  8869. onResourceDialogClose() {
  8870. if (this.qcSpecPickerRow) {
  8871. this.qcSpecPickerRow = null
  8872. this.resourceSelections = []
  8873. }
  8874. },
  8875. // 确认选择工序
  8876. confirmOperation() {
  8877. if (this.qcSpecPickerRow) {
  8878. const sel = this.operationSelections
  8879. if (sel && sel.length > 0) {
  8880. this.qcSpecPickerRow.operation = sel[0].operationDesc
  8881. }
  8882. this.qcSpecPickerRow = null
  8883. this.operationSelections = []
  8884. this.operationModelFlag = false
  8885. return
  8886. }
  8887. this.operationModelFlag = false
  8888. },
  8889. // 确认选择机台
  8890. confirmResource() {
  8891. if (this.qcSpecPickerRow) {
  8892. const sel = this.resourceSelections
  8893. if (sel && sel.length > 0) {
  8894. this.qcSpecPickerRow.resourceID = sel[0].resourceId
  8895. this.qcSpecPickerRow.resourceDesc = sel[0].resourceDesc
  8896. }
  8897. this.qcSpecPickerRow = null
  8898. this.resourceSelections = []
  8899. this.resourceModelFlag = false
  8900. return
  8901. }
  8902. this.resourceModelFlag = false
  8903. },
  8904. // 获取供应商列表
  8905. getManufacturerList() {
  8906. this.manufacturerPageIndex = 1
  8907. this.fetchManufacturerList(true, true)
  8908. },
  8909. // 搜索供应商列表
  8910. getManufacturerList2() {
  8911. this.manufacturerPageIndex = 1
  8912. this.fetchManufacturerList(false, false)
  8913. },
  8914. fetchManufacturerList(openDialog, restoreSelection) {
  8915. this.manufacturerData.site = this.detailData.site || this.manufacturerData.site
  8916. const payload = {
  8917. ...this.manufacturerData,
  8918. page: this.manufacturerPageIndex,
  8919. limit: this.manufacturerPageSize,
  8920. }
  8921. getManufacturerList(payload).then(({ data }) => {
  8922. if (data && data.code === 0) {
  8923. this.manufacturerList = (data.page && data.page.list) || []
  8924. this.manufacturerPageIndex = data.page.currPage
  8925. this.manufacturerPageSize = data.page.pageSize
  8926. this.manufacturerTotalPage = data.page.totalCount
  8927. if (restoreSelection || this.qcSpecPickerRow) {
  8928. this.$nextTick(() => {
  8929. if (!this.$refs.manufacturerTable) return
  8930. if (this.qcSpecPickerRow) {
  8931. const manufacturerID = this.qcSpecPickerRow.manufacturerID
  8932. if (manufacturerID) {
  8933. const match = this.manufacturerList.find(
  8934. (m) => m.manufacturerID === manufacturerID
  8935. )
  8936. if (match) {
  8937. this.$refs.manufacturerTable.setCurrentRow(match)
  8938. this.dataListManufacturerSelections = [match]
  8939. }
  8940. }
  8941. return
  8942. }
  8943. this.$refs.manufacturerTable.clearSelection()
  8944. const tempDataList = this.selectionManufacturer
  8945. this.manufacturerList.forEach((val) => {
  8946. if (tempDataList.includes(val.manufacturerID)) {
  8947. this.$refs.manufacturerTable.toggleRowSelection(val, true)
  8948. }
  8949. })
  8950. })
  8951. }
  8952. if (openDialog) {
  8953. this.manufacturerModelFlag = true
  8954. }
  8955. } else {
  8956. this.manufacturerList = []
  8957. this.manufacturerTotalPage = 0
  8958. if (openDialog && data && data.msg) {
  8959. this.$message.error(data.msg)
  8960. }
  8961. }
  8962. })
  8963. },
  8964. manufacturerSizeChange(val) {
  8965. this.manufacturerPageSize = val
  8966. this.manufacturerPageIndex = 1
  8967. this.fetchManufacturerList(false, !this.qcSpecPickerRow)
  8968. },
  8969. manufacturerCurrentChange(val) {
  8970. this.manufacturerPageIndex = val
  8971. this.fetchManufacturerList(false, !this.qcSpecPickerRow)
  8972. },
  8973. getRowKeys3(row) {
  8974. return row.manufacturerID
  8975. },
  8976. // 点击行选中供应商
  8977. manufacturerClickRow(row) {
  8978. if (this.qcSpecPickerRow) {
  8979. this.dataListManufacturerSelections = [row]
  8980. this.$refs.manufacturerTable.setCurrentRow(row)
  8981. return
  8982. }
  8983. this.$refs.manufacturerTable.toggleRowSelection(row)
  8984. },
  8985. manufacturerDblClickRow(row) {
  8986. if (!this.qcSpecPickerRow) return
  8987. this.dataListManufacturerSelections = [row]
  8988. this.confirmManufacturer()
  8989. },
  8990. // 多选
  8991. selectionManufacturerChangeHandle(val) {
  8992. this.dataListManufacturerSelections = val
  8993. },
  8994. // 确认多选供应商
  8995. confirmManufacturer() {
  8996. if (this.qcSpecPickerRow) {
  8997. const sel = this.dataListManufacturerSelections
  8998. if (sel && sel.length > 0) {
  8999. this.qcSpecPickerRow.manufacturerID = sel[0].manufacturerID
  9000. this.qcSpecPickerRow.manufacturerName = sel[0].manufacturerName
  9001. }
  9002. this.qcSpecPickerRow = null
  9003. this.manufacturerModelFlag = false
  9004. return
  9005. }
  9006. this.selectionManufacturer = []
  9007. this.selectionManufacturer2 = []
  9008. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  9009. this.selectionManufacturer.push(
  9010. this.dataListManufacturerSelections[i].manufacturerID
  9011. )
  9012. this.selectionManufacturer2.push(this.dataListManufacturerSelections[i])
  9013. }
  9014. this.manufacturerModelFlag = false
  9015. },
  9016. // 获取客户列表
  9017. getCustomerList() {
  9018. this.customerPageIndex = 1
  9019. this.fetchCustomerList(true, true)
  9020. },
  9021. // 搜索客户列表
  9022. getCustomerList2() {
  9023. this.customerPageIndex = 1
  9024. this.fetchCustomerList(false, false)
  9025. },
  9026. fetchCustomerList(openDialog, restoreSelection) {
  9027. this.customerData.site = this.detailData.site || this.customerData.site
  9028. const payload = {
  9029. ...this.customerData,
  9030. page: this.customerPageIndex,
  9031. limit: this.customerPageSize,
  9032. }
  9033. getCustomerList(payload).then(({ data }) => {
  9034. if (data && data.code === 0) {
  9035. this.customerList = (data.page && data.page.list) || []
  9036. this.customerPageIndex = data.page.currPage
  9037. this.customerPageSize = data.page.pageSize
  9038. this.customerTotalPage = data.page.totalCount
  9039. if (restoreSelection || this.qcSpecPickerRow) {
  9040. this.$nextTick(() => {
  9041. if (!this.$refs.customerTable) return
  9042. if (this.qcSpecPickerRow) {
  9043. const customerID = this.qcSpecPickerRow.customerID
  9044. if (customerID) {
  9045. const match = this.customerList.find(
  9046. (c) => c.customerID === customerID
  9047. )
  9048. if (match) {
  9049. this.$refs.customerTable.setCurrentRow(match)
  9050. this.dataListCustomerSelections = [match]
  9051. }
  9052. }
  9053. return
  9054. }
  9055. this.$refs.customerTable.clearSelection()
  9056. const tempDataList = this.selectionCustomer
  9057. this.customerList.forEach((val) => {
  9058. if (tempDataList.includes(val.customerID)) {
  9059. this.$refs.customerTable.toggleRowSelection(val, true)
  9060. }
  9061. })
  9062. })
  9063. }
  9064. if (openDialog) {
  9065. this.customerModelFlag = true
  9066. }
  9067. } else {
  9068. this.customerList = []
  9069. this.customerTotalPage = 0
  9070. if (openDialog && data && data.msg) {
  9071. this.$message.error(data.msg)
  9072. }
  9073. }
  9074. })
  9075. },
  9076. customerSizeChange(val) {
  9077. this.customerPageSize = val
  9078. this.customerPageIndex = 1
  9079. this.fetchCustomerList(false, !this.qcSpecPickerRow)
  9080. },
  9081. customerCurrentChange(val) {
  9082. this.customerPageIndex = val
  9083. this.fetchCustomerList(false, !this.qcSpecPickerRow)
  9084. },
  9085. // 点击行选中客户
  9086. customerClickRow(row) {
  9087. if (this.qcSpecPickerRow) {
  9088. this.dataListCustomerSelections = [row]
  9089. this.$refs.customerTable.setCurrentRow(row)
  9090. return
  9091. }
  9092. this.$refs.customerTable.toggleRowSelection(row)
  9093. },
  9094. customerDblClickRow(row) {
  9095. if (!this.qcSpecPickerRow) return
  9096. this.dataListCustomerSelections = [row]
  9097. this.confirmCustomer()
  9098. },
  9099. // 多选客户
  9100. selectionCustomerChangeHandle(val) {
  9101. this.dataListCustomerSelections = val
  9102. },
  9103. getRowKeys4(row) {
  9104. return row.customerID
  9105. },
  9106. // 确认多选客户
  9107. confirmCustomer() {
  9108. if (this.qcSpecPickerRow) {
  9109. const sel = this.dataListCustomerSelections
  9110. if (sel && sel.length > 0) {
  9111. this.qcSpecPickerRow.customerID = sel[0].customerID
  9112. this.qcSpecPickerRow.customerName = sel[0].customerName
  9113. }
  9114. this.qcSpecPickerRow = null
  9115. this.customerModelFlag = false
  9116. return
  9117. }
  9118. this.selectionCustomer = []
  9119. this.selectionCustomer2 = []
  9120. for (let i = 0; i < this.dataListCustomerSelections.length; i++) {
  9121. this.selectionCustomer.push(
  9122. this.dataListCustomerSelections[i].customerID
  9123. )
  9124. this.selectionCustomer2.push(this.dataListCustomerSelections[i])
  9125. }
  9126. this.customerModelFlag = false
  9127. },
  9128. // sop文件列表
  9129. sopFileList(row) {
  9130. this.sopData = {
  9131. site: row.site,
  9132. buNo: row.buNo,
  9133. partNo: row.partNo,
  9134. inspectionTypeNo: '',
  9135. }
  9136. this.getFileContentList()
  9137. },
  9138. getFileContentList() {
  9139. let tempData = {
  9140. orderRef1: this.sopData.site,
  9141. orderRef2: this.sopData.partNo,
  9142. orderRef3: this.sopData.inspectionTypeNo,
  9143. orderRef4: this.sopData.buNo,
  9144. }
  9145. getFileContentList(tempData).then(({ data }) => {
  9146. if (data && data.code == 200) {
  9147. this.sopList = data.rows
  9148. } else {
  9149. this.sopList = []
  9150. }
  9151. })
  9152. this.sopFileModelFlag = true
  9153. },
  9154. // 上传sop文件模态框
  9155. uploadSopFile() {
  9156. let currentData = {
  9157. titleCon: 'SOP文件上传',
  9158. site: this.sopData.site,
  9159. buNo: this.sopData.buNo,
  9160. createBy: this.$store.state.user.name,
  9161. partNo: this.sopData.partNo,
  9162. inspectionTypeNo: '',
  9163. options: this.options,
  9164. }
  9165. //打开组件 去做新增业务
  9166. this.$nextTick(() => {
  9167. this.$refs.qcSOPUploadFile.init(currentData)
  9168. })
  9169. },
  9170. // 文件下载
  9171. downloadFile(row) {
  9172. downLoadObjectFile(row).then(({ data }) => {
  9173. // 不限制文件下载类型
  9174. const blob = new Blob([data], { type: 'application/octet-stream' })
  9175. // 下载文件名称
  9176. const fileName = row.fileName
  9177. // a标签下载
  9178. const linkNode = document.createElement('a')
  9179. // a标签的download属性规定下载文件的名称
  9180. linkNode.download = fileName
  9181. linkNode.style.display = 'none'
  9182. // 生成一个Blob URL
  9183. linkNode.href = URL.createObjectURL(blob)
  9184. document.body.appendChild(linkNode)
  9185. // 模拟在按钮上的一次鼠标单击
  9186. linkNode.click()
  9187. // 释放URL 对象
  9188. URL.revokeObjectURL(linkNode.href)
  9189. document.body.removeChild(linkNode)
  9190. })
  9191. },
  9192. // 删除文件
  9193. deleteFile(row) {
  9194. this.$confirm(
  9195. this.$t('qc.partAttributePage.confirmDeleteFile'),
  9196. this.$t('qc.common.tip'),
  9197. {
  9198. confirmButtonText: this.$t('qc.common.confirm'),
  9199. cancelButtonText: this.$t('qc.common.cancel'),
  9200. type: 'warning',
  9201. }
  9202. ).then(() => {
  9203. deleteObjectFile(row).then(({ data }) => {
  9204. if (data && data.code === 0) {
  9205. this.getFileContentList()
  9206. this.$message.success(this.$t('qc.common.operationSuccess'))
  9207. } else {
  9208. this.$message.error(data.msg)
  9209. }
  9210. })
  9211. })
  9212. },
  9213. // 动态列开始 获取 用户保存的 格式列
  9214. reloadDynamicColumns() {
  9215. this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1)
  9216. this.getTableUserColumn(this.$route.meta.menuId + 'Table4', 4)
  9217. this.getTableUserColumn(this.$route.meta.menuId + 'Table5', 5)
  9218. this.getTableUserColumn(this.$route.meta.menuId + 'Table6', 6)
  9219. },
  9220. async getTableUserColumn(tableId, columnId) {
  9221. let queryTableUser = {
  9222. userId: this.$store.state.user.name,
  9223. functionId: this.$route.meta.menuId,
  9224. tableId: tableId,
  9225. status: true,
  9226. languageCode: this.$i18n.locale,
  9227. }
  9228. await getTableUserListLanguage(queryTableUser).then(({ data }) => {
  9229. if (data.rows.length > 0) {
  9230. switch (columnId) {
  9231. case 1:
  9232. this.columnList = data.rows
  9233. break
  9234. case 2:
  9235. this.columnDetailList = data.rows
  9236. break
  9237. case 4:
  9238. this.columnDefectTrackingList = this.applyDefectTrackingEditType(
  9239. data.rows
  9240. )
  9241. break
  9242. case 5:
  9243. this.columnFileCollectList = this.applyFileCollectEditType(data.rows)
  9244. break
  9245. case 6:
  9246. this.columnQcSpecList = this.applyQcSpecColumnMeta(data.rows)
  9247. break
  9248. }
  9249. // 接口返回会覆盖本地列;用前端 i18n map 再刷一遍表头
  9250. this.initPartAttributeI18n()
  9251. } else {
  9252. this.getColumnList(tableId, columnId)
  9253. }
  9254. })
  9255. },
  9256. // 获取 tableDefault 列
  9257. async getColumnList(tableId, columnId) {
  9258. let queryTable = {
  9259. functionId: this.$route.meta.menuId,
  9260. tableId: tableId,
  9261. languageCode: this.$i18n.locale,
  9262. }
  9263. await getTableDefaultListLanguage(queryTable).then(({ data }) => {
  9264. if (data.rows.length !== 0) {
  9265. switch (columnId) {
  9266. case 1:
  9267. this.columnList = data.rows
  9268. break
  9269. case 2:
  9270. this.columnDetailList = data.rows
  9271. break
  9272. case 4:
  9273. this.columnDefectTrackingList = this.applyDefectTrackingEditType(
  9274. data.rows
  9275. )
  9276. break
  9277. case 5:
  9278. this.columnFileCollectList = this.applyFileCollectEditType(data.rows)
  9279. break
  9280. case 6:
  9281. this.columnQcSpecList = this.applyQcSpecColumnMeta(data.rows)
  9282. break
  9283. }
  9284. this.initPartAttributeI18n()
  9285. }
  9286. })
  9287. },
  9288. /** 动态列接口不会带回 editType,批量编辑列需补回 */
  9289. applyDefectTrackingEditType(list) {
  9290. const editProps = ['defectThreshold', 'recoveryBatchCount']
  9291. return (list || []).map((col) => {
  9292. if (editProps.includes(col.columnProp)) {
  9293. return { ...col, editType: 'positiveInt' }
  9294. }
  9295. return col
  9296. })
  9297. },
  9298. applyFileCollectEditType(list) {
  9299. const editTypeMap = {
  9300. staffAccount: 'staffPicker',
  9301. itemNo: 'itemPicker',
  9302. operation: 'operationPicker',
  9303. originalColumnName: 'textInput',
  9304. remark: 'textInput',
  9305. }
  9306. return (list || []).map((col) => {
  9307. const editType = editTypeMap[col.columnProp]
  9308. if (editType) {
  9309. return { ...col, editType }
  9310. }
  9311. return col
  9312. })
  9313. },
  9314. /** 动态列接口不会带回 editType / visibleWhen,需按列补回 */
  9315. applyQcSpecColumnMeta(list) {
  9316. const editTypeMap = {
  9317. ipqcInspectionMethod: 'ipqcSelect',
  9318. valueType: 'valueType',
  9319. defaultValue: 'textInput',
  9320. maxValue: 'textInput',
  9321. minValue: 'textInput',
  9322. samplingProgrammeDesc: 'programmePicker',
  9323. samplingLevelDesc: 'levelPicker',
  9324. defaultSamplingQuantity: 'samplingQty',
  9325. defaultSamplingProportion: 'samplingRatio',
  9326. operation: 'operationPicker',
  9327. resourceID: 'resourcePicker',
  9328. manufacturerName: 'manufacturerPicker',
  9329. customerName: 'customerPicker',
  9330. custom1: 'textInput',
  9331. custom2: 'textInput',
  9332. custom3: 'textInput',
  9333. }
  9334. const visibleWhenMap = {
  9335. ipqcInspectionMethod: 'ipqcMethod',
  9336. operation: 'operation',
  9337. resourceID: 'resource',
  9338. manufacturerName: 'manufacturer',
  9339. customerName: 'customer',
  9340. }
  9341. return (list || []).map((col) => {
  9342. const extra = {}
  9343. if (editTypeMap[col.columnProp]) extra.editType = editTypeMap[col.columnProp]
  9344. if (visibleWhenMap[col.columnProp]) extra.visibleWhen = visibleWhenMap[col.columnProp]
  9345. return Object.keys(extra).length ? { ...col, ...extra } : col
  9346. })
  9347. },
  9348. closeDialog() {
  9349. this.partDetailData = {
  9350. partNo: '',
  9351. partDesc: '',
  9352. seqNo: '',
  9353. sku: '',
  9354. }
  9355. this.partInfoList = []
  9356. },
  9357. //获取按钮的权限数据
  9358. getButtonAuthData() {
  9359. let searchFlag = this.isAuth(this.menuId + ':search')
  9360. let saveFlag = this.isAuth(this.menuId + ':save')
  9361. let updateFlag = this.isAuth(this.menuId + ':update')
  9362. let deleteFlag = this.isAuth(this.menuId + ':delete')
  9363. let detailFlag = this.isAuth(this.menuId + ':detail')
  9364. let fileFlag = this.isAuth(this.menuId + ':file')
  9365. let syncFlag = this.isAuth(this.menuId + ':sync')
  9366. let itemImportFlag = this.isAuth(this.menuId + ':itemImport')
  9367. //处理页面的权限数据
  9368. this.authSearch = !searchFlag
  9369. this.authSave = !saveFlag
  9370. this.authUpdate = !updateFlag
  9371. this.authDelete = !deleteFlag
  9372. this.authDetail = !detailFlag
  9373. this.authFile = !fileFlag
  9374. this.authSync = !syncFlag
  9375. this.authItemImport = !itemImportFlag
  9376. },
  9377. syncPartCatalog() {
  9378. this.$confirm(
  9379. this.$t('qc.partAttributePage.dataSyncConfirm'),
  9380. this.$t('qc.common.tip'),
  9381. {
  9382. confirmButtonText: this.$t('qc.common.confirm'),
  9383. cancelButtonText: this.$t('qc.common.cancel'),
  9384. type: 'warning',
  9385. }
  9386. )
  9387. .then(() => {
  9388. this.syncLoading = true
  9389. return qcPartCatalogSync()
  9390. })
  9391. .then(({ data }) => {
  9392. this.syncLoading = false
  9393. if (data && data.code === 0) {
  9394. this.$message.success(this.$t('qc.partAttributePage.dataSyncSuccess'))
  9395. if (!this.authSearch) {
  9396. this.getDataList()
  9397. }
  9398. } else {
  9399. this.$message.error(
  9400. (data && data.msg) || this.$t('qc.partAttributePage.dataSyncFail')
  9401. )
  9402. }
  9403. })
  9404. .catch(() => {
  9405. this.syncLoading = false
  9406. })
  9407. },
  9408. openDieMoldAddModal() {
  9409. const defaultBu = this.buList.length > 0 ? this.buList[0] : null
  9410. const defaultUm = this.umList.length > 0 ? this.umList[0] : { umId: '' }
  9411. this.dieMoldAddData = {
  9412. bu: defaultBu ? defaultBu.buNo : '',
  9413. site: defaultBu ? defaultBu.site : this.$store.state.user.site || '',
  9414. buNo: this.parseBuNo(defaultBu ? defaultBu.buNo : ''),
  9415. partNo: '',
  9416. partDesc: '',
  9417. partType: this.$t('qc.partAttributePage.dieMoldPartType'),
  9418. spec: '',
  9419. umId: defaultUm.umId,
  9420. remark: '',
  9421. handle: 'Y',
  9422. active: 'Y',
  9423. createBy: this.$store.state.user.name,
  9424. }
  9425. this.dieMoldAddModalFlag = true
  9426. this.$nextTick(() => {
  9427. if (this.$refs.dieMoldAddForm) {
  9428. this.$refs.dieMoldAddForm.clearValidate()
  9429. }
  9430. })
  9431. },
  9432. parseBuNo(buValue) {
  9433. if (!buValue || buValue.indexOf('_') < 0) {
  9434. return ''
  9435. }
  9436. return buValue.split('_')[1]
  9437. },
  9438. onDieMoldAddBuChange(buValue) {
  9439. const selected = this.buList.find((item) => item.buNo === buValue)
  9440. this.dieMoldAddData.site = selected ? selected.site : ''
  9441. this.dieMoldAddData.buNo = this.parseBuNo(buValue)
  9442. },
  9443. saveDieMoldPart() {
  9444. this.$refs.dieMoldAddForm.validate((valid) => {
  9445. if (!valid) {
  9446. return
  9447. }
  9448. this.onDieMoldAddBuChange(this.dieMoldAddData.bu)
  9449. if (!this.dieMoldAddData.site || !this.dieMoldAddData.buNo) {
  9450. this.$message.warning(this.$t('qc.common.pleaseSelectBu'))
  9451. return
  9452. }
  9453. this.dieMoldAddSaveLoading = true
  9454. const submitData = {
  9455. ...this.dieMoldAddData,
  9456. partType: '刀模',
  9457. handle: 'Y',
  9458. createBy: this.$store.state.user.name,
  9459. }
  9460. qcPartDieMoldAdd(submitData)
  9461. .then(({ data }) => {
  9462. if (data && data.code === 0) {
  9463. this.$message.success(this.$t('qc.partAttributePage.dieMoldAddSuccess'))
  9464. this.dieMoldAddModalFlag = false
  9465. if (!this.authSearch) {
  9466. this.getDataList()
  9467. }
  9468. } else {
  9469. this.$message.error(data.msg)
  9470. }
  9471. })
  9472. .finally(() => {
  9473. this.dieMoldAddSaveLoading = false
  9474. })
  9475. })
  9476. },
  9477. },
  9478. }
  9479. </script>
  9480. <style scoped>
  9481. /deep/ .customer-tab .el-tabs__content {
  9482. padding: 5px !important;
  9483. }
  9484. .el-table /deep/ .cell {
  9485. height: auto;
  9486. line-height: 1.5;
  9487. }
  9488. /* 主表去掉行悬停变灰效果,保留选中行高亮 */
  9489. /deep/ .part-table.el-table--enable-row-hover .el-table__body tr:hover > td {
  9490. background-color: #fff !important;
  9491. }
  9492. /deep/ .part-table .el-table__body tr.part-row-selected > td,
  9493. /deep/ .part-table .el-table__body tr.part-row-selected:hover > td {
  9494. background-color: #cbe2f5 !important;
  9495. }
  9496. /* 物料编辑弹出框样式 - 超紧凑版 */
  9497. .part-edit-dialog .dialog-content {
  9498. padding: 8px;
  9499. max-height: 70vh;
  9500. }
  9501. .part-edit-dialog .form-section {
  9502. margin-bottom: 12px;
  9503. padding: 8px;
  9504. border-radius: 4px;
  9505. border-left: 2px solid #17b3a3;
  9506. }
  9507. .part-edit-dialog .section-title {
  9508. font-size: 13px;
  9509. font-weight: 600;
  9510. color: #303133;
  9511. margin-bottom: 2px;
  9512. padding-bottom: 3px;
  9513. border-bottom: 1px solid #e4e7ed;
  9514. }
  9515. .part-edit-dialog .el-form-item {
  9516. margin-bottom: 6px;
  9517. }
  9518. .part-edit-dialog .el-form-item__label {
  9519. font-weight: 500;
  9520. color: #606266;
  9521. font-size: 12px;
  9522. line-height: 1.2;
  9523. }
  9524. .part-edit-dialog .el-input__inner,
  9525. .part-edit-dialog .el-input-number .el-input__inner {
  9526. border-radius: 4px;
  9527. font-size: 12px;
  9528. height: 32px;
  9529. line-height: 32px;
  9530. }
  9531. .part-edit-dialog .el-input-group .el-input:first-child .el-input__inner {
  9532. border-right: 0;
  9533. border-top-right-radius: 0;
  9534. border-bottom-right-radius: 0;
  9535. }
  9536. .part-edit-dialog .el-input-group .el-input:last-child .el-input__inner {
  9537. border-left: 0;
  9538. border-top-left-radius: 0;
  9539. border-bottom-left-radius: 0;
  9540. }
  9541. .part-edit-dialog .el-checkbox {
  9542. font-size: 12px;
  9543. line-height: 1.2;
  9544. }
  9545. .part-edit-dialog .el-select .el-input__inner {
  9546. height: 32px;
  9547. line-height: 32px;
  9548. }
  9549. /* 检验模板弹出框样式 - 超紧凑版 */
  9550. .inspection-template-dialog .template-header {
  9551. padding: 10px;
  9552. background: #f5f7fa;
  9553. border-radius: 4px;
  9554. margin-bottom: 10px;
  9555. border: 1px solid #e4e7ed;
  9556. }
  9557. .inspection-template-dialog .template-header .el-form-item {
  9558. margin-bottom: 0;
  9559. }
  9560. .inspection-template-dialog .template-header .el-form-item__label {
  9561. font-weight: 600;
  9562. color: #303133;
  9563. font-size: 12px;
  9564. }
  9565. .inspection-template-dialog .template-header .el-input__inner {
  9566. font-size: 12px;
  9567. height: 32px;
  9568. line-height: 32px;
  9569. }
  9570. .inspection-template-dialog .template-table-container {
  9571. border-radius: 6px;
  9572. overflow: hidden;
  9573. border: 1px solid #e4e7ed;
  9574. }
  9575. .inspection-template-dialog .inspection-table {
  9576. font-size: 12px;
  9577. }
  9578. .inspection-template-dialog .inspection-table .el-table__header-wrapper th {
  9579. background: #f5f7fa;
  9580. color: #303133;
  9581. font-weight: 600;
  9582. font-size: 12px;
  9583. padding: 8px 0;
  9584. }
  9585. .inspection-template-dialog .input-button-group {
  9586. display: flex;
  9587. align-items: center;
  9588. gap: 8px;
  9589. }
  9590. .inspection-template-dialog .select-button {
  9591. min-width: 45px;
  9592. padding: 3px 8px;
  9593. font-size: 11px;
  9594. border: 1px solid #dcdfe6;
  9595. border-radius: 3px;
  9596. background: #fff;
  9597. color: #606266;
  9598. transition: all 0.2s;
  9599. }
  9600. .inspection-template-dialog .select-button:hover {
  9601. color: #409eff;
  9602. border-color: #c6e2ff;
  9603. background-color: #ecf5ff;
  9604. }
  9605. .inspection-template-dialog .readonly-input {
  9606. flex: 1;
  9607. }
  9608. .inspection-template-dialog .readonly-input .el-input__inner {
  9609. background-color: #f5f7fa;
  9610. border-color: #e4e7ed;
  9611. font-size: 11px;
  9612. height: 28px;
  9613. line-height: 28px;
  9614. }
  9615. .inspection-template-dialog .el-input-number {
  9616. width: 100%;
  9617. }
  9618. .inspection-template-dialog .el-input-number .el-input__inner {
  9619. text-align: center;
  9620. font-size: 11px;
  9621. height: 28px;
  9622. line-height: 28px;
  9623. }
  9624. .inspection-template-dialog .el-input__inner {
  9625. font-size: 11px;
  9626. height: 28px;
  9627. line-height: 28px;
  9628. }
  9629. /* 按钮样式 - 保持Element UI风格 */
  9630. /* 删除按钮样式 */
  9631. .inspection-template-dialog .el-button[style*='color: #f56c6c'] {
  9632. color: #f56c6c !important;
  9633. font-size: 11px;
  9634. padding: 3px 8px;
  9635. }
  9636. .inspection-template-dialog .el-button[style*='color: #f56c6c']:hover {
  9637. color: #f78989 !important;
  9638. }
  9639. /* 响应式设计 */
  9640. @media (max-width: 1200px) {
  9641. .part-edit-dialog {
  9642. width: 95% !important;
  9643. }
  9644. .inspection-template-dialog {
  9645. width: 95% !important;
  9646. }
  9647. }
  9648. @media (max-width: 768px) {
  9649. .part-edit-dialog .el-col,
  9650. .inspection-template-dialog .el-col {
  9651. margin-bottom: 15px;
  9652. }
  9653. .inspection-template-dialog .input-button-group {
  9654. flex-direction: column;
  9655. gap: 5px;
  9656. }
  9657. .inspection-template-dialog .select-button {
  9658. width: 100%;
  9659. }
  9660. }
  9661. /* 表格行悬停效果 */
  9662. .inspection-template-dialog
  9663. .el-table--enable-row-hover
  9664. .el-table__body
  9665. tr:hover
  9666. > td {
  9667. background-color: #f5f7fa;
  9668. }
  9669. /* 仓库配置区域特殊样式 */
  9670. .part-edit-dialog .form-section .el-input-group {
  9671. display: flex;
  9672. width: 100%;
  9673. }
  9674. .part-edit-dialog .form-section .el-input-group .el-input:first-child {
  9675. flex: 0 0 25%;
  9676. }
  9677. .part-edit-dialog .form-section .el-input-group .el-input:last-child {
  9678. flex: 1;
  9679. }
  9680. .part-edit-dialog .form-section .el-input-group .el-input__inner {
  9681. border-radius: 0;
  9682. }
  9683. .part-edit-dialog
  9684. .form-section
  9685. .el-input-group
  9686. .el-input:first-child
  9687. .el-input__inner {
  9688. border-top-left-radius: 4px;
  9689. border-bottom-left-radius: 4px;
  9690. border-right: 0;
  9691. }
  9692. .part-edit-dialog
  9693. .form-section
  9694. .el-input-group
  9695. .el-input:last-child
  9696. .el-input__inner {
  9697. border-top-right-radius: 4px;
  9698. border-bottom-right-radius: 4px;
  9699. border-left: 0;
  9700. }
  9701. /* 滚动条样式 */
  9702. .part-edit-dialog .dialog-content::-webkit-scrollbar {
  9703. width: 6px;
  9704. }
  9705. .part-edit-dialog .dialog-content::-webkit-scrollbar-track {
  9706. background: #f1f1f1;
  9707. border-radius: 3px;
  9708. }
  9709. .part-edit-dialog .dialog-content::-webkit-scrollbar-thumb {
  9710. background: #c0c4cc;
  9711. border-radius: 3px;
  9712. }
  9713. .part-edit-dialog .dialog-content::-webkit-scrollbar-thumb:hover {
  9714. background: #909399;
  9715. }
  9716. /* ==================== 检验标准维护配置对话框样式 ==================== */
  9717. /deep/ .config-dialog {
  9718. border-radius: 8px;
  9719. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  9720. }
  9721. /deep/ .config-dialog .el-dialog__header {
  9722. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  9723. padding: 20px 24px;
  9724. border-radius: 8px 8px 0 0;
  9725. }
  9726. /deep/ .config-dialog .el-dialog__title {
  9727. color: #ffffff;
  9728. font-size: 18px;
  9729. font-weight: 600;
  9730. }
  9731. /deep/ .config-dialog .el-dialog__headerbtn .el-dialog__close {
  9732. color: #ffffff;
  9733. font-size: 20px;
  9734. font-weight: bold;
  9735. }
  9736. /deep/ .config-dialog .el-dialog__headerbtn .el-dialog__close:hover {
  9737. color: #f0f0f0;
  9738. }
  9739. /deep/ .config-dialog .el-dialog__body {
  9740. padding: 0;
  9741. background: #f5f7fa;
  9742. }
  9743. .qc-spec-batch-fill-content {
  9744. padding: 20px 24px;
  9745. background: #ffffff;
  9746. .el-form-item {
  9747. margin-bottom: 16px;
  9748. }
  9749. ::v-deep .el-form-item__label {
  9750. line-height: 1.4;
  9751. padding-bottom: 4px;
  9752. }
  9753. ::v-deep .el-form-item__label a {
  9754. color: #20b2aa;
  9755. cursor: pointer;
  9756. text-decoration: none;
  9757. &:hover {
  9758. text-decoration: underline;
  9759. }
  9760. }
  9761. }
  9762. .qc-spec-sync-content {
  9763. padding: 20px 24px;
  9764. background: #ffffff;
  9765. .el-form-item {
  9766. margin-bottom: 16px;
  9767. }
  9768. .qc-spec-sync-fields {
  9769. margin-top: 8px;
  9770. .el-col {
  9771. margin-bottom: 12px;
  9772. }
  9773. }
  9774. .qc-spec-sync-hint {
  9775. margin-top: 4px;
  9776. color: #909399;
  9777. font-size: 12px;
  9778. line-height: 1.5;
  9779. }
  9780. }
  9781. /* 查询区域 */
  9782. .search-section {
  9783. padding: 16px 24px;
  9784. background: #ffffff;
  9785. border-bottom: 1px solid #e8e8e8;
  9786. }
  9787. .search-section .el-form {
  9788. margin-bottom: 0;
  9789. }
  9790. .search-section .el-form-item {
  9791. margin-bottom: 0;
  9792. }
  9793. /* 项目操作容器 */
  9794. .item-operation-content {
  9795. display: flex;
  9796. gap: 16px;
  9797. align-items: stretch;
  9798. padding: 16px;
  9799. }
  9800. /* 面板样式 */
  9801. .item-panel {
  9802. flex: 1;
  9803. min-width: 0;
  9804. background: #ffffff;
  9805. border-radius: 6px;
  9806. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  9807. overflow: hidden;
  9808. transition: all 0.3s ease;
  9809. }
  9810. .item-panel:hover {
  9811. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  9812. }
  9813. .available-panel,
  9814. .selected-panel {
  9815. flex: 1;
  9816. }
  9817. /* 面板头部 */
  9818. .panel-header {
  9819. padding: 8px 16px;
  9820. background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%);
  9821. border-bottom: 2px solid #9ac3d0;
  9822. display: flex;
  9823. align-items: center;
  9824. gap: 8px;
  9825. }
  9826. .panel-header i {
  9827. font-size: 18px;
  9828. color: #ffffff;
  9829. }
  9830. .panel-title {
  9831. font-size: 15px;
  9832. font-weight: 600;
  9833. color: #ffffff;
  9834. flex: 1;
  9835. }
  9836. .qc-spec-copy-hint {
  9837. margin-bottom: 12px;
  9838. font-size: 13px;
  9839. color: #606266;
  9840. }
  9841. .qc-spec-copy-content {
  9842. height: 100%;
  9843. display: flex;
  9844. flex-direction: column;
  9845. min-height: 0;
  9846. padding: 10px 18px 8px;
  9847. background: #ffffff;
  9848. overflow: hidden;
  9849. }
  9850. .qc-spec-copy-search-form {
  9851. display: flex;
  9852. flex-wrap: wrap;
  9853. align-items: center;
  9854. flex-shrink: 0;
  9855. margin-bottom: 2px;
  9856. }
  9857. .qc-spec-copy-search-form .el-form-item {
  9858. margin: 0 14px 8px 0;
  9859. }
  9860. .qc-spec-copy-available,
  9861. .qc-spec-copy-selected {
  9862. display: flex;
  9863. flex-direction: column;
  9864. min-height: 0;
  9865. }
  9866. .qc-spec-copy-available {
  9867. flex: 1.5;
  9868. }
  9869. .qc-spec-copy-selected {
  9870. flex: 1;
  9871. }
  9872. .qc-spec-copy-table-wrap {
  9873. position: relative;
  9874. flex: 1;
  9875. min-height: 0;
  9876. }
  9877. .qc-spec-copy-table-wrap .el-table {
  9878. position: absolute;
  9879. left: 0;
  9880. right: 0;
  9881. top: 0;
  9882. bottom: 0;
  9883. height: 100% !important;
  9884. }
  9885. .qc-spec-copy-section-header {
  9886. display: flex;
  9887. align-items: center;
  9888. justify-content: space-between;
  9889. flex-wrap: wrap;
  9890. flex-shrink: 0;
  9891. min-height: 36px;
  9892. margin-bottom: 6px;
  9893. }
  9894. .qc-spec-copy-section-header .el-button {
  9895. margin-left: 12px;
  9896. }
  9897. .qc-spec-copy-section-title {
  9898. color: #303133;
  9899. font-size: 14px;
  9900. font-weight: 600;
  9901. }
  9902. .qc-spec-copy-pagination {
  9903. display: flex;
  9904. flex-wrap: wrap;
  9905. align-items: center;
  9906. flex-shrink: 0;
  9907. margin-top: 8px;
  9908. }
  9909. .qc-spec-copy-added-header {
  9910. margin-top: 8px;
  9911. padding-top: 8px;
  9912. border-top: 1px solid #dcdfe6;
  9913. }
  9914. .qc-spec-copy-remove-button {
  9915. color: #f56c6c;
  9916. font-size: 17px;
  9917. }
  9918. .qc-spec-add-apply-link {
  9919. color: #409eff;
  9920. cursor: pointer;
  9921. }
  9922. .qc-spec-add-apply-link:hover {
  9923. text-decoration: underline;
  9924. }
  9925. .qc-spec-add-apply-link.is-disabled {
  9926. color: #c0c4cc;
  9927. cursor: not-allowed;
  9928. text-decoration: none;
  9929. }
  9930. .qc-spec-add-apply-input {
  9931. position: relative;
  9932. width: 100%;
  9933. }
  9934. .qc-spec-add-apply-input /deep/ .is-clearable .el-input__inner {
  9935. padding-right: 28px;
  9936. }
  9937. .qc-spec-add-apply-clear {
  9938. position: absolute;
  9939. right: 8px;
  9940. top: 50%;
  9941. transform: translateY(-50%);
  9942. z-index: 2;
  9943. font-size: 14px;
  9944. line-height: 1;
  9945. cursor: pointer;
  9946. color: #c0c4cc;
  9947. }
  9948. .qc-spec-add-apply-clear:hover {
  9949. color: #909399;
  9950. }
  9951. .qc-spec-pending-clear-btn {
  9952. color: #f56c6c;
  9953. padding: 0 2px;
  9954. margin-left: 2px;
  9955. }
  9956. .qc-spec-pending-clear-btn:hover {
  9957. color: #f78989;
  9958. }
  9959. .qc-spec-warning-dialog {
  9960. padding: 16px 20px 12px;
  9961. background: #f5f7fa;
  9962. }
  9963. .qc-spec-warning-header {
  9964. display: flex;
  9965. justify-content: space-between;
  9966. align-items: center;
  9967. }
  9968. .qc-spec-warning-item-info {
  9969. font-size: 13px;
  9970. color: #606266;
  9971. }
  9972. .qc-spec-warning-footer {
  9973. margin-top: 16px;
  9974. text-align: center;
  9975. }
  9976. /deep/ .qc-spec-warning-dialog .el-color-picker {
  9977. vertical-align: middle;
  9978. }
  9979. .item-count {
  9980. font-size: 13px;
  9981. color: #ffffff;
  9982. background: rgba(255, 255, 255, 0.2);
  9983. padding: 2px 10px;
  9984. border-radius: 12px;
  9985. font-weight: 500;
  9986. }
  9987. /* 表格样式 */
  9988. .operation-table {
  9989. border: none;
  9990. width: 100%;
  9991. }
  9992. .available-panel /deep/ .operation-table .el-table__body-wrapper {
  9993. overflow-x: auto;
  9994. }
  9995. /deep/ .operation-table .el-table__body-wrapper {
  9996. max-height: 420px;
  9997. overflow-y: auto;
  9998. }
  9999. /deep/ .operation-table .el-table__row {
  10000. cursor: pointer;
  10001. transition: background-color 0.2s ease;
  10002. }
  10003. /deep/ .operation-table .el-table__row:hover {
  10004. background-color: #f0f9ff !important;
  10005. }
  10006. /deep/ .operation-table .current-row > td {
  10007. background-color: #e6f7ff !important;
  10008. }
  10009. /* 操作按钮 */
  10010. .operation-buttons {
  10011. display: flex;
  10012. flex-direction: column;
  10013. justify-content: center;
  10014. align-items: center;
  10015. gap: 20px;
  10016. padding: 0 8px;
  10017. }
  10018. .operation-buttons .el-button {
  10019. width: 48px;
  10020. height: 48px;
  10021. font-size: 20px;
  10022. transition: all 0.3s ease;
  10023. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  10024. }
  10025. .operation-buttons .el-button:hover {
  10026. transform: scale(1.1);
  10027. box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  10028. }
  10029. .operation-buttons .el-button.is-disabled {
  10030. opacity: 0.4;
  10031. cursor: not-allowed;
  10032. }
  10033. .operation-buttons .el-button--primary {
  10034. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  10035. border: none;
  10036. }
  10037. .operation-buttons .el-button--danger {
  10038. background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  10039. border: none;
  10040. }
  10041. /* 底部按钮 */
  10042. .dialog-footer {
  10043. text-align: center;
  10044. padding: 16px 0 16px 0;
  10045. }
  10046. .dialog-footer .el-button {
  10047. min-width: 100px;
  10048. font-weight: 500;
  10049. }
  10050. /* 响应式优化 */
  10051. @media (max-width: 1300px) {
  10052. .item-operation-content {
  10053. gap: 12px;
  10054. }
  10055. .operation-buttons .el-button {
  10056. width: 42px;
  10057. height: 42px;
  10058. font-size: 18px;
  10059. }
  10060. }
  10061. /* 文件采集配置-新增弹框(参考合并卷) */
  10062. .file-collect-add-dialog {
  10063. ::v-deep .el-dialog {
  10064. border-radius: 8px;
  10065. overflow: hidden;
  10066. .el-dialog__header {
  10067. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  10068. padding: 18px 20px;
  10069. .el-dialog__title {
  10070. color: #fff;
  10071. font-size: 16px;
  10072. font-weight: 600;
  10073. }
  10074. .el-dialog__headerbtn .el-dialog__close {
  10075. color: #fff;
  10076. font-size: 18px;
  10077. &:hover {
  10078. color: #f0f0f0;
  10079. }
  10080. }
  10081. }
  10082. .el-dialog__body {
  10083. padding: 25px;
  10084. background-color: #f8f9fa;
  10085. }
  10086. .el-dialog__footer {
  10087. padding: 15px 20px;
  10088. background-color: #fff;
  10089. border-top: 1px solid #e9ecef;
  10090. }
  10091. }
  10092. }
  10093. .file-collect-add-content {
  10094. .form-item-enhanced {
  10095. margin-bottom: 15px;
  10096. ::v-deep .el-form-item__label {
  10097. color: #495057;
  10098. font-weight: 500;
  10099. font-size: 14px;
  10100. margin-bottom: 8px;
  10101. line-height: 1.4;
  10102. }
  10103. ::v-deep .el-input__inner {
  10104. border-radius: 6px;
  10105. border: 1px solid #dee2e6;
  10106. transition: all 0.3s;
  10107. height: 42px;
  10108. line-height: 42px;
  10109. font-size: 15px;
  10110. &:focus {
  10111. border-color: #667eea;
  10112. box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  10113. }
  10114. }
  10115. ::v-deep .el-input-number {
  10116. width: 100%;
  10117. .el-input__inner {
  10118. text-align: left;
  10119. }
  10120. }
  10121. }
  10122. .form-item-checkbox {
  10123. ::v-deep .el-form-item__content {
  10124. line-height: 42px;
  10125. }
  10126. ::v-deep .el-checkbox__label {
  10127. font-size: 14px;
  10128. color: #495057;
  10129. }
  10130. }
  10131. .field-link-label {
  10132. color: #667eea;
  10133. cursor: pointer;
  10134. font-weight: 500;
  10135. &:hover {
  10136. color: #764ba2;
  10137. text-decoration: underline;
  10138. }
  10139. }
  10140. .roll-info-card {
  10141. background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  10142. border-radius: 8px;
  10143. padding: 16px;
  10144. margin-bottom: 15px;
  10145. border: 1px solid #e3e8f0;
  10146. box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
  10147. .info-header {
  10148. display: flex;
  10149. align-items: center;
  10150. margin-bottom: 12px;
  10151. padding-bottom: 10px;
  10152. border-bottom: 1px solid #dee2e6;
  10153. i {
  10154. font-size: 18px;
  10155. color: #667eea;
  10156. margin-right: 8px;
  10157. }
  10158. span {
  10159. font-size: 14px;
  10160. font-weight: 600;
  10161. color: #495057;
  10162. }
  10163. }
  10164. .info-content {
  10165. padding-top: 5px;
  10166. }
  10167. }
  10168. .total-info-card {
  10169. background: linear-gradient(135deg, #17b3a320 0%, #13998b20 100%);
  10170. border-radius: 8px;
  10171. padding: 16px 20px;
  10172. border: 1px solid #17b3a350;
  10173. box-shadow: 0 2px 8px rgba(23, 179, 163, 0.1);
  10174. .total-row {
  10175. display: flex;
  10176. justify-content: space-between;
  10177. align-items: center;
  10178. .total-label {
  10179. font-size: 16px;
  10180. font-weight: 600;
  10181. color: #495057;
  10182. }
  10183. .total-value {
  10184. font-size: 24px;
  10185. font-weight: 700;
  10186. color: #17b3a3;
  10187. }
  10188. }
  10189. }
  10190. }
  10191. .file-collect-add-footer {
  10192. display: flex;
  10193. justify-content: center;
  10194. gap: 12px;
  10195. padding: 0;
  10196. .action-btn {
  10197. min-width: 80px;
  10198. padding: 6px 16px;
  10199. border-radius: 16px;
  10200. font-size: 13px;
  10201. font-weight: 500;
  10202. cursor: pointer;
  10203. transition: all 0.2s ease;
  10204. display: inline-flex;
  10205. align-items: center;
  10206. justify-content: center;
  10207. gap: 4px;
  10208. &:disabled {
  10209. opacity: 0.6;
  10210. cursor: not-allowed;
  10211. }
  10212. &.secondary {
  10213. background: white;
  10214. border: 1px solid #17b3a3;
  10215. color: #17b3a3;
  10216. &:hover:not(:disabled) {
  10217. background: #17b3a3;
  10218. color: white;
  10219. }
  10220. &:active:not(:disabled) {
  10221. transform: scale(0.98);
  10222. }
  10223. }
  10224. }
  10225. }
  10226. .qc-spec-cell-picker {
  10227. display: flex;
  10228. align-items: center;
  10229. width: 100%;
  10230. gap: 4px;
  10231. }
  10232. .qc-spec-cell-picker-btn {
  10233. flex-shrink: 0;
  10234. padding: 3px 4px;
  10235. }
  10236. .qc-spec-cell-picker-input {
  10237. flex: 1;
  10238. min-width: 0;
  10239. }
  10240. .qc-spec-type-bar {
  10241. margin: 0 2px;
  10242. border-bottom: 2px solid #e4e7ed;
  10243. line-height: 1;
  10244. }
  10245. .qc-spec-type-item {
  10246. display: inline-block;
  10247. padding: 8px 16px 6px;
  10248. cursor: pointer;
  10249. color: #303133;
  10250. font-size: 14px;
  10251. border-bottom: 2px solid transparent;
  10252. margin-bottom: -2px;
  10253. user-select: none;
  10254. }
  10255. .qc-spec-type-item:hover {
  10256. color: #17b3a3;
  10257. }
  10258. .qc-spec-type-item.is-active {
  10259. color: #17b3a3;
  10260. border-bottom-color: #17b3a3;
  10261. }
  10262. .qc-spec-toolbar-form {
  10263. margin-top: 2px;
  10264. margin-bottom: 0;
  10265. }
  10266. .qc-spec-table ::v-deep .qc-spec-row-draggable {
  10267. cursor: move;
  10268. }
  10269. .qc-spec-sortable-ghost {
  10270. opacity: 0.4;
  10271. background: #e8f4ff !important;
  10272. }
  10273. </style>
  10274. <style>
  10275. /* The dialog is appended to body, so its size rules must not be scoped. */
  10276. .qc-spec-copy-dialog {
  10277. width: 92% !important;
  10278. max-width: none !important;
  10279. height: 92vh !important;
  10280. margin-top: 4vh !important;
  10281. margin-bottom: 0 !important;
  10282. display: flex;
  10283. flex-direction: column;
  10284. }
  10285. .qc-spec-copy-dialog .el-dialog__body {
  10286. flex: 1;
  10287. min-height: 0;
  10288. max-height: none;
  10289. overflow: hidden;
  10290. padding: 0;
  10291. }
  10292. .qc-spec-copy-dialog .el-dialog__footer {
  10293. flex-shrink: 0;
  10294. }
  10295. @media (max-width: 840px) {
  10296. .qc-spec-copy-dialog {
  10297. width: 92% !important;
  10298. max-width: 92% !important;
  10299. }
  10300. }
  10301. </style>