panhui 5 years ago
parent
commit
3d9a17d209

+ 12 - 6
src/main/vue/src/components/AttachmentUpload.vue

@@ -11,11 +11,11 @@
             :on-preview="onPreview"
             :on-preview="onPreview"
             ref="upload"
             ref="upload"
         >
         >
-            <el-button type="primary" v-if="fileList.length < filesLimit" size="mini" slot="trigger">
+            <el-button type="primary" :disabled="fileList.length >= filesLimit" size="mini" slot="trigger">
                 点击上传
                 点击上传
             </el-button>
             </el-button>
             <div slot="tip" class="el-upload__tip">
             <div slot="tip" class="el-upload__tip">
-                <slot></slot>
+                <slot> 格式要求jpg/png/pdf/word,文件大小不超过5M</slot>
             </div>
             </div>
             <div class="file-list-item" slot="file" slot-scope="{ file }">
             <div class="file-list-item" slot="file" slot-scope="{ file }">
                 <div class="file-name">
                 <div class="file-name">
@@ -229,12 +229,13 @@ export default {
         }
         }
     }
     }
 }
 }
+.file-upload {
+    line-height: 28px;
+    padding-top: 10px;
+}
 .file-remark {
 .file-remark {
     margin-top: 14px;
     margin-top: 14px;
-}
-
-.el-upload {
-    line-height: 0px;
+    line-height: 28px;
 }
 }
 </style>
 </style>
 <style lang="less">
 <style lang="less">
@@ -246,4 +247,9 @@ export default {
         border-width: 0;
         border-width: 0;
     }
     }
 }
 }
+.file-upload {
+    .el-upload {
+        line-height: 28px;
+    }
+}
 </style>
 </style>

+ 31 - 33
src/main/vue/src/components/logoPatent/BaseInfo.vue

@@ -76,13 +76,13 @@
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
                 </el-form-item>
                 </el-form-item>
-                <el-form-item class="form-submit" style="width: calc(400px + 30vw); text-align: center;">
+                <!-- <el-form-item class="form-submit" style="width: calc(400px + 30vw); text-align: center;">
                     <el-button @click="onSave" :loading="saving" size="default" type="primary">保存 </el-button>
                     <el-button @click="onSave" :loading="saving" size="default" type="primary">保存 </el-button>
                     <el-button @click="onDelete" :loading="saving" size="default" type="danger" v-if="formData.id"
                     <el-button @click="onDelete" :loading="saving" size="default" type="danger" v-if="formData.id"
                         >删除
                         >删除
                     </el-button>
                     </el-button>
                     <el-button @click="$router.go(-1)" size="default">取消</el-button>
                     <el-button @click="$router.go(-1)" size="default">取消</el-button>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
             </el-form>
         </div>
         </div>
     </div>
     </div>
@@ -90,44 +90,39 @@
 <script>
 <script>
 export default {
 export default {
     name: 'LogoPatentEdit',
     name: 'LogoPatentEdit',
-    created() {
-        if (this.$route.query.id) {
-            this.$http
-                .get('logoPatent/get/' + this.$route.query.id)
-                .then(res => {
-                    this.formData = res;
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
-                });
+    props: {
+        info: {
+            type: Object,
+            default: () => {
+                return {};
+            }
         }
         }
+    },
+    created() {
         this.$http
         this.$http
             .post('/partner/all', { size: 1000, query: { del: false } }, { body: 'json' })
             .post('/partner/all', { size: 1000, query: { del: false } }, { body: 'json' })
             .then(res => {
             .then(res => {
                 if (res.content.length > 0) {
                 if (res.content.length > 0) {
-                    res.content.forEach(item => {
-                        this.clientPartnerIdOptions.push({
-                            label: item.name,
-                            value: item.id
+                    this.clientPartnerIdOptions = res.content
+                        .filter(item => {
+                            return item.type === 'CLIENT';
+                        })
+                        .map(item => {
+                            return {
+                                label: item.name,
+                                value: item.id
+                            };
                         });
                         });
-                    });
-                }
-            })
-            .catch(e => {
-                console.log(e);
-                this.$message.error(e.error);
-            });
-        this.$http
-            .post('/partner/all', { size: 1000, query: { del: false } }, { body: 'json' })
-            .then(res => {
-                if (res.content.length > 0) {
-                    res.content.forEach(item => {
-                        this.supplierPartnerIdOptions.push({
-                            label: item.name,
-                            value: item.id
+                    this.supplierPartnerIdOptions = res.content
+                        .filter(item => {
+                            return item.type === 'SUPPLIER';
+                        })
+                        .map(item => {
+                            return {
+                                label: item.name,
+                                value: item.id
+                            };
                         });
                         });
-                    });
                 }
                 }
             })
             })
             .catch(e => {
             .catch(e => {
@@ -167,6 +162,9 @@ export default {
         };
         };
     },
     },
     methods: {
     methods: {
+        init() {
+            this.formData = this.info;
+        },
         onSave() {
         onSave() {
             this.$refs.form.validate(valid => {
             this.$refs.form.validate(valid => {
                 if (valid) {
                 if (valid) {

+ 98 - 0
src/main/vue/src/components/logoPatent/Signed.vue

@@ -0,0 +1,98 @@
+<template>
+    <el-form :model="form" ref="form" :rules="rules" label-width="110px" :inline="false" size="normal">
+        <el-form-item label="是否签约">
+            <el-radio-group v-model="form.check">
+                <el-radio :label="true">
+                    是
+                </el-radio>
+                <el-radio :label="false">
+                    否
+                </el-radio>
+            </el-radio-group>
+        </el-form-item>
+        <el-form-item label="江苏省商标委托代理合同(双方盖章)">
+            <attachment-upload v-model="form.attachment1"> </attachment-upload>
+        </el-form-item>
+        <el-form-item label="收款回执">
+            <attachment-upload v-model="form.attachment2"> </attachment-upload>
+        </el-form-item>
+        <el-form-item prop="payRatio" label="支付比例">
+            <el-select v-model="form.payRatio" clearable filterable placeholder="请选择">
+                <el-option v-for="item in payRatioOptions" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+            </el-select>
+        </el-form-item>
+        <el-form-item>
+            <el-button @click="onSave" type="primary">提交</el-button>
+            <el-button @click="cancel">返回</el-button>
+        </el-form-item>
+    </el-form>
+</template>
+
+<script>
+export default {
+    name: 'Signed',
+    props: {
+        info: {}
+    },
+    data() {
+        return {
+            form: {
+                check: true,
+                attachment1: {
+                    attachmentName: '江苏省商标委托代理合同',
+                    fileName: '',
+                    url: '',
+                    remark: ''
+                },
+                attachment2: {
+                    attachmentName: '收款回执',
+                    fileName: '',
+                    url: '',
+                    remark: ''
+                },
+                payRatio: ''
+            },
+            payRatioOptions: [
+                { label: '全款', value: 'FULL_AMOUNT' },
+                { label: '首付80%', value: 'DOWN_PAYMENT_80' },
+                { label: '首付50%', value: 'DOWN_PAYMENT_50' }
+            ],
+            rules: {
+                payRatio: { required: true, message: '请选择支付比例', trigger: 'change' }
+            }
+        };
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    let info = { ...this.info };
+
+                    info.check = this.form.check;
+                    info.payRatio = this.form.payRatio;
+                    if (!info.attachment) {
+                        info.attachment = [];
+                    }
+
+                    if (this.form.attachment1.url) {
+                        info.attachment.push(this.form.attachment1);
+                    }
+                    if (this.form.attachment2.url) {
+                        info.attachment.push(this.form.attachment2);
+                    }
+
+                    this.$emit('submit', info);
+                } else {
+                    return false;
+                }
+            });
+        },
+        cancel() {
+            this.$emit('cancel');
+        }
+    }
+};
+</script>
+
+<style></style>

+ 42 - 39
src/main/vue/src/views/LogoPatentEdit.vue

@@ -4,16 +4,19 @@
         <el-tabs class="edit-tabs" v-model="activeName">
         <el-tabs class="edit-tabs" v-model="activeName">
             <div class="right-btns">
             <div class="right-btns">
                 <el-button type="primary" size="small">新增答复</el-button>
                 <el-button type="primary" size="small">新增答复</el-button>
+                <el-button type="primary" size="small">新增费用</el-button>
+                <el-button type="primary" size="small">新增附件</el-button>
+                <el-button type="primary" size="small">分案/接续流程</el-button>
             </div>
             </div>
             <div class="tips">
             <div class="tips">
                 <div class="tips-text">
                 <div class="tips-text">
                     <span class="name">当前流程节点</span>
                     <span class="name">当前流程节点</span>
-                    <span class="val">是否决定签约</span>
+                    <span class="val">{{ nowStatus }}</span>
                 </div>
                 </div>
 
 
                 <div class="tips-text">
                 <div class="tips-text">
                     <span class="name">处理人</span>
                     <span class="name">处理人</span>
-                    <span class="val">夏秋雨</span>
+                    <span class="val">{{ user }}</span>
                 </div>
                 </div>
 
 
                 <div class="tips-text">
                 <div class="tips-text">
@@ -24,16 +27,21 @@
                 <el-button type="text" size="small">立即处理</el-button>
                 <el-button type="text" size="small">立即处理</el-button>
             </div>
             </div>
             <el-tab-pane label="基本信息" name="first">
             <el-tab-pane label="基本信息" name="first">
-                <base-info></base-info>
+                <base-info ref="base" :info.sync="formData"></base-info>
             </el-tab-pane>
             </el-tab-pane>
             <el-tab-pane label="附件列表" name="second"></el-tab-pane>
             <el-tab-pane label="附件列表" name="second"></el-tab-pane>
             <el-tab-pane label="费用信息" name="third"></el-tab-pane>
             <el-tab-pane label="费用信息" name="third"></el-tab-pane>
             <el-tab-pane label="流程信息" name="fourth"></el-tab-pane>
             <el-tab-pane label="流程信息" name="fourth"></el-tab-pane>
         </el-tabs>
         </el-tabs>
+
+        <el-dialog title="是否决定签约" center :visible.sync="showCheck" width="600px">
+            <signed :info="formData" @submit="submit" @cancel="showChec = false"></signed>
+        </el-dialog>
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
 import BaseInfo from '../components/logoPatent/BaseInfo.vue';
 import BaseInfo from '../components/logoPatent/BaseInfo.vue';
+import Signed from '../components/logoPatent/Signed.vue';
 export default {
 export default {
     name: 'LogoPatentEdit',
     name: 'LogoPatentEdit',
     created() {
     created() {
@@ -42,44 +50,15 @@ export default {
                 .get('logoPatent/get/' + this.$route.query.id)
                 .get('logoPatent/get/' + this.$route.query.id)
                 .then(res => {
                 .then(res => {
                     this.formData = res;
                     this.formData = res;
+                    this.$nextTick(() => {
+                        this.init();
+                    });
                 })
                 })
                 .catch(e => {
                 .catch(e => {
                     console.log(e);
                     console.log(e);
                     this.$message.error(e.error);
                     this.$message.error(e.error);
                 });
                 });
         }
         }
-        this.$http
-            .post('/partner/all', { size: 1000, query: { del: false } }, { body: 'json' })
-            .then(res => {
-                if (res.content.length > 0) {
-                    res.content.forEach(item => {
-                        this.clientPartnerIdOptions.push({
-                            label: item.name,
-                            value: item.id
-                        });
-                    });
-                }
-            })
-            .catch(e => {
-                console.log(e);
-                this.$message.error(e.error);
-            });
-        this.$http
-            .post('/partner/all', { size: 1000, query: { del: false } }, { body: 'json' })
-            .then(res => {
-                if (res.content.length > 0) {
-                    res.content.forEach(item => {
-                        this.supplierPartnerIdOptions.push({
-                            label: item.name,
-                            value: item.id
-                        });
-                    });
-                }
-            })
-            .catch(e => {
-                console.log(e);
-                this.$message.error(e.error);
-            });
     },
     },
     data() {
     data() {
         return {
         return {
@@ -110,10 +89,33 @@ export default {
                 { label: '首付80%', value: 'DOWN_PAYMENT_80' },
                 { label: '首付80%', value: 'DOWN_PAYMENT_80' },
                 { label: '首付50%', value: 'DOWN_PAYMENT_50' }
                 { label: '首付50%', value: 'DOWN_PAYMENT_50' }
             ],
             ],
-            activeName: 'first'
+            activeName: 'first',
+            showCheck: true
         };
         };
     },
     },
+    computed: {
+        nowStatus() {
+            if (!this.formData.contract) {
+                return '是否决定签约';
+            } else {
+                return '';
+            }
+        },
+        user() {
+            if (!this.formData.contract) {
+                return '客户经理';
+            } else {
+                return '';
+            }
+        }
+    },
     methods: {
     methods: {
+        init() {
+            if (this.activeName === 'first') {
+                this.$refs.base.init();
+            }
+        },
+
         onSave() {
         onSave() {
             this.$refs.form.validate(valid => {
             this.$refs.form.validate(valid => {
                 if (valid) {
                 if (valid) {
@@ -123,8 +125,8 @@ export default {
                 }
                 }
             });
             });
         },
         },
-        submit() {
-            let data = { ...this.formData };
+        submit(info) {
+            let data = { ...info };
 
 
             this.saving = true;
             this.saving = true;
             this.$http
             this.$http
@@ -158,7 +160,8 @@ export default {
         }
         }
     },
     },
     components: {
     components: {
-        BaseInfo
+        BaseInfo,
+        Signed
     }
     }
 };
 };
 </script>
 </script>