2 Commit-ok 7a2a6799e3 ... cffda1e74b

Szerző SHA1 Üzenet Dátum
  zhongtianhaoyuan cffda1e74b Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc 1 éve
  zhongtianhaoyuan 5ad595c69c 合同利润 导出 1 éve

+ 5 - 1
src/api/V2/profitable/index.js

@@ -116,9 +116,13 @@ export const API_IMPORT_FIXED ='/fixedAssetsInfo/api/importFixedAssets'
 export const API_GET_COALPARAGRAPH = '/coalPaymentInfo/selectCoalInfo'
 //煤款记录
 export const API_GET_COALPARAGRAPH_RECORD = '/expenseInfo/selectRequestRecordInfo'
+//导出
+export const API_GET_EXPORT_TEXT = '/contractManagementInfo/settlementExport'
+//查看附件
+export const API_GET_LOOK_ANNEX = '/appendix/query/getFileList'
 //备用金列表
 export const API_GET_PETTCASHLIST = '/expenseInfo/selectPettyCashInfo'
 //备用金账户列表
 export const API_GET_PETTACCOUNTLIST = '/pettyCashInfo/selectPettyAccountInfo'
 //备用金账户下拉列表
-export const API_GET_GETACCOUNTLIST = '/pettyCashInfo/getPettyAccountList'
+export const API_GET_GETACCOUNTLIST = '/pettyCashInfo/getPettyAccountList'

+ 6 - 0
src/model/profitable/index.js

@@ -59,6 +59,8 @@ import {
   API_POST_UPLOADIMAGE,
   API_GET_COALPARAGRAPH,
   API_GET_COALPARAGRAPH_RECORD,
+  API_GET_EXPORT_TEXT,
+  API_GET_LOOK_ANNEX,
   API_GET_PETTCASHLIST,
   API_GET_PETTACCOUNTLIST,
   API_GET_GETACCOUNTLIST
@@ -180,6 +182,10 @@ export const importFixed = appRx.post(API_IMPORT_FIXED, errorCatcher, errorHandl
 export const coalPayment = appRx.get(API_GET_COALPARAGRAPH, errorCatcher, errorHandle, filter)
 // 煤款记录
 export const coalPaymentRecord = appRx.get(API_GET_COALPARAGRAPH_RECORD, errorCatcher, errorHandle, filter)
+// 导出
+export const exportText = appRx.get(API_GET_EXPORT_TEXT)
+//查看附件
+export const getAnnex = appRx.get(API_GET_LOOK_ANNEX, errorCatcher, errorHandle, filter)
 // 备用金列表
 export const pettCashList = appRx.get(API_GET_PETTCASHLIST, errorCatcher, errorHandle, filter)
 // 备用金账户列表

+ 1 - 1
src/views/home/right-top.vue

@@ -31,7 +31,7 @@ export default {
     };
   },
   watch:{
-    crklistData(res){debugger
+    crklistData(res){
       console.log('rightyop')
       console.log(res)
       this.pageflag = true;

+ 87 - 10
src/views/profitable/contractprofitsdetails.vue

@@ -93,6 +93,7 @@
               <el-button v-if="scope.row.status=='已完成'" @click="closeaccount(scope.row)" type="primary">结算</el-button>
               <el-button @click="inventory(scope.row)" type="primary">库存</el-button>
               <el-button @click="cost(scope.row)" type="primary">费用</el-button>
+              <el-button @click="exportText(scope.row)" type="primary" v-if="scope.row.status == '已结算'">导出</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -134,10 +135,7 @@
             <td class="col">{{tableData.seller}}</td>
           </tr>
           <tr class="row">
-            <td class="col col-bgc"> 
-              <span v-if="tableData.agreementType == '采购合同'">采购</span>
-              <span v-if="tableData.agreementType == '收购合同'">收购</span>
-              <span v-if="tableData.agreementType == '销售合同'">销售</span>结算单价(元/吨)</td>
+            <td class="col col-bgc">结算单价(元/吨)</td>
             <td class="col">{{tableData.settlementPrice}}</td>
             <td class="col col-bgc">合计利润(元)</td>
             <td class="col">{{tableData.profit}}</td>
@@ -149,11 +147,7 @@
             <td class="col col-bgc">利润(元)</td>
           </tr>
           <tr v-for="item in tableData.contractList" class="row">
-            <td class="col">{{item.contractNo}}
-              <span v-if="item.agreementType == '采购合同'">(采购)</span>
-              <span v-if="item.agreementType == '收购合同'">(收购)</span>
-              <span v-if="item.agreementType == '销售合同'">(销售)</span>
-            </td>
+            <td class="col">{{item.contractNo}}</td>
             <td class="col">{{item.settlementPrice}}</td>
             <td class="col">{{item.weight}}</td>
             <td class="col">{{item.profit}}</td>
@@ -161,6 +155,20 @@
         </table>
     </div>
 </el-dialog>
+<el-dialog title="导出" :visible.sync="exportShow" width="500px" :before-close="exportClose" :show-close="true">
+      <div class="check">
+        <el-checkbox-group v-model="checkList" @change="checkChange">
+          <el-checkbox label="合同附件" :disabled="contract"></el-checkbox>
+          <el-checkbox label="发运记录"></el-checkbox>
+          <el-checkbox label="费用记录"></el-checkbox>
+          <el-checkbox label="结算单"></el-checkbox>
+        </el-checkbox-group>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="exportClose">取 消</el-button>
+        <el-button type="primary" @click="exportSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -168,7 +176,9 @@
     getcontractdetails,
     getrelationcontract,
     editcontract,
-    judgesettlement
+    judgesettlement,
+    exportText,
+  getAnnex
   } from '@/model/profitable/index'
   export default {
     components: {},
@@ -195,6 +205,10 @@
         tableData:{},
         datalist:{},
         compId:localStorage.getItem('ws-pf_compId'),
+        exportShow: false,//导出
+      checkList: [],
+      exportObj: {},
+      contract: false,
       }
     },
     activated() {
@@ -206,6 +220,66 @@
       this.getPassYearFormatDate()
     },
     methods: {
+      async exportSubmit() {
+      const {
+        data
+      } = await exportText(
+        this.exportObj, {}, {
+        responseType: 'blob',
+      }
+      ).toPromise()
+      downloadFile({
+        res: data,
+        fileName: this.exportObj.contractNo + `结算详情`,
+        type: 'doc',
+      })
+      this.exportShow = false
+      this.checkList = []
+      this.exportObj = {}
+    },
+    exportText(row) {//导出
+      this.exportObj.contractNo = row.contractNo
+      if (row.addressUrl) {//查看附件后返回后端
+        getAnnex({
+          appendixIds: row.addressUrl,
+        }).toPromise().then(res => {
+          let arr = []
+          if (res.length > 0) {
+            for (let i = 0; i < res.length; i++) {
+              arr.push(res[i].appendixPath)
+            }
+          }
+          if (arr.length > 0) {
+            this.exportObj.addressUrl = arr.toString()
+          } else {//合同附件为空不让勾选
+            this.contract = true
+          }
+        })
+      }
+      this.exportShow = true
+    },
+    checkChange(e) {
+      for (let i = 0; i < this.checkList.length; i++) {
+        switch (this.checkList[i]) {
+          case '合同附件':
+            this.exportObj.needContractUrl = 1
+            break
+          case '发运记录':
+            this.exportObj.shippingRecord = 1
+            break
+          case '费用记录':
+            this.exportObj.expenseRecord = 1
+            break
+          case '结算单':
+            this.exportObj.needSettlementUrl = 1
+            break
+        }
+      }
+    },
+    exportClose() {
+      this.checkList = []
+      this.exportShow = false
+    },
       handleClose(){
         this.correlationshow=false
       },
@@ -493,4 +567,7 @@
   .el-icon-connection{
     color:#409eff;
   }
+  .check {
+  text-align: center;
+}
 </style>

+ 3 - 1
src/views/profitable/expensemanagementdetails.vue

@@ -429,6 +429,9 @@ export default {
     }
   },
   activated() {
+    if(this.$route.query.id){//有id证从任务页面进来的  将筛选状态变成待付款
+      this.toExamineType = "2"
+    }
     this.getPassYearFormatDate()
     if(this.$route.query.contractNo){
         this.flowTo=this.$route.query.contractNo
@@ -580,7 +583,6 @@ export default {
         })
     },
     getList1() {
-      console.log(this.toExamineType)
       this.currentPage = 1
       this.getList()
     },