提交 17d82bb2 authored 作者: huaxinzhu's avatar huaxinzhu

1、售后列表/订单列表,增加申请时间搜索条件;

2、商品-编辑时,兼容,被删除了运费模板字段的信息
3、优化,图片上传失败后,界面仍看见图片的bug
4、兼容后台返回值为 0  的时间格式
上级 336687e8
...@@ -6,14 +6,16 @@ ...@@ -6,14 +6,16 @@
// 3. Y年m月d日 // 3. Y年m月d日
// 4. Y年m月d日 H时i分 // 4. Y年m月d日 H时i分
formats = formats || 'Y-m-d'; formats = formats || 'Y-m-d';
var zero = function (value) { var zero = function (value) {
if (value < 10) { if (value < 10) {
return '0' + value; return '0' + value;
} }
return value; return value;
}; };
// 统一转换,如果时间是 0 或者 “0”,则转换为空字符串 “”
if(timestamp == 0 ) {
return ""
}
var myDate = timestamp? new Date(timestamp): new Date(); var myDate = timestamp? new Date(timestamp): new Date();
var year = myDate.getFullYear(); var year = myDate.getFullYear();
...@@ -40,12 +42,12 @@ ...@@ -40,12 +42,12 @@
*/ */
export function formatDate(cellValue) { export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return ""; if (cellValue == null || cellValue == "") return "";
var date = new Date(cellValue) var date = new Date(cellValue)
var year = date.getFullYear() var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
} }
...@@ -363,7 +365,7 @@ export function makeMap(str, expectsLowerCase) { ...@@ -363,7 +365,7 @@ export function makeMap(str, expectsLowerCase) {
? val => map[val.toLowerCase()] ? val => map[val.toLowerCase()]
: val => map[val] : val => map[val]
} }
export const exportDefault = 'export default ' export const exportDefault = 'export default '
export const beautifierConf = { export const beautifierConf = {
...@@ -420,4 +422,3 @@ export function camelCase(str) { ...@@ -420,4 +422,3 @@ export function camelCase(str) {
export function isNumberStr(str) { export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
} }
\ No newline at end of file
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
this.ruleFormdialogImageUrlplus.push({'url': res.data.data.imageUrl}) this.ruleFormdialogImageUrlplus.push({'url': res.data.data.imageUrl})
this.$message({ message:'上传成功',type:'success'}); this.$message({ message:'上传成功',type:'success'});
}else { }else {
this.ruleFormdialogImageUrlplus = [];
this.$message({ message:'上传失败,请重新上传',type:'error'}); this.$message({ message:'上传失败,请重新上传',type:'error'});
} }
}) })
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
<el-form-item label="运费模板" v-if="ruleForm.resource==1"> <el-form-item label="运费模板" v-if="ruleForm.resource==1">
<el-select v-model="ruleForm.freightId" placeholder="请选择运费模板" style="width:400px;"> <el-select v-model="ruleForm.freightId" placeholder="请选择运费模板" style="width:400px;" @change="selectTm">
<el-option v-for="item in freightList" :key="item.Id" :label="item.Name" :value="item.Id" <el-option v-for="item in freightList" :key="item.Id" :label="item.Name" :value="item.Id"
style="text-align:center;"></el-option> style="text-align:center;"></el-option>
</el-select> </el-select>
...@@ -60,10 +60,9 @@ ...@@ -60,10 +60,9 @@
<el-form-item label="发货时效" prop="Delayompensate"> <el-form-item label="发货时效" prop="Delayompensate">
<el-select v-model="ruleForm.Delayompensate" style="width:400px;" placeholder="请选择发货时效"> <el-select v-model="ruleForm.Delayompensate" style="width:400px;" placeholder="请选择发货时效">
<el-option label="24小时" value="24" ></el-option>
<el-option label="24小时" value="24" style="text-align:center;"></el-option> <el-option label="48小时" value="48" ></el-option>
<el-option label="48小时" value="48" style="text-align:center;"></el-option> <el-option label="72小时" value="72" ></el-option>
<el-option label="72小时" value="72" style="text-align:center;"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="售后时长" prop="aftersaleTime"> <el-form-item label="售后时长" prop="aftersaleTime">
...@@ -186,7 +185,7 @@ ...@@ -186,7 +185,7 @@
goodsBrand: '', //品牌 goodsBrand: '', //品牌
resource: "1", resource: "1",
categoryId: 0, categoryId: 0,
freightId: '', //运费模板ID freightId: '全国包邮通用模板', //运费模板ID
wlPrice: '', wlPrice: '',
pywlPrice: '', pywlPrice: '',
jsPrice: '', //协议价 jsPrice: '', //协议价
...@@ -280,6 +279,7 @@ ...@@ -280,6 +279,7 @@
this.options1 = response.data.data; this.options1 = response.data.data;
}); });
}, },
// 运费模板
getFreight() { getFreight() {
GetFreight(this.queryParams).then(response => { GetFreight(this.queryParams).then(response => {
this.freightList = response.data this.freightList = response.data
...@@ -347,6 +347,11 @@ ...@@ -347,6 +347,11 @@
return flag return flag
}, },
selectTm(indexId) {
},
} }
} }
</script> </script>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</template> </template>
<script> <script>
import {getGoods} from '@/api/module/goods' import {getGoods,GetFreight} from '@/api/module/goods'
import descartes from "@/utils/dikaerjs.js"; import descartes from "@/utils/dikaerjs.js";
import Guide from './components/guide' import Guide from './components/guide'
import Goodsinfomation from './components/goodsinfomation' import Goodsinfomation from './components/goodsinfomation'
...@@ -49,7 +49,9 @@ ...@@ -49,7 +49,9 @@
parameterdate: {}, parameterdate: {},
params: { params: {
applyStatus: 0 applyStatus: 0
} },
expressTemplateIdList: [], //'原来绑定的运费模板已经被删除',
expressTemplateList: [],
} }
}, },
components: { components: {
...@@ -59,11 +61,21 @@ ...@@ -59,11 +61,21 @@
Goodsparameter Goodsparameter
}, },
created() { created() {
this.getParams() this.getParams();
this.getFreight();//运费模板数据,回显匹配专用
}, },
methods: { methods: {
// 运费模板
getFreight() {
GetFreight(this.queryParams).then(response => {
this.expressTemplateList = response.data;
this.expressTemplateIdList = this.expressTemplateList.filter(function(item) {
return item.Id;
})
});
},
getParams() { getParams() {
let goodsId = this.$route.query.goodsId let goodsId = this.$route.query.goodsId;
if (goodsId > 0) { if (goodsId > 0) {
this.title = "编辑商品信息"; this.title = "编辑商品信息";
this.genGoodsInfo(goodsId); this.genGoodsInfo(goodsId);
...@@ -76,6 +88,18 @@ ...@@ -76,6 +88,18 @@
getGoods(goods_id).then(response => { getGoods(goods_id).then(response => {
if(response.data.code === 1 && response.data.data) { if(response.data.code === 1 && response.data.data) {
this.goodsOnsale = response.data.data.isOnsale; this.goodsOnsale = response.data.data.isOnsale;
// 对发货时效单独处理
if(response.data.data.Delayompensate == 0) {
response.data.data.Delayompensate = '';
}
// 运费模板单独处理
if(response.data.data.freightId === "全国包邮通用模板" || response.data.data.freightId == 0) {
response.data.data.freightId = 310;
}else {
if( this.expressTemplateIdList.indexOf(response.data.data.freightId) < 0) {
response.data.data.freightId = '原来绑定的运费模板已经被删除';
}
}
this.infomationdata = { this.infomationdata = {
goodsId: response.data.data.goodsId, goodsId: response.data.data.goodsId,
goodsName: response.data.data.goodsName, goodsName: response.data.data.goodsName,
...@@ -139,22 +163,23 @@ ...@@ -139,22 +163,23 @@
}, },
//规格 //规格
guideclick(type, specsGroup) { guideclick(type, specsGroup) {
this.params["specs"] = type this.params["specs"] = type;
this.params["specsGroup"] = specsGroup this.params["specsGroup"] = specsGroup;
}, },
//参数 //参数
parameterclick(type) { parameterclick(type) {
this.params["goodsPram"] = type this.params["goodsPram"] = type;
}, },
/** 确定按钮 */ /** 确定按钮 */
submitForm(status) { submitForm(status) {
this.params.applyStatus = 0; this.params.applyStatus = 0;
this.params.isOnsale = this.goodsOnsale; this.params.isOnsale = this.goodsOnsale;
if(status === 1) { if(status === 1) {
this.params.applyStatus = 1; this.params.applyStatus = 1;
} }
// console.log("gogogogog",this.params); console.log("gogogogog",this.params);
// 商品信息 表单字段校验 // 商品信息 表单字段校验
let isGoodInfMsg = this.$refs['childGoodsInf'].validateGoodsInfForm(); let isGoodInfMsg = this.$refs['childGoodsInf'].validateGoodsInfForm();
// 商品图片 校验 // 商品图片 校验
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="85px">
<el-form-item label="付款状态" prop="payStatus"> <el-form-item label="付款状态" prop="payStatus">
<el-select v-model="queryParams.payStatus" placeholder="付款状态"> <el-select v-model="queryParams.payStatus" placeholder="付款状态" size="small">
<el-option v-for="item in payOptions" :key="item.value" :label="item.label" <el-option v-for="item in payOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发货状态" prop="goodsStatus"> <el-form-item label="发货状态" prop="goodsStatus">
<el-select v-model="queryParams.goodsStatus" placeholder="发货状态"> <el-select v-model="queryParams.goodsStatus" placeholder="发货状态" size="small">
<el-option v-for="item in goodsOptions" :key="item.value" :label="item.label" <el-option v-for="item in goodsOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="订单状态" prop="status"> <el-form-item label="订单状态" prop="status">
<el-select v-model="queryParams.status" placeholder="订单状态"> <el-select v-model="queryParams.status" placeholder="订单状态" size="small">
<el-option v-for="item in orderOptions" :key="item.value" :label="item.label" <el-option v-for="item in orderOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
...@@ -43,6 +43,20 @@ ...@@ -43,6 +43,20 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="下单时间" prop="addTimeInterval">
<el-date-picker
size="small"
v-model="queryParams.addTimeInterval"
type="daterange"
align="left"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
></el-date-picker>
</el-form-item>
<el-form-item label="收货人名字" prop="shipname"> <el-form-item label="收货人名字" prop="shipname">
<el-input <el-input
v-model="queryParams.shipname" v-model="queryParams.shipname"
...@@ -69,7 +83,6 @@ ...@@ -69,7 +83,6 @@
</el-form> </el-form>
</div> </div>
<el-table v-loading="loading" :data="orderList" :height="tableHeight" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="orderList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="商品名称" align="center" width="200"> <el-table-column label="商品名称" align="center" width="200">
...@@ -91,11 +104,11 @@ ...@@ -91,11 +104,11 @@
<el-table-column label="数量" align="center" prop="Quantity"/> <el-table-column label="数量" align="center" prop="Quantity"/>
<el-table-column label="订单金额" align="center" prop="Money"/> <el-table-column label="订单金额" align="center" prop="Money"/>
<el-table-column label="结算价格" align="center" prop="SellerMoney"/> <el-table-column label="结算价格" align="center" prop="SellerMoney"/>
<el-table-column label="来源" align="center"> <!-- <el-table-column label="来源" align="center">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<p v-if="scope.row.Pt==0">供应链中台</p> <!-- <p v-if="scope.row.Pt==0">供应链中台</p>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<!--<el-table-column label="收货人姓名" align="center" prop=""/>--> <!--<el-table-column label="收货人姓名" align="center" prop=""/>-->
<el-table-column label="收货人信息" align="center" width="300"> <el-table-column label="收货人信息" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -429,6 +442,34 @@ ...@@ -429,6 +442,34 @@
name: "order", name: "order",
data() { data() {
return { return {
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
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]);
}
}]
},
//-------------------
fullHeight: '', fullHeight: '',
tableHeight: 500, tableHeight: 500,
fullscreenLoading: false, fullscreenLoading: false,
...@@ -502,6 +543,9 @@ ...@@ -502,6 +543,9 @@
order_sn: null, order_sn: null,
shipname: null, shipname: null,
Tel:null, Tel:null,
beginTime: 0,
endTime: 0,
addTimeInterval: []
}, },
sendGoods: { sendGoods: {
orderSn: "", orderSn: "",
...@@ -522,13 +566,20 @@ ...@@ -522,13 +566,20 @@
this.$nextTick(() => { this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
}) })
}, },
watch: { watch: {
fullHeight(val, oldval) { fullHeight(val, oldval) {
// console.log(val)
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 110 this.tableHeight = val - formHeight - 110
},
// 保证日期初始化格式
'queryParams.addTimeInterval'() {
// select组件,clear的时候,将addTimeInterval的值,初始化为null,判断当其值为null时,赋值为数组
if(!this.queryParams.addTimeInterval && typeof(this.queryParams.addTimeInterval) !== "undefined") {
this.queryParams.addTimeInterval = [];
this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
}
} }
}, },
methods: { methods: {
...@@ -548,16 +599,16 @@ ...@@ -548,16 +599,16 @@
}, },
//物流 //物流
handleWl: function (row) { handleWl: function (row) {
this.loading = true this.loading = true;
this.sendGoods.deliverName = row.DeliverName this.sendGoods.deliverName = row.DeliverName;
this.sendGoods.deliverNo = row.DeliverNo this.sendGoods.deliverNo = row.DeliverNo;
this.sendGoods.orderSn = row.order_sn this.sendGoods.orderSn = row.order_sn;
getExpressInfo(this.sendGoods).then(response => { getExpressInfo(this.sendGoods).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.loading = false; this.loading = false;
this.open3 = true; this.open3 = true;
this.title3 = "物流信息"; this.title3 = "物流信息";
this.expressInfo = response.data.data this.expressInfo = response.data.data;
} }
}); });
}, },
...@@ -576,7 +627,6 @@ ...@@ -576,7 +627,6 @@
getList() { getList() {
this.loading = true; this.loading = true;
listOrder(this.queryParams).then(response => { listOrder(this.queryParams).then(response => {
console.log(579,response);
this.from = response.data.list; this.from = response.data.list;
this.orderList = response.data.list; this.orderList = response.data.list;
this.total = response.data.total; this.total = response.data.total;
...@@ -595,13 +645,18 @@ ...@@ -595,13 +645,18 @@
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
if(this.queryParams.addTimeInterval.length === 2) {
this.queryParams.beginTime = new Date(this.queryParams.addTimeInterval[0]).getTime() / 1000;
this.queryParams.endTime = new Date(this.queryParams.addTimeInterval[1]).getTime() / 1000;
}
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
console.log(612,this.queryParams); this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
this.handleQuery(); this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
...@@ -617,11 +672,12 @@ ...@@ -617,11 +672,12 @@
this.loading = true this.loading = true
const order_sn = row.order_sn || this.ids const order_sn = row.order_sn || this.ids
getOrder(order_sn).then(response => { getOrder(order_sn).then(response => {
//console.log("请求原始数据:",response);
this.loading = false this.loading = false
this.form = response.data.parms; this.form = response.data.parms;
this.form.Delivertime = dateFormat(response.data.Delivertime * 1000, "Y-m-d H:i:s"); this.form.Delivertime = dateFormat(response.data.parms.Delivertime * 1000, "Y-m-d H:i:s");
this.form.Addtime = dateFormat(response.data.Addtime * 1000, "Y-m-d H:i:s"); this.form.Addtime = dateFormat(response.data.parms.Addtime * 1000, "Y-m-d H:i:s");
this.expressList = response.data.expressLists this.expressList = response.data.expressLists;
this.open = true; this.open = true;
this.title = "订单详情"; this.title = "订单详情";
}); });
......
...@@ -3,6 +3,19 @@ ...@@ -3,6 +3,19 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="申请时间" prop="applyTime">
<el-date-picker
size="small"
v-model="queryParams.applyTime"
type="daterange"
align="left"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="商品ID" prop="goodsId"> <el-form-item label="商品ID" prop="goodsId">
<el-input <el-input
v-model="queryParams.goodsId" v-model="queryParams.goodsId"
...@@ -365,7 +378,10 @@ ...@@ -365,7 +378,10 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
goodsId: null, goodsId: null,
goodsName: null goodsName: null,
applyTime: [],
beginTime: 0,
endTime: 0,
}, },
data: {}, data: {},
...@@ -374,6 +390,33 @@ ...@@ -374,6 +390,33 @@
retreat: {info: {needMsg: 0}}, retreat: {info: {needMsg: 0}},
order: {}, order: {},
}, },
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
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]);
}
}]
},
}; };
}, },
created() { created() {
...@@ -388,6 +431,14 @@ ...@@ -388,6 +431,14 @@
// console.log(val) // console.log(val)
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 110 this.tableHeight = val - formHeight - 110
},
'queryParams.applyTime'() {
// select组件,clear的时候,将addTimeInterval的值,初始化为null,判断当其值为null时,赋值为数组
if(!this.queryParams.applyTime && typeof(this.queryParams.applyTime) !== "undefined") {
this.queryParams.applyTime = [];
this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
}
} }
}, },
methods: { methods: {
...@@ -523,12 +574,18 @@ ...@@ -523,12 +574,18 @@
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
if(this.queryParams.applyTime.length === 2) {
this.queryParams.beginTime = new Date(this.queryParams.applyTime[0]).getTime() / 1000;
this.queryParams.endTime = new Date(this.queryParams.applyTime[1]).getTime() / 1000;
}
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
this.handleQuery(); this.handleQuery();
}, },
//同意申请并发货 //同意申请并发货
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleDetails(scope.row)">详情</el-button> <el-button type="text" @click="handleDetails(scope.row)" :disabled="(scope.row.id === 1)">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -286,9 +286,9 @@ ...@@ -286,9 +286,9 @@
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label=""> <el-form-item label="">
<div style="width:100%;height: 100%;display: flex;flex-direction: row;justify-content: normal;"> <div style="width:100%;height: 100%;display: flex;flex-direction: row;justify-content: normal;">
<p class="download-Template-btn"> <el-button :disabled="downTemplatehttp !== '' ? false: true" >
<el-link :href="downTemplatehttp" :disabled="downTemplatehttp ? false: true" ><i class="el-icon-download"></i>下载模板</el-link> <el-link :href="downTemplatehttp" :disabled="downTemplatehttp !== '' ? false: true" type="primary" :underline="false"><i class="el-icon-download"></i>下载模板</el-link>
</p> </el-button>
<div> <div>
<span class="tips-text"> <span class="tips-text">
<i class="el-icon-warning h-warning"></i> <i class="el-icon-warning h-warning"></i>
...@@ -435,7 +435,12 @@ ...@@ -435,7 +435,12 @@
fullHeight(val) { fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 110; this.tableHeight = val - formHeight - 110;
} },
// 'brandForm.brand_auth'() {
// if(this.brandForm.brand_auth === '') {
// this.factoryImgFileList = [];
// }
// }
}, },
methods: { methods: {
...@@ -478,6 +483,12 @@ ...@@ -478,6 +483,12 @@
// 自有品牌授权模板下载路径 shopTemplatehttp // 自有品牌授权模板下载路径 shopTemplatehttp
// 品牌厂商授权模板下载路径 factoryTemplatehttp // 品牌厂商授权模板下载路径 factoryTemplatehttp
this.downTemplatehttp = (this.brandForm.brand_type === 1 ? this.shopTemplatehttp : this.factoryTemplatehttp); this.downTemplatehttp = (this.brandForm.brand_type === 1 ? this.shopTemplatehttp : this.factoryTemplatehttp);
//
// 品牌授权 图片处理 factoryImgFileList
if(this.brandForm.brand_auth === '') {
this.factoryImgFileList = [];
}
//console.log("切换时候:",this.brandForm);
}, },
chooseBrandRange() { chooseBrandRange() {
this.$refs.brandForm.clearValidate('brand_range'); this.$refs.brandForm.clearValidate('brand_range');
...@@ -652,13 +663,16 @@ ...@@ -652,13 +663,16 @@
// 新增,修改,详情 // 新增,修改,详情
handleAdd() { handleAdd() {
this.isOpen = true; if(this.total < 20 ) {
this.brandTitle = '新增品牌信息'; this.isOpen = true;
this.reset('brandForm'); this.brandTitle = '新增品牌信息';
this.brandForm.id = 0; this.reset('brandForm');
this.brandForm.brand_auth = ''; this.brandForm.id = 0;
this.brandForm.brand_auth_time = ''; this.brandForm.brand_auth = '';
//console.log('新增前是否有数据:',this.brandForm); this.brandForm.brand_auth_time = '';
}else {
this.$message({ type: 'warning', message: '目前暂时只支持维护20个品牌数据!'});
}
}, },
// 详情 // 详情
handleDetails(row) { handleDetails(row) {
...@@ -667,7 +681,10 @@ ...@@ -667,7 +681,10 @@
const ids = row.id; const ids = row.id;
getDetails(ids).then(res => { getDetails(ids).then(res => {
if(res.code && res.code === 1 && res.data) { if(res.code && res.code === 1 && res.data) {
//console.log("详情:",res.data);
this.brandForm = res.data; this.brandForm = res.data;
// 模板下载地址赋值
this.downTemplatehttp = (this.brandForm.brand_type === 1 ? this.shopTemplatehttp : this.factoryTemplatehttp);
// 商标logo图片处理 // 商标logo图片处理
let brandList = {}; let brandList = {};
let brandArr = []; let brandArr = [];
...@@ -746,7 +763,6 @@ ...@@ -746,7 +763,6 @@
} }
} }
}); });
}, },
// 查询 // 查询
handleQuery() { handleQuery() {
...@@ -868,7 +884,6 @@ ...@@ -868,7 +884,6 @@
}, },
// 取消 // 取消
handleCancel(form) { handleCancel(form) {
//console.log("取消数据",this.brandForm);
this.reset(form); this.reset(form);
this.isOpen = false; this.isOpen = false;
}, },
...@@ -904,7 +919,6 @@ ...@@ -904,7 +919,6 @@
this.certImgFileList= []; this.certImgFileList= [];
this.factoryImgFileList= []; this.factoryImgFileList= [];
this.shopImgFileList= []; this.shopImgFileList= [];
//this.brandForm.id = 0;
}, },
// 图片转换为base64位 // 图片转换为base64位
...@@ -935,7 +949,6 @@ ...@@ -935,7 +949,6 @@
const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
return Y + M + D + h + m + s; return Y + M + D + h + m + s;
}, },
} }
} }
</script> </script>
...@@ -1019,23 +1032,4 @@ ...@@ -1019,23 +1032,4 @@
color: #e3c300; color: #e3c300;
} }
// 提示语样式 end // 提示语样式 end
// 模板下载按钮 start
.download-Template-btn {
width: 145px;
height: 38px;
line-height: 38px;
text-align: center;
color: #1890FF;
font-size: 14px;
border: 1px solid #1890FF;
border-radius: 3px;
cursor: pointer;
}
.download-Template-btn:hover {
color: #fff;
border: 1px solid #1890FF;
background-color : #1890ff;
}
// 模板下载按钮 end
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论