|
|
|
@ -21,9 +21,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
<view v-if="!formshow">
|
|
|
|
<view v-if="!formshow">
|
|
|
|
<u-form-item label="工地名称" label-position="top" prop="type" required>
|
|
|
|
<u-form-item label="工地名称" label-position="top" prop="type" required>
|
|
|
|
<u-input placeholder="请选择工地" v-model="buildName" type="select" :border="true" @click="buildShow = true" />
|
|
|
|
<u-input placeholder="请输入工地名称以查询或新建" v-model="buildName" type="input" :border="true" @confirm="selectBuildList" />
|
|
|
|
<!-- <u-picker :show="typeShow" keyName="name" :columns="rainArr.rainTypes" @confirm="confirmType"></u-picker> -->
|
|
|
|
<!-- <u-picker :show="typeShow" keyName="name" :columns="rainArr.rainTypes" @confirm="confirmType"></u-picker> -->
|
|
|
|
<u-select v-model="buildShow" mode="single-column" value-name="id" label-name="name" :list="rainArr.buildList"
|
|
|
|
<u-select :confirm-text="confirmText" v-model="buildShow" mode="single-column" value-name="id" label-name="name" :list="rainArr.buildList"
|
|
|
|
@confirm="confirmBuildType"></u-select>
|
|
|
|
@confirm="confirmBuildType"></u-select>
|
|
|
|
</u-form-item>
|
|
|
|
</u-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
@ -151,6 +151,7 @@
|
|
|
|
askName:"",
|
|
|
|
askName:"",
|
|
|
|
lawName:"",
|
|
|
|
lawName:"",
|
|
|
|
buildName:"",
|
|
|
|
buildName:"",
|
|
|
|
|
|
|
|
confirmText:"确认",
|
|
|
|
dateparams: {
|
|
|
|
dateparams: {
|
|
|
|
year: true,
|
|
|
|
year: true,
|
|
|
|
month: true,
|
|
|
|
month: true,
|
|
|
|
@ -268,7 +269,7 @@
|
|
|
|
var that = this;
|
|
|
|
var that = this;
|
|
|
|
this.loadAskContent();
|
|
|
|
this.loadAskContent();
|
|
|
|
this.loadLawTypes();
|
|
|
|
this.loadLawTypes();
|
|
|
|
this.loadBuild();
|
|
|
|
// this.loadBuild();
|
|
|
|
this.loadBuildType();
|
|
|
|
this.loadBuildType();
|
|
|
|
if(options.id){
|
|
|
|
if(options.id){
|
|
|
|
this.infoId = options.id;
|
|
|
|
this.infoId = options.id;
|
|
|
|
@ -309,6 +310,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
selectBuildList(){
|
|
|
|
|
|
|
|
var that = this
|
|
|
|
|
|
|
|
// that.rainArr.buildList = []
|
|
|
|
|
|
|
|
that.loadBuild()
|
|
|
|
|
|
|
|
console.log("123",that.rainArr.buildList)
|
|
|
|
|
|
|
|
// if(that.rainArr.buildList){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
confirmBuildTypeName(val){
|
|
|
|
confirmBuildTypeName(val){
|
|
|
|
console.log(val)
|
|
|
|
console.log(val)
|
|
|
|
var that = this
|
|
|
|
var that = this
|
|
|
|
@ -317,6 +328,11 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
confirmBuildType(val){
|
|
|
|
confirmBuildType(val){
|
|
|
|
var that = this
|
|
|
|
var that = this
|
|
|
|
|
|
|
|
console.log(val)
|
|
|
|
|
|
|
|
if(!val[0].value){
|
|
|
|
|
|
|
|
that.form.name = that.buildName
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
let buildinfo = val[0].extra;
|
|
|
|
let buildinfo = val[0].extra;
|
|
|
|
that.buildName = val[0].label
|
|
|
|
that.buildName = val[0].label
|
|
|
|
that.form.building_site_id = val[0].value
|
|
|
|
that.form.building_site_id = val[0].value
|
|
|
|
@ -444,16 +460,27 @@
|
|
|
|
that.util.request({
|
|
|
|
that.util.request({
|
|
|
|
api: '/api/mobile/rain-inspection/all-building-site',
|
|
|
|
api: '/api/mobile/rain-inspection/all-building-site',
|
|
|
|
method: "get",
|
|
|
|
method: "get",
|
|
|
|
data: {},
|
|
|
|
data: {
|
|
|
|
|
|
|
|
keyword:that.buildName
|
|
|
|
|
|
|
|
},
|
|
|
|
utilSuccess: function(result) {
|
|
|
|
utilSuccess: function(result) {
|
|
|
|
// that.rainArr.buildList = result
|
|
|
|
// that.rainArr.buildList = result
|
|
|
|
let arr=[];
|
|
|
|
let arr=[];
|
|
|
|
for(var m of result){
|
|
|
|
if(result.length>0){
|
|
|
|
m.extra = m
|
|
|
|
for(var m of result){
|
|
|
|
arr.push(m)
|
|
|
|
m.extra = m
|
|
|
|
|
|
|
|
arr.push(m)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
that.confirmText = "确认"
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
arr.push({
|
|
|
|
|
|
|
|
name:that.buildName
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
that.confirmText = "新增"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
that.rainArr.buildList = arr
|
|
|
|
that.rainArr.buildList = arr
|
|
|
|
console.log(that.rainArr.buildList)
|
|
|
|
that.buildShow = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
utilFail: function(res) {
|
|
|
|
utilFail: function(res) {
|
|
|
|
that.util.alert(res);
|
|
|
|
that.util.alert(res);
|
|
|
|
|