Commit 666e1ba2 by 谢明辉

a

1 parent c031fff4
......@@ -20,6 +20,7 @@
html,
body,
#app {
min-height: 700px;
height: 100%;
}
</style>
......@@ -307,6 +307,7 @@
</el-table-column>
<el-table-column label="操作" width="140" align="center">
<template slot-scope="scope">
<el-button-group>
<el-button @click.native.prevent="payment_data_modify(scope.$index, payments_data)" type="primary" size="mini" round :disabled="disabled_list[0]==1">
修改
......@@ -948,6 +949,9 @@
computed: {
// 账款状态
get_amount_state() {
if (this.form.amount_state_unid) {
return this.form.amount_state_unid;
}
var weibao_code = "";
this.contract_type_data.forEach(e => {
e.name == "维保" ? (weibao_code = e.code) : null;
......@@ -1194,7 +1198,9 @@
for (let i = 0; i < this.rebacks_data.length; i++) {
const e = this.rebacks_data[i];
if (e.actual_reback_amount) {
total = this.$Numeral(total).add(e.actual_reback_amount).value();
total = this.$Numeral(total)
.add(e.actual_reback_amount)
.value();
}
}
return total.toFixed(2);
......@@ -1207,22 +1213,33 @@
now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
for (let i = 0; i < this.payments_data.length; i++) {
const e = this.payments_data[i];
if (this.date_diff(now_date, this.get_pay_date(i)) > 0) {
total = this.$Numeral(total).add(this.get_pay_amount(i)).value();
if (e.payment_type != "100001") {
if (this.date_diff(now_date, this.get_pay_date(i)) > 0) {
total = this.$Numeral(total)
.add(this.get_pay_amount(i))
.value();
}
} else {
if (this.form.contract_type != "40004") {
total = this.$Numeral(total)
.add(this.get_pay_amount(i))
.value();
} else if (this.date_diff(now_date, this.get_pay_date(i)) > 0) {
total = this.$Numeral(total)
.add(this.get_pay_amount(i))
.value();
}
}
}
return total.toFixed(2);
},
// 应收账款余额
total_leave_amount: function() {
var a = this.$Numeral(
this.total_receive_amount ? this.total_receive_amount : 0
)
.subtract(this.total_reback_amount ? this.total_reback_amount : 0)
.subtract(this.form.deduct_amount ? this.form.deduct_amount : 0)
.subtract(this.form.stop_amount ? this.form.stop_amount : 0)
.subtract(this.form.exemptions_amount ? this.form.exemptions_amount : 0)
.subtract(this.form.bad_amount ? this.form.bad_amount : 0)
.value();
// if (isNaN(a)) {
// return null;
......@@ -1232,6 +1249,14 @@
},
// 逾期天数
over_days_unid: function() {
var total = this.$Numeral(
this.total_reback_amount ? this.total_reback_amount : 0
)
.add(this.bad_amount ? this.bad_amount : 0)
.add(this.deduct_amount ? this.deduct_amount : 0)
.add(this.stop_amount ? this.stop_amount : 0)
.add(this.exemptions_amount ? this.exemptions_amount : 0)
.value();
var pay_date = "";
var now = new Date();
var now_date =
......@@ -1246,7 +1271,7 @@
.add(pay_amount)
.value();
var a = this.date_diff(now_date, pay_date);
if (a > 0 && (amount > this.total_reback_amount && a > days)) {
if (a > 0 && (amount > total && a > days)) {
days = a;
}
}
......@@ -1526,8 +1551,7 @@
var receipt_propority = 0;
if (this.form.contract_amount) {
receipt_propority = (
this.receipts_data[index].receipt_amount *
100 /
(this.receipts_data[index].receipt_amount * 100) /
this.form.contract_amount
).toFixed(2);
}
......@@ -1537,8 +1561,8 @@
var reback_propority = 0;
if (this.form.contract_amount) {
reback_propority =
this.rebacks_data[index].actual_reback_amount /
this.form.contract_amount *
(this.rebacks_data[index].actual_reback_amount /
this.form.contract_amount) *
100;
}
return parseFloat(reback_propority).toFixed(2);
......@@ -2116,10 +2140,15 @@
* 根据不同的付款类型计算他们的付款日期
*/
get_pay_date(index) {
debugger;
var date = "";
var type = this.payments_data[index].payment_type;
var days = this.payments_data[index].days;
if (type == "100001" && this.form.sign_date) {
if (this.form.contract_type == "40004") {
if (this.guarantee_date) {
date = this.date_add_days(this.start_guarantee_date, days);
}
} else if (type == "100001" && this.form.sign_date) {
date = this.date_add_days(this.form.sign_date, days);
} else if (
(type == "100002" || type == "100004") &&
......@@ -2148,6 +2177,12 @@
var amount = this.$Numeral(0).value();
if (this.form.contract_amount > 0) {
amount = this.$Numeral(this.form.contract_amount)
.subtract(this.form.bad_amount ? this.form.bad_amount : 0)
.subtract(this.form.deduct_amount ? this.form.deduct_amount : 0)
.subtract(this.form.stop_amount ? this.form.stop_amount : 0)
.subtract(
this.form.exemptions_amount ? this.form.exemptions_amount : 0
)
.multiply(this.payments_data[index].payment_propority)
.value();
}
......
......@@ -56,6 +56,9 @@
<el-col :span="6">
<el-button class="add_button" type="primary" @click="login_user_dialog_show = !login_user_dialog_show">用户管理</el-button>
</el-col>
<el-col :span="6">
<el-button class="add_button" type="primary" @click="modify_salesperson_dialog_show = !modify_salesperson_dialog_show">删除销售员</el-button>
</el-col>
</el-row>
<el-dialog :visible.sync="login_user_dialog_show" width="30%" :show-close="false">
<el-tabs type="border-card" v-show="login_user_dialog_show" style="margin:auto">
......@@ -129,6 +132,27 @@
</el-table-column> -->
</el-table>
</el-dialog>
<el-dialog :visible.sync="modify_salesperson_dialog_show" width="30%" :show-close="false" style="">
<el-table :data="all_salesperson" style="max-height:350px;overflow-y:auto;z-index:inherit">
<el-table-column label="姓名" prop="name" min-width="30%" align="center">
</el-table-column>
<el-table-column label="创建时间" prop="create_dt" min-width="30%" align="center">
<template slot-scope="scope">
{{get_create_date(scope.row)}}
</template>
</el-table-column>
<el-table-column label="操作" min-width="20%" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.is_active == true" type="text" @click="modify_salesperson(scope.row,false)">
删除
</el-button>
<el-button v-if="scope.row.is_active == false" type="text" @click="modify_salesperson(scope.row,true)">
恢复
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</el-card>
</template>
......@@ -143,6 +167,8 @@
salesperson_name_data: [],
project_name_data: [],
users_data: [],
all_salesperson: [],
modify_salesperson_dialog_show: false,
add_dialog_show: false,
login_user_dialog_show: false,
code_base_url: this.$disparch_data.code_base_url,
......@@ -194,13 +220,12 @@
}
};
},
methods: {
get_create_date(row) {
return row.create_dt.replace("T", " ");
},
//search
/**
* 可以在新增前四个选项是弹出提示框,
* 列出已存在的,当键入已存在合同就会出现。
* 没什么用处啊。。。
*/
search_contract_unid(queryString, cb) {
var contract_unid_data = this.contract_unid_data;
var results = queryString
......@@ -216,7 +241,7 @@
cb(results);
},
search_salesperson(queryString, cb) {
var salesperson_name_data = this.salesperson_name_data;
var salesperson_name_data = this.all_salesperson;
var results = queryString
? salesperson_name_data.filter(this.salesperson_filter(queryString))
: salesperson_name_data;
......@@ -264,8 +289,8 @@
this.$Axios({
method: "get",
url: this.contract_base_url + "codes",
params:{
date:Date()
params: {
date: Date()
}
})
.then(response => {
......@@ -275,13 +300,46 @@
// console.log(err.message);
});
},
get_all_salesperson() {
this.$Axios({
method: "get",
url: this.auth_base_url + "users",
params: {
norm_type: "employee",
date: Date()
}
})
.then(response => {
this.salesperson_name_data = response.data.list_data;
this.$Axios({
method: "get",
url: this.auth_base_url + "users",
params: {
is_active: false,
norm_type: "employee",
date: Date()
}
})
.then(res => {
this.all_salesperson = this.salesperson_name_data.concat(
res.data.list_data
);
})
.catch(err => {
console.log(err);
});
})
.catch(err => {
// console.log(err.message);
});
},
get_salesperson() {
this.$Axios({
method: "get",
url: this.auth_base_url + "users",
params: {
norm_type: "employee",
date:Date()
date: Date()
}
})
.then(response => {
......@@ -295,8 +353,8 @@
this.$Axios({
method: "get",
url: this.contract_base_url + "customers",
params:{
date:Date()
params: {
date: Date()
}
})
.then(response => {
......@@ -310,8 +368,8 @@
this.$Axios({
method: "get",
url: this.contract_base_url + "projects",
params:{
date:Date()
params: {
date: Date()
}
})
.then(response => {
......@@ -400,7 +458,7 @@
url: this.auth_base_url + "users",
params: {
norm_type: "login",
date:Date()
date: Date()
}
})
.then(res => {
......@@ -483,7 +541,7 @@
if (response.data.name) {
this.salesperson = null;
this.show_message("添加成功", "success");
this.get_salesperson();
this.get_all_salesperson();
}
})
.catch(err => {
......@@ -494,6 +552,22 @@
this.show_message("请填写信息", "info");
}
},
modify_salesperson(row, is_active) {
this.$Axios({
method: "post",
url: this.auth_base_url + "users/" + row.user_unid,
data: {
is_active: is_active,
date: Date()
}
})
.then(res => {
this.get_all_salesperson();
})
.catch(err => {
console.log(err);
});
},
project_name_add() {
if (this.project_name) {
this.$Axios({
......@@ -534,8 +608,8 @@
this.$Axios({
method: "get",
url: this.auth_base_url + "roles",
params:{
date:Date()
params: {
date: Date()
}
})
.then(response => {
......@@ -663,9 +737,10 @@
this.get_roles();
this.get_users();
this.get_contract_unid();
this.get_salesperson();
// this.get_salesperson();
this.get_customers();
this.get_projects();
this.get_all_salesperson();
},
mounted() {
this.change_dialog();
......@@ -733,7 +808,9 @@
background-color: rgba(0, 0, 0, 0.2);
color: black;
}
#manage >>>.el-table--border::after, .el-table--group::after, .el-table::before{
#manage >>> .el-table--border::after,
.el-table--group::after,
.el-table::before {
content: none;
}
</style>
......
<template>
<el-container id="nav">
<el-aside width="10%">
<el-menu :default-active="$route.path" class="el-menu-vertical-demo" router :collapse="false" text-color="white" background-color="black" active-text-color="#ffd04b">
<el-aside width="10%" style="background-color:black;position:relative">
<el-menu :default-active="$route.path" class="el-menu-vertical-demo" router :collapse="false" text-color="white" background-color="rgba(0,0,0,0)" active-text-color="#ffd04b">
<div style="height:20%;text-align:center">
<img src="../assets/logo.png" alt="" style="width:100%;height:26%">
</div>
......@@ -27,6 +27,14 @@
<span slot="title">退出</span>
</el-menu-item>
</el-menu>
<div class="poem">
<div class="content" v-for="(item,index) in poem.sentences" :key="index" v-if="item">
{{item}}
</div>
<div class="content" v-if="poem.author">
丨丨{{poem.author}}
</div>
</div>
</el-aside>
<el-main :style="color">
......@@ -43,6 +51,10 @@
name: "HelloWorld",
data() {
return {
poem: {
author: "",
sentences: [,]
},
color: "background-color: lightblue",
management: false,
username: "",
......@@ -69,6 +81,15 @@
this.$router.push({ path: "/" });
})
.catch(() => {});
},
get_poem() {
this.$Axios.get("https://api.gushi.ci/all.json").then(res => {
this.poem = res.data;
console.log(this.poem.content);
var reg = /[。;、,?!]/;
var a = this.poem.content.split(reg);
this.poem.sentences = a;
});
}
},
beforeCreate() {
......@@ -139,6 +160,9 @@
}
localStorage.setItem("style", JSON.stringify(style));
}
},
mounted() {
// this.get_poem();
}
};
</script>
......@@ -158,4 +182,20 @@
.el-aside > .el-menu {
height: 100%;
}
.poem {
position: absolute;
margin: auto;
left: 15px;
bottom: 50px;
}
.content {
font-family: "隶书";
color: white;
display: inline-block;
width: 25px;
font-size: 20px;
line-height: 24px;
overflow: hidden;
word-wrap: break-word;
}
</style>
......@@ -22,8 +22,8 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="账款状态" prop="amount_state_unid">
<el-select v-model="search_form.amount_state_unid" clearable>
<el-form-item label="账款状态" prop="amount_state_unid_data_list">
<el-select v-model="search_form.amount_state_unid_data_list" clearable multiple>
<el-option v-for="item in amount_state_unid_data" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
......@@ -51,8 +51,11 @@
<el-form-item label="销售员" v-if="sales">
<el-input style="width:217px" :readonly="true" v-model="salesperson_name"></el-input>
</el-form-item>
<el-form-item label="销售员" prop="salesperson_name__like" v-if="!sales">
<el-input style="width:217px" v-model="search_form.salesperson_name__like"></el-input>
<el-form-item label="销售员" prop="salesperson_list" v-if="!sales">
<el-select v-model="search_form.salesperson_list" filterable multiple>
<el-option v-for="item in salesperson_data" :key="item.user_unid" :label="item.name" :value="item.user_unid">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
......@@ -380,11 +383,11 @@
value: "产品线类型"
},
{
key: "province",
key: "province_name",
value: "省"
},
{
key: "city",
key: "city_name",
value: "市"
},
{
......@@ -482,6 +485,58 @@
{
key: "total_receipt_amount",
value: "累计开票金额"
},
{
key: "contract_note",
value: "合同备注"
},
{
key: "bad_amount_note",
value: "坏账金额备注"
},
{
key: "reback_note",
value: "暂停金额备注"
},
{
key: "contract_amount_note",
value: "抵扣金额备注"
},
{
key: "contract_remain_note",
value: "豁免金额备注"
},
{
key: "advance_pay_proporition",
value: "预付款比例"
},
{
key: "arrive_pay_proportion",
value: "到货款比例"
},
{
key: "acceptanc_pay_proportion",
value: "验收款比例"
},
{
key: "mainten_pay_proportition",
value: "质保款比例"
},
{
key: "advance_pay_requirement",
value: "预付款条件"
},
{
key: "arrive_pay_requirement",
value: "到货款条件"
},
{
key: "acceptanc_pay_requirement",
value: "验收款条件"
},
{
key: "mainten_pay_requirement",
value: "质保款条件"
}
],
export_item_selected_dialog_show: false,
......@@ -495,6 +550,7 @@
counties: [],
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,
month_list: [
"01",
"02",
......@@ -509,6 +565,7 @@
"11",
"12"
],
salesperson_data: [],
contract_state_data: [],
contract_type_data: [],
product_line_type_data: [],
......@@ -523,10 +580,12 @@
year: null,
month: null,
contract_state_list: [],
salesperson_list: [],
contract_type: null,
product_line_type: null,
acceptance_type: null,
is_archive: null,
amount_state_unid_data_list: [],
amount_state_unid: null,
confirm_income_amount: null,
province: null,
......@@ -901,6 +960,23 @@
});
}
},
get_salesperson_data() {
this.$Axios({
method: "get",
url: this.auth_base_url + "users",
params: {
norm_type: "employee",
date: Date()
}
})
.then(response => {
this.salesperson_data = response.data.list_data;
})
.catch(err => {
// console.log(err.message);
});
},
/**
* 获取检索结果
*/
......@@ -911,6 +987,17 @@
} else {
a.contract_states = "";
}
if (a.salesperson_list.length > 0) {
a.salesperson_unid_columns = a.salesperson_list.join(",");
} else {
a.salesperson_unid_columns = "";
}
if (a.amount_state_unid_data_list.length > 0) {
a.amount_state_unids = a.amount_state_unid_data_list.join(",");
} else {
a.amount_state_unids = "";
}
Object.keys(a).forEach(key => {
if (a[key] && typeof a[key] == "string") {
// console.log(a[key]);
......@@ -971,7 +1058,6 @@
reset() {
this.$refs["search_form"].resetFields();
},
commit() {
this.$refs["search_form"].validate(valid => {
if (valid) {
......@@ -1067,6 +1153,7 @@
}
},
created() {
this.get_salesperson_data();
if (sessionStorage.getItem("user_roles") == "null") {
this.salesperson_name = sessionStorage.getItem("user_name");
this.sales = true;
......@@ -1189,4 +1276,8 @@ span {
#search >>> .el-checkbox__input.is-checked + .el-checkbox__label {
color: crimson;
}
/* #search >>>.el-table__header-wrapper{
position: fixed;
top: 0;
} */
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!