Commit 49078541 by LJM

add

parent 44ddc25f
*上架有效期,*商品型号,*制造商,*寄售库存数量,安全库存,"*最小起订量
*上架有效期,*商品型号,*制造商,*寄售库存数量,安全库存,"*最小起订量
(MOQ)",标准包装量(MPQ),*递增量,封装,批次,大陆交期,香港交期,简短描述,物料编码,*显示类型(国内现货,国际现货,猎芯期货),含税销售价(RMB),美金销售价(USD),阶梯数量1,国内含税价1(¥),香港交货价1($),阶梯数量2,国内含税价2(¥),香港交货价2($),阶梯数量3,国内含税价3(¥),香港交货价3($),阶梯数量4,国内含税价4(¥),香港交货价4($),阶梯数量5,国内含税价5(¥),香港交货价5($),阶梯数量6,国内含税价6(¥),香港交货价6($),阶梯数量7,国内含税价7(¥),香港交货价7($),阶梯数量8,国内含税价8(¥),香港交货价8($),阶梯数量9,国内含税价9(¥),香港交货价9($)
2024/12/25,TLE6431K,JAK,1000,100,1000,1000,1,,2301,2-5工作日,7-10工作日,,,国内现货,10,,1000,10,1.5,,,,,,,,,,,,,,,,,,,,,,,,
*SKUID,*上架有效期,安全库存,"*最小起订量
*SKUID,*上架有效期,安全库存,"*最小起订量
(MOQ)",标准包装量(MPQ),*递增量,封装,批次,大陆交期,香港交期,简短描述,物料编码,*显示类型(国内现货,国际现货,猎芯期货),含税销售价(RMB),美金销售价(USD),阶梯数量1,国内含税价1(¥),香港交货价1($),阶梯数量2,国内含税价2(¥),香港交货价2($),阶梯数量3,国内含税价3(¥),香港交货价3($),阶梯数量4,国内含税价4(¥),香港交货价4($),阶梯数量5,国内含税价5(¥),香港交货价5($),阶梯数量6,国内含税价6(¥),香港交货价6($),阶梯数量7,国内含税价7(¥),香港交货价7($),阶梯数量8,国内含税价8(¥),香港交货价8($),阶梯数量9,国内含税价9(¥),香港交货价9($)
,2024/12/25,,1000,1000,1,,2301,2-5工作日,7-10工作日,,,国内现货,10,,1000,10,1.5,,,,,,,,,,,,,,,,,,,,,,,,
<template>
<section class="store pagex">
<div class="pagex">
<div class="store-con">
<!--搜索区-->
<el-form :inline="true" :model="formParam" ref="formParam" label-width="80px">
<el-form-item label="消息类型" prop="msg_type">
<el-select v-model="formParam.msg_type" placeholder="全部" clearable>
<el-form :inline="true" :model="formParam" class="demo-form-inline" ref="formParam" label-width="80px">
<el-form-item label="型号" prop="goods_name">
<el-autocomplete v-model="formParam.goods_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" :fetch-suggestions="querySearchAsync" placeholder="请输入型号" clearable></el-autocomplete>
</el-form-item>
<el-form-item label="品牌" prop="brand_name">
<el-autocomplete v-model="formParam.brand_name" :trigger-on-focus="false" @keyup.enter.native="onSubmit" :fetch-suggestions="querySearchAsyncBrand" placeholder="请输入品牌" clearable></el-autocomplete>
</el-form-item>
<el-form-item label="上架状态" prop="status">
<el-select v-model="formParam.status" placeholder="请选择" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="上架" value="1"></el-option>
<el-option label="下架" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="来源" prop="status">
<el-select v-model="formParam.source" placeholder="请选择" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="已选中报价消息" value="1"></el-option>
<el-option label="已成单消息" value="2"></el-option>
<el-option label="自主上传" value="7"></el-option>
<el-option label="代上传" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<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 label="更新日期" prop="date">
<el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="formParam.date" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="过期时间" prop="date">
<el-date-picker :unlink-panels=true style="width:193px" prefix-icon="prefix-icon-time-style" v-model="cp_time_val" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item label="SKUID" prop="sku_id">
<el-input v-model="formParam.sku_id" placeholder="请输入SKUID" @keyup.enter.native="submit" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">搜索</el-button>
<el-button @click="resetForm('formParam')">重置</el-button>
</el-form-item>
</el-form>
<!--统计数据-->
<ul class="statistical-data row avarage">
<!--询价次数-->
<li>
<p class="title row verCenter">询价次数</p>
<div class="head row verCenter">
<span style="width: 40%;" class="row verCenter">型号</span>
<span style="width: 40%;" class="row verCenter">品牌</span>
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<div class="list">
<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">
<span style="width: 20%;" class="color1">{{ v.num }}</span>
</template>
<template v-else-if="index == 1">
<span style="width: 20%;" class="color2">{{ v.num }}</span>
</template>
<template v-else-if="index == 2">
<span style="width: 20%;" class="color3">{{ v.num }}</span>
</template>
<template v-else>
<span style="width: 20%;">{{ v.num }}</span>
</template>
</div>
</div>
</li>
<!--报价次数-->
<li>
<p class="title row verCenter">报价次数</p>
<div class="head row verCenter">
<span style="width: 40%;" class="row verCenter">型号</span>
<span style="width: 40%;" class="row verCenter">品牌</span>
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<div class="list">
<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">
<span style="width: 20%;" class="color1">{{ v.num }}</span>
</template>
<template v-else-if="index == 1">
<span style="width: 20%;" class="color2">{{ v.num }}</span>
</template>
<template v-else-if="index == 2">
<span style="width: 20%;" class="color3">{{ v.num }}</span>
</template>
<template v-else>
<span style="width: 20%;">{{ v.num }}</span>
</template>
</div>
</div>
</li>
<!--成单次数-->
<li>
<p class="title row verCenter">成单次数</p>
<div class="head row verCenter">
<span style="width: 40%;" class="row verCenter">型号</span>
<span style="width: 40%;" class="row verCenter">品牌</span>
<span style="width: 20%;" class="row verCenter">次数</span>
</div>
<div class="list">
<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">
<span style="width: 20%;" class="color1">{{ v.num }}</span>
</template>
<template v-else-if="index == 1">
<span style="width: 20%;" class="color2">{{ v.num }}</span>
</template>
<template v-else-if="index == 2">
<span style="width: 20%;" class="color3">{{ v.num }}</span>
</template>
<template v-else>
<span style="width: 20%;">{{ v.num }}</span>
</template>
</div>
</div>
</li>
</ul>
<!--操作区-->
<div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter">
<div class="btn-nav" style="margin-bottom: 0;margin-top: 0">
<el-dropdown @command="handleCommand">
<div class="update">修改&nbsp;|<i class="el-icon-arrow-down"></i></div>
<el-dropdown-menu>
<el-dropdown-item command="1">修改安全库存</el-dropdown-item>
<el-dropdown-item command="2">修改交期</el-dropdown-item>
<el-dropdown-item command="3">上架有效期</el-dropdown-item>
<el-dropdown-item command="4">修改销售价格</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<el-button type="primary" @click="changeStatus(1)" style="margin-left: 10px;">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
<el-button type="primary" @click="downOut">导出</el-button>
<a :href="downHref" ref="downs" target="_blank" style="display:none">下载</a>
<el-button type="primary" style="margin-left: 10px;" @click="batchModify()">批量修改</el-button>
<el-button type="primary" @click="consignmentReplenishment()">寄售补货</el-button>
<el-button type="primary" @click="consignmentRecall()">寄售召回</el-button>
</div>
<div class="text-tip row verCenter">
<i class="el-icon-warning"></i>
<span>该页面展示的数据为:贵司寄售在猎芯的库存信息</span>
</div>
</div>
<!--列表区-->
<div class="data-box">
<el-table :data="list" border max-height="600">
<el-table-column prop="msg_sn" label="消息编号" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="消息类型" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="创建时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column label="操作" width="110" align="center">
<el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40" align="center"></el-table-column>
<el-table-column prop="sku_id" label="SKUID" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_name" label="型号" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_name" label="品牌" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_standard_name" label="猎芯标准品牌" width="150" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="viewChange(scope.$index, scope.row)" class="yunyin-btn">查看内容</el-button>
<template v-if="scope.row.brand_standard_name">
{{ scope.row.brand_standard_name }}
</template>
<template v-else>
<span class="f-yellow1">待确认</span>
<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">该品牌在猎芯标准品牌库没有匹配到对应品牌,等待猎芯运营同事添加中......</div>
</el-tooltip>
</template>
</template>
</el-table-column>
<el-table-column prop="encap" label="封装" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="batch_sn" label="批次" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="moq" label="起订量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="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="" label="可用库存数量" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" label="在途库存" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" 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">
<el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.cn_ladder_price">
<span>{{ item.purchases }}+</span>
<span style="margin-left: 5px">&yen;{{ item.price }}</span>
</p>
<a slot="reference" href="javascript:;" class="alink">查看</a>
</el-popover>
</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">
<el-popover effect="light" trigger="hover" placement="bottom">
<p class="row" v-for="item in scope.row.hk_ladder_price">
<span>{{ item.purchases }}+</span>
<span style="margin-left: 5px">${{ item.price }}</span>
</p>
<a slot="reference" href="javascript:;" class="alink">查看</a>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="cn_delivery_time" label="大陆交期" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="hk_delivery_time" label="香港交期" width="100" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="" label="统计" width="100" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<el-popover placement="bottom" title="" width="400" trigger="click" @show="showChange(scope.row)">
<div class="statistics-table">
<div class="title row verCenter">
<span class="one" style="width: 180px">{{ skuStatistics.goods_name }}</span>
<span style="width: 100px">次数</span>
<span style="width: 200px">排名</span>
<span style="width: 272px">最近时间</span>
</div>
<div class="list">
<div class="box row verCenter">
<span class="one" style="width: 180px">搜索次数</span>
<span style="width: 100px">{{ skuStatistics.search_count }}</span>
<span style="width: 200px">{{ skuStatistics.search_rank }}(全网)</span>
<span style="width: 272px">{{ skuStatistics.search_last_time }}</span>
</div>
<div class="box row verCenter">
<span class="one" style="width: 180px">询价次数</span>
<span style="width: 100px">{{ skuStatistics.inquiry_count }}</span>
<span style="width: 200px">{{ skuStatistics.inquiry_rank }}</span>
<span style="width: 272px">{{ skuStatistics.inquiry_last_time }}</span>
</div>
<div class="box row verCenter">
<span class="one" style="width: 180px">报价次数</span>
<span style="width: 100px">{{ skuStatistics.quote_count }}</span>
<span style="width: 200px">{{ skuStatistics.quote_rank }}</span>
<span style="width: 272px">{{ skuStatistics.quote_last_time }}</span>
</div>
<div class="box row verCenter">
<span class="one" style="width: 180px">成单次数</span>
<span style="width: 100px">{{ skuStatistics.order_count }}</span>
<span style="width: 200px">{{ skuStatistics.order_rank }}</span>
<span style="width: 272px">{{ skuStatistics.order_last_time }}</span>
</div>
</div>
</div>
<a slot="reference" href="javascript:;" class="alink">查看</a>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="source_val" label="来源" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_status" label="状态" width="100" align="center" :show-overflow-tooltip="true">
<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>
</template>
</el-table-column>
<el-table-column prop="cp_time" label="上架有效期" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="update_time" label="更新时间" width="150" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed="right" label="操作" width="110" align="center">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="primary" size="mini" class="yunyin-btn">查看日志</el-button>
</template>
</el-table-column>
</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>
<!--修改库存弹窗-->
<el-dialog title="修改安全库存" :close-on-click-modal="false" :visible.sync="dialogVisible" width="900px">
<div class="kc-mask">
<el-table :data="kucundata" border max-height="600">
<el-table-column prop="goods_name" label="型号" min-width="25%">
</el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="25%">
</el-table-column>
<el-table-column prop="stock" label="库存数量" min-width="25%">
</el-table-column>
<el-table-column label="修改库存" min-width="25%">
<template slot-scope="scope">
<el-input v-model="scope.row.updateStock" placeholder="点击修改" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}">
</el-input>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitKc">确 定</el-button>
</span>
</el-dialog>
<!--修改交期弹窗-->
<el-dialog title="修改交期" :close-on-click-modal="false" :visible.sync="dialogVisible2" width="900px">
<div class="kc-mask">
<el-table :data="huoqidata" border max-height="600">
<el-table-column prop="goods_name" label="型号" min-width="20%"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="20%"></el-table-column>
<el-table-column prop="cn_delivery_time" label="大陆交期" min-width="20%"></el-table-column>
<el-table-column prop="hk_delivery_time" label="香港交期" min-width="20%"></el-table-column>
<el-table-column label="修改大陆交期" min-width="20%">
<template slot-scope="scope">
<div class="updatebox">
<el-input v-model="scope.row.dlhq" placeholder="如:2-5工作日"></el-input>
</div>
<Menu/>
<el-dialog title="消息详情" :close-on-click-modal="false" :visible.sync="dialogVisible" width="1000px">
<el-descriptions size="medium" border :column="2">
<el-descriptions-item>
<template slot="label">发件人</template>
{{ msgDetail.sender }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">收件人</template>
{{ msgDetail.recipient }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">时间</template>
{{ msgDetail.create_time }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">大小</template>
{{ msgDetail.size }}
</el-descriptions-item>
</el-descriptions>
<p style="margin-top: 20px;padding-bottom: 10px;">{{ msgDetail.content }}</p>
</template>
</el-table-column>
<el-table-column label="修改香港交期" min-width="20%">
<template slot-scope="scope">
<div class="updatebox">
<el-input v-model="scope.row.hkhq" placeholder="如:2-5工作日"></el-input>
</div>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible2 = false">取 消</el-button>
<el-button type="primary" @click="submitHq">确 定</el-button>
</span>
</el-dialog>
</section>
<!--修改上架有效期弹窗-->
<el-dialog title="修改上架有效期" :close-on-click-modal="false" :visible.sync="dialogVisible3" width="900px">
<div class="kc-mask">
<el-table :data="cpdata" border max-height="600">
<el-table-column prop="goods_name" label="型号" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_status" label="状态" width="80" :show-overflow-tooltip="true">
<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>
</template>
</el-table-column>
<el-table-column prop="cp_time_temp" label="上架有效期" width="160" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="修改上架有效期" width="160">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.cp_time" type="date" placeholder="选择日期" style="width: 128px" value-format="yyyy-MM-dd" :picker-options="pickerOptions"></el-date-picker>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible3 = false">取 消</el-button>
<el-button type="primary" @click="submitCp">确 定</el-button>
</span>
</el-dialog>
<!--修改销售价格-->
<el-dialog title="修改销售价格" :close-on-click-modal="false" :visible.sync="dialogVisible4" width="900px">
<div class="kc-mask">
<el-table :data="priceData" border max-height="600" style="margin-bottom: 10px">
<el-table-column label="商品信息" width="100%">
<el-table-column prop="goods_name" label="型号" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brand_name" label="品牌" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="stock" label="库存" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="moq" label="起订量" min-width="20%" :show-overflow-tooltip="true"></el-table-column>
</el-table-column>
</el-table>
<el-table :data="skuOriginalStepPriceData" border max-height="600">
<el-table-column label="阶梯价格" width="100%">
<el-table-column type="index" label="阶梯" width="50" align="center"></el-table-column>
<el-table-column prop="purchases" label="起订量(必填)" min-width="20%" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="skuOriginalStepPriceData[scope.$index].purchases" @input="handleInput(scope.$index)" placeholder="起订量" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}"></el-input>
</template>
</el-table-column>
<el-table-column prop="price_cn" label="含税成本价(RMB)" min-width="20%" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="skuOriginalStepPriceData[scope.$index].price_cn" placeholder="¥"></el-input>
</template>
</el-table-column>
<el-table-column prop="price_us" label="美金成本价(USD)" min-width="20%" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="skuOriginalStepPriceData[scope.$index].price_us" placeholder="$"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template slot-scope="scope">
<template v-if="scope.$index > 0">
<el-button type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</template>
</el-table-column>
</el-table-column>
</el-table>
<i class="el-icon-plus add" @click="addRow" style="color: #409EFF;cursor: pointer;margin-top: 20px;">增加阶梯价</i>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible4 = false">取 消</el-button>
<el-button type="primary" @click="updateSkuOriginalStepPrice">确 定</el-button>
</span>
</el-dialog>
<!--弹窗日志-->
<el-dialog title="现货库存管理日志" :close-on-click-modal="false" :visible.sync="dialogVisibleLog" 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>
<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>
</template>
</el-table-column>
<el-table-column prop="operator" label="操作人" min-width="150" align="center"></el-table-column>
</el-table>
</el-dialog>
<!--弹窗日志详情-->
<el-dialog title="修改详情" :close-on-click-modal="false" :visible.sync="dialogVisibleLogDetail" width="1000px" @close="closeBothDialogs">
<div class="row verCenter bothSide">
<div style="width:470px">
<el-table :data="message.pre_data" border max-height="600">
<el-table-column label="修改前" width="100%">
<el-table-column label="阶梯" type="index" align="center" width="50"></el-table-column>
<el-table-column prop="purchases" label="起订量" align="center"></el-table-column>
<el-table-column prop="price_cn" label="含税成本价(RMB)" align="center"></el-table-column>
<el-table-column prop="price_us" label="美金成本价(USD)" align="center"></el-table-column>
</el-table-column>
</el-table>
</div>
<div style="width:470px">
<el-table :data="message.current_data" border max-height="600">
<el-table-column label="修改后" width="100%">
<el-table-column label="阶梯" type="index" align="center" width="50"></el-table-column>
<el-table-column prop="purchases" label="起订量" align="center"></el-table-column>
<el-table-column prop="price_cn" label="含税成本价(RMB)" align="center"></el-table-column>
<el-table-column prop="price_us" label="美金成本价(USD)" align="center"></el-table-column>
</el-table-column>
</el-table>
</div>
</div>
</el-dialog>
<!--批量修改-->
<el-dialog title="批量修改" :close-on-click-modal="false" :visible.sync="dialogVisibleBatchModify" width="500px">
<el-upload drag action="https://jsonplaceholder.typicode.com/posts/">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
<el-link type="primary" href="/批量修改.csv" :underline="false">下载模板</el-link>
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleBatchModify = false">取 消</el-button>
<el-button type="primary" @click="">确 定</el-button>
</span>
</el-dialog>
</div>
<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, Message, MessageBox, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip} from 'element-ui'
import {Autocomplete, Button, DatePicker, Dialog, Dropdown, DropdownItem, DropdownMenu, Form, FormItem, Input, Link, Message, Option, Pagination, Popover, Select, Table, TableColumn, Tag, Tooltip, Upload} from 'element-ui'
import Util from "../../tool";
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);
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(Upload).use(Dropdown).use(DropdownMenu).use(DropdownItem).use(TableColumn).use(Table).use(Pagination).use(Popover)
export default {
name: "consignmentInventory",
data() {
return {
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible: false,
msgDetail: {},
page: 1,
dialogVisible: false,//库存弹窗
dialogVisible2: false,//交期弹窗
dialogVisible3: false,//上架有效期
dialogVisible4: false,//修改价格
dialogVisibleLog: false,//日志
dialogVisibleLogDetail: false,//日志详情
dialogVisibleBatchModify: false,//批量修改
logs: [],
downHref: "",
cp_time_val: '',
formParam: {
msg_type: '',
date: ''
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() {
this.getData()
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, '1168906660256142490');
},
/**
* 查看日志详情
* @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);
}
},
/**
* 获取数据
*/
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},
{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 => {
{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.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
this.tableData = res.data.list || [];
this.total = Number(res.data.count) || 0;
} else {
this.$message({
message: res.msg,
type: 'error'
type: 'warning'
});
}
})
},
getMsgDetail(msg_id) {
this.$http('GET', "/api/message/getMsgDetail", {msg_id: msg_id}).then(res => {
/**
* 获取sku的型号统计排名列表
*/
getSkuRankList() {
this.$http('GET', "/api/sku/getSkuRankList", {}).then(res => {
if (res.code === 0) {
this.msgDetail = res.data;
this.dialogVisible = true;
this.skuRankList = res.data.rankList;
} else {
this.$message({
message: res.msg,
type: 'error'
type: 'warning'
});
}
})
},
viewChange(index, row) {
this.getMsgDetail(row.id);
/**
* 型号
* @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([]);
}
}
})
},
/**
* 品牌
* @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();
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
}
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
})
},
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;
......@@ -137,6 +733,344 @@ export default {
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);
}
return date > maxDate || date < minDate; // 返回 true 禁用日期,返回 false 启用日期
},
/**
*
* @param date 时间类型
* @param type 是否加30天
* @returns {string}
*/
getTimes(date, type) {
if (type) {
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 {
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);
}
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;
}
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;
}
},
/**
* 增加阶梯价
*/
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 => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.dialogVisible4 = false;
this.getData();
}, 2000)
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
},
/**
* 获取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'
});
}
})
},
/**
* 修改上架有效期
*/
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'
});
}
})
},
/**
* 上下架
* @param status
*/
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;
}
});
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'
});
}
})
},
/**
* 批量修改
*/
batchModify() {
this.dialogVisibleBatchModify = true;
},
/**
* 寄售补货
*/
consignmentReplenishment() {
},
/**
* 寄售召回
*/
consignmentRecall() {
}
},
components: {
......@@ -145,5 +1079,5 @@ export default {
};
</script>
<style scoped>
@import "../../assets/css/store/list.min.css";
</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