Warehousing.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <el-form
  3. class="form-no-message"
  4. ref="formRef"
  5. :show-message="false"
  6. label-position="left"
  7. :model="{ workReport }"
  8. >
  9. <div class="message-box">
  10. <ul>
  11. <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
  12. <li>
  13. <span class="label">批次数量</span
  14. >{{ countMsg.inStoreBatchNum }}PCS</li
  15. >
  16. <li>
  17. <span class="label">累计入库数量</span
  18. >{{ countMsg.inStoreNum }}PCS</li
  19. >
  20. </ul>
  21. <div class="right">
  22. <el-form-item
  23. label="执行人工号"
  24. prop="workReport.executorJobNum"
  25. required
  26. label-width="100px"
  27. ><personSelectRemote
  28. v-model="workReport.executorId"
  29. placeholder="请输入"
  30. @selfChange="
  31. (val, item) => (workReport.executorJobNum = item.jobNumber)
  32. "
  33. /></el-form-item>
  34. <el-form-item
  35. label="执行日期"
  36. required
  37. prop="executeTime"
  38. label-width="100px"
  39. ><el-date-picker
  40. v-model="workReport.executeTime"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. type="datetime"
  43. format="yyyy-MM-dd HH:mm"
  44. placeholder="请选择"
  45. ></el-date-picker
  46. ></el-form-item>
  47. </div>
  48. </div>
  49. <el-card>
  50. <el-descriptions title="交接" direction="vertical" :column="7" border>
  51. <el-descriptions-item label="待交接数量">{{
  52. countMsg.surplusStandardNum
  53. }}</el-descriptions-item>
  54. <el-descriptions-item label="">
  55. <span slot="label" class="label-required after">实际数量(PCS)</span>
  56. <el-form-item label="" label-width="0" class="w100" required
  57. ><el-input v-model="categoryMsg.number"></el-input
  58. ></el-form-item>
  59. </el-descriptions-item>
  60. </el-descriptions>
  61. <el-descriptions
  62. title="入库"
  63. direction="vertical"
  64. :column="7"
  65. border
  66. class="mt-16"
  67. >
  68. <!-- <template slot="extra">
  69. <el-button type="primary" size="small" @click="handleAddBatch"
  70. >添加</el-button
  71. >
  72. </template> -->
  73. <el-descriptions-item label="交货仓库">
  74. <span slot="label" class="label-required after">交货仓库</span>
  75. <el-form-item
  76. label=""
  77. label-width="0"
  78. class="w100"
  79. prop="workReport.storageInfo.storageCode"
  80. >
  81. <DictSelection
  82. v-model="workReport.storageInfo.storageCode"
  83. dict-name="仓库"
  84. @itemChange="
  85. (item) => (workReport.storageInfo.storageName = item.dictValue)
  86. "
  87. ></DictSelection>
  88. </el-form-item>
  89. </el-descriptions-item>
  90. <!-- <template v-for="(item, index) in batchList"> -->
  91. <el-descriptions-item label="批次号">
  92. <span slot="label" class="label-required after">批次号</span>
  93. <el-form-item
  94. label=""
  95. label-width="0"
  96. class="w100"
  97. prop="workReport.storageInfo.batchNum"
  98. ><el-input
  99. v-model="workReport.storageInfo.batchNum"
  100. ></el-input></el-form-item
  101. ></el-descriptions-item>
  102. <el-descriptions-item label="入库数量(PCS)">
  103. <span slot="label" class="label-required after">入库数量(PCS)</span
  104. ><el-form-item
  105. label=""
  106. label-width="0"
  107. class="w100"
  108. prop="workReport.storageInfo.storageCode"
  109. ><el-input
  110. v-model="workReport.storageInfo.inStorageNum"
  111. ></el-input></el-form-item
  112. ></el-descriptions-item>
  113. <!-- </template> -->
  114. </el-descriptions>
  115. </el-card>
  116. </el-form>
  117. </template>
  118. <script>
  119. import personSelectRemote from '@/components/CommomSelect/person-select-remote';
  120. import { reportCount } from '@/api/produceOrder';
  121. import dayjs from 'dayjs';
  122. export default {
  123. components: { personSelectRemote },
  124. props: {
  125. infoData: {
  126. type: Object,
  127. default: () => ({})
  128. },
  129. taskInfo: {
  130. type: Object,
  131. default: () => ({})
  132. }
  133. },
  134. data () {
  135. return {
  136. workReport: {
  137. executorId: '',
  138. executorJobNum: '',
  139. executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm'),
  140. storageInfo: {
  141. batchNum: '',
  142. inStorageNum: '',
  143. storageCode: '',
  144. storageName: ''
  145. }
  146. },
  147. categoryMsg: {
  148. batchNo: '',
  149. number: '',
  150. totalWeight: '',
  151. brandNum: '',
  152. sourceCategoryId: '',
  153. rootCategoryLevelId: '9',
  154. name: '',
  155. code: ''
  156. },
  157. countMsg: {}
  158. };
  159. },
  160. watch: {
  161. taskInfo: {
  162. immediate: true,
  163. handler () {
  164. if (this.taskInfo.code) {
  165. this.getReportCount();
  166. }
  167. }
  168. }
  169. },
  170. created () {
  171. this.workReport.executorId = this.$store.state.user.info?.userId;
  172. this.workReport.executorJobNum = this.$store.state.user.info?.jobNumber;
  173. },
  174. methods: {
  175. async getReportCount () {
  176. const res = await reportCount({
  177. taskCode: this.taskInfo.code,
  178. lastTaskCode: this.taskInfo.lastTaskCode,
  179. workOrderId: this.infoData.id
  180. });
  181. this.countMsg = res;
  182. },
  183. report (fun) {
  184. this.$refs.formRef.validate((value) => {
  185. if (value) {
  186. this.$confirm('是否确定要报工?', '提示').then(() => {
  187. this.categoryMsg = Object.assign(this.categoryMsg, {
  188. brandNum: this.infoData.brandNo,
  189. sourceCategoryId: this.infoData.categoryId,
  190. name: this.infoData.productName,
  191. code: this.infoData.productCode
  192. });
  193. fun({
  194. checkState: 1,
  195. workReport: this.workReport,
  196. workReportCategoryList: [this.categoryMsg]
  197. }).then((res) => {
  198. this.$message.success('报工成功!');
  199. this.getReportCount();
  200. });
  201. });
  202. }
  203. });
  204. }
  205. }
  206. };
  207. </script>
  208. <style lang="scss" scoped>
  209. .message-box {
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. margin-bottom: 16px;
  214. .label {
  215. margin-right: 5px;
  216. }
  217. ul {
  218. list-style: none;
  219. display: flex;
  220. align-items: center;
  221. justify-content: flex-start;
  222. li {
  223. margin-right: 20px;
  224. }
  225. }
  226. .right {
  227. padding-top: 22px;
  228. display: flex;
  229. align-items: center;
  230. }
  231. }
  232. </style>