Pārlūkot izejas kodu

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

chenrui 3 gadi atpakaļ
vecāks
revīzija
9d9b1a5d2e

+ 5 - 0
src/views/common/rangeDate.vue

@@ -4,6 +4,7 @@
     :size="size"
     :value="date"
     :disabledDate="disabledDate"
+    :allowClear="allowClear"
     :format="dateFormat"
     @change="dateChange"
     @calendarChange="dateCalendarChange"
@@ -22,6 +23,10 @@ export default {
     size: {
       type: String,
       default: 'default'
+    },
+    allowClear: {
+      type: Boolean,
+      default: true
     }
   },
   data () {

+ 10 - 15
src/views/salesManagement/salesQuery/chooseActive.vue

@@ -71,16 +71,6 @@ export default {
       type: Boolean,
       default: false
     },
-    buyerSn: {
-      type: String,
-      default: ''
-    },
-    nowData: {
-      type: Object,
-      default: () => {
-        return {}
-      }
-    },
     newLoading: Boolean
   },
   data () {
@@ -91,6 +81,8 @@ export default {
       spinning: false,
       list: [],
       salesBillDetailSn: null,
+      buyerSn: '',
+      nowData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -184,6 +176,14 @@ export default {
     },
     cansel () {
       this.$emit('close')
+    },
+    getData (data, buyerSn) {
+      const _this = this
+      _this.buyerSn = buyerSn
+      _this.nowData = data
+      setTimeout(() => (
+        _this.$refs.table.refresh(true)
+      ), 300)
     }
   },
   watch: {
@@ -197,11 +197,6 @@ export default {
         this.selectedRows = []
         this.selectedRowKeys = []
         this.$emit('close')
-      } else {
-        const _this = this
-        setTimeout(() => (
-          _this.$refs.table.refresh(true)
-        ), 300)
       }
     }
   }

+ 17 - 23
src/views/salesManagement/salesQuery/edit.vue

@@ -20,7 +20,7 @@
           </div>
         </div>
         <!-- 查询配件列表 -->
-        <queryPart ref="partQuery" :buyerSn="detailData&&detailData.buyerSn" :newLoading="isInster" @add="insterProduct"></queryPart>
+        <queryPart ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesEdit-cont">
         <div slot="title">
@@ -117,7 +117,7 @@
           </div>
         </a-alert>
         <!-- 已选促销品列表 -->
-        <queryPromotable ref="promotable" :salesBillSn="$route.params.sn" :delLoading="delLoading" @onCellBlur="onCellBlur" @del="handleDel"></queryPromotable>
+        <queryPromotable ref="promotable" :delLoading="delLoading" @onCellBlur="onCellBlur" @del="handleDel"></queryPromotable>
       </a-card>
     </a-spin>
     <div class="affix-cont">
@@ -133,8 +133,6 @@
     <!-- 添加产品 -->
     <ChooseActive
       ref="activeProduct"
-      :buyerSn="detailData&&detailData.buyerSn"
-      :nowData="nowData"
       :openModal="newActive"
       @ok="addNewActive"
       :newLoading="isInster"
@@ -192,6 +190,7 @@ export default {
           }
           this.disabled = false
           this.dataSource = data.list
+          this.$refs.promotable.getData(this.salesBillSn)
           return data
         })
       }
@@ -224,11 +223,7 @@ export default {
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
       this.getPromoacActiveList()
-      this.getOrderDetail()
-    },
-    // 重置列表
-    resetForm () {
-      this.$refs.table.refresh()
+      this.getOrderDetail(false)
     },
     //  返回
     handleBack () {
@@ -321,12 +316,13 @@ export default {
       })
     },
     //  销售单详情
-    getOrderDetail () {
+    getOrderDetail (flag) {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
-        console.log('getOrderDetail')
         if (res.status == 200) {
           this.detailData = res.data
-          console.log(this.detailData)
+          if (flag) {
+            this.$refs.partQuery.pageInit(this.detailData && this.detailData.buyerSn || '')
+          }
         }
       })
     },
@@ -358,9 +354,9 @@ export default {
     },
     // 选择促销品
     handleSelCx (row) {
-      this.nowData = row
+      // this.nowData = row
       this.newActive = true
-      // this.$refs.activeProduct.getData(row)
+      this.$refs.activeProduct.getData(row, this.detailData && this.detailData.buyerSn || '')
     },
     // 批量添加促销品
     addNewActive (list) {
@@ -377,8 +373,8 @@ export default {
       this.spinning = true
       addPromoGoods(temp).then(res => {
         if (res.status == 200) {
-          this.$refs.promotable.getData()
-          this.getOrderDetail()
+          this.$refs.promotable.getData(this.salesBillSn)
+          this.getOrderDetail(false)
           this.newActive = false
           this.isInster == false
           this.spinning = false
@@ -392,10 +388,10 @@ export default {
       this.newActive = false
     },
     pageInit () {
-      this.getOrderDetail()
-      this.$refs.partQuery.resetSearchForm()
-      this.$refs.promotable.getData()
-      this.$refs.table.refresh(true)
+      if (!this.disabled) {
+        this.getOrderDetail(true)
+        this.$refs.table.refresh(true)
+      }
     }
   },
   mounted () {
@@ -406,9 +402,7 @@ export default {
       vm.salesBillSn = vm.$route.params.sn
       // 获取促销活动
       vm.getPromoacActiveList()
-      if (!vm.disabled) {
-        vm.pageInit()
-      }
+      vm.pageInit()
     })
   }
 }

+ 5 - 4
src/views/salesManagement/salesQuery/queryPart.vue

@@ -99,10 +99,6 @@ export default {
   name: 'QueryPart',
   components: { STable, VSelect, ProductBrand, ProductType },
   props: {
-    buyerSn: {
-      type: [Number, String],
-      default: ''
-    },
     newLoading: Boolean
   },
   data () {
@@ -110,6 +106,7 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
       productType: [],
+      buyerSn: '',
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -185,6 +182,10 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
+    pageInit (buyerSn) {
+      this.buyerSn = buyerSn
+      this.resetSearchForm()
+    },
     // 刷新当前页面
     resetCurForm () {
       this.$refs.table.refresh()

+ 3 - 5
src/views/salesManagement/salesQuery/queryPromotable.vue

@@ -47,10 +47,6 @@ export default {
   name: 'Promotable',
   components: { STable, VSelect },
   props: {
-    salesBillSn: {
-      type: [Number, String],
-      default: ''
-    },
     delLoading: Boolean
   },
   data () {
@@ -59,6 +55,7 @@ export default {
         salesBillSn: '',
         promotionFlag: 1
       },
+      salesBillSn: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.productForm.salesBillSn = this.salesBillSn
@@ -106,7 +103,8 @@ export default {
     handleDel (row) {
       this.$emit('del', row)
     },
-    getData () {
+    getData (salesBillSn) {
+      this.salesBillSn = salesBillSn
       this.$refs.table.refresh(true)
     }
   }

+ 9 - 7
src/views/salesManagement/salesReturn/queryPart.vue

@@ -83,16 +83,13 @@ export default {
   name: 'QueryPart',
   components: { STable, VSelect },
   props: {
-    buyerSn: {
-      type: [Number, String],
-      default: ''
-    },
-    newLoading: Boolean,
-    grabFlag: [Number, String],
-    priceType: [Number, String]
+    newLoading: Boolean
   },
   data () {
     return {
+      buyerSn: '',
+      grabFlag: '',
+      priceType: '',
       queryParam: { //  查询条件
         salesBillNo: '', //  销售单号
         productName: '', // 产品名称
@@ -176,6 +173,11 @@ export default {
       this.queryParam.productCode = ''
       this.$refs.table.refresh(true)
     },
+    pageInit (buyerSn, grabFlag) {
+      this.buyerSn = buyerSn
+      this.grabFlag = grabFlag
+      this.resetSearchForm()
+    },
     // 选择配件
     handleAdd (row) {
       this.$emit('add', row)

+ 6 - 3
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -15,7 +15,7 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="ordeDetail&&ordeDetail.salesReturnBillSource=='SALES'">
         <!-- 查询配件列表 -->
-        <queryPart ref="partQuery" :buyerSn="$route.params.buyerSn" grabFlag="0" :newLoading="isInster" @add="saveProduct"></queryPart>
+        <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
         <!-- alert -->
@@ -97,7 +97,7 @@
         id="salesReturn-handleSubmit">提交</a-button>
     </div>
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn, grabFlag: ordeDetail.grabFlag}" @close="openGuideModal=false" @ok="hanldeOk" />
+    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn, grabFlag: ordeDetail.grabFlag}" @close="closeGuideModel" @ok="hanldeOk" />
   </div>
 </template>
 
@@ -299,6 +299,9 @@ export default {
         this.spinning = false
       })
     },
+    closeGuideModel () {
+      this.openGuideModal = false
+    },
     // 导入产品
     hanldeOk (obj) {
       salesReturnBatchInsert(obj).then(res => {
@@ -312,7 +315,7 @@ export default {
       this.buyerSn = this.$route.params.buyerSn
       this.resetSearchForm(true)
       this.$nextTick(() => {
-        this.$refs.partQuery.resetSearchForm()
+        this.$refs.partQuery.pageInit(this.buyerSn, 0)
       })
     }
   },

+ 4 - 3
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -10,7 +10,7 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="ordeDetail&&ordeDetail.salesReturnBillSource=='SALES'">
         <!-- 查询配件列表 -->
-        <queryPart ref="queryPart" :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
+        <queryPart ref="queryPart" :newLoading="isInster" @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
         <!-- alert -->
@@ -142,7 +142,6 @@ export default {
         // 查询总计
         this.productForm.salesReturnBillSn = this.$route.params.sn
         return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
-          this.getOrderDetail()
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -304,8 +303,10 @@ export default {
       this.orderSn = this.$route.params.sn
       this.buyerSn = this.$route.params.buyerSn
       this.getOrderDetail()
-      this.$refs.queryPart.resetSearchForm()
       this.$refs.table.refresh(true)
+      this.$nextTick(() => {
+        this.$refs.partQuery.pageInit(this.buyerSn, 1)
+      })
     }
   },
   mounted () {

+ 1 - 1
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :allowClear="false" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 1 - 1
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :allowClear="false" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 2 - 8
src/views/salesManagement/waitDispatch/edit.vue

@@ -18,8 +18,6 @@
         <!-- 查询配件列表 -->
         <queryPart
           ref="partQuery"
-          :salesBillSn="salesBillSn"
-          :detailData="detailData"
           :newLoading="isInster"
           @oneDispatch="oneDispatch"
           @cancelProduct="cancelProduct"
@@ -361,10 +359,9 @@ export default {
     //  销售单详情
     getOrderDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
-        console.log('getOrderDetail')
         if (res.status == 200) {
           this.detailData = res.data
-          console.log(this.detailData)
+          this.$refs.partQuery.pageInit(this.$route.params.salesBillSn, this.detailData)
         }
       })
     },
@@ -386,12 +383,9 @@ export default {
       })
     },
     pageInit () {
-      this.getOrderDetail()
       this.salesBillSn = this.$route.params.salesBillSn
-      console.log(this.salesBillSn)
-      // this.$refs.partQuery.resetSearchForm()
       if (!this.disabled) {
-        this.$refs.table.refresh(true)
+        this.resetSearchForm(true)
       }
     }
   },

+ 8 - 6
src/views/salesManagement/waitDispatch/queryPart.vue

@@ -135,12 +135,7 @@ export default {
   name: 'QueryPart',
   components: { STable, VSelect },
   props: {
-    salesBillSn: {
-      type: [Number, String],
-      default: ''
-    },
-    newLoading: Boolean,
-    detailData: Object
+    newLoading: Boolean
   },
   watch: {
     data (newValue, oldValue) {
@@ -153,6 +148,8 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
       productType: [],
+      salesBillSn: '',
+      detailData: null,
       queryParam: {
         ptype: '0', // 类型
         productCode: '', //  产品编码
@@ -273,6 +270,11 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
+    pageInit (salesBillSn, detailData) {
+      this.salesBillSn = salesBillSn
+      this.detailData = detailData
+      this.resetSearchForm()
+    },
     // 刷新当前页面
     resetCurForm () {
       this.selectedRowKeys = []