Browse Source

添加权限

chenrui 11 months ago
parent
commit
ace10e746c

+ 3 - 3
src/api/purchase.js

@@ -52,14 +52,14 @@ export const purchaseDetailPageList = (params) => {
     }
   })
 }
-//  采购入库 明细列表合计
+//  采购入库 明细列表  基础信息
 export const queryDetailCount = (params) => {
   const url = `/purchase/queryBySn/${params.sn}`
   return axios({
     url: url,
     method: 'post',
     headers: {
-      'module': encodeURIComponent('明细合计')
+      'module': encodeURIComponent('基础信息')
     }
   })
 }
@@ -93,7 +93,7 @@ export const purchaseSubmit = (params) => {
     data: params,
     method: 'post',
     headers: {
-      'module': encodeURIComponent('新增/编辑')
+      'module': encodeURIComponent('提交')
     }
   })
 }

+ 4 - 4
src/config/router.config.js

@@ -869,8 +869,8 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '采购入库',
-              icon: 'gold'
-              // permission: 'M_purchaseReceiptList'
+              icon: 'gold',
+              permission: 'M_purchaseReceipt'
             },
             hideChildrenInMenu: true,
             children: [
@@ -881,8 +881,8 @@ export const asyncRouterMap = [
                 meta: {
                   title: '采购入库列表',
                   icon: 'gold',
-                  hidden: true
-                  // permission: 'M_purchaseReceiptList'
+                  hidden: true,
+                  permission: 'M_purchaseReceiptList'
                 }
               },
               {

+ 7 - 8
src/views/purchasingManagement/purchaseReceipt/detailModal.vue

@@ -136,18 +136,17 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购单价', dataIndex: 'productTotalCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '采购金额', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
-        // { title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '采购数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '采购单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        // { title: '采购金额', dataIndex: 'subtotal', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
       ]
       if (this.basicInfoData && this.basicInfoData.state && this.basicInfoData.state === 'FINISH') {
         arr.push({ title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } })
       }
-      // if (this.$hasPermissions('B_sparePartsDetail_costPrice')) { //  成本价权限
-      //   arr.splice(5, 0, { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-      //   arr.splice(6, 0, { title: '小计', dataIndex: 'subtotal', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-      // }
+      if (this.$hasPermissions('B_purchaseReceiptDetail_costPrice')) { //  成本价权限
+        arr.splice(5, 0, { title: '采购单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'subtotal', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      }
       return arr
     }
   },

+ 10 - 75
src/views/purchasingManagement/purchaseReceipt/edit.vue

@@ -194,84 +194,19 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        {
-          title: '产品编码',
-          dataIndex: 'productCode',
-          width: '18%',
-          align: 'center',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
-        {
-          title: '产品名称',
-          dataIndex: 'productName',
-          width: '25%',
-          align: 'left',
-          customRender: function (text) {
-            return text || '--'
-          },
-          ellipsis: true
-        },
-        {
-          title: '单位',
-          dataIndex: 'unit',
-          align: 'center',
-          width: '6%',
-          customRender: function (text) {
-            return text || '--'
-          }
-        },
+        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
         { title: '采购数量', dataIndex: 'productQty', align: 'center', width: '13%', customRender: function (text) { return text || text == 0 ? text : '--' } },
-        {
-          title: '第三方库存',
-          dataIndex: 'thirdStockQty',
-          align: 'center',
-          width: '10%',
-          customRender: function (text) {
-            return text || text == 0 ? text : '--'
-          }
-        },
-        {
-          title: '采购单价',
-          dataIndex: 'productCost',
-          width: '8%',
-          align: 'right',
-          customRender: function (text) {
-            return text || text == 0 ? _this.toThousands(text, 2) : '--'
-          }
-        },
-        {
-          title: '采购金额',
-          dataIndex: 'subtotal',
-          width: '8%',
-          align: 'right',
-          customRender: function (text) {
-            return text || text == 0 ? _this.toThousands(text, 2) : '--'
-          }
-        },
+        { title: '第三方库存', dataIndex: 'thirdStockQty', align: 'center', width: '10%', customRender: function (text) { return text || text == 0 ? text : '--' } },
+        // { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' }, },
+        // { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      // if (this.$hasPermissions('B_purchaseReturnEdit_costPrice')) {
-      //   arr.splice(6, 0, {
-      //     title: '退货单价',
-      //     dataIndex: 'cost',
-      //     width: '8%',
-      //     align: 'right',
-      //     customRender: function (text) {
-      //       return text || text == 0 ? _this.toThousands(text, 2) : '--'
-      //     }
-      //   })
-      //   arr.splice(8, 0, {
-      //     title: '采购金额',
-      //     dataIndex: 'totalCost',
-      //     width: '8%',
-      //     align: 'right',
-      //     customRender: function (text) {
-      //       return text || text == 0 ? _this.toThousands(text, 2) : '--'
-      //     }
-      //   })
-      // }
+      if (this.$hasPermissions('B_purchaseReceiptEdit_costPrice')) {
+        arr.splice(6, 0, { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+        arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+      }
       return arr
     }
   },

+ 11 - 12
src/views/purchasingManagement/purchaseReceipt/list.vue

@@ -101,7 +101,7 @@
           bordered>
           <!-- 采购退货单号 -->
           <template slot="purchaseReceiptNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_purchaseReturnDetail')" id="purchaseReceiptList-detail-btn" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsNo }}</span>
+            <span v-if="$hasPermissions('B_purchaseReceiptDetail')" id="purchaseReceiptList-detail-btn" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsNo }}</span>
             <span v-else>{{ record.sparePartsNo }}</span>
           </template>
           <!-- 操作 -->
@@ -113,23 +113,23 @@
               type="link"
               class="button-warning"
               @click="handleCheck(record)"
-              v-if="$hasPermissions('B_purchaseReturnRate') && record.state ==='WAIT_AUDIT'&&(!record.thirdpartyBizState)"
+              v-if="$hasPermissions('B_purchaseReceiptAudit') && record.state ==='WAIT_AUDIT'&&(!record.thirdpartyBizState)"
               id="purchaseReceiptList-examine-btn">审核</a-button>
             <a-button
               size="small"
               type="link"
               @click="handleEdit(record)"
               class="button-info"
-              v-if="$hasPermissions('B_purchaseReturnEdit') && (record.state ==='WAIT_SUBMIT'||record.state ==='WAIT_AUDIT'||record.state ==='REJECT') && (!record.thirdpartyBizState)"
+              v-if="$hasPermissions('B_purchaseReceiptEdit') && (record.state ==='WAIT_SUBMIT'||record.state ==='WAIT_AUDIT'||record.state ==='REJECT') && (!record.thirdpartyBizState)"
               id="purchaseReceiptList-edit-btn">编辑</a-button>
             <a-button
               size="small"
               type="link"
-              v-if="$hasPermissions('B_purchaseReturnDel')&&isShowCancelBtn(record)"
+              v-if="$hasPermissions('B_purchaseReceiptDel')&&isShowCancelBtn(record)"
               @click="handleDel(record)"
               class="button-error"
               id="purchaseReceiptList-del-btn">取消</a-button>
-            <a-tooltip placement="left">
+            <a-tooltip placement="left" v-if="$hasPermissions('B_purchaseReceiptTransportNo') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')">
               <template slot="title">
                 <span>物流单号:{{ record.transportNo }}</span>
               </template>
@@ -137,7 +137,6 @@
                 size="small"
                 type="link"
                 class="button-warning"
-                v-if="$hasPermissions('B_purchaseReturnRate') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')"
                 id="purchaseReceiptList-logistics-btn">
                 物流
               </a-button>
@@ -147,14 +146,14 @@
               type="link"
               class="button-warning"
               @click="addVoucher(record)"
-              v-if="$hasPermissions('B_purchaseReturnRate') && isShowUploadBtn(record)"
+              v-if="$hasPermissions('B_purchaseReceiptAddVoucher') && isShowUploadBtn(record)"
               id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
               @click="seeVoucher(record)"
-              v-if="$hasPermissions('B_purchaseReturnRate') && isShowCheckBtn(record)"
+              v-if="$hasPermissions('B_purchaseReceiptSeeVoucher') && isShowCheckBtn(record)"
               id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
             <span v-if="isShowNoBtn(record)">--</span>
           </template>
@@ -257,7 +256,7 @@ export default {
         { title: '提交时间', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '供应商名称', dataIndex: 'supplierName', align: 'left', width: '14%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '采购数量', dataIndex: 'productTotalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        // { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
         { title: '入库仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '关联单号', dataIndex: 'lockBizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'lockBizDealerName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -266,9 +265,9 @@ export default {
         { title: '备注', dataIndex: 'bizRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      // if (this.$hasPermissions('M_purchaseReturnList_costPrice')) { //  售价权限
-      //   arr.splice(7, 0, { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
-      // }
+      if (this.$hasPermissions('M_purchaseReceiptList_costPrice')) { //  成本价权限
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      }
       return arr
     }
   },