Commit d538929a by 谢明辉

添加注释

1 parent 12e3d367
.DS_Store .DS_Store
node_modules/
/dist/ /dist/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<body style="height: 100%;margin: 0"> <body style="height: 100%;margin: 0">
<div id="app"></div> <div id="app"></div>
<audio src="./static/" autoplay="autoplay"></audio>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
......
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
JSON.stringify(res.data.roles) JSON.stringify(res.data.roles)
); );
sessionStorage.setItem("user_name", res.data.user_name); sessionStorage.setItem("user_name", res.data.user_name);
/**
* 这里应该用axios.all()
*/
this.get_provinces(); this.get_provinces();
this.get_contract_state_data(); this.get_contract_state_data();
this.get_contract_type_data(); this.get_contract_type_data();
......
...@@ -196,6 +196,11 @@ ...@@ -196,6 +196,11 @@
}, },
methods: { methods: {
//search //search
/**
* 可以在新增前四个选项是弹出提示框,
* 列出已存在的,当键入已存在合同就会出现。
* 没什么用处啊。。。
*/
search_contract_unid(queryString, cb) { search_contract_unid(queryString, cb) {
var contract_unid_data = this.contract_unid_data; var contract_unid_data = this.contract_unid_data;
var results = queryString var results = queryString
...@@ -342,6 +347,9 @@ ...@@ -342,6 +347,9 @@
}) })
.catch(() => {}); .catch(() => {});
}, },
/**
* 更新数据统一调用的方法,add_data是自定义的对象
*/
get_data(url) { get_data(url) {
this.$Axios.get(url).then(res => { this.$Axios.get(url).then(res => {
if (res.data.list_data) { if (res.data.list_data) {
......
...@@ -31,15 +31,23 @@ ...@@ -31,15 +31,23 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row style="text-align:left"> <el-row style="text-align:left">
<el-col :span="12"> <el-col :span="6">
<el-form-item label="应收账款余额" prop="leave_amount_start_point"> <el-form-item label="所属年份" prop="year">
<el-input v-model="search_form.leave_amount_start_point" placeholder="不填默认为0"></el-input> <el-select v-model="search_form.year" clearable>
<el-option v-for="n in year_list" :key="n" :label="n" :value="n">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item prop="leave_amount_end_point"> </el-col>
<el-input v-model="search_form.leave_amount_end_point" placeholder="不填则无上限"></el-input> <el-col :span="6">
<el-form-item label="所属月份" prop="month">
<el-select v-model="search_form.month" clearable>
<el-option v-for="n in month_list" :key="n" :label="n" :value="n">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="6">
<el-form-item label="销售员" v-if="sales"> <el-form-item label="销售员" v-if="sales">
<el-input style="width:217px" :readonly="true" v-model="salesperson_name"></el-input> <el-input style="width:217px" :readonly="true" v-model="salesperson_name"></el-input>
</el-form-item> </el-form-item>
...@@ -47,6 +55,24 @@ ...@@ -47,6 +55,24 @@
<el-input style="width:217px" v-model="search_form.salesperson_name__like"></el-input> <el-input style="width:217px" v-model="search_form.salesperson_name__like"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="合同状态" prop="contract_state_list">
<el-select v-model="search_form.contract_state_list" multiple>
<el-option v-for="item in contract_state_data" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="text-align:left">
<el-col :span="12">
<el-form-item label="应收账款余额" prop="leave_amount_start_point">
<el-input v-model="search_form.leave_amount_start_point" placeholder="不填默认为0"></el-input>
</el-form-item>
<el-form-item prop="leave_amount_end_point">
<el-input v-model="search_form.leave_amount_end_point" placeholder="不填则无上限"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
<!-- hide --> <!-- hide -->
<el-row style="margin-bottom:10px"> <el-row style="margin-bottom:10px">
...@@ -57,36 +83,35 @@ ...@@ -57,36 +83,35 @@
<el-collapse-transition> <el-collapse-transition>
<div id="hide" v-show="!hide_search_item"> <div id="hide" v-show="!hide_search_item">
<el-row style="text-align:left"> <el-row style="text-align:left">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同状态" prop="contract_state_list"> <el-form-item label="合同性质" prop="contract_type">
<el-select v-model="search_form.contract_state_list" multiple> <el-select v-model="search_form.contract_type" clearable>
<el-option v-for="item in contract_state_data" :key="item.code" :label="item.name" :value="item.code"> <el-option v-for="item in contract_type_data" :key="item.code" :label="item.name" :value="item.code">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6" style="text-align:left">
<el-form-item label="所属年份" prop="year"> <el-form-item label="省" prop="province">
<el-select v-model="search_form.year" clearable> <el-select style="width:217px" v-model="search_form.province" filterable clearable placeholder="省" @change="get_cities()">
<el-option v-for="n in year_list" :key="n" :label="n" :value="n"> <el-option v-for="(item,index) in provinces" :key="index" :label="item.name" :value="item.province_unid">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6" style="text-align:left">
<el-form-item label="所属月份" prop="month"> <el-form-item label="市" prop="city">
<el-select v-model="search_form.month" clearable> <el-select style="width:217px" v-model="search_form.city" filterable clearable placeholder="市">
<el-option v-for="n in month_list" :key="n" :label="n" :value="n"> <el-option v-for="(item,index) in cities" :key="index" :label="item.name" :value="item.city_unid">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同性质" prop="contract_type"> <el-form-item label="质保周期(月)" prop="guarantee_period">
<el-select v-model="search_form.contract_type" clearable> <el-select v-model="search_form.guarantee_period" clearable>
<el-option v-for="item in contract_type_data" :key="item.code" :label="item.name" :value="item.code"> <el-option v-for="n in guarantee_period_list" :key="n" :label="n" :value="n"></el-option>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -124,31 +149,8 @@ ...@@ -124,31 +149,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="text-align:left"> <!-- <el-row style="text-align:left">
<el-col :span="6"> </el-row> -->
<el-form-item label="质保周期(月)" prop="guarantee_period">
<el-select v-model="search_form.guarantee_period" clearable>
<el-option v-for="n in guarantee_period_list" :key="n" :label="n" :value="n"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align:left">
<el-form-item label="省" prop="province">
<el-select style="width:217px" v-model="search_form.province" filterable clearable placeholder="省" @change="get_cities()">
<el-option v-for="(item,index) in provinces" :key="index" :label="item.name" :value="item.province_unid">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" style="text-align:left">
<el-form-item label="市" prop="city">
<el-select style="width:217px" v-model="search_form.city" filterable clearable placeholder="市">
<el-option v-for="(item,index) in cities" :key="index" :label="item.name" :value="item.city_unid">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row style="text-align:left"> <el-row style="text-align:left">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="签订日期" prop="start_date"> <el-form-item label="签订日期" prop="start_date">
...@@ -556,6 +558,9 @@ ...@@ -556,6 +558,9 @@
}; };
}, },
computed: { computed: {
/**
* 年份选择列表
*/
year_list: function() { year_list: function() {
var a = new Date().getFullYear(); var a = new Date().getFullYear();
var arr = []; var arr = [];
...@@ -564,6 +569,9 @@ ...@@ -564,6 +569,9 @@
} }
return arr; return arr;
}, },
/**
* 字面意思
*/
offset() { offset() {
return (this.current_page - 1) * this.limit; return (this.current_page - 1) * this.limit;
}, },
...@@ -628,6 +636,9 @@ ...@@ -628,6 +636,9 @@
}); });
}); });
}, },
/**
* 全选
*/
check_all_item(val) { check_all_item(val) {
if (val) { if (val) {
this.display_item_list.forEach(e => { this.display_item_list.forEach(e => {
...@@ -644,6 +655,9 @@ ...@@ -644,6 +655,9 @@
this.is_indeterminate = this.is_indeterminate =
checkedCount > 0 && checkedCount < this.display_item_list.length; checkedCount > 0 && checkedCount < this.display_item_list.length;
}, },
/**
* 自定义排序规则
*/
project_name_sort(a, b) { project_name_sort(a, b) {
if (a.project_name && b.project_name) { if (a.project_name && b.project_name) {
return a.project_name.trim().localeCompare(b.project_name.trim()); return a.project_name.trim().localeCompare(b.project_name.trim());
...@@ -712,7 +726,11 @@ ...@@ -712,7 +726,11 @@
? (this.hide_icon = "icon i-arrowdown-copy") ? (this.hide_icon = "icon i-arrowdown-copy")
: (this.hide_icon = "icon i-arrowup"); : (this.hide_icon = "icon i-arrowup");
}, },
/**
* 点击导入按钮,弹出文件选择栏,当选择文件后
* type为file的input的文件列表会改变
* 检测到这种改变后,调用import_contract方法
*/
import_click() { import_click() {
document.getElementById("import_unview").click(); document.getElementById("import_unview").click();
}, },
...@@ -852,10 +870,15 @@ ...@@ -852,10 +870,15 @@
}); });
} }
}, },
/**
* 获取检索结果
*/
get_list_data() { get_list_data() {
var a = this.search_form; var a = this.search_form;
if (a.contract_state_list.length > 0) { if (a.contract_state_list.length > 0) {
a.contract_states = a.contract_state_list.join(","); a.contract_states = a.contract_state_list.join(",");
} else {
a.contract_states = "";
} }
Object.keys(a).forEach(key => { Object.keys(a).forEach(key => {
if (a[key] && typeof a[key] == "string") { if (a[key] && typeof a[key] == "string") {
...@@ -934,6 +957,9 @@ ...@@ -934,6 +957,9 @@
} }
}); });
}, },
/**
* page控件的一些操作
*/
handle_size_change(val) { handle_size_change(val) {
this.limit = val; this.limit = val;
if (this.list_data.length != 0) { if (this.list_data.length != 0) {
...@@ -946,6 +972,9 @@ ...@@ -946,6 +972,9 @@
console.log(this.current_page); console.log(this.current_page);
this.get_list_data(); this.get_list_data();
}, },
/**
* 导出合同的excel表格
*/
export_contract() { export_contract() {
if (this.checked_item_list.length > 0) { if (this.checked_item_list.length > 0) {
this.search_form.columns = this.checked_item_list.join(","); this.search_form.columns = this.checked_item_list.join(",");
...@@ -983,10 +1012,16 @@ ...@@ -983,10 +1012,16 @@
console.log(err.message); console.log(err.message);
}); });
}, },
/**
* 点击详情后进度contract页面
*/
go_to(id) { go_to(id) {
sessionStorage.setItem("modify", "1"); sessionStorage.setItem("modify", "1");
this.$router.push("/nav/contract/" + id); this.$router.push("/nav/contract/" + id);
}, },
/**
* 改变dialog背景颜色
*/
change_dialog() { change_dialog() {
if (localStorage.getItem("style")) { if (localStorage.getItem("style")) {
var style = JSON.parse(localStorage.getItem("style")); var style = JSON.parse(localStorage.getItem("style"));
...@@ -1038,7 +1073,9 @@ ...@@ -1038,7 +1073,9 @@
} else { } else {
this.get_product_line_type_data(); this.get_product_line_type_data();
} }
/**
*Admin具有删除合同的权限
*/
if (sessionStorage.getItem("user_name") === "Admin") { if (sessionStorage.getItem("user_name") === "Admin") {
this.management = true; this.management = true;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!