form.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <!-- 添加或修改项目信息对话框 -->
  3. <el-drawer v-model="visible" size="90%" direction="rtl" :close-on-press-escape="false">
  4. <div class="page-container form-container">
  5. <div class="form-btns-container" style="display: flex; align-items: center;">
  6. <span class="title-label"><el-icon>
  7. <Document />
  8. </el-icon>
  9. 计划详情</span>
  10. </div>
  11. <!-- 主表 -->
  12. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
  13. <el-form-item label="产品描述:">
  14. <el-input placeholder="请输入产品描述" v-model.trim="queryParams.productDescription" style="width: 150px" clearable
  15. @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
  16. </el-form-item>
  17. <el-form-item label="批次号:">
  18. <el-input placeholder="请输入批次号" v-model.trim="queryParams.lotCode" style="width: 130px" clearable
  19. @keyup.enter="handleQuerydaywork" @keydown.enter.prevent />
  20. </el-form-item>
  21. <el-form-item label="工段:">
  22. <el-select-v2 v-model="queryParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 140px" />
  23. </el-form-item>
  24. <el-form-item label="是否回退:">
  25. <el-select v-model="queryParams.isFallback" placeholder="请选择是否回退">
  26. <el-option v-for="item in yes_no" :key="item.value" :label="item.label" :value="item.value"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item label="是否废品回用:">
  30. <el-select v-model="queryParams.isWasteRecycling" placeholder="请选择是否废品回用">
  31. <el-option v-for="item in yes_no" :key="item.value" :label="item.label" :value="item.value"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="info" icon="Search" @click="handleQuerydaywork">搜索</el-button>
  36. </el-form-item>
  37. <div style="margin-top: 20px;">
  38. <el-button type="primary" @click="handleFallback">回退</el-button>
  39. <el-button type="primary" @click="handleWasteRecycling">添加废品回用</el-button>
  40. <el-button type="primary" @click="handleQuerydaywork">分批</el-button>
  41. <el-button type="primary" @click="handleQuerydaywork">单批单改</el-button>
  42. <el-button type="primary" @click="handleQuerydaywork">多批单改</el-button>
  43. </div>
  44. </el-form>
  45. <!-- 列表区 -->
  46. <div class="el-table-container">
  47. <el-table ref="dayworkTable" v-loading="loading" row-key="id" @selection-change="handleSelectionChange"
  48. height="100%" :data="lotList">
  49. <el-table-column type="selection" width="40" align="center" />
  50. <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
  51. <el-table-column label="生产计划单号" width="100" prop="productionPlanNo" align="center" />
  52. <el-table-column label="批次号" prop="lotCode" width="130" align="center" />
  53. <el-table-column label="产品描述" prop="productDescription" align="center" />
  54. <el-table-column label="图纸版本" width="80" prop="technologyVersion" align="center" />
  55. <el-table-column label="投产量" width="100" prop="productionQuantity" align="center" />
  56. <el-table-column label="下达日期" prop="createTime" width="100" align="center">
  57. <template #default="scope">
  58. <span>{{
  59. proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
  60. }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="当前工段" width="100" prop="deptName" align="center" />
  64. <el-table-column label="当前工序" width="120" prop="processAlias" align="center" />
  65. <el-table-column label="回退" width="60" prop="isFallback" align="center">
  66. <template #default="scope">
  67. <dict-tag :options="yes_no" :value="scope.row.isFallback" />
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="废品回用" width="70" prop="isWasteRecycling" align="center">
  71. <template #default="scope">
  72. <dict-tag :options="yes_no" :value="scope.row.isWasteRecycling" />
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="批废" width="70" prop="isWaste" align="center">
  76. <template #default="scope">
  77. <dict-tag :options="yes_no" :value="scope.row.isWaste" />
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="母批号" prop="fromCode" align="center" />
  81. <el-table-column fixed="right" label="操作" align="center" width="140px">
  82. <template #default="scope">
  83. <el-button v-if="scope.row.isWaste == 0" link type="danger" icon="Delete"
  84. @click="handlelotWaste(scope.row)">批废
  85. </el-button>
  86. <el-button v-else link type="primary" icon="View" @click="handleChecklotWaste(scope.row)">查看
  87. </el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. </div>
  92. <lot-waste-dialog ref="lotWasteDialogRef" @handleSaveSuccess="open(currentProductionPlan)" />
  93. <waste-recycling-dialog ref="wasteRecyclingDialogRef"></waste-recycling-dialog>
  94. </div>
  95. </el-drawer>
  96. </template>
  97. <script setup>
  98. import {
  99. getDayworkInfo, getDeptList
  100. } from "@/api/business/daywork.js";
  101. import lotWasteDialog from './dayworkWasteDialog.vue'
  102. const { proxy } = getCurrentInstance();
  103. /** 字典数组区 */
  104. const { yes_no } = proxy.useDict("yes_no");
  105. /** 表单抽屉 页变量 */
  106. const currentProductionPlan = ref({});
  107. const loading = ref(false);
  108. const lotList = ref([])
  109. const visible = ref(false);
  110. const deptList = ref([])
  111. /** 查询对象 */
  112. const queryParams = ref({
  113. pageNum: 1,
  114. pageSize: 10,
  115. lotCode: "",
  116. deptId: null,
  117. isFallback: "",
  118. isWasteRecycling: "",
  119. });
  120. const queryDeptParams = ref({
  121. lineNumber: '',
  122. productionPlanNo: ''
  123. })
  124. /*********************** 方法区 ****************************/
  125. /** 打开抽屉 */
  126. const open = (row) => {
  127. currentProductionPlan.value = row;
  128. queryParams.value.lineNumber = row.lineNumber
  129. queryParams.value.productionPlanNo = row.productionPlanNo
  130. queryDeptParams.value.lineNumber = row.lineNumber
  131. queryDeptParams.value.productionPlanNo = row.productionPlanNo
  132. getDeptList(queryDeptParams.value).then(res => {
  133. if (res.code == 200) {
  134. deptList.value = res.data
  135. }
  136. })
  137. //获取工段信息
  138. getDayworkList()
  139. visible.value = true;
  140. };
  141. /**获取生产计划列表 */
  142. function getDayworkList() {
  143. loading.value = true;
  144. getDayworkInfo(queryParams.value).then(res => {
  145. if (res.code == 200) {
  146. lotList.value = res.rows
  147. loading.value = false
  148. }
  149. })
  150. }
  151. /**搜索 */
  152. function handleQuerydaywork() {
  153. getDayworkList()
  154. }
  155. /**批废 */
  156. function handlelotWaste(row) {
  157. //flag为true时代表批废
  158. row.flag = false
  159. proxy.$refs.lotWasteDialogRef.open(row)
  160. }
  161. /**查看 */
  162. function handleChecklotWaste(row) {
  163. row.flag = true
  164. proxy.$refs.lotWasteDialogRef.open(row)
  165. }
  166. /**
  167. * 对话框关闭 事件
  168. */
  169. function close() {
  170. visible.value = false;
  171. }
  172. /**搜索栏清空 */
  173. function reset() {
  174. queryParams.value = {
  175. pageNum: 1,
  176. pageSize: 10,
  177. lotCode: "",
  178. deptId: null,
  179. isFallback: "",
  180. isWasteRecycling: ""
  181. }
  182. proxy.resetForm("queryRef");
  183. }
  184. /** 取消按钮 */
  185. const handleCancel = () => {
  186. visible.value = false;
  187. };
  188. /** 暴露给父组件的方法 */
  189. defineExpose({
  190. open,
  191. });
  192. </script>