Browse Source

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

liuhj 2 years ago
parent
commit
80d971bdc7

+ 41 - 34
src/components/Crm/CustomerCompany.vue

@@ -195,8 +195,8 @@ export default {
                 companyName: "",
                 address: "",
                 postCodes: "",
-                lastedOpUserId: 0,
-                createUserId: 0,
+                lastedOpUserId: this.userId,
+                createUserId: this.userId,
                 remark: ""
             },
                 this.TypeVisible = true;
@@ -228,44 +228,51 @@ export default {
                             that.$message.error(res.data.msg);
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             })
         },
-        
-        del(index, row) {
 
-            var url = "/api/CRM/DelClientCompany"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+        del(index, row) {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/CRM/DelClientCompany"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.ClientCompany()
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.ClientCompany()
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 41 - 34
src/components/Crm/DeleClient.vue

@@ -4,8 +4,7 @@
             <div class="communal-title">
                 <div>客户资料</div>
                 <div class="communal-box">
-                    <el-input @input="Inquireclick()" placeholder="城市/名称/联系人" v-model="input" clearable
-                        style="width: 350px;">
+                    <el-input @input="Inquireclick()" placeholder="姓名/所属公司" v-model="input" clearable style="width: 350px;">
                     </el-input>
                     <router-link to="/home/visaEdit">
                         <el-button type="primary" style="margin-left: 10px;">新增</el-button>
@@ -137,11 +136,9 @@ export default {
             } else {
 
                 for (var i = 0; i < this.tableData.length; i++) {
-                    if (this.tableData[i].city.indexOf(this.input) != -1) {
+                    if (this.tableData[i].clientName.indexOf(this.input) != -1) {
                         newarr.push(this.tableData[i]);
-                    } else if (this.tableData[i].name.indexOf(this.input) != -1) {
-                        newarr.push(this.tableData[i]);
-                    } else if (this.tableData[i].contact.indexOf(this.input) != -1) {
+                    } else if (this.tableData[i].companyName.indexOf(this.input) != -1) {
                         newarr.push(this.tableData[i]);
                     }
                 }
@@ -159,36 +156,46 @@ export default {
         },
 
         del(index, row) {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/CRM/DelCustomer"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-            var url = "/api/CRM/DelCustomer"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
-
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.DeleClient();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.DeleClient();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 123 - 21
src/components/OP/visaEdit.vue

@@ -88,7 +88,7 @@
             <div class="small-title">
                 <span>证件信息</span>
             </div>
-            <el-form v-for="(item, i) in customerCerts" :key="i" :rules="rules" ref="customerCerts" @submit.native.prevent>
+            <el-form v-for="(item, i) in customerCerts" :key="i" :rules="rulesCert" ref="deleClient" @submit.native.prevent>
                 <div class="foundation-box1">
                     <el-form-item label="证件类型" prop="sdId">
                         <el-select v-model="item.sdId" filterable placeholder="请选择" style="width: 164px;">
@@ -136,15 +136,18 @@
                     class="demo-deleClient" @submit.native.prevent>
                     <div class="foundation-box">
                         <div style="width: 100%;padding-left: 50px;color: red;font-size: 12px;">
-                            若信息有误或没有单位请到客户公司资料编辑
+                            若下拉框没有你想选择的公司,请点击+添加
                         </div>
                         <el-form-item label="单位名称:" prop="companyName">
-                            <el-select v-model="customerCompany.id" filterable placeholder="请选择公司"
+                            <el-select v-model="customerCompany.id" clearable filterable placeholder="请选择公司"
                                 @change="companyChange(customerCompany.id)">
                                 <el-option v-for="item in CompanySelectData" :key="item.id" :label="item.companyName"
                                     :value="item.id">
                                 </el-option>
                             </el-select>
+
+                            <el-button circle icon="el-icon-plus" @click="btnAddCom()"></el-button>
+
                         </el-form-item>
                         <el-form-item label="单位地址:" disabled prop="companyAddress">
                             <el-input v-model="customerCompany.address" :disabled="true"></el-input>
@@ -681,8 +684,37 @@
         </div>
         <div>
             <el-button type="primary" @click="submitForm">确定</el-button>
-            <el-button @click="resetForm('deleClient')">重置</el-button>
+            <router-link to="/home/DeleClient">
+                <el-button type="primary" style="margin-left: 10px;">取消</el-button>
+            </router-link>
         </div>
+        <el-dialog title="添加客户公司信息" :visible.sync="TypeVisible" width="30%" :before-close="handleClose"
+            :close-on-click-modal="false">
+            <div>
+                <el-form :model="OperationData" :rules="rulesCompany" ref="OperationData" label-width="100px"
+                    class="demo-ruleForm">
+                    <el-form-item label="公司名称" prop="companyName">
+                        <el-input placeholder="请输入内容" v-model="OperationData.companyName">
+                        </el-input>
+                    </el-form-item>
+                    <el-form-item label="公司地址" prop="address">
+                        <el-input placeholder="请输入内容" v-model="OperationData.address">
+                        </el-input>
+                    </el-form-item>
+                    <el-form-item label="公司编码" prop="postCodes">
+                        <el-input placeholder="请输入内容" v-model="OperationData.postCodes">
+                        </el-input>
+                    </el-form-item>
+                    <el-form-item label="备 注" prop="remark">
+                        <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="OperationData.remark"></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="TypeVisible = false">取 消</el-button>
+                <el-button type="primary" @click="AddBtn">确 定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -693,13 +725,15 @@ export default {
             rules: {
                 lastName: [
                     { required: true, message: '请输入姓', trigger: 'change' },
+                    { required: true, message: '请输入姓', trigger: 'blur' },
                     { min: 1, max: 3, message: '长度在 1 到 3 个字符', trigger: 'change' }
                 ],
                 firstName: [
                     { required: true, message: '请输入名', trigger: 'change' },
+                    { required: true, message: '请输入名', trigger: 'blur' },
                     { min: 1, max: 3, message: '长度在 1 到 3 个字符', trigger: 'change' }
                 ],
-                oldName: [{ required: true, message: '请输入曾用名,没有则填写无', trigger: 'change' },],
+                oldName: [{ required: true, message: '请输入曾用名,没有则填写无', trigger: 'blur' },],
                 phone: [
                     { required: true, message: '请输入移动电话', trigger: 'change' },
                     {
@@ -708,14 +742,14 @@ export default {
                         trigger: "change"
                     }
                 ],
-                birthDay: [{ required: true, message: '请选择出生日期', trigger: 'change', },],
-                party: [{ required: true, message: '请输入党派宗教', trigger: 'change', },],
-                sex: [{ required: true, message: '请选择性别', trigger: 'change', },],
-                marriage: [{ required: true, message: '请选择婚姻状态', trigger: 'change', }],
-                nationality: [{ required: true, message: '请输入国籍', trigger: 'change' },],
-                birthCity: [{ required: true, message: '请输入出生城市', trigger: 'change' }],
-                birthProvince: [{ required: true, message: '请输入出生省份', trigger: 'change' }],
-                highestEducation: [{ required: true, message: '请输入最高学历', trigger: 'change' }],
+                birthDay: [{ required: true, message: '请选择出生日期', trigger: 'blur', },],
+                party: [{ required: true, message: '请输入党派宗教', trigger: 'blur', },],
+                sex: [{ required: true, message: '请选择性别', trigger: 'blur', },],
+                marriage: [{ required: true, message: '请选择婚姻状态', trigger: 'blur', }],
+                nationality: [{ required: true, message: '请输入国籍', trigger: 'blur' },],
+                birthCity: [{ required: true, message: '请输入出生城市', trigger: 'blur' }],
+                birthProvince: [{ required: true, message: '请输入出生省份', trigger: 'blur' }],
+                highestEducation: [{ required: true, message: '请输入最高学历', trigger: 'blur' }],
                 tel: [
                     { required: true, message: '请输入固话', trigger: 'change' },
                     {
@@ -740,9 +774,9 @@ export default {
                         trigger: "change"
                     }
                 ],
-                address: [{ required: true, message: '请输入现居住地址', trigger: 'change' }],
-                costBearers: [{ required: true, message: '请输入费用承担着', trigger: 'change' }],
-                tableOpName: [{ required: true, message: '请输入经办人', trigger: 'change' }],
+                address: [{ required: true, message: '请输入现居住地址', trigger: 'blur' }],
+                costBearers: [{ required: true, message: '请输入费用承担着', trigger: 'blur' }],
+                tableOpName: [{ required: true, message: '请输入经办人', trigger: 'blur' }],
                 tableOpTel: [
                     { required: true, message: '请输入经办人联系方式', trigger: 'change' },
                     {
@@ -751,13 +785,40 @@ export default {
                         trigger: "change"
                     }
                 ],
-                tableDate: [{ required: true, message: '请输入填表时间', trigger: 'change' }],
+                tableDate: [{ required: true, message: '请输入填表时间', trigger: 'blur' }],
+                //证件验证
+
+            },
+            rulesCert: {
+                certNo: [{ required: true, message: '请输入费用承担着', trigger: 'change' }],
+            },
+            rulesCompany: {
+                companyName: [
+                    { required: true, message: '请输入客户公司名称', trigger: 'blur' },
+                ],
+                address: [
+                    { required: true, message: '请输入客户公司地址', trigger: 'blur' },
+                ],
+                postCodes: [
+                    { required: true, message: '请输入客户公司邮编', trigger: 'blur' },
+                ],
             },
             Id: 0,
             token: '',
             userId: 0,
             Status: 0,
             typeStr: '',
+            TypeVisible: false,
+            OperationData: {
+                status: 0,
+                id: 0,
+                companyName: "",
+                address: "",
+                postCodes: "",
+                lastedOpUserId: 0,
+                createUserId: 0,
+                remark: ""
+            },
             //基础信息
             deleClient: {
                 id: 0,
@@ -1002,6 +1063,50 @@ export default {
                 that.$message.error("网络错误,请稍后重试");
             });
         },
+        handleClose(done) {
+            done();
+        },
+        btnAddCom() {
+            this.OperationData = {
+                status: 1,
+                id: 0,
+                companyName: "",
+                address: "",
+                postCodes: "",
+                lastedOpUserId: this.userId,
+                createUserId: this.userId,
+                remark: ""
+            },
+                this.TypeVisible = true;
+            this.typeName = "添加客户公司资料"
+        },
+        AddBtn() {
+            this.$refs.OperationData.validate((valid) => {
+                if (valid) {
+                    var that = this
+                    var url = "/api/CRM/OperationClientCompany"
+                    that.$axios({
+                        method: 'post',
+                        url: url,
+                        headers: {
+                            Authorization: 'Bearer ' + that.token
+                        },
+                        data: that.OperationData
+                    }).then(function (res) {
+                        if (res.data.code == 200) {
+                            that.$message({
+                                message: res.data.msg,
+                                type: 'success'
+                            });
+                            that.CompanySelect();
+                            that.TypeVisible = false;
+                        } else {
+                            that.$message.error(res.data.msg);
+                        }
+                    })
+                }
+            })
+        },
         CompanySelect() {
             var url = "/api/CRM/GetClientCompanyList"
             var that = this
@@ -1131,7 +1236,7 @@ export default {
                             });
                             that.loading = true;
                             setTimeout(() => {
-                                // that.$router.push('/home/HotelData')
+                                that.$router.push('/home/DeleClient')
                             }, 3000);
                         } else {
                             that.$message.error(res.data.msg);
@@ -1145,9 +1250,6 @@ export default {
                 }
             });
         },
-        resetForm(formName) {
-            this.$refs[formName].resetFields();
-        },
         //添加家庭信息
         customerFamilyAdd() {
             this.customerFamily.push({

+ 38 - 27
src/components/Resource/CarData.vue

@@ -187,35 +187,46 @@ export default {
             console.log(item);
         },
         del(index, row) {
-            var url = "/api/Resource/DelCarData"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/Resource/DelCarData"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.carData();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.carData();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 1 - 1
src/components/Resource/CarDataAdd.vue

@@ -42,7 +42,7 @@
                 <el-row>
                     <el-col :span="8">
                         <el-form-item label="联系人" prop="Contact">
-                            <el-input placeholder="单位地址" v-model="addData.Contact">
+                            <el-input placeholder="联系人" v-model="addData.Contact">
                             </el-input>
                         </el-form-item>
                     </el-col>

+ 1 - 1
src/components/Resource/CarDataEdit.vue

@@ -41,7 +41,7 @@
                 <el-row>
                     <el-col :span="8">
                         <el-form-item label="联系人" prop="Contact">
-                            <el-input placeholder="单位地址" v-model="upData.Contact">
+                            <el-input placeholder="联系人" v-model="upData.Contact">
                             </el-input>
                         </el-form-item>
                     </el-col>

+ 38 - 28
src/components/Resource/CountryFeeCost.vue

@@ -176,36 +176,46 @@ export default {
         },
 
         del(index, row) {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/Resource/DelCountryFeeCost"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-            var url = "/api/Resource/DelCountryFeeCost"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
-
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.HotelData();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.HotelData();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 11 - 17
src/components/Resource/CountryFeeCostOperation.vue

@@ -77,9 +77,11 @@
                     </div>
                     <div style="width: 49%;">
                         <el-form-item label="签证费用" label-width="125px" prop="VisaPrice">
-                            <el-input placeholder="签证费用" v-model="addData.VisaPrice">
+                            <el-input-number style="width:100%" v-model="addData.VisaPrice" auto-complete="off"
+                                :precision="2" :controls="false"></el-input-number>
+                            <!-- <el-input placeholder="签证费用" v-model="addData.VisaPrice">
                                 <template slot="append">元</template>
-                            </el-input>
+                            </el-input> -->
                         </el-form-item>
                     </div>
                 </div>
@@ -102,9 +104,8 @@
                     </div>
                     <div style="width: 49%;">
                         <el-form-item label="加急签证费用" label-width="125px" prop="UrgentPrice">
-                            <el-input placeholder="加急签证费用" v-model="addData.UrgentPrice">
-                                <template slot="append">元</template>
-                            </el-input>
+                            <el-input-number style="width:100%" v-model="addData.UrgentPrice" auto-complete="off"
+                                :precision="2" :controls="false"></el-input-number>
                         </el-form-item>
                     </div>
                 </div>
@@ -150,32 +151,25 @@ export default {
 
                 VisaPrice: [
                     { required: true, message: '签证金额不能为空', trigger: 'blur' },
-                    {
-                        pattern: '^([1-9][0-9]*)+(.[0-9]{1,2})?$',
-                        message: "小数部分为0到2位",
-                        trigger: "blur"
-                    }
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
                 ],
                 VisaTime: [
                     { required: true, message: '签证时间不能为空', trigger: 'blur' },
                     {
-                        pattern: '^([1-9][0-9]*)?$',
+                        pattern: '^([0-9][0-9]*)?$',
                         message: "请正确的输入天数",
                         trigger: "blur"
                     }
                 ],
                 UrgentPrice: [
                     { required: true, message: '加急签证金额不能为空', trigger: 'blur' },
-                    {
-                        pattern: '^([1-9][0-9]*)+(.[0-9]{1,2})?$',
-                        message: "小数部分为0到2位",
-                        trigger: "blur"
-                    }
+
+                    { pattern: /^(([1-9]?\d{0,8}(\.\d{1,2})?)|999999999|999999999\.(0){1,2})$/, message: '请输入正确的金额(最多2位小数)' }
                 ],
                 UrgentTime: [
                     { required: true, message: '加急签证时间不能为空', trigger: 'blur' },
                     {
-                        pattern: '^([1-9][0-9]*)?$',
+                        pattern: '^([0-9][0-9]*)?$',
                         message: "请正确的输入天数",
                         trigger: "blur"
                     }

+ 38 - 27
src/components/Resource/LocalGuide.vue

@@ -171,35 +171,46 @@ export default {
             console.log(item);
         },
         del(index, row) {
-            var url = "/api/Resource/DelLocalGuide"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/Resource/DelLocalGuide"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.LocalGuide();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.LocalGuide();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 38 - 27
src/components/Resource/ThreeCode.vue

@@ -139,35 +139,46 @@ export default {
         },
 
         del(index, row) {
-            var url = "/api/Resource/DelThreeCode"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/Resource/DelThreeCode"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.ThreeCode();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.ThreeCode();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 4 - 5
src/components/Resource/ThreeCodeOperation.vue

@@ -188,11 +188,10 @@ export default {
             })
         },
         upData() {
-
-            for (var i = 0; i < this.tableData.length; i++) {
-                if (this.tableData[i].id == parseInt(this.addData.Id)) {
-
-                    this.ThreeCodeData = this.tableData[i];
+            debugger
+            for (var i = 0; i < this.tableData.pageSource.length; i++) {
+                if (this.tableData.pageSource[i].id == parseInt(this.addData.Id)) {
+                    this.ThreeCodeData = this.tableData.pageSource[i];
                     break;
                 }
             }

+ 7 - 14
src/components/system/Company.vue

@@ -35,7 +35,7 @@
                     </el-table-column> -->
                     <el-table-column label="操作">
                         <template slot-scope="scope">
-                            <el-button size="mini" @click="upDate(scope.$index, scope.row)">编辑</el-button>
+                            <el-button size="mini" @click="upDateOp(scope.$index, scope.row)">编辑</el-button>
                             <el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
                         </template>
                     </el-table-column>
@@ -282,8 +282,7 @@ export default {
             this.currentPage = 1;
         },
         //#region  修改操作
-        upDate(index, row) {
-
+        upDateOp(index, row) {
             this.upDataVisible = true;
             this.updata.Id = row.id
             this.updata.CompanyCode = row.companyCode
@@ -299,12 +298,12 @@ export default {
 
         },
         upDateBtn() {
-
-            var that = this
-            that.$refs.updata.validate((valid) => {
+            this.$refs.updata.validate((valid) => {
                 if (valid) {
-
+                    var that = this
                     if (that.updata.Id != 0) {
+                        this.updata.ContactUserId = this.valueUserValue
+                        this.updata.ParentCompanyId = this.valueCompanyValue
                         if (that.updata.CompanyName == "" || that.updata.CompanyName == undefined) {
                             that.$message.error("公司名称不能为空");
                             return
@@ -347,9 +346,6 @@ export default {
                             }
                         })
                     }
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             }).catch(function (error) {
                 that.$message.error("网络错误,请稍后重试");
@@ -362,7 +358,7 @@ export default {
         //#endregion
         del(index, row) {
 
-            this.$confirm('此操作将取消订单, 是否继续?', '提示', {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 type: 'warning'
@@ -475,9 +471,6 @@ export default {
                             that.$message.error('添加失败!');
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             }).catch(function (error) {
                 that.$message.error("网络错误,请稍后重试");

+ 7 - 10
src/components/system/Department.vue

@@ -286,13 +286,17 @@ export default {
         },
         //#region  修改操作
         upDate(index, row) {
-
             this.upDepVisible = true;
             this.upData.Id = row.id
             this.upData.CompanyId = row.companyId
             this.upData.DepCode = row.depCode
             this.upData.DepName = row.depName
-            this.upData.ParentDepId = row.parentDepId
+            if (row.parentDepId == 0) {
+                this.upData.ParentDepId = ''
+            } else {
+                this.upData.ParentDepId = row.parentDepId
+            }
+
             this.upData.Remark = row.remark
         },
         upDateBtn() {
@@ -336,9 +340,6 @@ export default {
                             that.$message.error('修改失败!');
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             }).catch(function (error) {
                 that.$message.error("网络错误,请稍后重试");
@@ -351,7 +352,7 @@ export default {
         //#endregion
         del(index, row) {
 
-            this.$confirm('此操作将取消订单, 是否继续?', '提示', {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 type: 'warning'
@@ -369,7 +370,6 @@ export default {
                     }
                 }).then(function (res) {
                     console.log(res)
-
                     if (res.data.code == 200) {
                         that.$message({
                             type: 'success',
@@ -443,9 +443,6 @@ export default {
                             that.$message.error('添加失败!');
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             }).catch(function (error) {
                 that.$message.error("网络错误,请稍后重试");

+ 4 - 10
src/components/system/JobPost.vue

@@ -56,7 +56,7 @@
                             </el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item label="上级部门" prop="ParentDepId">
+                    <el-form-item label="所属部门" prop="DepId">
                         <el-select v-model="addData.DepId" placeholder="所属部门">
                             <el-option v-for="item in depData" :key="item.id" :label="item.depName" :value="item.id">
                             </el-option>
@@ -87,7 +87,7 @@
                             </el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item label="上级部门" prop="DepId">
+                    <el-form-item label="所属部门" prop="DepId">
                         <el-select v-model="upData.DepId" placeholder="所属部门">
                             <el-option v-for="item in depData" :key="item.id" :label="item.depName" :value="item.id">
                             </el-option>
@@ -308,9 +308,6 @@ export default {
                             that.$message.error('修改失败!');
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             })
         },
@@ -321,7 +318,7 @@ export default {
         //#endregion
         del(index, row) {
 
-            this.$confirm('此操作将取消订单, 是否继续?', '提示', {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 type: 'warning'
@@ -345,7 +342,7 @@ export default {
                             type: 'success',
                             message: '删除成功!'
                         });
-                        that.Department();
+                        that.jobPost();
                     } else {
                         that.$message.error("删除失败,请稍后重试");
                     }
@@ -403,9 +400,6 @@ export default {
                             that.$message.error('添加失败!');
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             })
         },

+ 42 - 31
src/components/system/SetData.vue

@@ -92,7 +92,10 @@ export default {
             AddSetDataTypeVisible: false,
             rules: {
                 name: [
-                    { required: true, message: '请输数据类型名称', trigger: 'blur' },
+                    { required: true, message: '板块名称', trigger: 'blur' },
+                ],
+                sTid: [
+                    { required: true, message: '请选择数据类型', trigger: 'blur' },
                 ],
             },
             setDataType: [
@@ -254,43 +257,51 @@ export default {
                             that.$message.error(res.data.msg);
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             })
         },
         //点击删除
         del(index, row) {
-            var url = "/api/System/DelSetData"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/System/DelSetData"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.SetData();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.SetData();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 38 - 30
src/components/system/SetDataType.vue

@@ -218,43 +218,51 @@ export default {
                             that.$message.error(res.data.msg);
                         }
                     })
-                } else {
-                    this.$message.error('请完善信息在保存!');
-                    return false;
                 }
             })
         },
         //点击删除
         del(index, row) {
-            var url = "/api/System/DelSetDataType"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    Id: row.id,
-                    DeleteUserId: this.userId
-                }
-            }).then(function (res) {
-                console.log(res)
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/System/DelSetDataType"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        Id: row.id,
+                        DeleteUserId: this.userId
+                    }
+                }).then(function (res) {
+                    console.log(res)
 
-                if (res.data.code == 200) {
+                    if (res.data.code == 200) {
 
-                    that.$message({
-                        message: '删除成功',
-                        type: 'success'
-                    });
-                    that.SetDataType();
-                } else {
-                    that.$message.error('删除失败!');
-                }
-                that.loading = false
-            }).catch(function (error) {
-                that.loading = false
-                that.$message.error("网络错误,请稍后重试");
+                        that.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        });
+                        that.SetDataType();
+                    } else {
+                        that.$message.error('删除失败!');
+                    }
+                    that.loading = false
+                }).catch(function (error) {
+                    that.loading = false
+                    that.$message.error("网络错误,请稍后重试");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
             });
         }
     },

+ 2 - 2
src/main.js

@@ -9,8 +9,8 @@ import './assets/icon/iconfont.css'
 import store from './store/index.js';
 
 import axios from 'axios';
-axios.defaults.baseURL = 'http://132.232.92.186:8888';
-// axios.defaults.baseURL = 'http://localhost:5256/';
+//axios.defaults.baseURL = 'http://132.232.92.186:8888';
+axios.defaults.baseURL = 'http://localhost:5256/';
 import { Message } from "element-ui";
 Vue.prototype.$message = Message
 Vue.prototype.$axios = axios;