|
|
@ -10,7 +10,7 @@ |
|
|
|
<view style="overflow-x: hidden;"> |
|
|
|
<jia-cascader :itemList="angencyList" :defaultItemList="defaultItemList" |
|
|
|
@completeChange="completeGrid" @inputChange="change" :border="false" |
|
|
|
:clearIcon="false"></jia-cascader> |
|
|
|
:clearIcon="false" v-if="reset === 0" ></jia-cascader> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view :class="'item '"> |
|
|
@ -91,8 +91,8 @@ |
|
|
|
<view class="field-text">购置日期</view> |
|
|
|
</view> |
|
|
|
<view hover-class="backC" class="value-dl" @tap="showTimePicker"> |
|
|
|
<view :class="formData.acquistionDate ? 'di-name' : 'di-name1'">{{ formData.acquistionDate ? |
|
|
|
formData.acquistionDate : '请选择' }} |
|
|
|
<view :class="timeStr ? 'di-name' : 'di-name1'">{{ timeStr ? |
|
|
|
timeStr : '请选择' }} |
|
|
|
</view> |
|
|
|
<image class="di-but" src="/static/images/right.png" mode="aspectFit" /> |
|
|
|
</view> |
|
|
@ -109,9 +109,10 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bot_btn"> |
|
|
|
<button type="default" :plain="true" class="bottom_btn bottom_btn_close" @tap="close">取消</button> |
|
|
|
<button type="default" :plain="true" class="bottom_btn bottom_btn_close" @tap="backRouter">取消</button> |
|
|
|
<button type="primary" class="btn_bule bottom_btn" @tap="saveForm">提交</button> |
|
|
|
</view> |
|
|
|
<u-toast ref="uToast"></u-toast> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -131,6 +132,7 @@ export default { |
|
|
|
maxDate: null, |
|
|
|
angencyList: [], |
|
|
|
defaultItemList: [], |
|
|
|
timeStr:'', |
|
|
|
formData: { |
|
|
|
agencyId: '',//所属组织 |
|
|
|
orgNamePath: '',//所属组织名称路径 |
|
|
@ -145,7 +147,8 @@ export default { |
|
|
|
acquistionDate: '',//购置日期 |
|
|
|
carOwnerNum: '',//车主证件号 |
|
|
|
remark: ''//备注 |
|
|
|
} |
|
|
|
}, |
|
|
|
reset:0 |
|
|
|
}; |
|
|
|
}, |
|
|
|
/** |
|
|
@ -186,6 +189,9 @@ export default { |
|
|
|
*/ |
|
|
|
onShareAppMessage() { }, |
|
|
|
methods: { |
|
|
|
backRouter(){ |
|
|
|
uni.navigateBack() |
|
|
|
}, |
|
|
|
getAgencygridtree() { |
|
|
|
api.getAgencygridtree() |
|
|
|
.then((res) => { |
|
|
@ -205,7 +211,7 @@ export default { |
|
|
|
this.setData({ |
|
|
|
'formData.orgNamePath':e.result.map(item=>item.text).join(','), |
|
|
|
'formData.orgIdPath':e.result.map(item=>item.value).join(','), |
|
|
|
agencyId:e.result[e.result.length - 1].value |
|
|
|
'formData.agencyId' :e.result[e.result.length - 1].value |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
@ -238,18 +244,78 @@ export default { |
|
|
|
this.setData({ |
|
|
|
visibleTime: true, |
|
|
|
maxDate: new Date().getTime(), |
|
|
|
acquistionDate: new Date().getTime() |
|
|
|
'formData.acquistionDate': new Date().getTime() |
|
|
|
}); |
|
|
|
}, |
|
|
|
onConfirmDate(e) { |
|
|
|
console.log(e); |
|
|
|
console.log(formatTime(e.value)); |
|
|
|
this.setData({ |
|
|
|
visibleTime: false, |
|
|
|
'formData.acquistionDate': formatTime(e.value) |
|
|
|
'formData.acquistionDate':formatTime(e.value), |
|
|
|
timeStr:formatTime(e.value) |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
showToast(params) { |
|
|
|
this.$refs.uToast.show({ |
|
|
|
...params, |
|
|
|
complete() { |
|
|
|
params.url && uni.navigateTo({ |
|
|
|
url: params.url |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveForm() { |
|
|
|
console.log(this.formData); |
|
|
|
if(!this.formData.agencyId){ |
|
|
|
this.showToast({message:'请选择所属组织'}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if(!this.formData.carNumber){ |
|
|
|
this.showToast({message:'请输入车牌号码'}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if(!this.formData.carOwnerName){ |
|
|
|
this.showToast({message:'请输入车主姓名'}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if(!this.formData.carOwnerMobile){ |
|
|
|
this.showToast({message:'请输入车主电话'}) |
|
|
|
return false |
|
|
|
} |
|
|
|
this.formData.acquistionDate = this.timeStr |
|
|
|
api.carInfoSave(this.formData).then(res=>{// |
|
|
|
if(res.code === 0){ |
|
|
|
let than = this |
|
|
|
this.setData({ |
|
|
|
formData:{ |
|
|
|
agencyId: '',//所属组织 |
|
|
|
orgNamePath: '',//所属组织名称路径 |
|
|
|
carBrand: '',//车辆品牌 |
|
|
|
carOwnerMobile: '',//车主电话 |
|
|
|
carOwnerName: '',//车主姓名 |
|
|
|
orgIdPath: '',//所属组织路径 |
|
|
|
carNumber: '',//车牌号码 |
|
|
|
customerId: '',//客户Id |
|
|
|
carColor: '',//车辆颜色 |
|
|
|
carriersNum: 1,//核载人数 |
|
|
|
acquistionDate: '',//购置日期 |
|
|
|
carOwnerNum: '',//车主证件号 |
|
|
|
remark: ''//备注 |
|
|
|
}, |
|
|
|
timeStr:null |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
than.setData({ |
|
|
|
reset:0 |
|
|
|
}) |
|
|
|
},100) |
|
|
|
this.showToast({message:'新增成功'}) |
|
|
|
} |
|
|
|
}).catch(err=>{ |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|