From 963aa535e2ac0adf5bfc5dbd5168f63f71177c40 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 14 十一月 2023 19:28:50 +0800
Subject: [PATCH] 上架规则列表调整

---
 src/api/common/standard.js                           |   20 ++
 src/views/productManage/reorderRules/index.vue       |    2 
 src/views/reportForm/inboundOutboundDetail/index.vue |   42 ++--
 src/api/data.js                                      |   42 +++++
 src/components/makepager/CommonFormTableView.vue     |    3 
 src/views/warehouseManage/position/AddDialog.vue     |   35 +++-
 src/components/mixin/codeMixin.js                    |  131 ++++++++++++++++
 src/components/makepager/FormBtnsView.vue            |   33 ++-
 src/views/reportForm/locationReport/index.vue        |   21 +-
 src/views/productManage/product/IconCropper.vue      |   28 ++
 src/views/productManage/product/AddProductDialog.vue |   95 ++++++++++-
 src/views/warehouseManage/position/index.vue         |    7 
 12 files changed, 391 insertions(+), 68 deletions(-)

diff --git a/src/api/common/standard.js b/src/api/common/standard.js
new file mode 100644
index 0000000..68e203d
--- /dev/null
+++ b/src/api/common/standard.js
@@ -0,0 +1,20 @@
+import request from "@/common/untils/request"
+export function getCodeStandardList(data) {
+  // return  axios.get(`/api/code/getCodeList`, {
+  //   params: data
+  // })
+
+  return request({
+    url: "/api-wms/v1/code/getCodeList",
+    method: "get",
+    params: data
+  })
+} 
+// 鑾峰彇鑷姩缂栫爜
+export function getAutoCode(data) {
+  return request({
+    url: "/api-wms/v1/code/getAutoCode",
+    method: "post",
+    data
+  })
+}
diff --git a/src/api/data.js b/src/api/data.js
index afa04cb..37e68c5 100644
--- a/src/api/data.js
+++ b/src/api/data.js
@@ -178,6 +178,44 @@
     id: 9
   }
 ]
+// 鍑哄叆搴撴槑缁� 涓氬姟绫诲瀷
+const baseOperationTypeTwo=[
+  {
+    name: "鏀惰揣",
+    id: 1
+  },
+  {
+    name: "浜よ揣",
+    id: 2
+  },
+  {
+    name: "鍐呴儴璋冩嫧",
+    id: 3
+  },
+  {
+    name: "鎶ュ簾",
+    id: 4
+  },
+  {
+    name: "搴撳瓨鐩樼偣",
+    id: 5
+  },
+]
+//閲囪喘绫诲瀷
+const purchaseType = [
+  {
+    name: "閲囪喘",
+    id: 1,
+  },
+  {
+    name: "鑷埗",
+    id: 2,
+  },
+  {
+    name: "濮斿",
+    id: 3,
+  },
+];
 export const getDataByType = (type) => {
   if (type == "purchaseStatus") {
     return purchaseStatus
@@ -199,5 +237,9 @@
     return inventoryValuation
   } else if (type == "positionType") {
     return positionType
+  }else if(type=='baseOperationTypeTwo'){
+    return baseOperationTypeTwo
+  }else if(type=='purchaseType'){
+    return purchaseType;
   }
 }
diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index e193fcd..9bde217 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -151,6 +151,7 @@
                     v-model="scope.row[item.prop]"
                     placeholder="璇烽�夋嫨"
                     size="mini"
+                    filterable
                     style="width: 80%"
                     @change="
                       (val) => {
@@ -208,6 +209,7 @@
                     v-model="locacionName"
                     placeholder="璇烽�夋嫨"
                     size="mini"
+                    filterable
                     style="width: 80%"
                     @change="
                       (val) => {
@@ -237,6 +239,7 @@
                     v-model="scope.row[item.prop]"
                     placeholder="璇烽�夋嫨"
                     size="mini"
+                    filterable
                     style="width: 80%"
                     clearable
                     @clear="setValueNull(scope.row[item.prop])"
diff --git a/src/components/makepager/FormBtnsView.vue b/src/components/makepager/FormBtnsView.vue
index 653231a..876a61c 100644
--- a/src/components/makepager/FormBtnsView.vue
+++ b/src/components/makepager/FormBtnsView.vue
@@ -14,14 +14,14 @@
     >
       <div class="left"><i class="el-icon-present"></i></div>
       <div class="right">
-        <div class="right-label">{{ (countObject?.inLibrary ?? 0) + "浠�" }}</div>
+        <div class="right-label">{{ (countObject?.amount ?? 0) + "浠�" }}</div>
         <div class="right-label">鍦ㄥ簱</div>
       </div>
     </div>
     <div v-if="!showProduct && !showWarehouse && !showPosition && !addProduct" class="sub-number no-cursor">
       <div class="left"><i class="el-icon-present"></i></div>
       <div class="right">
-        <div class="right-label">{{ (countObject?.forecast ?? 0) + "浠�" }}</div>
+        <div class="right-label">{{ (countObject?.predictionAmount ?? 0) + "浠�" }}</div>
         <div class="right-label">棰勬祴</div>
       </div>
     </div>
@@ -33,8 +33,8 @@
     >
       <div class="left icon-view"><i class="el-icon-sort"></i></div>
       <div class="right">
-        <div class="right-label">{{ "杩�: " + (countObject?.enter ?? 0) }}</div>
-        <div class="right-label">{{ "鍑�: " + (countObject?.exit ?? 0) }}</div>
+        <div class="right-label">{{ "杩�: " + (countObject?.inputAmount ?? 0) }}</div>
+        <div class="right-label">{{ "鍑�: " + (countObject?.outputAmount ?? 0) }}</div>
       </div>
     </div>
     <!-- <div
@@ -56,14 +56,20 @@
     >
       <div class="left"><i class="el-icon-refresh"></i></div>
       <div class="right">
-        <div class="right-label">{{ countObject?.reorderRule ?? 0 }}</div>
-        <div class="right-label">閲嶈璐ц鍒�</div>
+        <template v-if="countObject?.reorderRuleNum== 1">
+          <div class="right-label">鏈�灏忥細{{ countObject?.minInventoryRule ?? 0 }}</div>
+          <div class="right-label">鏈�澶э細{{  countObject?.maxInventoryRule ?? 0 }}</div>
+        </template>
+        <template v-else>
+          <div class="right-label">{{ countObject?.reorderRuleNum ?? 0 }}</div>
+          <div class="right-label">閲嶈璐ц鍒�</div>
+        </template>
       </div>
     </div>
     <div v-if="showProduct" class="sub-number left_border yes-cursor" @click="productClick">
       <div class="left"><i class="el-icon-s-fold"></i></div>
       <div class="right">
-        <div class="right-label">{{ countObject?.product ?? 0 }}</div>
+        <div class="right-label">{{ countObject?.reorderRuleNum ?? 0 }}</div>
         <div class="right-label">浜у搧</div>
       </div>
     </div>
@@ -87,7 +93,7 @@
         <div class="right-label">宸插敭</div>
       </div>
     </div> -->
-    <div v-if="showPosition" class="sub-number no-cursor">
+    <div v-if="showPosition" :class="showPositionCursor?'sub-number yes-cursor':'no-cursor sub-number'" @click="positionReport">
       <div class="left"><i class="el-icon-help"></i></div>
       <div class="right">
         <div class="right-one">褰撳墠搴撳瓨</div>
@@ -129,6 +135,10 @@
       type: Boolean,
       default: true
     },
+    showPositionCursor:{
+      type: Boolean,
+      default: false,
+    },
     countObject: {
       type: Object,
       default: () => {
@@ -147,6 +157,9 @@
     return {}
   },
   methods: {
+    positionReport(){
+      this.$emit("positionReport")
+    },
     // 杩涘嚭
     inOutBoundClick() {
       this.$emit("inOutBoundClick")
@@ -181,12 +194,12 @@
   padding: 0px 10px;
   font-size: 13px;
   .sub-number {
-    width: 12.5%;
+    width: 13%;
     border-right: 1px solid #e9e9e9;
     border-top: 1px solid #e9e9e9;
     border-bottom: 1px solid #e9e9e9;
     display: flex;
-    padding: 3px 9px;
+    padding: 3px 5px;
     .left {
       margin-top: 3px;
       font-size: 22px;
diff --git a/src/components/mixin/codeMixin.js b/src/components/mixin/codeMixin.js
new file mode 100644
index 0000000..9c07427
--- /dev/null
+++ b/src/components/mixin/codeMixin.js
@@ -0,0 +1,131 @@
+
+import { getCodeStandardList,getAutoCode } from "@/api/common/standard"
+export default {
+  components: {},
+  data() {
+    return {
+      // 缂栫爜
+      // 鏄惁鑷姩鐢熸垚
+      isIdDisabled: false,
+      inputValue: [],
+      explain: "",
+      codenumer: 0, //姣忔杈撳叆鐨勭紪鐮�
+      codenumberList: [], //鏁存潯缂栫爜
+      sum: 0,
+      method: 0,
+      objCode: { name: "", page: 0, pageSize: 0, type: "鐗╂枡缂栫爜", codeStandID: "" },
+      codeRule: {},
+      codeLength: 0,
+      autoCodeObj: {}
+    }
+  },
+
+  methods: {
+    async getRCodeStandardList() {
+      try {
+        if (this.editConfig.title == "鏂板缓") {
+          const res = await getCodeStandardList(this.objCode)
+          this.codenumer = []
+          this.sum = 0
+          this.explain = ""
+          this.codeLength = 0;
+          if (res.code == 200) {
+            const { List = [], ID, AutoRule = {}, Method } = res.data ? res.data[0] : []
+            this.codeRule = res.data ? res.data[0] : {}
+            let autoRule = AutoRule  
+            let method = Method ? Method : 0
+            this.method = method
+            let rules = List
+            this.editConfig.infomation.ID = ID
+            if (method == 0 && res.data.data.length > 0) {
+              console.log("sss")
+              rules.forEach((item, index) => {
+                // setTimeout(() => {
+                //   this.codenumer = item.length;
+                //   this.sum++;
+                // }, 200);
+                this.codenumer.push(item.Length)
+                this.codeLength += item.Length;
+                this.sum++
+                this.explain += item.Name + (index === rules.Length - 1 ? "" : "/")
+              })
+            }
+            console.log(method)
+            if (method == 1) {
+              if (Object.keys(autoRule).length > 0) {
+                this.isIdDisabled = true
+                if (autoRule.PrefixMethod == 1) {
+                  let prefix = autoRule.PrefixValue.split("").length
+
+                  this.codenumer.push(prefix)
+                  this.codeLength += prefix;
+                  if (autoRule.SuffixMethod == 2) {
+                    this.codenumer.push(8)
+                    this.codeLength += 8;
+                  }
+                  if (autoRule.AutoLength) {
+                    this.codenumer.push(autoRule.AutoLength)
+                    this.codeLength += autoRule.AutoLength;
+                  }
+                  this.sum = prefix + Number(autoRule.AutoLength)
+                  // this.codeList(
+                  //   this.editConfig.infomation.id ? this.editConfig.infomation.id : autoRule.PrefixValue
+                  // )
+                }
+              }
+            }
+
+            this.$forceUpdate()
+          } else {
+            this.$message.error(res.data.msg ? res.data.msg : "鑾峰彇缂栫爜瑙勮寖澶辫触锛岃閲嶈瘯锛�")
+          }
+          this.getAutoCodeValue()
+        } else {
+          this.codeList(this.editConfig.infomation.id)
+        }
+      } catch (err) {
+        console.log(err)
+      }
+    },
+    async getAutoCodeValue() {
+      if(Object.keys(this.codeRule).length>0){
+        const res = await getAutoCode(this.codeRule);
+        if (res.code == 200) {
+          let p={
+            id:'',
+            codeStandardID:'',
+            maxAutoIncr:''
+          }
+          this.autoCodeObj = res.data?res.data:p;
+          this.$set(this.editConfig.infomation, 'id', this.autoCodeObj.id)
+        }else{
+          this.$set(this.editConfig.infomation, 'id', this.codeRule.AutoRule.PrefixValue?this.codeRule.AutoRule.PrefixValue:'')
+        }
+      }
+      
+    },
+    codeList(val) {
+      this.inputValue = val
+      this.codenumberList = val.toString()
+      this.editConfig.infomation.number = this.codenumberList.length > 0 ? this.codenumberList.replace(/,/g, "") : ""
+      console.log(this.codenumberList.replace(/,/g, ""))
+    },
+     // 璁㈠崟缂栫爜鍗曠嫭鏍¢獙
+     validateCheckCode(rule, value, callback) {
+      if (value && value.length > 0) {
+        if (this.editConfig.title == "鏂板缓") {
+            if (value.length != this.codeLength) {
+              callback(new Error("璇峰~鍐�" + this.codeLength + "浣嶇殑缂栫爜锛�"));
+            }
+         }
+        callback();
+      } else {
+        callback(new Error("璇疯緭鍏ョ紪鐮�"));
+      }
+    },
+    // 閰嶇疆缂栫爜瑙勮寖鐨勮烦杞�
+    numberClick() {
+      window.open("http://www.fai365.com:9080/facilty", "_blank")
+    }
+  }
+}
diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index 62f996c..d1b5371 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -66,6 +66,30 @@
                       style="width: 85%"
                     ></el-input>
                   </el-form-item>
+                  <el-form-item label="浜у搧缂栫爜" prop="id">
+                    <el-input
+                      style="width: 85%"
+                      v-if="
+                        editConfig.title == '缂栬緫' ||
+                        (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
+                      "
+                      :disabled="editConfig.title != '鏂板缓'"
+                      v-model="editConfig.infomation.id"
+                      placeholder="璇疯緭鍏ョ紪鐮�"
+                    >
+                    </el-input>
+                    <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c; width: 85%"
+                      >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
+                    >
+                  </el-form-item>
+                  <el-form-item label="浜у搧瑙勬牸" prop="specs">
+                    <el-input
+                      style="width: 85%"
+                      :disabled="!showFooter"
+                      v-model="editConfig.infomation.specs"
+                      placeholder="璇疯緭鍏�"
+                    ></el-input>
+                  </el-form-item>
                   <el-form-item label="浜у搧绫诲瀷" prop="productType">
                     <el-select
                       v-model="editConfig.infomation.productType"
@@ -183,6 +207,21 @@
                       </el-option>
                     </el-select>
                   </el-form-item>
+                  <el-form-item label="浜у搧鍨嬪彿" prop="type">
+                    <el-input
+                      style="width: 85%"
+                      :disabled="!showFooter"
+                      v-model="editConfig.infomation.type"
+                      placeholder="璇疯緭鍏�"
+                    ></el-input>
+                  </el-form-item>
+                  <el-form-item label="閲囪喘绫诲瀷" prop="purchaseType">
+                    <el-radio-group :disabled="!showFooter" v-model="editConfig.infomation.purchaseType">
+                      <el-radio v-for="item in purchaseTypeList" :key="item.id" :label="item.id">{{
+                        item.name
+                      }}</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
                   <el-form-item label="鍐呴儴缂栫爜" prop="internalReference">
                     <el-input
                       v-model.trim="editConfig.infomation.internalReference"
@@ -205,9 +244,9 @@
               </div>
               <div class="all">
                 <!-- <div class="second-label">澶囨敞</div> -->
-                <el-form-item label="澶囨敞" prop="internalNotes">
+                <el-form-item label="澶囨敞" prop="note">
                   <el-input
-                    v-model.trim="editConfig.infomation.internalNotes"
+                    v-model.trim="editConfig.infomation.note"
                     placeholder="璇疯緭鍏�"
                     size="mini"
                     type="textarea"
@@ -474,8 +513,10 @@
 import { getProductCategoryList } from "@/api/product/productCategory"
 import { getProductList, addProduct, updateProduct } from "@/api/product/product"
 import { uploadFiles } from "@/api/common/other"
-
+import codeMixin from "@/components/mixin/codeMixin"
+import { getDataByType } from "@/api/data"
 export default {
+  mixins: [codeMixin],
   name: "AddProductDialog",
   props: {
     editCommonConfig: {
@@ -508,9 +549,12 @@
       editConfig: this.editCommonConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏ヤ骇鍝佸悕绉�", trigger: "blur" }],
+        id: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }],
         model: [{ required: true, message: "璇烽�夋嫨鐗╂枡绫诲瀷", trigger: "change" }],
         // salePrice: [{ required: true, message: "璇疯緭鍏ラ攢鍞环鏍�", trigger: "blur" }],
-        unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: "blur" }]
+        unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: ["change", "blur"] }],
+        // 閲囪喘绫诲瀷
+        purchaseType: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }]
       },
       memberOptions: [{ name: "绠$悊鍛�", id: 1 }],
       productCategoryOptions: [], // 浜у搧绫诲埆
@@ -549,10 +593,25 @@
         { name: "鍏朵粬", id: "鍏朵粬" }
       ],
       statisticsMap: {
-        inLibrary: 0 // 鍦ㄥ簱
+        amount: this.editCommonConfig.infomation.amount ? this.editCommonConfig.infomation.amount : 0, // 鍦ㄥ簱
+        predictionAmount: this.editCommonConfig.infomation.predictionAmount
+          ? this.editCommonConfig.infomation.predictionAmount
+          : 0, //棰勬祴
+        inputAmount: this.editCommonConfig.infomation.inputAmount ? this.editCommonConfig.infomation.inputAmount : 0, //杩�
+        outputAmount: this.editCommonConfig.infomation.outputAmount ? this.editCommonConfig.infomation.outputAmount : 0, //鍑�
+        reorderRuleNum: this.editCommonConfig.infomation.reorderRuleNum
+          ? this.editCommonConfig.infomation.reorderRuleNum
+          : 0, //閲嶈璐ц鍒欐暟閲�
+        minInventoryRule: this.editCommonConfig.infomation.minInventoryRule
+          ? this.editCommonConfig.infomation.minInventoryRule
+          : 0, //鏈�灏忛噸璁㈣揣
+        maxInventoryRule: this.editCommonConfig.infomation.maxInventoryRule
+          ? this.editCommonConfig.infomation.maxInventoryRule
+          : 0 //鏈�澶ч噸璁㈣揣
       },
       isView: false,
-      fileFormdata: null // 涓婁紶鍥剧墖鍏ュ弬
+      fileFormdata: null, // 涓婁紶鍥剧墖鍏ュ弬
+      purchaseTypeList: getDataByType("purchaseType")
     }
   },
   created() {
@@ -564,12 +623,24 @@
     this.setTableForm()
     this.setBottonView()
     this.statisticsMap.inLibrary = this.editConfig?.infomation?.amount ?? 0
+    // 杩涘嚭鍙g殑浜у搧 鏁伴噺 杩樻病鏈�
+    this.statisticsMap.enter = this.editConfig?.infomation?.amount ?? 0
+    this.statisticsMap.exit = this.editConfig?.infomation?.amount ?? 0
     if (this.editConfig.autoEdit) {
       this.editClick()
     }
     this.setOptionalFieldsToEmpty()
+    this.formInfo()
   },
   methods: {
+    formInfo() {
+      this.objCode.type = "鐗╂枡缂栫爜"
+      this.objCode.codeStandID = ""
+      if (this.editConfig.infomation.codeStandardID) {
+        this.objCode.codeStandID = this.editConfig.infomation.codeStandardID
+      }
+      this.getRCodeStandardList()
+    },
     /**
      * 闈炲繀濉」鍚庣杩斿洖鐨勬槸鏁板瓧 0,琛ㄥ崟闇�瑕佺┖涓叉墠鑳借涓烘湭閫夋嫨鍥炴樉
      */
@@ -644,6 +715,7 @@
       this.showEdit = false
       this.showButton = false
       this.showFooter = true
+      this.isView = false
       this.setTableForm()
     },
     // 淇濆瓨
@@ -679,14 +751,19 @@
     saveEditRequest(attachmentIDs) {
       let requestUrl = this.editConfig.title === "鏂板缓" ? addProduct : updateProduct
       this.unsetFieldsToNumber()
-      requestUrl({
+      let params = {
         ...this.editConfig.infomation,
         attachmentIDs
-      }).then((res) => {
+      }
+      if (this.editConfig.title == "鏂板缓") {
+        params.codeStandardID = this.autoCodeObj.codeStandardID
+        params.autoIncr = this.autoCodeObj.maxAutoIncr
+      }
+      requestUrl(params).then((res) => {
         console.log(res)
         this.editConfig.visible = false
         if (res.code === 200) {
-          this.$message.success("娣诲姞鎴愬姛")
+          this.$message.success(this.editConfig.title === "鏂板缓" ? "娣诲姞" : "缂栬緫" + "鎴愬姛!")
           this.$parent.getData()
         }
       }, console.error)
diff --git a/src/views/productManage/product/IconCropper.vue b/src/views/productManage/product/IconCropper.vue
index cc074b0..ee360dc 100644
--- a/src/views/productManage/product/IconCropper.vue
+++ b/src/views/productManage/product/IconCropper.vue
@@ -127,16 +127,30 @@
       fileName: ""
     }
   },
-  mounted() {
-    console.log(this.imageUrl)
-    if (!this.isView && this.imageUrl?.length > 0) {
-      this.isPreview = true
-      this.previewImg = this.imageUrl
-    } else {
-      this.isPreview = false
+  computed: {
+    myIsView() {
+      return this.isView
     }
   },
+  watch: {
+    myIsView() {
+      this.setImgMethods()
+    }
+  },
+  mounted() {
+    console.log(this.imageUrl)
+    this.setImgMethods()
+  },
   methods: {
+    // 璁剧疆涓婁紶/鏇存崲鍥剧墖鏄剧ず鏂规硶
+    setImgMethods() {
+      if (!this.isView && this.imageUrl?.length > 0) {
+        this.isPreview = true
+        this.previewImg = this.imageUrl
+      } else {
+        this.isPreview = false
+      }
+    },
     // 涓婁紶鎸夐挳 闄愬埗鍥剧墖澶у皬鍜岀被鍨�
     handleChangeUpload(file, fileList) {
       const isJPG = file.raw.type === "image/jpeg" || file.raw.type === "image/png"
diff --git a/src/views/productManage/reorderRules/index.vue b/src/views/productManage/reorderRules/index.vue
index 57d32fa..c233acd 100644
--- a/src/views/productManage/reorderRules/index.vue
+++ b/src/views/productManage/reorderRules/index.vue
@@ -134,7 +134,7 @@
             }
             return {
               ...item,
-              productName: item.product.name,
+              productName: { label: item.product.name, value: item.product.id },
               locationName: item.location.name,
               isSet: false,
               isEdit: true,
diff --git a/src/views/reportForm/inboundOutboundDetail/index.vue b/src/views/reportForm/inboundOutboundDetail/index.vue
index c6ee050..c354af5 100644
--- a/src/views/reportForm/inboundOutboundDetail/index.vue
+++ b/src/views/reportForm/inboundOutboundDetail/index.vue
@@ -34,7 +34,7 @@
 // import { getProductOperatonList } from "@/api/product/product"
 
 import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
-
+import { getDataByType } from "@/api/data"
 export default {
   name: "InboundOutboundDetail",
   props: {},
@@ -56,7 +56,8 @@
         title: "鏂板缓",
         infomation: {}
       },
-      params: {}
+      params: {},
+      baseOperationTypeList:getDataByType("baseOperationTypeTwo"),
     }
   },
   created() {
@@ -71,7 +72,7 @@
       sessionStorage.setItem("paramsList", JSON.stringify(params))
     }
     this.params = params
-    console.log(this.params)
+    console.log(this.params,'====111')
     this.getData()
   },
   // 椤甸潰閿�姣佷箣鍓�
@@ -121,7 +122,9 @@
           label: "涓氬姟绫诲瀷",
           prop: "baseOperationType",
           isShowColumn: true,
-          default: true
+          default: true,
+          conversion: true,
+          getStatus: this.getBaseOperationTypeList
         },
         {
           label: "浠�",
@@ -170,6 +173,17 @@
       this.showcol = val
       this.tableList.tableColumn = this.setTableColumn(val)
     },
+    getBaseOperationTypeList(val){
+      let string = "--"
+      if (val) {
+        for (let i in this.baseOperationTypeList) {
+          if (this.baseOperationTypeList[i].id == val) {
+            return this.baseOperationTypeList[i].name
+          }
+        }
+      }
+      return string
+    },
     // 搴撳瓨鎶ヨ〃璺宠浆璇锋眰鏁版嵁
     async getData() {
       if (this.params.name === "鎶ヨ〃") {
@@ -212,21 +226,7 @@
           pageSize: this.pagerOptions.pageSize
         }).then((res) => {
           if (res.code === 200) {
-            // let arr=[]
-            res.data.map((item)=>{
-              if(item.baseOperationType===1){
-                item.baseOperationType="鏀惰揣"
-              }else if(item.baseOperationType===2){
-                item.baseOperationType="浜よ揣"
-              }else if(item.baseOperationType===3){
-                item.baseOperationType="鍐呴儴璋冩嫧"
-              }else if(item.baseOperationType===4){
-                item.baseOperationType="鎶ュ簾"
-              }else if(item.baseOperationType===5){
-                item.baseOperationType="搴撳瓨鐩樼偣"
-              }
-            })
-            this.tableList.tableInfomation = res.data
+            this.tableList.tableInfomation = res.data?res.data:[]
             this.pagerOptions.totalCount = res.total
           }
         })
@@ -234,7 +234,8 @@
     },
     // 鎼滅储
     getList(val) {
-      console.log(val)
+      this.params.keyWord=val;
+      this.getData()
       // getHistory({
       //     page: this.pagerOptions.currPage,
       //     pageSize: this.pagerOptions.pageSize
@@ -247,7 +248,6 @@
     },
     // 琛岀偣鍑�
     tableRowClick(row) {
-      console.log(row, "琛宺ow")
       this.editConfig.visible = true
       this.editConfig.title = "鏌ョ湅"
       this.editConfig.infomation = { ...row }
diff --git a/src/views/reportForm/locationReport/index.vue b/src/views/reportForm/locationReport/index.vue
index 6efd9ed..a26c37d 100644
--- a/src/views/reportForm/locationReport/index.vue
+++ b/src/views/reportForm/locationReport/index.vue
@@ -106,7 +106,8 @@
       },
       productId: this.$route.params.id,
       productName: this.$route.params.name,
-      metaTitle: this.$route.meta.title
+      metaTitle: this.$route.meta.title,
+      keyWord:''
     }
   },
   created() {
@@ -218,20 +219,22 @@
         pageSize: this.pagerOptions.pageSize
       })
       }else{
-        this.getLocationData({
+        let params={
           page: this.pagerOptions.currPage,
-          pageSize: this.pagerOptions.pageSize
-        })
+          pageSize: this.pagerOptions.pageSize,
+          keyWord:this.keyWord,
+        }
+        if(this.$route.params.locationId){
+          params.locationId=this.$route.params.locationId
+        }
+        this.getLocationData(params)
       }
     },
 
     // 鎼滅储
     getList(val) {
-      this.getLocationData({
-        page: 1,
-        pageSize: this.pagerOptions.pageSize,
-        keyWord: val
-      })
+      this.keyWord=val
+      this.getData()
     },
     // 琛岀偣鍑�
     tableRowClick(row) {
diff --git a/src/views/warehouseManage/position/AddDialog.vue b/src/views/warehouseManage/position/AddDialog.vue
index dba6cb2..b7f7ca6 100644
--- a/src/views/warehouseManage/position/AddDialog.vue
+++ b/src/views/warehouseManage/position/AddDialog.vue
@@ -19,7 +19,14 @@
             <span>鍔ㄤ綔</span>
             <!-- <el-button plain size="mini" style="margin-left: 15px" @click="deleteClick">鍒犻櫎</el-button> -->
           </span>
-          <el-button v-if="showEdit&&editConfig.infomation.type==3" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
+          <el-button
+            v-if="showEdit && editConfig.infomation.type == 3"
+            plain
+            size="mini"
+            style="margin-left: 15px"
+            @click="editClick"
+            >缂栬緫</el-button
+          >
         </div>
       </div>
       <!-- 鍐呭 -->
@@ -32,7 +39,7 @@
         size="mini"
       >
         <div class="content-number-bg">
-          <FormBtnsView :showPosition="true" :showWarehouse="false" @productClick="productClick" />
+          <FormBtnsView :showPosition="true" :showPositionCursor="this.editConfig.title != '鏂板缓'?true:false" @positionReport="positionReport" :showWarehouse="false" @productClick="productClick" />
         </div>
         <div class="basic-info">
           <div class="basic-info-view">
@@ -53,7 +60,7 @@
                     v-model="editConfig.infomation.parentId"
                     placeholder="璇烽�夋嫨"
                     size="mini"
-                    :disabled="editCommonConfig.title!='鏂板缓'"
+                    :disabled="editCommonConfig.title != '鏂板缓'"
                     style="width: 90%"
                   >
                     <el-option v-for="item in positionList" :key="item.id" :label="item.jointName" :value="item.id">
@@ -68,7 +75,7 @@
                   <el-select
                     v-model="editConfig.infomation.type"
                     filterable
-                    :disabled="editCommonConfig.title!='鏂板缓'"
+                    :disabled="editCommonConfig.title != '鏂板缓'"
                     placeholder="璇烽�夋嫨"
                     style="width: 90%"
                     no-data-text="鏆傛棤鏁版嵁"
@@ -202,7 +209,7 @@
       editConfig: this.editCommonConfig,
       rules: {
         name: [{ required: true, message: "璇疯緭鍏�", trigger: "change" }],
-        parentId: [{ required: true, message: "璇烽�夋嫨浣嶇疆绫诲瀷", trigger: "change" }],
+        // parentId: [{ required: true, message: "璇烽�夋嫨浣嶇疆绫诲瀷", trigger: "change" }],
         type: [{ required: true, message: "璇烽�夋嫨涓婄骇浣嶇疆", trigger: "change" }],
         countFrequency: [
           {
@@ -222,6 +229,7 @@
     }
   },
   created() {
+    console.log(this.editConfig.infomation)
     this.setBottonView()
   },
   methods: {
@@ -241,11 +249,22 @@
         callback()
       }
     },
+    // 褰撳墠搴撳瓨
+    positionReport(){
+      if(this.editConfig.title != '鏂板缓'){
+        this.$router.push({
+          name: "locationReport",
+          params: {
+            locationId: this.editConfig.infomation.id
+          }
+        })
+      }
+    },
     // 璺嚎
     productClick() {},
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
     setBottonView() {
-      if (this.editConfig.title === "鏂板缓"||this.editConfig.title === "缂栬緫") {
+      if (this.editConfig.title === "鏂板缓" || this.editConfig.title === "缂栬緫") {
         this.showEdit = false
         this.showFooter = true
       } else if (this.editConfig.infomation.status === "瀹屾垚") {
@@ -294,8 +313,8 @@
         notes: data.notes
       }
       if (data.id) {
-        params.id = data.id;
-        params.jointName=data.jointName;
+        params.id = data.id
+        params.jointName = data.jointName
       }
       return params
     },
diff --git a/src/views/warehouseManage/position/index.vue b/src/views/warehouseManage/position/index.vue
index b1bc80c..773ef77 100644
--- a/src/views/warehouseManage/position/index.vue
+++ b/src/views/warehouseManage/position/index.vue
@@ -124,12 +124,13 @@
     },
     // 璇锋眰鏁版嵁
     async getData() {
-      await getLocationList({
+      let params={
         type: this.type,
         keyword: this.keyword,
         page: this.pagerOptions.currPage,
-        pageSize: this.pagerOptions.pageSize
-      }).then((res) => {
+        pageSize: this.pagerOptions.pageSize,
+      }
+      await getLocationList(params).then((res) => {
         if (res.code === 200) {
           const list = res.data ? res.data : []
           this.tableList.tableInfomation = list

--
Gitblit v1.8.0