outsourceList.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <template>
  2. <view>
  3. <u-popup :show="show" :mode='mode' :closeOnClickOverlay='false'>
  4. <view class="card_box">
  5. <view class="item_box rx-bc">
  6. <view class="item_one perce50 rx-sc">
  7. <view class="lable">委外名称:</view>
  8. <view>{{ outObj.name }}</view>
  9. </view>
  10. <view class="item_one perce50 rx-sc">
  11. <view class="lable">委外类型:</view>
  12. <view>{{ outObj.type == 4 ? '带料委外' : '无料委外' }}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <u-tabs :list="tabList" @click="handTab" lineWidth="30" lineColor="#157A2C" :activeStyle="{
  17. color: '#157A2C',
  18. }" :inactiveStyle="{
  19. color: '#303133',
  20. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
  21. </u-tabs>
  22. <view class="box_list">
  23. <u-list @scrolltolower="scrolltolower" class="z_list">
  24. <view v-if="actTab == '物品清单'">
  25. <checkbox-group v-for="(item, index) in pickOutInList" :key="index">
  26. <label class="listBox rx-bs">
  27. <view class="listBox-sel">
  28. <checkbox
  29. v-if=' (item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1))'
  30. :value="item.code" color="#fff" :disabled="item.disabled"
  31. :checked="item.checked" />
  32. </view>
  33. <view class="listBox-con">
  34. <view class="listBox-top rx-bc">
  35. <view> {{ item.name }}</view>
  36. <view class="code">
  37. {{ item.rootCategoryLevelId == 4 ? item.codeNumber : item.code}}
  38. </view>
  39. </view>
  40. <view class="listBox-bottom rx">
  41. <view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
  42. class="items" v-if="!itm.formatter">
  43. <text>{{ itm.label }}</text>{{ item[itm.prop] }}
  44. </view>
  45. <view class="items"
  46. v-if='(item.rootCategoryLevelId == 1 && item.isConsumable == 1) && item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 4 '>
  47. <text>可用库存</text>{{ item.availableCountBase }} {{item.unit}}
  48. </view>
  49. <view class="items"
  50. v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
  51. <text>刻码</text>{{item.extInfo.engrave }}
  52. </view>
  53. <view class="items"
  54. v-if='([1,9,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
  55. <text>物料代号</text>{{item.extInfo.materielCode }}
  56. </view>
  57. <view class="items"
  58. v-if='([1,23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0) '>
  59. <text>客户代号</text>{{item.extInfo.clientCode }}
  60. </view>
  61. </view>
  62. </view>
  63. </label>
  64. </checkbox-group>
  65. </view>
  66. <view v-if="actTab == '带料清单'">
  67. <view class="title_box rx-bc">
  68. <view></view>
  69. <view class="right_box rx-ec">
  70. <u-button type="success" size="small" class="u-reset-button" @click="addPicking(2)"
  71. text="添加物料"></u-button>
  72. </view>
  73. </view>
  74. </view>
  75. <view v-if="actTab == '产出清单'">
  76. <view v-for="(item, index) in pickOutInVOList" :key="index">
  77. <view class="listBox rx-bs">
  78. <view class="listBox-bottom rx">
  79. <view class="items">
  80. <text>名称</text>{{ item.name }}
  81. </view>
  82. <view class="items">
  83. <text>编码</text>{{ item.code }}
  84. </view>
  85. <view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
  86. class="items" v-if="!itm.formatter">
  87. <text>{{ itm.label }}</text>{{ item[itm.prop] }}
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </u-list>
  94. <view class="operate_box rx-bc">
  95. <u-button size="small" class="u-reset-button" @click="close">
  96. 取消
  97. </u-button>
  98. <u-button type="success" size="small" class="u-reset-button" @click="handOK">
  99. 确定
  100. </u-button>
  101. </view>
  102. </view>
  103. </u-popup>
  104. </view>
  105. </template>
  106. <script>
  107. import {
  108. checkOutsourceMaterial
  109. } from '@/api/pda/workOrder.js'
  110. import {
  111. tableHeader
  112. } from '../common.js'
  113. import {
  114. EventBus
  115. } from '@/utils/eventBus.js'
  116. export default {
  117. data() {
  118. return {
  119. mode: 'center',
  120. show: false,
  121. topHight: 20 || 20,
  122. outObj: {},
  123. tabList: [{
  124. name: '主体清单'
  125. },
  126. {
  127. name: '带料清单'
  128. },
  129. {
  130. name: '产出清单'
  131. }
  132. ],
  133. actTab: '主体清单',
  134. bomMaterialList: [],
  135. pickOutInList: [],
  136. materialList: [],
  137. pickOutInVOList: []
  138. }
  139. },
  140. created() {
  141. EventBus.$on('outEvent', this.handleEvent);
  142. },
  143. methods: {
  144. open(obj) {
  145. console.log(obj, 999)
  146. this.outObj = obj
  147. this.outsourceMaterialFn()
  148. this.show = true
  149. },
  150. outsourceMaterialFn() {
  151. let param = {
  152. taskId: this.outObj.taskId,
  153. taskIds: this.outObj.taskIds,
  154. workOrderId: this.outObj.workOrderId
  155. }
  156. checkOutsourceMaterial(param).then(res => {
  157. this.pickOutInList = res.pickOutInList
  158. this.bomMaterialList = res.bomMaterialList
  159. this.pickOutInVOList = res.pickOutInVOList
  160. this.$forceUpdate()
  161. })
  162. },
  163. handTab(item) {
  164. this.actTab = item.name
  165. },
  166. close() {
  167. this.show = false
  168. },
  169. handleEvent(data) {
  170. console.log('Received event with data:', data);
  171. },
  172. tableH(type) {
  173. return tableHeader(type)
  174. },
  175. scrolltolower() {},
  176. addPicking(id) {
  177. const storageKey = Date.now() + "";
  178. let arr = []
  179. uni.setStorageSync(storageKey, arr);
  180. uni.navigateTo({
  181. url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,9]`
  182. })
  183. },
  184. handOK() {
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. .z_list {
  191. max-height: 860rpx;
  192. padding: 10rpx;
  193. box-sizing: border-box;
  194. }
  195. .box_list {
  196. min-height: 100rpx;
  197. width: 96vw;
  198. /deep/ .baseForm {
  199. padding: 0 20rpx;
  200. }
  201. }
  202. .operate_box {
  203. padding: 10rpx 32rpx;
  204. /deep/ .u-button {
  205. width: 40%;
  206. }
  207. }
  208. /deep/ .u-tabs__wrapper__nav {
  209. background: #f5f5f5 !important;
  210. }
  211. .listBox {
  212. margin-top: 8rpx;
  213. padding: 8rpx 24rpx;
  214. background: #fff;
  215. /deep/ .uni-checkbox-input-checked {
  216. background-color: $theme-color !important;
  217. border-color: $theme-color !important;
  218. }
  219. .listBox-con {
  220. width: 650rpx;
  221. font-weight: 400;
  222. }
  223. .listBox-top {
  224. margin-top: 6rpx;
  225. color: #090A0A;
  226. font-size: 28rpx;
  227. font-style: normal;
  228. font-weight: 800;
  229. }
  230. .listBox-bottom {
  231. color: #090A0A;
  232. font-size: 24rpx;
  233. font-style: normal;
  234. flex-wrap: wrap;
  235. .items {
  236. width: calc(50% - 1px);
  237. border-left: 1rpx solid #E3E5E5;
  238. border-right: 1rpx solid #E3E5E5;
  239. border-bottom: 1rpx solid #E3E5E5;
  240. box-sizing: border-box;
  241. word-break: break-all;
  242. text {
  243. display: inline-block;
  244. background: #F7F9FA;
  245. padding: 8rpx 10rpx;
  246. color: #157A2C;
  247. }
  248. &:nth-child(1),
  249. &:nth-child(2) {
  250. border-top: 1rpx solid #E3E5E5;
  251. margin-top: 8rpx;
  252. }
  253. }
  254. }
  255. }
  256. .card_box {
  257. width: 750rpx;
  258. padding: 16rpx 32rpx;
  259. box-sizing: border-box;
  260. border-bottom: 2rpx solid #E1E1E1;
  261. .item_box {
  262. margin-top: 10rpx;
  263. .item_one {
  264. width: 100%;
  265. font-size: 26rpx;
  266. font-style: normal;
  267. font-weight: 400;
  268. line-height: 38rpx;
  269. word-wrap: break-word;
  270. }
  271. .gylx {
  272. color: $theme-color;
  273. }
  274. .perce50 {
  275. width: 50%;
  276. }
  277. }
  278. }
  279. </style>