lotFormParticulars.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <template>
  2. <div v-if="!loading" class="page-container column-container">
  3. <el-form class="list-search" style="" :model="lot" ref="queryRef" :inline="true">
  4. <el-row style="margin-top: 10px">
  5. <el-form-item class="bold-large">
  6. <span>{{ "批次号:" }}</span>
  7. <span>{{ lot.lotCode }}</span>
  8. </el-form-item>
  9. <el-form-item>
  10. <el-tag class="spacing" :type="status(lot)">{{
  11. statusText(lot)
  12. }}</el-tag>
  13. <el-tag v-if="lot.isWaste == 1" class="spacing" type="danger">{{
  14. "报废"
  15. }}</el-tag>
  16. <el-tag v-if="lot.isAmend == 1" class="spacing" type="danger">{{
  17. "工艺修改"
  18. }}</el-tag>
  19. <el-tag v-if="lot.isWasteRecycling == 1" class="spacing" type="primary">{{ "废品回用" }}</el-tag>
  20. </el-form-item>
  21. </el-row>
  22. <el-row :gutter="24" style="margin-top: 10px">
  23. <el-col :span="6">
  24. <el-form-item label="客户简称" class="custom-label">
  25. <span>{{ lot.productionPlanDetail.companyAlias }}</span>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="6">
  29. <el-form-item label="生产计划单" class="custom-label">
  30. <span>{{ lot.productionPlanDetail.productionPlanNo }}</span>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="6">
  34. <el-form-item label="序号" class="custom-label">
  35. <span style="margin-left: 28px">
  36. {{ lot.productionPlanDetail.lineNumber }}
  37. </span>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="6">
  41. <el-form-item label="产品描述" class="custom-label">
  42. <span>{{ lot.productionPlanDetail.productDescription }}</span>
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. <el-row :gutter="24" style="margin-top: 10px">
  47. <el-col :span="6">
  48. <el-form-item label="图纸版本" class="custom-label">
  49. <span>{{ lot.technologyVersion }}</span>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="6">
  53. <el-form-item label="单批量" class="custom-label">
  54. <span style="margin-left: 28px"> {{ lot.productionQuantity }}</span>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-form-item label="领料部门" class="custom-label">
  59. <span>{{
  60. lot.productionPlanDetail.requisitionDepartmentName
  61. }}</span>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="6">
  65. <el-form-item label="下达日期" class="custom-label">
  66. <span>{{ lot.productionPlanDetail.issueDate }}</span>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. <el-row :gutter="24" style="margin-top: 10px">
  71. <el-col :span="6">
  72. <el-form-item label="当前箱号" class="custom-label">
  73. <span>{{ lot.carrierName }}</span>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="6">
  77. <el-form-item label="母批号" class="custom-label">
  78. <span style="margin-left: 23px">{{ lot.fromCode }}</span>
  79. </el-form-item>
  80. </el-col>
  81. </el-row>
  82. <el-row style="margin-top: 10px">
  83. <span style="font-weight: bold; font-size: 18px">基础信息</span>
  84. </el-row>
  85. <el-row :gutter="30" style="margin-top: 10px">
  86. <el-col :span="4">
  87. <el-form-item label="炉号" class="custom-label">
  88. <span>{{
  89. lot.furnaceNoInfo.furnaceNumber
  90. ? lot.furnaceNoInfo.furnaceNumber
  91. : "-"
  92. }}</span>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="4">
  96. <el-form-item label="厂家" class="custom-label">
  97. <span>{{
  98. lot.furnaceNoInfo.factory ? lot.furnaceNoInfo.factory : "-"
  99. }}</span>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="4">
  103. <el-form-item label="牌号" class="custom-label">
  104. <span style="margin-left: 28px">{{
  105. lot.furnaceNoInfo.brandNumber
  106. ? lot.furnaceNoInfo.brandNumber
  107. : "-"
  108. }}</span>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="4">
  112. <el-form-item label="规格" class="custom-label">
  113. <span>{{
  114. lot.furnaceNoInfo.spec ? lot.furnaceNoInfo.spec : "-"
  115. }}</span>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="4">
  119. <el-form-item label="形状" class="custom-label">
  120. <span>{{
  121. lot.furnaceNoInfo.shape ? lot.furnaceNoInfo.shape : "-"
  122. }}</span>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="4">
  126. <el-form-item label="材料直径" class="custom-label">
  127. <span>{{
  128. lot.furnaceNoInfo.diameter ? lot.furnaceNoInfo.diameter : "-"
  129. }}</span>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. <el-row :gutter="30" style="margin-top: 10px">
  134. <el-col :span="4">
  135. <el-form-item label="原料编码" class="custom-label">
  136. <span>{{
  137. lot.furnaceNoInfo.rawMaterialCode
  138. ? lot.furnaceNoInfo.rawMaterialCode
  139. : "-"
  140. }}</span>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="4">
  144. <el-form-item label="来料日期" class="custom-label">
  145. <span>{{
  146. lot.furnaceNoInfo.incomingDate
  147. ? lot.furnaceNoInfo.incomingDate
  148. : "-"
  149. }}</span>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="4">
  153. <el-form-item label="材质1" class="custom-label">
  154. <span style="margin-left: 28px">
  155. {{
  156. lot.furnaceNoInfo.firstTechnicalRequirement
  157. ? lot.furnaceNoInfo.firstTechnicalRequirement
  158. : "-"
  159. }}
  160. </span>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="4">
  164. <el-form-item label="材质2" class="custom-label">
  165. <span>
  166. {{
  167. lot.furnaceNoInfo.secondTechnicalRequirement
  168. ? lot.furnaceNoInfo.secondTechnicalRequirement
  169. : "-"
  170. }}
  171. </span>
  172. </el-form-item>
  173. </el-col>
  174. </el-row>
  175. </el-form>
  176. <div style="padding: 16px">
  177. <span style="font-weight: bold; font-size: 18px">工艺路线</span>
  178. <el-button v-if="showVerify(true, 'business:lot:onceSingleChange')" type="primary"
  179. style="float: right; margin-left: 10px" @click="handleOnceSingleChange">
  180. 单批单改
  181. </el-button>
  182. <el-button v-if="showVerify(true, 'business:lot:inBatch')" type="primary" style="float: right; margin-left: 10px"
  183. @click="handleSplit()">
  184. 分批
  185. </el-button>
  186. <el-button v-if="showVerify(true, 'business:lot:waste')" :disabled="lot.isWaste == 1" type="danger"
  187. style="float: right; margin-left: 10px" @click="handlelotWaste(route.params.lotCode)">
  188. 批废
  189. </el-button>
  190. <el-button v-if="showVerify(lot.isAmend == 1, 'business:lot:standard')" type="primary"
  191. style="float: right; margin-left: 10px" @click="handleStandardProcess(lot.technologicalProcessId)">
  192. 查看标准工艺
  193. </el-button>
  194. </div>
  195. <div class="el-table-container">
  196. <div class="el-table-inner-container">
  197. <el-table height="95%" :data="processDetails">
  198. <el-table-column type="index" label="行号" align="center"></el-table-column>
  199. <el-table-column label="工序名称" prop="processAlias" align="center"></el-table-column>
  200. <el-table-column label="状态" prop="status" align="center">
  201. <template #default="scope">
  202. <span>{{ getStatusText(scope.row.status) }}</span>
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="投产量" prop="investNum" align="center"></el-table-column>
  206. <el-table-column label="合格量" prop="qualifiedNum" align="center"></el-table-column>
  207. <el-table-column label="废品量" prop="abandonNum" align="center"></el-table-column>
  208. </el-table>
  209. </div>
  210. </div>
  211. <once-change ref="onceChangeRef" @handleSaveSuccess="init" />
  212. <lot-waste-dialog ref="lotWasteDialogRef" @handleSaveSuccess="init" />
  213. <el-dialog title="标准工序" v-model="visible" width="680px" append-to-body draggable>
  214. <div class="el-table-inner-container">
  215. <el-table style="height: 600px" @selection-change="handleSelectionChange" :data="processList">
  216. <el-table-column type="selection" :selectable="checkSelectable" width="50" align="center" />
  217. <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
  218. <el-table-column label="工序名称" prop="processAlias" align="center" />
  219. <el-table-column label="工序编号" prop="processStepNumber" width="200" align="center" />
  220. </el-table>
  221. </div>
  222. </el-dialog>
  223. <InBatchesDialog ref="inBatchesDialogRef" :getList="init" />
  224. </div>
  225. <div v-else v-loading="loading" class="page-container column-container"></div>
  226. </template>
  227. <script setup name="LotProductionPlan">
  228. import { ref } from "vue";
  229. import useUserStore from "@/store/modules/user";
  230. import onceChange from "./onceSingleChangeDialog";
  231. import InBatchesDialog from "@/views/business/lot/InBatchesDialog.vue";
  232. import {
  233. lotParticulars,
  234. selectStandardProcess,
  235. } from "@/api/business/technologicalAmend.js";
  236. import lotWasteDialog from "./dayworkWasteDialog.vue";
  237. const { proxy } = getCurrentInstance();
  238. /** 查询 对象 */
  239. const processDetails = ref([]);
  240. const loading = ref(true);
  241. const visible = ref(false);
  242. const processList = ref([]); //工序列表
  243. const permissions = useUserStore().permissions;
  244. const all_permission = "*:*:*";
  245. const route = useRoute();
  246. const inBatchesDialogRef = ref(null);
  247. const statusMap = {
  248. 0: { type: "info", text: "未开始" },
  249. 1: { type: "primary", text: "进行中" },
  250. 2: { type: "success", text: "已完成" },
  251. };
  252. const lot = ref({
  253. productionPlanDetail: {
  254. companyAlias: "",
  255. },
  256. furnaceNoInfo: {},
  257. daywork: {},
  258. }); //批次信息
  259. /**************************** 方法区 ****************************/
  260. /** 单批单改按钮操作 */
  261. function handleOnceSingleChange() {
  262. if (lot.value.isWaste == 1) {
  263. proxy.$message.error("批废不能再进行操作");
  264. return;
  265. }
  266. proxy.$refs.onceChangeRef.open(lot.value.lotCode);
  267. }
  268. /** 按钮是否显示 */
  269. function showVerify(bool, quer) {
  270. return (
  271. bool && (permissions.includes(all_permission) || permissions.includes(quer))
  272. );
  273. }
  274. /** 工序状态 */
  275. function getStatusText(status) {
  276. switch (status) {
  277. case "0":
  278. return "未开始";
  279. case "1":
  280. return "进行中";
  281. case "2":
  282. return "已完成";
  283. default:
  284. return "";
  285. }
  286. }
  287. /** 批次状态文本 */
  288. function statusText(lot) {
  289. if (!lot.daywork) {
  290. return "未开始";
  291. }
  292. return statusMap[lot.daywork.status].text;
  293. }
  294. /** 批次状态样式 */
  295. function status(lot) {
  296. if (!lot.daywork) {
  297. return statusMap[0].type;
  298. }
  299. return statusMap[lot.daywork.status].type;
  300. }
  301. /** 初始化数据 */
  302. function init(data) {
  303. loading.value = true;
  304. const lotCode = (route.params && route.params.lotCode) || data;
  305. if (lotCode) {
  306. lotParticulars(lotCode).then((res) => {
  307. if (res.code == 200) {
  308. lot.value = res.data;
  309. processDetails.value = lot.value.technologicalProcessDetailList;
  310. loading.value = false;
  311. }
  312. });
  313. }
  314. }
  315. /** 查询标准工艺操作 */
  316. function handleStandardProcess(processId) {
  317. selectStandardProcess(processId).then((res) => {
  318. if (res.code == 200) {
  319. processList.value = res.rows;
  320. visible.value = true;
  321. }
  322. });
  323. }
  324. //批废
  325. function handlelotWaste(lotCode) {
  326. if (lot.value.daywork) {
  327. let row = {};
  328. row.lotCode = lotCode;
  329. row.lotId = lot.value.id;
  330. row.companyAlias = lot.value.productionPlanDetail.companyAlias;
  331. row.productionPlanNo = lot.value.productionPlanDetail.productionPlanNo;
  332. row.productDescription = lot.value.productionPlanDetail.productDescription;
  333. row.technologyVersion = lot.value.technologyVersion;
  334. row.productionQuantity = lot.value.productionQuantity;
  335. row.createTime = lot.value.daywork.createTime;
  336. row.id = lot.value.daywork.id;
  337. row.isWaste = lot.value.isWaste;
  338. row.deptName = lot.value.daywork.deptName;
  339. row.temporaryProcessQualifiedNum =
  340. lot.value.daywork.temporaryProcessQualifiedNum;
  341. proxy.$refs.lotWasteDialogRef.open(row);
  342. } else {
  343. proxy.$modal.msgError("该批未投产,不能进行批废");
  344. }
  345. }
  346. function handleSplit() {
  347. if (lot.value.isWaste == 1) {
  348. proxy.$message.error("批废不能再进行操作");
  349. return;
  350. }
  351. inBatchesDialogRef.value.open({
  352. ...lot.value,
  353. lotId: lot.value.id,
  354. companyAlias: lot.value.productionPlanDetail.companyAlias,
  355. productionPlanNo: lot.value.productionPlanDetail.productionPlanNo,
  356. productDescription: lot.value.productionPlanDetail.productDescription,
  357. });
  358. }
  359. init();
  360. </script>
  361. <style lang="scss" scoped>
  362. .bold-large span {
  363. font-weight: bold;
  364. /* 设置内容加粗 */
  365. font-size: 22px;
  366. /* 设置内容字体大小 */
  367. }
  368. .spacing {
  369. margin-left: 10px;
  370. }
  371. .list-search {
  372. padding: 16px;
  373. border-bottom: 8px solid #eef0f5;
  374. }
  375. .list-search .el-form-item {
  376. margin-top: 0px;
  377. margin-right: 15px;
  378. margin-bottom: 0px;
  379. margin-left: 0;
  380. }
  381. .list-search .el-form-item .el-form-item__label {
  382. font-size: 16px;
  383. padding-right: 0;
  384. }
  385. </style>