handle-area.vue 3.24 KB
<template>
    <div class="handle-area">
        <div>处理方式</div>
        <div class="manage-type">
            <Radio>需要退回品牌方</Radio>
            <Radio>需要品牌方补寄</Radio>
            <Radio>补做发货单</Radio>
        </div>
        <div class="edit-area">
            <Form>
                <Form-item label="物流单号" :label-width="80">
                    <Input v-model.trim="otherInfo.waybillCode" type="text" style="width: 400px"></Input>
                </Form-item>
                <Form-item label="联系人" :label-width="80">
                    <Input v-model.trim="otherInfo.contacts" type="text" style="width: 400px"></Input>
                </Form-item>
                <Form-item label="联系人号码" :label-width="80">
                    <Input v-model.trim="otherInfo.phone" type="text" style="width: 400px"></Input>
                </Form-item>
                <Form-item label="邮政编码" :label-width="80">
                    <Input v-model.trim="otherInfo.zipCode" type="text" style="width: 400px"></Input>
                </Form-item>
                <Form-item label="返回地址" :label-width="80">
                    <Input v-model.trim="otherInfo.returnAddress" type="text" style="width: 400px"></Input>
                </Form-item>
                <Form-item label="物流公司" :label-width="80">
                    <Input v-model.trim="otherInfo.logistics" type="text" style="width: 400px"></Input>
                </Form-item>
                <Button type="primary" @click="save">保存</Button>
            </Form>
        </div>
    </div>
</template>

<script>
    import _ from 'lodash';
    import DiffService from 'services/repository/diff-service';

    export default {
        name: 'handle-area',
        props: {
            workId: {
                type: Number
            },
            otherInfo: {
                type: Object
            }
        },
        data() {
            return {

            };
        },
        created() {
            this.diffService = new DiffService();
        },
        methods: {
            save() {
                const params = {
                    id: 0,
                    phone: '',
                    zipCode: '',
                    contacts: '',
                    logistics: '',
                    waybillCode: '',
                    returnAddress: '',
                    logisticsDeptUpdateTime: '',
                };

                _.each(params, (value, key) => {
                    params[key] = this.otherInfo[key];
                });

                params.workOrderId = this.workId;

                // TODO 需求暂时不明、已与产品确认暂缓
                this.diffService.saveEditInfo(params)
                    .then(res => {
                        if (res.code === 200) {
                            this.$Message.success('保存成功');
                        } else {
                            this.$Message.error(res.message);
                        }
                    });
            }
        }
    };
</script>

<style lang="scss">
    .handle-area {
        margin-top: 20px;

        .manage-type {
            margin-top: 10px;
        }

        .edit-area {
            margin-top: 20px;
        }
    }
</style>