Explorar o código

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-web

zengtx %!s(int64=2) %!d(string=hai) anos
pai
achega
860a532d09

+ 3 - 2
src/api/document/order.js

@@ -1,6 +1,6 @@
 /** 单证 -- 订单数据 **/
 
-import { getAction } from '@/api/manage'
+import { getAction, postAction } from '@/api/manage'
 
 // 分页列表查询
 const orderList = params => getAction('/orderData/syOrderData/list', params)
@@ -9,5 +9,6 @@ const orderList = params => getAction('/orderData/syOrderData/list', params)
 const orderByNum = params => getAction('/orderData/syOrderDataItem/lists', params)
 
 //同步
+const syncy = params => postAction('/orderData/syOrderData/tongBu', params)
 
-export { orderList, orderByNum }
+export { orderList, orderByNum, syncy }

+ 6 - 1
src/api/document/shipmentList.js

@@ -43,6 +43,10 @@ const queryOrderData = params => getAction('/shippingDetails/syShippingDetails/q
 // 维护款号成分
 const addItemNumEle = params => postAction('/shippingDetails/syShippingDetails/updateByTcNumberMaterial', params)
 
+// 参照订单数据  确定
+
+const confimOrderData = params => getAction('/shippingDetails/syShippingDetails/displayDetails', params)
+
 export {
   shipmentList,
   addShipmentList,
@@ -56,5 +60,6 @@ export {
   cancelSubmitShipment,
   pushShipment,
   rePushShipment,
-  addItemNumEle
+  addItemNumEle,
+  confimOrderData
 }

+ 15 - 7
src/views/order/orderList.vue

@@ -109,7 +109,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 import OrderDetailDrawer from '@views/order/orderDetailDrawer.vue'
-import { orderList } from '@api/document/order'
+import { orderList, syncy } from '@api/document/order'
 
 export default {
   name: 'OrderList', // 【单证】 订单数据
@@ -159,8 +159,8 @@ export default {
         { title: '销售部门', width: 100, dataIndex: 'salesDepartment', className: 'replacecolor' },
         { title: '业务员', width: 140, dataIndex: 'salesman', className: 'replacecolor' },
         { title: '币种', width: 90, dataIndex: 'currencyText', className: 'replacecolor' },
-        { title: '品牌方', width: 220, dataIndex: 'brandSide',align: 'left', className: 'replacecolor' },
-        { title: '第三方', width: 220, dataIndex: 'thirdParty',  align: 'left', className: 'replacecolor' },
+        { title: '品牌方', width: 220, dataIndex: 'brandSide', align: 'left', className: 'replacecolor' },
+        { title: '第三方', width: 220, dataIndex: 'thirdParty', align: 'left', className: 'replacecolor' },
         { title: '定金比例(%)', width: 120, dataIndex: 'depositRatio', className: 'replacecolor' },
         { title: '定金', width: 100, dataIndex: 'deposit', className: 'replacecolor' },
         { title: '协同路线', width: 160, dataIndex: 'collaborativeRoute', className: 'replacecolor' },
@@ -234,6 +234,18 @@ export default {
         })
       })
     },
+    // 同步
+    synchronization() {
+      console.log('订单数据--同步')
+      this.$nextTick(() => {
+        syncy().then(res => {
+          if (res.success) {
+            this.getOrderList()
+            console.log('订单数据--同步')
+          }
+        })
+      })
+    },
 
     // 【订单号】 抽屉
     showDrawer(record) {
@@ -264,10 +276,6 @@ export default {
     onDateChange(value, dateString) {
       this.queryParam.orderDate = dateString
     },
-    // 同步
-    synchronization() {
-      console.log('订单数据--同步')
-    },
 
     handleTableChange(pagination, filters, sorter) {
       this.queryParam.pageNo = pagination.current

+ 1 - 1
src/views/shipment-details/itemNumEleModal.vue

@@ -80,7 +80,7 @@ export default {
       confirmLoading: false,
       itemNumEleModVis: false,
       editItemNumber: {}, // 编辑维护款号成分
-      record:{}
+      record: {}
     }
   },
   // 接收父组件 方法

+ 17 - 5
src/views/shipment-details/referOrderDataModal.vue

@@ -67,7 +67,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 
-import { queryOrderData } from '@api/document/shipmentList'
+import { queryOrderData, confimOrderData } from '@api/document/shipmentList'
 
 export default {
   name: 'ReferOrderDataModal', // 参照订单数据弹框
@@ -384,7 +384,10 @@ export default {
         queryOrderData(this.queryParam).then(res => {
           // console.log('参照订单数据res', res)
           if (res.success) {
+            console.log('00')
             this.orderListData = res.result.records
+            console.log('数据', this.orderListData)
+            console.log('out', this.orderListData.syOrderDataItemId)
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -400,10 +403,19 @@ export default {
       if (this.selectedRowKeys.length == 0) {
         this.$message.error('请勾选订单数据')
       } else {
-        // console.log('需要传给父组件的数据', this.selectedRows)
-        // bao父组件指定的传数据绑定的函数 || this.selectedRows子组件给父组件传递的数据
-        console.log('all?', this.selectedRows)
-
+        console.log('勾选', this.selectedRows.syOrderDataItemId)
+        confimOrderData({ itemId: this.orderListData.syOrderDataItemId }).then(res => {
+          // console.log('参照订单数据res', res)F
+          if (res.success) {
+            console.log('结果', res.result)
+            // this.orderListData = res.result.records
+            this.pagination = {
+              total: res.result.total,
+              current: res.result.current,
+              pageSize: res.result.size
+            }
+          }
+        })
         this.$emit('bao', this.selectedRows)
         this.referOrderDataModVis = false
         this.selectedRowKeys = []

+ 37 - 6
src/views/shipment-details/shipmentList.vue

@@ -80,6 +80,8 @@
     <a-card :bordered="false" style=" marginTop:10px;">
       <div class="table-operator">
         <a-button type="primary" @click.stop="addShipDet" icon="plus">新增</a-button>
+
+        <a-button type="primary" icon="download" @click="handleExportXls('发运明细')">导出</a-button>
       </div>
 
       <!-- 子表  :row-key="record => record.id"  :pagination="ipagination-->
@@ -223,6 +225,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 
+import { downFile } from '@/api/manage'
+
 import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
 import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
 import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
@@ -549,10 +553,37 @@ export default {
       this.$refs.itemNumEleModal.editItemNumber.isTc = record.isTc
     },
 
+    // 导出
+    handleExportXls(fileName) {
+      console.log('需导出的fileName:', fileName)
+      const params = this.shipmentListData
+      console.log('导出参数', params)
+      downFile('/shippingDetails/syShippingDetails/exportXls', params).then(data => {
+        console.log('888')
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName + '.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
+
     //  编辑
     edit(record) {
       this.$refs.editShipDetDrawer.visible = true
-      
+
       shipmentQueryById({ id: record.id }).then(res => {
         if (res.success) {
           // console.log('编辑对象', res.result)
@@ -582,7 +613,7 @@ export default {
         submitShipment({ id: record.id, type: '1' }).then(res => {
           if (res.success) {
             console.log('提交成功,单据状态改为【已提交】')
-            this.shipmentListData.state == '1'
+            this.shipmentListData.state = '1'
             this.getShipmentList() // 渲染 发运明细列表
             this.$message.success('提交成功')
           }
@@ -596,7 +627,7 @@ export default {
         cancelSubmitShipment({ id: record.id, type: '2' }).then(res => {
           if (res.success) {
             console.log('取消提交成功,单据状态改为【仅保存】')
-            this.shipmentListData.state == '0'
+            this.shipmentListData.state = '0'
             this.getShipmentList() // 渲染 发运明细列表
             this.$message.success('取消提交成功')
           }
@@ -611,7 +642,7 @@ export default {
         pushShipment({ id: record.id }).then(res => {
           if (res.success) {
             console.log('推送成功,推送状态【推送成功】')
-            this.shipmentListData.pushState == '1'
+            this.shipmentListData.pushState = '1'
             this.getShipmentList() // 渲染 发运明细列表
             this.$message.success('推送成功')
           }
@@ -626,7 +657,7 @@ export default {
         rePushShipment({ id: record.id }).then(res => {
           if (res.success) {
             console.log('重新推送成功,推送状态【推送成功】')
-            this.shipmentListData.pushState == '1'
+            this.shipmentListData.pushState = '1'
             this.getShipmentList() // 渲染 发运明细列表
             this.$message.success('重新推送成功')
           }
@@ -675,7 +706,7 @@ export default {
       this.queryParam.salesman = ''
       this.queryParam.itemNumber = ''
       this.queryParam.refer = ''
-      this.queryParam.is = ''
+      this.queryParam.isTc = ''
       this.getShipmentList() // 渲染 发运明细列表
     },