Просмотр исходного кода

Merge branch 'develop_yh39' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh39

lilei 1 год назад
Родитель
Сommit
d93fc2afdd

+ 18 - 13
src/views/common/shopingCatModal.vue

@@ -8,11 +8,12 @@
     :wrap-style="{ position: 'absolute' }"
     @close="onClose"
     wrapClassName="shopingCat-drawer jg-drawer-wrap">
-     <div slot="title">
-       <strong>{{title}}</strong>
-       <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
-     </div>
-     <shopingCat ref="shopingCat" modes="modals" @ok="handleok"></shopingCat>
+    <div slot="title">
+      <strong>{{ title }}</strong>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+    </div>
+    <shopingCat ref="shopingCat" modes="modals" @ok="handleok"></shopingCat>
   </a-drawer>
 </template>
 
@@ -20,7 +21,7 @@
 import { commonMixin } from '@/utils/mixin'
 import shopingCat from '@/views/shoppingCarManagement/shoppingCar/list.vue'
 export default {
-  name:"shopingCatModal",
+  name: 'ShopingCatModal',
   mixins: [commonMixin],
   components: {
     shopingCat
@@ -40,22 +41,26 @@ export default {
     },
     paramsData: {
       type: Object
+    },
+    purchaseTargetType: {
+      type: String,
+      default: null
     }
   },
   watch: {
     showModal (newValue, oldValue) {
       this.visible = newValue
       if (newValue) {
-         setTimeout(()=>{
-           this.$refs.shopingCat.pageInit(this.paramsData)
-         },500)
+        setTimeout(() => {
+          this.$refs.shopingCat.pageInit(this.paramsData)
+        }, 500)
       }
-    },
+    }
   },
   data () {
     return {
       visible: this.showModal,
-      title: '购物车',
+      title: '购物车'
     }
   },
   methods: {
@@ -64,7 +69,7 @@ export default {
     },
     handleok () {
       this.$emit('ok')
-    },
+    }
   }
 }
 </script>
@@ -84,6 +89,6 @@ export default {
       height: 100%;
     }
   }
-  
+
 }
 </style>

+ 2 - 1
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -265,6 +265,7 @@
     <!-- 上次缺货 -->
     <outStockModal
       ref="outStock"
+      :purchaseTargetType="detail?detail.purchaseTargetType:null"
       :paramsSn="$route.params.sn"
       :openModal="openOutStockModal"
       :chooseData="chooseData"
@@ -287,7 +288,7 @@ import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressMod
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
-import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCancelList } from '@/api/purchaseDetail'
+import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
 import { productListPurchase } from '@/api/product'
 import defImg from '@/assets/def_img@2x.png'
 import Print from '@/views/common/print.vue'

+ 18 - 4
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -4,10 +4,14 @@
     class="outStock-modal"
     :footer="null"
     :maskClosable="false"
-    title="采购缺货产品明细"
     v-model="isShow"
     @cancel="isShow=false"
     :width="900">
+    <div slot="title">
+      <strong>采购缺货产品明细</strong>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+    </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con">
         <div>
@@ -54,13 +58,18 @@
             ref="table"
             size="small"
             :rowKey="(record) => record.id"
-            :row-selection="{ columnWidth: 40 }"
+            :row-selection="{ columnWidth: 40 ,getCheckboxProps:record=>({props:{disabled:record.productPowerFlag==0}})}"
             @rowSelection="rowSelectionFun"
             :data="loadData"
             :columns="columns"
             :scroll="{ y: 450 }"
             :defaultLoadData="false"
             bordered>
+            <!-- 产品编码 -->
+            <template slot="productCode" slot-scope="text, record">
+              {{ record.productCode }}
+              <a-tag color="red" v-if="record.productPowerFlag== 0">无权限</a-tag>
+            </template>
           </s-table>
         </div>
         <!-- 按钮 -->
@@ -109,6 +118,10 @@ export default {
       default: () => {
         return []
       }
+    },
+    purchaseTargetType: {
+      type: String,
+      default: null
     }
   },
   data () {
@@ -123,7 +136,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '采购单号', dataIndex: 'purchaseBillNo', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', scopedSlots: { customRender: 'productCode' } },
         { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货金额', dataIndex: 'totalAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -161,7 +174,8 @@ export default {
           productTypeSn1: '', //  产品一级分类
           productTypeSn2: '', //  产品二级分类
           productTypeSn3: '' //  产品三级分类
-        }
+        },
+        newPurchaseBillSn: _this.paramsSn
       }
     }
   },

+ 2 - 2
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -171,11 +171,11 @@
       :paramsSn="$route.params.sn"
       :chooseData="chooseData"
       :openModal="openOutStockModal"
+      :purchaseTargetType="detail?detail.purchaseTargetType:null"
       @close="openOutStockModal=false"
       @ok="hanldeOkOutStock" />
     <!-- 购物车 -->
-    <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
-
+    <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" :purchaseTargetType="detail?detail.purchaseTargetType:null" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
   </div>
 </template>
 

+ 21 - 5
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -1,7 +1,6 @@
 <template>
   <a-drawer
     :zIndex="zIndex"
-    title="采购缺货产品明细"
     placement="right"
     :visible="isShow"
     :width="width"
@@ -10,6 +9,11 @@
     @close="onCancel"
     wrapClassName="outStock-modal"
   >
+    <div slot="title">
+      <strong>采购缺货产品明细</strong>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+    </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con jg-drawer-wrap">
         <div>
@@ -63,7 +67,7 @@
             ref="table"
             size="small"
             :rowKey="(record) => record.id"
-            :row-selection="{ columnWidth: 40 }"
+            :row-selection="{ columnWidth: 40 ,getCheckboxProps:record=>({props:{disabled:record.productPowerFlag==0}})}"
             :scroll="{ y:tableHeight, x: 1000 }"
             @rowSelection="rowSelectionFun"
             :data="loadData"
@@ -71,6 +75,11 @@
             :columns="columns"
             :pageSize="30"
             bordered>
+            <!-- 产品编码 -->
+            <template slot="productCode" slot-scope="text, record">
+              {{ record.productCode }}
+              <a-tag color="red" v-if="record.productPowerFlag== 0">无权限</a-tag>
+            </template>
           </s-table>
         </div>
       </div>
@@ -111,6 +120,12 @@ export default {
     zIndex: {
       type: Number,
       default: 100
+    },
+    // 1向总部采购的提示语:注意:仅可添加本供应商有经销权且总部已上线的产品
+    // 2向上级与省仓采购的提示语:注意:仅可添加本供应商有权限的产品
+    purchaseTargetType: {
+      type: String,
+      default: null
     }
   },
   data () {
@@ -126,7 +141,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '采购单号', dataIndex: 'purchaseBillNo', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', scopedSlots: { customRender: 'productCode' } },
         { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货数量', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货金额', dataIndex: 'totalAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -136,7 +151,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return outOfStockDetailList(Object.assign(parameter, { purchaseBillSnList: this.chooseData, purchaseBillNo: this.purchaseBillNo, dealerProduct: this.queryParam })).then(res => {
+        return outOfStockDetailList(Object.assign(parameter, { purchaseBillSnList: this.chooseData, newPurchaseBillSn: _this.paramsSn, purchaseBillNo: this.purchaseBillNo, dealerProduct: this.queryParam })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -160,7 +175,8 @@ export default {
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
-      }
+      },
+      purchaseBillNo: ''
     }
   },
   methods: {