mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化代码
This commit is contained in:
parent
b6778137b5
commit
73e6f6ef0d
@ -561,6 +561,32 @@ export function listAllocationStoreHisAuditOrders(_that,_data){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我物品类型
|
||||||
|
* @param {Object} _that 上下文对象
|
||||||
|
* @param {Object} _data 请求报文
|
||||||
|
*/
|
||||||
|
export function listResourceStoreTypes(_that,_data){
|
||||||
|
return new Promise(function(reslove,reject){
|
||||||
|
_that.context.get({
|
||||||
|
url: url.listResourceStoreTypes,
|
||||||
|
data:_data,
|
||||||
|
success: function(res) {
|
||||||
|
reslove(res.data);
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "服务器异常了",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物品转赠提交
|
* 物品转赠提交
|
||||||
* @param {Object} _that 上下文对象
|
* @param {Object} _that 上下文对象
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<view class="cu-bar bg-white search ">
|
<view class="cu-bar bg-white search ">
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
<input type="text" placeholder="输入物品名" v-model="resName" confirm-type="search"></input>
|
<input type="text" placeholder="请输入物品名" v-model="resName" confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
@ -11,6 +11,14 @@
|
|||||||
<view>{{storeHouses[storeHousesIndex].shName}}</view>
|
<view>{{storeHouses[storeHousesIndex].shName}}</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="cu-bar bg-white search ">
|
||||||
|
<view class="search-form round">
|
||||||
|
<text class="cuIcon-search"></text>
|
||||||
|
<picker :value="rssIndex" :range="resourceStoreTypes" :range-key="'name'" @change="rssChange">
|
||||||
|
<view>{{resourceStoreTypes[rssIndex].name}}</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
<view class="action">
|
<view class="action">
|
||||||
<button class="cu-btn bg-gradual-green shadow-blur round" @tap="$preventClick(_searchStoreHouses)">搜索</button>
|
<button class="cu-btn bg-gradual-green shadow-blur round" @tap="$preventClick(_searchStoreHouses)">搜索</button>
|
||||||
</view>
|
</view>
|
||||||
@ -36,6 +44,12 @@
|
|||||||
固定资产:{{item.isFixedName}}
|
固定资产:{{item.isFixedName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="text-gray text-sm flex">
|
||||||
|
<view class="text-cut">
|
||||||
|
规格:{{item.rssName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -52,7 +66,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
queryResourceStoreList,
|
queryResourceStoreList,
|
||||||
listStoreHouses
|
listStoreHouses,
|
||||||
|
listResourceStoreTypes
|
||||||
} from '../../api/resource/resource.js'
|
} from '../../api/resource/resource.js'
|
||||||
import {getCurrentCommunity} from '../../api/community/community.js'
|
import {getCurrentCommunity} from '../../api/community/community.js'
|
||||||
// 防止多次点击
|
// 防止多次点击
|
||||||
@ -70,10 +85,16 @@
|
|||||||
resourceList: [],
|
resourceList: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
selectedResId: [],
|
selectedResId: [],
|
||||||
|
rstId:'',
|
||||||
resName: '',
|
resName: '',
|
||||||
storeHouses: [{
|
storeHouses: [{
|
||||||
shName: '请选择仓库'
|
shName: '请选择仓库'
|
||||||
}],
|
}],
|
||||||
|
resourceStoreTypes:[{
|
||||||
|
rstId:'',
|
||||||
|
name: '请选择类型'
|
||||||
|
}],
|
||||||
|
rssIndex:0,
|
||||||
storeHousesIndex: 0,
|
storeHousesIndex: 0,
|
||||||
shId: '',
|
shId: '',
|
||||||
}
|
}
|
||||||
@ -99,6 +120,7 @@
|
|||||||
mounted() {
|
mounted() {
|
||||||
this._loadResourceList();
|
this._loadResourceList();
|
||||||
this._loadStoreHouses();
|
this._loadStoreHouses();
|
||||||
|
this._listResourceStoreTypes();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -121,6 +143,19 @@
|
|||||||
_that.storeHouses = _that.storeHouses.concat(res.data);
|
_that.storeHouses = _that.storeHouses.concat(res.data);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
_listResourceStoreTypes: function(){
|
||||||
|
let _that = this;
|
||||||
|
let _objData = {
|
||||||
|
page: 1,
|
||||||
|
row: 100,
|
||||||
|
communityId: getCurrentCommunity().communityId,
|
||||||
|
};
|
||||||
|
listResourceStoreTypes(this,_objData)
|
||||||
|
.then(function(res){
|
||||||
|
_that.resourceStoreTypes = _that.resourceStoreTypes.concat(res.data);
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
storeHousesChange: function(e){
|
storeHousesChange: function(e){
|
||||||
this.storeHousesIndex = e.target.value;
|
this.storeHousesIndex = e.target.value;
|
||||||
@ -132,6 +167,15 @@
|
|||||||
this.shId = selected.shId;
|
this.shId = selected.shId;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
rssChange: function(e){
|
||||||
|
this.rssIndex = e.target.value;
|
||||||
|
if (this.rssIndex == 0) {
|
||||||
|
this.rstId = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let selected = this.resourceStoreTypes[this.rssIndex];
|
||||||
|
this.rstId = selected.rstId;
|
||||||
|
},
|
||||||
_searchStoreHouses: function() {
|
_searchStoreHouses: function() {
|
||||||
this.resourceList = [];
|
this.resourceList = [];
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
@ -148,6 +192,7 @@
|
|||||||
shType: this.shType,
|
shType: this.shType,
|
||||||
shId: this.shId,
|
shId: this.shId,
|
||||||
resName: this.resName,
|
resName: this.resName,
|
||||||
|
rstId: this.rstId,
|
||||||
isShow: true
|
isShow: true
|
||||||
};
|
};
|
||||||
queryResourceStoreList(this, _data)
|
queryResourceStoreList(this, _data)
|
||||||
|
|||||||
@ -155,5 +155,7 @@ export default {
|
|||||||
listFeeDetail: baseUrl + "callComponent/propertyFee/listFeeDetail",
|
listFeeDetail: baseUrl + "callComponent/propertyFee/listFeeDetail",
|
||||||
repairStop: baseUrl + "callComponent/ownerRepair.repairStop",
|
repairStop: baseUrl + "callComponent/ownerRepair.repairStop",
|
||||||
repairStart: baseUrl + "callComponent/ownerRepair.repairStart",
|
repairStart: baseUrl + "callComponent/ownerRepair.repairStart",
|
||||||
listInspectionItemTitle: baseUrl + "app/inspectionItemTitle.listInspectionItemTitle"
|
listInspectionItemTitle: baseUrl + "app/inspectionItemTitle.listInspectionItemTitle",
|
||||||
|
listResourceStoreTypes: baseUrl + "app/resourceStoreType.listResourceStoreTypes",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user