Extrusion.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <el-form :model="{ categoryMsg, ...workReport }" ref="formRef">
  3. <div class="message-box">
  4. <ul>
  5. <li> <span class="label">报工次数</span> {{ countMsg.reportNum }}</li>
  6. <li>
  7. <span class="label">累计合格品数量</span>
  8. {{ countMsg.standardTotalNum }}</li
  9. >
  10. <li>
  11. <span class="label">累计合格品重量</span>
  12. {{ countMsg.standardTotalWeight }}</li
  13. >
  14. <li>
  15. <span class="label">累计投料重量</span>
  16. {{ countMsg.feedMaterielWeight }}</li
  17. >
  18. </ul>
  19. <div class="right">
  20. <el-form-item
  21. label="执行人工号"
  22. prop="executorJobNum"
  23. required
  24. label-width="100px"
  25. ><personSelectRemote
  26. v-model="workReport.executorId"
  27. placeholder="请输入"
  28. @selfChange="
  29. (val, item) => (workReport.executorJobNum = item.jobNumber)
  30. "
  31. /></el-form-item>
  32. <el-form-item label="执行日期" prop="executorTime" label-width="100px"
  33. ><el-date-picker
  34. v-model="workReport.executorTime"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. type="datetime"
  37. format="yyyy-MM-dd HH:mm"
  38. placeholder="请选择"
  39. ></el-date-picker
  40. ></el-form-item>
  41. </div>
  42. </div>
  43. <el-card>
  44. <el-descriptions title="报工信息" direction="vertical" :column="7" border>
  45. <el-descriptions-item label="原料编码/名称" :span="2">
  46. <span class="label-required after" slot="label">原料编码/名称</span>
  47. <el-form-item
  48. label=""
  49. label-width="0"
  50. class="w100"
  51. prop="categoryMsg.packNum"
  52. >
  53. <el-input
  54. placeholder="请输入"
  55. :value="`${categoryMsg.code}/${categoryMsg.name}`"
  56. @click.native="getMaterial"
  57. ></el-input>
  58. </el-form-item>
  59. </el-descriptions-item>
  60. <el-descriptions-item label="原料牌号">{{
  61. categoryMsg.brandNum
  62. }}</el-descriptions-item>
  63. <el-descriptions-item label="批次号">
  64. <el-select v-model="categoryMsg.batchNo" placeholder="请选择">
  65. <el-option
  66. v-for="(item, index) in batchList"
  67. :key="index"
  68. :label="item.batchNum"
  69. :value="item.batchNum"
  70. @click.native="categoryMsg.totalWeight = item.storageNum"
  71. ></el-option>
  72. </el-select>
  73. </el-descriptions-item>
  74. <el-descriptions-item label="原料重量(KG)"
  75. ><el-input
  76. v-model="categoryMsg.totalWeight"
  77. placeholder="请输入"
  78. ></el-input
  79. ></el-descriptions-item>
  80. <el-descriptions-item label="质检项" :span="2">{{
  81. infoData.qualityItem
  82. }}</el-descriptions-item>
  83. <el-descriptions-item label="质检标准" :span="3">{{
  84. infoData.qualityStandard
  85. }}</el-descriptions-item>
  86. <el-descriptions-item label="">
  87. <span class="label-required after" slot="label">合格品数量(PCS)</span>
  88. <el-form-item
  89. label=""
  90. label-width="0"
  91. class="w100"
  92. prop="productInfo.standardNum"
  93. ><el-input-number
  94. class="w100"
  95. :controls="false"
  96. v-model="workReport.productInfo.standardNum"
  97. :min="0"
  98. clearable
  99. ></el-input-number> </el-form-item
  100. ></el-descriptions-item>
  101. <el-descriptions-item label=""
  102. ><span class="label-required after" slot="label">合格品重量(KG)</span>
  103. <el-form-item
  104. label=""
  105. label-width="0"
  106. class="w100"
  107. prop="productInfo.standardWeight"
  108. ><el-input-number
  109. readonly
  110. class="w100"
  111. :controls="false"
  112. :value="
  113. (workReport.productInfo.standardWeight =
  114. workReport.productInfo.standardNum *
  115. (infoData.productUnitWeight || 1))
  116. "
  117. :min="0"
  118. clearable
  119. ></el-input-number> </el-form-item
  120. ></el-descriptions-item>
  121. <el-descriptions-item label="不合格品数量(PCS)">
  122. <el-input-number
  123. class="w100"
  124. :controls="false"
  125. v-model="workReport.productInfo.noStandardNum"
  126. :min="0"
  127. clearable
  128. ></el-input-number>
  129. </el-descriptions-item>
  130. <el-descriptions-item label="不合格品重量(KG)"
  131. ><el-input-number
  132. class="w100"
  133. readonly
  134. :controls="false"
  135. :value="
  136. (workReport.productInfo.noStandardWeight =
  137. workReport.noStandardNum * (infoData.productUnitWeight || 1))
  138. "
  139. :min="0"
  140. clearable
  141. ></el-input-number
  142. ></el-descriptions-item>
  143. <el-descriptions-item label="副产品重量(KG)"
  144. ><el-input-number
  145. class="w100"
  146. :controls="false"
  147. v-model="workReport.productInfo.netWeight"
  148. :min="0"
  149. clearable
  150. ></el-input-number
  151. ></el-descriptions-item>
  152. <el-descriptions-item label="备注">
  153. <el-input v-model="workReport.remark"></el-input
  154. ></el-descriptions-item>
  155. </el-descriptions>
  156. <el-descriptions
  157. title="设备信息"
  158. class="mt-16"
  159. direction="vertical"
  160. :column="7"
  161. border
  162. >
  163. <el-descriptions-item label="设备编码">{{
  164. workReportDeviceList.code
  165. }}</el-descriptions-item>
  166. <el-descriptions-item label="设备名称">{{
  167. workReportDeviceList.name
  168. }}</el-descriptions-item>
  169. <el-descriptions-item label="规格">{{
  170. workReportDeviceList.specification
  171. }}</el-descriptions-item>
  172. <el-descriptions-item label="型号">{{
  173. workReportDeviceList.model
  174. }}</el-descriptions-item>
  175. <el-descriptions-item label="设备位置">{{
  176. workReportDeviceList.path
  177. }}</el-descriptions-item>
  178. <el-descriptions-item label="操作" :span="2"
  179. ><el-link @click="getEquip" type="primary"
  180. >更改设备</el-link
  181. ></el-descriptions-item
  182. >
  183. <el-descriptions-item label="模具编码/名称"
  184. ><el-input
  185. class="w100"
  186. :value="`${moduleMsg.code}/${moduleMsg.name}`"
  187. @click.native="getCategory('5', 'moduleMsg')"
  188. ></el-input
  189. ></el-descriptions-item>
  190. <el-descriptions-item label="规格">{{
  191. moduleMsg.specification
  192. }}</el-descriptions-item>
  193. <el-descriptions-item label="型号">{{
  194. moduleMsg.model
  195. }}</el-descriptions-item>
  196. <el-descriptions-item label="冲压次数" :span="4"
  197. ><el-input
  198. placeholder="请输入"
  199. v-model="moduleMsg.extraField.stampingTimes"
  200. ></el-input
  201. ></el-descriptions-item>
  202. <el-descriptions-item label="舟皿编码/名称"
  203. ><el-input
  204. :value="`${boatMsg.code}/${boatMsg.name}`"
  205. @click.native="getCategory('8', 'boatMsg')"
  206. ></el-input
  207. ></el-descriptions-item>
  208. <el-descriptions-item label="规格">{{
  209. boatMsg.specification
  210. }}</el-descriptions-item>
  211. <el-descriptions-item label="槽数"></el-descriptions-item>
  212. <el-descriptions-item label="数量"
  213. ><el-input
  214. placeholder="请输入"
  215. v-model="boatMsg.extraField.num"
  216. ></el-input
  217. ></el-descriptions-item>
  218. </el-descriptions>
  219. </el-card>
  220. <equipmentDailog
  221. ref="equipmentRef"
  222. :isPlan="true"
  223. :produceVersionId="infoData.produceVersionId"
  224. />
  225. <materialDialog
  226. ref="materialRef"
  227. :params="{
  228. taskInstanceId: taskInfo.id,
  229. versionId: infoData.produceVersionId
  230. }"
  231. />
  232. <catogaryDialog ref="catogaryDialogRef" />
  233. </el-form>
  234. </template>
  235. <script>
  236. import { realTimeStorage } from '@/api/mainData';
  237. import personSelectRemote from '@/components/CommomSelect/person-select-remote';
  238. import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
  239. import materialDialog from '../materialDialog.vue';
  240. import catogaryDialog from '../catogaryDialog.vue';
  241. import { reportCount } from '@/api/produceOrder';
  242. export default {
  243. components: {
  244. personSelectRemote,
  245. equipmentDailog,
  246. materialDialog,
  247. catogaryDialog
  248. },
  249. props: {
  250. infoData: {
  251. type: Object,
  252. default: () => ({})
  253. },
  254. taskInfo: {
  255. type: Object,
  256. default: () => ({})
  257. }
  258. },
  259. data () {
  260. return {
  261. categoryMsg: {
  262. batchNo: '',
  263. totalWeight: '',
  264. brandNum: '',
  265. sourceCategoryId: '',
  266. rootCategoryLevelId: '1',
  267. name: '',
  268. code: ''
  269. },
  270. workReport: {
  271. executorId: '',
  272. executorJobNum: '',
  273. executorTime: '',
  274. remark: '',
  275. productInfo: {
  276. standardNum: '',
  277. standardWeight: '',
  278. noStandardNum: '',
  279. noStandardWeight: ''
  280. }
  281. },
  282. // 设备
  283. workReportDeviceList: {
  284. code: '',
  285. name: '',
  286. path: '',
  287. model: '',
  288. rootCategoryLevelId: '',
  289. specification: ''
  290. },
  291. countMsg: {},
  292. // 模具信息
  293. moduleMsg: {
  294. code: '',
  295. name: '',
  296. path: '',
  297. model: '',
  298. rootCategoryLevelId: '',
  299. specification: '',
  300. extraField: {
  301. stampingTimes: ''
  302. }
  303. },
  304. // 舟皿信息
  305. boatMsg: {
  306. code: '',
  307. name: '',
  308. path: '',
  309. model: '',
  310. rootCategoryLevelId: '',
  311. specification: '',
  312. extraField: {
  313. num: ''
  314. }
  315. },
  316. batchList: []
  317. };
  318. },
  319. watch: {
  320. taskInfo: {
  321. immediate: true,
  322. handler () {
  323. if (this.taskInfo.code) {
  324. this.getReportCount();
  325. }
  326. }
  327. }
  328. },
  329. methods: {
  330. getCategory (id, memo) {
  331. this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
  332. this[memo].rootCategoryLevelId = res.categoryLevelId;
  333. this[memo].code = res.code;
  334. this[memo].name = res.name;
  335. this[memo].specification = res.specification;
  336. this[memo].sourceInstanceId = res.id;
  337. if (memo === 'moduleMsg') {
  338. this[memo].model = res.modelType;
  339. this[memo].extraField.stampingTimes = '';
  340. } else {
  341. this[memo].extraField.num = '';
  342. }
  343. });
  344. },
  345. getMaterial () {
  346. this.$refs.materialRef.open(this.categoryMsg, (res) => {
  347. this.categoryMsg.name = res.categoryName;
  348. this.categoryMsg.code = res.categoryCode;
  349. this.categoryMsg.sourceCategoryId = res.id;
  350. this.categoryMsg.brandNum = res.brandNum;
  351. realTimeStorage({
  352. categoryCode: res.categoryCode,
  353. factoryCode: this.infoData.werks || '14T1'
  354. }).then((res) => {
  355. this.batchList = res;
  356. });
  357. });
  358. },
  359. getEquip () {
  360. this.$refs.equipmentRef.openSingle(
  361. [this.workReportDeviceList],
  362. (res) => {
  363. this.workReportDeviceList.code = res.code;
  364. this.workReportDeviceList.name = res.name;
  365. this.workReportDeviceList.model = res.modelType;
  366. this.workReportDeviceList.specification = res.specification;
  367. this.workReportDeviceList.sourceInstanceId = res.id;
  368. this.workReportDeviceList.rootCategoryLevelId =
  369. res.rootCategoryLevelId;
  370. this.workReportDeviceList.path = res.positionList[0]?.pathName;
  371. }
  372. );
  373. },
  374. async getReportCount () {
  375. const res = await reportCount({
  376. taskCode: this.taskInfo.code,
  377. workOrderId: this.infoData.id
  378. });
  379. this.countMsg = res;
  380. },
  381. report (fun) {
  382. this.$refs.formRef.validate((value) => {
  383. if (value) {
  384. const workReportDeviceList = [];
  385. if (this.workReportDeviceList.code) {
  386. workReportDeviceList.push(this.workReportDeviceList);
  387. }
  388. if (this.moduleMsg.code) {
  389. workReportDeviceList.push(this.moduleMsg);
  390. }
  391. if (this.boatMsg.code) {
  392. workReportDeviceList.push(this.boatMsg);
  393. }
  394. fun({
  395. checkState: 1,
  396. workReport: this.workReport,
  397. workReportCategoryList: [this.categoryMsg],
  398. workReportDeviceList
  399. }).then(() => {
  400. this.getReportCount();
  401. });
  402. }
  403. });
  404. }
  405. }
  406. };
  407. </script>
  408. <style lang="scss" scoped>
  409. .message-box {
  410. display: flex;
  411. justify-content: space-between;
  412. align-items: center;
  413. .label {
  414. margin-right: 5px;
  415. }
  416. ul {
  417. list-style: none;
  418. display: flex;
  419. align-items: center;
  420. justify-content: flex-start;
  421. li {
  422. margin-right: 20px;
  423. }
  424. }
  425. .right {
  426. padding-top: 22px;
  427. display: flex;
  428. align-items: center;
  429. }
  430. }
  431. </style>