|
@@ -57,7 +57,7 @@ import { list } from "@/mixins";
|
|
|
import { mapGetters} from "vuex";
|
|
import { mapGetters} from "vuex";
|
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
|
import ModalModule from "@/components/plugin/modal"
|
|
import ModalModule from "@/components/plugin/modal"
|
|
|
-import { addItem } from "@/api/order-item";
|
|
|
|
|
|
|
+import { loanFn } from "@/api/inventory";
|
|
|
import productMins from "@/mixins/product";
|
|
import productMins from "@/mixins/product";
|
|
|
export default {
|
|
export default {
|
|
|
components: { SelectList, AppWrapperEmpty,AppSearchModule,ModalModule},
|
|
components: { SelectList, AppWrapperEmpty,AppSearchModule,ModalModule},
|
|
@@ -82,7 +82,9 @@ export default {
|
|
|
breakFocus:false,
|
|
breakFocus:false,
|
|
|
breakShow:false,
|
|
breakShow:false,
|
|
|
checkStock:false,
|
|
checkStock:false,
|
|
|
- T:null
|
|
|
|
|
|
|
+ T:null,
|
|
|
|
|
+ inId:0,
|
|
|
|
|
+ outId:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -95,6 +97,8 @@ export default {
|
|
|
let prevPage = pages[ pages.length - 2 ];
|
|
let prevPage = pages[ pages.length - 2 ];
|
|
|
prevPage.$vm.addSelectItem = 1
|
|
prevPage.$vm.addSelectItem = 1
|
|
|
|
|
|
|
|
|
|
+ this.inId = this.option.itemId?this.option.itemId:0
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
|
this.resetList();
|
|
this.resetList();
|
|
@@ -112,18 +116,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
loanItem(item){
|
|
loanItem(item){
|
|
|
- let that = this
|
|
|
|
|
- let id = this.option.id ? this.option.id : 0
|
|
|
|
|
- let data = [{id:item.id,bigCount:item.bigCount}]
|
|
|
|
|
- uni.showLoading({mask:true})
|
|
|
|
|
- addItem({data:JSON.stringify(data),id:id}).then(res=>{
|
|
|
|
|
- uni.hideLoading()
|
|
|
|
|
|
|
+ if(Number(item.bigCount)<=0){
|
|
|
|
|
+ this.$msg('请填写数量')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ loanFn({inId:this.inId,outId:item.id,num:bigCount}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- that.$msg('借用成功')
|
|
|
|
|
- that.goBack()
|
|
|
|
|
|
|
+ this.$msg('操作成功')
|
|
|
|
|
+ this.goBack()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- item.bigCount=''
|
|
|
|
|
},
|
|
},
|
|
|
goBack(){
|
|
goBack(){
|
|
|
let pages = getCurrentPages();
|
|
let pages = getCurrentPages();
|