sampleListDialog.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.qualitySampleTemplateList" 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="" align="center">
  21. <template slot-scope="scope">
  22. <toolButtom
  23. v-model="scope.row.toolList"
  24. :type="'view'"
  25. :sList="sList"
  26. />
  27. </template>
  28. </el-table-column> -->
  29. <el-table-column label="质检内容" prop="qualityResultContent" align="center" fixed="right"
  30. width="360">
  31. <template slot-scope="scope">
  32. <el-input v-model="scope.row.qualityResultContent" placeholder="请输入内容"
  33. :disabled="type == 'detail'"></el-input>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="质检结果" prop="qualityResults" align="center" fixed="right">
  37. <template slot-scope="scope">
  38. <el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
  39. :disabled="type == 'detail'">
  40. <el-option v-for="item in qualityResultsList" :key="item.value"
  41. :label="item.label" :value="item.value">
  42. </el-option>
  43. </el-select>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <template v-for="column in tableColumns">
  51. <el-table-column :label="column.label" :prop="column.prop" :fixed="column.fixed"
  52. :show-overflow-tooltip="true" :width="column.width" :align="column.align"
  53. :formatter="column.formatter">
  54. </el-table-column>
  55. </template>
  56. <el-table-column label="操作" align="center" width="80">
  57. <template slot-scope="scope">
  58. <el-link :underline="false" type="primary"
  59. @click="handleDispose(scope.$index, scope.row, 'dispose')">
  60. 处置
  61. </el-link>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <template v-slot:footer v-if="type == 'report'">
  66. <el-button @click="handleClose">取消</el-button>
  67. <el-button type="primary" @click="handleConfirm">
  68. 确认
  69. </el-button>
  70. </template>
  71. </ele-modal>
  72. </template>
  73. <script>
  74. import toolButtom from './toolButtom.vue';
  75. export default {
  76. components: {
  77. toolButtom
  78. },
  79. data() {
  80. return {
  81. title: '',
  82. visible: false,
  83. rowIndex: 0,
  84. type: '',
  85. tableData: [],
  86. tableColumns: [
  87. {
  88. label: '编码',
  89. prop: 'categoryCode',
  90. width: '150',
  91. align: 'center'
  92. },
  93. {
  94. label: '名称',
  95. prop: 'categoryName',
  96. width: '150',
  97. align: 'center'
  98. },
  99. { label: '批次号', prop: 'batchNo', align: 'center' },
  100. // { label: '发货条码', prop: 'barcodes', align: 'center' },
  101. { label: '包装编码', prop: 'packageNo', align: 'center' },
  102. { label: '包装数量', prop: 'packingQuantity', align: 'center' },
  103. // { label: '包装单位', prop: 'packingUnit', align: 'center' },
  104. { label: '计量数量', prop: 'measureQuantity', align: 'center' },
  105. // { label: '计量单位', prop: 'measureUnit', align: 'center' },
  106. { label: '物料代号', prop: 'materielDesignation', align: 'center' },
  107. { label: '客户代号', prop: 'clientCode', align: 'center' },
  108. { label: '刻码', prop: 'engrave', align: 'center' },
  109. { label: '重量', prop: 'weight', align: 'center' },
  110. { label: '重量单位', prop: 'weightUnit', align: 'center' },
  111. { label: '仓库', prop: 'warehouseName', align: 'center', },
  112. {
  113. label: '质检结果', prop: 'qualityResults', align: 'center', formatter: (row, column) => {
  114. if (row.qualityResults) {
  115. return row.qualityResults == 1 ? '合格' : row.qualityResults == 2 ? '不合格' : row.qualityResults == 3 ? '让步接收' : '';
  116. }
  117. }
  118. },
  119. // { label: '货区', prop: 'areaName', align: 'center', },
  120. // { label: '货架', prop: 'goodsShelfName', align: 'center', },
  121. // { label: '货位', prop: 'goodsAllocationName', align: 'center', },
  122. // { label: '生产日期', prop: 'productionDate', align: 'center', },
  123. // { label: '采购日期', prop: 'purchaseDate', align: 'center', }
  124. ],
  125. qualityResultsList: [
  126. {
  127. value: 1,
  128. label: '合格'
  129. },
  130. {
  131. value: 2,
  132. label: '不合格'
  133. },
  134. {
  135. value: 3,
  136. label: '让步接收'
  137. },
  138. ],
  139. sList:[],//质检工具筛选
  140. };
  141. },
  142. computed: {
  143. },
  144. created() { },
  145. methods: {
  146. async openDia(index, row, type, list, isStatus, sList) {
  147. this.tableData = [];
  148. this.rowIndex = index
  149. this.type = type;
  150. // console.log(list, 'lklllllllllllllllllkkkkkkkkkkkkkkkkkkkkk', list[0].qualityResults);
  151. //如果质检项qualitySampleTemplateList只有一条数据且质检结果是让步接收
  152. if (list[0].qualitySampleTemplateList.length == 1) {
  153. for (let i = 0; i < list[0].qualitySampleTemplateList.length; i++) {
  154. list[0].qualitySampleTemplateList[i].qualityResults = list[0].qualityResults
  155. }
  156. }
  157. this.tableData = list;
  158. this.visible = true
  159. this.sList = sList;
  160. },
  161. handleClose() {
  162. this.visible = false;
  163. },
  164. handleConfirm() {
  165. this.visible = false;
  166. this.$emit('handleConfirm', this.tableData, this.rowIndex);
  167. },
  168. handleDispose(index, row, type) {
  169. this.$emit('handleDispose', index, row, type);
  170. },
  171. //选择质检工具
  172. openToolList(index, row) {
  173. this.$emit('openToolList', index, row);
  174. },
  175. }
  176. };
  177. </script>