Browse Source

提交代码

zyf 3 years ago
parent
commit
f050bc7bf0

+ 1 - 1
config/index.js

@@ -66,7 +66,7 @@ let proxyTable = {
   // 所有数据的请求域名地址
   "/api/v1": {
     target: "http://172.16.33.166:80",
-    // target: "http://localhost:8080",
+    //target: "http://localhost:8080",
     // target: "http://192.168.1.101:8080",
     ws: true,
     pathRewrite: {

+ 56 - 2
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -166,6 +166,8 @@
         border
         style="width: 100%"
         highlight-current-row
+        ref="materialTableTop"
+        id="table"
       >
         <el-table-column
           v-for="(item, i) in materialTableTop"
@@ -185,6 +187,10 @@
                   class="textinput111"
                   v-model.number="scope.row.orderPlanWeight"
                   placeholder="(必填)"
+                  :id="'input' + scope.$index"
+                  @keyup.up.native="clicks(scope.$index)"
+                  @keyup.down.native="clickx(scope.$index)"
+                  @keyup.enter.native="singleDistribute"
                 ></el-input>
               </template>
               <!-- 米数 -->
@@ -315,6 +321,14 @@
                   >更改</el-button
                 >
               </template>
+              <!--规格型号-->
+              <template v-if="item.prop == 'Specification'">
+                <el-input
+                  style="width: 120px"
+                  class="textinput"
+                  v-model.number="scope.row.Specification"
+                ></el-input>
+              </template>
               <!-- 物资件数 -->
               <template v-if="item.prop == 'orderPlanWeight'">
                 <el-input
@@ -887,7 +901,8 @@ export default {
         {
           prop: "Specification",
           label: "规格型号",
-          width: "140px"
+          width: "140px",
+          slot: true
         },
         {
           prop: "orderPlanWeight",
@@ -946,7 +961,8 @@ export default {
       ignoreSaleOrderConsigneeTel: 0,
       restaurants: [],
       saleAreaId: null,
-      isNiTui: 0
+      isNiTui: 0,
+      datalistindex: 0
     };
   },
   created() {
@@ -2105,6 +2121,44 @@ export default {
           done();
         })
         .catch(_ => {});
+    },
+    //点击事件(上)
+    clicks(index){
+      console.log(index)
+      console.log(this.materialList)
+      console.log(this.materialList.length-1)
+      console.log('clicks=e',arguments);
+      if (index==0){
+        console.log("向上1")
+        //this.datalistindex=this.materialTableTop.length-1
+        document.getElementById("input" + (this.materialList.length-1)).focus()
+      }else {
+        console.log("向上2")
+        //this.$refs.materialTableTop.bodyWrapper.scrollTop=index
+        document.getElementById("input" + (index-1)).focus()
+      }
+
+    },
+    //点击事件(下)
+    clickx(index){
+      console.log(index)
+      console.log(this.materialList)
+      console.log(this.materialList.length-1)
+      if (index ==this.materialList.length-1){
+        console.log("向下1")
+        document.getElementById("input" + 0).focus()
+      }else {
+        console.log("向下2")
+        //this.datalistindex+=1
+        //this.$refs.materialTableTop.bodyWrapper.scrollTop=(index+1)*height
+        //var tbl=document.getElementById("table").childNodes[0]
+        //tbl.childNodes[len].childNodes[0].childNodes[0].focus()children[3]
+        //const rowlist=this.$refs.materialTableTop.$el.children[3].children[1].children[0]
+          //.children[1].children[len].children[3].children[0].children[0].children[0].focus()
+        //console.log(rowlist)
+        var nextInput = document.getElementById("input" + (index + 1));
+        nextInput.focus()
+      }
     }
   }
 };

+ 20 - 2
src/views/appoint/components/saleContract/editSaleOrder.vue

@@ -322,6 +322,14 @@
                   v-model.number="scope.row.orderPlanWeight"
                 ></el-input>
               </template>
+              <!--规格型号-->
+              <template v-if="item.prop=='Specification'">
+                <el-input
+                  class="textinput"
+                  v-model.number="scope.row.Specification"
+                  style="width:120px"
+                ></el-input>
+              </template>
               <!-- 米数 -->
               <template v-if="item.prop == 'meterNumber'">
                 <el-input
@@ -705,7 +713,7 @@ export default {
         {
           prop: "Specification",
           label: "规格型号",
-          width: "140"
+          width: "140",
         },
         {
           prop: "orderPlanWeight",
@@ -841,7 +849,8 @@ export default {
         {
           prop: "Specification",
           label: "规格型号",
-          width: "140"
+          width: "140",
+          slot: true
         },
         {
           prop: "orderPlanWeight",
@@ -1885,6 +1894,15 @@ export default {
           i++;
         }
       });
+      //确认规格型号格式是否正确
+      this.axios
+        .post("/api/v1/ams/queryFormat",this.selectionList)
+        .then(res =>{
+          if (res.data.code == "500"){
+            this.$message.error("规格型号不对");
+            return;
+          }
+        })
       if (i != 0) {
         this.$message.error("件数必填且请输入正整数");
         return;