From 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期二, 06 八月 2024 11:16:58 +0800
Subject: [PATCH] gitlab上面的wms转移到公司git

---
 src/views/operate/inventoryAdjustment/index.vue |  827 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 544 insertions(+), 283 deletions(-)

diff --git a/src/views/operate/inventoryAdjustment/index.vue b/src/views/operate/inventoryAdjustment/index.vue
index aaa3b44..9a46898 100644
--- a/src/views/operate/inventoryAdjustment/index.vue
+++ b/src/views/operate/inventoryAdjustment/index.vue
@@ -1,340 +1,523 @@
 <template>
   <div class="rightContent">
+    <div class="label-fixed-element">
+      <span>搴撳瓨璋冩暣</span>
+    </div>
     <div class="top">
       <SearchCommonView
-        :add-title="addTitle"
-        :show-discard="showDiscard"
-        :show-apply="false"
-        :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
+        :add-title="'鏂板缓'"
+        :placeholder="'璇疯緭鍏ュ崟鍙�/鏉ユ簮鍗曟嵁'"
         :amount-view="false"
-        @addCommonClick="addProductClick"
+        :search-task-map="searchTaskMap"
+        @addCommonClick="addBtnClick"
         @searchClick="getList"
-        @discardBtnClick="discardBtnClick"
-        @applyBtnClick="applyBtnClick"
+        @delSelectClick="delSelectClick"
       />
     </div>
-    <div class="list-view">
-      <div class="table">
-        <CommonFormTableView
-          ref="tablelistRef"
-          :isOperateAdd="false"
-          :product-table-list="tableList"
-          @inputContent="inputContent"
-          @selLocationClick="selLocationClick"
-          @selProductClick="selProductClick"
-          @tableRowClick="tableRowClick"
-        >
-          <template slot="tableButton">
-            <el-table-column label="鎿嶄綔" width="180" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.isEdit" @click.stop="handleHistoryClick(scope.row)" class="yes-cursor">
-                  <i class="el-icon-refresh-left"></i>
-                  <span>鍘嗗彶</span>
-                </span>
-                <!-- <span v-if="scope.row.isSet" @click="handleSetClick(scope)" class="margin_left_5px">
-                  <i class="el-icon-setting"></i>
-                  <span>璁剧疆</span>
-                </span> -->
-                <template v-if="scope.row.status == 3">
-                  <span @click.stop="handleUseClick(scope.row)" class="margin_left_5px cursor_pointer">
-                    <i class="el-icon-document"></i>
-                    <span>搴旂敤</span>
-                  </span>
-                  <!-- <span @click="handleCleanupClick(scope)" class="margin_left_5px">
-                    <i class="el-icon-delete"></i>
-                    <span>娓呴櫎</span>
-                  </span> -->
+    <div class="body">
+      <!-- <div class="body-card"> -->
+      <div class="content-top">
+        <div class="list-view">
+          <TableCommonView
+            ref="tableListRef"
+            :table-list="tableList"
+            @selTableCol="selTableCol"
+            @tableRowClick="tableRowClick"
+            :selectClassRow="selectRow"
+          >
+            <template slot="tableButton">
+              <el-table-column label="鎿嶄綔" width="100">
+                <template slot-scope="scope">
+                  <el-button @click="viewEditClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+                  <el-button
+                    v-if="scope.row.status !== 4 && scope.row.status !== 5"
+                    @click="viewEditClick(scope.row, '缂栬緫')"
+                    type="text"
+                    size="small"
+                    >缂栬緫</el-button>
                 </template>
-              </template>
-            </el-table-column>
-          </template>
-        </CommonFormTableView>
+              </el-table-column>
+            </template>
+          </TableCommonView>
+          <div class="btn-pager">
+            <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+          </div>
+        </div>
       </div>
-      <div class="btn-pager">
-        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      <div class="content-bottom">
+        <div class="bottom-tabs">
+          <div
+            class="tab-pane"
+            @click="getTab(0)"
+            :style="{
+              background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
+              color: TabsIndex == 0 ? '#fff' : '#666'
+            }"
+          >
+            浜у搧淇℃伅
+          </div>
+        </div>
+        <div class="list-view">
+          <TableCommonView :table-list="productTableList" @selTableCol="selBottomTableCol">
+            <template slot="tableButton">
+              <el-table-column label="杈呭姪鏁伴噺" width="160">
+                <template slot-scope="scope">
+                  <span>{{scope.row.moreUnitList.map(item=>item.amount).join('/')}}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="杈呭姪鍗曚綅" width="160">
+                <template slot-scope="scope">
+                  <span>{{scope.row.moreUnitList.map(item=>item.unit).join('/')}}</span>
+                </template>
+              </el-table-column>
+            </template>
+          </TableCommonView>
+        </div>
       </div>
     </div>
+    <!-- 鏂板缓/缂栬緫 -->
+    <AddOverviewDialog
+      v-if="editConfig.visible"
+      :workType="workType"
+      :edit-common-config="editConfig"
+      :add-name="addName"
+      :display-edit="displayEdit"/>
   </div>
 </template>
 
 <script>
-import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
-import {
-  getInventoryAdjustmentList,
-  addInventoryAdjustment,
-  updateInventoryAdjustment,
-  finishInventoryAdjustment,
-  getLocationProductAmount
-} from "@/api/operate/inventoryAdjustment"
-import { currentTime } from "@/common/config/index"
-
+import { getOperation } from "@/api/overview/overview"
+import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
+import Cookies from 'js-cookie'
 export default {
-  name: "InventoryAdjustment",
+  name: "OverviewListView",
   props: {},
-  components: { CommonFormTableView },
+  components: { AddOverviewDialog },
   mixins: [pageMixin],
   computed: {},
   data() {
     return {
-      addTitle: "鏂板缓",
-      showDiscard: false,
       tableList: {},
-      tableData: [],
+      showcol: ["浠撳簱浣嶇疆", "鏉ユ簮","鏉ユ簮鍗曟嵁","璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�", "鏃ユ湡",   "閿�鍞槑缁嗗崟", "鐘舵��" ,"涓荤","浼氳","淇濈鍛�",],
       searchOptions: [],
-      countId: 0,
-      isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
-      isRowClick: false,
-      locationId: 0,
-      productId: 0,
-      differenceAmount: 0,
-      amount: 0,
-      operationId: 0,
-      adjustAmount: 0
+      commonDetail: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      editConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
+      },
+      workType: parseInt(this.$route.query.workType),
+      keyword: "",
+      params: {},
+      displayEdit: false,
+      formLabel: "",
+      toLabel: "",
+      addName: "搴撳瓨鐩樼偣",
+      searchTaskMap: [],
+      numberLabel: "鍗曞彿",
+      TabsIndex: "0",
+      productTableList: {},
+      showBottomCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍨嬪彿", "璁¢噺鍗曚綅","鐩樼偣浣嶇疆", "璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鐩樼偣鏁伴噺","搴撳瓨鏁伴噺","涓荤","浼氳","淇濈鍛�",'杈呭姪鏁伴噺','杈呭姪鍗曚綅','姣涢噸','鎬绘瘺閲�','鍑�閲�','鎬诲噣閲�'],
+      tableBottomColumn: [],
+      selectRow: {},
+      productColumn: [
+        { label: "浜у搧缂栧彿", prop: "productId", default: true },
+        { label: "浜у搧鍚嶇О", prop: "productName" },
+        { label: "浜у搧瑙勬牸", prop: "specs" },
+        { label: "浜у搧鍨嬪彿", prop: "model" },
+          { label: "鐩樼偣浣嶇疆", prop: "location" },
+        { label: "鐩樼偣鏁伴噺", prop: "amount" },
+         { label: "搴撳瓨鏁伴噺", prop: "stockAmount" },
+        { label: "璁¢噺鍗曚綅", prop: "unit" },
+       /* { label: "杈呭姪鏁伴噺", prop: "adjunctAmount" },
+        { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" },*/
+        { label: "姣涢噸", prop: "grossWeight" },
+        { label: "鎬绘瘺閲�", prop: "totalGrossWeight" },
+        { label: "鍑�閲�", prop: "netWeight" },
+        { label: "鎬诲噣閲�", prop: "totalNetWeight" }
+      ],
+      allotProductColumn: [
+        { label: "浜у搧缂栧彿", prop: "productId", default: true },
+        { label: "浜у搧鍚嶇О", prop: "productName" },
+        { label: "浜у搧瑙勬牸", prop: "specs" },
+        { label: "浜у搧鍨嬪彿", prop: "model" },
+        { label: "璁¢噺鍗曚綅", prop: "unit" },
+        { label: "璋冨嚭浣嶇疆", prop: "location" },
+        { label: "璋冨叆浣嶇疆", prop: "toLocation" },
+        { label: "鏁伴噺", prop: "amount" },
+        /*{ label: "杈呭姪鏁伴噺", prop: "adjunctAmount" },
+        { label: "杈呭姪鍗曚綅", prop: "adjunctUnit" },*/
+        { label: "姣涢噸", prop: "grossWeight" },
+        { label: "鎬绘瘺閲�", prop: "totalGrossWeight" },
+        { label: "鍑�閲�", prop: "netWeight" },
+        { label: "鎬诲噣閲�", prop: "totalNetWeight" }
+      ]
     }
   },
   created() {
+    this.setFormToLabel()
     this.setTable()
-    this.getData()
+    var paramsData = sessionStorage.getItem("paramsData")
+    let params = {}
+    if (paramsData) {
+      params = JSON.parse(sessionStorage.getItem("paramsData"))
+    } else {
+      params = this.$route.query
+      params.id=Number(params.id)
+      sessionStorage.setItem("paramsData", JSON.stringify(params))
+    }
+    this.params = params
+    this.searchTaskMap =
+    this.params.status > 0 ? [{ id: this.params.id, title: this.getStatus(this.params.status) }] : []
+    this.getData();
+  },
+  // 椤甸潰閿�姣佷箣鍓�
+  beforeDestroy() {
+    sessionStorage.removeItem("paramsData");
   },
   methods: {
+    setFormToLabel() {
+        this.showcol=["浠撳簱浣嶇疆", "浠撳簱","璋冨嚭浣嶇疆", "璋冨叆浣嶇疆", "鑱旂郴浜�","鏃ユ湡","鍒涘缓浜�" ,"鍒涘缓鏃堕棿","楠岃瘉浜�","楠岃瘉鏃堕棿",  "閿�鍞槑缁嗗崟", "鐘舵��","涓荤","浼氳","淇濈鍛�"];
+        this.formLabel = "璋冨嚭浣嶇疆";
+        this.toLabel = "璋冨叆浣嶇疆";
+        this.numberLabel = "璋冩暣鍗曞彿";
+    },
     setTable() {
       this.tableList = {
-        tableData: this.tableData,
+        tableInfomation: [],
         selectBox: false,
         selectIndex: true,
-        tableColumn: [
-          { label: "浣嶇疆", prop: "locationName", location: true },
-          { label: "浜у搧", prop: "productName", product: true },
-          { label: "鍦ㄥ簱鏁伴噺", prop: "amount" },
-          { label: "璁¢噺鍗曚綅", prop: "unit" },
-          { label: "璁℃暟鐨勬暟閲�", prop: "differenceAmount", inputFloat: true },
-          { label: "宸紓", prop: "adjustAmount" },
-          { label: "鏃ユ湡", prop: "createDate" },
-          { label: "鐢ㄦ埛", prop: "user", user: true }
-        ]
+        showcol: this.showcol,
+        allcol: [],
+        tableColumn: this.setTableColumn(this.showcol)
+      };
+      let allcol = [];
+      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
+        if (!this.tableList.tableColumn[i].default) {
+          const label = this.tableList.tableColumn[i].label;
+          allcol.push(label)
+        }
       }
+      this.tableList.allcol = allcol
+      this.tableBottomColumn = this.workType == 3 ? this.allotProductColumn : this.productColumn
+      this.setBottomList()
+    },
+    setTableColumn(showcol) {
+      let tableColumn = [
+        {
+          label: this.numberLabel,
+          prop: "number",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鏉ユ簮",
+          prop: "operationSource",
+          isShowColumn: showcol.includes("鏉ユ簮"),
+          default: false,
+          // status: true,
+          isCallMethod: true,
+          getCallMethod: this.getSourceStatus
+        },
+        {
+          label: "鏉ユ簮鍗曟嵁",
+          prop: "sourceNumber",
+          isShowColumn: showcol.includes("鏉ユ簮鍗曟嵁"),
+          default: false
+        },
+          {
+              label: "浠撳簱",
+              prop: "warehouseName",
+              isShowColumn: showcol.includes("浠撳簱"),
+              default: false
+          },
+        /*{
+          label: this.formLabel,
+          prop: "from",
+          isShowColumn: showcol.includes(this.formLabel),
+          default: false
+        },
+        {
+          label: this.toLabel,
+          prop: "to",
+          isShowColumn: showcol.includes(this.toLabel),
+          default: false
+        },*/
+        {
+          label: "鑱旂郴浜�",
+          prop: "companyName",
+          isShowColumn: showcol.includes("鑱旂郴浜�"),
+          default: false
+        },
+        {
+          label: "璐熻矗浜�",
+          prop: "contacterName",
+          isShowColumn: showcol.includes("璐熻矗浜�"),
+          default: false
+        },
+        {
+          label: "鏃ユ湡",
+          prop: "operationDate",
+          isShowColumn: showcol.includes("鏃ユ湡"),
+          default: false,
+          date: true
+        },
+          {
+              label: "鍒涘缓浜�",
+              prop: "createBy",
+              isShowColumn: showcol.includes("鍒涘缓浜�"),
+              default: false,
+          },
+          {
+              label: "鍒涘缓鏃堕棿",
+              prop: "createTime",
+              isShowColumn: showcol.includes("鍒涘缓鏃堕棿"),
+              default: false,
+              date: true
+          },
+          {
+              label: "楠岃瘉浜�",
+              prop: "checkedBy",
+              isShowColumn: showcol.includes("楠岃瘉浜�"),
+              default: false,
+          },
+          {
+              label: "楠岃瘉鏃堕棿",
+              prop: "auditDate",
+              isShowColumn: showcol.includes("楠岃瘉鏃堕棿"),
+              default: false,
+              date: true
+          },
+        // {
+        //   label: "鎴鏃ユ湡",
+        //   prop: "faultTime",
+        //   isShowColumn: showcol.includes("鎴鏃ユ湡"),
+        //   default: false
+        // },
+        // {
+        //   label: "瀹為檯鏃ユ湡",
+        //   prop: "shopName",
+        //   isShowColumn: showcol.includes("瀹為檯鏃ユ湡"),
+        //   default: false
+        // },
+        {
+          label: "閿�鍞槑缁嗗崟",
+          prop: "salesDetailsNumber",
+          isShowColumn: showcol.includes("閿�鍞槑缁嗗崟"),
+          default: false
+        },
+        {
+          label: "鍏ュ簱绫诲瀷",
+          prop: "operationTypeName",
+          isShowColumn: showcol.includes("鍏ュ簱绫诲瀷"),
+          default: false
+        },
+        {
+          label: "鐘舵��",
+          prop: "status",
+          width: 120,
+          isShowColumn: showcol.includes("鐘舵��"),
+          default: false,
+          status: true,
+          isCallMethod: true,
+          getCallMethod: this.getStatus
+        },
+        {
+          label: "涓荤",
+          prop: "manager",
+          isShowColumn: showcol.includes("涓荤"),
+          default: false
+        },
+        {
+          label: "浼氳",
+          prop: "accountant",
+          isShowColumn: showcol.includes("浼氳"),
+          default: false
+        },
+        {
+          label: "淇濈鍛�",
+          prop: "custodian",
+          isShowColumn: showcol.includes("淇濈鍛�"),
+          default: false
+        },
+      ];
+      return tableColumn
+    },
+    selTableCol(val) {
+      this.showcol = val;
+      this.tableList.tableColumn = this.setTableColumn(val);
     },
     // 璇锋眰鏁版嵁
     async getData() {
-      await getInventoryAdjustmentList({
+      await getOperation({
+        number: this.keyword,
+        baseOperationType:5,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize,
-        keyword:this.keyword,
+        status: this.params.status
       }).then((res) => {
         if (res.code === 200) {
-          console.log(res)
           const list = res.data.map((item) => {
             return {
               ...item,
-              isSet: false,
-              isEdit: true,
-              editable: true,
+              from: item.location.jointName,
+              to: item.toLocation.jointName,
+              operationDate:this.$moment(item.operationDate).format('yyyy-MM-DD'),
+              warehouseName:item.warehouse?item.warehouse.name:''
             }
-          })
-          this.tableList.tableData = list || []
-          this.tableData = list || []
+          });
+          this.tableList.tableInfomation = list || []
           this.pagerOptions.totalCount = res.total
-        }
-      })
-      
-    },
-    // 鎿嶄綔杈撳叆
-    inputContent(val, prop, row) {
-      console.log(val, prop, row)
-      console.log(val - row.amount, "缁撴灉")
-      this.adjustAmount = val - row.amount
-      this.tableList.tableData[row.index].adjustAmount = this.adjustAmount
-      // this.differenceAmount = val
-      this.differenceAmount = val
-    },
-    // 鏂板
-    addProductClick() {
-      this.isSel()
-      if (this.isNoProduct && this.addTitle === "鏂板缓") {
-        this.$refs.tablelistRef.getLocationList()
-        this.addTitle = "淇濆瓨"
-        this.showDiscard = true
-        this.isRowClick = false
-        this.operationId = 0
-        this.currentRowId = 0
-        this.countId++
-        this.tableData.unshift({
-          countId: this.countId,
-          amount: 0,
-          adjustAmount: 0,
-          productId: "",
-          differenceAmount: 0,
-          locationId: 0,
-          createDate: this.currentTime(),
-          isSet: true,
-          isEdit: false,
-          editable: false
-        })
-        this.locationId = 0
-        this.subLocationId = 0
-        this.productCategoryId = 0
-        this.productId = 0
-      } else {
-        this.addTitle = "鏂板缓"
-        this.showDiscard = false
-        let requestUrl = this.currentRowId === 0 ? addInventoryAdjustment : updateInventoryAdjustment
-
-        requestUrl({
-          amount: this.amount,
-          // adjustAmount: this.adjustAmount,
-          differenceAmount: this.differenceAmount,
-          locationId: this.locationId,
-          operationId: this.operationId,
-          productId: this.productId
-        })
-          .then((res) => {
-            console.log(res)
-            if (res.code === 200) {
-              let tipStr = this.currentRowId === 0 ? "娣诲姞鎴愬姛" : "淇敼鎴愬姛"
-              this.$message.success(tipStr)
-              this.getData()
-            }
-          })
-          .catch((err) => {
-            console.log(err)
-            this.getData()
-          })
-        // }
-      }
-    },
-    // 鏄惁閫夋嫨浜у搧
-    isSel() {
-      for (let i = 0; i < this.tableData.length; i++) {
-        // this.tableData[i].productName?.length === 0||!this.tableData[i].productId
-        if (!this.tableData[i].productId||!this.tableData[i].isEdit) {
-          this.isNoProduct = false
-          break
-        } else {
-          this.isNoProduct = true
-        }
-      }
-    },
-    // 鍙栨秷
-    discardBtnClick() {
-      this.getData()
-      // this.tableList.tableData.forEach((item) => {
-      //   item.differenceAmount = 0
-      //   item.adjustAmount = 0
-      // })
-      // this.tableList
-      // if (this.isRowClick) {
-      //   this.tableData.map((item) => {
-      //     item.isEdit = true
-      //   })
-      // } else {
-      //   this.tableData.splice(0, 1)
-      // }
-      this.addTitle = "鏂板缓"
-      this.showDiscard = false
-    },
-    // 搴旂敤鍏ㄩ儴
-    applyBtnClick() {
-      console.log("搴旂敤鍏ㄩ儴")
-    },
-    // 鍘嗗彶
-    handleHistoryClick(row) {
-      this.isSel()
-      console.log(row)
-      if (this.isNoProduct) {
-        this.$router.push({
-          name: "inventoryAdjustmentHistory",
-          params: { locationId: row.locationId, productId: row.productId, baseOperationType: row.baseOperationType }
-        })
-      }
-    },
-    // 璁剧疆
-    handleSetClick(scope) {
-      this.isSel()
-      if (this.isNoProduct) {
-        scope.row.isSet = !scope.row.isSet
-      }
-    },
-    // 搴旂敤
-    handleUseClick(row) {
-      // scope.row.isSet = !scope.row.isSet
-      finishInventoryAdjustment({
-        locationProductAmountId: row.locationProductAmountId,
-        operationId: row.operationId,
-        productId: row.productId
-      }).then((res) => {
-        console.log(res)
-        if (res.code === 200) {
-          this.$message.success("搴旂敤鎴愬姛")
-          this.getData()
-        }
-      })
-    },
-    // 娓呴櫎
-    handleCleanupClick(scope) {
-      scope.row.isSet = !scope.row.isSet
-    },
-    // 琛岀偣鍑�
-    tableRowClick(row, rowIndex) {
-      this.isSel()
-      //!this.isNoProduct && this.currentRowId == 0
-      if (!this.isNoProduct) {
-        this.$message.error("璇峰畬鎴愬綋鍓嶄繚瀛樻垨鍙栨秷淇濆瓨锛�")
-      } else {
-        this.locationId = row.locationId
-        this.rowIndex = rowIndex
-        this.currentRowId = row.id
-        this.addTitle = "淇濆瓨"
-        this.showDiscard = true
-        this.isRowClick = true
-        if (!this.isNoProduct) {
-          this.tableData.splice(this.tableData.length - 1, 1)
-        }
-        this.tableData.map((item, index) => {
-          if (index === rowIndex) {
-            item.isEdit = false
-            item.editable = true
-          } else {
-            item.isEdit = true
+          if (res.total > 0) {
+            this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
+            this.tableRowClick(this.selectRow)
+            this.bottomProductData(this.selectRow)
           }
-        })
-        this.differenceAmount = row.differenceAmount
-        this.amount = row.amount
-        this.productId = row.productId
-        this.operationId = row.operationId
-      }
+        }
+      })
+    },
+    // bottom浜у搧淇℃伅鏁版嵁澶勭悊
+    bottomProductData(arr) {
+        const list = arr.details.map((item) => {
+          const params={
+              ...item,
+              productName: item.product.name,
+              unit: item.product.unit,
+              model:item.product.model,
+              specs:item.product.specs,
+              adjunctUnit:item.auxiliaryUnit,
+              adjunctAmount:item.auxiliaryAmount,
+              grossWeight:item.product.grossWeight==0?'':item.product.grossWeight,
+              totalGrossWeight:item.totalGrossWeight==0?'':item.totalGrossWeight,
+              netWeight:item.product.netWeight==0?'':item.product.netWeight,
+              totalNetWeight:item.totalNetWeight==0?'':item.totalNetWeight,
+          }
+          params.location=item.fromLocation.name;
+          return  params;
+      });
+      this.productTableList.tableInfomation = list
+    },
+    // top 琛岀偣鍑�
+    tableRowClick(row) {
+      this.selectRow = row
+      this.bottomProductData(this.selectRow)
     },
     // 鎼滅储
     getList(val) {
+      console.log(val)
       this.keyword = val
       this.pagerOptions.currPage = 1
-      this.addTitle = "鏂板缓"
-      this.showDiscard = false
       this.getData()
     },
-    // 閫夋嫨浣嶇疆鏂规硶
-    selLocationClick(item, prop) {
-      console.log(item, prop)
-      this.locationId = item.value
-    },
-    // 閫夋嫨浜у搧鏂规硶
-    async selProductClick(value, item) {
-          console.log("鐪嬬湅杩斿洖",this.tableData)
-      if (value === "product") {
-        this.productId = item.productId
-        await getLocationProductAmount({
-          locationId:this.locationId,
-          productId:this.productId
-        }).then((res)=>{
-          if(res&&res.code===200){
-            this.tableData[0].amount=res.data?res.data.amount:0
-          }
-        })
+    // 鏌ョ湅 缂栬緫
+    viewEditClick(row, val) {
+      const row1=JSON.parse(JSON.stringify(row));
+      this.editConfig.visible = true
+      this.editConfig.title = val
+      this.editConfig.operationTypeId = this.params.id
+      this.editConfig.code = this.params.code
+      row1.details.map((item) => {
+        item.fromLocationId = item.fromLocation.jointName
+        item.toLocationId = item.toLocation.jointName
+        item.relAmount=item.amount;
+        item.amount=item.stockAmount;
+      });
+      row1.location = {
+          ...row1.location,
+        value: row1.location.id || row1.location.value,
+        label: row1.location.jointName || row1.location.label
       }
+      row1.toLocation = {
+          ...row1.toLocation,
+        value: row1.toLocation.id || row1.toLocation.value,
+        label: row1.toLocation.jointName || row1.toLocation.label
+      }
+      row1.locationID = row1.location.jointName
+      row1.locationId = row1.location.value
+      row1.managerObj={
+        label:row1.manager,
+        value:row1.managerId
+      }
+      row1.accountantObj={
+        label:row1.accountant,
+        value:row1.accountantId
+      }
+      row1.custodianObj={
+        label:row1.custodian,
+        value:row1.custodianId
+      }
+      this.editConfig.infomation = { ...row1 }
     },
-    // 鑾峰彇褰撳墠鏃堕棿
-    currentTime() {
-      return currentTime()
+    // 鏂板缓
+    addBtnClick() {
+      this.editConfig.title = "鏂板缓"
+      //this.addName = this.params.name
+      this.editConfig.operationTypeId = this.params.id
+      this.editConfig.code = this.params.code
+      this.editConfig.infomation = {
+        // location:{jointName:""}
+          operationDate:new Date()
+      }
+      this.editConfig.visible = true
+    },
+    // 鐘舵��
+    getStatus(val) {
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : val === 4 ? "瀹屾垚" : val === 5 ? "鍙栨秷" : ""
+    },
+    // 鏉ユ簮
+    getSourceStatus(val){
+      return val===0 ? '--':val === 1 ? "閲囪喘鍏ュ簱" : val === 2 ? "鐢熶骇鍏ュ簱" : val === 3 ? "濮斿鍏ュ簱" : val === 4 ? "鐢熶骇棰嗘枡" : val=== 5 ? "濮斿棰嗘枡": val === 6?"閿�鍞彂璐�": "--"
+    },
+    // 鍒犻櫎鎼滅储鐘舵��
+    delSelectClick() {
+      this.params.status = 0
+      this.getData()
+    },
+    // bottom 浜у搧淇℃伅
+    // bom 鍒楄〃
+    setBottomList() {
+      this.productTableList = {
+        selectIndex: true,
+        tableInfomation: [],
+        allcol: [],
+        showcol: this.showBottomCol,
+        tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn)
+      }
+      this.setTableList(this.productTableList)
+    },
+    setTableList(tableList) {
+      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+      // this.searchOptions = []
+      // for (let i = 0; i < tableList.tableColumn.length; i++) {
+      //   const label = tableList.tableColumn[i].label
+      //   const value = tableList.tableColumn[i].prop
+      //   this.searchOptions.push({ value: value, label: label })
+      // }
+    },
+    setColumnVisible(showCol, tableColumn) {
+      return tableColumn.map((ele) => {
+        return {
+          ...ele,
+          isShowColumn: showCol.includes(ele.label)
+        }
+      })
+    },
+    selBottomTableCol(val) {
+      this.showBottomCol = val
+      this.productTableList.tableColumn = this.setColumnVisible(val, this.tableBottomColumn)
+    },
+    getTab(tab) {
+      this.TabsIndex = tab
+      // if (this.TabsIndex == 0) {
+      //   // 浜у搧淇℃伅鍒楄〃
+      //   this.setBottomList()
+      //   this.getProductInventoryInfo(this.selectRow)
+      // }
     }
   }
 }
@@ -342,11 +525,89 @@
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
+.rightContent {
+  height: 100%;
+  overflow: hidden;
+  .body {
+    box-sizing: border-box;
+    padding: 10px 0px;
+    border-radius: 12px;
+    height: calc(100% - 70px);
+    .content-top {
+      background-color: #fff;
+      border-radius: 12px;
+      min-height: 70px;
+      height: 48%;
+      position: relative;
+      .list-view {
+        height: calc(100% - 50px);
+      }
+    }
+    .content-bottom {
+      .bottom-tabs {
+        height: 40px;
+        line-height: 40px;
+        background: #e6ecf2;
+        display: flex;
+        .tab-pane {
+          width: 100px;
+          margin-right: 20px;
+          font-size: 14px !important;
+          text-align: center;
+          cursor: pointer;
+          background: #2a78fb;
+          border-top-left-radius: 20px;
+          border-top-right-radius: 20px;
+        }
+      }
+      .lable-view {
+        background: #e6ecf2;
+        height: 40px;
+        line-height: 40px;
+        .name {
+          border-left: 4px solid #2a78fb;
+          padding-left: 10px;
+        }
+      }
+      background-color: #fff;
+      border-radius: 12px;
+      min-height: 70px;
+      height: calc(52% - 60px);
+      margin-top: 10px;
+      // padding: 10px 20px;
+      .list-view {
+        height: calc(100% - 10px);
+      }
+    }
+    .btn-pager {
+      display: flex;
+      margin-top: 0px;
+      .page {
+        margin-left: auto;
+      }
+    }
+  }
+}
+.label-fixed-element {
+  position: fixed;
+  background:#f8f8f9;
+  font-size: 14px;
+  width: calc(100% - 530px);
+  height: 45px;
+  line-height: 45px;
+  font-size: 18px;
+  font-weight: 700;
+  color: #171718;
+  margin-top: -60px;
+  margin-left: -5px;
+}
 ::v-deep {
-  .el-table {
-    border-top-left-radius: 12px;
-    border-top-right-radius: 12px;
-    overflow: auto;
+  .el-table__header-wrapper {
+    position: sticky;
+    width: 100%;
+    //  left:0px;
+    top: 0px;
+    z-index: 2000;
   }
 }
 </style>

--
Gitblit v1.8.0