14 changed files with 644 additions and 17 deletions
@ -0,0 +1,327 @@
|
||||
// pagesA/toubiao/toubiao.js
|
||||
const util = require('../../utils/util.js'); |
||||
Page({ |
||||
|
||||
/** |
||||
* 页面的初始数据 |
||||
*/ |
||||
data: { |
||||
biduser:'', |
||||
explain:'', |
||||
lxr:'', |
||||
phone:'', |
||||
xuanzhong:-1, |
||||
id:1, |
||||
fileid:'', |
||||
jinjia:'', |
||||
zffs:'', |
||||
wenjianlianjie:'', |
||||
lanmulist:[{ |
||||
material:'', |
||||
spec:'', |
||||
technical:'', |
||||
implement:'', |
||||
company:'', |
||||
number:'', |
||||
money:'', |
||||
all_money:'', |
||||
remake:'' |
||||
}] |
||||
}, |
||||
/** |
||||
* 生命周期函数--监听页面加载 |
||||
*/ |
||||
onLoad(options) { |
||||
let data={ |
||||
id:options.id |
||||
} |
||||
util.httpRequest({ |
||||
url: 'price/getCommitBaseInfo', |
||||
is_token: true, |
||||
is_loading: true, |
||||
type: 'get', |
||||
data: data, |
||||
success: (res) => { |
||||
console.log(res) |
||||
let newarr=[] |
||||
res.data.detail.map(item=>{ |
||||
newarr.push({ |
||||
material:item.material, |
||||
spec:item.spec, |
||||
technical:item.technical, |
||||
implement:item.implement, |
||||
company:item.company, |
||||
number:item.number, |
||||
money:'', |
||||
all_money:'', |
||||
remake:item.remake |
||||
}) |
||||
}) |
||||
this.setData({ |
||||
lanmulist:newarr, |
||||
fileid:res.data.price.file_info.id, |
||||
biduser:res.data.price.bid_user, |
||||
explain:res.data.price.explain_b, |
||||
lxr:res.data.price.people, |
||||
phone:res.data.price.tel, |
||||
jinjia:'', |
||||
wenjianlianjie:'', |
||||
zffs:res.data.price.payment |
||||
}) |
||||
} |
||||
}) |
||||
this.setData({ |
||||
id:options.id |
||||
}) |
||||
}, |
||||
htxz(){ |
||||
wx.setClipboardData({ |
||||
data: wx.getStorageSync('serverurl') + 'download-bid-template?id='+this.data.fileid, |
||||
success: function (res) { |
||||
wx.getClipboardData({ |
||||
//这个api是把拿到的数据放到电脑系统中的
|
||||
success: function (res) { |
||||
wx.showToast({ |
||||
title: '已复制链接,请前往浏览器下载', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
|
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
download(){ |
||||
wx.setClipboardData({ |
||||
data: wx.getStorageSync('serverurl') + 'download-bid-template', |
||||
success: function (res) { |
||||
wx.getClipboardData({ |
||||
//这个api是把拿到的数据放到电脑系统中的
|
||||
success: function (res) { |
||||
wx.showToast({ |
||||
title: '已复制链接,请前往浏览器下载', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
|
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
tijiao(){ |
||||
let {id,biduser,explain,lxr,phone,jinjia,wenjianlianjie,lanmulist,zffs}=this.data |
||||
let newarr=lanmulist |
||||
newarr.map(item=>{ |
||||
item.all_money=Number(item.money)*Number(item.number) |
||||
return item |
||||
}) |
||||
console.log(newarr); |
||||
let data={ |
||||
base:{ |
||||
bidding_id:id, |
||||
bid_user:biduser, |
||||
explain_b:explain, |
||||
file:wenjianlianjie, |
||||
people:lxr, |
||||
tel:phone, |
||||
price_file:jinjia, |
||||
payment:zffs |
||||
}, |
||||
detail:newarr |
||||
} |
||||
util.httpRequest({ |
||||
url: 'commit-bid', |
||||
is_token: true, |
||||
is_loading: false, |
||||
type: 'post', |
||||
data: data, |
||||
success: (res) => { |
||||
console.log(res) |
||||
if(res.code==200){ |
||||
wx.showToast({ |
||||
title: '提交成功', |
||||
duration:2000 |
||||
}) |
||||
setTimeout(() => { |
||||
wx.navigateBack() |
||||
}, 2000); |
||||
}else{ |
||||
wx.showToast({ |
||||
title: res.msg, |
||||
icon:'none' |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
syncInputValue: function(e){ |
||||
// console.log("输入:" + e.detail.value)
|
||||
this._tempInputValue = e.detail.value; |
||||
}, |
||||
setInputValue: function(e){ |
||||
let value = this._tempInputValue; |
||||
if(!value) {return;} |
||||
let index = e.target.dataset.index; |
||||
let names = e.target.dataset.names; |
||||
let arr = this.data.lanmulist |
||||
arr[index][names]=this._tempInputValue |
||||
this.setData({ |
||||
lanmulist: arr |
||||
}); |
||||
this._tempInputValue = null; |
||||
}, |
||||
xuanzhong1(e){ |
||||
// console.log(e.target.dataset.xzindex);
|
||||
// if(e.target.dataset.xzindex==this.data.xuanzhong){
|
||||
// return
|
||||
// }
|
||||
this.setData({ |
||||
xuanzhong:e.target.dataset.xzindex |
||||
}) |
||||
}, |
||||
removelanmu(){ |
||||
if(this.data.lanmulist.length==1){ |
||||
wx.showToast({ |
||||
title: '最少一个,不能再进行删除了', |
||||
icon:"none" |
||||
}) |
||||
return |
||||
} |
||||
if(this.data.xuanzhong==-1){ |
||||
wx.showToast({ |
||||
title: '请选择需要删除的物质栏', |
||||
icon:'none' |
||||
}) |
||||
return |
||||
} |
||||
let arr=this.data.lanmulist |
||||
arr.splice(this.data.xuanzhong,1) |
||||
this.setData({ |
||||
lanmulist:arr, |
||||
xuanzhong:-1 |
||||
}) |
||||
}, |
||||
addlanmu(){ |
||||
let arr=this.data.lanmulist |
||||
arr.push({ |
||||
material:'', |
||||
spec:'', |
||||
technical:'', |
||||
implement:'', |
||||
company:'', |
||||
number:'', |
||||
money:'', |
||||
all_money:'', |
||||
remake:'' |
||||
}) |
||||
this.setData({ |
||||
lanmulist:arr |
||||
}) |
||||
}, |
||||
updatawj1(){ |
||||
// if(this.data.jinjia!=''){
|
||||
// return
|
||||
// }
|
||||
wx.chooseMessageFile({ |
||||
count: 1, |
||||
type: 'all', |
||||
success: (res) => { |
||||
console.log(res) |
||||
var tempFiles = res.tempFiles[0].path |
||||
wx.uploadFile({ |
||||
url: wx.getStorageSync('serverurl') + 'upload-file', |
||||
filePath: tempFiles, |
||||
name: 'image*pdf*excel*word', |
||||
success: (res) => { |
||||
console.log(res); |
||||
let data = JSON.parse(res.data) |
||||
console.log(data); |
||||
|
||||
this.setData({ |
||||
jinjia:data.data.id |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
updatawj(){ |
||||
// if(this.data.wenjianlianjie!=''){
|
||||
// return
|
||||
// }
|
||||
wx.chooseMessageFile({ |
||||
count: 1, |
||||
type: 'all', |
||||
success: (res) => { |
||||
console.log(res) |
||||
var tempFiles = res.tempFiles[0].path |
||||
wx.uploadFile({ |
||||
url: wx.getStorageSync('serverurl') + 'upload-file', |
||||
filePath: tempFiles, |
||||
name: 'image*pdf*excel*word', |
||||
success: (res) => { |
||||
console.log(res); |
||||
let data = JSON.parse(res.data) |
||||
console.log(data); |
||||
|
||||
this.setData({ |
||||
wenjianlianjie:data.data.id |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
|
||||
/** |
||||
* 生命周期函数--监听页面初次渲染完成 |
||||
*/ |
||||
onReady() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面显示 |
||||
*/ |
||||
onShow() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面隐藏 |
||||
*/ |
||||
onHide() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面卸载 |
||||
*/ |
||||
onUnload() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 页面相关事件处理函数--监听用户下拉动作 |
||||
*/ |
||||
onPullDownRefresh() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 页面上拉触底事件的处理函数 |
||||
*/ |
||||
onReachBottom() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 用户点击右上角分享 |
||||
*/ |
||||
onShareAppMessage() { |
||||
|
||||
} |
||||
}) |
@ -0,0 +1,3 @@
|
||||
{ |
||||
"usingComponents": {} |
||||
} |
@ -0,0 +1,82 @@
|
||||
<view> |
||||
<view class="max_box"> |
||||
<view class="item_box"> |
||||
<view>投标人</view> |
||||
<view class="inputs"><input type="text" model:value='{{biduser}}' placeholder="请输入名字" /></view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>说明</view> |
||||
<view class="inputs"><input type="text" model:value='{{explain}}' placeholder="请输入内容" /></view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>支付方式</view> |
||||
<view class="inputs"><input type="text" model:value='{{zffs}}' placeholder="请输入内容" /></view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>合同文件</view> |
||||
<view bindtap="updatawj" class="updata"><text style="margin-right: 30rpx;" catchtap="htxz">下载合同</text>{{wenjianlianjie==""?'点击上传':'上传成功'}}</view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>竞价文件</view> |
||||
<view bindtap="updatawj1" class="updata"><text style="margin-right: 30rpx;" catchtap="download">下载模板</text>{{jinjia==""?'点击上传':'上传成功'}}</view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>联系人</view> |
||||
<view class="inputs"><input type="text" model:value='{{lxr}}' placeholder="请输入联系人" disabled="true" /></view> |
||||
</view> |
||||
<view class="item_box"> |
||||
<view>联系电话</view> |
||||
<view class="inputs"><input type="text" model:value='{{phone}}' placeholder="请输入联系电话" disabled="true" /></view> |
||||
</view> |
||||
</view> |
||||
<view class="lanmu_max_box"> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}' wx:if="{{lanmulist.length>0}}" wx:for="{{lanmulist}}" wx:key="{{index}}"> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>物资名字</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.material }}" data-index="{{index}}" data-names="material" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入物资名字" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>规格型号</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.spec }}" data-index="{{index}}" data-names="spec" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入规格型号" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>技术要求</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.technical }}" data-index="{{index}}" data-names="technical" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入技术要求" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>执行标准</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.implement }}" data-index="{{index}}" data-names="implement" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入执行标准" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>单位名称</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.company }}" data-index="{{index}}" data-names="company" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入单位名称" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>数量</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.number }}" data-index="{{index}}" data-names="number" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入数量" disabled="true" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>单价</view> |
||||
<view><input bindtap="xuanzhong1" data-xzindex='{{index}}' value="{{ item.money }}" data-index="{{index}}" data-names="money" bindinput="syncInputValue" bindblur="setInputValue" class="shurukuang" placeholder="请输入单价" /></view> |
||||
</view> |
||||
<view bindtap="xuanzhong1" data-xzindex='{{index}}'> |
||||
<view>备注</view> |
||||
<view><textarea value="{{ item.remake }}" data-index="{{index}}" data-names="remake" bindinput="syncInputValue" bindblur="setInputValue" bindtap="xuanzhong1" data-xzindex='{{index}}' class="shurukuang" placeholder="请输入备注" maxlength="200"> |
||||
</textarea> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- <view class="buttons"> |
||||
<view bindtap="removelanmu"> |
||||
<image src="../../static/img/remove.png" /> |
||||
删除 |
||||
</view> |
||||
<view bindtap="addlanmu"><image src="../../static/img/addfj.png" />添加物质</view> |
||||
</view> --> |
||||
<view class="maxbox"> |
||||
<view bindtap="tijiao" class="queren"> |
||||
确认投标 |
||||
</view> |
||||
</view> |
||||
</view> |
@ -0,0 +1,102 @@
|
||||
.buttons{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
padding: 10rpx 30rpx; |
||||
margin-bottom: 40rpx; |
||||
} |
||||
.buttons>view>image{ |
||||
width: 28rpx; |
||||
height: 28rpx; |
||||
margin-right: 10rpx; |
||||
} |
||||
.buttons>view:nth-of-type(1){ |
||||
width: 40%; |
||||
height: 80rpx; |
||||
border: 1rpx solid #d81e06; |
||||
border-radius: 10rpx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
color: #d81e06; |
||||
} |
||||
.buttons>view:nth-of-type(2){ |
||||
width: 40%; |
||||
height: 80rpx; |
||||
border: 1rpx solid #0084FF; |
||||
border-radius: 10rpx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
color: #0084FF; |
||||
} |
||||
.max_box{ |
||||
display: flex; |
||||
flex-direction: column; |
||||
padding: 20rpx 30rpx; |
||||
box-sizing: border-box; |
||||
} |
||||
.item_box{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
padding-bottom: 20rpx; |
||||
margin-bottom: 20rpx; |
||||
border-bottom: 1rpx dashed #c9c9c9; |
||||
} |
||||
|
||||
.item_box>.inputs input{ |
||||
text-align: right; |
||||
width: 400rpx; |
||||
} |
||||
|
||||
.lanmu_max_box{ |
||||
display: flex; |
||||
flex-direction: column; |
||||
padding: 10rpx 30rpx; |
||||
} |
||||
.lanmu_max_box>view{ |
||||
border: 1rpx solid #d1d1d1; |
||||
border-radius: 10rpx; |
||||
padding: 20rpx; |
||||
box-sizing: border-box; |
||||
margin-bottom: 20rpx; |
||||
/* box-shadow: 0rpx 0rpx 5rpx #797979; */ |
||||
} |
||||
.lanmu_max_box>view>view{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
padding-bottom: 20rpx; |
||||
border-bottom: 1rpx dashed #c9c9c9; |
||||
margin-bottom: 20rpx; |
||||
} |
||||
.maxbox{ |
||||
width: 100%; |
||||
padding: 0 30rpx; |
||||
box-sizing: border-box; |
||||
} |
||||
.queren{ |
||||
/* width: 100%; */ |
||||
height: 100rpx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
background-color: #0084FF; |
||||
color: #fff; |
||||
margin: auto; |
||||
margin-bottom:60rpx; |
||||
border-radius: 10rpx; |
||||
} |
||||
.xz{ |
||||
border-color: #0084FF !important; |
||||
} |
||||
.lanmu_max_box>view>view:nth-last-child(1){ |
||||
align-items: flex-start; |
||||
border-bottom:none; |
||||
margin-bottom: 0rpx; |
||||
} |
||||
.shurukuang{ |
||||
text-align: right; |
||||
width: 400rpx; |
||||
} |
@ -1,7 +1,7 @@
|
||||
{ |
||||
"projectname": "wx", |
||||
"setting": { |
||||
"compileHotReLoad": true |
||||
"compileHotReLoad": false |
||||
}, |
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html" |
||||
} |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in new issue