123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <view class="order-list content">
- <view class="swiper-box">
- <template v-if="tableData.length">
- <u-checkbox-group
- v-model="checked"
- @change="checkChange"
- iconPlacement="left"
- shape='circle'
- placement="column">
- <view class="order-card" v-for="(item, index) in tableData" :key="index">
- <view class="order-card-title">
- <u-checkbox class="check-item" activeColor="#4680F9" :name='item.Hcontent'></u-checkbox>
- {{work == 'in'?$t('spare.orderCode')+':'+item.orderCode:$t('spare.applyCode')+':'+item.takeCode}}
- </view>
- <view class="order-info">
- <p class="info-line">
- <text class="label">{{$t('spare.spareName')}}:</text>
- <text class="info"> {{item.materialName || ''}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('spare.orderNum')}}:</text>
- <text class="info"> {{item.number}}</text>
- </p>
- <template v-if="work == 'in'">
- <p class="info-line">
- <text class="label">{{$t('spare.alreadyInNumber')}}:</text>
- <text class="info"> {{item.entryNum}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('spare.canInNumber')}}:</text>
- <text class="info"> {{item.number-item.entryNum}}</text>
- </p>
- </template>
- <template v-else>
- <p class="info-line">
- <text class="label">{{$t('spare.canOutNumber')}}:</text>
- <text class="info"> {{item.number-item.outNum}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('spare.alreadyOutNumber')}}:</text>
- <text class="info"> {{item.outNum}}</text>
- </p>
- <p class="info-line">
- <text class="label">{{$t('spare.storeHaveNumber')}}:</text>
- <text class="info"> {{item.totalNum}}</text>
- </p>
- </template>
- </view>
- </view>
- </u-checkbox-group>
- </template>
- <template v-else>
- <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
- </u-empty>
- </template>
- </view>
- <view class="examine" v-if="tableData.length != 0">
- <u-checkbox-group
- v-model="checkAll"
- placement="column"
- @change="checkAllChange"
- >
- <u-checkbox shape='circle' activeColor="#4680F9" label="全选" :name="true"></u-checkbox>
- </u-checkbox-group>
- <view class="exam-wrap">
- <button @click='confirm' class='exam-btn'>{{$t('spare.sureSelect')}}</button>
- </view>
- </view>
- <u-loading-page
- color="#666"
- loading-mode="semicircle"
- :loading="loading">
- </u-loading-page>
- </view>
- </template>
- <script>
- import {getOrderDetailByPurveyId,getOrderDetailBydeptId} from '../../api/warehousing'
- export default {
- components:{
- },
- data() {
- return {
- tableData:[],
- loading:false,
- keyword:'',
- checkAll:[],
- checked:[],
- work:'',
- };
- },
- onLoad(options) {
- this.purveyId = options.purveyId
- this.dept = options.dept
- this.work = options.work
- this.getList()
- },
- methods: {
- //确认选择
- confirm(){
- let pages = getCurrentPages();
- let prevPage = pages[pages.length - 2]; //上一个页面
- if(this.work == 'in'){
- this.checked.forEach(j=>{
- let item = JSON.parse(j)
- let boo = true
- prevPage.$vm.details.forEach(i=>{
- if(item.id == i.orderDtlId && i.sourceType == '101'){
- boo = false
- }
- })
- if(boo){
- item.count=0
- item.shelfList = [
- {
- shelf:0,
- floor:0,
- seat:0,
- sign:0,
- num:0,
- }
- ]
- item.unit=item.materialUnit
- item.remark=''
- item.orderDtlId = item.id
- item.sourceType = '101'
- item.maxNumber = item.number - item.entryNum
- item.cess = parseInt(item.cess)
- prevPage.$vm.details.push(item)
- }
- })
- }else{
- this.checked.forEach(j=>{
- let item = JSON.parse(j)
- let boo = true
- prevPage.$vm.details.forEach(i=>{
- if(item.id == i.takeId && i.sourceType == '101'){
- boo = false
- }
- })
- if(boo){
- item.count=0
- item.unit=item.materialUnit
- item.remark=''
- item.takeId = item.id
- item.sourceType = '101'
- prevPage.$vm.details.push(item)
- }
- })
- }
- uni.navigateBack();
- },
- //获取订单列表
- getList() {
- this.loading = true
- if(this.work == 'in'){
- let data = {
- purveyId:this.purveyId
- };
- getOrderDetailByPurveyId(data).then((res) => {
- this.loading = false
- if(res.data.code == 0){
- this.tableData = res.data.data
- this.tableData.forEach(item=>{
- item.Hcontent = JSON.stringify(item)
- })
- }
- }).catch(()=>{
- this.loading = false
- })
- }else{
- getOrderDetailBydeptId(this.dept).then(res=>{
- this.loading = false
- if(res.data.code == 0){
- this.tableData = res.data.data
- this.tableData.forEach(item=>{
- item.Hcontent = JSON.stringify(item)
- })
- }
- }).catch(()=>{
- this.loading = false
- })
- }
- },
- //审批选择
- checkChange(item){
- console.log(item);
- this.checked = [...item]
- if(this.checked.length == this.tableData.length && this.tableData.length!=0){
- this.checkAll = [true]
- }else{
- this.checkAll = []
- }
- },
- //全选
- checkAllChange(item){
- if(item[0]){
- this.checked = this.tableData.map(item=>{
- return item.Hcontent
- })
- }else{
- this.checked = []
- }
- }
- },
- };
- </script>
- <style>
- /* #ifndef APP-NVUE */
- view {
- /* display: flex; */
- box-sizing: border-box;
- /* flex-direction: column; */
- }
- page {
- box-sizing: border-box;
- /* padding: 40rpx 40rpx 80rpx; */
- height: 100%;
- }
- /* #endif*/
- </style>
- <style lang="scss" scoped>
- @import '../../common/css/public.scss';
- .order-list {
- // height: calc(100vh - var(--window-top)) ;
- // overflow: hidden;
- .swiper-box{
- padding: 4rpx 0 24rpx;
- }
- background-color: #f8f8f8;
- .qrcode-wrap{
- padding: 24rpx;
- text-align: center;
- .info-line{
- text-align: center;
- font-size: 32rpx;
- margin-top: 24rpx;
- }
- }
- }
- .examine{
- position: fixed;
- bottom: 0;
- background-color: #fff;
- height: 80rpx;
- line-height: 80rpx;
- padding: 24rpx;
- width: 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- .exam-wrap{
- height: 80rpx;
- line-height: 80rpx;
- flex: 1;
- display: flex;
- justify-content: flex-end;
- flex-direction: row;
- font-size: 24rpx;
- align-items: center;
- .num{
- font-size: 32rpx;
- color: #4680F9;
- margin-right: 32rpx;
- }
- .exam-btn{
- height: 60rpx;
- border: none;
- background-color: #4680F9;
- color: #fff;
- font-size: 32rpx;
- line-height: 60rpx;
- margin: 0;
- border-radius: 80rpx;
- padding: 0 40rpx;
- }
- .disabled{
- color: rgba(0,0,0,.3);
- background-color: #f2f2f2;
- }
- }
- }
- .popupShow {
- overflow: hidden;
- position: fixed;
- }
- .order-card .order-card-title{
- justify-content: left;
- }
- </style>
|