|
@@ -4,23 +4,48 @@
|
|
|
<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-form-item>
|
|
|
<el-form-item label="运力类型" prop="capacityTypeName">
|
|
|
<el-input v-model="obj.capacityTypeName" readonly></el-input>
|
|
|
</el-form-item>
|
|
@@ -31,7 +56,10 @@
|
|
|
<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>
|
|
@@ -73,6 +101,41 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+ <!-- 油价联动公式模态框 -->
|
|
|
+ <el-drawer
|
|
|
+ title="请选择油价联动公式"
|
|
|
+ :visible.sync="oilPriceFormulaDrawer"
|
|
|
+ :direction="direction"
|
|
|
+ :before-close="handleClose"
|
|
|
+ close-on-press-escape
|
|
|
+ modal
|
|
|
+ wrapperClosable
|
|
|
+ size="40%"
|
|
|
+ >
|
|
|
+ <div class="selectText">
|
|
|
+ <!-- <span></span> -->
|
|
|
+ <el-input v-model="LineText" placeholder="请输入内容"></el-input>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="selectLineClick"
|
|
|
+ :loading="selectLineLoading"
|
|
|
+ ><i class="el-icon-search"></i>查询</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="addoilPriceFormula">确定</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="LineTable">
|
|
|
+ <vue-scroll :ops="ops" style="width:100%;height:100%">
|
|
|
+ <dilTable
|
|
|
+ v-bind.sync="oilPriceFormula"
|
|
|
+ @radio-change="currentRadioChange"
|
|
|
+ :isKuang="isKuang"
|
|
|
+ :loading="tableLoading"
|
|
|
+ :drawer="oilPriceFormulaDrawer"
|
|
|
+ @func="func"
|
|
|
+ ></dilTable>
|
|
|
+ </vue-scroll>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
<!-- 物资模态框 -->
|
|
|
<el-drawer
|
|
|
title="请选择物资"
|
|
@@ -89,7 +152,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>
|
|
@@ -155,11 +218,16 @@ export default {
|
|
|
capacityTypeId: 1
|
|
|
},
|
|
|
batchFormRules: {
|
|
|
- priceValue: [{ required: true, message: '运价不能为空', trigger: 'blur' }],
|
|
|
- priceDate: [{ required: true, message: '执行日期不能为空', trigger: 'blur' }],
|
|
|
- oilPriceFormula: [{ 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",
|
|
@@ -190,9 +258,21 @@ export default {
|
|
|
this.axios.get("/api/v1/uc/getTransRange").then(res => {
|
|
|
this.options = res.data.data;
|
|
|
});
|
|
|
- this.obj=this.$route.query.row;
|
|
|
- // console.log("obj "+JSON.stringify(this.obj))
|
|
|
- this.rangeId=this.obj.rangeId
|
|
|
+ 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;
|
|
|
},
|
|
|
methods: {
|
|
|
//打开线路的模态窗口
|
|
@@ -206,11 +286,11 @@ 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.priceDate = this.form1.priceDate),
|
|
|
+ (this.obj.oilTypeId = this.form1.oilTypeId);
|
|
|
|
|
|
this.oilPriceFormulaDrawer = false;
|
|
|
},
|
|
@@ -284,9 +364,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,
|
|
@@ -301,20 +381,15 @@ 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>
|
|
@@ -346,72 +421,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
-.txt1{
|
|
|
- display: inline-block;
|
|
|
- width: 150px;
|
|
|
- text-align: right;
|
|
|
-};
|
|
|
+ }
|
|
|
+ .txt1 {
|
|
|
+ display: inline-block;
|
|
|
+ width: 150px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
}
|
|
|
.elForm {
|
|
|
margin-left: 30%;
|
|
|
}
|
|
|
-.addTransportPrice {
|
|
|
- .form {
|
|
|
- display: flex;
|
|
|
- .form_box {
|
|
|
- width: 320px;
|
|
|
- margin-left: 30%;
|
|
|
- margin-top: 30px;
|
|
|
- margin-right: 20px;
|
|
|
- .el-form {
|
|
|
- .preview-group {
|
|
|
- .el-form-item {
|
|
|
- .el-form-item__label {
|
|
|
- display: inline-block;
|
|
|
- width: 70px !important;
|
|
|
- }
|
|
|
- .el-form-item__content {
|
|
|
- .el-select {
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- .el-input {
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .liulan {
|
|
|
- width: 120px;
|
|
|
- margin-top: 30px;
|
|
|
- .el-button {
|
|
|
- width: 100px !important;
|
|
|
- margin: auto;
|
|
|
- }
|
|
|
- .btn {
|
|
|
- margin-top: 54px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .button_box {
|
|
|
- margin-left: 45%;
|
|
|
- }
|
|
|
- .selectText {
|
|
|
- .el-input {
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- }
|
|
|
- .LineTable {
|
|
|
- width: 100%;
|
|
|
- height: 480px;
|
|
|
- overflow: hidden;
|
|
|
- margin-top: 10px;
|
|
|
- }
|
|
|
- .btnml {
|
|
|
- width: 250px;
|
|
|
- margin-left: 50px;
|
|
|
- }
|
|
|
+.button_box {
|
|
|
+ margin-left: 45%;
|
|
|
}
|
|
|
</style>
|