Browse Source

单证-发运明细、订单数据,接口

liangyan0105 2 years ago
parent
commit
07df614d66

+ 10 - 0
src/api/document/order.js

@@ -1 +1,11 @@
 /** 单证 -- 订单数据 **/
+
+import { getAction } from '@/api/manage'
+
+// 分页列表查询
+const orderList = params => getAction('/orderData/syOrderData/list', params)
+
+// 根据订单号查询 (详情)
+const orderByNum = params => getAction('/orderData/syOrderDataItem/list', params)
+
+export { orderList, orderByNum }

+ 15 - 2
src/api/document/shipmentList.js

@@ -1,4 +1,4 @@
-import { getAction, postAction } from '@/api/manage'
+import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
 
 /** 单证 -- 发运明细 **/
 
@@ -8,6 +8,19 @@ const shipmentList = params => getAction('/shippingDetails/syShippingDetails/lis
 // 新增
 const addShipmentList = params => postAction('/shippingDetails/syShippingDetails/add', params)
 
+// 详情
+const shipmentQueryById = params => getAction('/shippingDetails/syShippingDetails/queryById', params)
+
+// 编辑
+const editById = params => postAction('shippingDetails/syShippingDetails/edit', params)
+
+//  删除
+const deleteShipment = params => deleteAction('/shippingDetails/syShippingDetails/delete', params)
+
+// 提交
+const submitShipment = params => postAction('/shippingDetails/syShippingDetails/syShippingDetailsSubmit', params)
+
 // 参照订单数据
 const queryOrderData = params => getAction('/shippingDetails/syShippingDetails/queryOrderData', params)
-export { shipmentList, addShipmentList, queryOrderData }
+
+export { shipmentList, addShipmentList, deleteShipment, submitShipment, queryOrderData, shipmentQueryById, editById }

+ 6 - 0
src/api/reportForms/supply-capacity-table.js

@@ -1 +1,7 @@
 /** 报表 -- 供应商产能报表 **/
+
+import { getAction } from '@/api/manage'
+
+const supplyCapList = params => getAction('/scas/supplierCapacity/list2', params)
+
+export { supplyCapList }

+ 106 - 96
src/views/order/orderDetailDrawer.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 订单数据详情 信息全部回显-->
+  <!-- 订单数据 详情 -->
   <a-drawer
     title="详情"
     width="89%"
@@ -7,139 +7,138 @@
     :closable="true"
     :visible="visible"
     @close="onClose">
-
     <!--主表信息 -->
     <a-card :bordered="true">
       <div class="table-page-search-wrapper">
-        <a-form layout="inline">
+        <a-form-model layout="inline" ref="form">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="订单号">
-                <a-input v-model="orderDetail.orderNum"></a-input>
-              </a-form-item>
+              <a-form-model-item label="订单号" prop="orderNumber">
+                {{ orderDetail.orderNumber }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="订单日期">
-                <a-input v-model="orderDetail.orderDate"></a-input>
-              </a-form-item>
+              <a-form-model-item label="订单日期" prop="orderDate">
+                {{ orderDetail.orderDate }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="业务类型">
-                <a-input v-model="orderDetail.businessType"></a-input>
-              </a-form-item>
+              <a-form-model-item label="业务类型" prop="businessTypeValue">
+                {{ orderDetail.businessTypeValue }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="销售类型">
-                <a-input v-model="orderDetail.saleType"></a-input>
-              </a-form-item>
+              <a-form-model-item label="销售类型" prop="salesTypeValue">
+                {{ orderDetail.salesTypeValue }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="客户简称">
-                <a-input v-model="orderDetail.customerShortName"></a-input>
-              </a-form-item>
+              <a-form-model-item label="客户简称" prop="customerAbbreviation">
+                {{ orderDetail.customerAbbreviation }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="客户名称">
-                <a-input v-model="orderDetail.customerName"></a-input>
-              </a-form-item>
+              <a-form-model-item label="客户名称" prop="customerName">
+                {{ orderDetail.customerName }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="汇率">
-                <a-input v-model="orderDetail.exchangeRate"></a-input>
-              </a-form-item>
+              <a-form-model-item label="汇率" prop="exchangeRate">
+                {{ orderDetail.exchangeRate }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="销售部门">
-                <a-input v-model="orderDetail.salesDepartment"></a-input>
-              </a-form-item>
+              <a-form-model-item label="销售部门" prop="salesDepartment">
+                {{ orderDetail.salesDepartment }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="业务员">
-                <a-input v-model="orderDetail.salesman"></a-input>
-              </a-form-item>
+              <a-form-model-item label="业务员" prop="salesman">
+                {{ orderDetail.salesman }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="币种">
-                <a-input v-model="orderDetail.currency"></a-input>
-              </a-form-item>
+              <a-form-model-item label="币种" prop="currencyValue">
+                {{ orderDetail.currencyValue }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="品牌方">
-                <a-input v-model="orderDetail.brand"></a-input>
-              </a-form-item>
+              <a-form-model-item label="品牌方" prop="brandSide">
+                {{ orderDetail.brandSide }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="第三方">
-                <a-input v-model="orderDetail.thirdparty"></a-input>
-              </a-form-item>
+              <a-form-model-item label="第三方" prop="thirdParty">
+                {{ orderDetail.thirdParty }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="定金比例(%)">
-                <a-input v-model="orderDetail.depositRatio"></a-input>
-              </a-form-item>
+              <a-form-model-item label="定金比例(%)" prop="depositRatio">
+                {{ orderDetail.depositRatio }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="定金">
-                <a-input v-model="orderDetail.deposit"></a-input>
-              </a-form-item>
+              <a-form-model-item label="定金" prop="deposit">
+                {{ orderDetail.deposit }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="协同路线">
-                <a-input v-model="orderDetail.collaborativeRoute"></a-input>
-              </a-form-item>
+              <a-form-model-item label="协同路线" prop="collaborativeRoute">
+                {{ orderDetail.collaborativeRoute }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="订单备注">
-                <a-input v-model="orderDetail.orderNote"></a-input>
-              </a-form-item>
+              <a-form-model-item label="订单备注" prop="orderRemarks">
+                {{ orderDetail.orderRemarks }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="价格备注">
-                <a-input v-model="orderDetail.priceNote"></a-input>
-              </a-form-item>
+              <a-form-model-item label="价格备注" prop="priceRemarks">
+                {{ orderDetail.priceRemarks }}
+              </a-form-model-item>
             </a-col>
-
+            <!-- TODO:缺少该字段 -->
             <a-col :md="6" :sm="8">
-              <a-form-item label="客户订单号">
-                <a-input v-model="orderDetail.customerOrderNum"></a-input>
-              </a-form-item>
+              <a-form-model-item label="客户订单号" prop="customerOrderNum">
+                {{ orderDetail.customerOrderNumber }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="整单合计">
-                <a-input v-model="orderDetail.documentTotal"></a-input>
-              </a-form-item>
+              <a-form-model-item label="整单合计" prop="wholeOrderTotal">
+                {{ orderDetail.wholeOrderTotal }}
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="8">
-              <a-form-item label="最终客户">
-                <a-input v-model="orderDetail.finalCustomer"></a-input>
-              </a-form-item>
+              <a-form-model-item label="最终客户" prop="endCustomer">
+                {{ orderDetail.endCustomer }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="付款条件">
-                <a-input v-model="orderDetail.paymentClause"></a-input>
-              </a-form-item>
+              <a-form-model-item label="付款条件" prop="termOfPayment">
+                {{ orderDetail.termOfPayment }}
+              </a-form-model-item>
             </a-col>
 
             <a-col :md="18" :sm="12">
-              <a-form-item label="订单变更说明">
-                <a-input v-model="orderDetail.orderChangeDesc"></a-input>
-              </a-form-item>
+              <a-form-model-item label="订单变更说明" prop="orderChangeDescription">
+                {{ orderDetail.orderChangeDescription }}
+              </a-form-model-item>
             </a-col>
           </a-row>
-        </a-form>
+        </a-form-model>
       </div>
     </a-card>
 
@@ -147,8 +146,8 @@
     <a-card :bordered="true" style="margin:10px 0">
       <a-table
         bordered
-        :columns="detailColumns"
-        :data-source="orderDetailData"
+        :columns="childColumns"
+        :data-source="childData"
         :pagination="ipagination"
         :loading="loading"
         :scroll="{ x: 1500 }"
@@ -162,10 +161,11 @@
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
+import moment from 'moment'
 export default {
   name: 'OrderList',
   mixins: [JeecgListMixin],
-  components: { JEllipsis },
+  components: { JEllipsis, moment },
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
     return {
@@ -173,53 +173,63 @@ export default {
       visible: false, // 抽屉
 
       // 表头
-      detailColumns: [
-        { title: '款号', width: 120, dataIndex: 'styleNum', fixed: 'left', className: 'replacecolor' },
+      childColumns: [
+        { title: '款号', width: 120, dataIndex: 'itemNumber', fixed: 'left', className: 'replacecolor' },
         {
           title: '预发货日期',
           width: 120,
-          dataIndex: 'scheduledShipDate',
+          dataIndex: 'preDeliveryDate',
           fixed: 'left',
+          customRender: text => {
+            return moment(text).format('YYYY-MM-DD')
+          },
+          className: 'replacecolor'
+        },
+        {
+          title: '预完工日期',
+          width: 120,
+          dataIndex: 'preCompletionDate',
+          customRender: text => {
+            return moment(text).format('YYYY-MM-DD')
+          },
           className: 'replacecolor'
         },
-        { title: '预完工日期', width: 120, dataIndex: 'scheduledDoneDate', className: 'replacecolor' },
         { title: 'Pack Id', width: 100, dataIndex: 'packId', className: 'replacecolor' },
         { title: '小po', width: 100, dataIndex: 'smallPo', className: 'replacecolor' },
         { title: '分销点', width: 150, dataIndex: 'distributionPoint', className: 'replacecolor' },
-        { title: '存货编码', width: 120, dataIndex: 'cinvcode', className: 'replacecolor' },
+        { title: '存货编码', width: 120, dataIndex: 'inventoryCode', className: 'replacecolor' },
         { title: '存货名称', width: 120, dataIndex: 'inventoryName', className: 'replacecolor' },
-        { title: '规格型号', width: 100, dataIndex: 'specificationModel', className: 'replacecolor' },
-        { title: '颜色', width: 100, dataIndex: 'color', className: 'replacecolor' },
+        { title: '规格型号', width: 100, dataIndex: 'specificationAndModel', className: 'replacecolor' },
+        { title: '颜色', width: 100, dataIndex: 'colour', className: 'replacecolor' },
         { title: '尺码', width: 100, dataIndex: 'size', className: 'replacecolor' },
-        { title: '配码规则', width: 100, dataIndex: 'codeRules', className: 'replacecolor' },
-        { title: '光坯毛门幅CM', width: 140, dataIndex: 'smoothDoorCM', className: 'replacecolor' },
-        { title: '箱数', width: 100, dataIndex: 'boxNum', className: 'replacecolor' },
+        { title: '配码规则', width: 100, dataIndex: 'codingRules', className: 'replacecolor' },
+        { title: '光坯毛门幅CM', width: 140, dataIndex: 'guangpeiGateWidth', className: 'replacecolor' },
+        { title: '箱数', width: 100, dataIndex: 'boxNumber', className: 'replacecolor' },
         { title: '数量', width: 100, dataIndex: 'quantity', className: 'replacecolor' },
-        { title: '主计量', width: 100, dataIndex: 'mainMeter', className: 'replacecolor' },
-        { title: '含税单价', width: 100, dataIndex: 'priceInTax', className: 'replacecolor' },
-        { title: '价税合计', width: 100, dataIndex: 'totalPriceTax', className: 'replacecolor' },
+        { title: '主计量', width: 100, dataIndex: 'masterMetering', className: 'replacecolor' },
+        { title: '含税单价', width: 100, dataIndex: 'unitPriceIncludingTax', className: 'replacecolor' },
+        { title: '价税合计', width: 100, dataIndex: 'totalPriceAndTax', className: 'replacecolor' },
         { title: '税率(%)', width: 100, dataIndex: 'taxRate', className: 'replacecolor' },
         {
           title: '备注',
           width: 150,
-          dataIndex: 'note',
+          dataIndex: 'remarks',
           customRender: t => ellipsis(t),
           className: 'replacecolor',
-          scopedSlots: { customRender: 'note' }
+          scopedSlots: { customRender: 'remarks' }
         },
-        { title: '行关闭人', width: 100, dataIndex: 'shutDownMan', className: 'replacecolor' }
+        { title: '行关闭人', width: 100, dataIndex: 'bankClosedBy', className: 'replacecolor' }
       ],
-      orderDetailData: [{}, {}, {}],
+      orderDetail: [], // 主表信息
+      childData: [], // 子表数据
       loading: false, // 表格加载
-      orderDetail: []
+
+      dateFormat: 'YYYY-MM-DD'
     }
   },
   created() {},
   methods: {
-    backOrderList() {
-      console.log('返回订单销售列表')
-      this.visible = false
-    },
+    // 回显主表信息 正常应该通过id查询
     onClose() {
       // 关闭抽屉
       this.visible = false

+ 102 - 96
src/views/order/orderList.vue

@@ -8,35 +8,38 @@
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="订单号">
-                <a-input placeholder="请输入订单号" v-model="queryParam.orderNum"></a-input>
+                <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
               </a-form-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
-              <a-form-item label="订单日期" has-feedback>
+              <a-form-item label="订单日期">
                 <a-date-picker
                   style="width: 100%"
-                  v-model="queryParam.orderData"
+                  format="YYYY-MM-DD"
+                  v-model="queryParam.orderDate"
                   placeholder="请选择订单日期"
+                  @change="onDateChange"
                 ></a-date-picker>
               </a-form-item>
             </a-col>
 
             <a-col :md="6" :sm="8">
               <a-form-item label="客户简称">
-                <a-input placeholder="请输入客户简称" v-model="queryParam.customerShortName"></a-input>
+                <a-input placeholder="请输入客户简称" v-model="queryParam.customerAbbreviation"></a-input>
               </a-form-item>
             </a-col>
 
             <template v-if="toggleSearchStatus">
               <a-col :md="6" :sm="8">
                 <a-form-item label="账套">
-                  <a-select placeholder="请选择账套" v-model="queryParam.accountSet">
+                  <a-input placeholder="请输入账套" v-model="queryParam.account"></a-input>
+                  <!-- <a-select placeholder="请选择账套" v-model="queryParam.account">
                     <a-select-option :value="''">请选择</a-select-option>
                     <a-select-option :value="0">香港森语(101)</a-select-option>
                     <a-select-option :value="1">宁波森语(102)</a-select-option>
                     <a-select-option :value="2">宁波马菲羊(103)</a-select-option>
-                  </a-select>
+                  </a-select> -->
                 </a-form-item>
               </a-col>
 
@@ -72,7 +75,7 @@
         <a-button type="primary" @click="synchronization" icon="reload">同步</a-button>
       </div>
 
-      <!-- table区域  rowKey="id" -->
+      <!-- 主表信息  rowKey="id" -->
       <div>
         <a-table
           bordered
@@ -85,18 +88,9 @@
           @change="handleTableChange"
         >
           <!-- 订单号 链接-->
-          <span slot="orderNum" slot-scope="text">
+          <span slot="orderNumber" slot-scope="text">
             <a>{{ text }}</a>
           </span>
-
-          <!-- 同步状态 -->
-          <!-- slot-scope="text, record" -->
-          <span slot="synchronousStats">
-            <!-- v-if="record.isRelease == '0'" -->
-            <a-tag color="green">同步成功</a-tag>
-            <!-- <a-tag color="red" v-else>同步失败</a-tag> -->
-            <!-- <a-tag color="orange" v-else>未同步</a-tag> -->
-          </span>
         </a-table>
       </div>
     </a-card>
@@ -110,139 +104,140 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 import OrderDetailDrawer from '@views/order/orderDetailDrawer.vue'
+import { orderList, orderByNum } from '@api/document/order'
 
 export default {
-  name: 'OrderList',
+  name: 'OrderList', // 【单证】 订单数据
   mixins: [JeecgListMixin],
   components: { JEllipsis, moment, OrderDetailDrawer },
 
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
-
+    // sorter: true, table表头排序
     return {
       // 表头
       orderLIstColumns: [
         {
           title: '订单号',
           width: 140,
-          dataIndex: 'orderNum',
+          dataIndex: 'orderNumber',
           fixed: 'left',
           className: 'replacecolor',
           customCell: this.showDrawer,
-          scopedSlots: { customRender: 'orderNum' }
+          scopedSlots: { customRender: 'orderNumber' }
+        },
+
+        {
+          title: '订单日期',
+          width: 120,
+          dataIndex: 'orderDate',
+          fixed: 'left',
+          customRender: text => {
+            return moment(text).format('YYYY-MM-DD')
+          },
+          className: 'replacecolor'
         },
-        //  {
-        //   title: '创建时间',
-        //   dataIndex: 'createTime',
-        //   align: 'center',
-        //   sorter: true,
-        //   customRender: text => {
-        //     return moment(text).format('YYYY-MM-DD')
-        //   }
-        // },
-        { title: '订单日期', width: 120, dataIndex: 'orderData', fixed: 'left', className: 'replacecolor' },
-        { title: '业务类型', width: 120, dataIndex: 'businessType', className: 'replacecolor' },
-        { title: '客户订单', width: 120, dataIndex: 'customerorder', className: 'replacecolor' },
+        { title: '业务类型', width: 120, dataIndex: 'businessTypeValue', className: 'replacecolor' },
+        { title: '客户订单', width: 120, dataIndex: 'customerOrderNumber', className: 'replacecolor' },
         {
           title: '销售类型',
           width: 120,
-          dataIndex: 'saleType',
-
-          className: 'replacecolor',
-          customRender: function(text) {
-            if (text == '1') {
-              return '销售类型1'
-            }
-            if (text == '2') {
-              return '销售类型2'
-            }
-            if (text == '3') {
-              return '销售类型3'
-            }
-            if (text == '4') {
-              return '销售类型4'
-            }
-          }
+          dataIndex: 'salesTypeValue',
+          className: 'replacecolor'
         },
-        { title: '客户简称', width: 150, dataIndex: 'customerShortName', className: 'replacecolor' },
+        { title: '客户简称', width: 150, dataIndex: 'customerAbbreviation', className: 'replacecolor' },
         { title: '客户名称', width: 120, dataIndex: 'customerName', className: 'replacecolor' },
         { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' },
         { title: '汇率', width: 90, dataIndex: 'exchangeRate', className: 'replacecolor' },
-        { title: '整单合计', width: 120, dataIndex: 'documentTotal', className: 'replacecolor' },
+        { title: '整单合计', width: 120, dataIndex: 'wholeOrderTotal', className: 'replacecolor' },
         { title: '销售部门', width: 120, dataIndex: 'salesDepartment', className: 'replacecolor' },
         { title: '业务员', width: 120, dataIndex: 'salesman', className: 'replacecolor' },
-        { title: '币种', width: 120, dataIndex: 'currency', className: 'replacecolor' },
-        { title: '品牌方', width: 120, dataIndex: 'brand', className: 'replacecolor' },
-        { title: '第三方', width: 120, dataIndex: 'thirdparty', className: 'replacecolor' },
+        { title: '币种', width: 120, dataIndex: 'currencyValue', className: 'replacecolor' },
+        { title: '品牌方', width: 120, dataIndex: 'brandSide', className: 'replacecolor' },
+        { title: '第三方', width: 120, dataIndex: 'thirdParty', className: 'replacecolor' },
         { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor' },
         { title: '定金', width: 120, dataIndex: 'deposit', className: 'replacecolor' },
         { title: '协同路线', width: 120, dataIndex: 'collaborativeRoute', className: 'replacecolor' },
-        { title: '付款条件', width: 180, dataIndex: 'paymentClause', className: 'replacecolor' },
-        { title: '最终客户', width: 120, dataIndex: 'finalCustomer', className: 'replacecolor' },
+        { title: '付款条件', width: 180, dataIndex: 'termOfPayment', className: 'replacecolor' },
+        { title: '最终客户', width: 120, dataIndex: 'endCustomer', className: 'replacecolor' },
         {
           title: '订单备注',
           width: 180,
-          dataIndex: 'orderNote',
+          dataIndex: 'orderRemarks',
           customRender: t => ellipsis(t),
           className: 'replacecolor',
-          scopedSlots: { customRender: 'orderNote' }
+          scopedSlots: { customRender: 'orderRemarks' }
         },
         {
           title: '价格备注',
           width: 120,
-          dataIndex: 'priceNote',
+          dataIndex: 'priceRemarks',
           customRender: t => ellipsis(t),
           className: 'replacecolor',
-          scopedSlots: { customRender: 'priceNote' }
-        },
-        {
-          title: '同步状态',
-          width: 120,
-          dataIndex: 'synchronousStats',
-          fixed: 'right',
-          className: 'replacecolor',
-          scopedSlots: { customRender: 'synchronousStats' }
+          scopedSlots: { customRender: 'priceRemarks' }
         },
+
         {
           title: '订单变更说明',
           width: 180,
-          dataIndex: 'orderChangeDesc',
+          dataIndex: 'orderChangeDescription',
           fixed: 'right',
           customRender: t => ellipsis(t),
           className: 'replacecolor',
-          scopedSlots: { customRender: 'orderChangeDesc' }
+          scopedSlots: { customRender: 'orderChangeDescription' }
         }
       ],
-      orderListData: [
-        { orderNum: 'AA002200001' },
-        { orderNum: 'AA002204502' },
-        { orderNum: 'AA002206503' },
-        { orderNum: 'AA002200004' }
-      ],
+      orderListData: [], // 主表信息
       loading: false, // 表格加载
+
       // 查询条件
       queryParam: {
-        index: '',
-        planNum: '',
-        customerShortName: ''
+        orderNumber: '',
+        orderDate: '',
+        customerAbbreviation: '',
+        account: '',
+        pageNo: '', // 初始页
+        pageSize: '-1' // 每页显示条数
+      },
+      // 分页
+      pagination: {
+        total: '',
+        current: 0,
+        pageSize: 0
       }
     }
   },
+
   created() {
-    // 渲染订单销售列表
+    this.getOrderList()
   },
   methods: {
-    // 同步
-    synchronization() {},
-
+    // 订单数据查询
+    getOrderList() {
+      this.$nextTick(() => {
+        orderList(this.queryParam).then(res => {
+          if (res.success) {
+            this.orderListData = res.result.records
+            console.log('订单数据列表', this.orderListData)
+            // 分页信息赋值
+            this.pagination = {
+              total: res.result.total,
+              current: res.result.current,
+              pageSize: res.result.size
+            }
+          }
+        })
+      })
+    },
     // 查询按钮
     searchQuery() {
-      // 渲染订单销售列表
+      this.getOrderList()
+      console.log('this.queryParam.orderDate', this.queryParam.orderDate)
     },
     searchReset() {
-      // console.log('>>>>重置')
+      console.log('>>>>重置')
       this.queryParam = {}
-      // 重新渲染订单销售列表
+      this.getOrderList()
     },
 
     // 【订单号】 抽屉
@@ -250,22 +245,33 @@ export default {
       return {
         on: {
           click: event => {
-            console.log('点击了单元格')
-            // this.$router.push('orderDetail')
+            console.log('点击的订单号', record.orderNumber)
             this.$refs.orderDetailDrawer.visible = true
+            // 子表信息获取
+            orderByNum({ orderNumber: record.orderNumber }).then(res => {
+              if (res.success) {
+                console.log('子表详情', res.result)
+                // 子表信息赋值
+                this.$refs.orderDetailDrawer.childData = res.result
+                 console.log('主表信息', record)
+                 this.$refs.orderDetailDrawer.orderDetail = record
+              }
+            })
           }
         }
       }
     },
+
+    // 查询条件 订单日期转换成字符串并赋值
+    onDateChange(value, dateString) {
+      console.log('订单日期', dateString)
+      this.queryParam.orderDate = dateString
+    },
+    // 同步
+    synchronization() {},
+
     // father 抽屉方法
     aa() {}
-
-    // 分页、排序、筛选变化时触发
-    // handleTableChange(pagination, filters, sorter) {
-    //   // console.log('当前页信息>>>>',pagination)
-    //   this.queryParam.pageNo = pagination.current
-    //   // this.getOrderList()
-    // }
   },
   computed: {},
   mounted() {}

+ 74 - 125
src/views/shipment-details/addShipDetDrawer.vue

@@ -16,7 +16,7 @@
           <a-form-model layout="inline" ref="form" :model="addShipDet">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <!-- required 必填项 -->
+                <!-- required必填项 disabled 禁用  -->
                 <a-form-model-item label="单据号" prop="documentNo">
                   <a-input placeholder="请输入单据号" v-model="addShipDet.documentNo"></a-input>
                 </a-form-model-item>
@@ -52,9 +52,8 @@
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="预完工日期" prop="preCompletionDate">
-                  <!-- :format="dateFormat" -->
                   <a-date-picker
-                    placeholder="请选择预完工时间"
+                    placeholder="请选择预完工日期"
                     :format="dateFormat"
                     style="width:100%;"
                     v-model="addShipDet.preCompletionDate"
@@ -72,6 +71,7 @@
           </a-form-model>
         </div>
       </a-card>
+
       <!--  参照订单数据 増行-->
       <a-card :bordered="true" style="margin:10px 0">
         <div class="table-operator">
@@ -79,38 +79,37 @@
           <a-button type="primary" @click.stop="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
         </div>
 
-        <!-- 子表  :model="form" :pagination="ipagination"    rowKey="id" -->
+        <!-- 子表  :model="form"  rowKey="id" -->
         <a-spin :spinning="confirmLoading">
           <a-form-model ref="formRef">
             <a-table
-              v-if="data"
+              v-if="syShippingDetailsItemList"
               bordered
               :rowKey="record => record.id"
               :columns="columns"
-              :data-source="data"
+              :data-source="syShippingDetailsItemList"
               :loading="loading"
               :pagination="false"
               :scroll="{ x: 1500 }"
-              @change="handleTableChange"
             >
-              <!-- 款号 输入框 -->
-              <template slot="styleNum" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.styleNum">
-                  <a-input style="width:100%" type="text" v-model="record.styleNum" />
+              <!-- 款号 输入框 :rules="rules.itemNumber" -->
+              <template slot="itemNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="itemNumber">
+                  <a-input style="width:100%" type="text" v-model="record.itemNumber" />
                 </a-form-model-item>
               </template>
 
-              <!-- 发货数量 -->
+              <!-- 发货数量 :rules="rules.shipQuantity"-->
               <template slot="shipQuantity" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.shipQuantity">
+                <a-form-model-item prop="shipmentQuantity">
                   <a-input style="width:100%" type="text" v-model="record.shipQuantity" />
                 </a-form-model-item>
               </template>
 
-              <!-- 是否TC功能 -->
+              <!-- 是否TC功能 :rules="rules.isTC"-->
               <!-- isTc ' 是否 tc 功能 0 否 1 是', -->
               <template slot="isTC" slot-scope="text, record, index">
-                <a-form-model-item prop="isEnable" :rules="rules.isTC">
+                <a-form-model-item prop="isTc">
                   <a-select v-model="record.isTC">
                     <a-select-option :value="1">是</a-select-option>
                     <a-select-option :value="0">否</a-select-option>
@@ -118,9 +117,9 @@
                 </a-form-model-item>
               </template>
 
-              <!-- 物料成分 -->
+              <!-- 物料成分 :rules="rules.materialComposition"-->
               <template slot="materialComposition" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.materialComposition">
+                <a-form-model-item prop="materialComposition">
                   <a-input style="width:100%" type="text" v-model="record.materialComposition" />
                 </a-form-model-item>
               </template>
@@ -154,18 +153,14 @@
         <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
           <a-button :style="{ marginRight: '8px' }">取消</a-button>
         </a-popconfirm>
-        <a-button type="primary" @click="submitAdd">
-          提交
+        <a-button type="primary" @click="addSave">
+          保存
         </a-button>
       </div>
     </a-drawer>
 
     <!-- 参照订单数据弹框 -->
-    <referOrderData-modal
-      ref="referOrderDataModal"
-      :sonGetList="getOrderList"
-      @ok="referOrderDataOk"
-    ></referOrderData-modal>
+    <referOrderData-modal ref="referOrderDataModal" @bao="getSon" @ok="referOrderDataOk"></referOrderData-modal>
   </div>
 </template>
 
@@ -177,7 +172,7 @@ import moment from 'moment'
 
 import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
 
-import { addShipmentList, queryOrderData } from '@api/document/shipmentList'
+import { addShipmentList } from '@api/document/shipmentList'
 
 export default {
   name: 'AddShipDetDrawer', // 新增 发运明细 抽屉
@@ -191,22 +186,22 @@ export default {
       columns: [
         {
           title: '账套',
-          dataIndex: 'accountSet',
+          dataIndex: 'pkOrg',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '订单号',
-          dataIndex: 'documentNo',
+          dataIndex: 'orderNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '款号',
-          dataIndex: 'styleNum',
-          scopedSlots: { customRender: 'styleNum' },
+          dataIndex: 'itemNumber',
+          scopedSlots: { customRender: 'itemNumber' },
           fixed: 'left',
           width: 180,
           className: 'replacecolor'
@@ -232,7 +227,7 @@ export default {
         },
         {
           title: '业务类型',
-          dataIndex: 'businessType',
+          dataIndex: 'businessTypeValue',
           width: 120,
           className: 'replacecolor'
         },
@@ -293,13 +288,13 @@ export default {
 
         {
           title: '销售类型',
-          dataIndex: 'saleType',
+          dataIndex: 'salesTypeValue',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '客户简称',
-          dataIndex: 'customerShortName',
+          dataIndex: 'customerAbbreviation',
           width: 120,
           className: 'replacecolor'
         },
@@ -317,7 +312,7 @@ export default {
         },
         {
           title: '整单合计',
-          dataIndex: 'wholeSingleCombined',
+          dataIndex: 'wholeOrderTota',
           width: 120,
           className: 'replacecolor'
         },
@@ -336,14 +331,14 @@ export default {
         },
         {
           title: '币种',
-          dataIndex: 'currency',
+          dataIndex: 'currencyValue',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '品牌方',
-          dataIndex: 'brand',
+          dataIndex: 'brandSide',
           width: 120,
           className: 'replacecolor'
         },
@@ -355,7 +350,7 @@ export default {
         },
         {
           title: '定金比例(%)',
-          dataIndex: 'depositRate',
+          dataIndex: 'depositRatio',
           width: 120,
           className: 'replacecolor'
         },
@@ -374,20 +369,20 @@ export default {
 
         {
           title: '付款条件',
-          dataIndex: 'paymentClause',
+          dataIndex: 'termOfPayment',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '最终客户',
-          dataIndex: 'finalCustomer',
+          dataIndex: 'endCustomer',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '订单备注',
-          dataIndex: 'orderNote',
+          dataIndex: 'orderRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -395,14 +390,14 @@ export default {
 
         {
           title: '价格备注',
-          dataIndex: 'priceNote',
+          dataIndex: 'priceRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '订单变更说明',
-          dataIndex: 'orderChangeDesc',
+          dataIndex: 'orderChangeDescription',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -416,43 +411,16 @@ export default {
           className: 'replacecolor'
         }
       ],
-      // 子表数据
-      data: [{}],
+      msgFormSon: 'test', // 子组件传来数据的变量
+      syShippingDetailsItemList: [], // 子表数据
       addShipDet: {}, // 新增发运明细
       visible: false,
       confirmLoading: false,
       dateFormat: 'YYYY-MM-DD',
+      state: '0' // 单据状态初始未【保存】
 
-      // 查询条件
-      queryParam: {
-        pageNo: '', // 初始页
-        orderNumber: '', // 订单号
-        acSetNo: '',
-        pageSize: '-1' // 每页显示条数
-      },
-      // 分页
-      pagination: {
-        total: 0,
-        current: 0,
-        pageSize: 0
-      }
-      // dateFormat:{
-      //   type: String,
-      //   default: 'YYYY-MM-DD',
-      //   required: false
-      // },
       // validatorRules: {
-      //   documentNo: [{ required: true, message: '单据号不能为空', trigger: 'blur' }], // 单据号
-      //   documentDate: [{ required: true, message: '单据日期不能为空', trigger: 'blur' }],
-      //   customer: [{ required: true, message: '客户不能为空', trigger: 'blur' }], // 客户
-      //   preDeliveryDate: [{ required: true, message: '预发货日期不能为空', trigger: 'blur' }],
-      //   preCompletionDate: [{ required: true, message: '预完工日期不能为空', trigger: 'blur' }],
-      //   memo: [{ required: false, trigger: 'blur' }]
-      // styleNum: [{ required: true, message: '款号不能为空', trigger: 'blur' }],
-      // shipQuantity: [{ required: true, message: '发货数量不能为空', trigger: 'blur' }],
-      // isTC: [{ required: true, message: '请选择是否TC功能', trigger: 'blur' }],
-      // materialComposition: [{ required: true, message: '物料成分不能为空', trigger: 'blur' }]
-      // }
+      //   documentNo: [{ required: true, message: '单据号不能为空', trigger: 'blur' }], 单据号
     }
   },
   // 接收父组件查询方法
@@ -465,52 +433,44 @@ export default {
   created() {},
 
   methods: {
+    getSon(val) {
+      console.log('val', val)
+      this.msgFormSon = val
+      this.syShippingDetailsItemList = this.msgFormSon
+      console.log('新增页 子表信息', this.syShippingDetailsItemList)
+    },
     // 参照订单数据
     referOrderDataOpen() {
-      // console.log('打开参照订单数据,具体信息在弹框中处理')
       this.$refs.referOrderDataModal.referOrderDataModVis = true
-      console.log('加载订单数据')
-      this.getOrderList()
+      // console.log('点击参照订单数据')
     },
-    // 查询参照订单数据
-    getOrderList() {
-      console.log('000')
-      this.$nextTick(() => {
-        // this.queryParam
-        queryOrderData(this.queryParam).then(res => {
-          console.log('1111')
-          console.log('订单数据列表res', res)
+    // 新增 保存
+    addSave() {
+      // console.log('点击了保存新增')
+      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.memo = this.addShipDet.memo // U8系统适用
+      newObj.syShippingDetailsItemList = this.syShippingDetailsItemList // 子表信息赋值
+      // 单据状态
+      newObj.state = this.state
+      if (newObj.syShippingDetailsItemList.length == 0) {
+        this.$message.error('请选择参照订单数据')
+      } else {
+        addShipmentList(newObj).then(res => {
           if (res.success) {
-            this.shipmentListData = res.result.records
-            console.log('发运明细列表', this.shipmentListData)
-            this.pagination = {
-              // 分页信息赋值
-              total: res.result.total,
-              current: res.result.current,
-              pageSize: res.result.size
-            }
-            // console.log(this.pagination.total, this.pagination.pageSize, this.pagination.current)
+            this.$message.success('新增成功')
+            console.log('新增的对象', newObj)
+            this.close()
+            this.fatherList() // 调用父组件 查询方法
+            // this.msgFormSon = {}  清空子表信息
+            console.log('空')
           }
         })
-      })
-    },
-    // 抽屉 提交
-    submitAdd() {
-      console.log('新增抽屉,提交按钮')
-      var syShippingDetails = {} // 新增一条发运明细
-      syShippingDetails.documentNo = this.addShipDet.documentNo // 单据号
-      syShippingDetails.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD HH:mm:ss') // 单据日期
-      syShippingDetails.customer = this.addShipDet.customer
-      syShippingDetails.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD HH:mm:ss') // 预发货日期
-      syShippingDetails.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD HH:mm:ss') // 预完工日期
-      syShippingDetails.memo = this.addShipDet.memo // U8系统适用
-      addShipmentList(syShippingDetails).then(res => {
-        if (res.success) {
-          this.$message.success('新增成功')
-          this.close()
-          this.fatherList() // 调用父组件 查询方法
-        }
-      })
+      }
     },
 
     // 増行
@@ -519,7 +479,7 @@ export default {
       const addrow = {
         accountSet: '',
         documentNo: '',
-        styleNum: '',
+        itemNumber: '',
         orderDate: '',
         businessType: '',
         customerOrder: '',
@@ -550,7 +510,7 @@ export default {
         orderChangeDesc: '',
         operation: ''
       }
-      this.data.push(addrow)
+      this.syShippingDetailsItemList.push(addrow)
     },
     // --------------------------------------
     // 操作 删除
@@ -562,7 +522,6 @@ export default {
     // --------------------------------------
     // 抽屉 取消
     handleCancel() {
-      // console.log('点击抽屉取消')
       this.close()
     },
 
@@ -573,21 +532,11 @@ export default {
       this.$refs.form.resetFields()
     },
 
-    // --------------------------------------
-    // validateorderNum(rule, value, callback) {},
-    // 分页、排序、筛选变化时触发
-    // handleTableChange(pagination, filters, sorter) {
-    //   // console.log('当前页信息>>>>',pagination)
-    //   this.queryParam.pageNo = pagination.current
-    //   // this.getAnnList()
-    // },
     // 参照订单数据弹框 ok-------------------------------------
     referOrderDataOk() {
       console.log('参照订单数据弹框确定')
       this.$refs.referOrderDataModal.referOrderDataModVis = false
-    },
-    // father
-    aa() {}
+    }
   },
   computed: {},
   mounted() {}

+ 209 - 0
src/views/shipment-details/declareElementsModal.vue

@@ -0,0 +1,209 @@
+<template>
+  <div id="declareElementsModal">
+    <!-- @ok="onSubmit" -->
+    <a-modal
+      title="报关要素"
+      v-model="declareElementsModVis"
+      :confirmLoading="confirmLoading"
+      @cancel="handleCancel"
+      width="86%"
+      style="top:330px;left:100px;"
+    >
+      <!-- 主表信息 填写  -->
+      <a-card :bordered="false">
+        <div class="table-page-search-wrapper">
+          <a-form-model layout="inline" ref="form" :model="declareElements">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="8">
+                <!-- required必填项 disabled 禁用  -->
+                <a-form-model-item label="报关品名" prop="declarationName">
+                  <a-input placeholder="请输入报关品名" v-model="declareElements.declarationName"></a-input>
+                </a-form-model-item>
+              </a-col>
+
+              <a-col :md="6" :sm="8">
+                <a-form-model-item label="HS code" prop="HScode">
+                  <a-input placeholder="请输入HS code" v-model="declareElements.HScode"></a-input>
+                </a-form-model-item>
+              </a-col>
+
+              <a-col :md="6" :sm="8">
+                <a-form-model-item label="英文品名" prop="customer">
+                  <a-input placeholder="请输入英文品名" v-model="declareElements.englishName"></a-input>
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+      </a-card>
+
+      <!-- 子表 -->
+      <a-card :bordered="false" style="margin:10px 0">
+        <!-- 増行  -->
+        <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin:10px 0;">増行</a-button>
+        <a-spin :spinning="confirmLoading">
+          <a-form-model ref="formRef">
+            <a-table
+              v-if="declareElementsData"
+              bordered
+              rowKey="id"
+              :columns="declareElementsColumns"
+              :data-source="declareElementsData"
+              :loading="loading"
+              :pagination="false"
+            >
+              <!-- 描述 输入框-->
+              <template slot="description" slot-scope="text, record, index">
+                <a-form-model-item prop="description">
+                  <a-input style="width:100%" type="text" v-model="record.description" />
+                </a-form-model-item>
+              </template>
+
+              <!-- 操作 -->
+              <span slot="operationSlot" slot-scope="text, record">
+                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
+                  <a href="javascript:void(0);" style="color:red;">删除</a>
+                </a-popconfirm>
+              </span>
+            </a-table>
+          </a-form-model>
+        </a-spin>
+      </a-card>
+
+      <!-- 页面底部保存取消 -->
+      <div
+        :style="{
+          position: 'absolute',
+          right: 0,
+          bottom: 0,
+          width: '100%',
+          borderTop: '1px solid #e9e9e9',
+          padding: '10px 16px',
+          background: '#fff',
+          textAlign: 'right',
+          zIndex: 1
+        }"
+      >
+        <a-popconfirm title="确定放弃?" @confirm="handleCancel" okText="确定" cancelText="取消">
+          <a-button :style="{ marginRight: '8px' }">返回</a-button>
+        </a-popconfirm>
+        <a-button type="primary" @click="addSave">
+          保存
+        </a-button>
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import moment from 'moment'
+
+export default {
+  name: 'DeclareElementsModal', // 报关要素
+  mixins: [JeecgListMixin],
+  components: { JEllipsis, moment },
+
+  data() {
+    // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
+
+    return {
+      loading: false, // 表格加载
+      // 表头
+      declareElementsColumns: [
+        {
+          title: '序号',
+          width: 90,
+          dataIndex: 'index',
+          customRender: (text, record, index) => `${index + 1}`,
+          className: 'replacecolor'
+        },
+        {
+          title: '类型',
+          dataIndex: 'decEleContent',
+          width: 90,
+          className: 'replacecolor'
+        },
+        {
+          title: '描述',
+          dataIndex: 'desc',
+          width: 160,
+          className: 'replacecolor'
+        },
+
+        {
+          title: '操作',
+          dataIndex: 'operation',
+          scopedSlots: { customRender: 'operationSlot' },
+          width: 120,
+          className: 'replacecolor'
+        }
+      ],
+      declareElementsData: [{}, {}],
+      confirmLoading: false,
+      declareElementsModVis: false,
+      declareElements: {} // 申报要素对象
+    }
+  },
+  // 接收父组件 方法
+  props: {},
+
+  created() {},
+  methods: {
+    // 増行
+    handleAddColumn() {
+      console.log('増行')
+      const addrow = {
+        index: '',
+        type: '',
+        description: '',
+        operation: ''
+      }
+      this.declareElementsData.push(addrow)
+    },
+    // 报关要素 保存
+    addSave() {
+      console.log('点击报关要素对话框 保存')
+      // var newDeclareElement = {} // 新增对象
+      // newDeclareElement.documentNo = this.addShipDet.documentNo // 单据号
+          this.close()
+          // 刷新
+    },
+
+    close() {
+      this.$emit('close')
+      this.declareElementsModVis = false
+    },
+    handleCancel() {
+      this.close()
+    },
+    handleTableChange() {
+      console.log('??这是啥')
+    }
+  },
+
+  computed: {}
+}
+</script>
+<style lang="less" scoped>
+@import '~@assets/less/common.less';
+@import '~@assets/less/overwriter.less';
+/deep/ .ant-table-thead > tr > th {
+  text-align: center;
+  // font-weight: 700;
+}
+/deep/ .ant-table-tbody {
+  text-align: center;
+}
+// th.replacecolor {
+// background-color:  #ccc;
+// }
+// 对话框里的card样式
+/deep/ .ant-modal-content {
+  background-color: #f0f2f5;
+}
+/deep/ .ant-modal-body {
+  padding: 10px;
+}
+</style>

+ 30 - 48
src/views/shipment-details/detailsShipDetDrawer.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 详情 发运明细 全部回显-->
+  <!-- 详情 发运明细 -->
   <div id="detailsShipDetDrawer">
     <a-drawer
       title="详情"
@@ -8,51 +8,45 @@
       :closable="true"
       :visible="visible"
       @close="handleCancel">
+
       <!-- 主表信息 展示-->
       <a-card :bordered="true">
         <div class="table-page-search-wrapper">
-          <a-form-model layout="inline" ref="form" :model="detailsShipDet">
-            <!-- 主表信息 填写-->
+          <a-form-model layout="inline" ref="form">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="单据号" prop="orderNum">
-                  <!-- <a-input v-model="detailsShipDet.orderNum"></a-input> -->
-                  132fr34
+                <a-form-model-item label="单据号" prop="documentNo">
+                  {{ detailsShipDet.documentNo }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="单据日期" prop="billDate">
-                  2022-04-21
-                  <!-- <a-date-picker :format="dateFormat" style="width:100%;" v-model="detailsShipDet.billDate" /> -->
+                  {{ detailsShipDet.documentDate }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="客户" prop="customer">
-                  chenc
-                  <!-- <a-input v-model="detailsShipDet.customer"></a-input> -->
+                  {{ detailsShipDet.customer }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="预发货日期" prop="scheduledShipDate">
-                  2022-04-28
-                  <!-- <a-date-picker :format="dateFormat" style="width:100%;" v-model="detailsShipDet.scheduledShipDate" /> -->
+                  {{ detailsShipDet.preDeliveryDate }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="预完工日期" prop="scheduledDoneDate">
-                  2022-04-26
-                  <!-- <a-date-picker :format="dateFormat" style="width:100%;" v-model="detailsShipDet.scheduledDoneDate" /> -->
+                <a-form-model-item label="预完工日期" prop="preCompletionDate">
+                  {{ detailsShipDet.preCompletionDate }}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="18" :sm="18">
                 <a-form-model-item label="备注" prop="note">
-                  务必按时发货,紧急
-                  <!-- <a-input v-model="detailsShipDet.note"></a-input> -->
+                  {{ detailsShipDet.memo }}
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -68,7 +62,7 @@
               rowKey="id"
               size="middle"
               :columns="columns"
-              :data-source="data"
+              :data-source="syShippingDetailsItemList"
               :loading="loading"
               :pagination="ipagination"
               :scroll="{ x: 1500 }"
@@ -99,22 +93,22 @@ export default {
       columns: [
         {
           title: '账套',
-          dataIndex: 'accountSet',
+          dataIndex: 'acSetNo',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '订单号',
-          dataIndex: 'orderNum',
+          dataIndex: 'orderNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '款号',
-          dataIndex: 'styleNum',
-          // scopedSlots: { customRender: 'styleNum' },
+          dataIndex: 'itemNumber',
+          // scopedSlots: { customRender: 'itemNumber' },
           fixed: 'left',
           width: 180,
           className: 'replacecolor'
@@ -136,7 +130,7 @@ export default {
         },
         {
           title: '业务类型',
-          dataIndex: 'businessType',
+          dataIndex: 'businessTypeValue',
           width: 120,
           className: 'replacecolor'
         },
@@ -197,13 +191,13 @@ export default {
 
         {
           title: '销售类型',
-          dataIndex: 'saleType',
+          dataIndex: 'salesTypeValue',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '客户简称',
-          dataIndex: 'customerShortName',
+          dataIndex: 'customerAbbreviation',
           width: 120,
           className: 'replacecolor'
         },
@@ -221,7 +215,7 @@ export default {
         },
         {
           title: '整单合计',
-          dataIndex: 'wholeSingleCombined',
+          dataIndex: 'wholeOrderTota',
           width: 120,
           className: 'replacecolor'
         },
@@ -240,14 +234,14 @@ export default {
         },
         {
           title: '币种',
-          dataIndex: 'currency',
+          dataIndex: 'currencyValue',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '品牌方',
-          dataIndex: 'brand',
+          dataIndex: 'brandSide',
           width: 120,
           className: 'replacecolor'
         },
@@ -259,7 +253,7 @@ export default {
         },
         {
           title: '定金比例(%)',
-          dataIndex: 'depositRate',
+          dataIndex: 'depositRatio',
           width: 120,
           className: 'replacecolor'
         },
@@ -278,20 +272,20 @@ export default {
 
         {
           title: '付款条件',
-          dataIndex: 'paymentClause',
+          dataIndex: 'termOfPayment',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '最终客户',
-          dataIndex: 'finalCustomer',
+          dataIndex: 'endCustomer',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '订单备注',
-          dataIndex: 'orderNote',
+          dataIndex: 'orderRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -299,32 +293,21 @@ export default {
 
         {
           title: '价格备注',
-          dataIndex: 'priceNote',
+          dataIndex: 'priceRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '订单变更说明',
-          dataIndex: 'orderChangeDesc',
+          dataIndex: 'orderChangeDescription',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         }
       ],
-
-      data: [
-        {
-          orderNum: 'AA002200001',
-          smallPo: '008',
-          // shipQuantity: '',
-          // isTC: '',
-          paymentClause: '定金达到50%定金达到50%定金达到50%定金达到50%定金达到50%定金达到50%'
-        },
-        {}
-      ],
-
-      detailsShipDet: [], // 详情 发运明细
+      detailsShipDet: [], // 主表信息
+      syShippingDetailsItemList: [], // 子表信息
       visible: false,
       confirmLoading: false,
       dateFormat: 'YYYY-MM-DD'
@@ -335,7 +318,6 @@ export default {
   methods: {
     // 抽屉 取消
     handleCancel() {
-      console.log('点击抽屉取消')
       this.close()
     },
     close() {

+ 83 - 102
src/views/shipment-details/editShipDetDrawer.vue

@@ -8,60 +8,61 @@
       :closable="true"
       :visible="visible"
       @close="handleCancel">
-      <!-- 主表信息 编辑-->
+      <!-- 主表信息 编辑 :rules="validatorRules"-->
       <a-card :bordered="true">
         <div class="table-page-search-wrapper">
-          <a-form-model layout="inline" ref="form" :model="editShipDet" :rules="validatorRules">
+          <a-form-model layout="inline" ref="form" :model="editShipDet" >
             <!-- 主表信息 填写-->
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="单据号" prop="orderNum">
-                  <a-input placeholder="请输入单据号" v-model="editShipDet.orderNum"></a-input>
+                <!-- required 必填项 *-->
+                <a-form-model-item label="单据号" prop="documentNo">
+                  <a-input placeholder="请输入单据号" v-model="editShipDet.documentNo"></a-input>
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="单据日期" required prop="billDate">
+                <a-form-model-item label="单据日期" prop="documentDate">
                   <a-date-picker
                     placeholder="请选择单据日期"
                     :format="dateFormat"
                     style="width:100%;"
-                    v-model="editShipDet.billDate"
+                    v-model="editShipDet.documentDate"
                   />
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="客户" prop="customer">
-                  <a-input placeholder="请输入客户" v-model="editShipDet.customer"></a-input>
+                <a-form-model-item label="客户简称" prop="customer">
+                  <a-input placeholder="请输入客户简称" v-model="editShipDet.customer"></a-input>
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="预发货日期" required prop="scheduledShipDate">
+                <a-form-model-item label="预发货日期" prop="preDeliveryDate">
                   <a-date-picker
                     placeholder="请选择预发货时间"
                     :format="dateFormat"
                     style="width:100%;"
-                    v-model="editShipDet.scheduledShipDate"
+                    v-model="editShipDet.preDeliveryDate"
                   />
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="预完工日期" required prop="scheduledDoneDate">
+                <a-form-model-item label="预完工日期" prop="preCompletionDate">
                   <a-date-picker
-                    placeholder="请选择预完工时间"
+                    placeholder="请选择到货日期"
                     :format="dateFormat"
                     style="width:100%;"
-                    v-model="editShipDet.scheduledDoneDate"
+                    v-model="editShipDet.preCompletionDate"
                   />
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="18" :sm="18">
-                <a-form-model-item label="备注" prop="note">
-                  <a-input placeholder="请输入备注" v-model="editShipDet.note"></a-input>
+                <a-form-model-item label="备注" prop="memo">
+                  <a-input placeholder="请输入备注" v-model="editShipDet.memo"></a-input>
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -76,46 +77,47 @@
           <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
         </div>
 
-        <!-- 子表  :model="form" :pagination="ipagination"-->
+        <!-- 子表  :model="form" :rules="validatorRules"-->
         <a-spin :spinning="confirmLoading">
-          <a-form-model ref="formRef" :rules="validatorRules">
+          <a-form-model ref="formRef" >
             <a-table
+              v-if="syShippingDetailsItemList"
               bordered
               rowKey="id"
               :columns="columns"
-              :data-source="data"
+              :data-source="syShippingDetailsItemList"
               :loading="loading"
               :pagination="ipagination"
               :scroll="{ x: 1500 }"
               @change="handleTableChange"
             >
-              <!-- 款号 输入框 -->
-              <template slot="styleNum" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.styleNum" required>
-                  <a-input style="width:100%" type="text" v-model="record.styleNum" />
+              <!-- 款号 输入框  :rules="rules.itemNumber" required-->
+              <template slot="itemNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="itemNumber">
+                  <a-input style="width:100%" type="text" v-model="record.itemNumber" />
                 </a-form-model-item>
               </template>
 
-              <!-- 发货数量 -->
+              <!-- 发货数量 :rules="rules.shipmentQuantity" -->
               <template slot="shipQuantity" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.shipQuantity">
+                <a-form-model-item prop="shipmentQuantity">
                   <a-input style="width:100%" type="text" v-model="record.shipQuantity" />
                 </a-form-model-item>
               </template>
 
-              <!-- 是否TC功能 -->
+              <!-- 是否TC功能 :rules="rules.isTC" -->
               <template slot="isTC" slot-scope="text, record, index">
-                <a-form-model-item prop="isEnable" :rules="rules.isTC">
+                <a-form-model-item prop="isEnable" >
                   <a-select v-model="record.isTC">
+                    <a-select-option :value="0">否</a-select-option>
                     <a-select-option :value="1">是</a-select-option>
-                    <a-select-option :value="2">否</a-select-option>
                   </a-select>
                 </a-form-model-item>
               </template>
 
-              <!-- 物料成分 -->
+              <!-- 物料成分 :rules="rules.materialComposition"-->
               <template slot="materialComposition" slot-scope="text, record, index">
-                <a-form-model-item prop="styleNum" :rules="rules.materialComposition">
+                <a-form-model-item prop="materialComposition" >
                   <a-input style="width:100%" type="text" v-model="record.materialComposition" />
                 </a-form-model-item>
               </template>
@@ -132,7 +134,7 @@
           </a-form-model>
         </a-spin>
       </a-card>
-      <!-- 页面底部提交取消 -->
+      <!-- 页面底部保存取消 -->
       <div
         :style="{
           position: 'absolute',
@@ -149,51 +151,52 @@
         <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
           <a-button :style="{ marginRight: '8px' }">取消</a-button>
         </a-popconfirm>
-        <a-button type="primary" @click="submitEdit">
-          提交
+        <a-button type="primary" @click="editSave">
+          保存
         </a-button>
       </div>
     </a-drawer>
 
     <!-- 参照订单数据弹框 -->
-    <referOrderData-modal ref="referOrderDataModal" :father="aa" @ok="referOrderDataOk"></referOrderData-modal>
+    <referOrderData-modal ref="referOrderDataModal" @bao="getSon" @ok="referOrderDataOk"></referOrderData-modal>
   </div>
 </template>
 
 <script>
-import { JeecgListMixin } from '@/mixins/JeecgListMixin' // 分页等
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
+import { editById } from '@api/document/shipmentList'
 
 export default {
   name: 'EditShipDetDrawer', // 编辑 发运明细 抽屉
-  mixins: [JeecgListMixin], // 分页等
+  mixins: [JeecgListMixin], //
   components: { JEllipsis, ReferOrderDataModal, moment }, // 参照订单数据 弹框
   data() {
-    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
+    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       id: '',
       // 表头
       columns: [
         {
           title: '账套',
-          dataIndex: 'accountSet',
+          dataIndex: 'pkOrg',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '订单号',
-          dataIndex: 'orderNum',
+          dataIndex: 'orderNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
           title: '款号',
-          dataIndex: 'styleNum',
-          scopedSlots: { customRender: 'styleNum' },
+          dataIndex: 'itemNumber',
+          scopedSlots: { customRender: 'itemNumber' },
           fixed: 'left',
           width: 180,
           className: 'replacecolor'
@@ -215,7 +218,7 @@ export default {
         },
         {
           title: '业务类型',
-          dataIndex: 'businessType',
+          dataIndex: 'businessTypeValue',
           width: 120,
           className: 'replacecolor'
         },
@@ -247,14 +250,14 @@ export default {
         },
         {
           title: '订单剩余数量',
-          dataIndex: 'orderRemaQuantity',
+          dataIndex: 'orderRemainingQuantity',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '发货数量',
-          dataIndex: 'shipQuantity',
+          dataIndex: 'shipmentQuantity',
           scopedSlots: { customRender: 'shipQuantity' },
           width: 120,
           className: 'replacecolor'
@@ -276,13 +279,13 @@ export default {
 
         {
           title: '销售类型',
-          dataIndex: 'saleType',
+          dataIndex: 'salesTypeValue',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '客户简称',
-          dataIndex: 'customerShortName',
+          dataIndex: 'customerAbbreviation',
           width: 120,
           className: 'replacecolor'
         },
@@ -300,7 +303,7 @@ export default {
         },
         {
           title: '整单合计',
-          dataIndex: 'wholeSingleCombined',
+          dataIndex: 'wholeOrderTotal',
           width: 120,
           className: 'replacecolor'
         },
@@ -319,14 +322,14 @@ export default {
         },
         {
           title: '币种',
-          dataIndex: 'currency',
+          dataIndex: 'currencyValue',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '品牌方',
-          dataIndex: 'brand',
+          dataIndex: 'brandSide',
           width: 120,
           className: 'replacecolor'
         },
@@ -338,7 +341,7 @@ export default {
         },
         {
           title: '定金比例(%)',
-          dataIndex: 'depositRate',
+          dataIndex: 'depositRatio',
           width: 120,
           className: 'replacecolor'
         },
@@ -357,20 +360,20 @@ export default {
 
         {
           title: '付款条件',
-          dataIndex: 'paymentClause',
+          dataIndex: 'termOfPayment',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '最终客户',
-          dataIndex: 'finalCustomer',
+          dataIndex: 'endCustomer',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '订单备注',
-          dataIndex: 'orderNote',
+          dataIndex: 'orderRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -378,14 +381,14 @@ export default {
 
         {
           title: '价格备注',
-          dataIndex: 'priceNote',
+          dataIndex: 'priceRemarks',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '订单变更说明',
-          dataIndex: 'orderChangeDesc',
+          dataIndex: 'orderChangeDescription',
           width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -399,34 +402,12 @@ export default {
           className: 'replacecolor'
         }
       ],
-
-      data: [
-        {
-          orderNum: 'AA002200001',
-          smallPo: '008',
-          // shipQuantity: '',
-          // isTC: '',
-          paymentClause: '定金达到50%定金达到50%定金达到50%定金达到50%定金达到50%定金达到50%'
-        },
-        {}
-      ],
-
-      editShipDet: [], // 编辑发运明细
+      msgFormSon: 'test', // 子组件传来数据的变量
+      syShippingDetailsItemList: [], // 子表信息
+      editShipDet: {}, // 编辑发运明细
       visible: false,
       confirmLoading: false,
-      dateFormat: 'YYYY-MM-DD',
-      validatorRules: {
-        orderNum: [{ required: true, message: '订单号不能为空', trigger: 'blur' }], // 单据号
-        billDate: [{ required: true, message: '单据日期不能为空', trigger: 'blur' }],
-        customer: [{ required: true, message: '客户不能为空', trigger: 'blur' }], // 客户
-        scheduledShipDate: [{ required: true, message: '预发货日期不能为空', trigger: 'blur' }],
-        scheduledDoneDate: [{ required: true, message: '预完工日期不能为空', trigger: 'blur' }],
-        note: [{ required: false, trigger: 'blur' }],
-        styleNum: [{ required: true, message: '款号不能为空', trigger: 'blur' }],
-        shipQuantity: [{ required: true, message: '发货数量不能为空', trigger: 'blur' }],
-        isTC: [{ required: true, message: '请选择是否TC功能', trigger: 'blur' }],
-        materialComposition: [{ required: true, message: '物料成分不能为空', trigger: 'blur' }]
-      }
+      dateFormat: 'YYYY-MM-DD'
     }
   },
   // 接收父组件查询方法
@@ -436,24 +417,38 @@ export default {
       default: null
     }
   },
-  created() {
-    // this.getShipmentList() // 刷新发运明细列表
-  },
+  created() {},
 
   methods: {
+    getSon(val) {
+      console.log('val', val)
+      this.msgFormSon = val
+      this.syShippingDetailsItemList = this.msgFormSon
+      console.log('编辑页 子表信息', this.syShippingDetailsItemList)
+    },
+    // 编辑 保存
+    editSave() {
+      console.log('提交编辑、刷新发运明细列表')
+      editById(this.editShipDet).then(res => {
+        if (res.success) {
+          this.$message.success('编辑成功')
+          this.close()
+          this.fatherList() // 调用父组件的查询方法
+        }
+      })
+    },
     // 参照订单数据
     referOrderDataOpen() {
       console.log('打开参照订单数据')
-      // 打开订单数据弹框
       this.$refs.referOrderDataModal.referOrderDataModVis = true
     },
     // 増行
     handleAddColumn() {
       console.log('増行')
       const addrow = {
-        accountSet: '',
-        orderNum: '',
-        styleNum: '',
+        acSetNo: '',
+        orderNumber: '',
+        itemNumber: '',
         orderDate: '',
         businessType: '',
         customerOrder: '',
@@ -485,7 +480,7 @@ export default {
         operation: ''
       }
 
-      this.data.push(addrow)
+      this.syShippingDetailsItemList.push(addrow)
     },
     // --------------------------------------
     // 操作 删除
@@ -502,20 +497,6 @@ export default {
       this.close()
     },
 
-    // 编辑 提交
-    submitEdit() {
-      console.log('提交编辑、刷新发运明细列表')
-      const that = this
-      // 触发表单验证
-      this.$refs.form.validate(valid => {
-        if (valid) {
-          that.confirmLoading = true
-        }
-      })
-      this.sonGetList() // 调用父组件的查询方法
-      this.close()
-      // this.getShipmentList() // 刷新 发运明细列表
-    },
     close() {
       this.$emit('close')
       this.visible = false

+ 72 - 65
src/views/shipment-details/referOrderDataModal.vue

@@ -45,22 +45,20 @@
         </a-form>
       </div>
 
-      <!-- 勾选表         :row-key="record => record.id"-->
-      <div>
-        <a-table
-          bordered
-          rowKey="id"
-          v-if="referOerderData"
-          :columns="referOerderColumns"
-          :data-source="referOerderData"
-          :loading="loading"
-          :pagination="ipagination"
-          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
-          @change="handleTableChange"
-          :scroll="{ x: 1500, y: 300 }"
-        >
-        </a-table>
-      </div>
+      <!-- 勾选表  :row-key="record => record.id"  -->
+      <a-table
+        bordered
+        rowKey="id"
+        v-if="orderListData"
+        :columns="referOerderColumns"
+        :data-source="orderListData"
+        :loading="loading"
+        :pagination="ipagination"
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        @change="handleTableChange"
+        :scroll="{ x: 1500 }"
+      >
+      </a-table>
     </a-spin>
   </a-modal>
 </template>
@@ -80,7 +78,8 @@ export default {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
 
     return {
-      selectedRowKeys: [], // 勾选航
+      selectedRowKeys: [],
+      selectedRows: {}, // 勾选项
       loading: false, // 表格加载
       // 表头
       referOerderColumns: [
@@ -93,7 +92,7 @@ export default {
         },
         {
           title: '款号',
-          dataIndex: 'styleNum',
+          dataIndex: 'itemNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
@@ -105,9 +104,10 @@ export default {
           width: 120,
           className: 'replacecolor'
         },
+        // 账套替换
         {
-          title: '账套',
-          dataIndex: 'acSetNo',
+          title: '组织',
+          dataIndex: 'pkOrg',
           width: 120,
           className: 'replacecolor'
         },
@@ -135,7 +135,7 @@ export default {
         },
         {
           title: '颜色',
-          dataIndex: 'color',
+          dataIndex: 'colour',
           width: 120,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -148,7 +148,7 @@ export default {
         },
         {
           title: '配码规格',
-          dataIndex: 'specificationSize',
+          dataIndex: 'codingRules',
           width: 120,
           className: 'replacecolor'
         },
@@ -161,26 +161,26 @@ export default {
 
         {
           title: '业务类型',
-          dataIndex: 'businessType',
+          dataIndex: 'businessTypeText',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '客户订单',
-          dataIndex: 'customerOrder',
+          dataIndex: 'customerOrderNumber',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '销售类型',
-          dataIndex: 'saleType',
+          dataIndex: 'salesTypeText',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '客户简称',
-          dataIndex: 'customerShortName',
+          dataIndex: 'customerAbbreviation',
           width: 120,
           className: 'replacecolor'
         },
@@ -204,7 +204,7 @@ export default {
         },
         {
           title: '整单合计',
-          dataIndex: 'wholeSingleCombined',
+          dataIndex: 'wholeOrderTotal',
           width: 120,
           className: 'replacecolor'
         },
@@ -223,14 +223,14 @@ export default {
         },
         {
           title: '币种',
-          dataIndex: 'currency',
+          dataIndex: 'currencyValue',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '品牌方',
-          dataIndex: 'brand',
+          dataIndex: 'brandSide',
           width: 120,
           className: 'replacecolor'
         },
@@ -242,7 +242,7 @@ export default {
         },
         {
           title: '定金比例(%)',
-          dataIndex: 'depositRate',
+          dataIndex: 'depositRatio',
           width: 120,
           className: 'replacecolor'
         },
@@ -261,20 +261,20 @@ export default {
 
         {
           title: '付款条件',
-          dataIndex: 'paymentClause',
+          dataIndex: 'termOfPayment',
           width: 120,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '最终客户',
-          dataIndex: 'finalCustomer',
+          dataIndex: 'endCustomer',
           width: 120,
           className: 'replacecolor'
         },
         {
           title: '订单备注',
-          dataIndex: 'OrderNote',
+          dataIndex: 'orderRemarks',
           width: 120,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
@@ -282,21 +282,20 @@ export default {
 
         {
           title: '价格备注',
-          dataIndex: 'priceNote',
+          dataIndex: 'priceRemarks',
           width: 120,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '订单变更说明',
-          dataIndex: 'OrderChangeDesc',
+          dataIndex: 'orderChangeDescription',
           width: 120,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         }
       ],
-      referOerderData: [{}, {}],
-      // orderDataform: this.$form.createForm(this),
+      orderListData: [],
       confirmLoading: false,
       referOrderDataModVis: false,
 
@@ -306,7 +305,6 @@ export default {
         acSetNo: '',
         pageNo: '', // 初始页
         pageSize: '-1' // 每页显示条数
-        // 账套
       },
       // 分页
       pagination: {
@@ -317,31 +315,31 @@ export default {
     }
   },
   // 接收父组件 方法
-  props: {
-    father: {
-      type: Function,
-      default: null
-    }
+  props: {},
+
+  created() {
+    this.getOrderList()
   },
-  created() {},
   methods: {
+    // 查询参照订单数据
     getOrderList() {
-      // this.$nextTick(() => {
-      queryOrderData(this.queryParam).then(res => {
-        console.log('参照订单数据res', res)
-        if (res.success) {
-          this.referOerderData = res.result.records
-          console.log('参照订单数据', this.referOerderData)
-          this.pagination = {
-            // 分页信息赋值
-            total: res.result.total,
-            current: res.result.current,
-            pageSize: res.result.size
+      this.$nextTick(() => {
+        queryOrderData(this.queryParam).then(res => {
+          // console.log('参照订单数据res', res)
+          if (res.success) {
+            // 后台数据赋值给参照订单数据
+            this.orderListData = res.result.records
+            // console.log('参照订单数据', this.orderListData)
+            this.pagination = {
+              total: res.result.total,
+              current: res.result.current,
+              pageSize: res.result.size
+            }
           }
-        }
+        })
       })
-      // })
     },
+
     // 弹框查询按钮
     searchQuery() {
       this.getOrderList()
@@ -353,10 +351,25 @@ export default {
       this.queryParam.acSetNo = ''
       this.getOrderList()
     },
+    // 选中行
+    onSelectChange(keys, rows) {
+      this.selectedRowKeys = keys
+      this.selectedRows = rows
+      // console.log('this.selectedRows:', this.selectedRows)
+      // console.log('this.selectedRowKeys:', this.selectedRowKeys)
+    },
     // 弹框确定
     onSubmit() {
-      console.log('参照订单数据弹框确定,重新渲染【新增发运明细】')
-      this.referOrderDataModVis = false
+      if (this.selectedRowKeys.length == 0) {
+        this.$message.error('请勾选参照订单数据')
+      } else {
+        // console.log('需要传给父组件的数据', this.selectedRows)
+        // bao父组件指定的传数据绑定的函数 || this.selectedRows子组件给父组件传递的数据
+        this.$emit('bao', this.selectedRows)
+        this.referOrderDataModVis = false
+        this.selectedRowKeys = []
+        this.selectedRows = []
+      }
     },
 
     close() {
@@ -368,12 +381,6 @@ export default {
     },
     handleTableChange() {
       console.log('??这是啥')
-    },
-    // 选中行
-    onSelectChange(keys, rows) {
-      this.selectedRowKeys = keys
-      this.selectedRows = rows
-      console.log('选中行keys:', keys, '选中行rows:', rows)
     }
   },
   computed: {

+ 162 - 186
src/views/shipment-details/shipmentList.vue

@@ -16,9 +16,10 @@
               <a-form-item label="开始时间">
                 <a-date-picker
                   placeholder="请选择开始时间"
-                  :format="dateFormat"
+                  format="YYYY-MM-DD"
                   style="width: 100%"
                   v-model="queryParam.startTime"
+                  @change="startTimeChange"
                 />
               </a-form-item>
             </a-col>
@@ -27,21 +28,23 @@
               <a-form-item label="结束时间" style="width:100%;">
                 <a-date-picker
                   placeholder="请选择结束时间"
-                  :format="dateFormat"
+                  format="YYYY-MM-DD"
                   style="width: 100%"
                   v-model="queryParam.endTime"
+                  @change="endTimeChange"
                 />
               </a-form-item>
             </a-col>
 
             <template v-if="toggleSearchStatus">
               <a-col :md="6" :sm="8">
-                <a-form-item label="发货日期">
+                <a-form-item label="预完工日期">
                   <a-date-picker
                     placeholder="请选择发货日期"
-                    :format="dateFormat"
+                    format="YYYY-MM-DD"
                     style="width: 100%"
                     v-model="queryParam.deliveryDate"
+                    @change="deliveryDateChange"
                   />
                 </a-form-item>
               </a-col>
@@ -103,16 +106,15 @@
         @change="handleTableChange"
       >
         <!-- 推送状态 -->
-        <!-- slot-scope="text, record" -->
-        <span slot="pushStateSlot">
-          <!-- v-if="record.isRelease == '0'" -->
-          <a-tag color="#f50">失败</a-tag>
-          <!-- <a-tag color="#87d068" v-else>已发布</a-tag> -->
+        <span slot="pushStateSlot" slot-scope="text, record">
+          <a-tag color="#f50" v-if="record.pushStateSlot == '0'">失败</a-tag>
+          <!-- <a-tag color="#87d068" v-if="record.pushStateSlot == '1'">成功</a-tag> -->
         </span>
 
         <!-- 单据状态 -->
-        <span slot="documentStateSlot">
-          <a-tag color="#2db7f5">已保存</a-tag>
+        <span slot="state" slot-scope="text, record">
+          <a-tag color="#2db7f5" v-if="record.state == '0'">已保存</a-tag>
+          <!-- <a-tag color="#2db7f5" v-if="record.state == '1'">提交</a-tag> -->
         </span>
 
         <!-- 操作 -->
@@ -126,17 +128,24 @@
                 <a @click="details(record)">详情</a>
               </a-menu-item>
 
+              <!-- 判断是否提交 -->
               <a-menu-item>
-                <a @click="submit(record)">提交</a>
+                <!-- <a @click="submit(record)">提交</a> -->
+                <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
+                  <a href="javascript:void(0);">提交</a>
+                </a-popconfirm>
               </a-menu-item>
+
               <a-menu-item>
                 <a @click="edit(record)">编辑</a>
               </a-menu-item>
+
               <a-menu-item>
                 <a @click="push(record)">推送</a>
               </a-menu-item>
+
               <a-menu-item>
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
+                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
                 </a-popconfirm>
               </a-menu-item>
@@ -146,15 +155,13 @@
       </a-table>
     </a-card>
 
-    <!-- 抽屉 -->
+    <!-- 抽屉  :fatherObj="detailsByIdObj"-->
     <div>
       <addShipDet-drawer ref="addShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk"></addShipDet-drawer>
-      <detailsShipDet-drawer
-        ref="detailsShipDetDrawer"
-        :fatherList="getShipmentList"
-        @ok="modalFormOk"
-      ></detailsShipDet-drawer>
+      <detailsShipDet-drawer ref="detailsShipDetDrawer" @ok="modalFormOk"></detailsShipDet-drawer>
       <editShipDet-drawer ref="editShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk"></editShipDet-drawer>
+      <!-- 申报要素 弹框 @bao="getSon"-->
+      <declareElements-modal ref="declareElementsModal"></declareElements-modal>
     </div>
   </div>
 </template>
@@ -163,20 +170,19 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
-
 import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
 import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
 import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
-
-import { shipmentList } from '@api/document/shipmentList'
+import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
+import { shipmentList, deleteShipment, submitShipment, shipmentQueryById } from '@api/document/shipmentList'
 
 export default {
   name: 'ShipmentList', // 发运明细列表
   mixins: [JeecgListMixin],
-  components: { JEllipsis, moment, addShipDetDrawer, detailsShipDetDrawer, editShipDetDrawer },
+  components: { JEllipsis, moment, addShipDetDrawer, detailsShipDetDrawer, editShipDetDrawer, declareElementsModal },
 
   data() {
-    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
+    // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       loading: false, // 表格加载
       id: '',
@@ -190,26 +196,28 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '订单号',
-          dataIndex: 'orderNumber',
+          title: '销售订单号',
+          dataIndex: '',
           fixed: 'left',
           width: 120,
           className: 'replacecolor'
         },
 
         {
-          title: '单据日期',
-          dataIndex: 'documentDate',
+          title: '客户简称',
+          dataIndex: 'customerAbbreviation',
           width: 140,
-          // sorter: true,
-          // customRender: text => {
-          //   return moment(text).format('YYYY-MM-DD')
-          // },
           className: 'replacecolor'
         },
         {
-          title: '客户',
-          dataIndex: 'customer',
+          title: '部门',
+          dataIndex: 'salesDepartment',
+          width: 120,
+          className: 'replacecolor'
+        },
+        {
+          title: '业务员',
+          dataIndex: 'salesman',
           width: 120,
           className: 'replacecolor'
         },
@@ -221,221 +229,138 @@ export default {
         },
 
         {
-          title: '款号',
-          dataIndex: 'itemNumber',
+          title: 'pack id',
+          dataIndex: 'packId',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '报关品名',
-          dataIndex: 'declarationName',
+          title: '分销点',
+          dataIndex: 'distributionPoint',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: 'hscode',
-          dataIndex: 'HScode',
+          title: '款号',
+          dataIndex: 'itemNumber',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '英文品名',
-          dataIndex: 'englishName',
+          title: '预发货日期',
+          dataIndex: 'preDeliveryDate',
           width: 120,
+          customRender: text => {
+            return moment(text).format('YYYY-MM-DD')
+          },
           className: 'replacecolor'
         },
         {
-          title: '账套',
-          dataIndex: 'acSetNo',
+          title: '预完工日期',
+          dataIndex: 'preCompletionDate',
           width: 120,
+          customRender: text => {
+            return moment(text).format('YYYY-MM-DD')
+          },
           className: 'replacecolor'
         },
 
         {
-          title: '订单日期',
-          dataIndex: 'orderDate',
+          title: '存货名称',
+          dataIndex: 'inventoryName',
           width: 140,
           className: 'replacecolor'
         },
         {
-          title: '业务类型',
-          dataIndex: 'businessTypeValue',
+          title: '数量(合计)',
+          dataIndex: 'shipmentQuantity',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '客户订单',
-          dataIndex: 'customerOrder',
+          title: '单价(销售)',
+          dataIndex: 'salesUnitPrice',
           width: 120,
           className: 'replacecolor'
         },
 
         {
-          title: 'Pack Id',
-          dataIndex: 'packId',
+          title: '采购/委外订单号',
+          dataIndex: 'purOrSubOrder',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '订单数据',
-          dataIndex: 'orderData',
+          title: '订单类型',
+          dataIndex: 'orderType',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '订单剩余数量',
-          dataIndex: 'orderRemaQuantity',
+          title: '工厂单价(采购/委外单价)',
+          dataIndex: 'factoryUnitPrice',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '发货数量',
-          dataIndex: 'shipQuantity',
+          title: '申报要素(单证维护)',
+          dataIndex: 'declarationElements',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '是否TC功能',
-          dataIndex: 'isTC',
-          width: 90,
-          className: 'replacecolor'
-        },
-
-        {
-          title: '物料成分',
-          dataIndex: 'materialComposition',
+          title: '套装件数(存货自定义项)',
+          dataIndex: 'numberOfSets',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '销售类型',
-          dataIndex: 'salesTypeValue',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '客户简称',
-          dataIndex: 'customerAbbreviation',
-          width: 120,
-          className: 'replacecolor'
-        },
-
-        {
-          title: '客户名称',
-          dataIndex: 'customerName',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '汇率',
-          dataIndex: 'exchangeRate',
+          title: '是否TC',
+          dataIndex: 'isTc',
           width: 90,
-          className: 'replacecolor'
-        },
-        {
-          title: '整单合计',
-          dataIndex: 'wholeOrderTota',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '销售部门',
-          dataIndex: 'salesDepartment',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '业务员',
-          dataIndex: 'salesman',
-          width: 120,
+          customRender: function(text) {
+            if (text == '0') {
+              return '否'
+            }
+            if (text == '1') {
+              return '是'
+            }
+          },
           className: 'replacecolor'
         },
 
         {
-          title: '币种',
-          dataIndex: 'currencyValue',
+          title: 'HScode',
+          dataIndex: 'hsCode',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '品牌方',
-          dataIndex: 'brandSide',
+          title: '中文品名',
+          dataIndex: 'chineseName',
           width: 120,
           className: 'replacecolor'
         },
         {
-          title: '第三方',
-          dataIndex: 'thirdParty',
+          title: '英文品名',
+          dataIndex: 'englishName',
           width: 120,
           className: 'replacecolor'
         },
 
         {
-          title: '定金比例(%)',
-          dataIndex: 'depositRatio',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '定金',
-          dataIndex: 'deposit',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '协同路线',
-          dataIndex: 'collaborativeRoute',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '付款条件',
-          dataIndex: 'termOfPayment',
-          width: 120,
-          customRender: t => ellipsis(t),
-          className: 'replacecolor'
-        },
-        {
-          title: '最终客户',
-          dataIndex: 'endCustomer',
+          title: '成衣工厂',
+          dataIndex: 'garmentFactory',
           width: 120,
           className: 'replacecolor'
         },
-
-        {
-          title: '订单备注',
-          dataIndex: 'orderRemarks',
-          width: 160,
-          customRender: t => ellipsis(t),
-          className: 'replacecolor'
-        },
-        {
-          title: '价格备注',
-          dataIndex: 'priceRemarks',
-          width: 160,
-          customRender: t => ellipsis(t),
-          className: 'replacecolor'
-        },
         {
-          title: '订单变更说明',
-          dataIndex: 'orderChangeDescription',
-          width: 160,
-          customRender: t => ellipsis(t),
+          title: '报关单价',
+          dataIndex: 'customsDeclarationUnitPrice',
+          width: 90,
           className: 'replacecolor'
         },
 
-        {
-          title: '预发货日期',
-          dataIndex: 'preDeliveryDate',
-          width: 140,
-          className: 'replacecolor'
-        },
-        {
-          title: '预完工日期',
-          dataIndex: 'preCompletionDate',
-          width: 140,
-          className: 'replacecolor'
-        },
         {
           title: '推送状态',
           dataIndex: 'pushState',
@@ -446,8 +371,8 @@ export default {
         },
         {
           title: '单据状态',
-          dataIndex: 'documentState',
-          scopedSlots: { customRender: 'documentStateSlot' },
+          dataIndex: 'state',
+          scopedSlots: { customRender: 'state' },
           fixed: 'right',
           width: 90,
           className: 'replacecolor'
@@ -465,19 +390,19 @@ export default {
 
       // 查询条件
       queryParam: {
-        pageNo: '', // 初始页
         documentNo: '', // 单据号
         startTime: '',
         endTime: '',
         deliveryDate: '',
         salesman: '',
-        itemNumber: '',
+        itemNumber: '', // 款号
         refer: '',
+        pageNo: '', // 初始页
         pageSize: '-1' // 每页显示条数
       },
       // 分页
       pagination: {
-        total: 0,
+        total: '',
         current: 0,
         pageSize: 0
       },
@@ -508,7 +433,7 @@ export default {
 
     // 查询按钮
     searchQuery() {
-      this.getShipmentList() // 渲染 发运明细列表
+      this.getShipmentList()
     },
     // 重置
     searchReset() {
@@ -517,38 +442,89 @@ export default {
       this.queryParam.endTime = ''
       this.queryParam.deliveryDate = ''
       this.queryParam.salesman = ''
-      this.queryParam.styleNum = ''
+      this.queryParam.itemNumber = ''
       this.queryParam.refer = ''
       this.getShipmentList() // 渲染 发运明细列表
     },
     // --------------------------------------
 
-    // 新增 按钮
+    // 新增
     addShipDet() {
-      console.log('新增,负责打开抽屉,其余在子组件的提交按钮')
       this.$refs.addShipDetDrawer.visible = true
     },
 
     // --------------------------------------
     // 操作 申报要素
-    declareElements() {},
+    declareElements(record) {
+      console.log('点击申报要素id', record.id)
+      console.log('点击申报要素,打开弹框')
+      this.$refs.declareElementsModal.declareElementsModVis = true
+    },
+
     // 操作 详情
     details(record) {
-      console.log('查看发运明细')
       this.$refs.detailsShipDetDrawer.visible = true
+      // console.log('点击项的ID', record.id)
+      shipmentQueryById({ id: record.id }).then(res => {
+        if (res.success) {
+          console.log('点击的对象', res.result)
+          // 把通过id查询到的对象,赋值给子组件
+          this.$refs.detailsShipDetDrawer.detailsShipDet = res.result
+          this.$refs.detailsShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
+          // console.log('999', this.$refs.detailsShipDetDrawer.syShippingDetailsItemList)
+        }
+      })
     },
-    // 操作 提交
-    submit() {},
     // 操作 编辑
     edit(record) {
-      console.log('编辑发运明细')
       this.$refs.editShipDetDrawer.visible = true
+      shipmentQueryById({ id: record.id }).then(res => {
+        if (res.success) {
+          console.log('编辑对象', res.result)
+          console.log('子表信息', res.result.syShippingDetailsItemList)
+          // 把通过id查询到的对象,赋值给子组件
+          this.$refs.editShipDetDrawer.editShipDet = res.result
+          this.$refs.editShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
+        }
+      })
+    },
+    // 操作 提交
+    submit(record) {
+      console.log('点击id:', record.id)
+      this.$nextTick(() => {
+        submitShipment({ id: record.id }).then(res => {
+          if (res.success) {
+            this.getShipmentList() // 渲染 发运明细列表
+            this.$message.success('提交成功')
+          }
+        })
+      })
     },
+
     // 操作 推送
     push(record) {},
     // 操作 删除
-    handleDelete(id) {
-      console.log('id:', id)
+    handleDelete(record) {
+      console.log('点击删除项id:', record.id)
+      this.$nextTick(() => {
+        deleteShipment({ id: record.id }).then(res => {
+          console.log('res:', res)
+          this.getShipmentList() // 渲染 发运明细列表
+          this.$message.success('删除成功')
+        })
+      })
+    },
+    startTimeChange(value, dateString) {
+      console.log('开始时间', dateString)
+      this.queryParam.startTime = dateString
+    },
+    endTimeChange(value, dateString) {
+      console.log('结束时间', dateString)
+      this.queryParam.endTime = dateString
+    },
+    deliveryDateChange(value, dateString) {
+      console.log('预完工日期', dateString)
+      this.queryParam.deliveryDate = dateString
     }
   },
   computed: {},