|
@@ -12,6 +12,12 @@
|
|
|
:cell-style="cellStyle"
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="应收" name="first" :key="'first'">
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="应付" name="second" :key="'second'">
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
@@ -20,20 +26,34 @@
|
|
|
:disabled="disabled"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
- <el-button-group>
|
|
|
- <el-button
|
|
|
- type="receivableButton"
|
|
|
- :disabled="selectionList.length == 0"
|
|
|
- @click="receivable"
|
|
|
- >应收</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="copeWithButton"
|
|
|
- :disabled="selectionList.length == 0"
|
|
|
- @click="copeWith"
|
|
|
- >应付</el-button
|
|
|
- >
|
|
|
- </el-button-group>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ size="small"
|
|
|
+ @click.stop="billingDetails('收费')"
|
|
|
+ :disabled="disabled || selectionList.length == 0"
|
|
|
+ v-if="selectTab === 1"
|
|
|
+ >生成账单</el-button>
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowAdd"
|
|
|
+ :disabled="disabled || selectionList.length == 0"
|
|
|
+ v-if="selectTab === 1"
|
|
|
+ >查看生成记录</el-button>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ size="small"
|
|
|
+ @click.stop="billingDetails('申请')"
|
|
|
+ :disabled="disabled || selectionList.length == 0"
|
|
|
+ v-if="selectTab === 2"
|
|
|
+ >申请货款</el-button>
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowAdd"
|
|
|
+ :disabled="disabled || selectionList.length == 0"
|
|
|
+ v-if="selectTab === 2"
|
|
|
+ >查看申请记录</el-button>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<el-button
|
|
@@ -54,26 +74,28 @@
|
|
|
>
|
|
|
</template>
|
|
|
<template slot="corpId" slot-scope="{ row, index }">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
<crop-select
|
|
|
- v-show="row.$cellEdit"
|
|
|
+ style="width: 90% !important;display: inline-block"
|
|
|
+ v-if="row.$cellEdit"
|
|
|
v-model="row.corpId"
|
|
|
:cropIndex="index"
|
|
|
@getCorpData="getCorpData"
|
|
|
corpType="KH"
|
|
|
></crop-select>
|
|
|
- <span v-show="!row.$cellEdit">{{ row.corpName }}</span>
|
|
|
+ <span v-else>{{ row.corpName }}</span>
|
|
|
</template>
|
|
|
<template slot="feeName" slot-scope="{ row, index }">
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="text"
|
|
|
- @click="rePick(row, index)"
|
|
|
- :disabled="disabled || !row.$cellEdit"
|
|
|
- class="picker"
|
|
|
- style="padding:4px 10px;float:left"
|
|
|
- >选择</el-button
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
+ <breakdown-select
|
|
|
+ style="width: 90% !important;"
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.itemId"
|
|
|
+ @selectValue="(value) => selectValue(value,row)"
|
|
|
+ :configuration="breakConfiguration"
|
|
|
>
|
|
|
- <span> {{ row.feeName }}</span>
|
|
|
+ </breakdown-select>
|
|
|
+ <span v-else>{{ row.feeName }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
|
<el-input
|
|
@@ -81,7 +103,7 @@
|
|
|
v-model="row.price"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @change="priceChange(row)"
|
|
|
+ @change="countChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.price | micrometerFormat }}</span>
|
|
|
</template>
|
|
@@ -91,7 +113,7 @@
|
|
|
v-model="row.quantity"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @change="quantityChange(row)"
|
|
|
+ @change="countChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.quantity }}</span>
|
|
|
</template>
|
|
@@ -106,9 +128,8 @@
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
@change="rateChange(row)"
|
|
|
placeholder="请输入"
|
|
|
- disabled
|
|
|
></el-input>
|
|
|
- <span v-else>{{ row.exchangeRate | isPercentage }}</span>
|
|
|
+ <span v-else>{{ row.exchangeRate }}</span>
|
|
|
</template>
|
|
|
<template slot="currency" slot-scope="{ row }">
|
|
|
<el-select
|
|
@@ -187,6 +208,25 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<crop-dialog ref="cropDialog" @importCorp="importCorp"></crop-dialog>
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ title="账单"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="applyPaymentDialog"
|
|
|
+ width="70%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <apply-payment
|
|
|
+ :billType="billType"
|
|
|
+ :billData="billData"
|
|
|
+ :arrList="arrList"
|
|
|
+ @choceFun="choceFun"
|
|
|
+ >
|
|
|
+ </apply-payment>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -199,6 +239,8 @@ import { isPercentage, micrometerFormat } from "@/util/validate";
|
|
|
// import customerDialog from "@/components/customer-dialog/main";
|
|
|
import cropDialog from "@/components/crop-dialog/main";
|
|
|
import _ from "lodash";
|
|
|
+import ApplyPayment from "../finance/applyPayment";
|
|
|
+
|
|
|
export default {
|
|
|
name: "feeInfo",
|
|
|
data() {
|
|
@@ -245,7 +287,30 @@ export default {
|
|
|
feeData: [],
|
|
|
selectionList: [],
|
|
|
reData: null,
|
|
|
- currencyList: []
|
|
|
+ billData:{
|
|
|
+ optionType:'JK'
|
|
|
+ },
|
|
|
+ currencyList: [],
|
|
|
+ breakConfiguration:{
|
|
|
+ multipleChoices:false,
|
|
|
+ multiple:false,
|
|
|
+ disabled:false,
|
|
|
+ searchShow:true,
|
|
|
+ collapseTags:false,
|
|
|
+ clearable:true,
|
|
|
+ placeholder:'请点击右边按钮选择',
|
|
|
+ dicData:[]
|
|
|
+ },
|
|
|
+ allData:[],
|
|
|
+ data_one:[],
|
|
|
+ data_two:[],
|
|
|
+ selectTab:1,
|
|
|
+ activeName:"first",
|
|
|
+ tab1:true,
|
|
|
+ tab2:false,
|
|
|
+ applyPaymentDialog:false,
|
|
|
+ billType:'',
|
|
|
+ arrList:[],
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -277,9 +342,43 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
components: {
|
|
|
- cropDialog
|
|
|
+ cropDialog,
|
|
|
+ ApplyPayment
|
|
|
},
|
|
|
methods: {
|
|
|
+ //选择费用
|
|
|
+ selectValue(value,row){
|
|
|
+ this.$set(row,"feeName",value.cname)
|
|
|
+ this.$set(row,"unit",value.unitno)
|
|
|
+ this.$set(row,"currency",value.fcyno)
|
|
|
+ this.currencyChange(row)
|
|
|
+ },
|
|
|
+ //选择应收应付
|
|
|
+ handleClick(tab){
|
|
|
+ if(tab.name == "first") {
|
|
|
+ this.tab1 = true;
|
|
|
+ this.tab2 = false;
|
|
|
+
|
|
|
+ //将上一个tab页数据放到 对应data上
|
|
|
+ this.data_two = this.feeData
|
|
|
+
|
|
|
+ this.selectTab = 1
|
|
|
+ this.feeData = this.data_one //切换数据
|
|
|
+ this.selectionList = [];
|
|
|
+ this.arrList = [];
|
|
|
+
|
|
|
+ } else if(tab.name == "second") {
|
|
|
+ this.tab1 = false;
|
|
|
+ this.tab2 = true;
|
|
|
+ if(this.selectTab === 1){
|
|
|
+ this.data_one = this.feeData
|
|
|
+ }
|
|
|
+ this.selectTab = 2
|
|
|
+ this.feeData = this.data_two
|
|
|
+ this.selectionList = [];
|
|
|
+ this.arrList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
@@ -296,7 +395,8 @@ export default {
|
|
|
currency: null,
|
|
|
exchangeRate: null,
|
|
|
remarks: null,
|
|
|
- $cellEdit: true
|
|
|
+ $cellEdit: true,
|
|
|
+ feesType:this.selectTab
|
|
|
});
|
|
|
},
|
|
|
currencyChange(row) {
|
|
@@ -308,7 +408,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
rowDel(row, index) {
|
|
|
- console.log(row, index);
|
|
|
this.$confirm("确定删除数据?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -335,18 +434,9 @@ export default {
|
|
|
getCorpData(row) {
|
|
|
this.feeData[row.index].corpName = row.cname;
|
|
|
},
|
|
|
- priceChange(row) {
|
|
|
- if (!row.price) {
|
|
|
- row.price = 0;
|
|
|
- } else {
|
|
|
- row.amount = _.multiply(row.price, row.quantity).toFixed(2);
|
|
|
- }
|
|
|
- },
|
|
|
- quantityChange(row) {
|
|
|
- if (!row.quantity) {
|
|
|
- row.quantity = 0;
|
|
|
- } else {
|
|
|
- row.amount = _.multiply(row.price, row.quantity).toFixed(2);
|
|
|
+ countChange(row) {
|
|
|
+ if (row.price && row.quantity) {
|
|
|
+ row.amount = _.multiply(row.quantity, row.price).toFixed(2);
|
|
|
}
|
|
|
},
|
|
|
rateChange(row) {
|
|
@@ -466,30 +556,81 @@ export default {
|
|
|
currency: e.fcyno,
|
|
|
exchangeRate: null,
|
|
|
remarks: null,
|
|
|
- $cellEdit: true
|
|
|
+ $cellEdit: true,
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
this.feeDialog = false;
|
|
|
},
|
|
|
submitData() {
|
|
|
- return this.feeData;
|
|
|
- },
|
|
|
+ this.allData = []
|
|
|
+ //保存时 将所出的tab页数据赋值到相应 data上
|
|
|
+ if(this.selectTab == 1){
|
|
|
+ this.data_one = this.feeData
|
|
|
+ }else{
|
|
|
+ this.data_two = this.feeData
|
|
|
+ }
|
|
|
+
|
|
|
+ this.allData.push(...this.data_one,...this.data_two)
|
|
|
|
|
|
- //应收
|
|
|
- receivable() {
|
|
|
- //切换
|
|
|
- this.receivableButton = "primary";
|
|
|
- this.copeWithButton = "";
|
|
|
+ return this.allData;
|
|
|
+ },
|
|
|
|
|
|
- this.selectionList;
|
|
|
+ billingDetails(type){
|
|
|
+ //查看是否改动过数据
|
|
|
+ this.$emit("beforeFinance",this.submitData(),(params)=>{
|
|
|
+ if(params.valid){
|
|
|
+ for(let i=0;i<this.selectionList.length;i++){
|
|
|
+ if(this.selectionList[i].corpId != this.selectionList[0].corpId){
|
|
|
+ return this.$message.error('批量操作结算单位必须一致')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.billType = type
|
|
|
+ if(type === '申请'){
|
|
|
+ this.selectionList.map(item =>{
|
|
|
+ delete item.id
|
|
|
+ item.corpsName = item.corpName
|
|
|
+ item.srcFeesId = item.id
|
|
|
+ item.costType = item.itemId
|
|
|
+ item.itemType = '采购'
|
|
|
+ item.optionType = 'JK'
|
|
|
+ item.srcType = 2 //费用明细申请
|
|
|
+ let form = {
|
|
|
+ form:{
|
|
|
+ ...item,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.arrList.push(form)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.selectionList.map(item =>{
|
|
|
+ delete item.id
|
|
|
+ item.corpsName = item.corpName
|
|
|
+ item.srcFeesId = item.id
|
|
|
+ item.costType = item.itemId
|
|
|
+ item.itemType = '采购'
|
|
|
+ item.optionType = 'JK'
|
|
|
+ item.srcType = 2 //费用明细申请
|
|
|
+ let form = {
|
|
|
+ form:{
|
|
|
+ ...item,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.arrList.push(form)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.openApplyPayment()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- //应付
|
|
|
- copeWith() {
|
|
|
- this.receivableButton = "";
|
|
|
- this.copeWithButton = "primary";
|
|
|
+ //打开账单
|
|
|
+ openApplyPayment(){
|
|
|
+ this.applyPaymentDialog = true;
|
|
|
},
|
|
|
+ //关闭账单
|
|
|
+ choceFun(){
|
|
|
|
|
|
+ },
|
|
|
summaryMethod({ columns, data }) {
|
|
|
const sums = [];
|
|
|
if (columns.length > 0) {
|
|
@@ -529,10 +670,25 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
orderFeesList: function(rows) {
|
|
|
- this.feeData = rows ? rows : [];
|
|
|
+ this.allData = rows ? rows : [];
|
|
|
+ if(this.allData.length !=0){
|
|
|
+ this.data_one=this.allData.filter(item=>item.feesType === 1) //应收
|
|
|
+ this.data_two=this.allData.filter(item=>item.feesType === 2) //应付
|
|
|
+
|
|
|
+ if( this.feeData.length != 0){
|
|
|
+ this.feeData = this.data_one
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .required_fields{
|
|
|
+ color: #F56C6C;
|
|
|
+ display:inline-block;
|
|
|
+ width: 7%
|
|
|
+ }
|
|
|
+</style>
|