| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="mx3" style="padding-bottom: 100rpx">
- <view class="main-color-bg" style="height: 100rpx; margin: 0 -30rpx"></view>
- <view class="p3 bg-color-white" style="margin-top: -50rpx; border-radius: 20rpx">
- <u-form :model="form" ref="uForm" :label-width="180">
- <u-form-item label="拒单理由" required prop="refuseRemark">
- <u-input type="textarea" v-model="form.refuseRemark" />
- </u-form-item>
- </u-form>
- <view class="p-fixed d-flex j-around a-center footer">
- <view class="main-color-bg text-color-white common" :loading="confirmLoading" @tap="submit">提交</view>
- </view>
- </view>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- form: {
- id: '',
- refuseRemark: '',
- },
- rules: {
- refuseRemark: [
- {
- required: true,
- message: '拒单理由不能为空',
- trigger: 'blur'
- }
- ]
- },
- confirmLoading: false
- };
- },
- onReady() {
- this.$refs.uForm.setRules(this.rules);
- },
- onLoad(options) {
- // 只取拒单接口需要的字段,避免 URL 上的多余参数混入请求体导致接口报错
- this.form.id = options.id
- },
- methods: {
- // 提交
- submit() {
- this.$refs.uForm.validate(valid => {
- if (valid) {
- this.$Http.rejectRepair(this.form)
- .then((res) => {
- this.confirmLoading = false
- this.$refs.uToast.show({
- title: '提交成功!',
- type: 'success',
- back: true
- })
- }).catch(() => {
- this.confirmLoading = false
- })
- } else {
- console.log('验证失败');
- }
- });
- },
- }
- };
- </script>
- <style lang="less">
- page {
- background-color: #f4f4f4;
- }
- .footer {
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- z-index: 10000;
- border-top: 1rpx solid #f4f4f4;
- height: 100rpx;
- .common {
- padding: 15rpx 200rpx;
- border-radius: 30rpx;
- background-color: #0082ff;
- color: #fff;
- }
- }
- </style>
|