workOrderBom.vue 8.5 KB

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