deliveryFrom.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <view >
  3. <u-navbar title="出库申请"></u-navbar>
  4. <!-- 出库单状态 -->
  5. <view class="container">
  6. <!-- 出库单详情 -->
  7. <view class="details">
  8. <view class="item">
  9. <view class="name">
  10. 所属项目<span style="color: red;">*</span>
  11. </view>
  12. <view class="value">
  13. <u-input v-model="form.projectName" placeholder="请输入所属项目" type="text" />
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="name">
  18. 需求时间
  19. </view>
  20. <view class="value">
  21. <u-input v-model="needTime" @click="show=true,showText='needTime'" placeholder="请输入需求时间" type="select" />
  22. </view>
  23. </view>
  24. <view class="item">
  25. <view class="name">
  26. 使用周期至<span style="color: red;">*</span>
  27. </view>
  28. <view class="value">
  29. <u-calendar v-model="show" mode="date" max-date="2099-01-01" @change="change"></u-calendar>
  30. <u-input v-model="endTime" @click="show=true,showText='endTime'" placeholder="请输入使用周期" type="select" />
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 出库设备清单 -->
  35. <view class="list">
  36. <view class="list-head">
  37. <view class="title">
  38. 出库设备清单
  39. </view>
  40. <view class="amount add" @click="showpopup=true">
  41. <u-icon name="plus-circle"></u-icon>添加设备
  42. </view>
  43. </view>
  44. <!-- 清单信息 -->
  45. <view class="list-infos" v-for="(item,index) in list" :key="index" >
  46. <view class="infos-head">
  47. <view class="name">
  48. {{item.obj.title}}
  49. </view>
  50. <view class="state">
  51. <u-icon name="minus-circle" ></u-icon>删除
  52. </view>
  53. </view>
  54. <view class="infos">
  55. <view class="infos-1">
  56. <view class="infos-item">
  57. <view class="item-name">
  58. 型号:
  59. </view>
  60. <view class="item-value">
  61. {{item.obj.model}}
  62. </view>
  63. </view>
  64. <view class="infos-item">
  65. <view class="item-name">
  66. 库存:
  67. </view>
  68. <view class="item-value">
  69. {{item.obj.count}}
  70. </view>
  71. </view>
  72. </view>
  73. <view class="infos-2" v-if="false">
  74. <view class="infos-item">
  75. <view class="item-name">
  76. 单位:
  77. </view>
  78. <view class="item-value">
  79. </view>
  80. </view>
  81. <view class="infos-item">
  82. <view class="item-name">
  83. 库存:
  84. </view>
  85. <view class="item-value">
  86. 20
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view>
  92. <u-gap height="2" bg-color="#bbb"></u-gap>
  93. 出库数量
  94. <u-number-box bg-color="#FFFFFF"
  95. style="float: right;" v-model="item.count"></u-number-box>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <u-popup-sync v-model="showpopup" mode="bottom"
  101. border-radius="14"
  102. :closeable="true" >
  103. <view class="showpopup">添加设备</view>
  104. <!-- 搜索 -->
  105. <view class="search" >
  106. <view class="search-box">
  107. <u-search placeholder="搜索设备名称或型号" v-model="queryContent" :show-action="false">
  108. </u-search>
  109. <view class="search-btn" @click="ckQueryContent" >
  110. <view class="text">
  111. 搜索
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <scroll-view scroll-y="true" style="height: 800rpx;" @scrolltolower="refscrolltolower()">
  117. <equipmentRetrieval @ckItem="ckItem" ref="equipmentRetrievalRef" :iscomponents="1"></equipmentRetrieval>
  118. </scroll-view>
  119. </u-popup-sync>
  120. <!-- 确认出库 -->
  121. <view class="bottom" @click="submit()" >
  122. <button>提交出库单</button>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. import equipmentRetrieval from "@/pages/index/equipmentRetrieval/equipmentRetrieval"
  128. import * as API from '@/apis/pagejs/projectDepartment.js'
  129. export default {
  130. data() {
  131. return {
  132. recordId:"",
  133. form:{
  134. recordId:"",
  135. needTime:"",
  136. endTime:"",
  137. projectName:"",
  138. },
  139. show:false,
  140. showText:"",
  141. showpopup:false,
  142. endTime:'',
  143. needTime:'',
  144. queryContent:'',
  145. list:[]
  146. }
  147. },
  148. components:{
  149. equipmentRetrieval
  150. },
  151. computed:{
  152. },
  153. methods:{
  154. refscrolltolower(){
  155. this.$refs.equipmentRetrievalRef.myLoadmoreonReachBottom()
  156. },
  157. ckQueryContent(){
  158. this.$refs.equipmentRetrievalRef.queryContent=this.queryContent
  159. this.$refs.equipmentRetrievalRef.getList()
  160. },
  161. change(e){
  162. this.form[this.showText]=e.result;
  163. this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
  164. },
  165. submit(){
  166. if(!this.form.projectName){
  167. uni.showToast({
  168. title: "请填写所属项目"
  169. })
  170. return
  171. }
  172. if(!this.form.endTime){
  173. uni.showToast({
  174. title: "请输入使用周期"
  175. })
  176. return
  177. }
  178. if(this.list.length==0){
  179. uni.showToast({
  180. title: "请添加设备"
  181. })
  182. return
  183. }
  184. var list=this.list.map(item=>{
  185. var obj={
  186. ...item
  187. }
  188. delete obj.obj
  189. return obj
  190. })
  191. this.form.deviceData=list
  192. console.log(this.form)
  193. uni.showLoading({
  194. title: "加载中",
  195. mask: true,
  196. })
  197. API.saveOutRecord({
  198. content:JSON.stringify(this.form)
  199. }).then((res) => {
  200. const eventChannel = this.getOpenerEventChannel();
  201. eventChannel.emit('refreshData');
  202. uni.hideLoading()
  203. uni.showModal({
  204. title: '提示',
  205. content: '操作成功',
  206. showCancel:false,
  207. success: function (res) {
  208. if (res.confirm) {
  209. uni.navigateBack()
  210. } else if (res.cancel) {
  211. console.log('用户点击取消');
  212. }
  213. }
  214. });
  215. }).catch(error => {
  216. uni.showToast({
  217. title: error
  218. })
  219. })
  220. },
  221. ckItem(item){
  222. this.list.push({
  223. deviceName:item.title,
  224. obj:item,
  225. count:1
  226. })
  227. uni.showToast({
  228. title: "添加成功"
  229. })
  230. },
  231. }
  232. }
  233. </script>
  234. <style scoped lang="scss">
  235. // 搜索
  236. .search {
  237. padding: 12rpx 24rpx;
  238. display: flex;
  239. border-radius: 8px;
  240. overflow: hidden;
  241. .search-box {
  242. display: flex;
  243. border-radius: 8px;
  244. overflow: hidden;
  245. }
  246. /deep/.u-search {
  247. width: 630rpx;
  248. margin: auto !important;
  249. position: relative;
  250. flex: 0;
  251. margin: 0 !important;
  252. height: 64rpx !important;
  253. }
  254. /deep/.u-content {
  255. width: 430px;
  256. border-radius: 0px !important;
  257. height: 64rpx !important;
  258. }
  259. /deep/.u-icon--right {
  260. margin-right: 16rpx;
  261. }
  262. .search-btn {
  263. width: 100rpx;
  264. height: 64rpx;
  265. background-color: #f2f2f2;
  266. .text {
  267. height: 40rpx;
  268. margin: 12rpx 0;
  269. border-left: 1px solid #999999;
  270. font-family: Microsoft Yahei;
  271. text-align: center;
  272. color: rgba(16, 98, 213, 1);
  273. font-size: 28rpx;
  274. }
  275. }
  276. }
  277. .showpopup{
  278. font-size: 36rpx;
  279. text-align: center;
  280. margin: 32rpx;
  281. }
  282. page {
  283. padding-bottom: 200rpx;
  284. }
  285. // 出库单状态
  286. .head {
  287. background-color: #fff;
  288. padding: 24rpx 32rpx;
  289. display: flex;
  290. align-items: center;
  291. color: #101010;
  292. font-size: 32rpx;
  293. .photo {
  294. width: 84rpx;
  295. height: 84rpx;
  296. border-radius: 100rpx;
  297. img {
  298. width: 100%;
  299. height: 100%;
  300. overflow: hidden;
  301. }
  302. }
  303. .name {
  304. color: #101010;
  305. font-size: 32rpx;
  306. margin-right: 8rpx;
  307. margin-left: 24rpx;
  308. }
  309. .submit {
  310. text {
  311. color: #3385FF;
  312. }
  313. }
  314. .state {
  315. line-height: 48rpx;
  316. padding: 0 24rpx;
  317. border-radius: 50px;
  318. background-color: rgba(255, 255, 255, 1);
  319. color: rgba(51, 133, 255, 1);
  320. font-size: 12px;
  321. text-align: center;
  322. font-family: Arial;
  323. border: 1px solid rgba(51, 133, 255, 1);
  324. margin-left: auto;
  325. }
  326. }
  327. // 出库单详情
  328. .details {
  329. background-color: #fff;
  330. margin-top: 24rpx;
  331. padding: 0 32rpx;
  332. .item {
  333. display: flex;
  334. justify-content: space-between;
  335. padding: 22rpx 0;
  336. border-bottom: 1px solid rgba(244, 244, 244, 1);
  337. .name {
  338. color: rgba(119, 119, 119, 1);
  339. }
  340. .value {
  341. color: #101010;
  342. }
  343. }
  344. }
  345. // 出库单列表
  346. .list {
  347. background-color: #fff;
  348. margin-top: 24rpx;
  349. padding: 22rpx 32rpx;
  350. .list-head {
  351. display: flex;
  352. justify-content: space-between;
  353. align-items: center;
  354. .title {
  355. color: #333333;
  356. font-size: 32rpx
  357. }
  358. .amount.add{
  359. color:#45BA45 ;
  360. }
  361. .amount {
  362. font-size: 24rpx;
  363. text {
  364. color: #3385FF;
  365. }
  366. /deep/.u-icon--right {
  367. margin-left: 8rpx;
  368. }
  369. }
  370. }
  371. // 清单信息
  372. .list-infos {
  373. border-radius: 8px;
  374. background-color: #F5F6F9;
  375. margin-top: 24rpx;
  376. padding: 24rpx;
  377. .infos-head {
  378. display: flex;
  379. justify-content: space-between;
  380. align-items: center;
  381. margin-bottom: 24rpx;
  382. .name {
  383. color: rgba(51, 51, 51, 1);
  384. font-size: 32rpx;
  385. }
  386. .state {
  387. color: #999999;
  388. }
  389. }
  390. .infos {
  391. margin-top: 16rpx;
  392. display: flex;
  393. color: #777777;
  394. font-size: 24rpx;
  395. .infos-1 {
  396. margin-right: 68rpx;
  397. }
  398. .infos-item {
  399. display: flex;
  400. margin-bottom: 8rpx;
  401. }
  402. }
  403. }
  404. }
  405. // 流程
  406. .process {
  407. background-color: #fff;
  408. margin-top: 24rpx;
  409. padding: 24rpx 32rpx;
  410. .title {
  411. color: rgba(51, 51, 51, 1);
  412. font-size: 32rpx;
  413. }
  414. .u-time-axis-item{
  415. //margin-bottom: 76rpx;
  416. }
  417. .u-time-axis {
  418. //padding: 18rpx 40rpx;
  419. }
  420. .u-node {
  421. width: 18rpx;
  422. height: 18rpx;
  423. border-radius: 100rpx !important;
  424. display: flex;
  425. justify-content: center;
  426. align-items: center;
  427. background: #d0d0d0;
  428. }
  429. .u-order{
  430. margin-bottom: 32rpx;
  431. }
  432. .u-order-title {
  433. color: #333333;
  434. font-weight: bold;
  435. font-size: 32rpx;
  436. }
  437. .u-order-desc {
  438. margin-bottom: 16rpx;
  439. display: flex;
  440. justify-content: space-between;
  441. align-items: center;
  442. .level {
  443. color: #333333;
  444. font-size: 32rpx;
  445. font-weight: bold;
  446. }
  447. .date {
  448. color: rgba(119, 119, 119, 1);
  449. }
  450. .state {
  451. color: rgba(255, 121, 0, 1);
  452. }
  453. }
  454. .u-order-time {
  455. width: 90rpx;
  456. color: #777777;
  457. font-size: 28rpx;
  458. margin-top: 16rpx;
  459. display: flex;
  460. flex-direction: column;
  461. align-items: center;
  462. .photo {
  463. width: 56rpx;
  464. height: 56rpx;
  465. border-radius: 100px;
  466. margin-bottom: 4rpx;
  467. img {
  468. width: 100%;
  469. height: 100%;
  470. overflow: hidden;
  471. position: relative;
  472. }
  473. }
  474. .confirm {
  475. position: absolute;
  476. top: 46rpx;
  477. left: 56rpx;
  478. }
  479. .name {
  480. color: rgba(51, 51, 51, 1);
  481. font-size: 24rpx;
  482. }
  483. }
  484. }
  485. // .u-time-axis{
  486. // .u-time-axis-item:last-of-type{
  487. // margin-bottom: 0;
  488. // }
  489. // }
  490. // 确认出库
  491. .bottom{
  492. background-color: #fff;
  493. margin-top: 44rpx;
  494. padding: 16rpx 32rpx;
  495. z-index: 999;
  496. position: fixed;
  497. left: 0;
  498. right: 0;
  499. bottom: 0;
  500. uni-button{
  501. border-radius: 8px;
  502. background: linear-gradient(180deg, rgba(22,119,255,1) 0%,rgba(16,98,213,1) 100%);
  503. color: rgba(255, 255, 255, 1);
  504. font-size: 32rpx;
  505. line-height: 88rpx;
  506. }
  507. }
  508. </style>