| | |
| | | |
| | | |
| | | <!-- mescroll-body跟随page滚动, 不可fixed定位, 可设置 top, bottom, topbar, bottombar, safearea的偏移量--> |
| | | <mescroll-body ref="mescrollRef" top="176" bottom="300" @init="mescrollInit" @down="downCallback" @up="upCallback"> |
| | | <mescroll-body ref="mescrollRef" top="176" bottom="300" @init="mescrollInit" @down="downCallback" |
| | | @up="upCallback"> |
| | | <view class="cu-list menu-avatar "> |
| | | <view class="cu-item" v-for="(item,index) in assetsList" :key="index"> |
| | | <view class="cu-avatar radius lg bg-white" |
| | | style="background-image:url(../../static/device.png)"> |
| | | <view class="cu-avatar radius lg bg-white" style="background-image:url(../../static/device.png)"> |
| | | </view> |
| | | <view class="content"> |
| | | <view> |
| | | <view class="text-cut text-bold text-xl">{{item.name}}</view> |
| | | <view class="cu-tag radius bg-orange sm">可领用:{{item.quantity}}</view> |
| | | <view class="cu-tag radius bg-orange sm">可领用:{{item.availableQuantity}}</view> |
| | | <view class="numbox"> |
| | | <u-number-box v-model="valueList[index]" :min="0" :max="item.quantity" |
| | | <u-number-box v-model="valueList[index]" :min="0" :max="item.availableQuantity" |
| | | :showMinus="valueList[index] > 0"> |
| | | <view slot="minus" class="minus"> |
| | | <u-icon name="minus" size="12"></u-icon> |
| | | </view> |
| | | <input slot="input" style="width: 38px;text-align: center; " class="input" |
| | | :value="valueList[index]?valueList[index]:0"></input> |
| | | <input slot="input" style="width: 38px;text-align: center; " class="input" @blur="inputChange(index)" |
| | | :value="valueList[index] ? valueList[index] : 0" @input="valueList[index] = $event.detail.value" ></input> |
| | | <view slot="plus" class="plus"> |
| | | <u-icon name="plus" color="#FFFFFF" size="12"></u-icon> |
| | | </view> |
| | |
| | | |
| | | <!-- 底部 fixed定位 --> |
| | | <view class="bottom-warp"> |
| | | <view class="margin-top"> |
| | | <view class="" style="padding: 0px 15px 0px 15px;"> |
| | | <u--form> |
| | | <u-form-item label="使用人" labelWidth="80" borderBottom> |
| | | <u--input v-model="usePeople" border="none" placeholder="物资使用人(选填)"></u--input> |
| | | </u-form-item> |
| | | <u-form-item label="使用地点" labelWidth="80" borderBottom> |
| | | <u--input v-model="address" border="none" placeholder="填写地点(选填)"></u--input> |
| | | </u-form-item> |
| | | </u--form> |
| | | |
| | | </view> |
| | | |
| | | <view class="" style="margin-top: 10rpx;"> |
| | | <view class="margin-left border-title"> |
| | | 申请理由 |
| | | </view> |
| | | <view class="flex justify-center align-center" style="margin-top: 10rpx;"> |
| | | <view class="" style="width: 95%; "> |
| | | <u--textarea height="50" v-model="reason" placeholder="请输入内容" placeholderStyle="font-size: 15rpx;"> |
| | | <u--textarea height="30" v-model="reason" placeholder="请输入内容" |
| | | placeholderStyle="font-size: 15rpx;"> |
| | | </u--textarea> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="padding-left padding-top border-title " style="padding-bottom: 10rpx;"> |
| | | <view class="padding-left border-title " style="padding-bottom: 10rpx; margin-top: 10rpx"> |
| | | <view class="action"> |
| | | 申请人信息 |
| | | </view> |
| | | </view> |
| | | <view class="flex justify-center"> |
| | | <view class="u-border radius" style="width: 95%; padding:20rpx 0 20rpx 20rpx;"> |
| | | <view class="u-border radius" style="width: 95%; padding:10rpx 0 10rpx 20rpx;"> |
| | | <view class=""> |
| | | 申请人: {{applicant}} |
| | | </view> |
| | |
| | | </view> |
| | | |
| | | <view class="margin-top" style="margin-bottom: 30rpx;"> |
| | | <u-button style="width: 40%;" type="primary" text="提交申请" @click="submit" :disabled="isDisabled"></u-button> |
| | | <u-button style="width: 40%;" type="primary" text="提交申请" @click="submit" :disabled="isDisabled"> |
| | | </u-button> |
| | | </view> |
| | | |
| | | <u-toast ref="uToast"></u-toast> |
| | |
| | | applicationTime: '', //申请时间 |
| | | templateId: '', //模板ID |
| | | isDisabled: false, |
| | | |
| | | address:'', |
| | | usePeople:'', |
| | | |
| | | page: 1, |
| | | pageSize: 10, |
| | |
| | | this.initTemplateData(); |
| | | }, |
| | | methods: { |
| | | inputChange(index){ |
| | | // console.log('开始:',this.valueList[index]); |
| | | this.valueList[index] = this.valueList[index]; |
| | | // console.log('结束:',this.valueList[index]); |
| | | console.log('列表',this.valueList) |
| | | }, |
| | | |
| | | /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ |
| | | onSearch(e) { |
| | | console.log("搜索:" + this.keyword) |
| | |
| | | this.assetsList = this.assetsList.concat(data); //追加新数据 |
| | | console.log(this.assetsList.length) |
| | | this.mescroll.endBySize(this.assetsList.length, res.data.total); |
| | | } |
| | | else{ |
| | | } else { |
| | | this.mescroll.endBySize(0, 0); |
| | | } |
| | | |
| | |
| | | let data = { |
| | | "assets": assets, |
| | | "templateId": this.templateId, |
| | | "reason": this.reason |
| | | "reason": this.reason, |
| | | "useAddress":this.address, |
| | | "usePeople":this.usePeople, |
| | | } |
| | | |
| | | this.$http.post('/assets/approval/submit', data) |
| | |
| | | // debugger; |
| | | if (res.data.code === 0) { |
| | | console.log("成功了"); |
| | | this.reason=""; |
| | | |
| | | this.$refs.uToast.show({ |
| | | type: 'success', |
| | | message: "提交成功" |
| | | }); |
| | | |
| | | this.valueList=[]; |
| | | // for (let i = 0; i < this.valueList.length; i++) { |
| | | // this.valueList[i]=0; |
| | | // } |
| | | this.address=""; |
| | | this.reason = ""; |
| | | |
| | | this.onSearch(); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | type: 'error', |
| | |
| | | padding-top: 10rpx; |
| | | font-size: 28rpx; |
| | | text-align: center; |
| | | background-color: #CFE0DA; |
| | | background-color: #FFFFFF; |
| | | } |
| | | |
| | | // 设置padding |