index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <div class="page-container column-container">
  3. <!-- 搜索区 -->
  4. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
  5. <el-form-item label="产品描述:">
  6. <el-input placeholder="请输入产品描述" @keydown.enter.prevent @keyup.enter="handleQuery" clearable
  7. v-model="queryParams.productDescription" @blur="handleTrimQuarms" style="width: 160px" />
  8. </el-form-item>
  9. <el-form-item label="计划单号:">
  10. <el-input placeholder="请输入计划单号" @keydown.enter.prevent @keyup.enter="handleQuery" clearable
  11. v-model="queryParams.productionPlanNo" @blur="handleTrimQuarms" style="width: 160px" />
  12. </el-form-item>
  13. <el-form-item label="批号状态:" label-width="100px">
  14. <el-select v-model="queryParams.lotCodeStatusCode" clearable placeholder="请选择批号状态" style="width: 150px">
  15. <el-option v-for="dict in lot_code_status_code" :key="dict.value" :label="dict.label"
  16. :value="dict.value"></el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
  21. </el-form-item>
  22. </el-form>
  23. <!-- 列表区 -->
  24. <div class="el-table-container">
  25. <div class="el-table-inner-container">
  26. <el-table v-loading="loading" :data="productionPlanList" height="100%">
  27. <el-table-column type="index" label="行号" width="50" align="center"></el-table-column>
  28. <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
  29. <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center">
  30. <template #default="scope">
  31. <el-button link type="primary" @click="handleColumnClick(scope.row)"><span>{{ scope.row.productionPlanNo
  32. }}</span></el-button>
  33. </template></el-table-column>
  34. <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
  35. <el-table-column label="产品描述" prop="productDescription" align="center" />
  36. <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
  37. <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
  38. <el-table-column label="总批数" prop="totalLotNumber" width="80" align="center" />
  39. <el-table-column label="单批量" prop="oneLotQuantity" width="80" align="center" />
  40. <el-table-column label="尾批量" prop="lastLotQuantity" width="80" align="center" />
  41. <el-table-column label="批号状态" prop="lotCodeStatusCode" width="100" align="center">
  42. <template #default="scope">
  43. <dict-tag :options="lot_code_status_code" :value="scope.row.lotCodeStatusCode" />
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
  47. <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
  48. <el-table-column label="库位" prop="storageLocation" width="80" align="center" />
  49. <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" fixed="right">
  50. <template #default="scope">
  51. <span>{{ scope.row.requisitionDepartmentName }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
  55. <el-table-column label="操作" width="200" fixed="right" align="center">
  56. <template #default="scope">
  57. <el-button link type="primary" icon="View" v-hasPermi="['business:productionPlan:query']"
  58. @click="handleView(scope.row)">查看</el-button>
  59. <el-button icon="edit" link type="warning" v-hasPermi="['business:productionPlan:edit']"
  60. @click="handleUpdateProduction(scope.row)">编辑</el-button>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. </div>
  65. </div>
  66. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  67. v-model:limit="queryParams.pageSize" @pagination="getList" />
  68. <!-- 已经生产的批次 -->
  69. <produced-lot ref="producedLotFormRef"></produced-lot>
  70. <!-- 工艺版本变更弹窗 -->
  71. <production-dialog ref="productionDetailRef" @handleUpdateSuccess="handleFresh" />
  72. </div>
  73. </template>
  74. <script setup name="ReviseBath">
  75. import { getP2Plan } from "@/api/business/p2.js";
  76. import producedLot from "./producedLotForm.vue";
  77. import productionDialog from "./DialogProduction";
  78. import { ref } from "vue";
  79. import router from "@/router";
  80. import queryStore from "@/store/modules/query";
  81. const { proxy } = getCurrentInstance();
  82. /** 字典数组区 */
  83. /** 查询 对象 */
  84. const productionPlanList = ref([]);
  85. const loading = ref(true);
  86. const total = ref(2);
  87. const { plan_status } = proxy.useDict("plan_status");
  88. const { lot_code_status_code } = proxy.useDict("lot_code_status_code");
  89. /** 查询对象 */
  90. const queryParams = ref({
  91. productionPlanNo: "",
  92. productDescription: "",
  93. planStatus: "",
  94. pullP2PlanDetails: false,
  95. pageNum: 1,
  96. pageSize: 10,
  97. startTime: "",
  98. endTime: "",
  99. });
  100. onMounted(() => {
  101. getList();
  102. });
  103. /**************************** 方法区 ****************************/
  104. /** 查询生产计划列表 */
  105. function getList() {
  106. loading.value = true;
  107. const listQueryParams = queryStore().reviseBathParams;
  108. if (listQueryParams != null) {
  109. queryParams.value = listQueryParams;
  110. }
  111. getP2Plan(queryParams.value).then((res) => {
  112. productionPlanList.value = res.rows;
  113. total.value = res.total;
  114. loading.value = false;
  115. queryParams.value.pullP2PlanDetails = false;
  116. // console.log(productionPlanList.value[0])
  117. });
  118. }
  119. /** 打开计划查询页 */
  120. function handleColumnClick(row) {
  121. // router.push({ path: "/Production/lot/" + row.productionPlanNo });
  122. router.push({
  123. name: "lotInfo",
  124. params: {
  125. productionPlanNo: row.productionPlanNo,
  126. lineNumber: row.lineNumber,
  127. },
  128. });
  129. }
  130. /** 查看按钮操作 */
  131. function handleView(row) {
  132. proxy.$refs.producedLotFormRef.open(row);
  133. }
  134. function handleFresh() {
  135. console.log(queryParams.value)
  136. getList();
  137. }
  138. function handleTrimQuarms(){
  139. queryParams.value.productionPlanNo = queryParams.value.productionPlanNo !=null&&queryParams.value.productionPlanNo !=""?queryParams.value.productionPlanNo.trim():null;
  140. queryParams.value.productDescription = queryParams.value.productDescription !=null&&queryParams.value.productDescription !=""?queryParams.value.productDescription.trim():null;
  141. }
  142. /** 搜索按钮操作 */
  143. function handleQuery() {
  144. queryParams.value.pageNum = 1;
  145. const listQueryParams = JSON.parse(JSON.stringify(queryParams.value));
  146. queryStore().setReviseBathParams(listQueryParams);
  147. getList();
  148. }
  149. //打开修改生产计划的版本弹窗
  150. function handleUpdateProduction(row) {
  151. proxy.$refs.productionDetailRef.open(row);
  152. }
  153. /**
  154. * 同步P2生产计划
  155. */
  156. const handleSyncP2Plan = () => {
  157. queryParams.value.pullP2PlanDetails = true;
  158. getList();
  159. };
  160. </script>
  161. <style lang="scss" scoped>
  162. .hyperlink {
  163. color: blue;
  164. text-decoration: underline;
  165. cursor: pointer;
  166. }
  167. .dashboard-total-item {
  168. display: flex;
  169. align-items: center;
  170. font-size: 16px;
  171. height: 120px;
  172. background-color: #f2f2f2;
  173. border-radius: 10px;
  174. >div:first-child {
  175. display: flex;
  176. flex: 2;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. >div.dashboard-total-item-label {
  181. display: flex;
  182. flex: 3;
  183. flex-direction: column;
  184. justify-content: center;
  185. >span {
  186. display: block;
  187. width: 60%;
  188. text-align: center;
  189. &:first-child {
  190. font-size: 16px;
  191. margin-bottom: 4px;
  192. letter-spacing: 2px;
  193. }
  194. &:last-child {
  195. font-weight: bold;
  196. font-size: 24px;
  197. }
  198. }
  199. }
  200. }
  201. .dashboard-total-item>.dashboard-total-item-label>span:last-child {
  202. color: #444444;
  203. }
  204. .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:first-child {
  205. margin-right: 8px;
  206. }
  207. .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:last-child {
  208. color: #4367df;
  209. }
  210. .dashboard-total-item>.number-label {
  211. font-size: 40px;
  212. margin-left: 16px;
  213. font-weight: bold;
  214. color: #5a6ac3;
  215. }
  216. </style>