Răsfoiți Sursa

采购订单优化:新增批次号必填配置功能,调整相关表单验证逻辑和显示样式

yusheng 10 luni în urmă
părinte
comite
ff8f4d3352

+ 19 - 0
src/BIZComponents/inventoryTable.vue

@@ -585,6 +585,7 @@
       <template v-slot:headerPricingWay="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
+
       <template v-slot:taskName="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -612,6 +613,7 @@
             v-model="scope.row.arrivalWay"
             clearable
             style="width: 100%"
+  
           >
             <el-option
               v-for="item in arrivalWayList"
@@ -627,6 +629,13 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.batchNo'"
+          :rules="[
+            {
+              required: isBatchNo == 1 ? true : false,
+              message: '请输入批号',
+              trigger: 'blur'
+            }
+          ]"
         >
           <el-input
             v-model="scope.row.batchNo"
@@ -636,6 +645,11 @@
           </el-input>
         </el-form-item>
       </template>
+      <template v-slot:headerBatchNo="{ column }">
+        <span :class="isBatchNo == 1 ? 'is-required' : ''">{{
+          column.label
+        }}</span>
+      </template>
 
       <template v-slot:orderNo="{ row, $index }">
         <el-form-item :prop="'datasource.' + $index + '.orderNo'">
@@ -906,6 +920,10 @@
         type: Boolean,
         default: false
       },
+      isBatchNo: {
+        type: Boolean, //批次号是否必填
+        default: false
+      },
       orderOption: {
         default: () => {
           return [];
@@ -1196,6 +1214,7 @@
             prop: 'batchNo',
             label: '批次号',
             slot: 'batchNo',
+            headerSlot: 'headerBatchNo',
             align: 'center'
           },
           {

+ 24 - 2
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -66,6 +66,13 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.batchNo'"
+          :rules="[
+            {
+              required: isBatchNo == 1 ? true : false,
+              message: '请输入批号',
+              trigger: 'blur'
+            }
+          ]"
         >
           <el-input v-model="scope.row.batchNo" v-no-chinese></el-input>
         </el-form-item>
@@ -279,6 +286,9 @@
           </el-select>
         </el-form-item>
       </template>
+      <template v-slot:isRequired="{ column }">
+        <span :class="isBatchNo==1?'is-required':''">{{ column.label }}</span>
+      </template>
 
       <!-- 操作列 -->
       <template v-slot:action="scope">
@@ -459,6 +469,7 @@
             prop: 'batchNo',
             label: '批次号',
             slot: 'batchNo',
+            headerSlot: 'isRequired',
             align: 'center'
           },
           {
@@ -747,7 +758,11 @@
             label: '是否来料检验',
             align: 'center',
             formatter: (_row, _column, cellValue) => {
-              return _row.isComeCheck == 1 ? '是' :_row.isComeCheck === 0 ? '否':'';
+              return _row.isComeCheck == 1
+                ? '是'
+                : _row.isComeCheck === 0
+                ? '否'
+                : '';
             }
           },
 
@@ -790,7 +805,8 @@
             showOverflowTooltip: true
           }
         ],
-        isTotalCount: 0 //采购收货数量是否限制不能大于采购总数 //0否 1是
+        isTotalCount: 0, //采购收货数量是否限制不能大于采购总数 //0否 1是
+        isBatchNo: 0
       };
     },
     created() {
@@ -806,6 +822,12 @@
       }).then((res) => {
         this.isTotalCount = res.value;
       });
+      //批次号是否必填//0否 1是
+      parameterGetByCode({
+        code: 'eom_purchaseOrder_invoice_batchNo'
+      }).then((res) => {
+        this.isBatchNo = res.value;
+      });
     },
 
     computed: {},

+ 1 - 1
src/views/saleManage/businessOpportunity/components/addOpportunityDialog.vue

@@ -52,7 +52,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="商机来源" prop="sourceCode">
+          <el-form-item label="商机来源" prop="sourceCode" style="height: 36px;">
             <DictSelection
               dictName="商机来源"
               clearable

+ 9 - 16
src/views/saleManage/contact/components/addContactDialog.vue

@@ -192,7 +192,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="企业规模" prop="enterpriseScale">
+              <el-form-item
+                label="企业规模"
+                prop="enterpriseScale"
+                style="height: 36px"
+              >
                 <DictSelection
                   dictName="企业规模"
                   clearable
@@ -691,7 +695,7 @@
           </template>
         </ele-pro-table> -->
       </el-tab-pane>
-      <el-tab-pane :label="getLabel" :name="5" v-if="form.type != 1">
+      <el-tab-pane :label="getLabel" :name="5">
         <headerTitle :title="getLabel" style="margin-top: 30px"></headerTitle>
         <ele-pro-table
           ref="supplyRef"
@@ -762,28 +766,17 @@
       <el-button
         type="primary"
         @click="pageChange('next')"
-        :disabled="
-          (form.type == 1 && activeName == 4) ||
-          (form.type != 1 && activeName == 5)
-        "
+        :disabled="activeName == 5"
         >下一步</el-button
       >
-      <el-button
-        type="primary"
-        v-if="
-          (form.type == 1 && activeName == 4) ||
-          (form.type != 1 && activeName == 5) ||
-          form?.id
-        "
-        @click="save"
-        v-click-once
+      <el-button type="primary" v-if="form?.id||activeName == 5" @click="save" v-click-once
         >保存</el-button
       >
       <el-button
         type="primary"
         v-if="
           form.type == 1 &&
-          activeName == 4 &&
+          activeName == 5 &&
           form.qualificationCensorship == '1'
         "
         @click="save('sub')"

+ 306 - 0
src/views/saleManage/contact/components/darwerComponents/supplyList.vue

@@ -0,0 +1,306 @@
+<template>
+  <el-card shadow="never">
+    <ele-pro-table
+      ref="supplyRef"
+      :columns="supplyColumns"
+      :need-page="false"
+      :datasource="list"
+      :toolkit="[]"
+      height="350px"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button type="primary" @click="handSelectSupply">新增</el-button>
+        <el-button type="primary" @click="save">确认修改</el-button>
+      </template>
+      <template v-slot:purchasingCycle="scope">
+        <el-input v-model="scope.row.purchasingCycle" placeholder="请输入">
+          <template slot="append">天</template>
+        </el-input>
+      </template>
+      <template v-slot:purchaseMultiplier="scope">
+        <el-input v-model="scope.row.purchaseMultiplier" placeholder="请输入">
+        </el-input>
+      </template>
+      <template v-slot:minimumOrderQuantity="scope">
+        <el-input v-model="scope.row.minimumOrderQuantity" placeholder="请输入">
+        </el-input>
+      </template>
+      <template v-slot:provenance="scope">
+        <DictSelection
+          dictName="产地"
+          clearable
+          v-model="scope.row.provenance"
+          multiple
+        >
+        </DictSelection>
+      </template>
+
+      <!-- 操作栏 -->
+      <template v-slot:action="scope">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此产品吗?"
+          @confirm="handleRemoveSupply(scope.$index)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <product-list
+      ref="productListRef"
+      :data="list"
+      @changeParent="getSupplyList"
+    ></product-list>
+  </el-card>
+</template>
+
+<script>
+  import { contactUpdate } from '@/api/saleManage/contact';
+  import { contactDetail } from '@/api/saleManage/contact';
+  import { reviewStatus, lbjtList } from '@/enum/dict';
+  import productList from '@/BIZComponents/product-list.vue';
+
+  export default {
+    components: { productList },
+
+    data() {
+      return {
+        key: '',
+        list: [],
+        form: {}
+      };
+    },
+    computed: {
+      supplyColumns() {
+        return [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 50,
+            align: 'center',
+            showOverflowTooltip: true,
+            label: '序号'
+          },
+          {
+            prop: 'productCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'purchasingCycle',
+            label: '采购周期',
+            align: 'center',
+            slot: 'purchasingCycle',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'purchaseMultiplier',
+            label: '倍数',
+            slot: 'purchaseMultiplier',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'minimumOrderQuantity',
+            label: '最低订购数量',
+            slot: 'minimumOrderQuantity',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'manufacturer',
+            label: '生产厂家',
+            slot: 'manufacturer',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            show: this.getLabel == '供货列表'
+          },
+          {
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'produceType',
+            align: 'center',
+            label: '属性类型',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row, column) => {
+              if (row.produceType) {
+                return row.produceType
+                  .map((item) => {
+                    return lbjtList[item];
+                  })
+                  .toString();
+              }
+            }
+          },
+
+          {
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            align: 'center',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 90
+          },
+
+          {
+            slot: 'action',
+            align: 'center',
+            minWidth: 90,
+            fixed: 'right',
+            label: '操作'
+          }
+        ];
+      }
+    },
+
+    methods: {
+      //选择产品
+      handSelectSupply() {
+        this.$refs.productListRef.open(this.list, -1);
+      },
+      getSupplyList(obj) {
+        obj.forEach((item, index) => {
+          let params = {};
+          this.$set(params, 'contactId', this.form.base.id);
+          this.$set(params, 'productId', item.id);
+          this.$set(params, 'categoryName', item.name);
+          this.$set(params, 'productCategoryId', item.categoryLevelId);
+          this.$set(params, 'productBrand', item.brandNum);
+          this.$set(params, 'productCategoryName', item.categoryLevelPath);
+          this.$set(params, 'productCode', item.code);
+          this.$set(params, 'productName', item.name);
+          this.$set(params, 'modelType', item.modelType);
+          this.$set(params, 'availableCountBase', item.availableCountBase);
+          this.$set(params, 'measuringUnit', item.measuringUnit);
+          this.$set(params, 'specification', item.specification);
+          this.$set(params, 'weightUnit', item.weightUnit);
+          this.$set(params, 'imgCode', item.imgCode);
+          this.$set(params, 'produceType', item.componentAttribute);
+          this.$set(params, 'approvalNumber', item.approvalNumber);
+          this.$set(params, 'packingSpecification', item.packingSpecification);
+          if (item.purchaseOrigins?.length) {
+            item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
+          }
+          this.$set(params, 'provenance', item.purchaseOrigins || []);
+          this.list.push(params);
+        });
+      },
+      //删除供货产品
+      handleRemoveSupply(index) {
+        this.list.splice(index, 1);
+      },
+      async init(row) {
+        this.form = row;
+        this.list = row.productList;
+      },
+      handleBankDel(row, index) {
+        this.list.splice(index, 1);
+      },
+
+      save() {
+        this.form.productList = this.list;
+        contactUpdate(this.form)
+          .then((res) => {
+            this.$message.success('修改成功');
+
+            contactDetail(this.form.base.id).then((res) => {
+              this.list = res.productList;
+            });
+
+            this.$emit('success');
+          })
+          .catch((e) => {
+            //this.loading = false;
+          });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 15 - 2
src/views/saleManage/contact/components/drawer.vue

@@ -70,6 +70,10 @@
           <el-tab-pane label="跟进记录" name="跟进记录">
             <followList ref="followListRef"></followList
           ></el-tab-pane>
+          <el-tab-pane label="供货列表" name="供货列表">
+            <supplyList ref="supplyListRef"></supplyList
+          ></el-tab-pane>
+
           <el-tab-pane label="商机" name="商机">
             <businessOpportunity
               :key="row?.base?.id"
@@ -228,6 +232,8 @@
   import followList from './darwerComponents/followList.vue';
   //申请记录
   import applyList from './darwerComponents/applyList.vue';
+  //供货列表
+  import supplyList from './darwerComponents/supplyList.vue';
   import TinymceEditor from '@/components/TinymceEditor/index.vue';
   import { mapGetters } from 'vuex';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
@@ -255,7 +261,8 @@
       accountstatement,
       comment,
       certificateManagement,
-      applyList
+      applyList,
+      supplyList
     },
     data() {
       return {
@@ -289,7 +296,11 @@
         this.row = await contactDetail(row.id);
         if (this.row?.listApply) {
           this.row?.listApply.forEach((item, index) => {
-            this.$set(this.row?.listApply[index],'contactName',this.row.base.name)
+            this.$set(
+              this.row?.listApply[index],
+              'contactName',
+              this.row.base.name
+            );
           });
         }
         this.pageName = pageName;
@@ -308,6 +319,8 @@
               this.row.base.name
             );
           this.$refs.followListRef.init(this.row);
+          this.$refs.supplyListRef.init(this.row);
+          
           this.$refs.commentRef.init(this.row.base);
         });
       },

+ 15 - 2
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -90,7 +90,10 @@
             />
           </el-form-item>
           <el-form-item label="合同编号" prop="contractNumber">
-            <el-input :disabled="!!form.contractId" v-model="form.contractNumber" />
+            <el-input
+              :disabled="!!form.contractId"
+              v-model="form.contractNumber"
+            />
           </el-form-item>
 
           <el-form-item label="结算方式" prop="settlementMode">
@@ -300,6 +303,7 @@
         :isGoods="true"
         :isSinglePrice="form.needProduce != 2"
         :defTaxRate="13"
+        :isBatchNo="isBatchNo==1&&form.saleTypeName.includes('受托')"
       ></inventoryTable>
       <headerTitle
         title="类型清单"
@@ -482,6 +486,7 @@
   import typeList from './typeList.vue';
   import bomDialog from './bomDialog';
   import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
+  import { parameterGetByCode } from '@/api/main/index.js';
 
   export default {
     mixins: [dictMixins],
@@ -624,7 +629,8 @@
         // 是否是修改
         isUpdate: false,
         enterprisePage: [],
-        businessId: ''
+        businessId: '',
+        isBatchNo:0
       };
     },
     computed: {
@@ -704,6 +710,12 @@
       this.changePersonel();
       this.getGroupAll();
       this.getEnterprisePage();
+      //批次号是否必填//0否 1是
+      parameterGetByCode({
+        code: 'eom_saleOrder_entrusted_batchNo'
+      }).then((res) => {
+        this.isBatchNo = res.value;
+      });
     },
     methods: {
       setCountAmount(allPrice) {
@@ -989,6 +1001,7 @@
       getSaleTypeName() {
         let saleTypeName =
           this.getDictValue('销售类型', this.form.saleType) || '';
+        this.form.saleTypeName = saleTypeName;
         if (
           saleTypeName.indexOf('技改') != '-1' ||
           saleTypeName.indexOf('三包') != '-1' ||

+ 17 - 3
src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue

@@ -97,7 +97,11 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.batchNo'"
           :rules="[
-            { required: true, message: '请输入批次号', trigger: 'blur' }
+            {
+              required: isBatchNo == 1 ? true : false,
+              message: '请输入批次号',
+              trigger: 'blur'
+            }
           ]"
         >
           <el-input v-model="scope.row.batchNo" type="number"></el-input>
@@ -175,7 +179,9 @@
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:isRequired="{ column }">
-        <span class="is-required">{{ column.label }}</span>
+        <span :class="isBatchNo == 1 ? 'is-required' : ''">{{
+          column.label
+        }}</span>
       </template>
 
       <!-- 操作列 -->
@@ -214,6 +220,7 @@
 
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { getCode } from '@/api/login/index';
+  import { parameterGetByCode } from '@/api/main/index.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -548,13 +555,20 @@
             fixed: 'right',
             showOverflowTooltip: true
           }
-        ]
+        ],
+        isBatchNo: 0
       };
     },
     created() {
       getWarehouseList().then((res) => {
         this.warehouseList = res;
       });
+      //批次号是否必填//0否 1是
+      parameterGetByCode({
+        code: 'eom_saleOrder_entrusted_batchNo'
+      }).then((res) => {
+        this.isBatchNo = res.value;
+      });
     },
     computed: {
       canHandl() {

+ 8 - 6
src/views/saleManage/saleOrder/invoice/components/print-template-jr.vue

@@ -3,11 +3,13 @@
     <div id="printSection">
       <div
         class="print"
+        
         style="
           display: flex;
           align-items: center;
           justify-content: center;
           flex-direction: column;
+          width: 1141px;
         "
       >
         <div
@@ -15,7 +17,7 @@
             width: 100%;
             font-size: 12px;
             display: flex;
-            margin-bottom: 10px;
+            margin-bottom: 15px;
           "
         >
           <span style="width: 48%">
@@ -32,7 +34,7 @@
             width: 100%;
             font-size: 12px;
             display: flex;
-            margin-bottom: 10px;
+            margin-bottom: 15px;
           "
         >
           <span style="width: 48%">
@@ -59,7 +61,7 @@
           border
           style="
             width: 100%;
-            height: 190px;
+            height: 240px;
             table-layout: fixed;
             word-break: break-all;
             word-wrap: break-word;
@@ -67,7 +69,7 @@
           "
         >
           <tbody>
-            <tr align="center" style="height: 30px">
+            <tr align="center" style="height: 35px">
               <td style="width: 6%"> 商品编号 </td>
               <td style="width: 6%"> 品名 </td>
               <td style="width: 6%"> 规格 </td>
@@ -84,7 +86,7 @@
             </tr>
             <tr
               align="center"
-              style="height: 22px"
+              style="height:30px"
               v-for="(item, index) in [{}, {}, {}, {}, {}, {}]"
             >
               <td> {{ item.productCode }} </td>
@@ -218,7 +220,7 @@
         page-break-inside: avoid !important;
       };
        @page {
-      size: 200cm 11cm;
+      size: 31cm 11cm;
         }
        }