plm前端
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.

5155 lines
228 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
5 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="序列号">
  6. <el-input v-model="searchData.referenceNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item label="单据状态">
  9. <el-select v-model="searchData.status" clearable style="width: 120px">
  10. <el-option label="草稿" value="草稿"></el-option>
  11. <el-option label="审批中" value="审批中"></el-option>
  12. <el-option label="已完成" value="已完成"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="RoHS状态">
  16. <el-select v-model="searchData.rohsStatus" clearable style="width: 120px">
  17. <el-option label="Active" value="Active"></el-option>
  18. <el-option label="Dead" value="Dead"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="节点审批人">
  22. <el-input v-model="searchData.currentApprover" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item label="当前节点">
  25. <el-select v-model="searchData.nodeId" placeholder="请选择节点" clearable style="width: 120px">
  26. <el-option
  27. v-for="option in nodeOptions"
  28. :key="option.id"
  29. :label="option.name"
  30. :value="option.id">
  31. </el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item label="IFS物料编码">
  35. <el-input v-model="searchData.ifsPartNo" clearable style="width: 140px"></el-input>
  36. </el-form-item>
  37. <el-form-item label="IFS物料描述">
  38. <el-input v-model="searchData.materialDesc" clearable style="width: 180px"></el-input>
  39. </el-form-item>
  40. <el-form-item :label="' '">
  41. <el-button v-if="authSearch" @click="getDataList">查询</el-button>
  42. <el-button v-if="authUpdate" @click="addOrUpdateHandle()">新增</el-button>
  43. <el-button v-if="authDelete" type="danger" @click="deleteHandle()">删除</el-button>
  44. <download-excel
  45. v-if="authSearch"
  46. :fields="exportFieldMap"
  47. :data="exportData"
  48. type="xls"
  49. :name="exportName"
  50. :header="exportHeader"
  51. :footer="exportFooter"
  52. :fetch="createExportData"
  53. :before-generate="startDownload"
  54. :before-finish="finishDownload"
  55. worksheet="导出信息"
  56. :class="['el-button', 'el-button--primary', 'el-button--medium', {'is-loading': exportLoading}]">
  57. <i v-if="exportLoading" class="el-icon-loading"></i>
  58. <span>{{ "导出" }}</span>
  59. </download-excel>
  60. <el-button v-if="authSearch" @click="searchHandle()">搜索</el-button>
  61. </el-form-item>
  62. </el-form>
  63. <!-- 列表 -->
  64. <el-table
  65. ref="rohsTable"
  66. :height="height"
  67. :data="dataList"
  68. border
  69. :row-style="rowStyle"
  70. @row-click="changeClickRow"
  71. @current-change="currentChange"
  72. @selection-change="dataListSelectionChange"
  73. v-loading="dataListLoading"
  74. style="width: 100%;">
  75. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  76. <el-table-column prop="process" header-align="center" align="left" label="工艺" width="80"></el-table-column>
  77. <el-table-column prop="referenceNo" header-align="center" align="center" label="序列号" width="150"></el-table-column>
  78. <el-table-column prop="status" header-align="center" align="left" label="单据状态" width="100"></el-table-column>
  79. <el-table-column prop="nodeName" header-align="center" align="left" label="当前节点" width="150"></el-table-column>
  80. <el-table-column prop="currentApprover" header-align="center" align="left" label="当前节点审批人" width="120"></el-table-column>
  81. <el-table-column prop="applicant" header-align="center" align="left" label="申请人" width="120"></el-table-column>
  82. <el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="130"></el-table-column>
  83. <el-table-column prop="vendorCode" header-align="center" align="left" label="供应商" width="120"></el-table-column>
  84. <el-table-column prop="vendorMaterialCode" header-align="center" align="left" label="供应商材料" width="150" :show-overflow-tooltip="true"></el-table-column>
  85. <el-table-column prop="materialClassify" header-align="center" align="left" label="材料分类" width="250" :show-overflow-tooltip="true"></el-table-column>
  86. <el-table-column prop="endCustomer" header-align="center" align="left" label="最终客户编码" width="100"></el-table-column>
  87. <el-table-column prop="endCustomerName" header-align="center" align="left" label="最终客户名称" width="150"></el-table-column>
  88. <el-table-column prop="projectId" header-align="center" align="left" label="项目编码" width="100"></el-table-column>
  89. <el-table-column prop="projectName" header-align="center" align="left" label="项目名称" width="150"></el-table-column>
  90. <el-table-column prop="materialDesc" header-align="center" align="left" label="材料描述" width="180" :show-overflow-tooltip="true"></el-table-column>
  91. <el-table-column prop="mainIfsPartNo" header-align="center" align="left" label="IFS物料编码" width="120">
  92. <template slot-scope="scope">
  93. <span>{{ scope.row.mainIfsPartNo || scope.row.ifsPartNo || '' }}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column prop="mainPartDesc" header-align="center" align="left" label="IFS物料描述" width="250" :show-overflow-tooltip="true">
  97. <template slot-scope="scope">
  98. <span>{{ scope.row.mainPartDesc || scope.row.materialDesc || '' }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期" width="100"></el-table-column>
  102. <el-table-column prop="expiryDate" header-align="center" align="center" label="失效日期" width="130">
  103. <template slot-scope="scope">
  104. <span>{{ normalizeDateOnly(scope.row.expiryDate) }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
  108. <template slot-scope="scope">
  109. <el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
  110. <el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
  111. <el-link v-if="authIssue && scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <!-- 分页 -->
  116. <el-pagination style="margin-top: 0px"
  117. @size-change="sizeChangeHandle"
  118. @current-change="currentChangeHandle"
  119. :current-page="pageIndex"
  120. :page-sizes="[20, 50, 100, 200, 500]"
  121. :page-size="pageSize"
  122. :total="totalPage"
  123. layout="total, sizes, prev, pager, next, jumper">
  124. </el-pagination>
  125. <!-- 编辑模态框 -->
  126. <el-dialog
  127. :title="modalTitle"
  128. :visible.sync="modalFlag"
  129. width="1012px"
  130. top="3.8vh"
  131. v-drag
  132. :close-on-click-modal="false"
  133. :showClose="false">
  134. <el-tabs tab-position="left" type="border-card" v-model="activeName" style="width: 100%;height: 777px;">
  135. <!-- 基本信息 -->
  136. <el-tab-pane label="基本信息" name="basicInfo">
  137. <div style="height: 755px">
  138. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  139. <el-form-item>
  140. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Reference No.</a></span>
  141. <span v-else slot="label">申请人/Reference No.</span>
  142. <el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isRohsFieldDisabled('applicant')" style="width: 100px"></el-input>
  143. <el-input v-model="modalData.applicantName" disabled style="width: 155px"></el-input>
  144. </el-form-item>
  145. <el-form-item label="申请日期/Date">
  146. <el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('applicationDate')" style="width: 150px" :editable=false></el-date-picker>
  147. </el-form-item>
  148. <el-form-item label="Site">
  149. <el-input v-model="modalData.site" disabled style="width: 95px"></el-input>
  150. </el-form-item>
  151. <el-form-item label="工艺/Process">
  152. <dict-data-select v-model="modalData.process" clearable @change="handleProcessChange" :disabled="isProcessFieldDisabled()" style="width: 121px" dict-type="rohs_process"></dict-data-select>
  153. </el-form-item>
  154. </el-form>
  155. <el-form :inline="true" label-position="top" :model="modalData">
  156. <el-form-item>
  157. <span slot="label" v-if="!modalData.endCustomerFlag && !isRohsFieldDisabled('endCustomer')" @click="getBaseList(102, 1)"><a herf="#">最终客户/End Customer</a></span>
  158. <span slot="label" v-else>最终客户/End Customer</span>
  159. <el-input :disabled="modalData.endCustomerFlag || isRohsFieldDisabled('endCustomer')" readonly v-model="modalData.endCustomer" @blur="handleQueryCustomer" style="width: 100px"></el-input>
  160. <el-input disabled v-model="modalData.endCustomerName" style="width: 155px"></el-input>
  161. </el-form-item>
  162. <el-form-item>
  163. <span slot="label" v-if="!modalData.projectIdFlag && !isRohsFieldDisabled('projectId')" @click="chooseProjectListFlag = true"><a herf="#">项目编码/Project</a></span>
  164. <span slot="label" v-else>项目编码/Project</span>
  165. <el-input :disabled="modalData.projectIdFlag || isRohsFieldDisabled('projectId')" readonly v-model="modalData.projectId" @blur="handleQueryProjectByCustomer" style="width: 100px"></el-input>
  166. <el-input disabled v-model="modalData.projectName" style="width: 155px"></el-input>
  167. </el-form-item>
  168. <el-form-item label="WM所需求规格/The size that WM need">
  169. <el-input v-model="modalData.wmRequiredSpec" :disabled="isRohsFieldDisabled('wmRequiredSpec')" style="width: 260px"></el-input>
  170. </el-form-item>
  171. </el-form>
  172. <el-form :inline="true" label-position="top" :model="modalData">
  173. <el-form-item label="供应商/Vendor Code">
  174. <el-input v-model="modalData.vendorCode" :disabled="isRohsFieldDisabled('vendorCode')" style="width: 396px"></el-input>
  175. </el-form-item>
  176. <el-form-item label="供应商材料编码/Vendor Material Code">
  177. <el-input v-model="modalData.vendorMaterialCode" :disabled="isRohsFieldDisabled('vendorMaterialCode')" style="width: 396px"></el-input>
  178. </el-form-item>
  179. </el-form>
  180. <el-form :inline="true" label-position="top" :model="modalData">
  181. <el-form-item label="材料分类/Material Classify">
  182. <dict-data-select class="rohs-multiple-two-rows" v-model="modalData.materialClassifyList" multiple :title="getMultipleSelectTitle(modalData.materialClassifyList)" :disabled="isRohsFieldDisabled('materialClassify')" style="width: 532px" dict-type="rohs_material_classify"></dict-data-select>
  183. </el-form-item>
  184. <el-form-item label="其他分类/Other Material Classify" v-if="modalData.materialClassifyList && modalData.materialClassifyList.includes('Other其他')">
  185. <el-input v-model="modalData.otherMaterialClassify" :disabled="isRohsFieldDisabled('otherMaterialClassify')" style="width: 260px"></el-input>
  186. </el-form-item>
  187. </el-form>
  188. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  189. <el-form-item label="辅材用途/Assiaccessorial Material Use for">
  190. <el-input v-model="modalData.materialUseFor" :disabled="isRohsFieldDisabled('materialUseFor')" style="width: 259px"></el-input>
  191. </el-form-item>
  192. <el-form-item>
  193. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('technicalPlan')" slot="label" @click="getBaseList(2001, 4)"><a herf="#">技术计划/TP</a></span>
  194. <span v-else slot="label">技术计划/TP</span>
  195. <el-input v-model="modalData.technicalPlan" @blur="technicalPlanBlur(2001)" :disabled="isRohsFieldDisabled('technicalPlan')" style="width: 100px"></el-input>
  196. <el-input v-model="modalData.technicalPlanName" disabled style="width: 155px"></el-input>
  197. </el-form-item>
  198. <el-form-item>
  199. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('pm')" slot="label" @click="getBaseList(2054, 5)"><a herf="#">PM人员/PM</a></span>
  200. <span v-else slot="label">PM人员/PM</span>
  201. <el-input v-model="modalData.pm" @blur="pmBlur(2054)" :disabled="isRohsFieldDisabled('pm')" style="width: 100px"></el-input>
  202. <el-input v-model="modalData.pmName" disabled style="width: 156px"></el-input>
  203. </el-form-item>
  204. </el-form>
  205. <el-form :inline="true" label-position="top" :model="modalData">
  206. <el-form-item label="颜色/Color">
  207. <el-input v-model="modalData.color" :disabled="isRohsFieldDisabled('color')" style="width: 532px"></el-input>
  208. </el-form-item>
  209. <el-form-item label="计划转量产时间/Planned Mass Production Date">
  210. <el-date-picker v-model="modalData.plannedMassProductionDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 260px" :editable=false></el-date-picker>
  211. </el-form-item>
  212. </el-form>
  213. <el-form :inline="true" label-position="top" :model="modalData">
  214. <el-form-item>
  215. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup1')" slot="label" @click="getBaseList(110)"><a herf="#">商品组1/Comm Group 1</a></span>
  216. <span v-else slot="label">商品组1/Comm Group 1</span>
  217. <el-input v-model="modalData.commGroup1" @change="commGroup1Blur(110)" :disabled="isRohsFieldDisabled('commGroup1')" style="width: 100px"></el-input>
  218. <el-input v-model="modalData.commGroup1Desc" disabled style="width: 155px"></el-input>
  219. </el-form-item>
  220. <el-form-item>
  221. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup2')" slot="label" @click="getBaseList(111)"><a herf="#">商品组2/Comm Group 2</a></span>
  222. <span v-else slot="label">商品组2/Comm Group 2</span>
  223. <el-input v-model="modalData.commGroup2" @change="commGroup2Blur(111)" :disabled="isRohsFieldDisabled('commGroup2')" style="width: 100px"></el-input>
  224. <el-input v-model="modalData.commGroup2Desc" disabled style="width: 155px"></el-input>
  225. </el-form-item>
  226. <el-form-item>
  227. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup3')" slot="label" @click="getBaseList(130)"><a herf="#">商品组3/Comm Group 3</a></span>
  228. <span v-else slot="label">商品组3/Comm Group 3</span>
  229. <el-input v-model="modalData.commGroup3" @change="commGroup3Blur(130)" :disabled="isRohsFieldDisabled('commGroup3')" style="width: 100px"></el-input>
  230. <el-input v-model="modalData.commGroup3Desc" disabled style="width: 156px"></el-input>
  231. </el-form-item>
  232. </el-form>
  233. <el-form :inline="true" label-position="top" :model="modalData">
  234. <el-form-item label="是否是Fiber材料">
  235. <el-radio-group v-model="modalData.isFiberMaterial" :disabled="isRohsFieldDisabled('isFiberMaterial')" style="width: 145px">
  236. <el-radio label="Y" @click.native.prevent="radioClick('isFiberMaterial', 'Y')">是</el-radio>
  237. <el-radio label="N" @click.native.prevent="radioClick('isFiberMaterial', 'N')">否</el-radio>
  238. </el-radio-group>
  239. </el-form-item>
  240. <el-form-item label="是否需要创建300/700/900号/Dose Need Create 300/700/900 Number">
  241. <el-radio-group v-model="modalData.needCreateNumber" :disabled="isRohsFieldDisabled('needCreateNumber')" style="width: 374px">
  242. <el-radio label="Y" @click.native.prevent="radioClick('needCreateNumber', 'Y')">是</el-radio>
  243. <el-radio label="N" @click.native.prevent="radioClick('needCreateNumber', 'N')">否</el-radio>
  244. </el-radio-group>
  245. </el-form-item>
  246. <el-form-item label="材料厚度/Material Thickness">
  247. <el-input v-model="modalData.materialThickness" :disabled="isRohsFieldDisabled('materialThickness')" style="width: 260px"></el-input>
  248. </el-form-item>
  249. </el-form>
  250. <el-form :inline="true" label-position="top" :model="modalData">
  251. <el-form-item label="材料有效期/Material Validity Time">
  252. <dict-data-select v-model="modalData.materialValidityTime" clearable :disabled="isRohsFieldDisabled('materialValidityTime')" style="width: 260px" dict-type="rohs_material_validity_time"></dict-data-select>
  253. </el-form-item>
  254. <el-form-item label="是否需要Deviation/If need deviation or not">
  255. <el-radio-group v-model="modalData.needDeviation" :disabled="isRohsFieldDisabled('needDeviation')" style="width: 259px">
  256. <el-radio label="Y" @click.native.prevent="radioClick('needDeviation', 'Y')">是</el-radio>
  257. <el-radio label="N" @click.native.prevent="radioClick('needDeviation', 'N')">否</el-radio>
  258. </el-radio-group>
  259. </el-form-item>
  260. <el-form-item>
  261. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('npdEngineer')" slot="label" @click="getBaseList(2001, 3)"><a herf="#">NPD工程师/NPD Engineer</a></span>
  262. <span v-else slot="label">NPD工程师/NPD Engineer</span>
  263. <el-input v-model="modalData.npdEngineer" @blur="npdEngineerBlur(2001)" :disabled="isRohsFieldDisabled('npdEngineer')" style="width: 100px"></el-input>
  264. <el-input v-model="modalData.npdEngineerName" disabled style="width: 155px"></el-input>
  265. </el-form-item>
  266. </el-form>
  267. <el-form :inline="true" label-position="top" :model="modalData">
  268. <el-form-item label="材料有效期备注/Material Validity Time Comments">
  269. <el-input v-model="modalData.materialValidityComments" :disabled="isRohsFieldDisabled('materialValidityComments')" style="width: 260px"></el-input>
  270. </el-form-item>
  271. <el-form-item label="预计提供报告时间(一个月内)/Expect Date" style="margin-left: -2px">
  272. <el-date-picker v-model="modalData.expectReportTime" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expectReportTime')" style="width: 259px" :editable=false></el-date-picker>
  273. </el-form-item>
  274. <el-form-item>
  275. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('buyer')" slot="label" @click="getBaseList(2000, 2)"><a herf="#">采购/Buyer</a></span>
  276. <span v-else slot="label">采购/Buyer</span>
  277. <el-input v-model="modalData.buyer" @blur="buyerBlur(2000)" :disabled="isRohsFieldDisabled('buyer')" style="width: 100px"></el-input>
  278. <el-input v-model="modalData.buyerName" disabled style="width: 156px"></el-input>
  279. </el-form-item>
  280. </el-form>
  281. <el-form :inline="true" label-position="top" :model="modalData">
  282. <el-form-item label="所需审批文件/Qualification Documents needed" >
  283. <dict-data-select
  284. :key="'qualification-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')"
  285. class="rohs-multiple-two-rows"
  286. v-model="modalData.qualificationDocumentsNeededList"
  287. multiple
  288. :use-default-value="!isEditMode"
  289. :use-type-multi-default-value="!isEditMode"
  290. :title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)"
  291. :disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')"
  292. style="width: 807px"
  293. dict-type="rohs_qualification_docs">
  294. </dict-data-select>
  295. </el-form-item>
  296. </el-form>
  297. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  298. <el-form-item label="测试报告必测项/Test Report including items">
  299. <dict-data-select
  300. :key="'test-report-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')"
  301. class="rohs-multiple-two-rows"
  302. v-model="modalData.testReportIncludingItemsList"
  303. multiple
  304. :use-default-value="!isEditMode"
  305. :use-type-multi-default-value="!isEditMode"
  306. :title="getMultipleSelectTitle(modalData.testReportIncludingItemsList)"
  307. :disabled="isRohsFieldDisabled('testReportIncludingItems')"
  308. style="width: 807px"
  309. dict-type="rohs_test_report_items">
  310. </dict-data-select>
  311. </el-form-item>
  312. </el-form>
  313. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
  314. <el-form-item style="display: block;">
  315. <template slot="label">
  316. <span>备注说明/Comments</span>
  317. <el-button
  318. v-if="authDataEntry"
  319. style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;"
  320. type="primary"
  321. @click="openRohsRemarkDialog">备注</el-button>
  322. </template>
  323. <el-input type="textarea" :rows="3" v-model="modalData.remark" :disabled="isRohsFieldDisabled('remark')" resize="none" style="width: 804px;height: 30px"></el-input>
  324. </el-form-item>
  325. </el-form>
  326. </div>
  327. </el-tab-pane>
  328. <!-- NPD 信息 -->
  329. <el-tab-pane label="NPD 信息" name="npdInfo">
  330. <div style="height: 755px; overflow-y: auto;">
  331. <!-- <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">-->
  332. <!-- <el-form-item label="现有材料不同规格/Same Material Diff Size">-->
  333. <!-- <el-radio-group v-model="modalData.isSameMaterialDiffSize" :disabled="isRohsFieldDisabled('isSameMaterialDiffSize')" style="width: 190px">-->
  334. <!-- <el-radio label="Y" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'Y')">是</el-radio>-->
  335. <!-- <el-radio label="N" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'N')">否</el-radio>-->
  336. <!-- </el-radio-group>-->
  337. <!-- </el-form-item>-->
  338. <!-- </el-form>-->
  339. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  340. <el-form-item style="display: block;">
  341. <template slot="label">
  342. <span>材料描述/Material Desc.</span>
  343. <el-button
  344. v-if="authMaterialDescRemark"
  345. style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;"
  346. type="primary"
  347. @click="openRohsMaterialDescDialog">编辑</el-button>
  348. </template>
  349. <el-input type="textarea" :rows="3" v-model="modalData.materialDesc" :disabled="isRohsFieldDisabled('materialDesc')" resize="none" style="width: 804px;height: 30px"></el-input>
  350. </el-form-item>
  351. </el-form>
  352. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  353. <el-form-item label="备注说明/NPD Remark" style="display: block;">
  354. <el-input type="textarea" :rows="3" v-model="modalData.npdRemark" :disabled="isRohsFieldDisabled('npdRemark')" resize="none" style="width: 804px;height: 30px"></el-input>
  355. </el-form-item>
  356. </el-form>
  357. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
  358. <el-form-item label="内部TDS/Inner TDS" style="display: block;">
  359. <oss-components
  360. ref="modalTdsOss"
  361. :save-visible="authFileSave"
  362. :edit-visible="authFileSave"
  363. :download-visible="authFileDownLoad"
  364. :remove-visible="authFileRemove"
  365. :preview-visible="authFilePreview"
  366. :disabled="showModalFlag || modalData.status === '已完成'"
  367. :enable-upgrade="!showModalFlag && modalData.status !== '已完成'"
  368. :require-file-no-rev="true"
  369. :auto-file-no="true"
  370. :single-upload="true"
  371. :row-click-select="true"
  372. :show-order-ref2="false"
  373. label="序列号"
  374. :height="510"
  375. style="margin-top: 2px"
  376. :columns="tdsFileColumnList"
  377. :order-ref1="modalData.site || ''"
  378. :order-ref2="modalData.referenceNo || ''"
  379. order-ref3="tdsProperty">
  380. </oss-components>
  381. </el-form-item>
  382. </el-form>
  383. </div>
  384. </el-tab-pane>
  385. <!-- HSF 填写信息 -->
  386. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  387. <div style="height: 755px">
  388. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  389. <el-form-item label="报告日期/Report Date">
  390. <el-date-picker v-model="modalData.expiredDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expiredDate')" style="width: 150px" :editable=false></el-date-picker>
  391. </el-form-item>
  392. <el-form-item label="有效期数值/Valid Until Value">
  393. <el-input-number
  394. v-model="modalData.validUntilValue"
  395. :controls="false"
  396. :min="0"
  397. :step="1"
  398. :precision="0"
  399. :disabled="isValidUntilValueDisabled()"
  400. style="width: 150px">
  401. </el-input-number>
  402. </el-form-item>
  403. <el-form-item label="有效期单位/Valid Until Unit">
  404. <dict-data-select v-model="modalData.validUntil" clearable :disabled="isValidUntilUnitDisabled()" style="width: 150px" dict-type="rohs_valid_until"></dict-data-select>
  405. </el-form-item>
  406. <el-form-item label="失效日期/Expiry Date">
  407. <el-date-picker v-model="modalData.expiryDate" type="date" value-format="yyyy-MM-dd" disabled style="width: 150px" :editable=false></el-date-picker>
  408. </el-form-item>
  409. <el-form-item label="状态/Status">
  410. <el-select v-model="modalData.rohsStatus" clearable :disabled="isRohsFieldDisabled('rohsStatus')" style="width: 150px">
  411. <el-option label="Active" value="Active"></el-option>
  412. <el-option label="Dead" value="Dead"></el-option>
  413. </el-select>
  414. </el-form-item>
  415. </el-form>
  416. <el-form :inline="true" label-position="top" :model="modalData">
  417. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  418. <el-radio-group v-model="modalData.isMeetRohsRequirement" :disabled="isRohsFieldDisabled('isMeetRohsRequirement')" style="width: 190px">
  419. <el-radio label="Y" @click.native.prevent="radioClick('isMeetRohsRequirement', 'Y')">是</el-radio>
  420. <el-radio label="N" @click.native.prevent="radioClick('isMeetRohsRequirement', 'N')">否</el-radio>
  421. </el-radio-group>
  422. </el-form-item>
  423. <el-form-item label=" ">
  424. <el-checkbox
  425. v-model="modalData.isAhGrade"
  426. true-label="Y"
  427. false-label="N"
  428. :disabled="isRohsFieldDisabled('isAhGrade')"
  429. style="width: 190px">材料属性是否是AH/Is AH Grade</el-checkbox>
  430. </el-form-item>
  431. <el-form-item label="HSF供应商等级/Supplier Class">
  432. <el-radio-group v-model="modalData.hsfSupplierClassification" :disabled="isRohsFieldDisabled('hsfSupplierClassification')" style="width: 260px">
  433. <el-radio label="高风险" @click.native.prevent="radioClick('hsfSupplierClassification', '高风险')">高风险</el-radio>
  434. <el-radio label="中风险" @click.native.prevent="radioClick('hsfSupplierClassification', '中风险')">中风险</el-radio>
  435. <el-radio label="低风险" @click.native.prevent="radioClick('hsfSupplierClassification', '低风险')">低风险</el-radio>
  436. </el-radio-group>
  437. </el-form-item>
  438. </el-form>
  439. <el-form :inline="true" label-position="top" :model="modalData">
  440. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;">
  441. <el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" :disabled="isRohsFieldDisabled('fiberInformation')" resize="none" style="width: 804px;height: 30px"></el-input>
  442. </el-form-item>
  443. </el-form>
  444. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px">
  445. <el-form-item>
  446. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="openHsfApproverChooseModal"><a herf="#">HSF审批人/HSF Approver</a></span>
  447. <span v-else slot="label">HSF审批人/HSF Approver</span>
  448. <el-input
  449. v-model="modalData.hsfApproverName"
  450. readonly
  451. :disabled="isRohsFieldDisabled('hsfApprover')"
  452. style="width: 396px"
  453. placeholder="请选择人员"
  454. @focus="openHsfApproverChooseModal">
  455. <span slot="suffix" v-show="modalData.hsfApproverName && !isRohsFieldDisabled('hsfApprover')" @click.stop="clearHsfApproverSelection">
  456. <i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
  457. </span>
  458. </el-input>
  459. </el-form-item>
  460. <el-form-item>
  461. <span style="cursor: pointer" v-if="!isRohsFieldDisabled('relatedPeople')" slot="label" @click="openRelatedPeopleChooseModal"><a herf="#">Inform Related people</a></span>
  462. <span v-else slot="label">Inform Related people</span>
  463. <el-input
  464. v-model="modalData.relatedPeopleName"
  465. readonly
  466. :disabled="isRohsFieldDisabled('relatedPeople')"
  467. style="width: 396px"
  468. placeholder="请从HSF审批人中选择"
  469. @focus="openRelatedPeopleChooseModal">
  470. <span slot="suffix" v-show="modalData.relatedPeopleName && !isRohsFieldDisabled('relatedPeople')" @click.stop="clearRelatedPeopleSelection">
  471. <i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
  472. </span>
  473. </el-input>
  474. </el-form-item>
  475. </el-form>
  476. <el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 0px">
  477. <el-form-item label="HSF标准/HSF Standard" style="display: block;">
  478. <el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" :disabled="isRohsFieldDisabled('hsfStandard')" resize="none" style="width: 804px;height: 30px"></el-input>
  479. </el-form-item>
  480. </el-form>
  481. </div>
  482. </el-tab-pane>
  483. <!-- 材料信息 -->
  484. <el-tab-pane label="材料信息" name="materialInfo">
  485. <div style="height: 755px">
  486. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -15px;">
  487. <el-form-item label=" ">
  488. <el-button type="primary" v-if="isEditMode && canEditRohsMaterial()" @click="openCreateIfsPartDialog">创建IFS料号</el-button>
  489. <el-button type="primary" v-if="!showModalFlag && canEditRohsMaterial()" @click="openProjectMaterialDialog">关联料号</el-button>
  490. <el-button type="danger" v-if="!showModalFlag && canEditRohsMaterial()" @click="removeSelectedMaterialRows">删除关联</el-button>
  491. </el-form-item>
  492. </el-form>
  493. <el-table
  494. ref="rohsMaterialTable"
  495. class="rohs-material-table"
  496. border
  497. :data="modalData.materialList"
  498. @selection-change="materialSelectionChange"
  499. :header-cell-style="materialDialogHeaderCellStyle"
  500. :height="715"
  501. style="width: 100%">
  502. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  503. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  504. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true">
  505. <template slot-scope="scope">
  506. <el-link style="cursor:pointer;" @click="toPartMenu(scope.row.finalPartNo || scope.row.testPartNo)">
  507. {{ scope.row.finalPartNo || scope.row.testPartNo || '' }}
  508. </el-link>
  509. </template>
  510. </el-table-column>
  511. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  512. <el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  513. </el-table>
  514. </div>
  515. </el-tab-pane>
  516. <el-tab-pane label="附件信息" name="attachmentInfo">
  517. <div style="height: 755px; overflow-y: auto;">
  518. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
  519. <el-form-item label="TDS" style="display: block;">
  520. <oss-components
  521. ref="modalAttachmentTdsOss"
  522. :save-visible="authFileSave"
  523. :edit-visible="authFileSave"
  524. :download-visible="authFileDownLoad"
  525. :remove-visible="authFileRemove"
  526. :preview-visible="authFilePreview"
  527. :row-click-select="true"
  528. :disabled="modalData.status === '已完成'"
  529. label="序列号"
  530. :height="145"
  531. style="margin-top: 2px"
  532. :columns="fileColumnList"
  533. :order-ref1="modalData.site || ''"
  534. :order-ref2="modalData.referenceNo || ''"
  535. order-ref3="rohsAttachmentTds">
  536. </oss-components>
  537. </el-form-item>
  538. </el-form>
  539. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  540. <el-form-item label="MSDS" style="display: block;">
  541. <oss-components
  542. ref="modalAttachmentMsdsOss"
  543. :save-visible="authFileSave"
  544. :edit-visible="authFileSave"
  545. :download-visible="authFileDownLoad"
  546. :remove-visible="authFileRemove"
  547. :preview-visible="authFilePreview"
  548. :row-click-select="true"
  549. :disabled="modalData.status === '已完成'"
  550. label="序列号"
  551. :height="145"
  552. style="margin-top: 2px"
  553. :columns="fileColumnList"
  554. :order-ref1="modalData.site || ''"
  555. :order-ref2="modalData.referenceNo || ''"
  556. order-ref3="rohsAttachmentMsds">
  557. </oss-components>
  558. </el-form-item>
  559. </el-form>
  560. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  561. <el-form-item label="测试报告/Test Report" style="display: block;">
  562. <oss-components
  563. ref="modalAttachmentTestReportOss"
  564. :save-visible="authFileSave"
  565. :edit-visible="authFileSave"
  566. :download-visible="authFileDownLoad"
  567. :remove-visible="authFileRemove"
  568. :preview-visible="authFilePreview"
  569. :row-click-select="true"
  570. :disabled="modalData.status === '已完成'"
  571. label="序列号"
  572. :height="145"
  573. style="margin-top: 2px"
  574. :columns="fileColumnList"
  575. :order-ref1="modalData.site || ''"
  576. :order-ref2="modalData.referenceNo || ''"
  577. order-ref3="rohsAttachmentTestReport">
  578. </oss-components>
  579. </el-form-item>
  580. </el-form>
  581. <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 150px;">
  582. <el-form-item label="Other" style="display: block;">
  583. <oss-components
  584. ref="modalAttachmentOtherOss"
  585. :save-visible="authFileSave"
  586. :edit-visible="authFileSave"
  587. :download-visible="authFileDownLoad"
  588. :remove-visible="authFileRemove"
  589. :preview-visible="authFilePreview"
  590. :row-click-select="true"
  591. :disabled="modalData.status === '已完成'"
  592. label="序列号"
  593. :height="145"
  594. style="margin-top: 2px"
  595. :columns="fileColumnList"
  596. :order-ref1="modalData.site || ''"
  597. :order-ref2="modalData.referenceNo || ''"
  598. order-ref3="rohsAttachmentOther">
  599. </oss-components>
  600. </el-form-item>
  601. </el-form>
  602. </div>
  603. </el-tab-pane>
  604. </el-tabs>
  605. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  606. <el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">保存</el-button>
  607. <el-button type="primary" @click="handleModalClose">关闭</el-button>
  608. <el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
  609. <el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
  610. </el-footer>
  611. </el-dialog>
  612. <!--选择项目模态框-->
  613. <el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog"
  614. @open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%">
  615. <el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
  616. <el-row :gutter="10">
  617. <el-col :span="6">
  618. <el-form-item label="项目号">
  619. <el-input v-model="searchProjectData.projectId"></el-input>
  620. </el-form-item>
  621. </el-col>
  622. <el-col :span="6">
  623. <el-form-item label="项目名称">
  624. <el-input v-model="searchProjectData.projectName"></el-input>
  625. </el-form-item>
  626. </el-col>
  627. <el-col :span="6">
  628. <el-form-item label=" ">
  629. <el-button type="primary" @click="searchProjectInfoList">查询</el-button>
  630. </el-form-item>
  631. </el-col>
  632. </el-row>
  633. <el-table :height="223"
  634. :data="projectList"
  635. border
  636. @row-click="projectClickRow">
  637. <el-table-column label="项目号" prop="projectId"/>
  638. <el-table-column label="项目名称" prop="projectName"/>
  639. </el-table>
  640. </el-form>
  641. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  642. <el-button type="primary" @click="chooseProjectListFlag = false">关闭</el-button>
  643. </el-footer>
  644. </el-dialog>
  645. <el-dialog title="选择物料" top="15vh" width="50%" :close-on-click-modal="false" v-drag :visible.sync="projectMaterialDialogFlag">
  646. <el-form :inline="true" label-position="top" :model="projectMaterialSearchData">
  647. <el-form-item label="IFS物料编码/Final Part No.">
  648. <el-input v-model="projectMaterialSearchData.finalPartNo" clearable style="width: 150px"></el-input>
  649. </el-form-item>
  650. <el-form-item label="描述/Part Desc">
  651. <el-input v-model="projectMaterialSearchData.partDesc" clearable style="width: 200px"></el-input>
  652. </el-form-item>
  653. <el-form-item label="状态/Part Status">
  654. <el-input v-model="projectMaterialSearchData.partStatus" clearable style="width: 100px"></el-input>
  655. </el-form-item>
  656. <el-form-item label=" ">
  657. <el-button type="primary" @click="searchProjectMaterialList">查询</el-button>
  658. </el-form-item>
  659. </el-form>
  660. <el-table
  661. ref="projectMaterialTable"
  662. class="rohs-material-table"
  663. border
  664. v-loading="projectMaterialLoading"
  665. :data="projectMaterialList"
  666. @selection-change="projectMaterialSelectionChange"
  667. :header-cell-style="materialDialogHeaderCellStyle"
  668. :height="320"
  669. style="width: 100%">
  670. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  671. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="120" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  672. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  673. <el-table-column prop="partStatus" label="状态/Part Status" min-width="80" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  674. </el-table>
  675. <el-pagination
  676. style="margin-top: 10px"
  677. @size-change="projectMaterialSizeChangeHandle"
  678. @current-change="projectMaterialCurrentChangeHandle"
  679. :current-page="projectMaterialPageIndex"
  680. :page-sizes="[20, 50, 100]"
  681. :page-size="projectMaterialPageSize"
  682. :total="projectMaterialTotal"
  683. layout="total, sizes, prev, pager, next, jumper">
  684. </el-pagination>
  685. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  686. <el-button type="primary" @click="confirmProjectMaterialSelection">确定</el-button>
  687. <el-button type="primary" @click="projectMaterialDialogFlag = false">关闭</el-button>
  688. </el-footer>
  689. </el-dialog>
  690. <el-dialog
  691. title="创建IFS料号"
  692. top="7vh"
  693. width="1060px"
  694. v-drag
  695. :close-on-click-modal="false"
  696. :visible.sync="rohsCreatePartDialogFlag"
  697. @close="closeRohsCreatePartDialog">
  698. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  699. <el-form-item label="Site">
  700. <el-input v-model="rohsCreatePartData.site" disabled style="width: 80px"></el-input>
  701. </el-form-item>
  702. <el-form-item label="物料编码 / Part No.">
  703. <el-input v-model="rohsCreatePartData.partNo" clearable style="width: 200px"></el-input>
  704. </el-form-item>
  705. <el-form-item label="物料名称 / Part Desc.">
  706. <el-input v-model="rohsCreatePartData.partDesc" clearable style="width: 360px"></el-input>
  707. </el-form-item>
  708. <el-form-item :label="' '">
  709. <el-button type="primary" @click="nextRohsCreatePartNo">Next Part No</el-button>
  710. </el-form-item>
  711. </el-form>
  712. <el-tabs v-model="rohsCreatePartTab" style="width: 100%;height: 465px;" type="border-card">
  713. <el-tab-pane label="General" name="General">
  714. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  715. <el-form-item label="零件类型 / Part Type">
  716. <el-select v-model="rohsCreatePartData.partType" style="width: 458px">
  717. <el-option label="Manufactured" value="Manufactured"></el-option>
  718. <el-option label="Manufactured Recipe" value="Manufactured Recipe"></el-option>
  719. <el-option label="Purchased (raw)" value="Purchased (raw)"></el-option>
  720. <el-option label="Purchased" value="Purchased"></el-option>
  721. </el-select>
  722. </el-form-item>
  723. <el-form-item>
  724. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(123)"><a herf="#">安全代码 / Safety Code</a></span>
  725. <el-input v-model="rohsCreatePartData.hazardCode" clearable @blur="rohsCreateHazardCodeBlur(123)" style="width: 128px"></el-input>
  726. <el-input v-model="rohsCreatePartData.hazardDesc" disabled style="width: 327px"></el-input>
  727. </el-form-item>
  728. </el-form>
  729. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  730. <el-form-item>
  731. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(113)"><a herf="#">计划人 / Planner</a></span>
  732. <el-input v-model="rohsCreatePartData.productGroupId4" clearable @blur="rohsCreateProductGroupId4Blur(113)" style="width: 128px"></el-input>
  733. <el-input v-model="rohsCreatePartData.productGroupName4" disabled style="width: 327px"></el-input>
  734. </el-form-item>
  735. <el-form-item>
  736. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(112)"><a herf="#">会计组 / Accounting Group</a></span>
  737. <el-input v-model="rohsCreatePartData.productGroupId3" clearable @blur="rohsCreateProductGroupId3Blur(112)" style="width: 128px"></el-input>
  738. <el-input v-model="rohsCreatePartData.productGroupName3" disabled style="width: 327px"></el-input>
  739. </el-form-item>
  740. </el-form>
  741. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  742. <el-form-item>
  743. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(1007)"><a herf="#">计量单位 / Inventory UoM</a></span>
  744. <el-input v-model="rohsCreatePartData.umId" clearable @blur="rohsCreateUmIdBlur(1007)" style="width: 128px"></el-input>
  745. <el-input v-model="rohsCreatePartData.umName" disabled style="width: 327px"></el-input>
  746. </el-form-item>
  747. <el-form-item>
  748. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(109)"><a herf="#">产品代码 / Product Code</a></span>
  749. <el-input v-model="rohsCreatePartData.groupId" clearable @blur="rohsCreateGroupIdBlur(109)" style="width: 128px"></el-input>
  750. <el-input v-model="rohsCreatePartData.groupName" disabled style="width: 327px"></el-input>
  751. </el-form-item>
  752. </el-form>
  753. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  754. <el-form-item>
  755. <span slot="label">商品组1 / Comm Group 1</span>
  756. <el-input v-model="rohsCreatePartData.productGroupId1" readonly style="width: 128px"></el-input>
  757. <el-input v-model="rohsCreatePartData.productGroupName1" disabled style="width: 327px"></el-input>
  758. </el-form-item>
  759. <el-form-item>
  760. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(108)"><a herf="#">产品大类 / Product Family</a></span>
  761. <el-input v-model="rohsCreatePartData.familyId" clearable @blur="rohsCreateFamilyIdBlur(108)" style="width: 128px"></el-input>
  762. <el-input v-model="rohsCreatePartData.familyName" disabled style="width: 327px"></el-input>
  763. </el-form-item>
  764. </el-form>
  765. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  766. <el-form-item>
  767. <span slot="label">商品组2 / Comm Group 2</span>
  768. <el-input v-model="rohsCreatePartData.productGroupId2" readonly style="width: 128px"></el-input>
  769. <el-input v-model="rohsCreatePartData.productGroupName2" disabled style="width: 327px"></el-input>
  770. </el-form-item>
  771. <el-form-item label="类型指定 / Type Designation">
  772. <el-input v-model="rohsCreatePartData.typeDesignation" clearable style="width: 458px"></el-input>
  773. </el-form-item>
  774. </el-form>
  775. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  776. <el-form-item label="商品组3 / Comm Group 3">
  777. <el-input v-model="rohsCreatePartData.commGroup3" readonly style="width: 128px"></el-input>
  778. <el-input v-model="rohsCreatePartData.commGroup3Desc" disabled style="width: 327px"></el-input>
  779. </el-form-item>
  780. </el-form>
  781. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  782. <el-form-item>
  783. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(124)"><a herf="#">资产等级 / Asset Class</a></span>
  784. <el-input v-model="rohsCreatePartData.assetClass" clearable @blur="rohsCreateAssetClassBlur(124)" style="width: 128px"></el-input>
  785. <el-input v-model="rohsCreatePartData.assetClassDesc" disabled style="width: 327px"></el-input>
  786. </el-form-item>
  787. <el-form-item label="尺寸/材质 / Dimension/Quality">
  788. <el-input v-model="rohsCreatePartData.dimQuality" clearable style="width: 458px"></el-input>
  789. </el-form-item>
  790. </el-form>
  791. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  792. <el-form-item>
  793. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(125)"><a herf="#">零件状态 / Part Status</a></span>
  794. <el-input v-model="rohsCreatePartData.partStatus" clearable @blur="rohsCreatePartStatusBlur(125)" style="width: 128px"></el-input>
  795. <el-input v-model="rohsCreatePartData.partStatusDesc" disabled style="width: 327px"></el-input>
  796. </el-form-item>
  797. <el-form-item label="净重">
  798. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.weightNet" readonly type="number" style="width: 110px"></el-input>
  799. </el-form-item>
  800. <el-form-item label="净重单位" style="margin-left: -10px">
  801. <el-input v-model="rohsCreatePartData.uomForWeightNet" readonly style="width: 110px"></el-input>
  802. </el-form-item>
  803. <el-form-item label="频率级别 / Frequency Class">
  804. <el-input v-model="rohsCreatePartData.frequencyClass" readonly style="width: 220px"></el-input>
  805. </el-form-item>
  806. </el-form>
  807. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  808. <el-form-item>
  809. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(126)"><a herf="#">ABC类 / ABC Class</a></span>
  810. <el-input v-model="rohsCreatePartData.abcClass" clearable @blur="rohsCreateAbcClassBlur(126)" style="width: 128px"></el-input>
  811. <el-input v-model="rohsCreatePartData.abcClassDesc" disabled style="width: 327px"></el-input>
  812. </el-form-item>
  813. <el-form-item label="净数量">
  814. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.volumeNet" readonly type="number" style="width: 110px"></el-input>
  815. </el-form-item>
  816. <el-form-item label="数量单位" style="margin-left: -10px">
  817. <el-input v-model="rohsCreatePartData.uomForVolumeNet" readonly style="width: 110px"></el-input>
  818. </el-form-item>
  819. <el-form-item label="生命周期阶段 / Lifecycle Stage">
  820. <el-input v-model="rohsCreatePartData.lifecycleStage" readonly style="width: 220px"></el-input>
  821. </el-form-item>
  822. </el-form>
  823. </el-tab-pane>
  824. <el-tab-pane label="Acquisition" name="Acquisition">
  825. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  826. <el-form-item label="制造备货期 / Manufacturing Lead Time">
  827. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.manufacturingLeadTime" @change="rohsChangeExpectedLeadTime" :disabled="!(rohsCreatePartData.partType === 'Manufactured' || rohsCreatePartData.partType === 'Manufactured Recipe')" style="width: 222px"></el-input-number>
  828. </el-form-item>
  829. <el-form-item label="Shelf Life(Weeks)">
  830. <el-input class="inlineNumber numInput" v-model="rohsCreatePartData.durabilityWeek" readonly type="number" style="width: 221px"></el-input>
  831. </el-form-item>
  832. <el-form-item>
  833. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(127)"><a herf="#">来源国家 / Country of Origin</a></span>
  834. <el-input v-model="rohsCreatePartData.countryOfOrigin" clearable @blur="rohsCreateCountryOfOriginBlur(127)" style="width: 128px"></el-input>
  835. <el-input v-model="rohsCreatePartData.countryOfOriginDesc" disabled style="width: 327px"></el-input>
  836. </el-form-item>
  837. </el-form>
  838. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  839. <el-form-item label="预期提前期 / Expected Lead Time">
  840. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.expectedLeadTime" style="width: 222px"></el-input-number>
  841. </el-form-item>
  842. <el-form-item label="Shelf Life(Days)">
  843. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.durabilityDay" @change="rohsChangeDurabilityWeek" style="width: 221px"></el-input-number>
  844. </el-form-item>
  845. <el-form-item>
  846. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(128)"><a herf="#">区域代码 / Region Code</a></span>
  847. <el-input v-model="rohsCreatePartData.regionOfOrigin" clearable @blur="rohsCreateRegionOfOriginBlur(128)" style="width: 128px"></el-input>
  848. <el-input v-model="rohsCreatePartData.regionOfOriginDesc" disabled style="width: 327px"></el-input>
  849. </el-form-item>
  850. </el-form>
  851. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  852. <el-form-item label="州内转换因子 / Intrastat Conv Factor">
  853. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.intrastatConvFactor" style="width: 128px"></el-input-number>
  854. <el-input v-model="rohsCreatePartData.umDesc" disabled style="width: 327px"></el-input>
  855. </el-form-item>
  856. <el-form-item>
  857. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(129)"><a herf="#">海关统计序号 / Customs Stat No</a></span>
  858. <el-input v-model="rohsCreatePartData.customsStatNo" clearable @blur="rohsCreateCustomsStatNoBlur(129)" style="width: 128px"></el-input>
  859. <el-input v-model="rohsCreatePartData.customsStatDesc" disabled style="width: 327px"></el-input>
  860. </el-form-item>
  861. </el-form>
  862. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  863. <el-form-item label="默认物料需求供应 / Default Mtr Req Supply">
  864. <el-select v-model="rohsCreatePartData.supplyCode" style="width: 458px" clearable>
  865. <el-option label="Inventory Order" value="Inventory Order"></el-option>
  866. <el-option label="Purchase Order" value="Purchase Order"></el-option>
  867. </el-select>
  868. </el-form-item>
  869. </el-form>
  870. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  871. <el-form-item label="备注" style="height: 80px">
  872. <el-input type="textarea" v-model="rohsCreatePartData.remark" :rows="3" resize='none' show-word-limit style="width: 931px"></el-input>
  873. </el-form-item>
  874. </el-form>
  875. </el-tab-pane>
  876. <el-tab-pane label="Costs" name="Costs">
  877. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  878. <el-form-item label="配置标识 / Configuration ID">
  879. <el-select v-model="rohsCreatePartData.configurationId" style="width: 220px">
  880. <el-option label="*" value="*"></el-option>
  881. </el-select>
  882. </el-form-item>
  883. <el-form-item label="估计物料成本 / Estimated Material Cost">
  884. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.estimatedMaterialCost" style="width: 220px"></el-input-number>
  885. </el-form-item>
  886. </el-form>
  887. </el-tab-pane>
  888. <el-tab-pane label="Misc Part Info" name="MiscPartInfo">
  889. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  890. <el-form-item label="库存估价方法 / Inventory Valuation Method">
  891. <el-select v-model="rohsCreatePartData.inventoryValuationMethod" style="width: 458px">
  892. <el-option label="Weighted Average" value="Weighted Average"></el-option>
  893. <el-option label="Standard Cost" value="Standard Cost"></el-option>
  894. <el-option label="First In First Out" value="First In First Out"></el-option>
  895. <el-option label="Last In First Out" value="Last In First Out"></el-option>
  896. </el-select>
  897. </el-form-item>
  898. <el-form-item>
  899. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(131)"><a herf="#">零件成本组 / Part Cost Group</a></span>
  900. <el-input v-model="rohsCreatePartData.partCostGroupId" clearable @blur="rohsCreatePartCostGroupIdBlur(131)" style="width: 128px"></el-input>
  901. <el-input v-model="rohsCreatePartData.partCostGroupDesc" disabled style="width: 327px"></el-input>
  902. </el-form-item>
  903. </el-form>
  904. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  905. <el-form-item label="库存件成本层 / Inventory Part Cost Level">
  906. <el-select v-model="rohsCreatePartData.inventoryPartCostLevel" style="width: 458px">
  907. <el-option label="Cost Per Part" value="Cost Per Part"></el-option>
  908. <el-option label="Cost Per Configuration" value="Cost Per Configuration"></el-option>
  909. <el-option label="Cost Per Condition" value="Cost Per Condition"></el-option>
  910. <el-option label="Cost Per Lot Batch" value="Cost Per Lot Batch"></el-option>
  911. <el-option label="Cost Per Serial" value="Cost Per Serial"></el-option>
  912. </el-select>
  913. </el-form-item>
  914. </el-form>
  915. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  916. <el-form-item label="供应商发票事项 / Supplier Invoice Consideration">
  917. <el-select v-model="rohsCreatePartData.invoiceConsideration" style="width: 458px">
  918. <el-option label="Ignore Invoice Price" value="Ignore Invoice Price"></el-option>
  919. <el-option label="Periodic Weighted Average" value="Periodic Weighted Average"></el-option>
  920. <el-option label="Transaction Based" value="Transaction Based"></el-option>
  921. </el-select>
  922. </el-form-item>
  923. </el-form>
  924. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  925. <el-form-item label="零成本 / Zero Cost">
  926. <el-select v-model="rohsCreatePartData.zeroCostFlag" style="width: 458px">
  927. <el-option label="Zero Cost Allowed" value="Zero Cost Allowed"></el-option>
  928. <el-option label="Zero Cost Forbidden" value="Zero Cost Forbidden"></el-option>
  929. <el-option label="Zero Cost Only" value="Zero Cost Only"></el-option>
  930. </el-select>
  931. </el-form-item>
  932. </el-form>
  933. </el-tab-pane>
  934. <el-tab-pane label="Planning Data" name="PlanningData">
  935. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  936. <el-form-item>
  937. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(132)"><a herf="#">计划方法 / Planning Method</a></span>
  938. <el-input v-model="rohsCreatePartData.planningMethod" clearable @blur="rohsCreatePlanningMethodBlur(132)" style="width: 170px"></el-input>
  939. </el-form-item>
  940. <el-form-item label=" ">
  941. <el-input v-model="rohsCreatePartData.planningMethodDesc" disabled style="width: 510px"></el-input>
  942. </el-form-item>
  943. </el-form>
  944. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  945. <el-form-item label="安全库存 / Safety Stock">
  946. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.safetyStock" style="width: 170px"></el-input-number>
  947. </el-form-item>
  948. <el-form-item label="最小批量 / Min Lot Size">
  949. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.minOrderQty" style="width: 170px"></el-input-number>
  950. </el-form-item>
  951. <el-form-item label="最大批量 / Max Lot Size">
  952. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.maxOrderQty" style="width: 155px"></el-input-number>
  953. </el-form-item>
  954. <el-form-item label="多种批量大小 / Multiple Lot Size">
  955. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.mulOrderQty" style="width: 155px"></el-input-number>
  956. </el-form-item>
  957. </el-form>
  958. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  959. <el-form-item label="安全提前期 / Safety Lead Time">
  960. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.safetyLeadTime" style="width: 170px"></el-input-number>
  961. </el-form-item>
  962. <el-form-item label="报废因子(%) / Scrap Factor(%)">
  963. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.shrinkageFac" style="width: 170px"></el-input-number>
  964. </el-form-item>
  965. <el-form-item label="标准批量大小 / Std Lot Size">
  966. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.stdOrderQty" style="width: 155px"></el-input-number>
  967. </el-form-item>
  968. </el-form>
  969. </el-tab-pane>
  970. <el-tab-pane label="Manufacturing" name="Manufacturing">
  971. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  972. <el-form-item label="累计提前期 / Cum Lead Time">
  973. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.cumLeadTime" style="width: 294px"></el-input-number>
  974. </el-form-item>
  975. <el-form-item label="预留/下发来源 / Reserve/Issue from">
  976. <el-select v-model="rohsCreatePartData.backFlushPart" style="width: 248px">
  977. <el-option label="All Locations" value="All Locations"></el-option>
  978. <el-option label="Only Floor Stock" value="Only Floor Stock"></el-option>
  979. <el-option label="Only Specified Location" value="Only Specified Location"></el-option>
  980. </el-select>
  981. </el-form-item>
  982. <el-form-item style="margin-top: 23px">
  983. <el-checkbox v-model="rohsCreatePartData.byProdAsSupplyInMrpDb" true-label="Y">将副产品用作MRP中的供应 / Use By-Product as Supply in MRP</el-checkbox>
  984. </el-form-item>
  985. </el-form>
  986. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  987. <el-form-item label="未受保护提前期 / Unprotected Lead Time">
  988. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.unprotectedLeadTime" style="width: 294px"></el-input-number>
  989. </el-form-item>
  990. <el-form-item label="预留/下发方法 / Reserve/Issue Method">
  991. <el-select v-model="rohsCreatePartData.issueType" style="width: 248px">
  992. <el-option label="Reserve" value="Reserve"></el-option>
  993. <el-option label="Backflush" value="Backflush"></el-option>
  994. <el-option label="Reserve And Backflush" value="Reserve And Backflush"></el-option>
  995. <el-option label="Manual" value="Manual"></el-option>
  996. </el-select>
  997. </el-form-item>
  998. <el-form-item style="margin-top: 23px">
  999. <el-checkbox v-model="rohsCreatePartData.mrpControlFlagDb" true-label="Y">MRP控制 / MRP Control</el-checkbox>
  1000. </el-form-item>
  1001. </el-form>
  1002. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1003. <el-form-item label="按日固定提前期 / Fixed Lead Time by Day">
  1004. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.fixedLeadTimeDay" style="width: 294px"></el-input-number>
  1005. </el-form-item>
  1006. <el-form-item label="过度报告 / Over Reporting">
  1007. <el-select v-model="rohsCreatePartData.overReporting" style="width: 248px">
  1008. <el-option label="Allowed" value="Allowed"></el-option>
  1009. <el-option label="Allowed with Warning" value="Allowed with Warning"></el-option>
  1010. <el-option label="Not Allowed" value="Not Allowed"></el-option>
  1011. </el-select>
  1012. </el-form-item>
  1013. <el-form-item style="margin-top: 23px">
  1014. <el-checkbox v-model="rohsCreatePartData.useTheoreticalDensityDb" true-label="Y">使用理论 / Use Theoretical</el-checkbox>
  1015. </el-form-item>
  1016. </el-form>
  1017. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1018. <el-form-item label="按天的可变化提前期 / Variable Lead Time by Day">
  1019. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.variableLeadTimeDay" style="width: 294px"></el-input-number>
  1020. </el-form-item>
  1021. <el-form-item label="报告公差过大 / Over Report Tolerance">
  1022. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.overReportTolerance" style="width: 248px"></el-input-number>
  1023. </el-form-item>
  1024. </el-form>
  1025. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1026. <el-form-item label="按小时的固定提前期 / Fixed Lead Time by Hour">
  1027. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.fixedLeadTimeHour" style="width: 294px"></el-input-number>
  1028. </el-form-item>
  1029. <el-form-item label="密度 / Density">
  1030. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.density" style="width: 248px"></el-input-number>
  1031. </el-form-item>
  1032. </el-form>
  1033. <el-form :inline="true" label-position="top" :model="rohsCreatePartData">
  1034. <el-form-item label="按小时计算的可变提前期 / Variable Lead Time by Hour">
  1035. <el-input-number :controls="false" :step="0" v-model="rohsCreatePartData.variableLeadTimeHour" style="width: 294px"></el-input-number>
  1036. </el-form-item>
  1037. </el-form>
  1038. </el-tab-pane>
  1039. <el-tab-pane label="Characteristics" name="Characteristics">
  1040. <el-form :inline="true" label-position="top" :model="rohsCreatePartData" style="margin-top: -5px;">
  1041. <el-form-item>
  1042. <span style="cursor: pointer" slot="label" @click="openRohsCreatePartBaseList(20)"><a herf="#">属性模板</a></span>
  1043. <el-input v-model="rohsCreatePartData.codeNo" clearable @blur="rohsCreateCodeNoBlur(20)" style="width: 128px"></el-input>
  1044. <el-input v-model="rohsCreatePartData.codeDesc" disabled style="width: 327px"></el-input>
  1045. </el-form-item>
  1046. <el-form-item :label="' '">
  1047. <el-button type="primary" @click="openRohsCharacteristicDialog">新增</el-button>
  1048. <el-button type="primary" @click="removeRohsPartItemRows">删除</el-button>
  1049. </el-form-item>
  1050. </el-form>
  1051. <div class="rq">
  1052. <el-table
  1053. :data="rohsCreatePartData.partItemList"
  1054. height="355px"
  1055. border
  1056. @selection-change="rohsPartItemSelectionChange"
  1057. style="width: 100%">
  1058. <el-table-column
  1059. type="selection"
  1060. align="center"
  1061. width="50">
  1062. </el-table-column>
  1063. <el-table-column
  1064. v-for="(item,index) in rohsCreatePartColumnItemList" :key="index"
  1065. :sortable="item.columnSortable"
  1066. :prop="item.columnProp"
  1067. :header-align="item.headerAlign"
  1068. :show-overflow-tooltip="item.showOverflowTooltip"
  1069. :align="item.align"
  1070. :fixed="item.fixed===''?false:item.fixed"
  1071. :min-width="item.columnWidth"
  1072. :label="item.columnLabel">
  1073. <template slot-scope="scope">
  1074. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  1075. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  1076. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1077. </div>
  1078. <div v-else>
  1079. <div v-if="scope.row.valueChooseFlag !== 'Y'">
  1080. <el-input-number v-if="scope.row.valueTypeDb === 'N'" v-model="scope.row.numValue" style="padding: 0;width: 100%" :controls="false"></el-input-number>
  1081. <el-input v-else v-model="scope.row.textValue"></el-input>
  1082. </div>
  1083. <div v-else>
  1084. <el-select style="width: 100%;" v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue" clearable>
  1085. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1086. </el-select>
  1087. <el-select style="width: 100%;" v-else v-model="scope.row.numValue" clearable>
  1088. <el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
  1089. </el-select>
  1090. </div>
  1091. </div>
  1092. </template>
  1093. </el-table-column>
  1094. </el-table>
  1095. </div>
  1096. </el-tab-pane>
  1097. </el-tabs>
  1098. <el-footer style="height:35px;margin-top: 10px;text-align:center">
  1099. <el-button type="primary" :loading="rohsCreatePartLoading" @click="saveRohsCreatePart">保存</el-button>
  1100. <el-button type="primary" @click="rohsCreatePartDialogFlag = false">关闭</el-button>
  1101. </el-footer>
  1102. </el-dialog>
  1103. <el-dialog title="物料属性" :close-on-click-modal="false" v-drag :visible.sync="rohsCharacteristicDialogFlag" width="730px">
  1104. <el-form :inline="true" label-position="top" :model="rohsCharacteristicQueryData">
  1105. <el-form-item :label="'属性编码'">
  1106. <el-input v-model="rohsCharacteristicQueryData.propertiesItemNo" clearable style="width: 200px"></el-input>
  1107. </el-form-item>
  1108. <el-form-item :label="'属性名称'">
  1109. <el-input v-model="rohsCharacteristicQueryData.itemDesc" clearable style="width: 200px"></el-input>
  1110. </el-form-item>
  1111. <el-form-item :label="' '">
  1112. <el-button type="primary" @click="queryRohsCharacteristicOptions">查询</el-button>
  1113. </el-form-item>
  1114. </el-form>
  1115. <el-table
  1116. :height="250"
  1117. :data="rohsCharacteristicList"
  1118. border
  1119. ref="rohsCharacteristicTable"
  1120. @row-click="rohsCharacteristicRowClick"
  1121. @selection-change="rohsCharacteristicSelectionChange"
  1122. style="width: 100%;">
  1123. <el-table-column type="selection" align="center" width="50"></el-table-column>
  1124. <el-table-column
  1125. v-for="(item,index) in rohsCharacteristicColumnList" :key="index"
  1126. :sortable="item.columnSortable"
  1127. :prop="item.columnProp"
  1128. :header-align="item.headerAlign"
  1129. :show-overflow-tooltip="item.showOverflowTooltip"
  1130. :align="item.align"
  1131. :fixed="item.fixed===''?false:item.fixed"
  1132. :min-width="item.columnWidth"
  1133. :label="item.columnLabel">
  1134. <template slot-scope="scope">
  1135. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1136. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1137. </template>
  1138. </el-table-column>
  1139. </el-table>
  1140. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  1141. <el-button type="primary" @click="saveRohsCharacteristics">保存</el-button>
  1142. <el-button type="primary" @click="rohsCharacteristicDialogFlag = false">关闭</el-button>
  1143. </el-footer>
  1144. </el-dialog>
  1145. <el-dialog title="人员选择" @open="openHsfApproverDialog" @close="closeHsfApproverDialog" v-drag
  1146. :visible.sync="hsfApproverFlag" width="40vw" :close-on-click-modal="false">
  1147. <el-form :inline="true" label-position="top" :model="hsfApproverSearchData">
  1148. <el-form-item label="编码">
  1149. <el-input v-model="hsfApproverSearchData.operatorId" clearable style="width: 120px"></el-input>
  1150. </el-form-item>
  1151. <el-form-item label="名称">
  1152. <el-input v-model="hsfApproverSearchData.operatorName" clearable style="width: 120px"></el-input>
  1153. </el-form-item>
  1154. <el-form-item label=" ">
  1155. <el-button type="primary" @click="filterHsfApproverOptions">查询</el-button>
  1156. </el-form-item>
  1157. </el-form>
  1158. <el-table v-if="hsfApproverFlag"
  1159. :height="300"
  1160. :data="hsfApproverDisplayList"
  1161. @selection-change="handleHsfApproverSelectionChange"
  1162. @row-click="(row,column,event) => handleHsfApproverTableClick(row,column,event,'hsfApproverTable')"
  1163. ref="hsfApproverTable"
  1164. border row-key="operatorId"
  1165. style="width: 100%;">
  1166. <el-table-column
  1167. type="selection"
  1168. header-align="center"
  1169. align="center"
  1170. :reserve-selection="true"
  1171. width="50">
  1172. </el-table-column>
  1173. <el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
  1174. <el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
  1175. </el-table>
  1176. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1177. <el-button type="primary" @click="saveHsfApproverChooseModal">确定</el-button>
  1178. <el-button type="primary" @click="hsfApproverFlag = false">关闭</el-button>
  1179. </el-footer>
  1180. </el-dialog>
  1181. <el-dialog title="人员选择" @open="openRelatedPeopleDialog" @close="closeRelatedPeopleDialog" v-drag
  1182. :visible.sync="relatedPeopleFlag" width="40vw" :close-on-click-modal="false">
  1183. <el-form :inline="true" label-position="top" :model="relatedPeopleSearchData">
  1184. <el-form-item label="编码">
  1185. <el-input v-model="relatedPeopleSearchData.operatorId" clearable style="width: 120px"></el-input>
  1186. </el-form-item>
  1187. <el-form-item label="名称">
  1188. <el-input v-model="relatedPeopleSearchData.operatorName" clearable style="width: 120px"></el-input>
  1189. </el-form-item>
  1190. <el-form-item label=" ">
  1191. <el-button type="primary" @click="filterRelatedPeopleOptions">查询</el-button>
  1192. </el-form-item>
  1193. </el-form>
  1194. <el-table v-if="relatedPeopleFlag"
  1195. :height="300"
  1196. :data="relatedPeopleDisplayList"
  1197. highlight-current-row
  1198. @current-change="handleRelatedPeopleCurrentChange"
  1199. @row-click="handleRelatedPeopleTableClick"
  1200. ref="relatedPeopleTable"
  1201. border
  1202. style="width: 100%;">
  1203. <el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
  1204. <el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
  1205. </el-table>
  1206. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  1207. <el-button type="primary" @click="saveRelatedPeopleChooseModal">确定</el-button>
  1208. <el-button type="primary" @click="relatedPeopleFlag = false">关闭</el-button>
  1209. </el-footer>
  1210. </el-dialog>
  1211. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  1212. <el-form label-position="top">
  1213. <el-form-item label="驳回意见/Reject Opinion">
  1214. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none" show-word-limit style="width: 479px;height: 30px"></el-input>
  1215. </el-form-item>
  1216. </el-form>
  1217. <el-footer style="height:35px;margin-top:50px;text-align:center">
  1218. <el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
  1219. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  1220. </el-footer>
  1221. </el-dialog>
  1222. <el-dialog width="700px" title="备注" :close-on-click-modal="false" :visible.sync="rohsRemarkFlag" v-drag>
  1223. <el-form label-position="top">
  1224. <el-form-item label="备注说明">
  1225. <el-input
  1226. type="textarea"
  1227. v-model="rohsRemarkForm.remark"
  1228. :rows="6"
  1229. maxlength="255"
  1230. show-word-limit
  1231. resize="none">
  1232. </el-input>
  1233. </el-form-item>
  1234. </el-form>
  1235. <el-footer style="height:35px;margin-top:110px;text-align:center">
  1236. <el-button type="primary" @click="refreshRohsRemark">刷新</el-button>
  1237. <el-button type="primary" @click="saveRohsRemark">保存</el-button>
  1238. <el-button type="primary" @click="rohsRemarkFlag = false">取消</el-button>
  1239. </el-footer>
  1240. </el-dialog>
  1241. <el-dialog width="700px" title="材料描述" :close-on-click-modal="false" :visible.sync="rohsMaterialDescFlag" v-drag>
  1242. <el-form label-position="top">
  1243. <el-form-item label="材料描述">
  1244. <el-input
  1245. type="textarea"
  1246. v-model="rohsMaterialDescForm.materialDesc"
  1247. :rows="6"
  1248. maxlength="255"
  1249. show-word-limit
  1250. resize="none">
  1251. </el-input>
  1252. </el-form-item>
  1253. </el-form>
  1254. <el-footer style="height:35px;margin-top:110px;text-align:center">
  1255. <el-button type="primary" @click="refreshRohsMaterialDesc">刷新</el-button>
  1256. <el-button type="primary" @click="saveRohsMaterialDesc">保存</el-button>
  1257. <el-button type="primary" @click="rohsMaterialDescFlag = false">取消</el-button>
  1258. </el-footer>
  1259. </el-dialog>
  1260. <!-- 底部附件页签 -->
  1261. <el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
  1262. <el-tab-pane label="基本信息" name="basicInfo">
  1263. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1264. <el-form :inline="true" label-position="top" :model="currentRow">
  1265. <el-form-item>
  1266. <span slot="label">申请人/Reference No.</span>
  1267. <el-input :value="currentRow.applicant || ''" disabled style="width: 100px"></el-input>
  1268. <el-input :value="currentRow.applicantName || ''" disabled style="width: 155px"></el-input>
  1269. </el-form-item>
  1270. <el-form-item label="申请日期/Date">
  1271. <el-date-picker :value="currentRow.applicationDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1272. </el-form-item>
  1273. <el-form-item label="Site">
  1274. <el-input :value="currentRow.site || ''" disabled style="width: 95px"></el-input>
  1275. </el-form-item>
  1276. <el-form-item label="工艺/Process">
  1277. <el-input :value="currentRow.process || ''" disabled style="width: 121px"></el-input>
  1278. </el-form-item>
  1279. </el-form>
  1280. <el-form :inline="true" label-position="top" :model="currentRow">
  1281. <el-form-item>
  1282. <span slot="label">最终客户/End Customer</span>
  1283. <el-input :value="currentRow.endCustomer || ''" disabled style="width: 100px"></el-input>
  1284. <el-input :value="currentRow.endCustomerName || ''" disabled style="width: 155px"></el-input>
  1285. </el-form-item>
  1286. <el-form-item>
  1287. <span slot="label">项目编码/Project</span>
  1288. <el-input :value="currentRow.projectId || ''" disabled style="width: 100px"></el-input>
  1289. <el-input :value="currentRow.projectName || ''" disabled style="width: 155px"></el-input>
  1290. </el-form-item>
  1291. <el-form-item label="WM所需求规格/The size that WM need">
  1292. <el-input :value="currentRow.wmRequiredSpec || ''" disabled style="width: 260px"></el-input>
  1293. </el-form-item>
  1294. </el-form>
  1295. <el-form :inline="true" label-position="top" :model="currentRow">
  1296. <el-form-item label="供应商/Vendor Code">
  1297. <el-input :value="currentRow.vendorCode || ''" disabled style="width: 396px"></el-input>
  1298. </el-form-item>
  1299. <el-form-item label="供应商材料编码/Vendor Material Code">
  1300. <el-input :value="currentRow.vendorMaterialCode || ''" disabled style="width: 396px"></el-input>
  1301. </el-form-item>
  1302. </el-form>
  1303. <el-form :inline="true" label-position="top" :model="currentRow">
  1304. <el-form-item label="材料分类/Material Classify">
  1305. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.materialClassify || ''" disabled style="width: 532px"></el-input>
  1306. </el-form-item>
  1307. <el-form-item label="其他分类/Other Material Classify" v-if="currentRow.materialClassify && currentRow.materialClassify.includes('Other其他')">
  1308. <el-input :value="currentRow.otherMaterialClassify || ''" disabled style="width: 260px"></el-input>
  1309. </el-form-item>
  1310. </el-form>
  1311. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1312. <el-form-item label="辅材用途/Assiaccessorial Material Use for">
  1313. <el-input :value="currentRow.materialUseFor || ''" disabled style="width: 259px"></el-input>
  1314. </el-form-item>
  1315. <el-form-item>
  1316. <span slot="label">技术计划/TP</span>
  1317. <el-input :value="currentRow.technicalPlan || ''" disabled style="width: 100px"></el-input>
  1318. <el-input :value="currentRow.technicalPlanName || ''" disabled style="width: 155px"></el-input>
  1319. </el-form-item>
  1320. <el-form-item>
  1321. <span slot="label">PM人员/PM</span>
  1322. <el-input :value="currentRow.pm || ''" disabled style="width: 100px"></el-input>
  1323. <el-input :value="currentRow.pmName || ''" disabled style="width: 156px"></el-input>
  1324. </el-form-item>
  1325. </el-form>
  1326. <el-form :inline="true" label-position="top" :model="currentRow">
  1327. <el-form-item label="颜色/Color">
  1328. <el-input :value="currentRow.color || ''" disabled style="width: 532px"></el-input>
  1329. </el-form-item>
  1330. <el-form-item label="计划转量产时间/Planned Mass Production Date">
  1331. <el-date-picker :value="normalizeDateOnly(currentRow.plannedMassProductionDate)" disabled type="date" value-format="yyyy-MM-dd" style="width: 260px"></el-date-picker>
  1332. </el-form-item>
  1333. </el-form>
  1334. <el-form :inline="true" label-position="top" :model="currentRow">
  1335. <el-form-item>
  1336. <span slot="label">商品组1/Comm Group 1</span>
  1337. <el-input :value="currentRow.commGroup1 || ''" disabled style="width: 100px"></el-input>
  1338. <el-input :value="currentRow.commGroup1Desc || ''" disabled style="width: 155px"></el-input>
  1339. </el-form-item>
  1340. <el-form-item>
  1341. <span slot="label">商品组2/Comm Group 2</span>
  1342. <el-input :value="currentRow.commGroup2 || ''" disabled style="width: 100px"></el-input>
  1343. <el-input :value="currentRow.commGroup2Desc || ''" disabled style="width: 155px"></el-input>
  1344. </el-form-item>
  1345. <el-form-item>
  1346. <span slot="label">商品组3/Comm Group 3</span>
  1347. <el-input :value="currentRow.commGroup3 || ''" disabled style="width: 100px"></el-input>
  1348. <el-input :value="currentRow.commGroup3Desc || ''" disabled style="width: 156px"></el-input>
  1349. </el-form-item>
  1350. </el-form>
  1351. <el-form :inline="true" label-position="top" :model="currentRow">
  1352. <el-form-item label="是否是Fiber材料">
  1353. <el-radio-group :value="currentRow.isFiberMaterial" disabled style="width: 145px">
  1354. <el-radio label="Y">是</el-radio>
  1355. <el-radio label="N">否</el-radio>
  1356. </el-radio-group>
  1357. </el-form-item>
  1358. <el-form-item label="是否需要创建300/700/900号/Dose Need Create 300/700/900 Number">
  1359. <el-radio-group :value="currentRow.needCreateNumber" disabled style="width: 374px">
  1360. <el-radio label="Y">是</el-radio>
  1361. <el-radio label="N">否</el-radio>
  1362. </el-radio-group>
  1363. </el-form-item>
  1364. <el-form-item label="材料厚度/Material Thickness">
  1365. <el-input :value="currentRow.materialThickness || ''" disabled style="width: 260px"></el-input>
  1366. </el-form-item>
  1367. </el-form>
  1368. <el-form :inline="true" label-position="top" :model="currentRow">
  1369. <el-form-item label="材料有效期/Material Validity Time">
  1370. <dict-data-select :value="currentRow.materialValidityTime || ''" :use-default-value="false" disabled style="width: 260px" dict-type="rohs_material_validity_time"></dict-data-select>
  1371. </el-form-item>
  1372. <el-form-item label="是否需要Deviation/If need deviation or not">
  1373. <el-radio-group :value="currentRow.needDeviation" disabled style="width: 259px">
  1374. <el-radio label="Y">是</el-radio>
  1375. <el-radio label="N">否</el-radio>
  1376. </el-radio-group>
  1377. </el-form-item>
  1378. <el-form-item>
  1379. <span slot="label">NPD工程师/NPD Engineer</span>
  1380. <el-input :value="currentRow.npdEngineer || ''" disabled style="width: 100px"></el-input>
  1381. <el-input :value="currentRow.npdEngineerName || ''" disabled style="width: 155px"></el-input>
  1382. </el-form-item>
  1383. </el-form>
  1384. <el-form :inline="true" label-position="top" :model="currentRow">
  1385. <el-form-item label="材料有效期备注/Material Validity Time Comments">
  1386. <el-input :value="currentRow.materialValidityComments || ''" disabled style="width: 260px"></el-input>
  1387. </el-form-item>
  1388. <el-form-item label="预计提供报告时间(一个月内)/Expect Date" style="margin-left: -2px">
  1389. <el-date-picker :value="normalizeDateOnly(currentRow.expectReportTime)" disabled type="date" value-format="yyyy-MM-dd" style="width: 259px"></el-date-picker>
  1390. </el-form-item>
  1391. <el-form-item>
  1392. <span slot="label">采购/Buyer</span>
  1393. <el-input :value="currentRow.buyer || ''" disabled style="width: 100px"></el-input>
  1394. <el-input :value="currentRow.buyerName || ''" disabled style="width: 156px"></el-input>
  1395. </el-form-item>
  1396. </el-form>
  1397. <el-form :inline="true" label-position="top" :model="currentRow">
  1398. <el-form-item label="所需审批文件/Qualification Documents needed">
  1399. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 807px"></el-input>
  1400. </el-form-item>
  1401. </el-form>
  1402. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1403. <el-form-item label="测试报告必测项/Test Report including items">
  1404. <el-input type="textarea" :rows="2" resize="none" :value="currentRow.testReportIncludingItems || ''" disabled style="width: 807px"></el-input>
  1405. </el-form-item>
  1406. </el-form>
  1407. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
  1408. <el-form-item label="备注说明/Comments" style="display: block;">
  1409. <el-input type="textarea" :rows="3" :value="currentRow.remark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input>
  1410. </el-form-item>
  1411. </el-form>
  1412. </div>
  1413. </el-tab-pane>
  1414. <el-tab-pane label="NPD 信息" name="npdInfo">
  1415. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1416. <!-- <el-form :inline="true" label-position="top" :model="currentRow">-->
  1417. <!-- <el-form-item label="现有材料不同规格/Same Material Diff Size">-->
  1418. <!-- <el-radio-group :value="currentRow.isSameMaterialDiffSize" disabled style="width: 190px">-->
  1419. <!-- <el-radio label="Y">是</el-radio>-->
  1420. <!-- <el-radio label="N">否</el-radio>-->
  1421. <!-- </el-radio-group>-->
  1422. <!-- </el-form-item>-->
  1423. <!-- </el-form>-->
  1424. <el-form :inline="true" label-position="top" :model="currentRow">
  1425. <el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1426. </el-form>
  1427. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  1428. <el-form-item label="备注说明/NPD Remark" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.npdRemark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1429. </el-form>
  1430. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
  1431. <el-form-item label="内部TDS/Inner TDS" style="display: block;">
  1432. <oss-components
  1433. ref="bottomTdsOss"
  1434. :save-visible="authFileSave"
  1435. :edit-visible="false"
  1436. :download-visible="authFileDownLoad"
  1437. :remove-visible="authFileRemove"
  1438. :preview-visible="authFilePreview"
  1439. :disabled="true"
  1440. label="序列号"
  1441. :height="180"
  1442. style="margin-top: 2px"
  1443. :columns="tdsFileColumnList"
  1444. :order-ref1="currentRow.site || ''"
  1445. :order-ref2="currentRow.referenceNo || ''"
  1446. order-ref3="tdsProperty">
  1447. </oss-components>
  1448. </el-form-item>
  1449. </el-form>
  1450. </div>
  1451. </el-tab-pane>
  1452. <el-tab-pane label="HSF 填写信息" name="hsfInfo">
  1453. <div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
  1454. <el-form :inline="true" label-position="top" :model="currentRow">
  1455. <el-form-item label="报告日期/Report Date">
  1456. <el-date-picker :value="currentRow.expiredDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1457. </el-form-item>
  1458. <el-form-item label="有效期数值/Valid Until Value">
  1459. <el-input :value="currentRow.validUntilValue || ''" disabled style="width: 150px"></el-input>
  1460. </el-form-item>
  1461. <el-form-item label="有效期单位/Valid Until Unit">
  1462. <el-input :value="currentRow.validUntil || ''" disabled style="width: 150px"></el-input>
  1463. </el-form-item>
  1464. <el-form-item label="失效日期/Expiry Date">
  1465. <el-date-picker :value="currentRow.expiryDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
  1466. </el-form-item>
  1467. <el-form-item label="状态/Status">
  1468. <el-input :value="currentRow.rohsStatus || ''" disabled style="width: 150px"></el-input>
  1469. </el-form-item>
  1470. </el-form>
  1471. <el-form :inline="true" label-position="top" :model="currentRow">
  1472. <el-form-item label="是否符合RoHS/Meet RoHS Req">
  1473. <el-radio-group :value="currentRow.isMeetRohsRequirement" disabled style="width: 190px">
  1474. <el-radio label="Y">是</el-radio>
  1475. <el-radio label="N">否</el-radio>
  1476. </el-radio-group>
  1477. </el-form-item>
  1478. <el-form-item label=" ">
  1479. <el-checkbox
  1480. :value="currentRow.isAhGrade"
  1481. true-label="Y"
  1482. false-label="N"
  1483. disabled
  1484. style="width: 190px">材料属性是否是AH/Is AH Grade</el-checkbox>
  1485. </el-form-item>
  1486. <el-form-item label="HSF供应商等级/Supplier Class">
  1487. <el-radio-group :value="currentRow.hsfSupplierClassification" disabled style="width: 260px">
  1488. <el-radio label="高风险">高风险</el-radio>
  1489. <el-radio label="中风险">中风险</el-radio>
  1490. <el-radio label="低风险">低风险</el-radio>
  1491. </el-radio-group>
  1492. </el-form-item>
  1493. </el-form>
  1494. <el-form :inline="true" label-position="top" :model="currentRow">
  1495. <el-form-item label="Fiber报告信息/Fiber Information" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.fiberInformation || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1496. </el-form>
  1497. <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 45px">
  1498. <el-form-item label="HSF审批人/HSF Approver"><el-input :value="currentRow.hsfApproverName || currentRow.hsfApprover || ''" disabled style="width: 396px"></el-input></el-form-item>
  1499. <el-form-item label="Inform Related people"><el-input :value="currentRow.relatedPeopleName || currentRow.relatedPeople || ''" disabled style="width: 396px"></el-input></el-form-item>
  1500. </el-form>
  1501. <el-form v-if="shouldShowHsfStandard(currentRow.endCustomer)" :inline="true" label-position="top" :model="currentRow" style="margin-top: 0px">
  1502. <el-form-item label="HSF标准/HSF Standard" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.hsfStandard || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
  1503. </el-form>
  1504. </div>
  1505. </el-tab-pane>
  1506. <el-tab-pane label="材料信息" name="materialInfo">
  1507. <div :style="{height: secondHeight + 'px'}" style="overflow-y: auto;">
  1508. <el-table
  1509. class="rohs-material-table"
  1510. border
  1511. :data="currentRow.materialList || []"
  1512. :height="secondHeight"
  1513. style="width: 100%">
  1514. <el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
  1515. <el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true">
  1516. <template slot-scope="scope">
  1517. <el-link style="cursor:pointer;" @click="toPartMenu(scope.row.finalPartNo || scope.row.testPartNo)">
  1518. {{ scope.row.finalPartNo || scope.row.testPartNo || '' }}
  1519. </el-link>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  1523. <el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
  1524. </el-table>
  1525. </div>
  1526. </el-tab-pane>
  1527. <el-tab-pane label="附件信息" name="attachment">
  1528. <oss-components
  1529. ref="bottomAttachmentOss"
  1530. :save-visible="authFileSave"
  1531. :edit-visible="authFileSave"
  1532. :download-visible="authFileDownLoad"
  1533. :remove-visible="authFileRemove"
  1534. :preview-visible="authFilePreview"
  1535. :disabled="currentRow.status === '已完成'"
  1536. :show-order-ref3-filter="true"
  1537. :order-ref3-filter-options="rohsAttachmentTypeOptionList"
  1538. :query-order-ref3-list="rohsAttachmentQueryOrderRef3List"
  1539. :order-ref3-filter-query-map="rohsAttachmentTypeFilterQueryMap"
  1540. :order-ref3-label-map="rohsAttachmentTypeLabelMap"
  1541. label="序列号"
  1542. :height="secondHeight - 25"
  1543. style="margin-top: 2px"
  1544. :columns="rohsAttachmentSummaryColumnList"
  1545. :order-ref1="currentRow.site"
  1546. :order-ref2="currentRow.referenceNo">
  1547. </oss-components>
  1548. </el-tab-pane>
  1549. <el-tab-pane label="审批信息" name="approvalInformation">
  1550. <approval-information v-model:data-list="approvalList" :height="secondHeight"></approval-information>
  1551. </el-tab-pane>
  1552. </el-tabs>
  1553. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  1554. <filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
  1555. </div>
  1556. </template>
  1557. <script>
  1558. import * as api from '@/api/rohs/rohs'
  1559. import { checkSuperAdmin } from "@/api/changeManagement/changeManagement"
  1560. import { verifyData } from "@/api/chooselist/chooselist.js"
  1561. import { searchProjectInfoList } from "@/api/quotation/quotationInformation.js"
  1562. import { queryCustomer } from "@/api/customer/customerInformation"
  1563. import { queryProjectByCustomer } from "@/api/project/project"
  1564. import { createOfficialPartForRohs, getNextPartNo as getPartNextPartNo, getItemListByCodeNo as getPartItemListByCodeNo, getItemExclusionAlreadyExists as getPartItemExclusionAlreadyExists } from "@/api/part/partInformation.js"
  1565. import uploadFileList from '../common/uploadFileList'
  1566. import ossComponents from '../oss/ossComponents.vue'
  1567. import ChooseList from '@/views/modules/common/Chooselist'
  1568. import DictDataSelect from "../sys/dict-data-select.vue"
  1569. import ApprovalInformation from "../changeManagement/approvalInformation.vue"
  1570. import FilterSearch from "../../common/filterSearch.vue"
  1571. export default {
  1572. components: {
  1573. uploadFileList,
  1574. ossComponents,
  1575. ChooseList,
  1576. DictDataSelect,
  1577. ApprovalInformation,
  1578. FilterSearch
  1579. },
  1580. data () {
  1581. return {
  1582. searchData: {
  1583. site: this.$store.state.user.site,
  1584. referenceNo: '',
  1585. status: '',
  1586. rohsStatus: '',
  1587. currentApprover: '',
  1588. nodeId: '',
  1589. ifsPartNo: '',
  1590. materialDesc: ''
  1591. },
  1592. exportLoading: false,
  1593. exportData: [],
  1594. exportFieldMap: {},
  1595. exportName: '',
  1596. exportHeader: ['RoHs记录'],
  1597. exportFooter: [],
  1598. resultList: [],
  1599. dataList: [],
  1600. pageIndex: 1,
  1601. pageSize: 20,
  1602. totalPage: 0,
  1603. dataListLoading: false,
  1604. activeTable: 'basicInfo',
  1605. menuId: '112001',
  1606. authSearch: false,
  1607. authUpdate: false,
  1608. authIssue: false,
  1609. authSubmit: false,
  1610. authReject: false,
  1611. authFileSave: false,
  1612. authFileDownLoad: false,
  1613. authFileRemove: false,
  1614. authFilePreview: false,
  1615. authDataEntry: false,
  1616. authMaterialDescRemark: false,
  1617. authDelete: false,
  1618. superAdmin: false,
  1619. createBy2: this.$store.state.user.name,
  1620. height: 400,
  1621. secondHeight: 200,
  1622. currentRow: {},
  1623. fileColumnList: [
  1624. {
  1625. columnProp: 'fileName',
  1626. headerAlign: 'center',
  1627. align: 'center',
  1628. columnLabel: '文件名称',
  1629. columnHidden: false,
  1630. columnImage: false,
  1631. columnSortable: false,
  1632. status: true,
  1633. fixed: '',
  1634. columnWidth: 140
  1635. },
  1636. {
  1637. columnProp: 'fileRemark',
  1638. headerAlign: 'center',
  1639. align: 'center',
  1640. columnLabel: '备注',
  1641. columnHidden: false,
  1642. columnImage: false,
  1643. columnSortable: false,
  1644. status: true,
  1645. fixed: '',
  1646. columnWidth: 200
  1647. },
  1648. {
  1649. columnProp: 'createDate',
  1650. headerAlign: 'center',
  1651. align: 'center',
  1652. columnLabel: '上传时间',
  1653. columnHidden: false,
  1654. columnImage: false,
  1655. columnSortable: false,
  1656. status: true,
  1657. fixed: '',
  1658. columnWidth: 150
  1659. },
  1660. {
  1661. columnProp: 'createBy',
  1662. headerAlign: 'center',
  1663. align: 'center',
  1664. columnLabel: '上传人',
  1665. columnHidden: false,
  1666. columnImage: false,
  1667. columnSortable: false,
  1668. status: true,
  1669. fixed: '',
  1670. columnWidth: 120
  1671. }
  1672. ],
  1673. rohsAttachmentTypeOptionList: [
  1674. { value: 'rohsAttachmentTds', label: 'TDS' },
  1675. { value: 'rohsAttachmentMsds', label: 'MSDS' },
  1676. { value: 'rohsAttachmentTestReport', label: '测试报告' },
  1677. { value: 'rohsAttachmentOther', label: 'Other' }
  1678. ],
  1679. rohsAttachmentTypeLabelMap: {
  1680. rohsAttachmentTds: 'TDS',
  1681. rohsAttachmentMsds: 'MSDS',
  1682. rohsAttachmentTestReport: '测试报告',
  1683. rohsAttachmentOther: 'Other',
  1684. rohsAttachment: 'Other'
  1685. },
  1686. rohsAttachmentQueryOrderRef3List: [
  1687. 'rohsAttachmentTds',
  1688. 'rohsAttachmentMsds',
  1689. 'rohsAttachmentTestReport',
  1690. 'rohsAttachmentOther',
  1691. 'rohsAttachment'
  1692. ],
  1693. rohsAttachmentTypeFilterQueryMap: {
  1694. rohsAttachmentTds: ['rohsAttachmentTds'],
  1695. rohsAttachmentMsds: ['rohsAttachmentMsds'],
  1696. rohsAttachmentTestReport: ['rohsAttachmentTestReport'],
  1697. rohsAttachmentOther: ['rohsAttachmentOther', 'rohsAttachment']
  1698. },
  1699. rohsAttachmentSummaryColumnList: [
  1700. {
  1701. columnProp: 'orderRef3Label',
  1702. headerAlign: 'center',
  1703. align: 'center',
  1704. columnLabel: '类型',
  1705. columnHidden: false,
  1706. columnImage: false,
  1707. columnSortable: false,
  1708. status: true,
  1709. fixed: '',
  1710. columnWidth: 120
  1711. },
  1712. {
  1713. columnProp: 'fileName',
  1714. headerAlign: 'center',
  1715. align: 'center',
  1716. columnLabel: '文件名称',
  1717. columnHidden: false,
  1718. columnImage: false,
  1719. columnSortable: false,
  1720. status: true,
  1721. fixed: '',
  1722. columnWidth: 160
  1723. },
  1724. {
  1725. columnProp: 'fileRemark',
  1726. headerAlign: 'center',
  1727. align: 'center',
  1728. columnLabel: '备注',
  1729. columnHidden: false,
  1730. columnImage: false,
  1731. columnSortable: false,
  1732. status: true,
  1733. fixed: '',
  1734. columnWidth: 220
  1735. },
  1736. {
  1737. columnProp: 'createDate',
  1738. headerAlign: 'center',
  1739. align: 'center',
  1740. columnLabel: '上传时间',
  1741. columnHidden: false,
  1742. columnImage: false,
  1743. columnSortable: false,
  1744. status: true,
  1745. fixed: '',
  1746. columnWidth: 160
  1747. },
  1748. {
  1749. columnProp: 'createBy',
  1750. headerAlign: 'center',
  1751. align: 'center',
  1752. columnLabel: '上传人',
  1753. columnHidden: false,
  1754. columnImage: false,
  1755. columnSortable: false,
  1756. status: true,
  1757. fixed: '',
  1758. columnWidth: 120
  1759. }
  1760. ],
  1761. tdsFileColumnList: [
  1762. {
  1763. columnProp: 'fileNo',
  1764. headerAlign: 'center',
  1765. align: 'center',
  1766. columnLabel: '文件编码',
  1767. columnHidden: false,
  1768. columnImage: false,
  1769. columnSortable: false,
  1770. status: true,
  1771. fixed: '',
  1772. columnWidth: 130
  1773. },
  1774. {
  1775. columnProp: 'rev',
  1776. headerAlign: 'center',
  1777. align: 'center',
  1778. columnLabel: '版本号',
  1779. columnHidden: false,
  1780. columnImage: false,
  1781. columnSortable: false,
  1782. status: true,
  1783. fixed: '',
  1784. columnWidth: 90
  1785. },
  1786. {
  1787. columnProp: 'fileName',
  1788. headerAlign: 'center',
  1789. align: 'center',
  1790. columnLabel: '文件名称',
  1791. columnHidden: false,
  1792. columnImage: false,
  1793. columnSortable: false,
  1794. status: true,
  1795. fixed: '',
  1796. columnWidth: 160
  1797. },
  1798. {
  1799. columnProp: 'fileRemark',
  1800. headerAlign: 'center',
  1801. align: 'center',
  1802. columnLabel: '备注',
  1803. columnHidden: false,
  1804. columnImage: false,
  1805. columnSortable: false,
  1806. status: true,
  1807. fixed: '',
  1808. columnWidth: 180
  1809. },
  1810. {
  1811. columnProp: 'createDate',
  1812. headerAlign: 'center',
  1813. align: 'center',
  1814. columnLabel: '上传时间',
  1815. columnHidden: false,
  1816. columnImage: false,
  1817. columnSortable: false,
  1818. status: true,
  1819. fixed: '',
  1820. columnWidth: 150
  1821. },
  1822. {
  1823. columnProp: 'invalidationTime',
  1824. headerAlign: 'center',
  1825. align: 'center',
  1826. columnLabel: '失效时间',
  1827. columnHidden: false,
  1828. columnImage: false,
  1829. columnSortable: false,
  1830. status: true,
  1831. fixed: '',
  1832. columnWidth: 150
  1833. },
  1834. {
  1835. columnProp: 'createBy',
  1836. headerAlign: 'center',
  1837. align: 'center',
  1838. columnLabel: '上传人',
  1839. columnHidden: false,
  1840. columnImage: false,
  1841. columnSortable: false,
  1842. status: true,
  1843. fixed: '',
  1844. columnWidth: 120
  1845. }
  1846. ],
  1847. modalFlag: false,
  1848. chooseProjectListFlag: false,
  1849. projectMaterialDialogFlag: false,
  1850. rohsCreatePartDialogFlag: false,
  1851. rohsCreatePartLoading: false,
  1852. rohsCreatePartTab: 'General',
  1853. rohsCreatePartTagNo: 0,
  1854. rohsCharacteristicDialogFlag: false,
  1855. rohsCharacteristicQueryData: {
  1856. propertiesItemNo: '',
  1857. itemDesc: ''
  1858. },
  1859. rohsCharacteristicList: [],
  1860. rohsCharacteristicSelections: [],
  1861. rohsPartItemSelections: [],
  1862. rohsCreatePartColumnItemList: [
  1863. {
  1864. columnProp: 'propertiesItemNo',
  1865. headerAlign: 'center',
  1866. align: 'left',
  1867. columnLabel: '属性编码',
  1868. columnHidden: false,
  1869. columnImage: false,
  1870. status: true,
  1871. fixed: '',
  1872. columnWidth: 100
  1873. },
  1874. {
  1875. columnProp: 'itemDesc',
  1876. headerAlign: 'center',
  1877. align: 'left',
  1878. columnLabel: '属性名称',
  1879. columnHidden: false,
  1880. columnImage: false,
  1881. status: true,
  1882. fixed: '',
  1883. columnWidth: 150
  1884. },
  1885. {
  1886. columnProp: 'valueType',
  1887. headerAlign: 'center',
  1888. align: 'center',
  1889. columnLabel: '属性类型',
  1890. columnHidden: false,
  1891. columnImage: false,
  1892. status: true,
  1893. fixed: '',
  1894. columnWidth: 60
  1895. },
  1896. {
  1897. columnProp: 'textValue',
  1898. headerAlign: 'center',
  1899. align: 'left',
  1900. columnLabel: '属性值',
  1901. columnHidden: false,
  1902. columnImage: false,
  1903. status: true,
  1904. fixed: '',
  1905. columnWidth: 140
  1906. }
  1907. ],
  1908. rohsCharacteristicColumnList: [
  1909. {
  1910. columnProp: 'propertiesItemNo',
  1911. headerAlign: 'center',
  1912. align: 'left',
  1913. columnLabel: '属性编码',
  1914. columnHidden: false,
  1915. columnImage: false,
  1916. status: true,
  1917. fixed: '',
  1918. columnWidth: 100
  1919. },
  1920. {
  1921. columnProp: 'itemDesc',
  1922. headerAlign: 'center',
  1923. align: 'left',
  1924. columnLabel: '属性名称',
  1925. columnHidden: false,
  1926. columnImage: false,
  1927. status: true,
  1928. fixed: '',
  1929. columnWidth: 200
  1930. },
  1931. {
  1932. columnProp: 'valueType',
  1933. headerAlign: 'center',
  1934. align: 'center',
  1935. columnLabel: '属性类型',
  1936. columnHidden: false,
  1937. columnImage: false,
  1938. status: true,
  1939. fixed: '',
  1940. columnWidth: 60
  1941. }
  1942. ],
  1943. rohsCreatePartData: {
  1944. site: '',
  1945. partNo: '',
  1946. partDesc: '',
  1947. partType: 'Purchased',
  1948. hazardCode: '',
  1949. hazardDesc: '',
  1950. familyId: '',
  1951. familyName: '',
  1952. groupId: '',
  1953. groupName: '',
  1954. umId: '',
  1955. umName: '',
  1956. weightNet: '',
  1957. uomForWeightNet: 'kg',
  1958. volumeNet: '',
  1959. uomForVolumeNet: 'm3',
  1960. lotTrackingCode: 'Order Based',
  1961. remark: '',
  1962. productGroupId1: '',
  1963. productGroupName1: '',
  1964. productGroupId2: '',
  1965. productGroupName2: '',
  1966. productGroupId3: '',
  1967. productGroupName3: '',
  1968. productGroupId4: '*',
  1969. productGroupName4: 'NorthSky Application owner',
  1970. commGroup3: '',
  1971. commGroup3Desc: '',
  1972. codeNo: '',
  1973. codeDesc: '',
  1974. typeDesignation: '',
  1975. assetClass: 'S',
  1976. assetClassDesc: '标准',
  1977. dimQuality: '',
  1978. abcClass: 'C',
  1979. abcClassDesc: '',
  1980. frequencyClass: 'Very Slow Mover',
  1981. lifecycleStage: 'Development',
  1982. countryOfOrigin: '',
  1983. countryOfOriginDesc: '',
  1984. regionOfOrigin: '',
  1985. regionOfOriginDesc: '',
  1986. manufacturingLeadTime: 0,
  1987. expectedLeadTime: 0,
  1988. durabilityWeek: '',
  1989. durabilityDay: '',
  1990. intrastatConvFactor: undefined,
  1991. customsStatNo: '',
  1992. customsStatDesc: '',
  1993. umDesc: '',
  1994. planningMethod: 'A',
  1995. planningMethodDesc: '',
  1996. partStatus: 'A',
  1997. partStatusDesc: '活动',
  1998. active: 'Y',
  1999. status: 'Y',
  2000. supplyCode: 'Inventory Order',
  2001. configurationId: '*',
  2002. partCostGroupId: '',
  2003. partCostGroupDesc: '',
  2004. inventoryValuationMethod: 'Standard Cost',
  2005. inventoryPartCostLevel: 'Cost Per Part',
  2006. invoiceConsideration: 'Ignore Invoice Price',
  2007. zeroCostFlag: 'Zero Cost Forbidden',
  2008. estimatedMaterialCost: 0,
  2009. safetyStock: 0,
  2010. minOrderQty: 0,
  2011. maxOrderQty: 0,
  2012. mulOrderQty: 0,
  2013. safetyLeadTime: 0,
  2014. shrinkageFac: 0,
  2015. stdOrderQty: 0,
  2016. cumLeadTime: 0,
  2017. byProdAsSupplyInMrpDb: '',
  2018. unprotectedLeadTime: 0,
  2019. backFlushPart: 'All Locations',
  2020. issueType: 'Reserve And Backflush',
  2021. mrpControlFlagDb: 'Y',
  2022. fixedLeadTimeDay: 0,
  2023. overReporting: 'Allowed',
  2024. useTheoreticalDensityDb: '',
  2025. variableLeadTimeDay: 0,
  2026. overReportTolerance: 0,
  2027. fixedLeadTimeHour: 0,
  2028. density: undefined,
  2029. variableLeadTimeHour: 0,
  2030. showInQueryFlag: 'Y',
  2031. temporaryPartFlag: 'N',
  2032. partItemList: []
  2033. },
  2034. searchProjectData: {
  2035. site: '',
  2036. projectId: undefined,
  2037. projectName: undefined,
  2038. customerId: undefined,
  2039. },
  2040. projectMaterialSearchData: {
  2041. finalPartNo: '',
  2042. partDesc: '',
  2043. partStatus: ''
  2044. },
  2045. projectMaterialList: [],
  2046. projectMaterialSelections: [],
  2047. dataListSelections: [],
  2048. materialSelections: [],
  2049. projectMaterialPageIndex: 1,
  2050. projectMaterialPageSize: 20,
  2051. projectMaterialTotal: 0,
  2052. projectMaterialLoading: false,
  2053. nodeOptions: [],
  2054. projectList: [],
  2055. hsfApproverOptionList: [],
  2056. hsfApproverDisplayList: [],
  2057. hsfApproverSelectionCache: [],
  2058. hsfApproverFlag: false,
  2059. hsfApproverSearchData: {
  2060. operatorId: '',
  2061. operatorName: ''
  2062. },
  2063. relatedPeopleOptionList: [],
  2064. relatedPeopleDisplayList: [],
  2065. relatedPeopleSelection: null,
  2066. relatedPeopleFlag: false,
  2067. relatedPeopleSearchData: {
  2068. operatorId: '',
  2069. operatorName: ''
  2070. },
  2071. filterVisible: false,
  2072. isFilterSearch: false,
  2073. filterSearchData: {},
  2074. approvalList: [],
  2075. plmRohsAuthorityArr: [],
  2076. nodeAuthorityLoaded: false,
  2077. isEditMode: false,
  2078. modalTitle: 'RoHS 新增',
  2079. activeName: 'basicInfo',
  2080. showModalFlag: false,
  2081. submitModalFlag: false,
  2082. rohsRemarkFlag: false,
  2083. rohsMaterialDescFlag: false,
  2084. rejectOpinion: '',
  2085. submitLoading: false,
  2086. rohsRemarkForm: {
  2087. remark: ''
  2088. },
  2089. rohsMaterialDescForm: {
  2090. materialDesc: ''
  2091. },
  2092. hsfStandardDefaultText: 'With the follow environmental specification: Macallan regulated Substances specification(069-0135) /Macallan sustainable fiber specification(099-00532)',
  2093. modalData: {
  2094. site: 'DEFAULT',
  2095. referenceNo: '',
  2096. applicant: '',
  2097. pm: '',
  2098. pmName: '',
  2099. applicationDate: '',
  2100. process: '',
  2101. plannedMassProductionDate: '',
  2102. color: '',
  2103. vendorCode: '',
  2104. vendorMaterialCode: '',
  2105. materialClassify: '',
  2106. otherMaterialClassify: '',
  2107. materialUseFor: '',
  2108. endCustomer: '',
  2109. projectId: '',
  2110. commGroup1: '',
  2111. commGroup1Desc: '',
  2112. commGroup2: '',
  2113. commGroup2Desc: '',
  2114. commGroup3: '',
  2115. commGroup3Desc: '',
  2116. needCreateNumber: '',
  2117. npdEngineer: '',
  2118. materialValidityTime: '',
  2119. materialValidityComments: '',
  2120. needDeviation: '',
  2121. technicalPlan: '',
  2122. wmRequiredSpec: '',
  2123. isFiberMaterial: '',
  2124. materialThickness: '',
  2125. buyer: '',
  2126. expectReportTime: '',
  2127. qualificationDocumentsNeeded: '',
  2128. qualificationDocumentsNeededList: [],
  2129. testReportIncludingItems: '',
  2130. testReportIncludingItemsList: [],
  2131. remark: '',
  2132. status: '',
  2133. sgsReportNumber: '',
  2134. rohsStatus: 'Active',
  2135. expiredDate: '',
  2136. expiryDate: '',
  2137. fiberInformation: '',
  2138. hsfStandard: '',
  2139. hsfApprover: '',
  2140. hsfApproverName: '',
  2141. hsfApproverCodeList: [],
  2142. relatedPeople: '',
  2143. relatedPeopleName: '',
  2144. buNo: '',
  2145. validUntilValue: 0,
  2146. validUntil: '',
  2147. isMeetRohsRequirement: '',
  2148. isAhGrade: 'N',
  2149. hsfSupplierClassification: '',
  2150. materialDesc: '',
  2151. npdRemark: '',
  2152. isSameMaterialDiffSize: '',
  2153. ifsPartNo: '',
  2154. materialList: [],
  2155. stepId: null,
  2156. rejectFlag: '',
  2157. rejectStepId: null,
  2158. createBy2: '',
  2159. isReject: 'Y',
  2160. tpProcessControl: 'N',
  2161. csProcessControl: 'N'
  2162. }
  2163. }
  2164. },
  2165. created () {
  2166. this.menuId = (this.$route.meta && this.$route.meta.menuId) || this.menuId || '112001'
  2167. this.getButtonAuthData()
  2168. this.checkSuperAdmin()
  2169. },
  2170. mounted () {
  2171. this.fetchNodeOptions()
  2172. if (this.authSearch) {
  2173. this.handleRouteQuery()
  2174. }
  2175. this.$nextTick(() => {
  2176. this.height = window.innerHeight / 2 - 30
  2177. /*第二个表格高度的动态调整*/
  2178. this.secondHeight = window.innerHeight / 2 - 186
  2179. })
  2180. },
  2181. activated () {
  2182. this.handleRouteQuery()
  2183. },
  2184. watch: {
  2185. activeName (val) {
  2186. if (val === 'attachmentInfo' || val === 'npdInfo') {
  2187. this.$nextTick(() => {
  2188. if (val === 'attachmentInfo') {
  2189. this.refreshOssRef('modalAttachmentTdsOss')
  2190. this.refreshOssRef('modalAttachmentMsdsOss')
  2191. this.refreshOssRef('modalAttachmentTestReportOss')
  2192. this.refreshOssRef('modalAttachmentOtherOss')
  2193. }
  2194. if (val === 'npdInfo') {
  2195. this.refreshOssRef('modalTdsOss')
  2196. }
  2197. })
  2198. }
  2199. },
  2200. 'modalData.expiredDate' () {
  2201. this.syncExpiryDateByRule()
  2202. },
  2203. 'modalData.validUntilValue' () {
  2204. this.syncExpiryDateByRule()
  2205. },
  2206. 'modalData.validUntil' () {
  2207. this.syncExpiryDateByRule()
  2208. },
  2209. 'modalData.endCustomer' () {
  2210. this.applyHsfStandardDefaultByCustomer(this.modalData)
  2211. }
  2212. },
  2213. methods: {
  2214. resolveRouteReferenceNo () {
  2215. const routeParams = this.$route.params || {}
  2216. const routeQuery = this.$route.query || {}
  2217. const referenceNo = routeParams.referenceNo || routeParams.rohsNo || routeParams.docNo || routeParams.documentNo ||
  2218. routeQuery.referenceNo || routeQuery.rohsNo || routeQuery.docNo || routeQuery.documentNo || ''
  2219. return String(referenceNo || '').trim()
  2220. },
  2221. handleRouteQuery () {
  2222. if (!this.authSearch) {
  2223. return
  2224. }
  2225. const routeParams = this.$route.params || {}
  2226. const isTokenLogin = routeParams.type === 'tokenLogin'
  2227. const referenceNo = this.resolveRouteReferenceNo()
  2228. if (isTokenLogin) {
  2229. if (!referenceNo) {
  2230. this.getDataList()
  2231. return
  2232. }
  2233. if (this.modalFlag && String(this.modalData.referenceNo || '').trim() === referenceNo) {
  2234. return
  2235. }
  2236. this.searchData.referenceNo = referenceNo
  2237. this.getDataList().then((rows) => {
  2238. const rowList = Array.isArray(rows) ? rows : (this.dataList || [])
  2239. if (!rowList.length) {
  2240. if (this.$refs.rohsTable) {
  2241. this.$refs.rohsTable.setCurrentRow()
  2242. }
  2243. return
  2244. }
  2245. this.$nextTick(() => {
  2246. if (this.$refs.rohsTable) {
  2247. this.$refs.rohsTable.setCurrentRow(rowList[0])
  2248. }
  2249. this.addOrUpdateHandle(rowList[0], true)
  2250. })
  2251. })
  2252. return
  2253. }
  2254. if (referenceNo) {
  2255. this.searchData.referenceNo = referenceNo
  2256. }
  2257. this.getDataList()
  2258. },
  2259. fetchNodeOptions () {
  2260. if (!this.searchData.site || !this.menuId) {
  2261. this.nodeOptions = []
  2262. return
  2263. }
  2264. let params = {
  2265. site: this.searchData.site,
  2266. menuId: this.menuId
  2267. }
  2268. api.getNodeList(params).then(({data}) => {
  2269. if (data && data.code === 0 && Array.isArray(data.rows)) {
  2270. this.nodeOptions = data.rows
  2271. .filter(item => item && item.nodeId)
  2272. .map(item => ({
  2273. id: item.nodeId,
  2274. name: item.nodeName
  2275. }))
  2276. } else {
  2277. this.nodeOptions = []
  2278. }
  2279. }).catch(() => {
  2280. this.nodeOptions = []
  2281. })
  2282. },
  2283. loadNodeAuthority (site, stepId) {
  2284. if (!site || stepId === null || stepId === undefined || !this.menuId) {
  2285. this.plmRohsAuthorityArr = []
  2286. this.nodeAuthorityLoaded = true
  2287. return Promise.resolve()
  2288. }
  2289. this.nodeAuthorityLoaded = false
  2290. let params = {
  2291. site: site,
  2292. stepId: stepId,
  2293. menuId: this.menuId
  2294. }
  2295. return api.getRohsNodeAuthority(params).then(({data}) => {
  2296. if (data && data.code === 0 && data.rows) {
  2297. this.plmRohsAuthorityArr = data.rows.plm_rohs || []
  2298. } else {
  2299. this.plmRohsAuthorityArr = []
  2300. }
  2301. this.nodeAuthorityLoaded = true
  2302. }).catch(() => {
  2303. this.plmRohsAuthorityArr = []
  2304. this.nodeAuthorityLoaded = true
  2305. })
  2306. },
  2307. rohsFieldFlag (fieldId) {
  2308. if (!this.plmRohsAuthorityArr || this.plmRohsAuthorityArr.length === 0) {
  2309. return 'N'
  2310. }
  2311. let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId)
  2312. return target ? target.updateFlag : 'N'
  2313. },
  2314. isRohsFieldDisabled (fieldId) {
  2315. if (this.showModalFlag) {
  2316. return true
  2317. }
  2318. if (!this.isEditMode) {
  2319. return false
  2320. }
  2321. return this.rohsFieldFlag(fieldId) === 'N'
  2322. },
  2323. isProcessFieldDisabled () {
  2324. if (this.isEditMode) {
  2325. return true
  2326. }
  2327. return this.isRohsFieldDisabled('process')
  2328. },
  2329. handleProcessChange (value) {
  2330. const processValue = String(value || '').trim()
  2331. this.$set(this.modalData, 'process', processValue)
  2332. this.$set(this.modalData, 'buNo', processValue)
  2333. if (this.isEditMode) {
  2334. return
  2335. }
  2336. this.clearHsfApproverFields(false)
  2337. if (!processValue) {
  2338. return
  2339. }
  2340. this.loadHsfApproverByCurrentProcess(true)
  2341. },
  2342. isRohsFieldDisabledWithFallback (primaryFieldId, fallbackFieldId) {
  2343. if (this.showModalFlag) {
  2344. return true
  2345. }
  2346. if (!this.isEditMode) {
  2347. return false
  2348. }
  2349. const primaryDisabled = this.rohsFieldFlag(primaryFieldId) === 'N'
  2350. if (!primaryDisabled) {
  2351. return false
  2352. }
  2353. return this.rohsFieldFlag(fallbackFieldId) === 'N'
  2354. },
  2355. isValidUntilValueDisabled () {
  2356. return this.isRohsFieldDisabledWithFallback('validUntilValue', 'validUntil')
  2357. },
  2358. isValidUntilUnitDisabled () {
  2359. return this.isRohsFieldDisabledWithFallback('validUntil', 'validUntilValue')
  2360. },
  2361. canEditRohsMaterial () {
  2362. return !this.showModalFlag
  2363. },
  2364. normalizeDateOnly (value) {
  2365. if (value === null || value === undefined || value === '') {
  2366. return ''
  2367. }
  2368. if (value instanceof Date && !Number.isNaN(value.getTime())) {
  2369. const year = value.getFullYear()
  2370. const month = String(value.getMonth() + 1).padStart(2, '0')
  2371. const day = String(value.getDate()).padStart(2, '0')
  2372. return year + '-' + month + '-' + day
  2373. }
  2374. const text = String(value).trim()
  2375. if (!text) {
  2376. return ''
  2377. }
  2378. if (text.includes('T')) {
  2379. return text.split('T')[0]
  2380. }
  2381. return text.length >= 10 ? text.substring(0, 10) : text
  2382. },
  2383. parseDateOnly (value) {
  2384. const text = this.normalizeDateOnly(value)
  2385. if (!text) {
  2386. return null
  2387. }
  2388. const parts = text.split('-')
  2389. if (parts.length !== 3) {
  2390. return null
  2391. }
  2392. const year = Number.parseInt(parts[0], 10)
  2393. const month = Number.parseInt(parts[1], 10)
  2394. const day = Number.parseInt(parts[2], 10)
  2395. if (Number.isNaN(year) || Number.isNaN(month) || Number.isNaN(day)) {
  2396. return null
  2397. }
  2398. const date = new Date(year, month - 1, day)
  2399. if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
  2400. return null
  2401. }
  2402. return date
  2403. },
  2404. normalizeValidUntilUnitType (unitValue) {
  2405. const text = String(unitValue || '').trim().toLowerCase()
  2406. if (!text) {
  2407. return ''
  2408. }
  2409. if (text === 'd' || text === 'day' || text === 'days' || text.includes('日')) {
  2410. return 'day'
  2411. }
  2412. if (text === 'w' || text === 'week' || text === 'weeks' || text.includes('周')) {
  2413. return 'week'
  2414. }
  2415. if (text === 'm' || text === 'month' || text === 'months' || text.includes('月')) {
  2416. return 'month'
  2417. }
  2418. if (text === 'y' || text === 'year' || text === 'years' || text.includes('年')) {
  2419. return 'year'
  2420. }
  2421. return ''
  2422. },
  2423. addMonthsKeepDay (baseDate, monthDelta) {
  2424. const year = baseDate.getFullYear()
  2425. const month = baseDate.getMonth()
  2426. const day = baseDate.getDate()
  2427. const targetFirstDay = new Date(year, month + monthDelta, 1)
  2428. const targetYear = targetFirstDay.getFullYear()
  2429. const targetMonth = targetFirstDay.getMonth()
  2430. const lastDay = new Date(targetYear, targetMonth + 1, 0).getDate()
  2431. return new Date(targetYear, targetMonth, Math.min(day, lastDay))
  2432. },
  2433. addYearsKeepDay (baseDate, yearDelta) {
  2434. const targetYear = baseDate.getFullYear() + yearDelta
  2435. const month = baseDate.getMonth()
  2436. const day = baseDate.getDate()
  2437. const lastDay = new Date(targetYear, month + 1, 0).getDate()
  2438. return new Date(targetYear, month, Math.min(day, lastDay))
  2439. },
  2440. calculateExpiryDateByRule (reportDate, validUntilValue, validUntilUnit) {
  2441. const baseDate = this.parseDateOnly(reportDate)
  2442. const durationValue = this.normalizeValidUntilValue(validUntilValue)
  2443. const unitType = this.normalizeValidUntilUnitType(validUntilUnit)
  2444. if (!baseDate || !durationValue || !unitType) {
  2445. return ''
  2446. }
  2447. let resultDate = new Date(baseDate.getTime())
  2448. if (unitType === 'day') {
  2449. resultDate.setDate(resultDate.getDate() + durationValue)
  2450. } else if (unitType === 'week') {
  2451. resultDate.setDate(resultDate.getDate() + durationValue * 7)
  2452. } else if (unitType === 'month') {
  2453. resultDate = this.addMonthsKeepDay(baseDate, durationValue)
  2454. } else if (unitType === 'year') {
  2455. resultDate = this.addYearsKeepDay(baseDate, durationValue)
  2456. } else {
  2457. return ''
  2458. }
  2459. return this.normalizeDateOnly(resultDate)
  2460. },
  2461. syncExpiryDateByRule () {
  2462. if (!this.modalData) {
  2463. return ''
  2464. }
  2465. const expiryDate = this.calculateExpiryDateByRule(this.modalData.expiredDate, this.modalData.validUntilValue, this.modalData.validUntil)
  2466. this.$set(this.modalData, 'expiryDate', expiryDate)
  2467. return expiryDate
  2468. },
  2469. getCurrentDateString () {
  2470. return this.normalizeDateOnly(new Date())
  2471. },
  2472. normalizeCheckboxFlag (value) {
  2473. return String(value || '').trim().toUpperCase() === 'Y' ? 'Y' : 'N'
  2474. },
  2475. normalizeValidUntilValue (value) {
  2476. if (value === null || value === undefined || value === '') {
  2477. return null
  2478. }
  2479. const parsed = Number.parseInt(value, 10)
  2480. if (Number.isNaN(parsed) || parsed <= 0) {
  2481. return null
  2482. }
  2483. return parsed
  2484. },
  2485. getValidUntilDisplay (value, unit) {
  2486. const normalizedValue = this.normalizeValidUntilValue(value)
  2487. const normalizedUnit = String(unit || '').trim()
  2488. if (normalizedValue && normalizedUnit) {
  2489. return normalizedValue + normalizedUnit
  2490. }
  2491. if (normalizedValue) {
  2492. return String(normalizedValue)
  2493. }
  2494. return normalizedUnit
  2495. },
  2496. getRohsSubmitFieldValue (fieldId) {
  2497. const fieldMapping = {
  2498. materialClassify: 'materialClassifyList',
  2499. qualificationDocumentsNeeded: 'qualificationDocumentsNeededList',
  2500. testReportIncludingItems: 'testReportIncludingItemsList',
  2501. hsfApprover: 'hsfApproverCodeList'
  2502. }
  2503. const mappedField = fieldMapping[fieldId]
  2504. if (mappedField) {
  2505. return this.modalData[mappedField]
  2506. }
  2507. return this.modalData[fieldId]
  2508. },
  2509. isSubmitFieldEmpty (value) {
  2510. if (Array.isArray(value)) {
  2511. return value.length === 0
  2512. }
  2513. if (typeof value === 'string') {
  2514. return value.trim() === ''
  2515. }
  2516. return !value
  2517. },
  2518. validateSubmitRequiredFields () {
  2519. if (this.plmRohsAuthorityArr && this.plmRohsAuthorityArr.length > 0) {
  2520. let validUntilPairRequiredChecked = false
  2521. for (let i = 0; i < this.plmRohsAuthorityArr.length; i++) {
  2522. const fieldConfig = this.plmRohsAuthorityArr[i]
  2523. if (fieldConfig.required !== 'Y') {
  2524. continue
  2525. }
  2526. if (fieldConfig.fieldId === 'hsfStandard' && !this.shouldShowHsfStandard(this.modalData.endCustomer)) {
  2527. continue
  2528. }
  2529. if (fieldConfig.fieldId === 'validUntil' || fieldConfig.fieldId === 'validUntilValue') {
  2530. if (validUntilPairRequiredChecked) {
  2531. continue
  2532. }
  2533. const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
  2534. this.$set(this.modalData, 'validUntilValue', validUntilValue)
  2535. if (this.isSubmitFieldEmpty(validUntilValue) || this.isSubmitFieldEmpty(this.modalData.validUntil)) {
  2536. this.$message.warning('有效期数值/单位不能为空!')
  2537. return false
  2538. }
  2539. validUntilPairRequiredChecked = true
  2540. continue
  2541. }
  2542. const value = this.getRohsSubmitFieldValue(fieldConfig.fieldId)
  2543. if (this.isSubmitFieldEmpty(value)) {
  2544. this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!')
  2545. return false
  2546. }
  2547. }
  2548. }
  2549. return true
  2550. },
  2551. validateValidUntilPair () {
  2552. const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
  2553. const validUntilUnit = String(this.modalData.validUntil || '').trim()
  2554. this.$set(this.modalData, 'validUntilValue', validUntilValue)
  2555. this.$set(this.modalData, 'validUntil', validUntilUnit)
  2556. if (!validUntilValue && !validUntilUnit) {
  2557. return true
  2558. }
  2559. if (!validUntilValue) {
  2560. this.$message.warning('请填写有效期数值')
  2561. return false
  2562. }
  2563. if (!validUntilUnit) {
  2564. this.$message.warning('请选择有效期单位')
  2565. return false
  2566. }
  2567. return true
  2568. },
  2569. materialDialogHeaderCellStyle () {
  2570. return {
  2571. whiteSpace: 'nowrap',
  2572. wordBreak: 'keep-all'
  2573. }
  2574. },
  2575. displayYesNo (value) {
  2576. if (value === 'Y') {
  2577. return '是'
  2578. }
  2579. if (value === 'N') {
  2580. return '否'
  2581. }
  2582. return value || ''
  2583. },
  2584. getMultipleSelectTitle (value) {
  2585. if (!Array.isArray(value)) {
  2586. return ''
  2587. }
  2588. return value
  2589. .filter(item => item !== null && item !== undefined && String(item).trim() !== '')
  2590. .map(item => String(item).trim())
  2591. .join(';')
  2592. },
  2593. shouldShowHsfStandard (customerCode) {
  2594. return String(customerCode || '').trim().toUpperCase() === 'C00052'
  2595. },
  2596. applyHsfStandardDefaultByCustomer (formData) {
  2597. if (!formData || !this.shouldShowHsfStandard(formData.endCustomer)) {
  2598. return
  2599. }
  2600. const currentValue = String(formData.hsfStandard || '').trim()
  2601. if (!currentValue) {
  2602. this.$set(formData, 'hsfStandard', this.hsfStandardDefaultText)
  2603. }
  2604. },
  2605. normalizeHsfStandardByCustomer (formData) {
  2606. if (!formData) {
  2607. return
  2608. }
  2609. if (!this.shouldShowHsfStandard(formData.endCustomer)) {
  2610. this.$set(formData, 'hsfStandard', '')
  2611. return
  2612. }
  2613. this.applyHsfStandardDefaultByCustomer(formData)
  2614. },
  2615. resolveOperatorNameById (operatorId) {
  2616. const normalizedId = String(operatorId || '').trim()
  2617. if (!normalizedId) {
  2618. return ''
  2619. }
  2620. const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId) ||
  2621. (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId)
  2622. return option ? String(option.operatorName || '').trim() : normalizedId
  2623. },
  2624. resolveOperatorIdByCodeOrName (operatorValue) {
  2625. const normalizedValue = String(operatorValue || '').trim()
  2626. if (!normalizedValue) {
  2627. return ''
  2628. }
  2629. const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
  2630. (this.hsfApproverOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue) ||
  2631. (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
  2632. (this.relatedPeopleOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue)
  2633. return option ? String(option.operatorId || '').trim() : normalizedValue
  2634. },
  2635. syncHsfApproverFields () {
  2636. const sourceList = Array.isArray(this.modalData.hsfApproverCodeList)
  2637. ? this.modalData.hsfApproverCodeList
  2638. : []
  2639. const uniqueCodeList = []
  2640. const seen = new Set()
  2641. sourceList.forEach(item => {
  2642. const value = this.resolveOperatorIdByCodeOrName(item)
  2643. if (!value || seen.has(value)) {
  2644. return
  2645. }
  2646. seen.add(value)
  2647. uniqueCodeList.push(value)
  2648. })
  2649. this.$set(this.modalData, 'hsfApproverCodeList', uniqueCodeList)
  2650. this.$set(this.modalData, 'hsfApprover', uniqueCodeList.join(';'))
  2651. this.$set(this.modalData, 'hsfApproverName', uniqueCodeList.map(item => this.resolveOperatorNameById(item)).join(';'))
  2652. this.buildRelatedPeopleOptions(uniqueCodeList)
  2653. const relatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
  2654. if (relatedPeopleCode && !uniqueCodeList.includes(relatedPeopleCode)) {
  2655. this.$set(this.modalData, 'relatedPeople', '')
  2656. this.$set(this.modalData, 'relatedPeopleName', '')
  2657. return
  2658. }
  2659. if (relatedPeopleCode) {
  2660. this.$set(this.modalData, 'relatedPeople', relatedPeopleCode)
  2661. this.$set(this.modalData, 'relatedPeopleName', this.resolveOperatorNameById(relatedPeopleCode))
  2662. }
  2663. },
  2664. buildRelatedPeopleOptions (selectedOperatorIds) {
  2665. const normalizedIds = (Array.isArray(selectedOperatorIds) ? selectedOperatorIds : (this.modalData.hsfApproverCodeList || []))
  2666. .map(item => this.resolveOperatorIdByCodeOrName(item))
  2667. .filter(item => !!item)
  2668. const selectedSet = new Set(normalizedIds)
  2669. let optionList = (this.hsfApproverOptionList || [])
  2670. .filter(item => selectedSet.has(String(item.operatorId || '').trim()))
  2671. .map(item => ({
  2672. operatorId: item.operatorId,
  2673. operatorName: item.operatorName
  2674. }))
  2675. const existingIdSet = new Set(optionList.map(item => String(item.operatorId || '').trim()))
  2676. normalizedIds.forEach(operatorId => {
  2677. if (existingIdSet.has(operatorId)) {
  2678. return
  2679. }
  2680. optionList.push({
  2681. operatorId: operatorId,
  2682. operatorName: this.resolveOperatorNameById(operatorId)
  2683. })
  2684. existingIdSet.add(operatorId)
  2685. })
  2686. this.relatedPeopleOptionList = optionList
  2687. this.filterRelatedPeopleOptions()
  2688. const selectedRelatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
  2689. const selectedRelatedPeopleRow = optionList.find(item => String(item.operatorId || '').trim() === selectedRelatedPeopleCode)
  2690. if (!selectedRelatedPeopleRow) {
  2691. this.$set(this.modalData, 'relatedPeople', '')
  2692. this.$set(this.modalData, 'relatedPeopleName', '')
  2693. } else {
  2694. this.$set(this.modalData, 'relatedPeople', selectedRelatedPeopleCode)
  2695. this.$set(this.modalData, 'relatedPeopleName', String(selectedRelatedPeopleRow.operatorName || '').trim())
  2696. }
  2697. },
  2698. normalizeHsfApproverOptionList (rows) {
  2699. if (!Array.isArray(rows)) {
  2700. return []
  2701. }
  2702. return rows
  2703. .map(item => {
  2704. const operatorId = String(item.operatorId || item.operator_id || item.username || item.userName || '').trim()
  2705. const operatorName = String(item.operatorName || item.operator_name || item.userDisplay || item.user_display || '').trim()
  2706. if (!operatorId || !operatorName) {
  2707. return null
  2708. }
  2709. return {
  2710. operatorId,
  2711. operatorName
  2712. }
  2713. })
  2714. .filter(item => !!item)
  2715. },
  2716. filterHsfApproverOptions () {
  2717. const operatorIdKeyword = String(this.hsfApproverSearchData.operatorId || '').trim().toUpperCase()
  2718. const operatorNameKeyword = String(this.hsfApproverSearchData.operatorName || '').trim().toUpperCase()
  2719. this.hsfApproverDisplayList = (this.hsfApproverOptionList || []).filter(item => {
  2720. const operatorId = String(item.operatorId || '').toUpperCase()
  2721. const operatorName = String(item.operatorName || '').toUpperCase()
  2722. const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
  2723. const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
  2724. return matchOperatorId && matchOperatorName
  2725. })
  2726. },
  2727. filterRelatedPeopleOptions () {
  2728. const operatorIdKeyword = String(this.relatedPeopleSearchData.operatorId || '').trim().toUpperCase()
  2729. const operatorNameKeyword = String(this.relatedPeopleSearchData.operatorName || '').trim().toUpperCase()
  2730. this.relatedPeopleDisplayList = (this.relatedPeopleOptionList || []).filter(item => {
  2731. const operatorId = String(item.operatorId || '').toUpperCase()
  2732. const operatorName = String(item.operatorName || '').toUpperCase()
  2733. const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
  2734. const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
  2735. return matchOperatorId && matchOperatorName
  2736. })
  2737. },
  2738. openHsfApproverChooseModal () {
  2739. if (this.isRohsFieldDisabled('hsfApprover')) {
  2740. return
  2741. }
  2742. if (!this.modalData || !String(this.modalData.process || '').trim()) {
  2743. this.$message.warning('请先选择工艺')
  2744. return
  2745. }
  2746. this.loadHsfApproverByCurrentProcess(false).then(() => {
  2747. if (!this.hsfApproverOptionList || this.hsfApproverOptionList.length === 0) {
  2748. this.$message.warning('未查询到可选HSF审批人')
  2749. return
  2750. }
  2751. this.hsfApproverFlag = true
  2752. })
  2753. },
  2754. openHsfApproverDialog () {
  2755. this.hsfApproverSearchData = {
  2756. operatorId: '',
  2757. operatorName: ''
  2758. }
  2759. this.filterHsfApproverOptions()
  2760. const selectedOperatorSet = new Set(
  2761. (this.modalData.hsfApproverCodeList || [])
  2762. .map(item => String(item || '').trim())
  2763. .filter(item => !!item)
  2764. )
  2765. const selectedRows = (this.hsfApproverOptionList || []).filter(item => selectedOperatorSet.has(String(item.operatorId || '').trim()))
  2766. this.hsfApproverSelectionCache = JSON.parse(JSON.stringify(selectedRows))
  2767. this.$nextTick(() => {
  2768. if (!this.$refs.hsfApproverTable) {
  2769. return
  2770. }
  2771. this.$refs.hsfApproverTable.clearSelection()
  2772. selectedRows.forEach(item => {
  2773. this.$refs.hsfApproverTable.toggleRowSelection(item, true)
  2774. })
  2775. })
  2776. },
  2777. closeHsfApproverDialog () {
  2778. this.hsfApproverSelectionCache = []
  2779. },
  2780. handleHsfApproverSelectionChange (rows) {
  2781. this.hsfApproverSelectionCache = rows || []
  2782. },
  2783. handleHsfApproverTableClick (row, column, event, tableRef) {
  2784. if (this.$refs[tableRef]) {
  2785. this.$refs[tableRef].toggleRowSelection(row)
  2786. }
  2787. },
  2788. saveHsfApproverChooseModal () {
  2789. const selectedCodes = (this.hsfApproverSelectionCache || [])
  2790. .map(item => String(item.operatorId || '').trim())
  2791. .filter(item => !!item)
  2792. this.$set(this.modalData, 'hsfApproverCodeList', selectedCodes)
  2793. this.syncHsfApproverFields()
  2794. this.hsfApproverFlag = false
  2795. },
  2796. clearHsfApproverSelection () {
  2797. this.$set(this.modalData, 'hsfApproverCodeList', [])
  2798. this.syncHsfApproverFields()
  2799. },
  2800. openRelatedPeopleChooseModal () {
  2801. if (this.isRohsFieldDisabled('relatedPeople')) {
  2802. return
  2803. }
  2804. if (!this.modalData || !Array.isArray(this.modalData.hsfApproverCodeList) || this.modalData.hsfApproverCodeList.length === 0) {
  2805. this.$message.warning('请先选择HSF审批人')
  2806. return
  2807. }
  2808. this.buildRelatedPeopleOptions(this.modalData.hsfApproverCodeList)
  2809. if (!this.relatedPeopleOptionList || this.relatedPeopleOptionList.length === 0) {
  2810. this.$message.warning('未查询到可选Inform Related people')
  2811. return
  2812. }
  2813. this.relatedPeopleFlag = true
  2814. },
  2815. openRelatedPeopleDialog () {
  2816. this.relatedPeopleSearchData = {
  2817. operatorId: '',
  2818. operatorName: ''
  2819. }
  2820. this.filterRelatedPeopleOptions()
  2821. const relatedPeopleCode = String(this.modalData.relatedPeople || '').trim()
  2822. const selectedRow = (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === relatedPeopleCode) || null
  2823. this.relatedPeopleSelection = selectedRow
  2824. this.$nextTick(() => {
  2825. if (!this.$refs.relatedPeopleTable) {
  2826. return
  2827. }
  2828. this.$refs.relatedPeopleTable.setCurrentRow(selectedRow || null)
  2829. })
  2830. },
  2831. closeRelatedPeopleDialog () {
  2832. this.relatedPeopleSelection = null
  2833. },
  2834. handleRelatedPeopleCurrentChange (row) {
  2835. this.relatedPeopleSelection = row || null
  2836. },
  2837. handleRelatedPeopleTableClick (row) {
  2838. this.relatedPeopleSelection = row || null
  2839. if (this.$refs.relatedPeopleTable) {
  2840. this.$refs.relatedPeopleTable.setCurrentRow(row)
  2841. }
  2842. },
  2843. saveRelatedPeopleChooseModal () {
  2844. const selectedCode = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorId || '').trim() : ''
  2845. const selectedName = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorName || '').trim() : ''
  2846. this.$set(this.modalData, 'relatedPeople', selectedCode)
  2847. this.$set(this.modalData, 'relatedPeopleName', selectedName)
  2848. this.relatedPeopleFlag = false
  2849. },
  2850. clearRelatedPeopleSelection () {
  2851. this.$set(this.modalData, 'relatedPeople', '')
  2852. this.$set(this.modalData, 'relatedPeopleName', '')
  2853. this.relatedPeopleSelection = null
  2854. if (this.$refs.relatedPeopleTable) {
  2855. this.$refs.relatedPeopleTable.setCurrentRow(null)
  2856. }
  2857. },
  2858. clearHsfApproverFields (clearBuNo = false) {
  2859. if (clearBuNo) {
  2860. this.$set(this.modalData, 'buNo', '')
  2861. }
  2862. this.hsfApproverOptionList = []
  2863. this.hsfApproverDisplayList = []
  2864. this.hsfApproverSelectionCache = []
  2865. this.relatedPeopleOptionList = []
  2866. this.relatedPeopleDisplayList = []
  2867. this.relatedPeopleSelection = null
  2868. this.relatedPeopleFlag = false
  2869. this.hsfApproverSearchData = {
  2870. operatorId: '',
  2871. operatorName: ''
  2872. }
  2873. this.relatedPeopleSearchData = {
  2874. operatorId: '',
  2875. operatorName: ''
  2876. }
  2877. this.$set(this.modalData, 'hsfApproverCodeList', [])
  2878. this.$set(this.modalData, 'hsfApprover', '')
  2879. this.$set(this.modalData, 'hsfApproverName', '')
  2880. this.$set(this.modalData, 'relatedPeople', '')
  2881. this.$set(this.modalData, 'relatedPeopleName', '')
  2882. },
  2883. loadHsfApproverByCurrentProcess (forceSelectAll = false) {
  2884. if (!this.modalData || !this.modalData.site) {
  2885. this.hsfApproverOptionList = []
  2886. this.hsfApproverDisplayList = []
  2887. this.hsfApproverSelectionCache = []
  2888. if (forceSelectAll) {
  2889. this.clearHsfApproverFields(false)
  2890. }
  2891. return Promise.resolve()
  2892. }
  2893. const buNo = String(this.modalData.process || '').trim()
  2894. if (!buNo) {
  2895. if (forceSelectAll) {
  2896. this.$message.warning('请先选择工艺')
  2897. this.clearHsfApproverFields(false)
  2898. }
  2899. this.hsfApproverOptionList = []
  2900. this.hsfApproverDisplayList = []
  2901. this.hsfApproverSelectionCache = []
  2902. return Promise.resolve()
  2903. }
  2904. const params = {
  2905. site: this.modalData.site,
  2906. buNo: buNo,
  2907. roleNo: 'R015'
  2908. }
  2909. return api.searchBmUser(params).then(({data}) => {
  2910. if (data && data.code === 0 && Array.isArray(data.rows)) {
  2911. this.hsfApproverOptionList = this.normalizeHsfApproverOptionList(data.rows)
  2912. this.filterHsfApproverOptions()
  2913. this.hsfApproverSelectionCache = []
  2914. if (forceSelectAll) {
  2915. const defaultSelectedCodes = this.hsfApproverOptionList.map(item => item.operatorId).filter(item => item)
  2916. this.$set(this.modalData, 'hsfApproverCodeList', defaultSelectedCodes)
  2917. }
  2918. this.syncHsfApproverFields()
  2919. } else {
  2920. this.hsfApproverOptionList = []
  2921. this.hsfApproverDisplayList = []
  2922. this.hsfApproverSelectionCache = []
  2923. if (forceSelectAll) {
  2924. this.clearHsfApproverFields(false)
  2925. }
  2926. }
  2927. }).catch(() => {
  2928. this.hsfApproverOptionList = []
  2929. this.hsfApproverDisplayList = []
  2930. this.hsfApproverSelectionCache = []
  2931. if (forceSelectAll) {
  2932. this.clearHsfApproverFields(false)
  2933. }
  2934. })
  2935. },
  2936. isCurrentApprover () {
  2937. return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2))
  2938. },
  2939. canSaveAction () {
  2940. return !this.showModalFlag && (this.modalData.status === '草稿' || (this.modalData.status === '审批中' && this.isCurrentApprover()))
  2941. },
  2942. canAgreeAction () {
  2943. return this.authSubmit && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.tpProcessControl !== 'Y' && this.modalData.csProcessControl !== 'Y'
  2944. },
  2945. canRejectAction () {
  2946. return this.authReject && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.isReject === 'Y'
  2947. },
  2948. hasPersistedRohsRecord () {
  2949. return !!(this.modalData && this.modalData.site && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-'))
  2950. },
  2951. openRohsRemarkDialog () {
  2952. this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
  2953. this.rohsRemarkFlag = true
  2954. },
  2955. refreshRohsRemark () {
  2956. if (!this.hasPersistedRohsRecord()) {
  2957. this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
  2958. return
  2959. }
  2960. api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
  2961. if (data && data.code === 0 && data.data) {
  2962. this.$set(this.rohsRemarkForm, 'remark', data.data.remark || '')
  2963. } else {
  2964. this.$message.error((data && data.msg) || '刷新失败')
  2965. }
  2966. }).catch(() => {
  2967. this.$message.error('刷新失败')
  2968. })
  2969. },
  2970. saveRohsRemark () {
  2971. const remark = this.rohsRemarkForm.remark || ''
  2972. if (!this.hasPersistedRohsRecord()) {
  2973. this.$set(this.modalData, 'remark', remark)
  2974. this.rohsRemarkFlag = false
  2975. this.$message.success('暂存成功,保存单据后写入数据库')
  2976. return
  2977. }
  2978. const params = {
  2979. site: this.modalData.site,
  2980. referenceNo: this.modalData.referenceNo,
  2981. remark: remark
  2982. }
  2983. api.updateRohsRemark(params).then(({data}) => {
  2984. if (data && data.code === 0) {
  2985. this.$set(this.modalData, 'remark', remark)
  2986. if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
  2987. this.$set(this.currentRow, 'remark', remark)
  2988. }
  2989. const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
  2990. if (target) {
  2991. this.$set(target, 'remark', remark)
  2992. }
  2993. this.rohsRemarkFlag = false
  2994. this.$message.success('操作成功')
  2995. } else {
  2996. this.$message.error((data && data.msg) || '保存失败')
  2997. }
  2998. }).catch(() => {
  2999. this.$message.error('保存失败')
  3000. })
  3001. },
  3002. openRohsMaterialDescDialog () {
  3003. this.$set(this.rohsMaterialDescForm, 'materialDesc', this.modalData.materialDesc || '')
  3004. this.rohsMaterialDescFlag = true
  3005. },
  3006. refreshRohsMaterialDesc () {
  3007. if (!this.hasPersistedRohsRecord()) {
  3008. this.$set(this.rohsMaterialDescForm, 'materialDesc', this.modalData.materialDesc || '')
  3009. return
  3010. }
  3011. api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
  3012. if (data && data.code === 0 && data.data) {
  3013. this.$set(this.rohsMaterialDescForm, 'materialDesc', data.data.materialDesc || '')
  3014. } else {
  3015. this.$message.error((data && data.msg) || '刷新失败')
  3016. }
  3017. }).catch(() => {
  3018. this.$message.error('刷新失败')
  3019. })
  3020. },
  3021. saveRohsMaterialDesc () {
  3022. const materialDesc = this.rohsMaterialDescForm.materialDesc || ''
  3023. if (!this.hasPersistedRohsRecord()) {
  3024. this.$set(this.modalData, 'materialDesc', materialDesc)
  3025. this.rohsMaterialDescFlag = false
  3026. this.$message.success('暂存成功,保存单据后写入数据库')
  3027. return
  3028. }
  3029. const params = {
  3030. site: this.modalData.site,
  3031. referenceNo: this.modalData.referenceNo,
  3032. materialDesc: materialDesc
  3033. }
  3034. api.updateRohsMaterialDesc(params).then(({data}) => {
  3035. if (data && data.code === 0) {
  3036. this.$set(this.modalData, 'materialDesc', materialDesc)
  3037. if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
  3038. this.$set(this.currentRow, 'materialDesc', materialDesc)
  3039. }
  3040. const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
  3041. if (target) {
  3042. this.$set(target, 'materialDesc', materialDesc)
  3043. }
  3044. this.rohsMaterialDescFlag = false
  3045. this.$message.success('操作成功')
  3046. } else {
  3047. this.$message.error((data && data.msg) || '保存失败')
  3048. }
  3049. }).catch(() => {
  3050. this.$message.error('保存失败')
  3051. })
  3052. },
  3053. loadModalButtonCondition () {
  3054. if (!this.modalData.site || !this.modalData.referenceNo || this.modalData.status !== '审批中') {
  3055. this.$set(this.modalData, 'createBy2', '')
  3056. this.$set(this.modalData, 'isReject', 'Y')
  3057. this.$set(this.modalData, 'tpProcessControl', 'N')
  3058. this.$set(this.modalData, 'csProcessControl', 'N')
  3059. return
  3060. }
  3061. let params = {
  3062. site: this.modalData.site,
  3063. referenceNo: this.modalData.referenceNo
  3064. }
  3065. api.getRohsButtonCondition(params).then(({data}) => {
  3066. if (data && data.code === 0 && data.data) {
  3067. this.$set(this.modalData, 'createBy2', data.data.createBy2 || '')
  3068. this.$set(this.modalData, 'isReject', data.data.isReject || 'Y')
  3069. this.$set(this.modalData, 'tpProcessControl', data.data.tpProcessControl || 'N')
  3070. this.$set(this.modalData, 'csProcessControl', data.data.csProcessControl || 'N')
  3071. } else {
  3072. this.$set(this.modalData, 'createBy2', '')
  3073. this.$set(this.modalData, 'isReject', 'Y')
  3074. this.$set(this.modalData, 'tpProcessControl', 'N')
  3075. this.$set(this.modalData, 'csProcessControl', 'N')
  3076. }
  3077. }).catch(() => {
  3078. this.$set(this.modalData, 'createBy2', '')
  3079. this.$set(this.modalData, 'isReject', 'Y')
  3080. this.$set(this.modalData, 'tpProcessControl', 'N')
  3081. this.$set(this.modalData, 'csProcessControl', 'N')
  3082. })
  3083. },
  3084. // 列表行选中变色
  3085. rowStyle ({row}) {
  3086. if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
  3087. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  3088. }
  3089. },
  3090. // 获取按钮的权限数据
  3091. getButtonAuthData () {
  3092. this.authSearch = this.isAuth(this.menuId+":search")
  3093. this.authUpdate = this.isAuth(this.menuId+":update")
  3094. this.authIssue = this.isAuth(this.menuId+":issue")
  3095. this.authSubmit = this.isAuth(this.menuId+":submit")
  3096. this.authReject = this.isAuth(this.menuId+":reject")
  3097. this.authFileSave = this.isAuth(this.menuId+":fileSave")
  3098. this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
  3099. this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
  3100. this.authFilePreview = this.isAuth(this.menuId+":filePreview")
  3101. this.authDataEntry = this.isAuth(this.menuId+":dataEntry")
  3102. this.authMaterialDescRemark = this.isAuth(this.menuId + ":materialDescRemark")
  3103. this.authDelete = this.isAuth(this.menuId+":delete")
  3104. },
  3105. // 校验是否为超级管理员
  3106. checkSuperAdmin () {
  3107. checkSuperAdmin().then(({data}) => {
  3108. this.superAdmin = data.superAdmin
  3109. })
  3110. },
  3111. changeClickRow (row, column, event) {
  3112. this.loadCurrentRowFromServer(row, row || {})
  3113. },
  3114. currentChange (val) {
  3115. if (val) {
  3116. this.loadCurrentRowFromServer(val, val || {})
  3117. } else {
  3118. this.currentRow = {}
  3119. this.approvalList = []
  3120. }
  3121. },
  3122. dataListSelectionChange (rows) {
  3123. this.dataListSelections = rows || []
  3124. },
  3125. applyCurrentRowData (detailData, fallbackData = {}) {
  3126. this.currentRow = detailData || {}
  3127. if (!Array.isArray(this.currentRow.materialList)) {
  3128. this.$set(this.currentRow, 'materialList', [])
  3129. }
  3130. this.fillDisplayFields(this.currentRow, fallbackData || {})
  3131. this.syncDataListRow(this.currentRow)
  3132. this.refreshCurrentTabTable()
  3133. },
  3134. syncDataListRow (rowData) {
  3135. if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) {
  3136. return
  3137. }
  3138. const targetIndex = this.dataList.findIndex(item => item.site === rowData.site && item.referenceNo === rowData.referenceNo)
  3139. if (targetIndex < 0) {
  3140. return
  3141. }
  3142. const mergedRow = {
  3143. ...this.dataList[targetIndex],
  3144. ...rowData
  3145. }
  3146. this.fillDisplayFields(mergedRow, this.dataList[targetIndex] || {})
  3147. this.$set(this.dataList, targetIndex, mergedRow)
  3148. },
  3149. loadCurrentRowFromServer (row, fallbackData = {}) {
  3150. if (!row || !row.site || !row.referenceNo) {
  3151. this.applyCurrentRowData(row || {}, fallbackData || {})
  3152. return Promise.resolve()
  3153. }
  3154. return api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  3155. if (data && data.code === 0 && data.data) {
  3156. this.applyCurrentRowData(data.data, fallbackData || row)
  3157. } else {
  3158. this.applyCurrentRowData(row || {}, fallbackData || {})
  3159. }
  3160. }).catch(() => {
  3161. this.applyCurrentRowData(row || {}, fallbackData || {})
  3162. })
  3163. },
  3164. refreshCurrentRowFromServer (site, referenceNo) {
  3165. const querySite = site || (this.currentRow && this.currentRow.site)
  3166. const queryReferenceNo = referenceNo || (this.currentRow && this.currentRow.referenceNo)
  3167. if (!querySite || !queryReferenceNo || String(queryReferenceNo).startsWith('TEMP-')) {
  3168. return Promise.resolve()
  3169. }
  3170. return this.loadCurrentRowFromServer({
  3171. site: querySite,
  3172. referenceNo: queryReferenceNo
  3173. }, this.currentRow || {})
  3174. },
  3175. refreshOssRef (refName) {
  3176. const ref = this.$refs[refName]
  3177. if (!ref) {
  3178. return
  3179. }
  3180. const refList = Array.isArray(ref) ? ref : [ref]
  3181. refList.forEach(item => {
  3182. if (item && typeof item.handleQuery === 'function') {
  3183. item.handleQuery()
  3184. }
  3185. })
  3186. },
  3187. refreshAttachmentPanels () {
  3188. this.refreshOssRef('modalAttachmentTdsOss')
  3189. this.refreshOssRef('modalAttachmentMsdsOss')
  3190. this.refreshOssRef('modalAttachmentTestReportOss')
  3191. this.refreshOssRef('modalAttachmentOtherOss')
  3192. this.refreshOssRef('modalTdsOss')
  3193. this.refreshOssRef('bottomAttachmentOss')
  3194. this.refreshOssRef('bottomTdsOss')
  3195. },
  3196. handleModalClose () {
  3197. const site = this.modalData.site
  3198. const referenceNo = this.modalData.referenceNo
  3199. this.modalFlag = false
  3200. this.rohsCreatePartDialogFlag = false
  3201. this.rohsCharacteristicDialogFlag = false
  3202. this.rohsMaterialDescFlag = false
  3203. this.rohsCreatePartTab = 'General'
  3204. this.$nextTick(() => {
  3205. this.refreshAttachmentPanels()
  3206. })
  3207. this.refreshCurrentRowFromServer(site, referenceNo)
  3208. },
  3209. fillDisplayFields (target, fallbackData = {}) {
  3210. if (!target) {
  3211. return
  3212. }
  3213. const fields = ['nodeId', 'nodeName', 'currentApprover', 'applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc', 'hsfApproverName', 'relatedPeopleName']
  3214. fields.forEach(field => {
  3215. const value = target[field] || fallbackData[field] || ''
  3216. this.$set(target, field, value)
  3217. })
  3218. this.$set(target, 'endCustomerFlag', !!target.endCustomerFlag)
  3219. this.$set(target, 'projectIdFlag', !!target.projectIdFlag)
  3220. const validUntilValue = target.validUntilValue !== undefined && target.validUntilValue !== null && target.validUntilValue !== ''
  3221. ? target.validUntilValue
  3222. : fallbackData.validUntilValue
  3223. this.$set(target, 'validUntilValue', this.normalizeValidUntilValue(validUntilValue))
  3224. const applicationDate = target.applicationDate || fallbackData.applicationDate || ''
  3225. const plannedMassProductionDate = target.plannedMassProductionDate || fallbackData.plannedMassProductionDate || ''
  3226. const expiredDate = target.expiredDate || fallbackData.expiredDate || ''
  3227. const normalizedExpiredDate = this.normalizeDateOnly(expiredDate)
  3228. this.$set(target, 'applicationDate', this.normalizeDateOnly(applicationDate))
  3229. this.$set(target, 'plannedMassProductionDate', this.normalizeDateOnly(plannedMassProductionDate))
  3230. this.$set(target, 'expiredDate', normalizedExpiredDate)
  3231. this.$set(target, 'expiryDate', this.calculateExpiryDateByRule(normalizedExpiredDate, target.validUntilValue, target.validUntil))
  3232. const firstMaterialDisplay = this.resolveFirstMaterialDisplay(target)
  3233. const fallbackMainIfsPartNo = fallbackData.mainIfsPartNo || fallbackData.ifsPartNo || ''
  3234. const fallbackMainPartDesc = fallbackData.mainPartDesc || fallbackData.materialDesc || ''
  3235. this.$set(target, 'mainIfsPartNo', firstMaterialDisplay.mainIfsPartNo || target.mainIfsPartNo || fallbackMainIfsPartNo)
  3236. this.$set(target, 'mainPartDesc', firstMaterialDisplay.mainPartDesc || target.mainPartDesc || fallbackMainPartDesc)
  3237. },
  3238. resolveFirstMaterialDisplay (target) {
  3239. const materialList = Array.isArray(target && target.materialList) ? target.materialList : []
  3240. if (!materialList.length) {
  3241. return {
  3242. mainIfsPartNo: '',
  3243. mainPartDesc: ''
  3244. }
  3245. }
  3246. const firstMaterial = materialList[0] || {}
  3247. return {
  3248. mainIfsPartNo: String(firstMaterial.finalPartNo || firstMaterial.final_part_no || '').trim(),
  3249. mainPartDesc: String(firstMaterial.partDesc || firstMaterial.part_desc || '').trim()
  3250. }
  3251. },
  3252. refreshCurrentTabTable () {
  3253. if (this.activeTable === 'approvalInformation') {
  3254. this.getApprovalList()
  3255. return
  3256. }
  3257. if (this.activeTable === 'attachment') {
  3258. this.refreshOssRef('bottomAttachmentOss')
  3259. return
  3260. }
  3261. if (this.activeTable === 'npdInfo') {
  3262. this.refreshOssRef('bottomTdsOss')
  3263. }
  3264. },
  3265. getApprovalList () {
  3266. if (!this.currentRow || !this.currentRow.site || !this.currentRow.referenceNo) {
  3267. this.approvalList = []
  3268. return
  3269. }
  3270. let params = {
  3271. site: this.currentRow.site,
  3272. menuId: this.menuId,
  3273. documentNo: this.currentRow.referenceNo
  3274. }
  3275. api.getRohsApprovalList(params).then(({data}) => {
  3276. if (data && data.code === 0) {
  3277. this.approvalList = data.rows || []
  3278. } else {
  3279. this.approvalList = []
  3280. }
  3281. }).catch(() => {
  3282. this.approvalList = []
  3283. })
  3284. },
  3285. // 获取列表
  3286. getDataList () {
  3287. if (!this.authSearch) {
  3288. this.dataList = []
  3289. this.dataListSelections = []
  3290. this.totalPage = 0
  3291. this.currentRow = {}
  3292. this.approvalList = []
  3293. this.isFilterSearch = false
  3294. return Promise.resolve([])
  3295. }
  3296. this.dataListLoading = true
  3297. let params = {
  3298. page: this.pageIndex,
  3299. limit: this.pageSize,
  3300. site: this.$store.state.user.site,
  3301. menuId: this.menuId,
  3302. referenceNo: this.searchData.referenceNo,
  3303. status: this.searchData.status,
  3304. rohsStatus: this.searchData.rohsStatus,
  3305. currentApprover: this.searchData.currentApprover,
  3306. nodeId: this.searchData.nodeId,
  3307. ifsPartNo: this.searchData.ifsPartNo,
  3308. materialDesc: this.searchData.materialDesc
  3309. }
  3310. this.isFilterSearch = false
  3311. return api.getRohsList(params).then(({data}) => {
  3312. if (data && data.code === 0) {
  3313. const list = data.page.list || []
  3314. this.dataList = list.map(item => {
  3315. return {
  3316. applicantName: '',
  3317. pmName: '',
  3318. npdEngineerName: '',
  3319. technicalPlanName: '',
  3320. buyerName: '',
  3321. endCustomerName: '',
  3322. projectName: '',
  3323. nodeId: '',
  3324. nodeName: '',
  3325. currentApprover: '',
  3326. commGroup1Desc: '',
  3327. commGroup2Desc: '',
  3328. commGroup3Desc: '',
  3329. hsfApproverName: '',
  3330. relatedPeopleName: '',
  3331. mainIfsPartNo: '',
  3332. mainPartDesc: '',
  3333. ...item
  3334. }
  3335. })
  3336. this.dataListSelections = []
  3337. this.totalPage = data.page.totalCount
  3338. this.$nextTick(() => {
  3339. if (this.$refs.rohsTable) {
  3340. this.$refs.rohsTable.clearSelection()
  3341. }
  3342. if (this.$refs.rohsTable && this.dataList.length > 0) {
  3343. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  3344. } else if (this.$refs.rohsTable) {
  3345. this.$refs.rohsTable.setCurrentRow()
  3346. }
  3347. })
  3348. } else {
  3349. this.dataList = []
  3350. this.dataListSelections = []
  3351. this.totalPage = 0
  3352. this.currentRow = {}
  3353. this.approvalList = []
  3354. }
  3355. this.dataListLoading = false
  3356. return this.dataList
  3357. }).catch(() => {
  3358. this.dataListSelections = []
  3359. this.currentRow = {}
  3360. this.approvalList = []
  3361. this.dataListLoading = false
  3362. return []
  3363. })
  3364. },
  3365. // 分页
  3366. sizeChangeHandle (val) {
  3367. this.pageSize = val
  3368. this.pageIndex = 1
  3369. if (this.isFilterSearch === false) {
  3370. this.getDataList()
  3371. } else {
  3372. this.queryByAnyField(this.filterSearchData)
  3373. }
  3374. },
  3375. currentChangeHandle (val) {
  3376. this.pageIndex = val
  3377. if (this.isFilterSearch === false) {
  3378. this.getDataList()
  3379. } else {
  3380. this.queryByAnyField(this.filterSearchData)
  3381. }
  3382. },
  3383. // 搜索条件点击
  3384. searchHandle () {
  3385. if (!this.authSearch) {
  3386. return
  3387. }
  3388. this.filterVisible = true
  3389. },
  3390. queryByAnyField (params) {
  3391. const queryParams = {
  3392. ...(params || {})
  3393. }
  3394. queryParams.no = this.pageIndex
  3395. queryParams.size = this.pageSize
  3396. queryParams.userId = this.$store.state.user.id.toString()
  3397. queryParams.site = this.$store.state.user.site
  3398. queryParams.menuId = this.menuId
  3399. this.dataListLoading = true
  3400. api.getRohsListAny(queryParams).then(({data}) => {
  3401. if (data && data.code === 0) {
  3402. const list = (data.page && data.page.list) || []
  3403. this.dataList = list.map(item => {
  3404. return {
  3405. applicantName: '',
  3406. pmName: '',
  3407. npdEngineerName: '',
  3408. technicalPlanName: '',
  3409. buyerName: '',
  3410. endCustomerName: '',
  3411. projectName: '',
  3412. nodeId: '',
  3413. nodeName: '',
  3414. currentApprover: '',
  3415. commGroup1Desc: '',
  3416. commGroup2Desc: '',
  3417. commGroup3Desc: '',
  3418. hsfApproverName: '',
  3419. relatedPeopleName: '',
  3420. mainIfsPartNo: '',
  3421. mainPartDesc: '',
  3422. ...item
  3423. }
  3424. })
  3425. this.dataListSelections = []
  3426. this.totalPage = data.page.totalCount
  3427. this.$nextTick(() => {
  3428. if (this.$refs.rohsTable) {
  3429. this.$refs.rohsTable.clearSelection()
  3430. }
  3431. if (this.$refs.rohsTable && this.dataList.length > 0) {
  3432. this.$refs.rohsTable.setCurrentRow(this.dataList[0])
  3433. } else if (this.$refs.rohsTable) {
  3434. this.$refs.rohsTable.setCurrentRow()
  3435. }
  3436. })
  3437. } else {
  3438. this.$message.warning((data && data.msg) || '搜索失败')
  3439. this.dataList = []
  3440. this.dataListSelections = []
  3441. this.totalPage = 0
  3442. this.currentRow = {}
  3443. this.approvalList = []
  3444. }
  3445. this.dataListLoading = false
  3446. }).catch(() => {
  3447. this.dataList = []
  3448. this.dataListSelections = []
  3449. this.currentRow = {}
  3450. this.approvalList = []
  3451. this.dataListLoading = false
  3452. })
  3453. this.filterSearchData = JSON.parse(JSON.stringify(queryParams))
  3454. this.isFilterSearch = true
  3455. this.filterVisible = false
  3456. },
  3457. buildExportName () {
  3458. const now = new Date()
  3459. const year = String(now.getFullYear())
  3460. const month = String(now.getMonth() + 1).padStart(2, '0')
  3461. const day = String(now.getDate()).padStart(2, '0')
  3462. const hour = String(now.getHours()).padStart(2, '0')
  3463. const minute = String(now.getMinutes()).padStart(2, '0')
  3464. const second = String(now.getSeconds()).padStart(2, '0')
  3465. return 'RoHs记录' + year + month + day + hour + minute + second
  3466. },
  3467. async createExportData () {
  3468. const params = {
  3469. ...this.searchData,
  3470. site: this.$store.state.user.site,
  3471. menuId: this.menuId,
  3472. page: 1,
  3473. limit: -1
  3474. }
  3475. this.resultList = []
  3476. await api.getRohsList(params).then(({data}) => {
  3477. if (data && data.code === 0 && data.page && Array.isArray(data.page.list)) {
  3478. this.resultList = (data.page.list || []).map(item => {
  3479. const row = {
  3480. ...item
  3481. }
  3482. row.applicationDate = this.normalizeDateOnly(row.applicationDate)
  3483. row.plannedMassProductionDate = this.normalizeDateOnly(row.plannedMassProductionDate)
  3484. row.expectReportTime = this.normalizeDateOnly(row.expectReportTime)
  3485. row.expiredDate = this.normalizeDateOnly(row.expiredDate)
  3486. row.expiryDate = this.normalizeDateOnly(row.expiryDate)
  3487. row.validUntilDisplay = this.getValidUntilDisplay(row.validUntilValue, row.validUntil)
  3488. row.hsfApproverName = row.hsfApproverName || row.hsfApprover || ''
  3489. row.relatedPeopleName = row.relatedPeopleName || row.relatedPeople || ''
  3490. return row
  3491. })
  3492. } else {
  3493. this.$message.warning((data && data.msg) || '导出数据获取失败')
  3494. }
  3495. }).catch(() => {
  3496. this.$message.error('导出数据获取失败')
  3497. })
  3498. return this.resultList
  3499. },
  3500. startDownload () {
  3501. this.exportName = this.buildExportName()
  3502. this.exportFieldMap = this.buildExportFields()
  3503. if (!this.exportFieldMap || Object.keys(this.exportFieldMap).length === 0) {
  3504. this.$message.warning('未获取到可导出的列,请稍后重试')
  3505. }
  3506. this.exportLoading = true
  3507. },
  3508. finishDownload () {
  3509. this.exportLoading = false
  3510. },
  3511. buildExportFields () {
  3512. const tableRef = this.$refs.rohsTable
  3513. if (!tableRef || !Array.isArray(tableRef.columns)) {
  3514. return {}
  3515. }
  3516. const fields = {}
  3517. tableRef.columns.forEach(column => {
  3518. const label = column && column.label ? String(column.label).trim() : ''
  3519. const property = column && column.property ? String(column.property).trim() : ''
  3520. if (!label || !property || label === '操作') {
  3521. return
  3522. }
  3523. fields[label] = property
  3524. })
  3525. return fields
  3526. },
  3527. toPartMenu (ifsPartNo) {
  3528. const targetPartNo = String(ifsPartNo || '').trim()
  3529. if (!targetPartNo) {
  3530. this.$message.warning('IFS物料编码为空,无法跳转')
  3531. return
  3532. }
  3533. if (this.$router.resolve(`/part-partInformation`).resolved.name === '404') {
  3534. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定'})
  3535. } else {
  3536. // 先关闭当前页面所有可能产生全局遮罩的弹窗,避免跳转后残留遮罩层
  3537. this.modalFlag = false
  3538. this.chooseProjectListFlag = false
  3539. this.projectMaterialDialogFlag = false
  3540. this.rohsCreatePartDialogFlag = false
  3541. this.rohsCharacteristicDialogFlag = false
  3542. this.hsfApproverFlag = false
  3543. this.relatedPeopleFlag = false
  3544. this.submitModalFlag = false
  3545. this.rohsRemarkFlag = false
  3546. this.rohsMaterialDescFlag = false
  3547. this.$nextTick(() => {
  3548. this.$router.push({name: `part-partInformation`, params: {ifsPartNo: targetPartNo}})
  3549. })
  3550. }
  3551. },
  3552. // 单选可取消
  3553. radioClick (field, value) {
  3554. if (this.modalData[field] === value) {
  3555. this.modalData[field] = ''
  3556. } else {
  3557. this.modalData[field] = value
  3558. }
  3559. },
  3560. // 新增 / 修改
  3561. addOrUpdateHandle (row, forceOpen = false) {
  3562. if (!forceOpen && !row && !this.authUpdate) {
  3563. this.$message.warning('没有新增权限')
  3564. return
  3565. }
  3566. if (!forceOpen && row && !this.authUpdate && !this.authDataEntry) {
  3567. this.$message.warning('没有编辑权限')
  3568. return
  3569. }
  3570. this.modalFlag = true
  3571. this.activeName = 'basicInfo'
  3572. this.submitModalFlag = false
  3573. this.rohsRemarkFlag = false
  3574. this.rohsMaterialDescFlag = false
  3575. this.rejectOpinion = ''
  3576. this.rohsRemarkForm = {
  3577. remark: ''
  3578. }
  3579. this.rohsMaterialDescForm = {
  3580. materialDesc: ''
  3581. }
  3582. this.projectMaterialDialogFlag = false
  3583. this.rohsCreatePartDialogFlag = false
  3584. this.rohsCreatePartLoading = false
  3585. this.rohsCreatePartTab = 'General'
  3586. this.rohsCreatePartTagNo = 0
  3587. this.rohsCharacteristicDialogFlag = false
  3588. this.rohsCharacteristicQueryData = {
  3589. propertiesItemNo: '',
  3590. itemDesc: ''
  3591. }
  3592. this.rohsCharacteristicList = []
  3593. this.rohsCharacteristicSelections = []
  3594. this.rohsPartItemSelections = []
  3595. this.projectMaterialSelections = []
  3596. this.materialSelections = []
  3597. this.hsfApproverOptionList = []
  3598. this.hsfApproverDisplayList = []
  3599. this.hsfApproverSelectionCache = []
  3600. this.hsfApproverSearchData = {
  3601. operatorId: '',
  3602. operatorName: ''
  3603. }
  3604. this.hsfApproverFlag = false
  3605. this.relatedPeopleOptionList = []
  3606. this.relatedPeopleDisplayList = []
  3607. this.relatedPeopleSelection = null
  3608. this.relatedPeopleSearchData = {
  3609. operatorId: '',
  3610. operatorName: ''
  3611. }
  3612. this.relatedPeopleFlag = false
  3613. this.plmRohsAuthorityArr = []
  3614. this.nodeAuthorityLoaded = !row
  3615. this.isEditMode = !!row
  3616. this.projectMaterialPageIndex = 1
  3617. this.projectMaterialTotal = 0
  3618. this.projectMaterialList = []
  3619. this.projectMaterialSearchData = {
  3620. finalPartNo: '',
  3621. partDesc: '',
  3622. partStatus: ''
  3623. }
  3624. this.showModalFlag = !!(row && (row.status === '已完成' || !this.authUpdate))
  3625. if (row) {
  3626. this.modalTitle = 'RoHS 编辑'
  3627. api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
  3628. if (data && data.code === 0) {
  3629. this.modalData = data.data || {}
  3630. this.$set(this.modalData, 'qualificationDocumentsNeededList', this.modalData.qualificationDocumentsNeeded ? this.modalData.qualificationDocumentsNeeded.split(';').filter(item => item) : [])
  3631. this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
  3632. this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
  3633. this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
  3634. this.$set(this.modalData, 'hsfApproverCodeList', this.modalData.hsfApprover ? this.modalData.hsfApprover.split(';').filter(item => item) : [])
  3635. this.$set(this.modalData, 'buNo', this.modalData.process || '')
  3636. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3637. this.$set(this.modalData, 'validUntilValue', this.normalizeValidUntilValue(this.modalData.validUntilValue))
  3638. this.syncHsfApproverFields()
  3639. this.fillDisplayFields(this.modalData, row || {})
  3640. this.applyHsfStandardDefaultByCustomer(this.modalData)
  3641. // 编辑时不允许修改最终客户和项目编码
  3642. this.$set(this.modalData, 'endCustomerFlag', true)
  3643. this.$set(this.modalData, 'projectIdFlag', true)
  3644. this.$set(this.modalData, 'createBy2', '')
  3645. this.$set(this.modalData, 'isReject', 'Y')
  3646. this.$set(this.modalData, 'tpProcessControl', 'N')
  3647. this.$set(this.modalData, 'csProcessControl', 'N')
  3648. this.loadModalButtonCondition()
  3649. this.loadHsfApproverByCurrentProcess(false)
  3650. this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : (row.stepId !== null && row.stepId !== undefined ? row.stepId : 10))
  3651. }
  3652. }).catch(() => {
  3653. this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10)
  3654. })
  3655. } else {
  3656. this.modalTitle = 'RoHS 新增'
  3657. this.showModalFlag = false
  3658. // 生成一个临时ID用于附件上传绑定
  3659. const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000)
  3660. this.modalData = {
  3661. site: this.$store.state.user.site,
  3662. referenceNo: tempReferenceNo,
  3663. applicant: this.$store.state.user.name || '',
  3664. applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '',
  3665. pm: '',
  3666. pmName: '',
  3667. applicationDate: this.getCurrentDateString(),
  3668. process: '',
  3669. plannedMassProductionDate: '',
  3670. color: '',
  3671. vendorCode: '',
  3672. vendorMaterialCode: '',
  3673. materialClassify: '',
  3674. materialClassifyList: [],
  3675. otherMaterialClassify: '',
  3676. materialUseFor: '',
  3677. endCustomer: '',
  3678. endCustomerName: '',
  3679. endCustomerFlag: false,
  3680. projectId: '',
  3681. projectName: '',
  3682. projectIdFlag: true,
  3683. commGroup1: '',
  3684. commGroup1Desc: '',
  3685. commGroup2: '',
  3686. commGroup2Desc: '',
  3687. commGroup3: '',
  3688. commGroup3Desc: '',
  3689. needCreateNumber: '',
  3690. npdEngineer: '',
  3691. npdEngineerName: '',
  3692. materialValidityTime: '',
  3693. materialValidityComments: '',
  3694. needDeviation: '',
  3695. technicalPlan: '',
  3696. wmRequiredSpec: '',
  3697. isFiberMaterial: '',
  3698. materialThickness: '',
  3699. buyer: '',
  3700. buyerName: '',
  3701. expectReportTime: '',
  3702. qualificationDocumentsNeeded: '',
  3703. qualificationDocumentsNeededList: [],
  3704. testReportIncludingItems: '',
  3705. testReportIncludingItemsList: [],
  3706. remark: '',
  3707. status: '草稿',
  3708. sgsReportNumber: '',
  3709. rohsStatus: 'Active',
  3710. expiredDate: '',
  3711. expiryDate: '',
  3712. fiberInformation: '',
  3713. hsfStandard: '',
  3714. hsfApprover: '',
  3715. hsfApproverName: '',
  3716. hsfApproverCodeList: [],
  3717. relatedPeople: '',
  3718. relatedPeopleName: '',
  3719. buNo: '',
  3720. validUntilValue: 0,
  3721. validUntil: '',
  3722. isMeetRohsRequirement: '',
  3723. isAhGrade: 'N',
  3724. hsfSupplierClassification: '',
  3725. materialDesc: '',
  3726. npdRemark: '',
  3727. isSameMaterialDiffSize: '',
  3728. ifsPartNo: '',
  3729. materialList: [],
  3730. stepId: 10,
  3731. rejectFlag: 'N',
  3732. rejectStepId: null,
  3733. createBy2: '',
  3734. isReject: 'Y',
  3735. tpProcessControl: 'N',
  3736. csProcessControl: 'N'
  3737. }
  3738. this.nodeAuthorityLoaded = true
  3739. }
  3740. },
  3741. // 表单提交
  3742. dataFormSubmit () {
  3743. if (!this.canSaveAction()) {
  3744. this.$message.warning('当前状态不允许保存')
  3745. return
  3746. }
  3747. const isAddMode = this.modalTitle === 'RoHS 新增'
  3748. if (isAddMode && !String(this.modalData.endCustomer || '').trim()) {
  3749. this.$message.warning('最终客户不能为空')
  3750. return
  3751. }
  3752. if (isAddMode && !String(this.modalData.projectId || '').trim()) {
  3753. this.$message.warning('项目编码不能为空')
  3754. return
  3755. }
  3756. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3757. this.normalizeHsfStandardByCustomer(this.modalData)
  3758. this.syncHsfApproverFields()
  3759. if (!this.validateValidUntilPair()) {
  3760. return
  3761. }
  3762. this.syncExpiryDateByRule()
  3763. this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
  3764. this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
  3765. this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
  3766. this.modalData.materialList = (this.modalData.materialList || []).map((item, index) => {
  3767. return {
  3768. ...item,
  3769. lineNo: index + 1,
  3770. projectId: this.modalData.projectId
  3771. }
  3772. })
  3773. const submitMethod = this.modalTitle === 'RoHS 新增' ? api.saveRohs : api.updateRohs
  3774. submitMethod(this.modalData).then(({data}) => {
  3775. if (data && data.code === 0) {
  3776. this.$message.success('操作成功')
  3777. this.modalFlag = false
  3778. this.getDataList()
  3779. } else {
  3780. this.$message.error(data.msg || '操作失败')
  3781. }
  3782. })
  3783. },
  3784. // 同意
  3785. agreeSubmit () {
  3786. if (!this.canAgreeAction()) {
  3787. this.$message.warning('当前状态不允许同意')
  3788. return
  3789. }
  3790. this.$confirm('确认同意该申请单?', '提示', {
  3791. confirmButtonText: '确定',
  3792. cancelButtonText: '取消',
  3793. type: 'warning'
  3794. }).then(() => {
  3795. this.submitRohs('Y')
  3796. })
  3797. },
  3798. openRejectModal () {
  3799. if (!this.canRejectAction()) {
  3800. this.$message.warning('当前状态不允许驳回')
  3801. return
  3802. }
  3803. this.rejectOpinion = ''
  3804. this.submitModalFlag = true
  3805. },
  3806. // 驳回
  3807. rejectSubmit () {
  3808. if (!this.rejectOpinion || !this.rejectOpinion.trim()) {
  3809. this.$message.warning('请填写驳回意见')
  3810. return
  3811. }
  3812. this.submitRohs('N')
  3813. },
  3814. submitRohs (nodeConclusion) {
  3815. if (nodeConclusion === 'Y' && !this.canAgreeAction()) {
  3816. this.$message.warning('当前状态不允许同意')
  3817. return
  3818. }
  3819. if (nodeConclusion === 'N' && !this.canRejectAction()) {
  3820. this.$message.warning('当前状态不允许驳回')
  3821. return
  3822. }
  3823. if (!this.modalData.site || !this.modalData.referenceNo) {
  3824. this.$message.warning('单据主键信息缺失,无法提交审批')
  3825. return
  3826. }
  3827. this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
  3828. this.normalizeHsfStandardByCustomer(this.modalData)
  3829. this.syncHsfApproverFields()
  3830. if (!this.validateValidUntilPair()) {
  3831. return
  3832. }
  3833. this.syncExpiryDateByRule()
  3834. if (!this.nodeAuthorityLoaded) {
  3835. this.$message.warning('节点权限加载中,请稍后重试')
  3836. return
  3837. }
  3838. if (nodeConclusion === 'Y' && !this.validateSubmitRequiredFields()) {
  3839. return
  3840. }
  3841. const submitMaterialList = this.normalizeMaterialListForSave(this.modalData.materialList || [])
  3842. this.submitLoading = true
  3843. let params = {
  3844. ...this.modalData,
  3845. site: this.modalData.site,
  3846. referenceNo: this.modalData.referenceNo,
  3847. materialClassify: (this.modalData.materialClassifyList || []).join(';'),
  3848. qualificationDocumentsNeeded: (this.modalData.qualificationDocumentsNeededList || []).join(';'),
  3849. testReportIncludingItems: (this.modalData.testReportIncludingItemsList || []).join(';'),
  3850. materialList: submitMaterialList,
  3851. nodeConclusion: nodeConclusion,
  3852. rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '',
  3853. menuId: this.menuId,
  3854. documentNo: this.modalData.referenceNo
  3855. }
  3856. api.submitRohs(params).then(({data}) => {
  3857. if (data && data.code === 0) {
  3858. this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功')
  3859. this.submitModalFlag = false
  3860. this.modalFlag = false
  3861. this.getDataList()
  3862. } else {
  3863. this.$message.error(data.msg || '提交失败')
  3864. }
  3865. this.submitLoading = false
  3866. }).catch(() => {
  3867. this.submitLoading = false
  3868. })
  3869. },
  3870. // 下达
  3871. issueModal (row) {
  3872. if (!this.authIssue) {
  3873. this.$message.warning('没有下达权限')
  3874. return
  3875. }
  3876. this.$confirm('确认下达该申请单?', '提示', {
  3877. confirmButtonText: '确定',
  3878. cancelButtonText: '取消',
  3879. type: 'warning'
  3880. }).then(() => {
  3881. let params = {
  3882. site: row.site,
  3883. referenceNo: row.referenceNo,
  3884. menuId: this.menuId
  3885. }
  3886. api.issueRohs(params).then(({data}) => {
  3887. if (data && data.code === 0) {
  3888. this.$message.success('下达成功')
  3889. if (this.modalFlag && this.modalData.referenceNo === row.referenceNo) {
  3890. this.modalData.status = '审批中'
  3891. }
  3892. this.getDataList()
  3893. } else {
  3894. this.$message.error(data.msg || '下达失败')
  3895. }
  3896. })
  3897. })
  3898. },
  3899. deleteHandle () {
  3900. if (!this.authDelete) {
  3901. this.$message.warning('没有删除权限')
  3902. return
  3903. }
  3904. const selectedRows = (this.dataListSelections || []).filter(item => item && item.site && item.referenceNo)
  3905. if (!selectedRows.length) {
  3906. this.$message.warning('请先勾选要删除的单据')
  3907. return
  3908. }
  3909. const nonDraftRows = selectedRows.filter(item => item.status !== '草稿')
  3910. if (nonDraftRows.length) {
  3911. const previewText = nonDraftRows.slice(0, 3).map(item => item.referenceNo).join('、')
  3912. const suffix = nonDraftRows.length > 3 ? (' 等' + nonDraftRows.length + '条') : ''
  3913. this.$message.warning('仅草稿状态的单据允许删除,当前勾选包含非草稿单据:' + previewText + suffix)
  3914. return
  3915. }
  3916. this.$confirm('确认删除选中的' + selectedRows.length + '条RoHS单据?删除后会同步删除材料和附件数据。', '提示', {
  3917. confirmButtonText: '确定',
  3918. cancelButtonText: '取消',
  3919. type: 'warning'
  3920. }).then(() => {
  3921. const deleteTasks = selectedRows.map(item => {
  3922. return api.deleteRohs({
  3923. site: item.site,
  3924. referenceNo: item.referenceNo
  3925. }).then(({data}) => {
  3926. if (data && data.code === 0) {
  3927. return {
  3928. success: true,
  3929. referenceNo: item.referenceNo
  3930. }
  3931. }
  3932. return {
  3933. success: false,
  3934. referenceNo: item.referenceNo,
  3935. msg: (data && data.msg) || '删除失败'
  3936. }
  3937. }).catch(() => {
  3938. return {
  3939. success: false,
  3940. referenceNo: item.referenceNo,
  3941. msg: '删除失败'
  3942. }
  3943. })
  3944. })
  3945. Promise.all(deleteTasks).then(results => {
  3946. const successRows = results.filter(item => item.success)
  3947. const failRows = results.filter(item => !item.success)
  3948. if (this.modalFlag && successRows.some(item => item.referenceNo === this.modalData.referenceNo)) {
  3949. this.modalFlag = false
  3950. }
  3951. if (!failRows.length) {
  3952. this.$message.success('删除成功,共' + successRows.length + '条')
  3953. } else if (!successRows.length) {
  3954. this.$message.error(failRows[0].msg || '删除失败')
  3955. } else {
  3956. this.$message.warning('已删除' + successRows.length + '条,失败' + failRows.length + '条')
  3957. }
  3958. this.getDataList()
  3959. })
  3960. }).catch(() => {})
  3961. },
  3962. buildRohsCreatePartData () {
  3963. const user = this.$store.state.user || {}
  3964. return {
  3965. site: this.modalData.site || user.site || '',
  3966. partNo: '',
  3967. partDesc: this.modalData.materialDesc || '',
  3968. partType: 'Purchased',
  3969. hazardCode: '',
  3970. hazardDesc: '',
  3971. familyId: '',
  3972. familyName: '',
  3973. groupId: '',
  3974. groupName: '',
  3975. umId: '',
  3976. umName: '',
  3977. weightNet: '',
  3978. uomForWeightNet: 'kg',
  3979. volumeNet: '',
  3980. uomForVolumeNet: 'm3',
  3981. lotTrackingCode: 'Order Based',
  3982. remark: '',
  3983. productGroupId1: this.modalData.commGroup1 || '',
  3984. productGroupName1: this.modalData.commGroup1Desc || '',
  3985. productGroupId2: this.modalData.commGroup2 || '',
  3986. productGroupName2: this.modalData.commGroup2Desc || '',
  3987. productGroupId3: '',
  3988. productGroupName3: '',
  3989. productGroupId4: '*',
  3990. productGroupName4: 'NorthSky Application owner',
  3991. commGroup3: this.modalData.commGroup3 || '',
  3992. commGroup3Desc: this.modalData.commGroup3Desc || '',
  3993. codeNo: '',
  3994. codeDesc: '',
  3995. typeDesignation: '',
  3996. assetClass: 'S',
  3997. assetClassDesc: '标准',
  3998. dimQuality: '',
  3999. abcClass: 'C',
  4000. abcClassDesc: '',
  4001. frequencyClass: 'Very Slow Mover',
  4002. lifecycleStage: 'Development',
  4003. countryOfOrigin: '',
  4004. countryOfOriginDesc: '',
  4005. regionOfOrigin: '',
  4006. regionOfOriginDesc: '',
  4007. manufacturingLeadTime: 0,
  4008. expectedLeadTime: 0,
  4009. durabilityWeek: '',
  4010. durabilityDay: '',
  4011. intrastatConvFactor: undefined,
  4012. customsStatNo: '',
  4013. customsStatDesc: '',
  4014. umDesc: '',
  4015. planningMethod: 'A',
  4016. planningMethodDesc: '',
  4017. partStatus: 'A',
  4018. partStatusDesc: '活动',
  4019. active: 'Y',
  4020. status: 'Y',
  4021. supplyCode: 'Inventory Order',
  4022. configurationId: '*',
  4023. partCostGroupId: '',
  4024. partCostGroupDesc: '',
  4025. inventoryValuationMethod: 'Standard Cost',
  4026. inventoryPartCostLevel: 'Cost Per Part',
  4027. invoiceConsideration: 'Ignore Invoice Price',
  4028. zeroCostFlag: 'Zero Cost Forbidden',
  4029. estimatedMaterialCost: 0,
  4030. safetyStock: 0,
  4031. minOrderQty: 0,
  4032. maxOrderQty: 0,
  4033. mulOrderQty: 0,
  4034. safetyLeadTime: 0,
  4035. shrinkageFac: 0,
  4036. stdOrderQty: 0,
  4037. cumLeadTime: 0,
  4038. byProdAsSupplyInMrpDb: '',
  4039. unprotectedLeadTime: 0,
  4040. backFlushPart: 'All Locations',
  4041. issueType: 'Reserve And Backflush',
  4042. mrpControlFlagDb: 'Y',
  4043. fixedLeadTimeDay: 0,
  4044. overReporting: 'Allowed',
  4045. useTheoreticalDensityDb: '',
  4046. variableLeadTimeDay: 0,
  4047. overReportTolerance: 0,
  4048. fixedLeadTimeHour: 0,
  4049. density: undefined,
  4050. variableLeadTimeHour: 0,
  4051. showInQueryFlag: 'Y',
  4052. temporaryPartFlag: 'N',
  4053. partItemList: [],
  4054. createBy: user.name || '',
  4055. updateBy: user.name || ''
  4056. }
  4057. },
  4058. openCreateIfsPartDialog () {
  4059. if (!this.isEditMode || !this.canEditRohsMaterial()) {
  4060. this.$message.warning('当前状态不允许创建IFS料号')
  4061. return
  4062. }
  4063. this.rohsCreatePartData = this.buildRohsCreatePartData()
  4064. this.rohsCreatePartTab = 'General'
  4065. this.rohsCreatePartTagNo = 0
  4066. this.rohsCharacteristicDialogFlag = false
  4067. this.rohsCharacteristicQueryData = {
  4068. propertiesItemNo: '',
  4069. itemDesc: ''
  4070. }
  4071. this.rohsCharacteristicList = []
  4072. this.rohsCharacteristicSelections = []
  4073. this.rohsPartItemSelections = []
  4074. this.rohsCreatePartDialogFlag = true
  4075. },
  4076. closeRohsCreatePartDialog () {
  4077. this.rohsCreatePartTab = 'General'
  4078. this.rohsCreatePartTagNo = 0
  4079. this.rohsCreatePartLoading = false
  4080. this.rohsCharacteristicDialogFlag = false
  4081. this.rohsCharacteristicQueryData = {
  4082. propertiesItemNo: '',
  4083. itemDesc: ''
  4084. }
  4085. this.rohsCharacteristicList = []
  4086. this.rohsCharacteristicSelections = []
  4087. this.rohsPartItemSelections = []
  4088. this.rohsCreatePartData = this.buildRohsCreatePartData()
  4089. },
  4090. rohsChangeExpectedLeadTime () {
  4091. this.rohsCreatePartData.expectedLeadTime = this.rohsCreatePartData.manufacturingLeadTime
  4092. },
  4093. rohsChangeDurabilityWeek () {
  4094. const day = Number(this.rohsCreatePartData.durabilityDay || 0)
  4095. this.rohsCreatePartData.durabilityWeek = day / 7
  4096. },
  4097. nextRohsCreatePartNo (silent = false) {
  4098. this.rohsCreatePartData.ifsPartNo = this.rohsCreatePartData.partNo
  4099. const params = {
  4100. ...this.rohsCreatePartData,
  4101. ifsPartNo: this.rohsCreatePartData.ifsPartNo,
  4102. site: this.rohsCreatePartData.site || this.$store.state.user.site,
  4103. createBy: this.$store.state.user.name || '',
  4104. updateBy: this.$store.state.user.name || ''
  4105. }
  4106. getPartNextPartNo(params).then(({data}) => {
  4107. if (data && data.code === 0) {
  4108. this.$set(this.rohsCreatePartData, 'partNo', data.rows || '')
  4109. this.$set(this.rohsCreatePartData, 'ifsPartNo', data.rows || '')
  4110. } else if (!silent) {
  4111. this.$message.error((data && data.msg) || '获取料号失败')
  4112. }
  4113. }).catch(() => {
  4114. if (!silent) {
  4115. this.$message.error('获取料号失败')
  4116. }
  4117. })
  4118. },
  4119. openRohsCreatePartBaseList (tagNo) {
  4120. if (!this.rohsCreatePartDialogFlag) {
  4121. return
  4122. }
  4123. this.rohsCreatePartTagNo = tagNo
  4124. this.$nextTick(() => {
  4125. let strVal = ''
  4126. if (tagNo === 1007) {
  4127. strVal = this.rohsCreatePartData.umId
  4128. } else if (tagNo === 108) {
  4129. strVal = this.rohsCreatePartData.familyId
  4130. } else if (tagNo === 109) {
  4131. strVal = this.rohsCreatePartData.groupId
  4132. } else if (tagNo === 112) {
  4133. strVal = this.rohsCreatePartData.productGroupId3
  4134. } else if (tagNo === 113) {
  4135. strVal = this.rohsCreatePartData.productGroupId4
  4136. } else if (tagNo === 123) {
  4137. strVal = this.rohsCreatePartData.hazardCode
  4138. } else if (tagNo === 124) {
  4139. strVal = this.rohsCreatePartData.assetClass
  4140. } else if (tagNo === 125) {
  4141. strVal = this.rohsCreatePartData.partStatus
  4142. } else if (tagNo === 126) {
  4143. strVal = this.rohsCreatePartData.abcClass
  4144. } else if (tagNo === 127) {
  4145. strVal = this.rohsCreatePartData.countryOfOrigin
  4146. } else if (tagNo === 128) {
  4147. strVal = this.rohsCreatePartData.regionOfOrigin
  4148. } else if (tagNo === 129) {
  4149. strVal = this.rohsCreatePartData.customsStatNo
  4150. } else if (tagNo === 131) {
  4151. strVal = this.rohsCreatePartData.partCostGroupId
  4152. } else if (tagNo === 20) {
  4153. strVal = this.rohsCreatePartData.codeNo
  4154. } else if (tagNo === 132) {
  4155. strVal = this.rohsCreatePartData.planningMethod
  4156. }
  4157. this.$refs.baseList.init(tagNo, strVal)
  4158. })
  4159. },
  4160. applyRohsCreatePartBaseData (val) {
  4161. if (this.rohsCreatePartTagNo === 1007) {
  4162. this.rohsCreatePartData.umId = val.um_id
  4163. this.rohsCreatePartData.umName = val.um_name
  4164. } else if (this.rohsCreatePartTagNo === 108) {
  4165. this.rohsCreatePartData.familyId = val.family_id
  4166. this.rohsCreatePartData.familyName = val.family_name
  4167. } else if (this.rohsCreatePartTagNo === 109) {
  4168. this.rohsCreatePartData.groupId = val.group_id
  4169. this.rohsCreatePartData.groupName = val.group_name
  4170. } else if (this.rohsCreatePartTagNo === 112) {
  4171. this.rohsCreatePartData.productGroupId3 = val.product_group_id
  4172. this.rohsCreatePartData.productGroupName3 = val.product_group_name
  4173. } else if (this.rohsCreatePartTagNo === 113) {
  4174. this.rohsCreatePartData.productGroupId4 = val.product_group_id
  4175. this.rohsCreatePartData.productGroupName4 = val.product_group_name
  4176. } else if (this.rohsCreatePartTagNo === 123) {
  4177. this.rohsCreatePartData.hazardCode = val.hazard_code
  4178. this.rohsCreatePartData.hazardDesc = val.hazard_desc
  4179. } else if (this.rohsCreatePartTagNo === 124) {
  4180. this.rohsCreatePartData.assetClass = val.asset_class
  4181. this.rohsCreatePartData.assetClassDesc = val.asset_class_desc
  4182. } else if (this.rohsCreatePartTagNo === 125) {
  4183. this.rohsCreatePartData.partStatus = val.part_status
  4184. this.rohsCreatePartData.partStatusDesc = val.part_status_desc
  4185. } else if (this.rohsCreatePartTagNo === 126) {
  4186. this.rohsCreatePartData.abcClass = val.abc_class
  4187. this.rohsCreatePartData.abcClassDesc = val.abc_class_desc
  4188. } else if (this.rohsCreatePartTagNo === 127) {
  4189. this.rohsCreatePartData.countryOfOrigin = val.country_of_origin
  4190. this.rohsCreatePartData.countryOfOriginDesc = val.country_of_origin_desc
  4191. } else if (this.rohsCreatePartTagNo === 128) {
  4192. this.rohsCreatePartData.regionOfOrigin = val.region_of_origin
  4193. this.rohsCreatePartData.regionOfOriginDesc = val.region_of_origin_desc
  4194. } else if (this.rohsCreatePartTagNo === 129) {
  4195. this.rohsCreatePartData.customsStatNo = val.customs_stat_no
  4196. this.rohsCreatePartData.customsStatDesc = val.customs_stat_desc
  4197. } else if (this.rohsCreatePartTagNo === 131) {
  4198. this.rohsCreatePartData.partCostGroupId = val.part_cost_group_id
  4199. this.rohsCreatePartData.partCostGroupDesc = val.part_cost_group_desc
  4200. } else if (this.rohsCreatePartTagNo === 20) {
  4201. this.rohsCreatePartData.codeNo = val.Code_no
  4202. this.rohsCreatePartData.codeDesc = val.Code_desc
  4203. this.loadRohsPartItemListByCodeNo()
  4204. } else if (this.rohsCreatePartTagNo === 132) {
  4205. this.rohsCreatePartData.planningMethod = val.planning_method
  4206. this.rohsCreatePartData.planningMethodDesc = val.planning_method_desc
  4207. }
  4208. this.rohsCreatePartTagNo = 0
  4209. },
  4210. rohsCreateBaseFieldBlur (tagNo, codeKey, descKey, queryField, resultCodeField, resultDescField, withSite = true) {
  4211. this.rohsCreatePartData[codeKey] = (this.rohsCreatePartData[codeKey] || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4212. if (!this.rohsCreatePartData[codeKey]) {
  4213. this.rohsCreatePartData[descKey] = ''
  4214. return
  4215. }
  4216. const site = this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site
  4217. let conditionSql = " and " + queryField + " = '" + this.rohsCreatePartData[codeKey] + "'"
  4218. if (withSite) {
  4219. conditionSql += " and site = '" + site + "'"
  4220. }
  4221. const tempData = {
  4222. tagno: tagNo,
  4223. conditionSql: conditionSql
  4224. }
  4225. verifyData(tempData).then(({data}) => {
  4226. if (data && data.code === 0 && data.baseListData.length > 0) {
  4227. this.rohsCreatePartData[codeKey] = data.baseListData[0][resultCodeField]
  4228. this.rohsCreatePartData[descKey] = data.baseListData[0][resultDescField]
  4229. } else {
  4230. this.rohsCreatePartData[descKey] = ''
  4231. }
  4232. }).catch(() => {
  4233. this.rohsCreatePartData[descKey] = ''
  4234. })
  4235. },
  4236. rohsCreateHazardCodeBlur (tagNo) {
  4237. this.rohsCreateBaseFieldBlur(tagNo, 'hazardCode', 'hazardDesc', 'hazard_code', 'hazard_code', 'hazard_desc')
  4238. },
  4239. rohsCreateProductGroupId4Blur (tagNo) {
  4240. this.rohsCreateBaseFieldBlur(tagNo, 'productGroupId4', 'productGroupName4', 'product_group_id', 'product_group_id', 'product_group_name')
  4241. },
  4242. rohsCreateProductGroupId3Blur (tagNo) {
  4243. this.rohsCreateBaseFieldBlur(tagNo, 'productGroupId3', 'productGroupName3', 'product_group_id', 'product_group_id', 'product_group_name')
  4244. },
  4245. rohsCreateUmIdBlur (tagNo) {
  4246. this.rohsCreateBaseFieldBlur(tagNo, 'umId', 'umName', 'um_id', 'um_id', 'um_name', false)
  4247. },
  4248. rohsCreateGroupIdBlur (tagNo) {
  4249. this.rohsCreateBaseFieldBlur(tagNo, 'groupId', 'groupName', 'group_id', 'group_id', 'group_name')
  4250. },
  4251. rohsCreateFamilyIdBlur (tagNo) {
  4252. this.rohsCreateBaseFieldBlur(tagNo, 'familyId', 'familyName', 'family_id', 'family_id', 'family_name')
  4253. },
  4254. rohsCreateAssetClassBlur (tagNo) {
  4255. this.rohsCreateBaseFieldBlur(tagNo, 'assetClass', 'assetClassDesc', 'asset_class', 'asset_class', 'asset_class_desc')
  4256. },
  4257. rohsCreatePartStatusBlur (tagNo) {
  4258. this.rohsCreateBaseFieldBlur(tagNo, 'partStatus', 'partStatusDesc', 'part_status', 'part_status', 'part_status_desc')
  4259. },
  4260. rohsCreateAbcClassBlur (tagNo) {
  4261. this.rohsCreateBaseFieldBlur(tagNo, 'abcClass', 'abcClassDesc', 'abc_class', 'abc_class', 'abc_class_desc')
  4262. },
  4263. rohsCreateCountryOfOriginBlur (tagNo) {
  4264. this.rohsCreateBaseFieldBlur(tagNo, 'countryOfOrigin', 'countryOfOriginDesc', 'country_of_origin', 'country_of_origin', 'country_of_origin_desc')
  4265. },
  4266. rohsCreateRegionOfOriginBlur (tagNo) {
  4267. this.rohsCreateBaseFieldBlur(tagNo, 'regionOfOrigin', 'regionOfOriginDesc', 'region_of_origin', 'region_of_origin', 'region_of_origin_desc')
  4268. },
  4269. rohsCreateCustomsStatNoBlur (tagNo) {
  4270. this.rohsCreateBaseFieldBlur(tagNo, 'customsStatNo', 'customsStatDesc', 'customs_stat_no', 'customs_stat_no', 'customs_stat_desc')
  4271. },
  4272. rohsCreatePartCostGroupIdBlur (tagNo) {
  4273. this.rohsCreateBaseFieldBlur(tagNo, 'partCostGroupId', 'partCostGroupDesc', 'part_cost_group_id', 'part_cost_group_id', 'part_cost_group_desc')
  4274. },
  4275. rohsCreatePlanningMethodBlur (tagNo) {
  4276. this.rohsCreateBaseFieldBlur(tagNo, 'planningMethod', 'planningMethodDesc', 'planning_method', 'planning_method', 'planning_method_desc')
  4277. },
  4278. rohsCreateCodeNoBlur (tagNo) {
  4279. this.rohsCreatePartData.codeNo = (this.rohsCreatePartData.codeNo || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4280. if (!this.rohsCreatePartData.codeNo) {
  4281. this.rohsCreatePartData.codeDesc = ''
  4282. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4283. this.rohsPartItemSelections = []
  4284. return
  4285. }
  4286. const site = this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site
  4287. const tempData = {
  4288. tagno: tagNo,
  4289. conditionSql: " and Code_no = '" + this.rohsCreatePartData.codeNo + "'" + " and site = '" + site + "'"
  4290. }
  4291. verifyData(tempData).then(({data}) => {
  4292. if (data && data.code === 0 && data.baseListData.length > 0) {
  4293. this.rohsCreatePartData.codeNo = data.baseListData[0].Code_no
  4294. this.rohsCreatePartData.codeDesc = data.baseListData[0].Code_desc
  4295. this.loadRohsPartItemListByCodeNo()
  4296. } else {
  4297. this.rohsCreatePartData.codeDesc = ''
  4298. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4299. this.rohsPartItemSelections = []
  4300. }
  4301. }).catch(() => {
  4302. this.rohsCreatePartData.codeDesc = ''
  4303. })
  4304. },
  4305. loadRohsPartItemListByCodeNo () {
  4306. if (!this.rohsCreatePartData.codeNo) {
  4307. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4308. this.rohsPartItemSelections = []
  4309. return
  4310. }
  4311. const params = {
  4312. site: this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site,
  4313. codeNo: this.rohsCreatePartData.codeNo,
  4314. recordType: 'IP'
  4315. }
  4316. getPartItemListByCodeNo(params).then(({data}) => {
  4317. if (data && data.code === 0) {
  4318. this.$set(this.rohsCreatePartData, 'partItemList', (data.rows || []).map(item => ({
  4319. ...item,
  4320. numValue: item.numValue === null ? undefined : item.numValue
  4321. })))
  4322. } else {
  4323. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4324. }
  4325. this.rohsPartItemSelections = []
  4326. }).catch(() => {
  4327. this.$set(this.rohsCreatePartData, 'partItemList', [])
  4328. this.rohsPartItemSelections = []
  4329. })
  4330. },
  4331. rohsPartItemSelectionChange (selection) {
  4332. this.rohsPartItemSelections = selection || []
  4333. },
  4334. openRohsCharacteristicDialog () {
  4335. this.rohsCharacteristicSelections = []
  4336. this.rohsCharacteristicQueryData = {
  4337. propertiesItemNo: '',
  4338. itemDesc: ''
  4339. }
  4340. this.queryRohsCharacteristicOptions()
  4341. this.rohsCharacteristicDialogFlag = true
  4342. },
  4343. removeRohsPartItemRows () {
  4344. if (!this.rohsPartItemSelections || this.rohsPartItemSelections.length === 0) {
  4345. this.$message.warning('请选择要删除的属性!')
  4346. return
  4347. }
  4348. this.$confirm('请是否确认删除该属性记录?', '提示', {
  4349. confirmButtonText: '确定',
  4350. cancelButtonText: '取消',
  4351. type: 'warning'
  4352. }).then(() => {
  4353. const removeSet = new Set(this.rohsPartItemSelections.map(item => item.propertiesItemNo))
  4354. this.$set(this.rohsCreatePartData, 'partItemList', (this.rohsCreatePartData.partItemList || []).filter(item => !removeSet.has(item.propertiesItemNo)))
  4355. this.rohsPartItemSelections = []
  4356. }).catch(() => {})
  4357. },
  4358. queryRohsCharacteristicOptions () {
  4359. const itemNos = (this.rohsCreatePartData.partItemList || []).map(item => item.propertiesItemNo).filter(item => item).join(',')
  4360. const params = {
  4361. site: this.rohsCreatePartData.site || this.modalData.site || this.$store.state.user.site,
  4362. recordType: 'IP',
  4363. propertiesItemNo: this.rohsCharacteristicQueryData.propertiesItemNo,
  4364. itemDesc: this.rohsCharacteristicQueryData.itemDesc,
  4365. itemNos: itemNos
  4366. }
  4367. getPartItemExclusionAlreadyExists(params).then(({data}) => {
  4368. if (data && data.code === 0) {
  4369. this.rohsCharacteristicList = data.rows || []
  4370. } else {
  4371. this.rohsCharacteristicList = []
  4372. }
  4373. }).catch(() => {
  4374. this.rohsCharacteristicList = []
  4375. })
  4376. },
  4377. rohsCharacteristicRowClick (row) {
  4378. if (this.$refs.rohsCharacteristicTable) {
  4379. this.$refs.rohsCharacteristicTable.toggleRowSelection(row)
  4380. }
  4381. },
  4382. rohsCharacteristicSelectionChange (selection) {
  4383. this.rohsCharacteristicSelections = selection || []
  4384. },
  4385. saveRohsCharacteristics () {
  4386. if (!this.rohsCharacteristicSelections || this.rohsCharacteristicSelections.length === 0) {
  4387. this.$message.warning('请选择属性!')
  4388. return
  4389. }
  4390. const currentList = Array.isArray(this.rohsCreatePartData.partItemList) ? this.rohsCreatePartData.partItemList : []
  4391. const existSet = new Set(currentList.map(item => item.propertiesItemNo))
  4392. const appendList = this.rohsCharacteristicSelections.filter(item => item && item.propertiesItemNo && !existSet.has(item.propertiesItemNo)).map(item => ({
  4393. ...item,
  4394. numValue: item.numValue === null ? undefined : item.numValue
  4395. }))
  4396. if (appendList.length === 0) {
  4397. this.$message.warning('所选属性已存在')
  4398. return
  4399. }
  4400. this.$set(this.rohsCreatePartData, 'partItemList', [...currentList, ...appendList])
  4401. this.rohsCharacteristicDialogFlag = false
  4402. this.rohsCharacteristicSelections = []
  4403. },
  4404. validateRohsCreatePart () {
  4405. this.rohsCreatePartData.partNo = (this.rohsCreatePartData.partNo || '').replace(/[\s\u00A0\u3000\u200B]/g, '')
  4406. if (!this.rohsCreatePartData.partNo) {
  4407. this.$message.warning('请填写物料编码')
  4408. return false
  4409. }
  4410. if (!/^[A-Za-z0-9._-]+$/.test(this.rohsCreatePartData.partNo)) {
  4411. this.$message.warning('物料编码只能包含字母、数字、-、_、.')
  4412. return false
  4413. }
  4414. if (!this.rohsCreatePartData.partDesc || !String(this.rohsCreatePartData.partDesc).trim()) {
  4415. this.$message.warning('请填写物料名称')
  4416. return false
  4417. }
  4418. if (!this.rohsCreatePartData.partType) {
  4419. this.$message.warning('请选择零件类型')
  4420. return false
  4421. }
  4422. if (!this.rohsCreatePartData.umId) {
  4423. this.$message.warning('请选择计量单位')
  4424. return false
  4425. }
  4426. if (!this.rohsCreatePartData.productGroupId1 || !this.rohsCreatePartData.productGroupId2) {
  4427. this.$message.warning('请先在RoHS单据中维护商品组1/2')
  4428. return false
  4429. }
  4430. if (!this.rohsCreatePartData.productGroupId3) {
  4431. this.$message.warning('请选择会计组')
  4432. return false
  4433. }
  4434. if (!this.rohsCreatePartData.productGroupId4) {
  4435. this.$message.warning('请选择计划人')
  4436. return false
  4437. }
  4438. return true
  4439. },
  4440. appendCreatedPartToRohsMaterial (createdPart) {
  4441. const appendResult = this.appendMaterialRows([{
  4442. site: this.modalData.site,
  4443. referenceNo: this.modalData.referenceNo,
  4444. projectId: this.modalData.projectId,
  4445. testPartNo: createdPart.partNo,
  4446. finalPartNo: createdPart.partNo,
  4447. partDesc: createdPart.partDesc,
  4448. partStatus: createdPart.partStatus || 'A'
  4449. }])
  4450. if (!appendResult.appendedCount) {
  4451. this.$message.warning('IFS料号创建成功,但该料号已存在于材料列表')
  4452. return Promise.resolve()
  4453. }
  4454. if (!this.shouldPersistMaterialsImmediately()) {
  4455. this.$set(this.modalData, 'materialList', appendResult.materialList)
  4456. this.$message.success('IFS料号创建成功,已加入材料列表')
  4457. return Promise.resolve()
  4458. }
  4459. return this.persistMaterialList(appendResult.materialList, 'IFS料号创建成功并已关联到RoHS材料')
  4460. },
  4461. saveRohsCreatePart () {
  4462. if (!this.validateRohsCreatePart()) {
  4463. return
  4464. }
  4465. const payload = {
  4466. ...this.rohsCreatePartData,
  4467. site: this.modalData.site || this.$store.state.user.site,
  4468. buNo: this.modalData.process || '',
  4469. createBy: this.$store.state.user.name || '',
  4470. updateBy: this.$store.state.user.name || '',
  4471. partDesc: (this.rohsCreatePartData.partDesc || '').trim(),
  4472. productGroupId1: this.modalData.commGroup1 || this.rohsCreatePartData.productGroupId1,
  4473. productGroupName1: this.modalData.commGroup1Desc || this.rohsCreatePartData.productGroupName1,
  4474. productGroupId2: this.modalData.commGroup2 || this.rohsCreatePartData.productGroupId2,
  4475. productGroupName2: this.modalData.commGroup2Desc || this.rohsCreatePartData.productGroupName2,
  4476. productGroupId3: this.rohsCreatePartData.productGroupId3,
  4477. productGroupName3: this.rohsCreatePartData.productGroupName3,
  4478. commGroup3: this.modalData.commGroup3 || this.rohsCreatePartData.commGroup3,
  4479. commGroup3Desc: this.modalData.commGroup3Desc || this.rohsCreatePartData.commGroup3Desc,
  4480. status: 'Y',
  4481. showInQueryFlag: 'Y',
  4482. temporaryPartFlag: 'N',
  4483. ifsPartNo: this.rohsCreatePartData.partNo,
  4484. plmPartNo: this.rohsCreatePartData.partNo,
  4485. partItemList: Array.isArray(this.rohsCreatePartData.partItemList) ? this.rohsCreatePartData.partItemList : []
  4486. }
  4487. this.rohsCreatePartLoading = true
  4488. createOfficialPartForRohs(payload).then(({data}) => {
  4489. if (data && data.code === 0) {
  4490. this.appendCreatedPartToRohsMaterial(payload).then(() => {
  4491. this.rohsCreatePartDialogFlag = false
  4492. })
  4493. } else {
  4494. this.$message.error((data && data.msg) || '创建IFS料号失败')
  4495. }
  4496. }).catch(() => {
  4497. this.$message.error('创建IFS料号失败')
  4498. }).finally(() => {
  4499. this.rohsCreatePartLoading = false
  4500. })
  4501. },
  4502. openProjectMaterialDialog () {
  4503. if (!this.canEditRohsMaterial()) {
  4504. this.$message.warning('当前状态不允许编辑材料')
  4505. return
  4506. }
  4507. this.projectMaterialDialogFlag = true
  4508. this.projectMaterialPageIndex = 1
  4509. this.searchProjectMaterialList()
  4510. },
  4511. searchProjectMaterialList () {
  4512. this.projectMaterialLoading = true
  4513. const params = {
  4514. page: this.projectMaterialPageIndex,
  4515. limit: this.projectMaterialPageSize,
  4516. site: this.$store.state.user.site,
  4517. partDesc: this.projectMaterialSearchData.partDesc,
  4518. finalPartNo: this.projectMaterialSearchData.finalPartNo,
  4519. partStatus: this.projectMaterialSearchData.partStatus
  4520. }
  4521. api.getRohsProjectMaterialList(params).then(({data}) => {
  4522. if (data && data.code === 0 && data.page) {
  4523. this.projectMaterialList = data.page.list || []
  4524. this.projectMaterialTotal = data.page.totalCount || 0
  4525. this.$nextTick(() => {
  4526. if (this.$refs.projectMaterialTable) {
  4527. this.$refs.projectMaterialTable.clearSelection()
  4528. }
  4529. })
  4530. } else {
  4531. this.projectMaterialList = []
  4532. this.projectMaterialTotal = 0
  4533. this.$message.error(data.msg || '物料查询失败')
  4534. }
  4535. this.projectMaterialLoading = false
  4536. }).catch(() => {
  4537. this.projectMaterialList = []
  4538. this.projectMaterialTotal = 0
  4539. this.projectMaterialLoading = false
  4540. })
  4541. },
  4542. projectMaterialSelectionChange (rows) {
  4543. this.projectMaterialSelections = rows || []
  4544. },
  4545. projectMaterialSizeChangeHandle (val) {
  4546. this.projectMaterialPageSize = val
  4547. this.projectMaterialPageIndex = 1
  4548. this.searchProjectMaterialList()
  4549. },
  4550. projectMaterialCurrentChangeHandle (val) {
  4551. this.projectMaterialPageIndex = val
  4552. this.searchProjectMaterialList()
  4553. },
  4554. confirmProjectMaterialSelection () {
  4555. if (!this.canEditRohsMaterial()) {
  4556. this.$message.warning('当前状态不允许编辑材料')
  4557. return
  4558. }
  4559. if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) {
  4560. this.$message.warning('请至少选择一条物料')
  4561. return
  4562. }
  4563. const appendResult = this.appendMaterialRows(this.projectMaterialSelections)
  4564. if (!appendResult.appendedCount) {
  4565. this.$message.warning('所选物料已存在,未新增数据')
  4566. return
  4567. }
  4568. if (!this.shouldPersistMaterialsImmediately()) {
  4569. this.$set(this.modalData, 'materialList', appendResult.materialList)
  4570. this.projectMaterialDialogFlag = false
  4571. this.$message.success('已加入材料列表,保存单据后写入数据库')
  4572. return
  4573. }
  4574. this.$confirm('确认新增选中材料?', '提示', {
  4575. confirmButtonText: '确定',
  4576. cancelButtonText: '取消',
  4577. type: 'warning'
  4578. }).then(() => {
  4579. this.persistMaterialList(appendResult.materialList, '新增材料成功', () => {
  4580. this.projectMaterialDialogFlag = false
  4581. this.projectMaterialSelections = []
  4582. if (this.$refs.projectMaterialTable) {
  4583. this.$refs.projectMaterialTable.clearSelection()
  4584. }
  4585. })
  4586. }).catch(() => {})
  4587. },
  4588. appendMaterialRows (rows) {
  4589. const materialList = Array.isArray(this.modalData.materialList) ? [...this.modalData.materialList] : []
  4590. const exists = new Set(materialList.map(item => item.testPartNo))
  4591. let appendedCount = 0
  4592. rows.forEach(row => {
  4593. const testPartNo = row.testPartNo || row.test_part_no
  4594. if (!testPartNo || exists.has(testPartNo)) {
  4595. return
  4596. }
  4597. exists.add(testPartNo)
  4598. appendedCount++
  4599. materialList.push({
  4600. site: this.modalData.site,
  4601. referenceNo: this.modalData.referenceNo,
  4602. projectId: this.modalData.projectId,
  4603. testPartNo: testPartNo,
  4604. finalPartNo: row.finalPartNo || row.final_part_no || '',
  4605. partDesc: row.partDesc || row.part_desc || '',
  4606. partStatus: row.partStatus || row.part_status || ''
  4607. })
  4608. })
  4609. return {
  4610. materialList,
  4611. appendedCount
  4612. }
  4613. },
  4614. materialSelectionChange (rows) {
  4615. this.materialSelections = rows || []
  4616. },
  4617. shouldPersistMaterialsImmediately () {
  4618. return this.modalTitle === 'RoHS 编辑' && this.modalData && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-')
  4619. },
  4620. normalizeMaterialListForSave (materialList) {
  4621. return (materialList || []).map((item, index) => {
  4622. return {
  4623. site: item.site || this.modalData.site || '',
  4624. referenceNo: item.referenceNo || this.modalData.referenceNo || '',
  4625. projectId: item.projectId || this.modalData.projectId || '',
  4626. testPartNo: item.testPartNo || item.test_part_no || '',
  4627. finalPartNo: item.finalPartNo || item.final_part_no || '',
  4628. partDesc: item.partDesc || item.part_desc || '',
  4629. partStatus: item.partStatus || item.part_status || '',
  4630. lineNo: index + 1
  4631. }
  4632. }).filter(item => item.testPartNo)
  4633. },
  4634. persistMaterialList (materialList, successMsg, successCallback) {
  4635. const normalizedList = this.normalizeMaterialListForSave(materialList)
  4636. const payload = {
  4637. site: this.modalData.site,
  4638. referenceNo: this.modalData.referenceNo,
  4639. projectId: this.modalData.projectId,
  4640. materialList: normalizedList
  4641. }
  4642. return api.updateRohsMaterials(payload).then(({data}) => {
  4643. if (data && data.code === 0) {
  4644. this.$set(this.modalData, 'materialList', normalizedList)
  4645. this.materialSelections = []
  4646. if (this.currentRow && this.currentRow.referenceNo === this.modalData.referenceNo) {
  4647. this.$set(this.currentRow, 'materialList', normalizedList)
  4648. }
  4649. this.$message.success(successMsg || '保存成功')
  4650. if (typeof successCallback === 'function') {
  4651. successCallback()
  4652. }
  4653. } else {
  4654. this.$message.error((data && data.msg) || '保存失败')
  4655. }
  4656. }).catch(() => {
  4657. this.$message.error('保存失败')
  4658. })
  4659. },
  4660. removeSelectedMaterialRows () {
  4661. if (!this.canEditRohsMaterial()) {
  4662. this.$message.warning('当前状态不允许编辑材料')
  4663. return
  4664. }
  4665. if (!this.materialSelections || this.materialSelections.length === 0) {
  4666. this.$message.warning('请先选择要删除的材料')
  4667. return
  4668. }
  4669. const removeSet = new Set(this.materialSelections.map(item => item.testPartNo))
  4670. const materialList = (this.modalData.materialList || []).filter(item => !removeSet.has(item.testPartNo))
  4671. if (!this.shouldPersistMaterialsImmediately()) {
  4672. this.$set(this.modalData, 'materialList', materialList)
  4673. this.materialSelections = []
  4674. this.$message.success('已删除材料,保存单据后写入数据库')
  4675. return
  4676. }
  4677. this.$confirm('确认删除选中材料?', '提示', {
  4678. confirmButtonText: '确定',
  4679. cancelButtonText: '取消',
  4680. type: 'warning'
  4681. }).then(() => {
  4682. this.persistMaterialList(materialList, '删除材料成功')
  4683. }).catch(() => {})
  4684. },
  4685. // ======== chooseList相关方法 ========
  4686. // 获取基础数据列表
  4687. getBaseList (val, type) {
  4688. this.tagNo = val
  4689. this.tagNo1 = type
  4690. this.$nextTick(() => {
  4691. let strVal = ''
  4692. let conSql = ''
  4693. if (val === 102) {
  4694. if (type === 1) {
  4695. strVal = this.modalData.endCustomer
  4696. conSql = " order by Customer_no "
  4697. }
  4698. }
  4699. if (val === 103 || val === 2001 || val === 2054) {
  4700. if (type === 1) {
  4701. strVal = this.modalData.applicant
  4702. } else if (type === 3) {
  4703. strVal = this.modalData.npdEngineer
  4704. } else if (type === 4) {
  4705. strVal = this.modalData.technicalPlan
  4706. } else if (type === 5) {
  4707. strVal = this.modalData.pm
  4708. }
  4709. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  4710. }
  4711. if (val === 2000) {
  4712. strVal = this.modalData.buyer
  4713. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  4714. }
  4715. if (val === 110) {
  4716. strVal = this.modalData.commGroup1
  4717. }
  4718. if (val === 111) {
  4719. strVal = this.modalData.commGroup2
  4720. }
  4721. if (val === 130) {
  4722. strVal = this.modalData.commGroup3
  4723. }
  4724. this.$refs.baseList.init(val, strVal, conSql)
  4725. })
  4726. },
  4727. // 列表方法的回调
  4728. getBaseData (val) {
  4729. if (this.rohsCreatePartDialogFlag && this.rohsCreatePartTagNo) {
  4730. this.applyRohsCreatePartBaseData(val)
  4731. return
  4732. }
  4733. if (this.tagNo === 102) {
  4734. if (this.tagNo1 === 1) {
  4735. if (val.Customer_no === this.modalData.endCustomer) {
  4736. return
  4737. }
  4738. if (this.modalData.projectIdFlag) {
  4739. this.modalData.projectIdFlag = false
  4740. }
  4741. this.modalData.endCustomer = val.Customer_no
  4742. this.modalData.endCustomerName = val.Customer_desc
  4743. this.modalData.projectId = ''
  4744. this.modalData.projectName = ''
  4745. this.$set(this.modalData, 'materialList', [])
  4746. }
  4747. }
  4748. if (this.tagNo === 103 || this.tagNo === 2001 || this.tagNo === 2054) {
  4749. if (this.tagNo1 === 1) {
  4750. this.modalData.applicant = val.username
  4751. this.modalData.applicantName = val.user_display
  4752. } else if (this.tagNo1 === 3) {
  4753. this.modalData.npdEngineer = val.username
  4754. this.modalData.npdEngineerName = val.user_display
  4755. } else if (this.tagNo1 === 4) {
  4756. this.modalData.technicalPlan = val.username
  4757. this.modalData.technicalPlanName = val.user_display
  4758. } else if (this.tagNo1 === 5) {
  4759. this.modalData.pm = val.username
  4760. this.modalData.pmName = val.user_display
  4761. }
  4762. }
  4763. if (this.tagNo === 110) {
  4764. this.modalData.commGroup1 = val.product_group_id
  4765. this.modalData.commGroup1Desc = val.product_group_name
  4766. }
  4767. if (this.tagNo === 111) {
  4768. this.modalData.commGroup2 = val.product_group_id
  4769. this.modalData.commGroup2Desc = val.product_group_name
  4770. }
  4771. if (this.tagNo === 130) {
  4772. this.modalData.commGroup3 = val.product_group_id
  4773. this.modalData.commGroup3Desc = val.product_group_name
  4774. }
  4775. if (this.tagNo === 2000) {
  4776. this.modalData.buyer = val.username
  4777. this.modalData.buyerName = val.user_display
  4778. }
  4779. },
  4780. handleQueryCustomer() {
  4781. if (!this.modalData.endCustomer) {
  4782. this.modalData.endCustomerName = ''
  4783. this.modalData.projectId = ''
  4784. this.modalData.projectName = ''
  4785. this.modalData.projectIdFlag = true
  4786. this.$set(this.modalData, 'materialList', [])
  4787. return
  4788. }
  4789. let params = {
  4790. site: this.$store.state.user.site,
  4791. customerNo: this.modalData.endCustomer
  4792. }
  4793. queryCustomer(params).then(({data}) => {
  4794. if (data && data.code === 0) {
  4795. if (data.rows && data.rows.length === 1) {
  4796. const customer = data.rows[0]
  4797. this.modalData.endCustomerName = customer.customerDesc || customer.Customer_desc || customer.customerName || ''
  4798. this.modalData.projectIdFlag = !!this.modalData.endCustomerFlag
  4799. } else {
  4800. this.modalData.endCustomerName = ''
  4801. this.modalData.projectId = ''
  4802. this.modalData.projectName = ''
  4803. this.modalData.projectIdFlag = true
  4804. this.$set(this.modalData, 'materialList', [])
  4805. }
  4806. } else {
  4807. this.modalData.endCustomerName = ''
  4808. this.modalData.projectId = ''
  4809. this.modalData.projectName = ''
  4810. this.modalData.projectIdFlag = true
  4811. this.$set(this.modalData, 'materialList', [])
  4812. }
  4813. }).catch((error) => {
  4814. this.modalData.endCustomerName = ''
  4815. this.modalData.projectId = ''
  4816. this.modalData.projectName = ''
  4817. this.modalData.projectIdFlag = true
  4818. this.$set(this.modalData, 'materialList', [])
  4819. })
  4820. },
  4821. handleQueryProjectByCustomer() {
  4822. if (!this.modalData.projectId) {
  4823. this.modalData.projectName = ''
  4824. return
  4825. }
  4826. let params = {
  4827. site: this.$store.state.user.site,
  4828. projectId: this.modalData.projectId
  4829. }
  4830. if (this.modalData.endCustomer) {
  4831. params.customerId = this.modalData.endCustomer
  4832. }
  4833. queryProjectByCustomer(params).then(({data}) => {
  4834. if (data && data.code === 0) {
  4835. if (data.rows && data.rows.length === 1) {
  4836. const project = data.rows[0]
  4837. this.modalData.projectName = project.projectName || project.Project_name || ''
  4838. } else {
  4839. this.modalData.projectName = ''
  4840. }
  4841. } else {
  4842. this.modalData.projectName = ''
  4843. }
  4844. }).catch((error) => {
  4845. this.modalData.projectName = ''
  4846. })
  4847. },
  4848. projectClickRow(row) {
  4849. const oldProjectId = this.modalData.projectId
  4850. this.modalData.projectId = row.projectId
  4851. this.modalData.projectName = row.projectName
  4852. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  4853. // do nothing
  4854. } else {
  4855. this.modalData.endCustomer = row.customerId
  4856. this.modalData.endCustomerName = row.customerName
  4857. }
  4858. if (oldProjectId && oldProjectId !== row.projectId) {
  4859. this.$set(this.modalData, 'materialList', [])
  4860. }
  4861. this.chooseProjectListFlag = false
  4862. },
  4863. searchProjectInfoList() {
  4864. this.projectList = [];
  4865. if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
  4866. this.searchProjectData.customerId = this.modalData.endCustomer
  4867. } else {
  4868. this.searchProjectData.customerId = undefined
  4869. }
  4870. this.searchProjectData.site = this.$store.state.user.site
  4871. searchProjectInfoList(this.searchProjectData).then(({data}) => {
  4872. if (data && data.code === 0) {
  4873. const rows = data.rows || []
  4874. this.projectList = rows
  4875. if ((!this.modalData.endCustomer || this.modalData.endCustomer === '') && rows.length > 0) {
  4876. this.modalData.projectId = rows[0].projectId
  4877. this.modalData.projectName = rows[0].projectName
  4878. this.modalData.endCustomer = rows[0].customerId
  4879. this.modalData.endCustomerName = rows[0].customerName
  4880. }
  4881. } else {
  4882. this.projectList = []
  4883. }
  4884. }).catch((error) => {
  4885. this.$message.error('查询项目信息失败')
  4886. })
  4887. },
  4888. closeProjectInfoDialog() {
  4889. if(this.$refs.closeProjectInfoForm) {
  4890. this.$refs.closeProjectInfoForm.resetFields();
  4891. }
  4892. this.searchProjectData = {
  4893. site: this.$store.state.user.site,
  4894. projectId: undefined,
  4895. projectName: undefined,
  4896. customerId: undefined,
  4897. }
  4898. },
  4899. // 申请人输入校验
  4900. applicantBlur (tagNo) {
  4901. if (this.modalData.applicant != null && this.modalData.applicant !== '') {
  4902. let tempData = {
  4903. tagno: tagNo,
  4904. conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4905. }
  4906. verifyData(tempData).then(({data}) => {
  4907. if (data && data.code === 0) {
  4908. if (data.baseListData.length > 0) {
  4909. this.modalData.applicant = data.baseListData[0].username
  4910. this.modalData.applicantName = data.baseListData[0].user_display
  4911. return
  4912. }
  4913. }
  4914. this.modalData.applicantName = ''
  4915. })
  4916. } else {
  4917. this.modalData.applicantName = ''
  4918. }
  4919. },
  4920. // PM输入校验
  4921. pmBlur (tagNo) {
  4922. if (this.modalData.pm != null && this.modalData.pm !== '') {
  4923. let tempData = {
  4924. tagno: tagNo,
  4925. conditionSql: " and a.username = '" + this.modalData.pm + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4926. }
  4927. verifyData(tempData).then(({data}) => {
  4928. if (data && data.code === 0) {
  4929. if (data.baseListData.length > 0) {
  4930. this.modalData.pm = data.baseListData[0].username
  4931. this.modalData.pmName = data.baseListData[0].user_display
  4932. return
  4933. }
  4934. }
  4935. this.modalData.pmName = ''
  4936. })
  4937. } else {
  4938. this.modalData.pmName = ''
  4939. }
  4940. },
  4941. // NPD工程师输入校验
  4942. npdEngineerBlur (tagNo) {
  4943. if (this.modalData.npdEngineer != null && this.modalData.npdEngineer !== '') {
  4944. let tempData = {
  4945. tagno: tagNo,
  4946. conditionSql: " and a.username = '" + this.modalData.npdEngineer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4947. }
  4948. verifyData(tempData).then(({data}) => {
  4949. if (data && data.code === 0) {
  4950. if (data.baseListData.length > 0) {
  4951. this.modalData.npdEngineer = data.baseListData[0].username
  4952. this.modalData.npdEngineerName = data.baseListData[0].user_display
  4953. return
  4954. }
  4955. }
  4956. this.modalData.npdEngineerName = ''
  4957. })
  4958. } else {
  4959. this.modalData.npdEngineerName = ''
  4960. }
  4961. },
  4962. // 技术计划输入校验
  4963. technicalPlanBlur (tagNo) {
  4964. if (this.modalData.technicalPlan != null && this.modalData.technicalPlan !== '') {
  4965. let tempData = {
  4966. tagno: tagNo,
  4967. conditionSql: " and a.username = '" + this.modalData.technicalPlan + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4968. }
  4969. verifyData(tempData).then(({data}) => {
  4970. if (data && data.code === 0) {
  4971. if (data.baseListData.length > 0) {
  4972. this.modalData.technicalPlan = data.baseListData[0].username
  4973. this.modalData.technicalPlanName = data.baseListData[0].user_display
  4974. return
  4975. }
  4976. }
  4977. this.modalData.technicalPlanName = ''
  4978. })
  4979. } else {
  4980. this.modalData.technicalPlanName = ''
  4981. }
  4982. },
  4983. // 采购输入校验
  4984. buyerBlur (tagNo) {
  4985. if (this.modalData.buyer != null && this.modalData.buyer !== '') {
  4986. let tempData = {
  4987. tagno: tagNo,
  4988. conditionSql: " and a.username = '" + this.modalData.buyer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
  4989. }
  4990. verifyData(tempData).then(({data}) => {
  4991. if (data && data.code === 0) {
  4992. if (data.baseListData.length > 0) {
  4993. this.modalData.buyer = data.baseListData[0].username
  4994. this.modalData.buyerName = data.baseListData[0].user_display
  4995. return
  4996. }
  4997. }
  4998. this.modalData.buyerName = ''
  4999. })
  5000. } else {
  5001. this.modalData.buyerName = ''
  5002. }
  5003. },
  5004. // 商品组1输入校验
  5005. commGroup1Blur (tagNo) {
  5006. if (this.modalData.commGroup1 != null && this.modalData.commGroup1 !== '') {
  5007. let tempData = {
  5008. tagno: tagNo,
  5009. conditionSql: " and product_group_id = '" + this.modalData.commGroup1 + "'" + " and site = '" + this.$store.state.user.site + "'"
  5010. }
  5011. verifyData(tempData).then(({data}) => {
  5012. if (data && data.code === 0 && data.baseListData.length > 0) {
  5013. this.modalData.commGroup1 = data.baseListData[0].product_group_id
  5014. this.modalData.commGroup1Desc = data.baseListData[0].product_group_name
  5015. } else {
  5016. this.modalData.commGroup1Desc = ''
  5017. }
  5018. })
  5019. } else {
  5020. this.modalData.commGroup1Desc = ''
  5021. }
  5022. },
  5023. // 商品组2输入校验
  5024. commGroup2Blur (tagNo) {
  5025. if (this.modalData.commGroup2 != null && this.modalData.commGroup2 !== '') {
  5026. let tempData = {
  5027. tagno: tagNo,
  5028. conditionSql: " and product_group_id = '" + this.modalData.commGroup2 + "'" + " and site = '" + this.$store.state.user.site + "'"
  5029. }
  5030. verifyData(tempData).then(({data}) => {
  5031. if (data && data.code === 0 && data.baseListData.length > 0) {
  5032. this.modalData.commGroup2 = data.baseListData[0].product_group_id
  5033. this.modalData.commGroup2Desc = data.baseListData[0].product_group_name
  5034. } else {
  5035. this.modalData.commGroup2Desc = ''
  5036. }
  5037. })
  5038. } else {
  5039. this.modalData.commGroup2Desc = ''
  5040. }
  5041. },
  5042. // 商品组3输入校验
  5043. commGroup3Blur (tagNo) {
  5044. if (this.modalData.commGroup3 != null && this.modalData.commGroup3 !== '') {
  5045. let tempData = {
  5046. tagno: tagNo,
  5047. conditionSql: " and product_group_id = '" + this.modalData.commGroup3 + "'" + " and site = '" + this.$store.state.user.site + "'"
  5048. }
  5049. verifyData(tempData).then(({data}) => {
  5050. if (data && data.code === 0 && data.baseListData.length > 0) {
  5051. this.modalData.commGroup3 = data.baseListData[0].product_group_id
  5052. this.modalData.commGroup3Desc = data.baseListData[0].product_group_name
  5053. } else {
  5054. this.modalData.commGroup3Desc = ''
  5055. }
  5056. })
  5057. } else {
  5058. this.modalData.commGroup3Desc = ''
  5059. }
  5060. }
  5061. }
  5062. }
  5063. </script>
  5064. <style scoped lang="scss">
  5065. /deep/ .customer-tab .el-tabs__content {
  5066. padding: 0 !important;
  5067. }
  5068. /deep/ .rohs-material-table .el-table__header-wrapper th > .cell {
  5069. white-space: nowrap;
  5070. word-break: keep-all;
  5071. }
  5072. /deep/ .rohs-multiple-two-rows.el-select .el-input__inner,
  5073. /deep/ .rohs-multiple-two-rows .el-select .el-input__inner {
  5074. min-height: 62px !important;
  5075. height: auto !important;
  5076. padding-top: 6px !important;
  5077. padding-bottom: 6px !important;
  5078. }
  5079. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags,
  5080. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags {
  5081. max-width: calc(100% - 34px) !important;
  5082. max-height: 50px;
  5083. overflow-y: auto;
  5084. overflow-x: hidden;
  5085. white-space: normal;
  5086. }
  5087. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags > span,
  5088. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags > span {
  5089. display: inline;
  5090. max-width: 100%;
  5091. white-space: normal;
  5092. }
  5093. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags .el-tag,
  5094. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags .el-tag {
  5095. display: inline-flex;
  5096. max-width: 100%;
  5097. height: auto;
  5098. line-height: 16px;
  5099. padding-top: 2px;
  5100. padding-bottom: 2px;
  5101. margin-right: 4px;
  5102. white-space: normal;
  5103. vertical-align: middle;
  5104. }
  5105. /deep/ .rohs-multiple-two-rows.el-select .el-select__tags .el-tag .el-select__tags-text,
  5106. /deep/ .rohs-multiple-two-rows .el-select .el-select__tags .el-tag .el-select__tags-text {
  5107. white-space: normal;
  5108. word-break: break-all;
  5109. }
  5110. </style>