|
@@ -3,107 +3,39 @@
|
|
|
<view class="transaction">
|
|
|
<u-form :model="purchaseOrder" ref="uForm" class="uForm">
|
|
|
<u-form-item label="业务编号" prop="businessNumber" label-width="140" required>
|
|
|
- <u-input v-model="purchaseOrder.businessNumber" input-align="right" placeholder="请输入业务编号"/>
|
|
|
+ <u-input v-model="purchaseOrder.businessNumber" input-align="right" placeholder="请输入业务编号" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="收货方" prop="consignee" label-width="140" required>
|
|
|
- <u-input v-model="purchaseOrder.consignee" input-align="right" placeholder="请输入收货方名称"/>
|
|
|
+ <u-input v-model="purchaseOrder.consignee" input-align="right" placeholder="请输入收货方名称" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="发货方" prop="shipper" label-width="140" required>
|
|
|
- <u-input v-model="purchaseOrder.shipper" input-align="right" placeholder="请输入发货方名称"/>
|
|
|
+ <u-input v-model="purchaseOrder.shipper" input-align="right" placeholder="请输入发货方名称" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="货名" prop="goodsName" label-width="140" required>
|
|
|
- <u-input v-model="purchaseOrder.goodsName" input-align="right" placeholder="请输入货名,如玉米"/>
|
|
|
+ <u-input v-model="purchaseOrder.goodsName" input-align="right" placeholder="请输入货名,如玉米" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="货物单价(元/吨)" prop="goodsPrice" label-width="250" required>
|
|
|
- <u-input v-model="purchaseOrder.goodsPrice" input-align="right" placeholder="请输入货物单价"/>
|
|
|
+ <u-input v-model="purchaseOrder.goodsPrice" input-align="right" placeholder="请输入货物单价" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="运费单价(元/吨)" prop="freightUnitPrice" label-width="250" required>
|
|
|
- <u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价"/>
|
|
|
+ <u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价" />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="运费承担方" prop="freightUnitPrice" label-width="250" required>
|
|
|
- <!-- <u-select v-model="isFreightUnitPrice" :list="packingType" :default-value="defaultValue" mode="single-column" @confirm="packingChange"></u-select> -->
|
|
|
- <view class="con-list">
|
|
|
- <picker @change="packingChange" :value="packingIndex" :range="packingType">
|
|
|
- <view class="picker">
|
|
|
- {{packingIndex>-1?packingType[packingIndex]:'请选择'}}
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
+ <view class="con-list">
|
|
|
+ <picker @change="packingChange" :value="packingIndex" :range="packingType">
|
|
|
+ <view class="picker">
|
|
|
+ {{packingIndex>-1?packingType[packingIndex]:'请选择'}}
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="收货地址" prop="receivingAddress" label-width="140" required>
|
|
|
+ <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="请输入收货地址" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="收货人账号" prop="accountNumber" label-width="160" required>
|
|
|
+ <u-input v-model="purchaseOrder.accountNumber" input-align="right" placeholder="请输入收货人账号" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="收货地址" prop="receivingAddress" label-width="140" required>
|
|
|
- <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="请输入收货地址"/>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item label="收货人账号" prop="accountNumber" label-width="160" required>
|
|
|
- <u-input v-model="purchaseOrder.accountNumber" input-align="right" placeholder="请输入收货人账号"/>
|
|
|
- </u-form-item>
|
|
|
</u-form>
|
|
|
-
|
|
|
- <!-- <view class="c-row b-b margin-top">
|
|
|
- <view class="title">业务编号</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.businessNumber' placeholder="请输入业务编号"
|
|
|
- placeholder-style="font-size: 12px;" name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
-<!-- <view class="c-row b-b">
|
|
|
- <view class="title">收货方</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.consignee' placeholder="请输入收货方名称" placeholder-style="font-size: 12px;"
|
|
|
- name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">发货方</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.shipper' placeholder="请输入发货方名称" placeholder-style="font-size: 12px;"
|
|
|
- name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">货名</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.goodsName' placeholder="请输入货名,如玉米"
|
|
|
- placeholder-style="font-size: 12px;" name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">货物单价(元/吨)</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.goodsPrice' placeholder="请输入货物单价" placeholder-style="font-size: 12px;"
|
|
|
- name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">运费单价(元/吨)</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.freightUnitPrice' placeholder="请输入运费单价"
|
|
|
- placeholder-style="font-size: 12px;" name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">运费承担方</view>
|
|
|
- <view class="con-list">
|
|
|
- <picker @change="packingChange" :value="packingIndex" :range="packingType">
|
|
|
- <view class="picker">
|
|
|
- {{packingIndex>-1?packingType[packingIndex]:'请选择'}}
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- <view class="c-row b-b">
|
|
|
- <view class="title">收货地址</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.receivingAddress' placeholder="请输入收货地址"
|
|
|
- placeholder-style="font-size: 12px;" name="input"></input>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="c-row">
|
|
|
- <view class="title">收货人账号</view>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='purchaseOrder.accountNumber' placeholder="请输入收货人账号"
|
|
|
- placeholder-style="font-size: 12px;" name="input"></input>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
<view class="account-tip">
|
|
|
注:收货人账号为收货人注册易粮易运的手机号码
|
|
@@ -117,100 +49,160 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ // import fullPopup from '@/components/common/fullPopup'
|
|
|
export default {
|
|
|
name: "business",
|
|
|
+ components: {
|
|
|
+ // fullPopup
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
purchaseOrder: {
|
|
|
freightPayer: "发货方承担"
|
|
|
},
|
|
|
- packingType: ["发货方承担","收货方承担"],
|
|
|
- isFreightUnitPrice:true,
|
|
|
- packingIndex:0,
|
|
|
- phone:""
|
|
|
+ packingType: ["发货方承担", "收货方承担"],
|
|
|
+ isFreightUnitPrice: true,
|
|
|
+ packingIndex: 0,
|
|
|
+ phone: "",
|
|
|
+ rules: {
|
|
|
+ businessNumber: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '业务编号不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }, ],
|
|
|
+ consignee: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '收货方不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }],
|
|
|
+ shipper: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '发货方不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }],
|
|
|
+
|
|
|
+ goodsName: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '货名不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }],
|
|
|
+ goodsPrice: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '货物单价不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return this.$u.test.amount(value)
|
|
|
+ },
|
|
|
+ message: '数值类型,最多保留两位小数',
|
|
|
+ trigger: ['change', 'blur'],
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ freightUnitPrice: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '运费单价不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return this.$u.test.amount(value)
|
|
|
+ },
|
|
|
+ message: '数值类型,最多保留两位小数',
|
|
|
+ trigger: ['change', 'blur'],
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ receivingAddress: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '收获地址不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }],
|
|
|
+ accountNumber: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return !this.$u.test.isEmpty(value)
|
|
|
+ },
|
|
|
+ message: '手机号码不能为空',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ return this.$u.test.mobile(value);
|
|
|
+ },
|
|
|
+ message: '手机号格式不正确',
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
-
|
|
|
+ onReady() {
|
|
|
+ this.$refs.uForm.setRules(this.rules);
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.phone = options.phone
|
|
|
},
|
|
|
- onPageScroll(e) {
|
|
|
-
|
|
|
- },
|
|
|
- //下拉刷新
|
|
|
- onPullDownRefresh() {},
|
|
|
- onReachBottom() { //上拉触底函数
|
|
|
- },
|
|
|
methods: {
|
|
|
packingChange(event) {
|
|
|
console.log(event)
|
|
|
this.packingIndex = event.detail.value;
|
|
|
},
|
|
|
commit() {
|
|
|
- this.purchaseOrder.accountNumber= this.phone
|
|
|
- this.$api.doRequest('post', '/freightReceivingDispatching/api/insertFreightReceivingDispatching',this.purchaseOrder).then(res => {
|
|
|
- // if(res.data.code=='200'){
|
|
|
- // uni.showModal({
|
|
|
- // title: '提示',
|
|
|
- // content: '该手机号已认证过司机,再次认证将覆盖之前的认证信息,是否确定认证?',
|
|
|
- // success: function (res) {
|
|
|
- // if (res.confirm) {
|
|
|
- // that.DriverViewInfo.cover=1
|
|
|
- // that.$api.doRequest('post', '/driverViewInfo/api/editInfo', that.DriverViewInfo).then(res => {
|
|
|
- // }).catch(res => {
|
|
|
- // uni.showToast({
|
|
|
- // title: '提交成功',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/pages/attestation/indexThree`
|
|
|
- // })
|
|
|
- // })
|
|
|
- // } else if (res.cancel) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '提交失败',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
-
|
|
|
- // }else if(res.data.code==200){
|
|
|
- // uni.showToast({
|
|
|
- // title: '提交成功',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/pages/attestation/indexThree`
|
|
|
- // })
|
|
|
- // }
|
|
|
- if(res.data.code==200){
|
|
|
- uni.showToast({
|
|
|
- title: '提交成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000,
|
|
|
- success:function(){
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageA/freightTransport/index`
|
|
|
+ this.purchaseOrder.shipperPhone = this.phone
|
|
|
+ this.$refs.uForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '正在加载',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ console.log('验证通过');
|
|
|
+ this.$api.doRequest('post',
|
|
|
+ '/freightReceivingDispatching/api/insertFreightReceivingDispatching',
|
|
|
+ this
|
|
|
+ .purchaseOrder).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000,
|
|
|
+ success: function() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pageA/freightTransport/index`
|
|
|
})
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch(res => {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: res.data.message,
|
|
|
+ // icon: 'none',
|
|
|
+ // duration: 2000
|
|
|
+ // })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('验证失败');
|
|
|
}
|
|
|
-
|
|
|
- }).catch(res => {
|
|
|
- // uni.showToast({
|
|
|
- // title: res.data.message,
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -221,9 +213,11 @@
|
|
|
.content {
|
|
|
background: #F5F6FA;
|
|
|
}
|
|
|
- .center{
|
|
|
+
|
|
|
+ .center {
|
|
|
overflow-y: hidden;
|
|
|
}
|
|
|
+
|
|
|
.c-row {
|
|
|
display: -webkit-box;
|
|
|
display: -webkit-flex;
|
|
@@ -657,12 +651,14 @@
|
|
|
.btn:after {
|
|
|
border: none;
|
|
|
}
|
|
|
- .account-tip{
|
|
|
+
|
|
|
+ .account-tip {
|
|
|
font-size: 24rpx;
|
|
|
font-weight: 400;
|
|
|
color: #AFB3BF;
|
|
|
padding-left: 60rpx;
|
|
|
}
|
|
|
+
|
|
|
.uForm {
|
|
|
padding: 0 40rpx;
|
|
|
}
|