huk il y a 3 ans
Parent
commit
3a2ac7b288
4 fichiers modifiés avec 103 ajouts et 102 suppressions
  1. 2 2
      build/utils.js
  2. 2 2
      config/index.js
  3. 58 58
      src/views/RMS/components/addOilPrice.vue
  4. 41 40
      src/views/RMS/components/oilPrice.vue

+ 2 - 2
build/utils.js

@@ -15,8 +15,8 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-let devModules = ['all'];
-// let devModules = ['index','statisticalReport','TMS','RMS'];
+// let devModules = ['all'];
+let devModules = ['index','statisticalReport','appoint','RMS'];
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;
 }

+ 2 - 2
config/index.js

@@ -56,9 +56,9 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    target: "http://172.16.33.166:8080",
+    // target: "http://172.16.33.166:8080",
     // target: "http://172.16.33.162:8019",
-    // target: "http://localhost:8019",
+    target: "http://192.168.1.102:8019",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"

+ 58 - 58
src/views/RMS/components/addOilPrice.vue

@@ -1,11 +1,11 @@
 <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>
+    <page-title>返回</page-title>
+    <div class="form_box" style="margin-right: 10rem">
+      <dil-form :formId="357" v-model="form1" ref="from1" @change="onchang"></dil-form>
     </div>
-    <div class="button-box">
+    <div class="button_box">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
     </div>
@@ -14,82 +14,82 @@
 
 <script>
 import PageTitle from "@/components/Page/Title";
-
+import { isNumber } from '@/utils/sharedJsFile'
 export default {
   components: { PageTitle },
   data() {
     return {
-      form1: {},
-      value: undefined,
+      form1: {
+        priceOilName:'',
+        priceValue:'',
+        priceDate:new Date(),
+        enableStatus:false,
+      },
     };
   },
-  mounted() {},
   methods: {
+    onchang(val){
+      if(val.enableStatus){
+        this.$message.warning('确认启用后将停用现在正在执行的油品价格')
+      }
+    },
     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
-        )
+      console.log(!isNumber(this.form1.priceValue));
+      let state = false;
+      if(!this.form1.priceOilName){
+        this.$message.warning('请填写油品名称')
+      }else if(!this.form1.priceValue){
+        this.$message.warning('请填写油品价格')
+      }else if(!isNumber(this.form1.priceValue)){
+        this.$message.warning('油品价格必修为整数或者小数')
+      }else{
+        // state = true;            
+      }
+      if(state){
+        let RmsOilPrice = this.form1;
+        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("新增失败,可能存在重复!");
+          if (res.data.code == "200") {
+            this.$message.success('新增成功');
+            this.cancel();
           }
-        //  this.$refs['table'].resetField();
         });
+      }
     },
     // 取消
     cancel() {
-      this.$router.go(-1);
+      this.$router.push("/oilPrice");
     },
   },
 };
 </script>
-<style lang='scss' >
- .button-box{
-    display: flex;
-    justify-content: center;
-    .el-button{
-      width: 80px;
-      margin-right: 10px;
+<style lang='scss'>
+.addWagonLoad{
+  .form_box{
+    margin-left: 40%;
+    padding-top: 30px;
+    width: 310px;
+    .el-form{
+      .el-form-item{
+        display: flex;
+        align-items: center;
+        .el-form-item__content{
+          .el-input{
+            width: 250px;
+          }
+          .el-switch{
+            margin-left: -250px;
+          }
+        }
+      }
     }
   }
-.form-box{
-  display: flex;
-  justify-content: center;
-  .el-form-item{
+  .button_box{
+    margin-left: 40%;
+    padding-top: 30px;
+    width: 310px;
     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>

+ 41 - 40
src/views/RMS/components/oilPrice.vue

@@ -7,7 +7,7 @@
         v-model="textInput"
         clearable>
       </el-input>
-      <el-button type="primary" class="btn"  @click="onclick">
+      <el-button type="primary" class="btn1"  @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
       <el-button type="primary" class="btn" @click="toInsert">
@@ -15,9 +15,29 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
+      <dilTable 
+        v-bind.sync="options"
+        :isKuang="isKuang"
+        @func="func"
+      >
         <el-table-column fixed="right" label="操作" width="100">
           <template slot-scope="scope">
+            <el-button
+              type="text"
+              size="small"
+              @click="onEnable(scope)"
+              v-if="enableStatus"
+            >
+              启用
+            </el-button>
+            <el-button
+              type="text"
+              size="small"
+              @click="onDeactivate(scope)"
+              v-else
+            >
+              停用
+            </el-button>
             <el-button
               type="text"
               size="small"
@@ -43,6 +63,9 @@ export default {
   name:"homeworkPath",
   data(){
     return{
+      isKuang:false,
+      //切换是否启用按钮和停用按钮
+      enableStatus:true,
       textInput: "" ,
       restaurants: [],
       options:{
@@ -52,64 +75,42 @@ export default {
     }
   },
   methods:{
+    func(res){
+      console.log(res);
+      this.isKuang = false;
+    },
     onclick(){
+      this.isKuang = true;
       this.options.requestUrl = "/api/v1/rms/getOilPriceResultList?apiId=380&con=" +this.textInput;
     },
-
+    //跳转到新增页面
     toInsert() {
       this.$router.push("/addOilPrice");
-
     },
     /*这里要改一改*/
     updateOilPrice(scope){
-      console.log(scope.row.priceId)
       this.$router.push("/editOilPrice/"+scope.row.priceId)
     },
     deleteOilPrice(scope){
-      this.$confirm("是否删除", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
-        .then(() => {
-          this.axios
-            .post("/api/v1/rms/deleteOilPrice/" + scope.row.priceId)
-            .then((res) => {
-              if (res.data.code == 200) {
-                this.$message({
-                  type: "success",
-                  message: "删除成功!",
-                });
-                this.$router.go(0);
-              } else {
-                this.$message({
-                  message: "删除失败",
-                  type: "warning",
-                });
-              }
-            });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "删除操作已取消!",
-          });
-        });
+      console.log(scope)
     },
   },
-
 }
-
 </script>
 
 <style lang="scss" scode>
 .steel_inbound{
   .sache{
-    padding: 1.25rem 0.375rem;
+    width: 100%;height: 100px;
+    display: flex;
+    align-items: center;
     .el-input {
-      width: 20%;
-      margin-right: 1.25rem;
+      width: 250px;
+      margin-left: 50px;
+      margin-right: 30px;
+    }
+    .btn1{
+      margin-right: 30px;
     }
   }
   }