parent
d91ced5fca
commit
ac9365a6b4
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.mapper.PoundlistMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.poundlist.mapper.PoundlistMapper">
|
||||
<resultMap id="purchorderItemMap" type="jnpf.poundlist.entity.PoundlistEntity" >
|
||||
<!-- 制单人 -->
|
||||
<result property="supplierId" column="SUPPLIER_ID"/>
|
||||
<!-- 订单日期 -->
|
||||
<result property="salesId" column="SALES_ID"/>
|
||||
<!-- 对方合同号-->
|
||||
<result property="id" column="id"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryByKeyword" resultMap="purchorderItemMap">
|
||||
SELECT a.* from jg_poundlist a LEFT JOIN jg_vehicle b on a.vehicle_id = b.id
|
||||
LEFT JOIN jg_supplier c on a.supplier_id = c.id
|
||||
LEFT JOIN jg_customer d on a.customer_id = d.id
|
||||
where a.is_examine = '1'
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (b.ticketno LIKE CONCAT('%',#{keyword},'%') OR c.supplier_name LIKE CONCAT('%',#{keyword},'%') OR d.supplier_nm LIKE CONCAT('%',#{keyword},'%')) ORDER BY a.creator_time desc
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -1,298 +1,642 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<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" >
|
||||
<p>{{dataForm.documentNo}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号" prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo" placeholder="请输入单据编号" clearable :style='{"width":"100%"}' readonly>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="业务日期"
|
||||
prop="businessDate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.businessDate)}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务日期" prop="businessDate">
|
||||
<el-date-picker v-model="dataForm.businessDate" placeholder="请选择业务日期" clearable :style='{"width":"100%"}'
|
||||
type="date" format="yyyy-MM-dd" value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="金额"
|
||||
prop="amount" >
|
||||
<p>{{dataForm.amount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input-number v-model="dataForm.amount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="数量"
|
||||
prop="quantity" >
|
||||
<p>{{dataForm.quantity}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input-number v-model="dataForm.quantity" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票类型"
|
||||
prop="invoiceType" >
|
||||
<p>{{ dataForm.invoiceType | dynamicText(invoiceTypeOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型" prop="invoiceType">
|
||||
<el-select v-model="dataForm.invoiceType" placeholder="请选择" :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceTypeOptions" :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" >
|
||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 " prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<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="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据状态"
|
||||
prop="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
<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="invoiceAmount" >
|
||||
<p>{{dataForm.invoiceAmount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票金额" prop="invoiceAmount">
|
||||
<el-input-number v-model="dataForm.invoiceAmount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity" >
|
||||
<p>{{dataForm.invoiceQuantity}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票数量" prop="invoiceQuantity">
|
||||
<el-input-number v-model="dataForm.invoiceQuantity" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' readonly>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="采购订单号"
|
||||
prop="purchaseorderId" >
|
||||
<p>{{dataForm.purchaseorderId}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购订单号" prop="purchaseorderId">
|
||||
<popupSelect v-model="dataForm.purchaseorderId" placeholder="请选择" clearable field="purchaseorderId"
|
||||
interfaceId="389673535976550149" :columnOptions="purchaseorderIdcolumnOptions" propsValue="id"
|
||||
relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractId" >
|
||||
<p>{{dataForm.contractId}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同" prop="contractId">
|
||||
<popupSelect v-model="dataForm.contractId" placeholder="请选择" clearable field="contractId"
|
||||
interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions" propsValue="id"
|
||||
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="供应商"
|
||||
prop="supplierId" >
|
||||
<p>{{dataForm.supplierId}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<popupSelect v-model="dataForm.supplierId" placeholder="请选择" clearable field="supplierId"
|
||||
interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions" propsValue="id"
|
||||
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activebzsrnx" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应付明细">
|
||||
<el-col :span="24" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>设计子表</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.invoicesitem1List" size='mini' >
|
||||
<el-table :data="dataForm.invoicesitem1List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="materialId" label="物料">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.materialId}}</p>
|
||||
<popupSelect v-model="scope.row.materialId" placeholder="请选择" clearable
|
||||
:field="'materialId'+scope.$index" interfaceId="397736371898382533"
|
||||
:columnOptions="invoicesitem1materialIdcolumnOptions" propsValue="id"
|
||||
relationField="item_name" popupType="dialog" popupWidth="800px" hasPage :pageSize="20" :disabled="true">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="数量">
|
||||
<el-table-column prop="quantity" label="结算重量">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.quantity}}</p>
|
||||
<el-input v-model="scope.row.quantity" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitPrice" label="单价">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.unitPrice}}</p>
|
||||
<el-input v-model="scope.row.unitPrice" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
|
||||
<el-select v-model="scope.row.taxRate" placeholder="请选择 " clearable :style='{"width":"100%"}' :disabled="true">
|
||||
<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="taxAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.taxAmount}}</p>
|
||||
<el-input v-model="scope.row.taxAmount" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amountNotTax}}</p>
|
||||
<el-input v-model="scope.row.amountNotTax" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.remark}}</p>
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</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="delinvoicesitem1List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addinvoicesitem1List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.invoicesitem0List" size='mini' >
|
||||
<el-table :data="dataForm.invoicesitem0List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="materialName" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.materialName}}</p>
|
||||
<el-input v-model="scope.row.materialName" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.invoiceCode}}</p>
|
||||
<el-input v-model="scope.row.invoiceCode" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号码">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.invoiceNo}}</p>
|
||||
<el-input v-model="scope.row.invoiceNo" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量">
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量" width="150" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.invoiceQuantity}}</p>
|
||||
<!-- <el-input v-model="scope.row.invoiceQuantity" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' @change="invoiceQuantityChange">
|
||||
</el-input> -->
|
||||
<el-input-number v-model="scope.row.invoiceQuantity" placeholder="数字文本" :step="1" :style='{"width":"100%"}' @change="invoiceQuantityChange">
|
||||
|
||||
</el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额">
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" width="150" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.invoiceAmount}}</p>
|
||||
<!-- <el-input v-model="scope.row.invoiceAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input> -->
|
||||
<el-input-number v-model="scope.row.invoiceAmount" placeholder="数字文本" :step="1" :precision="6" :style='{"width":"100%"}' @change="invoiceAmountChange">
|
||||
|
||||
</el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
|
||||
<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="taxAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.taxAmount}}</p>
|
||||
<el-input v-model="scope.row.taxAmount" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amountNotTax}}</p>
|
||||
<el-input v-model="scope.row.amountNotTax" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceStatus" label="发票状态 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.invoiceStatus | dynamicText(invoiceStatusOptions) }}</p>
|
||||
<el-select v-model="scope.row.invoiceStatus" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="开票人">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.creatorUserName}}</p>
|
||||
<el-input v-model="scope.row.creatorUserName" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoicingDate" label="开票日期">
|
||||
<template slot-scope="scope">
|
||||
<p>{{jnpf.dateFormat(scope.row.invoicingDate)}}</p>
|
||||
<el-date-picker v-model="scope.row.invoicingDate" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp">
|
||||
</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="delinvoicesitem0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addinvoicesitem0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</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 PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
id :'',
|
||||
documentNo : '',
|
||||
businessDate : '',
|
||||
amount : 0,
|
||||
quantity : 0,
|
||||
invoiceType : "1",
|
||||
currency : "",
|
||||
remark : '',
|
||||
status : "0",
|
||||
invoiceAmount : 0,
|
||||
invoiceQuantity : 0,
|
||||
purchaseorderId : "",
|
||||
contractId : "",
|
||||
supplierId : "",
|
||||
invoicesitem1List:[],
|
||||
invoicesitem0List:[],
|
||||
documentNo: '',
|
||||
businessDate: '',
|
||||
amount: 0,
|
||||
quantity: 0,
|
||||
invoiceType: "1",
|
||||
currency: "",
|
||||
remark: '',
|
||||
status: "0",
|
||||
invoiceAmount: 0,
|
||||
invoiceQuantity: 0,
|
||||
purchaseorderId: "",
|
||||
contractId: "",
|
||||
supplierId: "",
|
||||
invoicesitem1List: [],
|
||||
invoicesitem0List: [],
|
||||
},
|
||||
activebzsrnx:'1',
|
||||
invoiceTypeOptions:[{"fullName":"普通增值税发票","id":"1"},{"fullName":"专用增值税发票","id":"2"},{"fullName":"增值税电子普通发票","id":"3"},{"fullName":"增值税电子发票","id":"4"}],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
activebzsrnx: '0',
|
||||
rules: {},
|
||||
invoiceTypeOptions: [{
|
||||
"fullName": "普通增值税发票",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "专用增值税发票",
|
||||
"id": "2"
|
||||
}, {
|
||||
"fullName": "增值税电子普通发票",
|
||||
"id": "3"
|
||||
}, {
|
||||
"fullName": "增值税电子发票",
|
||||
"id": "4"
|
||||
}],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}],
|
||||
purchaseorderIdcolumnOptions: [{
|
||||
"label": "采购订单号",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "合同",
|
||||
"value": "contractName"
|
||||
}, {
|
||||
"label": "供应商",
|
||||
"value": "supplier"
|
||||
}, {
|
||||
"label": "金额",
|
||||
"value": "amount"
|
||||
}, {
|
||||
"label": "数量",
|
||||
"value": "num"
|
||||
}, ],
|
||||
contractIdcolumnOptions: [{
|
||||
"label": "合同编码",
|
||||
"value": "contract_code"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
}, ],
|
||||
supplierIdcolumnOptions: [{
|
||||
"label": "供应商编码",
|
||||
"value": "supplier_code"
|
||||
}, {
|
||||
"label": "供应商名称",
|
||||
"value": "supplier_name"
|
||||
}, {
|
||||
"label": "供应商地点",
|
||||
"value": "supplier_site_code"
|
||||
}, ],
|
||||
|
||||
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"}],
|
||||
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"}],
|
||||
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}],
|
||||
invoicesitem1materialIdcolumnOptions: [{
|
||||
"label": "物料编码",
|
||||
"value": "item_code"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "item_name"
|
||||
}, {
|
||||
"label": "单位",
|
||||
"value": "primary_unit_of_measure"
|
||||
}, {
|
||||
"label": "可采购",
|
||||
"value": "purchase_flag_name"
|
||||
}, {
|
||||
"label": "可销售",
|
||||
"value": "sales_flag_name"
|
||||
}, ],
|
||||
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"
|
||||
}],
|
||||
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"
|
||||
}],
|
||||
invoiceStatusOptions: [{
|
||||
"fullName": "正常",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "红冲",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "作废",
|
||||
"id": "2"
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.invoicesitem1List.length;i++){
|
||||
var _list = _dataAll.invoicesitem1List[i];
|
||||
invoiceQuantityChange(e){
|
||||
var invoiceQuantity = 0;
|
||||
this.dataForm.invoicesitem0List.forEach((item, index)=>{
|
||||
invoiceQuantity = invoiceQuantity + parseFloat(item.invoiceQuantity);
|
||||
});
|
||||
this.dataForm.invoiceQuantity = invoiceQuantity;
|
||||
},
|
||||
invoiceAmountChange(e){
|
||||
var invoiceAmount = 0
|
||||
this.dataForm.invoicesitem0List.forEach((item, index)=>{
|
||||
invoiceAmount = invoiceAmount + parseFloat(item.invoiceAmount);
|
||||
});
|
||||
this.dataForm.invoiceAmount = invoiceAmount;
|
||||
},
|
||||
invoicesitem1Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.invoicesitem1List.length; i++) {
|
||||
const e = this.dataForm.invoicesitem1List[i];
|
||||
}
|
||||
for(let i=0;i<_dataAll.invoicesitem0List.length;i++){
|
||||
var _list = _dataAll.invoicesitem0List[i];
|
||||
_list.invoicingDate = _list.invoicingDate ? jnpf.dateFormat(_list.invoicingDate) : ''
|
||||
return isOk;
|
||||
},
|
||||
invoicesitem0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.invoicesitem0List.length; i++) {
|
||||
const e = this.dataForm.invoicesitem0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
return isOk;
|
||||
},
|
||||
|
||||
init(id) {
|
||||
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] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/invoices/Invoices/detail/'+this.dataForm.id,
|
||||
url: '/api/invoices/Invoices/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
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.invoicesitem1Exist()) return
|
||||
if (!this.invoicesitem0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/invoices/Invoices',
|
||||
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/invoices/Invoices/' + 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)
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addinvoicesitem1List() {
|
||||
let item = {
|
||||
materialId: undefined,
|
||||
quantity: undefined,
|
||||
unitPrice: undefined,
|
||||
amount: undefined,
|
||||
taxRate: undefined,
|
||||
taxAmount: undefined,
|
||||
amountNotTax: undefined,
|
||||
remark: undefined,
|
||||
}
|
||||
this.dataForm.invoicesitem1List.push(item)
|
||||
},
|
||||
delinvoicesitem1List(index) {
|
||||
this.dataForm.invoicesitem1List.splice(index, 1);
|
||||
},
|
||||
addinvoicesitem0List() {
|
||||
let item = {
|
||||
materialName: undefined,
|
||||
invoiceCode: undefined,
|
||||
invoiceNo: undefined,
|
||||
invoiceQuantity: undefined,
|
||||
invoiceAmount: undefined,
|
||||
taxRate: undefined,
|
||||
taxAmount: undefined,
|
||||
amountNotTax: undefined,
|
||||
invoiceStatus: undefined,
|
||||
creatorUserName: undefined,
|
||||
invoicingDate: undefined,
|
||||
}
|
||||
this.dataForm.invoicesitem0List.push(item)
|
||||
},
|
||||
delinvoicesitem0List(index) {
|
||||
this.dataForm.invoicesitem0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for (let i = 0; i < _data.invoicesitem1List.length; i++) {
|
||||
var _list = _data.invoicesitem1List[i];
|
||||
}
|
||||
for (let i = 0; i < _data.invoicesitem0List.length; i++) {
|
||||
var _list = _data.invoicesitem0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
for (let i = 0; i < _dataAll.invoicesitem1List.length; i++) {
|
||||
var _list = _dataAll.invoicesitem1List[i];
|
||||
}
|
||||
for (let i = 0; i < _dataAll.invoicesitem0List.length; i++) {
|
||||
var _list = _dataAll.invoicesitem0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,254 +1,499 @@
|
||||
<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" >
|
||||
<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" >
|
||||
<p>{{dataForm.documentno}}</p>
|
||||
<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="suppliername" >
|
||||
<p>{{dataForm.suppliername}}</p>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="供应商" required prop="suppliername">
|
||||
<el-input v-model="dataForm.suppliername" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="付款类型"
|
||||
prop="paymenttype" >
|
||||
<p>{{ dataForm.paymenttype | dynamicText(paymenttypeOptions) }} </p>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款类型" prop="paymenttype">
|
||||
<el-select v-model="dataForm.paymenttype" placeholder="请选择付款类型" clearable :style='{"width":"100%"}'>
|
||||
<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="paymentaccount" >
|
||||
<p>{{dataForm.paymentaccount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款账户" prop="paymentaccount">
|
||||
<el-input v-model="dataForm.paymentaccount" placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="付款银行"
|
||||
prop="paymentbank" >
|
||||
<p>{{dataForm.paymentbank}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款银行" prop="paymentbank">
|
||||
<el-input v-model="dataForm.paymentbank" placeholder="请输入付款银行" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="付款金额"
|
||||
prop="paymentamount" >
|
||||
<p>{{dataForm.paymentamount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款金额" prop="paymentamount">
|
||||
<el-input v-model="dataForm.paymentamount" placeholder="请输入付款金额" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款账户"
|
||||
prop="collectionaccount" >
|
||||
<p>{{dataForm.collectionaccount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款账户" prop="collectionaccount">
|
||||
<el-input v-model="dataForm.collectionaccount" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款银行"
|
||||
prop="collectionbank" >
|
||||
<p>{{dataForm.collectionbank}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款银行" prop="collectionbank">
|
||||
<el-input v-model="dataForm.collectionbank" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="申请金额"
|
||||
prop="requestedamount" >
|
||||
<p>{{dataForm.requestedamount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请金额" prop="requestedamount">
|
||||
<el-input v-model="dataForm.requestedamount" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="应付日期"
|
||||
prop="duedate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.duedate)}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应付日期" prop="duedate">
|
||||
<el-date-picker v-model="dataForm.duedate" placeholder="请选择" clearable :style='{"width":"100%"}'
|
||||
type="date" format="yyyy-MM-dd" value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别 "
|
||||
prop="currency" >
|
||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 " prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<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" >
|
||||
<p>{{ dataForm.settlementtype | dynamicText(settlementtypeOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="结算类型" required prop="settlementtype">
|
||||
<el-select v-model="dataForm.settlementtype" placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<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="paymentno" >
|
||||
<p>{{dataForm.paymentno}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="来源单号" prop="paymentno">
|
||||
<el-input v-model="dataForm.paymentno" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据状态"
|
||||
prop="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
<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="24">
|
||||
<el-tabs v-model="activeivpzpd" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="申请明细">
|
||||
<el-col :span="24" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.payment_item0List" size='mini' >
|
||||
<el-table :data="dataForm.payment_item0List" size='mini' show-summary :summary-method="getSummaries" >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="amount" label="付款金额">
|
||||
<el-table-column prop="amount" width="150" label="付款金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requestAmount" width="150" label="申请金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
<el-input v-model="scope.row.requestAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserId" label="申请金额">
|
||||
<el-table-column prop="allAmount" width="150" label="订单金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.creatorUserId}}</p>
|
||||
<el-input v-model="scope.row.allAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="订单金额">
|
||||
<el-table-column prop="payPrice" width="150" label="已付金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.creatorUserName}}</p>
|
||||
<el-input v-model="scope.row.payPrice" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastModifyUserId" label="已付金额">
|
||||
<el-table-column prop="documentNo" width="150" label="订单编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.lastModifyUserId}}</p>
|
||||
<el-input v-model="scope.row.documentNo" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastModifyUserName" label="订单编号">
|
||||
<el-table-column prop="contractNo" width="150" label="合同编码" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.lastModifyUserName}}</p>
|
||||
<el-input v-model="scope.row.contractNo" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lastModifyTime" label="合同编码">
|
||||
<el-table-column prop="num" width="150" label="结算重量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.lastModifyTime}}</p>
|
||||
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deleteUserId" label="重量">
|
||||
<el-table-column prop="advanceAmount" width="150" label="垫资金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.deleteUserId}}</p>
|
||||
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deleteTime" label="垫资金额">
|
||||
<el-table-column prop="rate" width="150" label="税额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.deleteTime}}</p>
|
||||
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orgnizeId" label="税额">
|
||||
<el-table-column prop="notAmount" width="150" label="不含税金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.orgnizeId}}</p>
|
||||
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="departmentId" label="不含税金额">
|
||||
<el-table-column prop="creatorTime" label="业务日期" align="center" width="160">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.departmentId}}</p>
|
||||
<el-date-picker v-model="scope.row.creatorTime" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" readonly>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="业务日期">
|
||||
<el-table-column label="操作" width="50" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delpayment_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addpayment_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</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 PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
excludeFields: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
id :'',
|
||||
documentno : '',
|
||||
suppliername : '',
|
||||
paymenttype : "0",
|
||||
paymentaccount : '',
|
||||
paymentbank : '',
|
||||
paymentamount : '',
|
||||
collectionaccount : '',
|
||||
collectionbank : '',
|
||||
requestedamount : '',
|
||||
duedate : '',
|
||||
currency : "0",
|
||||
settlementtype : "0",
|
||||
paymentno : '',
|
||||
remark : '',
|
||||
status : "0",
|
||||
payment_item0List:[],
|
||||
},
|
||||
activeivpzpd:'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"}],
|
||||
documentno: '',
|
||||
suppliername: '',
|
||||
paymenttype: "0",
|
||||
paymentaccount: '',
|
||||
paymentbank: '',
|
||||
paymentamount: '',
|
||||
collectionaccount: '',
|
||||
collectionbank: '',
|
||||
requestedamount: '',
|
||||
duedate: '',
|
||||
currency: "0",
|
||||
settlementtype: "0",
|
||||
paymentno: '',
|
||||
remark: '',
|
||||
status: "0",
|
||||
payment_item0List: [],
|
||||
},
|
||||
activeivpzpd: '0',
|
||||
rules: {
|
||||
suppliername: [],
|
||||
paymentaccount: [],
|
||||
paymentamount: [{
|
||||
required: true,
|
||||
message: '请输入付款金额',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/,
|
||||
message: '请输入正确的金额',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
},
|
||||
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"
|
||||
}],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
watch: {
|
||||
dataForm: {
|
||||
deep: true,
|
||||
handler: function() {
|
||||
|
||||
this.popupSelect()
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.payment_item0List.length;i++){
|
||||
var _list = _dataAll.payment_item0List[i];
|
||||
_list.creatorTime = _list.creatorTime ? jnpf.dateFormat(_list.creatorTime) : ''
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 5 || index === 6|| index === 7|| index === 8 )) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
|
||||
popupSelect() {
|
||||
let amount = 0
|
||||
for (let i = 0; i < this.dataForm.payment_item0List.length; i++) {
|
||||
amount = amount + parseFloat(this.dataForm.payment_item0List[i].amount);
|
||||
}
|
||||
parseFloat(this.dataForm.paymentamount = amount)
|
||||
},
|
||||
|
||||
init(id) {
|
||||
payment_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.payment_item0List.length; i++) {
|
||||
const e = this.dataForm.payment_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] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/payment/Payment/detail/'+this.dataForm.id,
|
||||
url: '/api/payment/Payment/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
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.payment_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/payment/Payment',
|
||||
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/payment/Payment/' + 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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addpayment_item0List() {
|
||||
let item = {
|
||||
amount: undefined,
|
||||
creatorUserId: undefined,
|
||||
creatorUserName: undefined,
|
||||
lastModifyUserId: undefined,
|
||||
lastModifyUserName: undefined,
|
||||
lastModifyTime: undefined,
|
||||
deleteUserId: undefined,
|
||||
deleteTime: undefined,
|
||||
orgnizeId: undefined,
|
||||
departmentId: undefined,
|
||||
creatorTime: undefined,
|
||||
}
|
||||
this.dataForm.payment_item0List.push(item)
|
||||
},
|
||||
delpayment_item0List(index) {
|
||||
this.dataForm.payment_item0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for (let i = 0; i < _data.payment_item0List.length; i++) {
|
||||
var _list = _data.payment_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
for (let i = 0; i < _dataAll.payment_item0List.length; i++) {
|
||||
var _list = _dataAll.payment_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,235 +1,508 @@
|
||||
<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" >
|
||||
<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" >
|
||||
<p>{{dataForm.documentNo}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="采购订单"
|
||||
prop="purchaseOrderId" >
|
||||
<p>{{dataForm.purchaseOrderId}}</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_purchaseorder_jnpf_contractName" >
|
||||
<p>{{dataForm.jnpf_jg_purchaseorder_jnpf_contractName}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号" prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="供应商名称"
|
||||
prop="jnpf_jg_purchaseorder_jnpf_supplierName" >
|
||||
<p>{{dataForm.jnpf_jg_purchaseorder_jnpf_supplierName}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购订单" prop="purchaseOrderId">
|
||||
<popupSelect v-model="dataForm.purchaseOrderId" placeholder="请选择" clearable
|
||||
field="purchaseOrderId" interfaceId="383149471917185157"
|
||||
:columnOptions="purchaseOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id"
|
||||
relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="实退金额"
|
||||
prop="actualAmount" >
|
||||
<p>{{dataForm.actualAmount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 " prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
<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="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退货金额" prop="refundAmount">
|
||||
<el-input v-model="dataForm.refundAmount" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="创建时间"
|
||||
prop="creatorTime" >
|
||||
<p>{{dataForm.creatorTime}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退货数量" prop="refundNum">
|
||||
<el-input v-model="dataForm.refundNum" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="创建人"
|
||||
prop="creatorUserName" >
|
||||
<p>{{dataForm.creatorUserName}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeyrmekt" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.purchaseback_item0List" size='mini' >
|
||||
<el-table :data="dataForm.purchaseback_item0List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="licenseNum" label="车牌号">
|
||||
<el-table-column prop="vehicleId" label="车辆" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.licenseNum}}</p>
|
||||
<popupSelect v-model="scope.row.vehicleId" placeholder="请选择" clearable
|
||||
:field="'vehicleId'+scope.$index" interfaceId="389754644018016581"
|
||||
:columnOptions="purchaseorderitem0vehicleIdcolumnOptions" propsValue="vehicle_id"
|
||||
relationField="ticketno" popupType="dialog" popupWidth="800px" hasPage :pageSize="20">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialName" label="物料名称">
|
||||
<el-table-column prop="materialId" label="物料" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.materialName}}</p>
|
||||
<popupSelect v-model="scope.row.materialId" placeholder="请选择" clearable
|
||||
:field="'materialId'+scope.$index" interfaceId="397736371898382533"
|
||||
:columnOptions="purchaseorderitem0materialIdcolumnOptions" propsValue="id"
|
||||
relationField="item_name" popupType="dialog" popupWidth="800px" hasPage :pageSize="20"
|
||||
:disabled="true">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="settlement" label="结算重量 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.settlement}}</p>
|
||||
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
|
||||
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
<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="采购单价">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.price}}</p>
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p>
|
||||
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
<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="应退金额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.notAmount}}</p>
|
||||
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pountUser" label="业务员">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.pountUser}}</p>
|
||||
<el-input v-model="scope.row.pountUser" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pountType" label="磅单类型 ">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.pountType | dynamicText(pountTypeOptions) }}</p>
|
||||
<el-select v-model="scope.row.pountType" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
<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="delpurchaseback_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addpurchaseback_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
<Form v-if="formVisible" ref="form" />
|
||||
</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 PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
components: { },
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
bissId: '380716763022647941',
|
||||
excludeFields: [],
|
||||
formVisible: false,
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
id :'',
|
||||
documentNo : '',
|
||||
purchaseOrderId : "",
|
||||
currency : "0",
|
||||
refundAmount : '',
|
||||
refundNum : '',
|
||||
remark : '',
|
||||
actualAmount : '',
|
||||
status : "0",
|
||||
creatorTime : "",
|
||||
creatorUserName : "",
|
||||
purchaseback_item0List:[],
|
||||
jg_purchaseorder:
|
||||
{
|
||||
contractName:'',
|
||||
supplierName:'',
|
||||
documentNo: '',
|
||||
purchaseOrderId: "",
|
||||
currency: "0",
|
||||
refundAmount: '',
|
||||
refundNum: '',
|
||||
remark: '',
|
||||
actualAmount: '',
|
||||
status: "0",
|
||||
creatorTime: "",
|
||||
creatorUserName: "",
|
||||
purchaseback_item0List: [],
|
||||
jg_purchaseorder: {
|
||||
contractName: '',
|
||||
supplierName: '',
|
||||
},
|
||||
jnpf_jg_purchaseorder_jnpf_contractName:'',
|
||||
jnpf_jg_purchaseorder_jnpf_supplierName:'',
|
||||
jnpf_jg_purchaseorder_jnpf_contractName: '',
|
||||
jnpf_jg_purchaseorder_jnpf_supplierName: '',
|
||||
},
|
||||
activeyrmekt:'0',
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
activeyrmekt: '0',
|
||||
rules: {},
|
||||
purchaseOrderIdcolumnOptions: [{
|
||||
"label": "ID",
|
||||
"value": "id"
|
||||
}, {
|
||||
"label": "采购订单号",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
}, {
|
||||
"label": "供应商名称",
|
||||
"value": "supplier_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"
|
||||
}],
|
||||
|
||||
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"}],
|
||||
purchaseback_item0licenseNumcolumnOptions: [{
|
||||
"label": "车牌号",
|
||||
"value": "license_num"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "material_name"
|
||||
}, {
|
||||
"label": "结算重量",
|
||||
"value": "settlement"
|
||||
}, {
|
||||
"label": "计量单位",
|
||||
"value": "unit"
|
||||
}, {
|
||||
"label": "采购单价",
|
||||
"value": "price"
|
||||
}, {
|
||||
"label": "税率",
|
||||
"value": "rate"
|
||||
}, {
|
||||
"label": "应退金额",
|
||||
"value": "amount"
|
||||
}, {
|
||||
"label": "税额",
|
||||
"value": "not_amount"
|
||||
}, {
|
||||
"label": "业务员",
|
||||
"value": "pount_user"
|
||||
}, {
|
||||
"label": "磅单类型",
|
||||
"value": "pount_type"
|
||||
}, ],
|
||||
purchaseorderitem0materialIdcolumnOptions: [{
|
||||
"label": "物料编码",
|
||||
"value": "item_code"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "item_name"
|
||||
}, {
|
||||
"label": "单位",
|
||||
"value": "primary_unit_of_measure"
|
||||
}, {
|
||||
"label": "可采购",
|
||||
"value": "purchase_flag_name"
|
||||
}, {
|
||||
"label": "可销售",
|
||||
"value": "sales_flag_name"
|
||||
}, ],
|
||||
purchaseorderitem0vehicleIdcolumnOptions: [{
|
||||
"label": "车牌号",
|
||||
"value": "ticketno"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "item_name"
|
||||
}, {
|
||||
"label": "结算重量",
|
||||
"value": "settlement"
|
||||
}, {
|
||||
"label": "计量单位",
|
||||
"value": "unitName"
|
||||
}, {
|
||||
"label": "采购单价",
|
||||
"value": "purchase_price"
|
||||
}, {
|
||||
"label": "磅单类型",
|
||||
"value": "poundTypeName"
|
||||
}, ],
|
||||
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() {
|
||||
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
_dataAll.jnpf_jg_purchaseorder_jnpf_contractName = _dataAll.jg_purchaseorder.contractName
|
||||
_dataAll.jnpf_jg_purchaseorder_jnpf_supplierName = _dataAll.jg_purchaseorder.supplierName
|
||||
for(let i=0;i<_dataAll.purchaseback_item0List.length;i++){
|
||||
var _list = _dataAll.purchaseback_item0List[i];
|
||||
popupSelectChange2(a, b){
|
||||
var excludeFields = [];
|
||||
|
||||
for (let i = 0; i < this.dataForm.purchaseback_item0List.length; i++) {
|
||||
excludeFields.push(this.dataForm.purchaseback_item0List[i].licenseNo);
|
||||
if(a == this.dataForm.purchaseback_item0List[i].licenseNum){
|
||||
this.dataForm.purchaseback_item0List[i].materialName = b.material_name;
|
||||
this.dataForm.purchaseback_item0List[i].settlement = b.settlement;
|
||||
this.dataForm.purchaseback_item0List[i].unit = b.unit;
|
||||
this.dataForm.purchaseback_item0List[i].price = b.price;
|
||||
this.dataForm.purchaseback_item0List[i].rate = b.rate;
|
||||
this.dataForm.purchaseback_item0List[i].amount = b.amount;
|
||||
this.dataForm.purchaseback_item0List[i].notAmount = b.not_amount;
|
||||
this.dataForm.purchaseback_item0List[i].pountUser = b.pount_user;
|
||||
this.dataForm.purchaseback_item0List[i].pountType = b.pount_type;
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
this.excludeFields = excludeFields;
|
||||
},
|
||||
|
||||
init(id) {
|
||||
popupSelectChange(e,d){
|
||||
this.dataForm.currency = d.currency;
|
||||
this.excludeFields = [];
|
||||
this.dataForm.receiptout_item0List = [];
|
||||
},
|
||||
purchaseback_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.purchaseback_item0List.length; i++) {
|
||||
const e = this.dataForm.purchaseback_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] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/purchaseback/Purchaseback/detail/'+this.dataForm.id,
|
||||
url: '/api/purchaseback/Purchaseback/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
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.purchaseback_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/purchaseback/Purchaseback',
|
||||
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/purchaseback/Purchaseback/' + 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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addpurchaseback_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.purchaseback_item0List.push(item)
|
||||
},
|
||||
delpurchaseback_item0List(index) {
|
||||
this.dataForm.purchaseback_item0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.jg_purchaseorder.contractName = _data.jnpf_jg_purchaseorder_jnpf_contractName
|
||||
_data.jg_purchaseorder.supplierName = _data.jnpf_jg_purchaseorder_jnpf_supplierName
|
||||
for (let i = 0; i < _data.purchaseback_item0List.length; i++) {
|
||||
var _list = _data.purchaseback_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
_dataAll.jnpf_jg_purchaseorder_jnpf_contractName = _dataAll.jg_purchaseorder.contractName
|
||||
_dataAll.jnpf_jg_purchaseorder_jnpf_supplierName = _dataAll.jg_purchaseorder.supplierName
|
||||
for (let i = 0; i < _dataAll.purchaseback_item0List.length; i++) {
|
||||
var _list = _dataAll.purchaseback_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,227 +1,671 @@
|
||||
<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" >
|
||||
<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" >
|
||||
<p>{{dataForm.documentno}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="业务类型"
|
||||
prop="type" >
|
||||
<p>{{ dataForm.type | dynamicText(typeOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="来源单号"
|
||||
prop="souceno" >
|
||||
<p>{{dataForm.souceno}}</p>
|
||||
<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="receiptamount" >
|
||||
<p>{{dataForm.receiptamount}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务类型" required prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择业务类型" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in typeOptions" :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" >
|
||||
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="来源单号" required prop="souceno">
|
||||
<popupSelect v-model="dataForm.souceno" placeholder="请选择" clearable field="souceno"
|
||||
interfaceId="392931756640102277" :columnOptions="soucenocolumnOptions" propsValue="document_no"
|
||||
relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
|
||||
@change="popupSelect">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="来源单号" prop="souceno">
|
||||
<popupSelect v-model="dataForm.souceno" placeholder="请选择" clearable field="souceno"
|
||||
interfaceId="392931756640102277" :columnOptions="soucenocolumnOptions" propsValue="id"
|
||||
relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="入库数量"
|
||||
prop="receiptnum" >
|
||||
<p>{{dataForm.receiptnum}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库金额" prop="receiptamount">
|
||||
<el-input v-model="dataForm.receiptamount" placeholder="请输入入库金额" readonly>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="供应商名称"
|
||||
prop="suppliername" >
|
||||
<p>{{dataForm.suppliername}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别" prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择币别" readonly>
|
||||
<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="16" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入库重量" prop="receiptnum">
|
||||
<el-input v-model="dataForm.receiptnum" placeholder="请输入入库重量" readonly>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="入库日期"
|
||||
prop="warehousingdate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.warehousingdate)}}</p>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="供应商名称" prop="suppliername">
|
||||
<el-input v-model="dataForm.suppliername" placeholder="请输入供应商名称" readonly>
|
||||
|
||||
</el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="供应商id" prop="supplierId">
|
||||
<popupSelect v-model="dataForm.supplierId" placeholder="请选择" clearable field="supplierId"
|
||||
interfaceId="397751667988199621" :columnOptions="supplierIdcolumnOptions" propsValue="id"
|
||||
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="单据状态"
|
||||
prop="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入供应商名称" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" >-->
|
||||
<!-- <el-form-item label="入库日期"-->
|
||||
<!-- prop="warehousingdate" >-->
|
||||
<!-- <el-date-picker v-model="dataForm.warehousingdate"-->
|
||||
<!-- placeholder="请选择入库日期" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >-->
|
||||
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12" >-->
|
||||
<!-- <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="24">
|
||||
<el-tabs v-model="activevpzhms" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.receiptin_item0List" size='mini' >
|
||||
<el-table :data="dataForm.receiptin_item0List" size='mini' show-summary
|
||||
:summary-method="getSummaries">
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="licenseno" label="车牌号">
|
||||
<!-- <el-table-column prop="licenseno" width="140" label="车牌号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.licenseno}}</p>
|
||||
<popupSelect v-model="scope.row.licenseno" placeholder="请选择" clearable
|
||||
:field="'licenseno'+scope.$index" interfaceId="392933121244325765"
|
||||
:columnOptions="receiptin_item0licensenocolumnOptions" propsValue="license_num"
|
||||
relationField="license_num" popupType="dialog" popupWidth="1000px" popupTitle="选择车牌"
|
||||
:bissId="dataForm.souceno" :excludeFields="excludeFields" @change="popupSelect2">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column prop="vehicleId" width="150" label="车辆">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.vehicleId" placeholder="请选择" clearable
|
||||
:field="'vehicleId'+scope.$index" interfaceId="392933121244325765"
|
||||
:columnOptions="jg_receiptin_item0vehicleIdcolumnOptions" propsValue="vehicle_id"
|
||||
relationField="ticketno" :bissId="dataForm.souceno" popupType="dialog" popupWidth="800px" @change="popupSelect2"
|
||||
hasPage :pageSize="20" :disabled="true">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialname" label="物料名称">
|
||||
<el-table-column prop="materialId" width="200" label="物料">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.materialname}}</p>
|
||||
<popupSelect v-model="scope.row.materialId" placeholder="请选择" clearable
|
||||
:field="'materialId'+scope.$index" interfaceId="398448695651178885"
|
||||
:columnOptions="jg_receiptin_item0materialIdcolumnOptions" propsValue="id"
|
||||
relationField="item_name" popupType="dialog" popupWidth="800px" hasPage :pageSize="20" :disabled="true">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reservoirareaId" label="库区名称">
|
||||
<!-- <el-table-column prop="materialname" width="140" label="物料名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.materialname" placeholder="请输入" :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="reservoirareaId" width="140" label="库区" align="center">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.reservoirareaId" placeholder="请选择" clearable
|
||||
:field="'reservoirareaId'+scope.$index" interfaceId="392939299932268421"
|
||||
:columnOptions="receiptin_item0reservoirareaIdcolumnOptions" propsValue="id"
|
||||
relationField="areaname" popupType="dialog" popupWidth="800px" @change="popupSelect3">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="reservoirareaId" width="150" label="库区">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.reservoirareaId}}</p>
|
||||
<popupSelect v-model="scope.row.reservoirareaId" placeholder="请选择" clearable
|
||||
:field="'reservoirareaId'+scope.$index" interfaceId="392939299932268421"
|
||||
:columnOptions="jg_receiptin_item0reservoirareaIdcolumnOptions" propsValue="id"
|
||||
relationField="areaname" popupType="dialog" popupWidth="800px" @change="popupSelect3">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseId" label="仓库名称">
|
||||
<el-table-column prop="warehouseId" width="150" label="仓库">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.warehouseId}}</p>
|
||||
<popupSelect v-model="scope.row.warehouseId" placeholder="请选择" clearable
|
||||
:field="'warehouseId'+scope.$index" interfaceId="398450221434116485"
|
||||
:columnOptions="jg_receiptin_item0warehouseIdcolumnOptions" propsValue="id"
|
||||
relationField="name" popupType="dialog" popupWidth="800px" hasPage :pageSize="20" :disabled="true">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="入库重量">
|
||||
|
||||
<!-- <el-table-column prop="warehouseId" width="140" label="仓库名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.warehouseId" placeholder="请输入" clearable :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="num" width="140" label="入库重量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.num}}</p>
|
||||
<el-input v-model="scope.row.num" placeholder="请输入" clearable @input="inputChange()"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位">
|
||||
<el-table-column prop="unit" width="140" label="计量单位" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
|
||||
<el-select v-model="scope.row.unit" placeholder="请选择" clearable :disabled="true">
|
||||
<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="单价">
|
||||
<el-table-column prop="price" width="140" label="单价" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.price}}</p>
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" clearable :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率">
|
||||
<el-table-column prop="rate" width="140" label="税率" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p>
|
||||
<el-select v-model="scope.row.rate" placeholder="请选择" clearable :disabled="true">
|
||||
<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="金额">
|
||||
<el-table-column prop="amount" width="140" label="金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.amount}}</p>
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable @input="inputChange()"
|
||||
:disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rateamount" label="税额">
|
||||
<el-table-column prop="rateamount" width="140" label="税额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.rateamount}}</p>
|
||||
<el-input v-model="scope.row.rateamount" placeholder="请输入" clearable :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="batchno" label="批次号">
|
||||
<!-- <el-table-column prop="batchno" width="140" label="批次号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.batchno}}</p>
|
||||
<el-input v-model="scope.row.batchno" placeholder="请输入" clearable :disabled="true">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="poundType" label="磅单类型">
|
||||
<el-table-column prop="poundType" width="140" label="磅单类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.poundType" placeholder="请选择" clearable :disabled="true">
|
||||
<el-option v-for="(item, index) in poundTypeOptions" :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" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.poundType | dynamicText(poundTypeOptions) }}</p>
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delreceiptin_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addreceiptin_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</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 PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
excludeFields: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
id :'',
|
||||
documentno : '',
|
||||
type : "",
|
||||
souceno : "",
|
||||
receiptamount : '',
|
||||
currency : "0",
|
||||
receiptnum : '',
|
||||
suppliername : '',
|
||||
remark : '',
|
||||
warehousingdate : '',
|
||||
status : "0",
|
||||
creatorTime : "",
|
||||
creatorUserName : "",
|
||||
receiptin_item0List:[],
|
||||
},
|
||||
activevpzhms:'0',
|
||||
typeOptions:[{"fullName":"采购入库","id":"0"},{"fullName":"购销入库","id":"1"}],
|
||||
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"}],
|
||||
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"}],
|
||||
poundTypeOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
documentno: '',
|
||||
type: "",
|
||||
souceno: "",
|
||||
receiptamount: 0,
|
||||
currency: "0",
|
||||
receiptnum: 0,
|
||||
suppliername: '',
|
||||
remark: '',
|
||||
warehousingdate: '',
|
||||
status: "0",
|
||||
creatorTime: "",
|
||||
creatorUserName: "",
|
||||
receiptin_item0List: [],
|
||||
},
|
||||
activevpzhms: '0',
|
||||
rules: {},
|
||||
typeOptions: [{
|
||||
"fullName": "采购入库",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "购销入库",
|
||||
"id": "1"
|
||||
}],
|
||||
soucenocolumnOptions: [{
|
||||
"label": "采购订单",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "供应商名称",
|
||||
"value": "supplier_name"
|
||||
}, {
|
||||
"label": "币别",
|
||||
"value": "currencyLabel"
|
||||
}, ],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}],
|
||||
|
||||
jg_receiptin_item0vehicleIdcolumnOptions: [{
|
||||
"label": "车牌号",
|
||||
"value": "ticketno"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "material"
|
||||
}, {
|
||||
"label": "库区名称",
|
||||
"value": "areaName"
|
||||
}, {
|
||||
"label": "仓库名称",
|
||||
"value": "houseName"
|
||||
}, {
|
||||
"label": "入库数量",
|
||||
"value": "settlement"
|
||||
}, {
|
||||
"label": "计量单位",
|
||||
"value": "unitName"
|
||||
}, {
|
||||
"label": "单价",
|
||||
"value": "price"
|
||||
}, {
|
||||
"label": "税率",
|
||||
"value": "rate"
|
||||
}, {
|
||||
"label": "金额",
|
||||
"value": "amount"
|
||||
}, {
|
||||
"label": "批次号",
|
||||
"value": "poundlist_id"
|
||||
}, {
|
||||
"label": "磅单类型",
|
||||
"value": "pount_type"
|
||||
}, ],
|
||||
supplierIdcolumnOptions: [{
|
||||
"label": "供应商编码",
|
||||
"value": "supplier_code"
|
||||
}, {
|
||||
"label": "供应商名称",
|
||||
"value": "supplier_name"
|
||||
}, {
|
||||
"label": "供应商地址",
|
||||
"value": "supplier_site_code"
|
||||
}, ],
|
||||
jg_receiptin_item0materialIdcolumnOptions: [{
|
||||
"label": "物料编码",
|
||||
"value": "item_code"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "item_name"
|
||||
}, {
|
||||
"label": "单位",
|
||||
"value": "primary_unit_of_measure"
|
||||
}, ],
|
||||
jg_receiptin_item0reservoirareaIdcolumnOptions: [{
|
||||
"label": "库区编码",
|
||||
"value": "areacode"
|
||||
}, {
|
||||
"label": "库区名称",
|
||||
"value": "areaname"
|
||||
}, {
|
||||
"label": "最高库存",
|
||||
"value": "maximum"
|
||||
}, {
|
||||
"label": "安全库存",
|
||||
"value": "safety"
|
||||
}, {
|
||||
"label": "最低库存",
|
||||
"value": "minimum"
|
||||
}, {
|
||||
"label": "计量单位",
|
||||
"value": "unit"
|
||||
}, {
|
||||
"label": "仓库名称",
|
||||
"value": "name"
|
||||
}, ],
|
||||
jg_receiptin_item0warehouseIdcolumnOptions: [{
|
||||
"label": "仓库编码",
|
||||
"value": "code"
|
||||
}, {
|
||||
"label": "仓库名称",
|
||||
"value": "name"
|
||||
}, {
|
||||
"label": "仓库地点",
|
||||
"value": "location"
|
||||
}, ],
|
||||
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"
|
||||
}],
|
||||
poundTypeOptions: [{
|
||||
"fullName": "吨",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "千克",
|
||||
"id": "1"
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.receiptin_item0List.length;i++){
|
||||
var _list = _dataAll.receiptin_item0List[i];
|
||||
getSummaries(param) {
|
||||
const {
|
||||
columns,
|
||||
data
|
||||
} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value)) && (index === 5 || index === 9 || index === 10)) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
init(id) {
|
||||
return sums;
|
||||
},
|
||||
inputChange(value) {
|
||||
var num = 0;
|
||||
var amount = 0;
|
||||
for (let i = 0; i < this.dataForm.receiptin_item0List.length; i++) {
|
||||
num = num + parseFloat(this.dataForm.receiptin_item0List[i].num);
|
||||
amount = amount + parseFloat(this.dataForm.receiptin_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.receiptamount = amount;
|
||||
this.dataForm.receiptnum = num;
|
||||
},
|
||||
popupSelect(e, d) {
|
||||
this.dataForm.currency = d.currency;
|
||||
this.dataForm.suppliername = d.supplier_name;
|
||||
this.excludeFields = [];
|
||||
this.dataForm.receiptin_item0List = [];
|
||||
},
|
||||
popupSelect2(a, b) {
|
||||
var excludeFields = [];
|
||||
var num = 0;
|
||||
var amount = 0;
|
||||
for (let i = 0; i < this.dataForm.receiptin_item0List.length; i++) {
|
||||
excludeFields.push(this.dataForm.receiptin_item0List[i].licenseno);
|
||||
if (a == this.dataForm.receiptin_item0List[i].licenseno) {
|
||||
this.dataForm.receiptin_item0List[i].vehicleId = b.vehicleId;
|
||||
this.dataForm.receiptin_item0List[i].materialId = b.materialId;
|
||||
this.dataForm.receiptin_item0List[i].reservoirareaId = b.areaId;
|
||||
this.dataForm.receiptin_item0List[i].warehouseId = b.houseId;
|
||||
this.dataForm.receiptin_item0List[i].num = b.settlement;
|
||||
this.dataForm.receiptin_item0List[i].unit = b.unit;
|
||||
this.dataForm.receiptin_item0List[i].price = b.price;
|
||||
this.dataForm.receiptin_item0List[i].rate = b.rate;
|
||||
this.dataForm.receiptin_item0List[i].amount = b.amount;
|
||||
this.dataForm.receiptin_item0List[i].batchno = b.poundlist_id;
|
||||
this.dataForm.receiptin_item0List[i].poundType = b.pound_type;
|
||||
this.rateOptions.forEach((column, index) => {
|
||||
if (column.id == b.rate) {
|
||||
this.dataForm.receiptin_item0List[i].rateamount = b.amount * column.fullName;
|
||||
}
|
||||
});
|
||||
}
|
||||
num = num + parseFloat(this.dataForm.receiptin_item0List[i].num);
|
||||
amount = amount + parseFloat(this.dataForm.receiptin_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.receiptamount = amount;
|
||||
this.dataForm.receiptnum = num;
|
||||
this.excludeFields = excludeFields;
|
||||
},
|
||||
popupSelect3(j, k) {
|
||||
for (let i = 0; i < this.dataForm.receiptin_item0List.length; i++) {
|
||||
if (j == this.dataForm.receiptin_item0List[i].reservoirareaId) {
|
||||
this.dataForm.receiptin_item0List[i].warehouseId = k.warehouseId;
|
||||
}
|
||||
}
|
||||
},
|
||||
receiptin_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.receiptin_item0List.length; i++) {
|
||||
const e = this.dataForm.receiptin_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 if (data[key] instanceof Number) {
|
||||
data[key] = 0;
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/receiptin/Receiptin/detail/'+this.dataForm.id,
|
||||
url: '/api/receiptin/Receiptin/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
this.dataForm.receiptamount = 0.0;
|
||||
this.dataForm.receiptnum = 0.0;
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.receiptin_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/receiptin/Receiptin',
|
||||
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/receiptin/Receiptin/' + 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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addreceiptin_item0List() {
|
||||
let item = {
|
||||
licenseno: undefined,
|
||||
materialname: undefined,
|
||||
reservoirareaId: undefined,
|
||||
warehouseId: undefined,
|
||||
num: undefined,
|
||||
unit: undefined,
|
||||
price: undefined,
|
||||
rate: undefined,
|
||||
amount: undefined,
|
||||
rateamount: undefined,
|
||||
batchno: undefined,
|
||||
poundType: undefined,
|
||||
}
|
||||
this.dataForm.receiptin_item0List.push(item)
|
||||
},
|
||||
delreceiptin_item0List(index) {
|
||||
this.dataForm.receiptin_item0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for (let i = 0; i < _data.receiptin_item0List.length; i++) {
|
||||
var _list = _data.receiptin_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
for (let i = 0; i < _dataAll.receiptin_item0List.length; i++) {
|
||||
var _list = _dataAll.receiptin_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,226 +1,762 @@
|
||||
<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" >
|
||||
<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="24" >
|
||||
<el-form-item label="磅单上传"
|
||||
prop="poundPictures" >
|
||||
<JNPF-UploadFz v-model="dataForm.poundPictures"
|
||||
disabled
|
||||
detailed :fileSize="500" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
||||
</JNPF-UploadFz>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="磅单上传" prop="poundPictures">
|
||||
<el-upload class="avatar-uploader" :action="action" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccess">
|
||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料名称"
|
||||
prop="materialId" >
|
||||
<p>{{dataForm.materialId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="物料名称" prop="materialId">
|
||||
<popupSelect v-model="dataForm.materialId" placeholder="请选择物料编码" clearable field="materialId"
|
||||
interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id"
|
||||
relationField="item_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<popupSelect v-model="dataForm.customerId" placeholder="请选择客户" clearable field="customerId"
|
||||
interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id"
|
||||
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20" @change="customerSelect">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售合同" prop="salesId">
|
||||
<popupSelect v-model="dataForm.salesId" placeholder="请选择合同" clearable field="salesId"
|
||||
interfaceId="396203872441416837" :columnOptions="salesIdcolumnOptions" propsValue="id"
|
||||
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" :bissId="dataForm.customerId"
|
||||
hasPage :pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<popupSelect v-model="dataForm.supplierId" placeholder="请选择客户" clearable field="supplierId"
|
||||
interfaceId="382494924156735557" :columnOptions="supplierIdcolumnOptions" propsValue="id"
|
||||
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
|
||||
:pageSize="20" >
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="客户名称"
|
||||
prop="customerId" >
|
||||
<p>{{dataForm.customerId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="采购合同" prop="purchaseId">
|
||||
<popupSelect v-model="dataForm.purchaseId" placeholder="请选择合同" clearable field="purchaseId"
|
||||
interfaceId="397408984857931205" :columnOptions="salesIdcolumnOptions" propsValue="id"
|
||||
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" @change="customerSelect2">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="销售合同"
|
||||
prop="salesId" >
|
||||
<p>{{dataForm.salesId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="采购价格" prop="purchasePrice">
|
||||
<el-input-number v-model="dataForm.purchasePrice" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="车牌号"
|
||||
prop="vehicleId" >
|
||||
<p>{{dataForm.vehicleId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="车牌号" prop="vehicleId">
|
||||
<popupSelect v-model="dataForm.vehicleId" placeholder="请选择车辆" clearable field="vehicleId"
|
||||
interfaceId="381432451370615173" :columnOptions="vehicleIdcolumnOptions" propsValue="id"
|
||||
relationField="ticketno" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="changePicture"
|
||||
hasPage :pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="车辆图片"
|
||||
prop="vehiclePictures" >
|
||||
<JNPF-UploadImg v-model="dataForm.vehiclePictures"
|
||||
disabled
|
||||
detailed :fileSize="500" sizeUnit="MB" :limit="9" >
|
||||
<el-col :span="24">
|
||||
<el-form-item label="车辆图片" prop="vehiclePictures">
|
||||
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
|
||||
|
||||
</JNPF-UploadImg>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="磅单时间"
|
||||
prop="poundDate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.poundDate)}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单时间" prop="poundDate">
|
||||
<el-date-picker v-model="dataForm.poundDate" placeholder="请选择" clearable :style='{"width":"100%"}'
|
||||
type="date" format="yyyy-MM-dd" value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="磅单号"
|
||||
prop="poundlistNo" >
|
||||
<p>{{dataForm.poundlistNo}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单号" prop="poundlistNo">
|
||||
<el-input v-model="dataForm.poundlistNo" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="皮重"
|
||||
prop="tareWeight" >
|
||||
<p>{{dataForm.tareWeight}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="皮重" prop="tareWeight">
|
||||
<el-input-number v-model="dataForm.tareWeight" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="毛重"
|
||||
prop="grossWeight" >
|
||||
<p>{{dataForm.grossWeight}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="毛重" prop="grossWeight">
|
||||
<el-input-number v-model="dataForm.grossWeight" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="扣重"
|
||||
prop="buckleWeight" >
|
||||
<p>{{dataForm.buckleWeight}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="扣重" prop="buckleWeight">
|
||||
<el-input-number v-model="dataForm.buckleWeight" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="净重"
|
||||
prop="netWeight" >
|
||||
<p>{{dataForm.netWeight}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="净重" prop="netWeight">
|
||||
<el-input-number v-model="dataForm.netWeight" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="单位 "
|
||||
prop="unit" >
|
||||
<p>{{ dataForm.unit | dynamicText(unitOptions) }} </p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单位 " prop="unit">
|
||||
<el-select v-model="unit" placeholder="请选择" clearable :style='{"width":"100%"}' @change="unitChange">
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="运输类型"
|
||||
prop="transportType" >
|
||||
<p>{{ dataForm.transportType | dynamicText(transportTypeOptions) }} </p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运输类型" prop="transportType">
|
||||
<el-select v-model="transportType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="transportTypeChange">
|
||||
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="是否垫资"
|
||||
prop="advance" >
|
||||
<p>{{ dataForm.advance | dynamicText(advanceOptions) }} </p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否垫资" prop="advance">
|
||||
<el-select v-model="advance" placeholder="请选择" clearable :style='{"width":"100%"}' @change="advanceChange">
|
||||
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="运费"
|
||||
prop="transportPrice" >
|
||||
<p>{{dataForm.transportPrice}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运费" prop="transportPrice">
|
||||
<el-input-number v-model="dataForm.transportPrice" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="销售价格"
|
||||
prop="salesPrice" >
|
||||
<p>{{dataForm.salesPrice}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="起始地" prop="originPlace">
|
||||
<el-input v-model="dataForm.originPlace" placeholder="请输入起始地" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="业务员"
|
||||
prop="businessId" >
|
||||
<p>{{dataForm.businessId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="销售价格" prop="salesPrice">
|
||||
<el-input-number v-model="dataForm.salesPrice" :style='{"width":"100%"}'></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="自然人"
|
||||
prop="naturalId" >
|
||||
<p>{{dataForm.naturalId}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="业务员" prop="businessId">
|
||||
<popupSelect v-model="dataForm.businessId" placeholder="请选择业务员" clearable field="businessId"
|
||||
interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="businessIdcolumnOptions"
|
||||
propsValue="F_Id" relationField="F_RealName" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" :bissId="dataForm.businessId">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="自然人" prop="naturalId">
|
||||
<popupSelect v-model="dataForm.naturalId" placeholder="请选择自然人" clearable field="naturalId"
|
||||
interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id"
|
||||
relationField="name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="磅单日期"
|
||||
prop="creatorTime" >
|
||||
<p>{{dataForm.creatorTime}}</p>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入备注信息" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</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>-->
|
||||
<!-- <el-button type="primary" @click="continueUpload()"> 继续上传</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
unit: "0",
|
||||
transportType: "0",
|
||||
advance: "0",
|
||||
action: this.define.APIURl + '/api/tradeupload/Tradeupload/UploaderPondList/annexpic',
|
||||
imageUrl: '',
|
||||
code: '100',
|
||||
fileList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
id :'',
|
||||
poundPictures : [],
|
||||
materialId : "",
|
||||
customerId : "",
|
||||
salesId : "",
|
||||
vehicleId : "",
|
||||
vehiclePictures : [],
|
||||
poundDate : '',
|
||||
poundlistNo : '',
|
||||
tareWeight : 0,
|
||||
grossWeight : 0,
|
||||
buckleWeight : 0,
|
||||
netWeight : 0,
|
||||
unit : "0",
|
||||
transportType : "0",
|
||||
advance : "0",
|
||||
transportPrice : 0,
|
||||
salesPrice : '',
|
||||
businessId : "",
|
||||
naturalId : "",
|
||||
remark : '',
|
||||
creatorTime : "",
|
||||
},
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
|
||||
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
poundPictures: [],
|
||||
materialId: "",
|
||||
customerId: "",
|
||||
supplierId: "",
|
||||
salesId: "",
|
||||
vehicleId: "",
|
||||
vehiclePictures: [],
|
||||
poundDate: '',
|
||||
poundlistNo: '',
|
||||
tareWeight: 0,
|
||||
grossWeight: 0,
|
||||
buckleWeight: 0,
|
||||
netWeight: 0,
|
||||
unit: "0",
|
||||
transportType: "0",
|
||||
advance: "0",
|
||||
transportPrice: 0,
|
||||
salesPrice: 0,
|
||||
purchasePrice: 0,
|
||||
businessId: "",
|
||||
naturalId: "",
|
||||
remark: '',
|
||||
creatorTime: "",
|
||||
isExamine: "",
|
||||
},
|
||||
rules: {
|
||||
materialId: [{
|
||||
required: true,
|
||||
message: '请选择物料编码',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
customerId: [{
|
||||
required: true,
|
||||
message: '请选择客户',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
supplierId: [{
|
||||
required: true,
|
||||
message: '请选择供应商',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
purchaseId: [{
|
||||
required: true,
|
||||
message: '请选择采购合同',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
salesId: [{
|
||||
required: true,
|
||||
message: '请选择合同',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
vehicleId: [{
|
||||
required: true,
|
||||
message: '请选择车辆',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
vehiclePictures: [{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'click'
|
||||
}, ],
|
||||
poundDate: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
poundlistNo: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
tareWeight: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
grossWeight: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
buckleWeight: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
netWeight: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
salesPrice: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
purchasePrice: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
businessId: [{
|
||||
required: true,
|
||||
message: '请选择业务员',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
},
|
||||
materialIdcolumnOptions: [{
|
||||
"label": "物料编码",
|
||||
"value": "item_code"
|
||||
}, {
|
||||
"label": "物料名称",
|
||||
"value": "item_name"
|
||||
}, {
|
||||
"label": "单位",
|
||||
"value": "primary_unit_of_measure"
|
||||
}, {
|
||||
"label": "默认入库区",
|
||||
"value": "in_area"
|
||||
}, {
|
||||
"label": "默认出库区",
|
||||
"value": "out_area"
|
||||
}, ],
|
||||
customerIdcolumnOptions: [{
|
||||
"label": "客户编码",
|
||||
"value": "supplier_cd"
|
||||
}, {
|
||||
"label": "客户名称",
|
||||
"value": "supplier_nm"
|
||||
}, {
|
||||
"label": "地址",
|
||||
"value": "address"
|
||||
}, {
|
||||
"label": "银行账号",
|
||||
"value": "bank_account"
|
||||
}, ],
|
||||
supplierIdcolumnOptions: [{
|
||||
"label": "供应商编码",
|
||||
"value": "supplier_code"
|
||||
}, {
|
||||
"label": "供应商名称",
|
||||
"value": "supplier_name"
|
||||
}],
|
||||
salesIdcolumnOptions: [{
|
||||
"label": "合同编码",
|
||||
"value": "contract_code"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
}, {
|
||||
"label": "合同类型",
|
||||
"value": "contract_type"
|
||||
}, {
|
||||
"label": "供应商/客户名称",
|
||||
"value": "name"
|
||||
}, ],
|
||||
vehicleIdcolumnOptions: [{
|
||||
"label": "车牌号",
|
||||
"value": "ticketno"
|
||||
}, {
|
||||
"label": "司机",
|
||||
"value": "drivername"
|
||||
}, {
|
||||
"label": "车辆照片",
|
||||
"value": "vehiclephotos"
|
||||
}, {
|
||||
"label": "手机号",
|
||||
"value": "contact"
|
||||
}, ],
|
||||
unitOptions: [{
|
||||
"fullName": "吨",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "千克",
|
||||
"id": "1"
|
||||
}],
|
||||
transportTypeOptions: [{
|
||||
"fullName": "汽运",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "船运",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "火车",
|
||||
"id": "2"
|
||||
}],
|
||||
advanceOptions: [{
|
||||
"fullName": "否",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "是",
|
||||
"id": "1"
|
||||
}],
|
||||
businessIdcolumnOptions: [{
|
||||
"label": "人员名称",
|
||||
"value": "F_RealName"
|
||||
}, {
|
||||
"label": "人员职位",
|
||||
"value": "F_FullName"
|
||||
}, ],
|
||||
naturalIdcolumnOptions: [{
|
||||
"label": "自然人名称",
|
||||
"value": "name"
|
||||
}, {
|
||||
"label": "自然人手机号",
|
||||
"value": "contact"
|
||||
}, {
|
||||
"label": "自然人地址",
|
||||
"value": "adress"
|
||||
}, ],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
_dataAll.poundPictures = _dataAll.poundPictures ? JSON.parse( _dataAll.poundPictures):[]
|
||||
_dataAll.vehiclePictures = _dataAll.vehiclePictures ? JSON.parse( _dataAll.vehiclePictures):[]
|
||||
this.dataForm = _dataAll
|
||||
unitChange(e){
|
||||
this.dataForm.unit = e;
|
||||
},
|
||||
|
||||
init(id) {
|
||||
transportTypeChange(e){
|
||||
this.dataForm.transportType = e;
|
||||
},
|
||||
advanceChange(e){
|
||||
this.dataForm.advance = e;
|
||||
},
|
||||
customerSelect(e, d) {
|
||||
const query = {
|
||||
code: d.id
|
||||
}
|
||||
request({
|
||||
url: '/api/example/ContractFile/getListByCustomer',
|
||||
method: 'post',
|
||||
data: query
|
||||
}).then((res) => {
|
||||
if(res.data.length > 0){
|
||||
//确定后 根据type 进行保存 不需要组件通讯
|
||||
this.dataForm.salesId = res.data[0].id
|
||||
this.dataForm.salesName = res.data[0].contractName
|
||||
}
|
||||
})
|
||||
},
|
||||
customerSelect2(a, b) {
|
||||
this.dataForm.supplierId = b.code;
|
||||
debugger
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
this.dataForm.customerId = res.data.customerId;
|
||||
this.dataForm.customerName = res.data.customerName;
|
||||
this.dataForm.salesId = res.data.salesId;
|
||||
this.dataForm.salesName = res.data.salesName;
|
||||
this.dataForm.vehicleId = res.data.vehicleId;
|
||||
this.dataForm.poundDate = res.data.poundDate;
|
||||
this.dataForm.poundlistNo = res.data.poundlistNo;
|
||||
this.dataForm.tareWeight = res.data.tareWeight;
|
||||
this.dataForm.grossWeight = res.data.grossWeight;
|
||||
this.dataForm.buckleWeight = res.data.buckleWeight;
|
||||
this.dataForm.netWeight = res.data.netWeight;
|
||||
this.dataForm.vehiclePictures = JSON.parse(res.data.vehiclePictures);
|
||||
},
|
||||
changePicture(a, b) {
|
||||
this.dataForm.vehiclePictures = JSON.parse(b.vehiclephotos);
|
||||
},
|
||||
continueUpload() {
|
||||
var tareWeight = this.dataForm.tareWeight;//皮重
|
||||
var grossWeight = this.dataForm.grossWeight;//毛重
|
||||
var buckleWeight = this.dataForm.buckleWeight;//扣重
|
||||
var netWeight = this.dataForm.netWeight;//净重
|
||||
if(grossWeight < tareWeight + buckleWeight + netWeight){
|
||||
this.$message({
|
||||
message: '毛重不得小于皮重+扣重+净重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(buckleWeight >= netWeight){
|
||||
this.$message({
|
||||
message: '扣重不得大于净重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(buckleWeight >= grossWeight){
|
||||
this.$message({
|
||||
message: '扣重不得大于毛重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request3()
|
||||
}
|
||||
})
|
||||
},
|
||||
// poundAI(){
|
||||
// let formData = new FormData();
|
||||
// let file = this.dataForm.poundPictures
|
||||
// formData.append('file',file);
|
||||
// request({
|
||||
// url: '/api/tradeupload/Tradeupload/poundai',
|
||||
// method: 'post',
|
||||
// data: formData
|
||||
// }).then(res => {
|
||||
// this.dataInfo(res.data)
|
||||
// this.loading = false
|
||||
// });
|
||||
// },
|
||||
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] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.poundDate = new Date();
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/detail/'+this.dataForm.id,
|
||||
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
|
||||
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
var tareWeight = this.dataForm.tareWeight;//皮重
|
||||
var grossWeight = this.dataForm.grossWeight;//毛重
|
||||
var buckleWeight = this.dataForm.buckleWeight;//扣重
|
||||
var netWeight = this.dataForm.netWeight;//净重
|
||||
this.dataForm.isExamine = '1';
|
||||
this.dataForm.unit = this.dataForm.unit ? this.dataForm.unit : 0;
|
||||
this.dataForm.transportType = this.dataForm.transportType ? this.dataForm.transportType : 0;
|
||||
this.dataForm.advance = this.dataForm.advance ? this.dataForm.advance : 0;
|
||||
if(grossWeight < tareWeight + buckleWeight + netWeight){
|
||||
this.$message({
|
||||
message: '毛重不得小于皮重+扣重+净重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(buckleWeight >= netWeight){
|
||||
this.$message({
|
||||
message: '扣重不得大于净重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(buckleWeight >= grossWeight){
|
||||
this.$message({
|
||||
message: '扣重不得大于毛重',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request2()
|
||||
}
|
||||
})
|
||||
},
|
||||
request2() {
|
||||
var _data = this.dataList()
|
||||
debugger
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload',
|
||||
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/tradeupload/Tradeupload/' + 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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
request3() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
})
|
||||
})
|
||||
}
|
||||
this.dataForm.vehicleId = null;
|
||||
this.dataForm.vehiclePictures = null;
|
||||
this.dataForm.poundDate = null;
|
||||
this.dataForm.poundlistNo = null;
|
||||
this.dataForm.tareWeight = null;
|
||||
this.dataForm.grossWeight = null;
|
||||
this.dataForm.buckleWeight = null;
|
||||
this.dataForm.netWeight = null;
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload',
|
||||
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/tradeupload/Tradeupload/' + 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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.poundPictures = JSON.stringify(_data.poundPictures)
|
||||
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
|
||||
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in new issue