Bläddra i källkod

权限增加,以及部分页面新需求

cz 1 år sedan
förälder
incheckning
bd7def7cf5

+ 2 - 2
src/components/process/SF/Contract.vue

@@ -128,8 +128,8 @@
 
       <template #commodity>
         <div style="width: 100%">
-          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
-                     v-if="!judgeStatus() && isEditList">产品库</el-button>
+          <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
+                     :disabled="!formData.data.companyId">产品库</el-button>
           <!-- default-expand-all -->
           <el-table :data="formData.data.contractProductList" style="width: 100%;" row-key="rowId">
             <el-table-column type="expand" width="50" align="center">

+ 14 - 0
src/directive/common/isMyData.js

@@ -0,0 +1,14 @@
+import useUserStore from '@/store/modules/user'
+export default {
+  mounted(el, binding, vnode) {
+    const companyId = useUserStore().user.companyId
+    const {
+      value
+    } = binding
+    if (value && (value != companyId)) {
+      el.style.display = 'none'
+    } else {
+
+    }
+  }
+}

+ 2 - 0
src/directive/index.js

@@ -2,6 +2,7 @@ import hasRole from './permission/hasRole'
 import hasPermi from './permission/hasPermi'
 import copyText from './common/copyText'
 import debounce from './common/debounce'
+import isMyData from './common/isMyData'
 import mousewheel from './permission/mousewheel'
 
 export default function directive(app) {
@@ -9,5 +10,6 @@ export default function directive(app) {
   app.directive('hasPermi', hasPermi)
   app.directive('copyText', copyText)
   app.directive('debounce', debounce)
+  app.directive('isMyData', isMyData)
   app.directive('mousewheel', mousewheel)
 }

+ 3 - 1
src/main.js

@@ -66,7 +66,8 @@ import {
   msgConfirm,
   getFile,
   getFileData,
-  downloadFile
+  downloadFile,
+  isCurrentCompanyData
 } from '@/utils/util'
 
 // 分页组件
@@ -100,6 +101,7 @@ app.config.globalProperties.msgTip = msgTip
 app.config.globalProperties.msgConfirm = msgConfirm
 app.config.globalProperties.getFile = getFile
 app.config.globalProperties.getFileData = getFileData
+app.config.globalProperties.isCurrentCompanyData = isCurrentCompanyData
 app.config.globalProperties.downloadFile = downloadFile
 app.config.globalProperties.postTwo = postTwo
 app.config.globalProperties.download = download

+ 10 - 0
src/utils/util.js

@@ -11,6 +11,7 @@ import {
   ElMessage,
   ElMessageBox
 } from 'element-plus'
+import useUserStore from '@/store/modules/user'
 
 
 // businessIdList 业务id列表  dataSource 数据源  att  要对应的属性  fileAtt  要赋值的属性  filePathAtt  取第一张图片的属性
@@ -85,6 +86,15 @@ export function getFileData(option = {}) {
 
 }
 
+export function isCurrentCompanyData(companyId) {
+  const currentCompanyId = useUserStore().user.companyId
+  if (companyId && (currentCompanyId == companyId)) {
+    return true
+  } else {
+    return false
+  }
+}
+
 
 //根据dictKey值回显字典label值
 export function dictKeyValue(value, arr) {

+ 1 - 1
src/views/EHSD/procurement/purchasedEHSD/index.vue

@@ -243,7 +243,7 @@ const config = computed(() => {
             },
           },
           // && Number(row.amount) > Number(row.sumPayMoney)
-          row.status == 30
+          row.status == 10 || (row.status == 30 && Number(row.sumPayMoney) == 0)
             ? {
                 attrs: {
                   label: "作废",

+ 36 - 1
src/views/MES/productionMaterial/index.vue

@@ -118,17 +118,32 @@ const config = ref([
       width: 60,
     },
   },
-
+  {
+    attrs: {
+      label: "生产订单号",
+      prop: "orderCode",
+      width: 130,
+    },
+  },
+  {
+    attrs: {
+      label: "交期",
+      prop: "deliveryPeriod",
+      width: 160,
+    },
+  },
   {
     attrs: {
       label: "物料图片",
       slot: "pic",
+      width: 80,
     },
   },
   {
     attrs: {
       label: "物料编码",
       prop: "materialCode",
+      width: 190,
     },
   },
   {
@@ -141,26 +156,44 @@ const config = ref([
     attrs: {
       label: "数量",
       prop: "quantity",
+      width: 110,
     },
   },
   {
     attrs: {
       label: "时间",
       prop: "preparationDeadline",
+      width: 160,
     },
   },
 ]);
 const configOne = ref([
   {
     attrs: {
+      label: "生产订单号",
+      prop: "orderCode",
+      width: 130,
+    },
+  },
+  {
+    attrs: {
+      label: "交期",
+      prop: "deliveryPeriod",
+      width: 160,
+    },
+  },
+  {
+    attrs: {
       label: "物料图片",
       slot: "pic",
+      width: 80,
     },
   },
   {
     attrs: {
       label: "物料编码",
       prop: "materialCode",
+      width: 190,
     },
   },
   {
@@ -173,12 +206,14 @@ const configOne = ref([
     attrs: {
       label: "数量",
       prop: "quantity",
+      width: 110,
     },
   },
   {
     attrs: {
       label: "投产时间",
       prop: "productionTime",
+      width: 160,
     },
   },
 ]);

+ 1 - 1
src/views/MES/productionOrder/index.vue

@@ -371,7 +371,7 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          row.produceTime
+          row.produceTime || !proxy.isCurrentCompanyData(row.companyId)
             ? {}
             : {
                 attrs: {

+ 1 - 1
src/views/MES/productionScheduling/index.vue

@@ -24,7 +24,7 @@
         <template #date="{ item }">
           <div style="width:100%; ">
             <div><el-icon :size="16" style="cursor:pointer;margin-right: 3px;position:relative;top:4px" color="#409EFF"
-                       @click="clickDistributeProduction(item)">
+                       @click="clickDistributeProduction(item)" v-if="isCurrentCompanyData(item.companyId)">
                 <Clock />
               </el-icon>
               {{item.produceTime}} ~ {{item.deliveryPeriod}}

+ 28 - 6
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -27,12 +27,19 @@
         </template>
         <template #size="{ item }">
           <div v-if="item.productLength && item.productWidth && item.productHeight">
-            <span>{{ item.productLength }}cm</span>*
-            <span>{{ item.productWidth }}cm</span>*
-            <span>{{ item.productHeight }}cm</span>
+            <span>{{ item.productLength }}</span>*
+            <span>{{ item.productWidth }}</span>*
+            <span>{{ item.productHeight }}</span>
           </div>
           <div v-else></div>
         </template>
+        <template #prodTag="{ item }">
+          <div style="width: 100%">
+            <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index">
+              {{ dictKeyValue(tag, contractTag) }}
+            </el-tag>
+          </div>
+        </template>
       </byTable>
     </div>
     <el-dialog :title="modalType == 'add' ? '添加供应商' : '编辑供应商'" v-model="dialogVisible" width="800" v-loading="loading">
@@ -118,6 +125,9 @@ const { proxy } = getCurrentInstance();
 const materialUnit = computed(
   () => proxy.useUserStore().allDict["material_unit"]
 );
+const contractTag = computed(
+  () => proxy.useUserStore().allDict["contract_prod_tag"]
+);
 // const treeData = ref([]);
 const companyData = ref([]);
 const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
@@ -153,6 +163,10 @@ const selectConfig = computed(() => [
         label: "部分采购",
         value: "30",
       },
+      {
+        label: "作废",
+        value: "88",
+      },
     ],
   },
   {
@@ -203,14 +217,14 @@ const config = computed(() => {
       attrs: {
         label: "物料名称",
         prop: "productName",
-        "min-width": 130,
+        "min-width": 150,
       },
     },
     {
       attrs: {
-        label: "尺寸",
+        label: "尺寸 (cm)",
         slot: "size",
-        width: 180,
+        width: 140,
       },
     },
     {
@@ -249,6 +263,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "生产指示",
+        slot: "prodTag",
+        "min-width": 180,
+      },
+    },
+    {
+      attrs: {
         label: "申购人",
         prop: "subcribeName",
         width: 100,
@@ -356,6 +377,7 @@ const getList = async (req) => {
       sourceList.value.data = res.rows.map((x) => ({
         ...x,
         isCheck: true,
+        prodTags: x.prodTag ? x.prodTag.split(",") : [],
       }));
       sourceList.value.pagination.total = res.total;
       console.log(res.total, "ss");