outsourceList.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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 class="title_box rx-bc">
  77. <view></view>
  78. <view class="right_box rx-ec">
  79. <u-button type="success" size="small" class="u-reset-button" @click="addPicking(3)"
  80. text="添加产出"></u-button>
  81. </view>
  82. </view>
  83. <view v-for="(item, index) in standardOutputList" :key="index">
  84. <label class="listBox rx-bs">
  85. <view class="listBox-sel">
  86. </view>
  87. <view class="listBox-con">
  88. <view class="listBox-bottom rx">
  89. <view
  90. class="items">
  91. <text>名称</text>{{ item.name }}
  92. </view>
  93. <view
  94. class="items">
  95. <text>编码</text>{{ item.code }}
  96. </view>
  97. <view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
  98. class="items" v-if="!itm.formatter">
  99. <text>{{ itm.label }}</text>{{ item[itm.prop] }}
  100. </view>
  101. </view>
  102. </view>
  103. </label>
  104. </view>
  105. </view>
  106. </u-list>
  107. <view class="operate_box rx-bc">
  108. <u-button size="small" class="u-reset-button" @click="close">
  109. 取消
  110. </u-button>
  111. <u-button type="success" size="small" class="u-reset-button" @click="handOK">
  112. 确定
  113. </u-button>
  114. </view>
  115. </view>
  116. </u-popup>
  117. </view>
  118. </template>
  119. <script>
  120. import {
  121. checkOutsourceMaterial
  122. } from '@/api/pda/workOrder.js'
  123. import {
  124. tableHeader
  125. } from '../common.js'
  126. import {
  127. EventBus
  128. } from '@/utils/eventBus.js'
  129. export default {
  130. data() {
  131. return {
  132. mode: 'center',
  133. show: false,
  134. topHight: 20 || 20,
  135. outObj: {},
  136. tabList: [{
  137. name: '主体清单'
  138. },
  139. {
  140. name: '带料清单'
  141. },
  142. {
  143. name: '产出清单'
  144. }
  145. ],
  146. actTab: '主体清单',
  147. bomMaterialList: [],
  148. pickOutInList: [],
  149. materialList: [],
  150. standardOutputList: []
  151. }
  152. },
  153. created() {
  154. EventBus.$on('outEvent', this.handleEvent);
  155. },
  156. methods: {
  157. open(obj) {
  158. console.log(obj, 999)
  159. this.outObj = obj
  160. this.outsourceMaterialFn()
  161. this.show = true
  162. },
  163. outsourceMaterialFn() {
  164. let param = {
  165. taskId: this.outObj.taskId,
  166. taskIds: this.outObj.taskIds,
  167. workOrderId: this.outObj.workOrderId
  168. }
  169. checkOutsourceMaterial(param).then(res => {
  170. this.pickOutInList = res.pickOutInList
  171. this.bomMaterialList = res.bomMaterialList
  172. this.standardOutputList = res.standardOutputList
  173. this.$forceUpdate()
  174. })
  175. },
  176. handTab(item) {
  177. this.actTab = item.name
  178. },
  179. close() {
  180. this.show = false
  181. },
  182. handleEvent({ message }) {
  183. if(message.pid == 3) {
  184. this.standardOutputList = message.memoList
  185. }
  186. },
  187. tableH(type) {
  188. return tableHeader(type)
  189. },
  190. scrolltolower() {},
  191. addPicking(id) {
  192. const storageKey = Date.now() + "";
  193. let arr = [
  194. {
  195. standardOutputList: this.standardOutputList
  196. }
  197. ]
  198. uni.setStorageSync(storageKey, arr);
  199. uni.navigateTo({
  200. url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,23,9]`
  201. })
  202. },
  203. handOK() {
  204. },
  205. }
  206. }
  207. </script>
  208. <style lang="scss" scoped>
  209. .z_list {
  210. max-height: 860rpx;
  211. padding: 10rpx;
  212. box-sizing: border-box;
  213. }
  214. .box_list {
  215. min-height: 100rpx;
  216. width: 96vw;
  217. /deep/ .baseForm {
  218. padding: 0 20rpx;
  219. }
  220. }
  221. .operate_box {
  222. padding: 10rpx 32rpx;
  223. /deep/ .u-button {
  224. width: 40%;
  225. }
  226. }
  227. /deep/ .u-tabs__wrapper__nav {
  228. background: #f5f5f5 !important;
  229. }
  230. .listBox {
  231. margin-top: 8rpx;
  232. padding: 8rpx 24rpx;
  233. background: #fff;
  234. /deep/ .uni-checkbox-input-checked {
  235. background-color: $theme-color !important;
  236. border-color: $theme-color !important;
  237. }
  238. .listBox-con {
  239. width: 650rpx;
  240. font-weight: 400;
  241. }
  242. .listBox-top {
  243. margin-top: 6rpx;
  244. color: #090A0A;
  245. font-size: 28rpx;
  246. font-style: normal;
  247. font-weight: 800;
  248. }
  249. .listBox-bottom {
  250. color: #090A0A;
  251. font-size: 24rpx;
  252. font-style: normal;
  253. flex-wrap: wrap;
  254. .items {
  255. width: calc(50% - 1px);
  256. border-left: 1rpx solid #E3E5E5;
  257. border-right: 1rpx solid #E3E5E5;
  258. border-bottom: 1rpx solid #E3E5E5;
  259. box-sizing: border-box;
  260. word-break: break-all;
  261. text {
  262. display: inline-block;
  263. background: #F7F9FA;
  264. padding: 8rpx 10rpx;
  265. color: #157A2C;
  266. }
  267. &:nth-child(1),
  268. &:nth-child(2) {
  269. border-top: 1rpx solid #E3E5E5;
  270. margin-top: 8rpx;
  271. }
  272. }
  273. }
  274. }
  275. .card_box {
  276. width: 750rpx;
  277. padding: 16rpx 32rpx;
  278. box-sizing: border-box;
  279. border-bottom: 2rpx solid #E1E1E1;
  280. .item_box {
  281. margin-top: 10rpx;
  282. .item_one {
  283. width: 100%;
  284. font-size: 26rpx;
  285. font-style: normal;
  286. font-weight: 400;
  287. line-height: 38rpx;
  288. word-wrap: break-word;
  289. }
  290. .gylx {
  291. color: $theme-color;
  292. }
  293. .perce50 {
  294. width: 50%;
  295. }
  296. }
  297. }
  298. </style>