소스 검색

优化表格列显示条件和代理配置

yusheng 10 달 전
부모
커밋
fc1523bfee

+ 6 - 3
src/BIZComponents/inventoryTable.vue

@@ -1008,14 +1008,15 @@
             headerSlot: 'headerCustomerExpectDeliveryDeadline',
             align: 'center'
           },
-          {
+          this.contractBookType==1?{
             width: 160,
             prop: 'produceDeliveryDeadline',
             label: '生产交付交期',
             slot: 'produceDeliveryDeadline',
             headerSlot: 'headerProduceDeliveryDeadline',
-            show: this.contractBookType == 1,
             align: 'center'
+          }:{
+             width: 1,
           },
 
           {
@@ -1026,13 +1027,15 @@
             // headerSlot: 'headerCustomerExpectDeliveryDeadline',
             align: 'center'
           },
-          {
+          this.isGuaranteePeriod?{
             width: 200,
             prop: 'guaranteePeriodDeadline',
             label: '有效期截止日期',
             slot: 'guaranteePeriodDeadline',
             show: this.isGuaranteePeriod,
             align: 'center'
+          }:{
+            width:1
           },
 
           {

+ 106 - 84
src/BIZComponents/inventoryTableDetails.vue

@@ -34,9 +34,7 @@
         </el-form-item>
       </template>
       <template v-slot:otherFiles="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '. otherFiles'"
-        >
+        <el-form-item :prop="'datasource.' + scope.$index + '. otherFiles'">
           <fileMain v-model="scope.row.otherFiles" type="view"></fileMain>
         </el-form-item>
       </template>
@@ -89,7 +87,7 @@
   // import fileMain from '@/components/addDoc/index.vue';
   import { contactQueryByCategoryIdsAPI } from '@/api/bpm/components/supplierManage/contact';
   const dayjs = require('dayjs');
-  import { lbjtList,levelList } from '@/enum/dict.js';
+  import { lbjtList, levelList } from '@/enum/dict.js';
   import timeDialog from '@/components/timeDialog/index.vue';
 
   export default {
@@ -136,7 +134,8 @@
       isOrderNo: {
         type: Boolean,
         default: false
-      },      countObj: {
+      },
+      countObj: {
         type: Object,
         default: () => {
           return {
@@ -180,7 +179,7 @@
             align: 'center'
           },
           orderColumn,
-      
+
           {
             width: 280,
             prop: 'productName',
@@ -210,42 +209,52 @@
             slot: 'specification',
             align: 'center'
           },
-          {
-            width: 200,
-            prop: 'customerMark',
-            label: '客户代号',
-            slot: 'customerMark',
-            headerSlot: 'headerCustomerMark',
-            align: 'center',
-            show: this.contractBookType == 1
-          },
-          {
-            width: 200,
-            prop: 'customerMark',
-            label: '供应商代号',
-            slot: 'customerMark',
-            headerSlot: 'headerSupplierMark',
-            align: 'center',
-            show: this.contractBookType == 2
-          },
-          {
-            minWidth: 120,
-            prop: 'entrustedEnterpriseId',
-            label: '受托企业',
-            slot: 'entrustedEnterpriseId',
-            show: this.isCustomerMark,
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row, column) => {
-              return (
-                (this.supplierObj &&
-                  this.supplierObj[row.productId]?.find(
-                    (item) => item.id === row.entrustedEnterpriseId
-                  )?.name) ||
-                ''
-              );
-            }
-          },
+          this.contractBookType == 1
+            ? {
+                width: 200,
+                prop: 'customerMark',
+                label: '客户代号',
+                slot: 'customerMark',
+                headerSlot: 'headerCustomerMark',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          this.contractBookType == 2
+            ? {
+                width: 200,
+                prop: 'customerMark',
+                label: '供应商代号',
+                slot: 'customerMark',
+                headerSlot: 'headerSupplierMark',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          this.isCustomerMark
+            ? {
+                minWidth: 120,
+                prop: 'entrustedEnterpriseId',
+                label: '受托企业',
+                slot: 'entrustedEnterpriseId',
+                show: this.isCustomerMark,
+                align: 'center',
+                showOverflowTooltip: true,
+                formatter: (row, column) => {
+                  return (
+                    (this.supplierObj &&
+                      this.supplierObj[row.productId]?.find(
+                        (item) => item.id === row.entrustedEnterpriseId
+                      )?.name) ||
+                    ''
+                  );
+                }
+              }
+            : {
+                width: 1
+              },
           {
             width: 150,
             prop: 'saleCount',
@@ -284,22 +293,28 @@
             slot: 'measuringUnit',
             align: 'center'
           },
-          {
-            minWidth: 110,
-            prop: 'sendTotalCount',
-            label: '已发货数量',
-            slot: 'sendTotalCount',
-            show: this.pageName == 'send',
-            align: 'center'
-          },
-          {
-            minWidth: 110,
-            prop: 'notSendTotalCount',
-            label: '未发货数量',
-            slot: 'notSendTotalCount',
-            show: this.pageName == 'send',
-            align: 'center'
-          },
+          this.pageName == 'send'
+            ? {
+                minWidth: 110,
+                prop: 'sendTotalCount',
+                label: '已发货数量',
+                slot: 'sendTotalCount',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
+          this.pageName == 'send'
+            ? {
+                minWidth: 110,
+                prop: 'notSendTotalCount',
+                label: '未发货数量',
+                slot: 'notSendTotalCount',
+                align: 'center'
+              }
+            : {
+                width: 1
+              },
           {
             width: 120,
             prop: 'singleWeight',
@@ -368,18 +383,22 @@
             label: '不含税单价',
             align: 'center'
           },
-          {
-            width: 160,
-            prop: 'discountSinglePrice',
-            label: '折让单价',
-            align: 'center',
-            show: this.isDiscount,
-            formatter: (_row, _column, cellValue) => {
-              return _row.discountSinglePrice
-                ? Number(_row.discountSinglePrice).toFixed(2)
-                : '';
-            }
-          },
+          this.isDiscount
+            ? {
+                width: 160,
+                prop: 'discountSinglePrice',
+                label: '折让单价',
+                align: 'center',
+
+                formatter: (_row, _column, cellValue) => {
+                  return _row.discountSinglePrice
+                    ? Number(_row.discountSinglePrice).toFixed(2)
+                    : '';
+                }
+              }
+            : {
+                width: 1
+              },
           {
             width: 120,
             prop: 'totalPrice',
@@ -387,24 +406,28 @@
             slot: 'totalPrice',
             align: 'center'
           },
-          {
-            width: 160,
-            prop: 'discountTotalPrice',
-            label: '折让合计',
-            align: 'center',
-            show: this.isDiscount,
-            formatter: (_row, _column, cellValue) => {
-              return _row.discountTotalPrice
-                ? Number(_row.discountTotalPrice).toFixed(2)
-                : '';
-            }
-          },
+          this.isDiscount
+            ? {
+                width: 160,
+                prop: 'discountTotalPrice',
+                label: '折让合计',
+                align: 'center',
+                formatter: (_row, _column, cellValue) => {
+                  return _row.discountTotalPrice
+                    ? Number(_row.discountTotalPrice).toFixed(2)
+                    : '';
+                }
+              }
+            : {
+                width: 1
+              },
           {
             minWidth: 120,
             prop: 'goodsLevel',
             label: '物品级别',
             formatter: (_row, _column, cellValue) => {
-              return levelList.find(item=>item.value==_row.goodsLevel)?.label
+              return levelList.find((item) => item.value == _row.goodsLevel)
+                ?.label;
             },
             align: 'center'
           },
@@ -603,7 +626,6 @@
       this.requestDict('产地');
       this.requestDict('保质期单位');
       this.requestDict('商品价格类型');
-
     },
     methods: {
       async getSupplierObj(productList, queryName) {

+ 7 - 4
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -160,7 +160,9 @@
         <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
       </template>
     </ele-pro-table>
-    <div class="title"  v-if="!isView && taskDefinitionKey == 'storemanApprove'"> 出库单信息</div>
+    <div class="title" v-if="!isView && taskDefinitionKey == 'storemanApprove'">
+      出库单信息</div
+    >
     <keep-alive>
       <add
         ref="add"
@@ -169,7 +171,7 @@
         :bizType="3"
         :saleProductList="form.productList"
         type="销售发货出库"
-        v-if="!isView && taskDefinitionKey == 'storemanApprove'&&form.docNo"
+        v-if="!isView && taskDefinitionKey == 'storemanApprove' && form.docNo"
       ></add>
     </keep-alive>
     <detailDialog
@@ -397,13 +399,14 @@
             align: 'center'
           },
 
-          {
+          this.clientEnvironmentId == '4'?{
             width: 120,
             prop: 'blockCount',
             label: '发货块数',
             slot: 'blockCount',
             align: 'center',
-            show: this.clientEnvironmentId == '4'
+          }:{
+             width: 1,
           },
           {
             width: 120,

+ 99 - 83
src/views/bpm/handleTask/components/saleOrder/invoice/inventoryTable.vue

@@ -29,7 +29,6 @@
           :prop="'datasource.' + $index + '.technicalDrawings'"
         >
           <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
-
         </el-form-item>
       </template>
       <template v-slot:remark="{ row, $index }">
@@ -87,17 +86,17 @@
           :prop="'datasource.' + $index + '.industryArtFiles'"
         >
           <fileMain v-model="row.industryArtFiles" type="view"></fileMain>
-<!--          <div v-if="row.industryArtFiles && row.industryArtFiles?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.industryArtFiles"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}</el-link-->
-<!--            >-->
-<!--          </div>-->
+          <!--          <div v-if="row.industryArtFiles && row.industryArtFiles?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.industryArtFiles"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}</el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </el-form-item>
       </template>
       <template v-slot:otherFiles="{ row, $index }">
@@ -106,17 +105,17 @@
           :prop="'datasource.' + $index + '.otherFiles'"
         >
           <fileMain v-model="row.otherFiles" type="view"></fileMain>
-<!--          <div v-if="row.otherFiles && row.otherFiles?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.otherFiles"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}</el-link-->
-<!--            >-->
-<!--          </div>-->
+          <!--          <div v-if="row.otherFiles && row.otherFiles?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.otherFiles"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}</el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </el-form-item>
       </template>
       <template v-slot:warehouseNum="scope">
@@ -131,20 +130,25 @@
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:stockLedger="scope">
-        <el-form-item
-          style="margin-bottom: 20px">
+        <el-form-item style="margin-bottom: 20px">
           <el-popover
-            @hide="()=>selection=[]"
+            @hide="() => (selection = [])"
             placement="right"
             width="60%"
-            trigger="hover">
-            <ele-pro-table :ref="'childrenTable'+scope.$index"
-                           row-key="id"
-                           max-height="300px"
-                           :selection.sync="selection"
-                           :needPage="false" :columns="childrenColumns" :toolkit="[]"
-                           :datasource="scope.row.sendProductDetail"
-                           cache-key="stockLedgerRoleTable" class="time-form">
+            trigger="hover"
+          >
+            <ele-pro-table
+              :ref="'childrenTable' + scope.$index"
+              row-key="id"
+              max-height="300px"
+              :selection.sync="selection"
+              :needPage="false"
+              :columns="childrenColumns"
+              :toolkit="[]"
+              :datasource="scope.row.sendProductDetail"
+              cache-key="stockLedgerRoleTable"
+              class="time-form"
+            >
               <!-- 表头工具栏 -->
               <template v-slot:toolbar="childrenScope">
                 <el-button
@@ -152,7 +156,8 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="stockLedgerSelect(scope.row,scope.$index)">
+                  @click="stockLedgerSelect(scope.row, scope.$index)"
+                >
                   选择
                 </el-button>
                 <el-button
@@ -161,13 +166,13 @@
                   icon="el-icon-delete"
                   class="ele-btn-icon"
                   :disabled="!selection.length"
-                  @click="stockLedgerRemove(scope.$index)">
+                  @click="stockLedgerRemove(scope.$index)"
+                >
                   删除
                 </el-button>
               </template>
             </ele-pro-table>
             <el-button type="text" slot="reference">明细</el-button>
-
           </el-popover>
         </el-form-item>
       </template>
@@ -192,8 +197,12 @@
       @changeParent="changeParent"
     ></product-list>
     <!-- 库存台账   -->
-    <stock-ledger-dialog v-if="stockLedgerDialogFlag" :stock-ledger-dialog-flag.sync="stockLedgerDialogFlag"
-                         ref="stockLedgerDialogRef" @getStockLedger="getStockLedger"></stock-ledger-dialog>
+    <stock-ledger-dialog
+      v-if="stockLedgerDialogFlag"
+      :stock-ledger-dialog-flag.sync="stockLedgerDialogFlag"
+      ref="stockLedgerDialogRef"
+      @getStockLedger="getStockLedger"
+    ></stock-ledger-dialog>
   </el-form>
 </template>
 <script>
@@ -206,9 +215,9 @@
   } from '@/api/bpm/components/saleManage/saleorder';
 
   import { copyObj } from '@/utils/util';
-  import StockLedgerDialog from "@/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/stockLedgerDialog.vue";
+  import StockLedgerDialog from '@/views/bpm/handleTask/components/saleOrder/invoice/stockLedger/stockLedgerDialog.vue';
   // import fileMain from "@/components/addDoc/index.vue";
-  import {lbjtList } from '@/enum/dict.js';
+  import { lbjtList } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins],
@@ -246,25 +255,25 @@
             type: 'index',
             columnKey: 'index',
             align: 'center',
-            fixed: 'left',
+            fixed: 'left'
           },
           {
             minWidth: 100,
             prop: 'code',
             label: '编码',
-            align: 'center',
+            align: 'center'
           },
           {
             minWidth: 140,
             prop: 'barcodes',
             label: '发货条码',
-            align: 'center',
+            align: 'center'
           },
           {
             minWidth: 100,
             prop: 'engrave',
             label: '刻码',
-            align: 'center',
+            align: 'center'
           }
         ],
         selection: [],
@@ -279,7 +288,7 @@
         form: {
           datasource: []
         },
-        rules: {},
+        rules: {}
       };
     },
     created() {
@@ -303,14 +312,14 @@
             type: 'index',
             columnKey: 'index',
             align: 'center',
-            fixed: 'left',
+            fixed: 'left'
           },
           {
             width: 200,
             prop: 'productName',
             label: '名称',
             slot: 'productName',
-            align: 'center',
+            align: 'center'
           },
           {
             width: 120,
@@ -345,7 +354,7 @@
             prop: 'customerMark',
             label: '客户代号',
             slot: 'customerMark',
-            align: 'center',
+            align: 'center'
           },
           {
             width: 120,
@@ -373,12 +382,13 @@
             align: 'center',
             label: '属性类型',
             formatter: (row, column) => {
-              if(row.produceType){
-                return row.produceType.map(item=>{
-                  return lbjtList[item]
-                }).toString()
+              if (row.produceType) {
+                return row.produceType
+                  .map((item) => {
+                    return lbjtList[item];
+                  })
+                  .toString();
               }
-          
             },
             showOverflowTooltip: true
           },
@@ -426,14 +436,14 @@
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
-            align: "center"
+            align: 'center'
           },
           {
             width: 200,
             prop: 'receiveTotalWeight',
             label: '收货总重',
             slot: 'receiveTotalWeight',
-            align: "center",
+            align: 'center',
             headerSlot: 'headerTotalCount'
           },
           {
@@ -441,7 +451,7 @@
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
-            align: "center",
+            align: 'center'
           },
 
           {
@@ -449,14 +459,14 @@
             prop: 'increaseTotalWeight',
             label: '增重重量',
             slot: 'increaseTotalWeight',
-            align: "center"
+            align: 'center'
           },
           {
             width: 100,
             prop: 'weightUnit',
             label: '重量单位',
             slot: 'weightUnit',
-            align: "center"
+            align: 'center'
           },
 
           {
@@ -494,14 +504,16 @@
             slot: 'deliveryDays',
             align: 'center'
           },
-      
+
           {
             width: 200,
             prop: 'guaranteePeriod',
             label: '有效期',
             slot: 'guaranteePeriod',
             formatter: (_row, _column, cellValue) => {
-              return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+              return (
+                (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
+              );
             },
             align: 'center'
           },
@@ -521,10 +533,9 @@
             minWidth: 200,
             showOverflowTooltip: true,
             formatter: (row, column) => {
-       
               return row.provenance && row.provenance.length
                 ? row.provenance
-                    .map((item) => this.getDictValue('产地', item ))
+                    .map((item) => this.getDictValue('产地', item))
                     .join(',')
                 : '';
             }
@@ -567,38 +578,43 @@
             fixed: 'right',
             showOverflowTooltip: true
           }
-        ]
+        ];
       }
     },
+    mounted() {
+      this.clientEnvironmentId =
+        this.this.$store.state.user.info.clientEnvironmentId;
+    },
     methods: {
       //发货明细选择
       stockLedgerSelect(row, index) {
-        this.curIndex = index
-        this.stockLedgerDialogFlag = true
+        this.curIndex = index;
+        this.stockLedgerDialogFlag = true;
         this.$nextTick(() => {
-          this.$refs.stockLedgerDialogRef.init(row.sendProductDetail,row)
-        })
+          this.$refs.stockLedgerDialogRef.init(row.sendProductDetail, row);
+        });
       },
       //获取
       getStockLedger(sendProductDetail) {
-        if (!this.form.datasource[this.curIndex].sendProductDetail) this.form.datasource[this.curIndex].sendProductDetail = []
-        let row = this.form.datasource[this.curIndex]
-        row.sendProductDetail.push(...sendProductDetail)
-        this.form.datasource[this.curIndex] = row
-        this.$refs['childrenTable'+this.curIndex].reload()
-        this.$refs.table.reload()
+        if (!this.form.datasource[this.curIndex].sendProductDetail)
+          this.form.datasource[this.curIndex].sendProductDetail = [];
+        let row = this.form.datasource[this.curIndex];
+        row.sendProductDetail.push(...sendProductDetail);
+        this.form.datasource[this.curIndex] = row;
+        this.$refs['childrenTable' + this.curIndex].reload();
+        this.$refs.table.reload();
       },
       //删除发货明细
       stockLedgerRemove(PIndex) {
-        let row = this.form.datasource[PIndex]
-        this.selection.forEach(item => {
-          let index = row.sendProductDetail.findIndex(i => i.id == item.id)
-          row.sendProductDetail.splice(index, 1)
-        })
-        this.form.datasource[PIndex] = row
-        this.$refs['childrenTable' + PIndex].reload()
-        this.$refs.table.reload()
-        this.selection = []
+        let row = this.form.datasource[PIndex];
+        this.selection.forEach((item) => {
+          let index = row.sendProductDetail.findIndex((i) => i.id == item.id);
+          row.sendProductDetail.splice(index, 1);
+        });
+        this.form.datasource[PIndex] = row;
+        this.$refs['childrenTable' + PIndex].reload();
+        this.$refs.table.reload();
+        this.selection = [];
       },
       async warehouseChange(index, row) {
         let warehouseIds =

+ 1 - 1
vue.config.js

@@ -39,7 +39,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.105:18086',
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.105:18086',
         changeOrigin: true, // 只有这个值为true的情况下 s才表示开启跨域
         pathRewrite: {
           '^/api': ''