Warehousing.vue 6.7 KB

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