workOrderBom.vue 8.4 KB

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