123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <template>
- <view class="warp">
- <view class="transaction">
- <u-form :model="purchaseOrder" ref="uForm" class="uForm">
- <u-form-item label="合同编号" prop="receivingAddress" label-width="140">
- <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
- </u-form-item>
- <u-form-item label="任务编号" prop="receivingAddress" label-width="140">
- <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
- </u-form-item>
- <u-form-item label="货名" prop="receivingAddress" label-width="140">
- <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="" disabled/>
- </u-form-item>
- <u-form-item label="发货地址" prop="receivingAddress" label-width="140" label-position='top'>
- <u-input v-model="purchaseOrder.receivingAddress" input-align="left" placeholder="" disabled/>
- </u-form-item>
- <u-form-item label="收货地址" prop="receivingAddress" label-width="140" label-position='top'>
- <u-input v-model="purchaseOrder.receivingAddress" input-align="left" placeholder="请输入收货地址" disabled/>
- </u-form-item>
- <u-form-item label="运费(元/吨)" prop="freightUnitPrice" label-width="250">
- <u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价" />
- </u-form-item>
- </u-form>
- </view>
- <u-toast ref="uToast" />
- <view class="bottom-btn">
- <u-button type="primary" class="submit" hover-class="none" @click="rejectSubmit()">驳回</u-button>
- <u-button type="primary" class="submit" hover-class="none" @click="passSubmit()">通过</u-button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- purchaseOrder: {
- freightUnitPrice: "123",
- receivingAddress:'444'
- },
- rules: {
- 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'],
- }
- ]
- }
- }
- },
- onLoad() {
- this.getList()
- },
- methods: {
- getList(){
-
- },
- passSubmit(){
- 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('验证失败');
- }
- });
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .transaction {
- background-color: #FFFFFF;
- margin: 10rpx;
- padding-bottom: 10rpx;
- border-radius: 20rpx;
- }
- .uForm {
- padding: 0 40rpx;
- }
- .u-form-item{
- padding: 0;
- }
- .bottom-btn {
- width: 100%;
- position: fixed;
- bottom: 40rpx;
- display: flex;
- z-index: 2;
- }
- .submit {
- width: 40%;
- background: #22C572;
- border-radius: 10rpx;
- }
- </style>
|