Browse Source

单证 - 成本分配汇总-列表完成+详情tabs完成(缺弹框、合计)

liangy 2 years ago
parent
commit
ed463f77e7

+ 7 - 1
src/api/document/cost-allocation-total.js

@@ -8,4 +8,10 @@ const costList = params => getAction('/cost/syCostAllocation/list', params)
 // 详情
 const costByPlanNum = params => getAction('/cost/syCostAllocation/queryByPlanNum', params)
 
-export { costList,costByPlanNum }
+//审核
+const itemCheck = params => getAction('/cost/syCostAllocation/approveByPlanNum', params)
+
+//取消审核
+const cancelItemCheck = params => getAction('/cost/syCostAllocation/dApproveByPlanNum', params)
+
+export { costList, costByPlanNum, itemCheck, cancelItemCheck }

+ 2 - 2
src/api/reportForms/order-statistics.js

@@ -2,7 +2,7 @@
 import { getAction, postAction, deleteAction } from '@/api/manage'
 
 // 分页查询(内部、外部)
-const external = params => getAction('/report/soSoDetails/getSO_SOMainReport', params)
+const externalList = params => getAction('/report/soSoDetails/getSO_SOMainReport', params)
 
 // 外部 部门 统计图
 // const depChart = params => getAction('/report/soSoDetails/getSO_SOMainReport', params)
@@ -10,4 +10,4 @@ const external = params => getAction('/report/soSoDetails/getSO_SOMainReport', p
 // 外部 客户 统计图
 // const cusChart= params => getAction('/report/soSoDetails/getSO_SOMainReport', params)
 
-export { external }
+export { externalList }

+ 15 - 10
src/views/cost-allocation-total/costDetailDrawer.vue

@@ -244,7 +244,7 @@ export default {
   data() {
     return {
       loading: false, // 表格加载
-      detailsPlanNum: {}, //主表回显回显
+      detailsPlanNum: {}, //详情所有数据
       remarks: '', // 备注
 
       // 事故单 表头
@@ -285,17 +285,23 @@ export default {
     getALLDetail() {
       this.$nextTick(() => {
         // console.log('详情拿到planNum', this.record.planNum)
-        costByPlanNum({ plannum: this.record.planNum }).then(res => {
+        costByPlanNum({ plannum: this.record.planNum, type: 'query' }).then(res => {
           if (res.success) {
-            console.log('详情所有数据createBy', res.result[0].createBy)
-            this.detailsPlanNum = res.result[0]
+            this.detailsPlanNum = res.result //所有详情
+            this.accidentListData = res.result.syCostAllocationAccidentList //事故单
+            this.costPayData = res.result.syCostAllocationCostpayList //支出费用
 
-            this.$refs.unitTabs.fabData = res.result[0].syCostAllocationFabricList //面料
-            this.$refs.unitTabs.ingData = res.result[0].syCostAllocationIngredientList //辅料
-            this.$refs.unitTabs.shipData = res.result[0].syCostAllocationShipdetailList //发运明细
+            // tabs 名称集合
+            this.$refs.unitTabs.tabNameList = res.result.processUnit.split(',')
 
-            this.accidentListData = res.result[0].syCostAllocationAccidentList //事故单
-            this.costPayData = res.result[0].syCostAllocationCostpayList //支出费用
+            //所有tabs数据
+            this.$refs.unitTabs.tabsAllData = res.result.processUnitList
+
+            // 页面打开加载的数据
+            var oneData = this.$refs.unitTabs.tabsAllData[0]
+            this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
+            this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList
+            this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetailList
 
             this.pagination = {
               total: res.result.total,
@@ -359,7 +365,6 @@ export default {
 //   background-color: #ccc;
 // }
 
-
 // 抽屉里的card样式
 /deep/ .ant-drawer-content {
   background-color: #f0f2f5;

+ 28 - 12
src/views/cost-allocation-total/list.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 【单证】 成本分配汇总 -->
-  <div id="CostAllocationTotal">
+  <div id="costAllocationTotal">
     <!-- 查询区域 -->
     <a-card :bordered="false">
       <div class="table-page-search-wrapper">
@@ -54,7 +54,7 @@
         <!-- 单据状态 -->
         <span slot="billstatus" slot-scope="text, record">
           <a-tag color="orange" v-if="record.billstatus == '0'">未保存</a-tag>
-          <a-tag color="green" v-if="record.billstatus == '1'">保存</a-tag>
+          <a-tag color="green" v-if="record.billstatus == '1'">保存</a-tag>
           <a-tag color="blue" v-if="record.billstatus == '2'">已审批</a-tag>
         </span>
 
@@ -94,7 +94,7 @@ import moment from 'moment'
 
 import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
 
-import { costList, costByPlanNum } from '@api/document/cost-allocation-total.js'
+import { costList, itemCheck, cancelItemCheck } from '@api/document/cost-allocation-total.js'
 
 export default {
   name: 'CostAllocationTotal', // 成本分配汇总 单证
@@ -178,13 +178,7 @@ export default {
           className: 'replacecolor'
         }
       ],
-      costAllocationData: [
-        {
-          orderNum: 'AA002200001',
-          remarks:
-            '跟Jeecg-Boot官网统一,单元格内容较多时,多出内容以“……”替代,鼠标移入显示全部内容(此处原型图上是弹框,)'
-        }
-      ],
+      costAllocationData: [],
       // 查询条件
       queryParam: {
         index: '',
@@ -230,9 +224,31 @@ export default {
       this.$refs.costDetailDrawer.getALLDetail()
     },
     //  审核
-    check(record) {},
+    check(record) {
+      this.$nextTick(() => {
+        itemCheck({ plannum: record.planNum }).then(res => {
+          if (res.success) {
+            console.log('提交成功,单据状态改为【已审核】')
+            this.costAllocationData.billstatus == '2'
+            this.getCostList()
+            this.$message.success('审核成功')
+          }
+        })
+      })
+    },
     //  取消审核
-    cancelCheck(record) {},
+    cancelCheck(record) {
+      this.$nextTick(() => {
+        cancelItemCheck({ plannum: record.planNum }).then(res => {
+          if (res.success) {
+            console.log('提交成功,单据状态改为【仅保存】')
+            this.costAllocationData.billstatus == '1'
+            this.getCostList()
+            this.$message.success('取消审核成功')
+          }
+        })
+      })
+    },
 
     searchQuery() {
       this.getCostList()

+ 23 - 139
src/views/cost-allocation-total/tabs.vue

@@ -1,8 +1,9 @@
 <template>
   <!-- 详情 - 成本分配汇总 单证 -->
+  <!--   default-active-key="1"-->
   <div id="unitTabs">
-    <a-tabs default-active-key="1" @change="tabsCallback">
-      <a-tab-pane key="1" tab="加工单位1">
+    <a-tabs @change="tabsCallback" :default-active-key="activeKey">
+      <a-tab-pane v-for="(item, index) in tabNameList" :key="index" :tab="item">
         <!-- tabs 面料 -->
         <div>
           <h6 class="table-title">面料</h6>
@@ -131,135 +132,6 @@
           </div>
         </div>
       </a-tab-pane>
-
-      <a-tab-pane key="2" tab="加工单位2">
-        <div>
-          <h6 class="table-title">面料</h6>
-          <a-table
-            rowKey="(item)=>item.id"
-            :loading="loading"
-            :columns="fabColumns"
-            :data-source="fabData"
-            bordered
-            :pagination="false"
-            :scroll="{ x: 1500, y: 300 }"
-          >
-            <!-- 面料 -转入数量 弹框-->
-            <span slot="fabInQuaSlot" slot-scope="text">
-              <a>{{ text }}</a>
-            </span>
-
-            <!-- 余下数量-->
-            <span slot="fabRemaQuaSlot" slot-scope="text">
-              <a>{{ text }}</a>
-            </span>
-          </a-table>
-        </div>
-
-        <!-- tabs 辅料   -->
-        <div style="margin:30px 0">
-          <h6 class="table-title">辅料</h6>
-          <a-table
-            rowKey="id"
-            :loading="loading"
-            :columns="ingColumns"
-            :data-source="ingData"
-            bordered
-            :pagination="false"
-            :scroll="{ x: 1000, y: 300 }"
-          >
-            <!--辅料-转入数量 弹框-->
-            <span slot="ingInQuaSlot" slot-scope="text">
-              <a>{{ text }}</a>
-            </span>
-            <!--辅料-余下数量 弹框-->
-            <span slot="ingRemQuaSlot" slot-scope="text">
-              <a>{{ text }}</a>
-            </span>
-          </a-table>
-        </div>
-
-        <!-- tabs 发运明细   :scroll="{ x: 1500 }"-->
-        <div>
-          <h6 class="table-title">发运明细</h6>
-          <a-table
-            rowKey="id"
-            :loading="loading"
-            :columns="shipColumns"
-            :data-source="shipData"
-            bordered
-            :pagination="false"
-            :scroll="{ x: 1000, y: 300 }"
-          >
-          </a-table>
-        </div>
-
-        <!-- tabs 合计 信息 -->
-        <div style="marginTop:30px;">
-          <h6 class="table-title">合计信息</h6>
-          <div style="border: 1px solid #e8e8e8;padding: 20px 20px 0 20px;">
-            <a-row :gutter="24">
-              <div class="table-page-search-wrapper">
-                <a-form layout="inline">
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="出货数量合计">
-                      <a-input v-model="sumInfo.shipQua"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="辅料金额合计">
-                      <a-input v-model="sumInfo.ingAmount"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="辅料不含税金额合计">
-                      <a-input v-model="sumInfo.ingExcludAmount"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="出运美元外销总价">
-                      <a-input v-model="sumInfo.exportPriceUSD"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="出运加工费">
-                      <a-input v-model="sumInfo.shipProcesFees"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="面料不含税金额合计">
-                      <a-input v-model="sumInfo.fabricExcludTax"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="出运人民币外销金额">
-                      <a-input v-model="sumInfo.exportedAmountRMB"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="合计金额">
-                      <a-input v-model="sumInfo.amountTotal"></a-input>
-                    </a-form-item>
-                  </a-col>
-
-                  <a-col :md="6" :sm="8">
-                    <a-form-item label="面料金额合计">
-                      <a-input v-model="sumInfo.fabricAmount"></a-input>
-                    </a-form-item>
-                  </a-col>
-                </a-form>
-              </div>
-            </a-row>
-          </div>
-        </div>
-      </a-tab-pane>
     </a-tabs>
 
     <!-- tabs内弹框 -->
@@ -359,6 +231,7 @@ export default {
         }
       ],
       fabData: [],
+
       // 辅料
       ingColumns: [
         {
@@ -445,6 +318,7 @@ export default {
         }
       ],
       ingData: [],
+
       // 发运明细
       shipColumns: [
         {
@@ -521,19 +395,29 @@ export default {
         }
       ],
       shipData: [],
+      tabsAllData: [], //tabs所有数据集合
+      tabNameList: [], //tabs数组集合
+      activeKey: '0',
       sumInfo: {} //合计对象
     }
   },
-  created() {
-    // 渲染订单销售列表
-  },
+  created() {},
   methods: {
-      getSum(){
-
-      },
-
     tabsCallback(key) {
-      console.log(key)
+      this.activeKey = key
+      console.log('点击的是', this.activeKey)
+      if (key == 0) {
+        var oneData = this.tabsAllData[0]
+        this.fabData = oneData.syCostAllocationFabricList
+        this.ingData = oneData.syCostAllocationIngredientList
+        this.shipData = oneData.syCostAllocationShipdetailList
+      }
+      if (key == 1) {
+        var twoData = this.tabsAllData[1]
+        this.fabData = twoData.syCostAllocationFabricList
+        this.ingData = twoData.syCostAllocationIngredientList
+        this.shipData = twoData.syCostAllocationShipdetailList
+      }
     },
 
     // 面料 -转入数量 弹框

+ 13 - 15
src/views/reportForms/order-statistics/external-statistics.vue

@@ -10,7 +10,7 @@
               <a-form-item label="起始年月">
                 <a-range-picker
                   style="width: 100%"
-                  placeholder="['开始年月', '结束年月']"
+                  :placeholder="['开始年月', '结束年月']"
                   format="YYYY-MM"
                   :mode="mode2"
                   :value="value"
@@ -74,13 +74,13 @@
       </div>
     </a-card>
 
-    <!-- table rowKey="id" :scroll="{ x: 1500 }"-->
+    <!-- table rowKey="id" :scroll="{ x: 1500 }"        v-if="data"-->
     <a-card :bordered="false" style="marginTop:10px;">
       <a-table
         bordered
         :row-key="record => record.id"
-        :columns="externalStatisticsColumns"
-        :data-source="externalStatisticsData"
+        :columns="extStaColumns"
+        :data-source="extStadata"
         :loading="loading"
         :pagination="pagination"
         @change="handleTableChange"
@@ -94,10 +94,11 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
+
 import departmentChart from '@views/reportForms/order-statistics/chart/external/departmentChart'
 import customerChart from '@views/reportForms/order-statistics/chart/external/customerChart.vue'
 
-import { external } from '@api/reportForms/order-statistics.js'
+import { externalList } from '@api/reportForms/order-statistics.js'
 
 export default {
   name: 'ExternalStatistics', // 订单外部统计表
@@ -108,7 +109,7 @@ export default {
     // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
     return {
       description: '订单外部统计表',
-      externalStatisticsColumns: [
+      extStaColumns: [
         {
           title: '部门',
           width: 140,
@@ -159,7 +160,7 @@ export default {
         },
         { title: '本币金额', width: 150, dataIndex: 'iNatMoney', className: 'replacecolor' }
       ],
-      externalStatisticsData: [],
+      extStadata: [],
       loading: false, // 表格加载
 
       // 查询条件
@@ -187,10 +188,11 @@ export default {
   methods: {
     getExternalData() {
       this.$nextTick(() => {
-        external(this.queryParam).then(res => {
+        externalList(this.queryParam).then(res => {
           if (res.success) {
-            this.ExternalData = res.result.records
-            console.log('订单外部列表', this.ExternalData)
+            console.log('99');
+            this.extStadata = res.result.records
+            console.log('订单外部列表', this.extStadata)
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -204,20 +206,16 @@ export default {
     handlePanelChange(value, mode) {
       this.value = value
       this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]]
-      // console.log('this.mode2', this.mode2)
       this.queryParam.startYearMonth = value[0].format('YYYY-MM')
       this.queryParam.endYearMonth = value[1].format('YYYY-MM')
       console.log('开始年月:', this.queryParam.startYearMonth)
       console.log('结束年月:', this.queryParam.endYearMonth)
-      setFieldsValue({
-        timeRange: value
-      })
     },
 
     // 时间发生变化的回调,发生在用户选择时间时
     monthChange(value) {
       this.value = value
-      console.log('what------monthChange')
+      // console.log('what------monthChange')
     },
     searchQuery() {
       this.queryParam.pageNo = ''