Commit 3741487c by liangjianmin

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

修复多个组件中的代码格式问题,包括:
1. 统一缩进为2个空格
2. 修复对象和数组声明中的多余空格
3. 保持组件导入和使用的格式一致
4. 移除多余空行和注释
parent 0e018907
Showing with 8326 additions and 8330 deletions
......@@ -10,7 +10,7 @@
<el-input v-model="formParam.keyword" placeholder="请输入关键词" @keyup.enter.native="submit" clearable></el-input>
</el-form-item>
<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-button type="primary" @click="submit">搜索</el-button>
......@@ -81,239 +81,239 @@
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from '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 Vue from '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'
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(TableColumn).use(Table).use(Upload)
export default {
name: "brand",
data() {
return {
dialogVisible: false,
updateBranddata: [],
total: 0,
limit: 10,
page: 1,
downHref: "",
formParam: {
brand_name: '',
keyword: '',
date: ''
},
disabled: false,
tableData: "",
timer: null,
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
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(TableColumn).use(Table).use(Upload)
export default {
name: "brand",
data() {
return {
dialogVisible: false,
updateBranddata: [],
total: 0,
limit: 10,
page: 1,
downHref: "",
formParam: {
brand_name: '',
keyword: '',
date: ''
},
disabled: false,
tableData: "",
timer: null,
multipleSelection: []
};
},
submitUpdate() {
var arr_ = {
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'
});
}
})
created() {
this.getData();
},
//品牌
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_);
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 {
cb([]);
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
/**
* 编辑品牌
*/
updateBrand() {
if (this.multipleSelection.length > 1) {
this.$message("只能选择一条数据")
return
}
})
},
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();
},
downOut() {
if (this.disabled) {
this.$message({
message: '正在导出中,请不要重复点击',
type: 'success'
});
return false;
}
this.$http('post', "/api/brand/export_brand", {
brand_id: this.formParam.brand_id,
brand_name: this.formParam.brand_name,
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
if (this.multipleSelection.length == 0) {
this.$message("请至少选择一条数据")
return
}
this.updateBranddata = JSON.parse(JSON.stringify(this.multipleSelection));
this.dialogVisible = true
},
submitUpdate() {
var arr_ = {
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'
});
}
})
},
//品牌
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([]);
}
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
}
})
},
resultDown(id_) {
this.$http('get', "/api/export/get_export_data", {
id: id_
}).then(res => {
if (res.code == 0) {
this.disabled = false
this.page = 1;
this.getData();
},
downOut() {
if (this.disabled) {
this.$message({
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
return false;
}
}, error => {
this.$message('网络出现问题,请检查网络');
this.disabled = false
})
},
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(",")
this.$http('post', "/api/brand/export_brand", {
brand_id: this.formParam.brand_id,
brand_name: this.formParam.brand_name,
keyword: this.formParam.keyword,
}).then(res => {
if (res.code === 0) {
this.$message("删除成功");
this.getData()
} else {
this.$message(res.msg);
if (res.code == 0) {
this.disabled = true
this.$message({
message: '正在导出中,请耐心等待',
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(() => {
})
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
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 => {
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) {
this.multipleSelection = val || [];
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/goods/brand.min.css";
@import "../../assets/css/goods/brand.min.css";
::v-deep .custom-dialog .el-dialog__body {
height: 500px;
overflow-y: auto;
}
::v-deep .custom-dialog .el-dialog__body {
height: 500px;
overflow-y: auto;
}
</style>
\ No newline at end of file
......@@ -89,271 +89,271 @@
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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);
export default {
name: "brand",
data() {
return {
dialogVisible: false,
updateGoodsdata: [],
total: 0,
limit: 10,
page: 1,
downHref: "",
formParam: {
goods_name: '',
brand_name: '',
keyword: '',
class_id2: '',
class_id1: '',
date: ''
},
disabled: false,
timer: null,
tableData: "",
multipleSelection: [],
options: [],
selectedOptions: []
}
},
created() {
this.getData();
this.getClass();
},
methods: {
getClass() {
this.$http('get', "/api/class/get_class_list", {}).then(res => {
if (res.code === 0) {
var data = res.data.list || [];
if (data.length > 0) {
for (let i = 0; i < data.length; i++) {
var children = []
let children_arr = data[i].sub_class || [];
if (children_arr.length > 0) {
for (let j = 0; j < children_arr.length; j++) {
children.push({
value: children_arr[j].class_id,
label: children_arr[j].class_name
})
Vue.prototype.$message = Message
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);
export default {
name: "brand",
data() {
return {
dialogVisible: false,
updateGoodsdata: [],
total: 0,
limit: 10,
page: 1,
downHref: "",
formParam: {
goods_name: '',
brand_name: '',
keyword: '',
class_id2: '',
class_id1: '',
date: ''
},
disabled: false,
timer: null,
tableData: "",
multipleSelection: [],
options: [],
selectedOptions: []
}
},
created() {
this.getData();
this.getClass();
},
methods: {
getClass() {
this.$http('get', "/api/class/get_class_list", {}).then(res => {
if (res.code === 0) {
var data = res.data.list || [];
if (data.length > 0) {
for (let i = 0; i < data.length; i++) {
var children = []
let children_arr = data[i].sub_class || [];
if (children_arr.length > 0) {
for (let j = 0; j < children_arr.length; j++) {
children.push({
value: children_arr[j].class_id,
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,
type: 'warning'
});
}
})
},
getData() {
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,
spu_name: this.formParam.goods_name,
keyword: this.formParam.keyword,
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_);
})
},
getData() {
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,
spu_name: this.formParam.goods_name,
keyword: this.formParam.keyword,
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 {
cb([]);
this.$message(res.msg);
}
}
})
},
//品牌
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]
})
})
},
//型号
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([]);
}
}
})
},
updateBrand() {
if (this.multipleSelection.length > 1) {
this.$message({
message: '只能选择一条数据',
type: 'warning'
});
return false;
}
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return false;
}
this.updateGoodsdata = JSON.parse(JSON.stringify(this.multipleSelection));
this.dialogVisible = true
},
submitUpdate() {
var arr_ = {
id: this.updateGoodsdata[0].spu_id,
remark: this.updateGoodsdata[0].remark
}
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 {
})
},
//品牌
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([]);
}
}
})
},
updateBrand() {
if (this.multipleSelection.length > 1) {
this.$message({
message: res.msg,
message: '只能选择一条数据',
type: 'warning'
});
return false;
}
})
},
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;
if (this.multipleSelection.length == 0) {
this.$message({
message: '正在导出中,请耐心等待',
type: 'warning',
duration: 0
message: '请至少选择一条数据',
type: 'warning'
});
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return false;
}
this.resultDown(res.data)
}, 3000)
return false;
}
})
},
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
this.updateGoodsdata = JSON.parse(JSON.stringify(this.multipleSelection));
this.dialogVisible = true
},
submitUpdate() {
var arr_ = {
id: this.updateGoodsdata[0].spu_id,
remark: this.updateGoodsdata[0].remark
}
}, 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 || [];
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({
message: res.msg,
type: 'warning'
});
}
})
},
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) {
this.formParam.class_id1 = value[0]
this.formParam.class_id2 = value[1]
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
::v-deep .custom-dialog .el-dialog__body {
height: 500px;
overflow-y: auto;
}
::v-deep .custom-dialog .el-dialog__body {
height: 500px;
overflow-y: auto;
}
</style>
\ No newline at end of file
<template>
<div class="home-index boxsiz">
<Menu/>
<Menu />
<div class="row bothSide verCenter survey-top-show">
<div class="column left-bar">
<ul class="survey-top row bothSide boxsiz">
......@@ -67,7 +67,7 @@
<span style="width: 30%">排名</span>
</div>
<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>
<template v-if="v.rank == 1">
<div class="sort row verCenter">
......@@ -98,13 +98,13 @@
<div class="rate-box boxsiz">
<div class="rate-tab row bothSide verCenter">
<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="1">报价成单率</el-radio-button>
</el-radio-group>
</div>
<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="1">本周</el-radio-button>
<el-radio-button label="2">本月</el-radio-button>
......@@ -119,14 +119,14 @@
<div class="offer boxsiz">
<div class="offer-tab row verCenter bothSide">
<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="2">报价量</el-radio-button>
<el-radio-button label="3">成单量</el-radio-button>
</el-radio-group>
</div>
<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="2">本月</el-radio-button>
<el-radio-button label="3">本年</el-radio-button>
......@@ -139,13 +139,13 @@
<el-table :data="inquiry_rank_list">
<el-table-column prop="numbers" label="排名" align="center" width="50">
<template slot-scope="scope">
<template v-if="scope.$index==0">
<template v-if="scope.$index == 0">
<span class="one row rowCenter verCenter">1</span>
</template>
<template v-else-if="scope.$index==1">
<template v-else-if="scope.$index == 1">
<span class="two row rowCenter verCenter">2</span>
</template>
<template v-else-if="scope.$index==2">
<template v-else-if="scope.$index == 2">
<span class="three row rowCenter verCenter">3</span>
</template>
<template v-else>
......@@ -163,199 +163,199 @@
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import * as echarts from 'echarts';
import {DatePicker, Form, FormItem, Message, Progress, Radio, RadioButton, RadioGroup, Table, TableColumn, Tabs} from 'element-ui';
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import * as echarts from 'echarts';
import { DatePicker, Form, FormItem, Message, Progress, Radio, RadioButton, RadioGroup, Table, TableColumn, Tabs } from 'element-ui';
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.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(DatePicker).use(Tabs).use(Radio).use(RadioGroup).use(RadioButton).use(Progress).use(Table).use(TableColumn);
export default {
name: "index",
data() {
return {
isDisabled: true,
date: '',
tabPosition: 0,
tabDate: 0,
offerPosition: 1,
offerDate: 1,
percentage: 0,
inquiry_rank_list: [],
xAxis: [],
series: [],
rankList: [],//搜索排名
flag: true,//切换品牌,型号
placeholderText: '输入型号,查看排名',
rankParam: {
type: 1,
keyword: ''
},
data: {
weekly_quote_selected_count: 0,
weekly_spu_count: 0,
all_sku_count: 0,
reject_sku_count: 0,
weekly_quote_deal_count: 0,
off_shelf_sku_count: 0,
weekly_quote_count: 0,
brand_count: 0,
weekly_sku_count: 0,
all_spu_count: 0,
weekly_inquiry_count: 0,
all_quote_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'
});
export default {
name: "index",
data() {
return {
isDisabled: true,
date: '',
tabPosition: 0,
tabDate: 0,
offerPosition: 1,
offerDate: 1,
percentage: 0,
inquiry_rank_list: [],
xAxis: [],
series: [],
rankList: [],//搜索排名
flag: true,//切换品牌,型号
placeholderText: '输入型号,查看排名',
rankParam: {
type: 1,
keyword: ''
},
data: {
weekly_quote_selected_count: 0,
weekly_spu_count: 0,
all_sku_count: 0,
reject_sku_count: 0,
weekly_quote_deal_count: 0,
off_shelf_sku_count: 0,
weekly_quote_count: 0,
brand_count: 0,
weekly_sku_count: 0,
all_spu_count: 0,
weekly_inquiry_count: 0,
all_quote_count: 0,
all_inquiry_count: 0
}
})
};
},
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'
});
}
})
mounted() {
this.getData();
this.getFrqRates();
this.getFrqStatInfo();
this.getSkuSearchRankList();
},
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;
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'
});
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 {
this.$message({
message: res.msg,
type: 'warning'
});
this.rankParam.type = 2;
this.placeholderText = '输入品牌,查看排名';
}
})
},
/**
* 型号,品牌切换
*/
switchChange() {
this.flag = !this.flag;
if (this.flag) {
this.rankParam.type = 1;
this.placeholderText = '输入型号,查看排名';
} else {
this.rankParam.type = 2;
this.placeholderText = '输入品牌,查看排名';
}
this.getSkuSearchRankList();
},
echartsChange(xAxis, series, text) {
var myChart = echarts.init(document.getElementById('echarts_box'));
var option = {
tooltip: {},
xAxis: {
data: xAxis
},
yAxis: {},
series: [
{
name: text,
type: 'bar',
data: series
this.getSkuSearchRankList();
},
echartsChange(xAxis, series, text) {
var myChart = echarts.init(document.getElementById('echarts_box'));
var option = {
tooltip: {},
xAxis: {
data: xAxis
},
yAxis: {},
series: [
{
name: text,
type: 'bar',
data: series
}
]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
},
getData() {
this.$http('get', "/api/statistics/index", {}).then(res => {
if (res.code === 0) {
this.data = res.data
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
})
}
},
getData() {
this.$http('get', "/api/statistics/index", {}).then(res => {
if (res.code === 0) {
this.data = res.data
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/index/index.min.css";
@import "../../assets/css/index/index.min.css";
</style>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<div class="tip">基本信息</div>
<div class="row verCenter">
<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">
<span class="icon iconfont fl"></span>
<div class="fl">更换头像</div>
......@@ -60,7 +60,7 @@
<!--子账号消息推送配置-->
<section class="role-auth">
<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>
</li>
</ul>
......@@ -69,184 +69,184 @@
<el-button type="primary" @click="submituser">编辑</el-button>
</el-row>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {NODE_ENVS} from "../../ajax";
import Tool from '../../tool'
import {Form, FormItem, Input, Message, Row, Tree, Upload} from 'element-ui'
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import { NODE_ENVS } from "../../ajax";
import Tool from '../../tool'
import { Form, FormItem, Input, Message, Row, Tree, Upload } from 'element-ui'
Vue.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row).use(Tree);
export default {
name: "message",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
filteredMessageIds: [],
upUrl: NODE_ENVS + '/api/user/setavatar',
fileData: {token: Tool.getCookie('token')},
messageMenu: [],//消息权限菜单
user_message_rule: [],
userinfo: {}
};
},
created() {
this.getUseInfo();
this.getMessageMenu();
},
methods: {
/**
* 获取当前用户的消息权限菜单
*/
getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = newMenuData;
Vue.prototype.$message = Message;
Vue.use(Form).use(FormItem).use(Input).use(Upload).use(Row).use(Tree);
export default {
name: "message",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
filteredMessageIds: [],
upUrl: NODE_ENVS + '/api/user/setavatar',
fileData: { token: Tool.getCookie('token') },
messageMenu: [],//消息权限菜单
user_message_rule: [],
userinfo: {}
};
},
created() {
this.getUseInfo();
this.getMessageMenu();
},
methods: {
/**
* 获取当前用户的消息权限菜单
*/
getMessageMenu() {
this.$http('GET', "/api/subAccount/getMessageMenu", {}).then(res => {
if (res.code === 0) {
let newMenuData = res.data.data.map(item => [item]);
this.messageMenu = 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);
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.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
});
this.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
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({
message: res.msg,
type: 'warning'
message: '设置成功',
type: 'success'
});
}
})
},
getUseInfo() {
this.$http('GET', "/api/user/getuserinfo").then(res => {
if (res.code === 0) {
this.userinfo = res.data;
this.userinfo.avatar = URL.createObjectURL(file.raw);
sessionStorage.removeItem('userInfox')
} 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) {
},
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: '更新成功',
type: 'success'
message: '上传头像图片只能是 JPG、PNG、GIF 格式!',
type: 'warning'
});
sessionStorage.removeItem('userInfox')
} else {
}
if (!isLt2M) {
this.$message({
message: res.msg,
message: '上传头像图片大小不能超过 5MB!',
type: 'warning'
});
}
})
},
handleAvatarSuccess(res, file) {
if (res.code === 0) {
this.$message({
message: '设置成功',
type: 'success'
});
this.userinfo.avatar = URL.createObjectURL(file.raw);
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) {
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)) {
this.user_message_rule.push(data.name);
}
}
}
}
},
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/info/message.min.css";
@import "../../assets/css/info/message.min.css";
.tip {
padding: 8px 16px;
background-color: #ecf8ff;
border-radius: 4px;
border-left: 5px solid #50bfff;
margin-bottom: 10px;
}
.tip {
padding: 8px 16px;
background-color: #ecf8ff;
border-radius: 4px;
border-left: 5px solid #50bfff;
margin-bottom: 10px;
}
</style>
\ No newline at end of file
......@@ -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 label="操作" width="250" align="center">
<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">
<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 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>
<el-button size="mini" type="danger" @click="confirmDelete(scope.row)">删除</el-button>
</template>
......@@ -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>
</div>
</div>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
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(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);
export default {
name: "subAccount",
data() {
return {
total: 0,
limit: 10,
page: 1,
tableData: [],
create_time_val: '',
update_time_val: '',
formParam: {
mobile: '',
name: '',
status: '',
create_type: '',
create_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'
});
export default {
name: "subAccount",
data() {
return {
total: 0,
limit: 10,
page: 1,
tableData: [],
create_time_val: '',
update_time_val: '',
formParam: {
mobile: '',
name: '',
status: '',
create_type: '',
create_time: '',
update_time: ''
}
})
};
},
/**
* 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(() => {
});
created() {
this.getData();
},
/**
* 删除
*/
confirmDelete(row) {
var html = `确定<span style="color: red;">删除</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:删除后,该子账号从系统清除,无法再登录芯链系统!</p>`;
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", {sbat_id: row.sbat_id, status: 0}).then(res => {
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.getData();
this.tableData = res.data.list || [];
this.total = res.data.total;
} else {
this.$message({
message: res.msg,
......@@ -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}`);
},
/**
* 分页条数切换
* @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();
});
},
/**
* 删除
*/
confirmDelete(row) {
var html = `确定<span style="color: red;">删除</span>当前子账号吗?<p style="font-size: 13px;color: #999;">PS:删除后,该子账号从系统清除,无法再登录芯链系统!</p>`;
this.$confirm(html, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.$http('POST', "/api/subAccount/changeStatus", { sbat_id: row.sbat_id, status: 0 }).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}`);
},
/**
* 分页条数切换
* @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();
}
},
/**
* 搜索提交
*/
onSubmit() {
this.page = 1;
this.getData();
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/info/subAccount.min.css";
@import "../../assets/css/info/subAccount.min.css";
</style>
\ No newline at end of file
......@@ -26,7 +26,7 @@
<!--子账号权限配置-->
<section class="role-auth">
<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>
</li>
</ul>
......@@ -35,7 +35,7 @@
<!--子账号消息推送配置-->
<section class="role-auth">
<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>
</li>
</ul>
......@@ -45,255 +45,255 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row>
</el-form>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
export default {
name: "subAccountAdd",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
rules: {
mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'},
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'}
],
name: [{
required: true,
message: '请输入名称',
trigger: 'blur'
}],
password_raw: [{
required: true,
message: '请输入密码',
trigger: 'blur'
}],
email: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']}
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
formParam: {
mobile: '',
name: '',
password_raw: '123456',
email: '',
user_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([]);
});
}
export default {
name: "subAccountAdd",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
rules: {
mobile: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur' }
],
name: [{
required: true,
message: '请输入名称',
trigger: 'blur'
}],
password_raw: [{
required: true,
message: '请输入密码',
trigger: 'blur'
}],
email: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change'] }
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
formParam: {
mobile: '',
name: '',
password_raw: '123456',
email: '',
user_rule: [],
user_message_rule: []
}
}
};
},
/**
* 取消
*/
canel() {
this.closetab('/subAccountadd')
created() {
this.getMenu();
this.getMessageMenu();
},
/**
* 关闭当前页面
* @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({
path: "/"
})
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 {
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({
path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
path: "/"
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
if (tab_arr[i - 1].query) {
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 {
const index = this.formParam.user_rule.indexOf(data.name);
if (index !== -1) {
this.formParam.user_rule.splice(index, 1);
}
if (data.children) {
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 {
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 checked
*/
handleCheckMsgChange(data, 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) {
},
/**
* 筛选子账号勾选的消息推送配置
* @param data
* @param checked
*/
handleCheckMsgChange(data, checked) {
if (checked) {
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;
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>
<style scoped>
@import "../../assets/css/info/subAccount.min.css";
@import "../../assets/css/info/subAccount.min.css";
</style>
\ No newline at end of file
......@@ -26,7 +26,7 @@
<!--子账号权限配置-->
<section class="role-auth">
<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>
</li>
</ul>
......@@ -35,7 +35,7 @@
<!--子账号消息推送配置-->
<section class="role-auth">
<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>
</li>
</ul>
......@@ -45,298 +45,298 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</el-row>
</el-form>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip).use(Row);
export default {
name: "subAccountEdit",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
rules: {
mobile: [
{required: true, message: '请输入手机号', trigger: 'blur'},
{pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur'}
],
name: [{
required: true,
message: '请输入名称',
trigger: 'blur'
}],
password_raw: [{
required: true,
message: '请输入密码',
trigger: 'blur'
}],
email: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change']}
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
filteredRuleIds: [],
filteredMessageIds: [],
ynat_id: this.$route.query.ynat_id,
formParam: {
sbat_id: this.$route.query.sbat_id,
mobile: '',
name: '',
password_raw: '',
email: '',
user_message_rule: [],
user_rule: []
}
};
},
created() {
this.getData();
this.getMenu();
this.getMessageMenu();
},
methods: {
/**
* 取消
*/
canel() {
this.closetab('/subAccountEdit')
export default {
name: "subAccountEdit",
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
rules: {
mobile: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ pattern: /^1\d{10}$/, message: '请输入有效的手机号', trigger: 'blur' }
],
name: [{
required: true,
message: '请输入名称',
trigger: 'blur'
}],
password_raw: [{
required: true,
message: '请输入密码',
trigger: 'blur'
}],
email: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
{ type: 'email', message: '请输入有效的邮箱地址', trigger: ['blur', 'change'] }
]
},
menuData: [],//权限菜单
messageMenu: [],//消息权限菜单
filteredRuleIds: [],
filteredMessageIds: [],
ynat_id: this.$route.query.ynat_id,
formParam: {
sbat_id: this.$route.query.sbat_id,
mobile: '',
name: '',
password_raw: '',
email: '',
user_message_rule: [],
user_rule: []
}
};
},
created() {
this.getData();
this.getMenu();
this.getMessageMenu();
},
/**
* 关闭当前页面
* @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({
path: "/"
})
} else {
if (tab_arr[i - 1].query) {
methods: {
/**
* 取消
*/
canel() {
this.closetab('/subAccountEdit')
},
/**
* 关闭当前页面
* @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({
path: tab_arr[i - 1].path,
query: tab_arr[i - 1].query
path: "/"
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
if (tab_arr[i - 1].query) {
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');
},
getData() {
this.$http('GET', "/api/subAccount/getSubAccountInfo", {sbat_id: this.formParam.sbat_id}).then(res => {
if (res.code === 0) {
//赋值子账号信息
this.formParam.mobile = res.data.mobile;
this.formParam.name = res.data.name;
this.formParam.password_raw = res.data.password_raw;
this.formParam.email = res.data.email;
} else {
this.$message({
message: res.msg,
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.$router.push('/subAccount');
},
getData() {
this.$http('GET', "/api/subAccount/getSubAccountInfo", { sbat_id: this.formParam.sbat_id }).then(res => {
if (res.code === 0) {
//赋值子账号信息
this.formParam.mobile = res.data.mobile;
this.formParam.name = res.data.name;
this.formParam.password_raw = res.data.password_raw;
this.formParam.email = res.data.email;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
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
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
//筛选出rule
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
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;
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);
})
},
/**
* 获取当前用户的消息权限菜单
*/
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;
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.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
result.push(child.name);
});
this.filteredMessageIds = filteredIds;
//筛选出rule-message
const result = [];
for (let obj of res.data.data) {
if (obj.checked) {
result.push(obj.name);
}
if (obj.children) {
for (let child of obj.children) {
if (child.checked) {
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) {
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) {
})
},
/**
* 筛选子账号勾选的权限配置
* @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)) {
this.formParam.user_rule.push(data.name);
}
}
}
}
},
/**
* 筛选子账号勾选的消息推送配置
* @param data
* @param checked
*/
handleCheckMsgChange(data, 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) {
},
/**
* 筛选子账号勾选的消息推送配置
* @param data
* @param checked
*/
handleCheckMsgChange(data, checked) {
if (checked) {
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;
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>
<style scoped>
@import "../../assets/css/info/subAccount.min.css";
@import "../../assets/css/info/subAccount.min.css";
</style>
\ No newline at end of file
......@@ -157,244 +157,244 @@
</div>
</div>
</div>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Tool from "@/tool";
import {NODE_ENVS} from "@/ajax";
import qs from 'qs';
import Vue from '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 Tool from "@/tool";
import { NODE_ENVS } from "@/ajax";
import qs from 'qs';
Vue.prototype.$message = Message
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(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.prototype.$message = Message
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(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 {
name: "inquireTransform",
data() {
return {
pickerOptions: {
shortcuts: [{
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近1年',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
picker.$emit('pick', [start, end]);
}
}]
},
total: 0,
page: 1,
limit: 10,
list: [],
tabPosition: 0,
update_time_val: '',
up_valid_time_val: '',
create_time_val: '',
bottom_info: {},
formInline: {
order_by: '',
asc: '',
goods_name: '',//型号
brand_name: '',//品牌
source: '',//来源
up_status: '',//状态
update_time: '',//更新时间
up_valid_time: '',//上架有效期
create_time: ''//创建时间
}
};
},
created() {
this.getData()
},
methods: {
getData() {
//格式化时间
if (this.update_time_val) {
this.formInline.update_time = this.update_time_val[0] + '~' + this.update_time_val[1];
} else {
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 = '';
}
export default {
name: "inquireTransform",
data() {
return {
pickerOptions: {
shortcuts: [{
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近1年',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
picker.$emit('pick', [start, end]);
}
}]
},
total: 0,
page: 1,
limit: 10,
list: [],
tabPosition: 0,
update_time_val: '',
up_valid_time_val: '',
create_time_val: '',
bottom_info: {},
formInline: {
order_by: '',
asc: '',
goods_name: '',//型号
brand_name: '',//品牌
source: '',//来源
up_status: '',//状态
update_time: '',//更新时间
up_valid_time: '',//上架有效期
create_time: ''//创建时间
}
};
},
created() {
this.getData()
},
methods: {
getData() {
//格式化时间
if (this.update_time_val) {
this.formInline.update_time = this.update_time_val[0] + '~' + this.update_time_val[1];
} else {
this.formInline.update_time = '';
}
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.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 = '';
}
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 || [];
this.bottom_info = res.data.bottom_info;
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 {
this.$message({
message: res.msg,
type: 'error'
});
this.formInline.create_time = '';
}
})
},
/**
* 导出
*/
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 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_);
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 || [];
this.bottom_info = res.data.bottom_info;
this.total = Number(res.data.total) || 0;
} 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';
}
})
},
/**
* 品牌
* @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]
})
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 {
cb([]);
}
cb(arr_);
} else {
cb([]);
}
}
})
},
/**
* 搜索
*/
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 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([]);
}
}
})
},
/**
* 搜索
*/
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();
}
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped lang="less">
.tetx-goods {
font-size: 12px;
margin-top: 20px;
flex-wrap: wrap;
.tetx-goods {
font-size: 12px;
margin-top: 20px;
flex-wrap: wrap;
span {
color: #F59A23;
font-weight: bold;
}
span {
color: #F59A23;
font-weight: bold;
}
em {
color: #FF0000;
font-weight: bold;
margin-right: 15px;
em {
color: #FF0000;
font-weight: bold;
margin-right: 15px;
}
}
}
</style>
\ No newline at end of file
......@@ -95,10 +95,10 @@
</el-table-column>
<el-table-column prop="i_status" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<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-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==-1" type="warning">已关闭</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 == 9" type="danger">已删除</el-tag>
<el-tag v-else-if="scope.row.i_status == -1" type="warning">已关闭</el-tag>
</template>
</el-table-column>
<el-table-column prop="buyer_info" label="猎芯采购员" width="100" :show-overflow-tooltip="true" align="center">
......@@ -117,7 +117,7 @@
<!--未成单-->
<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>
</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 @@
<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">
<template slot-scope="scope">
<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>
<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==7">待确认</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>
<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 == 7">待确认</el-tag>
<template v-if="scope.row.status_tips">
<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>
......@@ -200,16 +200,16 @@
</el-table-column>
<el-table-column prop="price_origin" label="价格" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span>
<span>{{ scope.row.price_origin | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="currency" label="币种" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<span v-if="scope.row.currency==1">人民币</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==4">欧元</span>
<span v-else-if="scope.row.currency==5">英磅</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 == 3">港币</span>
<span v-else-if="scope.row.currency == 4">欧元</span>
<span v-else-if="scope.row.currency == 5">英磅</span>
</template>
</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 @@
<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">
<template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span>
<span>{{ scope.row.price_other | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="120" :show-overflow-tooltip="true" align="center"></el-table-column>
......@@ -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="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">
<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">
<p class="row" v-for="item in scope.row.cn_ladder_price">
<span>{{ item.purchases }}+</span>
......@@ -260,7 +260,7 @@
</template>
</el-table-column>
<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">
<p class="row" v-for="item in scope.row.hk_ladder_price">
<span>{{ item.purchases }}+</span>
......@@ -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="goods_status" label="状态" width="150" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<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="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>
</template>
</el-table-column>
</el-table>
......@@ -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="status" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<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==3">已确认</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="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="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 == 3">已确认</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="danger" v-else-if="scope.row.status == 9">已删除</el-tag>
<el-tag type="warning" v-else-if="scope.row.status == -1">已撤销</el-tag>
</template>
</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">
<template slot-scope="scope">
<span v-if="scope.row.currency == 1">{{ scope.row.price_rmb|floatZero }}</span>
<span v-else>{{ scope.row.price_origin|floatZero }}</span>
<span v-if="scope.row.currency == 1">{{ scope.row.price_rmb | floatZero }}</span>
<span v-else>{{ scope.row.price_origin | floatZero }}</span>
</template>
</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 @@
<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">
<template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span>
<span>{{ scope.row.price_other | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="150" :show-overflow-tooltip="true" align="center"></el-table-column>
......@@ -345,7 +345,7 @@
</template>
</template>
</div>
<Menu/>
<Menu />
<!--弹窗日志-->
<el-dialog title="询价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisibleLog" width="1000px">
<el-table :data="logs" border max-height="600">
......@@ -386,12 +386,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -400,12 +400,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -414,12 +414,12 @@
</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>
<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])">确定</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>
</div>
</div>
</div>
......@@ -474,182 +474,232 @@
</section>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import VueClipboard from 'vue-clipboard2'
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 {NODE_ENVS} from "../../ajax";
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import VueClipboard from 'vue-clipboard2'
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 { NODE_ENVS } from "../../ajax";
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip);
Vue.use(VueClipboard);
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover).use(Tag).use(Tooltip);
Vue.use(VueClipboard);
export default {
name: "inquire",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
export default {
name: "inquire",
data() {
return {
pickerOptions: {
disabledDate(time) {
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,
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: ''//询价有效期
}
};
},
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 = '';
};
},
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 = '';
}
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.$http('get', "/api/inquiry/getlist", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = res.data.total;
this.ruleForm.quote_number = '';//清空报价数量
this.ruleForm.price_origin = '';//清空价格
this.ruleForm.currency = '';//清空币种
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
} else {
this.$message({
message: res.msg,
showClose: true,
message: '该订单不可报价',
type: 'warning'
});
return;
}
})
},
/**
* 报价新增
*/
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.$nextTick(() => {
this.$refs['ruleForm'].resetFields();
})
},
/**
* 匹配库存,历史报价新增
*/
addMatchingHistory(row) {
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.inquiry_sn = this.inquireObj.inquiry_sn;
this.ruleForm.inquiry_id = this.inquireObj.inquiry_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.price_origin = '';//清空价格
this.ruleForm.currency = '';//清空币种
......@@ -663,790 +713,740 @@ export default {
this.ruleForm.expire_time = '';//清空报价有效期
this.ruleForm.remark = '';//清空备注
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) {
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.price_origin = '';//清空价格
this.ruleForm.currency = '';//清空币种
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;
}
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) {
this.$message({
showClose: true,
message: '请勾选待报价,已报价',
type: 'warning'
});
return;
//询价单状态为“待报价,已报价
if (this.multipleSelection[0].i_status == -1) {
this.$message({
showClose: true,
message: '请勾选待报价,已报价',
type: 'warning'
});
return;
}
var inquiry_item_id = this.multipleSelection[0].id;
}
var inquiry_item_id = this.multipleSelection[0].id;
}
this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: inquiry_item_id
}).then(res => {
if (res.code === 0) {
if (res.data.quote_list.length > 0) {
//价单状态为“待确认,确认中” quote_status=7 待确认 quote_status=1 确认中
if (res.data.quote_list[0].quote_status == 1 || res.data.quote_list[0].quote_status == 7) {
var data = res.data.quote_list[0];
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: inquiry_item_id
}).then(res => {
if (res.code === 0) {
if (res.data.quote_list.length > 0) {
//价单状态为“待确认,确认中” quote_status=7 待确认 quote_status=1 确认中
if (res.data.quote_list[0].quote_status == 1 || res.data.quote_list[0].quote_status == 7) {
var data = res.data.quote_list[0];
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
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.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 = data.goods_name;//赋值型号
this.ruleForm.brand_name = data.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量
data.price_origin = this.float(data.price_origin);//价格转换
this.ruleForm.price_origin = data.price_origin;//价格
this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = data.batch;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = data.mpq;//最小包装数量
this.ruleForm.moq = data.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注
this.ruleForm.goods_name = data.goods_name;//赋值型号
this.ruleForm.brand_name = data.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量
data.price_origin = this.float(data.price_origin);//价格转换
this.ruleForm.price_origin = data.price_origin;//价格
this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = data.batch;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = data.mpq;//最小包装数量
this.ruleForm.moq = data.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注
//报价有效期
if (data.expire_time == '') {
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
//报价有效期
if (data.expire_time == '') {
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
} else {
this.ruleForm.expire_time = data.expire_time;
}
} 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) {
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
},
/**
* 编辑修改
*/
edit(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.inquiry_sn = row.inquiry_sn;
this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.quote_id = row.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.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;//起订量
data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注
row.price_other = this.float(row.price_other);//其他费用
this.ruleForm.price_other = row.price_other;//其他费用
this.ruleForm.remark = row.remark;//备注
//报价有效期
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
}
},
/**
* 编辑修改
*/
edit(row) {
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
this.ruleForm.inquiry_sn = row.inquiry_sn;
this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.quote_id = row.id; //编辑的时候需要
this.ruleForm.goods_name = row.goods_name;//赋值型号
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();
}
}
});
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 {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(err => {
this.$message({
message: res.msg,
message: '网络出现问题',
type: 'error'
});
}
}).catch(err => {
this.$message({
message: '网络出现问题',
type: 'error'
});
});
} else {
return false;
}
});
},
/**
* 行点击
* @param row
* @param column
* @param event
*/
rowClick(row, column, event) {
this.tabIndex = 0;
this.listVisible = true;
this.inquireObj = row;
this.currentQuotoChange();
},
/**
* tab切换
* @param index
*/
change(index) {
if (index == 0) {
} else {
return false;
}
});
},
/**
* 行点击
* @param row
* @param column
* @param event
*/
rowClick(row, column, event) {
this.tabIndex = 0;
this.listVisible = true;
this.inquireObj = row;
this.currentQuotoChange();
} else if (index == 1) {
this.matchingskuChange();
} else if (index == 2) {
this.historyChange();
}
},
/**
* 当前报价
*/
currentQuotoChange() {
this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: this.inquireObj.id
}).then(res => {
if (res.code === 0) {
this.currentQuotoDataList = res.data.quote_list || [];
} else {
this.$message({
message: res.msg,
type: 'warning'
});
},
/**
* tab切换
* @param index
*/
change(index) {
if (index == 0) {
this.currentQuotoChange();
} else if (index == 1) {
this.matchingskuChange();
} else if (index == 2) {
this.historyChange();
}
});
},
/**
* 匹配库存
*/
matchingskuChange() {
this.$http('GET', "/api/sku/list", {
"goods_name": this.inquireObj.goods_name,
"goods_status/condition": 1,
"goods_status": 1,
}).then(res => {
if (res.code === 0) {
this.matchingskuDataList = res.data.list || [];
//筛选匹配库存的所有goods_id
var ids = res.data.list.map(obj => {
return obj.goods_id;
})
if (ids.length > 0) {
this.checkBind(ids);
},
/**
* 当前报价
*/
currentQuotoChange() {
this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: this.inquireObj.id
}).then(res => {
if (res.code === 0) {
this.currentQuotoDataList = res.data.quote_list || [];
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
} 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,
inquiry_items_id: this.inquireObj.id
}).then(res => {
if (res.code === 0) {
this.historyDataList = res.data.list || [];
//筛选历史报价的id
var ids = res.data.list.map(obj => {
return obj.id;
})
if (ids.length > 0) {
this.checkBind(ids);
});
},
/**
* 匹配库存
*/
matchingskuChange() {
this.$http('GET', "/api/sku/list", {
"goods_name": this.inquireObj.goods_name,
"goods_status/condition": 1,
"goods_status": 1,
}).then(res => {
if (res.code === 0) {
this.matchingskuDataList = res.data.list || [];
//筛选匹配库存的所有goods_id
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'
});
}
} 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
}).then(res => {
if (res.code == 0) {
if (this.tabIndex == 1) {
this.matchingskuChange();
} else if (this.tabIndex == 2) {
this.historyChange();
});
},
/**
* 历史报价
*/
historyChange() {
this.$http('GET', "/api/quote/history", {
page: 1,
limit: 1000000,
goods_name: this.inquireObj.goods_name,
brand_name: this.inquireObj.brand_name,
inquiry_items_id: this.inquireObj.id
}).then(res => {
if (res.code === 0) {
this.historyDataList = res.data.list || [];
//筛选历史报价的id
var ids = res.data.list.map(obj => {
return obj.id;
})
if (ids.length > 0) {
this.checkBind(ids);
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
} 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) {
});
},
/**
* 库存关联报价
*/
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
}).then(res => {
if (res.code == 0) {
if (this.tabIndex == 1) {
this.matchingskuChange();
} else if (this.tabIndex == 2) {
this.historyChange();
}
} 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) {
//匹配库存
for (let i = 0; i < this.matchingskuDataList.length; i++) {
for (let j = 0; j < res.data.bind_ids.length; j++) {
if (this.matchingskuDataList[i].goods_id == res.data.bind_ids[j]) {
this.matchingskuDataList[i].is_bind = 1;
if (this.tabIndex == 1) {
//匹配库存
for (let i = 0; i < this.matchingskuDataList.length; i++) {
for (let j = 0; j < res.data.bind_ids.length; j++) {
if (this.matchingskuDataList[i].goods_id == res.data.bind_ids[j]) {
this.matchingskuDataList[i].is_bind = 1;
}
}
}
}
} else if (this.tabIndex == 2) {
//历史报价
for (let i = 0; i < this.historyDataList.length; i++) {
for (let j = 0; j < res.data.bind_ids.length; j++) {
if (this.historyDataList[i].id == res.data.bind_ids[j]) {
this.historyDataList[i].is_bind = 1;
} else if (this.tabIndex == 2) {
//历史报价
for (let i = 0; i < this.historyDataList.length; i++) {
for (let j = 0; j < res.data.bind_ids.length; j++) {
if (this.historyDataList[i].id == res.data.bind_ids[j]) {
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
* @returns {number}
*/
float(value) {
let num = Number(value)
if (num) {
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;
},
/**
* 前进年份
*/
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
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;
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))
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
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({
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();
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();
year = year.substring(year.length - 2);
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
let prev = year + period;
let next = year + val;
let prev = year + period;
let next = year + val;
this.ruleForm.batch = prev + '-' + next;
}
this.visible = false;
},
/**
* 税率切换
* @param val
*/
currentChange(val) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
} else {
this.ruleForm.tax_rate = '0%';
}
},
/**
* 搜索型号
* @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']
})
this.ruleForm.batch = prev + '-' + next;
}
this.visible = false;
},
/**
* 税率切换
* @param val
*/
currentChange(val) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
} else {
this.ruleForm.tax_rate = '0%';
}
},
/**
* 搜索型号
* @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]
})
})
},
/**
* 搜索品牌
* @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([]);
}
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 {
cb([]);
this.$message({
message: res.msg,
type: 'warning'
});
}
}
})
},
/**
* 重置
* @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 {
});
},
/**
* 查看日志
* @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({
message: res.msg,
showClose: true,
message: '请至少选择一条数据',
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++) {
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({
message: '请勾选待报价的数据',
type: 'warning'
message: '复制成功',
type: 'success'
});
}
},
/**
* 复制
* @param e
*/
onCopy(e) {
this.$message({
message: '复制成功',
type: 'success'
});
},
},
},
components: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/list/inquire.min.css";
@import "../../assets/css/list/inquire.min.css";
</style>
\ No newline at end of file
......@@ -5,27 +5,27 @@
<div class="input-box clr">
<div class="fl">
<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 class="fl">
<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 class="fl">
<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 class="fl">
<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 class="fl">
<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 class="fl">
<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>
<p class="text">
......@@ -49,26 +49,26 @@
<el-table-column prop="brand_name" label="报价品牌" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<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==3">已成单</span>
<span v-else-if="scope.row.status==4" class="f-red1">已关闭</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 == 3">已成单</span>
<span v-else-if="scope.row.status == 4" class="f-red1">已关闭</span>
</template>
</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="price_origin" label="价格" width="130" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span>
<span>{{ scope.row.price_origin | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="currency" label="币种" width="100">
<template slot-scope="scope">
<span v-if="scope.row.currency==1">人民币</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==4">欧元</span>
<span v-else-if="scope.row.currency==5">英磅</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 == 3">港币</span>
<span v-else-if="scope.row.currency == 4">欧元</span>
<span v-else-if="scope.row.currency == 5">英磅</span>
</template>
</el-table-column>
<el-table-column prop="tax_rate" label="税率" width="100"></el-table-column>
......@@ -78,7 +78,7 @@
<el-table-column prop="moq" label="起订量" width="100"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="100">
<template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span>
<span>{{ scope.row.price_other | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column>
......@@ -90,17 +90,16 @@
<div class="assistant">
<i class="ic"></i>
<ul class="tab row verCenter">
<li @click="tab(index)" class="boxsiz row rowCenter verCenter" :class="{'curr':active==index}"
v-for="(item,index) in textArr" :key="index">{{ item }}
<li @click="tab(index)" class="boxsiz row rowCenter verCenter" :class="{ 'curr': active == index }" v-for="(item, index) in textArr" :key="index">{{ item }}
</li>
</ul>
<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-column fixed label="操作" width="108" align="center">
<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>
</el-table-column>
<el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column>
......@@ -112,7 +111,7 @@
<el-table-column prop="stock" label="库存数量" width="150">
</el-table-column>
<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">
<el-tooltip placement="bottom" effect="light">
<div slot="content">
......@@ -129,7 +128,7 @@
</template>
</el-table-column>
<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">
<el-tooltip placement="bottom" effect="light">
<div slot="content">
......@@ -150,8 +149,8 @@
</el-table-column>
<el-table-column prop="goods_status" label="状态" width="150">
<template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span>
<span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status == 3">下架</span>
</template>
</el-table-column>
</el-table>
......@@ -162,26 +161,26 @@
<el-table :key="1" :data="historyList" border style="width: 100%">
<el-table-column fixed label="操作" width="108" align="center">
<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>
</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="status" label="状态" width="100">
<template slot-scope="scope">
<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==3">已确认</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==9" class="f-red1">已删除</span>
<span v-else-if="scope.row.status==-1" class="f-red1">已撤销</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 == 3">已确认</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 == 9" class="f-red1">已删除</span>
<span v-else-if="scope.row.status == -1" class="f-red1">已撤销</span>
</template>
</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">
<template slot-scope="scope">
<span>{{ scope.row.price_rmb|floatZero }}</span>
<span>{{ scope.row.price_rmb | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="currency" label="币种" width="100"></el-table-column>
......@@ -192,7 +191,7 @@
<el-table-column prop="moq" label="起订量" width="100"></el-table-column>
<el-table-column prop="price_other" label="其他费用" width="200">
<template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span>
<span>{{ scope.row.price_other | floatZero }}</span>
</template>
</el-table-column>
<el-table-column prop="expire_time" label="报价有效期" width="200"></el-table-column>
......@@ -202,8 +201,7 @@
<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>
<el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total"
@current-change="handleCurrentChange" :current-page="page"></el-pagination>
<el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</template>
</div>
</div>
......@@ -239,12 +237,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -253,12 +251,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -267,12 +265,12 @@
</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>
<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])">确定</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>
</div>
</div>
</div>
......@@ -324,631 +322,631 @@
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
</div>
</el-dialog>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {dateTimeFormate} from "../../filters/formate.js";
import Vue from 'vue';
import Menu from "@/components/menu.vue";
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.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.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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination)
export default {
name: "InquireDetail",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
}
},
currentDataId: 0,
active: 0,
total: 0,
limit: 10,
page: 1,
multipleSelection: [],
quote_info: {},
inquiry_info: {},
quote_list: [],
title: '新增',
isModify: false,
tableData: [],
historyList: [],
submitState: 0,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
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: '',
unit: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
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'
}]
},
dialogVisible: false,
brandList: [],
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();
export default {
name: "InquireDetail",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
}
},
currentDataId: 0,
active: 0,
total: 0,
limit: 10,
page: 1,
multipleSelection: [],
quote_info: {},
inquiry_info: {},
quote_list: [],
title: '新增',
isModify: false,
tableData: [],
historyList: [],
submitState: 0,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
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: '',
unit: '',
brand_name: '',
price_origin: '',
tax_rate: '13%',
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'
}]
},
dialogVisible: false,
brandList: [],
textArr: ['匹配库存', '历史报价']
};
},
//后退年份
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;
created() {
this.getData();
},
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
watch: {
$route(to, from) {
if (to.path == from.path) {
this.getData()
}
}
},
//批次关闭
clear(type, index) {
this.visible = false;
this.ruleForm.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.ruleForm.batch = val + '+';
} else if (type == 2) {
if (!val) {
this.$message({
message: '请选择第一周期',
type: 'warning'
});
return false;
methods: {
//前进年份
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
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;
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))
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
this.year = arr;
},
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) {
},
//批次关闭
clear(type, index) {
this.visible = false;
this.ruleForm.batch = '';
},
//批次确定
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
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();
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();
year = year.substring(year.length - 2);
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
let prev = year + period;
let next = year + val;
let prev = year + period;
let next = year + val;
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.ruleForm.batch = prev + '-' + next;
}
});
},
getSkulist() {
//匹配库存
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,
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
var arr_ = this.tableData, id_arr = [];
for (var i = 0; i < arr_.length; i++) {
id_arr.push(arr_[i].goods_id)
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.checkBind(id_arr.join(","))
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
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
});
},
getSkulist() {
//匹配库存
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,
}).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 {
if (this.active == 1) {
arr_[i].disabled = false
this.historyList = arr_
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
var arr_ = this.tableData, id_arr = [];
for (var i = 0; i < arr_.length; i++) {
id_arr.push(arr_[i].goods_id)
}
this.checkBind(id_arr.join(","))
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
},
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 {
arr_[i].disabled = false
this.tableData = arr_
if (this.active == 1) {
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);
}
})
}
},
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(","))
},
handleCurrentChange(val) {
this.page = val;
this.getHistory();
},
onSubmit() {
this.page = 1;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
tab(index) {
this.active = index;
this.page = 1;
this.$forceUpdate();
if (index == 1) {
this.getHistory();
} else {
this.$message(res.msg);
this.getSkulist();
}
})
},
handleCurrentChange(val) {
this.page = val;
this.getHistory();
},
onSubmit() {
this.page = 1;
this.getData();
},
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;
},
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%';
}
if (valid) {
this.submitState = 1;
let submitData_ = this.ruleForm;
if (submitData_.tax_rate == '13%') {
submitData_.tax_rate = 0.13
} else {
submitData_.tax_rate = 0
},
//提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (this.submitState) {
return;
}
this.$http('post', "/api/quote/save", submitData_).then(res => {
if (res.code == 0) {
this.getData();
//新增的时候不需要调用该接口
if (this.currentDataId != 0) {
this.$http('post', "/api/quote/pin", {
inquiry_items_id: this.ruleForm.inquiry_items_id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_id: this.currentDataId
}).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
if (this.active == 1) {
//历史报价
//this.getHistory()
if (valid) {
this.submitState = 1;
let submitData_ = this.ruleForm;
if (submitData_.tax_rate == '13%') {
submitData_.tax_rate = 0.13
} else {
submitData_.tax_rate = 0
}
this.$http('post', "/api/quote/save", submitData_).then(res => {
if (res.code == 0) {
this.getData();
//新增的时候不需要调用该接口
if (this.currentDataId != 0) {
this.$http('post', "/api/quote/pin", {
inquiry_items_id: this.ruleForm.inquiry_items_id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_id: this.currentDataId
}).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
if (this.active == 1) {
//历史报价
//this.getHistory()
} else {
//库存匹配
this.getSkulist()
}
this.dialogVisible = false
this.submitState = 0;
} else {
//库存匹配
this.getSkulist()
this.$message({
message: res.msg,
type: 'error'
});
this.submitState = 0;
}
this.dialogVisible = false
}).catch(err => {
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 {
this.$message({
message: res.msg,
type: 'error'
type: 'warning'
});
this.submitState = 0;
}
}).catch(err => {
this.submitState = 0;
});
})
} 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) {
this.$message({
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
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(() => {
if (this.multipleSelection[0].status == 1 || this.multipleSelection[0].status == 3) {
arr = this.multipleSelection.map(obj => {
return obj.id;
});
this.title = '修改';
})
},
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 = arr.join(",");
this.ruleForm.quote_id = '';
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 = '';
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.ruleForm.expire_time = res.data.quote_info.expire_time;
this.$message({
message: res.msg,
type: 'error'
});
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
} else {
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'])
}
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 {
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 {
this.ruleForm.expire_time = res.data.quote_info.expire_time;
}
} 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>
<style scoped>
@import "../../assets/css/list/inquireDetail.min.css";
@import "../../assets/css/list/inquireDetail.min.css";
</style>
\ No newline at end of file
......@@ -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="price_other" label="其他费用" width="100" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.price_other|floatZero }}</span>
<span>{{ scope.row.price_other | floatZero }}</span>
</template>
</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 @@
<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 />
<el-dialog title="报价管理日志" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px">
<el-table :data="logs" border max-height="600">
<el-table-column prop="create_time" label="时间" min-width="150" align="center"></el-table-column>
......@@ -164,12 +164,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -178,12 +178,12 @@
</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>
<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])">确定</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>
</div>
</div>
<div class="batch-box verCenter">
......@@ -192,12 +192,12 @@
</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>
<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])">确定</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>
</div>
</div>
</div>
......@@ -252,526 +252,494 @@
</section>
</template>
<script>
import Vue from '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 {NODE_ENVS} from "../../ajax";
import Tool from '../../tool'
import Vue from '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 { NODE_ENVS } from "../../ajax";
import Tool from '../../tool'
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Tag);
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Tag);
export default {
name: "quote",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < (Date.now() - (24 * 60 * 60 * 1000));
export default {
name: "quote",
data() {
return {
pickerOptions: {
disabledDate(time) {
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,
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: ""
}
};
},
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 = '';
};
},
created() {
let status = this.$route.query.status;
if (status) {
this.formParam.status = status;
}
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 || [];
this.total = res.data.total;
} else {
this.$message({
showClose: true,
message: res.msg,
type: 'warning'
});
}
})
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;
methods: {
getData() {
//格式化时间
if (this.quote_time_val) {
this.formParam.quote_time = this.quote_time_val[0] + '~' + this.quote_time_val[1];
} else {
this.$message({
message: res.msg,
type: 'warning'
});
this.formParam.quote_time = '';
}
});
},
/**
* 格式化数据
* @param value
* @returns {number}
*/
float(value) {
let num = Number(value)
if (num) {
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'
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 || [];
this.total = res.data.total;
} else {
this.$message({
showClose: true,
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'
});
}
});
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;
},
/**
* 格式化数据
* @param value
* @returns {number}
*/
float(value) {
let num = Number(value)
if (num) {
return num
} else {
return 0
}
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;
},
/**
* 前进年份
*/
prevChange() {
this.yearIndex = -1;
let starYear = this.year[0];
let arr = [];
for (let i = 0; i < 15; i++) {
arr.push(starYear - (i + 1))
}
if (!val) {
this.$message({
message: '请选择第二周期',
type: 'warning'
});
return false;
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;
}
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({
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();
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();
year = year.substring(year.length - 2);
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
let prev = year + period;
let next = year + val;
let prev = year + period;
let next = year + val;
this.ruleForm.batch = prev + '-' + next;
}
this.visible = false;
},
/**
* 税率切换
* @param val
*/
currentChange(val) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
} else {
this.ruleForm.tax_rate = '0%';
}
},
/**
*报价弹窗提交
* @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.dialogQuoteVisible = false;
that.getData();
}
});
this.ruleForm.batch = prev + '-' + next;
}
this.visible = false;
},
/**
* 税率切换
* @param val
*/
currentChange(val) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
} else {
this.ruleForm.tax_rate = '0%';
}
},
/**
*报价弹窗提交
* @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.dialogQuoteVisible = false;
that.getData();
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
}).catch(err => {
this.$message({
message: res.msg,
message: '网络出现问题',
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 false;
return;
}
});
},
/**
* 修改
*/
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) {
this.$message({
showClose: true,
message: '请勾选状态为确认中和待确认',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].quote_status != 1 && this.multipleSelection[0].quote_status != 7) {
this.$message({
showClose: true,
message: '请勾选状态为确认中和待确认',
type: 'warning'
});
return;
}
var row = this.multipleSelection[0];
this.title = '修改报价';
this.dialogQuoteVisible = true;
this.ruleForm.inquiry_sn = row.inquiry_sn;
this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.quote_id = row.quote_id; //编辑的时候需要
var row = this.multipleSelection[0];
this.title = '修改报价';
this.dialogQuoteVisible = true;
this.ruleForm.inquiry_sn = row.inquiry_sn;
this.ruleForm.inquiry_id = row.inquiry_id;
this.ruleForm.inquiry_items_id = row.inquiry_items_id;
this.ruleForm.quote_id = row.quote_id; //编辑的时候需要
this.ruleForm.goods_name = row.quote_goods_name;//赋值型号
this.ruleForm.brand_name = row.quote_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;//备注
this.ruleForm.goods_name = row.quote_goods_name;//赋值型号
this.ruleForm.brand_name = row.quote_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_val == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = '';
} else {
this.ruleForm.expire_time = row.expire_time_val;
}
//报价有效期
if (row.expire_time_val == '0000-00-00 00:00:00') {
this.ruleForm.expire_time = '';
} else {
this.ruleForm.expire_time = row.expire_time_val;
}
},
handleClick(row) {
this.getLogs(505, row.quote_id);
console.log(row);
},
//型号
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']
})
},
handleClick(row) {
this.getLogs(505, row.quote_id);
console.log(row);
},
//型号
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([]);
}
}
})
},
//品牌
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]
})
})
},
//品牌
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([]);
}
cb(arr_);
} else {
cb([]);
}
}
})
},
resetForm(formName) {
this.quote_time_val = '';
this.$refs[formName].resetFields();
},
onSubmit() {
this.page = 1;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
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]['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) {
})
},
resetForm(formName) {
this.quote_time_val = '';
this.$refs[formName].resetFields();
},
onSubmit() {
this.page = 1;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
exportChange() {
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
message: '关闭成功',
type: 'success'
showClose: true,
message: '请至少选择一条数据',
type: 'warning'
});
this.getData();
} else {
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: res.msg,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
})
},
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", {
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: '关闭成功',
type: 'success'
});
this.getData();
} else {
this.$message({
......@@ -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>
<style scoped>
@import "../../assets/css/list/quote.min.css";
@import "../../assets/css/list/quote.min.css";
</style>
\ No newline at end of file
......@@ -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>
</div>
</div>
<Menu/>
<Menu />
<el-dialog title="消息详情" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px">
<el-descriptions size="medium" border :column="2">
<el-descriptions-item>
......@@ -58,92 +58,90 @@
</section>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "news",
data() {
return {
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible: false,
msgDetail: {},
formParam: {
msg_type: '',
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'
});
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);
export default {
name: "news",
data() {
return {
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible: false,
msgDetail: {},
formParam: {
msg_type: '',
date: ''
}
})
},
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();
created() {
this.getData()
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
},
handleSizeChange(val) {
this.limit = val;
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() {
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) {
this.page = val;
this.getData();
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -24,7 +24,7 @@
<div class="notice-content" v-html="noticeMsg.content"></div>
<div class="enclosure row verCenter">
<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 class="notice-bottom row bothSide verCenter">
<span>发件人:深圳市猎芯科技有限公司</span>
......@@ -32,71 +32,69 @@
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "notice",
data() {
return {
noticeMsg: [],//系统公告消息
dialogNoticeVisible: false,
total: 0,
page: 1,
limit: 10,
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'
});
}
})
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);
export default {
name: "notice",
data() {
return {
noticeMsg: [],//系统公告消息
dialogNoticeVisible: false,
total: 0,
page: 1,
limit: 10,
list: []
};
},
view(row) {
this.dialogNoticeVisible = true;
this.noticeMsg = row;
created() {
this.getData()
},
handleSizeChange(val) {
this.limit = val;
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) {
this.dialogNoticeVisible = true;
this.noticeMsg = row;
},
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
}
},
handleCurrentChange(val) {
this.page = val;
this.getData();
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped lang="less">
</style>
\ No newline at end of file
<style scoped lang="less"></style>
\ No newline at end of file
......@@ -80,7 +80,7 @@
<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">
<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>
</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 @@
<el-table-column prop="shipping_status_val" label="发货状态" width="100" align="center">
<template slot-scope="scope">
<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="alink" 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>
</template>
</el-table-column>
<el-table-column prop="buyer_name" label="订单人员" width="100" align="center">
......@@ -158,237 +158,237 @@
</section>
</template>
<script>
import Vue from '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 Tool from "@/tool";
import {NODE_ENVS} from "@/ajax";
import qs from 'qs';
import Vue from '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 Tool from "@/tool";
import { NODE_ENVS } from "@/ajax";
import qs from 'qs';
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackGoods",
data() {
return {
total_amount: '',//订单总金额
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
logs: [],
create_time_val: '',
inquiry_item_id: '',//询价id
formInline: {
purchase_sn: '',
goods_name: '',
brand_name: '',
shipping_status: '',
status: '',
pay_status: '',
inquiry_sn: '',
quote_sn: '',
source_type: '',
currency: '',
create_time: ''
},
tableData: "",
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"
});
}
})
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackGoods",
data() {
return {
total_amount: '',//订单总金额
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
logs: [],
create_time_val: '',
inquiry_item_id: '',//询价id
formInline: {
purchase_sn: '',
goods_name: '',
brand_name: '',
shipping_status: '',
status: '',
pay_status: '',
inquiry_sn: '',
quote_sn: '',
source_type: '',
currency: '',
create_time: ''
},
tableData: "",
multipleSelection: []
};
},
handleCurrentChange(val) {
this.page = val;
created() {
this.formInline.inquiry_sn = this.$route.query.inquiry_sn || '';
this.formInline.quote_sn = this.$route.query.quote_sn || '';
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleSizeChange(val) {
this.limit = val;
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();
}
}
},
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;
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) {
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({
message: res.msg,
message: "请选择一条数据进行操作",
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 == '待提审') {
this.$message({
message: "待提审状态下不可生成",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].status_val == '待提审') {
this.$message({
message: "待提审状态下不可生成",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].status_val == '待审核') {
this.$message({
message: "待审核状态下不可生成",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].status_val == '待审核') {
this.$message({
message: "待审核状态下不可生成",
type: 'warning'
});
return false;
}
if (this.multipleSelection[0].shipping_status_val != '待发货' && this.multipleSelection[0].shipping_status_val != '部分发货') {
this.$message({
message: "请选择待发货/部分发货的数据进行操作",
type: 'warning'
});
return false;
}
this.$router.push({
path: "/OrderTrackPurAdd",
query: {
purchase_id: this.multipleSelection[0].purchase_id
if (this.multipleSelection[0].shipping_status_val != '待发货' && this.multipleSelection[0].shipping_status_val != '部分发货') {
this.$message({
message: "请选择待发货/部分发货的数据进行操作",
type: 'warning'
});
return false;
}
})
},
//型号
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']
})
this.$router.push({
path: "/OrderTrackPurAdd",
query: {
purchase_id: this.multipleSelection[0].purchase_id
}
})
},
//型号
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([]);
}
}
})
},
//品牌
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]
})
})
},
//品牌
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([]);
}
cb(arr_);
} else {
cb([]);
}
}
})
})
},
},
},
components: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped lang="less">
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
.tetx-goods {
font-size: 12px;
margin-top: 20px;
flex-wrap: wrap;
.tetx-goods {
font-size: 12px;
margin-top: 20px;
flex-wrap: wrap;
span {
color: #333;
font-weight: bold;
}
span {
color: #333;
font-weight: bold;
}
em {
color: #D9001B;
font-weight: bold;
margin-right: 15px;
em {
color: #D9001B;
font-weight: bold;
margin-right: 15px;
}
}
}
</style>
\ No newline at end of file
......@@ -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="status_val" label="状态" min-width="100" :show-overflow-tooltip="true" align="center">
<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="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="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="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-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>
......@@ -113,247 +113,247 @@
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackInvoice",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
dialogFileVisible: false,
logs: [],
create_time_val: '',//创建时间
qc_time_val: '',//质检时间
qcImage: [],//质检图片
qcAttachments: [],//质检附件
purchase_id: '',//记录从已采购订单页面跳转来的
stock_in_sn: '',//记录从退货单页面跳转来的
formInline: {
create_time: '',//创建时间
qc_time: '',//质检时间
stock_in_sn: "",
goods_name: '',
brand_name: '',
status: ''
},
tableData: "",
multipleSelection: [], //选择数据
};
},
created() {
this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_sn || '';
this.getData();
},
watch: {
$route(to, from) {
if (to.path == '/orderTrackInvoice') {
this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_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 = '';
}
if (this.qc_time_val) {
this.formInline.qc_time = this.qc_time_val[0] + '~' + this.qc_time_val[1];
} else {
this.formInline.qc_time = '';
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackInvoice",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
dialogFileVisible: false,
logs: [],
create_time_val: '',//创建时间
qc_time_val: '',//质检时间
qcImage: [],//质检图片
qcAttachments: [],//质检附件
purchase_id: '',//记录从已采购订单页面跳转来的
stock_in_sn: '',//记录从退货单页面跳转来的
formInline: {
create_time: '',//创建时间
qc_time: '',//质检时间
stock_in_sn: "",
goods_name: '',
brand_name: '',
status: ''
},
tableData: "",
multipleSelection: [], //选择数据
};
},
created() {
this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_sn || '';
this.getData();
},
watch: {
$route(to, from) {
if (to.path == '/orderTrackInvoice') {
this.purchase_id = this.$route.query.purchase_id || '';
this.formInline.stock_in_sn = this.$route.query.stock_in_sn || '';
this.getData();
}
}
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 => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
},
methods: {
getData() {
//格式化时间
if (this.create_time_val) {
this.formInline.create_time = this.create_time_val[0] + '~' + this.create_time_val[1];
} else {
this.$message(res.msg);
this.formInline.create_time = '';
}
})
},
/**
* 查看图片
*/
viewPic(qc_id, type) {
if (type == 2) {
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 (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 => {
if (res.code === 0) {
this.dialogVisible = true;
this.qcImage = res.data.list;
this.tableData = res.data.list || [];
this.total = Number(res.data.total) || 0;
} 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({
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(() => {
},
/**
* 查看图片
*/
viewPic(qc_id, type) {
if (type == 2) {
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) {
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({
message: '请选择待入库状态',
message: "请勾选数据进行操作",
type: 'warning'
});
return false;
}
} else {
this.$message({
message: '请选择创建人为自己的发货单',
type: 'warning'
});
}
},
//型号
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']
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'
});
}
})
}
cb(arr_);
}).catch(() => {
})
} else {
cb([]);
this.$message({
message: '请选择待入库状态',
type: 'warning'
});
}
} else {
this.$message({
message: '请选择创建人为自己的发货单',
type: 'warning'
});
}
})
},
//品牌
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]
})
},
//型号
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([]);
}
}
})
})
},
//品牌
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: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
.pic-list {
flex-wrap: wrap;
}
.pic-list {
flex-wrap: wrap;
}
.pic-list .el-image {
margin-right: 10px;
margin-bottom: 10px;
}
.pic-list .el-image {
margin-right: 10px;
margin-bottom: 10px;
}
</style>
\ No newline at end of file
......@@ -64,138 +64,138 @@
</section>
</template>
<script>
import Vue from '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 Vue from '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'
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(TableColumn).use(Table).use(Cascader).use(Autocomplete);
export default {
name: "orderTrackPurAdd",
data() {
return {
purOrderDetail: {},//基本信息,发货信息
purchase_uid: '',
multipleSelection: [],//选中的数据
pickerOption: {
disabledDate(time) {
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
})
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(TableColumn).use(Table).use(Cascader).use(Autocomplete);
export default {
name: "orderTrackPurAdd",
data() {
return {
purOrderDetail: {},//基本信息,发货信息
purchase_uid: '',
multipleSelection: [],//选中的数据
pickerOption: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
},
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: []
}
})
};
},
handleCurrentChange(val) {
this.page = val;
created() {
this.purchase_uid = this.$route.query.purchase_id;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
submit(formName) {
var self = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.multipleSelection.length <= 0) {
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({
message: "请选择发货信息",
message: res.msg,
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 {
})
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
submit(formName) {
var self = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.multipleSelection.length <= 0) {
this.$message({
message: res.msg,
type: 'error'
message: "请选择发货信息",
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 {
console.log('error submit!!');
return false;
}
});
}, 1000)
}
},
canel() {
document.querySelector('.item-boxs a.act .iconfont').click();
setTimeout(() => {
this.$router.push({
path: "/orderTrackGoods"
})
}, 1000)
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
</style>
\ No newline at end of file
......@@ -25,7 +25,7 @@
</el-select>
</el-form-item>
<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-button type="primary" @click="submit">查询</el-button>
......@@ -45,18 +45,18 @@
<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">
<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>
</el-table-column>
<el-table-column prop="status_val" label="状态" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<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==-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="success" v-else-if="scope.row.status==3">完成</el-tag>
<el-tag v-else-if="scope.row.status==4">待同步金蝶</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 == -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="success" v-else-if="scope.row.status == 3">完成</el-tag>
<el-tag v-else-if="scope.row.status == 4">待同步金蝶</el-tag>
</template>
</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 @@
<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 />
</section>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackInvoice",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
create_time_val: '',
formInline: {
create_time: '',
stock_in_sn: "",
goods_name: '',
brand_name: '',
status: ''
},
tableData: "",
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);
}
})
Vue.prototype.$message = Message;
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);
export default {
name: "orderTrackInvoice",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,
create_time_val: '',
formInline: {
create_time: '',
stock_in_sn: "",
goods_name: '',
brand_name: '',
status: ''
},
tableData: "",
multipleSelection: [] //选择数据
};
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
created() {
this.getData();
},
/**
* 分页条数切换
* @param val
*/
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.$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_);
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 {
cb([]);
this.$message(res.msg);
}
}
})
},
/**
* 搜索品牌
* @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]
})
})
},
/**
* 分页点击切换
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getData();
},
/**
* 分页条数切换
* @param val
*/
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.$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: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/goods/goods.min.css";
@import "../../assets/css/goods/goods.min.css";
</style>
\ No newline at end of file
......@@ -32,16 +32,16 @@
<el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column label="单号" min-width="20%" align="center">
<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>
</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">
<template slot-scope="scope">
<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==3" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.status==4" type="danger">失败</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 == 3" type="success">已处理</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">
<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>
......@@ -78,7 +78,7 @@
</template>
</p>
<p class="tt" style="font-size: 12px;">
上传的型号经由猎芯审核通过后,会展示在【猎芯网】进行售卖,并参与【猎芯询报价】系统自动推送询价<br/>
上传的型号经由猎芯审核通过后,会展示在【猎芯网】进行售卖,并参与【猎芯询报价】系统自动推送询价<br />
您此次上传的型号是否要对已在【猎芯网】展示的型号进行覆盖或是新增?
</p>
<p class="alink">覆盖:已在【猎芯网】进行展示的型号全部下架,展示现在新上传的型号;</p>
......@@ -91,183 +91,109 @@
<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-button type="primary" :loading="uploading">确 定</el-button>
<el-progress v-if="uploading" :percentage="progress"/>
<el-progress v-if="uploading" :percentage="progress" />
</el-upload>
</div>
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '../../tool'
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 Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '../../tool'
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'
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default {
name: "enter",
data() {
return {
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') || '',
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',
uploading: false,
progress: 0,
brand: [],
sku_user_name: '',
total: 0,
limit: 10,
page: 1,
downHref: "",
dialogVisible: false,
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
type: "1"//1覆盖 2新增
},
formParam: {
status: '',
date: ''
},
tableData: "",
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
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default {
name: "enter",
data() {
return {
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') || '',
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',
uploading: false,
progress: 0,
brand: [],
sku_user_name: '',
total: 0,
limit: 10,
page: 1,
downHref: "",
dialogVisible: false,
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
type: "1"//1覆盖 2新增
},
formParam: {
status: '',
date: ''
},
tableData: "",
multipleSelection: []
};
},
importChange() {
this.dialogVisible = true;
this.progress = 0;
this.uploading = false;
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'
});
watch: {
'formParam.date'(val) {
if (!val) {
this.formParam.date = []
}
})
},
resetForm(formName) {
this.formParam.date = '';
this.$refs[formName].resetFields();
}
},
/**
* 搜索提交
*/
submit() {
this.page = 1;
created() {
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() {
}
});
} else {
methods: {
handleBeforeUpload() {
this.uploading = true
},
handleProgress(event, file, fileList) {
this.progress = event.percent
},
importChange() {
this.dialogVisible = true;
this.progress = 0;
this.uploading = false;
this.$message({
message: file.msg,
type: 'warning'
});
}
},
/**
* 删除
*/
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 => {
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: '删除成功',
type: 'success'
message: res.msg,
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 {
this.$message({
message: res.msg,
......@@ -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) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
this.getData();
}
});
} else {
this.progress = 0;
this.uploading = false;
this.$message({
message: file.msg,
type: 'warning'
});
}
},
/**
* 删除
*/
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) {
this.multipleSelection = val || [];
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
@import "../../assets/css/store/enter.min.css";
@import "../../assets/css/store/enter.min.css";
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
.dialog-text .tt {
color: #333;
font-weight: bold;
margin-bottom: 16px;
}
.dialog-text .tt {
color: #333;
font-weight: bold;
margin-bottom: 16px;
}
.dialog-text .alink {
font-size: 12px;
}
.dialog-text .alink {
font-size: 12px;
}
</style>
\ No newline at end of file
......@@ -39,113 +39,113 @@
</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>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip } from 'element-ui'
import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
export default {
name: "goodDetail",
data() {
return {
total: 0,
limit: 10,
page: 1,
importDetail: {},
tableData: [],
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'
});
}
})
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
export default {
name: "goodDetail",
data() {
return {
total: 0,
limit: 10,
page: 1,
importDetail: {},
tableData: [],
multipleSelection: []
};
},
/**
* 导出文件
*/
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);
watch: {
$route(to, from) {
if (to.path == '/goodDetail') {
this.getData();
}
}
},
handleSizeChange(val) {
this.limit = val;
this.getList();
created() {
this.getData()
},
handleCurrentChange(val) {
this.page = val;
this.getList();
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'
});
}
})
},
/**
* 导出文件
*/
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: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/store/listDetail.min.css";
@import "../../assets/css/store/listDetail.min.css";
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-right: 10px;
display: block;
cursor: pointer;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-right: 10px;
display: block;
cursor: pointer;
}
</style>
\ No newline at end of file
......@@ -27,7 +27,7 @@
</el-select>
</el-form-item>
<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-button type="primary" @click="onSubmit">搜索</el-button>
......@@ -45,7 +45,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -72,7 +72,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -99,7 +99,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -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>
</div>
</div>
<Menu/>
<Menu />
<!--新增优势物料-->
<el-dialog title="新增优势物料" :close-on-click-modal="false" :visible.sync="addBestgoods.dialogVisible" width="1000px">
<div class="dialog-form bestGoodsList-dialog">
<table>
<tbody>
<tr>
<th align="left" width="150">
<em class="required">*</em>
<span>型号</span>
</th>
<th align="left" width="200">
<em class="required">*</em>
<span>品牌</span>
</th>
<th align="left" width="50">
<em class="required">*</em>
<span>起订量</span>
</th>
<th align="left">
<span>币种</span>
</th>
<th align="left" width="80">
<span>价格</span>
</th>
<th align="left" width="90">
<span>批次</span>
</th>
<th align="left" width="50">
<span>库存</span>
</th>
<th align="left" width="80">
<span>大陆交期</span>
</th>
<th align="left" width="80">
<span>香港交期</span>
</th>
<th align="left" width="50">
<span>操作</span>
</th>
</tr>
<tr v-for="(item,index) in addBestgoodsParam">
<td>
<el-autocomplete v-model="addBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td>
<td>
<el-autocomplete v-model="addBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td>
<td>
<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-select>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td>
<td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visible[index]">
<div class="row batch-layer">
<div class="batch-box verCenter">
<div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span>
<i class="el-icon-arrow-right" @click="nextChange"></i>
<tr>
<th align="left" width="150">
<em class="required">*</em>
<span>型号</span>
</th>
<th align="left" width="200">
<em class="required">*</em>
<span>品牌</span>
</th>
<th align="left" width="50">
<em class="required">*</em>
<span>起订量</span>
</th>
<th align="left">
<span>币种</span>
</th>
<th align="left" width="80">
<span>价格</span>
</th>
<th align="left" width="90">
<span>批次</span>
</th>
<th align="left" width="50">
<span>库存</span>
</th>
<th align="left" width="80">
<span>大陆交期</span>
</th>
<th align="left" width="80">
<span>香港交期</span>
</th>
<th align="left" width="50">
<span>操作</span>
</th>
</tr>
<tr v-for="(item, index) in addBestgoodsParam">
<td>
<el-autocomplete v-model="addBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td>
<td>
<el-autocomplete v-model="addBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td>
<td>
<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-select>
</td>
<td>
<el-input v-model="addBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td>
<td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visible[index]">
<div class="row batch-layer">
<div class="batch-box verCenter">
<div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span>
<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 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 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: 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 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 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(1, index)">清空</el-button>
<el-button size="mini" round @click="confirm(3, period[periodIndexTwo], index)">确定</el-button>
</div>
</div>
</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: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 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(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>
<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>
</table>
<i class="el-icon-plus add" @click="addRow">增加行</i>
......@@ -337,117 +337,117 @@
<div class="dialog-form bestGoodsList-dialog">
<table>
<tbody>
<tr>
<th align="left" width="150">
<em class="required">*</em>
<span>型号</span>
</th>
<th align="left" width="200">
<em class="required">*</em>
<span>品牌</span>
</th>
<th align="left" width="50">
<em class="required">*</em>
<span>起订量</span>
</th>
<th align="left">
<span>币种</span>
</th>
<th align="left" width="80">
<span>价格</span>
</th>
<th align="left" width="90">
<span>批次</span>
</th>
<th align="left" width="50">
<span>库存</span>
</th>
<th align="left" width="80">
<span>大陆交期</span>
</th>
<th align="left" width="80">
<span>香港交期</span>
</th>
</tr>
<tr v-for="(item,index) in updateBestgoodsParam">
<td>
<el-autocomplete v-model="updateBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td>
<td>
<el-autocomplete v-model="updateBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td>
<td>
<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-select>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td>
<td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visibleUpdate[index]">
<div class="row batch-layer">
<div class="batch-box verCenter">
<div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span>
<i class="el-icon-arrow-right" @click="nextChange"></i>
<tr>
<th align="left" width="150">
<em class="required">*</em>
<span>型号</span>
</th>
<th align="left" width="200">
<em class="required">*</em>
<span>品牌</span>
</th>
<th align="left" width="50">
<em class="required">*</em>
<span>起订量</span>
</th>
<th align="left">
<span>币种</span>
</th>
<th align="left" width="80">
<span>价格</span>
</th>
<th align="left" width="90">
<span>批次</span>
</th>
<th align="left" width="50">
<span>库存</span>
</th>
<th align="left" width="80">
<span>大陆交期</span>
</th>
<th align="left" width="80">
<span>香港交期</span>
</th>
</tr>
<tr v-for="(item, index) in updateBestgoodsParam">
<td>
<el-autocomplete v-model="updateBestgoodsParam[index].goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" placeholder="型号"></el-autocomplete>
</td>
<td>
<el-autocomplete v-model="updateBestgoodsParam[index].brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsyncBrand" placeholder="品牌"></el-autocomplete>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].start_order_number" placeholder="个"></el-input>
</td>
<td>
<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-select>
</td>
<td>
<el-input v-model="updateBestgoodsParam[index].price_origin" placeholder="0.00000"></el-input>
</td>
<td>
<el-popover placement="bottom" width="800" trigger="click" v-model="visibleUpdate[index]">
<div class="row batch-layer">
<div class="batch-box verCenter">
<div class="title row bothSide verCenter">
<i class="el-icon-arrow-left" @click="prevChange"></i>
<span>年份</span>
<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 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 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: 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 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 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>
<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: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 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>
<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>
</table>
</div>
......@@ -467,279 +467,330 @@
</section>
</template>
<script>
import Vue from '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 {NODE_ENVS} from "../../ajax";
import Tool from "@/tool";
import Vue from '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 { NODE_ENVS } from "../../ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Upload)
export default {
name: "goodslisr",
data() {
return {
logs: [],
total: 0,
page: 1,
limit: 10,
list: [],
uploadUrl: NODE_ENVS + '/api/bestgoods/importTemplate',
fileData: {
token: Tool.getCookie('token')
},
dialogVisible: false,
visible: [false],//批次弹窗
visibleUpdate: [false],//更新批次弹窗
readonly: true,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
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'],
options: [
{
value: '1',
label: '人民币'
}, {
value: '2',
label: '美元'
}, {
value: '3',
label: '港币'
}, {
value: '4',
label: '欧元'
}, {
value: '5',
label: '英磅'
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)
export default {
name: "goodslisr",
data() {
return {
logs: [],
total: 0,
page: 1,
limit: 10,
list: [],
uploadUrl: NODE_ENVS + '/api/bestgoods/importTemplate',
fileData: {
token: Tool.getCookie('token')
},
dialogVisible: false,
visible: [false],//批次弹窗
visibleUpdate: [false],//更新批次弹窗
readonly: true,
yearIndex: -1,//年份
periodIndex: -1,//第一周期
periodIndexTwo: -1,//第二周期
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'],
options: [
{
value: '1',
label: '人民币'
}, {
value: '2',
label: '美元'
}, {
value: '3',
label: '港币'
}, {
value: '4',
label: '欧元'
}, {
value: '5',
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: ''//创建时间
},
],
addBestgoods: {
dialogVisible: false, //新增优势物料
dialogVisibleUpdate: false //修改优势物料
multipleSelection: [],
skuStatistics: {},//统计数据
skuRankList: {}//sku的型号统计排名列表
};
},
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: "",
brand_name: "",
start_order_number: "",
currency: '1',
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: [],
skuStatistics: {},//统计数据
skuRankList: {}//sku的型号统计排名列表
};
},
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 {
//修改优势物料弹窗
updateBestgoods() {
if (this.multipleSelection.length != 1) {
this.$message({
message: res.msg,
message: '请支持修改一条数据',
type: 'warning'
});
return false;
}
})
},
/**
* 批量导入
* @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'
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//香港交期
});
}
},
/**
* 统计查看
* @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'
});
},
//增加行
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))
}
})
},
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;
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({
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 {
this.$message({
message: res.msg,
message: '请添加数据',
type: 'warning'
});
}
});
},
handleClick(row) {
this.getLogs(503, row.id);
console.log(row);
},
//新增优势物料弹窗
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) {
},
//修改优势物料提交
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.addBestgoodsParam[i].brand_name) {
if (!this.updateBestgoodsParam[i].brand_name) {
this.$message({
message: '请输入第' + (i + 1) + '行品牌',
type: 'warning'
});
return false;
}
if (!this.addBestgoodsParam[i].start_order_number) {
if (!this.updateBestgoodsParam[i].start_order_number) {
this.$message({
message: '请输入第' + (i + 1) + '行起订量',
type: 'warning'
......@@ -747,14 +798,15 @@ export default {
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) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.addBestgoods.dialogVisible = false;
self.addBestgoods.dialogVisibleUpdate = false;
self.getData();
}
});
......@@ -765,80 +817,66 @@ export default {
});
}
})
} else {
this.$message({
message: '请添加数据',
type: 'warning'
});
}
},
//修改优势物料提交
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) {
},
//删除
delBestgoods() {
var self = this;
if (this.multipleSelection.length <= 0) {
this.$message({
message: '请输入第' + (i + 1) + '行起订量',
message: '请勾选数据',
type: 'warning'
});
return false;
}
}
this.$http('post', "/api/bestgoods/updateBestgoods", {update_json: JSON.stringify(this.updateBestgoodsParam)}).then(res => {
if (res.code === 0) {
this.$message({
message: res.msg,
type: 'success',
duration: 2000,
onClose() {
self.addBestgoods.dialogVisibleUpdate = false;
self.getData();
var best_goods_ids = this.multipleSelection.map(obj => {
return obj.id;
})
this.$confirm('确认删除当前优势物料吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).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({
message: res.msg,
message: '请勾选数据',
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 => {
return obj.id;
})
var best_goods_ids = this.multipleSelection.map(obj => {
return obj.id;
})
this.$confirm('确认删除当前优势物料吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http('POST', "/api/bestgoods/delBestgoods", {best_goods_ids: best_goods_ids.join(',')}).then(res => {
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,
......@@ -855,295 +893,257 @@ export default {
});
}
})
}).catch(() => {
});
},
//是否参与询价
isJoinInquiryChange(type) {
var self = this;
if (this.multipleSelection.length <= 0) {
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;
},
//批次关闭
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', '');
}
var one = parseInt(this.period[this.periodIndex]);
var two = parseInt(val);
if (two <= one) {
},
//批次确定
confirm(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
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) {
this.$message({
message: '不可小于第一周期',
type: 'warning'
});
return false;
}
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
let prev = year + period;
let next = year + val;
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 prev = year + period;
let next = year + val;
this.$set(this.addBestgoodsParam[index], 'batch', prev + '-' + next);
}
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.$set(this.visible, index, false);
},
//批次更新
confirmUpdate(type, val, index) {
if (this.yearIndex == -1) {
this.$message({
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();
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();
year = year.substring(year.length - 2);
let year = this.year[this.yearIndex].toString();
year = year.substring(year.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
let period = this.period[this.periodIndex].toString();
period = period.substring(period.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
val = val.toString();
val = val.substring(val.length - 2);
let prev = year + period;
let next = year + val;
this.$set(this.updateBestgoodsParam[index], 'batch', prev + '-' + next);
}
this.$set(this.visibleUpdate, index, false);
},
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
}
},
/**
* 获取数据
*/
getData() {
//格式化时间
if (this.date_val) {
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;
let prev = year + period;
let next = year + val;
this.$set(this.updateBestgoodsParam[index], 'batch', prev + '-' + next);
}
this.$set(this.visibleUpdate, index, false);
},
tabChange(index, type) {
if (type == 1) {
this.yearIndex = index;
} else if (type == 2) {
this.periodIndex = index;
} else if (type == 3) {
this.periodIndexTwo = index;
}
},
/**
* 获取数据
*/
getData() {
//格式化时间
if (this.date_val) {
this.formParam.date = this.date_val[0] + '~' + this.date_val[1];
} else {
this.$message(res.msg);
this.formParam.date = '';
}
})
},
//型号
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_);
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 {
cb([]);
this.$message(res.msg);
}
}
})
},
//品牌
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]
})
})
},
//型号
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([]);
}
}
})
},
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();
})
},
//品牌
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([]);
}
}
})
},
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) {
this.page = val;
this.getData();
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
@import "../../assets/css/store/goodslist.min.css";
@import "../../assets/css/store/goodslist.min.css";
</style>
\ No newline at end of file
......@@ -45,7 +45,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -72,7 +72,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -99,7 +99,7 @@
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<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.brand_name }}</span>
<template v-if="index == 0">
......@@ -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="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">
<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">
<p class="row" v-for="item in scope.row.cn_ladder_price">
<span>{{ item.purchases }}+</span>
......@@ -179,7 +179,7 @@
</template>
</el-table-column>
<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">
<p class="row" v-for="item in scope.row.hk_ladder_price">
<span>{{ item.purchases }}+</span>
......@@ -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="goods_status" label="状态" width="100" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span>
<span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status == 3">下架</span>
</template>
</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 @@
<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">
<template slot-scope="scope">
<span v-if="scope.row.goods_status==1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status==3">下架</span>
<span v-if="scope.row.goods_status == 1" class="f-green">上架</span>
<span v-else-if="scope.row.goods_status == 3">下架</span>
</template>
</el-table-column>
<el-table-column prop="cp_time_temp" label="上架有效期" width="160" :show-overflow-tooltip="true"></el-table-column>
......@@ -377,7 +377,7 @@
<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">
<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>
</el-table-column>
<el-table-column prop="operator" label="操作人" min-width="150" align="center"></el-table-column>
......@@ -409,471 +409,369 @@
</div>
</el-dialog>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from '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 Util from "../../tool";
import Vue from '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 Util from "../../tool";
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover)
export default {
name: "list",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,//库存弹窗
dialogVisible2: false,//交期弹窗
dialogVisible3: false,//上架有效期
dialogVisible4: false,//修改价格
dialogVisibleLog: false,//日志
dialogVisibleLogDetail: false,//日志详情
logs: [],
downHref: "",
cp_time_val: '',
formParam: {
goods_name: '',
status: '',
brand_name: '',
date: '',
cp_time: '',
source: ''
},
multipleSelection: [],
selectData: [],
huoqidata: [],//修改交期数据
kucundata: [],//修改库存数据
cpdata: [],//上架有效期数据
priceData: [],//修改价格数据
message: {},
skuOriginalStepPriceData: [],
goods_id: '',
stock: 0,
tableData: [],
brandList: [],
disabled: false,
timer: null,
skuStatistics: {},//统计数据
skuRankList: {},//sku的型号统计排名列表
pickerOptions: {
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'
});
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover)
export default {
name: "list",
data() {
return {
total: 0,
limit: 10,
page: 1,
dialogVisible: false,//库存弹窗
dialogVisible2: false,//交期弹窗
dialogVisible3: false,//上架有效期
dialogVisible4: false,//修改价格
dialogVisibleLog: false,//日志
dialogVisibleLogDetail: false,//日志详情
logs: [],
downHref: "",
cp_time_val: '',
formParam: {
goods_name: '',
status: '',
brand_name: '',
date: '',
cp_time: '',
source: ''
},
multipleSelection: [],
selectData: [],
huoqidata: [],//修改交期数据
kucundata: [],//修改库存数据
cpdata: [],//上架有效期数据
priceData: [],//修改价格数据
message: {},
skuOriginalStepPriceData: [],
goods_id: '',
stock: 0,
tableData: [],
brandList: [],
disabled: false,
timer: null,
skuStatistics: {},//统计数据
skuRankList: {},//sku的型号统计排名列表
pickerOptions: {
disabledDate: this.disabledDate
}
});
};
},
/**
* 修改价格删除
* @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);
created() {
let status = this.$route.query.status;
if (status) {
this.formParam.status = status;
}
this.getData();
this.getSkuRankList();
},
/**
* 获取数据
*/
getData() {
//格式化时间
if (this.cp_time_val) {
this.formParam.cp_time = this.cp_time_val[0] + '~' + this.cp_time_val[1];
} else {
this.formParam.cp_time = '';
}
var params = Object.assign({},
{page: this.page},
{limit: this.limit},
this.formParam,
{action_time: this.formParam.date ? this.formParam.date[0] : ''},
{end_time: this.formParam.date ? this.formParam.date[1] : ''})
this.$http('get', "/api/sku/list", params).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'
});
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'
});
}
});
},
/**
* 修改价格删除
* @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的型号统计排名列表
*/
getSkuRankList() {
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
if (res.code === 0) {
this.skuRankList = res.data.rankList;
},
/**
* 获取数据
*/
getData() {
//格式化时间
if (this.cp_time_val) {
this.formParam.cp_time = this.cp_time_val[0] + '~' + this.cp_time_val[1];
} else {
this.$message({
message: res.msg,
type: 'warning'
});
this.formParam.cp_time = '';
}
})
},
/**
* 型号
* @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_);
var params = Object.assign({},
{ page: this.page },
{ limit: this.limit },
this.formParam,
{ action_time: this.formParam.date ? this.formParam.date[0] : '' },
{ end_time: this.formParam.date ? this.formParam.date[1] : '' })
this.$http('get', "/api/sku/list", params).then(res => {
if (res.code === 0) {
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
} else {
cb([]);
this.$message({
message: res.msg,
type: 'warning'
});
}
}
})
},
/**
* 品牌
* @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_);
})
},
/**
* 获取sku的型号统计排名列表
*/
getSkuRankList() {
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
if (res.code === 0) {
this.skuRankList = res.data.rankList;
} else {
cb([]);
this.$message({
message: res.msg,
type: 'warning'
});
}
}
})
},
downOut() {
if (this.disabled) {
this.$message({
message: '正在导出中,请不要重复点击',
type: 'warning'
});
return
}
this.$http('get', "/api/sku/exportSku", {
page: this.page,
limit: this.limit,
goods_name: this.formParam.goods_name,
status: this.formParam.status,
brand_id: this.formParam.brand_id,
brand_name: this.formParam.brand_name,
action_time: this.formParam.date[0],
end_time: this.formParam.date[1]
}).then(res => {
if (res.code == 0) {
this.disabled = true
this.$message({
message: '正在导出中,请耐心等待',
type: 'success'
});
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return
})
},
/**
* 型号
* @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([]);
}
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;
const newsUrl = this.$router.resolve(res.data);
window.open(res.data);
} else if (res.code == -1) {
//导出失败
}
})
},
/**
* 品牌
* @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([]);
}
}
})
},
downOut() {
if (this.disabled) {
this.$message({
message: '导出失败',
message: '正在导出中,请不要重复点击',
type: 'warning'
});
this.disabled = false;
return
}
}, error => {
this.$message('网络出现问题,请检查网络');
this.disabled = false
})
},
resetForm(formName) {
this.formParam.date = '';
this.cp_time_val = '';
this.$refs[formName].resetFields();
this.formParam.status = '';
},
onSubmit() {
this.page = 1;
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');
if (cp_time_day == -1) {
// “无限制”,则修改上架有效期默认为:2035-01-01
var maxDate = new Date('2035-01-01');
} else {
var maxDate = new Date(new Date().getTime() + cp_time_day * 24 * 60 * 60 * 1000);
}
this.$http('get', "/api/sku/exportSku", {
page: this.page,
limit: this.limit,
goods_name: this.formParam.goods_name,
status: this.formParam.status,
brand_id: this.formParam.brand_id,
brand_name: this.formParam.brand_name,
action_time: this.formParam.date[0],
end_time: this.formParam.date[1]
}).then(res => {
if (res.code == 0) {
this.disabled = true
this.$message({
message: '正在导出中,请耐心等待',
type: 'success'
});
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;
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 启用日期
},
/**
*
* @param date 时间类型
* @param type 是否加30天
* @returns {string}
*/
getTimes(date, type) {
if (type) {
},
resetForm(formName) {
this.formParam.date = '';
this.cp_time_val = '';
this.$refs[formName].resetFields();
this.formParam.status = '';
},
onSubmit() {
this.page = 1;
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');
if (cp_time_day == -1) {
// “无限制”,则修改上架有效期默认为:2035-01-01
var date = new Date('2035-01-01');
var maxDate = new Date('2035-01-01');
} 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);
} else {
var date = new Date(date);
}
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
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;
}
return date > maxDate || date < minDate; // 返回 true 禁用日期,返回 false 启用日期
},
/**
*
* @param date 时间类型
* @param type 是否加30天
* @returns {string}
*/
getTimes(date, type) {
if (type) {
this.selectData = JSON.parse(JSON.stringify(this.multipleSelection));
if (command == 1) {
//修改库存弹窗
this.dialogVisible = true;
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);
var cp_time_day = localStorage.getItem('cp_time_day');
if (cp_time_day == -1) {
// “无限制”,则修改上架有效期默认为:2035-01-01
var date = new Date('2035-01-01');
} else {
//上架有效期小于等于当前日期
this.selectData[i].cp_time = this.getTimes(new Date(), true);
var date = 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);
} else {
var date = new Date(date);
}
this.cpdata = this.selectData;
} else if (command == 4) {
//修改价格
this.dialogVisible4 = true;
this.priceData = this.selectData;
this.getSkuOriginalStepPrice(this.selectData[0].goods_id);
this.stock = this.selectData[0].stock;
}
},
/**
* 增加阶梯价
*/
addRow() {
if (this.skuOriginalStepPriceData.length >= 9) {
this.$message({
message: '已超过阶梯限制',
type: 'warning'
});
return false;
}
this.skuOriginalStepPriceData.push({
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 => {
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
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.$message({
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.dialogVisible4 = false;
this.getData();
}, 2000)
this.skuStatistics = res.data.statisticsData;
} else {
this.$message({
message: res.msg,
......@@ -881,161 +779,263 @@ export default {
});
}
})
}
},
/**
* 获取sku阶梯价格
*/
getSkuOriginalStepPrice(goods_id) {
this.$http('GET', "/api/sku/getSkuOriginalStepPrice", {goods_id: goods_id}).then(res => {
if (res.code == 0) {
this.skuOriginalStepPriceData = res.data.data;
this.goods_id = goods_id;
} else {
},
/**
* 修改按钮
* @param command
*/
handleCommand(command) {
if (this.multipleSelection.length == 0) {
this.$message({
message: res.msg,
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
})
},
/**
* 修改上架有效期
*/
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 {
// 修改价格时检查是否只选择了一条数据
if (command == 4 && this.multipleSelection.length > 1) {
this.$message({
message: res.msg,
message: '只能选择一条数据',
type: 'warning'
});
return;
}
})
},
/**
* 修改交期提交
*/
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.selectData = JSON.parse(JSON.stringify(this.multipleSelection));
if (command == 1) {
//修改库存弹窗
this.dialogVisible = true;
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 {
//上架有效期小于等于当前日期
this.selectData[i].cp_time = this.getTimes(new Date(), true);
}
}
this.cpdata = this.selectData;
} else if (command == 4) {
//修改价格
this.dialogVisible4 = true;
this.priceData = this.selectData;
this.getSkuOriginalStepPrice(this.selectData[0].goods_id);
this.stock = this.selectData[0].stock;
}
}
this.$http('post', "/api/sku/updateSku", arr_).then(res => {
if (res.code === 0) {
},
/**
* 增加阶梯价
*/
addRow() {
if (this.skuOriginalStepPriceData.length >= 9) {
this.$message({
message: '修改成功',
type: 'success'
message: '已超过阶梯限制',
type: 'warning'
});
this.getData()
this.dialogVisible = false
} else {
return false;
}
this.skuOriginalStepPriceData.push({
cost_price: '',
price_cn: '',
price_us: '',
purchases: ''
})
},
/**
* 修改阶梯价格
*/
updateSkuOriginalStepPrice() {
var isPurchasesValid = Util.isPurchasesValid(this.skuOriginalStepPriceData);
if (!isPurchasesValid) {
this.$message({
message: res.msg,
type: 'error'
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) {
this.$message({
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.dialogVisible4 = false;
this.getData();
}, 2000)
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
})
},
changeStatus(status) {
var time_arr = [];//过滤出上架有效期时间数组
var sku_ids = [];//过滤出sku_ids数组
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return;
}
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;
},
/**
* 获取sku阶梯价格
*/
getSkuOriginalStepPrice(goods_id) {
this.$http('GET', "/api/sku/getSkuOriginalStepPrice", { goods_id: goods_id }).then(res => {
if (res.code == 0) {
this.skuOriginalStepPriceData = res.data.data;
this.goods_id = goods_id;
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
});
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({
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'
if (status == 1) {
var time = new Date();//当前时间
time_arr = this.multipleSelection.map(obj => {
return obj.cp_time;
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
var times = time_arr.filter((item) => {
if (new Date(item) < time) {
return item;
}
});
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>
<style scoped>
@import "../../assets/css/store/list.min.css";
@import "../../assets/css/store/list.min.css";
</style>
\ No newline at end of file
......@@ -27,10 +27,10 @@
<el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope">
<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==3" type="success">审核通过</el-tag>
<el-tag v-else-if="scope.row.status==4" type="warning">审核未通过</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 == 3" type="success">审核通过</el-tag>
<el-tag v-else-if="scope.row.status == 4" type="warning">审核未通过</el-tag>
</template>
</el-table-column>
<el-table-column prop="error_msg" label="失败原因" width="200" :show-overflow-tooltip="true"></el-table-column>
......@@ -46,226 +46,226 @@
</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>
</div>
<Menu/>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip,Upload} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "ListDetail",
data() {
return {
detailInfo: "",
itemListObj: {},
total: 0,
limit: 10,
page: 1,
tableData: "",
maxPrice: [],
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
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);
}
})
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "ListDetail",
data() {
return {
detailInfo: "",
itemListObj: {},
total: 0,
limit: 10,
page: 1,
tableData: "",
maxPrice: [],
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
type: 2//1覆盖 2新增
},
};
},
/**
* 获取列表数据
*/
getList() {
this.$http('get', "/api/uploadSku/itemList", {
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);
watch: {
$route(to, from) {
if (to.path == from.path) {
this.getInfo()
this.getList()
}
})
},
/**
* 导入
*/
uploadChange(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.$message({
message: file.msg,
type: 'error'
});
}
},
/**
* 导出文件
*/
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);
created() {
this.getInfo()
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) {
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);
}
})
},
/**
* 获取列表数据
*/
getList() {
this.$http('get', "/api/uploadSku/itemList", {
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: '操作成功',
message: '导入成功',
type: 'success',
onClose() {
self.getList()
}
});
} else {
this.$message({
message: res.msg,
message: file.msg,
type: 'error'
});
}
})
},
handleSizeChange(val) {
this.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.page = val;
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) {
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: {
Menu
}
};
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/store/listDetail.min.css";
@import "../../assets/css/store/listDetail.min.css";
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
cursor: pointer;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
cursor: pointer;
}
</style>
\ No newline at end of file
......@@ -31,28 +31,28 @@
watch: {},
created() {
this.getData();
var code_=this.$route.query.err_type
if(code_==1){
this.text='微信授权失败'
}else if(code_==2){
this.text='芯链token校验失败'
var code_ = this.$route.query.err_type
if (code_ == 1) {
this.text = '微信授权失败'
} else if (code_ == 2) {
this.text = '芯链token校验失败'
}
else if(code_==3){
this.text='请求access_token失败'
else if (code_ == 3) {
this.text = '请求access_token失败'
}
else if(code_==4){
this.text='open_id已绑定其他账号,不能重复绑定'
else if (code_ == 4) {
this.text = 'open_id已绑定其他账号,不能重复绑定'
}
else if(code_==5){
this.text='更新绑定关系失败'
else if (code_ == 5) {
this.text = '更新绑定关系失败'
}
else if(code_==6){
this.text='添加绑定关系失败'
else if (code_ == 6) {
this.text = '添加绑定关系失败'
}
else if(code_==7){
this.text='获取微信信息失败'
else if (code_ == 7) {
this.text = '获取微信信息失败'
}
},
computed: {},
methods: {
......@@ -60,7 +60,7 @@
this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) {
this.hrefs = res.data.wx_login_url;
}
}
})
}
......
<template>
<div class="user-box">
<div class="head-box">
<div class="head-wrap lbBox">
<a class="logo lineBlock va-m" href="https://www.ichunt.com/">
<img src="../../assets/images/logo.png" alt=""/>
</a>
<span class="line lineBlock va-m"></span>
<div class="text lineBlock va-m">
<p class="t1">猎芯芯链商家</p>
<p class="t2">连接终端需求</p>
</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>
<div class="user-box">
<div class="head-box">
<div class="head-wrap lbBox">
<a class="logo lineBlock va-m" href="https://www.ichunt.com/">
<img src="../../assets/images/logo.png" alt="" />
</a>
<span class="line lineBlock va-m"></span>
<div class="text lineBlock va-m">
<p class="t1">猎芯芯链商家</p>
<p class="t2">连接终端需求</p>
</div>
<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>
</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>
</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>
<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>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import {Loading, Message} from 'element-ui';
import Util from "../../tool";
import Vue from 'vue';
import { Loading, Message } from 'element-ui';
import Util from "../../tool";
Vue.prototype.$message = Message
export default {
name: "index",
data() {
return {
pwdFlag: true,
active: false,
errror_text: '',
status1: false,
status2: false,
loading: true,
imgSrc: '',
errorClass1: false,
errorClass2: false,
errorClass3: false,
cp: false,
form: {
mobile: '',
password: '',
captcha: '',
captcha_key: ''
}
};
},
watch: {
form: {
deep: true,
handler: function (newV, oldV) {
let obj = newV;
let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
Vue.prototype.$message = Message
export default {
name: "index",
data() {
return {
pwdFlag: true,
active: false,
errror_text: '',
status1: false,
status2: false,
loading: true,
imgSrc: '',
errorClass1: false,
errorClass2: false,
errorClass3: false,
cp: false,
form: {
mobile: '',
password: '',
captcha: '',
captcha_key: ''
}
};
},
watch: {
form: {
deep: true,
handler: function (newV, oldV) {
let obj = newV;
let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!this.cp) {
if (obj.captcha || obj.password || obj.mobile) {
this.errror_text = '';
this.errorClass1 = false;
this.errorClass2 = false;
this.errorClass3 = false;
}
} else {
this.cp = false;
}
if (!this.cp) {
if (obj.captcha || obj.password || obj.mobile) {
this.errror_text = '';
this.errorClass1 = false;
this.errorClass2 = false;
this.errorClass3 = false;
}
} else {
this.cp = false;
}
if (myreg.test(obj.mobile)) {
this.active = true;
} else {
this.active = false;
}
}
}
},
created() {
this.updateCp();
},
computed: {},
methods: {
updateCp() {
this.$http('get', "/auth/cp").then(res => {
if (res.code === 0) {
this.imgSrc = res.data.url.img;
this.form.captcha_key = res.data.url.key;
}
}).catch(err => {
console.log(err.message);
})
},
changePwd: function () {
this.pwdFlag = !this.pwdFlag;
},
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}$/;
if (!this.form.mobile) {
this.errror_text = '请输入手机号';
this.errorClass1 = true;
return false;
}
if (myreg.test(obj.mobile)) {
this.active = true;
} else {
this.active = false;
}
}
}
},
created() {
this.updateCp();
},
computed: {},
methods: {
updateCp() {
this.$http('get', "/auth/cp").then(res => {
if (res.code === 0) {
this.imgSrc = res.data.url.img;
this.form.captcha_key = res.data.url.key;
}
}).catch(err => {
console.log(err.message);
})
},
changePwd: function () {
this.pwdFlag = !this.pwdFlag;
},
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}$/;
if (!this.form.mobile) {
this.errror_text = '请输入手机号';
this.errorClass1 = true;
return false;
}
if (!myreg.test(this.form.mobile)) {
this.errror_text = '请输入正确的手机号';
this.errorClass1 = true;
return false;
}
if (!myreg.test(this.form.mobile)) {
this.errror_text = '请输入正确的手机号';
this.errorClass1 = true;
return false;
}
if (!this.form.password) {
this.errror_text = '请输入登录密码';
this.errorClass2 = true;
return false;
}
if (!this.form.password) {
this.errror_text = '请输入登录密码';
this.errorClass2 = true;
return false;
}
if (!this.form.captcha) {
this.errror_text = '请输入验证码';
this.errorClass3 = true;
return false;
}
if (!this.form.captcha) {
this.errror_text = '请输入验证码';
this.errorClass3 = true;
return false;
}
let loadingInstance = Loading.service({
background: 'rgba(0, 0, 0, 0)'
});
let loadingInstance = Loading.service({
background: 'rgba(0, 0, 0, 0)'
});
this.$http('post', "/auth/login", {
mobile: this.form.mobile,
password: this.form.password,
captcha: this.form.captcha,
captcha_key: this.form.captcha_key
}).then(res => {
loadingInstance.close();
if (res.code === 0) {
sessionStorage.removeItem('tabs');
localStorage.removeItem('supplier_id');
localStorage.removeItem('cp_time_day');
localStorage.removeItem('futures_cp_time_day');
this.$http('post', "/auth/login", {
mobile: this.form.mobile,
password: this.form.password,
captcha: this.form.captcha,
captcha_key: this.form.captcha_key
}).then(res => {
loadingInstance.close();
if (res.code === 0) {
sessionStorage.removeItem('tabs');
localStorage.removeItem('supplier_id');
localStorage.removeItem('cp_time_day');
localStorage.removeItem('futures_cp_time_day');
localStorage.setItem('supplier_id', res.data.supplier_id);
localStorage.setItem('cp_time_day', res.data.cp_time_day);
localStorage.setItem('futures_cp_time_day', res.data.futures_cp_time_day);
localStorage.setItem('supplier_id', res.data.supplier_id);
localStorage.setItem('cp_time_day', res.data.cp_time_day);
localStorage.setItem('futures_cp_time_day', res.data.futures_cp_time_day);
Util.setCookie("token", res.data.api_token, 1);
//强制要求微信绑定
if (!res.data.is_bind_wechat) {
this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) {
window.location.href = res.data.wx_login_url;
} else {
this.$message({
message: res.msg,
type: 'warning'
Util.setCookie("token", res.data.api_token, 1);
//强制要求微信绑定
if (!res.data.is_bind_wechat) {
this.$http('get', "/api/login/getwxqrcode").then(res => {
if (res.code === 0) {
window.location.href = res.data.wx_login_url;
} else {
this.$message({
message: res.msg,
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>
<style scoped>
@import "../../assets/css/login/index.min.css";
@import "../../assets/css/login/index.min.css";
#app ::v-deep {
padding: 0 !important;
}
#app ::v-deep {
padding: 0 !important;
}
</style>
\ No newline at end of file
<template>
<div class="notfound">
<img src="../../assets/images/notfound.png" alt="">
</div>
<div class="notfound">
<img src="../../assets/images/notfound.png" alt="">
</div>
</template>
<script>
export default {
name: "notfound",
data() {
......@@ -14,14 +14,14 @@
};
</script>
<style>
.notfound {
width: 100%;
margin: 0 auto;
text-align: center;
}
.notfound {
width: 100%;
margin: 0 auto;
text-align: center;
}
.notfound img {
display: block;
margin: 0 auto;
}
.notfound img {
display: block;
margin: 0 auto;
}
</style>
\ No newline at end of file
......@@ -56,121 +56,119 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "allPayableBills",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
goods_name: '',
type: '',
status: '',
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'
});
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "allPayableBills",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
goods_name: '',
type: '',
status: '',
create_time: []
}
})
};
},
/**
* 型号监听
* @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 {
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'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
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();
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;
}
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -23,136 +23,134 @@
</div>
</template>
<script>
import Vue from '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 {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
import Vue from '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 { NODE_ENVS } from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "fileManagement",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
bill_sn: '',
status: '',
goods_name: '',
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'
});
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "fileManagement",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
bill_sn: '',
status: '',
goods_name: '',
create_time: []
}
})
};
},
/**
* 型号监听
* @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 {
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'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
return;
}
}).catch(() => {
cb([]);
});
},
/**
* 操作按钮监听
*/
handleCommand(command) {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
if (!bill_id) {
this.$message({
message: '请选择账单',
type: 'warning'
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([]);
});
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();
},
/**
* 重置表单
* @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
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -41,7 +41,7 @@
<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">
<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>
</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 @@
</div>
</template>
<script>
import Vue from '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 {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
import Vue from '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 { NODE_ENVS } from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "reconciledBill",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
bill_sn: '',
status: '',
goods_name: '',
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'
});
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "reconciledBill",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
bill_sn: '',
status: '',
goods_name: '',
create_time: []
}
})
};
},
/**
* 型号监听
* @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 {
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'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
return;
}
}).catch(() => {
cb([]);
});
},
/**
* 操作按钮监听
*/
handleCommand(command) {
let bill_id = this.multipleSelection.map(item => item.bill_id).join(',');
if (!bill_id) {
this.$message({
message: '请选择账单',
type: 'warning'
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([]);
});
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();
},
/**
* 重置表单
* @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
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -41,113 +41,111 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "reconciledBillDetail",
data() {
return {
multipleSelection: [],
recall_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
list: [],
bill_id: '',
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);
}
})
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "reconciledBillDetail",
data() {
return {
multipleSelection: [],
recall_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
list: [],
bill_id: '',
bill_sn: ''
};
},
/**
* 型号监听
* @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 {
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);
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
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();
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;
}
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -36,117 +36,115 @@
<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="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>
<Menu ref="menu"></Menu>
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "batchRecall",
data() {
return {
total: 0,
page: 1,
limit: 10,
list: [],
recall_upload_sn: '',//上传编号
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 || '上传失败');
}
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "batchRecall",
data() {
return {
total: 0,
page: 1,
limit: 10,
list: [],
recall_upload_sn: '',//上传编号
is_flag: false
};
},
/**
* 上传失败
* @param err
* @param file
* @param fileList
*/
handleUploadError(err, file, fileList) {
this.$message.error('上传失败,请重试');
created() {
},
/**
* 批量召回-提交
*/
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 => {
methods: {
/**
* 上传成功
* @param res
* @param file
* @param fileList
*/
handleUploadSuccess(res, file, fileList) {
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);
}
});
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 || '操作失败');
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: () => {
},
/**
* 上传失败
* @param err
* @param file
* @param fileList
*/
handleUploadError(err, file, fileList) {
this.$message.error('上传失败,请重试');
},
/**
* 批量召回-提交
*/
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 {
this.$message.error(res.msg || '操作失败');
}
})
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
}
},
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -46,7 +46,7 @@
<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">
<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>
</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 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentApplication",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible_1: false,
dialogVisible_2: false,
dialogVisible_3: false,
dialogVisible_4: false,
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: {
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentApplication",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible_1: false,
dialogVisible_2: false,
dialogVisible_3: false,
dialogVisible_4: false,
remark: '',
consignment_ids: '',
shipping_id: '',
shipping_no: ''
}
};
},
created() {
this.getData()
},
methods: {
getData() {
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 || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
/**
* 型号监听
* @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([]);
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: '',
shipping_id: '',
shipping_no: ''
}
}).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();
created() {
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;
methods: {
getData() {
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 || [];
this.total = Number(res.data.total) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
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;
})
},
/**
* 型号监听
* @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([]);
}
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;
}).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;
},
/**
* 弹窗事件
*/
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('只能关闭进行中且部分入库的寄售申请单');
return;
});
},
/**
* 提交审核
*/
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 || '操作失败');
}
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;
})
},
/**
* 作废
*/
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 || '操作失败');
}
// 填写物流:只能为待提审、待审核、进行中状态,且入库作为为为待入库或部分入库状态的数据填写物流
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;
})
},
/**
* 关单
*/
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 || '操作失败');
}
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;
}
});
},
/**
* 提交审核
*/
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
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -48,124 +48,122 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentApplicationDetail",
data() {
return {
multipleSelection: [],
consignment_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
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();
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentApplicationDetail",
data() {
return {
multipleSelection: [],
consignment_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
list: []
};
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
created() {
this.consignment_id = this.$route.query.consignment_id;
this.getData()
},
/**
* 删除寄售明细
*/
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 => {
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.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.getData();
}
});
this.detailData = res.data;
this.list = res.data.items.list;
this.total = res.data.items.total || 0;
} 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);
},
/**
* 列表分页条数筛选监听
* @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;
},
/**
* 删除寄售明细
*/
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>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -45,90 +45,88 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentContract",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
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'
});
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentContract",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
status: ''
}
})
},
/**
* 搜索
*/
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();
created() {
this.getData()
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
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();
},
/**
* 列表分页条数筛选监听
* @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;
}
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -35,16 +35,16 @@
<el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column label="单号" min-width="20%" align="center">
<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>
</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">
<template slot-scope="scope">
<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==3" type="success">已处理</el-tag>
<el-tag v-else-if="scope.row.status==4" type="danger">失败</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 == 3" type="success">已处理</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">
<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>
......@@ -77,7 +77,7 @@
<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-button type="primary" :loading="uploading">确 定</el-button>
<el-progress v-if="uploading" :percentage="progress"/>
<el-progress v-if="uploading" :percentage="progress" />
</el-upload>
</div>
</div>
......@@ -85,195 +85,195 @@
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '@/tool'
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 Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '@/tool'
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'
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default {
name: "consignmentImport",
data() {
return {
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') || '',//现货最高天数
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数
uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口
fileData: {
source: 12,
token: Tool.getCookie('token'),
type: "2"//1覆盖 2新增
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Upload).use(Radio).use(Progress);
export default {
name: "consignmentImport",
data() {
return {
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') || '',//现货最高天数
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数
uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口
fileData: {
source: 12,
token: Tool.getCookie('token'),
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: [],
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;
/**
* 导入
*/
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.getData();
this.$message({
message: '导入成功',
type: 'success'
});
} else {
// 上传失败重置状态
this.progress = 0;
this.uploading = false;
this.$message({
message: res.msg,
type: 'error'
message: file.msg,
type: 'warning'
});
}
})
},
/**
* 导入
*/
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;
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
this.$message({
message: '导入成功',
type: 'success'
});
} else {
// 上传失败重置状态
},
/**
* 重置表单
* @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;
this.$message({
message: file.msg,
type: 'warning'
});
if (this.$refs.upload) {
this.$refs.upload.clearFiles();
}
}
},
/**
* 搜索
*/
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
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
.downTemplate {
width: 68px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
}
.dialog-text .tt {
color: #333;
font-weight: bold;
margin-bottom: 16px;
}
.dialog-text .tt {
color: #333;
font-weight: bold;
margin-bottom: 16px;
}
.dialog-text .alink {
font-size: 12px;
}
.dialog-text .alink {
font-size: 12px;
}
</style>
\ No newline at end of file
......@@ -25,10 +25,10 @@
<el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope">
<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==3" type="success">上传成功</el-tag>
<el-tag v-else-if="scope.row.status==4" type="warning">审核未通过</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 == 3" type="success">上传成功</el-tag>
<el-tag v-else-if="scope.row.status == 4" type="warning">审核未通过</el-tag>
</template>
</el-table-column>
<el-table-column prop="error_msg" label="失败原因" min-width="150" :show-overflow-tooltip="true"></el-table-column>
......@@ -64,157 +64,155 @@
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
import { Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip, Upload } from 'element-ui'
import { NODE_ENVS } from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "consignmentImportDetail",
data() {
return {
detailData: {},
itemListObj: {},//明细数据
dialogVisible_1: false,
total: 0,
limit: 10,
page: 1,
list: [],
maxPrice: [],
id: '',
up_sn: '',
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
remark: '',
sku_apply_num_json: [],
fileData: {
token: Tool.getCookie('token'),
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);
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "consignmentImportDetail",
data() {
return {
detailData: {},
itemListObj: {},//明细数据
dialogVisible_1: false,
total: 0,
limit: 10,
page: 1,
list: [],
maxPrice: [],
id: '',
up_sn: '',
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
remark: '',
sku_apply_num_json: [],
fileData: {
token: Tool.getCookie('token'),
type: 2//1覆盖 2新增
}
})
};
},
/**
* 导出失败文件
*/
exportErrorItemList() {
let url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.up_sn + '&token=' + Tool.getCookie('token') + '&source=12';
Tool.openNewWindow(url);
created() {
this.id = this.$route.query.id;
this.up_sn = this.$route.query.up_sn;
this.getInfo()
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;
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'
});
}
this.sku_apply_num_json = this.multipleSelection.map(item => {
return {
sku_id: item.sku_id,
apply_num: item.consignment_apply_stock
}
});
this.dialogVisible_1 = true;
break;
}
},
/**
* 提交寄售审核
*/
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: () => {
this.dialogVisible_1 = false;
this.remark = '';
this.getList();
})
},
/**
* 获取列表数据
*/
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);
}
})
},
/**
* 导出失败文件
*/
exportErrorItemList() {
let url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.up_sn + '&token=' + Tool.getCookie('token') + '&source=12';
Tool.openNewWindow(url);
},
/**
* 弹窗事件
*/
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;
}
});
} else {
this.$message.error(res.msg || '操作失败');
this.sku_apply_num_json = this.multipleSelection.map(item => {
return {
sku_id: item.sku_id,
apply_num: item.consignment_apply_stock
}
});
this.dialogVisible_1 = true;
break;
}
})
},
/**
* 列表分页条数筛选监听
* @param val
*/
handleSizeChange(val) {
this.limit = val;
this.getList();
},
/**
* 列表分页输入页码监听
* @param val
*/
handleCurrentChange(val) {
this.page = val;
this.getList();
},
/**
* 提交寄售审核
*/
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: () => {
this.dialogVisible_1 = false;
this.remark = '';
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;
}
},
/**
* chebox 选择监听
* @param val
*/
handleSelectionChange(val) {
this.multipleSelection = val;
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -306,7 +306,7 @@
* 作废
*/
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) {
this.$message({
message: '操作成功',
......
......@@ -35,138 +35,139 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentRecallDetail",
data() {
return {
multipleSelection: [],
recall_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
status: '',
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);
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentRecallDetail",
data() {
return {
multipleSelection: [],
recall_id: '',
detailData: {},
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
status: '',
date: ''
}
})
};
},
/**
* 型号监听
* @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 {
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);
}
})
},
/**
* 型号监听
* @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();
},
/**
* 列表分页条数筛选监听
* @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) {
// 一键添加全部库存
this.recall_json = this.list;
} else {
// 添加选中的库存
this.recall_json = this.multipleSelection;
}
if (type) {
// 一键添加全部库存
this.recall_json = this.list;
} else {
// 添加选中的库存
this.recall_json = this.multipleSelection;
}
this.dialogVisible_1 = false; // 关闭弹窗
this.$message.success('添加成功');
this.dialogVisible_1 = false; // 关闭弹窗
this.$message.success('添加成功');
}
},
components: {
Menu
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
.remark-content {
min-width: 200px;
word-break: break-all; /* 防止文字溢出 */
}
.remark-content {
min-width: 200px;
word-break: break-all;
/* 防止文字溢出 */
}
</style>
\ No newline at end of file
......@@ -42,137 +42,135 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentReplenishment",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
sku_id: '',
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'
});
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "consignmentReplenishment",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
sku_id: '',
goods_name: ''
}
})
};
},
/**
* 型号监听
* @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 {
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'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
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;
},
/**
* 提交补货申请
*/
addConsignmentReplenishment() {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
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 || '操作失败');
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;
},
/**
* 提交补货申请
*/
addConsignmentReplenishment() {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
})
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>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
\ No newline at end of file
......@@ -55,161 +55,161 @@
</div>
</template>
<script>
import Vue from '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 Vue from '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'
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "inOutStockLog",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
goods_name: '',
types: [],
start_time: '',
end_time: ''
},
activeTimeBtn: 7
};
},
created() {
this.handleTimeFilter(7);
},
methods: {
getData() {
const params = {
...this.formParam,
page: this.page,
limit: this.limit,
types: this.formParam.types?.join(',') || ''
Vue.prototype.$message = Message
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(DatePicker).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Descriptions).use(DescriptionsItem);
export default {
name: "inOutStockLog",
data() {
return {
multipleSelection: [],
total: 0,
page: 1,
limit: 10,
list: [],
formParam: {
goods_name: '',
types: [],
start_time: '',
end_time: ''
},
activeTimeBtn: 7
};
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'
});
}
})
},
/**
* 型号监听
* @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 {
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'
});
}
})
},
/**
* 型号监听
* @param queryString
* @param cb
*/
querySearchAsync(queryString, cb) {
if (!queryString) {
cb([]);
return;
}
}).catch(() => {
cb([]);
});
},
/**
* 搜索
*/
onSubmit() {
this.page = 1;
this.getData();
},
/**
* 重置表单
* @param formName
*/
resetForm(formName) {
this.activeTimeBtn = '';
this.formParam.start_time = '';
this.formParam.end_time = '';
this.$refs[formName].resetFields();
this.getData();
},
/**
* 列表分页条数筛选监听
* @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;
},
/**
* 添加时间筛选处理方法
*/
handleTimeFilter() {
const days = this.activeTimeBtn;
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.activeTimeBtn = '';
this.formParam.start_time = '';
this.formParam.end_time = '';
this.$refs[formName].resetFields();
this.getData();
},
/**
* 列表分页条数筛选监听
* @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;
},
/**
* 添加时间筛选处理方法
*/
handleTimeFilter() {
const days = this.activeTimeBtn;
// 计算开始时间和结束时间
const end = new Date();
const start = new Date();
start.setDate(start.getDate() - days);
// 计算开始时间和结束时间
const end = new Date();
const start = new Date();
start.setDate(start.getDate() - days);
// 格式化日期
this.formParam.start_time = this.formatDate(start);
this.formParam.end_time = this.formatDate(end);
// 格式化日期
this.formParam.start_time = this.formatDate(start);
this.formParam.end_time = this.formatDate(end);
// 重新获取数据
this.page = 1;
this.getData();
// 重新获取数据
this.page = 1;
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}`;
}
},
/**
* 格式化日期的辅助方法
* @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
}
},
components: {
Menu
}
};
};
</script>
<style scoped>
.time-filter {
margin: 15px 0;
}
.time-filter {
margin: 15px 0;
}
.filter-btns .el-radio-group {
margin-left: 0px !important;
}
.filter-btns .el-radio-group {
margin-left: 0px !important;
}
</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