Commit ed5c5b98 by 梁建民

Merge branch 'dev/ver/3.0.0' into 'master'

Dev/ver/3.0.0

See merge request !11
parents d77c6f95 0eafe7a4
......@@ -60,6 +60,7 @@
<div class="operation-button row verCenter">
<el-button type="primary" @click="exportChange">导出</el-button>
<el-button type="danger" @click="del">删除</el-button>
<el-button type="primary" @click="editInquire">报价</el-button>
</div>
<div class="text-tip row verCenter">
<i class="el-icon-warning"></i>
......@@ -718,6 +719,87 @@ export default {
})
},
/**
* 报价按钮
*/
editInquire() {
if (this.multipleSelection.length != 1) {
this.$message({
showClose: true,
message: '请选择一条询价信息',
type: 'warning'
});
return;
}
if (this.multipleSelection[0].i_status == -1) {
this.$message({
showClose: true,
message: '请勾选待报价和已报价的信息',
type: 'warning'
});
return;
}
this.$http('GET', "/api/inquiry/detail", {
inquiry_item_id: this.multipleSelection[0].id
}).then(res => {
if (res.code === 0) {
if (res.data.quote_list.length > 0) {
if(res.data.quote_list[0].quote_status != 1 || res.data.quote_list[0].quote_status != 7){
this.$message({
showClose: true,
message: '请勾选报价单状态为确认中和待确认',
type: 'warning'
});
return;
}
var data = res.data.quote_list[0];
this.title = '修改报价';
this.dialogVisible = true;
this.isModify = true; //标记修改状态
this.ruleForm.inquiry_sn = data.inquiry_sn;
this.ruleForm.inquiry_id = data.inquiry_id;
this.ruleForm.inquiry_items_id = data.inquiry_items_id;
this.ruleForm.quote_id = data.id; //编辑的时候需要
this.ruleForm.goods_name = data.goods_name;//赋值型号
this.ruleForm.brand_name = data.brand_name;//赋值品牌
this.ruleForm.quote_number = data.quote_number;//报价数量
data.price_origin = this.float(data.price_origin);//价格转换
this.ruleForm.price_origin = data.price_origin;//价格
this.ruleForm.currency = data.currency.toString();//币种
this.ruleForm.tax_rate = Number(data.tax_rate) * 100 + '%';//税率
this.ruleForm.batch = data.batch;//批次
this.ruleForm.delivery_int = data.delivery_info.delivery_int; //货期
this.ruleForm.delivery_unit_val = data.delivery_info.delivery_unit_val;//货期单位
this.ruleForm.mpq = data.mpq;//最小包装数量
this.ruleForm.moq = data.moq;//起订量
data.price_other = this.float(data.price_other);//其他费用
this.ruleForm.price_other = data.price_other;//其他费用
this.ruleForm.remark = data.remark;//备注
//报价有效期
if (data.expire_time == '') {
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24 * 2);
this.ruleForm.expire_time = start;
} else {
this.ruleForm.expire_time = data.expire_time;
}
}
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
});
},
/**
*匹配库存选择修改报价 一部分数据是来自当前报价的第一条
*/
editSku(row) {
......
<template>
<section class="goods pagex">
<div class="goods-con">
<el-form :inline="true" :model="formParam" label-width="95px" ref="ruleForm">
<el-form :inline="true" :model="formParam" label-width="95px" ref="ruleForm" :rules="rules">
<el-form-item>
<el-button type="primary" @click="submit('ruleForm')">提交</el-button>
<el-button @click="canel">取消</el-button>
......@@ -9,8 +9,8 @@
<div class="tip-title" style="margin-top: 0">
<p>基本信息</p>
</div>
<el-form-item label="物流公司:">
<el-select v-model="formParam.shipping_id" placeholder="请选择" prop="shipping_id">
<el-form-item label="物流公司:" prop="shipping_id">
<el-select v-model="formParam.shipping_id" placeholder="请选择">
<el-option value="13" label="联邦快递"></el-option>
<el-option value="12" label="DHL国际快递"></el-option>
<el-option value="1" label="顺丰速运"></el-option>
......@@ -26,7 +26,7 @@
<el-option value="17" label="UPS"></el-option>
</el-select>
</el-form-item>
<el-form-item label="物流单号:">
<el-form-item label="物流单号:" prop="shipment_number">
<el-input v-model="formParam.shipment_number" placeholder="请输入物流单号"></el-input>
</el-form-item>
<el-form-item label="发货时间:">
......@@ -83,6 +83,14 @@ export default {
return time.getTime() < Date.now() - 8.64e7;
}
},
rules: {
shipping_id: [
{required: true, message: '请选择物流公司', trigger: 'change'}
],
shipment_number: [
{required: true, message: '请输入物流单号', trigger: 'change'}
]
},
itemlist: [],
formParam: {
company_id: '',
......
......@@ -48,7 +48,8 @@
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="latest_notice" label="最新上传状态" min-width="20%" align="center"></el-table-column>
<el-table-column prop="count_success" label="导入成功" width="160" align="center"></el-table-column>
<el-table-column prop="count_error" label="导入失败" width="160" align="center"></el-table-column>
<el-table-column prop="create_time" label="上传时间" width="160" align="center"></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>
......
......@@ -544,6 +544,29 @@ export default {
this.multipleSelection = val;
},
/**
*
* @param date 时间类型
* @param type 是否加30天
* @returns {string}
*/
getTime(date, type) {
var date = new Date(date);
var year = date.getFullYear();
var month = date.getMonth() + 1;
if (type) {
var day = date.getDate() + 30;
} else {
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 + ' ' + hour + ':' + minute + ':' + second;
return timer;
},
/**
* 统计查看
* @param val
*/
......@@ -586,8 +609,19 @@ export default {
} else {
//修改上架有效期
this.dialogVisible3 = true;
let currentTime = new Date().getTime();//当前日期毫秒
let currentTimeFormate = this.getTime(new Date());//当前日期格式化
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.getTime(this.selectData[i].cp_time, true);
} else {
//上架有效期小于等于当前日期
this.selectData[i].cp_time = this.getTime(new Date(), true);
}
}
this.cpdata = this.selectData;
}
......
......@@ -12,6 +12,9 @@
<el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
<a class="downTemplateExport" @click="exportChange">导出失败文件</a>
<el-upload :data="fileData" :action="uploadUrl" :on-success="uploadChange" :show-file-list="false">
<el-button type="primary">导入</el-button>
</el-upload>
<el-tooltip 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>
......@@ -49,13 +52,13 @@
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag,Tooltip} from 'element-ui'
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag, Tooltip,Upload} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip);
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem).use(Tooltip).use(Upload);
export default {
name: "ListDetail",
data() {
......@@ -67,7 +70,12 @@ export default {
page: 1,
tableData: "",
maxPrice: [],
multipleSelection: []
multipleSelection: [],
uploadUrl: NODE_ENVS + '/api/uploadSku/import',
fileData: {
token: Tool.getCookie('token'),
type: 2//1覆盖 2新增
},
};
},
watch: {
......@@ -130,14 +138,34 @@ export default {
})
},
/**
* 导入
*/
uploadChange(file, fileList) {
var that = this;
if (file.code === 0) {
this.$message({
message: '导入成功',
type: 'success',
onClose() {
}
});
} else {
this.$message({
message: file.msg,
type: 'error'
});
}
},
/**
* 导出文件
*/
exportChange(){
exportChange() {
var url = NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + this.$route.query.sn + '&token=' + Tool.getCookie('token');
const newsUrl = this.$router.resolve(url);
window.open(url);
},
toUrl(url){
toUrl(url) {
var htmlArr = [];
htmlArr.push('<form action="' + url + '" method="post" id="form" style="display: none">' +
' <input type="submit" value="提交">' +
......
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