reviewDtl.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <template>
  2. <div>
  3. <uni-nav-bar title="退仓复核-详情" :status-bar="true" background-color="#3F92F9" color="#FFF">
  4. <view slot="left">
  5. <u-icon name="account-fill" color="#FFF" size="35"></u-icon>
  6. <span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
  7. </view>
  8. <view slot="right" @tap="$utils.openNew(`/pages/warehouse/review`)">
  9. <span style="color: #FFFFFF;">返回</span>
  10. </view>
  11. </uni-nav-bar>
  12. <ul class="review-ul">
  13. <li v-for="(i,index) in dtlData.checkDetailsInfoList" :key="i.materialId">
  14. <view class="title">
  15. 物料名称:{{i.materialName}}
  16. </view>
  17. <view class="lists">
  18. <view class="list-box" v-for="(j,jindex) in i.stockBackDetailsList" :key="i.id">
  19. <view class="col">
  20. 卷{{jindex + 1}}
  21. </view>
  22. <view class="col" style="padding: 0 10rpx;">
  23. {{j.materialMeters}}
  24. </view style="padding: 0 10rpx;">
  25. <view class="col" style="min-height:10rpx">
  26. {{j.rfid ? j.rfid : ' '}}
  27. </view>
  28. <view class="col">
  29. <button @click="sacnFn(index,jindex)">扫描</button>
  30. </view>
  31. <view class="col">
  32. <button @click="tagFn(index,jindex)">生成</button>
  33. </view>
  34. </view>
  35. <view class="footer-btn-warp" style="margin-top: 20rpx;">
  36. <button class="cancel" style="color:#333" @click="dtlDataListDlt(index)">删除</button>
  37. <button class="upload" style="color:#333" @click="listUpdate(i,index)">修改</button>
  38. </view>
  39. </view>
  40. </li>
  41. </ul>
  42. <view class="footer-btn-warp" style="margin-top: 20rpx;">
  43. <button class="cancel" style="background-color:red" @tap="$utils.back()">取消</button>
  44. <button class="upload" style="background-color:blue" @click="submitCheck">确定</button>
  45. </view>
  46. <uni-popup ref="addModal" type="bottom">
  47. <view class="addModal-content">
  48. <view class="select-warp">
  49. <view class="label">
  50. 选择面料
  51. </view>
  52. <view class="show-text" @click="openSelectModal">
  53. {{!selectMaterialDtl.materialName ? '请选择物料' : selectMaterialDtl.materialName }}
  54. </view>
  55. <view class="add-icon">
  56. +
  57. </view>
  58. </view>
  59. <view style="height:40rpx;border-bottom: 1px solid #ccc;">
  60. </view>
  61. <view class="ul">
  62. <view class="li" v-for="(i,index) in selectMaterialDtl.stockBackDetailsList">
  63. <view class="delete-icon" @click="materialMetersListDelete(index)">
  64. -
  65. </view>
  66. <view class="li-label">
  67. 卷{{index + 1}}
  68. </view>
  69. <view class="input">
  70. <input type="number" :value="i.materialMeters" @input="((e)=>inputChange(e,index))">
  71. </view>
  72. </view>
  73. </view>
  74. <!-- <button class="add-btn" @click="addList">在添加一卷</button> -->
  75. <view class="footer-btn-warp" style="margin-top: 20rpx;">
  76. <button class="cancel" style="background-color:red" @click="closeaddModal">取消</button>
  77. <button class="upload" style="background-color:blue" @click="closeaddModal">确定</button>
  78. </view>
  79. </view>
  80. </uni-popup>
  81. <uni-popup ref="popup2" type="bottom">
  82. <u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" :is-scroll="false"
  83. swiperWidth="750"></u-tabs-swiper>
  84. <view class="search-box" v-if="current == 0">
  85. <ul>
  86. <li @click="selectMaterialList(i)" v-for="i in pickingToday" :key="i.id">
  87. {{i.name}}
  88. </li>
  89. <view class="no-data" v-if="pickingToday.length == 0">
  90. 暂无今日领取面料数据
  91. </view>
  92. </ul>
  93. </view>
  94. <view class="search-box" v-if="current == 1">
  95. <view class="input-warp">
  96. <u-input
  97. v-model="req.search"
  98. :searchIcon="true"
  99. :border="true"
  100. placeholder="请输入物料名称或编码"
  101. @search="getSelectMaterialList"
  102. class="search-input"
  103. />
  104. </view>
  105. <ul>
  106. <li @click="selectMaterialList(i)" v-for="i in materialData" :key="i.id">
  107. {{i.name}}
  108. </li>
  109. <view class="no-data" v-if="materialData.length == 0">
  110. 暂无数据
  111. </view>
  112. </ul>
  113. </view>
  114. </uni-popup>
  115. </div>
  116. </template>
  117. <script>
  118. import scan from './scan'
  119. export default{
  120. name:"xx",
  121. components:{
  122. scan
  123. },
  124. data(){
  125. return{
  126. dtlData:{},
  127. isEdit:false,
  128. swiperCurrent:0,
  129. current:0,
  130. list: [{
  131. name: '今日领取的面料'
  132. }, {
  133. name: '选择其他'
  134. }],
  135. userInfo:this.$storage.getStorageSync('userInfo'),
  136. form:{
  137. operatorId:this.$storage.getStorageSync('userInfo').id,
  138. backDetailList:[],
  139. },
  140. req:{
  141. userId:this.$storage.getStorageSync('userInfo').id,
  142. pageNum:1,
  143. pageSize:10,
  144. search:null,
  145. materialCode:null,
  146. },
  147. pickingToday:[],
  148. materialData:[],
  149. selectMaterialDtl:{},
  150. updateIndex:null,
  151. }
  152. },
  153. onLoad(option){
  154. const v = this
  155. uni.getStorage({
  156. key: 'reviewDtl',
  157. success: function (res) {
  158. console.log(res)
  159. v.dtlData = res.data
  160. } ,fail(err) {
  161. v.getDtl(option.id)
  162. }
  163. });
  164. },
  165. created(){
  166. this.selectList()
  167. this.getSelectMaterialList()
  168. },
  169. methods:{
  170. closeaddModal(){
  171. this.$refs.addModal.close()
  172. },
  173. submitCheck(){
  174. uni.showLoading({
  175. title: '正在提交'
  176. })
  177. const v = this
  178. var rfidItems = []
  179. for (var i = 0; i < v.dtlData.checkDetailsInfoList.length; i++) {
  180. const element = v.dtlData.checkDetailsInfoList[i]
  181. for (var j = 0; j < element.stockBackDetailsList.length; j++) {
  182. const jelement = element.stockBackDetailsList[j]
  183. if(!jelement.rfid){
  184. this.$msg.showToast('请扫描或生成所有面料!')
  185. return
  186. }else{
  187. rfidItems.push(jelement.rfid)
  188. }
  189. }
  190. }
  191. console.log(rfidItems)
  192. uni.request({
  193. url: 'http://120.79.80.64:8050' + '/cloudApi/stockBack/submitCheck',
  194. method: 'POST',
  195. header:{
  196. 'Content-Type' : 'application/json',
  197. },
  198. data: v.dtlData,
  199. success: res => {
  200. console.log(res)
  201. if(res.data.code == 200){
  202. this.$utils.openNew(`/pages/warehouse/review`)
  203. }
  204. },
  205. });
  206. },
  207. tagFn(index,jindex){
  208. const v = this
  209. v.dtlData.index = index
  210. v.dtlData.jindex = jindex
  211. uni.setStorage({
  212. key: 'reviewDtl',
  213. data: v.dtlData,
  214. success: function () {
  215. v.$utils.open('/pages/warehouse/tag')
  216. }
  217. });
  218. },
  219. sacnFn(index,jindex){
  220. const v = this
  221. v.dtlData.index = index
  222. v.dtlData.jindex = jindex
  223. uni.setStorage({
  224. key: 'reviewDtl',
  225. data: v.dtlData,
  226. success: function () {
  227. v.$utils.open('/pages/warehouse/scan')
  228. }
  229. });
  230. },
  231. getDtl(_id){
  232. console.log(_id)
  233. const v = this
  234. uni.request({
  235. url: 'http://120.79.80.64:8050' + '/cloudApi/stockBack/checkDetails',
  236. method: 'POST',
  237. header:{
  238. 'Content-Type' : 'application/json',
  239. },
  240. data: {
  241. stockBackId:_id
  242. },
  243. success: res => {
  244. this.dtlData = res.data.data
  245. v.dtlData.checkerId = this.$storage.getStorageSync('userInfo').id
  246. console.log(this.dtlData)
  247. },
  248. });
  249. },
  250. submitBack(){
  251. const v = this
  252. console.log(v.form)
  253. uni.request({
  254. url: 'http://120.79.80.64:8050' + '/cloudApi/stockBack/submitBack',
  255. method: 'POST',
  256. header:{
  257. 'Content-Type' : 'application/json',
  258. },
  259. data: v.form,
  260. success: res => {
  261. console.log(res)
  262. if(res.data.code == 200){
  263. this.$msg.showToast('操作成功!')
  264. this.$utils.back()
  265. }
  266. },
  267. });
  268. },
  269. dtlDataListDlt(index){
  270. this.dtlData.checkDetailsInfoList.splice(index,1)
  271. },
  272. materialMetersListDelete(index){
  273. this.dtlData.checkDetailsInfoList[this.updateIndex].stockBackDetailsList.splice(index,1)
  274. },
  275. listUpdate(i,index){
  276. console.log(i)
  277. this.selectMaterialDtl = i
  278. this.updateIndex = index
  279. this.$refs.addModal.open()
  280. },
  281. listDelete(index){
  282. this.form.backDetailList.splice(index,1)
  283. },
  284. pushList(){
  285. if(this.updateIndex === null){
  286. this.form.backDetailList.push(this.selectMaterialDtl)
  287. }else{
  288. this.form.backDetailList[this.updateIndex] = this.selectMaterialDtl
  289. }
  290. this.selectMaterialDtl = {}
  291. this.$refs.addModal.close()
  292. },
  293. inputChange(e,index){
  294. this.selectMaterialDtl.stockBackDetailsList[index].materialMeters = e.detail.value
  295. console.log(this.selectMaterialDtl)
  296. },
  297. tabsChange(index) {
  298. this.swiperCurrent = index;
  299. this.current = index;
  300. },
  301. addList(){
  302. this.selectMaterialDtl.materialMetersList.push({
  303. "id": "1565274397500047361",
  304. "stockBackId": "1565274397445521410",
  305. "materialId": "01.002.0043",
  306. "materialMeters": 0,
  307. "oldMaterialMeters": 0,
  308. "rfid": ""
  309. })
  310. },
  311. selectMaterialList(i){
  312. const v = this
  313. this.dtlData.checkDetailsInfoList[this.updateIndex].materialId = i.code
  314. this.dtlData.checkDetailsInfoList[this.updateIndex].materialName = i.name
  315. console.log(i)
  316. console.log(this.updateIndex)
  317. },
  318. openSelectModal(){
  319. this.$refs.popup2.open()
  320. },
  321. getSelectMaterialList(){
  322. const v = this
  323. uni.request({
  324. url: 'http://120.79.80.64:8050' + '/cloudApi/material/selectList',
  325. method: 'POST',
  326. header:{
  327. 'Content-Type' : 'application/json',
  328. },
  329. data: v.req,
  330. success: res => {
  331. console.log(res)
  332. this.materialData = res.data.data
  333. },
  334. });
  335. },
  336. selectList(){
  337. const v = this
  338. uni.request({
  339. url: 'http://120.79.80.64:8050' + '/cloudApi/stockBack/getPickingToday',
  340. method: 'POST',
  341. header:{
  342. 'Content-Type' : 'application/json',
  343. },
  344. data: v.req,
  345. success: res => {
  346. console.log(res)
  347. this.pickingToday = res.data.data
  348. },
  349. });
  350. },
  351. openModal(){
  352. this.$refs.addModal.open('bottom')
  353. },
  354. },
  355. }
  356. </script>
  357. <style scoped lang="less">
  358. .review-ul{
  359. padding: 0 20rpx;
  360. li{
  361. background-color: #fff;
  362. border-radius: 6rpx;
  363. list-style: none;
  364. margin-top: 20rpx;
  365. .title{
  366. height: 100rpx;
  367. line-height: 100rpx;
  368. font-size: 30rpx;
  369. border-bottom: 1px solid #dcdcdc;
  370. padding: 0 20rpx;
  371. }
  372. .lists{
  373. .list-box{
  374. overflow: hidden;
  375. line-height: 80rpx;
  376. .col{
  377. float: left;
  378. width: 20%;
  379. text-align: center;
  380. overflow: hidden;
  381. button{
  382. width: 80%;
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. .footer-btn-warp{
  390. display: flex;
  391. padding: 20rpx;
  392. button{
  393. width: 48%;
  394. color: #fff;
  395. }
  396. }
  397. .search-box{
  398. .input-warp{
  399. padding: 40rpx;
  400. }
  401. .search-input{
  402. }
  403. background-color: #fff;
  404. text-align: center;
  405. ul{
  406. li{
  407. padding: 25rpx 30rpx;
  408. border-bottom: 1rpx solid #dcdcdc;
  409. list-style: none;
  410. }
  411. }
  412. .no-data{
  413. padding: 100rpx;
  414. }
  415. }
  416. .addModal-content{
  417. background-color: #fff;
  418. border-top-left-radius:20rpx;
  419. border-top-right-radius:20rpx;
  420. padding-top:40rpx;
  421. .footer-btn-warp{
  422. display: flex;
  423. padding: 20rpx;
  424. button{
  425. width: 48%;
  426. color: #fff;
  427. }
  428. }
  429. .ul{
  430. .li{
  431. display: flex;
  432. justify-content: space-between;
  433. height: 80rpx;
  434. line-height: 80rpx;
  435. margin-top: 20rpx;
  436. .input{
  437. width: 70%;
  438. input{
  439. border:1rpx solid #dcdcdc;
  440. height: 78rpx;
  441. line-height: 78rpx;
  442. padding: 0 20rpx;
  443. }
  444. }
  445. }
  446. .delete-icon{
  447. height: 80rpx;
  448. width: 80rpx;
  449. text-align: center;
  450. line-height: 80rpx;
  451. font-size: 40rpx;
  452. color: #fff;
  453. background-color: #ccc;
  454. }
  455. }
  456. .select-warp{
  457. height: 80rpx;
  458. line-height: 80rpx;
  459. padding: 0 20rpx ;
  460. box-sizing: border-box;
  461. display: flex;
  462. justify-content: space-between;
  463. .show-text{
  464. width: 70%;
  465. border:1rpx solid #dcdcdc;
  466. padding: 0 20rpx;
  467. }
  468. .add-icon{
  469. height: 80rpx;
  470. width: 80rpx;
  471. text-align: center;
  472. line-height: 80rpx;
  473. font-size: 40rpx;
  474. color: #fff;
  475. background-color: #ccc;
  476. }
  477. }
  478. }
  479. .ul{
  480. .li{
  481. background-color: #fff;
  482. border-radius: 5rpx;
  483. margin: 20rpx 20rpx 0;
  484. .label{
  485. height: 100rpx;
  486. line-height: 100rpx;
  487. font-weight: 30rpx;
  488. border-bottom: 1rpx solid #ccc;
  489. padding: 0 20rpx;
  490. }
  491. .lists{
  492. border-bottom: 1rpx solid #ccc;
  493. .list-box{
  494. height: 100rpx;
  495. line-height: 100rpx;
  496. display: flex;
  497. justify-content: space-between;
  498. padding: 0 20rpx;
  499. }
  500. }
  501. .list-btn-warp{
  502. display: flex;
  503. padding: 20rpx;
  504. button{
  505. width: 48%;
  506. }
  507. }
  508. }
  509. }
  510. .add-header{
  511. height: 100rpx;
  512. line-height: 100rpx;
  513. font-size: 30rpx;
  514. font-weight: bold;
  515. overflow: hidden;
  516. padding: 20rpx;
  517. button{
  518. width: 200rpx;
  519. color: #fff;
  520. background-color: red;
  521. float: right;
  522. margin: 14rpx 0;
  523. }
  524. }
  525. </style>