gjy 3 лет назад
Родитель
Сommit
eab1778756

+ 13 - 1
src/api/V2/contract/index.js

@@ -99,4 +99,16 @@ export const API_GET_FEERECORD = '/storageFeeRecordCharge/feeRecord'
 export const API_POST_STOP = '/storageFeeRecord/editInfo'
 export const API_POST_STOP = '/storageFeeRecord/editInfo'
 
 
 // 代储费导出
 // 代储费导出
-export const API_POST_STORAGEFEERECORDEXPORT = '/storageFeeRecord/export'
+export const API_POST_STORAGEFEERECORDEXPORT = '/storageFeeRecord/export'
+// 合同费用列表
+export const API_CONTRACTCOST = '/contractCostInfo/selectInfo'
+// 合同编号
+export const API_GET_CONTRACT ='/warehouseBaseInfo/selectContractNoList'
+// 请款收款
+export const API_ADD_CONTRACT ='/contractCostInfo/api/addInfo'
+// 编辑请款收款
+export const API_EDIT_CONTRACT ='/contractCostInfo/editInfo'
+// 删除请款收款
+export const API_DELETE_CONTRACT ='/contractCostInfo/deleteInfo'
+// 付款
+export const API_PAYMENT ='/contractCostInfo/payment'

+ 2 - 0
src/lang/zh.js

@@ -484,6 +484,7 @@ export default {
     purchaseContract: '现货采购合同',
     purchaseContract: '现货采购合同',
     collectionContract: '代收合同',
     collectionContract: '代收合同',
     storageContract:'代储合同',
     storageContract:'代储合同',
+    purchaseContractcost:'现货采购合同  /  费用',
     purchaseContractAdd: '现货采购合同  /  添加',
     purchaseContractAdd: '现货采购合同  /  添加',
     collectionContractAdd: '代收合同  /  添加',
     collectionContractAdd: '代收合同  /  添加',
     storageContractAdd:'代储合同  /  添加',
     storageContractAdd:'代储合同  /  添加',
@@ -496,6 +497,7 @@ export default {
     storageContractRecord:'代储合同  /  记录',
     storageContractRecord:'代储合同  /  记录',
     purchaseContractExamine: '现货采购合同  /  查看',
     purchaseContractExamine: '现货采购合同  /  查看',
     salesContract: '现货销售合同',
     salesContract: '现货销售合同',
+    salesContractcost: '现货销售合同  /  费用',
     salesContractEdit: '现货销售合同  /  编辑',
     salesContractEdit: '现货销售合同  /  编辑',
     salesContractExamine: '现货销售合同  /  查看',
     salesContractExamine: '现货销售合同  /  查看',
     salesContractAudit: '现货销售合同  /  审核',
     salesContractAudit: '现货销售合同  /  审核',

+ 19 - 1
src/model/contarct/index.js

@@ -42,7 +42,13 @@ import {
     API_POST_STORAGEFEERECORDCHARGE,
     API_POST_STORAGEFEERECORDCHARGE,
     API_GET_FEERECORD,
     API_GET_FEERECORD,
     API_POST_STOP,
     API_POST_STOP,
-    API_POST_STORAGEFEERECORDEXPORT
+    API_POST_STORAGEFEERECORDEXPORT,
+    API_CONTRACTCOST,
+    API_GET_CONTRACT,
+    API_ADD_CONTRACT,
+    API_EDIT_CONTRACT,
+    API_DELETE_CONTRACT,
+    API_PAYMENT
 } from '@/api/V2/contract'
 } from '@/api/V2/contract'
 // 列表
 // 列表
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
@@ -144,3 +150,15 @@ export const stopStorageFeeRecord = appRx.post(API_POST_STOP, errorCatcher, erro
 
 
 // 代储费导出
 // 代储费导出
 export const exportStorageFee = appRx.post(API_POST_STORAGEFEERECORDEXPORT)
 export const exportStorageFee = appRx.post(API_POST_STORAGEFEERECORDEXPORT)
+// 合同费用列表
+export const contractcost = appRx.get(API_CONTRACTCOST, errorCatcher, errorHandle, filter)
+// 合同编号
+export const getcontract = appRx.get(API_GET_CONTRACT, errorCatcher, errorHandle, filter)
+// 请款收款
+export const addcontractcost = appRx.post(API_ADD_CONTRACT, errorCatcher, errorHandle, filter)
+// 编辑请款收款
+export const editcontractcost = appRx.post(API_EDIT_CONTRACT, errorCatcher, errorHandle, filter)
+// 删除请款收款
+export const delcontractcost = appRx.post(API_DELETE_CONTRACT, errorCatcher, errorHandle, filter)
+// 付款
+export const payment = appRx.post(API_PAYMENT, errorCatcher, errorHandle, filter)

+ 31 - 0
src/views/contractManagement/component/routers/route.js

@@ -26,6 +26,21 @@ const contractManagementRouter = {
         keepAlive: true
         keepAlive: true
       }
       }
     },
     },
+    // 现货采购合同费用
+    {
+      path: 'buyContractcost',
+      component: () =>
+        import(/* webpackChunkName: "sparepartList" */ '@/views/contractManagement/purchaseContractCost'),
+      name: 'buyContractcost',
+      meta: {
+        title: 'purchaseContractcost',
+        shortcutEntrance: 'contractManagement',
+        module: 'contractManagement.buyContract',
+        permissicon: [],
+        keepAlive: true
+      },
+      hidden: true
+    },
     //现货采购合同查看
     //现货采购合同查看
     {
     {
       path: 'purchaseContractExamine',
       path: 'purchaseContractExamine',
@@ -153,6 +168,22 @@ const contractManagementRouter = {
         // module: 'procurement.sparepart.applDetail'
         // module: 'procurement.sparepart.applDetail'
       }
       }
     },
     },
+    //现货销售合同费用
+    {
+      path: 'salesContractcost',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/contractManagement/salesContractCost'),
+      name: 'salesContractcost',
+      meta: {
+        title: 'salesContractcost',
+        shortcutEntrance: 'contractManagement',
+        module: 'contractManagement.salesContract',
+        permissicon: [],
+        keepAlive: true
+        // module: 'procurement.sparepart.applDetail'
+      },
+      hidden: true
+    },
     //现货销售合同查看
     //现货销售合同查看
     {
     {
       path: 'salesContractExamine',
       path: 'salesContractExamine',

+ 22 - 2
src/views/contractManagement/purchaseContract.vue

@@ -159,8 +159,17 @@
           </span>
           </span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="address" label="操作" width="140">
+      <el-table-column prop="address" label="操作" width="160">
         <template slot-scope="scope">
         <template slot-scope="scope">
+           <img width="16" height="17" style="
+                vertical-align: text-top;
+                position: relative;
+                top: -1px;
+                margin: 0 6px;
+              "  src="../../../public/img/daichu.png"
+               v-hasPermission="
+              `contractManagement.nonContract.nonContractInfo.view`"
+             @click="handlecost(scope.row)" alt="" />
           <img width="16" height="16" style="vertical-align: text-top; margin: 0 6px"
           <img width="16" height="16" style="vertical-align: text-top; margin: 0 6px"
             src="../../../public/img/chakan.png" @click="handleExamine(scope.row)" v-hasPermission="
             src="../../../public/img/chakan.png" @click="handleExamine(scope.row)" v-hasPermission="
               `contractManagement.buyContract.buyContractInfo.view`
               `contractManagement.buyContract.buyContractInfo.view`
@@ -186,7 +195,7 @@
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+    <el-pagination :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
       :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
       :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
     </el-pagination>
     </el-pagination>
 
 
@@ -348,6 +357,17 @@
       this.showType = this.isShow
       this.showType = this.isShow
     },
     },
     methods: {
     methods: {
+      handlecost(row){
+         this.$router.push({
+          name: 'buyContractcost',
+          query: {
+            id: row.id,
+            contractNo: row.contractNo,
+            status:row.status,
+            seller:row.seller
+          },
+        })
+      },
       onChange() {
       onChange() {
         this.$refs.upload
         this.$refs.upload
           .handleSaveBill()
           .handleSaveBill()

+ 797 - 0
src/views/contractManagement/purchaseContractCost.vue

@@ -0,0 +1,797 @@
+<!--现货采购合同费用-->
+<!--2019年5月30日 20:25:16 by jlx-->
+<template>
+  <div>
+    <BaseHeaderLayout :leftSpan="8">
+      <template slot="left">
+          <el-select style='width:200px;'  filterable v-model="searchTypeText" placeholder="" class="typeselect" @change="selectcontract"
+          :value="searchType">
+          <el-option v-for="item in contractList" :key="item.id" :label="item.contractNo+'('+item.status+')'" :value="item.contractNo"
+            style="color: #8890b1" />
+        </el-select>
+        <span style='padding-left:10px;'>卖方:{{seller}}</span>
+      </template>
+      <template slot="right">
+      </template>
+    </BaseHeaderLayout>
+    <BaseHeaderLayout :leftSpan="16">
+      <template slot="left">
+        <ws-button :type="type==''?'primary':''" @click="handlestatus('')">全部</ws-button>
+          <ws-button :type="type=='1'?'primary':''" @click="handlestatus(1)">收入</ws-button>
+          <ws-button :type="type=='2'?'primary':''" @click="handlestatus(2)">支出</ws-button>
+          <span style='padding-left:10px;'>粮款:{{grain}}</span>
+          <span style='padding-left:10px;'>合计收入:{{income}}</span>
+          <span style='padding-left:10px;'>合计支出:{{expend}}</span>
+          <span style='padding-left:10px;'>付款中:{{nograinexpend}}</span>
+          
+      </template>
+      <template slot="right">
+        <!-- <ws-button type="primary" @click="handleAdd()"
+          v-hasPermission="`contractManagement.buyContract.buyContractInfo.add`">运费</ws-button> -->
+          <ws-button type="primary" @click="handleAdd(2)"
+          v-hasPermission="`contractManagement.nonContract.nonContractInfo.add`">请款</ws-button>
+          <ws-button type="primary" @click="handleAdd(1)"
+          v-hasPermission="`contractManagement.nonContract.nonContractInfo.add`">收款</ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <el-table class="wenzi" :data="costList.records" style="width: 100%; margin-top: 10px"
+      height="calc(100% - 105px)">
+      <el-table-column type="index" label="序号">
+        <template scope="scope">
+          <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+          <span v-else>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="type" label="类型" width="150">
+        <template slot-scope="scope">
+          <span v-if='scope.row.type==1&&scope.row.costType==1'>收入(粮)</span>
+          <span v-if='scope.row.type==1&&scope.row.costType!=1'>收入</span>
+          <span v-if='scope.row.type==2&&scope.row.costType==1'>支出(粮)</span>
+          <span v-if='scope.row.type==2&&scope.row.costType!=1'>支出</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="costName" label="款项名称" width="80">
+      </el-table-column>
+      <!-- <el-table-column prop="grade" label="品级" width="80">
+        <template slot-scope="scope">
+          <span v-if="scope.row.grade == '一等品'" class="top-grade">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '二等品'" class="second-class">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '三等品'" class="third-class">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '等外'" class="substandard">{{
+            scope.row.grade
+          }}</span>
+        </template>
+      </el-table-column> -->
+      <el-table-column width='130' prop="costPrice" label="款项金额(元)">
+      </el-table-column>
+
+      <el-table-column prop="addressUrl" label="附件">
+        <template slot-scope="scope">
+          <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
+          <span v-if="scope.row.addressUrlArray != null">
+            {{
+              scope.row.addressUrlArray.length == 0
+                ? ''
+                : scope.row.addressUrlArray.length
+            }}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column width='130' prop="personName" label="请款人/收款人">
+      </el-table-column>
+      <el-table-column width='130' prop="payee" label="回款方">
+      </el-table-column>
+      <el-table-column width='130' prop="payDeadline" label="支付日期">
+      </el-table-column>
+      <el-table-column width='130' prop="createDate" label="录入日期">
+      </el-table-column>
+      <el-table-column width='130' prop="status" label="状态">
+         <template slot-scope="scope">
+           <span v-if='scope.row.approveStatus'>{{scope.row.approveStatus}}</span><span v-else>{{scope.row.status}}</span>
+           <i @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
+        </template>
+      </el-table-column>
+      <el-table-column prop="address" label="操作" width="360">
+        <template slot-scope="scope">
+          <div v-if='scope.row.type==2'>
+            <div style='display:inline-block;' v-if='scope.row.taskId'>
+              <ws-button type="primary" @click="handleaudit(scope.row)">审核</ws-button>
+            </div>
+             <div style='display:inline-block;' v-if='scope.row.status=="未付款"'>
+                <ws-button type="primary" @click="handlepayment(scope.row)"
+            v-hasPermission="`contractManagement.nonContract.nonContractInfo.status`">付款</ws-button>
+             </div>
+            <div style='display:inline-block;' v-if='scope.row.personName==staffName'>
+            <ws-button type="primary" @click="handleedit(scope.row)"
+            v-hasPermission="`contractManagement.nonContract.nonContractInfo.edit`">编辑</ws-button>
+            </div>
+            <div style='display:inline-block;' v-if='scope.row.status=="已驳回"&&scope.row.personName==staffName'>
+              <ws-button type="danger" @click="handleDelete(scope.row)" v-hasPermission="`contractManagement.nonContract.nonContractInfo.delete`">删除</ws-button>
+            </div>
+           
+          </div>
+          
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+      :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
+    </el-pagination>
+
+    <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')">
+      <div v-if='appendixIdss.length>0'>
+        <img style='border:1px solid #ccc;' v-for='item in appendixIdss' :src="item" alt="">
+      </div>
+      
+    </WinseaContentModal>
+    <el-dialog width='50%' :visible.sync="dialogVisible" :title="title" >
+      <el-form style='width:50%;margin:0 auto;text-align:center;' ref="form" :model="deptBudgetList" label-width="130px">
+        <el-form-item v-if='status==1||status==2||status==5' label="类型">
+          <el-radio-group v-model="costType">
+            <el-radio :label="1">粮款</el-radio>
+            <el-radio :label="2">非粮款</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item v-else label="类型">
+          <ws-select :disabled="disabled" v-model="costType" placeholder="" class="typeselect"
+          :value="costType">
+          <ws-option  key="1" label="粮款" value="1" style="color: #8890b1" />
+          <ws-option  key="2" label="非粮款" value="2" style="color: #8890b1" />
+        </ws-select>
+        </el-form-item>
+        <el-form-item label="款项名称">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costName"></el-input>
+        </el-form-item>
+        <!-- <el-form-item label="费用名称">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costName"></el-input>
+        </el-form-item> -->
+        <el-form-item label="金额(元)">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costPrice"></el-input>
+        </el-form-item>
+        <el-form-item v-if='status==1||currectcost.type==1' label="回款方">
+          <el-input :disabled='disabled' v-model="deptBudgetList.payee"></el-input>
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input :disabled='disabled' type="textarea" v-model="deptBudgetList.remark"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="附件">
+          <el-upload ref='uploadfiles' :file-list='dataList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item v-if='status==3' label="审核意见">
+          <el-input type="textarea" v-model="auditMind"></el-input>
+        </el-form-item>
+        <el-form-item v-if='status==1' label="收款日期">
+          <ws-date-picker v-model="deptBudgetList.payDeadline" type="date" placeholder="请选择收款日期"
+              value-format="yyyy-MM-dd" />
+        </el-form-item>
+        <el-form-item v-if='status==4' label="付款日期">
+          <ws-date-picker v-model="deptBudgetList.payDeadline" type="date" placeholder="请选择付款日期"
+              value-format="yyyy-MM-dd" />
+        </el-form-item>
+      </el-form>
+      <div v-if='status==1||status==2||status==4||status==5'>
+        <el-button @click='dialogVisible=false'>取消</el-button>
+        <el-button @click='confirm' type="primary">提交</el-button>
+      </div>
+      <div v-if='status==3'>
+        <el-button @click='cancel'>驳回</el-button>
+        <el-button @click='confirm' type="primary">通过</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog width='50%' :visible.sync="dialogVisible1" title="审核记录" >
+      <div v-for="item in recordList">
+        <div style='width:100%;justify-content: space-between;' class='flex'>
+          <div>{{item.operateUser}}</div>
+          <div>{{item.dealMsg}}</div>
+          <div>{{item.createDate}}</div>
+        </div>
+        <div style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import {
+    contractcost,
+    getcontract,
+    addcontractcost,
+    editcontractcost,
+    delcontractcost,
+    payment,
+    billoperatehis
+    // export1,
+    // editstatus,
+    // billoperatehis,
+    // deletecontract,
+    // editInfo,
+  } from '@/model/contarct/index'
+  import {
+    woekflowhandle,gettaskhistories
+  } from '@/model/tasksport/index'
+  import {
+    downloadFile
+  } from '@/utils/batchDown'
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    dayjs,
+    EventBus
+  } from 'base-core-lib'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      vesselId(val) {
+        this.getList()
+      },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        id: '',
+        // 船舶类型
+        monetaryKey: null,
+        // 表格显示数据
+        tableDate: [],
+        size: 10,
+        // 是否显示
+        showType: true,
+        // 年
+        year: '',
+        title:'',
+        costType:1,
+        seller:'',
+        deptBudgetTotal: 0,
+        currentPage: 1,
+        recordList:[],
+        pageSize: 9999,
+        searchType: 1,
+        dialogVisible1:false,
+        type:'',
+        searchTypeText: '',
+        searchKeyWord: '',
+        contractType: 2,
+        dataList:[],
+        startDate: null,
+        endDate: null,
+        addressUrls: [],
+        costList:{},
+        currectcost:{},
+        dialogVisible:false,
+        contractId:0,
+        status:'',
+        contractNo:'',
+        disabled:false,
+        // 提交类型
+        submitType: true,
+        auditMind:'',
+        grain:0,
+        income:0,
+        expend:0,
+        nograinexpend:0,
+        staffName:localStorage.getItem('ws-pf_staffName'),
+        paymentScreenshot:[],
+        deptCircularPage: {},
+        date: {
+          year: dayjs().format('YYYY'),
+          month: dayjs().format('MM'),
+        },
+        contractList: [],
+        deptBudgetList: {},
+        historyList: [],
+        appendixIdss: [],
+        compId: localStorage.getItem('ws-pf_compId'),
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        accessoryTFs: false,
+        value1: '',
+        value2: '',
+      }
+    },
+    activated() {
+      //cg.viewBudget
+      //cg.viewSpareMoney
+      // this.getVesselData();
+            this.contractId=this.$route.query.id
+            this.contractNo=this.$route.query.contractNo
+            this.searchTypeText=this.$route.query.contractNo+'('+this.$route.query.status+')'
+            this.seller=this.$route.query.seller
+      getcontract({flag:0}).toPromise()
+          .then((response) => {
+            this.contractList=response
+            // this.contractId=response[0].id
+            // this.contractNo=response[0].contractNo
+            // this.searchTypeText=response[0].contractNo
+            // this.seller=response[0].seller
+            this.getList()
+          })
+      
+      this.showType = this.isShow
+    },
+    methods: {
+      handlestatus(status){
+        this.type=status
+        this.getList()
+      },
+      handleedit(row){
+        if(row.type==1){
+          this.title='收款'
+        }else{
+          this.title='请款'
+        }
+        this.status=5
+        this.deptBudgetList=row
+        this.costType=row.costType
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.currectcost=row
+        this.dialogVisible=true
+      },
+      handlerecord(row){
+        billoperatehis({id: row.id}).toPromise()
+                .then((response) => {
+                  this.recordList=response
+                  this.dialogVisible1=true
+                }).catch((response) => {})
+        
+      },
+      handleaudit(row){
+        console.log(row)
+        this.status=3
+        this.costType=row.costType
+        this.deptBudgetList=row
+        this.currectcost=row
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.disabled=true
+        this.dialogVisible=true
+      },
+      handlepayment(row){
+        this.status=4
+        this.costType=row.costType
+        this.currectcost=row
+        this.disabled=true
+        this.deptBudgetList=row
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.dialogVisible=true
+      },
+      handlefujian(file) {
+        // console.log(file)
+        this.paymentScreenshot.push(file.url)
+        // this.dialogVisible = true
+      },
+      handleRemove(file) {
+        // console.log(file)
+        for (let i = 0; i < this.paymentScreenshot.length; i++) {
+          if(this.paymentScreenshot[i]==response.url){
+            this.paymentScreenshot.splice(i, 1)
+          }
+          
+        }
+      },
+       handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      selectcontract(e){
+        for (let i = 0; i < this.contractList.length; i++) {
+          if(this.contractList[i].contractNo==e){
+            this.contractId=this.contractList[i].id
+            this.contractNo=this.contractList[i].contractNo
+            this.searchTypeText=this.contractList[i].contractNo
+            this.seller=this.contractList[i].seller
+            this.getList()
+          }
+          
+        }
+      },
+      cancel(){
+        woekflowhandle({taskId: this.currectcost.taskId,
+                approved: false,
+                auditMind: this.auditMind,
+                needReapply: false,})
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '驳回成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+      },
+      confirm(){
+        // addcontractcost()
+         var text = ''
+        if(this.status == 2||this.status == 1){
+          if(!this.deptBudgetList.costName){
+            this.$message({
+              message: '款项名称不能为空',
+              type: 'warning',
+            })
+            return
+          }
+          if(!this.deptBudgetList.costPrice){
+            this.$message({
+              message: '金额不能为空',
+              type: 'warning',
+            })
+            return
+          }
+          if(this.deptBudgetList.costName.length<1||this.deptBudgetList.costName.length>15){
+            this.$message({
+              message: '费用名称输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if(this.deptBudgetList.costPrice<0.01||this.deptBudgetList.costPrice>100000000){
+            this.$message({
+              message: '费用名称输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if(String(this.deptBudgetList.costPrice).indexOf(".")!=-1){
+            if(String(this.deptBudgetList.costPrice).substring(String(this.deptBudgetList.costPrice).indexOf(".")+1,this.deptBudgetList.costPrice.length)>2){
+              this.$message({
+                message: '费用名称输入错误',
+                type: 'warning',
+              })
+              return
+            }
+          }
+          if(this.deptBudgetList.remark&&this.deptBudgetList.remark.length<0||this.deptBudgetList.remark&&this.deptBudgetList.remark.length>50){
+            this.$message({
+              message: '备注不超过50字',
+              type: 'warning',
+            })
+            return
+          }
+        }
+        if(this.status == 1){
+          if(this.paymentScreenshot.length==0){
+            this.$message({
+              message: '附件不能为空',
+              type: 'warning',
+            })
+            return
+          }
+        }
+        if (this.status == 2||this.status == 5&&this.currectcost.type==2) {
+          text =
+            '确认提交请款信息?'
+        } else if(this.status == 1) {
+          text = '确认提交收款信息?'
+        } else if(this.status == 3&&this.currectcost.type==2) {
+          text = '确认通过请款信息?'
+        }else if(this.status == 4) {
+          text = '确认提交付款信息?'
+        }
+        this.$confirm(text, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            this.deptBudgetList.contractId=this.contractId
+              this.deptBudgetList.contractNo=this.contractNo
+              this.deptBudgetList.contractType=this.contractType
+              this.deptBudgetList.costType=this.costType
+              this.deptBudgetList.compId=this.compId
+              this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
+              this.deptBudgetList.personName=localStorage.getItem('ws-pf_staffName')
+            if(this.status==1||this.status==2){
+              this.deptBudgetList.type=this.status
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              addcontractcost(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '提交成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==5){
+              this.deptBudgetList.type=this.currectcost.type
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              editcontractcost(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '编辑成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==3){
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              woekflowhandle({taskId: this.currectcost.taskId,
+                approved: true,
+                auditMind: this.auditMind,
+                needReapply: false,})
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '通过成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==4){
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              payment(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '付款成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }
+            
+          })
+          .catch(() => {
+            return false
+          })
+      },
+      handleAdd(status){
+        this.status=status
+        if(status==1){
+          this.title='收款'
+        }else if(status==2){
+          this.title='请款'
+        }
+        this.dialogVisible=true
+      },
+      onChange() {
+        this.$refs.upload
+          .handleSaveBill()
+          .then(async (response) => {
+            this.deptBudgetList.addressUrl = response
+            this.deptBudgetList.id = this.id
+            this.deptBudgetList.flag = 1
+            editInfo(this.deptBudgetList)
+              .toPromise()
+              .then((response) => {
+                this.accessoryTFs = false
+                this.$message.success('上传成功')
+                this.getList()
+              })
+          })
+          .catch((res) => {
+            EventBus.$emit('error', (JSON.parse(res) || {}).message)
+            this.$refs.upload.clearFiles()
+          })
+      },
+      getList() {
+        contractcost({
+            compId: localStorage.getItem('ws-pf_compId'),
+            contractType: this.contractType,
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            contractId:this.contractId,
+            contractNo:this.contractNo,
+            searchType:this.type
+          })
+          .toPromise()
+          .then((response) => {
+            var income=0,expend=0,grainincome=0,grainexpend=0,nograinexpend=0
+            this.costList=response
+            for (var i = 0; i < response.records.length; i++) {
+              if(response.records[i].addressUrl){
+                response.records[i].addressUrlArray=response.records[i].addressUrl.split(',')
+              }
+              // 收入
+              if(response.records[i].type==1){
+                income+=response.records[i].costPrice
+                if(response.records[i].costType==1){
+                  grainincome+=response.records[i].costPrice
+                }
+              }
+              // 支出
+              if(response.records[i].type==2){
+                expend+=response.records[i].costPrice
+                if(response.records[i].costType==1&&response.records[i].status=='已付款'){
+                  grainexpend+=response.records[i].costPrice
+                }else{
+                  nograinexpend+=response.records[i].costPrice
+                }
+              }
+            }
+            console.log(grainexpend,grainincome)
+            this.income=income.toFixed(2)
+            this.expend=expend.toFixed(2)
+            this.grain=(grainexpend-grainincome).toFixed(2)
+            this.nograinexpend=nograinexpend.toFixed(2)
+            // this.deptCircularPage.currentPage = response.current
+            // this.deptCircularPage.pageSize = response.size
+            // this.deptBudgetTotal = response.total
+            // this.contractList = response
+            // for (var i = 0; i < response.records.length; i++) {
+            //   var arr = new Array()
+            //   this.addressUrls[i] = new Array()
+            //   if (this.contractList.records[i].addressUrl != null) {
+            //     arr = this.contractList.records[i].addressUrl.split(',')
+            //     this.addressUrls[i] = arr
+            //   }
+            // }
+          })
+      },
+    
+      fujian(row) {
+        this.id = row.id
+        this.accessoryTFs = true
+        this.appendixIdss = row.addressUrlArray
+        console.log(this.appendixIdss)
+      },
+      handleExamine(row) {
+        console.log(row)
+        this.$router.push({
+          name: 'purchaseContractExamine',
+          query: {
+            id: row.id,
+            status: row.status,
+          },
+        })
+      },
+      handleEdit(row) {
+        this.$router.push({
+          name: 'purchaseContractEdit',
+          query: {
+            id: row.id,
+          },
+        })
+      },
+      // 关闭 dialog时 处理文件url 初始化upload组件
+      history(row) {
+        console.log(row)
+        billoperatehis({
+            id: row.id,
+          })
+          .toPromise()
+          .then((response) => {
+            this.historyList = response
+          })
+      },
+      find() {
+        if (this.value2) {
+          this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
+          this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
+        } else {
+          this.startDate = ''
+          this.endDate = ''
+        }
+        this.currentPage = 1
+        this.getList()
+      },
+      async exportlist() {
+        const {
+          data
+        } = await export1({
+          compId: localStorage.getItem('ws-pf_compId'),
+          contractType: this.contractType,
+          goodsType: this.goodsType,
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          searchType: this.searchType,
+          searchKeyWord: this.searchKeyWord,
+          startDate: this.startDate,
+          endDate: this.endDate,
+        }, {}, {
+          responseType: 'blob',
+        }).toPromise()
+        downloadFile({
+          res: data,
+          fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }_采购合同`,
+          type: 'xls',
+        })
+      },
+      // deletecontract(){},
+      //删除
+      handleDelete(row) {
+        var text = ''
+        if (row.type == 1) {
+          text =
+            '确认删除收款信息?'
+        } else {
+          text = '确认删除请款信息?'
+        }
+        this.$confirm(text, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            delcontractcost({
+                id: row.id,
+              })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '删除成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {})
+          })
+          .catch(() => {
+            return false
+          })
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+ /deep/.base_header_layout .grid-content{
+   height:36px;
+ }
+</style>

+ 21 - 2
src/views/contractManagement/salesContract.vue

@@ -161,8 +161,15 @@
           <!-- <i @click="fujian(scope.row)" class="el-icon-paperclip iconCss"></i> -->
           <!-- <i @click="fujian(scope.row)" class="el-icon-paperclip iconCss"></i> -->
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="address" label="操作" width="140">
+      <el-table-column prop="address" label="操作" width="160">
         <template slot-scope="scope">
         <template slot-scope="scope">
+          <img width="16" height="17" style="
+                vertical-align: text-top;
+                position: relative;
+                top: -1px;
+                margin: 0 6px;
+              "  src="../../../public/img/daichu.png"
+             @click="handlecost(scope.row)" alt="" />
           <img width="16" height="16" style="vertical-align: text-top; margin: 0 6px"
           <img width="16" height="16" style="vertical-align: text-top; margin: 0 6px"
             src="../../../public/img/chakan.png" @click="handleExamine(scope.row)" v-hasPermission="
             src="../../../public/img/chakan.png" @click="handleExamine(scope.row)" v-hasPermission="
               `contractManagement.salesContract.salesContractInfo.view`
               `contractManagement.salesContract.salesContractInfo.view`
@@ -189,7 +196,7 @@
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+    <el-pagination :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
       :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
       :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
     </el-pagination>
     </el-pagination>
     <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
     <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
@@ -361,6 +368,18 @@
       this.showType = this.isShow
       this.showType = this.isShow
     },
     },
     methods: {
     methods: {
+      
+      handlecost(row){
+         this.$router.push({
+          name: 'salesContractcost',
+          query: {
+            id: row.id,
+            contractNo: row.contractNo,
+            status:row.status,
+            buger:row.buger
+          },
+        })
+      },
       selectstatuschange(e,row){
       selectstatuschange(e,row){
         var data={}
         var data={}
         if(e=='发运结束'){
         if(e=='发运结束'){

+ 797 - 0
src/views/contractManagement/salesContractCost.vue

@@ -0,0 +1,797 @@
+<!--现货销售合同费用-->
+<!--2019年5月30日 20:25:16 by jlx-->
+<template>
+  <div>
+    <BaseHeaderLayout :leftSpan="8">
+      <template slot="left">
+          <el-select style='width:200px;'  filterable v-model="searchTypeText" placeholder="" class="typeselect" @change="selectcontract"
+          :value="searchType">
+          <el-option v-for="item in contractList" :key="item.id" :label="item.contractNo+'('+item.status+')'" :value="item.contractNo"
+            style="color: #8890b1" />
+        </el-select>
+        <span style='padding-left:10px;'>买方:{{buger}}</span>
+      </template>
+      <template slot="right">
+      </template>
+    </BaseHeaderLayout>
+    <BaseHeaderLayout :leftSpan="16">
+      <template slot="left">
+        <ws-button :type="type==''?'primary':''" @click="handlestatus('')">全部</ws-button>
+          <ws-button :type="type=='1'?'primary':''" @click="handlestatus(1)">收入</ws-button>
+          <ws-button :type="type=='2'?'primary':''" @click="handlestatus(2)">支出</ws-button>
+          <span style='padding-left:10px;'>粮款:{{grain}}</span>
+          <span style='padding-left:10px;'>合计收入:{{income}}</span>
+          <span style='padding-left:10px;'>合计支出:{{expend}}</span>
+          <span style='padding-left:10px;'>付款中:{{nograinexpend}}</span>
+          
+      </template>
+      <template slot="right">
+        <!-- <ws-button type="primary" @click="handleAdd()"
+          v-hasPermission="`contractManagement.buyContract.buyContractInfo.add`">运费</ws-button> -->
+          <ws-button type="primary" @click="handleAdd(2)"
+          v-hasPermission="`contractManagement.nonContract.nonContractInfo.add`">请款</ws-button>
+          <ws-button type="primary" @click="handleAdd(1)"
+          v-hasPermission="`contractManagement.nonContract.nonContractInfo.add`">收款</ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <el-table class="wenzi" :data="costList.records" style="width: 100%; margin-top: 10px"
+      height="calc(100% - 105px)">
+      <el-table-column type="index" label="序号">
+        <template scope="scope">
+          <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+          <span v-else>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="type" label="类型" width="150">
+        <template slot-scope="scope">
+          <span v-if='scope.row.type==1&&scope.row.costType==1'>收入(粮)</span>
+          <span v-if='scope.row.type==1&&scope.row.costType!=1'>收入</span>
+          <span v-if='scope.row.type==2&&scope.row.costType==1'>支出(粮)</span>
+          <span v-if='scope.row.type==2&&scope.row.costType!=1'>支出</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="costName" label="款项名称" width="80">
+      </el-table-column>
+      <!-- <el-table-column prop="grade" label="品级" width="80">
+        <template slot-scope="scope">
+          <span v-if="scope.row.grade == '一等品'" class="top-grade">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '二等品'" class="second-class">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '三等品'" class="third-class">{{
+            scope.row.grade
+          }}</span>
+          <span v-if="scope.row.grade == '等外'" class="substandard">{{
+            scope.row.grade
+          }}</span>
+        </template>
+      </el-table-column> -->
+      <el-table-column width='130' prop="costPrice" label="款项金额(元)">
+      </el-table-column>
+      <el-table-column prop="addressUrl" label="附件">
+        <template slot-scope="scope">
+          <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
+          <span v-if="scope.row.addressUrlArray != null">
+            {{
+              scope.row.addressUrlArray.length == 0
+                ? ''
+                : scope.row.addressUrlArray.length
+            }}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column width='130' prop="personName" label="请款人/收款人">
+      </el-table-column>
+      <el-table-column width='130' prop="payee" label="回款方">
+      </el-table-column>
+      <el-table-column width='130' prop="payDeadline" label="支付日期">
+      </el-table-column>
+      <el-table-column width='130' prop="createDate" label="录入日期">
+      </el-table-column>
+      <el-table-column width='130' prop="status" label="状态">
+         <template slot-scope="scope">
+           <span v-if='scope.row.approveStatus'>{{scope.row.approveStatus}}</span><span v-else>{{scope.row.status}}</span>
+           <i @click="handlerecord(scope.row)" class="el-icon-s-claim"></i>
+        </template>
+      </el-table-column>
+      <el-table-column prop="address" label="操作" width="360">
+        <template slot-scope="scope">
+          <div v-if='scope.row.type==2'>
+            <div style='display:inline-block;' v-if='scope.row.taskId'>
+              <ws-button type="primary" @click="handleaudit(scope.row)">审核</ws-button>
+            </div>
+             <div style='display:inline-block;' v-if='scope.row.status=="未付款"'>
+                <ws-button type="primary" @click="handlepayment(scope.row)"
+            v-hasPermission="`contractManagement.nonContract.nonContractInfo.status`">付款</ws-button>
+             </div>
+            <div style='display:inline-block;' v-if='scope.row.personName==staffName'>
+            <ws-button type="primary" @click="handleedit(scope.row)"
+            v-hasPermission="`contractManagement.nonContract.nonContractInfo.edit`">编辑</ws-button>
+            </div>
+            <div style='display:inline-block;' v-if='scope.row.status=="已驳回"&&scope.row.personName==staffName'>
+              <ws-button type="danger" @click="handleDelete(scope.row)" v-hasPermission="`contractManagement.nonContract.nonContractInfo.delete`">删除</ws-button>
+            </div>
+           
+          </div>
+          
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+      :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
+    </el-pagination>
+
+    <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')">
+      <div v-if='appendixIdss.length>0'>
+        <img style='border:1px solid #ccc;' v-for='item in appendixIdss' :src="item" alt="">
+      </div>
+      
+    </WinseaContentModal>
+    <el-dialog width='50%' :visible.sync="dialogVisible" :title="title" >
+      <el-form style='width:50%;margin:0 auto;text-align:center;' ref="form" :model="deptBudgetList" label-width="130px">
+        <el-form-item v-if='status==1||status==2||status==5' label="类型">
+          <el-radio-group v-model="costType">
+            <el-radio :label="1">粮款</el-radio>
+            <el-radio :label="2">非粮款</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item v-else label="类型">
+          <ws-select :disabled="disabled" v-model="costType" placeholder="" class="typeselect"
+          :value="costType">
+          <ws-option  key="1" label="粮款" value="1" style="color: #8890b1" />
+          <ws-option  key="2" label="非粮款" value="2" style="color: #8890b1" />
+        </ws-select>
+        </el-form-item>
+        <el-form-item label="款项名称">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costName"></el-input>
+        </el-form-item>
+        <!-- <el-form-item label="费用名称">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costName"></el-input>
+        </el-form-item> -->
+        <el-form-item label="金额(元)">
+          <el-input :disabled='disabled' v-model="deptBudgetList.costPrice"></el-input>
+        </el-form-item>
+        <el-form-item v-if='status==1||currectcost.type==1' label="回款方">
+          <el-input :disabled='disabled' v-model="deptBudgetList.payee"></el-input>
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input :disabled='disabled' type="textarea" v-model="deptBudgetList.remark"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="附件">
+          <el-upload ref='uploadfiles' :file-list='dataList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+            :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item v-if='status==3' label="审核意见">
+          <el-input type="textarea" v-model="auditMind"></el-input>
+        </el-form-item>
+        <el-form-item v-if='status==1' label="收款日期">
+          <ws-date-picker v-model="deptBudgetList.payDeadline" type="date" placeholder="请选择收款日期"
+              value-format="yyyy-MM-dd" />
+        </el-form-item>
+        <el-form-item v-if='status==4' label="付款日期">
+          <ws-date-picker v-model="deptBudgetList.payDeadline" type="date" placeholder="请选择付款日期"
+              value-format="yyyy-MM-dd" />
+        </el-form-item>
+      </el-form>
+      <div v-if='status==1||status==2||status==4||status==5'>
+        <el-button @click='dialogVisible=false'>取消</el-button>
+        <el-button @click='confirm' type="primary">提交</el-button>
+      </div>
+      <div v-if='status==3'>
+        <el-button @click='cancel'>驳回</el-button>
+        <el-button @click='confirm' type="primary">通过</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog width='50%' :visible.sync="dialogVisible1" title="审核记录" >
+      <div v-for="item in recordList">
+        <div style='width:100%;justify-content: space-between;' class='flex'>
+          <div>{{item.operateUser}}</div>
+          <div>{{item.dealMsg}}</div>
+          <div>{{item.createDate}}</div>
+        </div>
+        <div style='width:100%;text-align:center;'>{{item.verifyRemark}}</div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import {
+    contractcost,
+    getcontract,
+    addcontractcost,
+    editcontractcost,
+    delcontractcost,
+    payment,
+    billoperatehis
+    // export1,
+    // editstatus,
+    // billoperatehis,
+    // deletecontract,
+    // editInfo,
+  } from '@/model/contarct/index'
+  import {
+    woekflowhandle,gettaskhistories
+  } from '@/model/tasksport/index'
+  import {
+    downloadFile
+  } from '@/utils/batchDown'
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    dayjs,
+    EventBus
+  } from 'base-core-lib'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      vesselId(val) {
+        this.getList()
+      },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        id: '',
+        // 船舶类型
+        monetaryKey: null,
+        // 表格显示数据
+        tableDate: [],
+        size: 10,
+        // 是否显示
+        showType: true,
+        // 年
+        year: '',
+        title:'',
+        costType:1,
+        buger:'',
+        deptBudgetTotal: 0,
+        currentPage: 1,
+        recordList:[],
+        pageSize: 9999,
+        searchType: 1,
+        dialogVisible1:false,
+        type:'',
+        searchTypeText: '',
+        searchKeyWord: '',
+        contractType: 1,
+        dataList:[],
+        startDate: null,
+        endDate: null,
+        addressUrls: [],
+        costList:{},
+        currectcost:{},
+        dialogVisible:false,
+        contractId:0,
+        status:'',
+        contractNo:'',
+        disabled:false,
+        // 提交类型
+        submitType: true,
+        auditMind:'',
+        grain:0,
+        income:0,
+        expend:0,
+        nograinexpend:0,
+        staffName:localStorage.getItem('ws-pf_staffName'),
+        paymentScreenshot:[],
+        deptCircularPage: {},
+        date: {
+          year: dayjs().format('YYYY'),
+          month: dayjs().format('MM'),
+        },
+        contractList: [],
+        deptBudgetList: {},
+        historyList: [],
+        appendixIdss: [],
+        compId: localStorage.getItem('ws-pf_compId'),
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        accessoryTFs: false,
+        value1: '',
+        value2: '',
+      }
+    },
+    activated() {
+      //cg.viewBudget
+      //cg.viewSpareMoney
+      // this.getVesselData();
+            this.contractId=this.$route.query.id
+            this.contractNo=this.$route.query.contractNo
+            this.searchTypeText=this.$route.query.contractNo+'('+this.$route.query.status+')'
+            this.buger=this.$route.query.buger
+      getcontract({flag:0}).toPromise()
+          .then((response) => {
+            this.contractList=response
+            // this.contractId=response[0].id
+            // this.contractNo=response[0].contractNo
+            // this.searchTypeText=response[0].contractNo
+            // this.seller=response[0].seller
+            this.getList()
+          })
+      
+      this.showType = this.isShow
+    },
+    methods: {
+      handlestatus(status){
+        this.type=status
+        this.getList()
+      },
+      handleedit(row){
+        if(row.type==1){
+          this.title='收款'
+        }else{
+          this.title='请款'
+        }
+        this.status=5
+        this.deptBudgetList=row
+        this.costType=row.costType
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.currectcost=row
+        this.dialogVisible=true
+      },
+      handlerecord(row){
+        gettaskhistories({ businessKey: row.id,
+            workflowId: row.workflowId}).toPromise()
+                .then((response) => {
+                  this.recordList=response
+                  this.dialogVisible1=true
+                }).catch((response) => {})
+        
+      },
+      handleaudit(row){
+        console.log(row)
+        this.status=3
+        this.costType=row.costType
+        this.deptBudgetList=row
+        this.currectcost=row
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.disabled=true
+        this.dialogVisible=true
+      },
+      handlepayment(row){
+        this.status=4
+        this.costType=row.costType
+        this.currectcost=row
+        this.disabled=true
+        this.deptBudgetList=row
+        if(row.addressUrl){
+          this.dataList=[]
+          this.paymentScreenshot=row.addressUrl.split(',')
+          for (let i = 0; i < this.paymentScreenshot.length; i++) {
+            this.dataList.push({url:this.paymentScreenshot[i]})
+            
+          }
+        }
+        this.dialogVisible=true
+      },
+      handlefujian(file) {
+        // console.log(file)
+        this.paymentScreenshot.push(file.url)
+        // this.dialogVisible = true
+      },
+      handleRemove(file) {
+        // console.log(file)
+        for (let i = 0; i < this.paymentScreenshot.length; i++) {
+          if(this.paymentScreenshot[i]==response.url){
+            this.paymentScreenshot.splice(i, 1)
+          }
+          
+        }
+      },
+       handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      selectcontract(e){
+        for (let i = 0; i < this.contractList.length; i++) {
+          if(this.contractList[i].contractNo==e){
+            this.contractId=this.contractList[i].id
+            this.contractNo=this.contractList[i].contractNo
+            this.searchTypeText=this.contractList[i].contractNo
+            this.buger=this.contractList[i].buger
+            this.getList()
+          }
+          
+        }
+      },
+      cancel(){
+        woekflowhandle({taskId: this.currectcost.taskId,
+                approved: false,
+                auditMind: this.auditMind,
+                needReapply: false,})
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '驳回成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+      },
+      confirm(){
+        // addcontractcost()
+         var text = ''
+        if(this.status == 2||this.status == 1){
+          if(!this.deptBudgetList.costName){
+            this.$message({
+              message: '款项名称不能为空',
+              type: 'warning',
+            })
+            return
+          }
+          if(!this.deptBudgetList.costPrice){
+            this.$message({
+              message: '金额不能为空',
+              type: 'warning',
+            })
+            return
+          }
+          if(this.deptBudgetList.costName.length<1||this.deptBudgetList.costName.length>15){
+            this.$message({
+              message: '费用名称输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if(this.deptBudgetList.costPrice<0.01||this.deptBudgetList.costPrice>100000000){
+            this.$message({
+              message: '费用名称输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if(String(this.deptBudgetList.costPrice).indexOf(".")!=-1){
+            if(String(this.deptBudgetList.costPrice).substring(String(this.deptBudgetList.costPrice).indexOf(".")+1,this.deptBudgetList.costPrice.length)>2){
+              this.$message({
+                message: '费用名称输入错误',
+                type: 'warning',
+              })
+              return
+            }
+          }
+          if(this.deptBudgetList.remark&&this.deptBudgetList.remark.length<0||this.deptBudgetList.remark&&this.deptBudgetList.remark.length>50){
+            this.$message({
+              message: '备注不超过50字',
+              type: 'warning',
+            })
+            return
+          }
+        }
+        if(this.status == 1){
+          if(this.paymentScreenshot.length==0){
+            this.$message({
+              message: '附件不能为空',
+              type: 'warning',
+            })
+            return
+          }
+        }
+        if (this.status == 2||this.status == 5&&this.currectcost.type==2) {
+          text =
+            '确认提交请款信息?'
+        } else if(this.status == 1) {
+          text = '确认提交收款信息?'
+        } else if(this.status == 3&&this.currectcost.type==2) {
+          text = '确认通过请款信息?'
+        }else if(this.status == 4) {
+          text = '确认提交付款信息?'
+        }
+        this.$confirm(text, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            this.deptBudgetList.contractId=this.contractId
+              this.deptBudgetList.contractNo=this.contractNo
+              this.deptBudgetList.contractType=this.contractType
+              this.deptBudgetList.costType=this.costType
+              this.deptBudgetList.compId=this.compId
+              this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
+              this.deptBudgetList.personName=localStorage.getItem('ws-pf_staffName')
+            if(this.status==1||this.status==2){
+              this.deptBudgetList.type=this.status
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              addcontractcost(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '提交成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==5){
+              this.deptBudgetList.type=this.currectcost.type
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              editcontractcost(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '编辑成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==3){
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              woekflowhandle({taskId: this.currectcost.taskId,
+                approved: true,
+                auditMind: this.auditMind,
+                needReapply: false,})
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '通过成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }else if(this.status==4){
+              // this.deptBudgetList.personName=localStorage.getItem('ws-pf_roleName')+localStorage.getItem('ws-pf_staffName')
+              payment(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$notify.success({
+                    title: '成功',
+                    message: '付款成功',
+                  })
+                  this.dialogVisible=false
+                  this.deptBudgetList={}
+                  this.paymentScreenshot=[]
+                  this.$refs.uploadfiles.clearFiles()
+                  this.getList()
+                }).catch((response) => {})
+            }
+            
+          })
+          .catch(() => {
+            return false
+          })
+      },
+      handleAdd(status){
+        this.status=status
+        if(status==1){
+          this.title='收款'
+        }else if(status==2){
+          this.title='请款'
+        }
+        this.dialogVisible=true
+      },
+      onChange() {
+        this.$refs.upload
+          .handleSaveBill()
+          .then(async (response) => {
+            this.deptBudgetList.addressUrl = response
+            this.deptBudgetList.id = this.id
+            this.deptBudgetList.flag = 1
+            editInfo(this.deptBudgetList)
+              .toPromise()
+              .then((response) => {
+                this.accessoryTFs = false
+                this.$message.success('上传成功')
+                this.getList()
+              })
+          })
+          .catch((res) => {
+            EventBus.$emit('error', (JSON.parse(res) || {}).message)
+            this.$refs.upload.clearFiles()
+          })
+      },
+      getList() {
+        contractcost({
+            compId: localStorage.getItem('ws-pf_compId'),
+            contractType: this.contractType,
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            contractId:this.contractId,
+            contractNo:this.contractNo,
+            searchType:this.type
+          })
+          .toPromise()
+          .then((response) => {
+            var income=0,expend=0,grainincome=0,grainexpend=0,nograinexpend=0
+            this.costList=response
+            for (var i = 0; i < response.records.length; i++) {
+              if(response.records[i].addressUrl){
+                response.records[i].addressUrlArray=response.records[i].addressUrl.split(',')
+              }
+              // 收入
+              if(response.records[i].type==1){
+                income+=response.records[i].costPrice
+                if(response.records[i].costType==1){
+                  grainincome+=response.records[i].costPrice
+                }
+              }
+              // 支出
+              if(response.records[i].type==2){
+                expend+=response.records[i].costPrice
+                if(response.records[i].costType==1&&response.records[i].status=='已付款'){
+                  grainexpend+=response.records[i].costPrice
+                }else{
+                  nograinexpend+=response.records[i].costPrice
+                }
+              }
+            }
+            console.log(grainexpend,grainincome)
+            this.income=income.toFixed(2)
+            this.expend=expend.toFixed(2)
+            this.grain=(grainincome-grainexpend).toFixed(2)
+            this.nograinexpend=nograinexpend.toFixed(2)
+            // this.deptCircularPage.currentPage = response.current
+            // this.deptCircularPage.pageSize = response.size
+            // this.deptBudgetTotal = response.total
+            // this.contractList = response
+            // for (var i = 0; i < response.records.length; i++) {
+            //   var arr = new Array()
+            //   this.addressUrls[i] = new Array()
+            //   if (this.contractList.records[i].addressUrl != null) {
+            //     arr = this.contractList.records[i].addressUrl.split(',')
+            //     this.addressUrls[i] = arr
+            //   }
+            // }
+          })
+      },
+    
+      fujian(row) {
+        this.id = row.id
+        this.accessoryTFs = true
+        this.appendixIdss = row.addressUrlArray
+        console.log(this.appendixIdss)
+      },
+      handleExamine(row) {
+        console.log(row)
+        this.$router.push({
+          name: 'purchaseContractExamine',
+          query: {
+            id: row.id,
+            status: row.status,
+          },
+        })
+      },
+      handleEdit(row) {
+        this.$router.push({
+          name: 'purchaseContractEdit',
+          query: {
+            id: row.id,
+          },
+        })
+      },
+      // 关闭 dialog时 处理文件url 初始化upload组件
+      history(row) {
+        console.log(row)
+        billoperatehis({
+            id: row.id,
+          })
+          .toPromise()
+          .then((response) => {
+            this.historyList = response
+          })
+      },
+      find() {
+        if (this.value2) {
+          this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
+          this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
+        } else {
+          this.startDate = ''
+          this.endDate = ''
+        }
+        this.currentPage = 1
+        this.getList()
+      },
+      async exportlist() {
+        const {
+          data
+        } = await export1({
+          compId: localStorage.getItem('ws-pf_compId'),
+          contractType: this.contractType,
+          goodsType: this.goodsType,
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          searchType: this.searchType,
+          searchKeyWord: this.searchKeyWord,
+          startDate: this.startDate,
+          endDate: this.endDate,
+        }, {}, {
+          responseType: 'blob',
+        }).toPromise()
+        downloadFile({
+          res: data,
+          fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }_采购合同`,
+          type: 'xls',
+        })
+      },
+      // deletecontract(){},
+      //删除
+      handleDelete(row) {
+        var text = ''
+        if (row.type == 1) {
+          text =
+            '确认删除收款信息?'
+        } else {
+          text = '确认删除请款信息?'
+        }
+        this.$confirm(text, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            delcontractcost({
+                id: row.id,
+              })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '删除成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {})
+          })
+          .catch(() => {
+            return false
+          })
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+ /deep/.base_header_layout .grid-content{
+   height:36px;
+ }
+</style>