From 327b3157bb7e155d3333017bc2ddd66611ea06a9 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 26 九月 2023 19:34:11 +0800
Subject: [PATCH] 库存调整、上架规则

---
 src/views/warehouseManage/listingRules/index.vue                     |  235 +++++++---
 src/views/operate/inventoryAdjustment/inventoryAdjustmentHistory.vue |  167 +++++++
 src/router/operate/index.js                                          |   10 
 src/components/makepager/SearchCommonView.vue                        |   21 
 src/api/data.js                                                      |   98 ++--
 src/components/makepager/CommonFormTableView.vue                     |  151 ++++++
 src/views/warehouseManage/position/AddDialog.vue                     |  302 ++++++-------
 src/views/operate/inventoryAdjustment/index.vue                      |  246 +++++++---
 src/views/warehouseManage/position/index.vue                         |   57 +-
 9 files changed, 890 insertions(+), 397 deletions(-)

diff --git a/src/api/data.js b/src/api/data.js
index 36a8533..8e0ad06 100644
--- a/src/api/data.js
+++ b/src/api/data.js
@@ -17,61 +17,61 @@
     id: 4
   }
 ]
-// 浠撳簱 
+// 浠撳簱
 // 鍏ュ悜杩愯緭
-const inboundTransportation=[
+const inboundTransportation = [
   {
-    name:'鐩存帴鎺ユ敹浜у搧锛�1姝ユ敹璐э級',
-    id:1,
-    disabled:false,
+    name: "鐩存帴鎺ユ敹浜у搧锛�1姝ユ敹璐э級",
+    id: 1,
+    disabled: false
   },
   {
-    name:'鎺ュ埌浜у搧鍒版敹鏂欏尯锛屽啀鍏ュ簱锛�2姝ユ敹璐э級',
-    id:2,
-    disabled:true,
+    name: "鎺ュ埌浜у搧鍒版敹鏂欏尯锛屽啀鍏ュ簱锛�2姝ユ敹璐э級",
+    id: 2,
+    disabled: true
   },
   {
-    name:'鎺ユ敹浜у搧鍒版敹鏂欏尯锛屾楠岋紝鐒跺悗鍏ュ簱锛�3姝ユ敹璐э級',
-    id:3,
-    disabled:true,
+    name: "鎺ユ敹浜у搧鍒版敹鏂欏尯锛屾楠岋紝鐒跺悗鍏ュ簱锛�3姝ユ敹璐э級",
+    id: 3,
+    disabled: true
   }
 ]
 // 鍑哄簱杩愯緭
-const   outboundTransportation=[
+const outboundTransportation = [
   {
-    name:'鐩存帴鍑哄簱锛�1姝ワ級',
-    id:1,
-    disabled:false,
+    name: "鐩存帴鍑哄簱锛�1姝ワ級",
+    id: 1,
+    disabled: false
   },
   {
-    name:'閫佸埌寰呭嚭搴撳尯锛屽啀閫佽揣锛�2姝ュ彂璐э級',
-    id:2,
-    disabled:true,
+    name: "閫佸埌寰呭嚭搴撳尯锛屽啀閫佽揣锛�2姝ュ彂璐э級",
+    id: 2,
+    disabled: true
   },
   {
-    name:'鍖呰浜у搧锛屽彂閫佸埌寰呭嚭搴撳尯锛屽啀閫佽揣锛�3姝ュ彂璐э級',
-    id:3,
-    disabled:true,
+    name: "鍖呰浜у搧锛屽彂閫佸埌寰呭嚭搴撳尯锛屽啀閫佽揣锛�3姝ュ彂璐э級",
+    id: 3,
+    disabled: true
   }
 ]
 // 涓氬姟绫诲瀷
-// 浣滀笟绫诲瀷 
-const baseOperationType=[
+// 浣滀笟绫诲瀷
+const baseOperationType = [
   {
-    name: "鏀惰揣",
+    name: "鍏ュ簱",
     id: 1
   },
   {
-    name: "鍙戣揣",
+    name: "鍑哄簱",
     id: 2
   },
   {
     name: "鍐呴儴璋冩嫧",
     id: 3
-  },
+  }
 ]
 //鍒涘缓娆犲崟
-const createBackorder=[
+const createBackorder = [
   {
     name: "鎻愰棶",
     id: 1
@@ -83,10 +83,10 @@
   {
     name: "浠庝笉",
     id: 3
-  },
+  }
 ]
 //淇濈暀鏂瑰紡 鍦ㄩ瀹氭棩鏈熶箣鍓�=3
-const reservationMethod=[
+const reservationMethod = [
   {
     name: "纭鏃�",
     id: 1
@@ -96,9 +96,9 @@
     id: 2
   }
 ]
-// 浜у搧绫诲埆 
+// 浜у搧绫诲埆
 // 寮哄埗涓嬫灦绛栫暐
-const forceRemovalStrategy=[
+const forceRemovalStrategy = [
   {
     name: "First In First Out (FIFO)",
     id: 1
@@ -110,10 +110,10 @@
   {
     name: "Closest Location",
     id: 3
-  },
+  }
 ]
 //鎴愭湰鏂规硶
-const costingMethod=[
+const costingMethod = [
   {
     name: "鏍囧噯浠锋牸",
     id: 1
@@ -125,10 +125,10 @@
   {
     name: "骞冲潎鎴愭湰锛圓VCO锛�",
     id: 3
-  },
+  }
 ]
 // 搴撳瓨璁′环
-const inventoryValuation=[
+const inventoryValuation = [
   {
     name: "鎵嬪姩",
     id: 1
@@ -140,7 +140,7 @@
 ]
 // 浣嶇疆
 // 浣嶇疆绫诲瀷
-const positionType=[
+const positionType = [
   {
     name: "渚涘簲鍟嗕綅缃�",
     id: 1
@@ -173,23 +173,23 @@
 export const getDataByType = (type) => {
   if (type == "purchaseStatus") {
     return purchaseStatus
-  }else if(type=='inboundTransportation'){
+  } else if (type == "inboundTransportation") {
     return inboundTransportation
-  }else if(type=='outboundTransportation'){
+  } else if (type == "outboundTransportation") {
     return outboundTransportation
-  }else if(type=='baseOperationType'){
-    return baseOperationType;
-  }else if(type=='createBackorder'){
-    return createBackorder;
-  }else if(type=='reservationMethod'){
-    return reservationMethod;
-  }else if(type=='forceRemovalStrategy'){
+  } else if (type == "baseOperationType") {
+    return baseOperationType
+  } else if (type == "createBackorder") {
+    return createBackorder
+  } else if (type == "reservationMethod") {
+    return reservationMethod
+  } else if (type == "forceRemovalStrategy") {
     return forceRemovalStrategy
-  }else if(type=='costingMethod'){
+  } else if (type == "costingMethod") {
     return costingMethod
-  }else if(type=='inventoryValuation'){
+  } else if (type == "inventoryValuation") {
     return inventoryValuation
-  }else if(type=='positionType'){
-    return positionType;
+  } else if (type == "positionType") {
+    return positionType
   }
 }
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 60108e2..ff7f169 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -5,7 +5,11 @@
         :data="tableList.tableData"
         style="width: 100%"
         :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
+        :row-class-name="tableRowClassName"
+        @row-click="tableRowClick"
       >
+        <el-table-column v-if="tableList.selectBox" type="selection" width="40" align="center"> </el-table-column>
+        <el-table-column v-if="tableList.selectIndex" type="index" label="搴忓彿" width="50"> </el-table-column>
         <el-table-column
           v-for="(item, i) in tableList.tableColumn"
           :key="i"
@@ -73,7 +77,8 @@
                 :prop="'tableData.' + scope.$index + '.' + item.prop"
                 :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
               >
-                <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px">
+                <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span>
+                <el-date-picker v-else v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px">
                 </el-date-picker>
               </el-form-item>
               <el-form-item
@@ -102,7 +107,9 @@
                 :prop="'tableData.' + scope.$index + '.' + item.prop"
                 :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
               >
+                <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span>
                 <el-input-number
+                  v-else
                   v-model="scope.row[item.prop]"
                   placeholder=""
                   :min="0"
@@ -130,6 +137,76 @@
                   </el-select>
                 </div>
               </el-form-item>
+              <!-- 浣嶇疆 -->
+              <el-form-item v-else-if="item.location" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
+                <div class="custom-name">
+                  <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span>
+                  <el-select
+                    v-else
+                    v-model="scope.row[item.prop]"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 80%"
+                    @change="selLocationClick"
+                  >
+                    <el-option v-for="item in selLocationOptions" :key="item.id" :label="item.name" :value="item.name">
+                    </el-option>
+                  </el-select>
+                </div>
+              </el-form-item>
+              <!-- 浜у搧 -->
+              <el-form-item v-else-if="item.product" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
+                <div class="custom-name">
+                  <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span>
+                  <el-select
+                    v-else
+                    v-model="scope.row[item.prop]"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 80%"
+                    @change="
+                      (val) => {
+                        selProductClick(val)
+                      }
+                    "
+                  >
+                    <el-option
+                      v-for="item in productNameOptions"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="{ value: item.id, label: item.name, amount: item.amount, unit: item.unit }"
+                    >
+                    </el-option>
+                  </el-select>
+                </div>
+              </el-form-item>
+              <!-- 鐢ㄦ埛 -->
+              <el-form-item v-else-if="item.user" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
+                <div class="custom-name">
+                  <span>{{ "绠$悊鍛�" }}</span>
+                  <!-- <el-select
+                    v-else
+                    v-model="scope.row[item.prop]"
+                    placeholder="璇烽�夋嫨"
+                    size="mini"
+                    style="width: 80%"
+                    @change="selCommonClick"
+                  >
+                    <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.name">
+                    </el-option>
+                  </el-select> -->
+                </div>
+              </el-form-item>
+              <!-- 鍏徃 -->
+              <el-form-item v-else-if="item.company" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop">
+                <div class="custom-name">
+                  <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span>
+                  <el-select v-else v-model="scope.row[item.prop]" placeholder="璇烽�夋嫨" size="mini" style="width: 80%">
+                    <el-option v-for="item in companyOptions" :key="item.id" :label="item.name" :value="item">
+                    </el-option>
+                  </el-select>
+                </div>
+              </el-form-item>
               <span v-else>{{ scope.row[item.prop] }}</span>
             </template>
             <span v-else>{{ scope.row[item.prop] }}</span>
@@ -138,7 +215,7 @@
         <slot name="tableButton" />
       </el-table>
     </el-form>
-    <div v-if="!detailEnter" style="margin: 10px">
+    <div v-if="!detailEnter && !isinventory && !islistingrules" style="margin: 10px">
       <el-button size="small" type="primary" @click="add">娣诲姞鏄庣粏琛�</el-button>
       <!-- <el-button size="small" type="primary" @click="empty">娓呯┖</el-button> -->
     </div>
@@ -154,6 +231,8 @@
 
 <script>
 import { getProductList } from "@/api/product/product"
+import { getLocationList } from "@/api/warehouseManage/warehouse"
+import { getCompanyList } from "@/api/common/other"
 // import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 export default {
   name: "CommmonFormTableView",
@@ -171,6 +250,8 @@
       type: Object,
       default: () => {
         return {
+          selectBox: false,
+          selectIndex: false,
           tableData: [], // 鎺ュ彛杩斿洖鏁版嵁
           tableColumn: [
             // table琛ㄥ崟
@@ -178,6 +259,14 @@
           ]
         }
       }
+    },
+    isinventory: {
+      type: Boolean,
+      default: false
+    },
+    islistingrules: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -192,14 +281,24 @@
       },
       productIndex: 0,
       productNameOptions: [],
+      memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
       selOptions: [
         { id: 1, name: "浠�" },
         { id: 2, name: "鎵�" }
-      ]
+      ],
+      selLocationOptions: [], // 浣嶇疆
+      companyOptions: [] // 鍏徃
     }
   },
   created() {
     this.getProductList()
+    if (this.isinventory) {
+      this.getLocationList()
+    }
+    if (this.islistingrules) {
+      this.getLocationList()
+      this.getCompanyList()
+    }
     this.tableList = this.productTableList
   },
   computed: {},
@@ -223,6 +322,28 @@
         }
       })
     },
+    // 浣嶇疆
+    async getLocationList() {
+      await getLocationList({
+        keyword: "",
+        page: 1,
+        pageSize: 100
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data ? res.data : []
+          this.selLocationOptions = list
+        }
+      })
+    },
+    // 鑾峰彇鍏徃鍒楄〃
+    async getCompanyList() {
+      await getCompanyList().then((res) => {
+        console.log(res)
+        if (res.data.code === 200) {
+          this.companyOptions = res.data.data
+        }
+      })
+    },
     // 閫夋嫨浜у搧
     selProductClick(item) {
       this.tableList.tableData.map((ite) => {
@@ -235,7 +356,20 @@
       })
       console.log(this.tableList.tableData)
     },
-    // 閫夋嫨鍗曚綅
+    // 閫夋嫨浣嶇疆
+    selLocationClick(item) {
+      console.log(item)
+      console.log(this.tableList.tableData)
+      // this.tableList.tableData.map((ite) => {
+      //   if (ite.location.label === item.label) {
+      //     ite.location = item.label
+      //   }
+      //   if (ite.subLocation.label === item.label) {
+      //     ite.subLocation = item.label
+      //   }
+      // })
+    },
+    // 閫夋嫨鍗曚綅/鐢ㄦ埛
     selCommonClick(item) {
       console.log(item)
     },
@@ -320,6 +454,14 @@
         return true
       }
       this.tableList.tableData.splice(scope.$index, 1)
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row) {
+      this.$emit("tableRowClick", row, row.index)
+    },
+    // 鍗曢�夎鐩稿叧
+    tableRowClassName({ row, rowIndex }) {
+      row.index = rowIndex
     }
   }
 }
@@ -333,6 +475,7 @@
     margin-bottom: 0;
     .custom-name {
       display: flex;
+      justify-content: center;
       .common-select-btn {
         margin-left: 5px;
         font-size: 18px;
diff --git a/src/components/makepager/SearchCommonView.vue b/src/components/makepager/SearchCommonView.vue
index 16b2170..66c8f07 100644
--- a/src/components/makepager/SearchCommonView.vue
+++ b/src/components/makepager/SearchCommonView.vue
@@ -3,9 +3,13 @@
     <div class="search-top">
       <div class="left">
         <el-button v-if="showAdd" type="primary" size="mini" @click="addBtn">{{ addTitle }}</el-button>
+        <el-button v-if="showDiscard" size="mini" @click="discardBtn" style="margin-left: 0px">{{ "鍙栨秷" }}</el-button>
         <div class="download" @click="downloadClick" :style="{ cursor: showDownload ? 'pointer' : 'no-drop' }">
           <img src="@/assets/img/xiazai.png" style="width: 13px" />
         </div>
+        <el-button v-if="showApply" type="text" size="mini" @click="addBtn" style="margin-left: 10px">{{
+          "搴旂敤鍏ㄩ儴"
+        }}</el-button>
         <slot name="leftButton" />
       </div>
       <div v-if="amountView" class="amount">
@@ -79,7 +83,14 @@
       type: Boolean,
       default: true
     },
+    showDiscard: {
+      default: false
+    },
     showDownload: {
+      type: Boolean,
+      default: false
+    },
+    showApply: {
       type: Boolean,
       default: false
     },
@@ -188,9 +199,17 @@
     addBtn() {
       this.$emit("addCommonClick")
     },
+    // 涓㈠純
+    discardBtn() {
+      this.$emit("discardBtnClick")
+    },
     // 涓嬭浇
     downloadClick() {
       this.$emit("downloadClick")
+    },
+    // 涓㈠純
+    applyBtn() {
+      this.$emit("applyBtnClick")
     },
     // 妯″叿-妫�鏌ラ厤缃�
     inspectionConfigClick() {
@@ -212,7 +231,7 @@
     align-items: center;
     .left {
       display: flex;
-      width: 150px;
+      width: 210px;
       margin-left: 20px;
       .download {
         width: 30px;
diff --git a/src/router/operate/index.js b/src/router/operate/index.js
index 59f8d89..5aa40ab 100644
--- a/src/router/operate/index.js
+++ b/src/router/operate/index.js
@@ -3,6 +3,8 @@
 const allot = (resolve) => require(["@/views/operate/allot/index"], resolve) // 璋冩嫧
 const scrap = (resolve) => require(["@/views/operate/scrap/index"], resolve) // 鎶ュ簾
 const inventoryAdjustment = (resolve) => require(["@/views/operate/inventoryAdjustment/index"], resolve) // 搴撳瓨璋冩暣
+const inventoryAdjustmentHistory = (resolve) =>
+  require(["@/views/operate/inventoryAdjustment/inventoryAdjustmentHistory"], resolve) // 搴撳瓨璋冩暣鍘嗗彶
 
 const appconfig = [
   {
@@ -28,6 +30,14 @@
     meta: {
       title: "搴撳瓨璋冩暣"
     }
+  },
+  {
+    path: "/operate/inventoryAdjustmentHistory",
+    name: "inventoryAdjustmentHistory",
+    component: inventoryAdjustmentHistory,
+    meta: {
+      title: "搴撳瓨璋冩暣 / 鍘嗗彶"
+    }
   }
 ]
 
diff --git a/src/views/operate/inventoryAdjustment/index.vue b/src/views/operate/inventoryAdjustment/index.vue
index 7d52d43..9f6346e 100644
--- a/src/views/operate/inventoryAdjustment/index.vue
+++ b/src/views/operate/inventoryAdjustment/index.vue
@@ -2,57 +2,90 @@
   <div class="rightContent">
     <div class="top">
       <SearchCommonView
-        :add-title="'鏂板缓'"
-        :placeholder="'璇疯緭鍏ュ崟鍙�'"
+        :add-title="addTitle"
+        :show-discard="showDiscard"
+        :show-apply="true"
+        :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
         :amount-view="false"
-        @addCommonClick="addBtnClick"
+        @addCommonClick="addProductClick"
         @searchClick="getList"
+        @discardBtnClick="discardBtnClick"
+        @applyBtnClick="applyBtnClick"
       />
     </div>
     <div class="list-view">
       <div class="table">
-        <TableCommonView
-          ref="tableListRef"
-          :table-list="tableList"
-          :show-checkcol="false"
+        <CommonFormTableView
+          :isinventory="true"
+          :product-table-list="tableList"
+          @inputContent="inputContent"
           @tableRowClick="tableRowClick"
-        ></TableCommonView>
+        >
+          <template slot="tableButton">
+            <el-table-column label="鎿嶄綔" width="180" fixed="right" align="center">
+              <template slot-scope="scope">
+                <span @click="handleHistoryClick(scope.row)">
+                  <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-else>
+                  <span @click="handleUseClick(scope)" class="margin_left_5px">
+                    <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>
+                </template>
+              </template>
+            </el-table-column>
+          </template>
+        </CommonFormTableView>
       </div>
       <div class="btn-pager">
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
-    <!-- 鏂板缓/缂栬緫 -->
-    <AddDialog
-      v-if="editConfig.visible"
-      @refresh="refresh"
-      :positionList="tableList.tableInfomation"
-      :edit-common-config="editConfig"
-    />
   </div>
 </template>
 
 <script>
+import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import { getLocationList } from "@/api/warehouseManage/warehouse"
-import AddDialog from "@/views/warehouseManage/position/AddDialog"
-import { getDataByType } from "@/api/data"
 export default {
   name: "InventoryAdjustment",
   props: {},
-  components: { AddDialog },
+  components: { CommonFormTableView },
   mixins: [pageMixin],
   computed: {},
   data() {
     return {
+      addTitle: "鏂板缓",
+      showDiscard: false,
       tableList: {},
+      tableData: [
+        {
+          location: "HC/閿�鍞尯",
+          productName: "澶忓鐪熶笣鍚婂甫瑁�",
+          amount: "0.00",
+          unit: "浠�",
+          count: "0.00",
+          date: "2023-12-31",
+          user: "绠$悊鍛�",
+          isSet: true,
+          isEdit: true
+        }
+      ],
       searchOptions: [],
-      editConfig: {
-        visible: false,
-        title: "鏂板缓",
-        infomation: {}
-      },
-      positionTypeList: getDataByType("positionType")
+      countId: 0,
+      isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
+      isRowClick: false
     }
   },
   created() {
@@ -62,55 +95,124 @@
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [],
+        tableData: this.tableData,
         selectBox: true,
-        showcol: this.showcol,
-        allcol: [],
-        tableColumn: this.setTableColumn(this.showcol)
+        tableColumn: [
+          { label: "浣嶇疆", prop: "location", location: true },
+          { label: "浜у搧", prop: "productName", product: true },
+          { label: "鍦ㄥ簱鏁伴噺", prop: "amount" },
+          { label: "璁¢噺鍗曚綅", prop: "unit" },
+          { label: "璁℃暟鐨勬暟閲�", prop: "count", inputFloat: true },
+          { label: "宸紓", prop: "difference" },
+          { label: "鏃ユ湡", prop: "date", date: true },
+          { label: "鐢ㄦ埛", prop: "user", user: true }
+        ]
       }
-      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)
+    },
+    // 鎿嶄綔杈撳叆
+    inputContent(val, prop, row) {
+      this.countId = row.countId
+      this.tableData.map((item) => {
+        if (item.countId === row.countId) {
+          item[prop] = val
+        }
+      })
+    },
+    // 鏂板
+    addProductClick() {
+      console.log(this.tableData)
+      this.isSel()
+      if (this.isNoProduct && this.addTitle === "鏂板缓") {
+        this.addTitle = "淇濆瓨"
+        this.showDiscard = true
+        this.isRowClick = false
+        this.countId++
+        this.tableData.push({
+          countId: this.countId,
+          productId: "",
+          amount: 0,
+          unit: "",
+          productName: "",
+          count: "0.00",
+          isSet: true,
+          isEdit: false
+        })
+      } else if (this.isNoProduct && this.addTitle === "淇濆瓨") {
+        this.addTitle = "鏂板缓"
+        this.showDiscard = false
+      }
+    },
+    // 鏄惁閫夋嫨浜у搧
+    isSel() {
+      for (let i = 0; i < this.tableData.length; i++) {
+        if (this.tableData[i].productName.length === 0) {
+          this.isNoProduct = false
+          break
+        } else {
+          this.isNoProduct = true
         }
       }
-      this.tableList.allcol = allcol
     },
-    setTableColumn(showcol) {
-      console.log(showcol)
-      let tableColumn = [
-        {
-          label: "浣嶇疆",
-          prop: "jointName",
-          isShowColumn: true,
-          default: true
-        },
-        {
-          label: "浣嶇疆绫诲瀷",
-          prop: "type",
-          isShowColumn: true,
-          default: true,
-          conversion: true,
-          getStatus: this.getTypesList
-        }
-      ]
-      return tableColumn
-    },
-    getTypesList(val) {
-      let string = "--"
-      if (val) {
-        for (let i in this.positionTypeList) {
-          if (this.positionTypeList[i].id == val) {
-            return this.positionTypeList[i].name
-          }
-        }
+    // 鍙栨秷
+    discardBtnClick() {
+      if (this.isRowClick) {
+        this.tableData.map((item) => {
+          item.isEdit = true
+        })
+      } else {
+        this.tableData.splice(this.tableData.length - 1, 1)
       }
-      return string
+      this.addTitle = "鏂板缓"
+      this.showDiscard = false
     },
-    selTableCol(val) {
-      this.showcol = val
-      this.tableList.tableColumn = this.setTableColumn(val)
+    // 搴旂敤鍏ㄩ儴
+    applyBtnClick() {
+      console.log("搴旂敤鍏ㄩ儴")
+    },
+    // 鍘嗗彶
+    handleHistoryClick(row) {
+      this.isSel()
+      console.log(row)
+      if (this.isNoProduct) {
+        console.log("鍘嗗彶")
+        this.$router.push({
+          name: "inventoryAdjustmentHistory",
+          params: { id: row.id }
+        })
+      }
+    },
+    // 璁剧疆
+    handleSetClick(scope) {
+      this.isSel()
+      if (this.isNoProduct) {
+        scope.row.isSet = !scope.row.isSet
+      }
+    },
+    // 搴旂敤
+    handleUseClick(scope) {
+      scope.row.isSet = !scope.row.isSet
+    },
+    // 娓呴櫎
+    handleCleanupClick(scope) {
+      scope.row.isSet = !scope.row.isSet
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row, rowIndex) {
+      console.log(row, rowIndex)
+      this.addTitle = "淇濆瓨"
+      this.showDiscard = true
+      this.isRowClick = true
+      this.isSel()
+      if (!this.isNoProduct) {
+        this.tableData.splice(this.tableData.length - 1, 1)
+      }
+      this.tableData.map((item, index) => {
+        if (index === rowIndex) {
+          item.isEdit = false
+        } else {
+          item.isEdit = true
+        }
+      })
     },
     // 璇锋眰鏁版嵁
     async getData() {
@@ -126,23 +228,11 @@
         }
       })
     },
-    refresh() {
-      this.pagerOptions.currPage = 1
-      this.getData()
-    },
     // 鎼滅储
     getList(val) {
       this.keyword = val
       this.pagerOptions.currPage = 1
       this.getData()
-    },
-    // 琛岀偣鍑�
-    tableRowClick(row) {
-      console.log(row)
-      this.editConfig.title = "缂栬緫"
-      this.editConfig.infomation = { ...row }
-      this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId)
-      this.editConfig.visible = true
     },
     // 鏂板缓
     addBtnClick() {
diff --git a/src/views/operate/inventoryAdjustment/inventoryAdjustmentHistory.vue b/src/views/operate/inventoryAdjustment/inventoryAdjustmentHistory.vue
new file mode 100644
index 0000000..cb0de4a
--- /dev/null
+++ b/src/views/operate/inventoryAdjustment/inventoryAdjustmentHistory.vue
@@ -0,0 +1,167 @@
+<template>
+  <div class="rightContent">
+    <div class="top">
+      <SearchCommonView
+        :show-add="false"
+        :placeholder="'璇疯緭鍏ュ崟鍙�/浜у搧'"
+        :amount-view="false"
+        @searchClick="getList"
+      />
+    </div>
+    <div class="list-view">
+      <div class="table">
+        <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol"></TableCommonView>
+      </div>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import { getAllList } from "@/api/overview/overview"
+
+export default {
+  name: "InventoryAdjustmentHistory",
+  props: {},
+  components: {},
+  mixins: [pageMixin],
+  computed: {},
+  data() {
+    return {
+      tableList: {},
+      showcol: ["鐘舵��"],
+      searchOptions: [],
+      keyword: ""
+    }
+  },
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    setTable() {
+      this.tableList = {
+        tableInfomation: [],
+        selectBox: 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
+    },
+    setTableColumn(showcol) {
+      let tableColumn = [
+        {
+          label: "鏃ユ湡",
+          prop: "operationDate",
+          isShowColumn: true,
+          default: true,
+          date: true
+        },
+        {
+          label: "鍗曞彿",
+          prop: "number",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浜у搧",
+          prop: "productName",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "浠�",
+          prop: "from",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鑷�",
+          prop: "to",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鏁伴噺",
+          prop: "amount",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鍗曚綅",
+          prop: "unit",
+          isShowColumn: true,
+          default: true
+        },
+        {
+          label: "鐘舵��",
+          prop: "status",
+          width: 120,
+          isShowColumn: showcol.includes("鐘舵��"),
+          default: false,
+          status: true,
+          isCallMethod: true,
+          getCallMethod: this.getStatus
+        },
+        {
+          label: "瀹屾垚鑰�",
+          prop: "user",
+          isShowColumn: showcol.includes("瀹屾垚鑰�"),
+          default: false
+        }
+      ]
+      return tableColumn
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setTableColumn(val)
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      await getAllList({
+        number: this.keyword,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize,
+        sourceNumber: this.keyword
+      }).then((res) => {
+        if (res.code === 200) {
+          const list = res.data.map((item) => {
+            return {
+              ...item,
+              from: item.fromLocation.name,
+              to: item.toLocation.name
+            }
+          })
+          this.tableList.tableInfomation = list || []
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    // 鎼滅储
+    getList(val) {
+      console.log(val)
+      this.keyword = val
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 鐘舵��
+    getStatus(val) {
+      return val === 1 ? "鑽夌" : val === 3 ? "灏辩华" : "瀹屾垚"
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped></style>
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index 1b6f8c0..ee066a3 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -2,57 +2,74 @@
   <div class="rightContent">
     <div class="top">
       <SearchCommonView
-        :add-title="'鏂板缓'"
-        :placeholder="'璇疯緭鍏ュ崟鍙�'"
+        :add-title="addTitle"
+        :show-discard="showDiscard"
+        :placeholder="'璇疯緭鍏ヤ綅缃�/浜у搧'"
         :amount-view="false"
-        @addCommonClick="addBtnClick"
+        @addCommonClick="addProductClick"
         @searchClick="getList"
+        @discardBtnClick="discardBtnClick"
+        @applyBtnClick="applyBtnClick"
       />
     </div>
     <div class="list-view">
       <div class="table">
-        <TableCommonView
-          ref="tableListRef"
-          :table-list="tableList"
-          :show-checkcol="false"
+        <CommonFormTableView
+          :islistingrules="true"
+          :product-table-list="tableList"
+          @inputContent="inputContent"
           @tableRowClick="tableRowClick"
-        ></TableCommonView>
+        >
+        </CommonFormTableView>
       </div>
       <div class="btn-pager">
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
-    <!-- 鏂板缓/缂栬緫 -->
-    <AddDialog
-      v-if="editConfig.visible"
-      @refresh="refresh"
-      :positionList="tableList.tableInfomation"
-      :edit-common-config="editConfig"
-    />
   </div>
 </template>
 
 <script>
+import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import { getLocationList } from "@/api/warehouseManage/warehouse"
-import AddDialog from "@/views/warehouseManage/position/AddDialog"
-import { getDataByType } from "@/api/data"
 export default {
-  name: "ListingRules",
+  name: "listingRules",
   props: {},
-  components: { AddDialog },
+  components: { CommonFormTableView },
   mixins: [pageMixin],
   computed: {},
   data() {
     return {
+      addTitle: "鏂板缓",
+      showDiscard: false,
       tableList: {},
+      tableData: [
+        {
+          location: "HC/閿�鍞尯",
+          productName: "澶忓鐪熶笣鍚婂甫瑁�",
+          amount: "0.00",
+          unit: "浠�",
+          count: "0.00",
+          date: "2023-12-31",
+          user: "绠$悊鍛�",
+          isSet: true,
+          isEdit: true
+        },
+        {
+          location: "HM/閿�鍞尯",
+          productName: "澶忓鐪熶笣鍚婂甫瑁�",
+          productCategory: "",
+          subLocation: "A鍖�",
+          companyName: "璐濇�濈",
+          isSet: true,
+          isEdit: true
+        }
+      ],
       searchOptions: [],
-      editConfig: {
-        visible: false,
-        title: "鏂板缓",
-        infomation: {}
-      },
-      positionTypeList: getDataByType("positionType")
+      countId: 0,
+      isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
+      isRowClick: false
     }
   },
   created() {
@@ -62,55 +79,131 @@
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [],
+        tableData: this.tableData,
         selectBox: true,
-        showcol: this.showcol,
-        allcol: [],
-        tableColumn: this.setTableColumn(this.showcol)
+        tableColumn: [
+          { label: "褰撲骇鍝佸埌杈�", prop: "location", location: true },
+          { label: "浜у搧", prop: "productName", product: true },
+          // { label: "浜у搧绫诲埆", prop: "productCategory", productCategory: true },
+          { label: "瀛樺偍鍒板瓙浣嶇疆", prop: "subLocation", location: true },
+          { label: "鍏徃", prop: "companyName", company: true }
+        ]
       }
-      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
     },
-    setTableColumn(showcol) {
-      console.log(showcol)
-      let tableColumn = [
-        {
-          label: "浣嶇疆",
-          prop: "jointName",
-          isShowColumn: true,
-          default: true
-        },
-        {
-          label: "浣嶇疆绫诲瀷",
-          prop: "type",
-          isShowColumn: true,
-          default: true,
-          conversion: true,
-          getStatus: this.getTypesList
+    // 鎿嶄綔杈撳叆
+    inputContent(val, prop, row) {
+      this.countId = row.countId
+      this.tableData.map((item) => {
+        if (item.countId === row.countId) {
+          item[prop] = val
         }
-      ]
-      return tableColumn
+      })
     },
-    getTypesList(val) {
-      let string = "--"
-      if (val) {
-        for (let i in this.positionTypeList) {
-          if (this.positionTypeList[i].id == val) {
-            return this.positionTypeList[i].name
+    // 鏂板
+    addProductClick() {
+      console.log(this.tableData)
+      this.isSel()
+      if (this.isNoProduct && this.addTitle === "鏂板缓") {
+        this.addTitle = "淇濆瓨"
+        this.showDiscard = true
+        this.isRowClick = false
+        this.countId++
+        this.tableData.push({
+          countId: this.countId,
+          productId: "",
+          location: 0,
+          subLocation: "",
+          productName: "",
+          companyName: "",
+          isSet: true,
+          isEdit: false
+        })
+      } else if (this.isNoProduct && this.addTitle === "淇濆瓨") {
+        this.addTitle = "鏂板缓"
+        this.showDiscard = false
+        this.tableData.map((item) => {
+          item.isEdit = true
+          console.log(item)
+          if (typeof item.location === "object") {
+            item.location = item.location.name
           }
+          if (typeof item.subLocation === "object") {
+            item.location = item.subLocation.name
+          }
+        })
+      }
+    },
+    // 鏄惁閫夋嫨浜у搧
+    isSel() {
+      for (let i = 0; i < this.tableData.length; i++) {
+        if (this.tableData[i].productName.length === 0) {
+          this.isNoProduct = false
+          break
+        } else {
+          this.isNoProduct = true
         }
       }
-      return string
     },
-    selTableCol(val) {
-      this.showcol = val
-      this.tableList.tableColumn = this.setTableColumn(val)
+    // 鍙栨秷
+    discardBtnClick() {
+      if (this.isRowClick) {
+        this.tableData.map((item) => {
+          item.isEdit = true
+        })
+      } else {
+        this.tableData.splice(this.tableData.length - 1, 1)
+      }
+      this.addTitle = "鏂板缓"
+      this.showDiscard = false
+    },
+    // 搴旂敤鍏ㄩ儴
+    applyBtnClick() {
+      console.log("搴旂敤鍏ㄩ儴")
+    },
+    // 鍘嗗彶
+    handleHistoryClick(row) {
+      this.isSel()
+      console.log(row)
+      if (this.isNoProduct) {
+        console.log("鍘嗗彶")
+        this.$router.push({
+          name: "inventoryAdjustmentHistory",
+          params: { id: row.id }
+        })
+      }
+    },
+    // 璁剧疆
+    handleSetClick(scope) {
+      this.isSel()
+      if (this.isNoProduct) {
+        scope.row.isSet = !scope.row.isSet
+      }
+    },
+    // 搴旂敤
+    handleUseClick(scope) {
+      scope.row.isSet = !scope.row.isSet
+    },
+    // 娓呴櫎
+    handleCleanupClick(scope) {
+      scope.row.isSet = !scope.row.isSet
+    },
+    // 琛岀偣鍑�
+    tableRowClick(row, rowIndex) {
+      console.log(row, rowIndex)
+      this.addTitle = "淇濆瓨"
+      this.showDiscard = true
+      this.isRowClick = true
+      this.isSel()
+      if (!this.isNoProduct) {
+        this.tableData.splice(this.tableData.length - 1, 1)
+      }
+      this.tableData.map((item, index) => {
+        if (index === rowIndex) {
+          item.isEdit = false
+        } else {
+          item.isEdit = true
+        }
+      })
     },
     // 璇锋眰鏁版嵁
     async getData() {
@@ -126,23 +219,11 @@
         }
       })
     },
-    refresh() {
-      this.pagerOptions.currPage = 1
-      this.getData()
-    },
     // 鎼滅储
     getList(val) {
       this.keyword = val
       this.pagerOptions.currPage = 1
       this.getData()
-    },
-    // 琛岀偣鍑�
-    tableRowClick(row) {
-      console.log(row)
-      this.editConfig.title = "缂栬緫"
-      this.editConfig.infomation = { ...row }
-      this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId)
-      this.editConfig.visible = true
     },
     // 鏂板缓
     addBtnClick() {
diff --git a/src/views/warehouseManage/position/AddDialog.vue b/src/views/warehouseManage/position/AddDialog.vue
index a14916e..e61fef4 100644
--- a/src/views/warehouseManage/position/AddDialog.vue
+++ b/src/views/warehouseManage/position/AddDialog.vue
@@ -34,16 +34,15 @@
       >
         <div>
           <!-- <div>aaa</div> -->
-          <FormBtnsView :showPosition="true" :showWarehouse=false @productClick="productClick" />
+          <FormBtnsView :showPosition="true" :showWarehouse="false" @productClick="productClick" />
         </div>
         <div class="basic-info">
           <div class="basic-info-view">
-
             <el-row>
               <el-col :span="24" class="line_height_30px">
                 <el-form-item label="浣嶇疆鍚嶇О" prop="name">
                   <el-input
-                  :disabled="!showFooter"
+                    :disabled="!showFooter"
                     v-model="editConfig.infomation.name"
                     placeholder="璇疯緭鍏�"
                   ></el-input>
@@ -58,12 +57,7 @@
                     style="width: 45%"
                     :disabled="!showFooter"
                   >
-                    <el-option
-                      v-for="item in positionList"
-                      :key="item.id"
-                      :label="item.name"
-                      :value="item.id"
-                    >
+                    <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -71,94 +65,81 @@
             </el-row>
           </div>
           <div class="bottom">
-              <div class="left">
-                <div class="second-label">鍏朵粬淇℃伅</div>
-                <el-form-item label="浣嶇疆绫诲瀷" prop="type">
-                  <el-select
-                   v-model="editConfig.infomation.type"
-                    filterable
-                    :disabled="!showFooter"
-                    placeholder="璇烽�夋嫨"
-                    style="width: 100%"
-                    no-data-text="鏆傛棤鏁版嵁"
-                  >
-                    <el-option
-                      v-for="item in positionTypeList"
-                      :key="item.id"
-                      :label="item.name"
-                      :value="item.id"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-form-item> 
-                <el-form-item label="鏄竴涓姤搴熶綅缃�" v-if="editConfig.infomation.type==3||editConfig.infomation.type==5" prop="isScrapLocation">
-                  <el-checkbox
+            <div class="left">
+              <div class="second-label">鍏朵粬淇℃伅</div>
+              <el-form-item label="浣嶇疆绫诲瀷" prop="type">
+                <el-select
+                  v-model="editConfig.infomation.type"
+                  filterable
                   :disabled="!showFooter"
-                  v-model="editConfig.infomation.isScrapLocation"
-                  >
-                  </el-checkbox>
-                </el-form-item>
-                <el-form-item label="鏄竴涓��鍥炰綅缃�" prop="isReturnLocation">
-                  <el-checkbox
+                  placeholder="璇烽�夋嫨"
+                  style="width: 100%"
+                  no-data-text="鏆傛棤鏁版嵁"
+                >
+                  <el-option v-for="item in positionTypeList" :key="item.id" :label="item.name" :value="item.id">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item
+                label="鏄竴涓姤搴熶綅缃�"
+                v-if="editConfig.infomation.type == 3 || editConfig.infomation.type == 5"
+                prop="isScrapLocation"
+              >
+                <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.isScrapLocation"> </el-checkbox>
+              </el-form-item>
+              <el-form-item label="鏄竴涓��鍥炰綅缃�" prop="isReturnLocation">
+                <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.isReturnLocation"> </el-checkbox>
+              </el-form-item>
+              <el-form-item label="琛ュ厖浣嶇疆" v-if="editConfig.infomation.type == 3" prop="replenishLocation">
+                <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.replenishLocation"> </el-checkbox>
+              </el-form-item>
+            </div>
+            <div class="left" v-if="editConfig.infomation.type == 3 || editConfig.infomation.type == 7">
+              <div class="second-label">寰幆璁℃暟</div>
+              <el-form-item label="鐩樼偣棰戠巼锛堝ぉ锛�" prop="countFrequency">
+                <el-input
                   :disabled="!showFooter"
-                  v-model="editConfig.infomation.isReturnLocation"
-                  >
-                  </el-checkbox>
-                </el-form-item>
-                <el-form-item label="琛ュ厖浣嶇疆" v-if="editConfig.infomation.type==3" prop="replenishLocation">
-                  <el-checkbox
+                  v-model="editConfig.infomation.countFrequency"
+                  placeholder="璇疯緭鍏�"
+                ></el-input>
+              </el-form-item>
+              <el-form-item label="鏈�杩戞湁鏁堢洏鐐�" prop="recentlyCount">
+                <el-date-picker
                   :disabled="!showFooter"
-                  v-model="editConfig.infomation.replenishLocation"
-                  >
-                  </el-checkbox>
-                </el-form-item>
-              </div>
-              <div class="left" v-if="editConfig.infomation.type==3||editConfig.infomation.type==7">
-                <div class="second-label">寰幆璁℃暟</div>
-                <el-form-item label="鐩樼偣棰戠巼锛堝ぉ锛�" prop="countFrequency">
-                  <el-input
-                   :disabled="!showFooter"
-                    v-model="editConfig.infomation.countFrequency"
-                    placeholder="璇疯緭鍏�"
-                  ></el-input>
-                </el-form-item>
-                <el-form-item label="鏈�杩戞湁鏁堢洏鐐�" prop="recentlyCount">
-                  <el-date-picker
-                   :disabled="!showFooter"
-                    v-model="editConfig.infomation.recentlyCount"
-                    type="date"
-                    placeholder="閫夋嫨鏃ユ湡"
-                    value-format="yyyy-MM-dd"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-                <el-form-item label="棰勮涓嬩竴娆$洏鐐�" prop="nextCount">
-                  <el-date-picker
-                   :disabled="!showFooter"
-                    v-model="editConfig.infomation.nextCount"
-                    type="date"
-                    placeholder="閫夋嫨鏃ユ湡"
-                    value-format="yyyy-MM-dd"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-              </div>
+                  v-model="editConfig.infomation.recentlyCount"
+                  type="date"
+                  placeholder="閫夋嫨鏃ユ湡"
+                  value-format="yyyy-MM-dd"
+                >
+                </el-date-picker>
+              </el-form-item>
+              <el-form-item label="棰勮涓嬩竴娆$洏鐐�" prop="nextCount">
+                <el-date-picker
+                  :disabled="!showFooter"
+                  v-model="editConfig.infomation.nextCount"
+                  type="date"
+                  placeholder="閫夋嫨鏃ユ湡"
+                  value-format="yyyy-MM-dd"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </div>
           </div>
           <el-form-item label="" prop="notes" label-width="20px">
-                  <el-input
-                    :disabled="!showFooter"
-                      type="textarea"
-                      placeholder="澶栭儴澶囨敞"
-                      :autosize="{ minRows: 3, maxRows: 4 }"
-                      maxlength="500"
-                      clearable
-                      v-model="editConfig.infomation.notes"
-                  ></el-input>
+            <el-input
+              :disabled="!showFooter"
+              type="textarea"
+              placeholder="澶栭儴澶囨敞"
+              :autosize="{ minRows: 3, maxRows: 4 }"
+              maxlength="500"
+              clearable
+              v-model="editConfig.infomation.notes"
+            ></el-input>
           </el-form-item>
           <div class="bottom">
             <!-- <div class="left"> -->
-                <!-- <div class="second-label">鐗╂祦</div> -->
-                <!-- <el-form-item label="涓嬭浇绛栫暐" prop="desc">
+            <!-- <div class="second-label">鐗╂祦</div> -->
+            <!-- <el-form-item label="涓嬭浇绛栫暐" prop="desc">
                   <el-select
                    v-model="editConfig.value1"
                     filterable
@@ -177,7 +158,7 @@
                     </el-option>
                   </el-select>
                 </el-form-item> -->
-              <!-- </div> -->
+            <!-- </div> -->
           </div>
         </div>
       </el-form>
@@ -191,8 +172,8 @@
 </template>
 
 <script>
-import { addLocation,updateLocation,deleteLocation } from "@/api/warehouseManage/warehouse"
-import { getDataByType } from "@/api/data";
+import { addLocation, updateLocation, deleteLocation } from "@/api/warehouseManage/warehouse"
+import { getDataByType } from "@/api/data"
 export default {
   name: "AddScrapDialog",
   props: {
@@ -206,8 +187,8 @@
         }
       }
     },
-    positionList:{
-      type:[Array]
+    positionList: {
+      type: [Array]
     }
   },
   components: {},
@@ -218,19 +199,21 @@
       editConfig: this.editCommonConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
-        countFrequency: [{
+        countFrequency: [
+          {
             required: false,
             message: "璇峰~鍐欎笉灏忎簬0鐨勬暟瀛�",
-            trigger: "change",
+            trigger: "change"
           },
           {
             validator: this.validatorNum,
-            trigger: "blur",
-          },],
+            trigger: "blur"
+          }
+        ]
       },
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
-      positionTypeList: getDataByType("positionType"),
+      positionTypeList: getDataByType("positionType")
     }
   },
   created() {
@@ -240,23 +223,21 @@
     validatorNum(rule, value, callback) {
       if (value) {
         if (value == undefined || value == null) {
-          callback(new Error("璇疯緭鍏ユ湁鏁堟暟瀛�"));
+          callback(new Error("璇疯緭鍏ユ湁鏁堟暟瀛�"))
         } else {
-          var reg = /^\+?[0-9]\d*$/;
+          var reg = /^\+?[0-9]\d*$/
           if (!reg.test(value)) {
-            callback(new Error("璇峰~鍐欎笉灏忎簬0鐨勬暟瀛�"));
+            callback(new Error("璇峰~鍐欎笉灏忎簬0鐨勬暟瀛�"))
           } else {
-            callback();
+            callback()
           }
         }
       } else {
-        callback();
+        callback()
       }
     },
     // 璺嚎
-    productClick() {
-      
-    },
+    productClick() {},
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
     setBottonView() {
       if (this.editConfig.title === "鏂板缓") {
@@ -276,16 +257,16 @@
     },
     // 鍒櫎
     deleteClick() {
-      let data = JSON.parse(JSON.stringify(this.editConfig.infomation));
+      let data = JSON.parse(JSON.stringify(this.editConfig.infomation))
       deleteLocation({ id: data.id }).then((res) => {
         if (res.code == 200) {
-          this.editConfig.visible = false;
-          this.$message.success("鍒櫎鎴愬姛!");
-          this.$emit("refresh");
+          this.editConfig.visible = false
+          this.$message.success("鍒櫎鎴愬姛!")
+          this.$emit("refresh")
         } else {
-            this.$message.warning(res.msg?res.msg:"鍒犻櫎澶辫触!")
-         }
-      });
+          this.$message.warning(res.msg ? res.msg : "鍒犻櫎澶辫触!")
+        }
+      })
     },
     // 缂栬緫
     editClick() {
@@ -293,56 +274,56 @@
       this.showFooter = true
     },
     saveParams() {
-      let data =JSON.parse(JSON.stringify(this.editConfig.infomation));
-      
+      let data = JSON.parse(JSON.stringify(this.editConfig.infomation))
+
       let params = {
-        name:data.name,
-        parentId:data.parentId+'',
-        type:data.type,
-        isScrapLocation:data.isScrapLocation,
-        isReturnLocation:data.isReturnLocation,
-        replenishLocation:data.replenishLocation,
-        countFrequency:data.countFrequency?Number(data.countFrequency):0,
-        recentlyCount:data.recentlyCount,
-        nextCount:data.nextCount,
-        notes:data.notes,
+        name: data.name,
+        parentId: data.parentId,
+        type: data.type,
+        isScrapLocation: data.isScrapLocation,
+        isReturnLocation: data.isReturnLocation,
+        replenishLocation: data.replenishLocation,
+        countFrequency: data.countFrequency ? Number(data.countFrequency) : 0,
+        recentlyCount: data.recentlyCount,
+        nextCount: data.nextCount,
+        notes: data.notes
       }
-      if(data.id){
-        params.id=data.id
+      if (data.id) {
+        params.id = data.id
       }
-      return params;
+      return params
     },
     // 淇濆瓨
     saveClick(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-          const params = this.saveParams();
-            if (this.editConfig.title === "鏂板缓") {
-              addLocation(params).then((res) => {
-                if (res.code == 200) {
-                  this.editConfig.visible = false;
-                  this.$message.success("娣诲姞鎴愬姛!");
-                  this.$emit('refresh')
-                } else {
-                    this.$message.warning(res.msg?res.msg:"娣诲姞澶辫触!")
-                }
-              });
-            } else {
-              updateLocation(params).then((res) => {
-                if (res.code == 200) {
-                  this.editConfig.visible = false;
-                  this.$message.success("缂栬緫鎴愬姛!");
-                  this.$emit('refresh')
-                } else {
-                    this.$message.warning(res.msg?res.msg:"缂栬緫澶辫触!")
-                }
-              });
-            }
-        }else {
-          console.log("error submit");
-          return false;
+          const params = this.saveParams()
+          if (this.editConfig.title === "鏂板缓") {
+            addLocation(params).then((res) => {
+              if (res.code == 200) {
+                this.editConfig.visible = false
+                this.$message.success("娣诲姞鎴愬姛!")
+                this.$emit("refresh")
+              } else {
+                this.$message.warning(res.msg ? res.msg : "娣诲姞澶辫触!")
+              }
+            })
+          } else {
+            updateLocation(params).then((res) => {
+              if (res.code == 200) {
+                this.editConfig.visible = false
+                this.$message.success("缂栬緫鎴愬姛!")
+                this.$emit("refresh")
+              } else {
+                this.$message.warning(res.msg ? res.msg : "缂栬緫澶辫触!")
+              }
+            })
+          }
+        } else {
+          console.log("error submit")
+          return false
         }
-      });
+      })
     }
   }
 }
@@ -376,29 +357,26 @@
   -webkit-box-shadow: inset 0 0 2px #dee2e6;
   .basic-info-view {
     margin-top: 20px;
-    padding:0 20px;
-
+    padding: 0 20px;
   }
-  .bottom{
+  .bottom {
     display: flex;
     margin-left: 20px;
     .left {
       width: calc(50% - 10px);
-      margin-right:20px;
+      margin-right: 20px;
     }
     .right {
       width: calc(50% - 10px);
     }
     .second-label {
-      
       border-bottom: 1px solid #d9d9d9;
       margin-bottom: 10px;
     }
-    ::v-deep .el-tabs__content{
+    ::v-deep .el-tabs__content {
       padding: 0 20px;
     }
   }
-  
 }
 .purchase-view {
   display: flex;
diff --git a/src/views/warehouseManage/position/index.vue b/src/views/warehouseManage/position/index.vue
index 5a562a0..5d9c57d 100644
--- a/src/views/warehouseManage/position/index.vue
+++ b/src/views/warehouseManage/position/index.vue
@@ -23,7 +23,12 @@
       </div>
     </div>
     <!-- 鏂板缓/缂栬緫 -->
-    <AddDialog v-if="editConfig.visible" @refresh="refresh" :positionList="tableList.tableInfomation" :edit-common-config="editConfig" />
+    <AddDialog
+      v-if="editConfig.visible"
+      @refresh="refresh"
+      :positionList="tableList.tableInfomation"
+      :edit-common-config="editConfig"
+    />
   </div>
 </template>
 
@@ -31,7 +36,7 @@
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import { getLocationList } from "@/api/warehouseManage/warehouse"
 import AddDialog from "@/views/warehouseManage/position/AddDialog"
-import { getDataByType } from "@/api/data";
+import { getDataByType } from "@/api/data"
 export default {
   name: "WarehouseView",
   props: {},
@@ -47,7 +52,7 @@
         title: "鏂板缓",
         infomation: {}
       },
-      positionTypeList: getDataByType("positionType"),
+      positionTypeList: getDataByType("positionType")
     }
   },
   created() {
@@ -87,21 +92,21 @@
           isShowColumn: true,
           default: true,
           conversion: true,
-          getStatus: this.getTypesList,
+          getStatus: this.getTypesList
         }
       ]
       return tableColumn
     },
-    getTypesList(val){
-      let string='--'
-      if(val){
+    getTypesList(val) {
+      let string = "--"
+      if (val) {
         for (let i in this.positionTypeList) {
           if (this.positionTypeList[i].id == val) {
-            return this.positionTypeList[i].name;
+            return this.positionTypeList[i].name
           }
         }
       }
-      return string;
+      return string
     },
     selTableCol(val) {
       this.showcol = val
@@ -115,20 +120,20 @@
         pageSize: this.pagerOptions.pageSize
       }).then((res) => {
         if (res.code === 200) {
-          const list = res.data?res.data:[]
+          const list = res.data ? res.data : []
           this.tableList.tableInfomation = list
           this.pagerOptions.totalCount = res.total
         }
       })
     },
-    refresh(){
-      this.pagerOptions.currPage=1
+    refresh() {
+      this.pagerOptions.currPage = 1
       this.getData()
     },
     // 鎼滅储
     getList(val) {
-      this.keyword=val;
-      this.pagerOptions.currPage=1
+      this.keyword = val
+      this.pagerOptions.currPage = 1
       this.getData()
     },
     // 琛岀偣鍑�
@@ -136,22 +141,22 @@
       console.log(row)
       this.editConfig.title = "缂栬緫"
       this.editConfig.infomation = { ...row }
-      this.editConfig.infomation.parentId=Number(this.editConfig.infomation.parentId);
+      this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId)
       this.editConfig.visible = true
     },
     // 鏂板缓
     addBtnClick() {
-      this.editConfig.infomation={
-        name:'',
-        parentId:null,
-        type:3,
-        isScrapLocation:null,
-        isReturnLocation:null,
-        replenishLocation:null,
-        countFrequency:0,
-        recentlyCount:'',
-        nextCount:'',
-        notes:'',
+      this.editConfig.infomation = {
+        name: "",
+        parentId: null,
+        type: 3,
+        isScrapLocation: null,
+        isReturnLocation: null,
+        replenishLocation: null,
+        countFrequency: 0,
+        recentlyCount: "",
+        nextCount: "",
+        notes: ""
       }
       this.editConfig.visible = true
       this.editConfig.title = "鏂板缓"

--
Gitblit v1.8.0