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

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

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