Commit 22401b9c by LJM

js

parent 6a783d4a
Showing with 51 additions and 54 deletions
......@@ -41,7 +41,7 @@
<div class="btn-nav clr">
<el-button type="primary" @click="added">新增</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 class="data-box th-all">
<el-table :data="quote_list" border max-height="600" @selection-change="handleSelectionChange">
......@@ -60,7 +60,7 @@
</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="price_origin" label="价格" width="100">
<el-table-column prop="price_origin" label="价格" width="130" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.price_origin|floatZero }}</span>
</template>
......@@ -305,9 +305,9 @@
</el-input>
</el-form-item>
<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">
<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-select>
......@@ -571,8 +571,9 @@ export default {
});
},
getSkulist() {
//匹配库存
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_status/condition': 1,
goods_status: 1,
......@@ -599,7 +600,7 @@ export default {
}
},
checkBind(ids) {
if(ids){
if (ids) {
this.$http('get', "/api/quote/checkpinlist", {
inquiry_items_id: this.$route.query.id,
pin_type: (this.active == 1 ? 1 : 2),
......@@ -685,23 +686,6 @@ export default {
let date = row.create_time;
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) {
if (val == 1) {
this.ruleForm.tax_rate = '13%';
......@@ -709,14 +693,17 @@ export default {
this.ruleForm.tax_rate = '0%';
}
},
//提交
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (this.submitState) {
return
return;
}
if (valid) {
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%') {
submitData_.tax_rate = 0.13
} else {
......@@ -724,33 +711,37 @@ export default {
}
this.$http('post', "/api/quote/save", submitData_).then(res => {
if (res.code == 0) {
this.$http('post', "/api/quote/pin", {
inquiry_items_id: this.ruleForm.inquiry_items_id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_id: this.currentDataId
}).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
if (this.active == 1) {
//历史报价
//this.getHistory()
} else {
//库存匹配
this.getSkulist()
}
this.dialogVisible = false
this.submitState = 0;
})
this.getData();
//新增的时候不需要调用该接口
if (this.currentDataId != 0) {
this.$http('post', "/api/quote/pin", {
inquiry_items_id: this.ruleForm.inquiry_items_id,
pin_type: (this.active == 1 ? 1 : 2),
pin_obj_id: this.currentDataId
}).then(res => {
if (res.code == 0) {
this.$message({
message: '操作成功',
type: 'success'
});
this.getData()
} else {
this.$message({
message: res.msg,
type: 'warning'
});
}
})
}
if (this.active == 1) {
//历史报价
//this.getHistory()
} else {
//库存匹配
this.getSkulist()
}
this.dialogVisible = false
this.submitState = 0;
} else {
this.$message(res.msg);
......@@ -766,6 +757,7 @@ export default {
}
});
},
//新增报价
added() {
this.title = '新增';
this.dialogVisible = true;
......@@ -784,6 +776,7 @@ export default {
this.$refs['ruleForm'].resetFields();
})
},
//修改报价
modify() {
var arr = [];
if (this.multipleSelection.length == 0) {
......@@ -827,9 +820,12 @@ export default {
this.ruleForm.brand_s = res.data.quote_info.brand_name;
this.ruleForm.price_origin = res.data.quote_info.price_origin;
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_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.remark = res.data.quote_info.remark;
if (res.data.quote_info.expire_time == '0000-00-00 00:00:00') {
......@@ -859,6 +855,7 @@ export default {
},
//删除报价
del() {
var arr = [];
if (this.multipleSelection.length == 0) {
......@@ -923,7 +920,7 @@ export default {
this.ruleForm.goods_name = datap_.goods_name;
this.ruleForm.batch = datap_.batch;
this.ruleForm.price_origin = datap_.price_origin;
this.ruleForm.brand = datap_.brand_name;
this.ruleForm.brand_name = datap_.brand_name;
let brand_ssaa = [{
brand_id: datap_.brand_id,
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