parent
7b643cf0f9
commit
70a8894243
@ -1,246 +1,678 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<p>{{dataForm.documentNo}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户名称"
|
||||
prop="customerId" >
|
||||
<p>{{dataForm.customerId}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractId" >
|
||||
<p>{{dataForm.contractId}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款金额"
|
||||
prop="amountCollected" >
|
||||
<p>{{dataForm.amountCollected}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款账户"
|
||||
prop="collectionCount" >
|
||||
<p>{{dataForm.collectionCount}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款银行"
|
||||
prop="collectionBank" >
|
||||
<p>{{dataForm.collectionBank}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款类型 "
|
||||
prop="paymentType" >
|
||||
<p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别 "
|
||||
prop="currency" >
|
||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="结算类型"
|
||||
prop="settlementType" >
|
||||
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="备注信息"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款凭证"
|
||||
prop="voucher" >
|
||||
<JNPF-UploadFz v-model="dataForm.voucher"
|
||||
disabled
|
||||
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
||||
</JNPF-UploadFz>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据状态 "
|
||||
prop="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="制单人"
|
||||
prop="creatorUserName" >
|
||||
<p>{{dataForm.creatorUserName}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="收款明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.collection_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="amount" label="收款金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="订单金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.price}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountCollected" label="已收款金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amountCollected}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesorderId" label="销售订单编号">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.salesorderId}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contractId" label="合同编号">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.contractId}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="重量">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.num}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="taxRate" label="税率">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="advanceAmount" label="垫资金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.advanceAmount}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.rate}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notPrice" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.notPrice}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="业务日期">
|
||||
<template slot-scope="scope">
|
||||
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号" prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo" placeholder="系统自动生成" readonly>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<popupSelect v-model="dataForm.customerId" placeholder="请选择" clearable field="customerId"
|
||||
interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="id"
|
||||
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
|
||||
@change="popupSelect" disabled>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contractId">
|
||||
<popupSelect v-model="dataForm.contractId" placeholder="请选择" clearable field="contractId"
|
||||
interfaceId="399835312982972805" :bissId="dataForm.customerId" :columnOptions="contractNamecolumnOptions" propsValue="id"
|
||||
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="contractSelect" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款金额" prop="amountCollected">
|
||||
<el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账户" prop="collectionCount">
|
||||
<el-input v-model="dataForm.collectionCount" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collectionBank">
|
||||
<el-input v-model="dataForm.collectionBank" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款类型 " prop="paymentType">
|
||||
<el-select v-model="paymentType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="paymentTypeChange" disabled>
|
||||
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled" ></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 " prop="currency">
|
||||
<el-select v-model="currency" placeholder="请选择" clearable :style='{"width":"100%"}' @change="currencyChange" disabled>
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="结算类型" prop="settlementType">
|
||||
<el-select v-model="settlementType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="settlementTypeChange" disabled>
|
||||
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注信息" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款凭证" prop="voucher">
|
||||
<JNPF-UploadFz v-model="dataForm.voucher" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" disabled>
|
||||
|
||||
</JNPF-UploadFz>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label="单据状态 " prop="status">-->
|
||||
<!-- <el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>-->
|
||||
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"-->
|
||||
<!-- :disabled="item.disabled"></el-option>-->
|
||||
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label="制单人" prop="creatorUserName">-->
|
||||
<!-- <el-input v-model="dataForm.creatorUserName" placeholder="请输入" clearable :style='{"width":"100%"}'>-->
|
||||
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="收款明细">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.collection_item0List" size='mini' show-summary :summary-method="getSummaries">
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="amount" label="收款金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}' @change="amountSum" disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="订单金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountCollected" label="已收款金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesorderId" label="销售订单编号" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.salesorderId" placeholder="请选择" clearable
|
||||
:field="'salesorderId'+scope.$index" interfaceId="393372436705378053"
|
||||
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
|
||||
relationField="document_no" popupType="dialog" popupWidth="800px"
|
||||
:bissId="dataForm.contractId" @change="popupSelect2" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contractId" label="合同编号" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.contractId" placeholder="请选择" clearable
|
||||
:field="'contractId'+scope.$index" interfaceId="398848549678332037"
|
||||
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
|
||||
relationField="contract_code" popupType="dialog" popupWidth="800px" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="数量" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="taxRate" label="税率">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-select v-model="scope.row.taxRate"-->
|
||||
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
|
||||
<!-- <el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="advanceAmount" label="垫资金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notPrice" label="不含税金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.notPrice" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="业务日期" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delcollection_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<!-- <div class="table-actions" @click="addcollection_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button> -->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
dataForm: {
|
||||
id :'',
|
||||
customerId: '',
|
||||
contractId: '',
|
||||
documentNo : '',
|
||||
customerName : '',
|
||||
amountCollected : '',
|
||||
collectionCount : '',
|
||||
collectionBank : '',
|
||||
paymentType : "0",
|
||||
currency : "0",
|
||||
settlementType : "0",
|
||||
remark : '',
|
||||
voucher : [],
|
||||
status : "0",
|
||||
creatorUserName : '',
|
||||
collection_item0List:[],
|
||||
},
|
||||
activeojnisi:'0',
|
||||
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
|
||||
|
||||
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
paymentType: "0",
|
||||
currency: "0",
|
||||
settlementType: "0",
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
code: '',
|
||||
customerCode: '',
|
||||
documentNo: '',
|
||||
customerName: '',
|
||||
customerId: '',
|
||||
contractId: '',
|
||||
amountCollected: '',
|
||||
collectionCount: '',
|
||||
collectionBank: '',
|
||||
paymentType: "0",
|
||||
currency: "0",
|
||||
settlementType: "0",
|
||||
remark: '',
|
||||
voucher: [],
|
||||
status: "0",
|
||||
creatorUserName: '',
|
||||
collection_item0List: [],
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
_dataAll.voucher = _dataAll.voucher ? JSON.parse( _dataAll.voucher):[]
|
||||
for(let i=0;i<_dataAll.collection_item0List.length;i++){
|
||||
var _list = _dataAll.collection_item0List[i];
|
||||
_list.creatorTime = _list.creatorTime ? jnpf.dateFormat(_list.creatorTime) : ''
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
activeojnisi: '0',
|
||||
rules: {
|
||||
customerId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/collection/Collection/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
],
|
||||
contractId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
customerNamecolumnOptions: [{
|
||||
"label": "客户编码",
|
||||
"value": "supplier_cd"
|
||||
}, {
|
||||
"label": "客户名称",
|
||||
"value": "supplier_nm"
|
||||
}, {
|
||||
"label": "客户地点名称",
|
||||
"value": "supplier_site_code"
|
||||
}, {
|
||||
"label": "客户等级",
|
||||
"value": "customer_level"
|
||||
}, {
|
||||
"label": "银行账号",
|
||||
"value": "bank_account"
|
||||
}, {
|
||||
"label": "开户行",
|
||||
"value": "bank"
|
||||
},],
|
||||
contractNamecolumnOptions: [{
|
||||
"label": "合同编码",
|
||||
"value": "contract_code"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
} ],
|
||||
jg_collection_item0deleteTimecolumnOptions: [ {
|
||||
"label": "销售订单编号",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "合同编号",
|
||||
"value": "contract_id"
|
||||
},
|
||||
{
|
||||
"label": "订单金额",
|
||||
"value": "price"
|
||||
}, {
|
||||
"label": "已收款金额",
|
||||
"value": "amount_collected"
|
||||
},
|
||||
{
|
||||
"label": "重量",
|
||||
"value": "num"
|
||||
}, {
|
||||
"label": "垫资金额",
|
||||
"value": "advance_amount"
|
||||
},
|
||||
{
|
||||
"label": "税额",
|
||||
"value": "rate"
|
||||
}, {
|
||||
"label": "不含税金额",
|
||||
"value": "not_price"
|
||||
}, {
|
||||
"label": "业务日期",
|
||||
"value": "creator_time"
|
||||
},
|
||||
],
|
||||
paymentTypeOptions: [{
|
||||
"fullName": "货款",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "运费",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "仓储",
|
||||
"id": "2"
|
||||
}],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
settlementTypeOptions: [{
|
||||
"fullName": "现金",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "赊购",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "网银",
|
||||
"id": "2"
|
||||
}, {
|
||||
"fullName": "银企直连",
|
||||
"id": "3"
|
||||
}, {
|
||||
"fullName": "银票",
|
||||
"id": "4"
|
||||
}, {
|
||||
"fullName": "商票",
|
||||
"id": "5"
|
||||
}],
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}, {
|
||||
"fullName": "已付款",
|
||||
"id": "3"
|
||||
}],
|
||||
|
||||
taxRateOptions: [{
|
||||
"fullName": "13",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "9",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "6",
|
||||
"id": "2"
|
||||
}, {
|
||||
"fullName": "5",
|
||||
"id": "3"
|
||||
}, {
|
||||
"fullName": "3",
|
||||
"id": "4"
|
||||
}, {
|
||||
"fullName": "0",
|
||||
"id": "5"
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
paymentTypeChange(e){
|
||||
this.dataForm.paymentType = e;
|
||||
},
|
||||
currencyChange(e){
|
||||
this.dataForm.currency = e;
|
||||
},
|
||||
settlementTypeChange(e){
|
||||
this.dataForm.settlementType = e;
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 3 || index === 6 || index === 7 || index === 8 || index === 9)) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return this.jnpf.floatAdd(prev, curr);
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
},
|
||||
amountSum(){
|
||||
let sum = 0;
|
||||
for (let i = 0; i<this.dataForm.collection_item0List.length;i++){
|
||||
sum = this.jnpf.floatAdd(sum,this.dataForm.collection_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.amountCollected = sum;
|
||||
},
|
||||
popupSelect(e, d) {
|
||||
this.dataForm.code = d.id;
|
||||
this.dataForm.collectionCount = d.bank_account;
|
||||
this.dataForm.collectionBank = d.bank;
|
||||
this.dataForm.collection_item0List = [];
|
||||
let params = {
|
||||
"param" : this.dataForm.customerId
|
||||
}
|
||||
request({
|
||||
url: '/api/collection/Collection/display',
|
||||
method: 'get',
|
||||
data: params
|
||||
}).then(res => {
|
||||
let data = res.data;
|
||||
let amountSum = 0;
|
||||
this.dataForm.contractId = data.id;
|
||||
for (let i = 0; i< data.saleorderitemList.length;i++){
|
||||
this.addcollection_item0List();
|
||||
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
|
||||
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
|
||||
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
|
||||
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
|
||||
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
|
||||
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
|
||||
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
|
||||
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
|
||||
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
|
||||
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
|
||||
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.amountCollected = amountSum;
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
contractSelect(){
|
||||
this.dataForm.collection_item0List = [];
|
||||
let params = {
|
||||
"param" : this.dataForm.contractId
|
||||
}
|
||||
request({
|
||||
url: '/api/collection/Collection/show',
|
||||
method: 'get',
|
||||
data: params
|
||||
}).then(res => {
|
||||
let data = res.data;
|
||||
let amountSum = 0;
|
||||
this.dataForm.contractId = data.id;
|
||||
for (let i = 0; i< data.saleorderitemList.length;i++){
|
||||
this.addcollection_item0List();
|
||||
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
|
||||
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
|
||||
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
|
||||
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
|
||||
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
|
||||
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
|
||||
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
|
||||
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
|
||||
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
|
||||
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
|
||||
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.amountCollected = amountSum;
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
popupSelect2(a, b) {
|
||||
let amountCollectedSum = 0;
|
||||
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
|
||||
debugger
|
||||
if (a == this.dataForm.collection_item0List[i].salesorderId) {
|
||||
this.dataForm.collection_item0List[i].price = b.price;
|
||||
this.dataForm.collection_item0List[i].amountCollected = b.amount_collected;
|
||||
this.dataForm.collection_item0List[i].contractId = b.contract_id;
|
||||
this.dataForm.collection_item0List[i].num = b.num;
|
||||
this.dataForm.collection_item0List[i].advanceAmount = b.advance_amount;
|
||||
this.dataForm.collection_item0List[i].rate = b.rate;
|
||||
this.dataForm.collection_item0List[i].notPrice = b.not_price;
|
||||
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(b.price,b.amount_collected);
|
||||
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
|
||||
amountCollectedSum = this.jnpf.floatAdd(amountCollectedSum,this.dataForm.collection_item0List[i].amount);
|
||||
}
|
||||
}
|
||||
this.dataForm.amountCollected = amountCollectedSum;
|
||||
},
|
||||
collection_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
|
||||
const e = this.dataForm.collection_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
this.dataForm.paymentType = '0'
|
||||
this.dataForm.currency = '0'
|
||||
this.dataForm.settlementType = '0'
|
||||
let params = {
|
||||
"param" : 'collection'
|
||||
}
|
||||
request({
|
||||
url: '/api/collection/Collection/autoSerialNum',
|
||||
method: 'get',
|
||||
data: params
|
||||
}).then(res => {
|
||||
this.dataForm.documentNo = res.msg
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/collection/Collection/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
debugger
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
|
||||
if (valid) {
|
||||
if (!this.collection_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/collection/Collection',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/collection/Collection/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addcollection_item0List() {
|
||||
let item = {
|
||||
amount: undefined,
|
||||
price: undefined,
|
||||
amountCollected: undefined,
|
||||
salesorderId: undefined,
|
||||
contractId: undefined,
|
||||
num: undefined,
|
||||
advanceAmount: undefined,
|
||||
rate: undefined,
|
||||
notPrice: undefined,
|
||||
creatorTime: undefined,
|
||||
}
|
||||
this.dataForm.collection_item0List.push(item)
|
||||
},
|
||||
delcollection_item0List(index) {
|
||||
this.dataForm.collection_item0List.splice(index, 1);
|
||||
this.amountSum();
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.voucher = JSON.stringify(_data.voucher)
|
||||
for (let i = 0; i < _data.collection_item0List.length; i++) {
|
||||
var _list = _data.collection_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
_dataAll.voucher = JSON.parse(_dataAll.voucher)
|
||||
for (let i = 0; i < _dataAll.collection_item0List.length; i++) {
|
||||
var _list = _dataAll.collection_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
debugger
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,241 +1,504 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<p>{{dataForm.documentNo}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="销售订单"
|
||||
prop="salesOrderId" >
|
||||
<p>{{dataForm.salesOrderId}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别"
|
||||
prop="currency" >
|
||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="退款金额"
|
||||
prop="refundAmount" >
|
||||
<p>{{dataForm.refundAmount}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="退货数量"
|
||||
prop="refundNum" >
|
||||
<p>{{dataForm.refundNum}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="合同名称"-->
|
||||
<!-- prop="jnpf_jg_salesorder_jnpf_contractName" >-->
|
||||
<!-- <p>{{dataForm.jnpf_jg_salesorder_jnpf_contractName}}</p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="客户名称"-->
|
||||
<!-- prop="jnpf_jg_salesorder_jnpf_costomerName" >-->
|
||||
<!-- <p>{{dataForm.jnpf_jg_salesorder_jnpf_costomerName}}</p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="实退金额"-->
|
||||
<!-- prop="actualAmount" >-->
|
||||
<!-- <p>{{dataForm.actualAmount}}</p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="单据状态 "-->
|
||||
<!-- prop="status" >-->
|
||||
<!-- <p>{{ dataForm.status | dynamicText(statusOptions) }} </p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="创建时间"-->
|
||||
<!-- prop="creatorTime" >-->
|
||||
<!-- <p>{{dataForm.creatorTime}}</p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="创建人"-->
|
||||
<!-- prop="creatorUserName" >-->
|
||||
<!-- <p>{{dataForm.creatorUserName}}</p>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeqkzogz" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.saleback_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="vehicleName" label="车牌号">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.vehicleName}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialName" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.materialName}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="settlement" label="结算重量 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.settlement}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesPrice" label="销售单价">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.salesPrice}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="应退金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.notAmount}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="businessName" label="业务员">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.businessName}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pountType" label="磅单类型 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.pountType | dynamicText(pountTypeOptions) }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
dataForm: {
|
||||
id :'',
|
||||
documentNo : '',
|
||||
salesOrderId : "",
|
||||
currency : "0",
|
||||
refundAmount : '',
|
||||
refundNum : '',
|
||||
remark : '',
|
||||
actualAmount : '',
|
||||
status : "0",
|
||||
creatorTime : "",
|
||||
creatorUserName : "",
|
||||
saleback_item0List:[],
|
||||
// jg_salesorder:
|
||||
// {
|
||||
// contractName:'',
|
||||
// costomerName:'',
|
||||
// },
|
||||
// jnpf_jg_salesorder_jnpf_contractName:'',
|
||||
// jnpf_jg_salesorder_jnpf_costomerName:'',
|
||||
},
|
||||
activeqkzogz:'0',
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号" prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
rateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
|
||||
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售订单" prop="salesOrderId">
|
||||
<popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
|
||||
field="salesOrderId" interfaceId="383568951197606085"
|
||||
:columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
|
||||
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange" disabled>
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
|
||||
for(let i=0;i<_dataAll.saleback_item0List.length;i++){
|
||||
var _list = _dataAll.saleback_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
debugger
|
||||
},
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别" prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/saleback/Saleback/detail2/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
for (let i = 0;i<res.data.saleback_item0List.length;i++){
|
||||
this.dataForm.saleback_item0List[i].amount = res.data.saleback_item0List[i].price
|
||||
this.dataForm.saleback_item0List[i].price = res.data.saleback_item0List[i].salesPrice
|
||||
this.dataForm.saleback_item0List[i].notAmount = this.dataForm.saleback_item0List[i].amount - res.data.saleback_item0List[i].noPrice
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款金额" prop="refundAmount" >
|
||||
<el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退货数量" prop="refundNum" >
|
||||
<el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeqkzogz" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.saleback_item0List" size='mini' show-summary :summary-method="getSummaries">
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="vehicleId" label="车牌号" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.vehicleId"
|
||||
placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="400554150653457925"
|
||||
:bissId="dataForm.salesOrderId" :columnOptions="salesback_item0vehicleIdcolumnOptions" propsValue="vehicleId"
|
||||
relationField="ticketno" popupType="dialog" @change="popupSelectChange2" disabled
|
||||
popupWidth="800px">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialId" label="物料名称" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.materialId"
|
||||
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="381037852907038533" :columnOptions="jg_salesback_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
|
||||
popupWidth="800px" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="settlement" label="结算重量 " align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位 " align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="销售单价" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in rateOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="应退金额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notAmount" label="税额" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="businessId" label="业务员" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.businessId"
|
||||
placeholder="请选择" clearable :field="'businessId'+scope.$index" interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="jg_salesback_item0businessIdcolumnOptions" propsValue="F_Id" relationField="F_RealName" popupType="dialog"
|
||||
popupWidth="800px" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pountType" label="磅单类型 " align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.pountType" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in pountTypeOptions"
|
||||
:key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delsaleback_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<!-- <div class="table-actions" @click="addsaleback_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button> -->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
excludeFields: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo: '',
|
||||
salesOrderId: "",
|
||||
currency: "0",
|
||||
refundAmount: '',
|
||||
refundNum: '',
|
||||
remark: '',
|
||||
actualAmount: '',
|
||||
status: "0",
|
||||
creatorTime: "",
|
||||
creatorUserName: "",
|
||||
saleback_item0List: [],
|
||||
// jg_salesorder: {
|
||||
// contractName: '',
|
||||
// costomerName: '',
|
||||
// },
|
||||
// jnpf_jg_salesorder_jnpf_contractName: '',
|
||||
// jnpf_jg_salesorder_jnpf_costomerName: '',
|
||||
},
|
||||
activeqkzogz: '0',
|
||||
rules: {},
|
||||
salesOrderIdcolumnOptions: [{
|
||||
"label": "ID",
|
||||
"value": "id"
|
||||
}, {
|
||||
"label": "销售订单号",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
}, {
|
||||
"label": "客户名称",
|
||||
"value": "costomer_name"
|
||||
}, {
|
||||
"label": "币别",
|
||||
"value": "currency"
|
||||
}, {
|
||||
"label": "状态",
|
||||
"value": "status"
|
||||
}, ],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}],
|
||||
|
||||
salesback_item0vehicleIdcolumnOptions:[ {"label":"车牌号","value":"ticketno"},
|
||||
{"label":"物料名称","value":"material_name"},
|
||||
{"label":"结算重量","value":"settlement"},
|
||||
{"label":"计量单位","value":"unit"},
|
||||
{"label":"采购单价","value":"unit_price"},
|
||||
{"label":"税率","value":"rate"},
|
||||
{"label":"应退金额","value":"price"},
|
||||
{"label":"税额","value":"no_price"},
|
||||
{"label":"业务员","value":"business_id"},
|
||||
{"label":"磅单类型","value":"pound_type"},],
|
||||
jg_salesback_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
|
||||
unitOptions: [{
|
||||
"fullName": "吨",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "千克",
|
||||
"id": "1"
|
||||
}],
|
||||
rateOptions: [{
|
||||
"fullName": "13",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "9",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "6",
|
||||
"id": "2"
|
||||
}, {
|
||||
"fullName": "5",
|
||||
"id": "3"
|
||||
}, {
|
||||
"fullName": "3",
|
||||
"id": "4"
|
||||
}, {
|
||||
"fullName": "0",
|
||||
"id": "5"
|
||||
}],
|
||||
pountTypeOptions: [{
|
||||
"fullName": "贸易",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "其他",
|
||||
"id": "1"
|
||||
}],
|
||||
jg_salesback_item0businessIdcolumnOptions:[ {"label":"人员名称","value":"F_RealName"}, {"label":"人员职位","value":"F_FullName"},],
|
||||
}
|
||||
},
|
||||
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value)) && (index === 3 || index === 5 || index === 7 || index === 8 )) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return this.jnpf.floatAdd(prev, curr);
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
},
|
||||
popupSelectChange2(a, b){
|
||||
var sumPrice = 0;
|
||||
var sumNum = 0;
|
||||
var excludeFields = [];
|
||||
var floatMul2 = 0;
|
||||
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
|
||||
excludeFields.push(this.dataForm.saleback_item0List[i].vehicleId);
|
||||
if(a == this.dataForm.saleback_item0List[i].vehicleId){
|
||||
this.dataForm.saleback_item0List[i].materialId = b.material_id;
|
||||
this.dataForm.saleback_item0List[i].settlement = b.settlement;
|
||||
this.dataForm.saleback_item0List[i].unit = b.unit;
|
||||
this.dataForm.saleback_item0List[i].price = b.sales_price;
|
||||
this.dataForm.saleback_item0List[i].rate = b.rate;
|
||||
this.dataForm.saleback_item0List[i].amount = this.jnpf.floatMul(b.sales_price, b.settlement);
|
||||
this.dataForm.saleback_item0List[i].pountType = b.pound_type;
|
||||
this.dataForm.saleback_item0List[i].businessId = b.business_id;
|
||||
this.dataForm.saleback_item0List[i].salesorderItem0Id = b.saleitemId;
|
||||
this.dataForm.saleback_item0List[i].poundlistId = b.poundlistId;
|
||||
this.rateOptions.find((item) => {
|
||||
if (this.dataForm.saleback_item0List[i].rate == item.id) {
|
||||
this.dataForm.saleback_item0List[i].notAmount =this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.saleback_item0List[i].amount,item.fullName),100)
|
||||
}
|
||||
})
|
||||
sumNum = this.jnpf.floatAdd(sumNum,b.settlement);
|
||||
sumPrice = this.jnpf.floatAdd(sumPrice,this.dataForm.saleback_item0List[i].amount);
|
||||
}
|
||||
}
|
||||
this.dataForm.refundNum = sumNum;
|
||||
this.dataForm.refundAmount = sumPrice;
|
||||
this.excludeFields = excludeFields;
|
||||
},
|
||||
popupSelectChange(e,d){
|
||||
this.dataForm.currency = d.currency;
|
||||
this.excludeFields = [];
|
||||
this.dataForm.saleback_item0List = [];
|
||||
},
|
||||
saleback_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
|
||||
const e = this.dataForm.saleback_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
let param = {
|
||||
"param" : 'salesBack'
|
||||
}
|
||||
request({
|
||||
url: '/api/collection/Collection/autoSerialNum',
|
||||
method: 'get',
|
||||
data: param
|
||||
}).then(res => {
|
||||
this.dataForm.documentNo = res.msg
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/saleback/Saleback/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
for (let i = 0;i<res.data.saleback_item0List.length;i++){
|
||||
this.dataForm.saleback_item0List[i].amount = res.data.saleback_item0List[i].price
|
||||
this.dataForm.saleback_item0List[i].price = res.data.saleback_item0List[i].salesPrice
|
||||
this.dataForm.saleback_item0List[i].notAmount = this.jnpf.floatSub(this.dataForm.saleback_item0List[i].amount, res.data.saleback_item0List[i].noPrice)
|
||||
}
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.saleback_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/saleback/Saleback',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/saleback/Saleback/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addsaleback_item0List() {
|
||||
let item = {
|
||||
licenseNum: undefined,
|
||||
materialName: undefined,
|
||||
settlement: undefined,
|
||||
unit: undefined,
|
||||
price: undefined,
|
||||
rate: undefined,
|
||||
amount: undefined,
|
||||
notAmount: undefined,
|
||||
pountUser: undefined,
|
||||
pountType: undefined,
|
||||
}
|
||||
this.dataForm.saleback_item0List.push(item)
|
||||
},
|
||||
delsaleback_item0List(index) {
|
||||
this.dataForm.saleback_item0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
// _data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
|
||||
// _data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
|
||||
for (let i = 0; i < _data.saleback_item0List.length; i++) {
|
||||
var _list = _data.saleback_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
|
||||
for (let i = 0; i < _dataAll.saleback_item0List.length; i++) {
|
||||
var _list = _dataAll.saleback_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue