Browse Source

发运明细校验,订单修改

fenghaifu 2 years ago
parent
commit
827d3f7d30
3 changed files with 71 additions and 40 deletions
  1. BIN
      dist.zip
  2. 23 9
      src/views/order/orderList.vue
  3. 48 31
      src/views/shipment-details/addShipDetDrawer.vue

BIN
dist.zip


+ 23 - 9
src/views/order/orderList.vue

@@ -23,13 +23,14 @@ c<template>
 
             <a-col :md="6" :sm="8">
               <a-form-item label="订单日期">
-                <a-date-picker
+                <a-range-picker
                   style="width: 100%"
-                  format="YYYY-MM-DD"
-                  v-model="queryParam.orderDate"
-                  placeholder="请选择订单日期"
-                  @change="onDateChange"
-                ></a-date-picker>
+                  :mode="dataRangeMode"
+                  :placeholder="['开始日期', '结束日期']"
+                  :value="dateRange"
+                  format = "YYYY-MM-DD"
+                  @change="dateRangeSelectChange"
+                />
               </a-form-item>
             </a-col>
 
@@ -37,7 +38,11 @@ c<template>
             <template v-if="toggleSearchStatus">
               <a-col :md="6" :sm="8">
                 <a-form-item label="客户简称">
-                  <a-input placeholder="请输入客户简称" v-model="queryParam.customerAbbreviation"></a-input>
+                  <j-search-select-tag
+                    placeholder="请选择客户简称"
+                    v-model="queryParam.customerAbbreviation"
+                    dict="view_customer,customername,customername">
+                  </j-search-select-tag>
                 </a-form-item>
               </a-col>
 
@@ -158,7 +163,7 @@ export default {
           className: 'replacecolor'
         },
         { title: '业务类型', width: 100, dataIndex: 'businessTypeValue', className: 'replacecolor' },
-        { title: '客户订单号', width: 120, dataIndex: 'customerOrderNumber;', className: 'replacecolor' },
+        { title: '客户订单号', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor' },
         {
           title: '销售类型',
           width: 100,
@@ -225,6 +230,8 @@ export default {
         // current: 0,
         // pageSize: 0
       },
+      dateRange:[],
+      dataRangeMode:['date','date'],
     }
   },
 
@@ -294,7 +301,14 @@ export default {
     handleTableChange(pagination, filters, sorter) {
       this.queryParam.pageNo = pagination.current
       this.getOrderList()
-    }
+    },
+
+    // 时间发生变化的回调,发生在用户选择时间时
+    dateRangeSelectChange(value) {
+      this.dateRange = value;
+      this.queryParam.dateStar = value[0].format('YYYY-MM-DD');
+      this.queryParam.dateEnd  = value[1].format('YYYY-MM-DD');
+    },
   },
   computed: {},
   mounted() {}

+ 48 - 31
src/views/shipment-details/addShipDetDrawer.vue

@@ -13,12 +13,12 @@
       <a-card :bordered="true">
         <div class="table-page-search-wrapper">
           <!-- :rules="validatorRules" -->
-          <a-form-model layout="inline" ref="form" :model="addShipDet">
+          <a-form-model layout="inline" ref="form" :model="addShipDet" :rules="validatorRules">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
                 <!-- required 必填项 disabled 禁用  -->
                 <a-form-model-item label="单据号" prop="documentNo">
-                  <a-input placeholder="请输入单据号" v-model="addShipDet.documentNo"></a-input>
+                  <a-input placeholder="自动生成" v-model="addShipDet.documentNo" readOnly></a-input>
                 </a-form-model-item>
               </a-col>
 
@@ -267,6 +267,13 @@ export default {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       id: '',
+      validatorRules:{
+          documentDate:[{required: true, message: '请输入单据日期!'}],
+          customer:[{required: true, message: '请选择客户!'}],
+          preDeliveryDate:[{required: true, message: '请选择预发货时间!'}],
+          preCompletionDate:[{required: true, message: '请选择预完工日期!'}],
+          orderType:[{required: true, message: '请输入订单类型!'}],
+        },
       // 表头
       columns: [
         {
@@ -611,36 +618,46 @@ export default {
 
     // 新增 保存
     addSave() {
-      var newObj = {} // 新增对象
-      newObj.documentNo = this.addShipDet.documentNo
-      newObj.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD')
-      newObj.customer = this.addShipDet.customer
-      newObj.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD') // 预发货日期
-      newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 预完工日期
-      newObj.orderType = this.addShipDet.orderType
-
-      newObj.garmentFactory = this.addShipDet.garmentFactory
-      newObj.wholeOrderTotal = this.addShipDet.wholeOrderTotal
-      newObj.memo = this.addShipDet.memo // U8系统适用
-      newObj.syShippingDetailsItemList = this.syShippingDetailsItemList // 子表信息赋值
-
-      // 必须选择子表 --- 参照订单数据
-      if (newObj.syShippingDetailsItemList.length == 0) {
-        this.$message.error('请选择参照订单数据')
-      } else {
-        addShipmentList(newObj).then(res => {
-          if (res.success) {
-            this.$message.success('新增成功')
-            console.log('新增的对象', newObj)
-            this.close()
-            // 清空信息
-            newObj = {}
-            newObj.syShippingDetailsItemList = []
-            this.fatherList() // 调用父组件 查询方法
-            // this.msgFormSon = {}  清空子表信息
-          }
-        })
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate(valid => {
+      if (valid) {
+        var newObj = {} // 新增对象
+        newObj.documentNo = this.addShipDet.documentNo
+        newObj.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD')
+        newObj.customer = this.addShipDet.customer
+        newObj.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD') // 预发货日期
+        newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 预完工日期
+        newObj.orderType = this.addShipDet.orderType
+
+        newObj.garmentFactory = this.addShipDet.garmentFactory
+        newObj.wholeOrderTotal = this.addShipDet.wholeOrderTotal
+        newObj.memo = this.addShipDet.memo // U8系统适用
+        newObj.syShippingDetailsItemList = this.syShippingDetailsItemList // 子表信息赋值
+
+        // 必须选择子表 --- 参照订单数据
+        if (newObj.syShippingDetailsItemList.length == 0) {
+          this.$message.error('请选择参照订单数据')
+        } else {
+          addShipmentList(newObj).then(res => {
+            if (res.success) {
+              this.$message.success('新增成功')
+              this.close()
+              // 清空信息
+              newObj = {}
+              newObj.syShippingDetailsItemList = []
+              this.fatherList() // 调用父组件 查询方法
+              // this.msgFormSon = {}  清空子表信息
+            }else{
+              this.$message.error(res.message);
+            }
+          })
+        }
+      }else{
+        return false;
       }
+      });
+      
       // const that = this
       // // 触发表单验证
       // this.$refs.form.validate(valid => {