Commit 3741487c by liangjianmin

style: 统一代码格式并修复空格问题

修复多个组件中的代码格式问题,包括:
1. 统一缩进为2个空格
2. 修复对象和数组声明中的多余空格
3. 保持组件导入和使用的格式一致
4. 移除多余空行和注释
parent 0e018907
Showing with 8326 additions and 8330 deletions
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-input v-model="formParam.keyword" placeholder="请输入关键词" @keyup.enter.native="submit" clearable></el-input> <el-input v-model="formParam.keyword" placeholder="请输入关键词" @keyup.enter.native="submit" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间"> <el-form-item label="更新时间">
<el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="formParam.date" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="formParam.date" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submit">搜索</el-button> <el-button type="primary" @click="submit">搜索</el-button>
...@@ -81,239 +81,239 @@ ...@@ -81,239 +81,239 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Dialog, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Select, Table, TableColumn, Upload} from 'element-ui' import { Autocomplete, Button, Dialog, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Select, Table, TableColumn, Upload } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Autocomplete) Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Autocomplete)
Vue.use(TableColumn).use(Table).use(Upload) Vue.use(TableColumn).use(Table).use(Upload)
export default { export default {
name: "brand", name: "brand",
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
updateBranddata: [], updateBranddata: [],
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
downHref: "", downHref: "",
formParam: { formParam: {
brand_name: '', brand_name: '',
keyword: '', keyword: '',
date: '' date: ''
}, },
disabled: false, disabled: false,
tableData: "", tableData: "",
timer: null, timer: null,
multipleSelection: [] multipleSelection: []
}; };
},
created() {
this.getData();
},
methods: {
getData() {
this.$http('get', "/api/brand/get_brand_list", {
page: this.page,
limit: this.limit,
brand_id: this.formParam.brand_id,
brand_name: this.formParam.brand_name,
keyword: this.formParam.keyword
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 编辑品牌
*/
updateBrand() {
if (this.multipleSelection.length > 1) {
this.$message("只能选择一条数据")
return
}
if (this.multipleSelection.length == 0) {
this.$message("请至少选择一条数据")
return
}
this.updateBranddata = JSON.parse(JSON.stringify(this.multipleSelection));
this.dialogVisible = true
}, },
submitUpdate() { created() {
var arr_ = { this.getData();
id: this.updateBranddata[0].id,
remark: this.updateBranddata[0].remark,
internal_standard_name: this.updateBranddata[0].internal_standard_name
}
this.$http('post', "/api/brand/update_brand", arr_).then(res => {
if (res.code == 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData()
this.dialogVisible = false
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}, },
//品牌 methods: {
querySearchAsyncBrand(queryString, cb) { getData() {
this.$http('get', "/api/brand/get_stand_brand", { this.$http('get', "/api/brand/get_brand_list", {
brand: queryString page: this.page,
}).then(res => { limit: this.limit,
if (res.code == 0) { brand_id: this.formParam.brand_id,
if (res.data.list.length > 0) { brand_name: this.formParam.brand_name,
var arrlist_ = res.data.list || []; keyword: this.formParam.keyword
var arr_ = [] }).then(res => {
for (var i = 0; i < arrlist_.length; i++) { if (res.code === 0) {
arr_.push({ this.tableData = res.data.list || [];
value: arrlist_[i] this.total = Number(res.data.count) || 0;
})
}
cb(arr_);
} else { } else {
cb([]); this.$message({
message: res.msg,
type: 'warning'
});
} }
})
},
/**
* 编辑品牌
*/
updateBrand() {
if (this.multipleSelection.length > 1) {
this.$message("只能选择一条数据")
return
} }
}) if (this.multipleSelection.length == 0) {
}, this.$message("请至少选择一条数据")
resetForm(formName) { return
this.formParam.date = ''; }
this.$refs[formName].resetFields(); this.updateBranddata = JSON.parse(JSON.stringify(this.multipleSelection));
}, this.dialogVisible = true
submit() { },
if (this.formParam.keyword && this.formParam.keyword.length == 1) { submitUpdate() {
this.$message("关键词不能少于2个字符"); var arr_ = {
return id: this.updateBranddata[0].id,
} remark: this.updateBranddata[0].remark,
this.page = 1; internal_standard_name: this.updateBranddata[0].internal_standard_name
this.getData(); }
}, this.$http('post', "/api/brand/update_brand", arr_).then(res => {
downOut() { if (res.code == 0) {
if (this.disabled) { this.$message({
this.$message({ message: '修改成功',
message: '正在导出中,请不要重复点击', type: 'success'
type: 'success' });
}); this.getData()
return false; this.dialogVisible = false
} } else {
this.$http('post', "/api/brand/export_brand", { this.$message({
brand_id: this.formParam.brand_id, message: res.msg,
brand_name: this.formParam.brand_name, type: 'warning'
keyword: this.formParam.keyword, });
}).then(res => { }
if (res.code == 0) { })
this.disabled = true },
this.$message({ //品牌
message: '正在导出中,请耐心等待', querySearchAsyncBrand(queryString, cb) {
type: 'warning', this.$http('get', "/api/brand/get_stand_brand", {
duration: 0 brand: queryString
}); }).then(res => {
this.timer = setInterval(() => { if (res.code == 0) {
if (!this.disabled) { if (res.data.list.length > 0) {
clearInterval(this.timer) var arrlist_ = res.data.list || [];
return var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]
})
}
cb(arr_);
} else {
cb([]);
} }
this.resultDown(res.data) }
}, 3000) })
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
submit() {
if (this.formParam.keyword && this.formParam.keyword.length == 1) {
this.$message("关键词不能少于2个字符");
return
} }
}) this.page = 1;
}, this.getData();
resultDown(id_) { },
this.$http('get', "/api/export/get_export_data", { downOut() {
id: id_ if (this.disabled) {
}).then(res => {
if (res.code == 0) {
this.disabled = false
this.$message({ this.$message({
message: '导出成功', message: '正在导出中,请不要重复点击',
type: 'success' type: 'success'
}); });
this.downHref = res.data return false;
setTimeout(() => {
this.$message.closeAll();
this.$refs.downs.click();
}, 2000)
} else if (res.code == -1) {
//导出失败
this.$message({
message: res.msg,
type: 'error'
});
this.disabled = false
} }
}, error => { this.$http('post', "/api/brand/export_brand", {
this.$message('网络出现问题,请检查网络'); brand_id: this.formParam.brand_id,
this.disabled = false brand_name: this.formParam.brand_name,
}) keyword: this.formParam.keyword,
},
del() {
if (this.multipleSelection.length == 0) {
this.$message("请至少选择一条数据")
return
}
var arr = [];
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/brand/delete_brand", {
id: arr.join(",")
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code == 0) {
this.$message("删除成功"); this.disabled = true
this.getData() this.$message({
} else { message: '正在导出中,请耐心等待',
this.$message(res.msg); type: 'warning',
duration: 0
});
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return
}
this.resultDown(res.data)
}, 3000)
}
})
},
resultDown(id_) {
this.$http('get', "/api/export/get_export_data", {
id: id_
}).then(res => {
if (res.code == 0) {
this.disabled = false
this.$message({
message: '导出成功',
type: 'success'
});
this.downHref = res.data
setTimeout(() => {
this.$message.closeAll();
this.$refs.downs.click();
}, 2000)
} else if (res.code == -1) {
//导出失败
this.$message({
message: res.msg,
type: 'error'
});
this.disabled = false
} }
}, error => {
this.$message('网络出现问题,请检查网络');
this.disabled = false
}) })
}).catch(() => {
}) },
}, del() {
handleSizeChange(val) { if (this.multipleSelection.length == 0) {
this.limit = val; this.$message("请至少选择一条数据")
this.getData(); return
}, }
handleCurrentChange(val) { var arr = [];
this.page = val; for (var i = 0; i < this.multipleSelection.length; i++) {
this.getData(); arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/brand/delete_brand", {
id: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message("删除成功");
this.getData()
} else {
this.$message(res.msg);
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val || [];
}
}, },
handleSelectionChange(val) { components: {
this.multipleSelection = val || []; Menu
} }
};
},
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/brand.min.css"; @import "../../assets/css/goods/brand.min.css";
::v-deep .custom-dialog .el-dialog__body { ::v-deep .custom-dialog .el-dialog__body {
height: 500px; height: 500px;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>
\ No newline at end of file
...@@ -89,271 +89,271 @@ ...@@ -89,271 +89,271 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Image, Input, Message, Option, Pagination, Select, Table, TableColumn, Upload} from 'element-ui' import { Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Image, Input, Message, Option, Pagination, Select, Table, TableColumn, Upload } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(Image).use(DatePicker).use(Upload); Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(Image).use(DatePicker).use(Upload);
export default { export default {
name: "brand", name: "brand",
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
updateGoodsdata: [], updateGoodsdata: [],
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
downHref: "", downHref: "",
formParam: { formParam: {
goods_name: '', goods_name: '',
brand_name: '', brand_name: '',
keyword: '', keyword: '',
class_id2: '', class_id2: '',
class_id1: '', class_id1: '',
date: '' date: ''
}, },
disabled: false, disabled: false,
timer: null, timer: null,
tableData: "", tableData: "",
multipleSelection: [], multipleSelection: [],
options: [], options: [],
selectedOptions: [] selectedOptions: []
} }
}, },
created() { created() {
this.getData(); this.getData();
this.getClass(); this.getClass();
}, },
methods: { methods: {
getClass() { getClass() {
this.$http('get', "/api/class/get_class_list", {}).then(res => { this.$http('get', "/api/class/get_class_list", {}).then(res => {
if (res.code === 0) { if (res.code === 0) {
var data = res.data.list || []; var data = res.data.list || [];
if (data.length > 0) { if (data.length > 0) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
var children = [] var children = []
let children_arr = data[i].sub_class || []; let children_arr = data[i].sub_class || [];
if (children_arr.length > 0) { if (children_arr.length > 0) {
for (let j = 0; j < children_arr.length; j++) { for (let j = 0; j < children_arr.length; j++) {
children.push({ children.push({
value: children_arr[j].class_id, value: children_arr[j].class_id,
label: children_arr[j].class_name label: children_arr[j].class_name
}) })
}
} }
this.options.push({
value: parseInt(data[i].class_id),
label: data[i].class_name,
children: children
})
} }
this.options.push({
value: parseInt(data[i].class_id),
label: data[i].class_name,
children: children
})
} }
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
} else { })
this.$message({ },
message: res.msg, getData() {
type: 'warning' this.$http('get', "/api/spu/get_spu_list", {
}); page: this.page,
} limit: this.limit,
}) brand_id: this.formParam.brand_id,
}, brand_name: this.formParam.brand_name,
getData() { spu_name: this.formParam.goods_name,
this.$http('get', "/api/spu/get_spu_list", { keyword: this.formParam.keyword,
page: this.page, class_id2: this.formParam.class_id2,
limit: this.limit, class_id1: this.formParam.class_id1
brand_id: this.formParam.brand_id, }).then(res => {
brand_name: this.formParam.brand_name, if (res.code === 0) {
spu_name: this.formParam.goods_name, this.tableData = res.data.list || [];
keyword: this.formParam.keyword, this.total = Number(res.data.count) || 0;
class_id2: this.formParam.class_id2,
class_id1: this.formParam.class_id1
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
} else {
this.$message(res.msg);
}
})
},
//型号
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else { } else {
cb([]); this.$message(res.msg);
} }
} })
}) },
}, //型号
//品牌 querySearchAsync(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/search/getspu", {
this.$http('get', "/api/brand/get_stand_brand", { spu_name: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]['spu_name']
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, //品牌
updateBrand() { querySearchAsyncBrand(queryString, cb) {
if (this.multipleSelection.length > 1) { this.$http('get', "/api/brand/get_stand_brand", {
this.$message({ brand: queryString
message: '只能选择一条数据', }).then(res => {
type: 'warning' if (res.code == 0) {
}); if (res.data.list.length > 0) {
return false; var arrlist_ = res.data.list || [];
} var arr_ = []
if (this.multipleSelection.length == 0) { for (var i = 0; i < arrlist_.length; i++) {
this.$message({ arr_.push({
message: '请至少选择一条数据', value: arrlist_[i]
type: 'warning' })
}); }
return false; cb(arr_);
} } else {
this.updateGoodsdata = JSON.parse(JSON.stringify(this.multipleSelection)); cb([]);
this.dialogVisible = true }
}, }
submitUpdate() { })
var arr_ = { },
id: this.updateGoodsdata[0].spu_id, updateBrand() {
remark: this.updateGoodsdata[0].remark if (this.multipleSelection.length > 1) {
}
this.$http('post', "/api/spu/update_spu", arr_).then(res => {
if (res.code == 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData()
this.dialogVisible = false
} else {
this.$message({ this.$message({
message: res.msg, message: '只能选择一条数据',
type: 'warning' type: 'warning'
}); });
return false;
} }
}) if (this.multipleSelection.length == 0) {
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
submit() {
this.page = 1;
this.getData();
},
downOut() {
if (this.disabled) {
this.$message("正在导出中,请不要重复点击");
return false;
}
this.$http('post', "/api/spu/export_spu", {
spu_name: this.formParam.goods_name,
brand_name: this.formParam.brand_name,
brand_id: this.formParam.brand_id,
class_id2: this.formParam.class_id2,
class_id1: this.formParam.class_id1,
keyword: this.formParam.keyword
}).then(res => {
if (res.code == 0) {
this.disabled = true;
this.$message({ this.$message({
message: '正在导出中,请耐心等待', message: '请至少选择一条数据',
type: 'warning', type: 'warning'
duration: 0
}); });
this.timer = setInterval(() => { return false;
if (!this.disabled) {
clearInterval(this.timer)
return false;
}
this.resultDown(res.data)
}, 3000)
} }
}) this.updateGoodsdata = JSON.parse(JSON.stringify(this.multipleSelection));
}, this.dialogVisible = true
resultDown(id_) { },
this.$http('get', "/api/export/get_export_data", { submitUpdate() {
id: id_ var arr_ = {
}).then(res => { id: this.updateGoodsdata[0].spu_id,
if (res.code == 0) { remark: this.updateGoodsdata[0].remark
this.disabled = false;
this.$message({
message: '导出成功',
type: 'success'
});
this.downHref = res.data
setTimeout(() => {
this.$message.closeAll();
this.$refs.downs.click()
}, 2000)
} else if (res.code == -1) {
//导出失败
this.$message({
message: res.msg,
type: 'error'
});
this.disabled = false
} }
}, error => { this.$http('post', "/api/spu/update_spu", arr_).then(res => {
this.$message('网络出现问题,请检查网络'); if (res.code == 0) {
this.disabled = false this.$message({
}) message: '修改成功',
}, type: 'success'
handleSizeChange(val) { });
this.limit = val; this.getData()
this.getData(); this.dialogVisible = false
}, } else {
handleCurrentChange(val) { this.$message({
this.page = val; message: res.msg,
this.getData(); type: 'warning'
}, });
handleSelectionChange(val) { }
this.multipleSelection = val || []; })
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
submit() {
this.page = 1;
this.getData();
},
downOut() {
if (this.disabled) {
this.$message("正在导出中,请不要重复点击");
return false;
}
this.$http('post', "/api/spu/export_spu", {
spu_name: this.formParam.goods_name,
brand_name: this.formParam.brand_name,
brand_id: this.formParam.brand_id,
class_id2: this.formParam.class_id2,
class_id1: this.formParam.class_id1,
keyword: this.formParam.keyword
}).then(res => {
if (res.code == 0) {
this.disabled = true;
this.$message({
message: '正在导出中,请耐心等待',
type: 'warning',
duration: 0
});
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return false;
}
this.resultDown(res.data)
}, 3000)
}
})
},
resultDown(id_) {
this.$http('get', "/api/export/get_export_data", {
id: id_
}).then(res => {
if (res.code == 0) {
this.disabled = false;
this.$message({
message: '导出成功',
type: 'success'
});
this.downHref = res.data
setTimeout(() => {
this.$message.closeAll();
this.$refs.downs.click()
}, 2000)
} else if (res.code == -1) {
//导出失败
this.$message({
message: res.msg,
type: 'error'
});
this.disabled = false
}
}, error => {
this.$message('网络出现问题,请检查网络');
this.disabled = false
})
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val || [];
},
handleChange(value) {
this.formParam.class_id1 = value[0]
this.formParam.class_id2 = value[1]
}
}, },
handleChange(value) { components: {
this.formParam.class_id1 = value[0] Menu
this.formParam.class_id2 = value[1]
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
::v-deep .custom-dialog .el-dialog__body { ::v-deep .custom-dialog .el-dialog__body {
height: 500px; height: 500px;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="home-index boxsiz"> <div class="home-index boxsiz">
<Menu/> <Menu />
<div class="row bothSide verCenter survey-top-show"> <div class="row bothSide verCenter survey-top-show">
<div class="column left-bar"> <div class="column left-bar">
<ul class="survey-top row bothSide boxsiz"> <ul class="survey-top row bothSide boxsiz">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<span style="width: 30%">排名</span> <span style="width: 30%">排名</span>
</div> </div>
<div class="box-wrap"> <div class="box-wrap">
<div class="row verCenter box" v-for="(v,index) in rankList"> <div class="row verCenter box" v-for="(v, index) in rankList">
<span CLASS="t1">{{ v.name }}</span> <span CLASS="t1">{{ v.name }}</span>
<template v-if="v.rank == 1"> <template v-if="v.rank == 1">
<div class="sort row verCenter"> <div class="sort row verCenter">
...@@ -98,13 +98,13 @@ ...@@ -98,13 +98,13 @@
<div class="rate-box boxsiz"> <div class="rate-box boxsiz">
<div class="rate-tab row bothSide verCenter"> <div class="rate-tab row bothSide verCenter">
<div class="row"> <div class="row">
<el-radio-group v-model="tabPosition" @change="change(tabPosition,'frqRates')"> <el-radio-group v-model="tabPosition" @change="change(tabPosition, 'frqRates')">
<el-radio-button label="0">询价报价率</el-radio-button> <el-radio-button label="0">询价报价率</el-radio-button>
<el-radio-button label="1">报价成单率</el-radio-button> <el-radio-button label="1">报价成单率</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="row"> <div class="row">
<el-radio-group v-model="tabDate" @change="change(tabDate,'frqRatesDate')"> <el-radio-group v-model="tabDate" @change="change(tabDate, 'frqRatesDate')">
<el-radio-button label="0">昨日</el-radio-button> <el-radio-button label="0">昨日</el-radio-button>
<el-radio-button label="1">本周</el-radio-button> <el-radio-button label="1">本周</el-radio-button>
<el-radio-button label="2">本月</el-radio-button> <el-radio-button label="2">本月</el-radio-button>
...@@ -119,14 +119,14 @@ ...@@ -119,14 +119,14 @@
<div class="offer boxsiz"> <div class="offer boxsiz">
<div class="offer-tab row verCenter bothSide"> <div class="offer-tab row verCenter bothSide">
<div class="row"> <div class="row">
<el-radio-group v-model="offerPosition" @change="change(offerPosition,'offerPosition')"> <el-radio-group v-model="offerPosition" @change="change(offerPosition, 'offerPosition')">
<el-radio-button label="1">询价量</el-radio-button> <el-radio-button label="1">询价量</el-radio-button>
<el-radio-button label="2">报价量</el-radio-button> <el-radio-button label="2">报价量</el-radio-button>
<el-radio-button label="3">成单量</el-radio-button> <el-radio-button label="3">成单量</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="row"> <div class="row">
<el-radio-group v-model="offerDate" @change="change(offerDate,'offerDate')"> <el-radio-group v-model="offerDate" @change="change(offerDate, 'offerDate')">
<el-radio-button label="1">近7天</el-radio-button> <el-radio-button label="1">近7天</el-radio-button>
<el-radio-button label="2">本月</el-radio-button> <el-radio-button label="2">本月</el-radio-button>
<el-radio-button label="3">本年</el-radio-button> <el-radio-button label="3">本年</el-radio-button>
...@@ -139,13 +139,13 @@ ...@@ -139,13 +139,13 @@
<el-table :data="inquiry_rank_list"> <el-table :data="inquiry_rank_list">
<el-table-column prop="numbers" label="排名" align="center" width="50"> <el-table-column prop="numbers" label="排名" align="center" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.$index==0"> <template v-if="scope.$index == 0">
<span class="one row rowCenter verCenter">1</span> <span class="one row rowCenter verCenter">1</span>
</template> </template>
<template v-else-if="scope.$index==1"> <template v-else-if="scope.$index == 1">
<span class="two row rowCenter verCenter">2</span> <span class="two row rowCenter verCenter">2</span>
</template> </template>
<template v-else-if="scope.$index==2"> <template v-else-if="scope.$index == 2">
<span class="three row rowCenter verCenter">3</span> <span class="three row rowCenter verCenter">3</span>
</template> </template>
<template v-else> <template v-else>
...@@ -163,199 +163,199 @@ ...@@ -163,199 +163,199 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import {DatePicker, Form, FormItem, Message, Progress, Radio, RadioButton, RadioGroup, Table, TableColumn, Tabs} from 'element-ui'; import { DatePicker, Form, FormItem, Message, Progress, Radio, RadioButton, RadioGroup, Table, TableColumn, Tabs } from 'element-ui';
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(DatePicker).use(Tabs).use(Radio).use(RadioGroup).use(RadioButton).use(Progress).use(Table).use(TableColumn); Vue.use(Form).use(FormItem).use(DatePicker).use(Tabs).use(Radio).use(RadioGroup).use(RadioButton).use(Progress).use(Table).use(TableColumn);
export default { export default {
name: "index", name: "index",
data() { data() {
return { return {
isDisabled: true, isDisabled: true,
date: '', date: '',
tabPosition: 0, tabPosition: 0,
tabDate: 0, tabDate: 0,
offerPosition: 1, offerPosition: 1,
offerDate: 1, offerDate: 1,
percentage: 0, percentage: 0,
inquiry_rank_list: [], inquiry_rank_list: [],
xAxis: [], xAxis: [],
series: [], series: [],
rankList: [],//搜索排名 rankList: [],//搜索排名
flag: true,//切换品牌,型号 flag: true,//切换品牌,型号
placeholderText: '输入型号,查看排名', placeholderText: '输入型号,查看排名',
rankParam: { rankParam: {
type: 1, type: 1,
keyword: '' keyword: ''
}, },
data: { data: {
weekly_quote_selected_count: 0, weekly_quote_selected_count: 0,
weekly_spu_count: 0, weekly_spu_count: 0,
all_sku_count: 0, all_sku_count: 0,
reject_sku_count: 0, reject_sku_count: 0,
weekly_quote_deal_count: 0, weekly_quote_deal_count: 0,
off_shelf_sku_count: 0, off_shelf_sku_count: 0,
weekly_quote_count: 0, weekly_quote_count: 0,
brand_count: 0, brand_count: 0,
weekly_sku_count: 0, weekly_sku_count: 0,
all_spu_count: 0, all_spu_count: 0,
weekly_inquiry_count: 0, weekly_inquiry_count: 0,
all_quote_count: 0, all_quote_count: 0,
all_inquiry_count: 0 all_inquiry_count: 0
}
};
},
mounted() {
this.getData();
this.getFrqRates();
this.getFrqStatInfo();
this.getSkuSearchRankList();
},
methods: {
change(index, type) {
if (type == 'frqRates') {
this.getFrqRates(this.tabDate);
}
if (type == 'frqRatesDate') {
this.getFrqRates(this.tabDate);
}
if (type == 'offerPosition') {
this.getFrqStatInfo(this.offerDate);
}
if (type == 'offerDate') {
this.getFrqStatInfo(this.offerDate);
}
},
/**
* 获取sku型号/品牌的搜索排名
*/
getSkuSearchRankList() {
this.$http('GET', "/api/sku/getSkuSearchRankList", this.rankParam).then(res => {
if (res.code === 0) {
this.rankList = res.data.rankList;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}) };
}, },
getFrqRates(type) { mounted() {
//首页询报价比率信息 this.getData();
this.$http('GET', "/api/statistics/getFrqRates", {type: type}).then(res => { this.getFrqRates();
if (res.code === 0) { this.getFrqStatInfo();
if (this.tabPosition == 0) { this.getSkuSearchRankList();
this.percentage = parseInt(res.data.inquiry_quote_rate);
} else if (this.tabPosition == 1) {
this.percentage = parseInt(res.data.quote_ordered_rate);
} else if (this.tabPosition == 2) {
this.percentage = parseInt(res.data.quote_ordered_rate);
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}, },
getFrqStatInfo(type) { methods: {
//首页询报价数量统计信息 change(index, type) {
this.$http('GET', "/api/statistics/getFrqStatInfo", {type: type}).then(res => { if (type == 'frqRates') {
if (res.code === 0) { this.getFrqRates(this.tabDate);
this.inquiry_rank_list = res.data.inquiry_rank_list; }
if (this.offerPosition == 1) { if (type == 'frqRatesDate') {
let step_name = res.data.inquiry_num_step_list.map(obj => { this.getFrqRates(this.tabDate);
return obj.step_name; }
}); if (type == 'offerPosition') {
let step_count = res.data.inquiry_num_step_list.map(obj => { this.getFrqStatInfo(this.offerDate);
return obj.step_count; }
}); if (type == 'offerDate') {
this.echartsChange(step_name, step_count, '询价量'); this.getFrqStatInfo(this.offerDate);
} else if (this.offerPosition == 2) { }
let step_name = res.data.quote_num_step_list.map(obj => { },
return obj.step_name; /**
}); * 获取sku型号/品牌的搜索排名
let step_count = res.data.quote_num_step_list.map(obj => { */
return obj.step_count; getSkuSearchRankList() {
this.$http('GET', "/api/sku/getSkuSearchRankList", this.rankParam).then(res => {
if (res.code === 0) {
this.rankList = res.data.rankList;
} else {
this.$message({
message: res.msg,
type: 'warning'
}); });
this.echartsChange(step_name, step_count, '报价量'); }
} else if (this.offerPosition == 3) { })
let step_name = res.data.order_num_step_list.map(obj => { },
return obj.step_name; getFrqRates(type) {
//首页询报价比率信息
this.$http('GET', "/api/statistics/getFrqRates", { type: type }).then(res => {
if (res.code === 0) {
if (this.tabPosition == 0) {
this.percentage = parseInt(res.data.inquiry_quote_rate);
} else if (this.tabPosition == 1) {
this.percentage = parseInt(res.data.quote_ordered_rate);
} else if (this.tabPosition == 2) {
this.percentage = parseInt(res.data.quote_ordered_rate);
}
} else {
this.$message({
message: res.msg,
type: 'warning'
}); });
let step_count = res.data.order_num_step_list.map(obj => { }
return obj.step_count; })
},
getFrqStatInfo(type) {
//首页询报价数量统计信息
this.$http('GET', "/api/statistics/getFrqStatInfo", { type: type }).then(res => {
if (res.code === 0) {
this.inquiry_rank_list = res.data.inquiry_rank_list;
if (this.offerPosition == 1) {
let step_name = res.data.inquiry_num_step_list.map(obj => {
return obj.step_name;
});
let step_count = res.data.inquiry_num_step_list.map(obj => {
return obj.step_count;
});
this.echartsChange(step_name, step_count, '询价量');
} else if (this.offerPosition == 2) {
let step_name = res.data.quote_num_step_list.map(obj => {
return obj.step_name;
});
let step_count = res.data.quote_num_step_list.map(obj => {
return obj.step_count;
});
this.echartsChange(step_name, step_count, '报价量');
} else if (this.offerPosition == 3) {
let step_name = res.data.order_num_step_list.map(obj => {
return obj.step_name;
});
let step_count = res.data.order_num_step_list.map(obj => {
return obj.step_count;
});
this.echartsChange(step_name, step_count, '成单量');
}
} else {
this.$message({
message: res.msg,
type: 'warning'
}); });
this.echartsChange(step_name, step_count, '成单量');
} }
})
},
/**
* 型号,品牌切换
*/
switchChange() {
this.flag = !this.flag;
if (this.flag) {
this.rankParam.type = 1;
this.placeholderText = '输入型号,查看排名';
} else { } else {
this.$message({ this.rankParam.type = 2;
message: res.msg, this.placeholderText = '输入品牌,查看排名';
type: 'warning'
});
} }
}) this.getSkuSearchRankList();
}, },
/** echartsChange(xAxis, series, text) {
* 型号,品牌切换 var myChart = echarts.init(document.getElementById('echarts_box'));
*/ var option = {
switchChange() { tooltip: {},
this.flag = !this.flag; xAxis: {
if (this.flag) { data: xAxis
this.rankParam.type = 1; },
this.placeholderText = '输入型号,查看排名'; yAxis: {},
} else { series: [
this.rankParam.type = 2; {
this.placeholderText = '输入品牌,查看排名'; name: text,
} type: 'bar',
this.getSkuSearchRankList(); data: series
}, }
echartsChange(xAxis, series, text) { ]
var myChart = echarts.init(document.getElementById('echarts_box')); };
var option = { myChart.setOption(option);
tooltip: {}, window.onresize = function () {
xAxis: { myChart.resize();
data: xAxis };
}, },
yAxis: {}, getData() {
series: [ this.$http('get', "/api/statistics/index", {}).then(res => {
{ if (res.code === 0) {
name: text, this.data = res.data
type: 'bar', } else {
data: series this.$message({
message: res.msg,
type: 'warning'
});
} }
] })
}; }
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
}, },
getData() { components: {
this.$http('get', "/api/statistics/index", {}).then(res => { Menu
if (res.code === 0) {
this.data = res.data
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/index/index.min.css"; @import "../../assets/css/index/index.min.css";
</style> </style>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="tip">基本信息</div> <div class="tip">基本信息</div>
<div class="row verCenter"> <div class="row verCenter">
<div class="up-box"> <div class="up-box">
<img :src="userinfo.avatar || 'https://www.ichunt.com/v3/dist/res/home/images/headimg/boy1.png'" class="imspre"/> <img :src="userinfo.avatar || 'https://www.ichunt.com/v3/dist/res/home/images/headimg/boy1.png'" class="imspre" />
<el-upload class="avatar-uploader" :data="fileData" :action="upUrl" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"> <el-upload class="avatar-uploader" :data="fileData" :action="upUrl" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<span class="icon iconfont fl"></span> <span class="icon iconfont fl"></span>
<div class="fl">更换头像</div> <div class="fl">更换头像</div>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<!--子账号消息推送配置--> <!--子账号消息推送配置-->
<section class="role-auth"> <section class="role-auth">
<ul class="row"> <ul class="row">
<li v-for="(item,index) in messageMenu" :key="item.id"> <li v-for="(item, index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree> <el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree>
</li> </li>
</ul> </ul>
...@@ -69,184 +69,184 @@ ...@@ -69,184 +69,184 @@
<el-button type="primary" @click="submituser">编辑</el-button> <el-button type="primary" @click="submituser">编辑</el-button>
</el-row> </el-row>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {NODE_ENVS} from "../../ajax"; import { NODE_ENVS } from "../../ajax";
import Tool from '../../tool' import Tool from '../../tool'
import {Form, FormItem, Input, Message, Row, Tree, Upload} from 'element-ui' import { Form, FormItem, Input, Message, Row, Tree, Upload } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row).use(Tree); Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row).use(Tree);
export default { export default {
name: "message", name: "message",
data() { data() {
return { return {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
filteredMessageIds: [], filteredMessageIds: [],
upUrl: NODE_ENVS + '/api/user/setavatar', upUrl: NODE_ENVS + '/api/user/setavatar',
fileData: {token: Tool.getCookie('token')}, fileData: { token: Tool.getCookie('token') },
messageMenu: [],//消息权限菜单 messageMenu: [],//消息权限菜单
user_message_rule: [], user_message_rule: [],
userinfo: {} userinfo: {}
}; };
}, },
created() { created() {
this.getUseInfo(); this.getUseInfo();
this.getMessageMenu(); this.getMessageMenu();
}, },
methods: { methods: {
/** /**
* 获取当前用户的消息权限菜单 * 获取当前用户的消息权限菜单
*/ */
getMessageMenu() { getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => { this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) { if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]); let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = newMenuData; this.messageMenu = newMenuData;
const filteredIds = []; const filteredIds = [];
res.data.data.forEach(item => { res.data.data.forEach(item => {
if (item.children) { if (item.children) {
const childrenWithChecked = item.children.filter(child => child.checked); const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id); const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids); filteredIds.push(...ids);
} else { } else {
if (item.checked) { if (item.checked) {
filteredIds.push(item.id); filteredIds.push(item.id);
}
} }
} });
}); this.filteredMessageIds = filteredIds;
this.filteredMessageIds = filteredIds; //筛选出rule-message
//筛选出rule-message const result = [];
const result = []; for (let obj of res.data.data) {
for (let obj of res.data.data) { if (obj.checked) {
if (obj.checked) { result.push(obj.name);
result.push(obj.name); }
} if (obj.children) {
if (obj.children) { for (let child of obj.children) {
for (let child of obj.children) { if (child.checked) {
if (child.checked) { result.push(child.name);
result.push(child.name); }
} }
} }
} }
this.user_message_rule = result;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
this.user_message_rule = result; })
} else { },
getUseInfo() {
this.$http('GET', "/api/user/getuserinfo").then(res => {
if (res.code === 0) {
this.userinfo = res.data;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
submituser() {
this.$http('post', "/api/user/setuserinfo", {
email: this.userinfo.email,
contacts_name: this.userinfo.contacts_name,
user_message_rule: JSON.stringify(this.user_message_rule)
}).then(res => {
if (res.code === 0) {
this.$message({
message: '更新成功',
type: 'success'
});
sessionStorage.removeItem('userInfox')
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
handleAvatarSuccess(res, file) {
if (res.code === 0) {
this.$message({ this.$message({
message: res.msg, message: '设置成功',
type: 'warning' type: 'success'
}); });
} this.userinfo.avatar = URL.createObjectURL(file.raw);
}) sessionStorage.removeItem('userInfox')
},
getUseInfo() {
this.$http('GET', "/api/user/getuserinfo").then(res => {
if (res.code === 0) {
this.userinfo = res.data;
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'warning' type: 'warning'
}); });
} }
}) },
}, beforeAvatarUpload(file) {
submituser() { const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/gif';
this.$http('post', "/api/user/setuserinfo", { const isLt2M = file.size / 1024 / 1024 < 5;
email: this.userinfo.email, if (!isJPG) {
contacts_name: this.userinfo.contacts_name,
user_message_rule: JSON.stringify(this.user_message_rule)
}).then(res => {
if (res.code === 0) {
this.$message({ this.$message({
message: '更新成功', message: '上传头像图片只能是 JPG、PNG、GIF 格式!',
type: 'success' type: 'warning'
}); });
sessionStorage.removeItem('userInfox') }
} else { if (!isLt2M) {
this.$message({ this.$message({
message: res.msg, message: '上传头像图片大小不能超过 5MB!',
type: 'warning' type: 'warning'
}); });
} }
}) return isJPG && isLt2M;
}, },
handleAvatarSuccess(res, file) { /**
if (res.code === 0) { * 筛选子账号勾选的消息推送配置
this.$message({ * @param data
message: '设置成功', * @param checked
type: 'success' */
}); handleCheckMsgChange(data, checked) {
this.userinfo.avatar = URL.createObjectURL(file.raw); if (checked) {
sessionStorage.removeItem('userInfox')
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/gif';
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isJPG) {
this.$message({
message: '上传头像图片只能是 JPG、PNG、GIF 格式!',
type: 'warning'
});
}
if (!isLt2M) {
this.$message({
message: '上传头像图片大小不能超过 5MB!',
type: 'warning'
});
}
return isJPG && isLt2M;
},
/**
* 筛选子账号勾选的消息推送配置
* @param data
* @param checked
*/
handleCheckMsgChange(data, checked) {
if (checked) {
if (!this.user_message_rule.includes(data.name)) {
this.user_message_rule.push(data.name);
}
} else {
const index = this.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.user_message_rule.includes(data.name)) { if (!this.user_message_rule.includes(data.name)) {
this.user_message_rule.push(data.name); this.user_message_rule.push(data.name);
} }
} else {
const index = this.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.user_message_rule.includes(data.name)) {
this.user_message_rule.push(data.name);
}
}
} }
} }
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/info/message.min.css"; @import "../../assets/css/info/message.min.css";
.tip { .tip {
padding: 8px 16px; padding: 8px 16px;
background-color: #ecf8ff; background-color: #ecf8ff;
border-radius: 4px; border-radius: 4px;
border-left: 5px solid #50bfff; border-left: 5px solid #50bfff;
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
\ No newline at end of file
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
<el-table-column prop="update_time_cn" label="修改时间" width="200" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="update_time_cn" label="修改时间" width="200" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column label="操作" width="250" align="center"> <el-table-column label="操作" width="250" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" @click="goToSubAccountEdit(scope.row.sbat_id,scope.row.ynat_id)">编辑</el-button> <el-button size="mini" @click="goToSubAccountEdit(scope.row.sbat_id, scope.row.ynat_id)">编辑</el-button>
<template v-if="scope.row.status == 1"> <template v-if="scope.row.status == 1">
<el-button size="mini" type="warning" @click="confirmEnable(scope.row,2)">禁用</el-button> <el-button size="mini" type="warning" @click="confirmEnable(scope.row, 2)">禁用</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button size="mini" type="success" @click="confirmEnable(scope.row,1)">启用</el-button> <el-button size="mini" type="success" @click="confirmEnable(scope.row, 1)">启用</el-button>
</template> </template>
<el-button size="mini" type="danger" @click="confirmDelete(scope.row)">删除</el-button> <el-button size="mini" type="danger" @click="confirmDelete(scope.row)">删除</el-button>
</template> </template>
...@@ -66,111 +66,59 @@ ...@@ -66,111 +66,59 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip);
export default { export default {
name: "subAccount", name: "subAccount",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
tableData: [], tableData: [],
create_time_val: '', create_time_val: '',
update_time_val: '', update_time_val: '',
formParam: { formParam: {
mobile: '', mobile: '',
name: '', name: '',
status: '', status: '',
create_type: '', create_type: '',
create_time: '', create_time: '',
update_time: '' update_time: ''
}
};
},
created() {
this.getData();
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formParam.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formParam.update_time = '';
}
if (this.update_time_val) {
this.formParam.update_time = this.update_time_val[0] + '~' + this.update_time_val[1];
} else {
this.formParam.update_time = '';
}
var params = Object.assign({}, {page: this.page, limit: this.limit}, this.formParam);
this.$http('GET', "/api/subAccount/list", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = res.data.total;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}) };
}, },
/** created() {
* 1启用,2禁用 this.getData();
* @param row
*/
confirmEnable(row, type) {
if (type == 1) {
var html = `确定<span style="color: #00BFBF">启用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:启用后,该子账号可登录芯链系统,操作对应权限页面</p>`;
} else {
var html = `确定<span style="color: #E6A23C">禁用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:禁用后,该子账号无法再登录芯链系统</p>`;
}
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: type,
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", {sbat_id: row.sbat_id, status: type}).then(res => {
if (res.code === 0) {
this.getData();
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
});
}, },
/** methods: {
* 删除 getData() {
*/ //格式化时间
confirmDelete(row) { if (this.create_time_val) {
var html = `确定<span style="color: red;">删除</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:删除后,该子账号从系统清除,无法再登录芯链系统!</p>`; this.formParam.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
this.$confirm(html, '提示', { } else {
confirmButtonText: '确定', this.formParam.update_time = '';
cancelButtonText: '取消', }
type: 'warning', if (this.update_time_val) {
dangerouslyUseHTMLString: true this.formParam.update_time = this.update_time_val[0] + '~' + this.update_time_val[1];
}).then(() => { } else {
this.$http('POST', "/api/subAccount/changeStatus", {sbat_id: row.sbat_id, status: 0}).then(res => { this.formParam.update_time = '';
}
var params = Object.assign({}, { page: this.page, limit: this.limit }, this.formParam);
this.$http('GET', "/api/subAccount/list", params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.getData(); this.tableData = res.data.list || [];
this.total = res.data.total;
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
...@@ -178,51 +126,103 @@ export default { ...@@ -178,51 +126,103 @@ export default {
}); });
} }
}) })
}).catch(() => { },
/**
* 1启用,2禁用
* @param row
*/
confirmEnable(row, type) {
if (type == 1) {
var html = `确定<span style="color: #00BFBF">启用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:启用后,该子账号可登录芯链系统,操作对应权限页面</p>`;
} else {
var html = `确定<span style="color: #E6A23C">禁用</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:禁用后,该子账号无法再登录芯链系统</p>`;
}
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: type,
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", { sbat_id: row.sbat_id, status: type }).then(res => {
if (res.code === 0) {
this.getData();
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
}); });
}, },
goToSubAccountEdit(sbat_id, ynat_id) { /**
this.$router.push(`/subAccountEdit?sbat_id=${sbat_id}&ynat_id=${ynat_id}`); * 删除
}, */
/** confirmDelete(row) {
* 分页条数切换 var html = `确定<span style="color: red;">删除</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:删除后,该子账号从系统清除,无法再登录芯链系统!</p>`;
* @param val this.$confirm(html, '提示', {
*/ confirmButtonText: '确定',
handleSizeChange(val) { cancelButtonText: '取消',
this.limit = val; type: 'warning',
this.getData(); dangerouslyUseHTMLString: true
}, }).then(() => {
/** this.$http('POST', "/api/subAccount/changeStatus", { sbat_id: row.sbat_id, status: 0 }).then(res => {
* 分页点击切换 if (res.code === 0) {
* @param val this.getData();
*/ } else {
handleCurrentChange(val) { this.$message({
this.page = val; message: res.msg,
this.getData(); type: 'warning'
}, });
/** }
* 重置 })
* @param formName }).catch(() => {
*/
resetForm(formName) { });
this.create_time_val = ''; },
this.deadline_time_val = ''; goToSubAccountEdit(sbat_id, ynat_id) {
this.$refs[formName].resetFields(); this.$router.push(`/subAccountEdit?sbat_id=${sbat_id}&ynat_id=${ynat_id}`);
},
/**
* 分页条数切换
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* 重置
* @param formName
*/
resetForm(formName) {
this.create_time_val = '';
this.deadline_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 搜索提交
*/
onSubmit() {
this.page = 1;
this.getData();
}
}, },
/** components: {
* 搜索提交 Menu
*/
onSubmit() {
this.page = 1;
this.getData();
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/info/subAccount.min.css"; @import "../../assets/css/info/subAccount.min.css";
</style> </style>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<!--子账号权限配置--> <!--子账号权限配置-->
<section class="role-auth"> <section class="role-auth">
<ul class="row"> <ul class="row">
<li v-for="(item,index) in menuData" :key="item.id"> <li v-for="(item, index) in menuData" :key="item.id">
<el-tree ref="tree" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckChange"></el-tree> <el-tree ref="tree" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckChange"></el-tree>
</li> </li>
</ul> </ul>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<!--子账号消息推送配置--> <!--子账号消息推送配置-->
<section class="role-auth"> <section class="role-auth">
<ul class="row"> <ul class="row">
<li v-for="(item,index) in messageMenu" :key="item.id"> <li v-for="(item, index) in messageMenu" :key="item.id">
<el-tree ref="treeMsg" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckMsgChange"></el-tree> <el-tree ref="treeMsg" :data="item" show-checkbox node-key="id" :props="defaultProps" default-expand-all @check-change="handleCheckMsgChange"></el-tree>
</li> </li>
</ul> </ul>
...@@ -45,255 +45,255 @@ ...@@ -45,255 +45,255 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button> <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row> </el-row>
</el-form> </el-form>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Checkbox, CheckboxButton, CheckboxGroup, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Row, Select, Table, TableColumn, Tag, Tooltip, Tree} from 'element-ui' import { Autocomplete, Button, Checkbox, CheckboxButton, CheckboxGroup, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Row, Select, Table, TableColumn, Tag, Tooltip, Tree } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Tree).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton).use(Checkbox).use(CheckboxButton).use(CheckboxGroup); Vue.use(Button).use(Form).use(Select).use(Tree).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton).use(Checkbox).use(CheckboxButton).use(CheckboxGroup);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
export default { export default {
name: "subAccountAdd", name: "subAccountAdd",
data() { data() {
return { return {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
rules: { rules: {
mobile: [ mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'}, { required: true, message: '请输入手机号', trigger: 'blur' },
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'} { pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur' }
], ],
name: [{ name: [{
required: true, required: true,
message: '请输入名称', message: '请输入名称',
trigger: 'blur' trigger: 'blur'
}], }],
password_raw: [{ password_raw: [{
required: true, required: true,
message: '请输入密码', message: '请输入密码',
trigger: 'blur' trigger: 'blur'
}], }],
email: [ email: [
{required: true, message: '请输入邮箱', trigger: 'blur'}, { required: true, message: '请输入邮箱', trigger: 'blur' },
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']} { type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change'] }
] ]
}, },
menuData: [],//权限菜单 menuData: [],//权限菜单
messageMenu: [],//消息权限菜单 messageMenu: [],//消息权限菜单
formParam: { formParam: {
mobile: '', mobile: '',
name: '', name: '',
password_raw: '123456', password_raw: '123456',
email: '', email: '',
user_rule: [], user_rule: [],
user_message_rule: [] user_message_rule: []
}
};
},
created() {
this.getMenu();
this.getMessageMenu();
},
methods: {
/**
* 全选 反选
*/
checkAll(type) {
if (type == 1) {
var data = this.$refs.tree;
if (data.length > 0) {
if (this.checked) {
data.forEach((element, index) => {
if (this.menuData[index][0].name != '概况') {
data[index].setCheckedKeys([this.menuData[index][0].id]);
}
});
} else {
data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
}
} else {
var data = this.$refs.treeMsg;
if (data.length > 0) {
if (this.checked_msg) {
data.forEach((element, index) => {
data[index].setCheckedKeys([this.messageMenu[index][0].id]);
});
} else {
data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
} }
} };
}, },
/** created() {
* 取消 this.getMenu();
*/ this.getMessageMenu();
canel() {
this.closetab('/subAccountadd')
}, },
/** methods: {
* 关闭当前页面 /**
* @param path * 全选 反选
*/ */
closetab(path) { checkAll(type) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs')) if (type == 1) {
for (var i = 0; i < tab_arr.length; i++) { var data = this.$refs.tree;
if (tab_arr[i].path == path) { if (data.length > 0) {
tab_arr.splice(i, 1); if (this.checked) {
sessionStorage.setItem('tabs', JSON.stringify(tab_arr)); data.forEach((element, index) => {
if (path == this.$route.path) { if (this.menuData[index][0].name != '概况') {
if (i == 0) { data[index].setCheckedKeys([this.menuData[index][0].id]);
this.$router.push({ }
path: "/" });
}) } else {
data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
}
} else {
var data = this.$refs.treeMsg;
if (data.length > 0) {
if (this.checked_msg) {
data.forEach((element, index) => {
data[index].setCheckedKeys([this.messageMenu[index][0].id]);
});
} else { } else {
if (tab_arr[i - 1].query) { data.forEach((element, index) => {
data[index].setCheckedKeys([]);
});
}
}
}
},
/**
* 取消
*/
canel() {
this.closetab('/subAccountadd')
},
/**
* 关闭当前页面
* @param path
*/
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({ this.$router.push({
path: tab_arr[i - 1].path, path: "/"
query: tab_arr[i - 1].query
}) })
} else { } else {
this.$router.push({ if (tab_arr[i - 1].query) {
path: tab_arr[i - 1].path, this.$router.push({
}) path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
}
} }
} }
break;
} }
break;
}
}
this.$router.push('/subAccount');
},
/**
* 获取当前用户的权限菜单
*/
getMenu() {
this.$http('GET', "/api/subAccount/getMenu", {method: 'add'}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.menuData = newMenuData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 获取当前用户的消息权限菜单
*/
getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = newMenuData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 筛选子账号勾选的权限配置
* @param data
* @param checked
*/
handleCheckChange(data, checked) {
if (checked) {
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
} }
} else { this.$router.push('/subAccount');
const index = this.formParam.user_rule.indexOf(data.name); },
if (index !== -1) { /**
this.formParam.user_rule.splice(index, 1); * 获取当前用户的权限菜单
} */
if (data.children) { getMenu() {
this.$http('GET', "/api/subAccount/getMenu", { method: 'add' }).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.menuData = newMenuData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 获取当前用户的消息权限菜单
*/
getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = newMenuData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 筛选子账号勾选的权限配置
* @param data
* @param checked
*/
handleCheckChange(data, checked) {
if (checked) {
if (!this.formParam.user_rule.includes(data.name)) { if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name); this.formParam.user_rule.push(data.name);
} }
} else {
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
}
} }
} },
}, /**
/** * 筛选子账号勾选的消息推送配置
* 筛选子账号勾选的消息推送配置 * @param data
* @param data * @param checked
* @param checked */
*/ handleCheckMsgChange(data, checked) {
handleCheckMsgChange(data, checked) { if (checked) {
if (checked) {
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
} else {
const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_message_rule.includes(data.name)) { if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name); this.formParam.user_message_rule.push(data.name);
} }
}
}
},
/**
* 表单提交
* @param formName
*/
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/create", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
message: '创建成功',
type: 'success'
});
setTimeout(() => {
this.closetab('/subAccountadd')
}, 2000)
} else {
this.formParam.user_rule = JSON.parse(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.parse(this.formParam.user_message_rule);
this.$message({
message: res.msg,
type: 'error',
onClose: () => {
}
});
}
})
} else { } else {
return false; const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
}
} }
}); },
/**
* 表单提交
* @param formName
*/
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/create", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
message: '创建成功',
type: 'success'
});
setTimeout(() => {
this.closetab('/subAccountadd')
}, 2000)
} else {
this.formParam.user_rule = JSON.parse(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.parse(this.formParam.user_message_rule);
this.$message({
message: res.msg,
type: 'error',
onClose: () => {
}
});
}
})
} else {
return false;
}
});
}
}
,
components: {
Menu
} }
} }
, ;
components: {
Menu
}
}
;
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/info/subAccount.min.css"; @import "../../assets/css/info/subAccount.min.css";
</style> </style>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<!--子账号权限配置--> <!--子账号权限配置-->
<section class="role-auth"> <section class="role-auth">
<ul class="row"> <ul class="row">
<li v-for="(item,index) in menuData" :key="item.id"> <li v-for="(item, index) in menuData" :key="item.id">
<el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredRuleIds" default-expand-all node-key="id" @check-change="handleCheckChange"></el-tree> <el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredRuleIds" default-expand-all node-key="id" @check-change="handleCheckChange"></el-tree>
</li> </li>
</ul> </ul>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<!--子账号消息推送配置--> <!--子账号消息推送配置-->
<section class="role-auth"> <section class="role-auth">
<ul class="row"> <ul class="row">
<li v-for="(item,index) in messageMenu" :key="item.id"> <li v-for="(item, index) in messageMenu" :key="item.id">
<el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree> <el-tree :data="item" show-checkbox :props="defaultProps" :default-checked-keys="filteredMessageIds" default-expand-all node-key="id" @check-change="handleCheckMsgChange"></el-tree>
</li> </li>
</ul> </ul>
...@@ -45,298 +45,298 @@ ...@@ -45,298 +45,298 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button> <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row> </el-row>
</el-form> </el-form>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Checkbox, CheckboxButton, CheckboxGroup, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Row, Select, Table, TableColumn, Tag, Tooltip, Tree} from 'element-ui' import { Autocomplete, Button, Checkbox, CheckboxButton, CheckboxGroup, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Row, Select, Table, TableColumn, Tag, Tooltip, Tree } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Tree).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton).use(Checkbox).use(CheckboxButton).use(CheckboxGroup); Vue.use(Button).use(Form).use(Select).use(Tree).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton).use(Checkbox).use(CheckboxButton).use(CheckboxGroup);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
export default { export default {
name: "subAccountEdit", name: "subAccountEdit",
data() { data() {
return { return {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
rules: { rules: {
mobile: [ mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'}, { required: true, message: '请输入手机号', trigger: 'blur' },
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'} { pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur' }
], ],
name: [{ name: [{
required: true, required: true,
message: '请输入名称', message: '请输入名称',
trigger: 'blur' trigger: 'blur'
}], }],
password_raw: [{ password_raw: [{
required: true, required: true,
message: '请输入密码', message: '请输入密码',
trigger: 'blur' trigger: 'blur'
}], }],
email: [ email: [
{required: true, message: '请输入邮箱', trigger: 'blur'}, { required: true, message: '请输入邮箱', trigger: 'blur' },
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']} { type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change'] }
] ]
}, },
menuData: [],//权限菜单 menuData: [],//权限菜单
messageMenu: [],//消息权限菜单 messageMenu: [],//消息权限菜单
filteredRuleIds: [], filteredRuleIds: [],
filteredMessageIds: [], filteredMessageIds: [],
ynat_id: this.$route.query.ynat_id, ynat_id: this.$route.query.ynat_id,
formParam: { formParam: {
sbat_id: this.$route.query.sbat_id, sbat_id: this.$route.query.sbat_id,
mobile: '', mobile: '',
name: '', name: '',
password_raw: '', password_raw: '',
email: '', email: '',
user_message_rule: [], user_message_rule: [],
user_rule: [] user_rule: []
} }
}; };
}, },
created() { created() {
this.getData(); this.getData();
this.getMenu(); this.getMenu();
this.getMessageMenu(); this.getMessageMenu();
},
methods: {
/**
* 取消
*/
canel() {
this.closetab('/subAccountEdit')
}, },
/** methods: {
* 关闭当前页面 /**
* @param path * 取消
*/ */
closetab(path) { canel() {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs')) this.closetab('/subAccountEdit')
for (var i = 0; i < tab_arr.length; i++) { },
if (tab_arr[i].path == path) { /**
tab_arr.splice(i, 1); * 关闭当前页面
sessionStorage.setItem('tabs', JSON.stringify(tab_arr)); * @param path
if (path == this.$route.path) { */
if (i == 0) { closetab(path) {
this.$router.push({ let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
path: "/" for (var i = 0; i < tab_arr.length; i++) {
}) if (tab_arr[i].path == path) {
} else { tab_arr.splice(i, 1);
if (tab_arr[i - 1].query) { sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({ this.$router.push({
path: tab_arr[i - 1].path, path: "/"
query: tab_arr[i - 1].query
}) })
} else { } else {
this.$router.push({ if (tab_arr[i - 1].query) {
path: tab_arr[i - 1].path, this.$router.push({
}) path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
}
} }
} }
break;
} }
break;
} }
} this.$router.push('/subAccount');
this.$router.push('/subAccount'); },
}, getData() {
getData() { this.$http('GET', "/api/subAccount/getSubAccountInfo", { sbat_id: this.formParam.sbat_id }).then(res => {
this.$http('GET', "/api/subAccount/getSubAccountInfo", {sbat_id: this.formParam.sbat_id}).then(res => { if (res.code === 0) {
if (res.code === 0) { //赋值子账号信息
//赋值子账号信息 this.formParam.mobile = res.data.mobile;
this.formParam.mobile = res.data.mobile; this.formParam.name = res.data.name;
this.formParam.name = res.data.name; this.formParam.password_raw = res.data.password_raw;
this.formParam.password_raw = res.data.password_raw; this.formParam.email = res.data.email;
this.formParam.email = res.data.email; } else {
} else { this.$message({
this.$message({ message: res.msg,
message: res.msg, type: 'warning'
type: 'warning'
});
}
})
},
/**
* 获取当前用户的权限菜单
*/
getMenu() {
this.$http('GET', "/api/subAccount/getMenu", {sbat_id: this.formParam.sbat_id}).then(res => {
if (res.code === 0) {
if (res.data.data.length > 0) {
let newMenuData = res.data.data.map(item => [item]);
this.menuData = newMenuData;
const filteredIds = [];
res.data.data.forEach(item => {
if (item.children) {
const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
if (item.checked) {
filteredIds.push(item.id);
}
}
}); });
this.filteredRuleIds = filteredIds; }
})
},
/**
* 获取当前用户的权限菜单
*/
getMenu() {
this.$http('GET', "/api/subAccount/getMenu", { sbat_id: this.formParam.sbat_id }).then(res => {
if (res.code === 0) {
if (res.data.data.length > 0) {
let newMenuData = res.data.data.map(item => [item]);
this.menuData = newMenuData;
const filteredIds = [];
res.data.data.forEach(item => {
if (item.children) {
const childrenWithChecked = item.children.filter(child => child.checked);
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
if (item.checked) {
filteredIds.push(item.id);
}
}
});
this.filteredRuleIds = filteredIds;
//筛选出rule //筛选出rule
const result = []; const result = [];
for (let obj of res.data.data) { for (let obj of res.data.data) {
if (obj.checked) { if (obj.checked) {
result.push(obj.name); result.push(obj.name);
} }
if (obj.children) { if (obj.children) {
for (let child of obj.children) { for (let child of obj.children) {
if (child.checked) { if (child.checked) {
result.push(child.name); result.push(child.name);
}
} }
} }
} }
this.formParam.user_rule = result;
} }
this.formParam.user_rule = result; } else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
} else { })
this.$message({ },
message: res.msg, /**
type: 'warning' * 获取当前用户的消息权限菜单
}); */
} getMessageMenu() {
}) this.$http('GET', "/api/subAccount/getMessageMenu", { ynat_id: this.ynat_id }).then(res => {
}, if (res.code === 0) {
/** if (res.data.data.length > 0) {
* 获取当前用户的消息权限菜单 let newMenuData = res.data.data.map(item => [item]);
*/ this.messageMenu = newMenuData;
getMessageMenu() { const filteredIds = [];
this.$http('GET', "/api/subAccount/getMessageMenu", {ynat_id: this.ynat_id}).then(res => { res.data.data.forEach(item => {
if (res.code === 0) { if (item.children) {
if (res.data.data.length > 0) { const childrenWithChecked = item.children.filter(child => child.checked);
let newMenuData = res.data.data.map(item => [item]); const ids = childrenWithChecked.map(child => child.id);
this.messageMenu = newMenuData; filteredIds.push(...ids);
const filteredIds = []; } else {
res.data.data.forEach(item => { if (item.checked) {
if (item.children) { filteredIds.push(item.id);
const childrenWithChecked = item.children.filter(child => child.checked); }
const ids = childrenWithChecked.map(child => child.id);
filteredIds.push(...ids);
} else {
if (item.checked) {
filteredIds.push(item.id);
} }
} });
}); this.filteredMessageIds = filteredIds;
this.filteredMessageIds = filteredIds; //筛选出rule-message
//筛选出rule-message const result = [];
const result = []; for (let obj of res.data.data) {
for (let obj of res.data.data) { if (obj.checked) {
if (obj.checked) { result.push(obj.name);
result.push(obj.name); }
} if (obj.children) {
if (obj.children) { for (let child of obj.children) {
for (let child of obj.children) { if (child.checked) {
if (child.checked) { result.push(child.name);
result.push(child.name); }
} }
} }
} }
this.formParam.user_message_rule = result;
} }
this.formParam.user_message_rule = result; } else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
} else { })
this.$message({ },
message: res.msg, /**
type: 'warning' * 筛选子账号勾选的权限配置
}); * @param data
} * @param checked
}) */
}, handleCheckChange(data, checked) {
/** if (checked) {
* 筛选子账号勾选的权限配置
* @param data
* @param checked
*/
handleCheckChange(data, checked) {
if (checked) {
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
} else {
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_rule.includes(data.name)) { if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name); this.formParam.user_rule.push(data.name);
} }
} else {
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_rule.includes(data.name)) {
this.formParam.user_rule.push(data.name);
}
}
} }
} },
}, /**
/** * 筛选子账号勾选的消息推送配置
* 筛选子账号勾选的消息推送配置 * @param data
* @param data * @param checked
* @param checked */
*/ handleCheckMsgChange(data, checked) {
handleCheckMsgChange(data, checked) { if (checked) {
if (checked) {
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
} else {
const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_message_rule.includes(data.name)) { if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name); this.formParam.user_message_rule.push(data.name);
} }
}
}
},
/**
* 表单提交
* @param formName
*/
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/edit", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
message: '修改成功',
type: 'success'
});
setTimeout(() => {
this.closetab('/subAccountEdit')
}, 2000)
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
} else { } else {
return false; const index = this.formParam.user_message_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_message_rule.splice(index, 1);
}
if (data.children) {
if (!this.formParam.user_message_rule.includes(data.name)) {
this.formParam.user_message_rule.push(data.name);
}
}
} }
}); },
/**
* 表单提交
* @param formName
*/
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.formParam.user_rule = JSON.stringify(this.formParam.user_rule);
this.formParam.user_message_rule = JSON.stringify(this.formParam.user_message_rule);
this.$http('POST', "/api/subAccount/edit", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
message: '修改成功',
type: 'success'
});
setTimeout(() => {
this.closetab('/subAccountEdit')
}, 2000)
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
} else {
return false;
}
});
}
}
,
components: {
Menu
} }
} }
, ;
components: {
Menu
}
}
;
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/info/subAccount.min.css"; @import "../../assets/css/info/subAccount.min.css";
</style> </style>
\ No newline at end of file
...@@ -157,244 +157,244 @@ ...@@ -157,244 +157,244 @@
</div> </div>
</div> </div>
</div> </div>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tabs, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tabs, Tag, Tooltip } from 'element-ui'
import Tool from "@/tool"; import Tool from "@/tool";
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import qs from 'qs'; import qs from 'qs';
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem).use(Tabs).use(Radio).use(RadioGroup).use(RadioButton); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem).use(Tabs).use(Radio).use(RadioGroup).use(RadioButton);
export default { export default {
name: "inquireTransform", name: "inquireTransform",
data() { data() {
return { return {
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
text: '最近一个月', text: '最近一个月',
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]); picker.$emit('pick', [start, end]);
} }
}, { }, {
text: '最近三个月', text: '最近三个月',
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]); picker.$emit('pick', [start, end]);
} }
}, { }, {
text: '最近1年', text: '最近1年',
onClick(picker) { onClick(picker) {
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365); start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
picker.$emit('pick', [start, end]); picker.$emit('pick', [start, end]);
} }
}] }]
}, },
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
tabPosition: 0, tabPosition: 0,
update_time_val: '', update_time_val: '',
up_valid_time_val: '', up_valid_time_val: '',
create_time_val: '', create_time_val: '',
bottom_info: {}, bottom_info: {},
formInline: { formInline: {
order_by: '', order_by: '',
asc: '', asc: '',
goods_name: '',//型号 goods_name: '',//型号
brand_name: '',//品牌 brand_name: '',//品牌
source: '',//来源 source: '',//来源
up_status: '',//状态 up_status: '',//状态
update_time: '',//更新时间 update_time: '',//更新时间
up_valid_time: '',//上架有效期 up_valid_time: '',//上架有效期
create_time: ''//创建时间 create_time: ''//创建时间
} }
}; };
}, },
created() { created() {
this.getData() this.getData()
}, },
methods: { methods: {
getData() { getData() {
//格式化时间 //格式化时间
if (this.update_time_val) { if (this.update_time_val) {
this.formInline.update_time = this.update_time_val[0] + '~' + this.update_time_val[1]; this.formInline.update_time = this.update_time_val[0] + '~' + this.update_time_val[1];
} else { } else {
this.formInline.update_time = ''; this.formInline.update_time = '';
} }
if (this.up_valid_time_val) {
this.formInline.up_valid_time = this.up_valid_time_val[0] + '~' + this.up_valid_time_val[1];
} else {
this.formInline.up_valid_time = '';
}
if (this.create_time_val) { if (this.up_valid_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1]; this.formInline.up_valid_time = this.up_valid_time_val[0] + '~' + this.up_valid_time_val[1];
} else { } else {
this.formInline.create_time = ''; this.formInline.up_valid_time = '';
} }
var params = Object.assign({}, {page: this.page, limit: this.limit}, this.formInline); if (this.create_time_val) {
this.$http('GET', "/api/statistics/inquiryChangeStatisticsList", params).then(res => { this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
if (res.code === 0) {
this.list = res.data.list || [];
this.bottom_info = res.data.bottom_info;
this.total = Number(res.data.total) || 0;
} else { } else {
this.$message({ this.formInline.create_time = '';
message: res.msg,
type: 'error'
});
} }
})
}, var params = Object.assign({}, { page: this.page, limit: this.limit }, this.formInline);
/** this.$http('GET', "/api/statistics/inquiryChangeStatisticsList", params).then(res => {
* 导出 if (res.code === 0) {
*/ this.list = res.data.list || [];
exportChange() { this.bottom_info = res.data.bottom_info;
var params = Object.assign({}, {token: Tool.getCookie('token')}, this.formInline, {is_export: 1}) this.total = Number(res.data.total) || 0;
var url = NODE_ENVS + '/api/statistics/inquiryChangeStatisticsList?' + qs.stringify(params);
const newsUrl = this.$router.resolve(url);
window.open(url);
},
/**
* 自定义排序
*/
sortChange(column, key, order) {
this.formInline.order_by = column.prop;
if (column.order == 'ascending') {
this.formInline.asc = 'asc';
} else if (column.order == 'descending') {
this.formInline.asc = 'desc';
}
this.getData();
},
/**
* 创建时间监听
* @param val
*/
changtime(val) {
this.getData();
},
/**
* 搜索型号
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else { } else {
cb([]); this.$message({
message: res.msg,
type: 'error'
});
} }
})
},
/**
* 导出
*/
exportChange() {
var params = Object.assign({}, { token: Tool.getCookie('token') }, this.formInline, { is_export: 1 })
var url = NODE_ENVS + '/api/statistics/inquiryChangeStatisticsList?' + qs.stringify(params);
const newsUrl = this.$router.resolve(url);
window.open(url);
},
/**
* 自定义排序
*/
sortChange(column, key, order) {
this.formInline.order_by = column.prop;
if (column.order == 'ascending') {
this.formInline.asc = 'asc';
} else if (column.order == 'descending') {
this.formInline.asc = 'desc';
} }
}) this.getData();
}, },
/** /**
* 品牌 * 创建时间监听
* @param queryString * @param val
* @param cb */
*/ changtime(val) {
querySearchAsyncBrand(queryString, cb) { this.getData();
this.$http('get', "/api/brand/get_stand_brand", { },
brand: queryString /**
}).then(res => { * 搜索型号
if (res.code == 0) { * @param queryString
if (res.data.list.length > 0) { * @param cb
var arrlist_ = res.data.list || []; */
var arr_ = [] querySearchAsync(queryString, cb) {
for (var i = 0; i < arrlist_.length; i++) { this.$http('get', "/api/search/getspu", {
arr_.push({ spu_name: queryString
value: arrlist_[i] }).then(res => {
}) if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, /**
/** * 品牌
* 搜索 * @param queryString
*/ * @param cb
onSubmit() { */
this.page = 1; querySearchAsyncBrand(queryString, cb) {
this.getData(); this.$http('get', "/api/brand/get_stand_brand", {
}, brand: queryString
/** }).then(res => {
* 重置 if (res.code == 0) {
* @param formName if (res.data.list.length > 0) {
*/ var arrlist_ = res.data.list || [];
resetForm(formName) { var arr_ = []
this.update_time_val = ''; for (var i = 0; i < arrlist_.length; i++) {
this.up_valid_time_val = ''; arr_.push({
this.$refs[formName].resetFields(); value: arrlist_[i]
}, })
/** }
* 分页条数切换 cb(arr_);
* @param val } else {
*/ cb([]);
handleSizeChange(val) { }
this.limit = val; }
this.getData(); })
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置
* @param formName
*/
resetForm(formName) {
this.update_time_val = '';
this.up_valid_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 分页条数切换
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
}
}, },
/** components: {
* 分页点击切换 Menu
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.tetx-goods { .tetx-goods {
font-size: 12px; font-size: 12px;
margin-top: 20px; margin-top: 20px;
flex-wrap: wrap; flex-wrap: wrap;
span { span {
color: #F59A23; color: #F59A23;
font-weight: bold; font-weight: bold;
} }
em { em {
color: #FF0000; color: #FF0000;
font-weight: bold; font-weight: bold;
margin-right: 15px; margin-right: 15px;
}
} }
}
</style> </style>
\ No newline at end of file
...@@ -95,10 +95,10 @@ ...@@ -95,10 +95,10 @@
</el-table-column> </el-table-column>
<el-table-column prop="i_status" label="状态" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="i_status" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.i_status==2" type="success" @click="editInquire(scope.row.id)">已报价</el-tag> <el-tag v-if="scope.row.i_status == 2" type="success" @click="editInquire(scope.row.id)">已报价</el-tag>
<el-tag v-else-if="scope.row.i_status==1" @click="editInquire(scope.row.id)">待报价</el-tag> <el-tag v-else-if="scope.row.i_status == 1" @click="editInquire(scope.row.id)">待报价</el-tag>
<el-tag v-else-if="scope.row.i_status==9" type="danger">已删除</el-tag> <el-tag v-else-if="scope.row.i_status == 9" type="danger">已删除</el-tag>
<el-tag v-else-if="scope.row.i_status==-1" type="warning">已关闭</el-tag> <el-tag v-else-if="scope.row.i_status == -1" type="warning">已关闭</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="buyer_info" label="猎芯采购员" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="buyer_info" label="猎芯采购员" width="100" :show-overflow-tooltip="true" align="center">
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<!--未成单--> <!--未成单-->
<span v-if="scope.row.is_purchased == 0">{{ scope.row.is_purchased_val }}</span> <span v-if="scope.row.is_purchased == 0">{{ scope.row.is_purchased_val }}</span>
<!--成单--> <!--成单-->
<a v-if="scope.row.is_purchased == 1" class="alink" :href="'/#/orderTrackGoods?inquiry_sn='+scope.row.inquiry_sn">{{ scope.row.is_purchased_val }}</a> <a v-if="scope.row.is_purchased == 1" class="alink" :href="'/#/orderTrackGoods?inquiry_sn=' + scope.row.inquiry_sn">{{ scope.row.is_purchased_val }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="customer_tag" label="客户性质" width="80" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="customer_tag" label="客户性质" width="80" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -179,11 +179,11 @@ ...@@ -179,11 +179,11 @@
<el-table-column prop="brand_name" label="品牌" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="brand_name" label="品牌" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="status" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.quote_status==1" type="info">确认中</el-tag> <el-tag v-if="scope.row.quote_status == 1" type="info">确认中</el-tag>
<el-tag v-else-if="scope.row.quote_status==2" type="success">已选中</el-tag> <el-tag v-else-if="scope.row.quote_status == 2" type="success">已选中</el-tag>
<a v-else-if="scope.row.quote_status==3" class="alink" :href="'/#/orderTrackGoods?inquiry_item_id='+scope.row.inquiry_items_id">已成单</a> <a v-else-if="scope.row.quote_status == 3" class="alink" :href="'/#/orderTrackGoods?inquiry_item_id=' + scope.row.inquiry_items_id">已成单</a>
<el-tag v-else-if="scope.row.quote_status==4" type="warning">已关闭</el-tag> <el-tag v-else-if="scope.row.quote_status == 4" type="warning">已关闭</el-tag>
<el-tag v-else-if="scope.row.quote_status==7">待确认</el-tag> <el-tag v-else-if="scope.row.quote_status == 7">待确认</el-tag>
<template v-if="scope.row.status_tips"> <template v-if="scope.row.status_tips">
<el-tooltip :aa="scope" class="item" effect="dark" placement="top-start"> <el-tooltip :aa="scope" class="item" effect="dark" placement="top-start">
<i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i> <i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i>
...@@ -200,16 +200,16 @@ ...@@ -200,16 +200,16 @@
</el-table-column> </el-table-column>
<el-table-column prop="price_origin" label="价格" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="price_origin" label="价格" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span> <span>{{ scope.row.price_origin | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="currency" label="币种" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="currency" label="币种" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.currency==1">人民币</span> <span v-if="scope.row.currency == 1">人民币</span>
<span v-else-if="scope.row.currency==2">美元</span> <span v-else-if="scope.row.currency == 2">美元</span>
<span v-else-if="scope.row.currency==3">港币</span> <span v-else-if="scope.row.currency == 3">港币</span>
<span v-else-if="scope.row.currency==4">欧元</span> <span v-else-if="scope.row.currency == 4">欧元</span>
<span v-else-if="scope.row.currency==5">英磅</span> <span v-else-if="scope.row.currency == 5">英磅</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="tax_rate" label="税率" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="tax_rate" label="税率" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
<el-table-column prop="moq" label="起订量" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="moq" label="起订量" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="price_other" label="其他费用" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span> <span>{{ scope.row.price_other | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" width="120" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="remark" label="备注" width="120" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<el-table-column prop="mpq" label="标准包装量" width="120" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="mpq" label="标准包装量" width="120" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="stock" label="库存数量" width="120" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="stock" label="库存数量" width="120" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="cn_ladder_price" label="国内含税价" width="120" :show-overflow-tooltip="true" align="center"> <el-table-column prop="cn_ladder_price" label="国内含税价" width="120" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope" v-if="scope.row.cn_ladder_price&&scope.row.cn_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length > 0">
<el-popover effect="light" trigger="hover" placement="bottom"> <el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.cn_ladder_price"> <p class="row" v-for="item in scope.row.cn_ladder_price">
<span>{{ item.purchases }}+</span> <span>{{ item.purchases }}+</span>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="hk_ladder_price" label="香港交货价" width="120" :show-overflow-tooltip="true" align="center"> <el-table-column prop="hk_ladder_price" label="香港交货价" width="120" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope" v-if="scope.row.hk_ladder_price&&scope.row.hk_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.hk_ladder_price && scope.row.hk_ladder_price.length > 0">
<el-popover effect="light" trigger="hover" placement="bottom"> <el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.hk_ladder_price"> <p class="row" v-for="item in scope.row.hk_ladder_price">
<span>{{ item.purchases }}+</span> <span>{{ item.purchases }}+</span>
...@@ -274,8 +274,8 @@ ...@@ -274,8 +274,8 @@
<el-table-column prop="hk_delivery_time" label="香港交期" width="150" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="hk_delivery_time" label="香港交期" width="150" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="goods_status" label="状态" width="150" :show-overflow-tooltip="true" align="center"> <el-table-column prop="goods_status" label="状态" width="150" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.goods_status==1" class="f-green">上架</el-tag> <el-tag type="success" v-if="scope.row.goods_status == 1" class="f-green">上架</el-tag>
<el-tag type="info" v-else-if="scope.row.goods_status==3">下架</el-tag> <el-tag type="info" v-else-if="scope.row.goods_status == 3">下架</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -312,20 +312,20 @@ ...@@ -312,20 +312,20 @@
<el-table-column prop="brand_name" label="品牌" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="brand_name" label="品牌" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="status" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="info" v-if="scope.row.status==1">比价中</el-tag> <el-tag type="info" v-if="scope.row.status == 1">比价中</el-tag>
<el-tag type="info" v-else-if="scope.row.status==2">已选中</el-tag> <el-tag type="info" v-else-if="scope.row.status == 2">已选中</el-tag>
<el-tag type="info" v-else-if="scope.row.status==3">已确认</el-tag> <el-tag type="info" v-else-if="scope.row.status == 3">已确认</el-tag>
<el-tag type="success" v-else-if="scope.row.status==4">已成单</el-tag> <el-tag type="success" v-else-if="scope.row.status == 4">已成单</el-tag>
<el-tag type="warning" v-else-if="scope.row.status==5">已关闭</el-tag> <el-tag type="warning" v-else-if="scope.row.status == 5">已关闭</el-tag>
<el-tag type="danger" v-else-if="scope.row.status==9">已删除</el-tag> <el-tag type="danger" v-else-if="scope.row.status == 9">已删除</el-tag>
<el-tag type="warning" v-else-if="scope.row.status==-1">已撤销</el-tag> <el-tag type="warning" v-else-if="scope.row.status == -1">已撤销</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_status_val" label="是否有效" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="expire_status_val" label="是否有效" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="price_rmb" label="价格" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="price_rmb" label="价格" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.currency == 1">{{ scope.row.price_rmb|floatZero }}</span> <span v-if="scope.row.currency == 1">{{ scope.row.price_rmb | floatZero }}</span>
<span v-else>{{ scope.row.price_origin|floatZero }}</span> <span v-else>{{ scope.row.price_origin | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="currency_val" label="币种" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="currency_val" label="币种" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
<el-table-column prop="moq" label="起订量" width="100" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="moq" label="起订量" width="100" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="price_other" label="其他费用" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span> <span>{{ scope.row.price_other | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" width="150" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="remark" label="备注" width="150" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
</template> </template>
</template> </template>
</div> </div>
<Menu/> <Menu />
<!--弹窗日志--> <!--弹窗日志-->
<el-dialog title="询价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisibleLog" width="1000px"> <el-dialog title="询价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisibleLog" width="1000px">
<el-table :data="logs" border max-height="600"> <el-table :data="logs" border max-height="600">
...@@ -386,12 +386,12 @@ ...@@ -386,12 +386,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row year-list"> <ul class="row year-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in year" :class="{curr:yearIndex==indexY}" @click="tabChange(indexY,1)">{{ v }}年</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in year" :class="{ curr: yearIndex == indexY }" @click="tabChange(indexY, 1)">{{ v }}年</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(1,year[yearIndex])">确定</el-button> <el-button size="mini" round @click="confirm(1, year[yearIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -400,12 +400,12 @@ ...@@ -400,12 +400,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndex==indexY}" @click="tabChange(indexY,2)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndex == indexY }" @click="tabChange(indexY, 2)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(2,period[periodIndex])">确定</el-button> <el-button size="mini" round @click="confirm(2, period[periodIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -414,12 +414,12 @@ ...@@ -414,12 +414,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndexTwo==indexY}" @click="tabChange(indexY,3)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndexTwo == indexY }" @click="tabChange(indexY, 3)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(3,period[periodIndexTwo])">确定</el-button> <el-button size="mini" round @click="confirm(3, period[periodIndexTwo])">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -474,182 +474,232 @@ ...@@ -474,182 +474,232 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2'
import Tool from '../../tool' import Tool from '../../tool'
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Radio, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import {NODE_ENVS} from "../../ajax"; import { NODE_ENVS } from "../../ajax";
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Radio).use(RadioGroup).use(RadioButton);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip);
Vue.use(VueClipboard); Vue.use(VueClipboard);
export default { export default {
name: "inquire", name: "inquire",
data() { data() {
return { return {
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000)); return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
}
},
title: '新增报价',
tabIndex: 0,
dialogVisible: false,
listVisible: false,
dialogVisibleLog: false,
total: 0,
limit: 10,
page: 1,
tableData: [],
multipleSelection: [],
logs: [],
inquireObj: {},
currentQuotoDataList: [],//当前报价列表
matchingskuDataList: [],//匹配库存列表
historyDataList: [],//历史报价列表
isModify: false,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
pin_obj_id: '',//关联库存id
visible: false,
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
ruleForm: {
inquiry_id: '',
inquiry_sn: '',
inquiry_items_id: '',
quote_id: '',
goods_name: '',
quote_number: '',
currency: '1',
batch: '',
mpq: '',
price_other: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
delivery_int: '',
delivery_unit_val: '工作日',
delivery_time: '',//delivery_int+delivery_unit_val
moq: '',
expire_time: '',
remark: ''
},
rules: {
goods_name: [{
required: true,
message: '请输入报价型号',
trigger: 'blur'
}],
quote_number: [{
required: true,
message: '请输入报价数量',
trigger: 'blur'
}],
currency: [{
required: true,
message: '请选择币种',
trigger: 'blur'
}],
batch: [{
required: true,
message: '请输入批次',
trigger: 'change'
}],
price_origin: [{
required: true,
message: '请输入价格',
trigger: 'blur'
},],
delivery_int: [{
required: true,
message: '请输入货期',
trigger: 'blur'
}],
expire_time: [{
required: true,
message: '请输入报价有效期',
trigger: 'blur'
}]
},
create_time_val: '',//询价时间
deadline_time_val: '',//询价有效期
formParam: {
inquiry_sn: '',//询价单号
goods_name: '',//型号
brand_name: '',//品牌
i_status: '',//状态
is_purchased: '',//是否成功
customer_tag: '',//客户性质
source_from: '',//来源类型
create_time: '',//询价时间
deadline_time: ''//询价有效期
} }
}, };
title: '新增报价', },
tabIndex: 0, created() {
dialogVisible: false, let status = this.$route.query.status;
listVisible: false, this.formParam.inquiry_sn = this.$route.query.inquiry_sn || '';
dialogVisibleLog: false, if (status) {
total: 0, this.formParam.i_status = status;
limit: 10,
page: 1,
tableData: [],
multipleSelection: [],
logs: [],
inquireObj: {},
currentQuotoDataList: [],//当前报价列表
matchingskuDataList: [],//匹配库存列表
historyDataList: [],//历史报价列表
isModify: false,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
pin_obj_id: '',//关联库存id
visible: false,
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
ruleForm: {
inquiry_id: '',
inquiry_sn: '',
inquiry_items_id: '',
quote_id: '',
goods_name: '',
quote_number: '',
currency: '1',
batch: '',
mpq: '',
price_other: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
delivery_int: '',
delivery_unit_val: '工作日',
delivery_time: '',//delivery_int+delivery_unit_val
moq: '',
expire_time: '',
remark: ''
},
rules: {
goods_name: [{
required: true,
message: '请输入报价型号',
trigger: 'blur'
}],
quote_number: [{
required: true,
message: '请输入报价数量',
trigger: 'blur'
}],
currency: [{
required: true,
message: '请选择币种',
trigger: 'blur'
}],
batch: [{
required: true,
message: '请输入批次',
trigger: 'change'
}],
price_origin: [{
required: true,
message: '请输入价格',
trigger: 'blur'
},],
delivery_int: [{
required: true,
message: '请输入货期',
trigger: 'blur'
}],
expire_time: [{
required: true,
message: '请输入报价有效期',
trigger: 'blur'
}]
},
create_time_val: '',//询价时间
deadline_time_val: '',//询价有效期
formParam: {
inquiry_sn: '',//询价单号
goods_name: '',//型号
brand_name: '',//品牌
i_status: '',//状态
is_purchased: '',//是否成功
customer_tag: '',//客户性质
source_from: '',//来源类型
create_time: '',//询价时间
deadline_time: ''//询价有效期
}
};
},
created() {
let status = this.$route.query.status;
this.formParam.inquiry_sn = this.$route.query.inquiry_sn || '';
if (status) {
this.formParam.i_status = status;
}
this.getData();
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formParam.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formParam.create_time = '';
}
if (this.deadline_time_val) {
this.formParam.deadline_time = this.deadline_time_val[0] + '~' + this.deadline_time_val[1];
} else {
this.formParam.deadline_time = '';
} }
this.getData();
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formParam.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formParam.create_time = '';
}
if (this.deadline_time_val) {
this.formParam.deadline_time = this.deadline_time_val[0] + '~' + this.deadline_time_val[1];
} else {
this.formParam.deadline_time = '';
}
var params = Object.assign({}, { page: this.page }, { limit: this.limit }, this.formParam)
this.$http('get', "/api/inquiry/getlist", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = res.data.total;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 报价新增
*/
add() {
if (this.multipleSelection.length != 1) {
this.$message({
showClose: true,
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].i_status == 1 || this.multipleSelection[0].i_status == 2) {
this.title = '新增报价';
this.dialogVisible = true;
this.isModify = false;//标记新增状态
this.ruleForm.inquiry_sn = this.multipleSelection[0].inquiry_sn;
this.ruleForm.inquiry_id = this.multipleSelection[0].inquiry_id;
this.ruleForm.inquiry_items_id = this.multipleSelection[0].id;
this.ruleForm.goods_name = this.multipleSelection[0].goods_name; //赋值型号
this.ruleForm.brand_name = this.multipleSelection[0].brand_name; //赋值品牌
var params = Object.assign({}, {page: this.page}, {limit: this.limit}, this.formParam) this.ruleForm.quote_number = '';//清空报价数量
this.$http('get', "/api/inquiry/getlist", params).then(res => { this.ruleForm.price_origin = '';//清空价格
if (res.code === 0) { this.ruleForm.currency = '';//清空币种
this.tableData = res.data.list || []; this.ruleForm.tax_rate = '13%';//恢复税率
this.total = res.data.total; this.ruleForm.batch = '';//清空批次
this.ruleForm.delivery_int = '';//清空货期
this.ruleForm.delivery_unit_val = '工作日';//恢复货期默认单位
this.ruleForm.mpq = '';//清空最小包装数量
this.ruleForm.moq = '';//清空起订量
this.ruleForm.price_other = '';//清空其他费用
this.ruleForm.expire_time = '';//清空报价有效期
this.ruleForm.remark = '';//清空备注
this.ruleForm.quote_id = '';//新增的时候不需要quote_id
} else { } else {
this.$message({ this.$message({
message: res.msg, showClose: true,
message: '该订单不可报价',
type: 'warning' type: 'warning'
}); });
return;
} }
})
}, this.$nextTick(() => {
/** this.$refs['ruleForm'].resetFields();
* 报价新增 })
*/ },
add() { /**
if (this.multipleSelection.length != 1) { * 匹配库存,历史报价新增
this.$message({ */
showClose: true, addMatchingHistory(row) {
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].i_status == 1 || this.multipleSelection[0].i_status == 2) {
this.title = '新增报价'; this.title = '新增报价';
this.dialogVisible = true; this.dialogVisible = true;
this.isModify = false;//标记新增状态 this.isModify = false;//标记新增状态
this.ruleForm.inquiry_sn = this.multipleSelection[0].inquiry_sn; this.ruleForm.inquiry_sn = this.inquireObj.inquiry_sn;
this.ruleForm.inquiry_id = this.multipleSelection[0].inquiry_id; this.ruleForm.inquiry_id = this.inquireObj.inquiry_id;
this.ruleForm.inquiry_items_id = this.multipleSelection[0].id; this.ruleForm.inquiry_items_id = this.inquireObj.id;
this.ruleForm.goods_name = this.multipleSelection[0].goods_name; //赋值型号 /**
this.ruleForm.brand_name = this.multipleSelection[0].brand_name; //赋值品牌 * 匹配库存关联goods_id
* 历史报价关联id
*/
if (this.tabIndex == 1) {
this.pin_obj_id = row.goods_id;
} else if (this.tabIndex == 2) {
this.pin_obj_id = row.id;
}
this.ruleForm.goods_name = row.goods_name; //赋值型号
this.ruleForm.brand_name = row.brand_name; //赋值品牌
this.ruleForm.quote_number = '';//清空报价数量 this.ruleForm.quote_number = '';//清空报价数量
this.ruleForm.price_origin = '';//清空价格 this.ruleForm.price_origin = '';//清空价格
this.ruleForm.currency = '';//清空币种 this.ruleForm.currency = '';//清空币种
...@@ -663,790 +713,740 @@ export default { ...@@ -663,790 +713,740 @@ export default {
this.ruleForm.expire_time = '';//清空报价有效期 this.ruleForm.expire_time = '';//清空报价有效期
this.ruleForm.remark = '';//清空备注 this.ruleForm.remark = '';//清空备注
this.ruleForm.quote_id = '';//新增的时候不需要quote_id this.ruleForm.quote_id = '';//新增的时候不需要quote_id
} else {
this.$message({
showClose: true,
message: '该订单不可报价',
type: 'warning'
});
return;
}
this.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
/**
* 匹配库存,历史报价新增
*/
addMatchingHistory(row) {
this.title = '新增报价';
this.dialogVisible = true;
this.isModify = false;//标记新增状态
this.ruleForm.inquiry_sn = this.inquireObj.inquiry_sn;
this.ruleForm.inquiry_id = this.inquireObj.inquiry_id;
this.ruleForm.inquiry_items_id = this.inquireObj.id;
this.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
/** /**
* 匹配库存关联goods_id * 报价按钮
* 历史报价关联id
*/ */
if (this.tabIndex == 1) { editInquire(id) {
this.pin_obj_id = row.goods_id; if (id) {
} else if (this.tabIndex == 2) { var inquiry_item_id = id;
this.pin_obj_id = row.id; } else {
} if (this.multipleSelection.length != 1) {
this.$message({
this.ruleForm.goods_name = row.goods_name; //赋值型号 showClose: true,
this.ruleForm.brand_name = row.brand_name; //赋值品牌 message: '请选择一条询价信息',
this.ruleForm.quote_number = '';//清空报价数量 type: 'warning'
this.ruleForm.price_origin = '';//清空价格 });
this.ruleForm.currency = '';//清空币种 return;
this.ruleForm.tax_rate = '13%';//恢复税率 }
this.ruleForm.batch = '';//清空批次
this.ruleForm.delivery_int = '';//清空货期
this.ruleForm.delivery_unit_val = '工作日';//恢复货期默认单位
this.ruleForm.mpq = '';//清空最小包装数量
this.ruleForm.moq = '';//清空起订量
this.ruleForm.price_other = '';//清空其他费用
this.ruleForm.expire_time = '';//清空报价有效期
this.ruleForm.remark = '';//清空备注
this.ruleForm.quote_id = '';//新增的时候不需要quote_id
this.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
/**
* 报价按钮
*/
editInquire(id) {
if (id) {
var inquiry_item_id = id;
} else {
if (this.multipleSelection.length != 1) {
this.$message({
showClose: true,
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
//询价单状态为“待报价,已报价 //询价单状态为“待报价,已报价
if (this.multipleSelection[0].i_status == -1) { if (this.multipleSelection[0].i_status == -1) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: '请勾选待报价,已报价', message: '请勾选待报价,已报价',
type: 'warning' type: 'warning'
}); });
return; return;
}
var inquiry_item_id = this.multipleSelection[0].id;
} }
var inquiry_item_id = this.multipleSelection[0].id;
}
this.$http('GET', "/api/inquiry/detail", { this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: inquiry_item_id inquiry_item_id: inquiry_item_id
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.quote_list.length > 0) { if (res.data.quote_list.length > 0) {
//价单状态为“待确认,确认中” quote_status=7 待确认 quote_status=1 确认中 //价单状态为“待确认,确认中” quote_status=7 待确认 quote_status=1 确认中
if (res.data.quote_list[0].quote_status == 1 || res.data.quote_list[0].quote_status == 7) { if (res.data.quote_list[0].quote_status == 1 || res.data.quote_list[0].quote_status == 7) {
var data = res.data.quote_list[0]; var data = res.data.quote_list[0];
this.title = '修改报价'; this.title = '修改报价';
this.dialogVisible = true; this.dialogVisible = true;
this.isModify = true; //标记修改状态 this.isModify = true; //标记修改状态
this.ruleForm.inquiry_sn = data.inquiry_sn; this.ruleForm.inquiry_sn = data.inquiry_sn;
this.ruleForm.inquiry_id = data.inquiry_id; this.ruleForm.inquiry_id = data.inquiry_id;
this.ruleForm.inquiry_items_id = data.inquiry_items_id; this.ruleForm.inquiry_items_id = data.inquiry_items_id;
this.ruleForm.quote_id = data.id; //编辑的时候需要 this.ruleForm.quote_id = data.id; //编辑的时候需要
this.ruleForm.goods_name = data.goods_name;//赋值型号 this.ruleForm.goods_name = data.goods_name;//赋值型号
this.ruleForm.brand_name = data.brand_name;//赋值品牌 this.ruleForm.brand_name = data.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量 this.ruleForm.quote_number = data.quote_number;//报价数量
data.price_origin = this.float(data.price_origin);//价格转换 data.price_origin = this.float(data.price_origin);//价格转换
this.ruleForm.price_origin = data.price_origin;//价格 this.ruleForm.price_origin = data.price_origin;//价格
this.ruleForm.currency = data.currency.toString();//币种 this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率 this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = data.batch;//批次 this.ruleForm.batch = data.batch;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期 this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位 this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = data.mpq;//最小包装数量 this.ruleForm.mpq = data.mpq;//最小包装数量
this.ruleForm.moq = data.moq;//起订量 this.ruleForm.moq = data.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用 data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用 this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注 this.ruleForm.remark = data.remark;//备注
//报价有效期 //报价有效期
if (data.expire_time == '') { if (data.expire_time == '') {
const start = new Date(); const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2); start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start; this.ruleForm.expire_time = start;
} else {
this.ruleForm.expire_time = data.expire_time;
}
} else { } else {
this.ruleForm.expire_time = data.expire_time; this.$message({
showClose: true,
message: '请勾选报价单状态为“待确认,确认中',
type: 'warning'
});
return;
} }
} else {
this.$message({
showClose: true,
message: '请勾选报价单状态为“待确认,确认中',
type: 'warning'
});
return;
} }
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
});
} else { },
this.$message({ /**
message: res.msg, *匹配库存选择修改报价 一部分数据是来自当前报价的第一条
type: 'warning' */
}); editSku(row) {
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
if (this.currentQuotoDataList.length > 0) {
let data = this.currentQuotoDataList[0];
this.ruleForm.inquiry_sn = data.inquiry_sn;
this.ruleForm.inquiry_id = data.inquiry_id;
this.ruleForm.inquiry_items_id = data.inquiry_items_id;
this.ruleForm.quote_id = data.id; //编辑的时候需要
this.ruleForm.goods_name = row.goods_name;//赋值型号
this.ruleForm.brand_name = row.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量
//取当前报价的字段quote_number,与匹配库存里的阶梯价格符合条件的第一条
let quote_number = data.quote_number * 1;
let purchases_filter = [];
if (row.cn_ladder_price.length > 0) {
purchases_filter = row.cn_ladder_price.filter((item) => {
if (quote_number <= item.purchases) {
return item;
}
});
}
if (purchases_filter.length > 0) {
this.ruleForm.price_origin = purchases_filter[0].price * 1;//价格
} else {
this.ruleForm.price_origin = 0;//价格
}
this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = row.batch_sn;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = row.mpq;//最小包装数量
this.ruleForm.moq = row.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注
//报价有效期
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
} }
});
}, },
/** /**
*匹配库存选择修改报价 一部分数据是来自当前报价的第一条 * 编辑修改
*/ */
editSku(row) { edit(row) {
this.title = '修改报价'; this.title = '修改报价';
this.dialogVisible = true; this.dialogVisible = true;
this.isModify = true; //标记修改状态 this.isModify = true; //标记修改状态
if (this.currentQuotoDataList.length > 0) { this.ruleForm.inquiry_sn = row.inquiry_sn;
let data = this.currentQuotoDataList[0]; this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_sn = data.inquiry_sn; this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.inquiry_id = data.inquiry_id; this.ruleForm.quote_id = row.id; //编辑的时候需要
this.ruleForm.inquiry_items_id = data.inquiry_items_id;
this.ruleForm.quote_id = data.id; //编辑的时候需要
this.ruleForm.goods_name = row.goods_name;//赋值型号 this.ruleForm.goods_name = row.goods_name;//赋值型号
this.ruleForm.brand_name = row.brand_name;//赋值品牌 this.ruleForm.brand_name = row.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量 this.ruleForm.quote_number = row.quote_number;//报价数量
row.price_origin = this.float(row.price_origin);//价格转换
//取当前报价的字段quote_number,与匹配库存里的阶梯价格符合条件的第一条 this.ruleForm.price_origin = row.price_origin;//价格
let quote_number = data.quote_number * 1; this.ruleForm.currency = row.currency.toString();//币种
let purchases_filter = []; this.ruleForm.tax_rate = Number(row.tax_rate) * 100 + '%';//税率
if (row.cn_ladder_price.length > 0) { this.ruleForm.batch = row.batch;//批次
purchases_filter = row.cn_ladder_price.filter((item) => { this.ruleForm.delivery_int = row.delivery_info.delivery_int; //货期
if (quote_number <= item.purchases) { this.ruleForm.delivery_unit_val = row.delivery_info.delivery_unit_val;//货期单位
return item;
}
});
}
if (purchases_filter.length > 0) {
this.ruleForm.price_origin = purchases_filter[0].price * 1;//价格
} else {
this.ruleForm.price_origin = 0;//价格
}
this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = row.batch_sn;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = row.mpq;//最小包装数量 this.ruleForm.mpq = row.mpq;//最小包装数量
this.ruleForm.moq = row.moq;//起订量 this.ruleForm.moq = row.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用 row.price_other = this.float(row.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用 this.ruleForm.price_other = row.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注 this.ruleForm.remark = row.remark;//备注
//报价有效期 //报价有效期
const start = new Date(); if (row.expire_time == '') {
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2); const start = new Date();
this.ruleForm.expire_time = start; start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
} this.ruleForm.expire_time = start;
} else {
}, this.ruleForm.expire_time = row.expire_time;
/** }
* 编辑修改 },
*/ /**
edit(row) { *报价弹窗提交
this.title = '修改报价'; * @param formName
this.dialogVisible = true; */
this.isModify = true; //标记修改状态 submitForm(formName) {
var that = this;
this.ruleForm.inquiry_sn = row.inquiry_sn; this.$refs[formName].validate((valid) => {
this.ruleForm.inquiry_id = row.inquiry_id; if (valid) {
this.ruleForm.inquiry_items_id = row.inquiry_items_id; var params = this.ruleForm;
this.ruleForm.quote_id = row.id; //编辑的时候需要 //转化税率
if (params.tax_rate == '13%') {
this.ruleForm.goods_name = row.goods_name;//赋值型号 params.tax_rate = 0.13;
this.ruleForm.brand_name = row.brand_name;//赋值品牌
this.ruleForm.quote_number = row.quote_number;//报价数量
row.price_origin = this.float(row.price_origin);//价格转换
this.ruleForm.price_origin = row.price_origin;//价格
this.ruleForm.currency = row.currency.toString();//币种
this.ruleForm.tax_rate = Number(row.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = row.batch;//批次
this.ruleForm.delivery_int = row.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = row.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = row.mpq;//最小包装数量
this.ruleForm.moq = row.moq;//起订量
row.price_other = this.float(row.price_other);//其他费用
this.ruleForm.price_other = row.price_other;//其他费用
this.ruleForm.remark = row.remark;//备注
//报价有效期
if (row.expire_time == '') {
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
} else {
this.ruleForm.expire_time = row.expire_time;
}
},
/**
*报价弹窗提交
* @param formName
*/
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
var params = this.ruleForm;
//转化税率
if (params.tax_rate == '13%') {
params.tax_rate = 0.13;
} else {
params.tax_rate = 0;
}
this.ruleForm.delivery_time = this.ruleForm.delivery_int + this.ruleForm.delivery_unit_val; //拼接货期字段
this.$http('post', "/api/quote/save", params).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose() {
that.dialogVisible = false;
that.getData();
if (that.tabIndex == 0) {
that.currentQuotoChange();
}
//匹配库存 历史报价需要调用库存关联报价
if (that.tabIndex == 1 || that.tabIndex == 2) {
that.quotePin();
}
}
});
} else { } else {
params.tax_rate = 0;
}
this.ruleForm.delivery_time = this.ruleForm.delivery_int + this.ruleForm.delivery_unit_val; //拼接货期字段
this.$http('post', "/api/quote/save", params).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose() {
that.dialogVisible = false;
that.getData();
if (that.tabIndex == 0) {
that.currentQuotoChange();
}
//匹配库存 历史报价需要调用库存关联报价
if (that.tabIndex == 1 || that.tabIndex == 2) {
that.quotePin();
}
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(err => {
this.$message({ this.$message({
message: res.msg, message: '网络出现问题',
type: 'error' type: 'error'
}); });
}
}).catch(err => {
this.$message({
message: '网络出现问题',
type: 'error'
}); });
}); } else {
} else { return false;
return false; }
} });
}); },
}, /**
/** * 行点击
* 行点击 * @param row
* @param row * @param column
* @param column * @param event
* @param event */
*/ rowClick(row, column, event) {
rowClick(row, column, event) { this.tabIndex = 0;
this.tabIndex = 0; this.listVisible = true;
this.listVisible = true; this.inquireObj = row;
this.inquireObj = row;
this.currentQuotoChange();
},
/**
* tab切换
* @param index
*/
change(index) {
if (index == 0) {
this.currentQuotoChange(); this.currentQuotoChange();
} else if (index == 1) { },
this.matchingskuChange(); /**
} else if (index == 2) { * tab切换
this.historyChange(); * @param index
} */
}, change(index) {
/** if (index == 0) {
* 当前报价 this.currentQuotoChange();
*/ } else if (index == 1) {
currentQuotoChange() { this.matchingskuChange();
this.$http('GET', "/api/inquiry/detail", { } else if (index == 2) {
inquiry_item_id: this.inquireObj.id this.historyChange();
}).then(res => {
if (res.code === 0) {
this.currentQuotoDataList = res.data.quote_list || [];
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}); },
}, /**
/** * 当前报价
* 匹配库存 */
*/ currentQuotoChange() {
matchingskuChange() { this.$http('GET', "/api/inquiry/detail", {
this.$http('GET', "/api/sku/list", { inquiry_item_id: this.inquireObj.id
"goods_name": this.inquireObj.goods_name, }).then(res => {
"goods_status/condition": 1, if (res.code === 0) {
"goods_status": 1, this.currentQuotoDataList = res.data.quote_list || [];
}).then(res => { } else {
if (res.code === 0) { this.$message({
this.matchingskuDataList = res.data.list || []; message: res.msg,
//筛选匹配库存的所有goods_id type: 'warning'
var ids = res.data.list.map(obj => { });
return obj.goods_id;
})
if (ids.length > 0) {
this.checkBind(ids);
} }
} else { });
this.$message({ },
message: res.msg, /**
type: 'warning' * 匹配库存
}); */
} matchingskuChange() {
}); this.$http('GET', "/api/sku/list", {
}, "goods_name": this.inquireObj.goods_name,
/** "goods_status/condition": 1,
* 历史报价 "goods_status": 1,
*/ }).then(res => {
historyChange() { if (res.code === 0) {
this.$http('GET', "/api/quote/history", { this.matchingskuDataList = res.data.list || [];
page: 1, //筛选匹配库存的所有goods_id
limit: 1000000, var ids = res.data.list.map(obj => {
goods_name: this.inquireObj.goods_name, return obj.goods_id;
brand_name: this.inquireObj.brand_name, })
inquiry_items_id: this.inquireObj.id if (ids.length > 0) {
}).then(res => { this.checkBind(ids);
if (res.code === 0) { }
this.historyDataList = res.data.list || []; } else {
//筛选历史报价的id this.$message({
var ids = res.data.list.map(obj => { message: res.msg,
return obj.id; type: 'warning'
}) });
if (ids.length > 0) {
this.checkBind(ids);
} }
} else { });
this.$message({ },
message: res.msg, /**
type: 'warning' * 历史报价
}); */
} historyChange() {
}); this.$http('GET', "/api/quote/history", {
}, page: 1,
/** limit: 1000000,
* 库存关联报价 goods_name: this.inquireObj.goods_name,
*/ brand_name: this.inquireObj.brand_name,
quotePin() { inquiry_items_id: this.inquireObj.id
var that = this; }).then(res => {
this.$http('post', "/api/quote/pin", { if (res.code === 0) {
inquiry_items_id: this.inquireObj.id, this.historyDataList = res.data.list || [];
pin_type: this.tabIndex == 1 ? 2 : 1, // 1历史报价匹配 2库存匹配 //筛选历史报价的id
pin_obj_id: this.pin_obj_id var ids = res.data.list.map(obj => {
}).then(res => { return obj.id;
if (res.code == 0) { })
if (this.tabIndex == 1) { if (ids.length > 0) {
this.matchingskuChange(); this.checkBind(ids);
} else if (this.tabIndex == 2) { }
this.historyChange(); } else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
} else { });
this.$message({ },
message: res.msg, /**
type: 'warning' * 库存关联报价
}); */
} quotePin() {
}) var that = this;
}, this.$http('post', "/api/quote/pin", {
/** inquiry_items_id: this.inquireObj.id,
*效验是否已生成报价 pin_type: this.tabIndex == 1 ? 2 : 1, // 1历史报价匹配 2库存匹配
*/ pin_obj_id: this.pin_obj_id
checkBind(ids) { }).then(res => {
this.$http('get', "/api/quote/checkpinlist", { if (res.code == 0) {
inquiry_items_id: this.inquireObj.id, if (this.tabIndex == 1) {
pin_type: this.tabIndex == 1 ? 2 : 1,// 1历史报价匹配 2库存匹配 this.matchingskuChange();
pin_obj_ids: ids.join(',') } else if (this.tabIndex == 2) {
}).then(res => { this.historyChange();
if (res.code === 0) { }
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
*效验是否已生成报价
*/
checkBind(ids) {
this.$http('get', "/api/quote/checkpinlist", {
inquiry_items_id: this.inquireObj.id,
pin_type: this.tabIndex == 1 ? 2 : 1,// 1历史报价匹配 2库存匹配
pin_obj_ids: ids.join(',')
}).then(res => {
if (res.code === 0) {
if (this.tabIndex == 1) { if (this.tabIndex == 1) {
//匹配库存 //匹配库存
for (let i = 0; i < this.matchingskuDataList.length; i++) { for (let i = 0; i < this.matchingskuDataList.length; i++) {
for (let j = 0; j < res.data.bind_ids.length; j++) { for (let j = 0; j < res.data.bind_ids.length; j++) {
if (this.matchingskuDataList[i].goods_id == res.data.bind_ids[j]) { if (this.matchingskuDataList[i].goods_id == res.data.bind_ids[j]) {
this.matchingskuDataList[i].is_bind = 1; this.matchingskuDataList[i].is_bind = 1;
}
} }
} }
} } else if (this.tabIndex == 2) {
} else if (this.tabIndex == 2) { //历史报价
//历史报价 for (let i = 0; i < this.historyDataList.length; i++) {
for (let i = 0; i < this.historyDataList.length; i++) { for (let j = 0; j < res.data.bind_ids.length; j++) {
for (let j = 0; j < res.data.bind_ids.length; j++) { if (this.historyDataList[i].id == res.data.bind_ids[j]) {
if (this.historyDataList[i].id == res.data.bind_ids[j]) { this.historyDataList[i].is_bind = 1;
this.historyDataList[i].is_bind = 1; }
} }
} }
} }
} }
})
},
/**
* 格式化数据
* @param value
* @returns {number}
*/
float(value) {
let num = Number(value)
if (num) {
return num
} else {
return 0
} }
}) },
}, /**
/** * 前进年份
* 格式化数据 */
* @param value prevChange() {
* @returns {number} this.yearIndex = -1;
*/ let starYear = this.year[0];
float(value) { let arr = [];
let num = Number(value) for (let i = 0; i < 15; i++) {
if (num) { arr.push(starYear - (i + 1))
return num
} else {
return 0
}
},
/**
* 前进年份
*/
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
this.year = arr.sort();
},
/**
* 后退年份
*/
nextChange() {
this.yearIndex = -1;
let starYear = this.year[this.year.length - 1] * 1;
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
}
this.year = arr;
},
/**
* 批次年月选择
* @param index
* @param type
*/
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
}
},
/**
* 批次关闭
* @param type
* @param index
*/
clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
/**
* 批次确定
* @param type
* @param val
* @param index
* @returns {boolean}
*/
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
message: '请选择年份',
type: 'warning'
});
return false;
}
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
} }
let year = this.year[this.yearIndex].toString(); this.year = arr.sort();
year = year.substring(year.length - 2); },
this.ruleForm.batch = year + val; /**
} else if (type == 3) { * 后退年份
if (this.periodIndex == -1) { */
this.$message({ nextChange() {
message: '请选择第一周期', this.yearIndex = -1;
type: 'warning' let starYear = this.year[this.year.length - 1] * 1;
}); let arr = [];
return false; for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
} }
if (!val) { this.year = arr;
this.$message({ },
message: '请选择第二周期', /**
type: 'warning' * 批次年月选择
}); * @param index
return false; * @param type
*/
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
} }
var one = parseInt(this.period[this.periodIndex]); },
var two = parseInt(val); /**
if (two <= one) { * 批次关闭
* @param type
* @param index
*/
clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
/**
* 批次确定
* @param type
* @param val
* @param index
* @returns {boolean}
*/
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({ this.$message({
message: '不可小于第一周期', message: '请选择年份',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.ruleForm.batch = year + val;
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString(); let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2); year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString(); let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2); period = period.substring(period.length - 2);
val = val.toString(); val = val.toString();
val = val.substring(val.length - 2); val = val.substring(val.length - 2);
let prev = year + period; let prev = year + period;
let next = year + val; let next = year + val;
this.ruleForm.batch = prev + '-' + next; this.ruleForm.batch = prev + '-' + next;
} }
this.visible = false; this.visible = false;
}, },
/** /**
* 税率切换 * 税率切换
* @param val * @param val
*/ */
currentChange(val) { currentChange(val) {
if (val == 1) { if (val == 1) {
this.ruleForm.tax_rate = '13%'; this.ruleForm.tax_rate = '13%';
} else { } else {
this.ruleForm.tax_rate = '0%'; this.ruleForm.tax_rate = '0%';
} }
}, },
/** /**
* 搜索型号 * 搜索型号
* @param queryString * @param queryString
* @param cb * @param cb
*/ */
querySearchAsync(queryString, cb) { querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", { this.$http('get', "/api/search/getspu", {
spu_name: queryString spu_name: queryString
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
var arrlist_ = res.data.list || []; var arrlist_ = res.data.list || [];
var arr_ = [] var arr_ = []
for (var i = 0; i < arrlist_.length; i++) { for (var i = 0; i < arrlist_.length; i++) {
arr_.push({ arr_.push({
value: arrlist_[i]['spu_name'] value: arrlist_[i]['spu_name']
}) })
}
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, /**
/** * 搜索品牌
* 搜索品牌 * @param queryString
* @param queryString * @param cb
* @param cb */
*/ querySearchAsyncBrand(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/brand/get_stand_brand", {
this.$http('get', "/api/brand/get_stand_brand", { brand: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_); }
})
},
/**
* 重置
* @param formName
*/
resetForm(formName) {
this.create_time_val = '';
this.deadline_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 搜索提交
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* chebox选择的数据
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 分页条数切换
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* 获取日志
* @param obj_type
* @param obj_id
*/
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisibleLog = true;
this.logs = res.data.list;
} else { } else {
cb([]); this.$message({
message: res.msg,
type: 'warning'
});
} }
} });
}) },
}, /**
/** * 查看日志
* 重置 * @param row
* @param formName */
*/ handleClick(row) {
resetForm(formName) { this.getLogs(504, row.supplier_auto_inquiry_id);
this.create_time_val = ''; console.log(row);
this.deadline_time_val = ''; },
this.$refs[formName].resetFields(); /**
}, * 导出
/** */
* 搜索提交 exportChange() {
*/ var arr = [];
onSubmit() { if (this.multipleSelection.length == 0) {
this.page = 1;
this.getData();
},
/**
* chebox选择的数据
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 分页条数切换
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* 获取日志
* @param obj_type
* @param obj_id
*/
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisibleLog = true;
this.logs = res.data.list;
} else {
this.$message({ this.$message({
message: res.msg, showClose: true,
message: '请至少选择一条数据',
type: 'warning' type: 'warning'
}); });
return;
} }
});
},
/**
* 查看日志
* @param row
*/
handleClick(row) {
this.getLogs(504, row.supplier_auto_inquiry_id);
console.log(row);
},
/**
* 导出
*/
exportChange() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
window.location.href = NODE_ENVS + '/api/inquiry/export?ids=' + arr.join(",") + '&token=' + Tool.getCookie('token');
},
/**
* 删除
* @returns {boolean}
*/
del() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请勾选数据删除',
type: 'warning'
});
return false;
}
var status_arr = this.multipleSelection.map(obj => {
return obj.i_status;
})
let status = status_arr.every(ele => ele === 1);// -1已关闭1待报价2已报价9删除
if (status) {
for (var i = 0; i < this.multipleSelection.length; i++) { for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['supplier_auto_inquiry_id']) arr.push(this.multipleSelection[i]['id'])
}
window.location.href = NODE_ENVS + '/api/inquiry/export?ids=' + arr.join(",") + '&token=' + Tool.getCookie('token');
},
/**
* 删除
* @returns {boolean}
*/
del() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请勾选数据删除',
type: 'warning'
});
return false;
} }
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/inquiry/delete", {
ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
});
this.getData();
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
var status_arr = this.multipleSelection.map(obj => {
return obj.i_status;
}) })
} else { let status = status_arr.every(ele => ele === 1);// -1已关闭1待报价2已报价9删除
if (status) {
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['supplier_auto_inquiry_id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/inquiry/delete", {
ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
});
this.getData();
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
})
} else {
this.$message({
message: '请勾选待报价的数据',
type: 'warning'
});
}
},
/**
* 复制
* @param e
*/
onCopy(e) {
this.$message({ this.$message({
message: '请勾选待报价的数据', message: '复制成功',
type: 'warning' type: 'success'
}); });
} },
},
/**
* 复制
* @param e
*/
onCopy(e) {
this.$message({
message: '复制成功',
type: 'success'
});
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/list/inquire.min.css"; @import "../../assets/css/list/inquire.min.css";
</style> </style>
\ No newline at end of file
...@@ -5,27 +5,27 @@ ...@@ -5,27 +5,27 @@
<div class="input-box clr"> <div class="input-box clr">
<div class="fl"> <div class="fl">
<span class="p-text">型号</span> <span class="p-text">型号</span>
<input type="text" placeholder="" disabled :value="inquiry_info.goods_name" style="width: 180px;margin-right: 30px; "/> <input type="text" placeholder="" disabled :value="inquiry_info.goods_name" style="width: 180px;margin-right: 30px; " />
</div> </div>
<div class="fl"> <div class="fl">
<span class="p-text">品牌</span> <span class="p-text">品牌</span>
<input type="text" placeholder="" disabled :value="inquiry_info.brand_name" style="width: 180px;margin-right: 30px; "/> <input type="text" placeholder="" disabled :value="inquiry_info.brand_name" style="width: 180px;margin-right: 30px; " />
</div> </div>
<div class="fl"> <div class="fl">
<span class="p-text">数量</span> <span class="p-text">数量</span>
<input type="text" placeholder="" disabled :value="inquiry_info.inquiry_number" style="width: 180px ;margin-right: 30px;"/> <input type="text" placeholder="" disabled :value="inquiry_info.inquiry_number" style="width: 180px ;margin-right: 30px;" />
</div> </div>
<div class="fl"> <div class="fl">
<span class="p-text">批次<font style="visibility:hidden;">型号</font></span> <span class="p-text">批次<font style="visibility:hidden;">型号</font></span>
<input type="text" placeholder="" disabled :value="inquiry_info.batch" style="width: 180px;margin-right: 30px; "/> <input type="text" placeholder="" disabled :value="inquiry_info.batch" style="width: 180px;margin-right: 30px; " />
</div> </div>
<div class="fl"> <div class="fl">
<span class="p-text">交货日期</span> <span class="p-text">交货日期</span>
<input type="text" placeholder="" disabled :value="inquiry_info.delivery_time" style="width: 180px;margin-right: 30px; "/> <input type="text" placeholder="" disabled :value="inquiry_info.delivery_time" style="width: 180px;margin-right: 30px; " />
</div> </div>
<div class="fl"> <div class="fl">
<span class="p-text">询价单号</span> <span class="p-text">询价单号</span>
<input type="text" placeholder="" disabled :value="inquiry_info.inquiry_sn" style="width: 138px "/> <input type="text" placeholder="" disabled :value="inquiry_info.inquiry_sn" style="width: 138px " />
</div> </div>
</div> </div>
<p class="text"> <p class="text">
...@@ -49,26 +49,26 @@ ...@@ -49,26 +49,26 @@
<el-table-column prop="brand_name" label="报价品牌" width="200"></el-table-column> <el-table-column prop="brand_name" label="报价品牌" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status==1" class="f-green">确认中</span> <span v-if="scope.row.status == 1" class="f-green">确认中</span>
<span v-else-if="scope.row.status==2" class="f-yellow1">已选中</span> <span v-else-if="scope.row.status == 2" class="f-yellow1">已选中</span>
<span v-else-if="scope.row.status==3">已成单</span> <span v-else-if="scope.row.status == 3">已成单</span>
<span v-else-if="scope.row.status==4" class="f-red1">已关闭</span> <span v-else-if="scope.row.status == 4" class="f-red1">已关闭</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column> <el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column>
<el-table-column prop="quote_number" label="报价数量" width="100"></el-table-column> <el-table-column prop="quote_number" label="报价数量" width="100"></el-table-column>
<el-table-column prop="price_origin" label="价格" width="130" :show-overflow-tooltip="true"> <el-table-column prop="price_origin" label="价格" width="130" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span> <span>{{ scope.row.price_origin | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="currency" label="币种" width="100"> <el-table-column prop="currency" label="币种" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.currency==1">人民币</span> <span v-if="scope.row.currency == 1">人民币</span>
<span v-else-if="scope.row.currency==2">美元</span> <span v-else-if="scope.row.currency == 2">美元</span>
<span v-else-if="scope.row.currency==3">港币</span> <span v-else-if="scope.row.currency == 3">港币</span>
<span v-else-if="scope.row.currency==4">欧元</span> <span v-else-if="scope.row.currency == 4">欧元</span>
<span v-else-if="scope.row.currency==5">英磅</span> <span v-else-if="scope.row.currency == 5">英磅</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="tax_rate" label="税率" width="100"></el-table-column> <el-table-column prop="tax_rate" label="税率" width="100"></el-table-column>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<el-table-column prop="moq" label="起订量" width="100"></el-table-column> <el-table-column prop="moq" label="起订量" width="100"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="100"> <el-table-column prop="price_other" label="其他费用" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span> <span>{{ scope.row.price_other | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column> <el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column>
...@@ -90,17 +90,16 @@ ...@@ -90,17 +90,16 @@
<div class="assistant"> <div class="assistant">
<i class="ic"></i> <i class="ic"></i>
<ul class="tab row verCenter"> <ul class="tab row verCenter">
<li @click="tab(index)" class="boxsiz row rowCenter verCenter" :class="{'curr':active==index}" <li @click="tab(index)" class="boxsiz row rowCenter verCenter" :class="{ 'curr': active == index }" v-for="(item, index) in textArr" :key="index">{{ item }}
v-for="(item,index) in textArr" :key="index">{{ item }}
</li> </li>
</ul> </ul>
<div class="data-box th-all"> <div class="data-box th-all">
<!--匹配库存--> <!--匹配库存-->
<template v-if="active==0"> <template v-if="active == 0">
<el-table :key="2" :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange"> <el-table :key="2" :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column fixed label="操作" width="108" align="center"> <el-table-column fixed label="操作" width="108" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="dcg" :class="{'disabled':scope.row.disabled}" @click="handle(scope.$index, scope.row)">确认</span> <span class="dcg" :class="{ 'disabled': scope.row.disabled }" @click="handle(scope.$index, scope.row)">确认</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column> <el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column>
...@@ -112,7 +111,7 @@ ...@@ -112,7 +111,7 @@
<el-table-column prop="stock" label="库存数量" width="150"> <el-table-column prop="stock" label="库存数量" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="cn_ladder_price" label="国内含税价(¥)" width="140"> <el-table-column prop="cn_ladder_price" label="国内含税价(¥)" width="140">
<template slot-scope="scope" v-if="scope.row.cn_ladder_price&&scope.row.cn_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length > 0">
<div class="price-more"> <div class="price-more">
<el-tooltip placement="bottom" effect="light"> <el-tooltip placement="bottom" effect="light">
<div slot="content"> <div slot="content">
...@@ -129,7 +128,7 @@ ...@@ -129,7 +128,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="hk_ladder_price" label="香港交货价($)" width="150"> <el-table-column prop="hk_ladder_price" label="香港交货价($)" width="150">
<template slot-scope="scope" v-if="scope.row.hk_ladder_price&&scope.row.hk_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.hk_ladder_price && scope.row.hk_ladder_price.length > 0">
<div class="price-more"> <div class="price-more">
<el-tooltip placement="bottom" effect="light"> <el-tooltip placement="bottom" effect="light">
<div slot="content"> <div slot="content">
...@@ -150,8 +149,8 @@ ...@@ -150,8 +149,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="goods_status" label="状态" width="150"> <el-table-column prop="goods_status" label="状态" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span> <span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span> <span v-else-if="scope.row.goods_status == 3">下架</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -162,26 +161,26 @@ ...@@ -162,26 +161,26 @@
<el-table :key="1" :data="historyList" border style="width: 100%"> <el-table :key="1" :data="historyList" border style="width: 100%">
<el-table-column fixed label="操作" width="108" align="center"> <el-table-column fixed label="操作" width="108" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="dcg " :class="{'disabled':scope.row.disabled}" @click="handle(scope.$index, scope.row)">确认</span> <span class="dcg " :class="{ 'disabled': scope.row.disabled }" @click="handle(scope.$index, scope.row)">确认</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed prop="goods_name" label="报价型号" width="200"></el-table-column> <el-table-column fixed prop="goods_name" label="报价型号" width="200"></el-table-column>
<el-table-column fixed prop="brand_name" label="报价品牌" width="200"></el-table-column> <el-table-column fixed prop="brand_name" label="报价品牌" width="200"></el-table-column>
<el-table-column fixed prop="status" label="状态" width="100"> <el-table-column fixed prop="status" label="状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status==1" class="f-green">比价中</span> <span v-if="scope.row.status == 1" class="f-green">比价中</span>
<span v-else-if="scope.row.status==2" class="f-yellow1">已选中</span> <span v-else-if="scope.row.status == 2" class="f-yellow1">已选中</span>
<span v-else-if="scope.row.status==3">已确认</span> <span v-else-if="scope.row.status == 3">已确认</span>
<span v-else-if="scope.row.status==4" class="f-green">已成单</span> <span v-else-if="scope.row.status == 4" class="f-green">已成单</span>
<span v-else-if="scope.row.status==5" class="f-red1">已关闭</span> <span v-else-if="scope.row.status == 5" class="f-red1">已关闭</span>
<span v-else-if="scope.row.status==9" class="f-red1">已删除</span> <span v-else-if="scope.row.status == 9" class="f-red1">已删除</span>
<span v-else-if="scope.row.status==-1" class="f-red1">已撤销</span> <span v-else-if="scope.row.status == -1" class="f-red1">已撤销</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column> <el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column>
<el-table-column prop="price_rmb" label="价格" width="100"> <el-table-column prop="price_rmb" label="价格" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_rmb|floatZero }}</span> <span>{{ scope.row.price_rmb | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="currency" label="币种" width="100"></el-table-column> <el-table-column prop="currency" label="币种" width="100"></el-table-column>
...@@ -192,7 +191,7 @@ ...@@ -192,7 +191,7 @@
<el-table-column prop="moq" label="起订量" width="100"></el-table-column> <el-table-column prop="moq" label="起订量" width="100"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="200"> <el-table-column prop="price_other" label="其他费用" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span> <span>{{ scope.row.price_other | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column> <el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column>
...@@ -202,8 +201,7 @@ ...@@ -202,8 +201,7 @@
<el-table-column prop="inquiry_brand_name" label="品牌" width="200"></el-table-column> <el-table-column prop="inquiry_brand_name" label="品牌" width="200"></el-table-column>
<el-table-column prop="inquiry_sn" label="询价单号" width="200"></el-table-column> <el-table-column prop="inquiry_sn" label="询价单号" width="200"></el-table-column>
</el-table> </el-table>
<el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total" <el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
@current-change="handleCurrentChange" :current-page="page"></el-pagination>
</template> </template>
</div> </div>
</div> </div>
...@@ -239,12 +237,12 @@ ...@@ -239,12 +237,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row year-list"> <ul class="row year-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in year" :class="{curr:yearIndex==indexY}" @click="tabChange(indexY,1)">{{ v }}年</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in year" :class="{ curr: yearIndex == indexY }" @click="tabChange(indexY, 1)">{{ v }}年</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(1,year[yearIndex])">确定</el-button> <el-button size="mini" round @click="confirm(1, year[yearIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -253,12 +251,12 @@ ...@@ -253,12 +251,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndex==indexY}" @click="tabChange(indexY,2)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndex == indexY }" @click="tabChange(indexY, 2)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(2,period[periodIndex])">确定</el-button> <el-button size="mini" round @click="confirm(2, period[periodIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -267,12 +265,12 @@ ...@@ -267,12 +265,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndexTwo==indexY}" @click="tabChange(indexY,3)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndexTwo == indexY }" @click="tabChange(indexY, 3)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(3,period[periodIndexTwo])">确定</el-button> <el-button size="mini" round @click="confirm(3, period[periodIndexTwo])">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -324,631 +322,631 @@ ...@@ -324,631 +322,631 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button> <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {dateTimeFormate} from "../../filters/formate.js"; import { dateTimeFormate } from "../../filters/formate.js";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Tooltip).use(Popover) Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Tooltip).use(Popover)
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination) Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination)
export default { export default {
name: "InquireDetail", name: "InquireDetail",
data() { data() {
return { return {
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000)); return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
} }
}, },
currentDataId: 0, currentDataId: 0,
active: 0, active: 0,
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
multipleSelection: [], multipleSelection: [],
quote_info: {}, quote_info: {},
inquiry_info: {}, inquiry_info: {},
quote_list: [], quote_list: [],
title: '新增', title: '新增',
isModify: false, isModify: false,
tableData: [], tableData: [],
historyList: [], historyList: [],
submitState: 0, submitState: 0,
yearIndex: -1,//年份 yearIndex: -1,//年份
periodIndex: -1,//第一周期 periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期 periodIndexTwo: -1,//第二周期
visible: false, visible: false,
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'], year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'], period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
ruleForm: { ruleForm: {
inquiry_id: '', inquiry_id: '',
inquiry_sn: '', inquiry_sn: '',
inquiry_items_id: '', inquiry_items_id: '',
quote_id: '', quote_id: '',
goods_name: '', goods_name: '',
quote_number: '', quote_number: '',
currency: '1', currency: '1',
batch: '', batch: '',
mpq: '', mpq: '',
price_other: '', price_other: '',
unit: '', unit: '',
brand_name: '', brand_name: '',
price_origin: '', price_origin: '',
tax_rate: '13%', tax_rate: '13%',
delivery_int: '', delivery_int: '',
delivery_unit_val: '工作日', delivery_unit_val: '工作日',
moq: '', moq: '',
expire_time: '', expire_time: '',
remark: '' remark: ''
}, },
rules: { rules: {
goods_name: [{ goods_name: [{
required: true, required: true,
message: '请输入报价型号', message: '请输入报价型号',
trigger: 'blur' trigger: 'blur'
}], }],
quote_number: [{ quote_number: [{
required: true, required: true,
message: '请输入报价数量', message: '请输入报价数量',
trigger: 'blur' trigger: 'blur'
}], }],
currency: [{ currency: [{
required: true, required: true,
message: '请选择币种', message: '请选择币种',
trigger: 'blur' trigger: 'blur'
}], }],
batch: [{ batch: [{
required: true, required: true,
message: '请输入批次', message: '请输入批次',
trigger: 'change' trigger: 'change'
}], }],
price_origin: [{ price_origin: [{
required: true, required: true,
message: '请输入价格', message: '请输入价格',
trigger: 'blur' trigger: 'blur'
},], },],
delivery_int: [{ delivery_int: [{
required: true, required: true,
message: '请输入货期', message: '请输入货期',
trigger: 'blur' trigger: 'blur'
}], }],
expire_time: [{ expire_time: [{
required: true, required: true,
message: '请输入报价有效期', message: '请输入报价有效期',
trigger: 'blur' trigger: 'blur'
}] }]
}, },
dialogVisible: false, dialogVisible: false,
brandList: [], brandList: [],
textArr: ['匹配库存', '历史报价'] textArr: ['匹配库存', '历史报价']
}; };
},
created() {
this.getData();
},
watch: {
$route(to, from) {
if (to.path == from.path) {
this.getData()
}
}
},
methods: {
//前进年份
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
this.year = arr.sort();
}, },
//后退年份 created() {
nextChange() { this.getData();
this.yearIndex = -1;
let starYear = this.year[this.year.length - 1] * 1;
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
}
this.year = arr;
}, },
tabChange(index, type) { watch: {
if (type == 1) { $route(to, from) {
this.yearIndex = index; if (to.path == from.path) {
} else if (type == 2) { this.getData()
this.periodIndex = index; }
} else if (type == 3) {
this.periodIndexTwo = index;
} }
}, },
//批次关闭 methods: {
clear(type, index) { //前进年份
this.visible = false; prevChange() {
this.ruleForm.batch = ''; this.yearIndex = -1;
}, let starYear = this.year[0];
//批次确定 let arr = [];
confirm(type, val, index) { for (let i = 0; i < 15; i++) {
if (this.yearIndex == -1) { arr.push(starYear - (i + 1))
this.$message({
message: '请选择年份',
type: 'warning'
});
return false;
}
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
} }
let year = this.year[this.yearIndex].toString(); this.year = arr.sort();
year = year.substring(year.length - 2); },
this.ruleForm.batch = year + val; //后退年份
} else if (type == 3) { nextChange() {
if (this.periodIndex == -1) { this.yearIndex = -1;
this.$message({ let starYear = this.year[this.year.length - 1] * 1;
message: '请选择第一周期', let arr = [];
type: 'warning' for (let i = 0; i < 15; i++) {
}); arr.push(starYear + (i + 1))
return false;
} }
if (!val) { this.year = arr;
this.$message({ },
message: '请选择第二周期', tabChange(index, type) {
type: 'warning' if (type == 1) {
}); this.yearIndex = index;
return false; } else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
} }
var one = parseInt(this.period[this.periodIndex]); },
var two = parseInt(val); //批次关闭
if (two <= one) { clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
//批次确定
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({ this.$message({
message: '不可小于第一周期', message: '请选择年份',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.ruleForm.batch = year + val;
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString(); let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2); year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString(); let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2); period = period.substring(period.length - 2);
val = val.toString(); val = val.toString();
val = val.substring(val.length - 2); val = val.substring(val.length - 2);
let prev = year + period; let prev = year + period;
let next = year + val; let next = year + val;
this.ruleForm.batch = prev + '-' + next; this.ruleForm.batch = prev + '-' + next;
}
this.visible = false;
},
getData() {
this.$http('get', "/api/inquiry/detail", {
inquiry_item_id: this.$route.query.id
}).then(res => {
if (res.code === 0) {
this.inquiry_info = res.data.inquiry_info;
this.quote_list = res.data.quote_list;
this.ruleForm.inquiry_sn = res.data.inquiry_info.inquiry_sn;
this.ruleForm.inquiry_id = res.data.inquiry_info.inquiry_id;
this.ruleForm.inquiry_items_id = res.data.inquiry_info.id;
this.getSkulist();
} else {
this.$message(res.msg);
} }
}); this.visible = false;
}, },
getSkulist() { getData() {
//匹配库存 this.$http('get', "/api/inquiry/detail", {
this.$http('get', "/api/sku/list", { inquiry_item_id: this.$route.query.id
// brand_name: this.inquiry_info.brand_name, }).then(res => {
goods_name: this.inquiry_info.goods_name, if (res.code === 0) {
'goods_status/condition': 1, this.inquiry_info = res.data.inquiry_info;
goods_status: 1, this.quote_list = res.data.quote_list;
}).then(res => { this.ruleForm.inquiry_sn = res.data.inquiry_info.inquiry_sn;
if (res.code === 0) { this.ruleForm.inquiry_id = res.data.inquiry_info.inquiry_id;
this.tableData = res.data.list || []; this.ruleForm.inquiry_items_id = res.data.inquiry_info.id;
this.total = Number(res.data.count) || 0; this.getSkulist();
var arr_ = this.tableData, id_arr = []; } else {
for (var i = 0; i < arr_.length; i++) { this.$message(res.msg);
id_arr.push(arr_[i].goods_id)
} }
this.checkBind(id_arr.join(",")) });
} else { },
this.$message({ getSkulist() {
message: res.msg, //匹配库存
type: 'warning' this.$http('get', "/api/sku/list", {
}); // brand_name: this.inquiry_info.brand_name,
} goods_name: this.inquiry_info.goods_name,
}) 'goods_status/condition': 1,
}, goods_status: 1,
float(value) {
let num = Number(value)
if (num) {
return num
} else {
return 0
}
},
checkBind(ids) {
if (ids) {
this.$http('get', "/api/quote/checkpinlist", {
inquiry_items_id: this.$route.query.id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_ids: ids
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data && res.data.bind_ids && res.data.bind_ids.length > 0) { this.tableData = res.data.list || [];
var arr_ = this.active == 1 ? JSON.parse(JSON.stringify(this.historyList)) : JSON.parse(JSON.stringify(this.tableData)) this.total = Number(res.data.count) || 0;
for (var i = 0; i < arr_.length; i++) { var arr_ = this.tableData, id_arr = [];
var str_ = this.active == 1 ? String(arr_[i].id) : String(arr_[i].goods_id); for (var i = 0; i < arr_.length; i++) {
if (res.data.bind_ids.indexOf(str_) != -1) { id_arr.push(arr_[i].goods_id)
if (this.active == 1) { }
arr_[i].disabled = true this.checkBind(id_arr.join(","))
this.historyList = arr_ } else {
} else { this.$message({
arr_[i].disabled = true message: res.msg,
this.tableData = arr_ type: 'warning'
} });
} else { }
if (this.active == 1) { })
arr_[i].disabled = false },
this.historyList = arr_ float(value) {
let num = Number(value)
if (num) {
return num
} else {
return 0
}
},
checkBind(ids) {
if (ids) {
this.$http('get', "/api/quote/checkpinlist", {
inquiry_items_id: this.$route.query.id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_ids: ids
}).then(res => {
if (res.code === 0) {
if (res.data && res.data.bind_ids && res.data.bind_ids.length > 0) {
var arr_ = this.active == 1 ? JSON.parse(JSON.stringify(this.historyList)) : JSON.parse(JSON.stringify(this.tableData))
for (var i = 0; i < arr_.length; i++) {
var str_ = this.active == 1 ? String(arr_[i].id) : String(arr_[i].goods_id);
if (res.data.bind_ids.indexOf(str_) != -1) {
if (this.active == 1) {
arr_[i].disabled = true
this.historyList = arr_
} else {
arr_[i].disabled = true
this.tableData = arr_
}
} else { } else {
arr_[i].disabled = false if (this.active == 1) {
this.tableData = arr_ arr_[i].disabled = false
this.historyList = arr_
} else {
arr_[i].disabled = false
this.tableData = arr_
}
} }
} }
} }
} }
})
}
},
getHistory() {
this.$http('get', "/api/quote/history", {
page: this.page,
limit: this.limit,
goods_name: this.inquiry_info.goods_name,
brand_name: this.inquiry_info.brand_name,
inquiry_items_id: this.$route.query.id
}).then(res => {
if (res.code === 0) {
this.total = res.data.total;
this.historyList = res.data.list || [];
var arr_ = this.historyList, id_arr = []
for (var i = 0; i < arr_.length; i++) {
id_arr.push(arr_[i].id)
}
this.checkBind(id_arr.join(","))
} else {
this.$message(res.msg);
} }
}) })
} },
}, handleCurrentChange(val) {
getHistory() { this.page = val;
this.$http('get', "/api/quote/history", { this.getHistory();
page: this.page, },
limit: this.limit, onSubmit() {
goods_name: this.inquiry_info.goods_name, this.page = 1;
brand_name: this.inquiry_info.brand_name, this.getData();
inquiry_items_id: this.$route.query.id },
}).then(res => { handleSelectionChange(val) {
if (res.code === 0) { this.multipleSelection = val;
this.total = res.data.total; },
this.historyList = res.data.list || []; tab(index) {
var arr_ = this.historyList, id_arr = [] this.active = index;
for (var i = 0; i < arr_.length; i++) { this.page = 1;
id_arr.push(arr_[i].id) this.$forceUpdate();
}
this.checkBind(id_arr.join(",")) if (index == 1) {
this.getHistory();
} else { } else {
this.$message(res.msg); this.getSkulist();
} }
}) },
}, dateFormat(row, column) {
handleCurrentChange(val) { let date = row.create_time;
this.page = val; return dateTimeFormate(date);
this.getHistory(); },
}, currentChange(val) {
onSubmit() { if (val == 1) {
this.page = 1; this.ruleForm.tax_rate = '13%';
this.getData(); } else {
}, this.ruleForm.tax_rate = '0%';
handleSelectionChange(val) {
this.multipleSelection = val;
},
tab(index) {
this.active = index;
this.page = 1;
this.$forceUpdate();
if (index == 1) {
this.getHistory();
} else {
this.getSkulist();
}
},
dateFormat(row, column) {
let date = row.create_time;
return dateTimeFormate(date);
},
currentChange(val) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
} else{
this.ruleForm.tax_rate = '0%';
}
},
//提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (this.submitState) {
return;
} }
if (valid) { },
this.submitState = 1; //提交
let submitData_ = this.ruleForm; submitForm(formName) {
if (submitData_.tax_rate == '13%') { this.$refs[formName].validate((valid) => {
submitData_.tax_rate = 0.13 if (this.submitState) {
} else { return;
submitData_.tax_rate = 0
} }
this.$http('post', "/api/quote/save", submitData_).then(res => { if (valid) {
if (res.code == 0) { this.submitState = 1;
this.getData(); let submitData_ = this.ruleForm;
//新增的时候不需要调用该接口 if (submitData_.tax_rate == '13%') {
if (this.currentDataId != 0) { submitData_.tax_rate = 0.13
this.$http('post', "/api/quote/pin", { } else {
inquiry_items_id: this.ruleForm.inquiry_items_id, submitData_.tax_rate = 0
pin_type: (this.active == 1 ? 1 : 2), }
pin_obj_id: this.currentDataId this.$http('post', "/api/quote/save", submitData_).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { this.getData();
this.$message({ //新增的时候不需要调用该接口
message: '操作成功', if (this.currentDataId != 0) {
type: 'success' this.$http('post', "/api/quote/pin", {
}); inquiry_items_id: this.ruleForm.inquiry_items_id,
this.getData() pin_type: (this.active == 1 ? 1 : 2),
} else { pin_obj_id: this.currentDataId
this.$message({ }).then(res => {
message: res.msg, if (res.code == 0) {
type: 'warning' this.$message({
}); message: '操作成功',
} type: 'success'
}) });
} this.getData()
if (this.active == 1) { } else {
//历史报价 this.$message({
//this.getHistory() message: res.msg,
type: 'warning'
});
}
})
}
if (this.active == 1) {
//历史报价
//this.getHistory()
} else {
//库存匹配
this.getSkulist()
}
this.dialogVisible = false
this.submitState = 0;
} else { } else {
//库存匹配 this.$message({
this.getSkulist() message: res.msg,
type: 'error'
});
this.submitState = 0;
} }
this.dialogVisible = false }).catch(err => {
this.submitState = 0; this.submitState = 0;
});
} else {
return false;
}
});
},
//新增报价
added() {
console.log(this.inquiry_info)
this.title = '新增';
this.dialogVisible = true;
this.isModify = false;
this.ruleForm.brand_name = '';
this.ruleForm.tax_rate = '13%';
this.ruleForm.moq = '';
this.ruleForm.mpq = '';
this.ruleForm.price_other = '';
this.ruleForm.quote_id = '';
this.ruleForm.quote_number = this.inquiry_info.inquiry_number;
this.ruleForm.batch = this.inquiry_info.batch;
this.ruleForm.expire_time = new Date();
this.ruleForm.goods_name = this.inquiry_info.goods_name; //赋值型号
this.ruleForm.brand_name = this.inquiry_info.brand_name; //赋值品牌
this.ruleForm.delivery_int = this.inquiry_info.delivery_info.delivery_int;
this.ruleForm.delivery_unit_val = this.inquiry_info.delivery_info.delivery_unit_val;
this.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
//修改报价
modify() {
var arr = []; //quote_id集合
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection.length > 1) {
this.$message({
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].status == 1 || this.multipleSelection[0].status == 3) {
arr = this.multipleSelection.map(obj => {
return obj.id;
});
this.title = '修改';
this.dialogVisible = true;
this.ruleForm.quote_id = arr.join(",");
this.isModify = true;
this.$http('get', "/api/quote/getinfo", {
id: arr.join(",")
}).then(res => {
if (res.code === 0) {
res.data.quote_info.price_other = this.float(res.data.quote_info.price_other);
res.data.quote_info.price_origin = this.float(res.data.quote_info.price_origin);
this.ruleForm.goods_name = res.data.quote_info.goods_name;
this.ruleForm.quote_number = res.data.quote_info.quote_number;
this.ruleForm.currency = res.data.quote_info.currency.toString();
this.ruleForm.batch = res.data.quote_info.batch;
this.ruleForm.mpq = res.data.quote_info.mpq;
this.ruleForm.price_other = res.data.quote_info.price_other;
this.ruleForm.unit = res.data.quote_info.unit;
this.ruleForm.brand_name = res.data.quote_info.brand_name;
this.ruleForm.price_origin = res.data.quote_info.price_origin;
this.ruleForm.tax_rate = Number(res.data.quote_info.tax_rate) * 100 + '%';
this.ruleForm.delivery_int = res.data.quote_info.delivery_int;
this.ruleForm.delivery_unit_val = res.data.quote_info.delivery_unit_val;
this.ruleForm.moq = res.data.quote_info.moq;
this.ruleForm.remark = res.data.quote_info.remark;
if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = '';
} else {
this.ruleForm.expire_time = res.data.quote_info.expire_time;
}
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'error' type: 'warning'
}); });
this.submitState = 0;
} }
}).catch(err => { })
this.submitState = 0;
});
} else { } else {
return false; this.$message({
message: '该报价不可修改',
type: 'warning'
});
return;
}
},
//删除报价
del() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
} }
});
},
//新增报价
added() {
console.log(this.inquiry_info)
this.title = '新增';
this.dialogVisible = true;
this.isModify = false;
this.ruleForm.brand_name = '';
this.ruleForm.tax_rate = '13%';
this.ruleForm.moq = '';
this.ruleForm.mpq = '';
this.ruleForm.price_other = '';
this.ruleForm.quote_id = '';
this.ruleForm.quote_number = this.inquiry_info.inquiry_number;
this.ruleForm.batch = this.inquiry_info.batch;
this.ruleForm.expire_time = new Date();
this.ruleForm.goods_name = this.inquiry_info.goods_name; //赋值型号
this.ruleForm.brand_name = this.inquiry_info.brand_name; //赋值品牌
this.ruleForm.delivery_int = this.inquiry_info.delivery_info.delivery_int;
this.ruleForm.delivery_unit_val = this.inquiry_info.delivery_info.delivery_unit_val;
this.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
//修改报价
modify() {
var arr = []; //quote_id集合
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection.length > 1) { MessageBox.confirm('确认到删除当前勾选数据吗?', {
this.$message({ type: 'error'
message: '请选择一条询价信息', }).then(() => {
type: 'warning' this.$http('post', "/api/quote/delete", {
}); ids: arr.join(",")
return; }).then(res => {
} if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
});
this.getData();
} else {
this.$message(res.msg);
}
})
}).catch(() => {
if (this.multipleSelection[0].status == 1 || this.multipleSelection[0].status == 3) { })
arr = this.multipleSelection.map(obj => { },
return obj.id; handle(index, row) {
}); if (row.disabled) {
this.title = '修改'; this.$message({
message: '已绑定,不能重复操作',
type: 'warning'
});
return;
}
if (this.active == 1) {
this.currentDataId = row.id;
} else {
this.currentDataId = row.goods_id;
}
this.title = this.active == 1 ? '确认-历史报价' : '确认-匹配库存';
this.dialogVisible = true; this.dialogVisible = true;
this.ruleForm.quote_id = arr.join(","); this.ruleForm.quote_id = '';
this.isModify = true; this.isModify = true;
this.$http('get', "/api/quote/getinfo", { if (this.active != 1) {
id: arr.join(",") //匹配库存 不请求接口
}).then(res => { this.$http('get', "/api/quote/gettransinfoforsku", {
if (res.code === 0) { goods_id: row.goods_id,
res.data.quote_info.price_other = this.float(res.data.quote_info.price_other); inquiry_items_id: this.$route.query.id
res.data.quote_info.price_origin = this.float(res.data.quote_info.price_origin); }).then(res => {
this.ruleForm.goods_name = res.data.quote_info.goods_name; if (res.code === 0) {
this.ruleForm.quote_number = res.data.quote_info.quote_number; var datap_ = res.data.trans_to_quote_info;
this.ruleForm.currency = res.data.quote_info.currency.toString(); datap_.price_origin = this.float(datap_.price_origin)
this.ruleForm.batch = res.data.quote_info.batch; this.ruleForm.goods_name = datap_.goods_name;
this.ruleForm.mpq = res.data.quote_info.mpq; this.ruleForm.batch = datap_.batch;
this.ruleForm.price_other = res.data.quote_info.price_other; this.ruleForm.price_origin = datap_.price_origin;
this.ruleForm.unit = res.data.quote_info.unit; this.ruleForm.brand_name = datap_.brand_name;
this.ruleForm.brand_name = res.data.quote_info.brand_name; this.ruleForm.moq = datap_.moq;
this.ruleForm.price_origin = res.data.quote_info.price_origin; this.ruleForm.mpq = datap_.mpq;
this.ruleForm.tax_rate = Number(res.data.quote_info.tax_rate) * 100 + '%'; this.ruleForm.quote_number = datap_.quote_number;
this.ruleForm.delivery_int = res.data.quote_info.delivery_int;
this.ruleForm.delivery_unit_val = res.data.quote_info.delivery_unit_val;
this.ruleForm.moq = res.data.quote_info.moq;
this.ruleForm.remark = res.data.quote_info.remark;
if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = '';
} else { } else {
this.ruleForm.expire_time = res.data.quote_info.expire_time; this.$message({
message: res.msg,
type: 'error'
});
} }
} else { })
this.$message({ } else {
message: res.msg, this.$http('get', "/api/quote/getinfo", {
type: 'warning' id: row.id
}); }).then(res => {
} if (res.code === 0) {
}) res.data.quote_info.price_other = this.float(res.data.quote_info.price_other)
} else { res.data.quote_info.price_origin = this.float(res.data.quote_info.price_origin)
this.$message({ this.ruleForm.goods_name = res.data.quote_info.goods_name;
message: '该报价不可修改', this.ruleForm.brand_name = res.data.quote_info.brand_name;
type: 'warning' this.ruleForm.quote_number = res.data.quote_info.quote_number;
}); this.ruleForm.currency = res.data.quote_info.currency.toString();
return; this.ruleForm.batch = res.data.quote_info.batch;
} this.ruleForm.mpq = res.data.quote_info.mpq;
}, this.ruleForm.price_other = res.data.quote_info.price_other;
//删除报价 this.ruleForm.unit = res.data.quote_info.unit;
del() { this.ruleForm.brand = res.data.quote_info.brand_name;
var arr = []; this.ruleForm.price_origin = res.data.quote_info.price_origin;
if (this.multipleSelection.length == 0) { this.ruleForm.tax_rate = res.data.quote_info.tax_rate;
this.$message({ this.ruleForm.delivery_int = res.data.quote_info.delivery_int;
message: '请至少选择一条数据', this.ruleForm.delivery_unit_val = res.data.quote_info.delivery_unit_val;
type: 'warning' this.ruleForm.moq = res.data.quote_info.moq;
}); this.ruleForm.remark = res.data.quote_info.remark;
return; if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
} this.ruleForm.expire_time = '';
for (var i = 0; i < this.multipleSelection.length; i++) { } else {
arr.push(this.multipleSelection[i]['id']) this.ruleForm.expire_time = res.data.quote_info.expire_time;
} }
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/quote/delete", {
ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
});
this.getData();
} else {
this.$message(res.msg);
}
})
}).catch(() => {
})
},
handle(index, row) {
if (row.disabled) {
this.$message({
message: '已绑定,不能重复操作',
type: 'warning'
});
return;
}
if (this.active == 1) {
this.currentDataId = row.id;
} else {
this.currentDataId = row.goods_id;
}
this.title = this.active == 1 ? '确认-历史报价' : '确认-匹配库存';
this.dialogVisible = true;
this.ruleForm.quote_id = '';
this.isModify = true;
if (this.active != 1) {
//匹配库存 不请求接口
this.$http('get', "/api/quote/gettransinfoforsku", {
goods_id: row.goods_id,
inquiry_items_id: this.$route.query.id
}).then(res => {
if (res.code === 0) {
var datap_ = res.data.trans_to_quote_info;
datap_.price_origin = this.float(datap_.price_origin)
this.ruleForm.goods_name = datap_.goods_name;
this.ruleForm.batch = datap_.batch;
this.ruleForm.price_origin = datap_.price_origin;
this.ruleForm.brand_name = datap_.brand_name;
this.ruleForm.moq = datap_.moq;
this.ruleForm.mpq = datap_.mpq;
this.ruleForm.quote_number = datap_.quote_number;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
} else {
this.$http('get', "/api/quote/getinfo", {
id: row.id
}).then(res => {
if (res.code === 0) {
res.data.quote_info.price_other = this.float(res.data.quote_info.price_other)
res.data.quote_info.price_origin = this.float(res.data.quote_info.price_origin)
this.ruleForm.goods_name = res.data.quote_info.goods_name;
this.ruleForm.brand_name = res.data.quote_info.brand_name;
this.ruleForm.quote_number = res.data.quote_info.quote_number;
this.ruleForm.currency = res.data.quote_info.currency.toString();
this.ruleForm.batch = res.data.quote_info.batch;
this.ruleForm.mpq = res.data.quote_info.mpq;
this.ruleForm.price_other = res.data.quote_info.price_other;
this.ruleForm.unit = res.data.quote_info.unit;
this.ruleForm.brand = res.data.quote_info.brand_name;
this.ruleForm.price_origin = res.data.quote_info.price_origin;
this.ruleForm.tax_rate = res.data.quote_info.tax_rate;
this.ruleForm.delivery_int = res.data.quote_info.delivery_int;
this.ruleForm.delivery_unit_val = res.data.quote_info.delivery_unit_val;
this.ruleForm.moq = res.data.quote_info.moq;
this.ruleForm.remark = res.data.quote_info.remark;
if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = '';
} else { } else {
this.ruleForm.expire_time = res.data.quote_info.expire_time; this.$message({
message: res.msg,
type: 'error'
});
} }
} else { })
this.$message({ }
message: res.msg,
type: 'error'
});
}
})
}
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/list/inquireDetail.min.css"; @import "../../assets/css/list/inquireDetail.min.css";
</style> </style>
\ No newline at end of file
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<el-table-column prop="moq" label="起订量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="moq" label="起订量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="100" align="center" :show-overflow-tooltip="true"> <el-table-column prop="price_other" label="其他费用" width="100" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span> <span>{{ scope.row.price_other | floatZero }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expire_time_val" label="报价有效期" width="200" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="expire_time_val" label="报价有效期" width="200" align="center" :show-overflow-tooltip="true"></el-table-column>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<Menu/> <Menu />
<el-dialog title="报价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px"> <el-dialog title="报价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px">
<el-table :data="logs" border max-height="600"> <el-table :data="logs" border max-height="600">
<el-table-column prop="create_time" label="时间" min-width="150" align="center"></el-table-column> <el-table-column prop="create_time" label="时间" min-width="150" align="center"></el-table-column>
...@@ -164,12 +164,12 @@ ...@@ -164,12 +164,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row year-list"> <ul class="row year-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in year" :class="{curr:yearIndex==indexY}" @click="tabChange(indexY,1)">{{ v }}年</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in year" :class="{ curr: yearIndex == indexY }" @click="tabChange(indexY, 1)">{{ v }}年</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(1,year[yearIndex])">确定</el-button> <el-button size="mini" round @click="confirm(1, year[yearIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -178,12 +178,12 @@ ...@@ -178,12 +178,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndex==indexY}" @click="tabChange(indexY,2)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndex == indexY }" @click="tabChange(indexY, 2)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(2,period[periodIndex])">确定</el-button> <el-button size="mini" round @click="confirm(2, period[periodIndex])">确定</el-button>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <div class="batch-box verCenter">
...@@ -192,12 +192,12 @@ ...@@ -192,12 +192,12 @@
</div> </div>
<div class="content row"> <div class="content row">
<ul class="row period-list"> <ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndexTwo==indexY}" @click="tabChange(indexY,3)">{{ v }}</li> <li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndexTwo == indexY }" @click="tabChange(indexY, 3)">{{ v }}</li>
</ul> </ul>
</div> </div>
<div class="footer-btn row verCenter"> <div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(3,period[periodIndexTwo])">确定</el-button> <el-button size="mini" round @click="confirm(3, period[periodIndexTwo])">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -252,526 +252,494 @@ ...@@ -252,526 +252,494 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import {NODE_ENVS} from "../../ajax"; import { NODE_ENVS } from "../../ajax";
import Tool from '../../tool' import Tool from '../../tool'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Tooltip).use(Popover); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Autocomplete).use(Tooltip).use(Popover);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Tag); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Tag);
export default { export default {
name: "quote", name: "quote",
data() { data() {
return { return {
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000)); return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
}
},
title: '新增报价',
total: 0,
limit: 10,
page: 1,
tableData: [],
multipleSelection: [],
dialogVisible: false,
dialogQuoteVisible: false,
logs: [],
quote_time_val: "",//最近报价时间
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
pin_obj_id: '',//关联库存id
visible: false,
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
ruleForm: {
inquiry_id: '',
inquiry_sn: '',
inquiry_items_id: '',
quote_id: '',
goods_name: '',
quote_number: '',
currency: '1',
batch: '',
mpq: '',
price_other: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
delivery_int: '',
delivery_unit_val: '工作日',
delivery_time: '',//delivery_int+delivery_unit_val
moq: '',
expire_time: '',
remark: ''
},
rules: {
goods_name: [{
required: true,
message: '请输入报价型号',
trigger: 'blur'
}],
quote_number: [{
required: true,
message: '请输入报价数量',
trigger: 'blur'
}],
currency: [{
required: true,
message: '请选择币种',
trigger: 'blur'
}],
batch: [{
required: true,
message: '请输入批次',
trigger: 'change'
}],
price_origin: [{
required: true,
message: '请输入价格',
trigger: 'blur'
},],
delivery_int: [{
required: true,
message: '请输入货期',
trigger: 'blur'
}],
expire_time: [{
required: true,
message: '请输入报价有效期',
trigger: 'blur'
}]
},
formParam: {
goods_name: "",
brand_name: "",
quote_time: "",
status: ""
} }
}, };
title: '新增报价', },
total: 0, created() {
limit: 10, let status = this.$route.query.status;
page: 1, if (status) {
tableData: [], this.formParam.status = status;
multipleSelection: [],
dialogVisible: false,
dialogQuoteVisible: false,
logs: [],
quote_time_val: "",//最近报价时间
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
pin_obj_id: '',//关联库存id
visible: false,
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
ruleForm: {
inquiry_id: '',
inquiry_sn: '',
inquiry_items_id: '',
quote_id: '',
goods_name: '',
quote_number: '',
currency: '1',
batch: '',
mpq: '',
price_other: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
delivery_int: '',
delivery_unit_val: '工作日',
delivery_time: '',//delivery_int+delivery_unit_val
moq: '',
expire_time: '',
remark: ''
},
rules: {
goods_name: [{
required: true,
message: '请输入报价型号',
trigger: 'blur'
}],
quote_number: [{
required: true,
message: '请输入报价数量',
trigger: 'blur'
}],
currency: [{
required: true,
message: '请选择币种',
trigger: 'blur'
}],
batch: [{
required: true,
message: '请输入批次',
trigger: 'change'
}],
price_origin: [{
required: true,
message: '请输入价格',
trigger: 'blur'
},],
delivery_int: [{
required: true,
message: '请输入货期',
trigger: 'blur'
}],
expire_time: [{
required: true,
message: '请输入报价有效期',
trigger: 'blur'
}]
},
formParam: {
goods_name: "",
brand_name: "",
quote_time: "",
status: ""
}
};
},
created() {
let status = this.$route.query.status;
if (status) {
this.formParam.status = status;
}
this.getData();
},
methods: {
getData() {
//格式化时间
if (this.quote_time_val) {
this.formParam.quote_time = this.quote_time_val[0] + '~' + this.quote_time_val[1];
} else {
this.formParam.quote_time = '';
} }
var params = Object.assign({}, {page: this.page}, {limit: this.limit}, this.formParam); this.getData();
this.$http('get', "/api/quote/getlist", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = res.data.total;
} else {
this.$message({
showClose: true,
message: res.msg,
type: 'warning'
});
}
})
}, },
getLogs(obj_type, obj_id) { methods: {
this.$http('GET', "/api/log/getLogs", { getData() {
obj_type: obj_type, //格式化时间
obj_id: obj_id if (this.quote_time_val) {
}).then(res => { this.formParam.quote_time = this.quote_time_val[0] + '~' + this.quote_time_val[1];
if (res.code === 0) {
this.dialogVisible = true;
this.logs = res.data.list;
} else { } else {
this.$message({ this.formParam.quote_time = '';
message: res.msg,
type: 'warning'
});
} }
}); var params = Object.assign({}, { page: this.page }, { limit: this.limit }, this.formParam);
}, this.$http('get', "/api/quote/getlist", params).then(res => {
/** if (res.code === 0) {
* 格式化数据 this.tableData = res.data.list || [];
* @param value this.total = res.data.total;
* @returns {number} } else {
*/ this.$message({
float(value) { showClose: true,
let num = Number(value) message: res.msg,
if (num) { type: 'warning'
return num });
} else { }
return 0 })
} },
}, getLogs(obj_type, obj_id) {
/** this.$http('GET', "/api/log/getLogs", {
* 前进年份 obj_type: obj_type,
*/ obj_id: obj_id
prevChange() { }).then(res => {
this.yearIndex = -1; if (res.code === 0) {
let starYear = this.year[0]; this.dialogVisible = true;
let arr = []; this.logs = res.data.list;
for (let i = 0; i < 15; i++) { } else {
arr.push(starYear - (i + 1)) this.$message({
} message: res.msg,
this.year = arr.sort(); type: 'warning'
}, });
/** }
* 后退年份
*/
nextChange() {
this.yearIndex = -1;
let starYear = this.year[this.year.length - 1] * 1;
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
}
this.year = arr;
},
/**
* 批次年月选择
* @param index
* @param type
*/
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
}
},
/**
* 批次关闭
* @param type
* @param index
*/
clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
/**
* 批次确定
* @param type
* @param val
* @param index
* @returns {boolean}
*/
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
message: '请选择年份',
type: 'warning'
}); });
return false; },
} /**
if (type == 1) { * 格式化数据
val = val.toString(); * @param value
val = val.substring(val.length - 2); * @returns {number}
this.ruleForm.batch = val + '+'; */
} else if (type == 2) { float(value) {
if (!val) { let num = Number(value)
this.$message({ if (num) {
message: '请选择第一周期', return num
type: 'warning' } else {
}); return 0
return false;
} }
let year = this.year[this.yearIndex].toString(); },
year = year.substring(year.length - 2); /**
this.ruleForm.batch = year + val; * 前进年份
} else if (type == 3) { */
if (this.periodIndex == -1) { prevChange() {
this.$message({ this.yearIndex = -1;
message: '请选择第一周期', let starYear = this.year[0];
type: 'warning' let arr = [];
}); for (let i = 0; i < 15; i++) {
return false; arr.push(starYear - (i + 1))
} }
if (!val) { this.year = arr.sort();
this.$message({ },
message: '请选择第二周期', /**
type: 'warning' * 后退年份
}); */
return false; nextChange() {
this.yearIndex = -1;
let starYear = this.year[this.year.length - 1] * 1;
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
}
this.year = arr;
},
/**
* 批次年月选择
* @param index
* @param type
*/
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
} }
var one = parseInt(this.period[this.periodIndex]); },
var two = parseInt(val); /**
if (two <= one) { * 批次关闭
* @param type
* @param index
*/
clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
/**
* 批次确定
* @param type
* @param val
* @param index
* @returns {boolean}
*/
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({ this.$message({
message: '不可小于第一周期', message: '请选择年份',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.ruleForm.batch = year + val;
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString(); let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2); year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString(); let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2); period = period.substring(period.length - 2);
val = val.toString(); val = val.toString();
val = val.substring(val.length - 2); val = val.substring(val.length - 2);
let prev = year + period; let prev = year + period;
let next = year + val; let next = year + val;
this.ruleForm.batch = prev + '-' + next; this.ruleForm.batch = prev + '-' + next;
} }
this.visible = false; this.visible = false;
}, },
/** /**
* 税率切换 * 税率切换
* @param val * @param val
*/ */
currentChange(val) { currentChange(val) {
if (val == 1) { if (val == 1) {
this.ruleForm.tax_rate = '13%'; this.ruleForm.tax_rate = '13%';
} else { } else {
this.ruleForm.tax_rate = '0%'; this.ruleForm.tax_rate = '0%';
} }
}, },
/** /**
*报价弹窗提交 *报价弹窗提交
* @param formName * @param formName
*/ */
submitForm(formName) { submitForm(formName) {
var that = this; var that = this;
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
var params = this.ruleForm; var params = this.ruleForm;
//转化税率 //转化税率
if (params.tax_rate == '13%') { if (params.tax_rate == '13%') {
params.tax_rate = 0.13; params.tax_rate = 0.13;
} else {
params.tax_rate = 0;
}
this.ruleForm.delivery_time = this.ruleForm.delivery_int + this.ruleForm.delivery_unit_val; //拼接货期字段
this.$http('post', "/api/quote/save", params).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose() {
that.dialogQuoteVisible = false;
that.getData();
}
});
} else { } else {
params.tax_rate = 0;
}
this.ruleForm.delivery_time = this.ruleForm.delivery_int + this.ruleForm.delivery_unit_val; //拼接货期字段
this.$http('post', "/api/quote/save", params).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose() {
that.dialogQuoteVisible = false;
that.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(err => {
this.$message({ this.$message({
message: res.msg, message: '网络出现问题',
type: 'error' type: 'error'
}); });
}
}).catch(err => {
this.$message({
message: '网络出现问题',
type: 'error'
}); });
} else {
return false;
}
});
},
/**
* 修改
*/
update() {
if (this.multipleSelection.length != 1) {
this.$message({
showClose: true,
message: '请选择一条询价信息',
type: 'warning'
}); });
} else { return;
return false;
} }
});
},
/**
* 修改
*/
update() {
if (this.multipleSelection.length != 1) {
this.$message({
showClose: true,
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].quote_status != 1 && this.multipleSelection[0].quote_status != 7) { if (this.multipleSelection[0].quote_status != 1 && this.multipleSelection[0].quote_status != 7) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: '请勾选状态为确认中和待确认', message: '请勾选状态为确认中和待确认',
type: 'warning' type: 'warning'
}); });
return; return;
} }
var row = this.multipleSelection[0]; var row = this.multipleSelection[0];
this.title = '修改报价'; this.title = '修改报价';
this.dialogQuoteVisible = true; this.dialogQuoteVisible = true;
this.ruleForm.inquiry_sn = row.inquiry_sn; this.ruleForm.inquiry_sn = row.inquiry_sn;
this.ruleForm.inquiry_id = row.inquiry_id; this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_items_id = row.inquiry_items_id; this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.quote_id = row.quote_id; //编辑的时候需要 this.ruleForm.quote_id = row.quote_id; //编辑的时候需要
this.ruleForm.goods_name = row.quote_goods_name;//赋值型号 this.ruleForm.goods_name = row.quote_goods_name;//赋值型号
this.ruleForm.brand_name = row.quote_brand_name;//赋值品牌 this.ruleForm.brand_name = row.quote_brand_name;//赋值品牌
this.ruleForm.quote_number = row.quote_number;//报价数量 this.ruleForm.quote_number = row.quote_number;//报价数量
row.price_origin = this.float(row.price_origin);//价格转换 row.price_origin = this.float(row.price_origin);//价格转换
this.ruleForm.price_origin = row.price_origin;//价格 this.ruleForm.price_origin = row.price_origin;//价格
this.ruleForm.currency = row.currency.toString();//币种 this.ruleForm.currency = row.currency.toString();//币种
this.ruleForm.tax_rate = Number(row.tax_rate) * 100 + '%';//税率 this.ruleForm.tax_rate = Number(row.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = row.batch;//批次 this.ruleForm.batch = row.batch;//批次
this.ruleForm.delivery_int = row.delivery_info.delivery_int; //货期 this.ruleForm.delivery_int = row.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = row.delivery_info.delivery_unit_val;//货期单位 this.ruleForm.delivery_unit_val = row.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = row.mpq;//最小包装数量 this.ruleForm.mpq = row.mpq;//最小包装数量
this.ruleForm.moq = row.moq;//起订量 this.ruleForm.moq = row.moq;//起订量
row.price_other = this.float(row.price_other);//其他费用 row.price_other = this.float(row.price_other);//其他费用
this.ruleForm.price_other = row.price_other;//其他费用 this.ruleForm.price_other = row.price_other;//其他费用
this.ruleForm.remark = row.remark;//备注 this.ruleForm.remark = row.remark;//备注
//报价有效期 //报价有效期
if (row.expire_time_val == '0000-00-00 00:00:00') { if (row.expire_time_val == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = ''; this.ruleForm.expire_time = '';
} else { } else {
this.ruleForm.expire_time = row.expire_time_val; this.ruleForm.expire_time = row.expire_time_val;
} }
}, },
handleClick(row) { handleClick(row) {
this.getLogs(505, row.quote_id); this.getLogs(505, row.quote_id);
console.log(row); console.log(row);
}, },
//型号 //型号
querySearchAsync(queryString, cb) { querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", { this.$http('get', "/api/search/getspu", {
spu_name: queryString spu_name: queryString
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
var arrlist_ = res.data.list || []; var arrlist_ = res.data.list || [];
var arr_ = [] var arr_ = []
for (var i = 0; i < arrlist_.length; i++) { for (var i = 0; i < arrlist_.length; i++) {
arr_.push({ arr_.push({
value: arrlist_[i]['spu_name'] value: arrlist_[i]['spu_name']
}) })
}
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, //品牌
//品牌 querySearchAsyncBrand(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/brand/get_stand_brand", {
this.$http('get', "/api/brand/get_stand_brand", { brand: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, resetForm(formName) {
resetForm(formName) { this.quote_time_val = '';
this.quote_time_val = ''; this.$refs[formName].resetFields();
this.$refs[formName].resetFields(); },
}, onSubmit() {
onSubmit() { this.page = 1;
this.page = 1; this.getData();
this.getData(); },
}, handleSelectionChange(val) {
handleSelectionChange(val) { this.multipleSelection = val;
this.multipleSelection = val; },
}, handleSizeChange(val) {
handleSizeChange(val) { this.limit = val;
this.limit = val; this.getData();
this.getData(); },
}, handleCurrentChange(val) {
handleCurrentChange(val) { this.page = val;
this.page = val; this.getData();
this.getData(); },
}, exportChange() {
exportChange() { var arr = [];
var arr = []; if (this.multipleSelection.length == 0) {
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['quote_id'])
}
window.location.href = NODE_ENVS + '/api/quote/export?ids=' + arr.join(",") + '&token=' + Tool.getCookie('token');
},
close() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
arr = this.multipleSelection.map(obj => {
return obj.quote_id;
})
this.$http('post', "/api/quote/close", {
ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message({ this.$message({
message: '关闭成功', showClose: true,
type: 'success' message: '请至少选择一条数据',
type: 'warning'
}); });
this.getData(); return;
} else { }
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['quote_id'])
}
window.location.href = NODE_ENVS + '/api/quote/export?ids=' + arr.join(",") + '&token=' + Tool.getCookie('token');
},
close() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: res.msg, message: '请至少选择一条数据',
type: 'warning' type: 'warning'
}); });
return;
} }
}) arr = this.multipleSelection.map(obj => {
}, return obj.quote_id;
del() { })
var arr = []; this.$http('post', "/api/quote/close", {
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/quote/delete", {
ids: arr.join(",") ids: arr.join(",")
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message("删除成功"); this.$message({
message: '关闭成功',
type: 'success'
});
this.getData(); this.getData();
} else { } else {
this.$message({ this.$message({
...@@ -781,16 +749,48 @@ export default { ...@@ -781,16 +749,48 @@ export default {
}); });
} }
}) })
}).catch(() => { },
del() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
}) for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('post', "/api/quote/delete", {
ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message("删除成功");
this.getData();
} else {
this.$message({
showClose: true,
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
})
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/list/quote.min.css"; @import "../../assets/css/list/quote.min.css";
</style> </style>
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<Menu/> <Menu />
<el-dialog title="消息详情" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px"> <el-dialog title="消息详情" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px">
<el-descriptions size="medium" border :column="2"> <el-descriptions size="medium" border :column="2">
<el-descriptions-item> <el-descriptions-item>
...@@ -58,92 +58,90 @@ ...@@ -58,92 +58,90 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "news", name: "news",
data() { data() {
return { return {
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
dialogVisible: false, dialogVisible: false,
msgDetail: {}, msgDetail: {},
formParam: { formParam: {
msg_type: '', msg_type: '',
date: '' date: ''
}
};
},
created() {
this.getData()
},
methods: {
getData() {
var params = Object.assign({},
{page: this.page, limit: this.limit},
this.formParam,
{start_time: this.formParam.date ? this.formParam.date[0] : ''},
{end_time: this.formParam.date ? this.formParam.date[1] : ''}
);
this.$http('GET', "/api/message/getMsgList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
},
getMsgDetail(msg_id) {
this.$http('GET', "/api/message/getMsgDetail", {msg_id: msg_id}).then(res => {
if (res.code === 0) {
this.msgDetail = res.data;
this.dialogVisible = true;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
viewChange(index, row) {
this.getMsgDetail(row.id);
}, },
onSubmit() { created() {
this.page = 1; this.getData()
this.getData();
}, },
resetForm(formName) { methods: {
this.formParam.date = ''; getData() {
this.$refs[formName].resetFields(); var params = Object.assign({},
}, { page: this.page, limit: this.limit },
handleSizeChange(val) { this.formParam,
this.limit = val; { start_time: this.formParam.date ? this.formParam.date[0] : '' },
this.getData(); { end_time: this.formParam.date ? this.formParam.date[1] : '' }
);
this.$http('GET', "/api/message/getMsgList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
getMsgDetail(msg_id) {
this.$http('GET', "/api/message/getMsgDetail", { msg_id: msg_id }).then(res => {
if (res.code === 0) {
this.msgDetail = res.data;
this.dialogVisible = true;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
viewChange(index, row) {
this.getMsgDetail(row.id);
},
onSubmit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
}
}, },
handleCurrentChange(val) { components: {
this.page = val; Menu
this.getData();
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="notice-content" v-html="noticeMsg.content"></div> <div class="notice-content" v-html="noticeMsg.content"></div>
<div class="enclosure row verCenter"> <div class="enclosure row verCenter">
<span>附件:</span> <span>附件:</span>
<a class="down" :href="noticeMsg.attachment_url " target="_blank">{{ noticeMsg.attachment_name || '暂无附件' }}</a> <a class="down" :href="noticeMsg.attachment_url" target="_blank">{{ noticeMsg.attachment_name || '暂无附件' }}</a>
</div> </div>
<div class="notice-bottom row bothSide verCenter"> <div class="notice-bottom row bothSide verCenter">
<span>发件人:深圳市猎芯科技有限公司</span> <span>发件人:深圳市猎芯科技有限公司</span>
...@@ -32,71 +32,69 @@ ...@@ -32,71 +32,69 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "notice", name: "notice",
data() { data() {
return { return {
noticeMsg: [],//系统公告消息 noticeMsg: [],//系统公告消息
dialogNoticeVisible: false, dialogNoticeVisible: false,
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [] list: []
}; };
},
created() {
this.getData()
},
methods: {
getData() {
this.$http('get', "/api/system/getNoticeList", {
page: this.page,
limit: this.limit,
}).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.list = res.data.list;
this.total = Number(res.data.count) || 0;
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}, },
view(row) { created() {
this.dialogNoticeVisible = true; this.getData()
this.noticeMsg = row;
}, },
handleSizeChange(val) { methods: {
this.limit = val; getData() {
this.getData(); this.$http('get', "/api/system/getNoticeList", {
page: this.page,
limit: this.limit,
}).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.list = res.data.list;
this.total = Number(res.data.count) || 0;
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
view(row) {
this.dialogNoticeVisible = true;
this.noticeMsg = row;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
}
}, },
handleCurrentChange(val) { components: {
this.page = val; Menu
this.getData();
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less"></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<el-table-column fixed type="selection" width="40" align="center"></el-table-column> <el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column prop="purchase_sn" label="订单号" width="200" align="center" :show-overflow-tooltip="true"> <el-table-column prop="purchase_sn" label="订单号" width="200" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="'/#/orderTrackGoodsDetail?purchase_id='+scope.row.purchase_id" class="alink">{{ scope.row.purchase_sn }}</a> <a :href="'/#/orderTrackGoodsDetail?purchase_id=' + scope.row.purchase_id" class="alink">{{ scope.row.purchase_sn }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="company_name" label="订货公司" min-width="160" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="company_name" label="订货公司" min-width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
<el-table-column prop="shipping_status_val" label="发货状态" width="100" align="center"> <el-table-column prop="shipping_status_val" label="发货状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.shipping_status_val == '待发货'">{{ scope.row.shipping_status_val }}</span> <span v-if="scope.row.shipping_status_val == '待发货'">{{ scope.row.shipping_status_val }}</span>
<a class="f-yellow1" v-if="scope.row.shipping_status_val == '部分发货'" :href="'/#/orderTrackInvoice?purchase_id='+scope.row.purchase_id">{{ scope.row.shipping_status_val }}</a> <a class="f-yellow1" v-if="scope.row.shipping_status_val == '部分发货'" :href="'/#/orderTrackInvoice?purchase_id=' + scope.row.purchase_id">{{ scope.row.shipping_status_val }}</a>
<a class="alink" v-if="scope.row.shipping_status_val == '全部发货'" :href="'/#/orderTrackInvoice?purchase_id='+scope.row.purchase_id">{{ scope.row.shipping_status_val }}</a> <a class="alink" v-if="scope.row.shipping_status_val == '全部发货'" :href="'/#/orderTrackInvoice?purchase_id=' + scope.row.purchase_id">{{ scope.row.shipping_status_val }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="buyer_name" label="订单人员" width="100" align="center"> <el-table-column prop="buyer_name" label="订单人员" width="100" align="center">
...@@ -158,237 +158,237 @@ ...@@ -158,237 +158,237 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag} from 'element-ui' import { Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag } from 'element-ui'
import Tool from "@/tool"; import Tool from "@/tool";
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import qs from 'qs'; import qs from 'qs';
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(DatePicker).use(Tag).use(Popover); Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete).use(DatePicker).use(Tag).use(Popover);
export default { export default {
name: "orderTrackGoods", name: "orderTrackGoods",
data() { data() {
return { return {
total_amount: '',//订单总金额 total_amount: '',//订单总金额
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
dialogVisible: false, dialogVisible: false,
logs: [], logs: [],
create_time_val: '', create_time_val: '',
inquiry_item_id: '',//询价id inquiry_item_id: '',//询价id
formInline: { formInline: {
purchase_sn: '', purchase_sn: '',
goods_name: '', goods_name: '',
brand_name: '', brand_name: '',
shipping_status: '', shipping_status: '',
status: '', status: '',
pay_status: '', pay_status: '',
inquiry_sn: '', inquiry_sn: '',
quote_sn: '', quote_sn: '',
source_type: '', source_type: '',
currency: '', currency: '',
create_time: '' create_time: ''
}, },
tableData: "", tableData: "",
multipleSelection: [] multipleSelection: []
}; };
},
created() {
this.formInline.inquiry_sn = this.$route.query.inquiry_sn || '';
this.formInline.quote_sn = this.$route.query.quote_sn || '';
this.getData();
},
watch: {
$route(to, from) {
if (to.path == '/orderTrackGoods') {
this.formInline.inquiry_sn = this.$route.query.inquiry_sn || '';
this.formInline.quote_sn = this.$route.query.quote_sn || '';
this.getData();
}
}
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formInline.create_time = '';
}
var params = Object.assign({}, {page: this.page}, {limit: this.limit}, this.formInline, {inquiry_item_id: this.inquiry_item_id})
this.$http('post', "/api/purchase/getPurchaseList", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
this.total_amount = res.data.total_amount;
} else {
this.$message({
message: res.msg,
type: "error"
});
}
})
}, },
handleCurrentChange(val) { created() {
this.page = val; this.formInline.inquiry_sn = this.$route.query.inquiry_sn || '';
this.formInline.quote_sn = this.$route.query.quote_sn || '';
this.getData(); this.getData();
}, },
handleSelectionChange(val) { watch: {
this.multipleSelection = val; $route(to, from) {
}, if (to.path == '/orderTrackGoods') {
handleSizeChange(val) { this.formInline.inquiry_sn = this.$route.query.inquiry_sn || '';
this.limit = val; this.formInline.quote_sn = this.$route.query.quote_sn || '';
this.getData(); this.getData();
}
}
}, },
getLogs(obj_type, obj_id) { methods: {
this.$http('GET', "/api/log/getLogs", { getData() {
obj_type: obj_type, //格式化时间
obj_id: obj_id if (this.create_time_val) {
}).then(res => { this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
if (res.code === 0) {
this.dialogVisible = true;
this.logs = res.data.list;
} else { } else {
this.formInline.create_time = '';
}
var params = Object.assign({}, { page: this.page }, { limit: this.limit }, this.formInline, { inquiry_item_id: this.inquiry_item_id })
this.$http('post', "/api/purchase/getPurchaseList", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
this.total_amount = res.data.total_amount;
} else {
this.$message({
message: res.msg,
type: "error"
});
}
})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisible = true;
this.logs = res.data.list;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
});
},
handleClick(row) {
this.getLogs(204, row.purchase_id);
console.log(row);
},
submit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 导出
*/
exportChange() {
var ids = this.multipleSelection.map(obj => {
return obj.purchase_id;
});
var params = Object.assign({}, { token: Tool.getCookie('token') }, { ids: ids.join(',') })
var url = NODE_ENVS + '/api/purchase/export?' + qs.stringify(params);
const newsUrl = this.$router.resolve(url);
window.open(url);
},
//生成发货单
addSend() {
if (this.multipleSelection.length != 1) {
this.$message({ this.$message({
message: res.msg, message: "请选择一条数据进行操作",
type: 'warning' type: 'warning'
}); });
return false;
} }
});
},
handleClick(row) {
this.getLogs(204, row.purchase_id);
console.log(row);
},
submit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 导出
*/
exportChange() {
var ids = this.multipleSelection.map(obj => {
return obj.purchase_id;
});
var params = Object.assign({}, {token: Tool.getCookie('token')},{ids: ids.join(',')})
var url = NODE_ENVS + '/api/purchase/export?' + qs.stringify(params);
const newsUrl = this.$router.resolve(url);
window.open(url);
},
//生成发货单
addSend() {
if (this.multipleSelection.length != 1) {
this.$message({
message: "请选择一条数据进行操作",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].status_val == '待提审') { if (this.multipleSelection[0].status_val == '待提审') {
this.$message({ this.$message({
message: "待提审状态下不可生成", message: "待提审状态下不可生成",
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (this.multipleSelection[0].status_val == '待审核') { if (this.multipleSelection[0].status_val == '待审核') {
this.$message({ this.$message({
message: "待审核状态下不可生成", message: "待审核状态下不可生成",
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (this.multipleSelection[0].shipping_status_val != '待发货' && this.multipleSelection[0].shipping_status_val != '部分发货') { if (this.multipleSelection[0].shipping_status_val != '待发货' && this.multipleSelection[0].shipping_status_val != '部分发货') {
this.$message({ this.$message({
message: "请选择待发货/部分发货的数据进行操作", message: "请选择待发货/部分发货的数据进行操作",
type: 'warning' type: 'warning'
}); });
return false; return false;
}
this.$router.push({
path: "/OrderTrackPurAdd",
query: {
purchase_id: this.multipleSelection[0].purchase_id
} }
}) this.$router.push({
}, path: "/OrderTrackPurAdd",
//型号 query: {
querySearchAsync(queryString, cb) { purchase_id: this.multipleSelection[0].purchase_id
this.$http('get', "/api/search/getspu", { }
spu_name: queryString })
}).then(res => { },
if (res.code == 0) { //型号
if (res.data.list.length > 0) { querySearchAsync(queryString, cb) {
var arrlist_ = res.data.list || []; this.$http('get', "/api/search/getspu", {
var arr_ = [] spu_name: queryString
for (var i = 0; i < arrlist_.length; i++) { }).then(res => {
arr_.push({ if (res.code == 0) {
value: arrlist_[i]['spu_name'] if (res.data.list.length > 0) {
}) var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, //品牌
//品牌 querySearchAsyncBrand(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/brand/get_stand_brand", {
this.$http('get', "/api/brand/get_stand_brand", { brand: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
.tetx-goods { .tetx-goods {
font-size: 12px; font-size: 12px;
margin-top: 20px; margin-top: 20px;
flex-wrap: wrap; flex-wrap: wrap;
span { span {
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
em { em {
color: #D9001B; color: #D9001B;
font-weight: bold; font-weight: bold;
margin-right: 15px; margin-right: 15px;
}
} }
}
</style> </style>
\ No newline at end of file
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
<el-table-column prop="in_qty" label="到货数量" min-width="80" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="in_qty" label="到货数量" min-width="80" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status_val" label="状态" min-width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="status_val" label="状态" min-width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.status == 2 " disable-transitions>{{ scope.row.status_val }}</el-tag> <el-tag type="success" v-if="scope.row.status == 2" disable-transitions>{{ scope.row.status_val }}</el-tag>
<el-tag type="primary" v-else-if="scope.row.status == 1 " disable-transitions>{{ scope.row.status_val }}</el-tag> <el-tag type="primary" v-else-if="scope.row.status == 1" disable-transitions>{{ scope.row.status_val }}</el-tag>
<el-tag type="info" v-else-if="scope.row.status == -3 " disable-transitions>{{ scope.row.status_val }}</el-tag> <el-tag type="info" v-else-if="scope.row.status == -3" disable-transitions>{{ scope.row.status_val }}</el-tag>
<el-tag type="primary" v-else>{{ scope.row.status_val }}</el-tag> <el-tag type="primary" v-else>{{ scope.row.status_val }}</el-tag>
<el-tooltip :aa="scope" class="item" effect="dark" placement="top-start"> <el-tooltip :aa="scope" class="item" effect="dark" placement="top-start">
<i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i> <i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i>
...@@ -113,247 +113,247 @@ ...@@ -113,247 +113,247 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Form, FormItem, Image, Input, Link, Message, MessageBox, Option, Pagination, Select, Table, TableColumn, Tag} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Form, FormItem, Image, Input, Link, Message, MessageBox, Option, Pagination, Select, Table, TableColumn, Tag } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Autocomplete).use(Tag).use(DatePicker).use(Image).use(Link); Vue.use(TableColumn).use(Table).use(Autocomplete).use(Tag).use(DatePicker).use(Image).use(Link);
export default { export default {
name: "orderTrackInvoice", name: "orderTrackInvoice",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
dialogVisible: false, dialogVisible: false,
dialogFileVisible: false, dialogFileVisible: false,
logs: [], logs: [],
create_time_val: '',//创建时间 create_time_val: '',//创建时间
qc_time_val: '',//质检时间 qc_time_val: '',//质检时间
qcImage: [],//质检图片 qcImage: [],//质检图片
qcAttachments: [],//质检附件 qcAttachments: [],//质检附件
purchase_id: '',//记录从已采购订单页面跳转来的 purchase_id: '',//记录从已采购订单页面跳转来的
stock_in_sn: '',//记录从退货单页面跳转来的 stock_in_sn: '',//记录从退货单页面跳转来的
formInline: { formInline: {
create_time: '',//创建时间 create_time: '',//创建时间
qc_time: '',//质检时间 qc_time: '',//质检时间
stock_in_sn: "", stock_in_sn: "",
goods_name: '', goods_name: '',
brand_name: '', brand_name: '',
status: '' status: ''
}, },
tableData: "", tableData: "",
multipleSelection: [], //选择数据 multipleSelection: [], //选择数据
}; };
}, },
created() { created() {
this.purchase_id = this.$route.query.purchase_id || ''; this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_sn || ''; this.formInline.stock_in_sn = this.$route.query.stock_in_sn || '';
this.getData(); this.getData();
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
if (to.path == '/orderTrackInvoice') { if (to.path == '/orderTrackInvoice') {
this.purchase_id = this.$route.query.purchase_id || ''; this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_sn || ''; this.formInline.stock_in_sn = this.$route.query.stock_in_sn || '';
this.getData(); this.getData();
} }
}
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formInline.create_time = '';
}
if (this.qc_time_val) {
this.formInline.qc_time = this.qc_time_val[0] + '~' + this.qc_time_val[1];
} else {
this.formInline.qc_time = '';
} }
var params = Object.assign({}, {page: this.page}, {limit: this.limit}, this.formInline, {purchase_id: this.purchase_id}); },
this.$http('post', "/api/purchase/getDeliveryList", params).then(res => { methods: {
if (res.code === 0) { getData() {
this.tableData = res.data.list || []; //格式化时间
this.total = Number(res.data.total) || 0; if (this.create_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else { } else {
this.$message(res.msg); this.formInline.create_time = '';
} }
}) if (this.qc_time_val) {
}, this.formInline.qc_time = this.qc_time_val[0] + '~' + this.qc_time_val[1];
/** } else {
* 查看图片 this.formInline.qc_time = '';
*/ }
viewPic(qc_id, type) { var params = Object.assign({}, { page: this.page }, { limit: this.limit }, this.formInline, { purchase_id: this.purchase_id });
if (type == 2) { this.$http('post', "/api/purchase/getDeliveryList", params).then(res => {
this.$http('POST', "/api/purchase/getQcAttachments", {qc_id: qc_id}).then(res => {
if (res.code === 0) {
this.dialogFileVisible = true;
this.qcAttachments = res.data.list;
} else {
this.$message(res.msg);
}
})
} else {
this.$http('POST', "/api/purchase/getQcImages", {qc_id: qc_id}).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.dialogVisible = true; this.tableData = res.data.list || [];
this.qcImage = res.data.list; this.total = Number(res.data.total) || 0;
} else { } else {
this.$message(res.msg); this.$message(res.msg);
} }
}) })
} },
}, /**
handleCurrentChange(val) { * 查看图片
this.page = val; */
this.getData(); viewPic(qc_id, type) {
}, if (type == 2) {
handleSizeChange(val) { this.$http('POST', "/api/purchase/getQcAttachments", { qc_id: qc_id }).then(res => {
this.limit = val; if (res.code === 0) {
this.getData(); this.dialogFileVisible = true;
}, this.qcAttachments = res.data.list;
handleSelectionChange(val) { } else {
this.multipleSelection = val; this.$message(res.msg);
}, }
submit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.qc_time_val = '';
this.$refs[formName].resetFields();
},
//取消发货
cancelSend() {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({
message: "请勾选数据进行操作",
type: 'warning'
});
return false;
}
let stock_in_ids = [];
stock_in_ids = this.multipleSelection.map(obj => {
return obj.stock_in_id;
})
let source_arr = [];
let status_arr = [];
source_arr = this.multipleSelection.map(obj => {
return obj.source;
})
status_arr = this.multipleSelection.map(obj => {
return obj.status;
})
let source = source_arr.every(ele => ele === 2)
if (source) {
//待入库
let status = status_arr.every(ele => ele === 1)
if (status) {
MessageBox.confirm('确定取消发货吗?', {
type: 'error'
}).then(() => {
this.$http('POST', "/api/purchase/cancelSupDelivery", {stock_in_ids: stock_in_ids.join(',')}).then(res => {
if (res.code == 0) {
this.$message({
message: "操作成功",
type: 'success',
duration: 2000,
onClose() {
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
}).catch(() => {
}) })
} else { } else {
this.$http('POST', "/api/purchase/getQcImages", { qc_id: qc_id }).then(res => {
if (res.code === 0) {
this.dialogVisible = true;
this.qcImage = res.data.list;
} else {
this.$message(res.msg);
}
})
}
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
submit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.qc_time_val = '';
this.$refs[formName].resetFields();
},
//取消发货
cancelSend() {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({ this.$message({
message: '请选择待入库状态', message: "请勾选数据进行操作",
type: 'warning' type: 'warning'
}); });
return false;
} }
} else { let stock_in_ids = [];
this.$message({ stock_in_ids = this.multipleSelection.map(obj => {
message: '请选择创建人为自己的发货单', return obj.stock_in_id;
type: 'warning' })
});
} let source_arr = [];
}, let status_arr = [];
//型号 source_arr = this.multipleSelection.map(obj => {
querySearchAsync(queryString, cb) { return obj.source;
this.$http('get', "/api/search/getspu", { })
spu_name: queryString status_arr = this.multipleSelection.map(obj => {
}).then(res => { return obj.status;
if (res.code == 0) { })
if (res.data.list.length > 0) { let source = source_arr.every(ele => ele === 2)
var arrlist_ = res.data.list || []; if (source) {
var arr_ = [] //待入库
for (var i = 0; i < arrlist_.length; i++) { let status = status_arr.every(ele => ele === 1)
arr_.push({ if (status) {
value: arrlist_[i]['spu_name'] MessageBox.confirm('确定取消发货吗?', {
type: 'error'
}).then(() => {
this.$http('POST', "/api/purchase/cancelSupDelivery", { stock_in_ids: stock_in_ids.join(',') }).then(res => {
if (res.code == 0) {
this.$message({
message: "操作成功",
type: 'success',
duration: 2000,
onClose() {
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}) })
} }).catch(() => {
cb(arr_);
})
} else { } else {
cb([]); this.$message({
message: '请选择待入库状态',
type: 'warning'
});
} }
} else {
this.$message({
message: '请选择创建人为自己的发货单',
type: 'warning'
});
} }
}) },
}, //型号
//品牌 querySearchAsync(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/search/getspu", {
this.$http('get', "/api/brand/get_stand_brand", { spu_name: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]['spu_name']
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
//品牌
querySearchAsyncBrand(queryString, cb) {
this.$http('get', "/api/brand/get_stand_brand", {
brand: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]
})
}
cb(arr_);
} else {
cb([]);
}
}
})
},
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
.pic-list { .pic-list {
flex-wrap: wrap; flex-wrap: wrap;
} }
.pic-list .el-image { .pic-list .el-image {
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>
\ No newline at end of file
...@@ -64,138 +64,138 @@ ...@@ -64,138 +64,138 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn} from 'element-ui' import { Autocomplete, Button, Cascader, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(DatePicker); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(DatePicker);
Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete); Vue.use(TableColumn).use(Table).use(Cascader).use(Autocomplete);
export default { export default {
name: "orderTrackPurAdd", name: "orderTrackPurAdd",
data() { data() {
return { return {
purOrderDetail: {},//基本信息,发货信息 purOrderDetail: {},//基本信息,发货信息
purchase_uid: '', purchase_uid: '',
multipleSelection: [],//选中的数据 multipleSelection: [],//选中的数据
pickerOption: { pickerOption: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
}
},
rules: {
shipping_id: [
{required: true, message: '请选择物流公司', trigger: 'change'}
],
shipment_number: [
{required: true, message: '请输入物流单号', trigger: 'change'}
]
},
itemlist: [],
formParam: {
company_id: '',
shipping_id: '',
shipment_number: '',
delivery_time: '',
itemlist: []
}
};
},
created() {
this.purchase_uid = this.$route.query.purchase_id;
this.getData();
},
methods: {
getData() {
this.$http('POST', "/api/purchase/purOrderDetail", {
id: this.purchase_uid
}).then(res => {
if (res.code === 0) {
this.purOrderDetail = res.data;
this.formParam.company_id = res.data.purchase_info.company_id;
//组装formParam
for (let i = 0; i < res.data.purchase_item_list.length; i++) {
this.itemlist.push({
"purchase_item_id": res.data.purchase_item_list[i].purchase_item_id,
"purchase_id": res.data.purchase_item_list[i].purchase_id,
"out_qty": res.data.purchase_item_list[i].purchase_qty - res.data.purchase_item_list[i].out_qty
})
} }
} else { },
this.$message({ rules: {
message: res.msg, shipping_id: [
type: 'warning' { required: true, message: '请选择物流公司', trigger: 'change' }
}); ],
shipment_number: [
{ required: true, message: '请输入物流单号', trigger: 'change' }
]
},
itemlist: [],
formParam: {
company_id: '',
shipping_id: '',
shipment_number: '',
delivery_time: '',
itemlist: []
} }
}) };
}, },
handleCurrentChange(val) { created() {
this.page = val; this.purchase_uid = this.$route.query.purchase_id;
this.getData(); this.getData();
}, },
handleSelectionChange(val) { methods: {
this.multipleSelection = val; getData() {
}, this.$http('POST', "/api/purchase/purOrderDetail", {
submit(formName) { id: this.purchase_uid
var self = this; }).then(res => {
this.$refs[formName].validate((valid) => { if (res.code === 0) {
if (valid) { this.purOrderDetail = res.data;
if (this.multipleSelection.length <= 0) { this.formParam.company_id = res.data.purchase_info.company_id;
//组装formParam
for (let i = 0; i < res.data.purchase_item_list.length; i++) {
this.itemlist.push({
"purchase_item_id": res.data.purchase_item_list[i].purchase_item_id,
"purchase_id": res.data.purchase_item_list[i].purchase_id,
"out_qty": res.data.purchase_item_list[i].purchase_qty - res.data.purchase_item_list[i].out_qty
})
}
} else {
this.$message({ this.$message({
message: "请选择发货信息", message: res.msg,
type: 'warning' type: 'warning'
}); });
return false;
} }
let filterArr = []; })
for (let i = 0; i < this.itemlist.length; i++) { },
for (let j = 0; j < this.multipleSelection.length; j++) { handleCurrentChange(val) {
if (this.multipleSelection[j].purchase_item_id == this.itemlist[i].purchase_item_id) { this.page = val;
filterArr.push(this.itemlist[i]) this.getData();
} },
} handleSelectionChange(val) {
} this.multipleSelection = val;
this.formParam.itemlist = filterArr; },
this.$http('POST', "/api/purchase/addSupDelivery", this.formParam).then(res => { submit(formName) {
if (res.code === 0) { var self = this;
this.$message({ this.$refs[formName].validate((valid) => {
message: res.msg, if (valid) {
type: 'success', if (this.multipleSelection.length <= 0) {
duration: 2000,
onClose() {
document.querySelector('.item-boxs a.act .iconfont').click();
self.$router.push({
path: "/orderTrackGoods"
})
}
});
} else {
this.$message({ this.$message({
message: res.msg, message: "请选择发货信息",
type: 'error' type: 'warning'
}); });
return false;
} }
let filterArr = [];
for (let i = 0; i < this.itemlist.length; i++) {
for (let j = 0; j < this.multipleSelection.length; j++) {
if (this.multipleSelection[j].purchase_item_id == this.itemlist[i].purchase_item_id) {
filterArr.push(this.itemlist[i])
}
}
}
this.formParam.itemlist = filterArr;
this.$http('POST', "/api/purchase/addSupDelivery", this.formParam).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
document.querySelector('.item-boxs a.act .iconfont').click();
self.$router.push({
path: "/orderTrackGoods"
})
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
} else {
console.log('error submit!!');
return false;
}
});
},
canel() {
document.querySelector('.item-boxs a.act .iconfont').click();
setTimeout(() => {
this.$router.push({
path: "/orderTrackGoods"
}) })
} else { }, 1000)
console.log('error submit!!'); }
return false;
}
});
}, },
canel() { components: {
document.querySelector('.item-boxs a.act .iconfont').click(); Menu
setTimeout(() => {
this.$router.push({
path: "/orderTrackGoods"
})
}, 1000)
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
</style> </style>
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="退货时间"> <el-form-item label="退货时间">
<el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="create_time_val" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="create_time_val" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submit">查询</el-button> <el-button type="primary" @click="submit">查询</el-button>
...@@ -45,18 +45,18 @@ ...@@ -45,18 +45,18 @@
<el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange"> <el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column prop="stock_in_sn" label="对应发货单" width="160" :show-overflow-tooltip="true" align="center"> <el-table-column prop="stock_in_sn" label="对应发货单" width="160" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<a class="alink" :href="'/#/orderTrackInvoice?stock_in_sn='+scope.row.stock_in_sn">{{ scope.row.stock_in_sn }}</a> <a class="alink" :href="'/#/orderTrackInvoice?stock_in_sn=' + scope.row.stock_in_sn">{{ scope.row.stock_in_sn }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status_val" label="状态" width="100" :show-overflow-tooltip="true" align="center"> <el-table-column prop="status_val" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="danger" v-if="scope.row.status==-3">作废</el-tag> <el-tag type="danger" v-if="scope.row.status == -3">作废</el-tag>
<el-tag type="primary" v-else-if=" scope.row.status==-2">待提审</el-tag> <el-tag type="primary" v-else-if="scope.row.status == -2">待提审</el-tag>
<el-tag type="primary" v-else-if=" scope.row.status==-1">待审核</el-tag> <el-tag type="primary" v-else-if="scope.row.status == -1">待审核</el-tag>
<el-tag type="primary" v-else-if=" scope.row.status==1">待退货入库</el-tag> <el-tag type="primary" v-else-if="scope.row.status == 1">待退货入库</el-tag>
<el-tag type="warning" v-else-if=" scope.row.status==2">待付款退款</el-tag> <el-tag type="warning" v-else-if="scope.row.status == 2">待付款退款</el-tag>
<el-tag type="success" v-else-if="scope.row.status==3">完成</el-tag> <el-tag type="success" v-else-if="scope.row.status == 3">完成</el-tag>
<el-tag v-else-if="scope.row.status==4">待同步金蝶</el-tag> <el-tag v-else-if="scope.row.status == 4">待同步金蝶</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goods_name" label="型号" min-width="150" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="goods_name" label="型号" min-width="150" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -71,141 +71,141 @@ ...@@ -71,141 +71,141 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<Menu/> <Menu />
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn, Tag} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Form, FormItem, Input, Message, Option, Pagination, Select, Table, TableColumn, Tag } from 'element-ui'
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination);
Vue.use(TableColumn).use(Table).use(Autocomplete).use(Tag).use(DatePicker); Vue.use(TableColumn).use(Table).use(Autocomplete).use(Tag).use(DatePicker);
export default { export default {
name: "orderTrackInvoice", name: "orderTrackInvoice",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
dialogVisible: false, dialogVisible: false,
create_time_val: '', create_time_val: '',
formInline: { formInline: {
create_time: '', create_time: '',
stock_in_sn: "", stock_in_sn: "",
goods_name: '', goods_name: '',
brand_name: '', brand_name: '',
status: '' status: ''
}, },
tableData: "", tableData: "",
multipleSelection: [] //选择数据 multipleSelection: [] //选择数据
}; };
},
created() {
this.getData();
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.formInline.create_time = '';
}
var params = Object.assign({}, {page: this.page}, {limit: this.limit}, this.formInline)
this.$http('post', "/api/purchase/getReturnMaterialList", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message(res.msg);
}
})
}, },
/** created() {
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData(); this.getData();
}, },
/** methods: {
* 分页条数切换 getData() {
* @param val //格式化时间
*/ if (this.create_time_val) {
handleSizeChange(val) { this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
this.limit = val; } else {
this.getData(); this.formInline.create_time = '';
}, }
handleSelectionChange(val) { var params = Object.assign({}, { page: this.page }, { limit: this.limit }, this.formInline)
this.multipleSelection = val; this.$http('post', "/api/purchase/getReturnMaterialList", params).then(res => {
}, if (res.code === 0) {
submit() { this.tableData = res.data.list || [];
this.page = 1; this.total = Number(res.data.total) || 0;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 搜索型号
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else { } else {
cb([]); this.$message(res.msg);
} }
} })
}) },
}, /**
/** * 分页点击切换
* 搜索品牌 * @param val
* @param queryString */
* @param cb handleCurrentChange(val) {
*/ this.page = val;
querySearchAsyncBrand(queryString, cb) { this.getData();
this.$http('get', "/api/brand/get_stand_brand", { },
brand: queryString /**
}).then(res => { * 分页条数切换
if (res.code == 0) { * @param val
if (res.data.list.length > 0) { */
var arrlist_ = res.data.list || []; handleSizeChange(val) {
var arr_ = [] this.limit = val;
for (var i = 0; i < arrlist_.length; i++) { this.getData();
arr_.push({ },
value: arrlist_[i] handleSelectionChange(val) {
}) this.multipleSelection = val;
},
submit() {
this.page = 1;
this.getData();
},
resetForm(formName) {
this.create_time_val = '';
this.$refs[formName].resetFields();
},
/**
* 搜索型号
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
/**
* 搜索品牌
* @param queryString
* @param cb
*/
querySearchAsyncBrand(queryString, cb) {
this.$http('get', "/api/brand/get_stand_brand", {
brand: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]
})
}
cb(arr_);
} else {
cb([]);
}
}
})
},
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/goods/goods.min.css"; @import "../../assets/css/goods/goods.min.css";
</style> </style>
\ No newline at end of file
...@@ -32,16 +32,16 @@ ...@@ -32,16 +32,16 @@
<el-table-column fixed type="selection" width="40" align="center"></el-table-column> <el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column label="单号" min-width="20%" align="center"> <el-table-column label="单号" min-width="20%" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="'/#/listDetail?sn='+scope.row.up_sn+'&id='+scope.row.id" class="alink">{{ scope.row.up_sn }}</a> <a :href="'/#/listDetail?sn=' + scope.row.up_sn + '&id=' + scope.row.id" class="alink">{{ scope.row.up_sn }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_name" label="文件名字" min-width="20%" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="file_name" label="文件名字" min-width="20%" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="120" align="center"> <el-table-column prop="status" label="状态" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="primary">待处理</el-tag> <el-tag v-if="scope.row.status == 1" type="primary">待处理</el-tag>
<el-tag v-else-if="scope.row.status==2" type="warning">处理中</el-tag> <el-tag v-else-if="scope.row.status == 2" type="warning">处理中</el-tag>
<el-tag v-else-if="scope.row.status==3" type="success">已处理</el-tag> <el-tag v-else-if="scope.row.status == 3" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.status==4" type="danger">失败</el-tag> <el-tag v-else-if="scope.row.status == 4" type="danger">失败</el-tag>
<el-tooltip :aa="scope" class="item" effect="dark" placement="top-start"> <el-tooltip :aa="scope" class="item" effect="dark" placement="top-start">
<i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i> <i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i>
<div slot="content">{{ scope.row.status_tips }}</div> <div slot="content">{{ scope.row.status_tips }}</div>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</template> </template>
</p> </p>
<p class="tt" style="font-size: 12px;"> <p class="tt" style="font-size: 12px;">
上传的型号经由猎芯审核通过后,会展示在【猎芯网】进行售卖,并参与【猎芯询报价】系统自动推送询价<br/> 上传的型号经由猎芯审核通过后,会展示在【猎芯网】进行售卖,并参与【猎芯询报价】系统自动推送询价<br />
您此次上传的型号是否要对已在【猎芯网】展示的型号进行覆盖或是新增? 您此次上传的型号是否要对已在【猎芯网】展示的型号进行覆盖或是新增?
</p> </p>
<p class="alink">覆盖:已在【猎芯网】进行展示的型号全部下架,展示现在新上传的型号;</p> <p class="alink">覆盖:已在【猎芯网】进行展示的型号全部下架,展示现在新上传的型号;</p>
...@@ -91,183 +91,109 @@ ...@@ -91,183 +91,109 @@
<el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button> <el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button>
<el-upload :data="fileData" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleChange" :on-progress="handleProgress"> <el-upload :data="fileData" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleChange" :on-progress="handleProgress">
<el-button type="primary" :loading="uploading">确 定</el-button> <el-button type="primary" :loading="uploading">确 定</el-button>
<el-progress v-if="uploading" :percentage="progress"/> <el-progress v-if="uploading" :percentage="progress" />
</el-upload> </el-upload>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import Tool from '../../tool' import Tool from '../../tool'
import {NODE_ENVS} from "../../ajax"; import { NODE_ENVS } from "../../ajax";
import {Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Progress, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui' import { Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Progress, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag).use(Tooltip); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag).use(Tooltip);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default { export default {
name: "enter", name: "enter",
data() { data() {
return { return {
skuHref: location.hostname === 'xinlian.ichunt.com' ? 'https://cloud.ichunt.com/template/芯链SKU上传模板.csv' : 'http://cloud.liexindev.net/template/芯链SKU上传模板.csv', skuHref: location.hostname === 'xinlian.ichunt.com' ? 'https://cloud.ichunt.com/template/芯链SKU上传模板.csv' : 'http://cloud.liexindev.net/template/芯链SKU上传模板.csv',
cp_time_day: localStorage.getItem('cp_time_day') || '', cp_time_day: localStorage.getItem('cp_time_day') || '',
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '', futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',
uploading: false, uploading: false,
progress: 0, progress: 0,
brand: [], brand: [],
sku_user_name: '', sku_user_name: '',
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
downHref: "", downHref: "",
dialogVisible: false, dialogVisible: false,
uploadUrl: NODE_ENVS + '/api/uploadSku/import', uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: { fileData: {
token: Tool.getCookie('token'), token: Tool.getCookie('token'),
type: "1"//1覆盖 2新增 type: "1"//1覆盖 2新增
}, },
formParam: { formParam: {
status: '', status: '',
date: '' date: ''
}, },
tableData: "", tableData: "",
multipleSelection: [] multipleSelection: []
}; };
},
watch: {
'formParam.date'(val) {
if (!val) {
this.formParam.date = []
}
}
},
created() {
this.getData();
},
methods: {
handleBeforeUpload() {
this.uploading = true
},
handleProgress(event, file, fileList) {
this.progress = event.percent
}, },
importChange() { watch: {
this.dialogVisible = true; 'formParam.date'(val) {
this.progress = 0; if (!val) {
this.uploading = false; this.formParam.date = []
this.getSupplierBrand();
},
/**
* 获取品牌数据
*/
getSupplierBrand() {
this.$http('get', "/api/system/getSupplierBrand", {}).then(res => {
if (res.code === 0) {
if (res.data.brand.length > 0) {
this.brand = res.data.brand.join(',');
this.sku_user_name = res.data.sku_user_name;
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 获取数据
*/
getData() {
this.$http('get', "/api/uploadSku/list", {
page: this.page,
limit: this.limit,
status: this.formParam.status,
action_time: this.formParam.date[0],
end_time: this.formParam.date[1]
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}) }
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
}, },
/** created() {
* 搜索提交
*/
submit() {
this.page = 1;
this.getData(); this.getData();
}, },
/** methods: {
* 文件导入 handleBeforeUpload() {
* @param file this.uploading = true
* @param fileList },
* @returns {boolean} handleProgress(event, file, fileList) {
*/ this.progress = event.percent
handleChange(file, fileList) { },
var that = this; importChange() {
if (file.code === 0) { this.dialogVisible = true;
that.dialogVisible = false;
that.page = 1;
that.getData();
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.progress = 0; this.progress = 0;
this.uploading = false; this.uploading = false;
this.$message({ this.getSupplierBrand();
message: file.msg, },
type: 'warning' /**
}); * 获取品牌数据
} */
}, getSupplierBrand() {
/** this.$http('get', "/api/system/getSupplierBrand", {}).then(res => {
* 删除
*/
del() {
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
var arr = [];
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('get', "/api/uploadSku/del", {
log_ids: arr.join(",")
}).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.brand.length > 0) {
this.brand = res.data.brand.join(',');
this.sku_user_name = res.data.sku_user_name;
}
} else {
this.$message({ this.$message({
message: '删除成功', message: res.msg,
type: 'success' type: 'warning'
}); });
this.getData() }
})
},
/**
* 获取数据
*/
getData() {
this.$http('get', "/api/uploadSku/list", {
page: this.page,
limit: this.limit,
status: this.formParam.status,
action_time: this.formParam.date[0],
end_time: this.formParam.date[1]
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
...@@ -275,52 +201,126 @@ export default { ...@@ -275,52 +201,126 @@ export default {
}); });
} }
}) })
}).catch(() => { },
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 搜索提交
*/
submit() {
this.page = 1;
this.getData();
},
/**
* 文件导入
* @param file
* @param fileList
* @returns {boolean}
*/
handleChange(file, fileList) {
var that = this;
if (file.code === 0) {
that.dialogVisible = false;
that.page = 1;
that.getData();
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}) }
}, });
handleSizeChange(val) { } else {
this.limit = val; this.progress = 0;
this.getData(); this.uploading = false;
}, this.$message({
handleCurrentChange(val) { message: file.msg,
this.page = val; type: 'warning'
this.getData(); });
}
},
/**
* 删除
*/
del() {
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
var arr = [];
for (var i = 0; i < this.multipleSelection.length; i++) {
arr.push(this.multipleSelection[i]['id'])
}
MessageBox.confirm('确认到删除当前勾选数据吗?', {
type: 'error'
}).then(() => {
this.$http('get', "/api/uploadSku/del", {
log_ids: arr.join(",")
}).then(res => {
if (res.code === 0) {
this.$message({
message: '删除成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}).catch(() => {
})
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val || [];
}
}, },
handleSelectionChange(val) { components: {
this.multipleSelection = val || []; Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/store/enter.min.css"; @import "../../assets/css/store/enter.min.css";
.downTemplate { .downTemplate {
width: 68px; width: 68px;
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 28px; line-height: 28px;
color: #FFF; color: #FFF;
background-color: #409EFF; background-color: #409EFF;
border-color: #409EFF; border-color: #409EFF;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
display: block; display: block;
} }
.dialog-text .tt { .dialog-text .tt {
color: #333; color: #333;
font-weight: bold; font-weight: bold;
margin-bottom: 16px; margin-bottom: 16px;
} }
.dialog-text .alink { .dialog-text .alink {
font-size: 12px; font-size: 12px;
} }
</style> </style>
\ No newline at end of file
...@@ -39,113 +39,113 @@ ...@@ -39,113 +39,113 @@
</el-table> </el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip); Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
export default { export default {
name: "goodDetail", name: "goodDetail",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
importDetail: {}, importDetail: {},
tableData: [], tableData: [],
multipleSelection: [] multipleSelection: []
}; };
},
watch: {
$route(to, from) {
if (to.path == '/goodDetail') {
this.getData();
}
}
},
created() {
this.getData()
},
methods: {
/**
* 获取列表数据
*/
getData() {
this.$http('GET', "/api/bestgoods/importDetail", {
page: this.page,
limit: this.limit,
import_sn: this.$route.query.import_sn
}).then(res => {
if (res.code === 0) {
this.importDetail = res.data;
this.tableData = res.data.list;
this.total = res.data.count || 0;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}, },
/** watch: {
* 导出文件 $route(to, from) {
*/ if (to.path == '/goodDetail') {
exportChange() { this.getData();
var url = NODE_ENVS + '/api/bestgoods/exportFailedGoods?import_sn=' + this.$route.query.import_sn + '&token=' + Tool.getCookie('token'); }
const newsUrl = this.$router.resolve(url); }
window.open(url);
}, },
handleSizeChange(val) { created() {
this.limit = val; this.getData()
this.getList();
}, },
handleCurrentChange(val) { methods: {
this.page = val; /**
this.getList(); * 获取列表数据
*/
getData() {
this.$http('GET', "/api/bestgoods/importDetail", {
page: this.page,
limit: this.limit,
import_sn: this.$route.query.import_sn
}).then(res => {
if (res.code === 0) {
this.importDetail = res.data;
this.tableData = res.data.list;
this.total = res.data.count || 0;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 导出文件
*/
exportChange() {
var url = NODE_ENVS + '/api/bestgoods/exportFailedGoods?import_sn=' + this.$route.query.import_sn + '&token=' + Tool.getCookie('token');
const newsUrl = this.$router.resolve(url);
window.open(url);
},
handleSizeChange(val) {
this.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.page = val;
this.getList();
},
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/store/listDetail.min.css"; @import "../../assets/css/store/listDetail.min.css";
.btn-nav { .btn-nav {
background: #FFFFFF; background: #FFFFFF;
padding: 0 0 20px 20px; padding: 0 0 20px 20px;
} }
::v-deep .el-descriptions-item__label { ::v-deep .el-descriptions-item__label {
white-space: nowrap; white-space: nowrap;
} }
::v-deep .el-descriptions-item__content { ::v-deep .el-descriptions-item__content {
white-space: nowrap; white-space: nowrap;
} }
.downTemplateExport { .downTemplateExport {
width: 92px; width: 92px;
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 28px; line-height: 28px;
color: #FFF; color: #FFF;
background-color: #409EFF; background-color: #409EFF;
border-color: #409EFF; border-color: #409EFF;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
margin-right: 10px; margin-right: 10px;
display: block; display: block;
cursor: pointer; cursor: pointer;
} }
</style> </style>
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="date_val" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="date_val" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit">搜索</el-button> <el-button type="primary" @click="onSubmit">搜索</el-button>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[2]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[2]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[3]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[3]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[4]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[4]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -200,129 +200,129 @@ ...@@ -200,129 +200,129 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<Menu/> <Menu />
<!--新增优势物料--> <!--新增优势物料-->
<el-dialog title="新增优势物料" :close-on-click-modal="false" :visible.sync="addBestgoods.dialogVisible" width="1000px"> <el-dialog title="新增优势物料" :close-on-click-modal="false" :visible.sync="addBestgoods.dialogVisible" width="1000px">
<div class="dialog-form bestGoodsList-dialog"> <div class="dialog-form bestGoodsList-dialog">
<table> <table>
<tbody> <tbody>
<tr> <tr>
<th align="left" width="150"> <th align="left" width="150">
<em class="required">*</em> <em class="required">*</em>
<span>型号</span> <span>型号</span>
</th> </th>
<th align="left" width="200"> <th align="left" width="200">
<em class="required">*</em> <em class="required">*</em>
<span>品牌</span> <span>品牌</span>
</th> </th>
<th align="left" width="50"> <th align="left" width="50">
<em class="required">*</em> <em class="required">*</em>
<span>起订量</span> <span>起订量</span>
</th> </th>
<th align="left"> <th align="left">
<span>币种</span> <span>币种</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>价格</span> <span>价格</span>
</th> </th>
<th align="left" width="90"> <th align="left" width="90">
<span>批次</span> <span>批次</span>
</th> </th>
<th align="left" width="50"> <th align="left" width="50">
<span>库存</span> <span>库存</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>大陆交期</span> <span>大陆交期</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>香港交期</span> <span>香港交期</span>
</th> </th>
<th align="left" width="50"> <th align="left" width="50">
<span>操作</span> <span>操作</span>
</th> </th>
</tr> </tr>
<tr v-for="(item,index) in addBestgoodsParam"> <tr v-for="(item, index) in addBestgoodsParam">
<td> <td>
<el-autocomplete v-model="addBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete> <el-autocomplete v-model="addBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td> </td>
<td> <td>
<el-autocomplete v-model="addBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete> <el-autocomplete v-model="addBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td> </td>
<td> <td>
<el-input v-model="addBestgoodsParam[index].start_order_number" placeholder="个"></el-input> <el-input v-model="addBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td> </td>
<td> <td>
<el-select v-model="addBestgoodsParam[index].currency" placeholder="请选择"> <el-select v-model="addBestgoodsParam[index].currency" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</td> </td>
<td> <td>
<el-input v-model="addBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input> <el-input v-model="addBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td> </td>
<td> <td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visible[index]"> <el-popover placement="bottom" width="800" trigger="click" v-model="visible[index]">
<div class="row batch-layer"> <div class="row batch-layer">
<div class="batch-box verCenter"> <div class="batch-box verCenter">
<div class="title row bothSide verCenter"> <div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i> <i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span> <span>年份</span>
<i class="el-icon-arrow-right" @click="nextChange"></i> <i class="el-icon-arrow-right" @click="nextChange"></i>
</div>
<div class="content row">
<ul class="row year-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in year" :class="{ curr: yearIndex == indexY }" @click="tabChange(indexY, 1)">{{ v }}年</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(1, year[yearIndex], index)">确定</el-button>
</div>
</div> </div>
<div class="content row"> <div class="batch-box verCenter">
<ul class="row year-list"> <div class="title row rowCenter verCenter">
<li class="row rowCenter verCenter" v-for="(v,indexY) in year" :class="{curr:yearIndex==indexY}" @click="tabChange(indexY,1)">{{ v }}年</li> <span>第一周期</span>
</ul> </div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndex == indexY }" @click="tabChange(indexY, 2)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(2, period[periodIndex], index)">确定</el-button>
</div>
</div> </div>
<div class="footer-btn row verCenter"> <div class="batch-box verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <div class="title row rowCenter verCenter">
<el-button size="mini" round @click="confirm(1,year[yearIndex],index)">确定</el-button> <span>第二周期</span>
</div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndexTwo == indexY }" @click="tabChange(indexY, 3)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(3, period[periodIndexTwo], index)">确定</el-button>
</div>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <el-input slot="reference" :readonly="readonly" v-model="addBestgoodsParam[index].batch" placeholder="批次" @click.native="batchChange(index)"></el-input>
<div class="title row rowCenter verCenter"> </el-popover>
<span>第一周期</span> </td>
</div> <td>
<div class="content row"> <el-input v-model="addBestgoodsParam[index].stock_number" placeholder="个"></el-input>
<ul class="row period-list"> </td>
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndex==indexY}" @click="tabChange(indexY,2)">{{ v }}</li> <td>
</ul> <el-input v-model="addBestgoodsParam[index].delivery_time_cn" placeholder="如2-5工作日" title="如2-5工作日"></el-input>
</div> </td>
<div class="footer-btn row verCenter"> <td>
<el-button size="mini" round @click="clear(1,index)">清空</el-button> <el-input v-model="addBestgoodsParam[index].delivery_time_hk" placeholder="如2-5工作日" title="如2-5工作日"></el-input>
<el-button size="mini" round @click="confirm(2,period[periodIndex],index)">确定</el-button> </td>
</div> <td>
</div> <el-button type="danger" @click="reduceRow(index)">删除</el-button>
<div class="batch-box verCenter"> </td>
<div class="title row rowCenter verCenter"> </tr>
<span>第二周期</span>
</div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndexTwo==indexY}" @click="tabChange(indexY,3)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(1,index)">清空</el-button>
<el-button size="mini" round @click="confirm(3,period[periodIndexTwo],index)">确定</el-button>
</div>
</div>
</div>
<el-input slot="reference" :readonly="readonly" v-model="addBestgoodsParam[index].batch" placeholder="批次" @click.native="batchChange(index)"></el-input>
</el-popover>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].stock_number" placeholder="个"></el-input>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].delivery_time_cn" placeholder="如2-5工作日" title="如2-5工作日"></el-input>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].delivery_time_hk" placeholder="如2-5工作日" title="如2-5工作日"></el-input>
</td>
<td>
<el-button type="danger" @click="reduceRow(index)">删除</el-button>
</td>
</tr>
</tbody> </tbody>
</table> </table>
<i class="el-icon-plus add" @click="addRow">增加行</i> <i class="el-icon-plus add" @click="addRow">增加行</i>
...@@ -337,117 +337,117 @@ ...@@ -337,117 +337,117 @@
<div class="dialog-form bestGoodsList-dialog"> <div class="dialog-form bestGoodsList-dialog">
<table> <table>
<tbody> <tbody>
<tr> <tr>
<th align="left" width="150"> <th align="left" width="150">
<em class="required">*</em> <em class="required">*</em>
<span>型号</span> <span>型号</span>
</th> </th>
<th align="left" width="200"> <th align="left" width="200">
<em class="required">*</em> <em class="required">*</em>
<span>品牌</span> <span>品牌</span>
</th> </th>
<th align="left" width="50"> <th align="left" width="50">
<em class="required">*</em> <em class="required">*</em>
<span>起订量</span> <span>起订量</span>
</th> </th>
<th align="left"> <th align="left">
<span>币种</span> <span>币种</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>价格</span> <span>价格</span>
</th> </th>
<th align="left" width="90"> <th align="left" width="90">
<span>批次</span> <span>批次</span>
</th> </th>
<th align="left" width="50"> <th align="left" width="50">
<span>库存</span> <span>库存</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>大陆交期</span> <span>大陆交期</span>
</th> </th>
<th align="left" width="80"> <th align="left" width="80">
<span>香港交期</span> <span>香港交期</span>
</th> </th>
</tr> </tr>
<tr v-for="(item,index) in updateBestgoodsParam"> <tr v-for="(item, index) in updateBestgoodsParam">
<td> <td>
<el-autocomplete v-model="updateBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete> <el-autocomplete v-model="updateBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td> </td>
<td> <td>
<el-autocomplete v-model="updateBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete> <el-autocomplete v-model="updateBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td> </td>
<td> <td>
<el-input v-model="updateBestgoodsParam[index].start_order_number" placeholder="个"></el-input> <el-input v-model="updateBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td> </td>
<td> <td>
<el-select v-model="updateBestgoodsParam[index].currency" placeholder="请选择"> <el-select v-model="updateBestgoodsParam[index].currency" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</td> </td>
<td> <td>
<el-input v-model="updateBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input> <el-input v-model="updateBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td> </td>
<td> <td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visibleUpdate[index]"> <el-popover placement="bottom" width="800" trigger="click" v-model="visibleUpdate[index]">
<div class="row batch-layer"> <div class="row batch-layer">
<div class="batch-box verCenter"> <div class="batch-box verCenter">
<div class="title row bothSide verCenter"> <div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i> <i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span> <span>年份</span>
<i class="el-icon-arrow-right" @click="nextChange"></i> <i class="el-icon-arrow-right" @click="nextChange"></i>
</div>
<div class="content row">
<ul class="row year-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in year" :class="{ curr: yearIndex == indexY }" @click="tabChange(indexY, 1)">{{ v }}年</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(2, index)">清空</el-button>
<el-button size="mini" round @click="confirmUpdate(1, year[yearIndex], index)">确定</el-button>
</div>
</div> </div>
<div class="content row"> <div class="batch-box verCenter">
<ul class="row year-list"> <div class="title row rowCenter verCenter">
<li class="row rowCenter verCenter" v-for="(v,indexY) in year" :class="{curr:yearIndex==indexY}" @click="tabChange(indexY,1)">{{ v }}年</li> <span>第一周期</span>
</ul> </div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndex == indexY }" @click="tabChange(indexY, 2)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(2, index)">清空</el-button>
<el-button size="mini" round @click="confirmUpdate(2, period[periodIndex], index)">确定</el-button>
</div>
</div> </div>
<div class="footer-btn row verCenter"> <div class="batch-box verCenter">
<el-button size="mini" round @click="clear(2,index)">清空</el-button> <div class="title row rowCenter verCenter">
<el-button size="mini" round @click="confirmUpdate(1,year[yearIndex],index)">确定</el-button> <span>第二周期</span>
</div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v, indexY) in period" :class="{ curr: periodIndexTwo == indexY }" @click="tabChange(indexY, 3)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(2, index)">清空</el-button>
<el-button size="mini" round @click="confirmUpdate(3, period[periodIndexTwo], index)">确定</el-button>
</div>
</div> </div>
</div> </div>
<div class="batch-box verCenter"> <el-input slot="reference" :readonly="readonly" v-model="updateBestgoodsParam[index].batch" placeholder="批次" @click.native="batchChange(index)"></el-input>
<div class="title row rowCenter verCenter"> </el-popover>
<span>第一周期</span> </td>
</div> <td>
<div class="content row"> <el-input v-model="updateBestgoodsParam[index].stock_number" placeholder="个"></el-input>
<ul class="row period-list"> </td>
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndex==indexY}" @click="tabChange(indexY,2)">{{ v }}</li> <td>
</ul> <el-input v-model="updateBestgoodsParam[index].delivery_time_cn" placeholder="如2-5个工作日"></el-input>
</div> </td>
<div class="footer-btn row verCenter"> <td>
<el-button size="mini" round @click="clear(2,index)">清空</el-button> <el-input v-model="updateBestgoodsParam[index].delivery_time_hk" placeholder="如2-5个工作日"></el-input>
<el-button size="mini" round @click="confirmUpdate(2,period[periodIndex],index)">确定</el-button> </td>
</div> </tr>
</div>
<div class="batch-box verCenter">
<div class="title row rowCenter verCenter">
<span>第二周期</span>
</div>
<div class="content row">
<ul class="row period-list">
<li class="row rowCenter verCenter" v-for="(v,indexY) in period" :class="{curr:periodIndexTwo==indexY}" @click="tabChange(indexY,3)">{{ v }}</li>
</ul>
</div>
<div class="footer-btn row verCenter">
<el-button size="mini" round @click="clear(2,index)">清空</el-button>
<el-button size="mini" round @click="confirmUpdate(3,period[periodIndexTwo],index)">确定</el-button>
</div>
</div>
</div>
<el-input slot="reference" :readonly="readonly" v-model="updateBestgoodsParam[index].batch" placeholder="批次" @click.native="batchChange(index)"></el-input>
</el-popover>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].stock_number" placeholder="个"></el-input>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].delivery_time_cn" placeholder="如2-5个工作日"></el-input>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].delivery_time_hk" placeholder="如2-5个工作日"></el-input>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -467,279 +467,330 @@ ...@@ -467,279 +467,330 @@
</section> </section>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
import {NODE_ENVS} from "../../ajax"; import { NODE_ENVS } from "../../ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag) Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag)
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Upload) Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Upload)
export default { export default {
name: "goodslisr", name: "goodslisr",
data() { data() {
return { return {
logs: [], logs: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
uploadUrl: NODE_ENVS + '/api/bestgoods/importTemplate', uploadUrl: NODE_ENVS + '/api/bestgoods/importTemplate',
fileData: { fileData: {
token: Tool.getCookie('token') token: Tool.getCookie('token')
}, },
dialogVisible: false, dialogVisible: false,
visible: [false],//批次弹窗 visible: [false],//批次弹窗
visibleUpdate: [false],//更新批次弹窗 visibleUpdate: [false],//更新批次弹窗
readonly: true, readonly: true,
yearIndex: -1,//年份 yearIndex: -1,//年份
periodIndex: -1,//第一周期 periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期 periodIndexTwo: -1,//第二周期
year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'], year: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'],
period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'], period: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54'],
options: [ options: [
{ {
value: '1', value: '1',
label: '人民币' label: '人民币'
}, { }, {
value: '2', value: '2',
label: '美元' label: '美元'
}, { }, {
value: '3', value: '3',
label: '港币' label: '港币'
}, { }, {
value: '4', value: '4',
label: '欧元' label: '欧元'
}, { }, {
value: '5', value: '5',
label: '英磅' label: '英磅'
},
],
addBestgoods: {
dialogVisible: false, //新增优势物料
dialogVisibleUpdate: false //修改优势物料
},
addBestgoodsParam: [
{
goods_name: "",
brand_name: "",
start_order_number: "",
currency: '1',
price_origin: "",
batch: "",
stock_number: "",
join_inquiry: "",
delivery_time_cn: '',//大陆交期
delivery_time_hk: ''//香港交期
}
],
updateBestgoodsParam: [],
date_val: '',//创建时间
formParam: {
goods_name: '',//型号
brand_name: '',//品牌
join_inquiry: '',//状态
currency: '',//币种
date: ''//创建时间
}, },
], multipleSelection: [],
addBestgoods: { skuStatistics: {},//统计数据
dialogVisible: false, //新增优势物料 skuRankList: {}//sku的型号统计排名列表
dialogVisibleUpdate: false //修改优势物料 };
},
created() {
this.getData();
this.getSkuRankList();
},
methods: {
/**
* 获取sku的型号统计排名列表
*/
getSkuRankList() {
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
if (res.code === 0) {
this.skuRankList = res.data.rankList;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 批量导入
* @param file
* @param fileList
*/
importTemplate(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose() {
that.$router.push({
path: "/goodDetail",
query: { import_sn: file.data.import_sn },
});
}
});
} else {
this.$message({
message: file.msg,
type: 'warning'
});
}
},
/**
* 统计查看
* @param val
*/
showChange(row) {
this.$http('GET', "/api/sku/getSkuStatistics", {
goods_name: row.goods_name,
brand_name: row.brand_name
}).then(res => {
if (res.code == 0) {
this.skuStatistics = res.data.statisticsData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisible = true;
this.logs = res.data.list;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
});
},
handleClick(row) {
this.getLogs(503, row.id);
console.log(row);
}, },
addBestgoodsParam: [ //新增优势物料弹窗
{ addBestgoodsChange() {
this.addBestgoods.dialogVisible = true;
this.addBestgoodsParam = [{
goods_name: "", goods_name: "",
brand_name: "", brand_name: "",
start_order_number: "", start_order_number: "",
currency: '1', currency: "1",
price_origin: "", price_origin: "",
batch: "", batch: "",
stock_number: "", stock_number: "",
join_inquiry: "", join_inquiry: "",
delivery_time_cn: '',//大陆交期 delivery_time_cn: '',//大陆交期
delivery_time_hk: ''//香港交期 delivery_time_hk: ''//香港交期
} }]
],
updateBestgoodsParam: [],
date_val: '',//创建时间
formParam: {
goods_name: '',//型号
brand_name: '',//品牌
join_inquiry: '',//状态
currency: '',//币种
date: ''//创建时间
}, },
multipleSelection: [], //修改优势物料弹窗
skuStatistics: {},//统计数据 updateBestgoods() {
skuRankList: {}//sku的型号统计排名列表 if (this.multipleSelection.length != 1) {
};
},
created() {
this.getData();
this.getSkuRankList();
},
methods: {
/**
* 获取sku的型号统计排名列表
*/
getSkuRankList() {
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
if (res.code === 0) {
this.skuRankList = res.data.rankList;
} else {
this.$message({ this.$message({
message: res.msg, message: '请支持修改一条数据',
type: 'warning' type: 'warning'
}); });
return false;
} }
}) this.addBestgoods.dialogVisibleUpdate = true;
}, this.updateBestgoodsParam = [];
/** this.updateBestgoodsParam.push({
* 批量导入 best_goods_id: this.multipleSelection[0].id,
* @param file goods_name: this.multipleSelection[0].goods_name,
* @param fileList brand_name: this.multipleSelection[0].brand_name,
*/ start_order_number: this.multipleSelection[0].start_order_number,
importTemplate(file, fileList) { currency: this.multipleSelection[0].currency.toString(),
var that = this; price_origin: this.multipleSelection[0].price_origin,
if (file.code === 0) { batch: this.multipleSelection[0].batch,
this.$message({ stock_number: this.multipleSelection[0].stock_number,
message: '导入成功', join_inquiry: this.multipleSelection[0].join_inquiry,
type: 'success', delivery_time_cn: this.multipleSelection[0].delivery_time_cn,//大陆交期
onClose() { delivery_time_hk: this.multipleSelection[0].delivery_time_hk//香港交期
that.$router.push({
path: "/goodDetail",
query: {import_sn: file.data.import_sn},
});
}
});
} else {
this.$message({
message: file.msg,
type: 'warning'
}); });
} },
}, //增加行
/** addRow() {
* 统计查看 this.addBestgoodsParam.push({
* @param val goods_name: "",
*/ brand_name: "",
showChange(row) { start_order_number: "",
this.$http('GET', "/api/sku/getSkuStatistics", { currency: "1",
goods_name: row.goods_name, price_origin: "",
brand_name: row.brand_name batch: "",
}).then(res => { stock_number: "",
if (res.code == 0) { join_inquiry: ""
this.skuStatistics = res.data.statisticsData; })
} else { this.visible.push(false);
this.$message({ },
message: res.msg, //删除行
type: 'warning' reduceRow(index) {
}); this.addBestgoodsParam.splice(index, 1)
this.visible.splice(index, 1)
},
//前进年份
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
} }
}) this.year = arr.sort();
}, },
getLogs(obj_type, obj_id) { //后退年份
this.$http('GET', "/api/log/getLogs", { nextChange() {
obj_type: obj_type, this.yearIndex = -1;
obj_id: obj_id let starYear = this.year[this.year.length - 1] * 1;
}).then(res => { let arr = [];
if (res.code === 0) { for (let i = 0; i < 15; i++) {
this.dialogVisible = true; arr.push(starYear + (i + 1))
this.logs = res.data.list; }
this.year = arr;
},
//批次选择
batchChange() {
},
//新增优势物料提交
addBestgoodsSubmit() {
var self = this;
if (this.addBestgoodsParam.length > 0) {
for (let i = 0; i < this.addBestgoodsParam.length; i++) {
if (!this.addBestgoodsParam[i].goods_name) {
this.$message({
message: '请输入第' + (i + 1) + '行型号',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].brand_name) {
this.$message({
message: '请输入第' + (i + 1) + '行品牌',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].start_order_number) {
this.$message({
message: '请输入第' + (i + 1) + '行起订量',
type: 'warning'
});
return false;
}
}
this.$http('post', "/api/bestgoods/addBestgoods", { add_json: JSON.stringify(this.addBestgoodsParam) }).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.addBestgoods.dialogVisible = false;
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
} else { } else {
this.$message({ this.$message({
message: res.msg, message: '请添加数据',
type: 'warning' type: 'warning'
}); });
} }
}); },
}, //修改优势物料提交
handleClick(row) { updateBestgoodsSubmit() {
this.getLogs(503, row.id); var self = this;
console.log(row); for (let i = 0; i < this.updateBestgoodsParam.length; i++) {
}, if (!this.updateBestgoodsParam[i].goods_name) {
//新增优势物料弹窗
addBestgoodsChange() {
this.addBestgoods.dialogVisible = true;
this.addBestgoodsParam = [{
goods_name: "",
brand_name: "",
start_order_number: "",
currency: "1",
price_origin: "",
batch: "",
stock_number: "",
join_inquiry: "",
delivery_time_cn: '',//大陆交期
delivery_time_hk: ''//香港交期
}]
},
//修改优势物料弹窗
updateBestgoods() {
if (this.multipleSelection.length != 1) {
this.$message({
message: '请支持修改一条数据',
type: 'warning'
});
return false;
}
this.addBestgoods.dialogVisibleUpdate = true;
this.updateBestgoodsParam = [];
this.updateBestgoodsParam.push({
best_goods_id: this.multipleSelection[0].id,
goods_name: this.multipleSelection[0].goods_name,
brand_name: this.multipleSelection[0].brand_name,
start_order_number: this.multipleSelection[0].start_order_number,
currency: this.multipleSelection[0].currency.toString(),
price_origin: this.multipleSelection[0].price_origin,
batch: this.multipleSelection[0].batch,
stock_number: this.multipleSelection[0].stock_number,
join_inquiry: this.multipleSelection[0].join_inquiry,
delivery_time_cn: this.multipleSelection[0].delivery_time_cn,//大陆交期
delivery_time_hk: this.multipleSelection[0].delivery_time_hk//香港交期
});
},
//增加行
addRow() {
this.addBestgoodsParam.push({
goods_name: "",
brand_name: "",
start_order_number: "",
currency: "1",
price_origin: "",
batch: "",
stock_number: "",
join_inquiry: ""
})
this.visible.push(false);
},
//删除行
reduceRow(index) {
this.addBestgoodsParam.splice(index, 1)
this.visible.splice(index, 1)
},
//前进年份
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
this.year = arr.sort();
},
//后退年份
nextChange() {
this.yearIndex = -1;
let starYear = this.year[this.year.length - 1] * 1;
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear + (i + 1))
}
this.year = arr;
},
//批次选择
batchChange() {
},
//新增优势物料提交
addBestgoodsSubmit() {
var self = this;
if (this.addBestgoodsParam.length > 0) {
for (let i = 0; i < this.addBestgoodsParam.length; i++) {
if (!this.addBestgoodsParam[i].goods_name) {
this.$message({ this.$message({
message: '请输入第' + (i + 1) + '行型号', message: '请输入第' + (i + 1) + '行型号',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (!this.updateBestgoodsParam[i].brand_name) {
if (!this.addBestgoodsParam[i].brand_name) {
this.$message({ this.$message({
message: '请输入第' + (i + 1) + '行品牌', message: '请输入第' + (i + 1) + '行品牌',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (!this.addBestgoodsParam[i].start_order_number) { if (!this.updateBestgoodsParam[i].start_order_number) {
this.$message({ this.$message({
message: '请输入第' + (i + 1) + '行起订量', message: '请输入第' + (i + 1) + '行起订量',
type: 'warning' type: 'warning'
...@@ -747,14 +798,15 @@ export default { ...@@ -747,14 +798,15 @@ export default {
return false; return false;
} }
} }
this.$http('post', "/api/bestgoods/addBestgoods", {add_json: JSON.stringify(this.addBestgoodsParam)}).then(res => {
this.$http('post', "/api/bestgoods/updateBestgoods", { update_json: JSON.stringify(this.updateBestgoodsParam) }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success', type: 'success',
duration: 2000, duration: 2000,
onClose() { onClose() {
self.addBestgoods.dialogVisible = false; self.addBestgoods.dialogVisibleUpdate = false;
self.getData(); self.getData();
} }
}); });
...@@ -765,80 +817,66 @@ export default { ...@@ -765,80 +817,66 @@ export default {
}); });
} }
}) })
} else { },
this.$message({ //删除
message: '请添加数据', delBestgoods() {
type: 'warning' var self = this;
}); if (this.multipleSelection.length <= 0) {
}
},
//修改优势物料提交
updateBestgoodsSubmit() {
var self = this;
for (let i = 0; i < this.updateBestgoodsParam.length; i++) {
if (!this.updateBestgoodsParam[i].goods_name) {
this.$message({
message: '请输入第' + (i + 1) + '行型号',
type: 'warning'
});
return false;
}
if (!this.updateBestgoodsParam[i].brand_name) {
this.$message({
message: '请输入第' + (i + 1) + '行品牌',
type: 'warning'
});
return false;
}
if (!this.updateBestgoodsParam[i].start_order_number) {
this.$message({ this.$message({
message: '请输入第' + (i + 1) + '行起订量', message: '请勾选数据',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
}
this.$http('post', "/api/bestgoods/updateBestgoods", {update_json: JSON.stringify(this.updateBestgoodsParam)}).then(res => { var best_goods_ids = this.multipleSelection.map(obj => {
if (res.code === 0) { return obj.id;
this.$message({ })
message: res.msg,
type: 'success', this.$confirm('确认删除当前优势物料吗?', '提示', {
duration: 2000, confirmButtonText: '确定',
onClose() { cancelButtonText: '取消',
self.addBestgoods.dialogVisibleUpdate = false; type: 'warning'
self.getData(); }).then(() => {
this.$http('POST', "/api/bestgoods/delBestgoods", { best_goods_ids: best_goods_ids.join(',') }).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}); })
} else { }).catch(() => {
});
},
//是否参与询价
isJoinInquiryChange(type) {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({ this.$message({
message: res.msg, message: '请勾选数据',
type: 'warning' type: 'warning'
}); });
return false;
} }
})
},
//删除
delBestgoods() {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({
message: '请勾选数据',
type: 'warning'
});
return false;
}
var best_goods_ids = this.multipleSelection.map(obj => { var best_goods_ids = this.multipleSelection.map(obj => {
return obj.id; return obj.id;
}) })
this.$confirm('确认删除当前优势物料吗?', '提示', {
confirmButtonText: '确定', this.$http('post', "/api/bestgoods/isJoinInquiry", { join_inquiry: type, best_goods_ids: best_goods_ids.join(',') }).then(res => {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http('POST', "/api/bestgoods/delBestgoods", {best_goods_ids: best_goods_ids.join(',')}).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: res.msg, message: res.msg,
...@@ -855,295 +893,257 @@ export default { ...@@ -855,295 +893,257 @@ export default {
}); });
} }
}) })
}).catch(() => { },
//批次关闭
}); clear(type, index) {
if (type == 1) {
}, this.$set(this.visible, index, false);
//是否参与询价 this.$set(this.addBestgoodsParam[index], 'batch', '');
isJoinInquiryChange(type) { } else if (type == 2) {
var self = this; this.$set(this.visibleUpdate, index, false);
if (this.multipleSelection.length <= 0) { this.$set(this.updateBestgoodsParam[index], 'batch', '');
this.$message({
message: '请勾选数据',
type: 'warning'
});
return false;
}
var best_goods_ids = this.multipleSelection.map(obj => {
return obj.id;
})
this.$http('post', "/api/bestgoods/isJoinInquiry", {join_inquiry: type, best_goods_ids: best_goods_ids.join(',')}).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
//批次关闭
clear(type, index) {
if (type == 1) {
this.$set(this.visible, index, false);
this.$set(this.addBestgoodsParam[index], 'batch', '');
} else if (type == 2) {
this.$set(this.visibleUpdate, index, false);
this.$set(this.updateBestgoodsParam[index], 'batch', '');
}
},
//批次确定
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
message: '请选择年份',
type: 'warning'
});
return false;
}
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.$set(this.addBestgoodsParam[index], 'batch', val + '+');
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.$set(this.addBestgoodsParam[index], 'batch', year + val);
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
} }
var one = parseInt(this.period[this.periodIndex]); },
var two = parseInt(val); //批次确定
if (two <= one) { confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({ this.$message({
message: '不可小于第一周期', message: '请选择年份',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.$set(this.addBestgoodsParam[index], 'batch', val + '+');
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.$set(this.addBestgoodsParam[index], 'batch', year + val);
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString(); let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2); year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString(); let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2); period = period.substring(period.length - 2);
val = val.toString(); val = val.toString();
val = val.substring(val.length - 2); val = val.substring(val.length - 2);
let prev = year + period; let prev = year + period;
let next = year + val; let next = year + val;
this.$set(this.addBestgoodsParam[index], 'batch', prev + '-' + next); this.$set(this.addBestgoodsParam[index], 'batch', prev + '-' + next);
}
this.$set(this.visible, index, false);
},
//批次更新
confirmUpdate(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
message: '请选择年份',
type: 'warning'
});
return false;
}
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.$set(this.updateBestgoodsParam[index], 'batch', val + '+');
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
} }
let year = this.year[this.yearIndex].toString(); this.$set(this.visible, index, false);
year = year.substring(year.length - 2); },
this.$set(this.updateBestgoodsParam[index], 'batch', year + val); //批次更新
} else if (type == 3) { confirmUpdate(type, val, index) {
if (this.periodIndex == -1) { if (this.yearIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({ this.$message({
message: '不可小于第一周期', message: '请选择年份',
type: 'warning' type: 'warning'
}); });
return false; return false;
} }
if (type == 1) {
val = val.toString();
val = val.substring(val.length - 2);
this.$set(this.updateBestgoodsParam[index], 'batch', val + '+');
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
this.$set(this.updateBestgoodsParam[index], 'batch', year + val);
} else if (type == 3) {
if (this.periodIndex == -1) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString(); let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2); year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString(); let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2); period = period.substring(period.length - 2);
val = val.toString(); val = val.toString();
val = val.substring(val.length - 2); val = val.substring(val.length - 2);
let prev = year + period; let prev = year + period;
let next = year + val; let next = year + val;
this.$set(this.updateBestgoodsParam[index], 'batch', prev + '-' + next); this.$set(this.updateBestgoodsParam[index], 'batch', prev + '-' + next);
} }
this.$set(this.visibleUpdate, index, false); this.$set(this.visibleUpdate, index, false);
}, },
tabChange(index, type) { tabChange(index, type) {
if (type == 1) { if (type == 1) {
this.yearIndex = index; this.yearIndex = index;
} else if (type == 2) { } else if (type == 2) {
this.periodIndex = index; this.periodIndex = index;
} else if (type == 3) { } else if (type == 3) {
this.periodIndexTwo = index; this.periodIndexTwo = index;
} }
}, },
/** /**
* 获取数据 * 获取数据
*/ */
getData() { getData() {
//格式化时间 //格式化时间
if (this.date_val) { if (this.date_val) {
this.formParam.date = this.date_val[0] + '~' + this.date_val[1]; this.formParam.date = this.date_val[0] + '~' + this.date_val[1];
} else {
this.formParam.date = '';
}
var params = Object.assign({}, {page: this.page, limit: this.limit}, this.formParam);
this.$http('GET', "/api/bestgoods/getBestGoodsList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.count) || 0;
} else { } else {
this.$message(res.msg); this.formParam.date = '';
} }
}) var params = Object.assign({}, { page: this.page, limit: this.limit }, this.formParam);
}, this.$http('GET', "/api/bestgoods/getBestGoodsList", params).then(res => {
//型号 if (res.code === 0) {
querySearchAsync(queryString, cb) { this.list = res.data.list || [];
this.$http('get', "/api/search/getspu", { this.total = Number(res.data.count) || 0;
spu_name: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else { } else {
cb([]); this.$message(res.msg);
} }
} })
}) },
}, //型号
//品牌 querySearchAsync(queryString, cb) {
querySearchAsyncBrand(queryString, cb) { this.$http('get', "/api/search/getspu", {
this.$http('get', "/api/brand/get_stand_brand", { spu_name: queryString
brand: queryString }).then(res => {
}).then(res => { if (res.code == 0) {
if (res.code == 0) { if (res.data.list.length > 0) {
if (res.data.list.length > 0) { var arrlist_ = res.data.list || [];
var arrlist_ = res.data.list || []; var arr_ = []
var arr_ = [] for (var i = 0; i < arrlist_.length; i++) {
for (var i = 0; i < arrlist_.length; i++) { arr_.push({
arr_.push({ value: arrlist_[i]['spu_name']
value: arrlist_[i] })
}) }
cb(arr_);
} else {
cb([]);
} }
cb(arr_);
} else {
cb([]);
} }
} })
}) },
}, //品牌
handleSelectionChange(val) { querySearchAsyncBrand(queryString, cb) {
this.multipleSelection = val; this.$http('get', "/api/brand/get_stand_brand", {
}, brand: queryString
resetForm(formName) { }).then(res => {
this.formParam.date = ''; if (res.code == 0) {
this.date_val = ''; if (res.data.list.length > 0) {
this.$refs[formName].resetFields(); var arrlist_ = res.data.list || [];
}, var arr_ = []
onSubmit() { for (var i = 0; i < arrlist_.length; i++) {
this.page = 1; arr_.push({
this.getData(); value: arrlist_[i]
}, })
handleSizeChange(val) { }
this.limit = val; cb(arr_);
this.getData(); } else {
cb([]);
}
}
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
resetForm(formName) {
this.formParam.date = '';
this.date_val = '';
this.$refs[formName].resetFields();
},
onSubmit() {
this.page = 1;
this.getData();
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
}
}, },
handleCurrentChange(val) { components: {
this.page = val; Menu
this.getData();
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
.downTemplate { .downTemplate {
width: 68px; width: 68px;
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 28px; line-height: 28px;
color: #FFF; color: #FFF;
background-color: #409EFF; background-color: #409EFF;
border-color: #409EFF; border-color: #409EFF;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
display: block; display: block;
} }
@import "../../assets/css/store/goodslist.min.css"; @import "../../assets/css/store/goodslist.min.css";
</style> </style>
\ No newline at end of file
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[2]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[2]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[3]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[3]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<span style="width: 20%;" class="row verCenter">次数</span> <span style="width: 20%;" class="row verCenter">次数</span>
</div> </div>
<div class="list"> <div class="list">
<div class="box row verCenter" v-for="(v,index) in skuRankList[4]"> <div class="box row verCenter" v-for="(v, index) in skuRankList[4]">
<span style="width: 40%;">{{ v.goods_name }}</span> <span style="width: 40%;">{{ v.goods_name }}</span>
<span style="width: 40%;">{{ v.brand_name }}</span> <span style="width: 40%;">{{ v.brand_name }}</span>
<template v-if="index == 0"> <template v-if="index == 0">
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<el-table-column prop="mpq" label="标准包装量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="mpq" label="标准包装量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="stock" label="库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="stock" label="库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="cn_ladder_price" label="含税成本价(¥)" width="120" align="center" :show-overflow-tooltip="true"> <el-table-column prop="cn_ladder_price" label="含税成本价(¥)" width="120" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length > 0">
<el-popover effect="light" trigger="hover" placement="bottom"> <el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.cn_ladder_price"> <p class="row" v-for="item in scope.row.cn_ladder_price">
<span>{{ item.purchases }}+</span> <span>{{ item.purchases }}+</span>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="hk_ladder_price" label="美金成本价($)" width="120" align="center" :show-overflow-tooltip="true"> <el-table-column prop="hk_ladder_price" label="美金成本价($)" width="120" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length>0"> <template slot-scope="scope" v-if="scope.row.cn_ladder_price && scope.row.cn_ladder_price.length > 0">
<el-popover effect="light" trigger="hover" placement="bottom"> <el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.hk_ladder_price"> <p class="row" v-for="item in scope.row.hk_ladder_price">
<span>{{ item.purchases }}+</span> <span>{{ item.purchases }}+</span>
...@@ -235,8 +235,8 @@ ...@@ -235,8 +235,8 @@
<el-table-column prop="source_val" label="来源" width="150" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="source_val" label="来源" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_status" label="状态" width="100" align="center" :show-overflow-tooltip="true"> <el-table-column prop="goods_status" label="状态" width="100" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span> <span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span> <span v-else-if="scope.row.goods_status == 3">下架</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cp_time" label="上架有效期" width="150" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="cp_time" label="上架有效期" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
...@@ -309,8 +309,8 @@ ...@@ -309,8 +309,8 @@
<el-table-column prop="brand_name" label="品牌" min-width="20%" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="brand_name" label="品牌" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_status" label="状态" width="80" :show-overflow-tooltip="true"> <el-table-column prop="goods_status" label="状态" width="80" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span> <span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span> <span v-else-if="scope.row.goods_status == 3">下架</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cp_time_temp" label="上架有效期" width="160" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="cp_time_temp" label="上架有效期" width="160" :show-overflow-tooltip="true"></el-table-column>
...@@ -377,7 +377,7 @@ ...@@ -377,7 +377,7 @@
<el-table-column prop="create_time" label="时间" min-width="150" align="center"></el-table-column> <el-table-column prop="create_time" label="时间" min-width="150" align="center"></el-table-column>
<el-table-column prop="message" label="操作说明" min-width="150" align="center"> <el-table-column prop="message" label="操作说明" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>修改了价格,点击查看 <a style="color: #409EFF" href="javascript:;" @click="handleDetailClick(scope.row.message.pre_data,scope.row.message.current_data)">修改详情</a></span> <span>修改了价格,点击查看 <a style="color: #409EFF" href="javascript:;" @click="handleDetailClick(scope.row.message.pre_data, scope.row.message.current_data)">修改详情</a></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="operator" label="操作人" min-width="150" align="center"></el-table-column> <el-table-column prop="operator" label="操作人" min-width="150" align="center"></el-table-column>
...@@ -409,471 +409,369 @@ ...@@ -409,471 +409,369 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import Util from "../../tool"; import Util from "../../tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Tag).use(Link) Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Tag).use(Link)
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover) Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover)
export default { export default {
name: "list", name: "list",
data() { data() {
return { return {
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
dialogVisible: false,//库存弹窗 dialogVisible: false,//库存弹窗
dialogVisible2: false,//交期弹窗 dialogVisible2: false,//交期弹窗
dialogVisible3: false,//上架有效期 dialogVisible3: false,//上架有效期
dialogVisible4: false,//修改价格 dialogVisible4: false,//修改价格
dialogVisibleLog: false,//日志 dialogVisibleLog: false,//日志
dialogVisibleLogDetail: false,//日志详情 dialogVisibleLogDetail: false,//日志详情
logs: [], logs: [],
downHref: "", downHref: "",
cp_time_val: '', cp_time_val: '',
formParam: { formParam: {
goods_name: '', goods_name: '',
status: '', status: '',
brand_name: '', brand_name: '',
date: '', date: '',
cp_time: '', cp_time: '',
source: '' source: ''
}, },
multipleSelection: [], multipleSelection: [],
selectData: [], selectData: [],
huoqidata: [],//修改交期数据 huoqidata: [],//修改交期数据
kucundata: [],//修改库存数据 kucundata: [],//修改库存数据
cpdata: [],//上架有效期数据 cpdata: [],//上架有效期数据
priceData: [],//修改价格数据 priceData: [],//修改价格数据
message: {}, message: {},
skuOriginalStepPriceData: [], skuOriginalStepPriceData: [],
goods_id: '', goods_id: '',
stock: 0, stock: 0,
tableData: [], tableData: [],
brandList: [], brandList: [],
disabled: false, disabled: false,
timer: null, timer: null,
skuStatistics: {},//统计数据 skuStatistics: {},//统计数据
skuRankList: {},//sku的型号统计排名列表 skuRankList: {},//sku的型号统计排名列表
pickerOptions: { pickerOptions: {
disabledDate: this.disabledDate disabledDate: this.disabledDate
}
};
},
created() {
let status = this.$route.query.status;
if (status) {
this.formParam.status = status;
}
this.getData();
this.getSkuRankList();
},
methods: {
closeBothDialogs() {
this.dialogVisibleLog = false;
this.dialogVisibleLogDetail = false;
},
/**
* 查看日志
* @param row
*/
handleClick(row) {
this.getLogs(507, row.goods_id);
},
/**
* 查看日志详情
* @param row
*/
handleDetailClick(pre_data, current_data) {
var data = Object.assign({}, {
pre_data: pre_data,
current_data: current_data
});
this.dialogVisibleLogDetail = true;
this.message = data;
},
/**
* 获取日志
* @param obj_type
* @param obj_id
*/
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisibleLog = true;
this.logs = res.data.list;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
} }
}); };
}, },
/** created() {
* 修改价格删除 let status = this.$route.query.status;
* @param index if (status) {
* @param row this.formParam.status = status;
*/
handleDelete(index, row) {
this.skuOriginalStepPriceData.splice(index, 1);
},
/**
* 监听起订量
*/
handleInput(index) {
var val = Number(this.skuOriginalStepPriceData[index].purchases) || 0;
var max = Number(this.stock) || 0;
if (val > max) {
this.$set(this.skuOriginalStepPriceData[index], 'purchases', max);
} }
this.getData();
this.getSkuRankList();
}, },
/** methods: {
* 获取数据 closeBothDialogs() {
*/ this.dialogVisibleLog = false;
getData() { this.dialogVisibleLogDetail = false;
//格式化时间 },
if (this.cp_time_val) { /**
this.formParam.cp_time = this.cp_time_val[0] + '~' + this.cp_time_val[1]; * 查看日志
} else { * @param row
this.formParam.cp_time = ''; */
} handleClick(row) {
var params = Object.assign({}, this.getLogs(507, row.goods_id);
{page: this.page}, },
{limit: this.limit}, /**
this.formParam, * 查看日志详情
{action_time: this.formParam.date ? this.formParam.date[0] : ''}, * @param row
{end_time: this.formParam.date ? this.formParam.date[1] : ''}) */
handleDetailClick(pre_data, current_data) {
this.$http('get', "/api/sku/list", params).then(res => { var data = Object.assign({}, {
if (res.code === 0) { pre_data: pre_data,
this.tableData = res.data.list || []; current_data: current_data
this.total = Number(res.data.count) || 0; });
} else { this.dialogVisibleLogDetail = true;
this.$message({ this.message = data;
message: res.msg, },
type: 'warning' /**
}); * 获取日志
* @param obj_type
* @param obj_id
*/
getLogs(obj_type, obj_id) {
this.$http('GET', "/api/log/getLogs", {
obj_type: obj_type,
obj_id: obj_id
}).then(res => {
if (res.code === 0) {
this.dialogVisibleLog = true;
this.logs = res.data.list;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
});
},
/**
* 修改价格删除
* @param index
* @param row
*/
handleDelete(index, row) {
this.skuOriginalStepPriceData.splice(index, 1);
},
/**
* 监听起订量
*/
handleInput(index) {
var val = Number(this.skuOriginalStepPriceData[index].purchases) || 0;
var max = Number(this.stock) || 0;
if (val > max) {
this.$set(this.skuOriginalStepPriceData[index], 'purchases', max);
} }
}) },
}, /**
/** * 获取数据
* 获取sku的型号统计排名列表 */
*/ getData() {
getSkuRankList() { //格式化时间
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => { if (this.cp_time_val) {
if (res.code === 0) { this.formParam.cp_time = this.cp_time_val[0] + '~' + this.cp_time_val[1];
this.skuRankList = res.data.rankList;
} else { } else {
this.$message({ this.formParam.cp_time = '';
message: res.msg,
type: 'warning'
});
} }
}) var params = Object.assign({},
}, { page: this.page },
/** { limit: this.limit },
* 型号 this.formParam,
* @param queryString { action_time: this.formParam.date ? this.formParam.date[0] : '' },
* @param cb { end_time: this.formParam.date ? this.formParam.date[1] : '' })
*/
querySearchAsync(queryString, cb) { this.$http('get', "/api/sku/list", params).then(res => {
this.$http('get', "/api/search/getspu", { if (res.code === 0) {
spu_name: queryString this.tableData = res.data.list || [];
}).then(res => { this.total = Number(res.data.count) || 0;
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
} else { } else {
cb([]); this.$message({
message: res.msg,
type: 'warning'
});
} }
} })
}) },
}, /**
/** * 获取sku的型号统计排名列表
* 品牌 */
* @param queryString getSkuRankList() {
* @param cb this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
*/ if (res.code === 0) {
querySearchAsyncBrand(queryString, cb) { this.skuRankList = res.data.rankList;
this.$http('get', "/api/brand/get_stand_brand", {
brand: queryString
}).then(res => {
if (res.code == 0) {
if (res.data.list.length > 0) {
var arrlist_ = res.data.list || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]
})
}
cb(arr_);
} else { } else {
cb([]); this.$message({
message: res.msg,
type: 'warning'
});
} }
} })
}) },
}, /**
downOut() { * 型号
if (this.disabled) { * @param queryString
this.$message({ * @param cb
message: '正在导出中,请不要重复点击', */
type: 'warning' querySearchAsync(queryString, cb) {
}); this.$http('get', "/api/search/getspu", {
return spu_name: queryString
} }).then(res => {
this.$http('get', "/api/sku/exportSku", { if (res.code == 0) {
page: this.page, if (res.data.list.length > 0) {
limit: this.limit, var arrlist_ = res.data.list || [];
goods_name: this.formParam.goods_name, var arr_ = []
status: this.formParam.status, for (var i = 0; i < arrlist_.length; i++) {
brand_id: this.formParam.brand_id, arr_.push({
brand_name: this.formParam.brand_name, value: arrlist_[i]['spu_name']
action_time: this.formParam.date[0], })
end_time: this.formParam.date[1] }
}).then(res => { cb(arr_);
if (res.code == 0) { } else {
this.disabled = true cb([]);
this.$message({
message: '正在导出中,请耐心等待',
type: 'success'
});
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return
} }
this.resultDown(res.data) }
}, 3000) })
} },
}) /**
}, * 品牌
resultDown(id_) { * @param queryString
this.$http('get', "/api/export/get_export_data", { * @param cb
id: id_ */
}).then(res => { querySearchAsyncBrand(queryString, cb) {
if (res.code == 0) { this.$http('get', "/api/brand/get_stand_brand", {
this.disabled = false; brand: queryString
this.$message({ }).then(res => {
message: '导出成功', if (res.code == 0) {
type: 'success' if (res.data.list.length > 0) {
}); var arrlist_ = res.data.list || [];
this.downHref = res.data; var arr_ = []
const newsUrl = this.$router.resolve(res.data); for (var i = 0; i < arrlist_.length; i++) {
window.open(res.data); arr_.push({
} else if (res.code == -1) { value: arrlist_[i]
//导出失败 })
}
cb(arr_);
} else {
cb([]);
}
}
})
},
downOut() {
if (this.disabled) {
this.$message({ this.$message({
message: '导出失败', message: '正在导出中,请不要重复点击',
type: 'warning' type: 'warning'
}); });
this.disabled = false; return
} }
}, error => { this.$http('get', "/api/sku/exportSku", {
this.$message('网络出现问题,请检查网络'); page: this.page,
this.disabled = false limit: this.limit,
}) goods_name: this.formParam.goods_name,
status: this.formParam.status,
}, brand_id: this.formParam.brand_id,
resetForm(formName) { brand_name: this.formParam.brand_name,
this.formParam.date = ''; action_time: this.formParam.date[0],
this.cp_time_val = ''; end_time: this.formParam.date[1]
this.$refs[formName].resetFields(); }).then(res => {
this.formParam.status = ''; if (res.code == 0) {
}, this.disabled = true
onSubmit() { this.$message({
this.page = 1; message: '正在导出中,请耐心等待',
this.getData(); type: 'success'
}, });
handleSizeChange(val) { this.timer = setInterval(() => {
this.limit = val; if (!this.disabled) {
this.getData(); clearInterval(this.timer)
}, return
handleCurrentChange(val) { }
this.page = val; this.resultDown(res.data)
this.getData(); }, 3000)
}, }
handleSelectionChange(val) { })
this.multipleSelection = val; },
}, resultDown(id_) {
disabledDate(date) { this.$http('get', "/api/export/get_export_data", {
var maxDate = new Date(); // 设置最大日期 id: id_
var minDate = new Date(); // 设置最小日期 }).then(res => {
if (res.code == 0) {
var cp_time_day = localStorage.getItem('cp_time_day'); this.disabled = false;
this.$message({
if (cp_time_day == -1) { message: '导出成功',
// “无限制”,则修改上架有效期默认为:2035-01-01 type: 'success'
var maxDate = new Date('2035-01-01'); });
} else { this.downHref = res.data;
var maxDate = new Date(new Date().getTime() + cp_time_day * 24 * 60 * 60 * 1000); const newsUrl = this.$router.resolve(res.data);
} window.open(res.data);
} else if (res.code == -1) {
//导出失败
this.$message({
message: '导出失败',
type: 'warning'
});
this.disabled = false;
}
}, error => {
this.$message('网络出现问题,请检查网络');
this.disabled = false
})
return date > maxDate || date < minDate; // 返回 true 禁用日期,返回 false 启用日期 },
}, resetForm(formName) {
/** this.formParam.date = '';
* this.cp_time_val = '';
* @param date 时间类型 this.$refs[formName].resetFields();
* @param type 是否加30天 this.formParam.status = '';
* @returns {string} },
*/ onSubmit() {
getTimes(date, type) { this.page = 1;
if (type) { this.getData();
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
disabledDate(date) {
var maxDate = new Date(); // 设置最大日期
var minDate = new Date(); // 设置最小日期
var cp_time_day = localStorage.getItem('cp_time_day'); var cp_time_day = localStorage.getItem('cp_time_day');
if (cp_time_day == -1) { if (cp_time_day == -1) {
// “无限制”,则修改上架有效期默认为:2035-01-01 // “无限制”,则修改上架有效期默认为:2035-01-01
var date = new Date('2035-01-01'); var maxDate = new Date('2035-01-01');
} else { } else {
var date = new Date(new Date().getTime() + cp_time_day * 24 * 60 * 60 * 1000); var maxDate = new Date(new Date().getTime() + cp_time_day * 24 * 60 * 60 * 1000);
} }
// var date = new Date(new Date(date).getTime() + 30 * 24 * 60 * 60 * 1000); return date > maxDate || date < minDate; // 返回 true 禁用日期,返回 false 启用日期
} else { },
var date = new Date(date); /**
} *
var year = date.getFullYear(); * @param date 时间类型
var month = date.getMonth() + 1; * @param type 是否加30天
var day = date.getDate(); * @returns {string}
*/
var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours(); getTimes(date, type) {
var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); if (type) {
var second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
month >= 1 && month <= 9 ? (month = '0' + month) : '';
day >= 0 && day <= 9 ? (day = '0' + day) : '';
var timer = year + '-' + month + '-' + day + ' ' + 0 + ':' + 0 + ':' + 0;
return timer;
},
/**
* 统计查看
* @param val
*/
showChange(row) {
this.$http('GET', "/api/sku/getSkuStatistics", {
goods_name: row.goods_name,
brand_name: row.brand_name
}).then(res => {
if (res.code == 0) {
this.skuStatistics = res.data.statisticsData;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 修改按钮
* @param command
*/
handleCommand(command) {
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
// 修改价格时检查是否只选择了一条数据
if (command == 4 && this.multipleSelection.length > 1) {
this.$message({
message: '只能选择一条数据',
type: 'warning'
});
return;
}
this.selectData = JSON.parse(JSON.stringify(this.multipleSelection)); var cp_time_day = localStorage.getItem('cp_time_day');
if (command == 1) { if (cp_time_day == -1) {
//修改库存弹窗 // “无限制”,则修改上架有效期默认为:2035-01-01
this.dialogVisible = true; var date = new Date('2035-01-01');
this.kucundata = this.selectData;
} else if (command == 2) {
//修改货期弹窗
this.dialogVisible2 = true;
this.huoqidata = this.selectData;
} else if (command == 3) {
//修改上架有效期
this.dialogVisible3 = true;
let currentTime = new Date().getTime();//当前日期毫秒
for (let i = 0; i < this.selectData.length; i++) {
this.selectData[i].cp_time_temp = this.selectData[i].cp_time;
var time = Date.parse(this.selectData[i].cp_time);//上架有效期
if (time > currentTime) {
//上架有效期大于当前日期
this.selectData[i].cp_time = this.getTimes(this.selectData[i].cp_time, true);
} else { } else {
//上架有效期小于等于当前日期 var date = new Date(new Date().getTime() + cp_time_day * 24 * 60 * 60 * 1000);
this.selectData[i].cp_time = this.getTimes(new Date(), true);
} }
// var date = new Date(new Date(date).getTime() + 30 * 24 * 60 * 60 * 1000);
} else {
var date = new Date(date);
} }
this.cpdata = this.selectData; var year = date.getFullYear();
} else if (command == 4) { var month = date.getMonth() + 1;
//修改价格 var day = date.getDate();
this.dialogVisible4 = true;
this.priceData = this.selectData; var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
this.getSkuOriginalStepPrice(this.selectData[0].goods_id); var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
this.stock = this.selectData[0].stock; var second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
} month >= 1 && month <= 9 ? (month = '0' + month) : '';
}, day >= 0 && day <= 9 ? (day = '0' + day) : '';
/** var timer = year + '-' + month + '-' + day + ' ' + 0 + ':' + 0 + ':' + 0;
* 增加阶梯价 return timer;
*/ },
addRow() { /**
if (this.skuOriginalStepPriceData.length >= 9) { * 统计查看
this.$message({ * @param val
message: '已超过阶梯限制', */
type: 'warning' showChange(row) {
}); this.$http('GET', "/api/sku/getSkuStatistics", {
return false; goods_name: row.goods_name,
} brand_name: row.brand_name
this.skuOriginalStepPriceData.push({ }).then(res => {
cost_price: '',
price_cn: '',
price_us: '',
purchases: ''
})
},
/**
* 修改阶梯价格
*/
updateSkuOriginalStepPrice() {
var isPurchasesValid = Util.isPurchasesValid(this.skuOriginalStepPriceData);
if (!isPurchasesValid) {
this.$message({
message: '修改价格时格式填写错误,起订量不能低于最小起订量,不能高于库存;并且需要填写对应价格;',
type: 'warning'
});
} else {
this.$http('GET', "/api/sku/updateSkuOriginalStepPrice", {goods_id: this.goods_id, original_price: JSON.stringify(this.skuOriginalStepPriceData)}).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message({ this.skuStatistics = res.data.statisticsData;
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.dialogVisible4 = false;
this.getData();
}, 2000)
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
...@@ -881,161 +779,263 @@ export default { ...@@ -881,161 +779,263 @@ export default {
}); });
} }
}) })
} },
}, /**
/** * 修改按钮
* 获取sku阶梯价格 * @param command
*/ */
getSkuOriginalStepPrice(goods_id) { handleCommand(command) {
this.$http('GET', "/api/sku/getSkuOriginalStepPrice", {goods_id: goods_id}).then(res => { if (this.multipleSelection.length == 0) {
if (res.code == 0) {
this.skuOriginalStepPriceData = res.data.data;
this.goods_id = goods_id;
} else {
this.$message({ this.$message({
message: res.msg, message: '请至少选择一条数据',
type: 'warning' type: 'warning'
}); });
return;
} }
})
}, // 修改价格时检查是否只选择了一条数据
/** if (command == 4 && this.multipleSelection.length > 1) {
* 修改上架有效期
*/
submitCp() {
var arr_ = {}
for (var i = 0; i < this.cpdata.length; i++) {
arr_[this.cpdata[i]['goods_id']] = {}
if (this.cpdata[i]['cp_time'] && this.cpdata[i]['cp_time'] != 'undefined') {
arr_[this.cpdata[i]['goods_id']].cp_time = this.cpdata[i]['cp_time']
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
if (res.code == 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData();
this.dialogVisible3 = false;
} else {
this.$message({ this.$message({
message: res.msg, message: '只能选择一条数据',
type: 'warning' type: 'warning'
}); });
return;
} }
})
}, this.selectData = JSON.parse(JSON.stringify(this.multipleSelection));
/** if (command == 1) {
* 修改交期提交 //修改库存弹窗
*/ this.dialogVisible = true;
submitHq() { this.kucundata = this.selectData;
var arr_ = {} } else if (command == 2) {
for (var i = 0; i < this.huoqidata.length; i++) { //修改货期弹窗
arr_[this.huoqidata[i]['goods_id']] = {} this.dialogVisible2 = true;
if (this.huoqidata[i]['dlhq'] && this.huoqidata[i]['dlhq'] != 'undefined') { this.huoqidata = this.selectData;
arr_[this.huoqidata[i]['goods_id']].cn_delivery_time = this.huoqidata[i]['dlhq'] } else if (command == 3) {
} //修改上架有效期
if (this.huoqidata[i]['hkhq'] && this.huoqidata[i]['hkhq'] != 'undefined') { this.dialogVisible3 = true;
arr_[this.huoqidata[i]['goods_id']].hk_delivery_time = this.huoqidata[i]['hkhq'] let currentTime = new Date().getTime();//当前日期毫秒
} for (let i = 0; i < this.selectData.length; i++) {
} this.selectData[i].cp_time_temp = this.selectData[i].cp_time;
this.$http('post', "/api/sku/updateSku", arr_).then(res => { var time = Date.parse(this.selectData[i].cp_time);//上架有效期
if (res.code == 0) { if (time > currentTime) {
this.$message("修改成功"); //上架有效期大于当前日期
this.getData() this.selectData[i].cp_time = this.getTimes(this.selectData[i].cp_time, true);
this.dialogVisible2 = false } else {
} else { //上架有效期小于等于当前日期
this.$message(res.msg); this.selectData[i].cp_time = this.getTimes(new Date(), true);
} }
}) }
}, this.cpdata = this.selectData;
/** } else if (command == 4) {
* 修改库存提交 //修改价格
*/ this.dialogVisible4 = true;
submitKc() { this.priceData = this.selectData;
var arr_ = {} this.getSkuOriginalStepPrice(this.selectData[0].goods_id);
var self = this; this.stock = this.selectData[0].stock;
for (var i = 0; i < self.kucundata.length; i++) {
arr_[self.kucundata[i]['goods_id']] = {
stock: self.kucundata[i]['updateStock']
} }
} },
this.$http('post', "/api/sku/updateSku", arr_).then(res => { /**
if (res.code === 0) { * 增加阶梯价
*/
addRow() {
if (this.skuOriginalStepPriceData.length >= 9) {
this.$message({ this.$message({
message: '修改成功', message: '已超过阶梯限制',
type: 'success' type: 'warning'
}); });
this.getData() return false;
this.dialogVisible = false }
} else { this.skuOriginalStepPriceData.push({
cost_price: '',
price_cn: '',
price_us: '',
purchases: ''
})
},
/**
* 修改阶梯价格
*/
updateSkuOriginalStepPrice() {
var isPurchasesValid = Util.isPurchasesValid(this.skuOriginalStepPriceData);
if (!isPurchasesValid) {
this.$message({ this.$message({
message: res.msg, message: '修改价格时格式填写错误,起订量不能低于最小起订量,不能高于库存;并且需要填写对应价格;',
type: 'error' type: 'warning'
}); });
} else {
this.$http('GET', "/api/sku/updateSkuOriginalStepPrice", { goods_id: this.goods_id, original_price: JSON.stringify(this.skuOriginalStepPriceData) }).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.dialogVisible4 = false;
this.getData();
}, 2000)
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
} }
}) },
}, /**
changeStatus(status) { * 获取sku阶梯价格
var time_arr = [];//过滤出上架有效期时间数组 */
var sku_ids = [];//过滤出sku_ids数组 getSkuOriginalStepPrice(goods_id) {
this.$http('GET', "/api/sku/getSkuOriginalStepPrice", { goods_id: goods_id }).then(res => {
if (this.multipleSelection.length == 0) { if (res.code == 0) {
this.$message({ this.skuOriginalStepPriceData = res.data.data;
message: '请至少选择一条数据', this.goods_id = goods_id;
type: 'warning' } else {
}); this.$message({
return; message: res.msg,
} type: 'warning'
});
if (status == 1) {
var time = new Date();//当前时间
time_arr = this.multipleSelection.map(obj => {
return obj.cp_time;
});
var times = time_arr.filter((item) => {
if (new Date(item) < time) {
return item;
} }
}); })
if (times.length > 0) { },
/**
* 修改上架有效期
*/
submitCp() {
var arr_ = {}
for (var i = 0; i < this.cpdata.length; i++) {
arr_[this.cpdata[i]['goods_id']] = {}
if (this.cpdata[i]['cp_time'] && this.cpdata[i]['cp_time'] != 'undefined') {
arr_[this.cpdata[i]['goods_id']].cp_time = this.cpdata[i]['cp_time']
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
if (res.code == 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData();
this.dialogVisible3 = false;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 修改交期提交
*/
submitHq() {
var arr_ = {}
for (var i = 0; i < this.huoqidata.length; i++) {
arr_[this.huoqidata[i]['goods_id']] = {}
if (this.huoqidata[i]['dlhq'] && this.huoqidata[i]['dlhq'] != 'undefined') {
arr_[this.huoqidata[i]['goods_id']].cn_delivery_time = this.huoqidata[i]['dlhq']
}
if (this.huoqidata[i]['hkhq'] && this.huoqidata[i]['hkhq'] != 'undefined') {
arr_[this.huoqidata[i]['goods_id']].hk_delivery_time = this.huoqidata[i]['hkhq']
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
if (res.code == 0) {
this.$message("修改成功");
this.getData()
this.dialogVisible2 = false
} else {
this.$message(res.msg);
}
})
},
/**
* 修改库存提交
*/
submitKc() {
var arr_ = {}
var self = this;
for (var i = 0; i < self.kucundata.length; i++) {
arr_[self.kucundata[i]['goods_id']] = {
stock: self.kucundata[i]['updateStock']
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
if (res.code === 0) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getData()
this.dialogVisible = false
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
changeStatus(status) {
var time_arr = [];//过滤出上架有效期时间数组
var sku_ids = [];//过滤出sku_ids数组
if (this.multipleSelection.length == 0) {
this.$message({ this.$message({
message: '您勾选的数据中,有型号的“上架有效期”低于当前的日期,请先维护上架有效期;', message: '请至少选择一条数据',
type: 'warning' type: 'warning'
}); });
return; return;
} }
}
sku_ids = this.multipleSelection.map(obj => {
return obj.goods_id;
});
this.$http('post', "/api/sku/updateSkuStatus", { if (status == 1) {
sku_ids: sku_ids.join(","), var time = new Date();//当前时间
status: status == 1 ? 'passed' : 'offshelf' time_arr = this.multipleSelection.map(obj => {
}).then(res => { return obj.cp_time;
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success'
}); });
this.getData() var times = time_arr.filter((item) => {
} else { if (new Date(item) < time) {
this.$message({ return item;
message: res.msg, }
type: 'warning'
}); });
if (times.length > 0) {
this.$message({
message: '您勾选的数据中,有型号的“上架有效期”低于当前的日期,请先维护上架有效期;',
type: 'warning'
});
return;
}
} }
})
sku_ids = this.multipleSelection.map(obj => {
return obj.goods_id;
});
this.$http('post', "/api/sku/updateSkuStatus", {
sku_ids: sku_ids.join(","),
status: status == 1 ? 'passed' : 'offshelf'
}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/store/list.min.css"; @import "../../assets/css/store/list.min.css";
</style> </style>
\ No newline at end of file
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
<el-table-column fixed type="selection" width="40"></el-table-column> <el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center"> <el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="danger">审核前失败</el-tag> <el-tag v-if="scope.row.status == 1" type="danger">审核前失败</el-tag>
<el-tag v-else-if="scope.row.status==2" type="info">待审核</el-tag> <el-tag v-else-if="scope.row.status == 2" type="info">待审核</el-tag>
<el-tag v-else-if="scope.row.status==3" type="success">审核通过</el-tag> <el-tag v-else-if="scope.row.status == 3" type="success">审核通过</el-tag>
<el-tag v-else-if="scope.row.status==4" type="warning">审核未通过</el-tag> <el-tag v-else-if="scope.row.status == 4" type="warning">审核未通过</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="error_msg" label="失败原因" width="200" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="error_msg" label="失败原因" width="200" :show-overflow-tooltip="true"></el-table-column>
...@@ -46,226 +46,226 @@ ...@@ -46,226 +46,226 @@
</el-table> </el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
<Menu/> <Menu />
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip,Upload} from 'element-ui' import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload); Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default { export default {
name: "ListDetail", name: "ListDetail",
data() { data() {
return { return {
detailInfo: "", detailInfo: "",
itemListObj: {}, itemListObj: {},
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
tableData: "", tableData: "",
maxPrice: [], maxPrice: [],
multipleSelection: [], multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import', uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: { fileData: {
token: Tool.getCookie('token'), token: Tool.getCookie('token'),
type: 2//1覆盖 2新增 type: 2//1覆盖 2新增
}, },
}; };
},
watch: {
$route(to, from) {
if (to.path == from.path) {
this.getInfo()
this.getList()
}
}
},
created() {
this.getInfo()
this.getList()
},
methods: {
/**
* 获取详情
*/
getInfo() {
this.$http('get', "/api/uploadSku/info", {
id: this.$route.query.id
}).then(res => {
if (res.code === 0) {
this.detailInfo = res.data
} else {
this.$message(res.msg);
}
})
}, },
/** watch: {
* 获取列表数据 $route(to, from) {
*/ if (to.path == from.path) {
getList() { this.getInfo()
this.$http('get', "/api/uploadSku/itemList", { this.getList()
page: this.page,
limit: this.limit,
up_sn: this.$route.query.sn
}).then(res => {
if (res.code === 0) {
this.itemListObj = res.data;
var arr = res.data.list || [];
for (var i = 0; i < arr.length; i++) {
if (arr[i]['ladder_price']) {
for (var j = 0; j < arr[i]['ladder_price'].length; j++) {
arr[i]['purchases' + (j + 1)] = arr[i]['ladder_price'][j]['purchases']
arr[i]['price_cn' + (j + 1)] = arr[i]['ladder_price'][j]['price_cn']
arr[i]['price_us' + (j + 1)] = arr[i]['ladder_price'][j]['price_us']
}
}
}
this.tableData = arr
this.total = res.data.total || 0;
var max_ = res.data.max_price_count || 0;
for (var g = 0; g < max_; g++) {
this.maxPrice.push(g)
}
} else {
this.$message(res.msg);
} }
})
},
/**
* 导入
*/
uploadChange(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.$message({
message: file.msg,
type: 'error'
});
} }
}, },
/** created() {
* 导出文件 this.getInfo()
*/ this.getList()
exportChange() {
var url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.$route.query.sn + '&token=' + Tool.getCookie('token');
const newsUrl = this.$router.resolve(url);
window.open(url);
}, },
toUrl(url) { methods: {
var htmlArr = []; /**
htmlArr.push('<form action="' + url + '" method="post" id="form" style="display: none">' + * 获取详情
' <input type="submit" value="提交">' + */
' </form>'); getInfo() {
$("body").append(htmlArr.join('')); this.$http('get', "/api/uploadSku/info", {
$("#form").attr('target', '_blank'); id: this.$route.query.id
$("#form").submit(); }).then(res => {
}, if (res.code === 0) {
handleSelectionChange(val) { this.detailInfo = res.data
this.multipleSelection = val; } else {
}, this.$message(res.msg);
changeStatus(status) { }
var self = this; })
var arr = []; },
if (this.multipleSelection.length == 0) { /**
this.$message({ * 获取列表数据
message: '请至少选择一条数据', */
type: 'warning' getList() {
}); this.$http('get', "/api/uploadSku/itemList", {
return false; page: this.page,
} limit: this.limit,
var status_arr = this.multipleSelection.map(obj => { up_sn: this.$route.query.sn
return obj.status; }).then(res => {
}) if (res.code === 0) {
let flag = status_arr.every(ele => ele === 3) this.itemListObj = res.data;
if (!flag) { var arr = res.data.list || [];
this.$message({ for (var i = 0; i < arr.length; i++) {
message: '选择审核通过的', if (arr[i]['ladder_price']) {
type: 'warning' for (var j = 0; j < arr[i]['ladder_price'].length; j++) {
}); arr[i]['purchases' + (j + 1)] = arr[i]['ladder_price'][j]['purchases']
return false; arr[i]['price_cn' + (j + 1)] = arr[i]['ladder_price'][j]['price_cn']
} arr[i]['price_us' + (j + 1)] = arr[i]['ladder_price'][j]['price_us']
arr = this.multipleSelection.map(obj => { }
return obj.sku_id; }
}); }
this.tableData = arr
this.$http('POST', "/api/sku/updateSkuStatus", { this.total = res.data.total || 0;
sku_ids: arr.join(","), var max_ = res.data.max_price_count || 0;
status: status == 1 ? 'passed' : 'offshelf' for (var g = 0; g < max_; g++) {
}).then(res => { this.maxPrice.push(g)
if (res.code === 0) { }
} else {
this.$message(res.msg);
}
})
},
/**
* 导入
*/
uploadChange(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '导入成功',
type: 'success', type: 'success',
onClose() { onClose() {
self.getList()
} }
}); });
} else { } else {
this.$message({ this.$message({
message: res.msg, message: file.msg,
type: 'error' type: 'error'
}); });
} }
}) },
}, /**
handleSizeChange(val) { * 导出文件
this.limit = val; */
this.getList(); exportChange() {
}, var url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.$route.query.sn + '&token=' + Tool.getCookie('token');
handleCurrentChange(val) { const newsUrl = this.$router.resolve(url);
this.page = val; window.open(url);
this.getList(); },
toUrl(url) {
var htmlArr = [];
htmlArr.push('<form action="' + url + '" method="post" id="form" style="display: none">' +
' <input type="submit" value="提交">' +
' </form>');
$("body").append(htmlArr.join(''));
$("#form").attr('target', '_blank');
$("#form").submit();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
changeStatus(status) {
var self = this;
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return false;
}
var status_arr = this.multipleSelection.map(obj => {
return obj.status;
})
let flag = status_arr.every(ele => ele === 3)
if (!flag) {
this.$message({
message: '选择审核通过的',
type: 'warning'
});
return false;
}
arr = this.multipleSelection.map(obj => {
return obj.sku_id;
});
this.$http('POST', "/api/sku/updateSkuStatus", {
sku_ids: arr.join(","),
status: status == 1 ? 'passed' : 'offshelf'
}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose() {
self.getList()
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
handleSizeChange(val) {
this.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.page = val;
this.getList();
},
}, },
}, components: {
components: { Menu
Menu }
} };
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/store/listDetail.min.css"; @import "../../assets/css/store/listDetail.min.css";
.btn-nav { .btn-nav {
background: #FFFFFF; background: #FFFFFF;
padding: 0 0 20px 20px; padding: 0 0 20px 20px;
} }
::v-deep .el-descriptions-item__label { ::v-deep .el-descriptions-item__label {
white-space: nowrap; white-space: nowrap;
} }
::v-deep .el-descriptions-item__content { ::v-deep .el-descriptions-item__content {
white-space: nowrap; white-space: nowrap;
} }
.downTemplateExport { .downTemplateExport {
width: 92px; width: 92px;
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 28px; line-height: 28px;
color: #FFF; color: #FFF;
background-color: #409EFF; background-color: #409EFF;
border-color: #409EFF; border-color: #409EFF;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
display: block; display: block;
cursor: pointer; cursor: pointer;
} }
</style> </style>
\ No newline at end of file
...@@ -31,28 +31,28 @@ ...@@ -31,28 +31,28 @@
watch: {}, watch: {},
created() { created() {
this.getData(); this.getData();
var code_=this.$route.query.err_type var code_ = this.$route.query.err_type
if(code_==1){ if (code_ == 1) {
this.text='微信授权失败' this.text = '微信授权失败'
}else if(code_==2){ } else if (code_ == 2) {
this.text='芯链token校验失败' this.text = '芯链token校验失败'
} }
else if(code_==3){ else if (code_ == 3) {
this.text='请求access_token失败' this.text = '请求access_token失败'
} }
else if(code_==4){ else if (code_ == 4) {
this.text='open_id已绑定其他账号,不能重复绑定' this.text = 'open_id已绑定其他账号,不能重复绑定'
} }
else if(code_==5){ else if (code_ == 5) {
this.text='更新绑定关系失败' this.text = '更新绑定关系失败'
} }
else if(code_==6){ else if (code_ == 6) {
this.text='添加绑定关系失败' this.text = '添加绑定关系失败'
} }
else if(code_==7){ else if (code_ == 7) {
this.text='获取微信信息失败' this.text = '获取微信信息失败'
} }
}, },
computed: {}, computed: {},
methods: { methods: {
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
this.$http('get', "/api/login/getwxqrcode").then(res => { this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) { if (res.code === 0) {
this.hrefs = res.data.wx_login_url; this.hrefs = res.data.wx_login_url;
} }
}) })
} }
......
<template> <template>
<div class="user-box"> <div class="user-box">
<div class="head-box"> <div class="head-box">
<div class="head-wrap lbBox"> <div class="head-wrap lbBox">
<a class="logo lineBlock va-m" href="https://www.ichunt.com/"> <a class="logo lineBlock va-m" href="https://www.ichunt.com/">
<img src="../../assets/images/logo.png" alt=""/> <img src="../../assets/images/logo.png" alt="" />
</a> </a>
<span class="line lineBlock va-m"></span> <span class="line lineBlock va-m"></span>
<div class="text lineBlock va-m"> <div class="text lineBlock va-m">
<p class="t1">猎芯芯链商家</p> <p class="t1">猎芯芯链商家</p>
<p class="t2">连接终端需求</p> <p class="t2">连接终端需求</p>
</div> </div>
<b class="lineBlock emptys"></b>
</div>
</div>
<div class="section">
<div class="section-wrap">
<div class="login-box">
<p class="tit">欢迎登录芯链系统</p>
<div class="bar">
<form>
<div class="input-box lbBox" :class="errorClass1 ? 'error':''">
<i class="iconfont iconuser va-m"></i>
<input type="text" placeholder="请输入手机号" class="inp va-m" v-model="form.mobile" autocomplete="off"/>
<b class="lineBlock emptys"></b>
</div>
<div class="input-box lbBox" :class="errorClass2 ? 'error':''">
<i class="iconfont icondenglu-mimabeifen va-m"></i>
<input :type='pwdFlag?"password":"text"' placeholder="请输入登录密码" class="inp va-m" v-model="form.password"/>
<a href="javascript:;" class="iconfont eye" :class="pwdFlag ? 'iconyincang':'iconyanjing'" @click="changePwd()"></a>
<b class="lineBlock emptys"></b> <b class="lineBlock emptys"></b>
</div> </div>
<div class="code-box clr" :class="errorClass3 ? 'error':''"> </div>
<div class="fl l"> <div class="section">
<input type="text" placeholder="请输入验证码" v-model="form.captcha"/> <div class="section-wrap">
<div class="login-box">
<p class="tit">欢迎登录芯链系统</p>
<div class="bar">
<form>
<div class="input-box lbBox" :class="errorClass1 ? 'error' : ''">
<i class="iconfont iconuser va-m"></i>
<input type="text" placeholder="请输入手机号" class="inp va-m" v-model="form.mobile" autocomplete="off" />
<b class="lineBlock emptys"></b>
</div>
<div class="input-box lbBox" :class="errorClass2 ? 'error' : ''">
<i class="iconfont icondenglu-mimabeifen va-m"></i>
<input :type='pwdFlag ? "password" : "text"' placeholder="请输入登录密码" class="inp va-m" v-model="form.password" />
<a href="javascript:;" class="iconfont eye" :class="pwdFlag ? 'iconyincang' : 'iconyanjing'" @click="changePwd()"></a>
<b class="lineBlock emptys"></b>
</div>
<div class="code-box clr" :class="errorClass3 ? 'error' : ''">
<div class="fl l">
<input type="text" placeholder="请输入验证码" v-model="form.captcha" />
</div>
<a class="fr r" href="javascript:;" title="换一张" @click="updateCp()">
<img :src="imgSrc" alt="">
</a>
</div>
<p class="text">
<span class="error">{{ errror_text }}</span>
<a href="javascript:;" style="visibility:hidden;">忘记密码</a>
</p>
<a href="javascript:;" class="btn-submit" :class="active ? 'active' : ''" @click="submit()" :loading="true">登录</a>
</form>
</div>
</div> </div>
<a class="fr r" href="javascript:;" title="换一张" @click="updateCp()"> </div>
<img :src="imgSrc" alt="">
</a>
</div>
<p class="text">
<span class="error">{{ errror_text }}</span>
<a href="javascript:;" style="visibility:hidden;">忘记密码</a>
</p>
<a href="javascript:;" class="btn-submit" :class="active ? 'active':''" @click="submit()" :loading="true">登录</a>
</form>
</div>
</div> </div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import {Loading, Message} from 'element-ui'; import { Loading, Message } from 'element-ui';
import Util from "../../tool"; import Util from "../../tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
export default { export default {
name: "index", name: "index",
data() { data() {
return { return {
pwdFlag: true, pwdFlag: true,
active: false, active: false,
errror_text: '', errror_text: '',
status1: false, status1: false,
status2: false, status2: false,
loading: true, loading: true,
imgSrc: '', imgSrc: '',
errorClass1: false, errorClass1: false,
errorClass2: false, errorClass2: false,
errorClass3: false, errorClass3: false,
cp: false, cp: false,
form: { form: {
mobile: '', mobile: '',
password: '', password: '',
captcha: '', captcha: '',
captcha_key: '' captcha_key: ''
} }
}; };
}, },
watch: { watch: {
form: { form: {
deep: true, deep: true,
handler: function (newV, oldV) { handler: function (newV, oldV) {
let obj = newV; let obj = newV;
let myreg = /^[1][3,4,5,7,8][0-9]{9}$/; let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!this.cp) { if (!this.cp) {
if (obj.captcha || obj.password || obj.mobile) { if (obj.captcha || obj.password || obj.mobile) {
this.errror_text = ''; this.errror_text = '';
this.errorClass1 = false; this.errorClass1 = false;
this.errorClass2 = false; this.errorClass2 = false;
this.errorClass3 = false; this.errorClass3 = false;
} }
} else { } else {
this.cp = false; this.cp = false;
} }
if (myreg.test(obj.mobile)) { if (myreg.test(obj.mobile)) {
this.active = true; this.active = true;
} else { } else {
this.active = false; this.active = false;
} }
} }
} }
}, },
created() { created() {
this.updateCp(); this.updateCp();
}, },
computed: {}, computed: {},
methods: { methods: {
updateCp() { updateCp() {
this.$http('get', "/auth/cp").then(res => { this.$http('get', "/auth/cp").then(res => {
if (res.code === 0) { if (res.code === 0) {
this.imgSrc = res.data.url.img; this.imgSrc = res.data.url.img;
this.form.captcha_key = res.data.url.key; this.form.captcha_key = res.data.url.key;
} }
}).catch(err => { }).catch(err => {
console.log(err.message); console.log(err.message);
}) })
}, },
changePwd: function () { changePwd: function () {
this.pwdFlag = !this.pwdFlag; this.pwdFlag = !this.pwdFlag;
}, },
submit() { submit() {
var myreg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/; var myreg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
if (!this.form.mobile) { if (!this.form.mobile) {
this.errror_text = '请输入手机号'; this.errror_text = '请输入手机号';
this.errorClass1 = true; this.errorClass1 = true;
return false; return false;
} }
if (!myreg.test(this.form.mobile)) { if (!myreg.test(this.form.mobile)) {
this.errror_text = '请输入正确的手机号'; this.errror_text = '请输入正确的手机号';
this.errorClass1 = true; this.errorClass1 = true;
return false; return false;
} }
if (!this.form.password) { if (!this.form.password) {
this.errror_text = '请输入登录密码'; this.errror_text = '请输入登录密码';
this.errorClass2 = true; this.errorClass2 = true;
return false; return false;
} }
if (!this.form.captcha) { if (!this.form.captcha) {
this.errror_text = '请输入验证码'; this.errror_text = '请输入验证码';
this.errorClass3 = true; this.errorClass3 = true;
return false; return false;
} }
let loadingInstance = Loading.service({ let loadingInstance = Loading.service({
background: 'rgba(0, 0, 0, 0)' background: 'rgba(0, 0, 0, 0)'
}); });
this.$http('post', "/auth/login", { this.$http('post', "/auth/login", {
mobile: this.form.mobile, mobile: this.form.mobile,
password: this.form.password, password: this.form.password,
captcha: this.form.captcha, captcha: this.form.captcha,
captcha_key: this.form.captcha_key captcha_key: this.form.captcha_key
}).then(res => { }).then(res => {
loadingInstance.close(); loadingInstance.close();
if (res.code === 0) { if (res.code === 0) {
sessionStorage.removeItem('tabs'); sessionStorage.removeItem('tabs');
localStorage.removeItem('supplier_id'); localStorage.removeItem('supplier_id');
localStorage.removeItem('cp_time_day'); localStorage.removeItem('cp_time_day');
localStorage.removeItem('futures_cp_time_day'); localStorage.removeItem('futures_cp_time_day');
localStorage.setItem('supplier_id', res.data.supplier_id); localStorage.setItem('supplier_id', res.data.supplier_id);
localStorage.setItem('cp_time_day', res.data.cp_time_day); localStorage.setItem('cp_time_day', res.data.cp_time_day);
localStorage.setItem('futures_cp_time_day', res.data.futures_cp_time_day); localStorage.setItem('futures_cp_time_day', res.data.futures_cp_time_day);
Util.setCookie("token", res.data.api_token, 1); Util.setCookie("token", res.data.api_token, 1);
//强制要求微信绑定 //强制要求微信绑定
if (!res.data.is_bind_wechat) { if (!res.data.is_bind_wechat) {
this.$http('get', "/api/login/getwxqrcode").then(res => { this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) { if (res.code === 0) {
window.location.href = res.data.wx_login_url; window.location.href = res.data.wx_login_url;
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'warning' type: 'warning'
});
}
})
} else {
window.location.href = '/';
}
} else if (res.code === 102) {
this.errror_text = res.msg;
this.cp = true;
this.updateCp();
this.$message({
message: res.msg,
type: 'warning'
});
} else {
this.errror_text = res.msg;
this.cp = true;
this.updateCp();
this.$message({
message: res.msg,
type: 'warning'
});
}
}).catch(err => {
loadingInstance.close();
}); });
} }
})
} else {
window.location.href = '/';
}
} else if (res.code === 102) {
this.errror_text = res.msg;
this.cp = true;
this.updateCp();
this.$message({
message: res.msg,
type: 'warning'
});
} else {
this.errror_text = res.msg;
this.cp = true;
this.updateCp();
this.$message({
message: res.msg,
type: 'warning'
});
} }
}).catch(err => { };
loadingInstance.close();
});
}
}
};
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/login/index.min.css"; @import "../../assets/css/login/index.min.css";
#app ::v-deep { #app ::v-deep {
padding: 0 !important; padding: 0 !important;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="notfound"> <div class="notfound">
<img src="../../assets/images/notfound.png" alt=""> <img src="../../assets/images/notfound.png" alt="">
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "notfound", name: "notfound",
data() { data() {
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
}; };
</script> </script>
<style> <style>
.notfound { .notfound {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
} }
.notfound img { .notfound img {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
</style> </style>
\ No newline at end of file
...@@ -56,121 +56,119 @@ ...@@ -56,121 +56,119 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "allPayableBills", name: "allPayableBills",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
goods_name: '', goods_name: '',
type: '', type: '',
status: '', status: '',
create_time: [] create_time: []
}
};
},
created() {
this.getData()
},
methods: {
getData() {
// 处理日期范围
let params = Object.assign({}, this.formParam);
if (params.create_time && params.create_time.length === 2) {
params.create_time = params.create_time.join(' ~ ');
}
params = Object.assign(params, {page: this.page, limit: this.limit});
this.$http('GET', "/api/bill/getUnPayBillList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
}, },
/** created() {
* 型号监听 this.getData()
* @param queryString },
* @param cb methods: {
*/ getData() {
querySearchAsync(queryString, cb) { // 处理日期范围
if (!queryString) { let params = Object.assign({}, this.formParam);
cb([]); if (params.create_time && params.create_time.length === 2) {
return; params.create_time = params.create_time.join(' ~ ');
} }
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { params = Object.assign(params, { page: this.page, limit: this.limit });
if (res.code == 0 && res.data.list?.length) { this.$http('GET', "/api/bill/getUnPayBillList", params).then(res => {
const arr = res.data.list.map(item => ({ if (res.code === 0) {
value: item.spu_name this.list = res.data.list || [];
})); this.total = Number(res.data.total) || 0;
cb(arr); } else {
} else { this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 搜索 cb(arr);
*/ } else {
onSubmit() { cb([]);
this.page = 1; }
this.getData(); }).catch(() => {
}, cb([]);
/** });
* 重置表单 },
* @param formName /**
*/ * 搜索
resetForm(formName) { */
this.formParam.date = ''; onSubmit() {
this.$refs[formName].resetFields(); this.page = 1;
}, this.getData();
/** },
* 列表分页条数筛选监听 /**
* @param val * 重置表单
*/ * @param formName
handleSizeChange(val) { */
this.limit = val; resetForm(formName) {
this.getData(); this.formParam.date = '';
}, this.$refs[formName].resetFields();
/** },
* 列表分页输入页码监听 /**
* @param val * 列表分页条数筛选监听
*/ * @param val
handleCurrentChange(val) { */
this.page = val; handleSizeChange(val) {
this.getData(); this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
}
}, },
/** components: {
* chebox 选择监听 Menu
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -23,136 +23,134 @@ ...@@ -23,136 +23,134 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "fileManagement", name: "fileManagement",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
bill_sn: '', bill_sn: '',
status: '', status: '',
goods_name: '', goods_name: '',
create_time: [] create_time: []
}
};
},
created() {
this.getData()
},
methods: {
getData() {
this.$http('GET', "/api/fileManage/getFileList", {}).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
}, },
/** created() {
* 型号监听 this.getData()
* @param queryString },
* @param cb methods: {
*/ getData() {
querySearchAsync(queryString, cb) { this.$http('GET', "/api/fileManage/getFileList", {}).then(res => {
if (!queryString) { if (res.code === 0) {
cb([]); this.list = res.data.list || [];
return; this.total = Number(res.data.total) || 0;
} } else {
this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => { this.$message({
if (res.code == 0 && res.data.list?.length) { message: res.msg,
const arr = res.data.list.map(item => ({ type: 'error'
value: item.spu_name });
})); }
cb(arr); })
} else { },
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 操作按钮监听 cb(arr);
*/ } else {
handleCommand(command) { cb([]);
let bill_id = this.multipleSelection.map(item => item.bill_id).join(','); }
if (!bill_id) { }).catch(() => {
this.$message({ cb([]);
message: '请选择账单',
type: 'warning'
}); });
return; },
} /**
if (this.multipleSelection.length > 1) { * 操作按钮监听
this.$message.warning('不支持批量导出操作'); */
return; handleCommand(command) {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
if (!bill_id) {
this.$message({
message: '请选择账单',
type: 'warning'
});
return;
}
if (this.multipleSelection.length > 1) {
this.$message.warning('不支持批量导出操作');
return;
}
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?bill_id=' + bill_id + '&token=' + Tool.getCookie('token') + '&type=' + command;
Tool.openNewWindow(url);
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?bill_id=' + bill_id + '&token=' + Tool.getCookie('token') + '&type=' + command;
Tool.openNewWindow(url);
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
}, },
/** components: {
* 重置表单 Menu
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column> <el-table-column type="index" label="序号" width="50" align="center" fixed></el-table-column>
<el-table-column prop="bill_sn" label="账单号" width="120" :show-overflow-tooltip="true" align="center"> <el-table-column prop="bill_sn" label="账单号" width="120" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :underline="false" @click="$router.push({path: '/reconciledBillDetail', query: {bill_id: scope.row.bill_id,bill_sn:scope.row.bill_sn}})" style="font-size: 12px;">{{ scope.row.bill_sn }}</el-link> <el-link type="primary" :underline="false" @click="$router.push({ path: '/reconciledBillDetail', query: { bill_id: scope.row.bill_id, bill_sn: scope.row.bill_sn } })" style="font-size: 12px;">{{ scope.row.bill_sn }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="bill_name" label="账单名称" min-width="170" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="bill_name" label="账单名称" min-width="170" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -62,151 +62,149 @@ ...@@ -62,151 +62,149 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "reconciledBill", name: "reconciledBill",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
bill_sn: '', bill_sn: '',
status: '', status: '',
goods_name: '', goods_name: '',
create_time: [] create_time: []
}
};
},
created() {
this.getData()
},
methods: {
getData() {
// 处理日期范围
let params = Object.assign({}, this.formParam);
if (params.create_time && params.create_time.length === 2) {
params.create_time = params.create_time.join(' ~ ');
}
params = Object.assign(params, {page: this.page, limit: this.limit});
this.$http('GET', "/api/bill/getVerifiedBillList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
}, },
/** created() {
* 型号监听 this.getData()
* @param queryString },
* @param cb methods: {
*/ getData() {
querySearchAsync(queryString, cb) { // 处理日期范围
if (!queryString) { let params = Object.assign({}, this.formParam);
cb([]); if (params.create_time && params.create_time.length === 2) {
return; params.create_time = params.create_time.join(' ~ ');
} }
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { params = Object.assign(params, { page: this.page, limit: this.limit });
if (res.code == 0 && res.data.list?.length) {
const arr = res.data.list.map(item => ({ this.$http('GET', "/api/bill/getVerifiedBillList", params).then(res => {
value: item.spu_name if (res.code === 0) {
})); this.list = res.data.list || [];
cb(arr); this.total = Number(res.data.total) || 0;
} else { } else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 操作按钮监听 cb(arr);
*/ } else {
handleCommand(command) { cb([]);
let bill_id = this.multipleSelection.map(item => item.bill_id).join(','); }
if (!bill_id) { }).catch(() => {
this.$message({ cb([]);
message: '请选择账单',
type: 'warning'
}); });
return; },
} /**
if (this.multipleSelection.length > 1) { * 操作按钮监听
this.$message.warning('不支持批量导出操作'); */
return; handleCommand(command) {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
if (!bill_id) {
this.$message({
message: '请选择账单',
type: 'warning'
});
return;
}
if (this.multipleSelection.length > 1) {
this.$message.warning('不支持批量导出操作');
return;
}
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?bill_id=' + bill_id + '&token=' + Tool.getCookie('token') + '&type=' + command;
Tool.openNewWindow(url);
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 已对账账单-导出(待采购系统确认)
*/
exportVerifiedBill() {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?type=2&bill_id=' + bill_id + '&token=' + Tool.getCookie('token');
Tool.openNewWindow(url);
} }
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?bill_id=' + bill_id + '&token=' + Tool.getCookie('token') + '&type=' + command;
Tool.openNewWindow(url);
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
}, },
/** components: {
* 重置表单 Menu
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 已对账账单-导出(待采购系统确认)
*/
exportVerifiedBill() {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
let url = NODE_ENVS + '/api/bill/exportVerifiedBill?type=2&bill_id=' + bill_id + '&token=' + Tool.getCookie('token');
Tool.openNewWindow(url);
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -41,113 +41,111 @@ ...@@ -41,113 +41,111 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "reconciledBillDetail", name: "reconciledBillDetail",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
recall_id: '', recall_id: '',
detailData: {}, detailData: {},
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
bill_id: '', bill_id: '',
bill_sn: '' bill_sn: ''
}; };
},
created() {
this.bill_id = this.$route.query.bill_id;
this.bill_sn = this.$route.query.bill_sn;
this.getData()
},
methods: {
getData() {
this.$http('GET', "/api/bill/getVerifiedBillDetail", {bill_id: this.bill_id, bill_sn: this.bill_sn, page: this.page, limit: this.limit}).then(res => {
if (res.code === 0) {
this.detailData = res.data.bill_info;
this.list = res.data.list;
this.total = res.data.total || 0;
} else {
this.$message.error(res.msg);
}
})
}, },
/** created() {
* 型号监听 this.bill_id = this.$route.query.bill_id;
* @param queryString this.bill_sn = this.$route.query.bill_sn;
* @param cb this.getData()
*/ },
querySearchAsync(queryString, cb) { methods: {
if (!queryString) { getData() {
cb([]); this.$http('GET', "/api/bill/getVerifiedBillDetail", { bill_id: this.bill_id, bill_sn: this.bill_sn, page: this.page, limit: this.limit }).then(res => {
return; if (res.code === 0) {
} this.detailData = res.data.bill_info;
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { this.list = res.data.list;
if (res.code == 0 && res.data.list?.length) { this.total = res.data.total || 0;
const arr = res.data.list.map(item => ({ } else {
value: item.spu_name this.$message.error(res.msg);
})); }
cb(arr); })
} else { },
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 搜索 cb(arr);
*/ } else {
onSubmit() { cb([]);
this.page = 1; }
this.getData(); }).catch(() => {
}, cb([]);
/** });
* 重置表单 },
* @param formName /**
*/ * 搜索
resetForm(formName) { */
this.formParam.date = ''; onSubmit() {
this.$refs[formName].resetFields(); this.page = 1;
}, this.getData();
/** },
* 列表分页条数筛选监听 /**
* @param val * 重置表单
*/ * @param formName
handleSizeChange(val) { */
this.limit = val; resetForm(formName) {
this.getData(); this.formParam.date = '';
}, this.$refs[formName].resetFields();
/** },
* 列表分页输入页码监听 /**
* @param val * 列表分页条数筛选监听
*/ * @param val
handleCurrentChange(val) { */
this.page = val; handleSizeChange(val) {
this.getData(); this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
}
}, },
/** components: {
* chebox 选择监听 Menu
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -36,117 +36,115 @@ ...@@ -36,117 +36,115 @@
<div v-if="is_flag" style="margin-top: 20px;"> <div v-if="is_flag" style="margin-top: 20px;">
<el-button size="small" type="primary" @click="batchRecallSubmit">提交</el-button> <el-button size="small" type="primary" @click="batchRecallSubmit">提交</el-button>
<el-button size="small" type="primary" @click="batchRecallExportFailed">导出失败数据</el-button> <el-button size="small" type="primary" @click="batchRecallExportFailed">导出失败数据</el-button>
<el-button size="small" @click="$router.push({path: '/consignmentRecall'})">取 消</el-button> <el-button size="small" @click="$router.push({ path: '/consignmentRecall' })">取 消</el-button>
</div> </div>
</div> </div>
<Menu ref="menu"></Menu> <Menu ref="menu"></Menu>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Upload).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Upload).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "batchRecall", name: "batchRecall",
data() { data() {
return { return {
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
recall_upload_sn: '',//上传编号 recall_upload_sn: '',//上传编号
is_flag: false is_flag: false
}; };
},
created() {
},
methods: {
/**
* 上传成功
* @param res
* @param file
* @param fileList
*/
handleUploadSuccess(res, file, fileList) {
if (res.code === 0) {
this.$message.success('上传成功');
if (res.data.list.length > 0) {
this.is_flag = true;
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
}
} else {
this.$message.error(res.msg || '上传失败');
}
}, },
/** created() {
* 上传失败
* @param err
* @param file
* @param fileList
*/
handleUploadError(err, file, fileList) {
this.$message.error('上传失败,请重试');
}, },
/** methods: {
* 批量召回-提交 /**
*/ * 上传成功
batchRecallSubmit() { * @param res
this.recall_upload_sn = this.list.filter(item => item.status === 1).map(item => item.recall_upload_sn); * @param file
this.$http('POST', "/api/consignmentRecall/batchRecallSubmit", {recall_upload_sn: this.recall_upload_sn}).then(res => { * @param fileList
*/
handleUploadSuccess(res, file, fileList) {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message.success('上传成功');
message: '操作成功', if (res.data.list.length > 0) {
type: 'success', this.is_flag = true;
onClose: () => { this.list = res.data.list || [];
this.$refs.menu.closetab(this.$route.path); this.total = Number(res.data.total) || 0;
setTimeout(() => { }
if (this.$route.path !== '/consignmentRecall') {
this.$router.push({path: '/consignmentRecall'}).catch(err => {
if (err.name !== 'NavigationDuplicated') {
throw err;
}
});
}
}, 0);
}
});
} else { } else {
this.$message.error(res.msg || '操作失败'); this.$message.error(res.msg || '上传失败');
} }
}) },
}, /**
/** * 上传失败
* 批量召回-导出失败数据 * @param err
*/ * @param file
batchRecallExportFailed() { * @param fileList
this.recall_upload_sn = this.list.filter(item => item.status === 0).map(item => item.recall_upload_sn); */
this.$http('POST', "/api/consignmentRecall/batchRecallExportFailed", {recall_upload_sn: this.recall_upload_sn}).then(res => { handleUploadError(err, file, fileList) {
if (res.code === 0) { this.$message.error('上传失败,请重试');
this.$message({ },
message: '操作成功', /**
type: 'success', * 批量召回-提交
onClose: () => { */
batchRecallSubmit() {
this.recall_upload_sn = this.list.filter(item => item.status === 1).map(item => item.recall_upload_sn);
this.$http('POST', "/api/consignmentRecall/batchRecallSubmit", { recall_upload_sn: this.recall_upload_sn }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.$refs.menu.closetab(this.$route.path);
setTimeout(() => {
if (this.$route.path !== '/consignmentRecall') {
this.$router.push({ path: '/consignmentRecall' }).catch(err => {
if (err.name !== 'NavigationDuplicated') {
throw err;
}
});
}
}, 0);
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 批量召回-导出失败数据
*/
batchRecallExportFailed() {
this.recall_upload_sn = this.list.filter(item => item.status === 0).map(item => item.recall_upload_sn);
this.$http('POST', "/api/consignmentRecall/batchRecallExportFailed", { recall_upload_sn: this.recall_upload_sn }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
} }
}); });
} else { } else {
this.$message.error(res.msg || '操作失败'); this.$message.error(res.msg || '操作失败');
} }
}) })
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<el-table-column type="selection" width="40" align="center" fixed></el-table-column> <el-table-column type="selection" width="40" align="center" fixed></el-table-column>
<el-table-column prop="consignment_sn" label="寄售申请单号" width="160" :show-overflow-tooltip="true" align="center"> <el-table-column prop="consignment_sn" label="寄售申请单号" width="160" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :underline="false" @click="$router.push({path: '/consignmentApplicationDetail', query: {consignment_id: scope.row.consignment_id}})" style="font-size: 12px;">{{ scope.row.consignment_sn }}</el-link> <el-link type="primary" :underline="false" @click="$router.push({ path: '/consignmentApplicationDetail', query: { consignment_id: scope.row.consignment_id } })" style="font-size: 12px;">{{ scope.row.consignment_sn }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="consignment_status_val" label="状态" width="80" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="consignment_status_val" label="状态" width="80" :show-overflow-tooltip="true" align="center"></el-table-column>
...@@ -142,303 +142,301 @@ ...@@ -142,303 +142,301 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "consignmentApplication", name: "consignmentApplication",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
dialogVisible_1: false, dialogVisible_1: false,
dialogVisible_2: false, dialogVisible_2: false,
dialogVisible_3: false, dialogVisible_3: false,
dialogVisible_4: false, dialogVisible_4: false,
remark: '', remark: '',
consignment_ids: '',
rules: {
shipping_id: [
{required: true, message: '请选择物流公司', trigger: 'blur'},
],
shipping_no: [
{required: true, message: '请输入物流单号', trigger: 'blur'},
{
pattern: /^[a-zA-Z0-9,,]*$/,
message: '物流单号只能输入英文、数字、中英文逗号',
trigger: 'blur'
}
]
},
formParam: {
consignment_sn: '',
goods_name: '',
consignment_status: ''
},
updateShippingInfoParasm: {
consignment_ids: '', consignment_ids: '',
shipping_id: '', rules: {
shipping_no: '' shipping_id: [
} { required: true, message: '请选择物流公司', trigger: 'blur' },
}; ],
}, shipping_no: [
created() { { required: true, message: '请输入物流单号', trigger: 'blur' },
this.getData() {
}, pattern: /^[a-zA-Z0-9,,]*$/,
methods: { message: '物流单号只能输入英文、数字、中英文逗号',
getData() { trigger: 'blur'
var params = Object.assign({}, this.formParam, {page: this.page, limit: this.limit}); }
this.$http('GET', "/api/consignment/getConsignmentList", params).then(res => { ]
if (res.code === 0) { },
this.list = res.data.list || []; formParam: {
this.total = Number(res.data.total) || 0; consignment_sn: '',
} else { goods_name: '',
this.$message({ consignment_status: ''
message: res.msg, },
type: 'error' updateShippingInfoParasm: {
}); consignment_ids: '',
} shipping_id: '',
}) shipping_no: ''
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
return;
}
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => {
if (res.code == 0 && res.data.list?.length) {
const arr = res.data.list.map(item => ({
value: item.spu_name
}));
cb(arr);
} else {
cb([]);
} }
}).catch(() => { };
cb([]);
});
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
}, },
/** created() {
* 列表分页条数筛选监听 this.getData()
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
}, },
/** methods: {
* 列表分页输入页码监听 getData() {
* @param val var params = Object.assign({}, this.formParam, { page: this.page, limit: this.limit });
*/ this.$http('GET', "/api/consignment/getConsignmentList", params).then(res => {
handleCurrentChange(val) { if (res.code === 0) {
this.page = val; this.list = res.data.list || [];
this.getData(); this.total = Number(res.data.total) || 0;
}, } else {
/** this.$message({
* chebox 选择监听 message: res.msg,
* @param val type: 'error'
*/ });
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 弹窗事件
*/
popupEvent(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
switch (type) {
case 1:
// 提交审核:校验待提审状态
const invalidVerify = this.multipleSelection.filter(item => item.consignment_status != 0);
if (invalidVerify.length) {
this.$message.warning('只能选择待提审状态的数据');
return;
} }
if (this.multipleSelection.length > 200) { })
this.$message.warning('每次最多可提交200条数据'); },
return; /**
} * 型号监听
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(','); * @param queryString
this.dialogVisible_1 = true; * @param cb
break; */
case 2: querySearchAsync(queryString, cb) {
if (this.multipleSelection.length > 1) { if (!queryString) {
this.$message.warning('不支持批量操作'); cb([]);
return; return;
} }
// 作废:校验 待提审或进行中且待入库状态为待入库 this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
var invalidCancel = this.multipleSelection.filter(item => { if (res.code == 0 && res.data.list?.length) {
var isPendingReview = item.consignment_status === 0; const arr = res.data.list.map(item => ({
var isInProgressAndPendingStock = item.consignment_status === 2 && item.stock_in_status === 1; value: item.spu_name
return !(isPendingReview || isInProgressAndPendingStock); }));
}); cb(arr);
if (invalidCancel.length) { } else {
this.$message.warning('只能作废待提审状态或进行中且未入库的数据'); cb([]);
return;
} }
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(','); }).catch(() => {
this.dialogVisible_2 = true; cb([]);
break; });
case 3: },
if (this.multipleSelection.length > 1) { /**
this.$message.warning('不支持批量操作'); * 搜索
return; */
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 弹窗事件
*/
popupEvent(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
switch (type) {
case 1:
// 提交审核:校验待提审状态
const invalidVerify = this.multipleSelection.filter(item => item.consignment_status != 0);
if (invalidVerify.length) {
this.$message.warning('只能选择待提审状态的数据');
return;
}
if (this.multipleSelection.length > 200) {
this.$message.warning('每次最多可提交200条数据');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_1 = true;
break;
case 2:
if (this.multipleSelection.length > 1) {
this.$message.warning('不支持批量操作');
return;
}
// 作废:校验 待提审或进行中且待入库状态为待入库
var invalidCancel = this.multipleSelection.filter(item => {
var isPendingReview = item.consignment_status === 0;
var isInProgressAndPendingStock = item.consignment_status === 2 && item.stock_in_status === 1;
return !(isPendingReview || isInProgressAndPendingStock);
});
if (invalidCancel.length) {
this.$message.warning('只能作废待提审状态或进行中且未入库的数据');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_2 = true;
break;
case 3:
if (this.multipleSelection.length > 1) {
this.$message.warning('不支持批量操作');
return;
}
// 关单的条件:状态:进行(consignment_status=2)中且入库状态:部分入库(stock_in_status=2)
var invalidClose = this.multipleSelection.filter(item => {
return item.consignment_status != 2 || item.stock_in_status != 2;
});
if (invalidClose.length) {
this.$message.warning('只能关闭进行中且部分入库的寄售申请单');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_3 = true;
break;
case 4:
if (this.multipleSelection.length > 1) {
this.$message.warning('不支持批量操作');
return;
}
// 填写物流:只能为待提审、待审核、进行中状态,且入库作为为为待入库或部分入库状态的数据填写物流
var invalidShipping = this.multipleSelection.filter(item =>
!([0, 1, 2].includes(item.consignment_status) && [1, 2].includes(item.stock_in_status))
);
if (invalidShipping.length) {
this.$message.warning('只能为待提审、待审核、进行中状态,且入库状态为待入库或部分入库状态的数据填写物流');
return;
}
this.updateShippingInfoParasm.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_4 = true;
break;
}
},
/**
* 填写物流
*/
updateShippingInfo(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
// 保存的时候,如果物流单号有中文逗号自动转化成英文逗号保存
this.updateShippingInfoParasm.shipping_no = this.updateShippingInfoParasm.shipping_no.replace(/,/g, ',');
this.$http('POST', "/api/consignment/updateShippingInfo", this.updateShippingInfoParasm).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_4 = false;
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
} else {
console.log('error submit!!');
return false;
} }
// 关单的条件:状态:进行(consignment_status=2)中且入库状态:部分入库(stock_in_status=2) });
var invalidClose = this.multipleSelection.filter(item => { },
return item.consignment_status != 2 || item.stock_in_status != 2; /**
}); * 提交审核
if (invalidClose.length) { */
this.$message.warning('只能关闭进行中且部分入库的寄售申请单'); verifyConsignment() {
return; this.$http('POST', "/api/consignment/verifyConsignment", { consignment_ids: this.consignment_ids, remark: this.remark }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_1 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
} }
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(','); })
this.dialogVisible_3 = true; },
break; /**
case 4: * 作废
if (this.multipleSelection.length > 1) { */
this.$message.warning('不支持批量操作'); cancelConsignment() {
return; this.$http('POST', "/api/consignment/cancelConsignment", { consignment_ids: this.consignment_ids, cancel_remark: this.remark }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_2 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
} }
// 填写物流:只能为待提审、待审核、进行中状态,且入库作为为为待入库或部分入库状态的数据填写物流 })
var invalidShipping = this.multipleSelection.filter(item => },
!([0, 1, 2].includes(item.consignment_status) && [1, 2].includes(item.stock_in_status)) /**
); * 关单
if (invalidShipping.length) { */
this.$message.warning('只能为待提审、待审核、进行中状态,且入库状态为待入库或部分入库状态的数据填写物流'); closeConsignment() {
return; this.$http('POST', "/api/consignment/closeConsignment", { consignment_ids: this.consignment_ids }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_3 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
} }
this.updateShippingInfoParasm.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(','); })
this.dialogVisible_4 = true;
break;
} }
}, },
/** components: {
* 填写物流 Menu
*/
updateShippingInfo(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
// 保存的时候,如果物流单号有中文逗号自动转化成英文逗号保存
this.updateShippingInfoParasm.shipping_no = this.updateShippingInfoParasm.shipping_no.replace(/,/g, ',');
this.$http('POST', "/api/consignment/updateShippingInfo", this.updateShippingInfoParasm).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_4 = false;
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
} else {
console.log('error submit!!');
return false;
}
});
},
/**
* 提交审核
*/
verifyConsignment() {
this.$http('POST', "/api/consignment/verifyConsignment", {consignment_ids: this.consignment_ids, remark: this.remark}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_1 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 作废
*/
cancelConsignment() {
this.$http('POST', "/api/consignment/cancelConsignment", {consignment_ids: this.consignment_ids, cancel_remark: this.remark}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_2 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 关单
*/
closeConsignment() {
this.$http('POST', "/api/consignment/closeConsignment", {consignment_ids: this.consignment_ids}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_3 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -48,124 +48,122 @@ ...@@ -48,124 +48,122 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "consignmentApplicationDetail", name: "consignmentApplicationDetail",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
consignment_id: '', consignment_id: '',
detailData: {}, detailData: {},
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [] list: []
}; };
},
created() {
this.consignment_id = this.$route.query.consignment_id;
this.getData()
},
methods: {
getData() {
this.$http('GET', "/api/consignment/getConsignmentDetail", { consignment_id: this.consignment_id, page: this.page, limit: this.limit }).then(res => {
if (res.code === 0) {
this.detailData = res.data;
this.list = res.data.items.list;
this.total = res.data.items.total || 0;
} else {
this.$message.error(res.msg);
}
})
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
}, },
/** created() {
* chebox 选择监听 this.consignment_id = this.$route.query.consignment_id;
* @param val this.getData()
*/
handleSelectionChange(val) {
this.multipleSelection = val;
}, },
/** methods: {
* 删除寄售明细 getData() {
*/ this.$http('GET', "/api/consignment/getConsignmentDetail", { consignment_id: this.consignment_id, page: this.page, limit: this.limit }).then(res => {
deleteConsignmentItems() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择要删除的数据');
return;
}
// 提交审核:校验待提审状态
if (this.detailData.consignment_status != 0) {
this.$message.warning('只能选择待提审状态的数据');
return;
}
this.$confirm('确定删除已选择的商品明细?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let consignment_item_ids = this.multipleSelection.map(item => item.consignment_item_id).join(',');
this.$http('POST', "/api/consignment/deleteConsignmentItems", { consignment_item_ids: consignment_item_ids }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.detailData = res.data;
message: '操作成功', this.list = res.data.items.list;
type: 'success', this.total = res.data.items.total || 0;
onClose: () => {
this.getData();
}
});
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
}).catch(() => { },
console.log('已取消删除'); /**
}); * 列表分页条数筛选监听
}, * @param val
/** */
* 更新明细寄售数量 handleSizeChange(val) {
*/ this.limit = val;
updateConsignmentItems(consignment_item_id, apply_num) { this.getData();
if (!apply_num || apply_num <= 0) { },
this.$message.warning('请输入有效的数量'); /**
return; * 列表分页输入页码监听
} * @param val
this.$http('POST', "/api/consignment/updateConsignmentItems", { consignment_item_id: consignment_item_id, apply_num: apply_num }).then(res => { */
if (res.code === 0) { handleCurrentChange(val) {
this.page = val;
} else { this.getData();
this.$message.error(res.msg); },
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 删除寄售明细
*/
deleteConsignmentItems() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择要删除的数据');
return;
}
// 提交审核:校验待提审状态
if (this.detailData.consignment_status != 0) {
this.$message.warning('只能选择待提审状态的数据');
return;
}
this.$confirm('确定删除已选择的商品明细?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let consignment_item_ids = this.multipleSelection.map(item => item.consignment_item_id).join(',');
this.$http('POST', "/api/consignment/deleteConsignmentItems", { consignment_item_ids: consignment_item_ids }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.getData();
}
});
} else {
this.$message.error(res.msg);
}
})
}).catch(() => {
console.log('已取消删除');
});
},
/**
* 更新明细寄售数量
*/
updateConsignmentItems(consignment_item_id, apply_num) {
if (!apply_num || apply_num <= 0) {
this.$message.warning('请输入有效的数量');
return;
} }
}) this.$http('POST', "/api/consignment/updateConsignmentItems", { consignment_item_id: consignment_item_id, apply_num: apply_num }).then(res => {
if (res.code === 0) {
} else {
this.$message.error(res.msg);
}
})
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -45,90 +45,88 @@ ...@@ -45,90 +45,88 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "consignmentContract", name: "consignmentContract",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
status: '' status: ''
}
};
},
created() {
this.getData()
},
methods: {
getData() {
var params = Object.assign({}, this.formParam, {page: this.page, limit: this.limit});
this.$http('GET', "/api/consignmentContract/getConsignmentContractList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
}, },
/** created() {
* 列表分页条数筛选监听 this.getData()
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
}, },
/** methods: {
* 列表分页输入页码监听 getData() {
* @param val var params = Object.assign({}, this.formParam, { page: this.page, limit: this.limit });
*/ this.$http('GET', "/api/consignmentContract/getConsignmentContractList", params).then(res => {
handleCurrentChange(val) { if (res.code === 0) {
this.page = val; this.list = res.data.list || [];
this.getData(); this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
}
}, },
/** components: {
* chebox 选择监听 Menu
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -35,16 +35,16 @@ ...@@ -35,16 +35,16 @@
<el-table-column fixed type="selection" width="40" align="center"></el-table-column> <el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column label="单号" min-width="20%" align="center"> <el-table-column label="单号" min-width="20%" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :underline="false" @click="$router.push({path: '/consignmentImportDetail', query: {up_sn: scope.row.up_sn,id:scope.row.id}})" style="font-size: 12px;">{{ scope.row.up_sn }}</el-link> <el-link type="primary" :underline="false" @click="$router.push({ path: '/consignmentImportDetail', query: { up_sn: scope.row.up_sn, id: scope.row.id } })" style="font-size: 12px;">{{ scope.row.up_sn }}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="file_name" label="文件名字" min-width="20%" :show-overflow-tooltip="true" align="center"></el-table-column> <el-table-column prop="file_name" label="文件名字" min-width="20%" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="120" align="center"> <el-table-column prop="status" label="状态" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="primary">待处理</el-tag> <el-tag v-if="scope.row.status == 1" type="primary">待处理</el-tag>
<el-tag v-else-if="scope.row.status==2" type="warning">处理中</el-tag> <el-tag v-else-if="scope.row.status == 2" type="warning">处理中</el-tag>
<el-tag v-else-if="scope.row.status==3" type="success">已处理</el-tag> <el-tag v-else-if="scope.row.status == 3" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.status==4" type="danger">失败</el-tag> <el-tag v-else-if="scope.row.status == 4" type="danger">失败</el-tag>
<el-tooltip :aa="scope" class="item" effect="dark" placement="top-start"> <el-tooltip :aa="scope" class="item" effect="dark" placement="top-start">
<i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i> <i class="el-icon-question" style="color:#ff7e11;margin-left:5px;cursor:pointer;font-size:16px;"></i>
<div slot="content">{{ scope.row.status_tips }}</div> <div slot="content">{{ scope.row.status_tips }}</div>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button> <el-button @click="dialogVisible = false" style="margin-right: 10px;">取 消</el-button>
<el-upload ref="upload" :data="fileData" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleChange" :on-progress="handleProgress"> <el-upload ref="upload" :data="fileData" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleChange" :on-progress="handleProgress">
<el-button type="primary" :loading="uploading">确 定</el-button> <el-button type="primary" :loading="uploading">确 定</el-button>
<el-progress v-if="uploading" :percentage="progress"/> <el-progress v-if="uploading" :percentage="progress" />
</el-upload> </el-upload>
</div> </div>
</div> </div>
...@@ -85,195 +85,195 @@ ...@@ -85,195 +85,195 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import Tool from '@/tool' import Tool from '@/tool'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import {Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Progress, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui' import { Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Progress, Radio, Select, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag).use(Tooltip).use(Link); Vue.use(Button).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Pagination).use(Tag).use(Tooltip).use(Link);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default { export default {
name: "consignmentImport", name: "consignmentImport",
data() { data() {
return { return {
jsHref: location.hostname === 'xinlian.ichunt.com' ? 'https://cloud.ichunt.com/template/芯链寄售商品导入模板.csv' : 'http://cloud.liexindev.net/template/芯链寄售商品导入模板.csv', jsHref: location.hostname === 'xinlian.ichunt.com' ? 'https://cloud.ichunt.com/template/芯链寄售商品导入模板.csv' : 'http://cloud.liexindev.net/template/芯链寄售商品导入模板.csv',
cp_time_day: localStorage.getItem('cp_time_day') || '',//现货最高天数 cp_time_day: localStorage.getItem('cp_time_day') || '',//现货最高天数
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数 futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数
uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口 uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口
fileData: { fileData: {
source: 12, source: 12,
token: Tool.getCookie('token'), token: Tool.getCookie('token'),
type: "2"//1覆盖 2新增 type: "2"//1覆盖 2新增
},
uploading: false,//上传状态
progress: 0,//上传进度
dialogVisible: false,
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
date: [],
status: '',
source: 12
}
};
},
created() {
this.getData()
},
methods: {
getData() {
var params = Object.assign({}, { page: this.page, limit: this.limit, source: 12, status: this.formParam.status, action_time: this.formParam.date[0], end_time: this.formParam.date[1] });
this.$http('GET', "/api/uploadSku/list", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
}, },
uploading: false,//上传状态 /**
progress: 0,//上传进度 * 导入
dialogVisible: false, */
multipleSelection: [], importChange() {
total: 0, // 先重置所有状态
page: 1, this.progress = 0;
limit: 10, this.uploading = false;
list: [],
formParam: { // 清空上传列表
date: [], if (this.$refs.upload) {
status: '', this.$refs.upload.clearFiles();
source: 12 }
}
}; // 使用 nextTick 确保DOM更新后再显示对话框
}, this.$nextTick(() => {
created() { this.dialogVisible = true;
this.getData() });
}, },
methods: { /**
getData() { * 上传文件之前的钩子
var params = Object.assign({}, { page: this.page, limit: this.limit, source: 12, status: this.formParam.status, action_time: this.formParam.date[0], end_time: this.formParam.date[1] }); */
this.$http('GET', "/api/uploadSku/list", params).then(res => { handleBeforeUpload() {
if (res.code === 0) { this.uploading = true
this.list = res.data.list || []; },
this.total = Number(res.data.total) || 0; /**
* 文件上传时的钩子
* @param response
* @param file
* @param fileList
*/
handleProgress(event, file, fileList) {
this.progress = event.percent
},
/**
* 文件上传成功时的钩子
* @param file
* @param fileList
* @returns {boolean}
*/
handleChange(file, fileList) {
// 文件上传成功处理
if (file.code === 0) {
this.dialogVisible = false;
this.page = 1;
this.getData();
this.$message({
message: '导入成功',
type: 'success'
});
} else { } else {
// 上传失败重置状态
this.progress = 0;
this.uploading = false;
this.$message({ this.$message({
message: res.msg, message: file.msg,
type: 'error' type: 'warning'
}); });
} }
}) },
}, /**
/** * 搜索
* 导入 */
*/ onSubmit() {
importChange() {
// 先重置所有状态
this.progress = 0;
this.uploading = false;
// 清空上传列表
if (this.$refs.upload) {
this.$refs.upload.clearFiles();
}
// 使用 nextTick 确保DOM更新后再显示对话框
this.$nextTick(() => {
this.dialogVisible = true;
});
},
/**
* 上传文件之前的钩子
*/
handleBeforeUpload() {
this.uploading = true
},
/**
* 文件上传时的钩子
* @param response
* @param file
* @param fileList
*/
handleProgress(event, file, fileList) {
this.progress = event.percent
},
/**
* 文件上传成功时的钩子
* @param file
* @param fileList
* @returns {boolean}
*/
handleChange(file, fileList) {
// 文件上传成功处理
if (file.code === 0) {
this.dialogVisible = false;
this.page = 1; this.page = 1;
this.getData(); this.getData();
this.$message({ },
message: '导入成功', /**
type: 'success' * 重置表单
}); * @param formName
} else { */
// 上传失败重置状态 resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleDialogClosed() {
// 对话框关闭时清空
this.progress = 0; this.progress = 0;
this.uploading = false; this.uploading = false;
this.$message({ if (this.$refs.upload) {
message: file.msg, this.$refs.upload.clearFiles();
type: 'warning' }
});
} }
}, },
/** components: {
* 搜索 Menu
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleDialogClosed() {
// 对话框关闭时清空
this.progress = 0;
this.uploading = false;
if (this.$refs.upload) {
this.$refs.upload.clearFiles();
}
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
.downTemplate { .downTemplate {
width: 68px; width: 68px;
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 28px; line-height: 28px;
color: #FFF; color: #FFF;
background-color: #409EFF; background-color: #409EFF;
border-color: #409EFF; border-color: #409EFF;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
display: block; display: block;
} }
.dialog-text .tt { .dialog-text .tt {
color: #333; color: #333;
font-weight: bold; font-weight: bold;
margin-bottom: 16px; margin-bottom: 16px;
} }
.dialog-text .alink { .dialog-text .alink {
font-size: 12px; font-size: 12px;
} }
</style> </style>
\ No newline at end of file
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
<el-table-column fixed type="selection" width="40"></el-table-column> <el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center"> <el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="danger">审核前失败</el-tag> <el-tag v-if="scope.row.status == 1" type="danger">审核前失败</el-tag>
<el-tag v-else-if="scope.row.status==2" type="info">待审核</el-tag> <el-tag v-else-if="scope.row.status == 2" type="info">待审核</el-tag>
<el-tag v-else-if="scope.row.status==3" type="success">上传成功</el-tag> <el-tag v-else-if="scope.row.status == 3" type="success">上传成功</el-tag>
<el-tag v-else-if="scope.row.status==4" type="warning">审核未通过</el-tag> <el-tag v-else-if="scope.row.status == 4" type="warning">审核未通过</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="error_msg" label="失败原因" min-width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="error_msg" label="失败原因" min-width="150" :show-overflow-tooltip="true"></el-table-column>
...@@ -64,157 +64,155 @@ ...@@ -64,157 +64,155 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui' import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
import {NODE_ENVS} from "@/ajax"; import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool"; import Tool from "@/tool";
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload); Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default { export default {
name: "consignmentImportDetail", name: "consignmentImportDetail",
data() { data() {
return { return {
detailData: {}, detailData: {},
itemListObj: {},//明细数据 itemListObj: {},//明细数据
dialogVisible_1: false, dialogVisible_1: false,
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
list: [], list: [],
maxPrice: [], maxPrice: [],
id: '', id: '',
up_sn: '', up_sn: '',
multipleSelection: [], multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import', uploadUrl: NODE_ENVS + '/api/uploadSku/import',
remark: '', remark: '',
sku_apply_num_json: [], sku_apply_num_json: [],
fileData: { fileData: {
token: Tool.getCookie('token'), token: Tool.getCookie('token'),
type: 2//1覆盖 2新增 type: 2//1覆盖 2新增
}
};
},
created() {
this.id = this.$route.query.id;
this.up_sn = this.$route.query.up_sn;
this.getInfo()
this.getList()
},
methods: {
/**
* 获取详情
*/
getInfo() {
this.$http('GET', "/api/uploadSku/info", {id: this.id}).then(res => {
if (res.code === 0) {
this.detailData = res.data
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 获取列表数据
*/
getList() {
this.$http('GET', "/api/uploadSku/itemList", {page: this.page, limit: this.limit, up_sn: this.up_sn, source: 12}).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = res.data.total || 0;
this.itemListObj = res.data;//明细数据
} else {
this.$message(res.msg);
} }
}) };
}, },
/** created() {
* 导出失败文件 this.id = this.$route.query.id;
*/ this.up_sn = this.$route.query.up_sn;
exportErrorItemList() { this.getInfo()
let url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.up_sn + '&token=' + Tool.getCookie('token') + '&source=12'; this.getList()
Tool.openNewWindow(url);
}, },
/** methods: {
* 弹窗事件 /**
*/ * 获取详情
popupEvent(type) { */
if (!this.multipleSelection.length) { getInfo() {
this.$message.warning('请选择数据'); this.$http('GET', "/api/uploadSku/info", { id: this.id }).then(res => {
return; if (res.code === 0) {
} this.detailData = res.data
switch (type) { } else {
case 1: this.$message({
// 提交审核:校验待提审状态 message: res.msg,
const invalidVerify = this.multipleSelection.filter(item => item.status != 3); type: 'error'
if (invalidVerify.length) { });
this.$message.warning('上传成功的才可提交寄售审核');
return;
} }
this.sku_apply_num_json = this.multipleSelection.map(item => { })
return { },
sku_id: item.sku_id, /**
apply_num: item.consignment_apply_stock * 获取列表数据
} */
}); getList() {
this.dialogVisible_1 = true; this.$http('GET', "/api/uploadSku/itemList", { page: this.page, limit: this.limit, up_sn: this.up_sn, source: 12 }).then(res => {
break; if (res.code === 0) {
} this.list = res.data.list || [];
}, this.total = res.data.total || 0;
/** this.itemListObj = res.data;//明细数据
* 提交寄售审核 } else {
*/ this.$message(res.msg);
submitConsignmentAudit() { }
this.$http('POST', "/api/sku/submitConsignmentAudit", {sku_apply_num_json: JSON.stringify(this.sku_apply_num_json), remark: this.remark}).then(res => { })
if (res.code === 0) { },
this.$message({ /**
message: '操作成功', * 导出失败文件
type: 'success', */
onClose: () => { exportErrorItemList() {
this.dialogVisible_1 = false; let url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.up_sn + '&token=' + Tool.getCookie('token') + '&source=12';
this.remark = ''; Tool.openNewWindow(url);
this.getList(); },
/**
* 弹窗事件
*/
popupEvent(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
switch (type) {
case 1:
// 提交审核:校验待提审状态
const invalidVerify = this.multipleSelection.filter(item => item.status != 3);
if (invalidVerify.length) {
this.$message.warning('上传成功的才可提交寄售审核');
return;
} }
}); this.sku_apply_num_json = this.multipleSelection.map(item => {
} else { return {
this.$message.error(res.msg || '操作失败'); sku_id: item.sku_id,
apply_num: item.consignment_apply_stock
}
});
this.dialogVisible_1 = true;
break;
} }
}) },
}, /**
/** * 提交寄售审核
* 列表分页条数筛选监听 */
* @param val submitConsignmentAudit() {
*/ this.$http('POST', "/api/sku/submitConsignmentAudit", { sku_apply_num_json: JSON.stringify(this.sku_apply_num_json), remark: this.remark }).then(res => {
handleSizeChange(val) { if (res.code === 0) {
this.limit = val; this.$message({
this.getList(); message: '操作成功',
}, type: 'success',
/** onClose: () => {
* 列表分页输入页码监听 this.dialogVisible_1 = false;
* @param val this.remark = '';
*/ this.getList();
handleCurrentChange(val) { }
this.page = val; });
this.getList(); } else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getList();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getList();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
}
}, },
/** components: {
* chebox 选择监听 Menu
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
* 作废 * 作废
*/ */
cancelConsignmentRecall() { cancelConsignmentRecall() {
this.$http('POST', "/api/consignmentRecall/cancelConsignmentRecall", { recall_id: this.recall_ids}).then(res => { this.$http('POST', "/api/consignmentRecall/cancelConsignmentRecall", { recall_id: this.recall_ids }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
......
...@@ -35,138 +35,139 @@ ...@@ -35,138 +35,139 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, Col, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Row, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(Row).use(Col);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "consignmentRecallDetail", name: "consignmentRecallDetail",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
recall_id: '', recall_id: '',
detailData: {}, detailData: {},
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
status: '', status: '',
date: '' date: ''
}
};
},
created() {
this.recall_id = this.$route.query.recall_id;
this.getData()
},
methods: {
getData() {
this.$http('GET', "/api/consignmentRecall/getConsignmentRecallDetail", {recall_id: this.recall_id, page: this.page, limit: this.limit}).then(res => {
if (res.code === 0) {
this.detailData = res.data;
this.list = res.data.items.list;
this.total = res.data.items.total || 0;
} else {
this.$message.error(res.msg);
} }
}) };
}, },
/** created() {
* 型号监听 this.recall_id = this.$route.query.recall_id;
* @param queryString this.getData()
* @param cb },
*/ methods: {
querySearchAsync(queryString, cb) { getData() {
if (!queryString) { this.$http('GET', "/api/consignmentRecall/getConsignmentRecallDetail", { recall_id: this.recall_id, page: this.page, limit: this.limit }).then(res => {
cb([]); if (res.code === 0) {
return; this.detailData = res.data;
} this.list = res.data.items.list;
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { this.total = res.data.items.total || 0;
if (res.code == 0 && res.data.list?.length) { } else {
const arr = res.data.list.map(item => ({ this.$message.error(res.msg);
value: item.spu_name }
})); })
cb(arr); },
} else { /**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
}
this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
if (res.code == 0 && res.data.list?.length) {
const arr = res.data.list.map(item => ({
value: item.spu_name
}));
cb(arr);
} else {
cb([]);
}
}).catch(() => {
cb([]);
});
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 添加库存
* @param {number} type - 0:添加选中 1:一键添加全部
*/
addInventory(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
} }
}).catch(() => {
cb([]);
});
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getData();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 添加库存
* @param {number} type - 0:添加选中 1:一键添加全部
*/
addInventory(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
if (type) { if (type) {
// 一键添加全部库存 // 一键添加全部库存
this.recall_json = this.list; this.recall_json = this.list;
} else { } else {
// 添加选中的库存 // 添加选中的库存
this.recall_json = this.multipleSelection; this.recall_json = this.multipleSelection;
} }
this.dialogVisible_1 = false; // 关闭弹窗 this.dialogVisible_1 = false; // 关闭弹窗
this.$message.success('添加成功'); this.$message.success('添加成功');
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
.remark-content { .remark-content {
min-width: 200px; min-width: 200px;
word-break: break-all; /* 防止文字溢出 */ word-break: break-all;
} /* 防止文字溢出 */
}
</style> </style>
\ No newline at end of file
...@@ -42,137 +42,135 @@ ...@@ -42,137 +42,135 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "consignmentReplenishment", name: "consignmentReplenishment",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
sku_id: '', sku_id: '',
goods_name: '' goods_name: ''
}
};
},
created() {
this.getData()
},
methods: {
getData() {
var params = Object.assign({}, this.formParam, {page: this.page, limit: this.limit});
this.$http('GET', "/api/consignmentReplenishment/getConsignmentReplenishmentList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
} }
}) };
}, },
/** created() {
* 型号监听 this.getData()
* @param queryString },
* @param cb methods: {
*/ getData() {
querySearchAsync(queryString, cb) { var params = Object.assign({}, this.formParam, { page: this.page, limit: this.limit });
if (!queryString) { this.$http('GET', "/api/consignmentReplenishment/getConsignmentReplenishmentList", params).then(res => {
cb([]); if (res.code === 0) {
return; this.list = res.data.list || [];
} this.total = Number(res.data.total) || 0;
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { } else {
if (res.code == 0 && res.data.list?.length) { this.$message({
const arr = res.data.list.map(item => ({ message: res.msg,
value: item.spu_name type: 'error'
})); });
cb(arr); }
} else { })
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 搜索 cb(arr);
*/ } else {
onSubmit() { cb([]);
this.page = 1; }
this.getData(); }).catch(() => {
}, cb([]);
/** });
* 重置表单 },
* @param formName /**
*/ * 搜索
resetForm(formName) { */
this.formParam.date = ''; onSubmit() {
this.$refs[formName].resetFields(); this.page = 1;
}, this.getData();
/** },
* 列表分页条数筛选监听 /**
* @param val * 重置表单
*/ * @param formName
handleSizeChange(val) { */
this.limit = val; resetForm(formName) {
this.getData(); this.formParam.date = '';
}, this.$refs[formName].resetFields();
/** },
* 列表分页输入页码监听 /**
* @param val * 列表分页条数筛选监听
*/ * @param val
handleCurrentChange(val) { */
this.page = val; handleSizeChange(val) {
this.getData(); this.limit = val;
}, this.getData();
/** },
* chebox 选择监听 /**
* @param val * 列表分页输入页码监听
*/ * @param val
handleSelectionChange(val) { */
this.multipleSelection = val; handleCurrentChange(val) {
}, this.page = val;
/** this.getData();
* 提交补货申请 },
*/ /**
addConsignmentReplenishment() { * chebox 选择监听
if (!this.multipleSelection.length) { * @param val
this.$message.warning('请选择数据'); */
return; handleSelectionChange(val) {
} this.multipleSelection = val;
let sku_ids = this.multipleSelection.map(item => item.sku_id).join(','); },
this.$http('POST', "/api/consignmentReplenishment/addConsignmentReplenishment", {sku_ids: sku_ids}).then(res => { /**
if (res.code === 0) { * 提交补货申请
this.$message({ */
message: '操作成功', addConsignmentReplenishment() {
type: 'success', if (!this.multipleSelection.length) {
onClose: () => { this.$message.warning('请选择数据');
this.getData(); return;
}
});
} else {
this.$message.error(res.msg || '操作失败');
} }
}) let sku_ids = this.multipleSelection.map(item => item.sku_id).join(',');
this.$http('POST', "/api/consignmentReplenishment/addConsignmentReplenishment", { sku_ids: sku_ids }).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
}
},
components: {
Menu
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped></style>
\ No newline at end of file
</style>
\ No newline at end of file
...@@ -55,161 +55,161 @@ ...@@ -55,161 +55,161 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Menu from "@/components/menu.vue"; import Menu from "@/components/menu.vue";
import {Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui' import { Autocomplete, Button, DatePicker, Descriptions, DescriptionsItem, Dialog, Divider, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, MessageBox, Option, Pagination, Popover, RadioButton, RadioGroup, Select, Table, TableColumn, Tag, Tooltip } from 'element-ui'
Vue.prototype.$message = Message Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$confirm = MessageBox.confirm;
Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(RadioGroup).use(RadioButton); Vue.use(Button).use(Link).use(Form).use(Select).use(Option).use(Input).use(FormItem).use(Dialog).use(Tooltip).use(Autocomplete).use(Popover).use(Tag).use(Divider).use(RadioGroup).use(RadioButton);
Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem); Vue.use(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default { export default {
name: "inOutStockLog", name: "inOutStockLog",
data() { data() {
return { return {
multipleSelection: [], multipleSelection: [],
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
formParam: { formParam: {
goods_name: '', goods_name: '',
types: [], types: [],
start_time: '', start_time: '',
end_time: '' end_time: ''
}, },
activeTimeBtn: 7 activeTimeBtn: 7
};
},
created() {
this.handleTimeFilter(7);
},
methods: {
getData() {
const params = {
...this.formParam,
page: this.page,
limit: this.limit,
types: this.formParam.types?.join(',') || ''
}; };
this.$http('GET', "/api/consignmentWmsLog/getConsignmentWmsLogList", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
}, },
/** created() {
* 型号监听 this.handleTimeFilter(7);
* @param queryString },
* @param cb methods: {
*/ getData() {
querySearchAsync(queryString, cb) { const params = {
if (!queryString) { ...this.formParam,
cb([]); page: this.page,
return; limit: this.limit,
} types: this.formParam.types?.join(',') || ''
this.$http('GET', "/api/search/getspu", {spu_name: queryString}).then(res => { };
if (res.code == 0 && res.data.list?.length) {
const arr = res.data.list.map(item => ({ this.$http('GET', "/api/consignmentWmsLog/getConsignmentWmsLogList", params).then(res => {
value: item.spu_name if (res.code === 0) {
})); this.list = res.data.list || [];
cb(arr); this.total = Number(res.data.total) || 0;
} else { } else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]); cb([]);
return;
} }
}).catch(() => { this.$http('GET', "/api/search/getspu", { spu_name: queryString }).then(res => {
cb([]); if (res.code == 0 && res.data.list?.length) {
}); const arr = res.data.list.map(item => ({
}, value: item.spu_name
/** }));
* 搜索 cb(arr);
*/ } else {
onSubmit() { cb([]);
this.page = 1; }
this.getData(); }).catch(() => {
}, cb([]);
/** });
* 重置表单 },
* @param formName /**
*/ * 搜索
resetForm(formName) { */
this.activeTimeBtn = ''; onSubmit() {
this.formParam.start_time = ''; this.page = 1;
this.formParam.end_time = ''; this.getData();
this.$refs[formName].resetFields(); },
this.getData(); /**
}, * 重置表单
/** * @param formName
* 列表分页条数筛选监听 */
* @param val resetForm(formName) {
*/ this.activeTimeBtn = '';
handleSizeChange(val) { this.formParam.start_time = '';
this.limit = val; this.formParam.end_time = '';
this.getData(); this.$refs[formName].resetFields();
}, this.getData();
/** },
* 列表分页输入页码监听 /**
* @param val * 列表分页条数筛选监听
*/ * @param val
handleCurrentChange(val) { */
this.page = val; handleSizeChange(val) {
this.getData(); this.limit = val;
}, this.getData();
/** },
* chebox 选择监听 /**
* @param val * 列表分页输入页码监听
*/ * @param val
handleSelectionChange(val) { */
this.multipleSelection = val; handleCurrentChange(val) {
}, this.page = val;
/** this.getData();
* 添加时间筛选处理方法 },
*/ /**
handleTimeFilter() { * chebox 选择监听
const days = this.activeTimeBtn; * @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
},
/**
* 添加时间筛选处理方法
*/
handleTimeFilter() {
const days = this.activeTimeBtn;
// 计算开始时间和结束时间 // 计算开始时间和结束时间
const end = new Date(); const end = new Date();
const start = new Date(); const start = new Date();
start.setDate(start.getDate() - days); start.setDate(start.getDate() - days);
// 格式化日期 // 格式化日期
this.formParam.start_time = this.formatDate(start); this.formParam.start_time = this.formatDate(start);
this.formParam.end_time = this.formatDate(end); this.formParam.end_time = this.formatDate(end);
// 重新获取数据 // 重新获取数据
this.page = 1; this.page = 1;
this.getData(); this.getData();
},
/**
* 格式化日期的辅助方法
* @param date
*/
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
}, },
/** components: {
* 格式化日期的辅助方法 Menu
* @param date
*/
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
} }
}, };
components: {
Menu
}
};
</script> </script>
<style scoped> <style scoped>
.time-filter { .time-filter {
margin: 15px 0; margin: 15px 0;
} }
.filter-btns .el-radio-group { .filter-btns .el-radio-group {
margin-left: 0px !important; margin-left: 0px !important;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment