|
@@ -4,47 +4,27 @@
|
|
|
<page-title>编辑</page-title>
|
|
|
<div class="form">
|
|
|
<div class="form_box">
|
|
|
- <el-form
|
|
|
- :model="obj"
|
|
|
- :rules="batchFormRules"
|
|
|
- label-width="100px"
|
|
|
- label-position="left"
|
|
|
- >
|
|
|
+ <el-form :model="obj" :rules="batchFormRules" label-width="100px" label-position="left">
|
|
|
<div class="preview-group">
|
|
|
<el-form-item label="运价" prop="priceValue">
|
|
|
- <el-input
|
|
|
- v-model="obj.priceValue"
|
|
|
- placeholder="请输入内容"
|
|
|
- type="number"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="obj.priceValue" placeholder="请输入内容" type="number"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="物资" prop="materialNames">
|
|
|
<el-input v-model="obj.materialNames" readonly></el-input>
|
|
|
<el-button type="primary" class="btnml" @click="materialDrawer"
|
|
|
- >浏览物资</el-button
|
|
|
- >
|
|
|
+ >浏览物资</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行日期" prop="priceDate">
|
|
|
<el-date-picker
|
|
|
v-model="obj.priceDate"
|
|
|
type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
+ placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联动公式" prop="oilPriceFormula">
|
|
|
- <el-input
|
|
|
- v-model="obj.oilPriceFormula"
|
|
|
- placeholder="请选择油价联动公式"
|
|
|
- readonly
|
|
|
- disabled
|
|
|
- ></el-input>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="btn"
|
|
|
- @click="oilPriceFormulaClick"
|
|
|
- >浏览</el-button
|
|
|
- >
|
|
|
+ <el-input v-model="obj.oilPriceFormula" placeholder="请选择油价联动公式" readonly disabled></el-input>
|
|
|
+ <el-button type="primary" class="btn" @click="oilPriceFormulaClick"
|
|
|
+ >浏览</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="运力类型" prop="capacityTypeName">
|
|
|
<el-input v-model="obj.capacityTypeName" readonly></el-input>
|
|
@@ -56,10 +36,7 @@
|
|
|
<el-input v-model="obj.oilTypeName" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="油价变化率阈值" prop="oilpriceChangeThreshold">
|
|
|
- <el-input
|
|
|
- v-model="obj.oilpriceChangeThreshold"
|
|
|
- readonly
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="obj.oilpriceChangeThreshold" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计价单位" prop="type">
|
|
|
<el-input v-model="obj.type" readonly></el-input>
|
|
@@ -119,7 +96,7 @@
|
|
|
type="primary"
|
|
|
@click="selectLineClick"
|
|
|
:loading="selectLineLoading"
|
|
|
- ><i class="el-icon-search"></i>查询</el-button
|
|
|
+ ><i class="el-icon-search"></i>查询</el-button
|
|
|
>
|
|
|
<el-button type="primary" @click="addoilPriceFormula">确定</el-button>
|
|
|
</div>
|
|
@@ -152,7 +129,7 @@
|
|
|
type="primary"
|
|
|
@click="selectMaterial"
|
|
|
:loading="selectLineLoading"
|
|
|
- ><i class="el-icon-search"></i>查询</el-button
|
|
|
+ ><i class="el-icon-search"></i>查询</el-button
|
|
|
>
|
|
|
<el-button type="primary" @click="addMaterialList">确定</el-button>
|
|
|
</div>
|
|
@@ -218,16 +195,10 @@ export default {
|
|
|
capacityTypeId: 1
|
|
|
},
|
|
|
batchFormRules: {
|
|
|
- priceValue: [
|
|
|
- { required: true, message: "运价不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- priceDate: [
|
|
|
- { required: true, message: "执行日期不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- oilpriceBase: [
|
|
|
- { required: true, message: "油价基准不能为空", trigger: "blur" }
|
|
|
- ]
|
|
|
- },
|
|
|
+ priceValue: [{ required: true, message: '运价不能为空', trigger: 'blur' }],
|
|
|
+ priceDate: [{ required: true, message: '执行日期不能为空', trigger: 'blur' }],
|
|
|
+ oilpriceBase: [{ required: true, message: '油价基准不能为空', trigger: 'blur' }]
|
|
|
+ },
|
|
|
tableTop: [
|
|
|
{
|
|
|
prop: "materialName",
|
|
@@ -258,21 +229,17 @@ export default {
|
|
|
this.axios.get("/api/v1/uc/getTransRange").then(res => {
|
|
|
this.options = res.data.data;
|
|
|
});
|
|
|
- this.obj = this.$route.query.row;
|
|
|
- this.axios
|
|
|
- .post("/api/v1/ams/getwz", { priceId: this.obj.priceId })
|
|
|
- .then(res => {
|
|
|
- this.selectionList = res.data.data;
|
|
|
- });
|
|
|
+ this.obj=this.$route.query.row;
|
|
|
+ this.axios.post("/api/v1/ams/getwz",{"priceId":this.obj.priceId}).then(res => {
|
|
|
+ this.selectionList = res.data.data;
|
|
|
+ });
|
|
|
//根据price_id查询联动公式和列表传过去
|
|
|
- this.axios
|
|
|
- .post("/api/v1/ams/getcargonameId", { priceId: this.obj.priceId })
|
|
|
- .then(res => {
|
|
|
- (this.obj.oilPriceFormula = res.data.data.formulaString),
|
|
|
- (this.obj.cargonameId = res.data.data.formulaId);
|
|
|
- this.oilPriceFormulaId = this.obj.cargonameId;
|
|
|
- });
|
|
|
- this.rangeId = this.obj.rangeId;
|
|
|
+ this.axios.post("/api/v1/ams/getcargonameId",{"priceId":this.obj.priceId}).then(res => {
|
|
|
+ this.obj.oilPriceFormula = res.data.data.formulaString,
|
|
|
+ this.obj.cargonameId = res.data.data.formulaId;
|
|
|
+ this.oilPriceFormulaId=this.obj.cargonameId;
|
|
|
+ });
|
|
|
+ this.rangeId=this.obj.rangeId
|
|
|
},
|
|
|
methods: {
|
|
|
//打开线路的模态窗口
|
|
@@ -286,11 +253,10 @@ export default {
|
|
|
},
|
|
|
//选定联动公式确定
|
|
|
addoilPriceFormula() {
|
|
|
- (this.obj.oilPriceFormula = this.formulaString),
|
|
|
- (this.obj.cargonameId = this.oilPriceFormulaId);
|
|
|
+ this.obj.oilPriceFormula=this.formulaString,
|
|
|
+ this.obj.cargonameId = this.oilPriceFormulaId;
|
|
|
this.obj.capacityTypeId = this.form1.capacityTypeId;
|
|
|
- (this.obj.priceDate = this.form1.priceDate),
|
|
|
- (this.obj.oilTypeId = this.form1.oilTypeId);
|
|
|
+ this.obj.oilTypeId=this.form1.oilTypeId
|
|
|
|
|
|
this.oilPriceFormulaDrawer = false;
|
|
|
},
|
|
@@ -364,9 +330,9 @@ export default {
|
|
|
},
|
|
|
// 修改
|
|
|
onClickConfirm() {
|
|
|
- if (this.obj.priceValue == "" || this.obj.priceValue == undefined) {
|
|
|
- this.$message.info("修改前请填写运价!");
|
|
|
- return;
|
|
|
+ if (this.obj.priceValue==''|| this.obj.priceValue == undefined){
|
|
|
+ this.$message.info("修改前请填写运价!")
|
|
|
+ return;
|
|
|
}
|
|
|
let mapValue = {
|
|
|
cargonameId: this.oilPriceFormulaId,
|
|
@@ -381,15 +347,20 @@ export default {
|
|
|
mapList: this.selectionList,
|
|
|
priceId: this.obj.priceId
|
|
|
};
|
|
|
- this.axios.post("/api/v1/ams/updateTransPrice", mapValue).then(res => {
|
|
|
- if (res.data.data >= 1) {
|
|
|
- this.$message.success("修改成功!");
|
|
|
- this.$router.go(-1);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.axios
|
|
|
+ .post(
|
|
|
+ "/api/v1/ams/updateTransPrice",
|
|
|
+ mapValue
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.data >=1) {
|
|
|
+ this.$message.success("修改成功!")
|
|
|
+ this.$router.go(-1);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -421,12 +392,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .txt1 {
|
|
|
- display: inline-block;
|
|
|
- width: 150px;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
+ };
|
|
|
+ .txt1{
|
|
|
+ display: inline-block;
|
|
|
+ width: 150px;
|
|
|
+ text-align: right;
|
|
|
+};
|
|
|
}
|
|
|
.elForm {
|
|
|
margin-left: 30%;
|