Commit ae368147 authored by dragondean@qq.com's avatar dragondean@qq.com

查看价格增加状态

parent e6023de0
......@@ -276,7 +276,8 @@
<el-card class="mt-10" v-if="readonly">
<el-descriptions :column="1">
<el-descriptions-item :label="$t('创建时间')">{{form.createTime|parseTime}}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">{{ statusName(form) }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{form.createTime|parseTime}}</el-descriptions-item>
<el-descriptions-item :label="$t('创建人')">{{form.creatorName}}</el-descriptions-item>
<el-descriptions-item :label="$t('最新修改时间')">{{form.updateTime|parseTime}}</el-descriptions-item>
<el-descriptions-item :label="$t('最新修改人')">{{form.updaterName}}</el-descriptions-item>
......@@ -383,6 +384,7 @@ import {openedRouterList} from '@/api/ecw/warehouse'
import Decimal from "decimal.js";
import {getChannel} from "@/api/ecw/channel";
import PackagingType from "@/views/ecw/channel/componrnts/packaging-type.vue";
import {getStatusName} from './util'
export default {
components: {PackagingType, RoutersSelector, ProductSelector, Selector, Inputor },
filters: {parseTime},
......@@ -425,6 +427,9 @@ export default {
}
},
computed: {
statusName(){
return getStatusName
},
routerOption(){
return this.$route.query
},
......
......@@ -333,6 +333,7 @@ import {arrryToKeyedObjectBy} from '@/utils/index'
import { getProduct } from '@/api/ecw/product';
import {parseTime} from '@/utils/ruoyi'
import Template from "@/views/cms/template";
import {getStatusName} from "./util";
export default {
name: "EcwProductpriceIndex",
filters: {parseTime},
......@@ -470,23 +471,7 @@ export default {
},
// 根据状态获取状态名称 ,这个应该可以改成字典,目前接口缺少相关数据,待定
statusName() {
return row => {
//判断价格是否过期
let validateStartDate = row.validateStartDate;
let validateEndDate = row.validateEndDate;
let notSetPrice = false;
let nowDate = new Date().getTime();
if(validateStartDate && validateStartDate > nowDate) {
notSetPrice = true;
}
if(validateEndDate && validateEndDate < nowDate) {
notSetPrice = true;
}
let setPriceText = notSetPrice ? '(' + this.$t('已过期') + ')' : '';
if(row.blacklist) return this.$t('黑名单') // + setPriceText;
if(row.auditStatus === AuditStatusEnum.PASS) return this.$t('已上架') // + setPriceText;
return this.$t('已下架') + setPriceText;
}
return getStatusName
},
// 根据运输方式获取名称
......
import {AuditStatusEnum} from "@/utils/constants";
import i18n from '@/i18n'
export const getStatusName = (row) => {
//判断价格是否过期
let validateStartDate = row.validateStartDate;
let validateEndDate = row.validateEndDate;
let notSetPrice = false;
let nowDate = new Date().getTime();
if(validateStartDate && validateStartDate > nowDate) {
notSetPrice = true;
}
if(validateEndDate && validateEndDate < nowDate) {
notSetPrice = true;
}
let setPriceText = notSetPrice ? '(' + i18n.t('已过期') + ')' : '';
if(row.blacklist) return i18n.t('黑名单') // + setPriceText;
if(row.auditStatus === AuditStatusEnum.PASS) return i18n.t('已上架') // + setPriceText;
return i18n.t('已下架') + setPriceText;
}
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 to comment