123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647 |
- <template>
- <div class="borderless">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- <div v-if="!auditDisabled" class="upper_right_button">
- <el-dropdown style="padding: 0 8px;line-height: 0">
- <el-button
- type="warning"
- :loading="buttonLoading"
- size="small"
- >
- 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- :loading="buttonLoading"
- :disabled="checkDisabled"
- @click.native="paymentCheck">{{form.checkStatus == '审核中'?'审核中':'请核'}}
- </el-dropdown-item>
- <el-dropdown-item
- :loading="buttonLoading"
- @click.native="checkScheduleDialog = true,checkId=form.id">审核进度
- </el-dropdown-item>
- <el-dropdown-item
- :disabled="!checkDisabled"
- @click.native="cancelAudit">撤销审核
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <!-- <el-button type="info"-->
- <!-- size="small"-->
- <!-- class="el-button--small-yh"-->
- <!-- :loading="buttonLoading"-->
- <!-- :disabled="checkDisabled"-->
- <!-- @click.stop="paymentCheck">-->
- <!-- {{form.checkStatus == '审核中'?'审核中':'申请'}}-->
- <!-- </el-button>-->
- <el-button type="warning"
- size="small"
- :loading="buttonLoading"
- class="el-button--small-yh"
- :disabled="!checkDisabled || form.checkStatus == '审核中'"
- @click.stop="settlement">结算
- </el-button>
- <el-button type="primary"
- size="small"
- :loading="buttonLoading"
- class="el-button--small-yh"
- @click.stop="confirmEdit">保存数据
- </el-button>
- </div>
- <div v-if="auditDisabled" class="upper_right_button">
- <el-button type="primary"
- size="small"
- class="el-button--small-yh"
- :loading="buttonLoading"
- :disabled="buttonDisabled"
- @click.stop="openCheckDialog">
- 审核
- </el-button>
- </div>
- </div>
- </div>
- <div class="customer-main">
- <containerTitle title="基础信息"></containerTitle>
- <basic-container>
- <avue-form class="trading-form" ref="form" v-model="form" :option="option">
- <template slot="corpId">
- <select-component
- v-model="form.corpId"
- @returnBack="returnBack"
- :configuration="configuration"
- :disabled="checkDisabled || auditDisabled"
- ></select-component>
- </template>
- <template slot="accountNo">
- <el-select v-model="form.accountNo"
- placeholder="请选择"
- @change="accountNoChange"
- :disabled="checkDisabled || auditDisabled"
- clearable
- allow-create
- default-first-option
- filterable>
- <el-option v-for="(item,index) in form.bankList"
- :key="index"
- :label="item.accountNo"
- :value="item.accountNo"
- >
- </el-option>
- </el-select>
- </template>
- </avue-form>
- </basic-container>
- <containerTitle title="明细列表"></containerTitle>
- <basic-container>
- <avue-crud :option="itemOption"
- :data="dataList"
- ref="crud"
- v-model="itemForm"
- :page.sync="page"
- @search-reset="searchReset"
- @row-update="rowUpdate"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange">
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- size="small"
- :disabled="checkDisabled || auditDisabled"
- @click="rowCell(scope.row,scope.index)"
- >{{ scope.row.$cellEdit ? '修改完成' : '修改' }}
- </el-button>
- <el-button
- type="text"
- size="small"
- :disabled="checkDisabled || auditDisabled"
- @click.stop="rowDel(scope.row,scope.index)"
- >删除
- </el-button>
- </template>
- <template slot="costType" slot-scope="{ row }">
- <breakdown-select
- v-if="row.$cellEdit"
- v-model="row.costType"
- :configuration="breakConfiguration">
- </breakdown-select>
- <span v-else>{{ row.itemName }}</span>
- </template>
- <template slot="price" slot-scope="{ row }">
- <el-input
- v-if="row.$cellEdit"
- v-model="row.price"
- placeholder="请输入"
- size="small"
- oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
- ></el-input>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="currency" slot-scope="{row,index}">
- <el-select v-if="row.$cellEdit"
- v-model="row.currency"
- size="small"
- @change="currencyChange(row)"
- clearable
- filterable>
- <el-option v-for="(item,index) in currencyDic"
- :key="index"
- :label="item.dictValue"
- :value="item.dictValue"></el-option>
- </el-select>
- <span v-else>{{ row.currency }}</span>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- <el-dialog
- append-to-body
- title="审核进度"
- class="el-dialogDeep"
- :visible.sync="checkScheduleDialog"
- width="40%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check-schedule
- :checkId="checkId"
- @choceScheduleFun="choceScheduleFun"
- >
- </check-schedule>
- </el-dialog>
- <el-dialog
- append-to-body
- title="审批"
- class="el-dialogDeep"
- :visible.sync="checkDialog"
- width="50%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check
- :checkData="checkData"
- @choceCheckFun="choceCheckFun"
- >
- </check>
- </el-dialog>
- </div>
- </template>
- <script>
- import itemOption from "./configuration/detailsPage.json";
- import { contrastObj,contrastList } from "@/util/contrastData";
- import { getDetails,modify,submit, paymentCheck,getlistBankBy,saveOrEdit } from "@/api/financialManagement/paymentRequest";
- import _ from "lodash";
- import { approvePass } from "@/api/approveData/main"
- import checkSchedule from "../../../components/check/checkSchedule";
- import check from "@/components/check/check";
- import { cancelCheck } from "@/api/check/check";
- export default {
- name: "paymentDetailsPage",
- props: {
- detailData: {
- type: Object
- }
- },
- components:{
- checkSchedule,
- check
- },
- data() {
- return {
- form:{},
- itemForm: {},
- checkData:{},
- itemOption: itemOption,
- checkDisabled:false,
- auditDisabled:false,
- buttonDisabled:true,
- buttonLoading:false,
- checkScheduleDialog:false,
- checkDialog:false,
- checkId:'',
- parentId:0,
- id:"",
- dataList: [],
- currencyDic:[],
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- breakConfiguration:{
- multipleChoices:false,
- multiple:false,
- disabled:false,
- searchShow:true,
- collapseTags:false,
- placeholder:'请点击右边按钮选择',
- dicData:[]
- },
- query:{},
- option: {
- menuBtn: false,
- labelWidth: 100,
- column: [
- {
- label: '系统号',
- prop: 'sysNo',
- span: 8,
- disabled: true
- },{
- label: '合同号',
- prop: 'srcOrderno',
- span: 8,
- rules: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '客户名称',
- prop: 'corpId',
- sort:true,
- span: 8,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '银行账号',
- prop: 'accountNo',
- type:"select",
- span: 8,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '开户银行',
- prop: 'accountBank',
- span: 8,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '银行户头',
- prop: 'accountName',
- span: 8,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '人民币金额',
- prop: 'amount',
- span: 8,
- rules: [
- {
- pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '外币金额',
- prop: 'foreignAmount',
- span: 8,
- rules: [
- {
- pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '申请人',
- prop: 'createUserName',
- span: 8,
- disabled:true,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- }, {
- label: '申请日期',
- prop: 'createTime',
- span: 8,
- type:"date",
- disabled:true,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '备注',
- prop: 'remark',
- span:24,
- minRows: 2,
- rules: [
- {
- required: false,
- message: ' ',
- trigger: 'blur'
- }
- ]
- },
- ],
- },
- //客户组件配置控制
- configuration:{
- multipleChoices:false,
- multiple:false,
- searchShow:true,
- collapseTags:false,
- placeholder:'请点击右边按钮选择',
- dicData:[]
- },
- oldForm:{},
- oldDataList:[],
- }
- },
- created() {
- //是否需要根据 登录人所属公司 区分不用option
- //币别
- this.getWorkDicts("currency").then(res =>{
- this.currencyDic = res.data.data
- })
- if (this.detailData.id) {
- this.id = this.detailData.id;
- this.buttonLoading = true;
- getDetails(this.id).then(res => {
- this.afterEcho(res.data.data)
- }).finally(()=>{
- this.buttonLoading = false
- })
- }
- if(this.detailData.check){
- //待审批状态才可选择通过或者驳回
- if(this.detailData.check.auditStatus === "S"){
- this.buttonDisabled = false
- }
- this.auditDisabled = true
- this.buttonLoading = true;
- getDetails(this.detailData.check.srcBillId).then(res => {
- this.afterEcho(res.data.data)
- }).finally(()=>{
- this.buttonLoading = false;
- })
- }
- },
- methods: {
- //选择客户
- returnBack(corpValue){
- getlistBankBy(corpValue).then(res =>{
- this.form.bankList = res.data
- })
- },
- //选择银行账号
- accountNoChange(value){
- this.form.bankList.forEach(item =>{
- if(item.accountNo == value){
- this.$set(this.form,"accountBank",item.accountBank)
- this.$set(this.form,"accountName",item.accountName)
- }
- })
- },
- //打开审核
- openCheckDialog(){
- this.checkData = this.detailData.check
- this.checkDialog = true;
- },
- //关闭审核
- choceCheckFun(){
- this.checkDialog = false;
- },
- //选择费用
- returnBreak(breakValue){
- },
- //撤销审核
- cancelAudit(){
- cancelCheck(this.form.id).then(res =>{
- if(res.data.success){
- this.$message.success("操作成功!")
- this.afterEcho(res.data.data)
- }
- })
- },
- choceScheduleFun(){
- this.checkScheduleDialog = false
- },
- //选择币别 带汇率
- currencyChange(row){
- if(row.currency === "CNY"){
- row.exchangeRate = 1
- }else if(row.currency === "USD"){
- row.exchangeRate = 6.384300
- }else{
- row.exchangeRate = 7.174900
- }
- },
- rowUpdate(row, index, done, loading) {
- done(row);
- },
- rowCell(row, index) {
- this.$refs.crud.rowCell(row, index)
- },
- rowDel(row,index){
- this.dataList.splice(index, 1);
- },
- //验证新旧数据
- verification(){
- let verification;
- if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)){
- this.$confirm("您已改动数据,是否先保存在进行操作!", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.confirmEdit()
- }).catch(()=>{
- verification = false; //取消改动数据
- })
- }else{
- verification = true; //没有动过数据
- }
- return verification
- },
- //请核
- paymentCheck(){
- if(this.verification()){
- this.$confirm("您确定请核此次申请吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(()=>{
- const params ={
- id : this.form.id,
- billType: this.form.billType
- }
- this.buttonLoading = true
- paymentCheck(params).then(res =>{
- if(res.data.success){
- this.$message.success("申请成功!");
- this.afterEcho(res.data.data)
- }
- }).finally(()=>{
- this.buttonLoading = false
- })
- })
- }
- },
- //结算
- settlement(){
- if(this.verification()){
- if(this.$store.getters.takeStatus){
- this.$alert("结算页面已存在,请关闭收货单再进行操作", "温馨提示", {
- confirmButtonText: "确定",
- type: 'warning',
- callback: action => {
- }
- });
- }else{
- //关闭一下存在的列表页 跳转
- this.$router.$avueRouter.closeTag('/financialManagement/paymentSettle/paymentSettle');
- this.$router.push({
- path: "/financialManagement/paymentSettle/paymentSettle",
- query: {params: this.form.id},
- });
- }
- }
- },
- searchReset() {
- console.log('1')
- },
- selectionChange() {
- console.log('1')
- },
- currentChange() {
- console.log('1')
- },
- sizeChange() {
- console.log('1')
- },
- refreshChange() {
- console.log('1')
- },
- confirmEdit(status){
- this.$refs["form"].validate((valid,done) => {
- done();
- if(valid){
- this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
- const params = {
- ...this.form,
- billType:"申请",
- itemsList:this.dataList
- }
- this.buttonLoading = true
- saveOrEdit(params).then(res =>{
- this.$message.success("操作成功!")
- this.afterEcho(res.data.data)
- }).finally(()=>{
- this.buttonLoading = false
- })
- if(status === true){
- this.$emit("goBack");
- }
- }
- })
- },
- afterEcho(data){
- this.form = data;
- this.oldForm = Object.assign({},data);
- this.checkDisabled = data.checkStatus === "未请核"?false:true;
- this.option.column.forEach(item =>{
- if( item.prop == "remark" ){
- this.$set(item,"disabled",(this.auditDisabled || false))
- }else if( item.prop == "createUserName" || item.prop == "createTime" ){
- this.$set(item,"disabled",true)
- }else{
- this.$set(item,"disabled",this.checkDisabled)
- }
- })
- if(data.itemsList){
- this.dataList = data.itemsList
- this.oldDataList = this.deepClone(data.itemsList)
- }
- },
- backToList() {
- if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
- ){
- this.$confirm("是否保存当前页面?", "提示", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.editCustomer(true)
- }).catch(()=>{
- this.$emit("goBack");
- })
- }else{
- this.$emit("goBack");
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 0;
- }
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- .upper_right_button{
- display: flex;
- position: fixed;
- right: 12px;
- top: 47px;
- }
- </style>
|