sampleListDialog.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!-- 用户编辑弹窗 -->
  2. <template>
  3. <ele-modal :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
  4. :close-on-press-escape="false" append-to-body width="80%" :maxable="true">
  5. <el-table :data="tableData" :default-expand-all="true">
  6. <el-table-column type="expand">
  7. <template slot-scope="props">
  8. <div style="padding: 10px;">
  9. <el-table :data="props.row.children" border>
  10. <el-table-column label="质检方案编码" prop="qualitySchemeTemplateCode" align="center">
  11. </el-table-column>
  12. <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName"
  13. align="center"></el-table-column>
  14. <el-table-column label="质检类型" prop="categoryLevelClassName"
  15. align="center"></el-table-column>
  16. <el-table-column label="质检项编码" prop="inspectionCode" align="center"></el-table-column>
  17. <el-table-column label="质检项名称" prop="inspectionName" align="center"></el-table-column>
  18. <el-table-column label="工艺参数" prop="defaultValue" align="center">
  19. </el-table-column>
  20. <el-table-column label="质检内容" prop="qualityResultContent" align="center" fixed="right"
  21. width="360">
  22. <template slot-scope="scope">
  23. <el-input v-model="scope.row.qualityResultContent" placeholder="请输入内容"
  24. :disabled="type == 'detail'"></el-input>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="质检结果" prop="qualityResults" align="center" fixed="right">
  28. <template slot-scope="scope">
  29. <el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
  30. :disabled="type == 'detail'">
  31. <el-option v-for="item in qualityResultsList" :key="item.value"
  32. :label="item.label" :value="item.value">
  33. </el-option>
  34. </el-select>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. </div>
  39. </template>
  40. </el-table-column>
  41. <template v-for="column in tableColumns">
  42. <el-table-column :label="column.label" :prop="column.prop" :fixed="column.fixed"
  43. :show-overflow-tooltip="true" :width="column.width" :align="column.align">
  44. </el-table-column>
  45. </template>
  46. <el-table-column label="操作" align="center" width="80">
  47. <template slot-scope="scope">
  48. <el-link :underline="false" type="primary">
  49. 处置
  50. </el-link>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <template v-slot:footer v-if="type == 'report'">
  55. <el-button @click="handleClose">取消</el-button>
  56. <el-button type="primary" @click="handleConfirm">
  57. 确认
  58. </el-button>
  59. </template>
  60. </ele-modal>
  61. </template>
  62. <script>
  63. export default {
  64. components: {
  65. },
  66. data() {
  67. return {
  68. title: '',
  69. visible: false,
  70. rowIndex: 0,
  71. type: '',
  72. tableData: [],
  73. tableColumns: [
  74. {
  75. label: '编码',
  76. prop: 'categoryCode',
  77. width: '150',
  78. align: 'center'
  79. },
  80. {
  81. label: '名称',
  82. prop: 'categoryName',
  83. width: '150',
  84. align: 'center'
  85. },
  86. { label: '批次号', prop: 'batchNo', align: 'center' },
  87. // { label: '发货条码', prop: 'barcodes', align: 'center' },
  88. { label: '包装编码', prop: 'packageNo', align: 'center' },
  89. { label: '包装数量', prop: 'packingQuantity', align: 'center' },
  90. // { label: '包装单位', prop: 'packingUnit', align: 'center' },
  91. { label: '计量数量', prop: 'measureQuantity', align: 'center' },
  92. // { label: '计量单位', prop: 'measureUnit', align: 'center' },
  93. { label: '物料代号', prop: 'materielDesignation', align: 'center' },
  94. { label: '客户代号', prop: 'clientCode', align: 'center' },
  95. { label: '刻码', prop: 'engrave', align: 'center' },
  96. { label: '重量', prop: 'weight', align: 'center' },
  97. { label: '重量单位', prop: 'weightUnit', align: 'center' },
  98. { label: '仓库', prop: 'warehouseName', align: 'center', },
  99. { label: '质检结果', prop: '', align: 'center', },
  100. // { label: '货区', prop: 'areaName', align: 'center', },
  101. // { label: '货架', prop: 'goodsShelfName', align: 'center', },
  102. // { label: '货位', prop: 'goodsAllocationName', align: 'center', },
  103. // { label: '生产日期', prop: 'productionDate', align: 'center', },
  104. // { label: '采购日期', prop: 'purchaseDate', align: 'center', }
  105. ],
  106. qualityResultsList: [
  107. {
  108. value: 1,
  109. label: '合格'
  110. },
  111. {
  112. value: 2,
  113. label: '不合格'
  114. },
  115. {
  116. value: 3,
  117. label: '让步接收'
  118. },
  119. ]
  120. };
  121. },
  122. computed: {
  123. },
  124. created() { },
  125. methods: {
  126. async openDia(index, row, type, list) {
  127. this.rowIndex = index
  128. this.type = type;
  129. if (row.isStatus) {
  130. for (let i = 0; i < list.length; i++) {
  131. const arr = list[i].children
  132. for (let j = 0; j < arr.length; j++) {
  133. arr[j].qualityResults = 1
  134. }
  135. }
  136. }
  137. this.tableData = list;
  138. this.visible = true;
  139. },
  140. handleClose() {
  141. this.tableData.forEach((item) => {
  142. item.children.forEach((child) => {
  143. child.qualityResultContent = '';
  144. child.qualityResults = ''
  145. })
  146. })
  147. this.visible = false;
  148. },
  149. handleConfirm() {
  150. this.visible = false;
  151. this.$emit('handleConfirm', this.tableData, this.rowIndex);
  152. },
  153. }
  154. };
  155. </script>