standardDialog.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <el-dialog
  3. :visible.sync="equipmentdialog"
  4. :before-close="handleClose"
  5. :close-on-click-modal="true"
  6. :close-on-press-escape="false"
  7. append-to-body
  8. width="70%"
  9. >
  10. <div>
  11. <el-row>
  12. <el-col :span="12" class="table_col" v-if="equipmentdialog">
  13. <div class="title">工艺参数</div>
  14. <ele-pro-table
  15. ref="equiTable"
  16. :columns="columns"
  17. :datasource="datasource"
  18. :current.sync="current"
  19. highlight-current-row
  20. row-key="id"
  21. height="50vh"
  22. >
  23. <template v-slot:textType="{ row }">
  24. {{ row.textType == 1 ? '数值' : row.textType == 2 ? '选择' : row.textType == 3 ? '产品参数' : row.textType == 4 ? '规格' :
  25. row.textType == 5 ? '时间' : '' }}
  26. </template>
  27. </ele-pro-table>
  28. </el-col>
  29. <el-col :span="12" class="table_col" v-if="equipmentdialog">
  30. <div class="title">质检项</div>
  31. <ele-pro-table
  32. ref="equiTable"
  33. :columns="columns1"
  34. :datasource="datasource1"
  35. :current.sync="current1"
  36. highlight-current-row
  37. row-key="id"
  38. height="50vh"
  39. >
  40. </ele-pro-table>
  41. </el-col>
  42. </el-row>
  43. </div>
  44. <div class="btns">
  45. <el-button type="primary" size="small" @click="selected">选择</el-button>
  46. <el-button size="small" @click="handleClose">关闭</el-button>
  47. </div>
  48. </el-dialog>
  49. </template>
  50. <script>
  51. import { parameterList } from '@/api/inspectionStandard';
  52. import { getList } from '@/api/inspectionProject';
  53. export default {
  54. components: {},
  55. props: {
  56. selectList: Array,
  57. type: {
  58. default: 1 //1多选 2单选
  59. }
  60. },
  61. data() {
  62. return {
  63. equipmentdialog: false,
  64. current: null,
  65. current1: null,
  66. columns: [
  67. {
  68. prop: 'code',
  69. label: '参数编码',
  70. // sortable: 'custom',
  71. showOverflowTooltip: true,
  72. align: 'center',
  73. minWidth: 110
  74. },
  75. {
  76. prop: 'name',
  77. label: '参数名称',
  78. showOverflowTooltip: true,
  79. align: 'center',
  80. minWidth: 110
  81. },
  82. {
  83. prop: 'textType',
  84. label: '参数类型',
  85. showOverflowTooltip: true,
  86. align: 'center',
  87. slot: 'textType',
  88. minWidth: 110
  89. },
  90. {
  91. align: 'center',
  92. prop: 'description',
  93. label: '文本描述',
  94. showOverflowTooltip: true,
  95. minWidth: 110
  96. },
  97. {
  98. prop: 'maxValue',
  99. label: '参数上限',
  100. align: 'center',
  101. showOverflowTooltip: true
  102. },
  103. {
  104. prop: 'minValue',
  105. label: '参数下限',
  106. align: 'center',
  107. showOverflowTooltip: true
  108. },
  109. {
  110. prop: 'defaultValue',
  111. label: '默认值',
  112. align: 'center',
  113. showOverflowTooltip: true
  114. },
  115. {
  116. prop: 'categoryType',
  117. label: '参数分类',
  118. align: 'center',
  119. slot: 'status',
  120. showOverflowTooltip: true
  121. }
  122. ],
  123. columns1: [
  124. {
  125. prop: 'inspectionCode',
  126. label: '编码'
  127. },
  128. {
  129. label: '质检项名称',
  130. prop: 'inspectionName'
  131. },
  132. // {
  133. // label: '是否生成过程',
  134. // prop: 'isCreateCourse',
  135. // formatter: (row, column, cellValue) => {
  136. // return cellValue == 1 ? '是' : cellValue === 0 ? '否' : '';
  137. // }
  138. // },
  139. {
  140. label: '质检标准',
  141. prop: 'inspectionStandard'
  142. },
  143. // {
  144. // label: '质检工具',
  145. // prop: 'inspectionTool'
  146. // },
  147. {
  148. label: '状态',
  149. prop: 'status',
  150. formatter: (row, column, cellValue) => {
  151. return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
  152. }
  153. },
  154. {
  155. label: '描述',
  156. prop: 'description'
  157. },
  158. {
  159. label: '备注',
  160. prop: 'inspectionRemark'
  161. }
  162. ],
  163. categoryLevelId: null,
  164. code: null,
  165. selection: [],
  166. ids: []
  167. };
  168. },
  169. watch: {},
  170. methods: {
  171. datasource({ page, where, limit }) {
  172. return parameterList({
  173. ...where,
  174. pageNum: page,
  175. size: limit
  176. });
  177. },
  178. datasource1({ page, where, limit }) {
  179. return getList({
  180. ...where,
  181. pageNum: page,
  182. size: limit
  183. });
  184. },
  185. open() {
  186. this.equipmentdialog = true;
  187. },
  188. handleClose() {
  189. this.equipmentdialog = false;
  190. },
  191. // 选择
  192. selected() {
  193. this.$emit('choose', {
  194. parameter: JSON.parse(JSON.stringify(this.current)),
  195. project: JSON.parse(JSON.stringify(this.current1))
  196. });
  197. this.handleClose();
  198. }
  199. }
  200. };
  201. </script>
  202. <style lang="scss" scoped>
  203. .title {
  204. font-size: 16px;
  205. margin-bottom: 20px;
  206. }
  207. .btns {
  208. text-align: center;
  209. padding: 10px 0;
  210. }
  211. </style>