DialogFurnaceNoInfo.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <el-dialog title="选择炉号" v-model="visible" width="800px" height="400px" @close="close" append-to-body draggable>
  3. <!-- <el-form ref="dialogForm" :model="queryParams" :inline="true" style="padding-top: 16px">
  4. <el-form-item label="炉号:" prop="code" label-width="104">
  5. <el-input v-model.trim="queryParams.processAlias" type="text" @keydown.enter.prevent style="width: 160px"
  6. placeholder="请输入关键字" :clearable="true" @keyup.enter="handleSearch" />
  7. </el-form-item>
  8. <el-form-item label-width="20px">
  9. <el-button type="info" icon="Search" @click="handleSearch">搜索</el-button>
  10. </el-form-item>
  11. </el-form> -->
  12. <el-table ref="dialogTable" :data="productList" size="small" v-loading="loading" border height="370px"
  13. @selection-change="handleSelectionChange">
  14. <!-- <el-table-column type="selection" width="40" align="center" /> -->
  15. <el-table-column label="序号" width="56" align="center" type="index" />
  16. <el-table-column label="材料厂家" align="center" prop="factory" />
  17. <el-table-column label="炉号" align="center" prop="furnaceNumber" />
  18. <el-table-column label="牌号" align="center" prop="brandNumber" />
  19. <el-table-column label="规格" align="center" prop="spec" />
  20. <el-table-column label="材料直径" align="center" prop="diameter" />
  21. <el-table-column label="形状" align="center" prop="shape" />
  22. <el-table-column label="来料日期" align="center" prop="incomingDate" />
  23. <el-table-column label="原料编码" align="center" prop="rawMaterialCode" />
  24. <el-table-column label="操作" align="center" prop="rawMaterialCode">
  25. <template #default="scope">
  26. <el-button type="success" icon="finished" circle @click="handleSingleSelected(scope.row)" />
  27. </template>
  28. </el-table-column>
  29. </el-table>
  30. <!-- 分页 -->
  31. <!-- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  32. v-model:limit="queryParams.pageSize" @pagination="getList" /> -->
  33. <!-- <template #footer>
  34. <div class="dialog-footer">
  35. <el-button type="primary" icon="Check" :disabled="selections.length === 0" @click="handleMultipleSelected">
  36. 确 定
  37. </el-button>
  38. <el-button type="danger" icon="Close" @click="close">取 消</el-button>
  39. </div>
  40. </template> -->
  41. </el-dialog>
  42. </template>
  43. <script setup>
  44. // import { carrierForOutsource } from "@/api/business/outsourcedOrder";
  45. import { getFurnaceNoInfo } from '@/api/business/p2'
  46. const { proxy } = getCurrentInstance();
  47. /** 字典数组区 */
  48. const { process_status } = proxy.useDict("process_status");
  49. /** 工序变量 */
  50. const total = ref(0);
  51. const props = defineProps({
  52. singleSelected: {
  53. type: Function,
  54. default: null,
  55. },
  56. multipleSelected: {
  57. type: Function,
  58. default: null,
  59. },
  60. supplierId: {
  61. type: String,
  62. default: "",
  63. },
  64. });
  65. const { multipleSelected, supplierId } = toRefs(props);
  66. const productList = ref([]);
  67. const visible = ref(false);
  68. const lotId = ref({});
  69. const loading = ref(false);
  70. const queryParams = ref({
  71. });
  72. const details = ref([])
  73. const selections = ref([]);
  74. /**
  75. * 对话框打开 事件
  76. */
  77. function open(data) {
  78. queryParams.value = data.queryParams
  79. details.value = data.details
  80. visible.value = true;
  81. getList();
  82. }
  83. /**
  84. * 对话框关闭 事件
  85. */
  86. function close() {
  87. // proxy.$refs.dialogForm.resetFields();
  88. proxy.$refs.dialogTable.clearSelection();
  89. visible.value = false;
  90. }
  91. /**
  92. * 加载数据
  93. */
  94. function getList() {
  95. loading.value = true;
  96. getFurnaceNoInfo(queryParams.value).then((res) => {
  97. productList.value = res.data;
  98. loading.value = false;
  99. });
  100. }
  101. /**
  102. * 列表checkbox列选择 事件
  103. */
  104. function handleSelectionChange(selection) {
  105. selections.value = selection;
  106. }
  107. /** 搜索 事件 */
  108. function handleSearch() {
  109. getList();
  110. }
  111. /** 多选事件 */
  112. function handleMultipleSelected() {
  113. if (multipleSelected.value) {
  114. multipleSelected.value(selections.value, lotId.value);
  115. }
  116. close();
  117. }
  118. function handleSingleSelected(row) {
  119. if (singleSelected.value) {
  120. singleSelected.value(details.value, row);
  121. }
  122. close();
  123. }
  124. defineExpose({
  125. open,
  126. });
  127. </script>