Commit 64383881 by 谢明辉

a

1 parent 2c4365cf
......@@ -39,13 +39,13 @@
<el-col :span="8">
<el-form-item label="客户名称" prop="customer_unid">
<el-select :disabled="disabled_list[0]==1" class="width-220" v-model="form.customer_unid" clearable filterable placeholder="客户名称">
<el-option v-for="(item,index) in customer_unid_selected_data" :key="item.customer_unid" :label="item.customer_name" :value="item.customer_unid">
<el-option v-for="(item) in customer_unid_selected_data" :key="item.customer_unid" :label="item.customer_name" :value="item.customer_unid">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目所在地" prop="province_value">
<el-form-item id="province" label="项目所在地" prop="province_value">
<el-select :disabled="disabled_list[0]==1" style="width:108px" v-model="form.province_value" clearable placeholder="省" @change="get_cities()">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.name" :value="item.province_unid + '#' + item.name">
</el-option>
......@@ -218,7 +218,7 @@
<el-row style="text-align:left">
<el-col :span="8">
<el-form-item label="维保服务期" prop="guarantee_date">
<el-date-picker :disabled="disabled_list[0]==1" style="width:300px" v-model="guarantee_date" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :unlink-panels="true">
<el-date-picker :disabled="disabled_list[0]==1" style="width:220px;padding:0 0 0 10px" v-model="guarantee_date" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :unlink-panels="true">
</el-date-picker>
</el-form-item>
</el-col>
......@@ -238,7 +238,7 @@
<el-row style="text-align:left">
<el-col :span="8">
<el-form-item label="备注" prop="contract_note">
<el-input :disabled="disabled_list[0]==1" v-model="form.contract_note" type="textarea" :rows="5" style="width:300px"></el-input>
<el-input :disabled="disabled_list[0]==1" v-model="form.contract_note" type="textarea" :rows="5" style="width:220px"></el-input>
</el-form-item>
</el-col>
<el-col :span="9">
......@@ -390,7 +390,6 @@
</el-form-item>
</el-row>
</el-form>
</el-form>
<el-form :inline="true" :model="final_acceptancs_form" class="demo-form-inline" label-width="100px" :rules="acceptanc_form_rules2" ref="final_acceptancs_form" :disabled="disabled_list[3]==1">
<el-row>
<el-col :span="8">
......@@ -640,12 +639,12 @@
</div>
</template>
<script>
const twodecimalrule = {
const twodecimalrule = {
pattern: /((^[1-9]\d*)|^0)(\.\d{2})$/,
message: "请输入数字并保留两位小数",
trigger: "blur"
};
export default {
};
export default {
name: "contract_information",
data() {
return {
......@@ -656,9 +655,9 @@ export default {
acceptancs_appendix_list: [],
first_acceptancs_appendix_list: [],
operate_type: [0, 0, 0, 0, 0, 0], //整个页面的操作类型,一共6个表单,0表示新增,1表示修改
code_base_url: disparch_data.code_base_url,
contract_base_url: disparch_data.contract_base_url,
auth_base_url: disparch_data.auth_base_url,
code_base_url: this.$disparch_data.code_base_url,
contract_base_url: this.$disparch_data.contract_base_url,
auth_base_url: this.$disparch_data.auth_base_url,
contract_unid_selected_data: [], //合同编号数据数组
salesperson_unid_selected_data: [], //销售人员数据数组
project_unid_selected_data: [], //项目名称数据数组
......@@ -1139,8 +1138,6 @@ export default {
// methods++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
methods: {
download_file(f) {
console.log(f);
window.open(f.url);
},
// upload+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1602,8 +1599,6 @@ export default {
appendUrl,
data: a
}).then(res => {
console.log(data[index]);
if (res.data.ecode == "200") {
this.$message({
duration: 1000,
......@@ -1639,7 +1634,6 @@ export default {
) {
this.payment_type_tag = 0;
}
debugger;
data.splice(index, 1);
if (appendUrl == "delivers") {
this.delivers_form = {
......@@ -2111,6 +2105,16 @@ export default {
"province_value",
response.data.province + "#" + response.data.province_name
);
} else if (response.data.province_name) {
this.provinces.forEach(e => {
if (e.name === response.data.province_name) {
this.$set(
this.form,
"province_value",
e.province_unid + "#" + response.data.province_name
);
}
});
}
if (response.data.city) {
this.get_cities();
......@@ -2119,6 +2123,30 @@ export default {
"city_value",
response.data.city + "#" + response.data.city_name
);
} else if (response.data.city_name && this.form.province_value) {
this.$Axios({
method: "get",
url:
this.code_base_url +
"countries/0E229CD043/provinces/" +
this.get_province_unid +
"/cities"
})
.then(r => {
this.cities = r.data.list_data;
this.cities.forEach(e => {
if (e.name === response.data.city_name) {
this.$set(
this.form,
"city_value",
e.city_unid + "#" + response.data.city_name
);
}
});
})
.catch(err => {
console.log(err.message);
});
}
// if (response.data.county) {
// this.get_counties();
......@@ -2268,7 +2296,6 @@ export default {
response.data.bad_amount.toFixed(2)
);
}
debugger;
this.contract_appendix_list = [];
if (response.data.appendix_list) {
for (let i = 0; i < response.data.appendix_list.length; i++) {
......@@ -2857,8 +2884,6 @@ export default {
watch: {
//点击合同编号后对路由进行push,但不会刷新当前页面,需要通过watch 路由变化进行刷新
$route(to, from) {
console.log(1);
this.payments_data = [];
this.rebacks_data = [];
this.receipts_data = [];
......@@ -2873,7 +2898,7 @@ export default {
}
}
}
};
};
</script>
<style scoped>
.add_button {
......@@ -2941,4 +2966,7 @@ span:hover {
#contract_info >>> thead > tr > th {
background-color: lightgray;
}
#province {
margin-right: 0;
}
</style>
<template>
<div id="login_box" @click.ctrl.meta.alt="manager">
<el-row type="flex" justify="center" align="middle" style="height:80%">
<el-card class="box-card" shadow="hover" style="width:25%">
<el-card class="box-card" shadow="hover" style="min-width:25%">
<div slot="header" style="text-align:center" class="clearfix">
<span style="font-size:24px">合同管理系统</span>
</div>
......@@ -33,15 +33,15 @@
</template>
<script>
export default {
export default {
name: "login",
data() {
return {
password_type: "password",
view_password: "icon i-password-not-view",
contract_base_url: disparch_data.contract_base_url,
code_base_url: disparch_data.code_base_url,
auth_base_url: disparch_data.auth_base_url,
contract_base_url: this.$disparch_data.contract_base_url,
code_base_url: this.$disparch_data.code_base_url,
auth_base_url: this.$disparch_data.auth_base_url,
net_error: false,
form: {
username: "",
......@@ -86,11 +86,14 @@ export default {
});
} else {
window.localStorage.setItem("username", this.form.username);
sessionStorage.setItem("login_check",true)
sessionStorage.setItem("user_unid",res.data.user_unid)
sessionStorage.setItem("rtoken",res.data.rtoken)
sessionStorage.setItem("user_roles",JSON.stringify(res.data.roles));
sessionStorage.setItem("user_name",res.data.user_name)
sessionStorage.setItem("login_check", true);
sessionStorage.setItem("user_unid", res.data.user_unid);
sessionStorage.setItem("rtoken", res.data.rtoken);
sessionStorage.setItem(
"user_roles",
JSON.stringify(res.data.roles)
);
sessionStorage.setItem("user_name", res.data.user_name);
this.get_provinces();
this.get_contract_state_data();
this.get_contract_type_data();
......@@ -309,8 +312,8 @@ export default {
});
},
manager() {
sessionStorage.setItem('manager','1')
sessionStorage.setItem('login_check','1')
sessionStorage.setItem("manager", "1");
sessionStorage.setItem("login_check", "1");
this.get_provinces();
this.get_contract_state_data();
this.get_contract_type_data();
......@@ -344,14 +347,14 @@ export default {
mounted() {
this.form.username = localStorage.getItem("username");
}
};
};
</script>
<style scoped>
#login_box {
height: 100%;
}
#fankui{
#fankui {
text-align: center;
margin-top: 0;
}
......
......@@ -22,12 +22,25 @@
<el-button type="primary" @click="project_name_add">添加</el-button>
</el-col>
</el-row>
<el-row style="border-bottom:1px solid rgb(235, 238, 245);padding-bottom:18px">
<el-col :span="6">
<el-button class="add_button" type="primary" @click="add_login_user">添加登录用户</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-button class="add_button" type="primary" @click="login_user_dialog_show = true">添加登录用户</el-button>
<el-button class="add_button" type="primary" @click="product_line_type">产品线类型</el-button>
</el-col>
<el-col :span="6">
<el-button class="add_button" type="primary" @click="contract_statu">合同状态</el-button>
</el-col>
<el-col :span="6">
<el-button class="add_button" type="primary" @click="contract_type">合同性质</el-button>
</el-col>
<el-col :span="6">
<el-button class="add_button" type="primary" @click="amount_statu">账款状态</el-button>
</el-col>
</el-row>
<el-dialog id="login_user_dialog" title="添加登录户" :visible.sync="login_user_dialog_show" width="30%" :show-close="false">
<el-form :model="login_user_form" label-width="100px" label-position="left" :rules="login_user_form_rules" ref="login_user_form">
<el-form-item label="用户类型" prop="role_unid">
......@@ -43,30 +56,53 @@
<el-input v-model="login_user_form.name" placeholder="姓名" style="width:100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="login_user_dialog_cancel()">取 消</el-button>
<el-button type="primary" @click="login_user_dialog_confirm()">确 定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="add_dialog_show" width="30%" :show-close="false" style="max-height:800px">
<el-input v-model="add_data.text"></el-input>
<el-button type="primary" style="width:100%;margin-bottom:20px;margin-top:5px" @click="add_to_database">添加</el-button>
<el-table :data="add_data.data" highlight-current-row border>
<el-table-column label="名称" prop="name" min-width="30%" align="center">
</el-table-column>
<el-table-column label="码" prop="code" min-width="30%" align="center">
</el-table-column>
<el-table-column label="操作" min-width="20%" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="delete_code(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</el-card>
</template>
<script>
export default {
export default {
name: "manage",
data() {
return {
add_dialog_show: false,
login_user_dialog_show: false,
code_base_url: disparch_data.code_base_url,
contract_base_url: disparch_data.contract_base_url,
auth_base_url: disparch_data.auth_base_url,
code_base_url: this.$disparch_data.code_base_url,
contract_base_url: this.$disparch_data.contract_base_url,
auth_base_url: this.$disparch_data.auth_base_url,
contract_unid: null,
customer_name: null,
salesperson: null,
project_name: null,
add_data: {
text: null,
data: [],
url: null
},
roles: [],
login_user_form: {
role_unid: "",
......@@ -97,6 +133,66 @@ export default {
};
},
methods: {
// -----------------------
product_line_type() {
this.add_data.url = this.code_base_url + "custom/cates/4FC51AD3C9/codes";
this.get_data(this.add_data.url);
},
contract_statu() {
this.add_data.url = this.code_base_url + "custom/cates/13BEFACBCF/codes";
this.get_data(this.add_data.url);
},
contract_type() {
this.add_data.url = this.code_base_url + "custom/cates/8EC31D08A0/codes";
this.get_data(this.add_data.url);
},
amount_statu() {
this.add_data.url = this.code_base_url + "custom/cates/42407C5EF2/codes";
this.get_data(this.add_data.url);
},
delete_code(data) {
this.$Axios({
method:'delete',
url:this.add_data.url + '/' + data.unid
}).then(res=>{
this.show_message('删除成功','success')
this.get_data(this.add_data.url)
})
},
get_data(url) {
this.$Axios.get(url).then(res => {
if (res.data.list_data) {
this.add_data.data = res.data.list_data;
this.add_dialog_show = true;
}
});
},
add_to_database() {
var code = 0;
this.add_data.data.forEach(e => {
if (e.code > code) {
code = e.code;
}
});
code++;
this.$Axios({
method: "post",
url: this.add_data.url,
data: {
name: this.add_data.text,
note: this.add_data.text,
code: code
}
}).then(res => {
if (res.data.code == code) {
this.show_message("添加成功", "success");
this.add_data.text = null;
this.get_data(this.add_data.url);
}
});
},
// -----------------------
contract_unid_add() {
if (this.contract_unid) {
this.$Axios({
......@@ -211,7 +307,7 @@ export default {
duration: 3000
});
},
get_roles() {
add_login_user() {
this.$Axios({
method: "get",
url: this.auth_base_url + "roles"
......@@ -219,9 +315,13 @@ export default {
.then(response => {
if (response.data.list_data) {
this.roles = response.data.list_data;
this.login_user_dialog_show = true;
} else {
this.show_message("失败", "error");
}
})
.catch(err => {
this.show_message("失败", "error");
console.log(err.message);
});
},
......@@ -273,10 +373,8 @@ export default {
});
}
},
created() {
this.get_roles();
}
};
created() {}
};
</script>
<style scoped>
......@@ -289,7 +387,8 @@ export default {
.add_button {
display: inline-block;
font-size: 18px;
width: 80%;
width: 75%;
min-width: 200px;
margin-top: 20px;
}
......
......@@ -14,14 +14,14 @@
<i class="icon i-file"></i>
<span slot="title">合同信息</span>
</el-menu-item>
<el-menu-item index="/nav/manage" v-show="management">
<i class="icon i-setting"></i>
<span slot="title">后台管理</span>
</el-menu-item>
<el-menu-item index="/nav/user">
<i class="icon i-user"></i>
<span slot="title">个人管理</span>
</el-menu-item>
<el-menu-item index="/nav/manage" v-show="management">
<i class="icon i-setting"></i>
<span slot="title">后台管理</span>
</el-menu-item>
<el-menu-item index="" @click="exit">
<i class="icon i-login"></i>
<span slot="title">退出</span>
......@@ -39,7 +39,7 @@
</template>
<script>
export default {
export default {
name: "HelloWorld",
data() {
return {
......@@ -47,7 +47,7 @@ export default {
username: "",
department: "",
collapse: true,
contract_show: true,
contract_show: true
};
},
......@@ -77,27 +77,33 @@ export default {
}
},
created() {
if (sessionStorage.getItem("user_roles") != "null" && sessionStorage.getItem("user_roles")) {
if (
sessionStorage.getItem("user_roles") != "null" &&
sessionStorage.getItem("user_roles")
) {
var roles = JSON.parse(sessionStorage.getItem("user_roles"));
for (let i = 0; i < roles.length; i++) {
const e = roles[i];
if (e.role_unid == "91d5185d47e3bad099e17570b0dd0ed2") {
this.management = true;
}
}
}else{
} else {
this.contract_show = false;
}
if (sessionStorage.getItem("user_name") === "Admin") {
this.management = true;
}
if (sessionStorage.getItem("manager")) {
this.management = true;
this.contract_show = true;
}
}
};
};
</script>
<style>
.el-container > .el-main {
min-width: 1120px;
text-align: center;
padding-top: 0;
padding-left: 0;
......@@ -106,10 +112,10 @@ export default {
}
.el-container,
.el-aside {
min-width: 167px;
height: 100%;
}
.el-aside > .el-menu {
height: 100%;
}
</style>
......@@ -316,12 +316,12 @@
</template>
<script>
const twodecimalrule = {
const twodecimalrule = {
pattern: /((^[1-9]\d*)|^0)(\.\d{2})$/,
message: "请输入数字并保留两位小数",
trigger: "blur"
};
export default {
};
export default {
name: "search",
data() {
return {
......@@ -330,8 +330,8 @@ export default {
provinces: [],
cities: [],
counties: [],
code_base_url: disparch_data.code_base_url,
contract_base_url: disparch_data.contract_base_url,
code_base_url: this.$disparch_data.code_base_url,
contract_base_url: this.$disparch_data.contract_base_url,
month_list: [
"01",
"02",
......@@ -405,8 +405,9 @@ export default {
},
computed: {
year_list: function() {
var a = new Date().getFullYear();
var arr = [];
for (let i = 2000; i < 2041; i++) {
for (let i = a; i >= 2000; i--) {
arr.push(i);
}
return arr;
......@@ -565,27 +566,27 @@ export default {
});
}
},
get_counties() {
// this.search_form.county = "";
if (this.search_form.province && this.search_form.city) {
this.$Axios({
method: "get",
url:
this.code_base_url +
"countries/0E229CD043/provinces/" +
this.search_form.province +
"/cities/" +
this.search_form.city +
"/counties"
})
.then(response => {
this.counties = response.data.list_data;
})
.catch(err => {
console.log(err.message);
});
}
},
// get_counties() {
// // this.search_form.county = "";
// if (this.search_form.province && this.search_form.city) {
// this.$Axios({
// method: "get",
// url:
// this.code_base_url +
// "countries/0E229CD043/provinces/" +
// this.search_form.province +
// "/cities/" +
// this.search_form.city +
// "/counties"
// })
// .then(response => {
// this.counties = response.data.list_data;
// })
// .catch(err => {
// console.log(err.message);
// });
// }
// },
get_list_data() {
var a = this.search_form;
a.offset = this.offset;
......@@ -643,12 +644,21 @@ export default {
},
commit() {
this.$refs["search_form"].validate(valid => {
if (valid) {
this.current_page = 1;
sessionStorage.setItem(
"search_condition",
JSON.stringify(this.search_form)
);
this.get_list_data();
}else {
this.$message({
type:'warning',
message:'请检查数据格式是否正确'
})
}
});
},
page_change(val) {
this.search_form = JSON.parse(sessionStorage.getItem("search_condition"));
......@@ -727,7 +737,7 @@ export default {
this.get_product_line_type_data();
}
}
};
};
</script>
<style scoped>
......
......@@ -24,15 +24,17 @@
</el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" @click="submitForm('password_form')">提交</el-button>
<el-button @click="resetForm('password_form')">重置</el-button>
<el-button type="warning" @click="resetForm('password_form')">重置</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
export default {
export default {
name: "user",
data() {
return {
......@@ -42,7 +44,7 @@ export default {
odd_password_view: "icon i-password-not-view",
rtoken: "",
user_unid: "",
auth_base_url: disparch_data.auth_base_url,
auth_base_url: this.$disparch_data.auth_base_url,
password_form: {
odd_password: "",
new_password: "",
......@@ -56,8 +58,8 @@ export default {
},
new_password: [
{
pattern: /^[A-Za-z\d]{6,}$/,
message: "密码至少6位",
pattern: /^[A-Za-z0-9\x20-\x7f]{6,16}$/,
message: "密码至少6位,至多16位",
trigger: "blur"
},
{
......@@ -76,8 +78,8 @@ export default {
],
check_password: [
{
pattern: /^[A-Za-z\d]{6,}$/,
message: "密码至少6位",
pattern: /^[A-Za-z0-9\x20-\x7f]{6,16}$/,
message: "密码至少6位,至多16位",
trigger: "blur"
},
{
......@@ -156,7 +158,7 @@ export default {
this.user_unid = sessionStorage.getItem("user_unid");
}
}
};
};
</script>
......
......@@ -9,7 +9,6 @@ import CollapseTransition from 'element-ui/lib/transitions/collapse-transition';
import 'element-ui/lib/theme-chalk/index.css'
import '../static/city-data'
// import "./mock"
import '../static/disparch'
import './assets/icons/iconfont.css'
import 'babel-polyfill'
......@@ -76,6 +75,23 @@ Axios.interceptors.response.use((response) => {
return Promise.reject(err);
});
{
if (window.location.host == 'localhost:8089') {
Vue.prototype.$disparch_data = {
code_base_url: "http://192.168.9.162:20080/api/v1/codes/",
contract_base_url: "http://192.168.9.162:20080/api/v1/financial/contracts/",
auth_base_url: "http://192.168.9.162:20080/api/v1/auth/"
}
} else {
var url = window.location.host;
Vue.prototype.$disparch_data = {
code_base_url: "http://" + url + "/api/v1/codes/",
contract_base_url: "http://" + url + "/api/v1/financial/contracts/",
auth_base_url: "http://" + url + "/api/v1/auth/"
}
}
}
new Vue({
......
disparch_data = {
code_base_url: "http://192.168.9.162:20080/api/v1/codes/",
contract_base_url: "http://192.168.9.162:20080/api/v1/financial/contracts/",
auth_base_url: "http://192.168.9.162:20080/api/v1/auth/"
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!