HalfAdded.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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 }}</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. infoData.qualityItem
  104. }}</el-descriptions-item>
  105. <el-descriptions-item label="质检标准" :span="3">{{
  106. infoData.qualityStandard
  107. }}</el-descriptions-item>
  108. <el-descriptions-item label="">
  109. <span class="label-required after" slot="label">合格品数量(PCS)</span>
  110. <el-form-item
  111. label=""
  112. label-width="0"
  113. class="w100"
  114. prop="productInfo.standardNum"
  115. ><el-input-number
  116. class="w100"
  117. :controls="false"
  118. v-model="workReport.productInfo.standardNum"
  119. :min="0"
  120. clearable
  121. ></el-input-number> </el-form-item
  122. ></el-descriptions-item>
  123. <el-descriptions-item label=""
  124. ><span class="label-required after" slot="label">合格品重量(KG)</span>
  125. <el-form-item
  126. label=""
  127. label-width="0"
  128. class="w100"
  129. prop="productInfo.standardWeight"
  130. ><el-input-number
  131. readonly
  132. class="w100"
  133. :controls="false"
  134. :value="
  135. (workReport.productInfo.standardWeight =
  136. workReport.productInfo.standardNum *
  137. (infoData.productUnitWeight || 1))
  138. "
  139. :min="0"
  140. clearable
  141. ></el-input-number> </el-form-item
  142. ></el-descriptions-item>
  143. <el-descriptions-item label="不合格品数量(PCS)">
  144. <el-input-number
  145. class="w100"
  146. :controls="false"
  147. v-model="workReport.productInfo.noStandardNum"
  148. :min="0"
  149. clearable
  150. ></el-input-number>
  151. </el-descriptions-item>
  152. <el-descriptions-item label="不合格品重量(KG)"
  153. ><el-input-number
  154. class="w100"
  155. readonly
  156. :controls="false"
  157. :value="
  158. (workReport.productInfo.noStandardWeight =
  159. workReport.noStandardNum * (infoData.productUnitWeight || 1))
  160. "
  161. :min="0"
  162. clearable
  163. ></el-input-number
  164. ></el-descriptions-item>
  165. <el-descriptions-item label="副产品重量(KG)"
  166. ><el-input-number
  167. class="w100"
  168. :controls="false"
  169. v-model="workReport.productInfo.netWeight"
  170. :min="0"
  171. clearable
  172. ></el-input-number
  173. ></el-descriptions-item>
  174. <el-descriptions-item label="备注">
  175. <el-input v-model="workReport.remark"></el-input
  176. ></el-descriptions-item>
  177. </el-descriptions>
  178. <el-descriptions
  179. title="设备信息"
  180. class="mt-16"
  181. direction="vertical"
  182. :column="7"
  183. border
  184. >
  185. <el-descriptions-item label="设备编码">{{
  186. workReportDeviceList.code
  187. }}</el-descriptions-item>
  188. <el-descriptions-item label="设备名称">{{
  189. workReportDeviceList.name
  190. }}</el-descriptions-item>
  191. <el-descriptions-item label="规格">{{
  192. workReportDeviceList.specification
  193. }}</el-descriptions-item>
  194. <el-descriptions-item label="型号">{{
  195. workReportDeviceList.model
  196. }}</el-descriptions-item>
  197. <el-descriptions-item label="设备位置">{{
  198. workReportDeviceList.path
  199. }}</el-descriptions-item>
  200. <el-descriptions-item label="操作"
  201. ><el-link @click="getEquip">更改设备</el-link></el-descriptions-item
  202. >
  203. </el-descriptions>
  204. </el-card>
  205. <equipmentDailog
  206. ref="equipmentRef"
  207. :produceVersionId="infoData.produceVersionId"
  208. />
  209. <catogaryDialog ref="catogaryDialogRef" />
  210. </el-form>
  211. </template>
  212. <script>
  213. import personSelectRemote from '@/components/CommomSelect/person-select-remote';
  214. import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
  215. import { reportCount } from '@/api/produceOrder';
  216. import catogaryDialog from '../catogaryDialog.vue';
  217. export default {
  218. components: { personSelectRemote, equipmentDailog, catogaryDialog },
  219. props: {
  220. infoData: {
  221. type: Object,
  222. default: () => ({})
  223. },
  224. taskInfo: {
  225. type: Object,
  226. default: () => ({})
  227. }
  228. },
  229. data () {
  230. return {
  231. categoryMsg: {
  232. batchNo: '',
  233. number: '',
  234. totalWeight: '',
  235. brandNum: '',
  236. sourceCategoryId: '',
  237. rootCategoryLevelId: '9',
  238. name: '',
  239. code: ''
  240. },
  241. workReport: {
  242. executorId: '',
  243. executorJobNum: '',
  244. executorTime: '',
  245. remark: '',
  246. productInfo: {
  247. standardNum: '',
  248. standardWeight: '',
  249. noStandardNum: '',
  250. noStandardWeight: ''
  251. }
  252. },
  253. workReportDeviceList: {
  254. code: '',
  255. name: '',
  256. path: '',
  257. model: '',
  258. rootCategoryLevelId: '',
  259. specification: ''
  260. },
  261. countMsg: {},
  262. // 舟皿信息
  263. boatMsg: {
  264. code: '',
  265. name: '',
  266. path: '',
  267. model: '',
  268. rootCategoryLevelId: '',
  269. specification: '',
  270. extraField: {
  271. num: ''
  272. }
  273. }
  274. };
  275. },
  276. watch: {
  277. taskInfo: {
  278. immediate: true,
  279. handler () {
  280. if (this.taskInfo.code) {
  281. this.getReportCount();
  282. }
  283. }
  284. }
  285. },
  286. methods: {
  287. getCategory (id, memo) {
  288. this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
  289. this[memo].rootCategoryLevelId = res.categoryLevelId;
  290. this[memo].code = res.code;
  291. this[memo].name = res.name;
  292. this[memo].specification = res.specification;
  293. this[memo].sourceInstanceId = res.id;
  294. if (memo === 'moduleMsg') {
  295. this[memo].model = res.modelType;
  296. this[memo].extraField.stampingTimes = '';
  297. } else {
  298. this[memo].extraField.num = '';
  299. }
  300. });
  301. },
  302. async getReportCount () {
  303. const res = await reportCount({
  304. taskCode: this.taskInfo.code,
  305. workOrderId: this.infoData.id
  306. });
  307. this.countMsg = res;
  308. },
  309. getEquip () {
  310. this.$refs.equipmentRef.openSingle(
  311. [this.workReportDeviceList],
  312. (res) => {
  313. this.workReportDeviceList.code = res.code;
  314. this.workReportDeviceList.name = res.name;
  315. this.workReportDeviceList.model = res.modelType;
  316. this.workReportDeviceList.specification = res.specification;
  317. this.workReportDeviceList.sourceInstanceId = res.id;
  318. this.workReportDeviceList.rootCategoryLevelId =
  319. res.rootCategoryLevelId;
  320. this.workReportDeviceList.path = res.positionList[0]?.pathName;
  321. }
  322. );
  323. },
  324. report (fun) {
  325. this.$refs.formRef.validate((value) => {
  326. if (value) {
  327. this.categoryMsg = Object.assign(this.categoryMsg, {
  328. brandNum: this.infoData.brandNo,
  329. sourceCategoryId: this.infoData.categoryId,
  330. name: this.infoData.productName,
  331. code: this.infoData.productCode
  332. });
  333. fun({
  334. checkState: 1,
  335. workReport: this.workReport,
  336. workReportDeviceList: [this.workReportDeviceList],
  337. workReportCategoryList: [this.categoryMsg]
  338. }).then((res) => {
  339. this.getReportCount();
  340. });
  341. }
  342. });
  343. }
  344. }
  345. };
  346. </script>
  347. <style lang="scss" scoped>
  348. .form-no-message {
  349. :deep(.el-input-number) {
  350. .el-input__inner {
  351. text-align: left !important;
  352. }
  353. }
  354. }
  355. .message-box {
  356. display: flex;
  357. justify-content: space-between;
  358. align-items: center;
  359. margin-bottom: 16px;
  360. .label {
  361. margin-right: 5px;
  362. }
  363. ul {
  364. list-style: none;
  365. display: flex;
  366. align-items: center;
  367. justify-content: flex-start;
  368. li {
  369. margin-right: 20px;
  370. }
  371. }
  372. .right {
  373. padding-top: 22px;
  374. display: flex;
  375. align-items: center;
  376. .el-form-item {
  377. margin-left: 10px;
  378. }
  379. }
  380. }
  381. </style>