workOrderBom.vue 8.4 KB

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