workOrderBom.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. console.log(newVal, "11111");
  126. this.getByCode();
  127. },
  128. },
  129. },
  130. created() {
  131. console.log("item", this.item);
  132. this.getByCode();
  133. },
  134. methods: {
  135. changeTime(e, val) {
  136. let a = e.split(" ");
  137. console.log(a);
  138. if (a[1] !== "") {
  139. this.currentExecutorTime = e;
  140. } else {
  141. this.currentExecutorTime = `${e}00:00:00`;
  142. }
  143. this.item.executorTime = this.currentExecutorTime;
  144. console.log("executorTime", this.item.executorTime);
  145. },
  146. async getByCode() {
  147. console.log("11111");
  148. await parameterGetByCode({ code: "mes_order_feed_by_default_date" }).then(
  149. (res) => {
  150. console.log("res", res);
  151. if (res.value == "1") {
  152. if (!this.item.executorTime) {
  153. const now = new Date();
  154. const year = now.getFullYear();
  155. const month = String(now.getMonth() + 1).padStart(2, "0");
  156. const day = String(now.getDate()).padStart(2, "0");
  157. const hours = String(now.getHours()).padStart(2, "0");
  158. const minutes = String(now.getMinutes()).padStart(2, "0");
  159. const seconds = String(now.getSeconds()).padStart(2, "0");
  160. this.currentExecutorTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  161. this.item.executorTime = this.currentExecutorTime;
  162. // this.item.workReportInfo.executorTime = this.currentExecutorTime;
  163. this.$set(this.item, "executorTime", this.currentExecutorTime);
  164. this.$set(
  165. this.item.workReportInfo,
  166. "executorTime",
  167. this.currentExecutorTime
  168. );
  169. console.log("executorTime", this.item.executorTime);
  170. console.log("item", this.item);
  171. this.$forceUpdate();
  172. }
  173. }
  174. }
  175. );
  176. },
  177. handleScan(id) {
  178. this.$emit("handleScan", id, "wordOrder");
  179. },
  180. },
  181. };
  182. </script>
  183. <style lang="scss" scoped>
  184. .title_box {
  185. .name {
  186. font-size: 28rpx;
  187. font-style: normal;
  188. font-weight: 400;
  189. color: $theme-color;
  190. padding-left: 20rpx;
  191. position: relative;
  192. &:before {
  193. position: absolute;
  194. content: "";
  195. left: 0rpx;
  196. top: 0rpx;
  197. bottom: 0rpx;
  198. width: 4rpx;
  199. height: 28rpx;
  200. background: $theme-color;
  201. margin: auto;
  202. }
  203. }
  204. .btn_box {
  205. padding: 0 18rpx;
  206. height: 60rpx;
  207. background: $theme-color;
  208. font-size: 26rpx;
  209. font-style: normal;
  210. font-weight: 400;
  211. font-size: 24rpx;
  212. color: #fff;
  213. border-radius: 4rpx;
  214. .scan {
  215. width: 34rpx;
  216. height: 34rpx;
  217. margin-right: 12rpx;
  218. }
  219. }
  220. }
  221. .material {
  222. margin-top: 10rpx;
  223. .content_table {
  224. width: 100%;
  225. border: 2rpx solid $border-color;
  226. .item {
  227. display: flex;
  228. border-bottom: 2rpx solid $border-color;
  229. .lable {
  230. width: 132rpx;
  231. text-align: center;
  232. background-color: #f7f9fa;
  233. font-size: 26rpx;
  234. border-right: 2rpx solid $border-color;
  235. flex-shrink: 0;
  236. }
  237. .lable150 {
  238. width: 156rpx !important;
  239. font-size: 24rpx;
  240. }
  241. .ww80 {
  242. width: 80rpx;
  243. }
  244. .content {
  245. width: 518rpx;
  246. min-height: 64rpx;
  247. font-size: 28rpx;
  248. line-height: 28rpx;
  249. font-style: normal;
  250. font-weight: 400;
  251. padding: 18rpx 8rpx;
  252. box-sizing: border-box;
  253. word-wrap: break-word;
  254. flex-grow: 1 !important;
  255. .unit {
  256. padding: 0 4rpx;
  257. font-size: 24rpx;
  258. color: #404446;
  259. }
  260. }
  261. .content_num {
  262. display: flex;
  263. align-items: center;
  264. padding: 0 4rpx;
  265. /deep/ .uni-input-input {
  266. border: 2rpx solid #f0f8f2;
  267. background: #f0f8f2;
  268. color: $theme-color;
  269. }
  270. }
  271. .pd4 {
  272. padding: 4rpx 8rpx;
  273. }
  274. &:last-child {
  275. border-bottom: none;
  276. }
  277. }
  278. .ww55 {
  279. width: 55%;
  280. }
  281. .ww45 {
  282. width: 45%;
  283. }
  284. }
  285. }
  286. .mt20 {
  287. margin-top: 20rpx;
  288. }
  289. </style>