bug修改
This commit is contained in:
parent
be25f3e6b7
commit
8b6b608201
|
|
@ -12,7 +12,7 @@
|
|||
<h5 class="tit">规格型号</h5>
|
||||
<view class="drop-menu">
|
||||
<uni-data-select
|
||||
v-model="specVal"
|
||||
v-model="specVals"
|
||||
:localdata="specRange"
|
||||
@change="specChange"
|
||||
:clear="false"
|
||||
|
|
@ -50,6 +50,7 @@ import { basePath } from '../../public';
|
|||
|
||||
],
|
||||
specVal: '',
|
||||
specVals: '',
|
||||
specText: '',
|
||||
deviceNum: 1,
|
||||
specRange: [
|
||||
|
|
@ -69,18 +70,22 @@ import { basePath } from '../../public';
|
|||
console.log('参数');
|
||||
},
|
||||
specChange (e) {
|
||||
console.log(e, this.specRange);
|
||||
for (let i = 0; i < this.specRange.length; i++) {
|
||||
if (this.specRange[i].value == e) {
|
||||
this.specText = this.specRange[i].text
|
||||
this.status = this.specRange[i].status
|
||||
}
|
||||
}
|
||||
this.devicePrice = '¥' + (e * this.deviceNum)
|
||||
// for (let i = 0; i < this.specRange.length; i++) {
|
||||
// if (this.specRange[i].value == e) {
|
||||
// this.specText = this.specRange[i].text
|
||||
// this.status = this.specRange[i].status
|
||||
// }
|
||||
// }
|
||||
|
||||
this.specText = this.specRange[e].text
|
||||
this.status = this.specRange[e].status
|
||||
this.typeId = this.specRange[e].typeId
|
||||
this.specVal = this.specRange[e].leasePrice
|
||||
this.devicePrice = '¥' + (Math.round((e * this.deviceNum) * 100)/100)
|
||||
},
|
||||
numChange (e) {
|
||||
console.log(e);
|
||||
this.devicePrice = '¥' + (e * this.specVal)
|
||||
this.devicePrice = '¥' + (Math.round((e * Number(this.specVal || 0)) * 100)/100)
|
||||
},
|
||||
addCart () {
|
||||
if (this.specVal == '') {
|
||||
|
|
@ -138,11 +143,13 @@ import { basePath } from '../../public';
|
|||
for (let i = 0; i < res.data.data.length; i++) {
|
||||
that.bgList.push(res.data.data[i].photoUrl)
|
||||
}
|
||||
that.specRange = res.data.data.map((item) => {
|
||||
that.specRange = res.data.data.map((item,index) => {
|
||||
return {
|
||||
text: item['typeName'],
|
||||
value: item['leasePrice'],
|
||||
status: item['status']
|
||||
value: index,
|
||||
status: item['status'],
|
||||
typeId: item['typeId'],
|
||||
leasePrice: item['leasePrice']
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,9 @@
|
|||
this.taskId = params.taskId
|
||||
this.init()
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ import { basePath } from '../../public';
|
|||
sendData: {},
|
||||
deptFormData: {
|
||||
deptName: '',
|
||||
projName: ''
|
||||
projName: '',
|
||||
agreementId: null,
|
||||
agreementCode: null
|
||||
},
|
||||
deptRange: [
|
||||
|
||||
|
|
@ -225,7 +227,30 @@ import { basePath } from '../../public';
|
|||
closePopup () {
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
formSubmit () {
|
||||
|
||||
async getgreementId(){
|
||||
const params = {
|
||||
unitId:this.deptFormData.deptName,
|
||||
projectId:this.deptFormData.projName
|
||||
}
|
||||
const res = await this.$api.exitMaterial.ifAgreement(params)
|
||||
if(res.data.code == 200){
|
||||
this.deptFormData = { ...this.deptFormData,...res.data.data }
|
||||
}else{
|
||||
this.deptFormData.deptName = ''
|
||||
this.deptFormData.projName = ''
|
||||
|
||||
uni.showToast({
|
||||
duration:1000,
|
||||
title:'当前单位和工程未上传协议'
|
||||
})
|
||||
}
|
||||
console.log('getgreementId ==============',res);
|
||||
},
|
||||
|
||||
async formSubmit () {
|
||||
await this.getgreementId()
|
||||
|
||||
let that = this
|
||||
that.$refs.deptForm.validate().then(formData => {
|
||||
console.log(formData);
|
||||
|
|
@ -239,11 +264,14 @@ import { basePath } from '../../public';
|
|||
preNum: item['num']
|
||||
}
|
||||
})
|
||||
|
||||
that.sendData = {
|
||||
companyId: uni.getStorageSync('userInfo').sysUser.companyId,
|
||||
createBy: uni.getStorageSync('userInfo').sysUser.userName,
|
||||
unitId: formData.deptName,
|
||||
projectId: formData.projName,
|
||||
agreementId: that.deptFormData.agreementId,
|
||||
agreementCode: that.deptFormData.agreementCode,
|
||||
taskType: 29,
|
||||
taskStatus: 30,
|
||||
// createTime: that.formatDate(new Date().getTime()),
|
||||
|
|
@ -253,7 +281,7 @@ import { basePath } from '../../public';
|
|||
},
|
||||
leaseApplyDetails: that.totalGoods
|
||||
}
|
||||
console.log(that.sendData);
|
||||
console.log('that.sendData =================== ',that.sendData,that.deptFormData);
|
||||
// 提交预约商品
|
||||
uni.request({
|
||||
url: basePath + '/tm_task/submitLeaseApply',
|
||||
|
|
|
|||
Loading…
Reference in New Issue