|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
<view class="center">
|
|
|
+ <view class="buyup">
|
|
|
+
|
|
|
+
|
|
|
<view class="c-row b-b">
|
|
|
<text class="tit">名头</text>
|
|
|
<view class="con-list">
|
|
@@ -58,13 +61,6 @@
|
|
|
<input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="c-row b-b">
|
|
|
- <text class="tit">产地</text>
|
|
|
- <view class="con-list">
|
|
|
- <view @click='regionchange1'>{{region1}}</view>
|
|
|
- <u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1" ></u-picker>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
<view class="c-row b-b">
|
|
|
<text class="tit">收货地区</text>
|
|
|
<view class="con-list">
|
|
@@ -78,58 +74,62 @@
|
|
|
<input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="c-row b-b">
|
|
|
- <button @click='getcode' type="default">{{sendText}}</button>
|
|
|
+ <view class="c-row ">
|
|
|
+ <text class="validate">获取验证码</text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写6位短信验证码" name="input" v-model="deptList.title1"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="c-row b-b">
|
|
|
- <checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox>完善更多信息(选填,可由客服人员代为完善)
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view class="buylow">
|
|
|
+
|
|
|
+
|
|
|
+ <view class="c-row ">
|
|
|
+ <checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text style="font-size: 14px; ">完善更多信息<text style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
|
|
|
+ </view>
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">水分(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写水分占比" name="input" v-model="deptList.waterContent"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">容重(g/L)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写容重" name="input" v-model="deptList.bulkDensity"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">热损伤(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写热损伤占比" name="input" v-model="deptList.jiaorenli"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">杂质(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">霉变粒(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">不完整粒(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">蛋白(%)<= </text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">粒型 </text>
|
|
|
<picker @change="liChange" :value="liIndex" :range="liType" class="con-list" v-model="deptList.grain">
|
|
|
<view class="con-list">
|
|
@@ -137,7 +137,7 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">品级 </text>
|
|
|
<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
|
|
|
<view class="con-list">
|
|
@@ -145,7 +145,14 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
+ <text class="tit">产地</text>
|
|
|
+ <view class="con-list">
|
|
|
+ <view @click='regionchange1'>{{region1}}</view>
|
|
|
+ <u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1" ></u-picker>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">产出年份</text>
|
|
|
<picker @change="nianChange" :value="nianIndex" :range="nianType" class="con-list">
|
|
|
<view class="con-list">
|
|
@@ -153,7 +160,7 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">包装方式</text>
|
|
|
<picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
|
|
|
<view class="con-list">
|
|
@@ -161,13 +168,13 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
- <view v-if='checked&&baoIndex==2||!checked&&baoIndex==3' class="c-row b-b">
|
|
|
+ <view v-if='!checked&&baoIndex==2||!checked&&baoIndex==3' class="c-row b-b">
|
|
|
<text class="tit">袋装备注</text>
|
|
|
<view class="con-list">
|
|
|
<input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if='checked' class="c-row b-b">
|
|
|
+ <view v-if='!checked' class="c-row b-b">
|
|
|
<text class="tit">运费承担方</text>
|
|
|
<picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
|
|
|
<view class="con-list">
|
|
@@ -175,8 +182,9 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
|
|
|
- <button @click="commit()">发布</button>
|
|
|
+ <button @click="commit()" class="btn">发布</button>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -194,13 +202,10 @@
|
|
|
deptList: {
|
|
|
priceType: "定价采购",
|
|
|
procurementPlanType:"现货",
|
|
|
- grain:"不限",
|
|
|
- grainKey:1,
|
|
|
- grade:"不限",
|
|
|
- gradeKey:1,
|
|
|
+ grain:"塔粮",
|
|
|
+ grade:"不限(默认)",
|
|
|
outputYear:"2020",
|
|
|
- packingType:"不限",
|
|
|
- packingTypeKey:0,
|
|
|
+ packingType:"不限(默认)",
|
|
|
freightPayer:"",
|
|
|
},
|
|
|
params:{
|
|
@@ -215,20 +220,19 @@
|
|
|
checked:true,
|
|
|
insertProcurementPlanInfo: {},
|
|
|
liIndex: 0,
|
|
|
- liType: ['不限','塔粮', '筛粮', '中粒', '大粒'],
|
|
|
+ liType: ['塔粮', '筛粮', '中粒', '大粒'],
|
|
|
pinIndex: 0,
|
|
|
- pinType: ['不限', '一等品', '二等品', '三等品', '等外'],
|
|
|
+ pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
|
|
|
nianIndex: 3,
|
|
|
nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
|
|
|
'2011'
|
|
|
],
|
|
|
- sendText:'获取验证码',
|
|
|
show:false,
|
|
|
show1:false,
|
|
|
region:'请选择收货地区',
|
|
|
region1:'请选择产地',
|
|
|
baoIndex: 0,
|
|
|
- baoType: ['不限', '散装', '大袋', '小袋'],
|
|
|
+ baoType: ['不限(默认)', '散装', '大袋', '小袋'],
|
|
|
chengIndex: -1,
|
|
|
chengType: ['可议', '买方承担', '卖方承担']
|
|
|
}
|
|
@@ -256,46 +260,6 @@
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- getcode(){
|
|
|
- var that = this
|
|
|
- if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.deptList.buyerPhone)){
|
|
|
- this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.deptList.buyerPhone}).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
- that.sendDisabled = true
|
|
|
- let sec = 60
|
|
|
- let interval = setInterval(() => {
|
|
|
- sec--;
|
|
|
- that.sendText = sec + 's后重发'
|
|
|
- if (sec <= 0) {
|
|
|
- that.sendDisabled = false
|
|
|
- that.sendText = "获取验证码"
|
|
|
- clearInterval(interval)
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: '请输入正确的手机号',
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
regionpicker(e){
|
|
|
this.deptList.receivePrivate=e.province.label
|
|
|
this.deptList.receiveCity=e.city.label
|
|
@@ -318,14 +282,14 @@
|
|
|
},
|
|
|
typeChange(e) {
|
|
|
this.typesIndex = e.detail.value
|
|
|
- if(e.detail.value==0){
|
|
|
+ this.types = this.typesType[this.typesIndex];
|
|
|
+ this.deptList.procurementPlanType = this.typesType[this.typesIndex];
|
|
|
+ if (this.typesIndex == 0) {
|
|
|
this.deptList.priceType = '定价采购'
|
|
|
- this.deptList.procurementPlanTypeKey =2
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.deptList.priceType = '期货盘面价+基差'
|
|
|
- this.deptList.procurementPlanTypeKey =1
|
|
|
}
|
|
|
- this.deptList.procurementPlanType = this.typesType[this.typesIndex];
|
|
|
+
|
|
|
},
|
|
|
navToDetailPage() {
|
|
|
// if (index == 1) {
|
|
@@ -335,10 +299,6 @@
|
|
|
},
|
|
|
commit() {
|
|
|
this.insertProcurementPlanInfo = this.deptList
|
|
|
- // if (!this.deptList.goodsName) {
|
|
|
- // this.$api.msg('货名1不能为空')
|
|
|
- // return
|
|
|
- // }
|
|
|
if (!this.deptList.title) {
|
|
|
this.$api.msg('标题不能为空')
|
|
|
return
|
|
@@ -408,7 +368,7 @@
|
|
|
}
|
|
|
}else if(this.insertProcurementPlanInfo.procurementPlanType == '期货'){
|
|
|
if (!this.insertProcurementPlanInfo.basisPrice) {
|
|
|
- this.$api.msg('基差不能为空')
|
|
|
+ this.$api.msg('基差(元/吨)不能为空')
|
|
|
return
|
|
|
}
|
|
|
if (this.insertProcurementPlanInfo.basisPrice>10000||this.insertProcurementPlanInfo.basisPrice<1) {
|
|
@@ -487,13 +447,13 @@
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- if (this.deptList.protein&&this.deptList.protein<1||
|
|
|
- this.deptList.protein&&this.deptList.protein>80) {
|
|
|
+ if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity<1||
|
|
|
+ this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity>80) {
|
|
|
this.$api.msg('蛋白输入错误')
|
|
|
return
|
|
|
}
|
|
|
- if (this.deptList.protein&&this.deptList.protein.indexOf('.')!=-1) {
|
|
|
- if(this.deptList.protein.split('.')[1].length>2){
|
|
|
+ if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity.indexOf('.')!=-1) {
|
|
|
+ if(this.insertProcurementPlanInfo.bulkDensity.split('.')[1].length>2){
|
|
|
this.$api.msg('蛋白输入错误')
|
|
|
return
|
|
|
}
|
|
@@ -501,27 +461,10 @@
|
|
|
this.insertProcurementPlanInfo.basisPrice=-this.insertProcurementPlanInfo.basisPrice
|
|
|
this.insertProcurementPlanInfo.commonId = this.userInfo.id
|
|
|
this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
|
|
|
- uni.showModal({
|
|
|
- content: '确定发布交易信息?',
|
|
|
- success: (res) => {
|
|
|
- if(res.confirm) {
|
|
|
this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
|
|
|
.insertProcurementPlanInfo).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
- uni.showToast({
|
|
|
- title: "发布成功",
|
|
|
- icon: 'none',
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack({})
|
|
|
- }, 2000)
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
+ console.log("添加成功")
|
|
|
+ this.procurementPlanInfos = res.data.data
|
|
|
})
|
|
|
.catch(res => {
|
|
|
uni.showToast({
|
|
@@ -530,20 +473,15 @@
|
|
|
duration: 2000
|
|
|
})
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
liChange(e) {
|
|
|
this.liIndex = e.detail.value
|
|
|
this.litypes = this.liType[this.liIndex];
|
|
|
- this.deptList.grainKey = e.detail.value+1
|
|
|
this.deptList.grain = this.liType[this.liIndex]
|
|
|
},
|
|
|
pinChange(e) {
|
|
|
this.pinIndex = e.detail.value
|
|
|
this.pintypes = this.pinType[this.pinIndex];
|
|
|
- this.deptList.gradeKey = e.detail.value+1
|
|
|
this.deptList.grade = this.pinType[this.pinIndex]
|
|
|
},
|
|
|
nianChange(e) {
|
|
@@ -555,13 +493,11 @@
|
|
|
baoChange(e) {
|
|
|
this.baoIndex = e.detail.value
|
|
|
this.baotypes = this.baoType[this.baoIndex];
|
|
|
- this.deptList.packingTypeKey = e.detail.value
|
|
|
this.deptList.packingType = this.chengType[this.chengIndex];
|
|
|
},
|
|
|
chengChange(e) {
|
|
|
this.chengIndex = e.detail.value
|
|
|
this.chengtypes = this.chengType[this.chengIndex];
|
|
|
- this.deptList.freightPayerKey = e.detail.value+1
|
|
|
this.deptList.freightPayer = this.chengType[this.chengIndex];
|
|
|
}
|
|
|
}
|
|
@@ -571,6 +507,7 @@
|
|
|
<style>
|
|
|
.center {
|
|
|
padding: 10px 20px;
|
|
|
+ background-color: #F5F6FA;
|
|
|
}
|
|
|
|
|
|
.c-row {
|
|
@@ -595,10 +532,36 @@
|
|
|
-webkit-box-direction: normal;
|
|
|
-webkit-flex-direction: column;
|
|
|
flex-direction: column;
|
|
|
- color: #303133;
|
|
|
+ color: #AFB3BF;
|
|
|
line-height: 40rpx;
|
|
|
text-align: right;
|
|
|
padding-right: 20rpx;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
+ .buyup{
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 20px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .buylow{
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 20px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .btn{
|
|
|
+ border-radius: 20px;
|
|
|
+ margin-top: 10px;
|
|
|
+ background-color: #22C572;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ .validate{
|
|
|
+ width: 100px;
|
|
|
+ height: 32px;
|
|
|
+ background-color: #F5F6F9;
|
|
|
+ color: #AFB3BF;
|
|
|
+ border-radius: 10px;
|
|
|
+ border: none;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
</style>
|