| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634 |
- <template>
- <view class="mainBox">
- <view class="main">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="`选择出入库申请单`"
- @clickLeft="backAdd"></uni-nav-bar>
- <!-- <view class="searchBox">
- <input v-model="searchVal" placeholder="请输入编码" class="searchInput" />
- <u-button type="icon-shixiangxinzeng" size="30" @click="doSearch" data-icon="Search" class="searchBtn">
- <view class="iconfont icon-sousuo"></view>
- <view class="text">搜索</view>
- </u-button>
- </view> -->
- <view class="top-wrapper">
- <uni-section>
- <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="请输入编码">
- </uni-easyinput>
- </uni-section>
- <view style="display: flex;">
- <button class="search_btn" @click="doSearch">搜索</button>
- </view>
- </view>
- <view class="wrapper">
- <u-list @scrolltolower="scrolltolower" class="listContent">
- <radio-group @change="e => selectVal(e)">
- <label v-for="(item, index) in listData">
- <view class="listBox">
- <view class="listBox-sel">
- <radio :value="item.id" color="#fff" :disabled="item.disabled"
- :checked="item.id === (curItem && curItem.id)" />
- </view>
- <view class="listBox-con">
- <view style="display: flex;">
- <view class="listBox-top" style="justify-content: left;">
- <view class="round">{{Number(index)+1}}</view>
- <view class="listBox-name">
- {{ item.code }}
- </view>
- </view>
- <view class="listBox-top">
- <view class="listBox-code">
- {{ item.categoryNames }}
- </view>
- </view>
- </view>
- <view class="listBox-bottom">
- <view>牌号:{{ item.brandNum }}</view>
- <view>型号:{{ item.modelType }}</view>
- <view>规格:{{ item.specification }}</view>
- <view>出入库类型:{{ sourceTypeLabel(item.sourceType) }}</view>
- <view>审核人:{{ item.approvalUserName }}</view>
- <view>申请人:{{ item.createUserName }}</view>
- <view>状态:{{ statusOpt[item.status] }}</view>
- <view class="w100">创建时间:{{ item.createTime }}</view>
- </view>
- </view>
- </view>
- </label>
- </radio-group>
- <u-empty class="noDate" style="margin-top: 20vh" v-if="!listData.length"></u-empty>
- </u-list>
- </view>
- <view class="footer">
- <u-button type="success" size="small" class="u-reset-button" :disabled="!curItem" @click="jumpAdd">
- <view class="selBtn">选择</view>
- </u-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getTreeByIds,
- getPackingList,
- getWarehouseList,
- getProductList,
- getBatchList,
- getHierarchyList,
- getHierarchyFifo,
- getApplystoragedetail,
- getCode,
- getinboundRequestsList
- } from '@/api/warehouseManagement'
- import {
- sceneState,
- outputSceneState
- } from '../common'
- export default {
- data() {
- return {
- type: null,
- statusOpt: ['待处理', '已处理', '已撤销'],
- curItem: null, //当前选中项
- page: 1,
- size: 20,
- sceneState,
- outputSceneState,
- isEnd: true,
- searchVal: '',
- listData: [] //列表数据
- }
- },
- onLoad({
- type
- }) {
- this.type = type
- },
- onShow() {
- this.getList()
- },
- methods: {
- sourceTypeLabel(sourceType) {
- switch (this.type) {
- case '1':
- // 入库
- return this.sceneState.filter(item => item.value == sourceType)[0].text
- case '2':
- // 出库
- return this.outputSceneState.filter(item => item.value == sourceType)[0].text
- }
- },
- scrolltolower() {
- if (this.isEnd) {
- return
- }
- // 显示加载图标
- uni.showLoading({
- title: '数据加载中'
- })
- //获取更多数据
- this.page++
- this.getList()
- },
- //列表数据
- async getList() {
- this.isEnd = false
- this._getClassifyList()
- },
- async _getClassifyList() {
- uni.showLoading({
- title: '数据加载中'
- })
- const params = {
- pageNum: this.page,
- size: this.size,
- keyWord: this.searchVal,
- status: 0,
- type: this.type
- }
- let res = await getinboundRequestsList(params)
- uni.hideLoading()
- if (this.page == 1) {
- this.listData = []
- }
- this.listData = this.listData.concat(res.list)
- this.isEnd = this.listData.length >= res.count
- },
- doSearch() {
- this.page = 1
- this.getList()
- },
- // 单选
- selectVal({
- detail
- }) {
- this.curItem = this.listData.find(i => i.id === detail?.value)
- console.log(this.curItem)
- },
- //跳转回添加页面
- async jumpAdd() {
- getApplystoragedetail({
- applyId: this.curItem.id
- }).then(async res => {
- console.log(this.type, 'tttttttttttttttttttttttttttttttttttttttttttttt')
- if (this.type == 2) {
- // 出库
- let data = await getHierarchyFifo({
- type: 1,
- builders: res.map(item => {
- return {
- categoryId: item.categoryId,
- num: item.measureQuantity
- }
- })
- })
- if (data?.length > 0) {
- uni.$emit('requisitionSelectC', data, {
- sourceBizNo: this.curItem.code,
- bizType: this.curItem.sourceType,
- assetType: res.map(item => item.rootCategoryLevelId).join(',')
- })
- uni.navigateBack()
- } else {
- uni.showToast({
- icon: 'none',
- title: '该出库申请单无库存'
- })
- }
- } else {
- // 入库
- const batchNo = await getCode('lot_number_code')
- let data = res.map((item, index) => {
- return {
- ...item,
- index,
- packingQuantity: 1,
- minPackingQuantity: item.measureQuantity,
- measureUnit: item.measuringUnit,
- batchNo,
- id: '',
- warehouseIds: [item.warehouseId],
- warehouseNames: [item.warehouseName]
- }
- })
- uni.$emit('requisitionSelect', data, {
- sourceBizNo: this.curItem.code,
- bizType: this.curItem.sourceType,
- assetType: res.map(item => item.rootCategoryLevelId).join(',')
- })
- uni.navigateBack()
- }
- })
- // let selectionList = this.listData.filter(item => item.checked)
- // if (this.dimension == 1) {
- // let boolen = selectionList.every(item => item.outboundNum > 0)
- // if (!boolen) {
- // uni.showToast({
- // icon: 'none',
- // title: '请输入出库数量',
- // duration: 2000
- // })
- // return
- // }
- // }
- // let data = null
- // if (this.dimension != 1) {
- // data = await getHierarchyList({
- // ids: selectionList.map(item => item.id).join(','),
- // type: this.dimension
- // })
- // } else {
- // data = await getHierarchyFifo({
- // type: this.dimension,
- // builders: selectionList.map(item => {
- // return {
- // categoryId: item.categoryId,
- // num: item.outboundNum
- // }
- // })
- // })
- // }
- // console.log('data-------------------', data)
- // uni.$emit('setSelectList', data)
- // uni.navigateBack()
- },
- //返回添加页
- backAdd() {
- uni.navigateBack()
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mainBox {
- height: 100vh;
- .main {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- .wrapper {
- flex: 1;
- overflow: hidden;
- }
- .top-wrapper {
- display: flex;
- height: 88rpx;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx;
- /deep/.uni-section {
- margin-top: 0px;
- }
- /deep/.uni-section-header {
- padding: 0px;
- }
- .search_btn {
- width: 120rpx;
- height: 70rpx;
- line-height: 70rpx;
- background: $theme-color;
- font-size: 28rpx;
- color: #fff;
- }
- .menu_icon {
- width: 44rpx;
- height: 44rpx;
- margin-left: 14rpx;
- }
- .more_search {
- display: flex;
- align-items: center;
- height: 70rpx;
- line-height: 70rpx;
- }
- /deep/.u-input {
- border: 1rpx solid #ccc;
- .u-input__content__field-wrapper__field {
- height: 40rpx !important;
- }
- }
- }
- // .searchBox {
- // padding: 10rpx 0;
- // box-sizing: border-box;
- // background-color: #dedede;
- // height: 90rpx;
- // width: 100%;
- // line-height: 90rpx;
- // display: flex;
- // justify-content: space-around;
- // align-items: center;
- // input {
- // height: 78rpx;
- // width: 65%;
- // background: #f9f9f9 !important;
- // margin: 0 10rpx;
- // padding: 0 10rpx;
- // box-sizing: border-box;
- // border-radius: 5rpx;
- // }
- // .searchBtn {
- // height: 80rpx;
- // background: #f9f9f9 !important;
- // color: #676767;
- // font-size: 28rpx;
- // padding: 0 42rpx;
- // box-sizing: border-box;
- // outline: none;
- // border: none;
- // width: 260rpx;
- // .icon-sousuo {
- // font-size: 22px;
- // }
- // .text {
- // font-size: 16px;
- // margin-left: 10px;
- // }
- // }
- // .search-icon {
- // display: flex;
- // align-items: center;
- // justify-content: space-around;
- // font-size: 28rpx;
- // white-space: nowrap;
- // margin-left: 10rpx;
- // image {
- // width: 30rpx;
- // height: 30rpx;
- // }
- // }
- // }
- .tab-title {
- position: fixed;
- top: 190rpx;
- z-index: 99;
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: $tab-height;
- line-height: $tab-height;
- background-color: #ffffff;
- border-bottom: 2rpx solid #f2f2f2;
- box-sizing: border-box;
- .tab-item {
- width: 25%;
- text-align: center;
- font-size: 32rpx;
- color: $uni-text-color-grey;
- }
- .tab-item.active {
- color: $j-primary-border-green;
- border-bottom: 1px solid $j-primary-border-green;
- font-weight: bold;
- }
- .tab-item.filter {
- flex: 1;
- padding: 0px 30rpx;
- .uni-icons {
- display: flex;
- padding-top: 5px;
- }
- }
- .screenIcon {
- display: flex;
- width: 80px;
- justify-content: center;
- .screenText {
- font-size: 32rpx;
- color: $uni-text-color-grey;
- }
- }
- }
- .listContent {
- height: 100% !important;
- .listBox {
- display: flex;
- // height: 180rpx;
- padding: 20rpx 0;
- border-top: 2rpx solid #e5e5e5;
- .listBox-sel {
- height: 90rpx;
- width: 80rpx;
- // line-height: 90rpx;
- text-align: center;
- checkbox {
- transform: scale(1.2);
- }
- }
- .listBox-con {
- width: 100%;
- // display: flex;
- // flex-wrap: wrap;
- // justify-content: space-between;
- align-items: center;
- padding: 0 18rpx 0 0;
- .round {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 50%;
- background: $theme-color;
- color: #fff;
- text-align: center;
- font-size: 20rpx;
- }
- .listBox-top {
- width: 100%;
- display: flex;
- justify-content: space-between;
- padding-bottom: 10rpx;
- .listBox-name,
- .listBox-code {
- display: inline-block;
- font-size: $uni-font-size-sm;
- font-weight: bold;
- }
- }
- .listBox-bottom {
- width: 100%;
- display: flex;
- justify-content: space-between;
- font-size: $uni-font-size-sm;
- flex-wrap: wrap;
- >view {
- width: 50%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .input_view {
- display: flex;
- align-items: center;
- justify-content: center;
- .u-input {
- height: 36rpx;
- padding: 0 !important;
- margin-right: 10rpx;
- border: 1px solid #ddd;
- }
- }
- .w100 {
- width: 100%;
- }
- }
- }
- }
- .noDate {
- height: 100%;
- }
- }
- //底部按钮
- .footer {
- height: 90rpx;
- position: relative;
- display: flex;
- justify-content: space-between;
- align-items: center;
- bottom: 0;
- width: 100%;
- height: 100rpx;
- border-top: 1rpx solid #eeecec;
- background-color: #ffffff;
- z-index: 999;
- .bottom {
- margin-left: 10rpx;
- }
- .u-reset-button {
- position: absolute;
- right: 10rpx;
- top: 20rpx;
- width: 150rpx;
- }
- }
- .search-container {
- width: 70vw;
- padding: 30rpx 36rpx;
- .footer {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- display: flex;
- box-shadow: 0 10rpx 30rpx 0 #000;
- .btn {
- width: 50%;
- height: 80rpx;
- border-radius: 0 !important;
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- &.reset {
- color: $j-primary-border-green;
- }
- &.search {
- color: #fff;
- background-color: $j-primary-border-green;
- }
- }
- }
- .title {
- font-weight: bold;
- font-size: 30rpx;
- }
- .status-wrapper {
- display: flex;
- align-items: center;
- justify-content: space-between;
- view {
- background-color: rgba(242, 242, 242, 1);
- height: 60rpx;
- border-radius: 30rpx;
- line-height: 60rpx;
- text-align: center;
- width: 160rpx;
- border: 1rpx solid rgba(242, 242, 242, 1);
- &.active {
- color: #157a2c;
- border-color: rgba(21, 122, 44, 1);
- }
- }
- }
- /deep/.uni-date {
- .uni-icons {
- display: none;
- }
- .uni-date-x {
- padding: 0;
- view {
- margin: 0 20rpx;
- }
- }
- }
- /deep/.uni-date__x-input,
- /deep/.uni-easyinput__content-input {
- height: 60rpx;
- border-radius: 30rpx;
- overflow: hidden;
- background-color: rgba(242, 242, 242, 1);
- }
- }
- }
- </style>
|