Commit 7e422f37 by LJM

库存管理/现货库存:修改上架有效期可修改超过一个月

parent c66bc603
Showing with 19 additions and 12 deletions
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
<el-button type="primary" @click="submitHq">确 定</el-button> <el-button type="primary" @click="submitHq">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!--修改期弹窗--> <!--修改上架有效期弹窗-->
<el-dialog title="修改上架有效期" :visible.sync="dialogVisible3" width="900px"> <el-dialog title="修改上架有效期" :visible.sync="dialogVisible3" width="900px">
<div class="kc-mask"> <div class="kc-mask">
<el-table :data="cpdata" border max-height="600"> <el-table :data="cpdata" border max-height="600">
...@@ -300,10 +300,10 @@ ...@@ -300,10 +300,10 @@
<span v-else-if="scope.row.goods_status==3">下架</span> <span v-else-if="scope.row.goods_status==3">下架</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cp_time" label="上架有效期" width="160" :show-overflow-tooltip="true"></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"> <el-table-column label="修改上架有效期" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.cp_time" :picker-options="pickerOptions" type="date" placeholder="选择日期" style="width: 128px" value-format="yyyy-MM-dd"></el-date-picker> <el-date-picker v-model="scope.row.cp_time" :picker-options="pickerOptions(scope.row.cp_time)" type="date" placeholder="选择日期" style="width: 128px" value-format="yyyy-MM-dd"></el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -329,11 +329,7 @@ export default { ...@@ -329,11 +329,7 @@ export default {
name: "list", name: "list",
data() { data() {
return { return {
pickerOptions: { pickerOptions: {},
disabledDate(time) {
return time.getTime() + 24 * 3600 * 1000 * 7
}
},
total: 0, total: 0,
limit: 10, limit: 10,
page: 1, page: 1,
...@@ -369,6 +365,14 @@ export default { ...@@ -369,6 +365,14 @@ export default {
} }
this.getData(); this.getData();
this.getSkuRankList(); this.getSkuRankList();
this.pickerOptions = function (val) {
return {
disabledDate(time) {
let limit_date = new Date(val);
return time.getTime() > limit_date.getTime() + 3600 * 1000 * 24 * 30;
}
}
}
}, },
methods: { methods: {
/** /**
...@@ -582,6 +586,9 @@ export default { ...@@ -582,6 +586,9 @@ export default {
} else { } else {
//修改上架有效期 //修改上架有效期
this.dialogVisible3 = true; this.dialogVisible3 = true;
for (let i = 0; i < this.selectData.length; i++) {
this.selectData[i].cp_time_temp=this.selectData[i].cp_time;
}
this.cpdata = this.selectData; this.cpdata = this.selectData;
} }
}, },
...@@ -592,8 +599,8 @@ export default { ...@@ -592,8 +599,8 @@ export default {
var arr_ = {} var arr_ = {}
for (var i = 0; i < this.cpdata.length; i++) { for (var i = 0; i < this.cpdata.length; i++) {
arr_[this.cpdata[i]['goods_id']] = {} arr_[this.cpdata[i]['goods_id']] = {}
if (this.cpdata[i]['cp_times'] && this.cpdata[i]['cp_times'] != 'undefined') { if (this.cpdata[i]['cp_time'] && this.cpdata[i]['cp_time'] != 'undefined') {
arr_[this.cpdata[i]['goods_id']].cp_time = this.cpdata[i]['cp_times'] arr_[this.cpdata[i]['goods_id']].cp_time = this.cpdata[i]['cp_time']
} }
} }
this.$http('post', "/api/sku/updateSku", arr_).then(res => { this.$http('post', "/api/sku/updateSku", arr_).then(res => {
...@@ -602,8 +609,8 @@ export default { ...@@ -602,8 +609,8 @@ export default {
message: '修改成功', message: '修改成功',
type: 'success' type: 'success'
}); });
this.getData() this.getData();
this.dialogVisible3 = false this.dialogVisible3 = false;
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
......
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