소스 검색

Merge branch 'develop_yh17_fencang' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh17_fencang

lilei 2 년 전
부모
커밋
2fae957651

+ 18 - 5
src/views/common/chooseWarehouse.js

@@ -23,7 +23,7 @@ const warehouse = {
       type: Boolean,
       default: false
     },
-    allowClear:{
+    allowClear: {
       type: Boolean,
       default: true
     },
@@ -42,6 +42,10 @@ const warehouse = {
     modeType: {
       type: String,
       default: 'default'
+    },
+    isDefault: { // 是否有默认值
+      type: Boolean,
+      default: undefined
     }
   },
   data () {
@@ -53,7 +57,7 @@ const warehouse = {
     }
   },
   mounted () {
-    if(this.isPermission){
+    if (this.isPermission) {
       this.$store.state.app.defWarehouse = null
       this.$store.state.app.isWarehouse = false
     }
@@ -81,19 +85,28 @@ const warehouse = {
       ajaxName({}).then(res => {
         if (res.status == 200) {
           // 有权限控制的
-          if(this.isPermission){
+          if (this.isPermission) {
             this.$store.state.app.isWarehouse = res.data && res.data.length > 1
             this.$store.state.app.defWarehouse = res.data && res.data[0]
           }
           this.warehouseData = res.data || []
+          let defaultWarehouseVal = {}
+          if (this.isDefault) {
+            defaultWarehouseVal = res.data.find(con => {
+              return con.defaultFlag == 1 ? con.warehouseSn : ''
+            })
+            this.defaultVal = defaultWarehouseVal.warehouseSn
+            this.$emit('load', defaultWarehouseVal.warehouseSn)
+          } else {
+            this.$emit('load')
+          }
         } else {
-          if(this.isPermission){
+          if (this.isPermission) {
             this.$store.state.app.isWarehouse = false
             this.$store.state.app.defWarehouse = null
           }
           this.warehouseData = []
         }
-        this.$emit('load')
       })
     },
     clearData () {

+ 1 - 1
src/views/productManagement/priceChangeRecord/list.vue

@@ -32,7 +32,7 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品状态">
+                <a-form-item label="变更状态">
                   <v-select code="ENABLE_FLAG" id="productChangeRecordList-productStatus" v-model="queryParam.enabledFlag" allowClear placeholder="请选择产品状态"></v-select>
                 </a-form-item>
               </a-col>

+ 10 - 6
src/views/salesReturnManagement/billOfLading/add.vue

@@ -111,7 +111,7 @@
             </a-col>
             <a-col :spna="24">
               <a-form-model-item label="退货仓库" :label-col="{span:2}" :wrapper-col="{span:20}" prop="warehouseSn">
-                <chooseWarehouse ref="warehouse" v-model="form.warehouseSn" @change="handleWarehouse"></chooseWarehouse>
+                <chooseWarehouse ref="warehouse" @load="loadWarehouseVal" :isDefault="!$route.params.sn" v-model="form.warehouseSn" @change="handleWarehouse"></chooseWarehouse>
               </a-form-model-item>
             </a-col>
             <a-col :spna="24">
@@ -267,14 +267,19 @@ export default {
     }
   },
   methods: {
+    loadWarehouseVal (con) {
+      this.form.warehouseSn = con || undefined
+    },
     // 选择退货仓库
     handleWarehouse (val) {
       this.form.warehouseSn = val
-      if (val && this.$route.query.path && this.$route.query.path == 'salerReturn') {
-        this.chooseData = []
-        if (this.salerReturnWsn && this.salerReturnWsn == val) {
-          const cd = this.$store.state.app.tempBillOfData
+      this.chooseData = []
+      if (this.salerReturnWsn && this.salerReturnWsn == val) {
+        const cd = this.$store.state.app.tempBillOfData
+        if (cd && this.$route.query.path == 'salerReturn') {
           this.chooseData.push(cd)
+        } else {
+          this.getReturnOrderList(this.salerReturnWsn)
         }
       }
     },
@@ -428,7 +433,6 @@ export default {
     },
     pageInit () {
       this.resetForm()
-      console.log('----')
       //  编辑页
       if (this.$route.params.sn) {
         this.form.theme = ''