Heating.vue 12 KB

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