Parcourir la source

【染损】接口联调

liangy il y a 3 ans
Parent
commit
af02ecf541

+ 5 - 2
src/api/reportForms/dye-loss-table.js

@@ -2,6 +2,9 @@
 import { getAction } from '@/api/manage'
 
 // 分页查询 染损列表
-// const dyeLossList = params => getAction('', params)
+const dyeLossList = params => getAction('scas/dyeLoss/list', params)
 
-export {  }
+// 导出
+const exportXls = params => getAction('/scas/dyeLoss/excel', params)
+
+export { dyeLossList,exportXls }

+ 2 - 0
src/field/document/shipmentDetail.md

@@ -109,3 +109,5 @@ describeText 描述
 账套 account
 
 币种 currencyText
+
+订单数据 orderDate

+ 5 - 5
src/field/reportForms/dyeLossTable.md

@@ -4,11 +4,11 @@
 
 ## 查询条件
 
-cCode 订单号
-????? 订单类型
-cVenName 供应商
-????? 计划单号
-????? 销售订单号
+code    订单号
+orderType   订单类型
+venName   供应商
+planLotNumber   计划单号
+csocode   销售订单号
 
 ---
 

+ 117 - 99
src/views/reportForms/dye-loss-table.vue

@@ -1,14 +1,14 @@
 <template>
   <!-- 染损报表 -->
   <div id="dyeLossRateTable">
+    <!-- 查询区域 -->
     <a-card :bordered="false">
-      <!-- 查询区域 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="订单号">
-                <a-input placeholder="请输入订单号" v-model="queryParam.cCode"></a-input>
+                <a-input placeholder="请输入订单号" v-model="queryParam.code"></a-input>
               </a-form-item>
             </a-col>
 
@@ -26,20 +26,20 @@
 
             <a-col :md="6" :sm="8">
               <a-form-item label="供应商">
-                <a-input placeholder="请输入供应商" v-model="queryParam.cVenName"></a-input>
+                <a-input placeholder="请输入供应商" v-model="queryParam.venName"></a-input>
               </a-form-item>
             </a-col>
 
             <template v-if="toggleSearchStatus">
               <a-col :md="6" :sm="8">
                 <a-form-item label="计划单号">
-                  <a-input placeholder="请输入计划单号" v-model="queryParam.planNum"></a-input>
+                  <a-input placeholder="请输入计划单号" v-model="queryParam.planLotNumber"></a-input>
                 </a-form-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-item label="销售订单号">
-                  <a-input placeholder="请输入销售订单号" v-model="queryParam.salescCode"></a-input>
+                  <a-input placeholder="请输入销售订单号" v-model="queryParam.csocode"></a-input>
                 </a-form-item>
               </a-col>
             </template>
@@ -59,13 +59,13 @@
       </div>
     </a-card>
 
-    <!-- 导出 -->
+    <!-- 导出 table-->
     <a-card :bordered="false" style="margin:10px 0;">
       <div class="table-operator">
         <a-button type="primary" icon="download" @click="handleExportXls('染损报表')">导出</a-button>
       </div>
 
-      <!-- 子表合计 table rowKey="id" :scroll="{ x: 1500 }"   :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"-->
+      <!-- 子表合计 table rowKey="id" :scroll="{ x: 1500 }" -->
       <div>
         <a-table
           bordered
@@ -101,18 +101,18 @@
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
-
 import moment from 'moment'
+
 import allLossChart from '@views/reportForms/dye-loss-table/allLossChart.vue'
 import someoneLossChart from '@views/reportForms/dye-loss-table/someoneLossChart'
 
-// import { dyeLossList } from '@api/reportForms/dye-loss-table.js'
+import { dyeLossList } from '@api/reportForms/dye-loss-table.js'
 
 // import FileSaver from 'file-saver'
 // import XLSX from 'xlsx'
 
 export default {
-  name: 'dyeLossRateTable', // 染损报表
+  name: 'DyeLossRateTable', // 染损报表
   mixins: [JeecgListMixin],
   components: { JEllipsis, moment, allLossChart, someoneLossChart },
 
@@ -216,33 +216,42 @@ export default {
         //   iMSQuantity: '20',
         //   dyeLossRate: '4.32%'
         // },
-        {
-          cInvCode: '1901034590',
-          cInvName: '1',
-          iQuantity: '30',
-          iQuantity2: '30',
-          iQuantity3: '30',
-          iMSQuantity: '30',
-          dyeLossRate: '1%'
-        },
-        {
-          cInvCode: '3801000890',
-          cInvName: '2',
-          iQuantity: '20',
-          iQuantity2: '20',
-          iQuantity3: '20',
-          iMSQuantity: '20',
-          dyeLossRate: '2%'
-        },
-        {
-          cInvCode: '1901034590',
-          cInvName: '3',
-          iQuantity: '30',
-          iQuantity2: '30',
-          iQuantity3: '30',
-          iMSQuantity: '30',
-          dyeLossRate: '3%'
-        }
+        // {
+        //   cInvCode: '1901034590',
+        //   cInvName: '1',
+        //   iQuantity: '30',
+        //   color: 'red',
+        //   cVenName: 'uuuuu',
+        //   cCode: 'TT765',
+        //   iQuantity2: '3',
+        //   iQuantity3: '22',
+        //   iMSQuantity: '30',
+        //   dyeLossRate: '1%'
+        // },
+        // {
+        //   cInvCode: '3801000890',
+        //   cInvName: '2',
+        //   iQuantity: '20',
+        //   iQuantity2: '2',
+        //   iQuantity3: '11',
+        //   color: 'orange',
+        //   cVenName: 'RRRR',
+        //   cCode: 'YY78',
+        //   iMSQuantity: '20',
+        //   dyeLossRate: '2%'
+        // },
+        // {
+        //   cInvCode: '1901034590',
+        //   cInvName: '3',
+        //   iQuantity: '30',
+        //   iQuantity2: '3',
+        //   color: 'gray',
+        //   cVenName: 'AAAA',
+        //   cCode: 'AA78',
+        //   iQuantity3: '10',
+        //   iMSQuantity: '30',
+        //   dyeLossRate: '3%'
+        // }
         // {
         //   cInvCode: '3801000890',
         //   cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
@@ -283,11 +292,11 @@ export default {
       loading: false, // 表格加载
 
       queryParam: {
-        cCode: '',
+        code: '', //订单号
         orderType: '', //订单类型
-        cVenName: '',
-        planNum: '', //订单号
-        salescCode: '', //销售订单号
+        venName: '', //供应商
+        planLotNumber: '', //计划单号
+        csocode: '', //销售订单号
         pageNo: '', // 初始页
         pageSize: '-1' // 为了显示数据总计数
       },
@@ -296,52 +305,38 @@ export default {
         total: '',
         current: 0,
         pageSize: 0
-      },
-      selectedRowKeys: [],
-      selectedRows: {}, // 勾选项
-      totals: []
+      }
     }
   },
+
   created() {
-    this.getdyeLossList() // 渲染染损列表
+    this.getdyeLossList() // 渲染 染损列表
+    console.log('000')
   },
 
   methods: {
     // 分页查询 染损列表
     getdyeLossList() {
       this.$nextTick(() => {
-        // dyeLossList(this.queryParam).then(res => {
-        //   if (res.success) {
-        //     this.dyeLossRateData = res.result.records
-        //     console.log('染损列表', this.dyeLossRateData)
-        //     // 分页信息赋值
-        //     this.pagination = {
-        //       total: res.result.total,
-        //       current: res.result.current,
-        //       pageSize: res.result.size
-        //     }
-        //   }
-        // })
+        console.log('111')
+        dyeLossList(this.queryParam).then(res => {
+          console.log('2222')
+          console.log(res.result);
+          if (res.success) {
+            console.log('333')
+            this.dyeLossRateData = res.result.records
+            console.log('染损列表', this.dyeLossRateData)
+            // 分页信息赋值
+            this.pagination = {
+              total: res.result.total,
+              current: res.result.current,
+              pageSize: res.result.size
+            }
+          }
+        })
       })
     },
 
-    // 合计行 TODO: 怎么合计数值 及 table 单元格合并
-    totalFooterShow(data) {
-      // 后端传递的合计的数据
-      console.log('染损报表----合计行')
-      console.log('data', data)
-      return (
-        <a-table
-          rowKey={Math.random}
-          bordered={false}
-          pagination={false}
-          columns={this.dyeLossRateColumns}
-          dataSource={this.dyeLossRateDataSource || []}
-          showHeader={false}
-        ></a-table>
-      )
-    },
-
     // 查询按钮
     searchQuery() {
       this.getdyeLossList() // 渲染染损列表
@@ -350,13 +345,6 @@ export default {
       this.queryParam = {}
       this.getdyeLossList()
     },
-    // 选中行
-    onSelectChange(keys, rows) {
-      this.selectedRowKeys = keys
-      this.selectedRows = rows
-      // console.log('this.selectedRows:', this.selectedRows)
-      // console.log('this.selectedRowKeys:', this.selectedRowKeys)
-    },
 
     handleTableChange() {
       console.log('??这是啥')
@@ -371,33 +359,63 @@ export default {
       console.log('需导出的fileName:', fileName)
       const params = this.queryParam
       console.log('导出参数', params)
+    },
+    // 合计行 TODO: 怎么合计数值 及 table 单元格合并
+    totalFooterShow(data) {
+      // 后端传递的合计的数据
+      console.log('染损报表----合计行')
+      // console.log('data', data)
+      return (
+        <a-table
+          rowKey={Math.random}
+          bordered={false}
+          pagination={false}
+          columns={this.dyeLossRateColumns}
+          dataSource={this.dyeLossRateDataSource || []}
+          showHeader={false}
+        ></a-table>
+      )
     }
   },
   computed: {
-    // 构建合计数据
+    // 合计数据
     dyeLossRateDataSource() {
       const summary = Object.assign({}, this.dyeLossRateData[1])
       for (const attr in summary) {
         summary[attr] = '合计'
-        break
       }
+      let iQuantityNum = 0 //订单数量 合计
+      this.dyeLossRateData.forEach(({ iQuantity }) => {
+        iQuantityNum = parseInt(iQuantityNum) + parseInt(iQuantity)
+      })
+      summary['iQuantity'] = iQuantityNum
+
+      let iQuantity2Num = 0 //采购入库数 合计
+      this.dyeLossRateData.forEach(({ iQuantity2 }) => {
+        iQuantity2Num = parseInt(iQuantity2Num) + parseInt(iQuantity2)
+      })
+      summary['iQuantity2'] = iQuantity2Num
+
+      let iQuantity3Num = 0 //材料出库数 合计
+      this.dyeLossRateData.forEach(({ iQuantity3 }) => {
+        iQuantity3Num = parseInt(iQuantity3Num) + parseInt(iQuantity3)
+      })
+      summary['iQuantity3'] = iQuantity3Num
+
+      let iMSQuantityNum = 0 //核销数量 合计
+      this.dyeLossRateData.forEach(({ iMSQuantity }) => {
+        iMSQuantityNum = parseInt(iMSQuantityNum) + parseInt(iMSQuantity)
+      })
+      summary['iMSQuantity'] = iMSQuantityNum
+
+      let dyeLossRateNum = 0 //染损
+      this.dyeLossRateData.forEach(({ dyeLossRate }) => {
+        dyeLossRateNum = parseInt(dyeLossRateNum) + parseInt(dyeLossRate)
+      })
+      summary['dyeLossRate'] = dyeLossRateNum
+
       return [summary]
     }
-    // 选中项
-    // rowSelection() {
-    //   return {
-    //     onChange: (selectedRowKeys, selectedRows) => {
-    //       console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-    //     },
-    //     getCheckboxProps: record => ({
-    //       props: {
-    //         disabled: record.title === 'Disabled User',
-    //         // Column configuration not to be checked
-    //         title: record.title
-    //       }
-    //     })
-    //   }
-    // }
   }
 }
 </script>

+ 2 - 2
src/views/shipment-details/addShipDetDrawer.vue

@@ -336,7 +336,7 @@ export default {
         },
         {
           title: '订单数据',
-          dataIndex: 'orderData',
+          dataIndex: 'orderDate',
           width: 120,
           className: 'replacecolor'
         },
@@ -590,7 +590,7 @@ export default {
         customerOrder: '',
         smallPo: '',
         packId: '',
-        orderData: '',
+        orderDate: '',
         orderRemaQuantity: '',
         shipQuantity: '',
         isTC: '',

+ 4 - 9
src/views/shipment-details/shipmentList.vue

@@ -231,10 +231,12 @@
 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 declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
+
 import {
   shipmentList,
   deleteShipment,
@@ -581,7 +583,7 @@ export default {
       console.log('点击id:', record.id)
       this.$nextTick(() => {
         //TODO: 缺少参数 提交类型
-        submitShipment({ id: record.id }).then(res => {
+        submitShipment({ id: record.id, type: '1' }).then(res => {
           if (res.success) {
             console.log('提交成功,单据状态改为【已提交】')
             this.shipmentListData.state == '1'
@@ -595,7 +597,7 @@ export default {
     cancelSubmit(record) {
       console.log('取消订单id:', record.id)
       this.$nextTick(() => {
-        cancelSubmitShipment({ id: record.id }).then(res => {
+        cancelSubmitShipment({ id: record.id, type: '2' }).then(res => {
           if (res.success) {
             console.log('取消提交成功,单据状态改为【仅保存】')
             this.shipmentListData.state == '0'
@@ -640,18 +642,11 @@ export default {
     handleDelete(record) {
       console.log('点击删除项id:', record.id)
       this.$nextTick(() => {
-        // 根据单据状态判断是否可删除数据(已提交不可删除)客户需要通过【删除】动作判断是否可删
-        //现在通过该状态,控制是否有【删除】按钮
-        // if (this.shipmentListData.state == 0) {
         deleteShipment({ id: record.id }).then(res => {
           console.log('res:', res)
           this.getShipmentList() // 渲染 发运明细列表
           this.$message.success('删除成功')
         })
-        // }
-        //  else {
-        //   this.$message.error('单据已提交,不可删除')
-        // }
       })
     },
     onDateChange(value, dateString) {