workOrderBom.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">工单信息 </view>
  5. <view class="btn_box rx-bc" @click="handleScan(item.workOrderId)" v-if='!isDetails'>
  6. <image class="scan" src="@/static/pda/ScanIt.svg"></image>
  7. 更换工单
  8. </view>
  9. </view>
  10. <view class="material ">
  11. <view class="content_table">
  12. <view class="item">
  13. <view class="lable rx-cc">工单编号</view>
  14. <view class="content">
  15. {{ item.code }}
  16. </view>
  17. </view>
  18. <view class="item">
  19. <view class="lable rx-cc">编码</view>
  20. <view class="content">{{ item.productCode }}</view>
  21. </view>
  22. <view class="item">
  23. <view class="lable rx-cc">规格</view>
  24. <view class="content">{{ item.specification }}</view>
  25. </view>
  26. <view class="item">
  27. <view class="lable rx-cc">名称</view>
  28. <view class="content">{{ item.productName }}</view>
  29. </view>
  30. <view class="item">
  31. <view class="lable rx-cc">批次号</view>
  32. <view class="content">{{ item.batchNo }}</view>
  33. </view>
  34. <view class="item">
  35. <view class="lable rx-cc">牌号</view>
  36. <view class="content">{{ item.brandNum }}</view>
  37. </view>
  38. <view class="item">
  39. <view class="lable rx-cc">型号</view>
  40. <view class="content">{{ item.modelType }}</view>
  41. </view>
  42. <view class="item">
  43. <view class="lable rx-cc">生产编号</view>
  44. <view class="content">{{ item.productionCodes }}</view>
  45. </view>
  46. <view class="item rx-sc">
  47. <view class="rx ww55 ">
  48. <view class="lable rx-cc">生产数量</view>
  49. <view class="content rx-sc">
  50. <view>{{ item.formingNum }}</view>
  51. <view class="unit">{{ item.unit }}</view>
  52. </view>
  53. </view>
  54. <view class="rx ww45">
  55. <view class="lable rx-cc ww80">重量</view>
  56. <view class="content content_num">
  57. <view>{{ item.formingWeight }}</view>
  58. <view class="unit">{{ item.weightUnit }}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- {{ clientEnvironmentId }} {{ pType }} -->
  65. <view class="title_box mt20 rx-bc"
  66. v-if="(pType == 'feed' || pType == 'job')">
  67. <view class="name">{{ pType == 'feed' ? '实际投料时间' : '实际报工时间' }} </view>
  68. </view>
  69. <view class="material "
  70. v-if="(pType == 'feed' || pType == 'job')">
  71. <view class="content_table">
  72. <view class="item">
  73. <view class="content ">
  74. <uni-datetime-picker type="datetime"
  75. :value="currentExecutorTime"
  76. @change="changeTime($event, item)" />
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import { parameterGetByCode } from "@/api/mainData/index.js";
  85. export default {
  86. props: {
  87. item: {
  88. type: Object,
  89. default: () => { }
  90. },
  91. isDetails: {
  92. type: Boolean,
  93. default: false
  94. },
  95. pType: {
  96. type: '',
  97. default: ''
  98. },
  99. taskType: {
  100. type: '',
  101. default: ''
  102. }
  103. },
  104. data() {
  105. return {
  106. clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId,
  107. currentExecutorTime: ''
  108. }
  109. },
  110. created() {
  111. console.log('item', this.item)
  112. this.getByCode();
  113. },
  114. methods: {
  115. changeTime(e, val) {
  116. let a = e.split(' ');
  117. console.log(a);
  118. if (a[1] !== "") {
  119. this.currentExecutorTime = e
  120. } else {
  121. this.currentExecutorTime = `${e}00:00:00`
  122. }
  123. this.item.executorTime = this.currentExecutorTime;
  124. console.log('executorTime', this.item.executorTime)
  125. },
  126. getByCode() {
  127. parameterGetByCode({ code: "mes_order_feed_by_default_date" }).then((res) => {
  128. console.log('res', res)
  129. if(res.value == "1") {
  130. if(!this.item.executorTime) {
  131. const now = new Date();
  132. const year = now.getFullYear();
  133. const month = String(now.getMonth() + 1).padStart(2, '0');
  134. const day = String(now.getDate()).padStart(2, '0');
  135. const hours = String(now.getHours()).padStart(2, '0');
  136. const minutes = String(now.getMinutes()).padStart(2, '0');
  137. const seconds = String(now.getSeconds()).padStart(2, '0');
  138. this.currentExecutorTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  139. this.item.executorTime = this.currentExecutorTime;
  140. console.log('executorTime', this.item.executorTime)
  141. console.log('item', this.item)
  142. this.$forceUpdate();
  143. }
  144. }
  145. });
  146. },
  147. handleScan(id) {
  148. this.$emit('handleScan', id, 'wordOrder')
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .title_box {
  155. .name {
  156. font-size: 28rpx;
  157. font-style: normal;
  158. font-weight: 400;
  159. color: $theme-color;
  160. padding-left: 20rpx;
  161. position: relative;
  162. &:before {
  163. position: absolute;
  164. content: '';
  165. left: 0rpx;
  166. top: 0rpx;
  167. bottom: 0rpx;
  168. width: 4rpx;
  169. height: 28rpx;
  170. background: $theme-color;
  171. margin: auto;
  172. }
  173. }
  174. .btn_box {
  175. padding: 0 18rpx;
  176. height: 60rpx;
  177. background: $theme-color;
  178. font-size: 26rpx;
  179. font-style: normal;
  180. font-weight: 400;
  181. font-size: 24rpx;
  182. color: #fff;
  183. border-radius: 4rpx;
  184. .scan {
  185. width: 34rpx;
  186. height: 34rpx;
  187. margin-right: 12rpx;
  188. }
  189. }
  190. }
  191. .material {
  192. margin-top: 10rpx;
  193. .content_table {
  194. width: 100%;
  195. border: 2rpx solid $border-color;
  196. .item {
  197. display: flex;
  198. border-bottom: 2rpx solid $border-color;
  199. .lable {
  200. width: 132rpx;
  201. text-align: center;
  202. background-color: #F7F9FA;
  203. font-size: 26rpx;
  204. border-right: 2rpx solid $border-color;
  205. flex-shrink: 0;
  206. }
  207. .lable150 {
  208. width: 156rpx !important;
  209. font-size: 24rpx;
  210. }
  211. .ww80 {
  212. width: 80rpx;
  213. }
  214. .content {
  215. width: 518rpx;
  216. min-height: 64rpx;
  217. font-size: 28rpx;
  218. line-height: 28rpx;
  219. font-style: normal;
  220. font-weight: 400;
  221. padding: 18rpx 8rpx;
  222. box-sizing: border-box;
  223. word-wrap: break-word;
  224. flex-grow: 1 !important;
  225. .unit {
  226. padding: 0 4rpx;
  227. font-size: 24rpx;
  228. color: #404446;
  229. }
  230. }
  231. .content_num {
  232. display: flex;
  233. align-items: center;
  234. padding: 0 4rpx;
  235. /deep/ .uni-input-input {
  236. border: 2rpx solid #F0F8F2;
  237. background: #F0F8F2;
  238. color: $theme-color;
  239. }
  240. }
  241. .pd4 {
  242. padding: 4rpx 8rpx;
  243. }
  244. &:last-child {
  245. border-bottom: none;
  246. }
  247. }
  248. .ww55 {
  249. width: 55%;
  250. }
  251. .ww45 {
  252. width: 45%;
  253. }
  254. }
  255. }
  256. .mt20 {
  257. margin-top: 20rpx;
  258. }
  259. </style>