Просмотр исходного кода

fix:物料入库单,领料单

zhangjingyuan 3 лет назад
Родитель
Сommit
19924909d4

+ 71 - 104
src/views/component/weiZhiChangGui.vue

@@ -7,7 +7,7 @@
       <!-- <input placeholder="请输入内容" :value="showValue"  id="valueDom" @click="onChange"> -->
     </div>
     <!-- <el-input></el-input> -->
-    <div class="selectArea" v-if="ifshow">
+    <div class="selectArea" v-show="ifshow">
       <div @click="close" class="close-content"> <i class="el-icon-close"></i><el-button class="closeBtn">关闭视图</el-button></div>
       <div class="top-content">
         <div class="top-title">库存可视化</div>
@@ -84,10 +84,9 @@
               v-for="(item, index) in listData"
               :key="index"
             >
-              <div>
+              <div v-loading="loading">
                 <div class="goods-level">
                   <div class="level-dsc">
-                    <!-- 第{{ index | indexfilter(listData) }}层 -->
                     第{{ index }}层
                   </div>
                   <div class="goods-list">
@@ -95,18 +94,17 @@
                       v-for="(it, index) in listData[index]"
                       :key="index"
                       class="goods-dsc"
-                      :style="{
-                        background:
-                          it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a',
-                      }"
+                      :style="{ background: it.cun_fang_wei_zhi_ == '空' ? '' : '#67c23a'}"
                       @click="closeView(it)"
                     >
                       <div class="top-dsc">
                         <div class="position">
-                          <p>名称:{{ it.wu_liao_ming_chen || 空 }}</p>
+                          <div style="text-align: left;"><div style="width:38px;display: inline-block;vertical-align: top;">名称:</div><span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.wu_liao_ming_chen || '' }} </span></div>
                           <p>编码:{{ it.wu_liao_bian_ma_ || it.wu_liao_bian_ma_ }}</p>
                           <p>位置:{{ it.wei_zhi_ || it.cun_fang_wei_zhi_ }}</p>
-                          <p>货号:{{ it.huo_hao_ || "空" }}</p>
+                          <!-- <p >货号:{{ it.huo_hao_ || "空" }}</p> -->
+                          <div style="text-align: left;"><div style="width:38px;display: inline-block;vertical-align: top;">货号:</div><span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.huo_hao_ || "空" }} </span></div>
+
                         </div>
                         <div class="right-content">
                           <p>入库批号:{{ it.ru_ku_pi_hao_ || "空" }}</p>
@@ -116,16 +114,16 @@
                         </div>
                         <!-- <div class="condition">{{ it.cun_chu_tiao_jian }}</div> -->
                       </div>
-                      <div class="bottom-dsc">
-                        <!-- {{ it.wu_pin_ming_cheng | specimenFilters }} -->
-                      </div>
+                      <!-- <div class="bottom-dsc">
+                        {{ it.wu_pin_ming_cheng | specimenFilters }} 
+                      </div> -->
                     </div>
                   </div>
                 </div>
               </div>
-              <div class="goodshelf-name" v-if="index == 1">
+              <!-- <div class="goodshelf-name" v-if="index == 1">
                 {{ desString }}
-              </div>
+              </div> -->
             </div>
           </div>
         </div>
@@ -167,7 +165,8 @@ export default {
       secondshow: false,
       ifshow: false,
       showValue: "",
-      value:"111"
+      value:"",
+      loading:true
     };
   },
   props: {
@@ -182,12 +181,12 @@ export default {
       type:Boolean,
       default: false
     },
-    component_12u7eoo:{
-      type:String,
-      default(){
-        return 111
-      }
-    }
+    // component_12u7eoo:{
+    //   type:String,
+    //   default(){
+    //     return 111
+    //   }
+    // }
     
   },
   filters: {
@@ -225,64 +224,51 @@ export default {
       }
     },
   },
-  mounted() {
-    this.loadQueryData();
-    this.firstLoadViewData();
-    this.firstLoadQuyu("试剂库1");
-  },
-  beforeDestroy() {
-    console.log(this.formData, "formData");
-    let id = this.formData.id;
-    let Status = this.formData.anNiugTai;
-    let ming_chen = this.formInline.cang_ku_ming_chen_value;
-    let weizhi = this.showValue;
-    console.log(weizhi, ming_chen);
-    return
-    if (weizhi !="" &&Status =="已入库") {
-      // 数据库更新
-      curdPost(
-        "update",
-        '{"tableName":"t_mjwlgl","paramWhere":{"wai_jian_":"' +
-          id +
-          '",},"paramCond":{"cang_ku_ming_chen":"' +
-          ming_chen +
-          '","cun_fang_wei_zhi_":"' +
-          weizhi +
-          '"}}'
-      )
-        .then((res) => {
-          this.$message({
-            message: "当前物料位置更新状态更新成功",
-            type: "success",
-          });
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    }
-  },
+  // mounted() {
+  //   this.loadQueryData();
+  //   this.firstLoadViewData();
+  //   this.firstLoadQuyu("试剂库1");
+  // },
+  // beforeDestroy() {
+  //   let id = this.formData.id;
+  //   let Status = this.formData.anNiugTai;
+  //   let ming_chen = this.formInline.cang_ku_ming_chen_value;
+  //   let weizhi = this.showValue;
+  //   // return
+  //   // if (weizhi !="" &&Status =="已入库") {
+  //   //   // 数据库更新
+  //   //   curdPost(
+  //   //     "update",
+  //   //     '{"tableName":"t_mjwlgl","paramWhere":{"wai_jian_":"' +
+  //   //       id +
+  //   //       '",},"paramCond":{"cang_ku_ming_chen":"' +
+  //   //       ming_chen +
+  //   //       '","cun_fang_wei_zhi_":"' +
+  //   //       weizhi +
+  //   //       '"}}'
+  //   //   )
+  //   //     .then((res) => {
+  //   //       this.$message({
+  //   //         message: "当前物料位置更新状态更新成功",
+  //   //         type: "success",
+  //   //       });
+  //   //     })
+  //   //     .catch((err) => {
+  //   //       console.log(err);
+  //   //     });
+  //   // }
+  // },
   methods: {
 
-    onChange(e){
-      console.log("onChange")
-
-    },
     closeView(value1) {
-      // let values = value[0];
-      // console.log(this.formData, "formData");
-      // console.log(value1);
-      //  this.showValue = value[0].wei_zhi_?value[0].wei_zhi_:value[0].cun_fang_wei_zhi_;
       if (value1.wei_zhi_) {
         this.showValue = value1.wei_zhi_;
       } else if (value1.cun_fang_wei_zhi_) {
         this.showValue = value1.cun_fang_wei_zhi_;
       }
-      //  values.cun_fang_wei_zhi_;
-      // console.log(this.showValue)
       const name = "cunFangWeiZhi"; //其他字段属性
       const value= this.showValue; //字段的值
       this.$emit("change-data", name, value);
-
       const name2 = "biaoZhunZhi"; //其他字段属性
       const value2= this.formInline.cang_ku_ming_chen_value; //字段的值
       this.$emit("change-data", name2, value2);
@@ -323,6 +309,8 @@ export default {
           return "SJG";
         case "冰箱":
           return "BX";
+        case "危化品柜":
+           return "WHPG";
         default:
           "";
       }
@@ -365,28 +353,12 @@ export default {
       const labelsMap = {}; // map存储
       let typeData = [];
       let typeArr = [];
-      var sqltype =
-        `select DISTINCT wei_zhi_ from t_ck where wei_zhi_ like ` +
-        "'%" +
-        py +
-        "%'" +
-        " and cang_ku_ming_chen ='" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' ORDER BY wei_zhi_ ASC ";
-      let classSql =
-        `select DISTINCT SUBSTR(wei_zhi_,1,6) AS wei_zhi_  from t_ck where wei_zhi_ like ` +
-        "'%" +
-        py +
-        "%'" +
-        " and cang_ku_ming_chen ='" +
-        this.formInline.cang_ku_ming_chen_value +
-        "' ORDER BY wei_zhi_ ASC ";
+      var sqltype =`select DISTINCT wei_zhi_ from t_ck where wei_zhi_ like ` + "'%" + py + "%'" + " and cang_ku_ming_chen ='" +this.formInline.cang_ku_ming_chen_value + "' ORDER BY wei_zhi_ ASC ";
+      let classSql = `select DISTINCT SUBSTR(wei_zhi_,1,6) AS wei_zhi_  from t_ck where wei_zhi_ like ` +"'%" +  py +"%'" + " and cang_ku_ming_chen ='" +this.formInline.cang_ku_ming_chen_value + "' ORDER BY wei_zhi_ ASC ";
       curdPost("sql", sqltype).then((res) => {
         typeData = res.variables.data; //查询具体仓库某个货架的所有位置
-        // console.log(typeData, "位置");
         curdPost("sql", sql).then((res) => {
           datas = res.variables.data; //具体仓库某个货架的所有物料数据
-          // console.log(datas, "数据");
           typeData.forEach((item) => {
             typeArr[item.wei_zhi_] = [];
             if (datas.length == 0) {
@@ -404,7 +376,6 @@ export default {
               });
             }
           });
-          // console.log(typeArr, "22222222222222");
           curdPost("sql", classSql).then((res2) => {
             let resData = res2.variables.data;
             resData.forEach((item) => {
@@ -413,23 +384,23 @@ export default {
               labelsMap[layer] = [];
               for (var prop in typeArr) {
                 if (typeArr.hasOwnProperty(prop)) {
-                  // console.log(prop,item.wei_zhi_);
                   if (prop.includes(item.wei_zhi_)) {
                     labelsMap[layer].push(...typeArr[prop]);
-                    //  console.log(labelsMap)
                   }
                 }
               }
             });
-            // console.log(labelsMap, "数据");
             this_.listData = labelsMap;
+            console.log(this.listData)
+            if(this_.listData[1].length >0){
+              this_.loading = false;
+            }
           });
         });
       });
     },
     qu_yu_Event(e) {
-      //点击区域事件,加载可视化视\
-      console.log(this.formData, "formData");
+      //点击区域事件,加载可视化视
       let value = e.target.innerText;
       if (value.includes("(")) {
         let index = value.indexOf("(");
@@ -439,14 +410,7 @@ export default {
       let py = value.split("号")[1].replace(/^\s*/g, "");
       let quyu = this.sqlSlice(py);
       let type = (quyu + num).replace(/^\s*/g, "");
-      var sqlString =
-        `select * from t_mjwlgl where cun_fang_wei_zhi_ like  ` +
-        "'%" +
-        type +
-        "%'" +
-        "  and cang_ku_ming_chen = '" +
-        this.formInline.cang_ku_ming_chen_value +
-        "'";
+      var sqlString =`select * from t_mjwlgl where cun_fang_wei_zhi_ like  ` +"'%" +type +"%'" + "  and cang_ku_ming_chen = '" + this.formInline.cang_ku_ming_chen_value +"'";
       // console.log(sqlString, type);
       this.queryLoad(sqlString, type);
       this.formInline.qu_yu_value = value;
@@ -456,6 +420,9 @@ export default {
       this.desShow = true;
     },
     clickBtn() {
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.firstLoadQuyu("试剂库1");
       this.ifshow = !this.ifshow;
     },
   },
@@ -585,8 +552,8 @@ p {
     display: flex;
     box-sizing: border-box;
     height: calc(100vh - 240px);
-    overflow-x: hidden;
-    overflow-y: scroll;
+    // overflow-x: hidden;
+    // overflow-y: scroll;
     .black {
       position: fixed;
       top: 300px;
@@ -652,14 +619,14 @@ p {
                 display: flex;
                 justify-content: space-between;
                 font-size: 12px;
-                height: 18px;
+                // height: 18px;
                 line-height: 18px;
                 .position > p {
                   text-align: left;
                   // color: #fbe8ff;
                 }
                 .right-content > p {
-                  margin-left: 15px;
+                  // margin-left: 15px;
                   // color: #fbe8ff;
                   text-align: left;
                 }

+ 12 - 22
src/views/system/jbdScan/goods/caigourukudan.vue

@@ -29,31 +29,18 @@
                     </div>
                     <div style="font-size: 10px">
                       供应商:<span style="margin-left: 10px">{{
-                        item1[0].gong_ying_shang_
-                          | gongyingshang(gongyingshangList)
+                        item1[0].gong_ying_shang_| gongyingshang(gongyingshangList)
                       }}</span>
                     </div>
                   </div>
                   <div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
+                    <div style="margin-left: 20px;margin-right: 5px;font-size: 10px;">
                       采购订单编号:<span style="margin-left: 10px">
                         {{ item1[0].cai_gou_ding_dan_ }}</span
                       >
                     </div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
-                      日期   :<span style="margin-left: 10px">{{
+                    <div style=" margin-left: 20px; margin-right: 5px; font-size: 10px;">
+                      日期:<span style="margin-left: 10px">{{
                         item1[0].dao_ku_ri_qi_
                       }}</span>
                     </div>
@@ -61,7 +48,7 @@
                 </div>
 
                 <div>
-                  <table border="1">
+                  <table :border="1">
                     <thead>
                       <tr>
                         <th style="width: 40px">序号</th>
@@ -93,7 +80,7 @@
                         <td style="width: 60px">{{ item1[0].huo_hao_ }}</td>
                         <td style="width: 60px">{{ item1[0].pi_hao_ }}</td>
                         <td style="width: 80px">{{ item1[0].gui_ge_ }}</td>
-                        <td style="width: 120px">{{ item1[0].chang_jia_ }}</td>
+                        <td style="width: 120px">{{ item1[0].chang_jia_| gongyingshang(gongyingshangList) }}</td>
                         <td style="width: 45px">
                           {{ item1[0].dao_huo_shu_liang }}
                         </td>
@@ -102,11 +89,11 @@
                           {{ item1[0].dan_jia_han_shui_ }}
                         </td>
                         <td style="width: 45px">{{ item1[0].shui_lv_ }}</td>
-                        <td style="width: 45px">{{ item1[0].dan_jia_ }}</td>
+                        <td style="width: 45px">{{ item1[0].dan_jia_|numToFixed(item1[0].dan_jia_)}}</td>
                         <td style="width: 45px">{{ item1[0].shui_e_ }}</td>
-                        <td style="width: 45px">{{ item1[0].jin_e_ }}</td>
+                        <td style="width: 45px">{{ item1[0].jin_e_ |numToFixed(item1[0].jin_e_)}}</td>
                         <td style="width: 60px">
-                          {{ item1[0].han_shui_he_ji_ }}
+                          {{ item1[0].han_shui_he_ji_|numToFixed(item1[0].han_shui_he_ji_) }}
                         </td>
                       </tr>
                       <tr>
@@ -217,6 +204,9 @@ export default {
         }
       }
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
     bumenfilters: function (value, list) {
       for (let i = 0; i < list.length; i++) {
         if (value == list[i].ID_) {

+ 51 - 31
src/views/system/jbdScan/goods/chnangguirukudan.vue

@@ -35,24 +35,10 @@
                     </div>
                   </div>
                   <div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
-                      采购订单编号:<span style="margin-left: 10px">{{
-                        item1.cai_gou_ding_dan_
-                      }}</span>
+                    <div style="margin-left: 20px;margin-right: 5px;font-size: 10px; ">
+                      采购订单编号:<span style="margin-left: 10px;">{{item1.cai_gou_ding_dan_}}</span>
                     </div>
-                    <div
-                      style="
-                        margin-left: 20px;
-                        margin-right: 5px;
-                        font-size: 10px;
-                      "
-                    >
+                    <div style="margin-left: 20px; margin-right: 5px; font-size: 10px; ">
                       日期 :<span style="margin-left: 10px">{{
                         item1.dao_huo_ri_qi_
                       }}</span>
@@ -60,7 +46,7 @@
                   </div>
                 </div>
                 <div>
-                  <table border="1">
+                  <table :border="1">
                     <thead>
                       <tr>
                         <th style="width: 40px">序号</th>
@@ -90,19 +76,15 @@
                         <td style="width: 60px">{{ item.huo_hao_ }}</td>
                         <td style="width: 60px">{{ item.pi_hao_ }}</td>
                         <td style="width: 80px">{{ item.gui_ge_xing_hao_ }}</td>
-                        <td style="width: 120px">
-                          {{ item.gong_ying_shang_ }}
-                        </td>
+                        <td style="width: 120px"> {{ item.gong_ying_shang_| gongyingshang(gongyingshangList) }} </td>
                         <td style="width: 45px">{{ item.shu_liang_ }}</td>
                         <td style="width: 45px">{{ item.dan_wei_ }}</td>
-                        <td style="width: 60px">
-                          {{ item.dan_jia_han_shui_ }}
-                        </td>
+                        <td style="width: 60px">{{ item.dan_jia_han_shui_ }}</td>
                         <td style="width: 45px">{{ item.shui_lv_ }}</td>
-                        <td style="width: 45px">{{ item.dan_jia_ }}</td>
-                        <td style="width: 45px">{{ item.shui_e_ }}</td>
-                        <td style="width: 45px">{{ item.jin_e_ }}</td>
-                        <td style="width: 60px">{{ item.han_shui_he_ji_ }}</td>
+                        <td style="width: 45px">{{ item.dan_jia_|numToFixed}}</td>
+                        <td style="width: 45px"> {{ item.dan_jia_han_shui_|shuieToFixed(item.shu_liang_,item.dan_jia_) }}</td>
+                        <td style="width: 45px">{{ item.dan_jia_|jineToFixed(item.shu_liang_)}}</td>
+                        <td style="width: 60px">{{ item.dan_jia_han_shui_|jineToFixed(item.shu_liang_) }}</td>
                       </tr>
                       <tr>
                         <td style="width: 30px"></td>
@@ -117,9 +99,9 @@
                         <td style="width: 60px"></td>
                         <td style="width: 45px"></td>
                         <td style="width: 45px">合计:</td>
-                        <td style="width: 45px">{{ item1.addshuie }}</td>
-                        <td style="width: 45px">{{ item1.addjine }}</td>
-                        <td style="width: 60px">{{ item1.addhanshuiheji }}</td>
+                        <td style="width: 45px">{{ item1|addshuieToFixed}}</td>
+                        <td style="width: 45px">{{ item1|addjineToFixed}}</td>
+                        <td style="width: 60px">{{ item1|addhshjToFixed }}</td>
                       </tr>
                     </tbody>
                   </table>
@@ -212,6 +194,44 @@ export default {
         }
       }
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
+    jineToFixed:function(a,b){
+     let value = (a * 1) * (b * 1);
+     
+     return value.toFixed(2)
+    },
+    shuieToFixed:function(a,b,c){
+      let jine = b*1*(c*1);
+      let hshj = b*1*(a*1);
+      let value = hshj - jine;
+      console.log(a,b,c)
+      return value.toFixed(2);
+    },
+    addshuieToFixed:function(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        adds =adds+(((item.shu_liang_*1) * (item.dan_jia_han_shui_*1)) - ((item.shu_liang_*1) * (item.dan_jia_*1)) );
+      })
+      return adds.toFixed(2);
+    },
+    addjineToFixed(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        debugger
+        adds =adds+((item.shu_liang_*1) * (item.dan_jia_*1));
+      })
+      return adds.toFixed(2);
+    },
+    addhshjToFixed(arr){
+      let adds =0;
+      arr.forEach(item=>{
+        debugger
+        adds =adds+((item.shu_liang_*1) * (item.dan_jia_han_shui_*1));
+      })
+      return adds.toFixed(2);
+    },
     bumenfilters: function (value, list) {
       // debugger
       for (let i = 0; i < list.length; i++) {

+ 9 - 2
src/views/system/jbdScan/goods/lingliaodan.vue

@@ -73,8 +73,8 @@
                         </td>
                         <td style="width: 60px">{{ item.shu_liang_ }}</td>
                         <td style="width: 60px">{{ item.dan_wei_ }}</td>
-                        <td style="width: 60px">{{ item.dan_jia_ }}</td>
-                        <td style="width: 60px">{{ item.jin_e_ }}</td>
+                        <td style="width: 60px">{{ item.dan_jia_ |numToFixed(item.dan_jia_) }}</td>
+                        <td style="width: 60px">{{ item.dan_jia_|jineToFixed(item.shu_liang_ ) }}</td>
                         <td style="width: 80px">{{ item.yong_tu_ }}</td>
                         <td style="width: 120px">{{ item.bei_zhu_ }}</td>
                       </tr>
@@ -174,6 +174,13 @@ export default {
         return res.variables.data[0].NAME_;
       });
     },
+    numToFixed: function (value) {
+      return (value*1).toFixed(2)
+    },
+    jineToFixed:function(a,b){
+     let value = (a * 1) * (b * 1)
+     return value.toFixed(2)
+    },
     bumenfilters: function (value, list) {
       for (let i = 0; i < list.length; i++) {
         if (value == list[i].ID_) {

+ 1 - 1
src/views/system/jbdScan/goods/liuyangData.vue

@@ -72,7 +72,7 @@
         </div>
       </div>
       <div class="body-content" v-if="viewShow">
-        <div class="right-view">
+        <div class="right-view" v-if="listData.length >0">
           <div class="goods-items">
             <div
               class="show-demo"