processes.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="processe-view">
  3. <view class="tabs">
  4. <view class="tabs-item" :class="{'active': activeName === '工序报工'}" @click="tabClick('工序报工')">工序报工</view>
  5. <view class="tabs-item" :class="{'active': activeName === '订单生产明细'}" @click="tabClick('订单生产明细')">订单生产明细</view>
  6. <!-- <view class="tabs-item" :class="{'active': activeName === '报工记录'}" @click="tabClick('报工记录')">报工记录</view> -->
  7. </view>
  8. <card title="工序信息" v-if="activeName === '工序报工'">
  9. <view class="card-content">
  10. <view class="report-item" v-for="item in processesList" :key="item.name">
  11. <view class="report-col">序号:{{item.vornr}}</view>
  12. <view class="report-col">名称:{{item.processes}}</view>
  13. <view class="report-col" >在制品:<text :class="{'text-danger': !Number.isNaN(+item.workProgress) && (item.workProgress < 0)}">{{item.workProgress || 0}}</text></view>
  14. <view class="report-col">已合格:{{item.lmnga|| 0}}</view>
  15. <view class="report-col">废品:{{item.xmnga|| 0}}</view>
  16. <view class="report-col"><button type='primary' :disabled='!canReport || item.steus === "W003" || orderStatus !== "在制" || (item.deptCode !== "X12") || (!processOperation.includes(item.operaDesc) && !processOperation.includes("ALL"))' @click="handleReport(item)">报工</button></view>
  17. </view>
  18. </view>
  19. </card>
  20. <template v-else-if="activeName === '订单生产明细'">
  21. <view class="report-detail">
  22. <view class="tab-wrapper">
  23. <view class="detail-tab">
  24. <view class="detail-item" :class="{'active': detailActive === '报工汇总'}" @click="detailClick('报工汇总')">报工汇总</view>
  25. <view class="detail-item" :class="{'active': detailActive === '101收货明细'}" @click="detailClick('101收货明细')">101收货明细</view>
  26. <view class="detail-item" :class="{'active': detailActive === '531收货明细'}" @click="detailClick('531收货明细')">531收货明细</view>
  27. <view class="detail-item" :class="{'active': detailActive === '投料'}" @click="detailClick('投料')">投料</view>
  28. <view class="detail-item" :class="{'active': detailActive === 'BOM'}" @click="detailClick('BOM')">BOM</view>
  29. </view>
  30. </view>
  31. <view class="content" :key="processesList.length">
  32. <summaryComp :processesList='processesList' :processOperation='processOperation' :orderStatus='orderStatus' v-if="detailActive === '报工汇总'" :canReport='canReport'/>
  33. <detailComp :processesList='processesList' :orderId='orderId' name='101' key='101收货明细' v-else-if="detailActive === '101收货明细'"/>
  34. <detailComp :processesList='processesList' :orderId='orderId' name='531' key='531收货明细' v-else-if="detailActive === '531收货明细'"/>
  35. <picking :processesList='processesList' :orderId='orderId' v-else-if="detailActive === '投料'"/>
  36. <BOM :orderId='orderId' v-else-if="detailActive === 'BOM'"/>
  37. </view>
  38. </view>
  39. </template>
  40. <template v-else-if="activeName === '报工日志'"></template>
  41. </view>
  42. </template>
  43. <script>
  44. import card from '@/components/card/card'
  45. import {getReportInfo} from "@/api/report/index"
  46. import summaryComp from './orderDetail/summary.vue'
  47. import detailComp from './orderDetail/detailComp.vue'
  48. import picking from './orderDetail/picking.vue'
  49. import BOM from './orderDetail/BOM.vue'
  50. import { get } from "@/utils/api.js"
  51. export default {
  52. components:{card, summaryComp, detailComp, picking, BOM},
  53. props:{
  54. processesList:{
  55. type: Array,
  56. default:() => []
  57. },
  58. orderId:[Number, String],
  59. orderStatus:String,
  60. canReport:{
  61. type: Boolean,
  62. default: false
  63. }
  64. },
  65. data(){
  66. return {
  67. activeName:"工序报工",
  68. detailActive:"报工汇总",
  69. processeVal:'0',
  70. processeDetail:[
  71. {label:'序号', key: 'aa'},
  72. {label:'工序名称', key: 'aa'},
  73. {label:'已合格', key: 'aa'},
  74. {label:'已废品', key: 'aa'},
  75. {label:'在制品', key: 'aa'},
  76. {label:'无成本报工', key: 'aa'},
  77. {label:'本次合格', key: 'aa'},
  78. {label:'设备号', key: 'aa'},
  79. {label:'报工批次', key: 'aa'},
  80. {label:'混合料密度', key: 'aa'},
  81. {label:'混炼', key: 'aa'},
  82. {label:'密度', key: 'aa'},
  83. ],
  84. processOperation:[]
  85. }
  86. },
  87. watch:{
  88. orderId:{
  89. immediate: true,
  90. handler(){
  91. console.log('getProcessOperation------');
  92. this.getProcessOperation()
  93. }
  94. },
  95. },
  96. created(){
  97. },
  98. methods:{
  99. tabClick(title){
  100. this.activeName = title
  101. },
  102. detailClick(title){
  103. this.detailActive = title
  104. },
  105. handleReport(item){
  106. uni.navigateTo({
  107. url:"/pages/production/report/handleReport?data=" + JSON.stringify(item)
  108. })
  109. },
  110. async getProcessOperation(){
  111. console.log('-------getProcessOperation-------');
  112. const res = await get(this.apiUrl + "/main/user/getProcessOperation")
  113. console.log(res,'--------------');
  114. if (res.success) {
  115. this.processOperation = res.data.split('+').map(item => (item.trim()).toUpperCase())
  116. console.log(this.processOperation,'this.processOperation');
  117. }
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .processe-view{
  124. background: #fff;
  125. margin-top: 20rpx;
  126. border-radius: 12rpx;
  127. padding: 10rpx 20rpx;
  128. /deep/.uni-collapse-item{
  129. background: #fff !important;
  130. .uni-collapse-item__title .uni-collapse-item__title-box-base{
  131. background: #fff !important;
  132. }
  133. }
  134. .report-item{
  135. display: flex;
  136. justify-content: space-between;
  137. align-items: flex-start;
  138. flex-wrap: wrap;
  139. margin-bottom: 30rpx;
  140. padding: 10rpx 0;
  141. border-bottom: 1rpx solid #ccc;
  142. .report-col{
  143. width: 50%;
  144. margin-bottom: 10rpx;
  145. font-size: $uni-font-size-lg;
  146. uni-button[disabled][type=primary]{
  147. background: #ccc;
  148. }
  149. button{
  150. width: 180rpx;
  151. height: 60rpx;
  152. line-height: 60rpx;
  153. background: $j-primary-green;
  154. margin: 0 0 0 auto;
  155. }
  156. }
  157. }
  158. .tabs{
  159. padding-top: 20rpx ;
  160. display: flex;
  161. justify-content: flex-start;
  162. align-items: center;
  163. font-size: $uni-font-size-sm;
  164. margin-bottom: 20rpx;
  165. .tabs-item{
  166. border: 1rpx solid #ccc;
  167. border-radius: 8rpx;
  168. padding: 10rpx 20rpx;
  169. &.active{
  170. color: #fff;
  171. background:$j-primary-border-green;
  172. }
  173. }
  174. }
  175. .card-content{
  176. padding:10rpx 10rpx 20rpx;
  177. font-size: $uni-font-size-sm;
  178. min-height: 20vh;
  179. .collapse-title{
  180. display: flex;
  181. justify-content: space-between;
  182. padding:16rpx 3% 16rpx;
  183. }
  184. }
  185. .content{
  186. min-height: 30vh;
  187. background: #fff;
  188. }
  189. .card-list{
  190. .list-item{
  191. font-size: $uni-font-size-ssm;
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. padding: 16rpx 0;
  196. }
  197. }
  198. .tab-wrapper{
  199. display: flex;
  200. justify-content: space-between;
  201. align-items: center;
  202. font-size: $uni-font-size-ssm;
  203. .detail-tab{
  204. display: flex;
  205. justify-content: flex-start;
  206. align-items: center;
  207. font-size: $uni-font-size-sm;
  208. margin-bottom: 20rpx;
  209. .detail-item{
  210. background: rgba(226, 226, 226, 1);
  211. border: 1rpx solid rgba(226, 226, 226, 1);
  212. padding: 10rpx 16rpx;
  213. &.active{
  214. background: #fff;
  215. }
  216. }
  217. }
  218. uni-button{
  219. margin: 0;
  220. }
  221. }
  222. }
  223. </style>