workOrderBom.vue 7.8 KB

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