qukaidi 4 anos atrás
pai
commit
002cfb7103

+ 3 - 1
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -1098,7 +1098,8 @@
                 >复制录入</el-button
               >
               <el-button type="primary" size="small"> 下载模板 </el-button>
-              <el-button size="small" type="primary">导入Execl</el-button
+              <el-button size="small" type="primary" @click="openUploadExcel"
+                >导入Execl</el-button
               >
             </el-col>
             <el-col style="display: flex; justify-content: flex-end">
@@ -1156,6 +1157,7 @@
               </div>
             </el-col>
           </el-row>
+          {{detailList}}
           <el-table
             :data="detailList"
             tooltip-effect="dark"

+ 0 - 41
src/views/Warehousing/inStock/downloadTemplate.vue

@@ -1,41 +0,0 @@
-<template>
-  <el-dialog
-    title="提示"
-    :visible.sync="templateVisible"
-    width="70%"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-  >
-    <span>这是一段信息</span>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="templateVisible = false">取 消</el-button>
-      <el-button type="primary" @click="templateVisible = false"
-        >确 定</el-button
-      >
-    </span>
-  </el-dialog>
-</template>
-
-<script>
-export default {
-  name: "inStock",
-  props: {
-    downloadTemplateVisible: {
-      type: Boolean,
-      default: false,
-    },
-  },
-  data() {
-    return {
-      templateVisible: false,
-    };
-  },
-  created() {},
-  methods: {},
-  watch: {
-    downloadTemplateVisible() {
-      this.templateVisible = this.downloadTemplateVisible;
-    },
-  },
-};
-</script>

+ 438 - 7
src/views/Warehousing/inStock/uploadExcel.vue

@@ -3,22 +3,253 @@
     title="提示"
     :visible.sync="uploadVisible"
     width="70%"
-    :before-close="handleClose"
     :close-on-click-modal="false"
   >
     <span>
-        
+      <div style="display: flex; justify-content: space-between">
+        <el-upload
+          :action="actionUrl"
+          multiple
+          :headers="headers"
+          :show-file-list="false"
+          :on-success="
+            (res) => {
+              handleSucces(res);
+            }
+          "
+        >
+          <el-button size="small" type="primary">上传Excel</el-button>
+        </el-upload>
+        <div style="margin: 0 10px">
+          <el-button
+            icon="el-icon-setting"
+            size="mini"
+            circle
+            @click="showSetting = !showSetting"
+          ></el-button>
+        </div>
+      </div>
+      <el-table :data="excelList">
+        <el-table-column type="selection" width="50" align="center" fixed />
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          fixed
+          align="center"
+        />
+        <el-table-column
+          v-for="(item, index) in getRowList"
+          :key="index"
+          :label="item.name"
+          :width="item.width"
+          :prop="item.label"
+          align="center"
+          :fixed="item.fixed"
+          :show-overflow-tooltip="true"
+          sortable
+        >
+          <template slot-scope="scope">
+            <span v-if="item.label == 'fBsdate'">
+              <el-date-picker
+                v-model="scope.row.fBsdate"
+                type="date"
+                style="width: 100%"
+                value-format="timestamp"
+                placeholder="入库日期"
+              >
+              </el-date-picker>
+            </span>
+            <span v-else-if="item.label == 'fGoodsid'">
+              <el-select
+                filterable
+                v-model="scope.row.fGoodsid"
+                style="width: 100%"
+                placeholder="请选择品名"
+              >
+                <el-option
+                  v-for="(item, index) in goodsOptions"
+                  :key="index.fId"
+                  :label="item.fName"
+                  :value="item.fId"
+                ></el-option>
+              </el-select>
+            </span>
+            <span v-else-if="item.label == 'fBusinessType'">
+              <el-select
+                filterable
+                v-model="scope.row.fBusinessType"
+                style="width: 100%"
+                placeholder="请选择商品属性"
+              >
+                <el-option
+                  v-for="(item, index) in fStorageTypeOptions"
+                  :key="index.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+              </el-select>
+            </span>
+            <span v-else-if="item.label == 'fMarks'">
+              <el-input
+                v-model="scope.row.fMarks"
+                style="width: 100%"
+                placeholder="请填写属性描述"
+              />
+            </span>
+            <span v-else-if="item.label == 'fWarehouselocid'">
+              <treeselect
+                v-model="scope.row.fWarehouselocid"
+                @select="getAlltree"
+                :options="fWarehouseidOptions"
+                :show-count="true"
+                :disable-branch-nodes="true"
+                placeholder="请选择库区"
+                style="z-index:10"
+              />
+            </span>
+            <span v-else-if="item.label == 'fQty'">
+              <el-input
+                v-input-limit="0"
+                v-model.number="scope.row.fQty"
+                style="width: 100%"
+                placeholder="件数"
+              />
+            </span>
+            <span v-else-if="item.label == 'fGrossweight'">
+              <el-input
+                v-model.number="scope.row.fGrossweight"
+                v-input-limit="2"
+                style="width: 100%"
+                placeholder="毛重"
+              />
+            </span>
+            <span v-else-if="item.label == 'fNetweight'">
+              <el-input
+                v-model.number="scope.row.fNetweight"
+                v-input-limit="2"
+                style="width: 100%"
+                placeholder="净重"
+              />
+            </span>
+            <span v-else-if="item.label == 'fPackagespecs'">
+              <el-input
+                v-model="scope.row.fPackagespecs"
+                style="width: 100%"
+                placeholder="包装规格"
+              />
+            </span>
+            <span v-else-if="item.label == 'fCntrno'">
+              <el-input
+                v-model="scope.row.fCntrno"
+                style="width: 100%"
+                placeholder="箱号"
+                v-Alphabet
+              />
+            </span>
+            <span v-else-if="item.label == 'fTruckno'">
+              <el-input
+                v-model="scope.row.fTruckno"
+                style="width: 100%"
+                placeholder="车号"
+                v-Alphabet
+              />
+            </span>
+            <span v-else>{{ scope.row[item.label] }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog
+        title="自定义列显示"
+        :visible.sync="showSetting"
+        width="700px"
+        v-dialogDrag
+        :close-on-click-modal="false"
+        append-to-body
+      >
+        <template slot="title">
+          <div class="avue-crud__dialog__header">
+            <span class="el-dialog__title">
+              <span
+                style="
+                  display: inline-block;
+                  width: 3px;
+                  height: 20px;
+                  margin-right: 5px;
+                  float: left;
+                  margin-top: 2px;
+                "
+              ></span>
+            </span>
+          </div>
+        </template>
+        <div>配置排序列数据(拖动调整顺序)</div>
+        <div style="margin-left: 17px">
+          <el-checkbox
+            v-model="allCheck"
+            label="全选"
+            @change="allChecked"
+          ></el-checkbox>
+        </div>
+        <div style="padding: 4px; display: flex; justify-content: center">
+          <draggable
+            v-model="setRowList"
+            group="site"
+            animation="300"
+            @start="onStart"
+            @end="onEnd"
+            handle=".indraggable"
+          >
+            <transition-group>
+              <div
+                v-for="item in setRowList"
+                :key="item.surface"
+                class="listStyle"
+              >
+                <div style="width: 500px" class="indraggable">
+                  <div class="progress" :style="{ width: item.width + 'px' }">
+                    <el-checkbox
+                      :label="item.name"
+                      v-model="item.checked"
+                      :true-label="0"
+                      :false-label="1"
+                      >{{ item.name }}
+                    </el-checkbox>
+                  </div>
+                </div>
+                <el-input-number
+                  v-model.number="item.width"
+                  controls-position="right"
+                  :min="1"
+                  :max="500"
+                  size="mini"
+                ></el-input-number>
+              </div>
+            </transition-group>
+          </draggable>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="showSetting = false">取 消</el-button>
+          <el-button @click="delRow" type="danger">重 置</el-button>
+          <el-button type="primary" @click="save()">确 定</el-button>
+        </span>
+      </el-dialog>
     </span>
     <span slot="footer" class="dialog-footer">
       <el-button @click="uploadVisible = false">取 消</el-button>
-      <el-button type="primary" @click="uploadVisible = false"
-        >确 定</el-button
-      >
+      <el-button type="primary" @click="uploadVisible = false">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
+import { getToken } from "@/utils/auth";
+import Cookies from "js-cookie";
+import { addSet, select, resetModule } from "@/api/system/set";
+import draggable from "vuedraggable";
+import Treeselect from "@riophae/vue-treeselect";
+import { listGoods } from "@/api/basicdata/goods";
+import { treeselect } from "@/api/basicdata/warehouse";
 export default {
   name: "inStock",
   props: {
@@ -27,13 +258,213 @@ export default {
       default: false,
     },
   },
+  components: {
+    draggable,
+    Treeselect,
+  },
   data() {
     return {
+      headers: {
+        Authorization: "Bearer " + getToken(),
+      },
+      actionUrl:
+        process.env.VUE_APP_BASE_API +
+        "/warehouseBusiness/inStock/importInstock", // 上传的图片服务器地址
       uploadVisible: false,
+      excelList: [],
+      drag: false,
+      setRowList: [],
+      getRowList: [],
+      allCheck: false,
+      showSetting: false,
+      tableDate: [
+        {
+          surface: "1",
+          label: "fBsdate",
+          name: "入库日期",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "2",
+          label: "fGoodsid",
+          name: "品名",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "3",
+          label: "fBusinessType",
+          name: "货物属性",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "4",
+          label: "fMarks",
+          name: "属性详情",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "5",
+          label: "fWarehouselocid",
+          name: "库区",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "6",
+          label: "fQty",
+          name: "件数",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "7",
+          label: "fGrossweight",
+          name: "毛重(kg)",
+          checked: 0,
+          width: 100,
+        },
+
+        {
+          surface: "8",
+          label: "fNetweight",
+          name: "净重(kg)",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "9",
+          label: "fPackagespecs",
+          name: "包装规格",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "10",
+          label: "fCntrno",
+          name: "箱号",
+          checked: 0,
+          width: 100,
+        },
+        {
+          surface: "11",
+          label: "fTruckno",
+          name: "车号",
+          checked: 0,
+          width: 100,
+        },
+      ],
+      goodsOptions: [],
+      fStorageTypeOptions: [],
+      fWarehouseidOptions: [],
     };
   },
-  created() {},
-  methods: {},
+  created() {
+    this.setRowList = this.tableDate;
+    this.getRowList = this.tableDate;
+    listGoods({ fStatus: 0, delFlag: 0 }).then((response) => {
+      this.goodsOptions = response.rows;
+    });
+    this.getDicts("storage_type").then((response) => {
+      this.fStorageTypeOptions = response.data;
+    });
+    this.getRow();
+  },
+  methods: {
+    init(fWarehouseid) {
+      treeselect(fWarehouseid).then((response) => {
+        this.fWarehouseidOptions = response.data;
+      });
+    },
+    handleSucces(res) {
+      if (res.code) {
+        this.excelList = res.data;
+      }
+    },
+    //列设置全选
+    allChecked() {
+      if (this.allCheck == true) {
+        this.setRowList.map((e) => {
+          return (e.checked = 0);
+        });
+      } else {
+        this.setRowList.map((e) => {
+          return (e.checked = 1);
+        });
+      }
+    },
+    //查询列数据
+    getRow() {
+      let that = this;
+      this.data = {
+        tableName: "上传Excel",
+        userId: Cookies.get("userName"),
+      };
+      select(this.data).then((res) => {
+        if (res.data.length != 0) {
+          this.getRowList = res.data.filter((e) => e.checked == 0);
+          this.setRowList = res.data;
+          this.setRowList = this.setRowList.reduce((res, item) => {
+            res.push({
+              surface: item.surface,
+              label: item.label,
+              name: item.name,
+              checked: item.checked,
+              width: item.width,
+              fixed: item.fixed,
+            });
+            return res;
+          }, []);
+        }
+      });
+    },
+    //重置列表
+    delRow() {
+      this.data = {
+        tableName: "上传Excel",
+        userId: Cookies.get("userName"),
+      };
+      resetModule(this.data).then((res) => {
+        if (res.code == 200) {
+          this.showSetting = false;
+          this.setRowList = this.$options.data().tableDate;
+          this.getRowList = this.$options.data().tableDate;
+        }
+      });
+    },
+    //保存列设置
+    save() {
+      this.showSetting = false;
+      this.data = {
+        tableName: "上传Excel",
+        userId: Cookies.get("userName"),
+        sysTableSetList: this.setRowList,
+      };
+      addSet(this.data).then((res) => {
+        if (res.code == 200) {
+          this.showSetting = false;
+          this.getRowList = this.setRowList.filter((e) => e.checked == 0);
+        }
+      });
+    },
+    //开始拖拽事件
+    onStart() {
+      this.drag = true;
+    },
+    //拖拽结束事件F
+    onEnd() {
+      this.drag = false;
+    },
+    getAlltree(tree) {
+      this.importList.fWarehouseInformation = tree.fWarehouseInformation;
+    },
+    handleClose() {
+      this.$emit("changeShow", "false");
+    },
+  },
   watch: {
     uploadExcelVisible() {
       this.uploadVisible = this.uploadExcelVisible;

+ 24 - 3
src/views/reportManagement/whgenleg/index.vue

@@ -713,7 +713,7 @@ export default {
         if (column.property === "fQtyD") {
           values = data.map((item) => Number(item["fQtyD"]));
         }
-                if (column.property === "fGrossweightC") {
+        if (column.property === "fGrossweightC") {
           values = data.map((item) => Number(item["fGrossweightC"]));
         }
         if (column.property === "fNetweightC") {
@@ -722,13 +722,25 @@ export default {
         if (column.property === "fQtyC") {
           values = data.map((item) => Number(item["fQtyC"]));
         }
+        if (column.property === "fQtyblc") {
+          values = data.map((item) => Number(item["fQtyblc"]));
+        }
+        if (column.property === "fGrossweightblc") {
+          values = data.map((item) => Number(item["fGrossweightblc"]));
+        }
+        if (column.property === "fNetweightblc") {
+          values = data.map((item) => Number(item["fNetweightblc"]));
+        }
         if (
           column.property === "fGrossweightD" ||
           column.property === "fNetweightD" ||
           column.property === "fQtyD" ||
           column.property === "fGrossweightC" ||
           column.property === "fNetweightC" ||
-          column.property === "fQtyC"
+          column.property === "fQtyC" ||
+          column.property === "fQtyblc" ||
+          column.property === "fGrossweightblc" ||
+          column.property === "fNetweightblc"
         ) {
           const values = data.map((item) => Number(item[column.property]));
           if (!values.every((value) => isNaN(value))) {
@@ -749,7 +761,7 @@ export default {
             if (column.property === "fQtyD") {
               sums[index] = sums[index].toFixed(2);
             }
-                 if (column.property === "fGrossweightC") {
+            if (column.property === "fGrossweightC") {
               sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
             }
             if (column.property === "fNetweightC") {
@@ -758,6 +770,15 @@ export default {
             if (column.property === "fQtyC") {
               sums[index] = sums[index].toFixed(2);
             }
+            if (column.property === "fGrossweightblc") {
+              sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
+            }
+            if (column.property === "fNetweightblc") {
+              sums[index] = (sums[index] / 1000).toFixed(2) + "吨";
+            }
+            if (column.property === "fQtyblc") {
+              sums[index] = sums[index].toFixed(2);
+            }
           }
         }
       });