赫艾前端
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.

3760 lines
138 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
7 months ago
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
8 months ago
7 months ago
​
7 months ago
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 months ago
​
​
​
​
7 months ago
8 months ago
7 months ago
8 months ago
​
​
​
7 months ago
8 months ago
7 months ago
8 months ago
​
7 months ago
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
7 months ago
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
8 months ago
​
​
​
​
​
​
​
​
6 months ago
8 months ago
​
​
​
​
​
​
​
6 months ago
8 months ago
6 months ago
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
7 months ago
​
​
7 months ago
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
7 months ago
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
7 months ago
​
7 months ago
​
​
​
​
7 months ago
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
8 months ago
​
​
​
​
​
6 months ago
8 months ago
7 months ago
​
​
​
​
6 months ago
​
​
6 months ago
​
​
​
7 months ago
​
​
​
7 months ago
​
​
​
​
6 months ago
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
11 months ago
11 months ago
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
11 months ago
​
11 months ago
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
11 months ago
​
11 months ago
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
11 months ago
​
11 months ago
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
7 months ago
​
​
​
​
​
7 months ago
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
6 months ago
​
​
​
​
7 months ago
​
7 months ago
​
7 months ago
​
​
7 months ago
7 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
​
​
​
7 months ago
​
​
7 months ago
7 months ago
​
​
​
​
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
8 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
7 months ago
​
​
7 months ago
7 months ago
​
​
​
7 months ago
​
7 months ago
7 months ago
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
7 months ago
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 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="'BU'">-->
  6. <!-- <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">-->
  7. <!-- <el-option-->
  8. <!-- v-for = "i in userBuList"-->
  9. <!-- :key = "i.buNo"-->
  10. <!-- :label = "i.buDesc"-->
  11. <!-- :value = "i.buDesc">-->
  12. <!-- </el-option>-->
  13. <!-- </el-select>-->
  14. <!-- </el-form-item>-->
  15. <el-form-item :label="'工厂编码'">
  16. <el-select filterable clearable v-model="searchData.site" placeholder="请选择" style="width: 160px">
  17. <el-option label="全部" value=""></el-option>
  18. <el-option
  19. v-for="item in siteList"
  20. :key="item.siteID"
  21. :label="item.shortSiteName"
  22. :value="item.siteID">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item :label="'物料编码'">
  27. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  28. </el-form-item>
  29. <el-form-item :label="'SKU'">
  30. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="'物料名称'">
  33. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  34. </el-form-item>
  35. <el-form-item :label="'PN'">
  36. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
  37. </el-form-item>
  38. <el-form-item :label="'类别名称'">
  39. <el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
  40. </el-form-item>
  41. <el-form-item label="IQC">
  42. <el-select v-model="searchData.iqcFlag" placeholder="全部" clearable style="width: 90px">
  43. <el-option v-for="item in maintainStatusOptions" :key="'iqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item label="IPQC">
  47. <el-select v-model="searchData.ipqcFlag" placeholder="全部" clearable style="width: 90px">
  48. <el-option v-for="item in maintainStatusOptions" :key="'ipqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="FQC">
  52. <el-select v-model="searchData.fqcFlag" placeholder="全部" clearable style="width: 90px">
  53. <el-option v-for="item in maintainStatusOptions" :key="'fqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="OQC">
  57. <el-select v-model="searchData.oqcFlag" placeholder="全部" clearable style="width: 90px">
  58. <el-option v-for="item in maintainStatusOptions" :key="'oqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="SQC">
  62. <el-select v-model="searchData.sqcFlag" placeholder="全部" clearable style="width: 90px">
  63. <el-option v-for="item in maintainStatusOptions" :key="'sqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item :label="' '">
  67. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  68. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  69. </el-form-item>
  70. <el-form-item :label="' '">
  71. <el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartAttrUpload()">物料属性导入</el-button>
  72. <el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartTemplateUpload()">检验模板导入</el-button>
  73. <el-button v-if="!authSave" type="primary" icon="el-icon-upload" @click="qcPartStandardUpload()">检验标准导入</el-button>
  74. <el-button type="primary" :loading="exportLoading" @click="exportExcel()">导出</el-button>
  75. </el-form-item>
  76. </el-form>
  77. <!-- 展示列表 -->
  78. <el-table
  79. :height="height"
  80. :data="dataList"
  81. border
  82. style="width: 100%;">
  83. <el-table-column
  84. v-for="(item,index) in columnList" :key="index"
  85. :sortable="item.columnSortable"
  86. :prop="item.columnProp"
  87. :header-align="item.headerAlign"
  88. :show-overflow-tooltip="item.showOverflowTooltip"
  89. :align="item.align"
  90. :fixed="item.fixed === ''?false:item.fixed"
  91. :min-width="item.columnWidth"
  92. :label="item.columnLabel">
  93. <template slot-scope="scope">
  94. <span v-if="!item.columnHidden">
  95. <span v-if="maintainFlagProps.includes(item.columnProp)">
  96. <el-tag :type="isMaintained(scope.row[item.columnProp]) ? 'success' : 'info'" size="small">{{ scope.row[item.columnProp] }}</el-tag>
  97. </span>
  98. <span v-else-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  99. <span v-else>
  100. {{ scope.row[item.columnProp] }}
  101. </span>
  102. </span>
  103. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. fixed="right"
  108. header-align="center"
  109. align="center"
  110. width="160"
  111. label="操作">
  112. <template slot-scope="scope">
  113. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  114. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
  115. <el-dropdown
  116. v-if="!authCheckout || !authDelete || !authFile"
  117. trigger="click"
  118. :show-timeout="0"
  119. placement="bottom-end">
  120. <span class="qc-more-dropdown-trigger" @click.stop>
  121. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  122. </span>
  123. <el-dropdown-menu slot="dropdown">
  124. <el-dropdown-item v-if="!authCheckout" @click.native="standardDetailModal(scope.row)">检验标准</el-dropdown-item>
  125. <el-dropdown-item v-if="!authFile" @click.native="sopFileList(scope.row)">文件清单</el-dropdown-item>
  126. <el-dropdown-item @click.native="patrolInspection(scope.row)">巡检配置</el-dropdown-item>
  127. <el-dropdown-item v-if="!authDelete" @click.native="deletePropertiesModel(scope.row)">删除</el-dropdown-item>
  128. </el-dropdown-menu>
  129. </el-dropdown>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <!-- 分页栏 -->
  134. <el-pagination
  135. @size-change="sizeChangeHandle"
  136. @current-change="currentChangeHandle"
  137. :current-page="pageIndex"
  138. :page-sizes="[20, 50, 100, 200, 500]"
  139. :page-size="pageSize"
  140. :total="totalPage"
  141. layout="total, sizes, prev, pager, next, jumper">
  142. </el-pagination>
  143. <!-- 物料属性新增/修改 -->
  144. <el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px" append-to-body>
  145. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  146. <!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
  147. <!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">-->
  148. <!-- <el-option-->
  149. <!-- v-for = "i in userBuList"-->
  150. <!-- :key = "i.buNo"-->
  151. <!-- :label = "i.sitename"-->
  152. <!-- :value = "i.buNo">-->
  153. <!-- <span style="float: left;width: 100px">{{ i.sitename }}</span>-->
  154. <!-- <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">-->
  155. <!-- {{ i.buDesc }}-->
  156. <!-- </span>-->
  157. <!-- </el-option>-->
  158. <!-- </el-select>-->
  159. <!-- </el-form-item>-->
  160. <el-form-item label="工厂编码:" prop="site" :rules="rules.site">
  161. <el-select filterable v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" @change="onModalSiteChange" style="width: 184px">
  162. <el-option
  163. v-for="item in siteList"
  164. :key="item.siteID"
  165. :label="item.shortSiteName"
  166. :value="item.siteID">
  167. </el-option>
  168. </el-select>
  169. </el-form-item>
  170. <el-form-item prop="partNo" :rules="rules.partNoType">
  171. <span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
  172. <span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
  173. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 184px"></el-input>
  174. </el-form-item>
  175. <!-- <el-form-item style="margin-top: 23px;margin-left: 2px">
  176. <el-checkbox v-model="modalData.exemptInspection" true-label="Y" false-label="N">是否免检</el-checkbox><br>
  177. </el-form-item> -->
  178. </el-form>
  179. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  180. <el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
  181. <el-input v-model="modalData.partDesc" disabled style="width: 380px"></el-input>
  182. </el-form-item>
  183. </el-form>
  184. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  185. <el-form-item label="默认值:" prop="defaultValue" >
  186. <el-input v-model="modalData.defaultValue" style="width: 85px"></el-input>
  187. </el-form-item>
  188. <el-form-item label="标准值:" prop="standardValue" >
  189. <el-input v-model="modalData.standardValue" style="width: 85px"></el-input>
  190. </el-form-item>
  191. <el-form-item label="上限值:" prop="maxValue" >
  192. <el-input v-model="modalData.maxValue" style="width: 85px"></el-input>
  193. </el-form-item>
  194. <el-form-item label="下限值:" prop="minValue" >
  195. <el-input v-model="modalData.minValue" style="width: 85px"></el-input>
  196. </el-form-item>
  197. <el-form-item label="首次巡检时长(h):" prop="firstIPQCPatrolTime" >
  198. <el-input type="number" v-model="modalData.firstIPQCPatrolTime" style="width: 117px"></el-input>
  199. </el-form-item>
  200. <el-form-item label="下次巡检时长(h):" prop="lastIPQCPatrolTime" >
  201. <el-input type="number" v-model="modalData.lastIPQCPatrolTime" style="width: 117px"></el-input>
  202. </el-form-item>
  203. <el-form-item label="累计巡检时长(h):" prop="cycleIPQCPatrolTime" >
  204. <el-input type="number" v-model="modalData.cycleIPQCPatrolTime" style="width: 117px"></el-input>
  205. </el-form-item>
  206. <el-form-item label="检验配置:" >
  207. <el-row :gutter="12">
  208. <el-col :span="6">
  209. <el-checkbox v-model="modalData.iqcExempt" true-label="Y" false-label="N">IQC检验</el-checkbox>
  210. </el-col>
  211. <!-- <el-col :span="6">
  212. <el-checkbox v-model="modalData.faiExempt" true-label="Y" false-label="N">FAI检验</el-checkbox>
  213. </el-col> -->
  214. <el-col :span="6">
  215. <el-checkbox v-model="modalData.ipqcExempt" true-label="Y" false-label="N">IPQC检验</el-checkbox>
  216. </el-col>
  217. <el-col :span="6">
  218. <el-checkbox v-model="modalData.oqcExempt" true-label="Y" false-label="N">OQC检验</el-checkbox>
  219. </el-col>
  220. <el-col :span="6">
  221. <el-checkbox v-model="modalData.fqcExempt" true-label="Y" false-label="N">FQC检验</el-checkbox>
  222. </el-col>
  223. </el-row>
  224. <el-row :gutter="12">
  225. <el-col :span="6">
  226. <el-checkbox v-model="modalData.sqcExempt" true-label="Y" false-label="N">SQC检验</el-checkbox>
  227. </el-col>
  228. </el-row>
  229. </el-form-item>
  230. <el-form-item label="备注:">
  231. <el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
  232. </el-form-item>
  233. <!-- <el-form-item label="是否免检">-->
  234. <!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
  235. <!-- </el-form-item>-->
  236. </el-form>
  237. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  238. <el-button type="primary" @click="saveData()">保存</el-button>
  239. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  240. </el-footer>
  241. </el-dialog>
  242. <!-- 检验模板 -->
  243. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
  244. <el-form :inline="true" label-position="top">
  245. <el-form-item :label="'物料编码'">
  246. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  247. </el-form-item>
  248. <el-form-item :label="'物料名称'">
  249. <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
  250. </el-form-item>
  251. <el-form-item :label="' '">
  252. <el-button type="primary" @click="addFastModal()">新增</el-button>
  253. </el-form-item>
  254. </el-form>
  255. <!-- 检验项目展示列表 -->
  256. <div class="rq ">
  257. <el-table
  258. :height="300"
  259. :data="detailList"
  260. border
  261. style="width: 100%;">
  262. <el-table-column
  263. v-for="(item,index) in detailColumnsBeforeIpqc" :key="'before-' + index"
  264. :sortable="item.columnSortable"
  265. :prop="item.columnProp"
  266. :header-align="item.headerAlign"
  267. :show-overflow-tooltip="item.showOverflowTooltip"
  268. :align="item.align"
  269. :fixed="item.fixed===''?false:item.fixed"
  270. :min-width="item.columnWidth"
  271. :label="item.columnLabel">
  272. <template slot-scope="scope">
  273. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  274. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  275. </template>
  276. </el-table-column>
  277. <el-table-column
  278. prop="ipqcInspectionMethod"
  279. header-align="center"
  280. align="center"
  281. min-width="180"
  282. label="检验方式">
  283. <template slot-scope="scope">
  284. <el-select
  285. v-model="scope.row.ipqcInspectionMethod"
  286. placeholder="请选择"
  287. size="mini"
  288. style="width: 160px"
  289. :disabled="!isInspectionMethodApplicable(scope.row)">
  290. <el-option
  291. v-for="opt in getInspectionMethodOptions(scope.row)"
  292. :key="opt"
  293. :label="opt"
  294. :value="opt">
  295. </el-option>
  296. </el-select>
  297. <span v-if="isInspectionMethodApplicable(scope.row) && !scope.row.ipqcInspectionMethod" style="color:#F56C6C;margin-left:6px">*</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column
  301. v-for="(item,index) in detailColumnsAfterIpqc" :key="'after-' + index"
  302. :sortable="item.columnSortable"
  303. :prop="item.columnProp"
  304. :header-align="item.headerAlign"
  305. :show-overflow-tooltip="item.showOverflowTooltip"
  306. :align="item.align"
  307. :fixed="item.fixed===''?false:item.fixed"
  308. :min-width="item.columnWidth"
  309. :label="item.columnLabel">
  310. <template slot-scope="scope">
  311. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  312. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  313. </template>
  314. </el-table-column>
  315. <el-table-column
  316. prop=""
  317. header-align="center"
  318. align="center"
  319. min-width="170"
  320. label="检验水平">
  321. <template slot-scope="scope">
  322. <el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  323. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  324. </template>
  325. </el-table-column>
  326. <el-table-column
  327. prop=""
  328. header-align="center"
  329. align="center"
  330. min-width="60"
  331. label="检验周期(h)">
  332. <template slot-scope="scope">
  333. <el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  334. </template>
  335. </el-table-column>
  336. <el-table-column
  337. prop=""
  338. header-align="center"
  339. align="center"
  340. min-width="170"
  341. label="抽样方案">
  342. <template slot-scope="scope">
  343. <el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
  344. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  345. </template>
  346. </el-table-column>
  347. <el-table-column
  348. prop=""
  349. header-align="center"
  350. align="center"
  351. min-width="60"
  352. label="AQL">
  353. <template slot-scope="scope">
  354. <el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  355. </template>
  356. </el-table-column>
  357. <el-table-column
  358. prop=""
  359. header-align="center"
  360. align="center"
  361. min-width="60"
  362. label="AC">
  363. <template slot-scope="scope">
  364. <el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. prop=""
  369. header-align="center"
  370. align="center"
  371. min-width="60"
  372. label="RE">
  373. <template slot-scope="scope">
  374. <el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  375. </template>
  376. </el-table-column>
  377. <el-table-column
  378. prop="templateRemark"
  379. header-align="center"
  380. align="center"
  381. label="备注">
  382. </el-table-column>
  383. <el-table-column
  384. fixed="right"
  385. header-align="center"
  386. align="center"
  387. width="80"
  388. label="操作">
  389. <template slot-scope="scope">
  390. <a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
  391. </template>
  392. </el-table-column>
  393. </el-table>
  394. </div>
  395. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  396. <el-button type="primary" @click="saveDetail()">保存</el-button>
  397. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  398. </el-footer>
  399. </el-dialog>
  400. <!-- 检验模板->快速新增(原实现已注释,现与 boying-vue 一致) -->
  401. <!--
  402. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  403. ... 原「可选模板 | 添加>> 删除<< | 已有模板」三栏布局与单工序/单机台逻辑已废弃 ...
  404. </el-dialog>
  405. -->
  406. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  407. <div style="font-size: 12px">
  408. <el-form :inline="true" label-position="top" :model="detailData">
  409. <el-form-item :label="'模板编码'">
  410. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  411. </el-form-item>
  412. <el-form-item :label="'模板名称'">
  413. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  414. </el-form-item>
  415. <el-form-item label="检验类型">
  416. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType" placeholder="请选择">
  417. <el-option
  418. v-for="i in options"
  419. :key="i.inspectionTypeNo"
  420. :label="i.inspectionTypeName"
  421. :value="i.inspectionTypeNo">
  422. </el-option>
  423. </el-select>
  424. </el-form-item>
  425. <el-form-item :label="' '">
  426. <el-button type="primary" @click="checkInspectionType2">查询</el-button>
  427. </el-form-item>
  428. <el-form-item :label="' '" style="margin-left: 63px">
  429. <el-button type="primary" @click="getOperationList" v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'" style="width: 63px">工序</el-button>
  430. <el-button type="primary" @click="getManufacturerList" v-if="detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
  431. <el-button type="primary" @click="getCustomerList" v-if="detailData.inspectionTypeNo === '110'" style="width: 63px">客户</el-button>
  432. </el-form-item>
  433. <el-form-item :label="' '" style="margin-left: 195px">
  434. <el-button type="primary" @click="getAllResourceList" v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '102' || detailData.inspectionTypeNo === '103' || detailData.inspectionTypeNo === '104' || detailData.inspectionTypeNo === '106' || detailData.inspectionTypeNo === '107'" style="width: 63px">机台</el-button>
  435. </el-form-item>
  436. </el-form>
  437. </div>
  438. <el-container>
  439. <el-header style="width: 1080px;height: 200px;padding: 0 0 0 0">
  440. <el-row :gutter="5">
  441. <el-col :span="span1">
  442. <span style="font-size: 12px">可选模板:</span>
  443. <el-table
  444. height="210px"
  445. :data="itemList1"
  446. v-loading="itemList1Loading"
  447. border
  448. ref="itemTable1"
  449. @row-click="itemClickRow1"
  450. @selection-change="selectionItem1"
  451. highlight-current-row
  452. style="width: 100%">
  453. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  454. <el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
  455. <el-table-column prop="templateName" header-align="left" align="left" min-width="200" label="模板名称"></el-table-column>
  456. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></el-table-column>
  457. </el-table>
  458. </el-col>
  459. <el-col v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '110' || detailData.inspectionTypeNo === '107'" :span="span2" style="margin-top: 25px">
  460. <el-table
  461. v-if="detailData.inspectionTypeNo === '105'"
  462. height="210px"
  463. :data="selectionManufacturer2"
  464. border
  465. highlight-current-row
  466. style="width: 100%">
  467. <el-table-column prop="manufacturerID" header-align="center" align="center" min-width="100" label="供应商编码"></el-table-column>
  468. <el-table-column prop="manufacturerName" header-align="left" align="left" min-width="150" label="供应商名称"></el-table-column>
  469. </el-table>
  470. <el-table
  471. v-else-if="detailData.inspectionTypeNo === '110'"
  472. height="210px"
  473. :data="selectionCustomer2"
  474. border
  475. highlight-current-row
  476. style="width: 100%">
  477. <el-table-column prop="customerID" header-align="center" align="center" min-width="100" label="客户编码"></el-table-column>
  478. <el-table-column prop="customerName" header-align="left" align="left" min-width="150" label="客户名称"></el-table-column>
  479. </el-table>
  480. <el-table
  481. v-else
  482. height="210px"
  483. :data="operationSelections"
  484. border
  485. highlight-current-row
  486. style="width: 100%">
  487. <el-table-column prop="operationDesc" header-align="center" align="center" label="工序"></el-table-column>
  488. </el-table>
  489. </el-col>
  490. <el-col v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '107'" :span="span3" style="margin-top: 25px">
  491. <el-table
  492. height="210px"
  493. :data="resourceSelections"
  494. border
  495. highlight-current-row
  496. style="width: 100%">
  497. <el-table-column prop="resourceId" header-align="center" align="center" min-width="100" label="机台编码"></el-table-column>
  498. <el-table-column prop="resourceDesc" header-align="left" align="left" min-width="150" label="机台名称"></el-table-column>
  499. </el-table>
  500. </el-col>
  501. </el-row>
  502. </el-header>
  503. <el-main style="width: 880px;height: 25px;margin-top: 50px;padding: 0 0 0 0;text-align:center">
  504. <div>
  505. <el-button type="primary" @click="addItem" :loading="addItemLoading">添加<i class="el-icon-caret-bottom el-icon--right" v-if="!addItemLoading"></i></el-button>
  506. <el-button type="primary" @click="deleteItem" :loading="deleteItemLoading">删除<i class="el-icon-caret-top el-icon--right" v-if="!deleteItemLoading"></i></el-button>
  507. </div>
  508. </el-main>
  509. <el-footer style="width: 1080px;height: 222px;padding: 0 0 0 0;margin-top: -4px">
  510. <span style="font-size: 12px">已有模板:</span>
  511. <div class="rq">
  512. <el-table
  513. height="200px"
  514. :data="itemList2"
  515. v-loading="itemList2Loading"
  516. border
  517. ref="itemTable2"
  518. @row-click="itemClickRow2"
  519. @selection-change="selectionItem2"
  520. highlight-current-row
  521. style="width: 100%">
  522. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  523. <el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
  524. <el-table-column prop="templateName" header-align="center" align="center" min-width="200" label="模板名称"></el-table-column>
  525. <el-table-column prop="operation" header-align="center" align="center" min-width="100" label="工序"></el-table-column>
  526. <el-table-column prop="resourceID" header-align="center" align="center" min-width="100" label="机台"></el-table-column>
  527. <el-table-column prop="manufacturerName" header-align="center" align="center" min-width="200" label="供应商"></el-table-column>
  528. <el-table-column prop="customerName" header-align="center" align="center" min-width="200" label="客户"></el-table-column>
  529. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></el-table-column>
  530. </el-table>
  531. </div>
  532. </el-footer>
  533. </el-container>
  534. <el-footer style="height:35px;margin-top: 18px;text-align:center">
  535. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  536. </el-footer>
  537. </el-dialog>
  538. <!-- 检验标准(qc_part_attr_detailed) -->
  539. <el-dialog title="检验标准清单" @close="closeStandardDialog" :close-on-click-modal="false" v-drag :visible.sync="standardDetailModelFlag" width="940px">
  540. <el-form :inline="true" label-position="top">
  541. <el-form-item :label="'物料编码'">
  542. <el-input v-model="standardDetailData.partNo" readonly style="width: 120px"></el-input>
  543. </el-form-item>
  544. <el-form-item :label="'物料名称'">
  545. <el-input v-model="standardDetailData.partDesc" readonly style="width: 240px"></el-input>
  546. </el-form-item>
  547. <!-- <el-form-item label="检验类型">
  548. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  549. <el-option
  550. v-for="i in options"
  551. :key="i.inspectionTypeNo"
  552. :label="i.inspectionTypeName"
  553. :value="i.inspectionTypeNo">
  554. </el-option>
  555. </el-select>
  556. </el-form-item> -->
  557. <el-form-item :label="' '">
  558. <!-- <el-button type="primary" @click="standardAddFastModal()">新增</el-button> -->
  559. <el-button type="primary" @click="standardSyncFromTemplate()">同步检验项目</el-button>
  560. <!-- <el-button type="primary" @click="standardGoUp()">上移</el-button>
  561. <el-button type="primary" @click="standardGoDown()">下移</el-button> -->
  562. </el-form-item>
  563. </el-form>
  564. <div class="rq">
  565. <el-table
  566. :height="400"
  567. :data="standardDetailList"
  568. @row-click="standardItemClickRow"
  569. ref="standardDetailTable"
  570. highlight-current-row
  571. border
  572. style="width: 100%;">
  573. <el-table-column
  574. v-for="(item,index) in standardColumnDetailList"
  575. :key="'std-col-' + index"
  576. :sortable="item.columnSortable"
  577. :prop="item.columnProp"
  578. :header-align="item.headerAlign"
  579. :show-overflow-tooltip="item.showOverflowTooltip"
  580. :align="item.align"
  581. :fixed="item.fixed===''?false:item.fixed"
  582. :min-width="item.columnWidth"
  583. :label="item.columnLabel">
  584. <template slot-scope="scope">
  585. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  586. </template>
  587. </el-table-column>
  588. <el-table-column
  589. prop=""
  590. header-align="center"
  591. align="right"
  592. min-width="60"
  593. label="标准值">
  594. <template slot-scope="scope">
  595. <el-input v-model="scope.row.defaultValue" style="height: 11px;width:98%"></el-input>
  596. </template>
  597. </el-table-column>
  598. <el-table-column
  599. prop=""
  600. header-align="center"
  601. align="right"
  602. min-width="60"
  603. label="最大值">
  604. <template slot-scope="scope">
  605. <el-input v-model="scope.row.maxValue" style="height: 11px;width:98%"></el-input>
  606. </template>
  607. </el-table-column>
  608. <el-table-column
  609. prop=""
  610. header-align="center"
  611. align="right"
  612. min-width="60"
  613. label="最小值">
  614. <template slot-scope="scope">
  615. <el-input v-model="scope.row.minValue" style="height: 11px;width:98%"></el-input>
  616. </template>
  617. </el-table-column>
  618. <el-table-column
  619. fixed="right"
  620. header-align="center"
  621. align="center"
  622. width="100"
  623. label="操作">
  624. <template slot-scope="scope">
  625. <a type="text" size="small" @click="standardDelItemDetails(scope.row)">删除项目</a>
  626. </template>
  627. </el-table-column>
  628. </el-table>
  629. </div>
  630. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  631. <el-button type="primary" @click="saveStandardDetail()">保存</el-button>
  632. <el-button type="primary" @click="standardDetailModelFlag = false">关闭</el-button>
  633. </el-footer>
  634. </el-dialog>
  635. <!-- 检验标准->快速新增 -->
  636. <el-dialog title="新增检验项目" @close="standardRefreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="standardFastAddFlag" width="1100px">
  637. <div style="font-size: 12px">
  638. <el-form :inline="true" label-position="top" :model="standardDetailData">
  639. <el-form-item :label="'项目编码'">
  640. <el-input v-model="standardDetailData.itemNo" clearable style="width: 120px"></el-input>
  641. </el-form-item>
  642. <el-form-item :label="'项目名称'">
  643. <el-input v-model="standardDetailData.itemDesc" clearable style="width: 200px"></el-input>
  644. </el-form-item>
  645. <el-form-item label="检验类型">
  646. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  647. <el-option
  648. v-for="i in options"
  649. :key="i.inspectionTypeNo"
  650. :label="i.inspectionTypeName"
  651. :value="i.inspectionTypeNo">
  652. </el-option>
  653. </el-select>
  654. </el-form-item>
  655. <el-form-item :label="' '">
  656. <el-button type="primary" @click="standardGetItem()">查询</el-button>
  657. </el-form-item>
  658. </el-form>
  659. </div>
  660. <el-container style="margin-top: 0px;">
  661. <el-main style="width: 720px; padding: 1px">
  662. <span style="font-size: 12px">可选项目:</span>
  663. <el-table
  664. height="400px"
  665. :data="standardItemList1"
  666. border
  667. ref="standardItemTable1"
  668. @row-click="standardItemClickRow1"
  669. @selection-change="standardSelectionItem1"
  670. highlight-current-row
  671. style="width: 100%">
  672. <el-table-column
  673. type="selection"
  674. header-align="center"
  675. align="center"
  676. :selectable="selectFlag"
  677. width="50">
  678. </el-table-column>
  679. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  680. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="120" label="项目名称"></el-table-column>
  681. <el-table-column prop="defaultValue" header-align="center" align="center" min-width="100" label="标准值"></el-table-column>
  682. <el-table-column prop="maxValue" header-align="center" align="center" min-width="60" label="最大值"></el-table-column>
  683. <el-table-column prop="minValue" header-align="center" align="center" min-width="60" label="最小值"></el-table-column>
  684. </el-table>
  685. </el-main>
  686. <el-main style="width: 111px;padding: 1px">
  687. <div style="margin-top: 182px;margin-left: 18px">
  688. <el-button type="primary" @click="standardAddItem()">添加>></el-button>
  689. </div>
  690. <div style="margin-top: 15px;margin-left: 18px">
  691. <el-button type="primary" @click="standardDeleteItem()">删除<<</el-button>
  692. </div>
  693. </el-main>
  694. <el-main style="width: 400px;padding: 1px">
  695. <span style="font-size: 12px">已有项目:</span>
  696. <el-table
  697. height="400px"
  698. :data="standardItemList2"
  699. border
  700. ref="standardItemTable2"
  701. @row-click="standardItemClickRow2"
  702. @selection-change="standardSelectionItem2"
  703. highlight-current-row
  704. style="width: 100%">
  705. <el-table-column
  706. type="selection"
  707. header-align="center"
  708. align="center"
  709. :selectable="selectFlag"
  710. width="50">
  711. </el-table-column>
  712. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  713. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="200" label="项目名称"></el-table-column>
  714. </el-table>
  715. </el-main>
  716. </el-container>
  717. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  718. <el-button type="primary" @click="standardFastAddFlag = false">关闭</el-button>
  719. </el-footer>
  720. </el-dialog>
  721. <!-- 工序(与 boying-vue 一致:多选 + reserve-selection) -->
  722. <el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
  723. <div class="rq">
  724. <el-form :inline="true" label-position="top" :model="operationData">
  725. <el-form-item :label="'工序:'">
  726. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  727. </el-form-item>
  728. <el-form-item :label="' '">
  729. <el-button type="primary" @click="getOperationList2">查询</el-button>
  730. </el-form-item>
  731. </el-form>
  732. <el-table
  733. :height="300"
  734. :data="operationList"
  735. ref="operationTable"
  736. @selection-change="selectionOperationChangeHandle"
  737. @select="operationSelect"
  738. :row-key="getRowKeys"
  739. border
  740. style="width: 100%;">
  741. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  742. <el-table-column prop="operationDesc" header-align="center" align="center" label="工序"></el-table-column>
  743. </el-table>
  744. </div>
  745. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  746. <el-button type="primary" @click="confirmOperation">确认</el-button>
  747. </el-footer>
  748. </el-dialog>
  749. <!-- 机台 -->
  750. <el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
  751. <div class="rq">
  752. <el-form :inline="true" label-position="top" :model="resourceData">
  753. <el-form-item :label="'机台编码'">
  754. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  755. </el-form-item>
  756. <el-form-item :label="'机台名称'">
  757. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  758. </el-form-item>
  759. <el-form-item :label="' '">
  760. <el-button type="primary" @click="getAllResourceList2">查询</el-button>
  761. </el-form-item>
  762. </el-form>
  763. <el-table
  764. :height="300"
  765. :data="resourceList"
  766. ref="resourceTable"
  767. @selection-change="selectionResourceChangeHandle"
  768. @select="resourceSelect"
  769. :row-key="getRowKeys2"
  770. border
  771. style="width: 100%;">
  772. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  773. <el-table-column prop="resourceId" header-align="center" align="center" label="机台编码"></el-table-column>
  774. <el-table-column prop="resourceDesc" header-align="center" align="center" label="机台名称"></el-table-column>
  775. </el-table>
  776. </div>
  777. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  778. <el-button type="primary" @click="confirmResource">确认</el-button>
  779. </el-footer>
  780. </el-dialog>
  781. <!-- 供应商 -->
  782. <el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
  783. <div class="rq">
  784. <el-form :inline="true" label-position="top" :model="manufacturerData">
  785. <el-form-item :label="'供应商编码:'">
  786. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
  787. </el-form-item>
  788. <el-form-item :label="'供应商名称:'">
  789. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  790. </el-form-item>
  791. <el-form-item :label="' '">
  792. <el-button type="primary" @click="getManufacturerList2">查询</el-button>
  793. </el-form-item>
  794. </el-form>
  795. <el-table
  796. :height="300"
  797. :data="manufacturerList"
  798. ref="manufacturerTable"
  799. @row-click="manufacturerClickRow"
  800. @selection-change="selectionManufacturerChangeHandle"
  801. :row-key="getRowKeys3"
  802. border
  803. style="width: 100%;">
  804. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  805. <el-table-column prop="manufacturerID" header-align="center" align="center" label="供应商编码"></el-table-column>
  806. <el-table-column prop="manufacturerName" header-align="center" align="center" label="供应商名称"></el-table-column>
  807. </el-table>
  808. </div>
  809. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  810. <el-button type="primary" @click="confirmManufacturer">确认</el-button>
  811. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  812. </el-footer>
  813. </el-dialog>
  814. <!-- 客户 -->
  815. <el-dialog title="客户清单" :close-on-click-modal="false" v-drag :visible.sync="customerModelFlag" width="520px">
  816. <div class="rq">
  817. <el-form :inline="true" label-position="top" :model="customerData">
  818. <el-form-item :label="'客户编码:'">
  819. <el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input>
  820. </el-form-item>
  821. <el-form-item :label="'客户名称:'">
  822. <el-input v-model="customerData.customerName" clearable style="width: 120px"></el-input>
  823. </el-form-item>
  824. <el-form-item :label="' '">
  825. <el-button type="primary" @click="getCustomerList2">查询</el-button>
  826. </el-form-item>
  827. </el-form>
  828. <el-table
  829. :height="300"
  830. :data="customerList"
  831. ref="customerTable"
  832. @row-click="customerClickRow"
  833. @selection-change="selectionCustomerChangeHandle"
  834. :row-key="getRowKeys4"
  835. border
  836. style="width: 100%;">
  837. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  838. <el-table-column prop="customerID" header-align="center" align="center" label="客户编码"></el-table-column>
  839. <el-table-column prop="customerName" header-align="center" align="center" label="客户名称"></el-table-column>
  840. </el-table>
  841. </div>
  842. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  843. <el-button type="primary" @click="confirmCustomer">确认</el-button>
  844. <el-button type="primary" @click="customerModelFlag = false">关闭</el-button>
  845. </el-footer>
  846. </el-dialog>
  847. <!-- sop文件清单 -->
  848. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px">
  849. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  850. <el-form-item :label="' '">
  851. <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
  852. </el-form-item>
  853. <el-form-item label="检验类型" style="margin-left: 448px">
  854. <el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
  855. <el-option label="全部" value=""></el-option>
  856. <el-option
  857. v-for = "i in options"
  858. :key = "i.inspectionTypeNo"
  859. :label = "i.inspectionTypeName"
  860. :value = "i.inspectionTypeNo">
  861. </el-option>
  862. </el-select>
  863. </el-form-item>
  864. <el-form-item :label="' '">
  865. <el-button type="primary" @click="getFileContentList">查询</el-button>
  866. </el-form-item>
  867. </el-form>
  868. <el-table
  869. :height="350"
  870. :data="sopList"
  871. border
  872. style="width: 100%; ">
  873. <el-table-column
  874. v-for="(item,index) in sopColumnList" :key="index"
  875. :sortable="item.columnSortable"
  876. :prop="item.columnProp"
  877. :header-align="item.headerAlign"
  878. :show-overflow-tooltip="item.showOverflowTooltip"
  879. :align="item.align"
  880. :fixed="item.fixed===''?false:item.fixed"
  881. :min-width="item.columnWidth"
  882. :label="item.columnLabel">
  883. <template slot-scope="scope">
  884. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  885. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  886. </template>
  887. </el-table-column>
  888. <el-table-column
  889. fixed="right"
  890. header-align="center"
  891. align="center"
  892. width="100"
  893. label="操作">
  894. <template slot-scope="scope">
  895. <a @click="downloadFile(scope.row)">下载</a>
  896. <a v-if="scope.row.orderReftype !== 'AttachmentList'" type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  897. </template>
  898. </el-table-column>
  899. </el-table>
  900. </el-dialog>
  901. <!-- 物料编码 -->
  902. <el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px" append-to-body>
  903. <el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
  904. <el-form-item label="物料编码">
  905. <el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
  906. </el-form-item>
  907. <el-form-item label="物料名称">
  908. <el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
  909. </el-form-item>
  910. <!-- <el-form-item label="SKU">
  911. <el-input v-model="partDetailData.sku" clearable style="width: 100px"></el-input>
  912. </el-form-item> -->
  913. <el-form-item label="规格型号">
  914. <el-input v-model="partDetailData.spec" clearable style="width: 100px"></el-input>
  915. </el-form-item>
  916. <el-form-item label="PN">
  917. <el-input v-model="partDetailData.cinvSourceCode" clearable style="width: 100px"></el-input>
  918. </el-form-item>
  919. <el-form-item>
  920. <el-button type="primary" @click="searchPartInfo()" style="margin-top: 24px">查询</el-button>
  921. </el-form-item>
  922. </el-form>
  923. <el-table
  924. :height="400"
  925. :data="partInfoList"
  926. @row-dblclick="getRowData1"
  927. border
  928. v-loading="dataListLoading"
  929. style="width: 100%;">
  930. <el-table-column
  931. prop="partNo"
  932. header-align="center"
  933. align="center"
  934. label="物料编码">
  935. </el-table-column>
  936. <el-table-column
  937. prop="partDesc"
  938. header-align="center"
  939. align="center"
  940. label="物料名称">
  941. </el-table-column>
  942. <el-table-column
  943. prop="spec"
  944. header-align="center"
  945. align="center"
  946. label="规格型号">
  947. </el-table-column>
  948. <el-table-column
  949. prop="sku"
  950. header-align="center"
  951. align="center"
  952. label="SKU">
  953. </el-table-column>
  954. <el-table-column
  955. prop="cinvSourceCode"
  956. header-align="center"
  957. align="center"
  958. label="PN">
  959. </el-table-column>
  960. </el-table>
  961. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  962. <el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
  963. </el-footer>
  964. </el-dialog>
  965. <!-- 巡检特殊配置(按工序) -->
  966. <el-dialog title="巡检特殊配置" :close-on-click-modal="false" v-drag :visible.sync="patrolConfigDialogFlag" width="900px" append-to-body>
  967. <div style="margin-bottom: 10px;">
  968. <el-button type="primary" size="small" icon="el-icon-plus" @click="addPatrolConfig">新增</el-button>
  969. <el-button type="danger" size="small" icon="el-icon-delete" @click="deletePatrolConfigRows" :disabled="patrolConfigSelections.length === 0">删除</el-button>
  970. <el-button type="success" size="small" icon="el-icon-upload2" @click="openPatrolConfigImport">导入</el-button>
  971. </div>
  972. <el-table
  973. :data="patrolConfigList"
  974. border
  975. height="400px"
  976. v-loading="patrolConfigLoading"
  977. @selection-change="patrolConfigSelectionChange"
  978. highlight-current-row
  979. style="width: 100%">
  980. <el-table-column type="selection" width="50" align="center"></el-table-column>
  981. <el-table-column prop="operationDesc" label="工序" header-align="center" align="left" min-width="150">
  982. <template slot-scope="scope">
  983. <el-select v-model="scope.row.operationDesc" size="small" placeholder="请选择工序" filterable clearable style="width: 100%">
  984. <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option>
  985. </el-select>
  986. </template>
  987. </el-table-column>
  988. <el-table-column prop="firstInspectionDuration" label="首次巡检时长(h)" header-align="center" align="right" width="140">
  989. <template slot-scope="scope">
  990. <el-input-number :controls="false" :step="0" v-model="scope.row.firstInspectionDuration" size="small" style="width: 100%"></el-input-number>
  991. </template>
  992. </el-table-column>
  993. <el-table-column prop="nextInspectionDuration" label="下次巡检时长(h)" header-align="center" align="right" width="140">
  994. <template slot-scope="scope">
  995. <el-input-number :controls="false" :step="0" v-model="scope.row.nextInspectionDuration" size="small" style="width: 100%"></el-input-number>
  996. </template>
  997. </el-table-column>
  998. <el-table-column prop="totalInspectionDuration" label="累计巡检时长(h)" header-align="center" align="right" width="140">
  999. <template slot-scope="scope">
  1000. <el-input-number :controls="false" :step="0" v-model="scope.row.totalInspectionDuration" size="small" style="width: 100%"></el-input-number>
  1001. </template>
  1002. </el-table-column>
  1003. <el-table-column prop="defaultFlag" label="是否默认" header-align="center" align="center" width="100">
  1004. <template slot-scope="scope">
  1005. <el-switch v-model="scope.row.defaultFlag" active-value="Y" inactive-value="N" @change="handleDefaultFlagChange(scope.row)"></el-switch>
  1006. </template>
  1007. </el-table-column>
  1008. <el-table-column label="操作" header-align="center" align="center" width="80">
  1009. <template slot-scope="scope">
  1010. <el-button type="text" size="small" @click="savePatrolConfigRow(scope.row)">保存</el-button>
  1011. </template>
  1012. </el-table-column>
  1013. </el-table>
  1014. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  1015. <el-button type="primary" @click="batchSavePatrolConfig" :loading="patrolConfigSaveLoading">保存</el-button>
  1016. <el-button @click="patrolConfigDialogFlag = false">关闭</el-button>
  1017. </el-footer>
  1018. </el-dialog>
  1019. <patrol-config-upload ref="patrolConfigUpload" @refreshPatrolConfig="getPatrolConfigList" v-drag></patrol-config-upload>
  1020. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  1021. <!-- 上传sop文件的modal -->
  1022. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
  1023. <!-- 导入 -->
  1024. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  1025. </div>
  1026. </template>
  1027. <script>
  1028. import {
  1029. qcPartAttributeSearch, // 查询物料属性
  1030. qcPartAttributeSave, // 新增物料属性
  1031. qcPartAttributeDelete, // 删除物料属性
  1032. qcPartAttributeEdit, // 修改物料属性
  1033. searchPartAttributeDetails, // 查询物料属性模板
  1034. savePartAttributeDetails, // 新增物料属性模板
  1035. deletePartAttributeDetails, // 删除物料属性模板
  1036. saveAttributeDetailed, // 新增物料属性模板详情
  1037. getPartTemplateLists, // 获取模板列表
  1038. inspectionTypeSearch, // 搜索所有检验类型
  1039. getOperationDescList, // 查询工序列表
  1040. getManufacturerList, // 查询供应商列表
  1041. getCustomerList, // 查询客户列表
  1042. getAllResourceList, // 查询机台列表
  1043. getSiteAndBuByUserName,
  1044. searchPartInfo, // 查询物料信息
  1045. partAttrDetailedSearch,
  1046. getPartAttrItemList,
  1047. getPartAttrItem,
  1048. addPartAttrItemDetails,
  1049. delPartAttrItemDetails,
  1050. savePartAttrDetailed,
  1051. syncPartAttrDetailedFromTemplate,
  1052. goUpPartAttrItem,
  1053. goDownPartAttrItem,
  1054. getPatrolConfigList as fetchPatrolConfigListApi,
  1055. savePatrolConfig as savePatrolConfigApi,
  1056. updatePatrolConfig as updatePatrolConfigApi,
  1057. deletePatrolConfig as deletePatrolConfigApi,
  1058. getPatrolOperationDescList as getPatrolOperationDescListApi,
  1059. getPartAttributeFileList,
  1060. exportQcExcel
  1061. } from "@/api/qc/qc.js"
  1062. import { getSiteData } from '@/api/board.js'
  1063. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  1064. import Chooselist from '@/views/modules/common/Chooselist_eam'
  1065. import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  1066. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  1067. import {deleteObjectFile} from '@/api/eam/eam.js'
  1068. import qcUpload from "./qc_upload"
  1069. import qcSOPUploadFile from "./qc_SOP_upload_file"
  1070. import PatrolConfigUpload from './patrol_config_upload'
  1071. export default {
  1072. components: {
  1073. qcSOPUploadFile,
  1074. Chooselist,
  1075. qcUpload,
  1076. PatrolConfigUpload
  1077. },
  1078. data () {
  1079. return {
  1080. columnsProp:['createBy', 'updateBy'],
  1081. maintainFlagProps: ['iqcFlag', 'ipqcFlag', 'fqcFlag', 'oqcFlag', 'sqcFlag'],
  1082. // 是否收藏
  1083. favorite: false,
  1084. exportLoading: false,
  1085. tagNo: '',
  1086. patrolConfigDialogFlag: false,
  1087. patrolConfigLoading: false,
  1088. patrolConfigList: [],
  1089. patrolConfigSelections: [],
  1090. operationDescList: [],
  1091. patrolConfigSaveLoading: false,
  1092. patrolContextRow: {
  1093. site: '',
  1094. buNo: '',
  1095. partNo: ''
  1096. },
  1097. searchData: {
  1098. site: '',
  1099. userName: this.$store.state.user.name,
  1100. partNo: '',
  1101. partDesc: '',
  1102. cinvSourceCode: '',
  1103. sku: '',
  1104. familyID: '',
  1105. familyName: '',
  1106. buDesc: '',
  1107. iqcFlag: '',
  1108. ipqcFlag: '',
  1109. fqcFlag: '',
  1110. oqcFlag: '',
  1111. sqcFlag: '',
  1112. attributeType: 'A',
  1113. page: 1,
  1114. limit: 10,
  1115. },
  1116. height: 200,
  1117. pageIndex: 1,
  1118. pageSize: 20,
  1119. totalPage: 0,
  1120. modalFlag: false,
  1121. modalDisableFlag: false,
  1122. partDisableFlag: false,
  1123. modalData: {
  1124. site: '',
  1125. bu: '',
  1126. flag: '',
  1127. partNo: '',
  1128. partDesc: '',
  1129. familyID: '',
  1130. familyName: '',
  1131. cinvSourceCode: '',
  1132. sku: '',
  1133. umid: '',
  1134. supplierNo: '',
  1135. supplierDesc: '',
  1136. attributeRemark: '',
  1137. createTime: '',
  1138. createBy: this.$store.state.user.name,
  1139. attributeType: 'A',
  1140. exemptInspection: 'N',
  1141. iqcExempt: 'N',
  1142. faiExempt: 'N',
  1143. ipqcExempt: 'N',
  1144. pqcExempt: 'N',
  1145. fqcExempt: 'N',
  1146. oqcExempt: 'N',
  1147. sqcExempt: 'N'
  1148. },
  1149. detailData: {
  1150. site: '',
  1151. buNo: '',
  1152. partNo: '',
  1153. attributeNo: '',
  1154. partDesc: '',
  1155. cinvSourceCode: '',
  1156. sku: '',
  1157. attributeType: 'A',
  1158. inspectionTypeNo: '',
  1159. templateId: '',
  1160. templateName: '',
  1161. createBy: this.$store.state.user.name
  1162. },
  1163. standardDetailModelFlag: false,
  1164. standardFastAddFlag: false,
  1165. standardDetailList: [],
  1166. standardItemList1: [],
  1167. standardItemList2: [],
  1168. standardItemSelections1: [],
  1169. standardItemSelections2: [],
  1170. standardCurrentRow: {},
  1171. standardDetailData: {
  1172. site: '',
  1173. buNo: '',
  1174. partNo: '',
  1175. partDesc: '',
  1176. attributeNo: '',
  1177. attributeType: 'A',
  1178. itemType: 'D',
  1179. itemNo: '',
  1180. itemDesc: '',
  1181. inspectionTypeNo: '',
  1182. inspectionTypeName: '',
  1183. createBy: this.$store.state.user.name
  1184. },
  1185. standardColumnDetailList: [
  1186. {
  1187. columnProp: 'itemNo',
  1188. headerAlign: 'center',
  1189. align: 'center',
  1190. columnLabel: '检验项目编码',
  1191. columnHidden: false,
  1192. columnImage: false,
  1193. columnSortable: false,
  1194. columnWidth: 80
  1195. },
  1196. {
  1197. columnProp: 'itemDesc',
  1198. headerAlign: 'center',
  1199. align: 'left',
  1200. columnLabel: '检验项目名称',
  1201. columnHidden: false,
  1202. columnImage: false,
  1203. columnSortable: false,
  1204. columnWidth: 250
  1205. },
  1206. {
  1207. columnProp: 'valueType',
  1208. headerAlign: 'center',
  1209. align: 'center',
  1210. columnLabel: '检测值类型',
  1211. columnHidden: false,
  1212. columnImage: false,
  1213. columnSortable: false,
  1214. columnWidth: 90
  1215. }
  1216. ],
  1217. columnList: [
  1218. {
  1219. userId: this.$store.state.user.name,
  1220. functionId: 301003,
  1221. serialNumber: '301003Table1Site',
  1222. tableId: "301003Table1",
  1223. tableName: "物料属性设置表",
  1224. columnProp: 'site',
  1225. headerAlign: "center",
  1226. align: "center",
  1227. columnLabel: '工厂编码',
  1228. columnHidden: false,
  1229. columnImage: false,
  1230. columnSortable: false,
  1231. sortLv: 0,
  1232. status: true,
  1233. fixed: '',
  1234. columnWidth: 100,
  1235. },
  1236. {
  1237. userId: this.$store.state.user.name,
  1238. functionId: 301003,
  1239. serialNumber: '301003Table1PartNo',
  1240. tableId: "301003Table1",
  1241. tableName: "物料属性设置表",
  1242. columnProp: 'partNo',
  1243. headerAlign: "center",
  1244. align: "center",
  1245. columnLabel: '物料编码',
  1246. columnHidden: false,
  1247. columnImage: false,
  1248. columnSortable: false,
  1249. sortLv: 0,
  1250. status: true,
  1251. fixed: '',
  1252. columnWidth: 120,
  1253. },
  1254. {
  1255. userId: this.$store.state.user.name,
  1256. functionId: 301003,
  1257. serialNumber: '301003Table1SKU',
  1258. tableId: "301003Table1",
  1259. tableName: "物料属性设置表",
  1260. columnProp: 'sku',
  1261. headerAlign: "center",
  1262. align: "center",
  1263. columnLabel: 'SKU',
  1264. columnHidden: false,
  1265. columnImage: false,
  1266. columnSortable: false,
  1267. sortLv: 0,
  1268. status: true,
  1269. fixed: '',
  1270. columnWidth: 120,
  1271. },
  1272. {
  1273. userId: this.$store.state.user.name,
  1274. functionId: 301003,
  1275. serialNumber: '301003Table1PartDesc',
  1276. tableId: "301003Table1",
  1277. tableName: "物料属性设置表",
  1278. columnProp: 'partDesc',
  1279. headerAlign: "center",
  1280. align: "left",
  1281. columnLabel: '物料名称',
  1282. columnHidden: false,
  1283. columnImage: false,
  1284. columnSortable: false,
  1285. sortLv: 0,
  1286. status: true,
  1287. fixed: '',
  1288. columnWidth: 300,
  1289. },
  1290. {
  1291. userId: this.$store.state.user.name,
  1292. functionId: 301003,
  1293. serialNumber: '301003Table1DefaultValue',
  1294. tableId: "301003Table1",
  1295. tableName: "物料属性设置表",
  1296. columnProp: 'defaultValue',
  1297. headerAlign: "center",
  1298. align: "left",
  1299. columnLabel: '默认值',
  1300. columnHidden: false,
  1301. columnImage: false,
  1302. columnSortable: false,
  1303. sortLv: 0,
  1304. status: true,
  1305. fixed: '',
  1306. columnWidth: 100,
  1307. },
  1308. {
  1309. userId: this.$store.state.user.name,
  1310. functionId: 301003,
  1311. serialNumber: '301003Table1StandardValue',
  1312. tableId: "301003Table1",
  1313. tableName: "物料属性设置表",
  1314. columnProp: 'standardValue',
  1315. headerAlign: "center",
  1316. align: "left",
  1317. columnLabel: '标准值',
  1318. columnHidden: false,
  1319. columnImage: false,
  1320. columnSortable: false,
  1321. sortLv: 0,
  1322. status: true,
  1323. fixed: '',
  1324. columnWidth: 100,
  1325. },
  1326. {
  1327. userId: this.$store.state.user.name,
  1328. functionId: 301003,
  1329. serialNumber: '301003Table1MaxValue',
  1330. tableId: "301003Table1",
  1331. tableName: "物料属性设置表",
  1332. columnProp: 'maxValue',
  1333. headerAlign: "center",
  1334. align: "left",
  1335. columnLabel: '上限值',
  1336. columnHidden: false,
  1337. columnImage: false,
  1338. columnSortable: false,
  1339. sortLv: 0,
  1340. status: true,
  1341. fixed: '',
  1342. columnWidth: 100,
  1343. },
  1344. {
  1345. userId: this.$store.state.user.name,
  1346. functionId: 301003,
  1347. serialNumber: '301003Table1MinValue',
  1348. tableId: "301003Table1",
  1349. tableName: "物料属性设置表",
  1350. columnProp: 'minValue',
  1351. headerAlign: "center",
  1352. align: "left",
  1353. columnLabel: '下限值',
  1354. columnHidden: false,
  1355. columnImage: false,
  1356. columnSortable: false,
  1357. sortLv: 0,
  1358. status: true,
  1359. fixed: '',
  1360. columnWidth: 100,
  1361. },
  1362. {
  1363. userId: this.$store.state.user.name,
  1364. functionId: 301003,
  1365. serialNumber: '301003Table1FirstIPQCPatrolTime',
  1366. tableId: "301003Table1",
  1367. tableName: "物料属性设置表",
  1368. columnProp: 'firstIPQCPatrolTime',
  1369. headerAlign: "center",
  1370. align: "left",
  1371. columnLabel: '首次巡检时间(h)',
  1372. columnHidden: false,
  1373. columnImage: false,
  1374. columnSortable: false,
  1375. sortLv: 0,
  1376. status: true,
  1377. fixed: '',
  1378. columnWidth: 100,
  1379. },
  1380. {
  1381. userId: this.$store.state.user.name,
  1382. functionId: 301003,
  1383. serialNumber: '301003Table1LastIPQCPatrolTime',
  1384. tableId: "301003Table1",
  1385. tableName: "物料属性设置表",
  1386. columnProp: 'lastIPQCPatrolTime',
  1387. headerAlign: "center",
  1388. align: "left",
  1389. columnLabel: '下次巡检时间(h)',
  1390. columnHidden: false,
  1391. columnImage: false,
  1392. columnSortable: false,
  1393. sortLv: 0,
  1394. status: true,
  1395. fixed: '',
  1396. columnWidth: 100,
  1397. },
  1398. {
  1399. userId: this.$store.state.user.name,
  1400. functionId: 301003,
  1401. serialNumber: '301003Table1CycleIPQCPatrolTime',
  1402. tableId: "301003Table1",
  1403. tableName: "物料属性设置表",
  1404. columnProp: 'cycleIPQCPatrolTime',
  1405. headerAlign: "center",
  1406. align: "left",
  1407. columnLabel: '累计巡检时间(h)',
  1408. columnHidden: false,
  1409. columnImage: false,
  1410. columnSortable: false,
  1411. sortLv: 0,
  1412. status: true,
  1413. fixed: '',
  1414. columnWidth: 100,
  1415. },
  1416. {
  1417. userId: this.$store.state.user.name,
  1418. functionId: 301003,
  1419. serialNumber: '301003Table1IqcFlag',
  1420. tableId: "301003Table1",
  1421. tableName: "物料属性设置表",
  1422. columnProp: 'iqcFlag',
  1423. headerAlign: "center",
  1424. align: "center",
  1425. columnLabel: 'IQC',
  1426. columnHidden: false,
  1427. columnImage: false,
  1428. columnSortable: false,
  1429. sortLv: 0,
  1430. status: true,
  1431. fixed: '',
  1432. columnWidth: 90,
  1433. },
  1434. {
  1435. userId: this.$store.state.user.name,
  1436. functionId: 301003,
  1437. serialNumber: '301003Table1IpqcFlag',
  1438. tableId: "301003Table1",
  1439. tableName: "物料属性设置表",
  1440. columnProp: 'ipqcFlag',
  1441. headerAlign: "center",
  1442. align: "center",
  1443. columnLabel: 'IPQC',
  1444. columnHidden: false,
  1445. columnImage: false,
  1446. columnSortable: false,
  1447. sortLv: 0,
  1448. status: true,
  1449. fixed: '',
  1450. columnWidth: 90,
  1451. },
  1452. {
  1453. userId: this.$store.state.user.name,
  1454. functionId: 301003,
  1455. serialNumber: '301003Table1FqcFlag',
  1456. tableId: "301003Table1",
  1457. tableName: "物料属性设置表",
  1458. columnProp: 'fqcFlag',
  1459. headerAlign: "center",
  1460. align: "center",
  1461. columnLabel: 'FQC',
  1462. columnHidden: false,
  1463. columnImage: false,
  1464. columnSortable: false,
  1465. sortLv: 0,
  1466. status: true,
  1467. fixed: '',
  1468. columnWidth: 90,
  1469. },
  1470. {
  1471. userId: this.$store.state.user.name,
  1472. functionId: 301003,
  1473. serialNumber: '301003Table1OqcFlag',
  1474. tableId: "301003Table1",
  1475. tableName: "物料属性设置表",
  1476. columnProp: 'oqcFlag',
  1477. headerAlign: "center",
  1478. align: "center",
  1479. columnLabel: 'OQC',
  1480. columnHidden: false,
  1481. columnImage: false,
  1482. columnSortable: false,
  1483. sortLv: 0,
  1484. status: true,
  1485. fixed: '',
  1486. columnWidth: 90,
  1487. },
  1488. {
  1489. userId: this.$store.state.user.name,
  1490. functionId: 301003,
  1491. serialNumber: '301003Table1SqcFlag',
  1492. tableId: "301003Table1",
  1493. tableName: "物料属性设置表",
  1494. columnProp: 'sqcFlag',
  1495. headerAlign: "center",
  1496. align: "center",
  1497. columnLabel: 'SQC',
  1498. columnHidden: false,
  1499. columnImage: false,
  1500. columnSortable: false,
  1501. sortLv: 0,
  1502. status: true,
  1503. fixed: '',
  1504. columnWidth: 90,
  1505. },
  1506. // {
  1507. // userId: this.$store.state.user.name,
  1508. // functionId: 301003,
  1509. // serialNumber: '301003Table1CinvSourceCode',
  1510. // tableId: "301003Table1",
  1511. // tableName: "物料属性设置表",
  1512. // columnProp: 'cinvSourceCode',
  1513. // headerAlign: "center",
  1514. // align: "center",
  1515. // columnLabel: 'PN',
  1516. // columnHidden: false,
  1517. // columnImage: false,
  1518. // columnSortable: false,
  1519. // sortLv: 0,
  1520. // status: true,
  1521. // fixed: '',
  1522. // columnWidth: 120,
  1523. // },
  1524. // {
  1525. // userId: this.$store.state.user.name,
  1526. // functionId: 301003,
  1527. // serialNumber: '301003Table1FamilyName',
  1528. // tableId: "301003Table1",
  1529. // tableName: "物料属性设置表",
  1530. // columnProp: 'familyName',
  1531. // headerAlign: "center",
  1532. // align: "left",
  1533. // columnLabel: '物料类别',
  1534. // columnHidden: false,
  1535. // columnImage: false,
  1536. // columnSortable: false,
  1537. // sortLv: 0,
  1538. // status: true,
  1539. // fixed: '',
  1540. // columnWidth: 150,
  1541. // },
  1542. // {
  1543. // userId: this.$store.state.user.name,
  1544. // functionId: 301003,
  1545. // serialNumber: '301003Table1Spec',
  1546. // tableId: "301003Table1",
  1547. // tableName: "物料属性设置表",
  1548. // columnProp: 'spec',
  1549. // headerAlign: "center",
  1550. // align: "left",
  1551. // columnLabel: '规格型号',
  1552. // columnHidden: false,
  1553. // columnImage: false,
  1554. // columnSortable: false,
  1555. // sortLv: 0,
  1556. // status: true,
  1557. // fixed: '',
  1558. // columnWidth: 300,
  1559. // },
  1560. // {
  1561. // userId: this.$store.state.user.name,
  1562. // functionId: 301003,
  1563. // serialNumber: '301003Table1Umid',
  1564. // tableId: "301003Table1",
  1565. // tableName: "物料属性设置表",
  1566. // columnProp: 'umid',
  1567. // headerAlign: "center",
  1568. // align: "left",
  1569. // columnLabel: '单位',
  1570. // columnHidden: false,
  1571. // columnImage: false,
  1572. // columnSortable: false,
  1573. // sortLv: 0,
  1574. // status: true,
  1575. // fixed: '',
  1576. // columnWidth: 100,
  1577. // },
  1578. {
  1579. userId: this.$store.state.user.name,
  1580. functionId: 301003,
  1581. serialNumber: '301003Table1ExemptInspection',
  1582. tableId: "301003Table1",
  1583. tableName: "物料属性设置表",
  1584. columnProp: 'exemptInspection',
  1585. headerAlign: "center",
  1586. align: "center",
  1587. columnLabel: '是否免检',
  1588. columnHidden: false,
  1589. columnImage: false,
  1590. columnSortable: false,
  1591. sortLv: 0,
  1592. status: true,
  1593. fixed: '',
  1594. columnWidth: 100,
  1595. },
  1596. {
  1597. userId: this.$store.state.user.name,
  1598. functionId: 301003,
  1599. serialNumber: '301003Table1AttributeRemark',
  1600. tableId: "301003Table1",
  1601. tableName: "物料属性设置表",
  1602. columnProp: 'attributeRemark',
  1603. headerAlign: "center",
  1604. align: "left",
  1605. columnLabel: '备注',
  1606. columnHidden: false,
  1607. columnImage: false,
  1608. columnSortable: false,
  1609. sortLv: 0,
  1610. status: true,
  1611. fixed: '',
  1612. columnWidth: 200,
  1613. },
  1614. {
  1615. userId: this.$store.state.user.name,
  1616. functionId: 301003,
  1617. serialNumber: '301003Table1CreateTime',
  1618. tableId: "301003Table1",
  1619. tableName: "物料属性设置表",
  1620. columnProp: 'createTime',
  1621. headerAlign: "center",
  1622. align: "center",
  1623. columnLabel: '创建时间',
  1624. columnHidden: false,
  1625. columnImage: false,
  1626. columnSortable: false,
  1627. sortLv: 0,
  1628. status: true,
  1629. fixed: '',
  1630. columnWidth: 170,
  1631. },
  1632. {
  1633. userId: this.$store.state.user.name,
  1634. functionId: 301003,
  1635. serialNumber: '301003Table1CreateBy',
  1636. tableId: "301003Table1",
  1637. tableName: "物料属性设置表",
  1638. columnProp: 'createBy',
  1639. headerAlign: "center",
  1640. align: "center",
  1641. columnLabel: '创建人',
  1642. columnHidden: false,
  1643. columnImage: false,
  1644. columnSortable: false,
  1645. sortLv: 0,
  1646. status: true,
  1647. fixed: '',
  1648. columnWidth: 100,
  1649. },
  1650. {
  1651. userId: this.$store.state.user.name,
  1652. functionId: 301003,
  1653. serialNumber: '301003Table1UpdateDate',
  1654. tableId: "301003Table1",
  1655. tableName: "物料属性设置表",
  1656. columnProp: 'updateDate',
  1657. headerAlign: "center",
  1658. align: "center",
  1659. columnLabel: '更新时间',
  1660. columnHidden: false,
  1661. columnImage: false,
  1662. columnSortable: false,
  1663. sortLv: 0,
  1664. status: true,
  1665. fixed: '',
  1666. columnWidth: 170,
  1667. },
  1668. {
  1669. userId: this.$store.state.user.name,
  1670. functionId: 301003,
  1671. serialNumber: '301003Table1UpdateBy',
  1672. tableId: "301003Table1",
  1673. tableName: "物料属性设置表",
  1674. columnProp: 'updateBy',
  1675. headerAlign: "center",
  1676. align: "center",
  1677. columnLabel: '更新人',
  1678. columnHidden: false,
  1679. columnImage: false,
  1680. columnSortable: false,
  1681. sortLv: 0,
  1682. status: true,
  1683. fixed: '',
  1684. columnWidth: 100,
  1685. },
  1686. ],
  1687. detailModelFlag: false,
  1688. detailList: [],
  1689. dataList: [],
  1690. dataListLoading: false,
  1691. ipqcInspectionMethodOptions: ['首件检', '自检', '巡检', '末件检'],
  1692. iqcInspectionMethodOptions: ['材料进货检验', '刀模进货检验-外观', '刀模进货检验-上机', '刀模维修检验-外观', '刀模维修检验-上机'],
  1693. // 展示列集
  1694. columnDetailList: [
  1695. {
  1696. userId: this.$store.state.user.name,
  1697. functionId: 301003,
  1698. serialNumber: '301003Table2TemplateId',
  1699. tableId: "301003Table2",
  1700. tableName: "检验模板清单表",
  1701. columnProp: 'templateId',
  1702. headerAlign: "center",
  1703. align: "center",
  1704. columnLabel: '模板编码',
  1705. columnHidden: false,
  1706. columnImage: false,
  1707. columnSortable: false,
  1708. sortLv: 0,
  1709. status: true,
  1710. fixed: '',
  1711. columnWidth: 120,
  1712. },
  1713. {
  1714. userId: this.$store.state.user.name,
  1715. functionId: 301003,
  1716. serialNumber: '301003Table2TemplateName',
  1717. tableId: "301003Table2",
  1718. tableName: "检验模板清单表",
  1719. columnProp: 'templateName',
  1720. headerAlign: "center",
  1721. align: "left",
  1722. columnLabel: '模板名称',
  1723. columnHidden: false,
  1724. columnImage: false,
  1725. columnSortable: false,
  1726. sortLv: 0,
  1727. status: true,
  1728. fixed: '',
  1729. columnWidth: 250,
  1730. },
  1731. {
  1732. userId: this.$store.state.user.name,
  1733. functionId: 301003,
  1734. serialNumber: '301003Table2InspectionTypeName',
  1735. tableId: "301003Table2",
  1736. tableName: "检验模板清单表",
  1737. columnProp: 'inspectionTypeName',
  1738. headerAlign: "center",
  1739. align: "center",
  1740. columnLabel: '检验类型',
  1741. columnHidden: false,
  1742. columnImage: false,
  1743. columnSortable: false,
  1744. sortLv: 0,
  1745. status: true,
  1746. fixed: '',
  1747. columnWidth: 100,
  1748. },
  1749. {
  1750. userId: this.$store.state.user.name,
  1751. functionId: 301003,
  1752. serialNumber: '301003Table2TemplateVersion',
  1753. tableId: "301003Table2",
  1754. tableName: "检验模板清单表",
  1755. columnProp: 'templateVersion',
  1756. headerAlign: "center",
  1757. align: "center",
  1758. columnLabel: '版本号',
  1759. columnHidden: false,
  1760. columnImage: false,
  1761. columnSortable: false,
  1762. sortLv: 0,
  1763. status: true,
  1764. fixed: '',
  1765. columnWidth: 100,
  1766. },
  1767. {
  1768. userId: this.$store.state.user.name,
  1769. functionId: 301003,
  1770. serialNumber: '301003Table2DefaultSamplingQuantity',
  1771. tableId: "301003Table2",
  1772. tableName: "检验模板清单表",
  1773. columnProp: 'defaultSamplingQuantity',
  1774. headerAlign: "center",
  1775. align: "right",
  1776. columnLabel: '默认抽样数量',
  1777. columnHidden: false,
  1778. columnImage: false,
  1779. columnSortable: false,
  1780. sortLv: 0,
  1781. status: true,
  1782. fixed: '',
  1783. columnWidth: 100,
  1784. },
  1785. {
  1786. userId: this.$store.state.user.name,
  1787. functionId: 301003,
  1788. serialNumber: '301003Table2DefaultSamplingProportion',
  1789. tableId: "301003Table2",
  1790. tableName: "检验模板清单表",
  1791. columnProp: 'defaultSamplingProportion',
  1792. headerAlign: "center",
  1793. align: "right",
  1794. columnLabel: '默认抽样比例',
  1795. columnHidden: false,
  1796. columnImage: false,
  1797. columnSortable: false,
  1798. sortLv: 0,
  1799. status: true,
  1800. fixed: '',
  1801. columnWidth: 100,
  1802. },
  1803. {
  1804. userId: this.$store.state.user.name,
  1805. functionId: 301003,
  1806. serialNumber: '301003Table2Operation',
  1807. tableId: "301003Table2",
  1808. tableName: "检验模板清单表",
  1809. columnProp: 'operation',
  1810. headerAlign: "center",
  1811. align: "left",
  1812. columnLabel: '工序',
  1813. columnHidden: false,
  1814. columnImage: false,
  1815. columnSortable: false,
  1816. sortLv: 0,
  1817. status: true,
  1818. fixed: '',
  1819. columnWidth: 120,
  1820. },
  1821. {
  1822. userId: this.$store.state.user.name,
  1823. functionId: 301003,
  1824. serialNumber: '301003Table2ResourceID',
  1825. tableId: "301003Table2",
  1826. tableName: "检验模板清单表",
  1827. columnProp: 'resourceID',
  1828. headerAlign: "center",
  1829. align: "left",
  1830. columnLabel: '机台',
  1831. columnHidden: false,
  1832. columnImage: false,
  1833. columnSortable: false,
  1834. sortLv: 0,
  1835. status: true,
  1836. fixed: '',
  1837. columnWidth: 120,
  1838. },
  1839. {
  1840. userId: this.$store.state.user.name,
  1841. functionId: 301003,
  1842. serialNumber: '301003Table2ManufacturerName',
  1843. tableId: "301003Table2",
  1844. tableName: "检验模板清单表",
  1845. columnProp: 'manufacturerName',
  1846. headerAlign: "center",
  1847. align: "left",
  1848. columnLabel: '供应商',
  1849. columnHidden: false,
  1850. columnImage: false,
  1851. columnSortable: false,
  1852. sortLv: 0,
  1853. status: true,
  1854. fixed: '',
  1855. columnWidth: 200,
  1856. },
  1857. {
  1858. userId: this.$store.state.user.name,
  1859. functionId: 301003,
  1860. serialNumber: '301003Table2CustomerName',
  1861. tableId: "301003Table2",
  1862. tableName: "检验模板清单表",
  1863. columnProp: 'customerName',
  1864. headerAlign: "center",
  1865. align: "left",
  1866. columnLabel: '客户',
  1867. columnHidden: false,
  1868. columnImage: false,
  1869. columnSortable: false,
  1870. sortLv: 0,
  1871. status: true,
  1872. fixed: '',
  1873. columnWidth: 200,
  1874. },
  1875. ],
  1876. // 快速添加
  1877. fastAddFlag: false,
  1878. itemList1: [],
  1879. itemList2: [],
  1880. itemList1Loading: false,
  1881. itemList2Loading: false,
  1882. addItemLoading: false,
  1883. deleteItemLoading: false,
  1884. itemListRow1: {},
  1885. itemListRow2: {},
  1886. tempLevelRow: '',
  1887. tempProgrammeRow: '',
  1888. options: [],
  1889. siteList: [],
  1890. itemSelections1: [],
  1891. itemSelections2: [],
  1892. rules: {
  1893. site:[
  1894. {
  1895. required: true,
  1896. message: ' ',
  1897. trigger: ['blur','change']
  1898. }
  1899. ],
  1900. partNoType:[
  1901. {
  1902. required: true,
  1903. message: ' ',
  1904. trigger: ['blur','change']
  1905. }
  1906. ],
  1907. partDescType:[
  1908. {
  1909. required: true,
  1910. message: ' ',
  1911. trigger: ['blur','change']
  1912. }
  1913. ],
  1914. bu: [
  1915. {
  1916. required: true,
  1917. message: ' ',
  1918. trigger: ['blur','change']
  1919. }
  1920. ]
  1921. },
  1922. // 工序
  1923. operationList: [],
  1924. resourceList: [],
  1925. operationModelFlag: false,
  1926. resourceModelFlag: false,
  1927. dataListOperationSelections: [],
  1928. operationData: {
  1929. operationDesc: '',
  1930. inspectionTypeNo: ''
  1931. },
  1932. resourceData: {
  1933. site: '',
  1934. resourceId: '',
  1935. resourceDesc: ''
  1936. },
  1937. operation: '',
  1938. resourceId: '',
  1939. selectionManufacturer: [],
  1940. selectionManufacturer2: [],
  1941. selectionCustomer: [],
  1942. selectionCustomer2: [],
  1943. span1: 12,
  1944. span2: 12,
  1945. span3: 12,
  1946. operationSelections: [],
  1947. resourceSelections: [],
  1948. // 供应商
  1949. manufacturerList: [],
  1950. manufacturerModelFlag: false,
  1951. dataListManufacturerSelections: [],
  1952. manufacturerData: {
  1953. site: '',
  1954. manufacturerID: '',
  1955. manufacturerName: ''
  1956. },
  1957. customerData: {
  1958. site: '',
  1959. customerID: '',
  1960. customerName: ''
  1961. },
  1962. customerModelFlag: false,
  1963. customerList: [],
  1964. dataListCustomerSelections: [],
  1965. // 单选框绑定的值
  1966. operationCurrent: -1,
  1967. resourceCurrent: -1,
  1968. sopData: {
  1969. site: '',
  1970. buNo: '',
  1971. partNo: '',
  1972. inspectionTypeNo: '',
  1973. inspectionTypeName: ''
  1974. },
  1975. sopList: [],
  1976. sopFileModelFlag: false,
  1977. sopColumnList: [
  1978. {
  1979. columnProp: 'fileName',
  1980. headerAlign: "center",
  1981. align: "center",
  1982. columnLabel: '文件名称',
  1983. columnHidden: false,
  1984. columnImage: false,
  1985. columnSortable: false,
  1986. sortLv: 0,
  1987. status: true,
  1988. fixed: '',
  1989. },
  1990. {
  1991. columnProp: 'createdBy',
  1992. headerAlign: "center",
  1993. align: 'center',
  1994. columnLabel: '上传人',
  1995. columnHidden: false,
  1996. columnImage: false,
  1997. columnSortable: true,
  1998. sortLv: 0,
  1999. status: true,
  2000. fixed: false
  2001. },
  2002. {
  2003. columnProp: 'createDate',
  2004. headerAlign: "center",
  2005. align: 'center',
  2006. columnLabel: '上传时间',
  2007. columnHidden: false,
  2008. columnImage: false,
  2009. columnSortable: true,
  2010. sortLv: 0,
  2011. status: true,
  2012. fixed: false
  2013. },
  2014. {
  2015. columnProp: 'orderRef3',
  2016. headerAlign: "center",
  2017. align: 'center',
  2018. columnLabel: '检验类型',
  2019. columnHidden: false,
  2020. columnImage: false,
  2021. columnSortable: true,
  2022. sortLv: 0,
  2023. status: true,
  2024. fixed: false
  2025. },
  2026. ],
  2027. userBuList: [],
  2028. partInfoList: [],
  2029. partDetailData: {
  2030. bu: '',
  2031. partNo: '',
  2032. partDesc: '',
  2033. seqNo: '',
  2034. sku: '',
  2035. spec:'',
  2036. cinvSourceCode:'',
  2037. },
  2038. authSearch: false,
  2039. authSave: false,
  2040. authUpdate: false,
  2041. authDelete: false,
  2042. authDetail: false,
  2043. authCheckout: false,
  2044. authFile: false,
  2045. menuId: this.$route.meta.menuId,
  2046. }
  2047. },
  2048. computed: {
  2049. maintainStatusOptions () {
  2050. return [
  2051. { label: '已维护', value: '已维护' },
  2052. { label: '未维护', value: '未维护' }
  2053. ]
  2054. },
  2055. detailColumnsBeforeIpqc () {
  2056. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  2057. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  2058. if (idx === -1) return list
  2059. return list.slice(0, idx + 1)
  2060. },
  2061. detailColumnsAfterIpqc () {
  2062. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  2063. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  2064. if (idx === -1) return []
  2065. return list.slice(idx + 1)
  2066. }
  2067. },
  2068. mounted () {
  2069. this.$nextTick(() => {
  2070. this.height = window.innerHeight - 180
  2071. })
  2072. },
  2073. created () {
  2074. // 按钮控制
  2075. this.getButtonAuthData()
  2076. // 获取用户的 site 和 bu
  2077. // this.getSiteAndBuByUserName()
  2078. // 校验用户是否收藏
  2079. // this.favoriteIsOk()
  2080. // 先加载工厂,再按默认 site 查询检验类型
  2081. this.loadSiteList()
  2082. // 动态列
  2083. // this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2084. // this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  2085. if (!this.authSearch) {
  2086. // 获取数据列表
  2087. this.getDataList()
  2088. }
  2089. },
  2090. methods: {
  2091. isMaintained (val) {
  2092. return val === '已维护'
  2093. },
  2094. // 获取用户的bu
  2095. getSiteAndBuByUserName () {
  2096. let tempData = {
  2097. username: this.$store.state.user.name,
  2098. }
  2099. getSiteAndBuByUserName(tempData).then(({data}) => {
  2100. if (data.code === 0) {
  2101. this.userBuList = data.rows
  2102. }
  2103. })
  2104. },
  2105. searchPartInfo () {
  2106. this.partDetailData.site = this.modalData.site
  2107. if (!this.partDetailData.partNo && !this.partDetailData.partDesc && !this.partDetailData.spec && !this.partDetailData.cinvSourceCode) {
  2108. this.partInfoList = []
  2109. this.partDisableFlag = true
  2110. }else {
  2111. searchPartInfo(this.partDetailData).then(({data}) => {
  2112. if (data.code === 0) {
  2113. this.partInfoList = data.rows
  2114. this.partDisableFlag = true
  2115. } else {
  2116. this.$alert(data.msg, '错误', {
  2117. confirmButtonText: '确定'
  2118. })
  2119. }
  2120. })
  2121. }
  2122. },
  2123. // 查询检验类型(必须带 site,否则查不到)
  2124. inspectionTypeSearch () {
  2125. const site = this.detailData.site || this.modalData.site || this.getDefaultSite()
  2126. if (!site) {
  2127. this.options = []
  2128. return Promise.resolve()
  2129. }
  2130. return inspectionTypeSearch({ site }).then(({data}) => {
  2131. if (data.code === 0) {
  2132. this.options = data.rows || []
  2133. }
  2134. })
  2135. },
  2136. loadSiteList () {
  2137. getSiteData({ userID: this.$store.state.user.name }).then(({data}) => {
  2138. this.siteList = (data && data.rows) ? data.rows : []
  2139. this.inspectionTypeSearch()
  2140. })
  2141. },
  2142. getDefaultSite () {
  2143. return (this.siteList && this.siteList.length) ? this.siteList[0].siteID : ''
  2144. },
  2145. onModalSiteChange () {
  2146. this.modalData.partNo = ''
  2147. this.modalData.partDesc = ''
  2148. this.modalData.familyID = ''
  2149. this.modalData.familyName = ''
  2150. this.modalData.cinvSourceCode = ''
  2151. this.modalData.sku = ''
  2152. this.modalData.umid = ''
  2153. },
  2154. isIPQCInspectionType (row) {
  2155. const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
  2156. const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
  2157. return name.toUpperCase().includes('IPQC') || no.toUpperCase().includes('IPQC') || no === '101'
  2158. },
  2159. isIQCInspectionType (row) {
  2160. const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
  2161. const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
  2162. return name.toUpperCase().includes('IQC') || no.toUpperCase().includes('IQC') || no === '105'
  2163. },
  2164. isInspectionMethodApplicable (row) {
  2165. return this.isIPQCInspectionType(row) || this.isIQCInspectionType(row)
  2166. },
  2167. getInspectionMethodOptions (row) {
  2168. if (this.isIQCInspectionType(row)) {
  2169. return this.iqcInspectionMethodOptions
  2170. }
  2171. return this.ipqcInspectionMethodOptions
  2172. },
  2173. normalizeIpqcInspectionMethod (row) {
  2174. if (!row) return
  2175. if (this.isIPQCInspectionType(row)) {
  2176. if (row.ipqcInspectionMethod && this.ipqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
  2177. this.$set(row, 'ipqcInspectionMethod', '')
  2178. }
  2179. } else if (this.isIQCInspectionType(row)) {
  2180. if (row.ipqcInspectionMethod && this.iqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
  2181. this.$set(row, 'ipqcInspectionMethod', '')
  2182. }
  2183. } else {
  2184. if (row.ipqcInspectionMethod) {
  2185. this.$set(row, 'ipqcInspectionMethod', '')
  2186. }
  2187. }
  2188. },
  2189. normalizeDetailListIpqcInspectionMethod () {
  2190. if (!Array.isArray(this.detailList)) return
  2191. this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r))
  2192. },
  2193. chooseLevel (row) {
  2194. this.tempLevelRow = row
  2195. this.getBaseList(208)
  2196. },
  2197. chooseProgrammeRow (row) {
  2198. this.tempProgrammeRow = row
  2199. this.getBaseList(207)
  2200. },
  2201. // 获取基础数据列表S
  2202. getBaseList (val,type) {
  2203. this.tagNo = val
  2204. this.$nextTick(() => {
  2205. let strVal = ''
  2206. // if (val === 507) {
  2207. // strVal = this.modalData.partNo
  2208. // this.$refs.baseList.init(val, strVal)
  2209. // }
  2210. if (val === 208) {
  2211. strVal = this.tempLevelRow.samplingLevelNo
  2212. this.$refs.baseList.init(val, strVal)
  2213. }
  2214. if (val === 207) {
  2215. strVal = this.tempProgrammeRow.samplingProgrammeNo
  2216. this.$refs.baseList.init(val, strVal)
  2217. }
  2218. if (val === 1056) {
  2219. strVal = this.modalData.supplierNo
  2220. this.$refs.baseList.init(val, strVal)
  2221. }
  2222. })
  2223. },
  2224. // 列表方法的回调
  2225. getBaseData (val) {
  2226. if (this.tagNo === 507) {
  2227. this.modalData.partNo = val.part_no
  2228. this.modalData.partDesc = val.part_desc
  2229. }
  2230. if (this.tagNo === 208) {
  2231. this.tempLevelRow.samplingLevelNo = val.sampling_level_no
  2232. this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
  2233. }
  2234. if (this.tagNo === 207) {
  2235. this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no
  2236. this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc
  2237. }
  2238. if (this.tagNo === 1056) {
  2239. this.modalData.supplierNo = val.supplier_id
  2240. this.modalData.supplierDesc = val.supplier_name
  2241. }
  2242. },
  2243. // 获取数据列表
  2244. getDataList () {
  2245. this.searchData.limit = this.pageSize
  2246. this.searchData.page = this.pageIndex
  2247. qcPartAttributeSearch(this.searchData).then(({data}) => {
  2248. if (data.code === 0) {
  2249. this.dataList = data.page.list
  2250. this.pageIndex = data.page.currPage
  2251. this.pageSize = data.page.pageSize
  2252. this.totalPage = data.page.totalCount
  2253. }
  2254. })
  2255. },
  2256. patrolInspection (row) {
  2257. this.patrolContextRow = {
  2258. site: row.site,
  2259. buNo: row.buNo,
  2260. partNo: row.partNo
  2261. }
  2262. this.patrolConfigDialogFlag = true
  2263. this.getPatrolConfigList()
  2264. this.loadPatrolOperationDescList()
  2265. },
  2266. loadPatrolOperationDescList () {
  2267. const params = {
  2268. site: this.patrolContextRow.site,
  2269. userName: this.$store.state.user.name
  2270. }
  2271. getPatrolOperationDescListApi(params).then(({ data }) => {
  2272. if (data && data.code === 0) {
  2273. this.operationDescList = data.rows || []
  2274. }
  2275. })
  2276. },
  2277. getPatrolConfigList () {
  2278. this.patrolConfigLoading = true
  2279. const params = {
  2280. site: this.patrolContextRow.site,
  2281. buNo: this.patrolContextRow.buNo,
  2282. partNo: this.patrolContextRow.partNo
  2283. }
  2284. fetchPatrolConfigListApi(params).then(({ data }) => {
  2285. if (data && data.code === 0) {
  2286. this.patrolConfigList = data.rows || []
  2287. } else {
  2288. this.$message.error((data && data.msg) || '获取巡检配置失败')
  2289. }
  2290. this.patrolConfigLoading = false
  2291. }).catch(() => {
  2292. this.patrolConfigLoading = false
  2293. })
  2294. },
  2295. patrolConfigSelectionChange (selections) {
  2296. this.patrolConfigSelections = selections
  2297. },
  2298. addPatrolConfig () {
  2299. this.patrolConfigList.push({
  2300. site: this.patrolContextRow.site,
  2301. buNo: this.patrolContextRow.buNo,
  2302. partNo: this.patrolContextRow.partNo,
  2303. operationDesc: '',
  2304. firstInspectionDuration: 0,
  2305. nextInspectionDuration: 0,
  2306. totalInspectionDuration: 0,
  2307. defaultFlag: 'N',
  2308. isNew: true
  2309. })
  2310. },
  2311. savePatrolConfigRow (row) {
  2312. if (!row.operationDesc) {
  2313. this.$message.warning('请输入工序')
  2314. return
  2315. }
  2316. const params = {
  2317. site: row.site,
  2318. buNo: row.buNo,
  2319. partNo: row.partNo,
  2320. operationDesc: row.operationDesc,
  2321. firstInspectionDuration: row.firstInspectionDuration,
  2322. nextInspectionDuration: row.nextInspectionDuration,
  2323. totalInspectionDuration: row.totalInspectionDuration,
  2324. defaultFlag: row.defaultFlag
  2325. }
  2326. if (row.isNew) {
  2327. savePatrolConfigApi(params).then(({ data }) => {
  2328. if (data && data.code === 0) {
  2329. this.$message.success('保存成功')
  2330. this.getPatrolConfigList()
  2331. } else {
  2332. this.$message.error((data && data.msg) || '保存失败')
  2333. }
  2334. })
  2335. } else {
  2336. updatePatrolConfigApi(params).then(({ data }) => {
  2337. if (data && data.code === 0) {
  2338. this.$message.success('更新成功')
  2339. this.getPatrolConfigList()
  2340. } else {
  2341. this.$message.error((data && data.msg) || '更新失败')
  2342. }
  2343. })
  2344. }
  2345. },
  2346. deletePatrolConfigRows () {
  2347. if (this.patrolConfigSelections.length === 0) {
  2348. this.$message.warning('请选择要删除的数据')
  2349. return
  2350. }
  2351. this.$confirm('确定删除选中的配置吗?', '提示', {
  2352. confirmButtonText: '确定',
  2353. cancelButtonText: '取消',
  2354. type: 'warning'
  2355. }).then(() => {
  2356. const deleteList = this.patrolConfigSelections.filter(item => !item.isNew)
  2357. if (deleteList.length === 0) {
  2358. this.patrolConfigSelections.forEach(item => {
  2359. const index = this.patrolConfigList.indexOf(item)
  2360. if (index > -1) {
  2361. this.patrolConfigList.splice(index, 1)
  2362. }
  2363. })
  2364. this.patrolConfigSelections = []
  2365. return
  2366. }
  2367. const params = {
  2368. list: deleteList.map(item => ({
  2369. site: item.site,
  2370. buNo: item.buNo,
  2371. partNo: item.partNo,
  2372. operationDesc: item.operationDesc
  2373. }))
  2374. }
  2375. deletePatrolConfigApi(params).then(({ data }) => {
  2376. if (data && data.code === 0) {
  2377. this.$message.success('删除成功')
  2378. this.getPatrolConfigList()
  2379. } else {
  2380. this.$message.error((data && data.msg) || '删除失败')
  2381. }
  2382. })
  2383. }).catch(() => {})
  2384. },
  2385. handleDefaultFlagChange (row) {
  2386. if (row.defaultFlag === 'Y') {
  2387. this.patrolConfigList.forEach(item => {
  2388. if (item !== row) {
  2389. item.defaultFlag = 'N'
  2390. }
  2391. })
  2392. }
  2393. },
  2394. batchSavePatrolConfig () {
  2395. if (this.patrolConfigList.length === 0) {
  2396. this.$message.warning('没有需要保存的数据')
  2397. return
  2398. }
  2399. for (let i = 0; i < this.patrolConfigList.length; i++) {
  2400. const item = this.patrolConfigList[i]
  2401. if (!item.operationDesc) {
  2402. this.$message.warning(`第${i + 1}行工序不能为空`)
  2403. return
  2404. }
  2405. }
  2406. this.patrolConfigSaveLoading = true
  2407. let successCount = 0
  2408. let errorCount = 0
  2409. const promises = this.patrolConfigList.map(row => {
  2410. const params = {
  2411. site: row.site,
  2412. buNo: row.buNo,
  2413. partNo: row.partNo,
  2414. operationDesc: row.operationDesc,
  2415. firstInspectionDuration: row.firstInspectionDuration,
  2416. nextInspectionDuration: row.nextInspectionDuration,
  2417. totalInspectionDuration: row.totalInspectionDuration,
  2418. defaultFlag: row.defaultFlag || 'N'
  2419. }
  2420. if (row.isNew) {
  2421. return savePatrolConfigApi(params).then(({ data }) => {
  2422. if (data && data.code === 0) {
  2423. successCount++
  2424. row.isNew = false
  2425. } else {
  2426. errorCount++
  2427. }
  2428. }).catch(() => {
  2429. errorCount++
  2430. })
  2431. } else {
  2432. return updatePatrolConfigApi(params).then(({ data }) => {
  2433. if (data && data.code === 0) {
  2434. successCount++
  2435. } else {
  2436. errorCount++
  2437. }
  2438. }).catch(() => {
  2439. errorCount++
  2440. })
  2441. }
  2442. })
  2443. Promise.all(promises).then(() => {
  2444. this.patrolConfigSaveLoading = false
  2445. if (errorCount === 0) {
  2446. this.$message.success('保存成功')
  2447. } else {
  2448. this.$message.warning(`保存完成,成功${successCount}条,失败${errorCount}条`)
  2449. }
  2450. this.getPatrolConfigList()
  2451. })
  2452. },
  2453. openPatrolConfigImport () {
  2454. const params = {
  2455. site: this.patrolContextRow.site,
  2456. buNo: this.patrolContextRow.buNo,
  2457. partNo: this.patrolContextRow.partNo
  2458. }
  2459. this.$refs.patrolConfigUpload.init(params)
  2460. },
  2461. getRowData1 (row) {
  2462. this.modalData.sku = row.sku
  2463. this.modalData.cinvSourceCode = row.cinvSourceCode
  2464. this.modalData.partNo = row.partNo
  2465. this.modalData.partDesc = row.partDesc
  2466. this.partDisableFlag = false
  2467. },
  2468. // 每页数
  2469. sizeChangeHandle (val) {
  2470. this.pageSize = val
  2471. this.pageIndex = 1
  2472. this.getDataList()
  2473. },
  2474. // 当前页
  2475. currentChangeHandle (val) {
  2476. this.pageIndex = val
  2477. this.getDataList()
  2478. },
  2479. addModal () {
  2480. this.modalData = {
  2481. site: this.getDefaultSite(),
  2482. buNo: '*',
  2483. // bu: this.userBuList[0].buNo,
  2484. flag: '1',
  2485. partNo: '',
  2486. partDesc: '',
  2487. familyID: '',
  2488. familyName: '',
  2489. umid: '',
  2490. supplierNo: '',
  2491. supplierDesc: '',
  2492. attributeRemark: '',
  2493. createTime: '',
  2494. updateBy: this.$store.state.user.name,
  2495. createBy: this.$store.state.user.name,
  2496. attributeType: 'A',
  2497. defaultValue: '',
  2498. standardValue: '',
  2499. maxValue: '',
  2500. minValue: '',
  2501. firstIPQCPatrolTime: '',
  2502. lastIPQCPatrolTime: '',
  2503. cycleIPQCPatrolTime: '',
  2504. exemptInspection: 'N',
  2505. iqcExempt: 'N',
  2506. faiExempt: 'N',
  2507. ipqcExempt: 'N',
  2508. pqcExempt: 'N',
  2509. fqcExempt: 'N',
  2510. oqcExempt: 'N',
  2511. sqcExempt: 'N'
  2512. }
  2513. this.modalDisableFlag = false
  2514. this.modalFlag = true
  2515. },
  2516. updateModal (row) {
  2517. this.modalData = {
  2518. site: row.site,
  2519. bu: row.site + '_' + row.buNo,
  2520. flag: '2',
  2521. partNo: row.partNo,
  2522. partDesc: row.partDesc,
  2523. familyID: row.familyID,
  2524. familyName: row.familyName,
  2525. umid: row.umid,
  2526. supplierNo: row.supplierNo,
  2527. supplierDesc: row.supplierDesc,
  2528. attributeRemark: row.attributeRemark,
  2529. updateBy: this.$store.state.user.name,
  2530. createBy: this.$store.state.user.name,
  2531. attributeType: 'A',
  2532. defaultValue: row.defaultValue,
  2533. standardValue: row.standardValue,
  2534. maxValue: row.maxValue,
  2535. minValue: row.minValue,
  2536. firstIPQCPatrolTime: row.firstIPQCPatrolTime,
  2537. lastIPQCPatrolTime: row.lastIPQCPatrolTime,
  2538. cycleIPQCPatrolTime: row.cycleIPQCPatrolTime,
  2539. exemptInspection: row.exemptInspection || 'N',
  2540. iqcExempt: row.iqcExempt || 'N',
  2541. faiExempt: row.faiExempt || 'N',
  2542. ipqcExempt: row.ipqcExempt || 'N',
  2543. pqcExempt: row.pqcExempt || 'N',
  2544. fqcExempt: row.fqcExempt || 'N',
  2545. oqcExempt: row.oqcExempt || 'N',
  2546. sqcExempt: row.sqcExempt || 'N'
  2547. }
  2548. this.modalDisableFlag = true
  2549. this.modalFlag = true
  2550. },
  2551. // 删除
  2552. deletePropertiesModel (row) {
  2553. this.$confirm(`是否删除这个检验模板?`, '提示', {
  2554. confirmButtonText: '确定',
  2555. cancelButtonText: '取消',
  2556. type: 'warning'
  2557. }).then(() => {
  2558. qcPartAttributeDelete(row).then(({data}) => {
  2559. if (data && data.code === 0) {
  2560. this.getDataList()
  2561. this.$message({
  2562. message: '操作成功',
  2563. type: 'success',
  2564. duration: 1500,
  2565. onClose: () => {}
  2566. })
  2567. } else {
  2568. this.$alert(data.msg, '错误', {
  2569. confirmButtonText: '确定'
  2570. })
  2571. }
  2572. })
  2573. }).catch(() => {
  2574. })
  2575. },
  2576. saveData () {
  2577. if (this.modalData.site === '' || this.modalData.site == null) {
  2578. this.$message.warning('请填写工厂编码!')
  2579. return
  2580. }
  2581. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2582. this.$message.warning('请选择物料编码!')
  2583. return
  2584. }
  2585. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  2586. this.$message.warning('请选择物料名称!')
  2587. return
  2588. }
  2589. // let obj = document.getElementsByName('isExemptInspection')
  2590. // let s = ''
  2591. // for (let i = 0; i < obj.length; i++) {
  2592. // if (obj[i].checked) {
  2593. // s += obj[i].value + ','
  2594. // }
  2595. // }
  2596. // s = s.substring(0, s.length - 1)
  2597. // this.modalData.exemptInspection = s
  2598. if (this.modalData.flag === '1') {
  2599. qcPartAttributeSave(this.modalData).then(({data}) => {
  2600. if (data && data.code === 0) {
  2601. this.getDataList()
  2602. this.modalFlag = false
  2603. this.$message({
  2604. message: '操作成功',
  2605. type: 'success',
  2606. duration: 1500,
  2607. onClose: () => {}
  2608. })
  2609. } else {
  2610. this.$alert(data.msg, '错误', {
  2611. confirmButtonText: '确定'
  2612. })
  2613. }
  2614. })
  2615. } else {
  2616. qcPartAttributeEdit(this.modalData).then(({data}) => {
  2617. if (data && data.code === 0) {
  2618. this.getDataList()
  2619. this.modalFlag = false
  2620. this.$message({
  2621. message: '操作成功',
  2622. type: 'success',
  2623. duration: 1500,
  2624. onClose: () => {}
  2625. })
  2626. } else {
  2627. this.$alert(data.msg, '错误', {
  2628. confirmButtonText: '确定'
  2629. })
  2630. }
  2631. })
  2632. }
  2633. },
  2634. // 保存属性模板
  2635. saveDetail () {
  2636. // IPQC / IQC 的检验方式必填
  2637. this.normalizeDetailListIpqcInspectionMethod()
  2638. const missingMethod = (this.detailList || []).find(r => this.isInspectionMethodApplicable(r) && !r.ipqcInspectionMethod)
  2639. if (missingMethod) {
  2640. this.$message.warning('检验类型为IPQC或IQC时,“检验方式”为必填!')
  2641. return
  2642. }
  2643. for (let i = 0; i < this.detailList.length; i++) {
  2644. this.detailList[i].updateBy = this.$store.state.user.name
  2645. saveAttributeDetailed(this.detailList[i]).then(({data}) => {
  2646. if (data && data.code === 0) {
  2647. this.getDataList()
  2648. this.detailModelFlag = false
  2649. this.$message({
  2650. message: '操作成功',
  2651. type: 'success',
  2652. duration: 1500,
  2653. onClose: () => {}
  2654. })
  2655. } else {
  2656. this.$alert(data.msg, '错误', {
  2657. confirmButtonText: '确定'
  2658. }).then(() => {
  2659. return false
  2660. })
  2661. }
  2662. })
  2663. }
  2664. },
  2665. // 打开物料模板清单
  2666. detailModal (row) {
  2667. this.detailData.site = row.site
  2668. this.detailData.buNo = row.buNo
  2669. this.detailData.partNo = row.partNo
  2670. this.detailData.attributeNo = row.partNo
  2671. this.detailData.partDesc = row.partDesc
  2672. this.$set(this.detailData, 'inspectionTypeNo', '')
  2673. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2674. this.detailList = data.rows
  2675. this.normalizeDetailListIpqcInspectionMethod()
  2676. })
  2677. this.inspectionTypeSearch()
  2678. this.detailModelFlag = true
  2679. },
  2680. checkInspectionType () {
  2681. this.refreshTemplateLists()
  2682. if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') {
  2683. this.span1 = 12
  2684. this.span2 = 6
  2685. this.span3 = 6
  2686. } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') {
  2687. this.span1 = 12
  2688. this.span2 = 12
  2689. } else {
  2690. this.span1 = 24
  2691. }
  2692. },
  2693. checkInspectionType2 () {
  2694. this.refreshTemplateLists()
  2695. },
  2696. refreshTemplateLists () {
  2697. this.itemList1Loading = true
  2698. this.itemList2Loading = true
  2699. getPartTemplateLists(this.detailData).then(({data}) => {
  2700. if (data) {
  2701. this.itemList1 = data.row1 || []
  2702. this.itemList2 = data.row2 || []
  2703. }
  2704. }).catch(err => {
  2705. console.error('加载模板列表失败:', err)
  2706. }).finally(() => {
  2707. this.itemList1Loading = false
  2708. this.itemList2Loading = false
  2709. })
  2710. },
  2711. // 快速新增(与 boying-vue 一致)
  2712. addFastModal () {
  2713. if (!this.detailData.partNo || !this.detailData.site) {
  2714. this.$message.warning('请先选择要设置模板的物料!')
  2715. return
  2716. }
  2717. const openFastAdd = () => {
  2718. if (!this.options || this.options.length === 0) {
  2719. this.$message.warning('未查询到检验类型,请检查该工厂是否已维护检验类型')
  2720. return
  2721. }
  2722. this.openFastAddDialog()
  2723. }
  2724. if (this.options && this.options.length > 0) {
  2725. openFastAdd()
  2726. return
  2727. }
  2728. this.inspectionTypeSearch().then(openFastAdd)
  2729. },
  2730. openFastAddDialog () {
  2731. this.itemSelections1 = []
  2732. this.itemSelections2 = []
  2733. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2734. if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') {
  2735. this.span1 = 12
  2736. this.span2 = 6
  2737. this.span3 = 6
  2738. } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') {
  2739. this.span1 = 12
  2740. this.span2 = 12
  2741. } else {
  2742. this.span1 = 24
  2743. }
  2744. this.operationSelections = []
  2745. this.resourceSelections = []
  2746. this.dataListOperationSelections = []
  2747. this.operationData.operationDesc = ''
  2748. this.resourceData.resourceId = ''
  2749. this.resourceData.resourceDesc = ''
  2750. this.selectionManufacturer = []
  2751. this.selectionManufacturer2 = []
  2752. this.dataListManufacturerSelections = []
  2753. this.selectionCustomer = []
  2754. this.selectionCustomer2 = []
  2755. this.dataListCustomerSelections = []
  2756. this.fastAddFlag = true
  2757. this.$nextTick(() => {
  2758. this.refreshTemplateLists()
  2759. })
  2760. },
  2761. // 可选项目
  2762. itemClickRow1 (row) {
  2763. if (this.$refs.itemTable1) {
  2764. this.$refs.itemTable1.toggleRowSelection(row)
  2765. }
  2766. },
  2767. // 已有项目
  2768. itemClickRow2 (row) {
  2769. if (this.$refs.itemTable2) {
  2770. this.$refs.itemTable2.toggleRowSelection(row)
  2771. }
  2772. },
  2773. selectFlag () {
  2774. return true
  2775. },
  2776. selectionItem1 (val) {
  2777. this.itemSelections1 = val
  2778. },
  2779. selectionItem2 (val) {
  2780. this.itemSelections2 = val
  2781. },
  2782. // 添加模板
  2783. addItem () {
  2784. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  2785. this.$message.warning('请选择可选模板!')
  2786. return
  2787. }
  2788. if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107')) {
  2789. if (this.resourceSelections.length > 0 && this.operationSelections.length === 0) {
  2790. this.$message.warning('如果选择机台,必须要选择工序!')
  2791. return
  2792. }
  2793. }
  2794. this.addItemLoading = true
  2795. let inData = {
  2796. site: this.detailData.site,
  2797. buNo: this.detailData.buNo,
  2798. attributeNo: this.detailData.partNo,
  2799. itemList: this.itemSelections1,
  2800. operationList: this.operationSelections.map(item => item.operationDesc),
  2801. resourceIDList: this.resourceSelections.map(item => item.resourceId),
  2802. manufacturerList: this.selectionManufacturer || [],
  2803. customerList: this.selectionCustomer || [],
  2804. attributeType: this.detailData.attributeType || 'A',
  2805. inspectionTypeNo: this.detailData.inspectionTypeNo,
  2806. updateBy: this.$store.state.user.name
  2807. }
  2808. savePartAttributeDetails(inData).then(({data}) => {
  2809. if (data && data.code === 0) {
  2810. this.$message.success('添加成功!')
  2811. this.refreshTemplateLists()
  2812. this.itemSelections1 = []
  2813. this.operationSelections = []
  2814. this.resourceSelections = []
  2815. this.selectionManufacturer = []
  2816. this.selectionManufacturer2 = []
  2817. this.selectionCustomer = []
  2818. this.selectionCustomer2 = []
  2819. } else {
  2820. this.$message.error(data && data.msg ? data.msg : '添加失败')
  2821. }
  2822. }).catch(err => {
  2823. this.$message.error('添加失败:' + (err.message || '未知错误'))
  2824. }).finally(() => {
  2825. this.addItemLoading = false
  2826. })
  2827. },
  2828. // 删除模板
  2829. deleteItem () {
  2830. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  2831. this.$message.warning('请选择已有模板!')
  2832. return
  2833. }
  2834. this.deleteItemLoading = true
  2835. let inData = {
  2836. attributeNo: this.detailData.partNo,
  2837. itemList: this.itemSelections2,
  2838. attributeType: this.detailData.attributeType,
  2839. site: this.detailData.site,
  2840. buNo: this.detailData.buNo,
  2841. }
  2842. deletePartAttributeDetails(inData).then(({data}) => {
  2843. if (data && data.code === 0) {
  2844. this.$message.success('删除成功!')
  2845. this.refreshTemplateLists()
  2846. this.itemSelections2 = []
  2847. } else {
  2848. this.$message.error(data && data.msg ? data.msg : '删除失败')
  2849. }
  2850. }).catch(err => {
  2851. this.$message.error('删除失败:' + (err.message || '未知错误'))
  2852. }).finally(() => {
  2853. this.deleteItemLoading = false
  2854. })
  2855. },
  2856. // 关闭后刷新列表
  2857. refreshDetailList () {
  2858. this.$set(this.detailData, 'inspectionTypeNo', '')
  2859. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2860. this.detailList = data.rows
  2861. this.normalizeDetailListIpqcInspectionMethod()
  2862. })
  2863. },
  2864. syncStandardInspectionTypeName () {
  2865. const o = this.options.find(i => i.inspectionTypeNo === this.standardDetailData.inspectionTypeNo)
  2866. if (o) {
  2867. this.standardDetailData.inspectionTypeName = o.inspectionTypeName
  2868. }
  2869. },
  2870. standardDetailModal (row) {
  2871. this.standardDetailData.site = row.site
  2872. this.standardDetailData.buNo = row.buNo
  2873. this.standardDetailData.partNo = row.partNo
  2874. this.standardDetailData.partDesc = row.partDesc
  2875. this.standardDetailData.attributeNo = row.partNo
  2876. this.standardDetailData.attributeType = 'A'
  2877. this.standardDetailData.itemType = 'D'
  2878. if (this.options && this.options.length > 0) {
  2879. this.standardDetailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2880. this.standardDetailData.inspectionTypeName = this.options[0].inspectionTypeName
  2881. }
  2882. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2883. if (data.code === 0) {
  2884. this.standardDetailList = data.rows || []
  2885. }
  2886. })
  2887. this.standardDetailModelFlag = true
  2888. },
  2889. closeStandardDialog () {
  2890. this.standardDetailList = []
  2891. this.standardItemList1 = []
  2892. this.standardItemList2 = []
  2893. },
  2894. standardAddFastModal () {
  2895. this.syncStandardInspectionTypeName()
  2896. this.standardItemSelections1 = null
  2897. this.standardItemSelections2 = null
  2898. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2899. if (data.code === 0) {
  2900. this.standardItemList1 = data.row1 || []
  2901. this.standardItemList2 = data.row2 || []
  2902. }
  2903. })
  2904. this.standardFastAddFlag = true
  2905. },
  2906. standardSyncFromTemplate () {
  2907. const queryData = {
  2908. site: this.standardDetailData.site,
  2909. buNo: this.standardDetailData.buNo,
  2910. attributeNo: this.standardDetailData.attributeNo,
  2911. attributeType: 'A'
  2912. }
  2913. searchPartAttributeDetails(queryData).then(({data}) => {
  2914. const templates = (data.rows || []).filter(t => t.templateId)
  2915. if (templates.length === 0) {
  2916. this.$message.warning('没有已维护的检验模板,请先在检验模板清单中维护!')
  2917. return
  2918. }
  2919. const seen = new Set()
  2920. const uniqueTemplates = templates.filter(t => {
  2921. if (seen.has(t.templateId)) return false
  2922. seen.add(t.templateId)
  2923. return true
  2924. })
  2925. this.$confirm(`将根据全部检验类型下 ${uniqueTemplates.length} 个检验模板同步检验项目,已存在的项目将跳过,是否继续?`, '提示', {
  2926. confirmButtonText: '确定',
  2927. cancelButtonText: '取消',
  2928. type: 'warning'
  2929. }).then(() => {
  2930. const syncPromises = uniqueTemplates.map(t => syncPartAttrDetailedFromTemplate({
  2931. site: this.standardDetailData.site,
  2932. buNo: this.standardDetailData.buNo,
  2933. attributeNo: this.standardDetailData.attributeNo,
  2934. attributeType: 'A',
  2935. templateId: t.templateId,
  2936. inspectionTypeNo: t.inspectionTypeNo,
  2937. updateBy: this.$store.state.user.name
  2938. }))
  2939. return Promise.all(syncPromises)
  2940. }).then((results) => {
  2941. const failed = (results || []).filter(r => r && r.data && r.data.code !== 0)
  2942. if (failed.length > 0) {
  2943. this.$alert((failed[0].data && failed[0].data.msg) || '部分模板同步失败', '错误', { confirmButtonText: '确定' })
  2944. } else {
  2945. this.$message.success('同步成功')
  2946. }
  2947. this.standardRefreshDetailList()
  2948. }).catch(() => {})
  2949. })
  2950. },
  2951. standardGetItem () {
  2952. this.syncStandardInspectionTypeName()
  2953. getPartAttrItem(this.standardDetailData).then(({data}) => {
  2954. if (data.code === 0) {
  2955. this.standardItemList1 = data.rows || []
  2956. }
  2957. })
  2958. },
  2959. standardItemClickRow (row) {
  2960. this.standardCurrentRow = JSON.parse(JSON.stringify(row))
  2961. },
  2962. standardItemClickRow1 (row) {
  2963. this.$refs.standardItemTable1.toggleRowSelection(row)
  2964. },
  2965. standardItemClickRow2 (row) {
  2966. this.$refs.standardItemTable2.toggleRowSelection(row)
  2967. },
  2968. standardSelectionItem1 (val) {
  2969. this.standardItemSelections1 = val
  2970. },
  2971. standardSelectionItem2 (val) {
  2972. this.standardItemSelections2 = val
  2973. },
  2974. standardAddItem () {
  2975. if (this.standardItemSelections1 == null || this.standardItemSelections1.length === 0) {
  2976. this.$message.warning('请选择可选项目!')
  2977. return
  2978. }
  2979. if (!this.standardDetailData.inspectionTypeName) {
  2980. this.syncStandardInspectionTypeName()
  2981. }
  2982. let inData = {
  2983. site: this.standardDetailData.site,
  2984. buNo: this.standardDetailData.buNo,
  2985. attributeNo: this.standardDetailData.attributeNo,
  2986. attributeType: 'A',
  2987. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  2988. itemType: this.standardDetailData.itemType,
  2989. updateBy: this.$store.state.user.name,
  2990. itemList: this.standardItemSelections1
  2991. }
  2992. addPartAttrItemDetails(inData).then(({data}) => {
  2993. if (data && data.code === 0) {
  2994. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2995. if (data.code === 0) {
  2996. this.standardItemList1 = data.row1 || []
  2997. this.standardItemList2 = data.row2 || []
  2998. }
  2999. })
  3000. this.standardItemSelections1 = []
  3001. this.$message.success('操作成功')
  3002. } else {
  3003. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3004. }
  3005. })
  3006. },
  3007. standardDeleteItem () {
  3008. if (this.standardItemSelections2 == null || this.standardItemSelections2.length === 0) {
  3009. this.$message.warning('请选择已有项目!')
  3010. return
  3011. }
  3012. let inData = {
  3013. site: this.standardDetailData.site,
  3014. buNo: this.standardDetailData.buNo,
  3015. attributeNo: this.standardDetailData.attributeNo,
  3016. attributeType: 'A',
  3017. updateBy: this.$store.state.user.name,
  3018. itemList: this.standardItemSelections2
  3019. }
  3020. delPartAttrItemDetails(inData).then(({data}) => {
  3021. if (data && data.code === 0) {
  3022. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  3023. if (data.code === 0) {
  3024. this.standardItemList1 = data.row1 || []
  3025. this.standardItemList2 = data.row2 || []
  3026. }
  3027. })
  3028. this.standardItemSelections2 = []
  3029. this.$message.success('操作成功')
  3030. } else {
  3031. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3032. }
  3033. })
  3034. },
  3035. standardRefreshDetailList () {
  3036. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3037. if (data.code === 0) {
  3038. this.standardDetailList = data.rows || []
  3039. }
  3040. })
  3041. },
  3042. saveStandardDetail () {
  3043. let tempData = {
  3044. site: this.standardDetailData.site,
  3045. buNo: this.standardDetailData.buNo,
  3046. attributeNo: this.standardDetailData.attributeNo,
  3047. attributeType: 'A',
  3048. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  3049. updateBy: this.$store.state.user.name,
  3050. itemList: this.standardDetailList
  3051. }
  3052. savePartAttrDetailed(tempData).then(({data}) => {
  3053. if (data && data.code === 0) {
  3054. this.getDataList()
  3055. this.standardDetailModelFlag = false
  3056. this.$message.success('操作成功')
  3057. } else {
  3058. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3059. }
  3060. })
  3061. },
  3062. standardDelItemDetails (row) {
  3063. this.$confirm('是否删除该检验项目?', '提示', {
  3064. confirmButtonText: '确定',
  3065. cancelButtonText: '取消',
  3066. type: 'warning'
  3067. }).then(() => {
  3068. delPartAttrItemDetails({
  3069. site: this.standardDetailData.site,
  3070. buNo: this.standardDetailData.buNo,
  3071. attributeNo: this.standardDetailData.attributeNo,
  3072. attributeType: 'A',
  3073. updateBy: this.$store.state.user.name,
  3074. itemList: [row]
  3075. }).then(({data}) => {
  3076. if (data && data.code === 0) {
  3077. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3078. if (data.code === 0) {
  3079. this.standardDetailList = data.rows || []
  3080. }
  3081. })
  3082. this.$message.success('操作成功')
  3083. } else {
  3084. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3085. }
  3086. })
  3087. }).catch(() => {})
  3088. },
  3089. standardGoUp () {
  3090. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  3091. this.$message.warning('请先点击表格选择一行')
  3092. return
  3093. }
  3094. const row = {
  3095. ...this.standardCurrentRow,
  3096. site: this.standardDetailData.site,
  3097. buNo: this.standardDetailData.buNo,
  3098. attributeNo: this.standardDetailData.attributeNo
  3099. }
  3100. goUpPartAttrItem(row).then(({data}) => {
  3101. if (data && data.code === 0) {
  3102. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3103. if (data.code === 0) {
  3104. this.standardDetailList = data.rows || []
  3105. for (let i = 0; i < this.standardDetailList.length; i++) {
  3106. if (this.standardDetailList[i].itemNo === row.itemNo) {
  3107. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  3108. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  3109. break
  3110. }
  3111. }
  3112. this.$message.success('操作成功')
  3113. }
  3114. })
  3115. }
  3116. })
  3117. },
  3118. standardGoDown () {
  3119. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  3120. this.$message.warning('请先点击表格选择一行')
  3121. return
  3122. }
  3123. const row = {
  3124. ...this.standardCurrentRow,
  3125. site: this.standardDetailData.site,
  3126. buNo: this.standardDetailData.buNo,
  3127. attributeNo: this.standardDetailData.attributeNo
  3128. }
  3129. goDownPartAttrItem(row).then(({data}) => {
  3130. if (data && data.code === 0) {
  3131. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3132. if (data.code === 0) {
  3133. this.standardDetailList = data.rows || []
  3134. for (let i = 0; i < this.standardDetailList.length; i++) {
  3135. if (this.standardDetailList[i].itemNo === row.itemNo) {
  3136. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  3137. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  3138. break
  3139. }
  3140. }
  3141. this.$message.success('操作成功')
  3142. }
  3143. })
  3144. }
  3145. })
  3146. },
  3147. // 删除物料属性中的模板
  3148. deletePartAttributeDetails (row) {
  3149. this.$confirm(`是否删除这个检验模板?`, '提示', {
  3150. confirmButtonText: '确定',
  3151. cancelButtonText: '取消',
  3152. type: 'warning'
  3153. }).then(() => {
  3154. deletePartAttributeDetails(row).then(({data}) => {
  3155. if (data && data.code === 0) {
  3156. searchPartAttributeDetails(this.detailData).then(({data}) => {
  3157. this.detailList = data.rows
  3158. this.normalizeDetailListIpqcInspectionMethod()
  3159. })
  3160. this.$message({
  3161. message: '操作成功',
  3162. type: 'success',
  3163. duration: 1500,
  3164. onClose: () => {}
  3165. })
  3166. } else {
  3167. this.$alert(data.msg, '错误', {
  3168. confirmButtonText: '确定'
  3169. })
  3170. }
  3171. })
  3172. }).catch(() => {
  3173. })
  3174. },
  3175. // 校验用户是否收藏
  3176. favoriteIsOk () {
  3177. let userFavorite = {
  3178. userId: this.$store.state.user.id,
  3179. languageCode: this.$i18n.locale
  3180. }
  3181. userFavoriteList(userFavorite).then(({data}) => {
  3182. for (let i = 0; i < data.list.length; i++) {
  3183. if (this.$route.meta.menuId === data.list[i].menuId) {
  3184. this.favorite = true
  3185. }
  3186. }
  3187. })
  3188. },
  3189. // 收藏 OR 取消收藏
  3190. favoriteFunction () {
  3191. let userFavorite = {
  3192. userId: this.$store.state.user.id,
  3193. functionId: this.$route.meta.menuId,
  3194. }
  3195. if (this.favorite) {
  3196. removeUserFavorite(userFavorite).then(({data}) => {
  3197. this.$message.success(data.msg)
  3198. this.favorite = false
  3199. })
  3200. } else {
  3201. // 收藏
  3202. saveUserFavorite(userFavorite).then(({data}) => {
  3203. this.$message.success(data.msg)
  3204. this.favorite = true
  3205. })
  3206. }
  3207. },
  3208. exportExcel () {
  3209. this.exportLoading = true
  3210. const query = Object.assign({}, this.searchData, { page: 1, limit: 1000 })
  3211. exportQcExcel('partAttr', query).then(({data}) => {
  3212. this.bindExportBlob(data, '物料属性' + this.dayjs().format('YYYYMMDDHHmmss') + '.xlsx')
  3213. }).catch(() => {
  3214. this.$message.error('导出失败')
  3215. }).finally(() => {
  3216. this.exportLoading = false
  3217. })
  3218. },
  3219. bindExportBlob (data, fileName) {
  3220. const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})
  3221. const linkNode = document.createElement('a')
  3222. linkNode.download = fileName
  3223. linkNode.style.display = 'none'
  3224. linkNode.href = URL.createObjectURL(blob)
  3225. document.body.appendChild(linkNode)
  3226. linkNode.click()
  3227. URL.revokeObjectURL(linkNode.href)
  3228. document.body.removeChild(linkNode)
  3229. },
  3230. qcPartAttrUpload () {
  3231. this.openQcUpload('partAttr', '物料属性导入')
  3232. },
  3233. qcPartTemplateUpload () {
  3234. this.openQcUpload('partTemplate', '检验模板导入')
  3235. },
  3236. qcPartStandardUpload () {
  3237. this.openQcUpload('partStandard', '检验标准导入')
  3238. },
  3239. openQcUpload (flag, title) {
  3240. let currentData = {
  3241. flag: flag,
  3242. title: title,
  3243. createBy: this.$store.state.user.name,
  3244. site: this.$store.state.user.site
  3245. }
  3246. this.$nextTick(() => {
  3247. this.$refs.qcUpload.init(currentData)
  3248. })
  3249. },
  3250. // 导入
  3251. qcUpload () {
  3252. let currentData = {
  3253. flag: 'partAttribute',
  3254. createBy: this.$store.state.user.name,
  3255. site: this.$store.state.user.site
  3256. }
  3257. //打开组件 去做新增业务
  3258. this.$nextTick(() => {
  3259. this.$refs.qcUpload.init(currentData)
  3260. })
  3261. },
  3262. // 获取工序列表
  3263. getOperationList () {
  3264. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  3265. getOperationDescList(this.operationData).then(({data}) => {
  3266. if (data && data.code === 0) {
  3267. this.operationList = data.rows
  3268. this.operationModelFlag = true
  3269. } else {
  3270. this.$message.error(data.msg)
  3271. }
  3272. })
  3273. },
  3274. // 获取机台列表
  3275. getAllResourceList () {
  3276. this.resourceData.site = this.detailData.site
  3277. getAllResourceList(this.resourceData).then(({data}) => {
  3278. if (data && data.code === 0) {
  3279. this.resourceList = data.rows
  3280. this.resourceModelFlag = true
  3281. } else {
  3282. this.$message.error(data.msg)
  3283. }
  3284. })
  3285. },
  3286. getOperationList2 () {
  3287. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  3288. getOperationDescList(this.operationData).then(({data}) => {
  3289. if (data && data.code === 0) {
  3290. this.operationList = data.rows
  3291. } else {
  3292. this.$message.error(data.msg)
  3293. }
  3294. })
  3295. },
  3296. getAllResourceList2 () {
  3297. this.resourceData.site = this.detailData.site
  3298. getAllResourceList(this.resourceData).then(({data}) => {
  3299. if (data && data.code === 0) {
  3300. this.resourceList = data.rows
  3301. } else {
  3302. this.$message.error(data.msg)
  3303. }
  3304. })
  3305. },
  3306. selectionOperationChangeHandle (val) {
  3307. this.operationSelections = val
  3308. },
  3309. operationSelect () {},
  3310. getRowKeys (row) {
  3311. return row.operationDesc
  3312. },
  3313. selectionResourceChangeHandle (val) {
  3314. this.resourceSelections = val
  3315. },
  3316. resourceSelect () {},
  3317. getRowKeys2 (row) {
  3318. return row.resourceId
  3319. },
  3320. confirmOperation () {
  3321. this.operationModelFlag = false
  3322. },
  3323. confirmResource () {
  3324. this.resourceModelFlag = false
  3325. },
  3326. getManufacturerList () {
  3327. this.manufacturerData.site = this.detailData.site
  3328. getManufacturerList(this.manufacturerData).then(({data}) => {
  3329. if (data && data.code === 0) {
  3330. this.manufacturerList = data.rows
  3331. this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
  3332. let tempDataList = this.selectionManufacturer
  3333. this.manufacturerList.forEach(val => {
  3334. if (tempDataList.includes(val.manufacturerID)) {
  3335. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  3336. }
  3337. })
  3338. this.manufacturerModelFlag = true
  3339. } else {
  3340. this.$message.error(data.msg)
  3341. }
  3342. })
  3343. },
  3344. getManufacturerList2 () {
  3345. this.manufacturerData.site = this.detailData.site
  3346. getManufacturerList(this.manufacturerData).then(({data}) => {
  3347. if (data && data.code === 0) {
  3348. this.manufacturerList = data.rows
  3349. let tempDataList = this.selectionManufacturer
  3350. this.manufacturerList.forEach(val => {
  3351. if (tempDataList.includes(val.manufacturerID)) {
  3352. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  3353. }
  3354. })
  3355. } else {
  3356. this.manufacturerList = []
  3357. }
  3358. })
  3359. },
  3360. getRowKeys3 (row) {
  3361. return row.manufacturerID
  3362. },
  3363. manufacturerClickRow (row) {
  3364. this.$refs.manufacturerTable.toggleRowSelection(row)
  3365. },
  3366. selectionManufacturerChangeHandle (val) {
  3367. this.dataListManufacturerSelections = val
  3368. },
  3369. confirmManufacturer () {
  3370. this.selectionManufacturer = []
  3371. this.selectionManufacturer2 = []
  3372. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  3373. this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID)
  3374. this.selectionManufacturer2.push(this.dataListManufacturerSelections[i])
  3375. }
  3376. this.manufacturerModelFlag = false
  3377. },
  3378. getCustomerList () {
  3379. this.customerData.site = this.detailData.site
  3380. getCustomerList(this.customerData).then(({data}) => {
  3381. if (data && data.code === 0) {
  3382. this.customerList = data.rows
  3383. this.$nextTick(() => this.$refs.customerTable.clearSelection())
  3384. let tempDataList = this.selectionCustomer
  3385. this.customerList.forEach(val => {
  3386. if (tempDataList.includes(val.customerID)) {
  3387. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  3388. }
  3389. })
  3390. this.customerModelFlag = true
  3391. } else {
  3392. this.$message.error(data.msg)
  3393. }
  3394. })
  3395. },
  3396. getCustomerList2 () {
  3397. this.customerData.site = this.detailData.site
  3398. getCustomerList(this.customerData).then(({data}) => {
  3399. if (data && data.code === 0) {
  3400. this.customerList = data.rows
  3401. let tempDataList = this.selectionCustomer
  3402. this.customerList.forEach(val => {
  3403. if (tempDataList.includes(val.customerID)) {
  3404. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  3405. }
  3406. })
  3407. } else {
  3408. this.customerList = []
  3409. }
  3410. })
  3411. },
  3412. customerClickRow (row) {
  3413. this.$refs.customerTable.toggleRowSelection(row)
  3414. },
  3415. selectionCustomerChangeHandle (val) {
  3416. this.dataListCustomerSelections = val
  3417. },
  3418. getRowKeys4 (row) {
  3419. return row.customerID
  3420. },
  3421. confirmCustomer () {
  3422. this.selectionCustomer = []
  3423. this.selectionCustomer2 = []
  3424. for (let i = 0; i < this.dataListCustomerSelections.length; i++) {
  3425. this.selectionCustomer.push(this.dataListCustomerSelections[i].customerID)
  3426. this.selectionCustomer2.push(this.dataListCustomerSelections[i])
  3427. }
  3428. this.customerModelFlag = false
  3429. },
  3430. // sop文件列表
  3431. sopFileList (row) {
  3432. this.sopData = {
  3433. site: row.site,
  3434. buNo: row.buNo,
  3435. partNo: row.partNo,
  3436. inspectionTypeNo: ''
  3437. }
  3438. this.getFileContentList()
  3439. },
  3440. getFileContentList () {
  3441. let tempData = {
  3442. orderRef1: this.sopData.site,
  3443. orderRef2: this.sopData.partNo,
  3444. orderRef3:this.sopData.inspectionTypeNo,
  3445. orderRef4: this.sopData.buNo,
  3446. }
  3447. getPartAttributeFileList(tempData).then(({data}) => {
  3448. if (data && data.code === 200) {
  3449. this.sopList = data.rows
  3450. } else {
  3451. this.sopList = []
  3452. }
  3453. })
  3454. this.sopFileModelFlag = true
  3455. },
  3456. // 上传sop文件模态框
  3457. uploadSopFile () {
  3458. let currentData = {
  3459. titleCon: '文件上传',
  3460. site: this.sopData.site,
  3461. buNo: this.sopData.buNo,
  3462. createBy: this.$store.state.user.name,
  3463. partNo: this.sopData.partNo,
  3464. inspectionTypeNo: '',
  3465. options: this.options
  3466. }
  3467. //打开组件 去做新增业务
  3468. this.$nextTick(() => {
  3469. this.$refs.qcSOPUploadFile.init(currentData)
  3470. })
  3471. },
  3472. // 文件下载
  3473. downloadFile (row) {
  3474. if (row.orderReftype === 'AttachmentList') {
  3475. const linkNode = document.createElement('a')
  3476. linkNode.href = this.$store.state.user.padSopUrl + row.url
  3477. linkNode.download = row.fileName
  3478. linkNode.target = '_blank'
  3479. linkNode.style.display = 'none'
  3480. document.body.appendChild(linkNode)
  3481. linkNode.click()
  3482. document.body.removeChild(linkNode)
  3483. return
  3484. }
  3485. downLoadObjectFile(row).then(({data}) => {
  3486. // 不限制文件下载类型
  3487. const blob = new Blob([data], {type: "application/octet-stream"})
  3488. // 下载文件名称
  3489. const fileName = row.fileName
  3490. // a标签下载
  3491. const linkNode = document.createElement('a')
  3492. // a标签的download属性规定下载文件的名称
  3493. linkNode.download = fileName
  3494. linkNode.style.display = 'none'
  3495. // 生成一个Blob URL
  3496. linkNode.href = URL.createObjectURL(blob)
  3497. document.body.appendChild(linkNode)
  3498. // 模拟在按钮上的一次鼠标单击
  3499. linkNode.click()
  3500. // 释放URL 对象
  3501. URL.revokeObjectURL(linkNode.href)
  3502. document.body.removeChild(linkNode)
  3503. })
  3504. },
  3505. // 删除文件
  3506. deleteFile (row) {
  3507. this.$confirm('确定要删除此文件?', '提示', {
  3508. confirmButtonText: '确定',
  3509. cancelButtonText: '取消',
  3510. type: 'warning'
  3511. }).then(() => {
  3512. deleteObjectFile(row).then(({data}) => {
  3513. if (data && data.code === 0) {
  3514. this.getFileContentList()
  3515. this.$message({
  3516. message: '操作成功',
  3517. type: 'success',
  3518. duration: 1500,
  3519. onClose: () => {}
  3520. })
  3521. } else {
  3522. this.$alert(data.msg, '错误', {
  3523. confirmButtonText: '确定'
  3524. })
  3525. }
  3526. })
  3527. }).catch(() => {
  3528. })
  3529. },
  3530. // 动态列开始 获取 用户保存的 格式列
  3531. async getTableUserColumn (tableId, columnId) {
  3532. let queryTableUser = {
  3533. userId: this.$store.state.user.name,
  3534. functionId: this.$route.meta.menuId,
  3535. tableId: tableId,
  3536. status: true,
  3537. languageCode: this.$i18n.locale
  3538. }
  3539. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3540. if (data.rows.length > 0) {
  3541. //this.columnList1 = []
  3542. switch (columnId) {
  3543. case 1:
  3544. this.columnList = data.rows
  3545. break;
  3546. case 2:
  3547. this.columnDetailList = data.rows
  3548. break;
  3549. // case 3:
  3550. // this.columnList2 = data.rows
  3551. // break;
  3552. // case 4:
  3553. // this.columnList3 = data.rows
  3554. // break;
  3555. }
  3556. } else {
  3557. this.getColumnList(tableId, columnId)
  3558. }
  3559. })
  3560. },
  3561. // 获取 tableDefault 列
  3562. async getColumnList (tableId, columnId) {
  3563. let queryTable = {
  3564. functionId: this.$route.meta.menuId,
  3565. tableId: tableId,
  3566. languageCode: this.$i18n.locale
  3567. }
  3568. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3569. if (!data.rows.length == 0) {
  3570. switch (columnId) {
  3571. case 1:
  3572. this.columnList = data.rows
  3573. break;
  3574. case 2:
  3575. this.columnDetailList = data.rows
  3576. break;
  3577. // case 3:
  3578. // this.columnList2 = data.rows
  3579. // break;
  3580. // case 4:
  3581. // this.columnList3 = data.rows
  3582. // break;
  3583. }
  3584. } else {
  3585. // this.showDefault = true.
  3586. }
  3587. })
  3588. },
  3589. closeDialog () {
  3590. this.partDetailData = {
  3591. partNo: '',
  3592. partDesc: '',
  3593. seqNo: '',
  3594. sku: '',
  3595. }
  3596. this.partInfoList = []
  3597. },
  3598. //获取按钮的权限数据
  3599. getButtonAuthData () {
  3600. let searchFlag = this.isAuth(this.menuId+":search")
  3601. let saveFlag = this.isAuth(this.menuId+":save")
  3602. let updateFlag = this.isAuth(this.menuId+":update")
  3603. let deleteFlag = this.isAuth(this.menuId+":delete")
  3604. let detailFlag = this.isAuth(this.menuId+":detail")
  3605. let fileFlag = this.isAuth(this.menuId+":file")
  3606. let checkoutFlag = this.isAuth(this.menuId+":checkout")
  3607. //处理页面的权限数据
  3608. this.authSearch = !searchFlag
  3609. this.authSave = !saveFlag
  3610. this.authUpdate = !updateFlag
  3611. this.authDelete = !deleteFlag
  3612. this.authDetail = !detailFlag
  3613. this.authFile = !fileFlag
  3614. this.authCheckout = !checkoutFlag
  3615. },
  3616. }
  3617. }
  3618. </script>
  3619. <style scoped>
  3620. .el-table /deep/ .cell{
  3621. height: auto;
  3622. line-height: 1.5;
  3623. }
  3624. .qc-more-dropdown-trigger {
  3625. cursor: pointer;
  3626. color: #45C2B5;
  3627. margin-left: 1px;
  3628. font-size: 12px;
  3629. white-space: nowrap;
  3630. }
  3631. </style>