Commit 22401b9c by LJM

js

parent 6a783d4a
Showing with 25 additions and 28 deletions
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="btn-nav clr"> <div class="btn-nav clr">
<el-button type="primary" @click="added">新增</el-button> <el-button type="primary" @click="added">新增</el-button>
<el-button type="primary" @click="modify">修改</el-button> <el-button type="primary" @click="modify">修改</el-button>
<el-button type="danger" @click="del">删除</el-button> <!-- <el-button type="danger" @click="del">删除</el-button>-->
</div> </div>
<div class="data-box th-all"> <div class="data-box th-all">
<el-table :data="quote_list" border max-height="600" @selection-change="handleSelectionChange"> <el-table :data="quote_list" border max-height="600" @selection-change="handleSelectionChange">
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column> <el-table-column prop="expire_status_val" label="是否有效" width="100"></el-table-column>
<el-table-column prop="quote_number" label="报价数量" width="100"></el-table-column> <el-table-column prop="quote_number" label="报价数量" width="100"></el-table-column>
<el-table-column prop="price_origin" label="价格" width="100"> <el-table-column prop="price_origin" label="价格" width="130" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span> <span>{{ scope.row.price_origin|floatZero }}</span>
</template> </template>
...@@ -305,9 +305,9 @@ ...@@ -305,9 +305,9 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="货期" prop="delivery_time_val" class="updatebox"> <el-form-item label="货期" prop="delivery_time_val" class="updatebox">
<el-input placeholder="" v-model="ruleForm.delivery_time_val" :value="ruleForm.delivery_time" @keyup.native="keyup(ruleForm.delivery_time_val)"></el-input> <el-input placeholder="" v-model="ruleForm.delivery_time_val" :value="ruleForm.delivery_time_val"></el-input>
<div class="selectdw"> <div class="selectdw">
<el-select v-model="ruleForm.delivery_time_unit" placeholder="天" class="placehoload" @change="unitChange"> <el-select v-model="ruleForm.delivery_time_unit" placeholder="天" class="placehoload">
<el-option label="工作日" value="工作日"></el-option> <el-option label="工作日" value="工作日"></el-option>
<el-option label="周" value="周"></el-option> <el-option label="周" value="周"></el-option>
</el-select> </el-select>
...@@ -571,8 +571,9 @@ export default { ...@@ -571,8 +571,9 @@ export default {
}); });
}, },
getSkulist() { getSkulist() {
//匹配库存
this.$http('get', "/api/sku/list", { this.$http('get', "/api/sku/list", {
brand_id: this.inquiry_info.brand_id, brand_name: this.inquiry_info.brand_name,
goods_name: this.inquiry_info.goods_name, goods_name: this.inquiry_info.goods_name,
'goods_status/condition': 1, 'goods_status/condition': 1,
goods_status: 1, goods_status: 1,
...@@ -599,7 +600,7 @@ export default { ...@@ -599,7 +600,7 @@ export default {
} }
}, },
checkBind(ids) { checkBind(ids) {
if(ids){ if (ids) {
this.$http('get', "/api/quote/checkpinlist", { this.$http('get', "/api/quote/checkpinlist", {
inquiry_items_id: this.$route.query.id, inquiry_items_id: this.$route.query.id,
pin_type: (this.active == 1 ? 1 : 2), pin_type: (this.active == 1 ? 1 : 2),
...@@ -685,23 +686,6 @@ export default { ...@@ -685,23 +686,6 @@ export default {
let date = row.create_time; let date = row.create_time;
return dateTimeFormate(date); return dateTimeFormate(date);
}, },
keyup(val) {
if (this.ruleForm.delivery_time_unit == '工作日') {
if (val >= 6) {
this.ruleForm.delivery_time_val = 6;
}
this.ruleForm.delivery_time = this.ruleForm.delivery_time_val;
} else if (this.ruleForm.delivery_time_unit == '周') {
this.ruleForm.delivery_time = this.ruleForm.delivery_time_val * 7;
}
},
unitChange(val) {
if (val == '周') {
this.ruleForm.delivery_time = this.ruleForm.delivery_time_val * 7;
} else {
this.ruleForm.delivery_time = this.ruleForm.delivery_time_val;
}
},
currentChange(val) { currentChange(val) {
if (val == 1) { if (val == 1) {
this.ruleForm.tax_rate = '13%'; this.ruleForm.tax_rate = '13%';
...@@ -709,14 +693,17 @@ export default { ...@@ -709,14 +693,17 @@ export default {
this.ruleForm.tax_rate = '0%'; this.ruleForm.tax_rate = '0%';
} }
}, },
//提交
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (this.submitState) { if (this.submitState) {
return return;
} }
if (valid) { if (valid) {
this.submitState = 1; this.submitState = 1;
let submitData_ = JSON.parse(JSON.stringify(this.ruleForm)) //delivery_time重新组装delivery_time_val+delivery_time_unit;
this.ruleForm.delivery_time = this.ruleForm.delivery_time_val + this.ruleForm.delivery_time_unit;
let submitData_ = this.ruleForm;
if (submitData_.tax_rate == '13%') { if (submitData_.tax_rate == '13%') {
submitData_.tax_rate = 0.13 submitData_.tax_rate = 0.13
} else { } else {
...@@ -724,6 +711,9 @@ export default { ...@@ -724,6 +711,9 @@ export default {
} }
this.$http('post', "/api/quote/save", submitData_).then(res => { this.$http('post', "/api/quote/save", submitData_).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.getData();
//新增的时候不需要调用该接口
if (this.currentDataId != 0) {
this.$http('post', "/api/quote/pin", { this.$http('post', "/api/quote/pin", {
inquiry_items_id: this.ruleForm.inquiry_items_id, inquiry_items_id: this.ruleForm.inquiry_items_id,
pin_type: (this.active == 1 ? 1 : 2), pin_type: (this.active == 1 ? 1 : 2),
...@@ -741,6 +731,8 @@ export default { ...@@ -741,6 +731,8 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
})
}
if (this.active == 1) { if (this.active == 1) {
//历史报价 //历史报价
//this.getHistory() //this.getHistory()
...@@ -750,7 +742,6 @@ export default { ...@@ -750,7 +742,6 @@ export default {
} }
this.dialogVisible = false this.dialogVisible = false
this.submitState = 0; this.submitState = 0;
})
} else { } else {
this.$message(res.msg); this.$message(res.msg);
...@@ -766,6 +757,7 @@ export default { ...@@ -766,6 +757,7 @@ export default {
} }
}); });
}, },
//新增报价
added() { added() {
this.title = '新增'; this.title = '新增';
this.dialogVisible = true; this.dialogVisible = true;
...@@ -784,6 +776,7 @@ export default { ...@@ -784,6 +776,7 @@ export default {
this.$refs['ruleForm'].resetFields(); this.$refs['ruleForm'].resetFields();
}) })
}, },
//修改报价
modify() { modify() {
var arr = []; var arr = [];
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
...@@ -827,9 +820,12 @@ export default { ...@@ -827,9 +820,12 @@ export default {
this.ruleForm.brand_s = res.data.quote_info.brand_name; this.ruleForm.brand_s = res.data.quote_info.brand_name;
this.ruleForm.price_origin = res.data.quote_info.price_origin; this.ruleForm.price_origin = res.data.quote_info.price_origin;
this.ruleForm.tax_rate = Number(res.data.quote_info.tax_rate) * 100 + '%'; this.ruleForm.tax_rate = Number(res.data.quote_info.tax_rate) * 100 + '%';
this.ruleForm.delivery_time = res.data.quote_info.delivery_time; this.ruleForm.delivery_time = res.data.quote_info.delivery_time;
this.ruleForm.delivery_time_val = this.ruleForm.delivery_time; this.ruleForm.delivery_time_val = this.ruleForm.delivery_time;
this.ruleForm.delivery_time_unit = '天' this.ruleForm.delivery_time_unit = this.ruleForm.delivery_time_unit;
this.ruleForm.moq = res.data.quote_info.moq; this.ruleForm.moq = res.data.quote_info.moq;
this.ruleForm.remark = res.data.quote_info.remark; this.ruleForm.remark = res.data.quote_info.remark;
if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') { if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
...@@ -859,6 +855,7 @@ export default { ...@@ -859,6 +855,7 @@ export default {
}, },
//删除报价
del() { del() {
var arr = []; var arr = [];
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
...@@ -923,7 +920,7 @@ export default { ...@@ -923,7 +920,7 @@ export default {
this.ruleForm.goods_name = datap_.goods_name; this.ruleForm.goods_name = datap_.goods_name;
this.ruleForm.batch = datap_.batch; this.ruleForm.batch = datap_.batch;
this.ruleForm.price_origin = datap_.price_origin; this.ruleForm.price_origin = datap_.price_origin;
this.ruleForm.brand = datap_.brand_name; this.ruleForm.brand_name = datap_.brand_name;
let brand_ssaa = [{ let brand_ssaa = [{
brand_id: datap_.brand_id, brand_id: datap_.brand_id,
brand_name: datap_.brand_name brand_name: datap_.brand_name
......
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