DialogFurnaceNoInfo.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. multipleSelected: {
  53. type: Function,
  54. default: null,
  55. },
  56. supplierId: {
  57. type: String,
  58. default: "",
  59. },
  60. });
  61. const { multipleSelected, supplierId } = toRefs(props);
  62. const productList = ref([]);
  63. const visible = ref(false);
  64. const lotId = ref({});
  65. const loading = ref(false);
  66. const queryParams = ref({
  67. });
  68. const details = ref([])
  69. const selections = ref([]);
  70. /**
  71. * 对话框打开 事件
  72. */
  73. function open(data) {
  74. queryParams.value = data.queryParams
  75. details.value = data.details
  76. visible.value = true;
  77. getList();
  78. }
  79. /**
  80. * 对话框关闭 事件
  81. */
  82. function close() {
  83. // proxy.$refs.dialogForm.resetFields();
  84. proxy.$refs.dialogTable.clearSelection();
  85. visible.value = false;
  86. }
  87. /**
  88. * 加载数据
  89. */
  90. function getList() {
  91. loading.value = true;
  92. getFurnaceNoInfo(queryParams.value).then((res) => {
  93. productList.value = res.data;
  94. loading.value = false;
  95. });
  96. }
  97. /**
  98. * 列表checkbox列选择 事件
  99. */
  100. function handleSelectionChange(selection) {
  101. selections.value = selection;
  102. }
  103. /** 搜索 事件 */
  104. function handleSearch() {
  105. getList();
  106. }
  107. /** 多选事件 */
  108. function handleMultipleSelected() {
  109. if (multipleSelected.value) {
  110. multipleSelected.value(selections.value, lotId.value);
  111. }
  112. close();
  113. }
  114. function handleSingleSelected(row) {
  115. if (singleSelected.value) {
  116. singleSelected.value(details.value, row);
  117. }
  118. close();
  119. }
  120. defineExpose({
  121. open,
  122. });
  123. </script>