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

3709 lines
136 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
6 months ago
5 months ago
​
5 months ago
5 months ago
​
​
9 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
5 months ago
6 months ago
5 months ago
6 months ago
​
​
​
5 months ago
6 months ago
5 months ago
6 months ago
​
5 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
5 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
6 months ago
​
​
​
​
​
​
​
​
4 months ago
6 months ago
​
​
​
​
​
​
​
4 months ago
6 months ago
4 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
​
​
​
5 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
6 months ago
​
​
​
​
​
4 months ago
6 months ago
5 months ago
​
​
​
​
4 months ago
​
​
​
4 months ago
​
​
​
5 months ago
​
​
​
5 months ago
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
9 months ago
9 months ago
​
​
​
​
​
​
9 months ago
​
​
​
9 months ago
​
9 months ago
​
9 months ago
​
​
​
​
​
9 months ago
​
​
​
9 months ago
​
9 months ago
​
9 months ago
​
​
​
​
​
9 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
9 months ago
​
9 months ago
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
4 months ago
​
​
​
​
5 months ago
​
5 months ago
​
5 months ago
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
5 months ago
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
5 months ago
​
​
5 months ago
5 months ago
​
​
​
5 months ago
​
5 months ago
5 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <!-- <el-form-item :label="'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-input v-model="searchData.site" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'物料编码'">
  19. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'SKU'">
  22. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'物料名称'">
  25. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'PN'">
  28. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'类别名称'">
  31. <el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
  32. </el-form-item>
  33. <el-form-item label="IQC">
  34. <el-select v-model="searchData.iqcFlag" placeholder="全部" clearable style="width: 90px">
  35. <el-option v-for="item in maintainStatusOptions" :key="'iqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="IPQC">
  39. <el-select v-model="searchData.ipqcFlag" placeholder="全部" clearable style="width: 90px">
  40. <el-option v-for="item in maintainStatusOptions" :key="'ipqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="FQC">
  44. <el-select v-model="searchData.fqcFlag" placeholder="全部" clearable style="width: 90px">
  45. <el-option v-for="item in maintainStatusOptions" :key="'fqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="OQC">
  49. <el-select v-model="searchData.oqcFlag" placeholder="全部" clearable style="width: 90px">
  50. <el-option v-for="item in maintainStatusOptions" :key="'oqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="SQC">
  54. <el-select v-model="searchData.sqcFlag" placeholder="全部" clearable style="width: 90px">
  55. <el-option v-for="item in maintainStatusOptions" :key="'sqc-' + item.value" :label="item.label" :value="item.value"></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item :label="' '">
  59. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  60. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  61. </el-form-item>
  62. <el-form-item :label="' '">
  63. <!-- <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>-->
  64. <download-excel
  65. :fields="fields()"
  66. :data="exportData"
  67. type="xls"
  68. :name="exportName"
  69. :header="exportHeader"
  70. :footer="exportFooter"
  71. :fetch="createExportData"
  72. :before-generate="startDownload"
  73. :before-finish="finishDownload"
  74. worksheet="导出信息"
  75. class="el-button el-button--primary el-button--medium">
  76. {{ "导出" }}
  77. </download-excel>
  78. </el-form-item>
  79. </el-form>
  80. <!-- 展示列表 -->
  81. <el-table
  82. :height="height"
  83. :data="dataList"
  84. border
  85. style="width: 100%;">
  86. <el-table-column
  87. v-for="(item,index) in columnList" :key="index"
  88. :sortable="item.columnSortable"
  89. :prop="item.columnProp"
  90. :header-align="item.headerAlign"
  91. :show-overflow-tooltip="item.showOverflowTooltip"
  92. :align="item.align"
  93. :fixed="item.fixed === ''?false:item.fixed"
  94. :min-width="item.columnWidth"
  95. :label="item.columnLabel">
  96. <template slot-scope="scope">
  97. <span v-if="!item.columnHidden">
  98. <span v-if="maintainFlagProps.includes(item.columnProp)">
  99. <el-tag :type="isMaintained(scope.row[item.columnProp]) ? 'success' : 'info'" size="small">{{ scope.row[item.columnProp] }}</el-tag>
  100. </span>
  101. <span v-else-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  102. <span v-else>
  103. {{ scope.row[item.columnProp] }}
  104. </span>
  105. </span>
  106. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. fixed="right"
  111. header-align="center"
  112. align="center"
  113. width="160"
  114. label="操作">
  115. <template slot-scope="scope">
  116. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  117. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验模板</a>
  118. <el-dropdown
  119. v-if="!authCheckout || !authDelete || !authFile"
  120. trigger="click"
  121. :show-timeout="0"
  122. placement="bottom-end">
  123. <span class="qc-more-dropdown-trigger" @click.stop>
  124. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  125. </span>
  126. <el-dropdown-menu slot="dropdown">
  127. <el-dropdown-item v-if="!authCheckout" @click.native="standardDetailModal(scope.row)">检验标准</el-dropdown-item>
  128. <el-dropdown-item v-if="!authFile" @click.native="sopFileList(scope.row)">文件清单</el-dropdown-item>
  129. <el-dropdown-item @click.native="patrolInspection(scope.row)">巡检配置</el-dropdown-item>
  130. <el-dropdown-item v-if="!authDelete" @click.native="deletePropertiesModel(scope.row)">删除</el-dropdown-item>
  131. </el-dropdown-menu>
  132. </el-dropdown>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <!-- 分页栏 -->
  137. <el-pagination
  138. @size-change="sizeChangeHandle"
  139. @current-change="currentChangeHandle"
  140. :current-page="pageIndex"
  141. :page-sizes="[20, 50, 100, 200, 500]"
  142. :page-size="pageSize"
  143. :total="totalPage"
  144. layout="total, sizes, prev, pager, next, jumper">
  145. </el-pagination>
  146. <!-- 物料属性新增/修改 -->
  147. <el-dialog title="物料属性设置" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  148. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  149. <!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
  150. <!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 295px">-->
  151. <!-- <el-option-->
  152. <!-- v-for = "i in userBuList"-->
  153. <!-- :key = "i.buNo"-->
  154. <!-- :label = "i.sitename"-->
  155. <!-- :value = "i.buNo">-->
  156. <!-- <span style="float: left;width: 100px">{{ i.sitename }}</span>-->
  157. <!-- <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">-->
  158. <!-- {{ i.buDesc }}-->
  159. <!-- </span>-->
  160. <!-- </el-option>-->
  161. <!-- </el-select>-->
  162. <!-- </el-form-item>-->
  163. <el-form-item label="工厂编码:" prop="partDesc" :rules="rules.site">
  164. <el-input v-model="modalData.site" disabled style="width: 184px"></el-input>
  165. </el-form-item>
  166. <el-form-item prop="partNo" :rules="rules.partNoType">
  167. <span v-if="modalDisableFlag === false" slot="label" @click="searchPartInfo()"><a herf="#">物料编码:</a></span>
  168. <span v-if="modalDisableFlag === true" slot="label">物料编码:</span>
  169. <el-input v-model="modalData.partNo" :disabled="modalDisableFlag" style="width: 184px"></el-input>
  170. </el-form-item>
  171. <!-- <el-form-item style="margin-top: 23px;margin-left: 2px">
  172. <el-checkbox v-model="modalData.exemptInspection" true-label="Y" false-label="N">是否免检</el-checkbox><br>
  173. </el-form-item> -->
  174. </el-form>
  175. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  176. <el-form-item label="物料名称:" prop="partDesc" :rules="rules.partDescType">
  177. <el-input v-model="modalData.partDesc" disabled style="width: 380px"></el-input>
  178. </el-form-item>
  179. </el-form>
  180. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  181. <el-form-item label="默认值:" prop="defaultValue" >
  182. <el-input v-model="modalData.defaultValue" style="width: 85px"></el-input>
  183. </el-form-item>
  184. <el-form-item label="标准值:" prop="standardValue" >
  185. <el-input v-model="modalData.standardValue" style="width: 85px"></el-input>
  186. </el-form-item>
  187. <el-form-item label="上限值:" prop="maxValue" >
  188. <el-input v-model="modalData.maxValue" style="width: 85px"></el-input>
  189. </el-form-item>
  190. <el-form-item label="下限值:" prop="minValue" >
  191. <el-input v-model="modalData.minValue" style="width: 85px"></el-input>
  192. </el-form-item>
  193. <el-form-item label="首次巡检时长(h):" prop="firstIPQCPatrolTime" >
  194. <el-input type="number" v-model="modalData.firstIPQCPatrolTime" style="width: 117px"></el-input>
  195. </el-form-item>
  196. <el-form-item label="下次巡检时长(h):" prop="lastIPQCPatrolTime" >
  197. <el-input type="number" v-model="modalData.lastIPQCPatrolTime" style="width: 117px"></el-input>
  198. </el-form-item>
  199. <el-form-item label="累计巡检时长(h):" prop="cycleIPQCPatrolTime" >
  200. <el-input type="number" v-model="modalData.cycleIPQCPatrolTime" style="width: 117px"></el-input>
  201. </el-form-item>
  202. <el-form-item label="检验配置:" >
  203. <el-row :gutter="12">
  204. <el-col :span="6">
  205. <el-checkbox v-model="modalData.iqcExempt" true-label="Y" false-label="N">IQC检验</el-checkbox>
  206. </el-col>
  207. <!-- <el-col :span="6">
  208. <el-checkbox v-model="modalData.faiExempt" true-label="Y" false-label="N">FAI检验</el-checkbox>
  209. </el-col> -->
  210. <el-col :span="6">
  211. <el-checkbox v-model="modalData.ipqcExempt" true-label="Y" false-label="N">IPQC检验</el-checkbox>
  212. </el-col>
  213. <el-col :span="6">
  214. <el-checkbox v-model="modalData.oqcExempt" true-label="Y" false-label="N">OQC检验</el-checkbox>
  215. </el-col>
  216. <el-col :span="6">
  217. <el-checkbox v-model="modalData.fqcExempt" true-label="Y" false-label="N">FQC检验</el-checkbox>
  218. </el-col>
  219. </el-row>
  220. <el-row :gutter="12">
  221. <el-col :span="6">
  222. <el-checkbox v-model="modalData.sqcExempt" true-label="Y" false-label="N">SQC检验</el-checkbox>
  223. </el-col>
  224. </el-row>
  225. </el-form-item>
  226. <el-form-item label="备注:">
  227. <el-input v-model="modalData.attributeRemark" style="width: 385px"></el-input>
  228. </el-form-item>
  229. <!-- <el-form-item label="是否免检">-->
  230. <!-- <input type="checkbox" value="Y" name="isExemptInspection" v-model="modalData.exemptInspection"/>-->
  231. <!-- </el-form-item>-->
  232. </el-form>
  233. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  234. <el-button type="primary" @click="saveData()">保存</el-button>
  235. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  236. </el-footer>
  237. </el-dialog>
  238. <!-- 检验模板 -->
  239. <el-dialog title="检验模板清单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1400px">
  240. <el-form :inline="true" label-position="top">
  241. <el-form-item :label="'物料编码'">
  242. <el-input v-model="detailData.partNo" readonly style="width: 120px"></el-input>
  243. </el-form-item>
  244. <el-form-item :label="'物料名称'">
  245. <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
  246. </el-form-item>
  247. <el-form-item :label="' '">
  248. <el-button type="primary" @click="addFastModal()">新增</el-button>
  249. </el-form-item>
  250. </el-form>
  251. <!-- 检验项目展示列表 -->
  252. <div class="rq ">
  253. <el-table
  254. :height="300"
  255. :data="detailList"
  256. border
  257. style="width: 100%;">
  258. <el-table-column
  259. v-for="(item,index) in detailColumnsBeforeIpqc" :key="'before-' + index"
  260. :sortable="item.columnSortable"
  261. :prop="item.columnProp"
  262. :header-align="item.headerAlign"
  263. :show-overflow-tooltip="item.showOverflowTooltip"
  264. :align="item.align"
  265. :fixed="item.fixed===''?false:item.fixed"
  266. :min-width="item.columnWidth"
  267. :label="item.columnLabel">
  268. <template slot-scope="scope">
  269. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  270. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column
  274. prop="ipqcInspectionMethod"
  275. header-align="center"
  276. align="center"
  277. min-width="180"
  278. label="检验方式">
  279. <template slot-scope="scope">
  280. <el-select
  281. v-model="scope.row.ipqcInspectionMethod"
  282. placeholder="请选择"
  283. size="mini"
  284. style="width: 160px"
  285. :disabled="!isInspectionMethodApplicable(scope.row)">
  286. <el-option
  287. v-for="opt in getInspectionMethodOptions(scope.row)"
  288. :key="opt"
  289. :label="opt"
  290. :value="opt">
  291. </el-option>
  292. </el-select>
  293. <span v-if="isInspectionMethodApplicable(scope.row) && !scope.row.ipqcInspectionMethod" style="color:#F56C6C;margin-left:6px">*</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. v-for="(item,index) in detailColumnsAfterIpqc" :key="'after-' + index"
  298. :sortable="item.columnSortable"
  299. :prop="item.columnProp"
  300. :header-align="item.headerAlign"
  301. :show-overflow-tooltip="item.showOverflowTooltip"
  302. :align="item.align"
  303. :fixed="item.fixed===''?false:item.fixed"
  304. :min-width="item.columnWidth"
  305. :label="item.columnLabel">
  306. <template slot-scope="scope">
  307. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  308. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. prop=""
  313. header-align="center"
  314. align="center"
  315. min-width="170"
  316. label="检验水平">
  317. <template slot-scope="scope">
  318. <el-button type="primary" @click="chooseLevel(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
  319. <el-input v-model="scope.row.samplingLevelDesc" readonly style="width:77%"></el-input>
  320. </template>
  321. </el-table-column>
  322. <el-table-column
  323. prop=""
  324. header-align="center"
  325. align="center"
  326. min-width="60"
  327. label="检验周期(h)">
  328. <template slot-scope="scope">
  329. <el-input v-model="scope.row.inspectionCycle" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  330. </template>
  331. </el-table-column>
  332. <el-table-column
  333. prop=""
  334. header-align="center"
  335. align="center"
  336. min-width="170"
  337. label="抽样方案">
  338. <template slot-scope="scope">
  339. <el-button type="primary" @click="chooseProgrammeRow(scope.row)" style="width:18%;padding: 3px 7px" >·&nbsp;·&nbsp;·</el-button>
  340. <el-input v-model="scope.row.samplingProgrammeDesc" readonly style="width:77%"></el-input>
  341. </template>
  342. </el-table-column>
  343. <el-table-column
  344. prop=""
  345. header-align="center"
  346. align="center"
  347. min-width="60"
  348. label="AQL">
  349. <template slot-scope="scope">
  350. <el-input v-model="scope.row.aql" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  351. </template>
  352. </el-table-column>
  353. <el-table-column
  354. prop=""
  355. header-align="center"
  356. align="center"
  357. min-width="60"
  358. label="AC">
  359. <template slot-scope="scope">
  360. <el-input v-model="scope.row.ac" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  361. </template>
  362. </el-table-column>
  363. <el-table-column
  364. prop=""
  365. header-align="center"
  366. align="center"
  367. min-width="60"
  368. label="RE">
  369. <template slot-scope="scope">
  370. <el-input v-model="scope.row.re" type="number" style="height: 11px;padding: 0px " allow-create>;width:98%"</el-input>
  371. </template>
  372. </el-table-column>
  373. <el-table-column
  374. prop="templateRemark"
  375. header-align="center"
  376. align="center"
  377. label="备注">
  378. </el-table-column>
  379. <el-table-column
  380. fixed="right"
  381. header-align="center"
  382. align="center"
  383. width="80"
  384. label="操作">
  385. <template slot-scope="scope">
  386. <a type="text" size="small" @click="deletePartAttributeDetails(scope.row)">删除模板</a>
  387. </template>
  388. </el-table-column>
  389. </el-table>
  390. </div>
  391. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  392. <el-button type="primary" @click="saveDetail()">保存</el-button>
  393. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  394. </el-footer>
  395. </el-dialog>
  396. <!-- 检验模板->快速新增(原实现已注释,现与 boying-vue 一致) -->
  397. <!--
  398. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  399. ... 原「可选模板 | 添加>> 删除<< | 已有模板」三栏布局与单工序/单机台逻辑已废弃 ...
  400. </el-dialog>
  401. -->
  402. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  403. <div style="font-size: 12px">
  404. <el-form :inline="true" label-position="top" :model="detailData">
  405. <el-form-item :label="'模板编码'">
  406. <el-input v-model="detailData.templateId" clearable style="width: 120px"></el-input>
  407. </el-form-item>
  408. <el-form-item :label="'模板名称'">
  409. <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
  410. </el-form-item>
  411. <el-form-item label="检验类型">
  412. <el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType" placeholder="请选择">
  413. <el-option
  414. v-for="i in options"
  415. :key="i.inspectionTypeNo"
  416. :label="i.inspectionTypeName"
  417. :value="i.inspectionTypeNo">
  418. </el-option>
  419. </el-select>
  420. </el-form-item>
  421. <el-form-item :label="' '">
  422. <el-button type="primary" @click="checkInspectionType2">查询</el-button>
  423. </el-form-item>
  424. <el-form-item :label="' '" style="margin-left: 63px">
  425. <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>
  426. <el-button type="primary" @click="getManufacturerList" v-if="detailData.inspectionTypeNo === '105'" style="width: 63px">供应商</el-button>
  427. <el-button type="primary" @click="getCustomerList" v-if="detailData.inspectionTypeNo === '110'" style="width: 63px">客户</el-button>
  428. </el-form-item>
  429. <el-form-item :label="' '" style="margin-left: 195px">
  430. <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>
  431. </el-form-item>
  432. </el-form>
  433. </div>
  434. <el-container>
  435. <el-header style="width: 1080px;height: 200px;padding: 0 0 0 0">
  436. <el-row :gutter="5">
  437. <el-col :span="span1">
  438. <span style="font-size: 12px">可选模板:</span>
  439. <el-table
  440. height="210px"
  441. :data="itemList1"
  442. v-loading="itemList1Loading"
  443. border
  444. ref="itemTable1"
  445. @row-click="itemClickRow1"
  446. @selection-change="selectionItem1"
  447. highlight-current-row
  448. style="width: 100%">
  449. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  450. <el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
  451. <el-table-column prop="templateName" header-align="left" align="left" min-width="200" label="模板名称"></el-table-column>
  452. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></el-table-column>
  453. </el-table>
  454. </el-col>
  455. <el-col v-if="detailData.inspectionTypeNo === '105' || detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '110' || detailData.inspectionTypeNo === '107'" :span="span2" style="margin-top: 25px">
  456. <el-table
  457. v-if="detailData.inspectionTypeNo === '105'"
  458. height="210px"
  459. :data="selectionManufacturer2"
  460. border
  461. highlight-current-row
  462. style="width: 100%">
  463. <el-table-column prop="manufacturerID" header-align="center" align="center" min-width="100" label="供应商编码"></el-table-column>
  464. <el-table-column prop="manufacturerName" header-align="left" align="left" min-width="150" label="供应商名称"></el-table-column>
  465. </el-table>
  466. <el-table
  467. v-else-if="detailData.inspectionTypeNo === '110'"
  468. height="210px"
  469. :data="selectionCustomer2"
  470. border
  471. highlight-current-row
  472. style="width: 100%">
  473. <el-table-column prop="customerID" header-align="center" align="center" min-width="100" label="客户编码"></el-table-column>
  474. <el-table-column prop="customerName" header-align="left" align="left" min-width="150" label="客户名称"></el-table-column>
  475. </el-table>
  476. <el-table
  477. v-else
  478. height="210px"
  479. :data="operationSelections"
  480. border
  481. highlight-current-row
  482. style="width: 100%">
  483. <el-table-column prop="operationDesc" header-align="center" align="center" label="工序"></el-table-column>
  484. </el-table>
  485. </el-col>
  486. <el-col v-if="detailData.inspectionTypeNo === '101' || detailData.inspectionTypeNo === '107'" :span="span3" style="margin-top: 25px">
  487. <el-table
  488. height="210px"
  489. :data="resourceSelections"
  490. border
  491. highlight-current-row
  492. style="width: 100%">
  493. <el-table-column prop="resourceId" header-align="center" align="center" min-width="100" label="机台编码"></el-table-column>
  494. <el-table-column prop="resourceDesc" header-align="left" align="left" min-width="150" label="机台名称"></el-table-column>
  495. </el-table>
  496. </el-col>
  497. </el-row>
  498. </el-header>
  499. <el-main style="width: 880px;height: 25px;margin-top: 50px;padding: 0 0 0 0;text-align:center">
  500. <div>
  501. <el-button type="primary" @click="addItem" :loading="addItemLoading">添加<i class="el-icon-caret-bottom el-icon--right" v-if="!addItemLoading"></i></el-button>
  502. <el-button type="primary" @click="deleteItem" :loading="deleteItemLoading">删除<i class="el-icon-caret-top el-icon--right" v-if="!deleteItemLoading"></i></el-button>
  503. </div>
  504. </el-main>
  505. <el-footer style="width: 1080px;height: 222px;padding: 0 0 0 0;margin-top: -4px">
  506. <span style="font-size: 12px">已有模板:</span>
  507. <div class="rq">
  508. <el-table
  509. height="200px"
  510. :data="itemList2"
  511. v-loading="itemList2Loading"
  512. border
  513. ref="itemTable2"
  514. @row-click="itemClickRow2"
  515. @selection-change="selectionItem2"
  516. highlight-current-row
  517. style="width: 100%">
  518. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  519. <el-table-column prop="templateId" header-align="center" align="center" min-width="80" label="模板编码"></el-table-column>
  520. <el-table-column prop="templateName" header-align="center" align="center" min-width="200" label="模板名称"></el-table-column>
  521. <el-table-column prop="operation" header-align="center" align="center" min-width="100" label="工序"></el-table-column>
  522. <el-table-column prop="resourceID" header-align="center" align="center" min-width="100" label="机台"></el-table-column>
  523. <el-table-column prop="manufacturerName" header-align="center" align="center" min-width="200" label="供应商"></el-table-column>
  524. <el-table-column prop="customerName" header-align="center" align="center" min-width="200" label="客户"></el-table-column>
  525. <el-table-column prop="inspectionTypeName" header-align="center" align="center" min-width="60" label="检验类型"></el-table-column>
  526. </el-table>
  527. </div>
  528. </el-footer>
  529. </el-container>
  530. <el-footer style="height:35px;margin-top: 18px;text-align:center">
  531. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  532. </el-footer>
  533. </el-dialog>
  534. <!-- 检验标准(qc_part_attr_detailed) -->
  535. <el-dialog title="检验标准清单" @close="closeStandardDialog" :close-on-click-modal="false" v-drag :visible.sync="standardDetailModelFlag" width="940px">
  536. <el-form :inline="true" label-position="top">
  537. <el-form-item :label="'物料编码'">
  538. <el-input v-model="standardDetailData.partNo" readonly style="width: 120px"></el-input>
  539. </el-form-item>
  540. <el-form-item :label="'物料名称'">
  541. <el-input v-model="standardDetailData.partDesc" readonly style="width: 240px"></el-input>
  542. </el-form-item>
  543. <!-- <el-form-item label="检验类型">
  544. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  545. <el-option
  546. v-for="i in options"
  547. :key="i.inspectionTypeNo"
  548. :label="i.inspectionTypeName"
  549. :value="i.inspectionTypeNo">
  550. </el-option>
  551. </el-select>
  552. </el-form-item> -->
  553. <el-form-item :label="' '">
  554. <!-- <el-button type="primary" @click="standardAddFastModal()">新增</el-button> -->
  555. <el-button type="primary" @click="standardSyncFromTemplate()">同步检验项目</el-button>
  556. <!-- <el-button type="primary" @click="standardGoUp()">上移</el-button>
  557. <el-button type="primary" @click="standardGoDown()">下移</el-button> -->
  558. </el-form-item>
  559. </el-form>
  560. <div class="rq">
  561. <el-table
  562. :height="400"
  563. :data="standardDetailList"
  564. @row-click="standardItemClickRow"
  565. ref="standardDetailTable"
  566. highlight-current-row
  567. border
  568. style="width: 100%;">
  569. <el-table-column
  570. v-for="(item,index) in standardColumnDetailList"
  571. :key="'std-col-' + index"
  572. :sortable="item.columnSortable"
  573. :prop="item.columnProp"
  574. :header-align="item.headerAlign"
  575. :show-overflow-tooltip="item.showOverflowTooltip"
  576. :align="item.align"
  577. :fixed="item.fixed===''?false:item.fixed"
  578. :min-width="item.columnWidth"
  579. :label="item.columnLabel">
  580. <template slot-scope="scope">
  581. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  582. </template>
  583. </el-table-column>
  584. <el-table-column
  585. prop=""
  586. header-align="center"
  587. align="right"
  588. min-width="60"
  589. label="标准值">
  590. <template slot-scope="scope">
  591. <el-input v-model="scope.row.defaultValue" style="height: 11px;width:98%"></el-input>
  592. </template>
  593. </el-table-column>
  594. <el-table-column
  595. prop=""
  596. header-align="center"
  597. align="right"
  598. min-width="60"
  599. label="最大值">
  600. <template slot-scope="scope">
  601. <el-input v-model="scope.row.maxValue" style="height: 11px;width:98%"></el-input>
  602. </template>
  603. </el-table-column>
  604. <el-table-column
  605. prop=""
  606. header-align="center"
  607. align="right"
  608. min-width="60"
  609. label="最小值">
  610. <template slot-scope="scope">
  611. <el-input v-model="scope.row.minValue" style="height: 11px;width:98%"></el-input>
  612. </template>
  613. </el-table-column>
  614. <el-table-column
  615. fixed="right"
  616. header-align="center"
  617. align="center"
  618. width="100"
  619. label="操作">
  620. <template slot-scope="scope">
  621. <a type="text" size="small" @click="standardDelItemDetails(scope.row)">删除项目</a>
  622. </template>
  623. </el-table-column>
  624. </el-table>
  625. </div>
  626. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  627. <el-button type="primary" @click="saveStandardDetail()">保存</el-button>
  628. <el-button type="primary" @click="standardDetailModelFlag = false">关闭</el-button>
  629. </el-footer>
  630. </el-dialog>
  631. <!-- 检验标准->快速新增 -->
  632. <el-dialog title="新增检验项目" @close="standardRefreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="standardFastAddFlag" width="1100px">
  633. <div style="font-size: 12px">
  634. <el-form :inline="true" label-position="top" :model="standardDetailData">
  635. <el-form-item :label="'项目编码'">
  636. <el-input v-model="standardDetailData.itemNo" clearable style="width: 120px"></el-input>
  637. </el-form-item>
  638. <el-form-item :label="'项目名称'">
  639. <el-input v-model="standardDetailData.itemDesc" clearable style="width: 200px"></el-input>
  640. </el-form-item>
  641. <el-form-item label="检验类型">
  642. <el-select v-model="standardDetailData.inspectionTypeNo" @change="syncStandardInspectionTypeName" placeholder="请选择" style="width: 160px">
  643. <el-option
  644. v-for="i in options"
  645. :key="i.inspectionTypeNo"
  646. :label="i.inspectionTypeName"
  647. :value="i.inspectionTypeNo">
  648. </el-option>
  649. </el-select>
  650. </el-form-item>
  651. <el-form-item :label="' '">
  652. <el-button type="primary" @click="standardGetItem()">查询</el-button>
  653. </el-form-item>
  654. </el-form>
  655. </div>
  656. <el-container style="margin-top: 0px;">
  657. <el-main style="width: 720px; padding: 1px">
  658. <span style="font-size: 12px">可选项目:</span>
  659. <el-table
  660. height="400px"
  661. :data="standardItemList1"
  662. border
  663. ref="standardItemTable1"
  664. @row-click="standardItemClickRow1"
  665. @selection-change="standardSelectionItem1"
  666. highlight-current-row
  667. style="width: 100%">
  668. <el-table-column
  669. type="selection"
  670. header-align="center"
  671. align="center"
  672. :selectable="selectFlag"
  673. width="50">
  674. </el-table-column>
  675. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  676. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="120" label="项目名称"></el-table-column>
  677. <el-table-column prop="defaultValue" header-align="center" align="center" min-width="100" label="标准值"></el-table-column>
  678. <el-table-column prop="maxValue" header-align="center" align="center" min-width="60" label="最大值"></el-table-column>
  679. <el-table-column prop="minValue" header-align="center" align="center" min-width="60" label="最小值"></el-table-column>
  680. </el-table>
  681. </el-main>
  682. <el-main style="width: 111px;padding: 1px">
  683. <div style="margin-top: 182px;margin-left: 18px">
  684. <el-button type="primary" @click="standardAddItem()">添加>></el-button>
  685. </div>
  686. <div style="margin-top: 15px;margin-left: 18px">
  687. <el-button type="primary" @click="standardDeleteItem()">删除<<</el-button>
  688. </div>
  689. </el-main>
  690. <el-main style="width: 400px;padding: 1px">
  691. <span style="font-size: 12px">已有项目:</span>
  692. <el-table
  693. height="400px"
  694. :data="standardItemList2"
  695. border
  696. ref="standardItemTable2"
  697. @row-click="standardItemClickRow2"
  698. @selection-change="standardSelectionItem2"
  699. highlight-current-row
  700. style="width: 100%">
  701. <el-table-column
  702. type="selection"
  703. header-align="center"
  704. align="center"
  705. :selectable="selectFlag"
  706. width="50">
  707. </el-table-column>
  708. <el-table-column prop="itemNo" header-align="center" align="center" min-width="80" label="项目编码"></el-table-column>
  709. <el-table-column prop="itemDesc" header-align="center" align="center" min-width="200" label="项目名称"></el-table-column>
  710. </el-table>
  711. </el-main>
  712. </el-container>
  713. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  714. <el-button type="primary" @click="standardFastAddFlag = false">关闭</el-button>
  715. </el-footer>
  716. </el-dialog>
  717. <!-- 工序(与 boying-vue 一致:多选 + reserve-selection) -->
  718. <el-dialog title="工序清单" :close-on-click-modal="false" v-drag :visible.sync="operationModelFlag" width="420px">
  719. <div class="rq">
  720. <el-form :inline="true" label-position="top" :model="operationData">
  721. <el-form-item :label="'工序:'">
  722. <el-input v-model="operationData.operationDesc" clearable style="width: 120px"></el-input>
  723. </el-form-item>
  724. <el-form-item :label="' '">
  725. <el-button type="primary" @click="getOperationList2">查询</el-button>
  726. </el-form-item>
  727. </el-form>
  728. <el-table
  729. :height="300"
  730. :data="operationList"
  731. ref="operationTable"
  732. @selection-change="selectionOperationChangeHandle"
  733. @select="operationSelect"
  734. :row-key="getRowKeys"
  735. border
  736. style="width: 100%;">
  737. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  738. <el-table-column prop="operationDesc" header-align="center" align="center" label="工序"></el-table-column>
  739. </el-table>
  740. </div>
  741. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  742. <el-button type="primary" @click="confirmOperation">确认</el-button>
  743. </el-footer>
  744. </el-dialog>
  745. <!-- 机台 -->
  746. <el-dialog title="机台清单" :close-on-click-modal="false" v-drag :visible.sync="resourceModelFlag" width="420px">
  747. <div class="rq">
  748. <el-form :inline="true" label-position="top" :model="resourceData">
  749. <el-form-item :label="'机台编码'">
  750. <el-input v-model="resourceData.resourceId" clearable style="width: 120px"></el-input>
  751. </el-form-item>
  752. <el-form-item :label="'机台名称'">
  753. <el-input v-model="resourceData.resourceDesc" clearable style="width: 120px"></el-input>
  754. </el-form-item>
  755. <el-form-item :label="' '">
  756. <el-button type="primary" @click="getAllResourceList2">查询</el-button>
  757. </el-form-item>
  758. </el-form>
  759. <el-table
  760. :height="300"
  761. :data="resourceList"
  762. ref="resourceTable"
  763. @selection-change="selectionResourceChangeHandle"
  764. @select="resourceSelect"
  765. :row-key="getRowKeys2"
  766. border
  767. style="width: 100%;">
  768. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  769. <el-table-column prop="resourceId" header-align="center" align="center" label="机台编码"></el-table-column>
  770. <el-table-column prop="resourceDesc" header-align="center" align="center" label="机台名称"></el-table-column>
  771. </el-table>
  772. </div>
  773. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  774. <el-button type="primary" @click="confirmResource">确认</el-button>
  775. </el-footer>
  776. </el-dialog>
  777. <!-- 供应商 -->
  778. <el-dialog title="供应商清单" :close-on-click-modal="false" v-drag :visible.sync="manufacturerModelFlag" width="520px">
  779. <div class="rq">
  780. <el-form :inline="true" label-position="top" :model="manufacturerData">
  781. <el-form-item :label="'供应商编码:'">
  782. <el-input v-model="manufacturerData.manufacturerID" clearable style="width: 120px"></el-input>
  783. </el-form-item>
  784. <el-form-item :label="'供应商名称:'">
  785. <el-input v-model="manufacturerData.manufacturerName" clearable style="width: 120px"></el-input>
  786. </el-form-item>
  787. <el-form-item :label="' '">
  788. <el-button type="primary" @click="getManufacturerList2">查询</el-button>
  789. </el-form-item>
  790. </el-form>
  791. <el-table
  792. :height="300"
  793. :data="manufacturerList"
  794. ref="manufacturerTable"
  795. @row-click="manufacturerClickRow"
  796. @selection-change="selectionManufacturerChangeHandle"
  797. :row-key="getRowKeys3"
  798. border
  799. style="width: 100%;">
  800. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  801. <el-table-column prop="manufacturerID" header-align="center" align="center" label="供应商编码"></el-table-column>
  802. <el-table-column prop="manufacturerName" header-align="center" align="center" label="供应商名称"></el-table-column>
  803. </el-table>
  804. </div>
  805. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  806. <el-button type="primary" @click="confirmManufacturer">确认</el-button>
  807. <el-button type="primary" @click="manufacturerModelFlag = false">关闭</el-button>
  808. </el-footer>
  809. </el-dialog>
  810. <!-- 客户 -->
  811. <el-dialog title="客户清单" :close-on-click-modal="false" v-drag :visible.sync="customerModelFlag" width="520px">
  812. <div class="rq">
  813. <el-form :inline="true" label-position="top" :model="customerData">
  814. <el-form-item :label="'客户编码:'">
  815. <el-input v-model="customerData.customerID" clearable style="width: 120px"></el-input>
  816. </el-form-item>
  817. <el-form-item :label="'客户名称:'">
  818. <el-input v-model="customerData.customerName" clearable style="width: 120px"></el-input>
  819. </el-form-item>
  820. <el-form-item :label="' '">
  821. <el-button type="primary" @click="getCustomerList2">查询</el-button>
  822. </el-form-item>
  823. </el-form>
  824. <el-table
  825. :height="300"
  826. :data="customerList"
  827. ref="customerTable"
  828. @row-click="customerClickRow"
  829. @selection-change="selectionCustomerChangeHandle"
  830. :row-key="getRowKeys4"
  831. border
  832. style="width: 100%;">
  833. <el-table-column type="selection" header-align="center" align="center" :reserve-selection="true" width="50"></el-table-column>
  834. <el-table-column prop="customerID" header-align="center" align="center" label="客户编码"></el-table-column>
  835. <el-table-column prop="customerName" header-align="center" align="center" label="客户名称"></el-table-column>
  836. </el-table>
  837. </div>
  838. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  839. <el-button type="primary" @click="confirmCustomer">确认</el-button>
  840. <el-button type="primary" @click="customerModelFlag = false">关闭</el-button>
  841. </el-footer>
  842. </el-dialog>
  843. <!-- sop文件清单 -->
  844. <el-dialog title="文件清单" :close-on-click-modal="false" v-drag :visible.sync="sopFileModelFlag" width="800px">
  845. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  846. <el-form-item :label="' '">
  847. <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
  848. </el-form-item>
  849. <el-form-item label="检验类型" style="margin-left: 448px">
  850. <el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
  851. <el-option label="全部" value=""></el-option>
  852. <el-option
  853. v-for = "i in options"
  854. :key = "i.inspectionTypeNo"
  855. :label = "i.inspectionTypeName"
  856. :value = "i.inspectionTypeNo">
  857. </el-option>
  858. </el-select>
  859. </el-form-item>
  860. <el-form-item :label="' '">
  861. <el-button type="primary" @click="getFileContentList">查询</el-button>
  862. </el-form-item>
  863. </el-form>
  864. <el-table
  865. :height="350"
  866. :data="sopList"
  867. border
  868. style="width: 100%; ">
  869. <el-table-column
  870. v-for="(item,index) in sopColumnList" :key="index"
  871. :sortable="item.columnSortable"
  872. :prop="item.columnProp"
  873. :header-align="item.headerAlign"
  874. :show-overflow-tooltip="item.showOverflowTooltip"
  875. :align="item.align"
  876. :fixed="item.fixed===''?false:item.fixed"
  877. :min-width="item.columnWidth"
  878. :label="item.columnLabel">
  879. <template slot-scope="scope">
  880. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  881. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  882. </template>
  883. </el-table-column>
  884. <el-table-column
  885. fixed="right"
  886. header-align="center"
  887. align="center"
  888. width="100"
  889. label="操作">
  890. <template slot-scope="scope">
  891. <a @click="downloadFile(scope.row)">下载</a>
  892. <a v-if="scope.row.orderReftype !== 'AttachmentList'" type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  893. </template>
  894. </el-table-column>
  895. </el-table>
  896. </el-dialog>
  897. <!-- 物料编码 -->
  898. <el-dialog title="物料选择" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="partDisableFlag" width="685px" height="273px">
  899. <el-form :inline="true" label-position="top" :model="partDetailData" style="margin-left: 7px;margin-top: -5px;">
  900. <el-form-item label="物料编码">
  901. <el-input v-model="partDetailData.partNo" clearable style="width: 137px"></el-input>
  902. </el-form-item>
  903. <el-form-item label="物料名称">
  904. <el-input v-model="partDetailData.partDesc" clearable style="width: 137px"></el-input>
  905. </el-form-item>
  906. <!-- <el-form-item label="SKU">
  907. <el-input v-model="partDetailData.sku" clearable style="width: 100px"></el-input>
  908. </el-form-item> -->
  909. <el-form-item label="规格型号">
  910. <el-input v-model="partDetailData.spec" clearable style="width: 100px"></el-input>
  911. </el-form-item>
  912. <el-form-item label="PN">
  913. <el-input v-model="partDetailData.cinvSourceCode" clearable style="width: 100px"></el-input>
  914. </el-form-item>
  915. <el-form-item>
  916. <el-button type="primary" @click="searchPartInfo()" style="margin-top: 24px">查询</el-button>
  917. </el-form-item>
  918. </el-form>
  919. <el-table
  920. :height="400"
  921. :data="partInfoList"
  922. @row-dblclick="getRowData1"
  923. border
  924. v-loading="dataListLoading"
  925. style="width: 100%;">
  926. <el-table-column
  927. prop="partNo"
  928. header-align="center"
  929. align="center"
  930. label="物料编码">
  931. </el-table-column>
  932. <el-table-column
  933. prop="partDesc"
  934. header-align="center"
  935. align="center"
  936. label="物料名称">
  937. </el-table-column>
  938. <el-table-column
  939. prop="spec"
  940. header-align="center"
  941. align="center"
  942. label="规格型号">
  943. </el-table-column>
  944. <el-table-column
  945. prop="sku"
  946. header-align="center"
  947. align="center"
  948. label="SKU">
  949. </el-table-column>
  950. <el-table-column
  951. prop="cinvSourceCode"
  952. header-align="center"
  953. align="center"
  954. label="PN">
  955. </el-table-column>
  956. </el-table>
  957. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  958. <el-button type="primary" @click="partDisableFlag = false">关闭</el-button>
  959. </el-footer>
  960. </el-dialog>
  961. <!-- 巡检特殊配置(按工序) -->
  962. <el-dialog title="巡检特殊配置" :close-on-click-modal="false" v-drag :visible.sync="patrolConfigDialogFlag" width="900px" append-to-body>
  963. <div style="margin-bottom: 10px;">
  964. <el-button type="primary" size="small" icon="el-icon-plus" @click="addPatrolConfig">新增</el-button>
  965. <el-button type="danger" size="small" icon="el-icon-delete" @click="deletePatrolConfigRows" :disabled="patrolConfigSelections.length === 0">删除</el-button>
  966. <el-button type="success" size="small" icon="el-icon-upload2" @click="openPatrolConfigImport">导入</el-button>
  967. </div>
  968. <el-table
  969. :data="patrolConfigList"
  970. border
  971. height="400px"
  972. v-loading="patrolConfigLoading"
  973. @selection-change="patrolConfigSelectionChange"
  974. highlight-current-row
  975. style="width: 100%">
  976. <el-table-column type="selection" width="50" align="center"></el-table-column>
  977. <el-table-column prop="operationDesc" label="工序" header-align="center" align="left" min-width="150">
  978. <template slot-scope="scope">
  979. <el-select v-model="scope.row.operationDesc" size="small" placeholder="请选择工序" filterable clearable style="width: 100%">
  980. <el-option v-for="item in operationDescList" :key="item" :label="item" :value="item"></el-option>
  981. </el-select>
  982. </template>
  983. </el-table-column>
  984. <el-table-column prop="firstInspectionDuration" label="首次巡检时长(h)" header-align="center" align="right" width="140">
  985. <template slot-scope="scope">
  986. <el-input-number :controls="false" :step="0" v-model="scope.row.firstInspectionDuration" size="small" style="width: 100%"></el-input-number>
  987. </template>
  988. </el-table-column>
  989. <el-table-column prop="nextInspectionDuration" label="下次巡检时长(h)" header-align="center" align="right" width="140">
  990. <template slot-scope="scope">
  991. <el-input-number :controls="false" :step="0" v-model="scope.row.nextInspectionDuration" size="small" style="width: 100%"></el-input-number>
  992. </template>
  993. </el-table-column>
  994. <el-table-column prop="totalInspectionDuration" label="累计巡检时长(h)" header-align="center" align="right" width="140">
  995. <template slot-scope="scope">
  996. <el-input-number :controls="false" :step="0" v-model="scope.row.totalInspectionDuration" size="small" style="width: 100%"></el-input-number>
  997. </template>
  998. </el-table-column>
  999. <el-table-column prop="defaultFlag" label="是否默认" header-align="center" align="center" width="100">
  1000. <template slot-scope="scope">
  1001. <el-switch v-model="scope.row.defaultFlag" active-value="Y" inactive-value="N" @change="handleDefaultFlagChange(scope.row)"></el-switch>
  1002. </template>
  1003. </el-table-column>
  1004. <el-table-column label="操作" header-align="center" align="center" width="80">
  1005. <template slot-scope="scope">
  1006. <el-button type="text" size="small" @click="savePatrolConfigRow(scope.row)">保存</el-button>
  1007. </template>
  1008. </el-table-column>
  1009. </el-table>
  1010. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  1011. <el-button type="primary" @click="batchSavePatrolConfig" :loading="patrolConfigSaveLoading">保存</el-button>
  1012. <el-button @click="patrolConfigDialogFlag = false">关闭</el-button>
  1013. </el-footer>
  1014. </el-dialog>
  1015. <patrol-config-upload ref="patrolConfigUpload" @refreshPatrolConfig="getPatrolConfigList" v-drag></patrol-config-upload>
  1016. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  1017. <!-- 上传sop文件的modal -->
  1018. <qcSOPUploadFile ref="qcSOPUploadFile" @refreshPageTables="getFileContentList()" v-drag></qcSOPUploadFile>
  1019. <!-- 导入 -->
  1020. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  1021. </div>
  1022. </template>
  1023. <script>
  1024. import {
  1025. qcPartAttributeSearch, // 查询物料属性
  1026. qcPartAttributeSave, // 新增物料属性
  1027. qcPartAttributeDelete, // 删除物料属性
  1028. qcPartAttributeEdit, // 修改物料属性
  1029. searchPartAttributeDetails, // 查询物料属性模板
  1030. savePartAttributeDetails, // 新增物料属性模板
  1031. deletePartAttributeDetails, // 删除物料属性模板
  1032. saveAttributeDetailed, // 新增物料属性模板详情
  1033. getPartTemplateLists, // 获取模板列表
  1034. inspectionTypeSearch, // 搜索所有检验类型
  1035. getOperationDescList, // 查询工序列表
  1036. getManufacturerList, // 查询供应商列表
  1037. getCustomerList, // 查询客户列表
  1038. getAllResourceList, // 查询机台列表
  1039. getSiteAndBuByUserName,
  1040. searchPartInfo, // 查询物料信息
  1041. partAttrDetailedSearch,
  1042. getPartAttrItemList,
  1043. getPartAttrItem,
  1044. addPartAttrItemDetails,
  1045. delPartAttrItemDetails,
  1046. savePartAttrDetailed,
  1047. syncPartAttrDetailedFromTemplate,
  1048. goUpPartAttrItem,
  1049. goDownPartAttrItem,
  1050. getPatrolConfigList as fetchPatrolConfigListApi,
  1051. savePatrolConfig as savePatrolConfigApi,
  1052. updatePatrolConfig as updatePatrolConfigApi,
  1053. deletePatrolConfig as deletePatrolConfigApi,
  1054. getPatrolOperationDescList as getPatrolOperationDescListApi,
  1055. getPartAttributeFileList
  1056. } from "@/api/qc/qc.js"
  1057. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  1058. import Chooselist from '@/views/modules/common/Chooselist_eam'
  1059. import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
  1060. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  1061. import {deleteObjectFile} from '@/api/eam/eam.js'
  1062. import qcUpload from "./qc_upload"
  1063. import qcSOPUploadFile from "./qc_SOP_upload_file"
  1064. import PatrolConfigUpload from './patrol_config_upload'
  1065. export default {
  1066. components: {
  1067. qcSOPUploadFile,
  1068. Chooselist,
  1069. qcUpload,
  1070. PatrolConfigUpload
  1071. },
  1072. data () {
  1073. return {
  1074. columnsProp:['createBy', 'updateBy'],
  1075. maintainFlagProps: ['iqcFlag', 'ipqcFlag', 'fqcFlag', 'oqcFlag', 'sqcFlag'],
  1076. // 是否收藏
  1077. favorite: false,
  1078. // 导出 start
  1079. exportData: [],
  1080. exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
  1081. exportHeader: ["根据物料设置检验模板"],
  1082. exportFooter: [],
  1083. exportList: [],
  1084. // 导出 end
  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. itemSelections1: [],
  1890. itemSelections2: [],
  1891. rules: {
  1892. site:[
  1893. {
  1894. required: true,
  1895. message: ' ',
  1896. trigger: ['blur','change']
  1897. }
  1898. ],
  1899. partNoType:[
  1900. {
  1901. required: true,
  1902. message: ' ',
  1903. trigger: ['blur','change']
  1904. }
  1905. ],
  1906. partDescType:[
  1907. {
  1908. required: true,
  1909. message: ' ',
  1910. trigger: ['blur','change']
  1911. }
  1912. ],
  1913. bu: [
  1914. {
  1915. required: true,
  1916. message: ' ',
  1917. trigger: ['blur','change']
  1918. }
  1919. ]
  1920. },
  1921. // 工序
  1922. operationList: [],
  1923. resourceList: [],
  1924. operationModelFlag: false,
  1925. resourceModelFlag: false,
  1926. dataListOperationSelections: [],
  1927. operationData: {
  1928. operationDesc: '',
  1929. inspectionTypeNo: ''
  1930. },
  1931. resourceData: {
  1932. site: '',
  1933. resourceId: '',
  1934. resourceDesc: ''
  1935. },
  1936. operation: '',
  1937. resourceId: '',
  1938. selectionManufacturer: [],
  1939. selectionManufacturer2: [],
  1940. selectionCustomer: [],
  1941. selectionCustomer2: [],
  1942. span1: 12,
  1943. span2: 12,
  1944. span3: 12,
  1945. operationSelections: [],
  1946. resourceSelections: [],
  1947. // 供应商
  1948. manufacturerList: [],
  1949. manufacturerModelFlag: false,
  1950. dataListManufacturerSelections: [],
  1951. manufacturerData: {
  1952. site: '',
  1953. manufacturerID: '',
  1954. manufacturerName: ''
  1955. },
  1956. customerData: {
  1957. site: '',
  1958. customerID: '',
  1959. customerName: ''
  1960. },
  1961. customerModelFlag: false,
  1962. customerList: [],
  1963. dataListCustomerSelections: [],
  1964. // 单选框绑定的值
  1965. operationCurrent: -1,
  1966. resourceCurrent: -1,
  1967. sopData: {
  1968. site: '',
  1969. buNo: '',
  1970. partNo: '',
  1971. inspectionTypeNo: '',
  1972. inspectionTypeName: ''
  1973. },
  1974. sopList: [],
  1975. sopFileModelFlag: false,
  1976. sopColumnList: [
  1977. {
  1978. columnProp: 'fileName',
  1979. headerAlign: "center",
  1980. align: "center",
  1981. columnLabel: '文件名称',
  1982. columnHidden: false,
  1983. columnImage: false,
  1984. columnSortable: false,
  1985. sortLv: 0,
  1986. status: true,
  1987. fixed: '',
  1988. },
  1989. {
  1990. columnProp: 'createdBy',
  1991. headerAlign: "center",
  1992. align: 'center',
  1993. columnLabel: '上传人',
  1994. columnHidden: false,
  1995. columnImage: false,
  1996. columnSortable: true,
  1997. sortLv: 0,
  1998. status: true,
  1999. fixed: false
  2000. },
  2001. {
  2002. columnProp: 'createDate',
  2003. headerAlign: "center",
  2004. align: 'center',
  2005. columnLabel: '上传时间',
  2006. columnHidden: false,
  2007. columnImage: false,
  2008. columnSortable: true,
  2009. sortLv: 0,
  2010. status: true,
  2011. fixed: false
  2012. },
  2013. {
  2014. columnProp: 'orderRef3',
  2015. headerAlign: "center",
  2016. align: 'center',
  2017. columnLabel: '检验类型',
  2018. columnHidden: false,
  2019. columnImage: false,
  2020. columnSortable: true,
  2021. sortLv: 0,
  2022. status: true,
  2023. fixed: false
  2024. },
  2025. ],
  2026. userBuList: [],
  2027. partInfoList: [],
  2028. partDetailData: {
  2029. bu: '',
  2030. partNo: '',
  2031. partDesc: '',
  2032. seqNo: '',
  2033. sku: '',
  2034. spec:'',
  2035. cinvSourceCode:'',
  2036. },
  2037. authSearch: false,
  2038. authSave: false,
  2039. authUpdate: false,
  2040. authDelete: false,
  2041. authDetail: false,
  2042. authCheckout: false,
  2043. authFile: false,
  2044. menuId: this.$route.meta.menuId,
  2045. }
  2046. },
  2047. computed: {
  2048. maintainStatusOptions () {
  2049. return [
  2050. { label: '已维护', value: '已维护' },
  2051. { label: '未维护', value: '未维护' }
  2052. ]
  2053. },
  2054. detailColumnsBeforeIpqc () {
  2055. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  2056. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  2057. if (idx === -1) return list
  2058. return list.slice(0, idx + 1)
  2059. },
  2060. detailColumnsAfterIpqc () {
  2061. const list = Array.isArray(this.columnDetailList) ? this.columnDetailList : []
  2062. const idx = list.findIndex(i => i.columnProp === 'inspectionTypeName')
  2063. if (idx === -1) return []
  2064. return list.slice(idx + 1)
  2065. }
  2066. },
  2067. mounted () {
  2068. this.$nextTick(() => {
  2069. this.height = window.innerHeight - 180
  2070. })
  2071. },
  2072. created () {
  2073. // 按钮控制
  2074. this.getButtonAuthData()
  2075. // 获取用户的 site 和 bu
  2076. // this.getSiteAndBuByUserName()
  2077. // 校验用户是否收藏
  2078. // this.favoriteIsOk()
  2079. // 获取检验类型
  2080. this.inspectionTypeSearch()
  2081. // 动态列
  2082. // this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2083. // this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  2084. if (!this.authSearch) {
  2085. // 获取数据列表
  2086. this.getDataList()
  2087. }
  2088. },
  2089. methods: {
  2090. isMaintained (val) {
  2091. return val === '已维护'
  2092. },
  2093. // 获取用户的bu
  2094. getSiteAndBuByUserName () {
  2095. let tempData = {
  2096. username: this.$store.state.user.name,
  2097. }
  2098. getSiteAndBuByUserName(tempData).then(({data}) => {
  2099. if (data.code === 0) {
  2100. this.userBuList = data.rows
  2101. }
  2102. })
  2103. },
  2104. searchPartInfo () {
  2105. this.partDetailData.site = this.modalData.site
  2106. if (!this.partDetailData.partNo && !this.partDetailData.partDesc && !this.partDetailData.spec && !this.partDetailData.cinvSourceCode) {
  2107. this.partInfoList = []
  2108. this.partDisableFlag = true
  2109. }else {
  2110. searchPartInfo(this.partDetailData).then(({data}) => {
  2111. if (data.code === 0) {
  2112. this.partInfoList = data.rows
  2113. this.partDisableFlag = true
  2114. } else {
  2115. this.$alert(data.msg, '错误', {
  2116. confirmButtonText: '确定'
  2117. })
  2118. }
  2119. })
  2120. }
  2121. },
  2122. // 查询检验类型
  2123. inspectionTypeSearch () {
  2124. let tempData = {
  2125. site: this.$store.state.user.site
  2126. }
  2127. inspectionTypeSearch(tempData).then(({data}) => {
  2128. if (data.code === 0) {
  2129. this.options = data.rows
  2130. }
  2131. })
  2132. },
  2133. isIPQCInspectionType (row) {
  2134. const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
  2135. const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
  2136. return name.toUpperCase().includes('IPQC') || no.toUpperCase().includes('IPQC') || no === '101'
  2137. },
  2138. isIQCInspectionType (row) {
  2139. const name = (row && row.inspectionTypeName) ? String(row.inspectionTypeName) : ''
  2140. const no = (row && row.inspectionTypeNo) ? String(row.inspectionTypeNo) : ''
  2141. return name.toUpperCase().includes('IQC') || no.toUpperCase().includes('IQC') || no === '105'
  2142. },
  2143. isInspectionMethodApplicable (row) {
  2144. return this.isIPQCInspectionType(row) || this.isIQCInspectionType(row)
  2145. },
  2146. getInspectionMethodOptions (row) {
  2147. if (this.isIQCInspectionType(row)) {
  2148. return this.iqcInspectionMethodOptions
  2149. }
  2150. return this.ipqcInspectionMethodOptions
  2151. },
  2152. normalizeIpqcInspectionMethod (row) {
  2153. if (!row) return
  2154. if (this.isIPQCInspectionType(row)) {
  2155. if (row.ipqcInspectionMethod && this.ipqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
  2156. this.$set(row, 'ipqcInspectionMethod', '')
  2157. }
  2158. } else if (this.isIQCInspectionType(row)) {
  2159. if (row.ipqcInspectionMethod && this.iqcInspectionMethodOptions.indexOf(row.ipqcInspectionMethod) === -1) {
  2160. this.$set(row, 'ipqcInspectionMethod', '')
  2161. }
  2162. } else {
  2163. if (row.ipqcInspectionMethod) {
  2164. this.$set(row, 'ipqcInspectionMethod', '')
  2165. }
  2166. }
  2167. },
  2168. normalizeDetailListIpqcInspectionMethod () {
  2169. if (!Array.isArray(this.detailList)) return
  2170. this.detailList.forEach(r => this.normalizeIpqcInspectionMethod(r))
  2171. },
  2172. chooseLevel (row) {
  2173. this.tempLevelRow = row
  2174. this.getBaseList(208)
  2175. },
  2176. chooseProgrammeRow (row) {
  2177. this.tempProgrammeRow = row
  2178. this.getBaseList(207)
  2179. },
  2180. // 获取基础数据列表S
  2181. getBaseList (val,type) {
  2182. this.tagNo = val
  2183. this.$nextTick(() => {
  2184. let strVal = ''
  2185. // if (val === 507) {
  2186. // strVal = this.modalData.partNo
  2187. // this.$refs.baseList.init(val, strVal)
  2188. // }
  2189. if (val === 208) {
  2190. strVal = this.tempLevelRow.samplingLevelNo
  2191. this.$refs.baseList.init(val, strVal)
  2192. }
  2193. if (val === 207) {
  2194. strVal = this.tempProgrammeRow.samplingProgrammeNo
  2195. this.$refs.baseList.init(val, strVal)
  2196. }
  2197. if (val === 1056) {
  2198. strVal = this.modalData.supplierNo
  2199. this.$refs.baseList.init(val, strVal)
  2200. }
  2201. })
  2202. },
  2203. // 列表方法的回调
  2204. getBaseData (val) {
  2205. if (this.tagNo === 507) {
  2206. this.modalData.partNo = val.part_no
  2207. this.modalData.partDesc = val.part_desc
  2208. }
  2209. if (this.tagNo === 208) {
  2210. this.tempLevelRow.samplingLevelNo = val.sampling_level_no
  2211. this.tempLevelRow.samplingLevelDesc = val.sampling_level_desc
  2212. }
  2213. if (this.tagNo === 207) {
  2214. this.tempProgrammeRow.samplingProgrammeNo = val.sampling_programme_no
  2215. this.tempProgrammeRow.samplingProgrammeDesc = val.sampling_programme_desc
  2216. }
  2217. if (this.tagNo === 1056) {
  2218. this.modalData.supplierNo = val.supplier_id
  2219. this.modalData.supplierDesc = val.supplier_name
  2220. }
  2221. },
  2222. // 获取数据列表
  2223. getDataList () {
  2224. this.searchData.limit = this.pageSize
  2225. this.searchData.page = this.pageIndex
  2226. qcPartAttributeSearch(this.searchData).then(({data}) => {
  2227. if (data.code === 0) {
  2228. this.dataList = data.page.list
  2229. this.pageIndex = data.page.currPage
  2230. this.pageSize = data.page.pageSize
  2231. this.totalPage = data.page.totalCount
  2232. }
  2233. })
  2234. },
  2235. patrolInspection (row) {
  2236. this.patrolContextRow = {
  2237. site: row.site,
  2238. buNo: row.buNo,
  2239. partNo: row.partNo
  2240. }
  2241. this.patrolConfigDialogFlag = true
  2242. this.getPatrolConfigList()
  2243. this.loadPatrolOperationDescList()
  2244. },
  2245. loadPatrolOperationDescList () {
  2246. const params = {
  2247. site: this.patrolContextRow.site,
  2248. userName: this.$store.state.user.name
  2249. }
  2250. getPatrolOperationDescListApi(params).then(({ data }) => {
  2251. if (data && data.code === 0) {
  2252. this.operationDescList = data.rows || []
  2253. }
  2254. })
  2255. },
  2256. getPatrolConfigList () {
  2257. this.patrolConfigLoading = true
  2258. const params = {
  2259. site: this.patrolContextRow.site,
  2260. buNo: this.patrolContextRow.buNo,
  2261. partNo: this.patrolContextRow.partNo
  2262. }
  2263. fetchPatrolConfigListApi(params).then(({ data }) => {
  2264. if (data && data.code === 0) {
  2265. this.patrolConfigList = data.rows || []
  2266. } else {
  2267. this.$message.error((data && data.msg) || '获取巡检配置失败')
  2268. }
  2269. this.patrolConfigLoading = false
  2270. }).catch(() => {
  2271. this.patrolConfigLoading = false
  2272. })
  2273. },
  2274. patrolConfigSelectionChange (selections) {
  2275. this.patrolConfigSelections = selections
  2276. },
  2277. addPatrolConfig () {
  2278. this.patrolConfigList.push({
  2279. site: this.patrolContextRow.site,
  2280. buNo: this.patrolContextRow.buNo,
  2281. partNo: this.patrolContextRow.partNo,
  2282. operationDesc: '',
  2283. firstInspectionDuration: 0,
  2284. nextInspectionDuration: 0,
  2285. totalInspectionDuration: 0,
  2286. defaultFlag: 'N',
  2287. isNew: true
  2288. })
  2289. },
  2290. savePatrolConfigRow (row) {
  2291. if (!row.operationDesc) {
  2292. this.$message.warning('请输入工序')
  2293. return
  2294. }
  2295. const params = {
  2296. site: row.site,
  2297. buNo: row.buNo,
  2298. partNo: row.partNo,
  2299. operationDesc: row.operationDesc,
  2300. firstInspectionDuration: row.firstInspectionDuration,
  2301. nextInspectionDuration: row.nextInspectionDuration,
  2302. totalInspectionDuration: row.totalInspectionDuration,
  2303. defaultFlag: row.defaultFlag
  2304. }
  2305. if (row.isNew) {
  2306. savePatrolConfigApi(params).then(({ data }) => {
  2307. if (data && data.code === 0) {
  2308. this.$message.success('保存成功')
  2309. this.getPatrolConfigList()
  2310. } else {
  2311. this.$message.error((data && data.msg) || '保存失败')
  2312. }
  2313. })
  2314. } else {
  2315. updatePatrolConfigApi(params).then(({ data }) => {
  2316. if (data && data.code === 0) {
  2317. this.$message.success('更新成功')
  2318. this.getPatrolConfigList()
  2319. } else {
  2320. this.$message.error((data && data.msg) || '更新失败')
  2321. }
  2322. })
  2323. }
  2324. },
  2325. deletePatrolConfigRows () {
  2326. if (this.patrolConfigSelections.length === 0) {
  2327. this.$message.warning('请选择要删除的数据')
  2328. return
  2329. }
  2330. this.$confirm('确定删除选中的配置吗?', '提示', {
  2331. confirmButtonText: '确定',
  2332. cancelButtonText: '取消',
  2333. type: 'warning'
  2334. }).then(() => {
  2335. const deleteList = this.patrolConfigSelections.filter(item => !item.isNew)
  2336. if (deleteList.length === 0) {
  2337. this.patrolConfigSelections.forEach(item => {
  2338. const index = this.patrolConfigList.indexOf(item)
  2339. if (index > -1) {
  2340. this.patrolConfigList.splice(index, 1)
  2341. }
  2342. })
  2343. this.patrolConfigSelections = []
  2344. return
  2345. }
  2346. const params = {
  2347. list: deleteList.map(item => ({
  2348. site: item.site,
  2349. buNo: item.buNo,
  2350. partNo: item.partNo,
  2351. operationDesc: item.operationDesc
  2352. }))
  2353. }
  2354. deletePatrolConfigApi(params).then(({ data }) => {
  2355. if (data && data.code === 0) {
  2356. this.$message.success('删除成功')
  2357. this.getPatrolConfigList()
  2358. } else {
  2359. this.$message.error((data && data.msg) || '删除失败')
  2360. }
  2361. })
  2362. }).catch(() => {})
  2363. },
  2364. handleDefaultFlagChange (row) {
  2365. if (row.defaultFlag === 'Y') {
  2366. this.patrolConfigList.forEach(item => {
  2367. if (item !== row) {
  2368. item.defaultFlag = 'N'
  2369. }
  2370. })
  2371. }
  2372. },
  2373. batchSavePatrolConfig () {
  2374. if (this.patrolConfigList.length === 0) {
  2375. this.$message.warning('没有需要保存的数据')
  2376. return
  2377. }
  2378. for (let i = 0; i < this.patrolConfigList.length; i++) {
  2379. const item = this.patrolConfigList[i]
  2380. if (!item.operationDesc) {
  2381. this.$message.warning(`第${i + 1}行工序不能为空`)
  2382. return
  2383. }
  2384. }
  2385. this.patrolConfigSaveLoading = true
  2386. let successCount = 0
  2387. let errorCount = 0
  2388. const promises = this.patrolConfigList.map(row => {
  2389. const params = {
  2390. site: row.site,
  2391. buNo: row.buNo,
  2392. partNo: row.partNo,
  2393. operationDesc: row.operationDesc,
  2394. firstInspectionDuration: row.firstInspectionDuration,
  2395. nextInspectionDuration: row.nextInspectionDuration,
  2396. totalInspectionDuration: row.totalInspectionDuration,
  2397. defaultFlag: row.defaultFlag || 'N'
  2398. }
  2399. if (row.isNew) {
  2400. return savePatrolConfigApi(params).then(({ data }) => {
  2401. if (data && data.code === 0) {
  2402. successCount++
  2403. row.isNew = false
  2404. } else {
  2405. errorCount++
  2406. }
  2407. }).catch(() => {
  2408. errorCount++
  2409. })
  2410. } else {
  2411. return updatePatrolConfigApi(params).then(({ data }) => {
  2412. if (data && data.code === 0) {
  2413. successCount++
  2414. } else {
  2415. errorCount++
  2416. }
  2417. }).catch(() => {
  2418. errorCount++
  2419. })
  2420. }
  2421. })
  2422. Promise.all(promises).then(() => {
  2423. this.patrolConfigSaveLoading = false
  2424. if (errorCount === 0) {
  2425. this.$message.success('保存成功')
  2426. } else {
  2427. this.$message.warning(`保存完成,成功${successCount}条,失败${errorCount}条`)
  2428. }
  2429. this.getPatrolConfigList()
  2430. })
  2431. },
  2432. openPatrolConfigImport () {
  2433. const params = {
  2434. site: this.patrolContextRow.site,
  2435. buNo: this.patrolContextRow.buNo,
  2436. partNo: this.patrolContextRow.partNo
  2437. }
  2438. this.$refs.patrolConfigUpload.init(params)
  2439. },
  2440. getRowData1 (row) {
  2441. this.modalData.sku = row.sku
  2442. this.modalData.cinvSourceCode = row.cinvSourceCode
  2443. this.modalData.partNo = row.partNo
  2444. this.modalData.partDesc = row.partDesc
  2445. this.partDisableFlag = false
  2446. },
  2447. // 每页数
  2448. sizeChangeHandle (val) {
  2449. this.pageSize = val
  2450. this.pageIndex = 1
  2451. this.getDataList()
  2452. },
  2453. // 当前页
  2454. currentChangeHandle (val) {
  2455. this.pageIndex = val
  2456. this.getDataList()
  2457. },
  2458. addModal () {
  2459. this.modalData = {
  2460. site: this.$store.state.user.site,
  2461. buNo: '*',
  2462. // bu: this.userBuList[0].buNo,
  2463. flag: '1',
  2464. partNo: '',
  2465. partDesc: '',
  2466. familyID: '',
  2467. familyName: '',
  2468. umid: '',
  2469. supplierNo: '',
  2470. supplierDesc: '',
  2471. attributeRemark: '',
  2472. createTime: '',
  2473. updateBy: this.$store.state.user.name,
  2474. createBy: this.$store.state.user.name,
  2475. attributeType: 'A',
  2476. defaultValue: '',
  2477. standardValue: '',
  2478. maxValue: '',
  2479. minValue: '',
  2480. firstIPQCPatrolTime: '',
  2481. lastIPQCPatrolTime: '',
  2482. cycleIPQCPatrolTime: '',
  2483. exemptInspection: 'N',
  2484. iqcExempt: 'N',
  2485. faiExempt: 'N',
  2486. ipqcExempt: 'N',
  2487. pqcExempt: 'N',
  2488. fqcExempt: 'N',
  2489. oqcExempt: 'N',
  2490. sqcExempt: 'N'
  2491. }
  2492. this.modalDisableFlag = false
  2493. this.modalFlag = true
  2494. },
  2495. updateModal (row) {
  2496. this.modalData = {
  2497. site: row.site,
  2498. bu: row.site + '_' + row.buNo,
  2499. flag: '2',
  2500. partNo: row.partNo,
  2501. partDesc: row.partDesc,
  2502. familyID: row.familyID,
  2503. familyName: row.familyName,
  2504. umid: row.umid,
  2505. supplierNo: row.supplierNo,
  2506. supplierDesc: row.supplierDesc,
  2507. attributeRemark: row.attributeRemark,
  2508. updateBy: this.$store.state.user.name,
  2509. createBy: this.$store.state.user.name,
  2510. attributeType: 'A',
  2511. defaultValue: row.defaultValue,
  2512. standardValue: row.standardValue,
  2513. maxValue: row.maxValue,
  2514. minValue: row.minValue,
  2515. firstIPQCPatrolTime: row.firstIPQCPatrolTime,
  2516. lastIPQCPatrolTime: row.lastIPQCPatrolTime,
  2517. cycleIPQCPatrolTime: row.cycleIPQCPatrolTime,
  2518. exemptInspection: row.exemptInspection || 'N',
  2519. iqcExempt: row.iqcExempt || 'N',
  2520. faiExempt: row.faiExempt || 'N',
  2521. ipqcExempt: row.ipqcExempt || 'N',
  2522. pqcExempt: row.pqcExempt || 'N',
  2523. fqcExempt: row.fqcExempt || 'N',
  2524. oqcExempt: row.oqcExempt || 'N',
  2525. sqcExempt: row.sqcExempt || 'N'
  2526. }
  2527. this.modalDisableFlag = true
  2528. this.modalFlag = true
  2529. },
  2530. // 删除
  2531. deletePropertiesModel (row) {
  2532. this.$confirm(`是否删除这个检验模板?`, '提示', {
  2533. confirmButtonText: '确定',
  2534. cancelButtonText: '取消',
  2535. type: 'warning'
  2536. }).then(() => {
  2537. qcPartAttributeDelete(row).then(({data}) => {
  2538. if (data && data.code === 0) {
  2539. this.getDataList()
  2540. this.$message({
  2541. message: '操作成功',
  2542. type: 'success',
  2543. duration: 1500,
  2544. onClose: () => {}
  2545. })
  2546. } else {
  2547. this.$alert(data.msg, '错误', {
  2548. confirmButtonText: '确定'
  2549. })
  2550. }
  2551. })
  2552. }).catch(() => {
  2553. })
  2554. },
  2555. saveData () {
  2556. if (this.modalData.site === '' || this.modalData.site == null) {
  2557. this.$message.warning('请填写工厂编码!')
  2558. return
  2559. }
  2560. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  2561. this.$message.warning('请选择物料编码!')
  2562. return
  2563. }
  2564. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  2565. this.$message.warning('请选择物料名称!')
  2566. return
  2567. }
  2568. // let obj = document.getElementsByName('isExemptInspection')
  2569. // let s = ''
  2570. // for (let i = 0; i < obj.length; i++) {
  2571. // if (obj[i].checked) {
  2572. // s += obj[i].value + ','
  2573. // }
  2574. // }
  2575. // s = s.substring(0, s.length - 1)
  2576. // this.modalData.exemptInspection = s
  2577. if (this.modalData.flag === '1') {
  2578. qcPartAttributeSave(this.modalData).then(({data}) => {
  2579. if (data && data.code === 0) {
  2580. this.getDataList()
  2581. this.modalFlag = false
  2582. this.$message({
  2583. message: '操作成功',
  2584. type: 'success',
  2585. duration: 1500,
  2586. onClose: () => {}
  2587. })
  2588. } else {
  2589. this.$alert(data.msg, '错误', {
  2590. confirmButtonText: '确定'
  2591. })
  2592. }
  2593. })
  2594. } else {
  2595. qcPartAttributeEdit(this.modalData).then(({data}) => {
  2596. if (data && data.code === 0) {
  2597. this.getDataList()
  2598. this.modalFlag = false
  2599. this.$message({
  2600. message: '操作成功',
  2601. type: 'success',
  2602. duration: 1500,
  2603. onClose: () => {}
  2604. })
  2605. } else {
  2606. this.$alert(data.msg, '错误', {
  2607. confirmButtonText: '确定'
  2608. })
  2609. }
  2610. })
  2611. }
  2612. },
  2613. // 保存属性模板
  2614. saveDetail () {
  2615. // IPQC / IQC 的检验方式必填
  2616. this.normalizeDetailListIpqcInspectionMethod()
  2617. const missingMethod = (this.detailList || []).find(r => this.isInspectionMethodApplicable(r) && !r.ipqcInspectionMethod)
  2618. if (missingMethod) {
  2619. this.$message.warning('检验类型为IPQC或IQC时,“检验方式”为必填!')
  2620. return
  2621. }
  2622. for (let i = 0; i < this.detailList.length; i++) {
  2623. this.detailList[i].updateBy = this.$store.state.user.name
  2624. saveAttributeDetailed(this.detailList[i]).then(({data}) => {
  2625. if (data && data.code === 0) {
  2626. this.getDataList()
  2627. this.detailModelFlag = false
  2628. this.$message({
  2629. message: '操作成功',
  2630. type: 'success',
  2631. duration: 1500,
  2632. onClose: () => {}
  2633. })
  2634. } else {
  2635. this.$alert(data.msg, '错误', {
  2636. confirmButtonText: '确定'
  2637. }).then(() => {
  2638. return false
  2639. })
  2640. }
  2641. })
  2642. }
  2643. },
  2644. // 打开物料模板清单
  2645. detailModal (row) {
  2646. this.detailData.site = row.site
  2647. this.detailData.buNo = row.buNo
  2648. this.detailData.partNo = row.partNo
  2649. this.detailData.attributeNo = row.partNo
  2650. this.detailData.partDesc = row.partDesc
  2651. this.$set(this.detailData, 'inspectionTypeNo', '')
  2652. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2653. this.detailList = data.rows
  2654. this.normalizeDetailListIpqcInspectionMethod()
  2655. })
  2656. this.detailModelFlag = true
  2657. },
  2658. checkInspectionType () {
  2659. this.refreshTemplateLists()
  2660. if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') {
  2661. this.span1 = 12
  2662. this.span2 = 6
  2663. this.span3 = 6
  2664. } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') {
  2665. this.span1 = 12
  2666. this.span2 = 12
  2667. } else {
  2668. this.span1 = 24
  2669. }
  2670. },
  2671. checkInspectionType2 () {
  2672. this.refreshTemplateLists()
  2673. },
  2674. refreshTemplateLists () {
  2675. this.itemList1Loading = true
  2676. this.itemList2Loading = true
  2677. getPartTemplateLists(this.detailData).then(({data}) => {
  2678. if (data) {
  2679. this.itemList1 = data.row1 || []
  2680. this.itemList2 = data.row2 || []
  2681. }
  2682. }).catch(err => {
  2683. console.error('加载模板列表失败:', err)
  2684. }).finally(() => {
  2685. this.itemList1Loading = false
  2686. this.itemList2Loading = false
  2687. })
  2688. },
  2689. // 快速新增(与 boying-vue 一致)
  2690. addFastModal () {
  2691. if (!this.detailData.partNo || !this.detailData.site) {
  2692. this.$message.warning('请先选择要设置模板的物料!')
  2693. return
  2694. }
  2695. if (!this.options || this.options.length === 0) {
  2696. this.$message.warning('检验类型数据加载中,请稍后再试')
  2697. return
  2698. }
  2699. this.itemSelections1 = []
  2700. this.itemSelections2 = []
  2701. this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2702. if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') {
  2703. this.span1 = 12
  2704. this.span2 = 6
  2705. this.span3 = 6
  2706. } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') {
  2707. this.span1 = 12
  2708. this.span2 = 12
  2709. } else {
  2710. this.span1 = 24
  2711. }
  2712. this.operationSelections = []
  2713. this.resourceSelections = []
  2714. this.dataListOperationSelections = []
  2715. this.operationData.operationDesc = ''
  2716. this.resourceData.resourceId = ''
  2717. this.resourceData.resourceDesc = ''
  2718. this.selectionManufacturer = []
  2719. this.selectionManufacturer2 = []
  2720. this.dataListManufacturerSelections = []
  2721. this.selectionCustomer = []
  2722. this.selectionCustomer2 = []
  2723. this.dataListCustomerSelections = []
  2724. this.fastAddFlag = true
  2725. this.$nextTick(() => {
  2726. this.refreshTemplateLists()
  2727. })
  2728. },
  2729. // 可选项目
  2730. itemClickRow1 (row) {
  2731. if (this.$refs.itemTable1) {
  2732. this.$refs.itemTable1.toggleRowSelection(row)
  2733. }
  2734. },
  2735. // 已有项目
  2736. itemClickRow2 (row) {
  2737. if (this.$refs.itemTable2) {
  2738. this.$refs.itemTable2.toggleRowSelection(row)
  2739. }
  2740. },
  2741. selectFlag () {
  2742. return true
  2743. },
  2744. selectionItem1 (val) {
  2745. this.itemSelections1 = val
  2746. },
  2747. selectionItem2 (val) {
  2748. this.itemSelections2 = val
  2749. },
  2750. // 添加模板
  2751. addItem () {
  2752. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  2753. this.$message.warning('请选择可选模板!')
  2754. return
  2755. }
  2756. 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')) {
  2757. if (this.resourceSelections.length > 0 && this.operationSelections.length === 0) {
  2758. this.$message.warning('如果选择机台,必须要选择工序!')
  2759. return
  2760. }
  2761. }
  2762. this.addItemLoading = true
  2763. let inData = {
  2764. site: this.detailData.site,
  2765. buNo: this.detailData.buNo,
  2766. attributeNo: this.detailData.partNo,
  2767. itemList: this.itemSelections1,
  2768. operationList: this.operationSelections.map(item => item.operationDesc),
  2769. resourceIDList: this.resourceSelections.map(item => item.resourceId),
  2770. manufacturerList: this.selectionManufacturer || [],
  2771. customerList: this.selectionCustomer || [],
  2772. attributeType: this.detailData.attributeType || 'A',
  2773. inspectionTypeNo: this.detailData.inspectionTypeNo,
  2774. updateBy: this.$store.state.user.name
  2775. }
  2776. savePartAttributeDetails(inData).then(({data}) => {
  2777. if (data && data.code === 0) {
  2778. this.$message.success('添加成功!')
  2779. this.refreshTemplateLists()
  2780. this.itemSelections1 = []
  2781. this.operationSelections = []
  2782. this.resourceSelections = []
  2783. this.selectionManufacturer = []
  2784. this.selectionManufacturer2 = []
  2785. this.selectionCustomer = []
  2786. this.selectionCustomer2 = []
  2787. } else {
  2788. this.$message.error(data && data.msg ? data.msg : '添加失败')
  2789. }
  2790. }).catch(err => {
  2791. this.$message.error('添加失败:' + (err.message || '未知错误'))
  2792. }).finally(() => {
  2793. this.addItemLoading = false
  2794. })
  2795. },
  2796. // 删除模板
  2797. deleteItem () {
  2798. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  2799. this.$message.warning('请选择已有模板!')
  2800. return
  2801. }
  2802. this.deleteItemLoading = true
  2803. let inData = {
  2804. attributeNo: this.detailData.partNo,
  2805. itemList: this.itemSelections2,
  2806. attributeType: this.detailData.attributeType,
  2807. site: this.detailData.site,
  2808. buNo: this.detailData.buNo,
  2809. }
  2810. deletePartAttributeDetails(inData).then(({data}) => {
  2811. if (data && data.code === 0) {
  2812. this.$message.success('删除成功!')
  2813. this.refreshTemplateLists()
  2814. this.itemSelections2 = []
  2815. } else {
  2816. this.$message.error(data && data.msg ? data.msg : '删除失败')
  2817. }
  2818. }).catch(err => {
  2819. this.$message.error('删除失败:' + (err.message || '未知错误'))
  2820. }).finally(() => {
  2821. this.deleteItemLoading = false
  2822. })
  2823. },
  2824. // 关闭后刷新列表
  2825. refreshDetailList () {
  2826. this.$set(this.detailData, 'inspectionTypeNo', '')
  2827. searchPartAttributeDetails(this.detailData).then(({data}) => {
  2828. this.detailList = data.rows
  2829. this.normalizeDetailListIpqcInspectionMethod()
  2830. })
  2831. },
  2832. syncStandardInspectionTypeName () {
  2833. const o = this.options.find(i => i.inspectionTypeNo === this.standardDetailData.inspectionTypeNo)
  2834. if (o) {
  2835. this.standardDetailData.inspectionTypeName = o.inspectionTypeName
  2836. }
  2837. },
  2838. standardDetailModal (row) {
  2839. this.standardDetailData.site = row.site
  2840. this.standardDetailData.buNo = row.buNo
  2841. this.standardDetailData.partNo = row.partNo
  2842. this.standardDetailData.partDesc = row.partDesc
  2843. this.standardDetailData.attributeNo = row.partNo
  2844. this.standardDetailData.attributeType = 'A'
  2845. this.standardDetailData.itemType = 'D'
  2846. if (this.options && this.options.length > 0) {
  2847. this.standardDetailData.inspectionTypeNo = this.options[0].inspectionTypeNo
  2848. this.standardDetailData.inspectionTypeName = this.options[0].inspectionTypeName
  2849. }
  2850. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  2851. if (data.code === 0) {
  2852. this.standardDetailList = data.rows || []
  2853. }
  2854. })
  2855. this.standardDetailModelFlag = true
  2856. },
  2857. closeStandardDialog () {
  2858. this.standardDetailList = []
  2859. this.standardItemList1 = []
  2860. this.standardItemList2 = []
  2861. },
  2862. standardAddFastModal () {
  2863. this.syncStandardInspectionTypeName()
  2864. this.standardItemSelections1 = null
  2865. this.standardItemSelections2 = null
  2866. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2867. if (data.code === 0) {
  2868. this.standardItemList1 = data.row1 || []
  2869. this.standardItemList2 = data.row2 || []
  2870. }
  2871. })
  2872. this.standardFastAddFlag = true
  2873. },
  2874. standardSyncFromTemplate () {
  2875. const queryData = {
  2876. site: this.standardDetailData.site,
  2877. buNo: this.standardDetailData.buNo,
  2878. attributeNo: this.standardDetailData.attributeNo,
  2879. attributeType: 'A'
  2880. }
  2881. searchPartAttributeDetails(queryData).then(({data}) => {
  2882. const templates = (data.rows || []).filter(t => t.templateId)
  2883. if (templates.length === 0) {
  2884. this.$message.warning('没有已维护的检验模板,请先在检验模板清单中维护!')
  2885. return
  2886. }
  2887. const seen = new Set()
  2888. const uniqueTemplates = templates.filter(t => {
  2889. if (seen.has(t.templateId)) return false
  2890. seen.add(t.templateId)
  2891. return true
  2892. })
  2893. this.$confirm(`将根据全部检验类型下 ${uniqueTemplates.length} 个检验模板同步检验项目,已存在的项目将跳过,是否继续?`, '提示', {
  2894. confirmButtonText: '确定',
  2895. cancelButtonText: '取消',
  2896. type: 'warning'
  2897. }).then(() => {
  2898. const syncPromises = uniqueTemplates.map(t => syncPartAttrDetailedFromTemplate({
  2899. site: this.standardDetailData.site,
  2900. buNo: this.standardDetailData.buNo,
  2901. attributeNo: this.standardDetailData.attributeNo,
  2902. attributeType: 'A',
  2903. templateId: t.templateId,
  2904. inspectionTypeNo: t.inspectionTypeNo,
  2905. updateBy: this.$store.state.user.name
  2906. }))
  2907. return Promise.all(syncPromises)
  2908. }).then((results) => {
  2909. const failed = (results || []).filter(r => r && r.data && r.data.code !== 0)
  2910. if (failed.length > 0) {
  2911. this.$alert((failed[0].data && failed[0].data.msg) || '部分模板同步失败', '错误', { confirmButtonText: '确定' })
  2912. } else {
  2913. this.$message.success('同步成功')
  2914. }
  2915. this.standardRefreshDetailList()
  2916. }).catch(() => {})
  2917. })
  2918. },
  2919. standardGetItem () {
  2920. this.syncStandardInspectionTypeName()
  2921. getPartAttrItem(this.standardDetailData).then(({data}) => {
  2922. if (data.code === 0) {
  2923. this.standardItemList1 = data.rows || []
  2924. }
  2925. })
  2926. },
  2927. standardItemClickRow (row) {
  2928. this.standardCurrentRow = JSON.parse(JSON.stringify(row))
  2929. },
  2930. standardItemClickRow1 (row) {
  2931. this.$refs.standardItemTable1.toggleRowSelection(row)
  2932. },
  2933. standardItemClickRow2 (row) {
  2934. this.$refs.standardItemTable2.toggleRowSelection(row)
  2935. },
  2936. standardSelectionItem1 (val) {
  2937. this.standardItemSelections1 = val
  2938. },
  2939. standardSelectionItem2 (val) {
  2940. this.standardItemSelections2 = val
  2941. },
  2942. standardAddItem () {
  2943. if (this.standardItemSelections1 == null || this.standardItemSelections1.length === 0) {
  2944. this.$message.warning('请选择可选项目!')
  2945. return
  2946. }
  2947. if (!this.standardDetailData.inspectionTypeName) {
  2948. this.syncStandardInspectionTypeName()
  2949. }
  2950. let inData = {
  2951. site: this.standardDetailData.site,
  2952. buNo: this.standardDetailData.buNo,
  2953. attributeNo: this.standardDetailData.attributeNo,
  2954. attributeType: 'A',
  2955. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  2956. itemType: this.standardDetailData.itemType,
  2957. updateBy: this.$store.state.user.name,
  2958. itemList: this.standardItemSelections1
  2959. }
  2960. addPartAttrItemDetails(inData).then(({data}) => {
  2961. if (data && data.code === 0) {
  2962. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2963. if (data.code === 0) {
  2964. this.standardItemList1 = data.row1 || []
  2965. this.standardItemList2 = data.row2 || []
  2966. }
  2967. })
  2968. this.standardItemSelections1 = []
  2969. this.$message.success('操作成功')
  2970. } else {
  2971. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  2972. }
  2973. })
  2974. },
  2975. standardDeleteItem () {
  2976. if (this.standardItemSelections2 == null || this.standardItemSelections2.length === 0) {
  2977. this.$message.warning('请选择已有项目!')
  2978. return
  2979. }
  2980. let inData = {
  2981. site: this.standardDetailData.site,
  2982. buNo: this.standardDetailData.buNo,
  2983. attributeNo: this.standardDetailData.attributeNo,
  2984. attributeType: 'A',
  2985. updateBy: this.$store.state.user.name,
  2986. itemList: this.standardItemSelections2
  2987. }
  2988. delPartAttrItemDetails(inData).then(({data}) => {
  2989. if (data && data.code === 0) {
  2990. getPartAttrItemList(this.standardDetailData).then(({data}) => {
  2991. if (data.code === 0) {
  2992. this.standardItemList1 = data.row1 || []
  2993. this.standardItemList2 = data.row2 || []
  2994. }
  2995. })
  2996. this.standardItemSelections2 = []
  2997. this.$message.success('操作成功')
  2998. } else {
  2999. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3000. }
  3001. })
  3002. },
  3003. standardRefreshDetailList () {
  3004. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3005. if (data.code === 0) {
  3006. this.standardDetailList = data.rows || []
  3007. }
  3008. })
  3009. },
  3010. saveStandardDetail () {
  3011. let tempData = {
  3012. site: this.standardDetailData.site,
  3013. buNo: this.standardDetailData.buNo,
  3014. attributeNo: this.standardDetailData.attributeNo,
  3015. attributeType: 'A',
  3016. inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
  3017. updateBy: this.$store.state.user.name,
  3018. itemList: this.standardDetailList
  3019. }
  3020. savePartAttrDetailed(tempData).then(({data}) => {
  3021. if (data && data.code === 0) {
  3022. this.getDataList()
  3023. this.standardDetailModelFlag = false
  3024. this.$message.success('操作成功')
  3025. } else {
  3026. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3027. }
  3028. })
  3029. },
  3030. standardDelItemDetails (row) {
  3031. this.$confirm('是否删除该检验项目?', '提示', {
  3032. confirmButtonText: '确定',
  3033. cancelButtonText: '取消',
  3034. type: 'warning'
  3035. }).then(() => {
  3036. delPartAttrItemDetails({
  3037. site: this.standardDetailData.site,
  3038. buNo: this.standardDetailData.buNo,
  3039. attributeNo: this.standardDetailData.attributeNo,
  3040. attributeType: 'A',
  3041. updateBy: this.$store.state.user.name,
  3042. itemList: [row]
  3043. }).then(({data}) => {
  3044. if (data && data.code === 0) {
  3045. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3046. if (data.code === 0) {
  3047. this.standardDetailList = data.rows || []
  3048. }
  3049. })
  3050. this.$message.success('操作成功')
  3051. } else {
  3052. this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
  3053. }
  3054. })
  3055. }).catch(() => {})
  3056. },
  3057. standardGoUp () {
  3058. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  3059. this.$message.warning('请先点击表格选择一行')
  3060. return
  3061. }
  3062. const row = {
  3063. ...this.standardCurrentRow,
  3064. site: this.standardDetailData.site,
  3065. buNo: this.standardDetailData.buNo,
  3066. attributeNo: this.standardDetailData.attributeNo
  3067. }
  3068. goUpPartAttrItem(row).then(({data}) => {
  3069. if (data && data.code === 0) {
  3070. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3071. if (data.code === 0) {
  3072. this.standardDetailList = data.rows || []
  3073. for (let i = 0; i < this.standardDetailList.length; i++) {
  3074. if (this.standardDetailList[i].itemNo === row.itemNo) {
  3075. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  3076. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  3077. break
  3078. }
  3079. }
  3080. this.$message.success('操作成功')
  3081. }
  3082. })
  3083. }
  3084. })
  3085. },
  3086. standardGoDown () {
  3087. if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
  3088. this.$message.warning('请先点击表格选择一行')
  3089. return
  3090. }
  3091. const row = {
  3092. ...this.standardCurrentRow,
  3093. site: this.standardDetailData.site,
  3094. buNo: this.standardDetailData.buNo,
  3095. attributeNo: this.standardDetailData.attributeNo
  3096. }
  3097. goDownPartAttrItem(row).then(({data}) => {
  3098. if (data && data.code === 0) {
  3099. partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
  3100. if (data.code === 0) {
  3101. this.standardDetailList = data.rows || []
  3102. for (let i = 0; i < this.standardDetailList.length; i++) {
  3103. if (this.standardDetailList[i].itemNo === row.itemNo) {
  3104. this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
  3105. this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
  3106. break
  3107. }
  3108. }
  3109. this.$message.success('操作成功')
  3110. }
  3111. })
  3112. }
  3113. })
  3114. },
  3115. // 删除物料属性中的模板
  3116. deletePartAttributeDetails (row) {
  3117. this.$confirm(`是否删除这个检验模板?`, '提示', {
  3118. confirmButtonText: '确定',
  3119. cancelButtonText: '取消',
  3120. type: 'warning'
  3121. }).then(() => {
  3122. deletePartAttributeDetails(row).then(({data}) => {
  3123. if (data && data.code === 0) {
  3124. searchPartAttributeDetails(this.detailData).then(({data}) => {
  3125. this.detailList = data.rows
  3126. this.normalizeDetailListIpqcInspectionMethod()
  3127. })
  3128. this.$message({
  3129. message: '操作成功',
  3130. type: 'success',
  3131. duration: 1500,
  3132. onClose: () => {}
  3133. })
  3134. } else {
  3135. this.$alert(data.msg, '错误', {
  3136. confirmButtonText: '确定'
  3137. })
  3138. }
  3139. })
  3140. }).catch(() => {
  3141. })
  3142. },
  3143. // 校验用户是否收藏
  3144. favoriteIsOk () {
  3145. let userFavorite = {
  3146. userId: this.$store.state.user.id,
  3147. languageCode: this.$i18n.locale
  3148. }
  3149. userFavoriteList(userFavorite).then(({data}) => {
  3150. for (let i = 0; i < data.list.length; i++) {
  3151. if (this.$route.meta.menuId === data.list[i].menuId) {
  3152. this.favorite = true
  3153. }
  3154. }
  3155. })
  3156. },
  3157. // 收藏 OR 取消收藏
  3158. favoriteFunction () {
  3159. let userFavorite = {
  3160. userId: this.$store.state.user.id,
  3161. functionId: this.$route.meta.menuId,
  3162. }
  3163. if (this.favorite) {
  3164. removeUserFavorite(userFavorite).then(({data}) => {
  3165. this.$message.success(data.msg)
  3166. this.favorite = false
  3167. })
  3168. } else {
  3169. // 收藏
  3170. saveUserFavorite(userFavorite).then(({data}) => {
  3171. this.$message.success(data.msg)
  3172. this.favorite = true
  3173. })
  3174. }
  3175. },
  3176. //导出excel
  3177. async createExportData() {
  3178. this.searchData.limit = -1
  3179. this.searchData.page = 1
  3180. await qcPartAttributeSearch(this.searchData).then(({data}) => {
  3181. this.exportList= data.page.list
  3182. })
  3183. return this.exportList
  3184. },
  3185. startDownload() {},
  3186. finishDownload() {},
  3187. fields () {
  3188. let json = "{"
  3189. this.columnList.forEach((item, index) => {
  3190. if (index == this.columnList.length - 1) {
  3191. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  3192. } else {
  3193. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  3194. }
  3195. })
  3196. json += "}"
  3197. let s = eval("(" + json + ")")
  3198. return s
  3199. },
  3200. // 导入
  3201. qcUpload () {
  3202. let currentData = {
  3203. flag: 'partAttribute',
  3204. createBy: this.$store.state.user.name,
  3205. site: this.$store.state.user.site,
  3206. }
  3207. //打开组件 去做新增业务
  3208. this.$nextTick(() => {
  3209. this.$refs.qcUpload.init(currentData)
  3210. })
  3211. },
  3212. // 获取工序列表
  3213. getOperationList () {
  3214. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  3215. getOperationDescList(this.operationData).then(({data}) => {
  3216. if (data && data.code === 0) {
  3217. this.operationList = data.rows
  3218. this.operationModelFlag = true
  3219. } else {
  3220. this.$message.error(data.msg)
  3221. }
  3222. })
  3223. },
  3224. // 获取机台列表
  3225. getAllResourceList () {
  3226. this.resourceData.site = this.detailData.site
  3227. getAllResourceList(this.resourceData).then(({data}) => {
  3228. if (data && data.code === 0) {
  3229. this.resourceList = data.rows
  3230. this.resourceModelFlag = true
  3231. } else {
  3232. this.$message.error(data.msg)
  3233. }
  3234. })
  3235. },
  3236. getOperationList2 () {
  3237. this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
  3238. getOperationDescList(this.operationData).then(({data}) => {
  3239. if (data && data.code === 0) {
  3240. this.operationList = data.rows
  3241. } else {
  3242. this.$message.error(data.msg)
  3243. }
  3244. })
  3245. },
  3246. getAllResourceList2 () {
  3247. this.resourceData.site = this.detailData.site
  3248. getAllResourceList(this.resourceData).then(({data}) => {
  3249. if (data && data.code === 0) {
  3250. this.resourceList = data.rows
  3251. } else {
  3252. this.$message.error(data.msg)
  3253. }
  3254. })
  3255. },
  3256. selectionOperationChangeHandle (val) {
  3257. this.operationSelections = val
  3258. },
  3259. operationSelect () {},
  3260. getRowKeys (row) {
  3261. return row.operationDesc
  3262. },
  3263. selectionResourceChangeHandle (val) {
  3264. this.resourceSelections = val
  3265. },
  3266. resourceSelect () {},
  3267. getRowKeys2 (row) {
  3268. return row.resourceId
  3269. },
  3270. confirmOperation () {
  3271. this.operationModelFlag = false
  3272. },
  3273. confirmResource () {
  3274. this.resourceModelFlag = false
  3275. },
  3276. getManufacturerList () {
  3277. this.manufacturerData.site = this.detailData.site
  3278. getManufacturerList(this.manufacturerData).then(({data}) => {
  3279. if (data && data.code === 0) {
  3280. this.manufacturerList = data.rows
  3281. this.$nextTick(() => this.$refs.manufacturerTable.clearSelection())
  3282. let tempDataList = this.selectionManufacturer
  3283. this.manufacturerList.forEach(val => {
  3284. if (tempDataList.includes(val.manufacturerID)) {
  3285. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  3286. }
  3287. })
  3288. this.manufacturerModelFlag = true
  3289. } else {
  3290. this.$message.error(data.msg)
  3291. }
  3292. })
  3293. },
  3294. getManufacturerList2 () {
  3295. this.manufacturerData.site = this.detailData.site
  3296. getManufacturerList(this.manufacturerData).then(({data}) => {
  3297. if (data && data.code === 0) {
  3298. this.manufacturerList = data.rows
  3299. let tempDataList = this.selectionManufacturer
  3300. this.manufacturerList.forEach(val => {
  3301. if (tempDataList.includes(val.manufacturerID)) {
  3302. this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true))
  3303. }
  3304. })
  3305. } else {
  3306. this.manufacturerList = []
  3307. }
  3308. })
  3309. },
  3310. getRowKeys3 (row) {
  3311. return row.manufacturerID
  3312. },
  3313. manufacturerClickRow (row) {
  3314. this.$refs.manufacturerTable.toggleRowSelection(row)
  3315. },
  3316. selectionManufacturerChangeHandle (val) {
  3317. this.dataListManufacturerSelections = val
  3318. },
  3319. confirmManufacturer () {
  3320. this.selectionManufacturer = []
  3321. this.selectionManufacturer2 = []
  3322. for (let i = 0; i < this.dataListManufacturerSelections.length; i++) {
  3323. this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID)
  3324. this.selectionManufacturer2.push(this.dataListManufacturerSelections[i])
  3325. }
  3326. this.manufacturerModelFlag = false
  3327. },
  3328. getCustomerList () {
  3329. this.customerData.site = this.detailData.site
  3330. getCustomerList(this.customerData).then(({data}) => {
  3331. if (data && data.code === 0) {
  3332. this.customerList = data.rows
  3333. this.$nextTick(() => this.$refs.customerTable.clearSelection())
  3334. let tempDataList = this.selectionCustomer
  3335. this.customerList.forEach(val => {
  3336. if (tempDataList.includes(val.customerID)) {
  3337. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  3338. }
  3339. })
  3340. this.customerModelFlag = true
  3341. } else {
  3342. this.$message.error(data.msg)
  3343. }
  3344. })
  3345. },
  3346. getCustomerList2 () {
  3347. this.customerData.site = this.detailData.site
  3348. getCustomerList(this.customerData).then(({data}) => {
  3349. if (data && data.code === 0) {
  3350. this.customerList = data.rows
  3351. let tempDataList = this.selectionCustomer
  3352. this.customerList.forEach(val => {
  3353. if (tempDataList.includes(val.customerID)) {
  3354. this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true))
  3355. }
  3356. })
  3357. } else {
  3358. this.customerList = []
  3359. }
  3360. })
  3361. },
  3362. customerClickRow (row) {
  3363. this.$refs.customerTable.toggleRowSelection(row)
  3364. },
  3365. selectionCustomerChangeHandle (val) {
  3366. this.dataListCustomerSelections = val
  3367. },
  3368. getRowKeys4 (row) {
  3369. return row.customerID
  3370. },
  3371. confirmCustomer () {
  3372. this.selectionCustomer = []
  3373. this.selectionCustomer2 = []
  3374. for (let i = 0; i < this.dataListCustomerSelections.length; i++) {
  3375. this.selectionCustomer.push(this.dataListCustomerSelections[i].customerID)
  3376. this.selectionCustomer2.push(this.dataListCustomerSelections[i])
  3377. }
  3378. this.customerModelFlag = false
  3379. },
  3380. // sop文件列表
  3381. sopFileList (row) {
  3382. this.sopData = {
  3383. site: row.site,
  3384. buNo: row.buNo,
  3385. partNo: row.partNo,
  3386. inspectionTypeNo: ''
  3387. }
  3388. this.getFileContentList()
  3389. },
  3390. getFileContentList () {
  3391. let tempData = {
  3392. orderRef1: this.sopData.site,
  3393. orderRef2: this.sopData.partNo,
  3394. orderRef3:this.sopData.inspectionTypeNo,
  3395. orderRef4: this.sopData.buNo,
  3396. }
  3397. getPartAttributeFileList(tempData).then(({data}) => {
  3398. if (data && data.code === 200) {
  3399. this.sopList = data.rows
  3400. } else {
  3401. this.sopList = []
  3402. }
  3403. })
  3404. this.sopFileModelFlag = true
  3405. },
  3406. // 上传sop文件模态框
  3407. uploadSopFile () {
  3408. let currentData = {
  3409. titleCon: '文件上传',
  3410. site: this.sopData.site,
  3411. buNo: this.sopData.buNo,
  3412. createBy: this.$store.state.user.name,
  3413. partNo: this.sopData.partNo,
  3414. inspectionTypeNo: '',
  3415. options: this.options
  3416. }
  3417. //打开组件 去做新增业务
  3418. this.$nextTick(() => {
  3419. this.$refs.qcSOPUploadFile.init(currentData)
  3420. })
  3421. },
  3422. // 文件下载
  3423. downloadFile (row) {
  3424. if (row.orderReftype === 'AttachmentList') {
  3425. const linkNode = document.createElement('a')
  3426. linkNode.href = this.$store.state.user.padSopUrl + row.url
  3427. linkNode.download = row.fileName
  3428. linkNode.target = '_blank'
  3429. linkNode.style.display = 'none'
  3430. document.body.appendChild(linkNode)
  3431. linkNode.click()
  3432. document.body.removeChild(linkNode)
  3433. return
  3434. }
  3435. downLoadObjectFile(row).then(({data}) => {
  3436. // 不限制文件下载类型
  3437. const blob = new Blob([data], {type: "application/octet-stream"})
  3438. // 下载文件名称
  3439. const fileName = row.fileName
  3440. // a标签下载
  3441. const linkNode = document.createElement('a')
  3442. // a标签的download属性规定下载文件的名称
  3443. linkNode.download = fileName
  3444. linkNode.style.display = 'none'
  3445. // 生成一个Blob URL
  3446. linkNode.href = URL.createObjectURL(blob)
  3447. document.body.appendChild(linkNode)
  3448. // 模拟在按钮上的一次鼠标单击
  3449. linkNode.click()
  3450. // 释放URL 对象
  3451. URL.revokeObjectURL(linkNode.href)
  3452. document.body.removeChild(linkNode)
  3453. })
  3454. },
  3455. // 删除文件
  3456. deleteFile (row) {
  3457. this.$confirm('确定要删除此文件?', '提示', {
  3458. confirmButtonText: '确定',
  3459. cancelButtonText: '取消',
  3460. type: 'warning'
  3461. }).then(() => {
  3462. deleteObjectFile(row).then(({data}) => {
  3463. if (data && data.code === 0) {
  3464. this.getFileContentList()
  3465. this.$message({
  3466. message: '操作成功',
  3467. type: 'success',
  3468. duration: 1500,
  3469. onClose: () => {}
  3470. })
  3471. } else {
  3472. this.$alert(data.msg, '错误', {
  3473. confirmButtonText: '确定'
  3474. })
  3475. }
  3476. })
  3477. }).catch(() => {
  3478. })
  3479. },
  3480. // 动态列开始 获取 用户保存的 格式列
  3481. async getTableUserColumn (tableId, columnId) {
  3482. let queryTableUser = {
  3483. userId: this.$store.state.user.name,
  3484. functionId: this.$route.meta.menuId,
  3485. tableId: tableId,
  3486. status: true,
  3487. languageCode: this.$i18n.locale
  3488. }
  3489. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  3490. if (data.rows.length > 0) {
  3491. //this.columnList1 = []
  3492. switch (columnId) {
  3493. case 1:
  3494. this.columnList = data.rows
  3495. break;
  3496. case 2:
  3497. this.columnDetailList = data.rows
  3498. break;
  3499. // case 3:
  3500. // this.columnList2 = data.rows
  3501. // break;
  3502. // case 4:
  3503. // this.columnList3 = data.rows
  3504. // break;
  3505. }
  3506. } else {
  3507. this.getColumnList(tableId, columnId)
  3508. }
  3509. })
  3510. },
  3511. // 获取 tableDefault 列
  3512. async getColumnList (tableId, columnId) {
  3513. let queryTable = {
  3514. functionId: this.$route.meta.menuId,
  3515. tableId: tableId,
  3516. languageCode: this.$i18n.locale
  3517. }
  3518. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  3519. if (!data.rows.length == 0) {
  3520. switch (columnId) {
  3521. case 1:
  3522. this.columnList = data.rows
  3523. break;
  3524. case 2:
  3525. this.columnDetailList = data.rows
  3526. break;
  3527. // case 3:
  3528. // this.columnList2 = data.rows
  3529. // break;
  3530. // case 4:
  3531. // this.columnList3 = data.rows
  3532. // break;
  3533. }
  3534. } else {
  3535. // this.showDefault = true.
  3536. }
  3537. })
  3538. },
  3539. closeDialog () {
  3540. this.partDetailData = {
  3541. partNo: '',
  3542. partDesc: '',
  3543. seqNo: '',
  3544. sku: '',
  3545. }
  3546. this.partInfoList = []
  3547. },
  3548. //获取按钮的权限数据
  3549. getButtonAuthData () {
  3550. let searchFlag = this.isAuth(this.menuId+":search")
  3551. let saveFlag = this.isAuth(this.menuId+":save")
  3552. let updateFlag = this.isAuth(this.menuId+":update")
  3553. let deleteFlag = this.isAuth(this.menuId+":delete")
  3554. let detailFlag = this.isAuth(this.menuId+":detail")
  3555. let fileFlag = this.isAuth(this.menuId+":file")
  3556. let checkoutFlag = this.isAuth(this.menuId+":checkout")
  3557. //处理页面的权限数据
  3558. this.authSearch = !searchFlag
  3559. this.authSave = !saveFlag
  3560. this.authUpdate = !updateFlag
  3561. this.authDelete = !deleteFlag
  3562. this.authDetail = !detailFlag
  3563. this.authFile = !fileFlag
  3564. this.authCheckout = !checkoutFlag
  3565. },
  3566. }
  3567. }
  3568. </script>
  3569. <style scoped>
  3570. .el-table /deep/ .cell{
  3571. height: auto;
  3572. line-height: 1.5;
  3573. }
  3574. .qc-more-dropdown-trigger {
  3575. cursor: pointer;
  3576. color: #45C2B5;
  3577. margin-left: 1px;
  3578. font-size: 12px;
  3579. white-space: nowrap;
  3580. }
  3581. </style>