1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <!-- 添加油价信息 -->
- <div class="addWagonLoad">
- <PageTitle>返回</PageTitle>
- <div class="form-box" style="margin-right: 10rem">
- <dil-form :formId="357" v-model="form1" ref="from1"></dil-form>
- </div>
- <div class="button-box">
- <el-button @click="cancel">取消</el-button>
- <el-button type="primary" @click="makeSure">确定</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- export default {
- components: { PageTitle },
- data() {
- return {
- form1: {},
- value: undefined,
- };
- },
- mounted() {},
- methods: {
- makeSure() {
- console.log(this.form1);
- let RmsOilPrice = {
- priceOilName:this.form1.priceOilName,
- priceId:this.form1.priceId,
- priceDate:this.form1.priceDate,
- priceValue:this.form1.priceValue,
- };
- if(
- RmsOilPrice.priceOilName ==null ||
- RmsOilPrice.priceDate ==null ||
- RmsOilPrice.priceValue ==null
- )this.$message.error("存在空值!");
- else
- this.axios
- .post(
- "/api/v1/rms/insertOilPrice" , RmsOilPrice
- )
- .then((res) => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- // this.$refs.table.refreshData();
- this.$router.go(-1);
- } else {
- this.$message.error("新增失败,可能存在重复!");
- }
- // this.$refs['table'].resetField();
- });
- },
- // 取消
- cancel() {
- this.$router.go(-1);
- },
- },
- };
- </script>
- <style lang='scss' >
- .button-box{
- display: flex;
- justify-content: center;
- .el-button{
- width: 80px;
- margin-right: 10px;
- }
- }
- .form-box{
- display: flex;
- justify-content: center;
- .el-form-item{
- display: flex;
- justify-content: center;
- .el-form-item__label{
- display: flex;
- align-items: center;
- }
- .el-form-item__content{
- .el-input{
- .el-input__inner{
- width: 250px;
- }
- }
- }
- }
- }
- </style>
|