parent
7b643cf0f9
commit
70a8894243
@ -1,246 +1,678 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="详情"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||||
:close-on-click-modal="false" append-to-body
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
<el-row :gutter="15" class="">
|
||||||
width="1000px">
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<el-row :gutter="15" class="">
|
<template v-if="!loading">
|
||||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
<el-col :span="8">
|
||||||
<template v-if="!loading">
|
<el-form-item label="单据编号" prop="documentNo">
|
||||||
<el-col :span="8" >
|
<el-input v-model="dataForm.documentNo" placeholder="系统自动生成" readonly>
|
||||||
<el-form-item label="单据编号"
|
|
||||||
prop="documentNo" >
|
</el-input>
|
||||||
<p>{{dataForm.documentNo}}</p>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8" >
|
<el-form-item label="客户名称" prop="customerId">
|
||||||
<el-form-item label="客户名称"
|
<popupSelect v-model="dataForm.customerId" placeholder="请选择" clearable field="customerId"
|
||||||
prop="customerId" >
|
interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="id"
|
||||||
<p>{{dataForm.customerId}}</p>
|
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
|
||||||
</el-form-item>
|
@change="popupSelect" disabled>
|
||||||
</el-col>
|
</popupSelect>
|
||||||
<el-col :span="8" >
|
</el-form-item>
|
||||||
<el-form-item label="合同名称"
|
</el-col>
|
||||||
prop="contractId" >
|
|
||||||
<p>{{dataForm.contractId}}</p>
|
<el-col :span="8">
|
||||||
</el-form-item>
|
<el-form-item label="合同名称" prop="contractId">
|
||||||
</el-col>
|
<popupSelect v-model="dataForm.contractId" placeholder="请选择" clearable field="contractId"
|
||||||
<el-col :span="8" >
|
interfaceId="399835312982972805" :bissId="dataForm.customerId" :columnOptions="contractNamecolumnOptions" propsValue="id"
|
||||||
<el-form-item label="收款金额"
|
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="contractSelect" disabled
|
||||||
prop="amountCollected" >
|
>
|
||||||
<p>{{dataForm.amountCollected}}</p>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="收款账户"
|
<el-form-item label="收款金额" prop="amountCollected">
|
||||||
prop="collectionCount" >
|
<el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||||
<p>{{dataForm.collectionCount}}</p>
|
|
||||||
</el-form-item>
|
</el-input>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8" >
|
</el-col>
|
||||||
<el-form-item label="收款银行"
|
<el-col :span="8">
|
||||||
prop="collectionBank" >
|
<el-form-item label="收款账户" prop="collectionCount">
|
||||||
<p>{{dataForm.collectionBank}}</p>
|
<el-input v-model="dataForm.collectionCount" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
</el-input>
|
||||||
<el-col :span="8" >
|
</el-form-item>
|
||||||
<el-form-item label="收款类型 "
|
</el-col>
|
||||||
prop="paymentType" >
|
<el-col :span="8">
|
||||||
<p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p>
|
<el-form-item label="收款银行" prop="collectionBank">
|
||||||
</el-form-item>
|
<el-input v-model="dataForm.collectionBank" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" >
|
</el-input>
|
||||||
<el-form-item label="币别 "
|
</el-form-item>
|
||||||
prop="currency" >
|
</el-col>
|
||||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
<el-col :span="8">
|
||||||
</el-form-item>
|
<el-form-item label="收款类型 " prop="paymentType">
|
||||||
</el-col>
|
<el-select v-model="paymentType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="paymentTypeChange" disabled>
|
||||||
<el-col :span="8" >
|
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
|
||||||
<el-form-item label="结算类型"
|
:value="item.id" :disabled="item.disabled" ></el-option>
|
||||||
prop="settlementType" >
|
|
||||||
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </p>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="备注信息"
|
<el-form-item label="币别 " prop="currency">
|
||||||
prop="remark" >
|
<el-select v-model="currency" placeholder="请选择" clearable :style='{"width":"100%"}' @change="currencyChange" disabled>
|
||||||
<p>{{dataForm.remark}}</p>
|
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
</el-form-item>
|
:disabled="item.disabled"></el-option>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" >
|
</el-select>
|
||||||
<el-form-item label="收款凭证"
|
</el-form-item>
|
||||||
prop="voucher" >
|
</el-col>
|
||||||
<JNPF-UploadFz v-model="dataForm.voucher"
|
<el-col :span="8">
|
||||||
disabled
|
<el-form-item label="结算类型" prop="settlementType">
|
||||||
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
<el-select v-model="settlementType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="settlementTypeChange" disabled>
|
||||||
</JNPF-UploadFz>
|
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
|
||||||
</el-form-item>
|
:value="item.id" :disabled="item.disabled"></el-option>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" >
|
</el-select>
|
||||||
<el-form-item label="单据状态 "
|
</el-form-item>
|
||||||
prop="status" >
|
</el-col>
|
||||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
<el-col :span="8">
|
||||||
</el-form-item>
|
<el-form-item label="备注信息" prop="remark">
|
||||||
</el-col>
|
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||||
<el-col :span="8" >
|
|
||||||
<el-form-item label="制单人"
|
</el-input>
|
||||||
prop="creatorUserName" >
|
</el-form-item>
|
||||||
<p>{{dataForm.creatorUserName}}</p>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="收款凭证" prop="voucher">
|
||||||
<el-col :span="24">
|
<JNPF-UploadFz v-model="dataForm.voucher" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" disabled>
|
||||||
<el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
|
|
||||||
<el-tab-pane label="收款明细">
|
</JNPF-UploadFz>
|
||||||
<el-col :span="24" >
|
</el-form-item>
|
||||||
<el-form-item label-width="0">
|
</el-col>
|
||||||
<div class="JNPF-common-title">
|
<!-- <el-col :span="8">-->
|
||||||
<h2></h2>
|
<!-- <el-form-item label="单据状态 " prop="status">-->
|
||||||
</div>
|
<!-- <el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>-->
|
||||||
<el-table :data="dataForm.collection_item0List" size='mini' >
|
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"-->
|
||||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
<!-- :disabled="item.disabled"></el-option>-->
|
||||||
<el-table-column prop="amount" label="收款金额">
|
|
||||||
<template slot-scope="scope">
|
<!-- </el-select>-->
|
||||||
<p>{{scope.row.amount}}</p>
|
<!-- </el-form-item>-->
|
||||||
</template>
|
<!-- </el-col>-->
|
||||||
</el-table-column>
|
<!-- <el-col :span="8">-->
|
||||||
<el-table-column prop="price" label="订单金额">
|
<!-- <el-form-item label="制单人" prop="creatorUserName">-->
|
||||||
<template slot-scope="scope">
|
<!-- <el-input v-model="dataForm.creatorUserName" placeholder="请输入" clearable :style='{"width":"100%"}'>-->
|
||||||
<p>{{scope.row.price}}</p>
|
|
||||||
</template>
|
<!-- </el-input>-->
|
||||||
</el-table-column>
|
<!-- </el-form-item>-->
|
||||||
<el-table-column prop="amountCollected" label="已收款金额">
|
<!-- </el-col>-->
|
||||||
<template slot-scope="scope">
|
<el-col :span="24">
|
||||||
<p>{{scope.row.amountCollected}}</p>
|
<el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
|
||||||
</template>
|
<el-tab-pane label="收款明细">
|
||||||
</el-table-column>
|
<el-col :span="24">
|
||||||
<el-table-column prop="salesorderId" label="销售订单编号">
|
<el-form-item label-width="0">
|
||||||
<template slot-scope="scope">
|
<div class="JNPF-common-title">
|
||||||
<p>{{scope.row.salesorderId}}</p>
|
<h2></h2>
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
<el-table :data="dataForm.collection_item0List" size='mini' show-summary :summary-method="getSummaries">
|
||||||
<el-table-column prop="contractId" label="合同编号">
|
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="amount" label="收款金额" align="center" width="130">
|
||||||
<p>{{scope.row.contractId}}</p>
|
<template slot-scope="scope">
|
||||||
</template>
|
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}' @change="amountSum" disabled>
|
||||||
</el-table-column>
|
</el-input>
|
||||||
<el-table-column prop="num" label="重量">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<p>{{scope.row.num}}</p>
|
<el-table-column prop="price" label="订单金额" align="center" width="130">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||||
<!-- <el-table-column prop="taxRate" label="税率">-->
|
</el-input>
|
||||||
<!-- <template slot-scope="scope">-->
|
</template>
|
||||||
<!-- <p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>-->
|
</el-table-column>
|
||||||
<!-- </template>-->
|
<el-table-column prop="amountCollected" label="已收款金额" align="center" width="130">
|
||||||
<!-- </el-table-column>-->
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="advanceAmount" label="垫资金额">
|
<el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable
|
||||||
<template slot-scope="scope">
|
:style='{"width":"100%"}' disabled>
|
||||||
<p>{{scope.row.advanceAmount}}</p>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="rate" label="税额">
|
<el-table-column prop="salesorderId" label="销售订单编号" align="center" width="130">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p>{{scope.row.rate}}</p>
|
<popupSelect v-model="scope.row.salesorderId" placeholder="请选择" clearable
|
||||||
</template>
|
:field="'salesorderId'+scope.$index" interfaceId="393372436705378053"
|
||||||
</el-table-column>
|
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
|
||||||
<el-table-column prop="notPrice" label="不含税金额">
|
relationField="document_no" popupType="dialog" popupWidth="800px"
|
||||||
<template slot-scope="scope">
|
:bissId="dataForm.contractId" @change="popupSelect2" disabled>
|
||||||
<p>{{scope.row.notPrice}}</p>
|
</popupSelect>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="creatorTime" label="业务日期">
|
<el-table-column prop="contractId" label="合同编号" align="center" width="130">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
|
<popupSelect v-model="scope.row.contractId" placeholder="请选择" clearable
|
||||||
</template>
|
:field="'contractId'+scope.$index" interfaceId="398848549678332037"
|
||||||
</el-table-column>
|
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
|
||||||
</el-table>
|
relationField="contract_code" popupType="dialog" popupWidth="800px" disabled
|
||||||
</el-form-item>
|
>
|
||||||
</el-col>
|
</popupSelect>
|
||||||
</el-tab-pane >
|
</template>
|
||||||
</el-tabs>
|
</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>
|
</el-col>
|
||||||
</template>
|
</el-tab-pane>
|
||||||
</el-form>
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<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>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import PrintBrowse from '@/components/PrintBrowse'
|
import {
|
||||||
import jnpf from '@/utils/jnpf'
|
getDataInterfaceRes
|
||||||
export default {
|
} from '@/api/systemData/dataInterface'
|
||||||
components: {PrintBrowse},
|
import {
|
||||||
props: [],
|
getDictionaryDataSelector
|
||||||
data() {
|
} from '@/api/systemData/dictionary'
|
||||||
return {
|
export default {
|
||||||
visible: false,
|
components: {},
|
||||||
loading: false,
|
props: [],
|
||||||
printBrowseVisible: false,
|
data() {
|
||||||
printId: '',
|
return {
|
||||||
dataForm: {
|
paymentType: "0",
|
||||||
id :'',
|
currency: "0",
|
||||||
customerId: '',
|
settlementType: "0",
|
||||||
contractId: '',
|
visible: false,
|
||||||
documentNo : '',
|
loading: false,
|
||||||
customerName : '',
|
isDetail: false,
|
||||||
amountCollected : '',
|
dataForm: {
|
||||||
collectionCount : '',
|
code: '',
|
||||||
collectionBank : '',
|
customerCode: '',
|
||||||
paymentType : "0",
|
documentNo: '',
|
||||||
currency : "0",
|
customerName: '',
|
||||||
settlementType : "0",
|
customerId: '',
|
||||||
remark : '',
|
contractId: '',
|
||||||
voucher : [],
|
amountCollected: '',
|
||||||
status : "0",
|
collectionCount: '',
|
||||||
creatorUserName : '',
|
collectionBank: '',
|
||||||
collection_item0List:[],
|
paymentType: "0",
|
||||||
},
|
currency: "0",
|
||||||
activeojnisi:'0',
|
settlementType: "0",
|
||||||
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
|
remark: '',
|
||||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
voucher: [],
|
||||||
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
|
status: "0",
|
||||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
|
creatorUserName: '',
|
||||||
|
collection_item0List: [],
|
||||||
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: {},
|
activeojnisi: '0',
|
||||||
watch: {},
|
rules: {
|
||||||
created() {
|
customerId: [
|
||||||
|
{
|
||||||
},
|
required: true,
|
||||||
mounted() {},
|
message: '请选择',
|
||||||
methods: {
|
trigger: 'change'
|
||||||
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
|
|
||||||
},
|
},
|
||||||
|
],
|
||||||
init(id) {
|
contractId: [
|
||||||
this.dataForm.id = id || 0;
|
{
|
||||||
this.visible = true;
|
required: true,
|
||||||
this.$nextTick(() => {
|
message: '请选择',
|
||||||
if(this.dataForm.id){
|
trigger: 'change'
|
||||||
this.loading = true
|
|
||||||
request({
|
|
||||||
url: '/api/collection/Collection/detail/'+this.dataForm.id,
|
|
||||||
method: 'get'
|
|
||||||
}).then(res => {
|
|
||||||
this.dataInfo(res.data)
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,241 +1,504 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="详情"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||||
:close-on-click-modal="false" append-to-body
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
<el-row :gutter="15" class="">
|
||||||
width="1000px">
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
||||||
<el-row :gutter="15" class="">
|
label-position="right">
|
||||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
<template v-if="!loading">
|
||||||
<template v-if="!loading">
|
<el-col :span="8">
|
||||||
<el-col :span="8" >
|
<el-form-item label="单据编号" prop="documentNo">
|
||||||
<el-form-item label="单据编号"
|
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
|
||||||
prop="documentNo" >
|
:style='{"width":"100%"}' readonly>
|
||||||
<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"}],
|
|
||||||
|
|
||||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
</el-input>
|
||||||
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"}],
|
</el-form-item>
|
||||||
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
|
</el-col>
|
||||||
}
|
<el-col :span="8">
|
||||||
},
|
<el-form-item label="销售订单" prop="salesOrderId">
|
||||||
computed: {},
|
<popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
|
||||||
watch: {},
|
field="salesOrderId" interfaceId="383568951197606085"
|
||||||
created() {
|
:columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
|
||||||
|
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange" disabled>
|
||||||
|
|
||||||
},
|
</popupSelect>
|
||||||
mounted() {},
|
</el-form-item>
|
||||||
methods: {
|
</el-col>
|
||||||
dataInfo(dataAll){
|
<el-col :span="8">
|
||||||
let _dataAll =dataAll
|
<el-form-item label="币别" prop="currency">
|
||||||
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
|
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
|
||||||
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
|
:style='{"width":"100%"}' disabled>
|
||||||
for(let i=0;i<_dataAll.saleback_item0List.length;i++){
|
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
|
||||||
var _list = _dataAll.saleback_item0List[i];
|
:value="item.id" :disabled="item.disabled"></el-option>
|
||||||
}
|
|
||||||
this.dataForm = _dataAll
|
|
||||||
debugger
|
|
||||||
},
|
|
||||||
|
|
||||||
init(id) {
|
</el-select>
|
||||||
this.dataForm.id = id || 0;
|
</el-form-item>
|
||||||
this.visible = true;
|
</el-col>
|
||||||
this.$nextTick(() => {
|
<el-col :span="8">
|
||||||
if(this.dataForm.id){
|
<el-form-item label="退款金额" prop="refundAmount" >
|
||||||
this.loading = true
|
<el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}' disabled>
|
||||||
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-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>
|
</script>
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue