term.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div>
  3. <ele-pro-table
  4. ref="table"
  5. :columns="columns"
  6. :datasource="list"
  7. max-height="calc(100vh - 605px)"
  8. tool-class="ele-toolbar-form"
  9. row-key="qualityLevelId"
  10. @columns-change="handleColumnChange"
  11. :cache-key="cacheKeyUrl"
  12. >
  13. <template v-slot:textType="{ row }">
  14. {{
  15. row.textType == 1
  16. ? '数值'
  17. : row.textType == 2
  18. ? '选择'
  19. : row.textType == 3
  20. ? '上下限'
  21. : row.textType == 4
  22. ? '规格'
  23. : row.textType == 5
  24. ? '时间'
  25. : row.textType == 6
  26. ? '范围'
  27. : ''
  28. }}
  29. </template>
  30. <template v-slot:type="{ row }">
  31. {{ getDictValue('质检标准类型', row.qualityStandardType) }}
  32. </template>
  33. <template v-slot:defaultValue="{ row }">
  34. <div style="display: flex">
  35. <div
  36. v-if="row.textType == 3"
  37. style="display: flex; align-items: center"
  38. >
  39. {{ row.minValue }} {{row.unit}}
  40. <span>&nbsp;&nbsp;-</span>
  41. {{ row.maxValue }}{{row.unit}}
  42. </div>
  43. <div v-else >
  44. {{ row.defaultValue }} {{row.unit}}
  45. </div>
  46. </div>
  47. </template>
  48. <template v-slot:qualityResultValue="{ row }">
  49. <el-input
  50. v-model="row.qualityResultValue"
  51. ></el-input>
  52. </template>
  53. <template v-slot:qualityResult="{ row }">
  54. <el-select
  55. v-model="row.qualityResult"
  56. placeholder="请选择"
  57. style="width: 100%"
  58. clearable
  59. :disabled="isDetails"
  60. >
  61. <el-option
  62. v-for="item in qualityList"
  63. :label="item.name"
  64. :key="item.value"
  65. :value="item.value"
  66. />
  67. </el-select>
  68. </template>
  69. </ele-pro-table>
  70. </div>
  71. </template>
  72. <script>
  73. import dictMixins from '@/mixins/dictMixins';
  74. import { getByCode } from '@/api/system/dictionary-data';
  75. import tabMixins from '@/mixins/tableColumnsMixin';
  76. export default {
  77. components: {},
  78. mixins: [dictMixins,tabMixins],
  79. props: {
  80. qualityParam: {
  81. type: Array
  82. },
  83. isDetails: {
  84. type: Boolean,
  85. default: false
  86. }
  87. },
  88. watch: {
  89. qualityParam: {
  90. handler(val) {
  91. this.list = val;
  92. this.$forceUpdate();
  93. },
  94. deep: true,
  95. immediate: true
  96. }
  97. },
  98. data() {
  99. return {
  100. list: [],
  101. dictList: [],
  102. qualityList: [{
  103. name: '合格',
  104. value: 1
  105. },
  106. {
  107. name: '不合格',
  108. value: 2
  109. },
  110. {
  111. name: '让步接受',
  112. value: 3
  113. },
  114. ],
  115. cacheKeyUrl: 'qms-c2e9664a-inspectionWork-components-term',
  116. columns: [
  117. {
  118. prop: 'categoryLevelName',
  119. label: '质检类型',
  120. align: 'center',
  121. minWidth: 110
  122. },
  123. {
  124. prop: 'inspectionName',
  125. label: '质检名称',
  126. showOverflowTooltip: true,
  127. align: 'center',
  128. minWidth: 110
  129. },
  130. {
  131. prop: 'defaultValue',
  132. slot: 'defaultValue',
  133. label: '工艺参数',
  134. align: 'center',
  135. minWidth: 180
  136. },
  137. {
  138. label: '工艺要求',
  139. prop: 'inspectionStandard',
  140. formatter: (row, column, cellValue) => {
  141. return row.symbol + ' ' + cellValue + ' ' + row.unit;
  142. },
  143. minWidth: 350
  144. },
  145. {
  146. prop: 'qualityResultValue',
  147. slot: 'qualityResultValue',
  148. label: '质检结果参数',
  149. align: 'center',
  150. minWidth: 160
  151. },
  152. {
  153. prop: 'qualityResult',
  154. slot: 'qualityResult',
  155. label: '质检结果',
  156. align: 'center',
  157. minWidth: 100
  158. },
  159. ]
  160. };
  161. },
  162. created() {
  163. this.requestDict('质检标准类型');
  164. // this.getDictList('mathematical_symbol');
  165. },
  166. methods: {
  167. async getDictList(code) {
  168. let { data: res } = await getByCode(code);
  169. this.dictList = res.map((item) => {
  170. let values = Object.keys(item);
  171. return {
  172. value: Number(values[0]),
  173. label: item[values[0]]
  174. };
  175. });
  176. },
  177. getDate() {
  178. return this.list;
  179. }
  180. }
  181. };
  182. </script>
  183. <style lang="scss" scoped>
  184. .content_box {
  185. width: 100%;
  186. margin-top: 12px;
  187. max-height: 42vh;
  188. overflow-y: scroll;
  189. }
  190. .content_ll_case {
  191. display: flex;
  192. flex-wrap: wrap;
  193. background: #e6f7ff;
  194. line-height: 30px;
  195. }
  196. .content_ll {
  197. height: 30px;
  198. width: 23%;
  199. display: flex;
  200. flex-direction: row;
  201. align-items: center;
  202. margin: auto;
  203. .name {
  204. color: #000;
  205. font-weight: 500;
  206. margin-right: 8px;
  207. }
  208. }
  209. ::v-deep .el-table--medium .el-table__cell {
  210. padding: 4px 0 !important;
  211. }
  212. ::v-deep .el-form-item__content {
  213. line-height: 28px !important;
  214. }
  215. </style>