parent
8327a16bc0
commit
21d2a029e1
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,562 +0,0 @@
|
||||
<template>
|
||||
<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="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="系统自动生成" readonly >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="业务日期"
|
||||
prop="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" >
|
||||
<el-input-number v-model="dataForm.amount"
|
||||
placeholder="数字文本" :step="1" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="数量"
|
||||
prop="quantity" >
|
||||
<el-input-number v-model="dataForm.quantity"
|
||||
placeholder="数字文本" :step="1" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别 "
|
||||
prop="currency" >
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<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" >
|
||||
<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" >
|
||||
<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" disabled></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票金额"
|
||||
prop="invoiceAmount" >
|
||||
<el-input-number v-model="dataForm.invoiceAmount"
|
||||
placeholder="数字文本" :step="1" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity" >
|
||||
<el-input-number v-model="dataForm.invoiceQuantity"
|
||||
placeholder="数字文本" :step="1" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="销售订单号"
|
||||
prop="salesOrderId" >
|
||||
<popupSelect v-model="dataForm.salesOrderId"
|
||||
placeholder="请选择" clearable field="salesOrderId" interfaceId="398359995269352069" :columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractId" >
|
||||
<popupSelect v-model="dataForm.contractId"
|
||||
placeholder="请选择" clearable field="contractId" interfaceId="398361758806411909" :columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户"
|
||||
prop="customerId" >
|
||||
<popupSelect v-model="dataForm.customerId"
|
||||
placeholder="请选择" clearable field="customerId" interfaceId="398362084892576389" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activezbtwpv" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应收明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.arinvoices_item1List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="materialId" label="物料">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.materialId"
|
||||
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
|
||||
popupWidth="800px" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.quantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitPrice" label="单价">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.unitPrice"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="单位">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.unit"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.taxRate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' disabled @change="computeAmount">
|
||||
<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">
|
||||
<el-input v-model="scope.row.taxAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountNotTax"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</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="delarinvoices_item1List(scope.$index)" disabled>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addarinvoices_item1List()">
|
||||
<el-button type="text" icon="el-icon-plus" disabled>添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.arinvoices_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<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">
|
||||
<el-input v-model="scope.row.invoiceNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceQuantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' @change="invoiceQuantitySum">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="involceAmount" label="发票金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.involceAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' @change="involceAmountSum">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.taxRate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' @change="rateCompute">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<el-input v-model="scope.row.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceDate" label="开票日期">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.invoiceDate"
|
||||
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="delarinvoices_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addarinvoices_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo : '',
|
||||
businessDate : '',
|
||||
amount : 0,
|
||||
quantity : 0,
|
||||
currency : "0",
|
||||
remark : '',
|
||||
status : "0",
|
||||
invoiceAmount : 0,
|
||||
invoiceQuantity : 0,
|
||||
salesOrderId : "",
|
||||
contractId : "",
|
||||
customerId : "",
|
||||
arinvoices_item1List:[],
|
||||
arinvoices_item0List:[],
|
||||
},
|
||||
activezbtwpv:'0',
|
||||
rules:
|
||||
{
|
||||
},
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
salesOrderIdcolumnOptions:[ {"label":"销售订单号","value":"document_no"},
|
||||
{"label":"合同","value":"contractName"}, {"label":"客户名称","value":"customer"},
|
||||
{"label":"金额","value":"price"}, {"label":"数量","value":"num"},
|
||||
],
|
||||
contractIdcolumnOptions:[ {"label":"合同编码","value":"contract_code"}, {"label":"合同名称","value":"contract_name"},],
|
||||
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"地址","value":"address"},],
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
arinvoices_item1materialIdcolumnOptions:[ {"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() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
invoiceQuantitySum(){
|
||||
debugger
|
||||
let sum = 0;
|
||||
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
|
||||
sum = sum + this.dataForm.arinvoices_item0List[i].invoiceQuantity
|
||||
}
|
||||
this.dataForm.invoiceQuantity = sum
|
||||
debugger
|
||||
},
|
||||
involceAmountSum(){
|
||||
let sum = 0;
|
||||
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
|
||||
sum = sum + this.dataForm.arinvoices_item0List[i].involceAmount
|
||||
}
|
||||
this.dataForm.invoiceAmount = sum
|
||||
},
|
||||
rateCompute(){
|
||||
for (let i = 0;i<this.dataForm.arinvoices_item0List.length;i++) {
|
||||
this.taxRateOptions.find((item) => {
|
||||
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
|
||||
this.dataForm.arinvoices_item0List[i].taxAmount = this.dataForm.arinvoices_item0List[i].involceAmount*item.fullName/100
|
||||
this.dataForm.arinvoices_item0List[i].amountNotTax = this.dataForm.arinvoices_item0List[i].involceAmount - this.dataForm.arinvoices_item0List[i].taxAmount
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
computeAmount(){
|
||||
for (let i = 0;i<this.dataForm.arinvoices_item1List.length;i++) {
|
||||
this.taxRateOptions.find((item) => {
|
||||
if (this.dataForm.arinvoices_item1List[i].taxRate == item.id) {
|
||||
this.dataForm.arinvoices_item1List[i].taxAmount = this.dataForm.arinvoices_item1List[i].amount*item.fullName/100
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
arinvoices_item1Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.arinvoices_item1List.length;i++){
|
||||
const e = this.dataForm.arinvoices_item1List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
arinvoices_item0Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.arinvoices_item0List.length;i++){
|
||||
const e = this.dataForm.arinvoices_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(list) {
|
||||
debugger
|
||||
this.visible = true;
|
||||
let amount = 0;
|
||||
let num = 0;
|
||||
this.dataForm.contractId = list[0].contractId;
|
||||
this.dataForm.customerId = list[0].customerId;
|
||||
debugger
|
||||
this.dataForm.salesOrderId = list[0].id;
|
||||
this.dataForm.arinvoices_item1List = list[0].list;
|
||||
for (let i = 0;i<list[0].list.length;i++){
|
||||
this.dataForm.arinvoices_item1List[i].quantity = list[0].list[i].settlement;
|
||||
this.dataForm.arinvoices_item1List[i].amount = list[0].list[i].price;
|
||||
this.dataForm.arinvoices_item1List[i].taxRate = list[0].list[i].rate;
|
||||
this.dataForm.arinvoices_item1List[i].amountNotTax = list[0].list[i].noPrice;
|
||||
this.dataForm.arinvoices_item1List[i].unit = list[0].list[i].poundEntity.unit;
|
||||
amount = amount + list[0].list[i].price;
|
||||
num = num + list[0].list[i].quantity;
|
||||
// this.dataForm.arinvoices_item1List[i].taxAmount = list[0].list[i].price*list[0].list[i].rate
|
||||
this.taxRateOptions.find((item) => {
|
||||
if (this.dataForm.arinvoices_item1List[i].taxRate == item.id) {
|
||||
this.dataForm.arinvoices_item1List[i].taxAmount = this.dataForm.arinvoices_item1List[i].amount*item.fullName/100
|
||||
}
|
||||
})
|
||||
}
|
||||
this.dataForm.amount = amount;
|
||||
this.dataForm.quantity = num;
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.arinvoices_item1Exist()) return
|
||||
if (!this.arinvoices_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices',
|
||||
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/arinvoices/Arinvoices/'+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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addarinvoices_item1List(){
|
||||
let item = {
|
||||
materialId:undefined,
|
||||
quantity:undefined,
|
||||
unitPrice:undefined,
|
||||
amount:undefined,
|
||||
taxRate:undefined,
|
||||
taxAmount:undefined,
|
||||
amountNotTax:undefined,
|
||||
remark:undefined,
|
||||
}
|
||||
this.dataForm.arinvoices_item1List.push(item)
|
||||
},
|
||||
delarinvoices_item1List(index) {
|
||||
this.dataForm.arinvoices_item1List.splice(index, 1);
|
||||
},
|
||||
addarinvoices_item0List(){
|
||||
let item = {
|
||||
invoiceCode:undefined,
|
||||
invoiceNo:undefined,
|
||||
invoiceQuantity:undefined,
|
||||
involceAmount:undefined,
|
||||
taxRate:undefined,
|
||||
taxAmount:undefined,
|
||||
amountNotTax:undefined,
|
||||
invoiceStatus:undefined,
|
||||
creatorUserName:undefined,
|
||||
invoiceDate:undefined,
|
||||
}
|
||||
this.dataForm.arinvoices_item0List.push(item)
|
||||
},
|
||||
delarinvoices_item0List(index) {
|
||||
this.dataForm.arinvoices_item0List.splice(index, 1);
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for(let i=0;i<_data.arinvoices_item1List.length;i++){
|
||||
var _list = _data.arinvoices_item1List[i];
|
||||
}
|
||||
for(let i=0;i<_data.arinvoices_item0List.length;i++){
|
||||
var _list = _data.arinvoices_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.arinvoices_item1List.length;i++){
|
||||
var _list = _dataAll.arinvoices_item1List[i];
|
||||
}
|
||||
for(let i=0;i<_dataAll.arinvoices_item0List.length;i++){
|
||||
var _list = _dataAll.arinvoices_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
@ -1,400 +0,0 @@
|
||||
<template xmlns:pointer-events="http://www.w3.org/1999/xhtml">
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="系统自动生成" readonly >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户"
|
||||
prop="customerId" >
|
||||
<popupSelect v-model="dataForm.customerId"
|
||||
placeholder="请选择" clearable field="customerId" interfaceId="393371066040385285" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款金额"
|
||||
prop="amountCollected" >
|
||||
<el-input v-model="dataForm.amountCollected"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款账户"
|
||||
prop="collectionCount" >
|
||||
<el-input v-model="dataForm.collectionCount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="收款银行"
|
||||
prop="collectionBank" >
|
||||
<el-input v-model="dataForm.collectionBank"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</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="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" >
|
||||
<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="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="voucher" >
|
||||
<JNPF-UploadFz v-model="dataForm.voucher"
|
||||
:fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
||||
|
||||
</JNPF-UploadFz>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="单据状态 "-->
|
||||
<!-- prop="status" >-->
|
||||
<!-- <el-select v-model="dataForm.status"-->
|
||||
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
|
||||
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
|
||||
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" >-->
|
||||
<!-- <el-form-item label="制单人"-->
|
||||
<!-- prop="creatorUserName" >-->
|
||||
<!-- <el-input v-model="dataForm.creatorUserName"-->
|
||||
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>-->
|
||||
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activexidaok" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="收款明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.collection_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="amount" label="收款金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' @change="amountSum">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="订单金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountCollected" label="已收款金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountCollected"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesorderId" label="销售订单">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.salesorderId"
|
||||
placeholder="请选择" clearable :field="'salesorderId'+scope.$index" interfaceId="399077559599480261" :columnOptions="collection_item0salesorderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
|
||||
popupWidth="800px" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contractId" label="合同编码">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.contractId"
|
||||
placeholder="请选择" clearable :field="'deleteTime'+scope.$index" interfaceId="398848549678332037" :columnOptions="collection_item0deleteTimecolumnOptions" propsValue="id" relationField="contract_code" popupType="dialog"
|
||||
popupWidth="800px" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="重量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.num"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="advanceAmount" label="垫资金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.advanceAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.rate"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notPrice" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.notPrice"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="业务日期">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.creatorTime"
|
||||
placeholder="请选择" clearable :style='{"width":"200%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50" >
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delcollection_item0List(scope.$index)" disabled>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addcollection_item0List()" >
|
||||
<el-button type="text" icon="el-icon-plus" disabled>添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo : '',
|
||||
customerId : "",
|
||||
contractId : "",
|
||||
amountCollected : '',
|
||||
collectionCount : '',
|
||||
collectionBank : '',
|
||||
paymentType : "0",
|
||||
currency : "0",
|
||||
settlementType : "0",
|
||||
remark : '',
|
||||
voucher : [],
|
||||
status : "0",
|
||||
creatorUserName : '',
|
||||
collection_item0List:[],
|
||||
},
|
||||
activexidaok:'0',
|
||||
rules:
|
||||
{
|
||||
},
|
||||
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"客户地点名称","value":"supplier_site_code"}, {"label":"客户等级","value":"customer_level"},],
|
||||
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"}],
|
||||
|
||||
collection_item0salesorderIdcolumnOptions:[ {"label":"销售订单编号","value":"document_no"},],
|
||||
collection_item0deleteTimecolumnOptions:[ {"label":"合同编号","value":"contract_code"}, {"label":"合同名称","value":"contract_name"}, {"label":"客户名称","value":"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"}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
amountSum(){
|
||||
let sum = 0;
|
||||
for (let i = 0;i<this.dataForm.collection_item0List.length;i++){
|
||||
sum = sum + parseFloat(this.dataForm.collection_item0List[i].amount);
|
||||
}
|
||||
this.dataForm.amountCollected = sum;
|
||||
},
|
||||
collection_item0Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.collection_item0List.length;i++){
|
||||
const e = this.dataForm.collection_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(list) {
|
||||
this.visible = true;
|
||||
this.dataForm.customerId = list[0].customerId;
|
||||
this.dataForm.contractId = list[0].contractId;
|
||||
this.dataForm.collection_item0List = list;
|
||||
debugger
|
||||
for (let i = 0;i<list.length;i++){
|
||||
this.dataForm.collection_item0List[i].salesorderId = list[i].id;
|
||||
this.dataForm.collection_item0List[i].rate = list[i].price - list[i].notPrice;
|
||||
debugger
|
||||
}
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.collection_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/collection/Collection',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/collection/Collection/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addcollection_item0List(){
|
||||
let item = {
|
||||
amount:undefined,
|
||||
creatorUserId:undefined,
|
||||
creatorUserName:undefined,
|
||||
salesorderId:undefined,
|
||||
deleteTime:undefined,
|
||||
lastModifyUserName:undefined,
|
||||
taxRate:undefined,
|
||||
lastModifyTime:undefined,
|
||||
deleteUserId:undefined,
|
||||
deleteUserName:undefined,
|
||||
creatorTime:undefined,
|
||||
}
|
||||
this.dataForm.collection_item0List.push(item)
|
||||
},
|
||||
delcollection_item0List(index) {
|
||||
this.dataForm.collection_item0List.splice(index, 1);
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.voucher = JSON.stringify(_data.voucher)
|
||||
for(let i=0;i<_data.collection_item0List.length;i++){
|
||||
var _list = _data.collection_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
_dataAll.voucher = JSON.parse( _dataAll.voucher)
|
||||
for(let i=0;i<_dataAll.collection_item0List.length;i++){
|
||||
var _list = _dataAll.collection_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
@ -1,429 +0,0 @@
|
||||
<template>
|
||||
<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="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="系统自动生成" readonly >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="业务类型"
|
||||
prop="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="salesId" >
|
||||
<popupSelect v-model="dataForm.salesId"
|
||||
placeholder="请选择" clearable field="salesId" interfaceId="392956668264114117" :columnOptions="salesIdcolumnOptions" 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="amount" >
|
||||
<el-input v-model="dataForm.amount"
|
||||
placeholder="请输入出库金额" readonly clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别"
|
||||
prop="currency" >
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<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="num" >
|
||||
<el-input v-model="dataForm.num"
|
||||
placeholder="请输入出库数量" readonly clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户"
|
||||
prop="customerId" >
|
||||
<popupSelect v-model="dataForm.customerId"
|
||||
placeholder="请选择" clearable field="customerId" interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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="issueDate" >-->
|
||||
<!-- <el-date-picker v-model="dataForm.issueDate"-->
|
||||
<!-- 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="activezlqlfb" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.receiptout_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="vehicleId" label="车牌号">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.vehicleId"
|
||||
placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="398732963950472005" :columnOptions="receiptout_item0vehicleIdcolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
|
||||
popupWidth="800px"
|
||||
hasPage :pageSize="20" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialId" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.materialId"
|
||||
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="398719564478785669" :columnOptions="receiptout_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
|
||||
popupWidth="800px" disabled
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reservoirareaId" label="库区名称">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.reservoirareaId"
|
||||
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="381404161809350213" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
|
||||
popupWidth="800px" @change="areaSelect"
|
||||
>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseId" label="仓库名称">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.warehouseId"
|
||||
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="399117969575232581" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
|
||||
popupWidth="800px" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveryNum" label="出库数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.deliveryNum"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.unit"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="单价">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.rate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rateAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.rateAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="batchNo" label="批次号">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.batchNo"
|
||||
placeholder="系统自动生成" readonly>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="poundType" label="磅单类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.poundType"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
|
||||
<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" >
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delreceiptout_item0List(scope.$index)" disabled>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addreceiptout_item0List()" disabled="">
|
||||
<el-button type="text" icon="el-icon-plus" disabled >添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo : '',
|
||||
type : "0",
|
||||
salesId : "",
|
||||
amount : '',
|
||||
currency : "0",
|
||||
num : '',
|
||||
customerId : '',
|
||||
remark : '',
|
||||
issueDate : '',
|
||||
status : "0",
|
||||
creatorTime : "",
|
||||
creatorUserName : "",
|
||||
lastModifyTime : "",
|
||||
lastModifyUserName : "",
|
||||
receiptout_item0List:[],
|
||||
},
|
||||
activezlqlfb:'0',
|
||||
rules:
|
||||
{
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
salesId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
typeOptions:[{"fullName":"销售出库","id":"0"},{"fullName":"购销出库","id":"1"}],
|
||||
salesIdcolumnOptions:[ {"label":"单据编号","value":"document_no"}, {"label":"币别","value":"currency"}, {"label":"客户名称","value":"customer_name"},],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"联系人","value":"contact_name"}, {"label":"地址","value":"address"},],
|
||||
receiptout_item0vehicleIdcolumnOptions:[ {"label":"车辆号","value":"ticketno"}],
|
||||
receiptout_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
|
||||
receiptout_item0reservoirareaIdcolumnOptions:[ {"label":"库区名称","value":"areaname"}, {"label":"最高库存","value":"maximum"}, {"label":"安全库存","value":"safety"}, {"label":"最低库存","value":"minimum"}, {"label":"仓库名称","value":"name"},],
|
||||
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"},{"fullName":"委外","id":"2"},{"fullName":"倒运","id":"3"}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
areaSelect(a,b){
|
||||
for (let i = 0;i<this.dataForm.receiptout_item0List.length;i++) {
|
||||
if (a == this.dataForm.receiptout_item0List[i].reservoirareaId) {
|
||||
this.dataForm.receiptout_item0List[i].warehouseId = b.warehouse_id
|
||||
}
|
||||
}
|
||||
},
|
||||
receiptout_item0Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.receiptout_item0List.length;i++){
|
||||
const e = this.dataForm.receiptout_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(list) {
|
||||
this.visible = true;
|
||||
this.dataForm.amount = list[0].price;
|
||||
this.dataForm.num = list[0].num;
|
||||
this.dataForm.salesId = list[0].id;
|
||||
this.dataForm.customerId = list[0].customerId;
|
||||
debugger
|
||||
this.dataForm.receiptout_item0List = list[0].list;
|
||||
for (let i = 0;i<list[0].list.length;i++){
|
||||
this.dataForm.receiptout_item0List[i].amount = list[0].list[i].price;
|
||||
this.dataForm.receiptout_item0List[i].price = list[0].list[i].unitPrice;
|
||||
this.dataForm.receiptout_item0List[i].deliveryNum = list[0].list[i].settlement;
|
||||
this.dataForm.receiptout_item0List[i].unit = list[0].list[i].poundEntity.unit;
|
||||
this.dataForm.receiptout_item0List[i].poundType = list[0].list[i].poundEntity.poundType;
|
||||
debugger
|
||||
this.rateOptions.find((item) => {
|
||||
if (this.dataForm.receiptout_item0List[i].rate == item.id) {
|
||||
this.dataForm.receiptout_item0List[i].rateAmount = this.dataForm.receiptout_item0List[i].amount*item.fullName/100
|
||||
debugger
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.receiptout_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/receipout/Receiptout/saleordercreate',
|
||||
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/receipout/Receiptout/'+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)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addreceiptout_item0List(){
|
||||
let item = {
|
||||
vehicleId:undefined,
|
||||
materialId:undefined,
|
||||
reservoirareaId:undefined,
|
||||
warehouseId:undefined,
|
||||
deliveryNum:undefined,
|
||||
unit:undefined,
|
||||
price:undefined,
|
||||
rate:undefined,
|
||||
amount:undefined,
|
||||
rateAmount:undefined,
|
||||
batchNo:undefined,
|
||||
poundType:undefined,
|
||||
}
|
||||
this.dataForm.receiptout_item0List.push(item)
|
||||
},
|
||||
delreceiptout_item0List(index) {
|
||||
this.dataForm.receiptout_item0List.splice(index, 1);
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for(let i=0;i<_data.receiptout_item0List.length;i++){
|
||||
var _list = _data.receiptout_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.receiptout_item0List.length;i++){
|
||||
var _list = _dataAll.receiptout_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
@ -1,461 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号" prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售订单" prop="salesOrderId">
|
||||
<popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
|
||||
field="salesOrderId" interfaceId="383568951197606085"
|
||||
:columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
|
||||
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别" prop="currency">
|
||||
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
<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="refundAmount" >
|
||||
<el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退货数量" prop="refundNum" >
|
||||
<el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeqkzogz" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="磅单明细">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.saleback_item0List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<!-- <el-table-column prop="licenseNum" label="车牌号">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <popupSelect v-model="scope.row.licenseNum" placeholder="请选择"-->
|
||||
<!-- clearable :field="'licenseNum'+scope.$index"-->
|
||||
<!-- interfaceId="383568082196537541" :bissId="dataForm.salesOrderId" :excludeFields="excludeFields"-->
|
||||
<!-- :columnOptions="saleback_item0licenseNumcolumnOptions"-->
|
||||
<!-- propsValue="license_num" relationField="license_num"-->
|
||||
<!-- popupType="dialog" popupWidth="800px" @change="popupSelectChange2">-->
|
||||
<!-- </popupSelect>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="vehicleId" label="车辆ID">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.vehicleId"
|
||||
placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="400554150653457925"
|
||||
:bissId="dataForm.salesOrderId" :columnOptions="salesback_item0vehicleIdcolumnOptions" propsValue="id"
|
||||
relationField="ticketno" popupType="dialog" @change="popupSelectChange2"
|
||||
popupWidth="800px">
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialId" label="物料名称">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.materialId"
|
||||
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="381037852907038533" :columnOptions="jg_salesback_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
|
||||
popupWidth="800px" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="settlement" label="结算重量 ">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="计量单位 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="销售单价">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rate" label="税率">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in rateOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount" label="应退金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="notAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="businessId" label="业务员">
|
||||
<template slot-scope="scope">
|
||||
<popupSelect v-model="scope.row.businessId"
|
||||
placeholder="请选择" clearable :field="'businessId'+scope.$index" interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="jg_salesback_item0businessIdcolumnOptions" propsValue="F_Id" relationField="F_RealName" popupType="dialog"
|
||||
popupWidth="800px" disabled>
|
||||
</popupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pountType" label="磅单类型 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.pountType" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}' disabled>
|
||||
<el-option v-for="(item, index) in pountTypeOptions"
|
||||
:key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delsaleback_item0List(scope.$index)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addsaleback_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus" >添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
excludeFields: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo: '',
|
||||
salesOrderId: "",
|
||||
currency: "0",
|
||||
refundAmount: '',
|
||||
refundNum: '',
|
||||
remark: '',
|
||||
actualAmount: '',
|
||||
status: "0",
|
||||
creatorTime: "",
|
||||
creatorUserName: "",
|
||||
saleback_item0List: [],
|
||||
jg_salesorder: {
|
||||
contractName: '',
|
||||
costomerName: '',
|
||||
},
|
||||
// jnpf_jg_salesorder_jnpf_contractName: '',
|
||||
// jnpf_jg_salesorder_jnpf_costomerName: '',
|
||||
},
|
||||
activeqkzogz: '0',
|
||||
rules: {},
|
||||
salesOrderIdcolumnOptions: [{
|
||||
"label": "ID",
|
||||
"value": "id"
|
||||
}, {
|
||||
"label": "销售订单号",
|
||||
"value": "document_no"
|
||||
}, {
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
}, {
|
||||
"label": "客户名称",
|
||||
"value": "costomer_name"
|
||||
}, {
|
||||
"label": "币别",
|
||||
"value": "currency"
|
||||
}, {
|
||||
"label": "状态",
|
||||
"value": "status"
|
||||
}, ],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}],
|
||||
salesback_item0vehicleIdcolumnOptions:[ {"label":"车牌号","value":"ticketno"},
|
||||
{"label":"物料名称","value":"material_name"},
|
||||
{"label":"结算重量","value":"settlement"},
|
||||
{"label":"计量单位","value":"unit"},
|
||||
{"label":"采购单价","value":"unit_price"},
|
||||
{"label":"税率","value":"rate"},
|
||||
{"label":"应退金额","value":"price"},
|
||||
{"label":"税额","value":"no_price"},
|
||||
{"label":"业务员","value":"business_id"},
|
||||
{"label":"磅单类型","value":"pound_type"},],
|
||||
|
||||
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"},{"fullName":"委外","id":"2"},{"fullName":"倒运","id":"3"}],
|
||||
jg_salesback_item0businessIdcolumnOptions:[ {"label":"人员名称","value":"F_RealName"}, {"label":"人员职位","value":"F_FullName"},],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
popupSelectChange2(a, b){
|
||||
debugger
|
||||
var excludeFields = [];
|
||||
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
|
||||
excludeFields.push(this.dataForm.saleback_item0List[i].vehicleId);
|
||||
if(a == this.dataForm.saleback_item0List[i].vehicleId){
|
||||
this.dataForm.saleback_item0List[i].materialId = b.material_id;
|
||||
this.dataForm.saleback_item0List[i].settlement = b.settlement;
|
||||
this.dataForm.saleback_item0List[i].unit = b.unit;
|
||||
this.dataForm.saleback_item0List[i].price = b.sales_price;
|
||||
this.dataForm.saleback_item0List[i].rate = b.rate;
|
||||
this.dataForm.saleback_item0List[i].amount = b.sales_price * b.settlement;
|
||||
this.dataForm.saleback_item0List[i].pountUser = b.business_id;
|
||||
this.dataForm.saleback_item0List[i].pountType = b.pound_type;
|
||||
this.dataForm.saleback_item0List[i].businessId = b.business_id;
|
||||
this.rateOptions.find((item) => {
|
||||
if (this.dataForm.saleback_item0List[i].rate == item.id) {
|
||||
this.dataForm.saleback_item0List[i].notAmount = this.dataForm.saleback_item0List[i].amount*item.fullName/100
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
this.excludeFields = excludeFields;
|
||||
},
|
||||
popupSelectChange(e,d){
|
||||
this.dataForm.currency = d.currency;
|
||||
this.excludeFields = [];
|
||||
this.dataForm.saleback_item0List = [];
|
||||
},
|
||||
saleback_item0Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
|
||||
const e = this.dataForm.saleback_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(list) {
|
||||
this.visible = true;
|
||||
this.dataForm.salesOrderId = list[0].id;
|
||||
this.dataForm.refundAmount = list[0].price;
|
||||
this.dataForm.refundNum = list[0].num;
|
||||
// this.dataForm.saleback_item0List = list[0].list;
|
||||
// for (let i = 0;i<list[0].list.length;i++){
|
||||
// this.dataForm.saleback_item0List[i].salesorderItem0Id = list[0].list[i].id;
|
||||
// this.dataForm.saleback_item0List[i].unit = list[0].list[i].poundEntity.unit;
|
||||
// this.dataForm.saleback_item0List[i].businessId = list[0].list[i].poundEntity.businessId;
|
||||
// this.dataForm.saleback_item0List[i].pountType = list[0].list[i].poundEntity.poundType;
|
||||
// this.dataForm.saleback_item0List[i].amount = list[0].list[i].price;
|
||||
// this.dataForm.saleback_item0List[i].price = list[0].list[i].unitPrice;
|
||||
// this.rateOptions.find((item) => {
|
||||
// if (this.dataForm.saleback_item0List[i].rate == item.id) {
|
||||
// this.dataForm.saleback_item0List[i].notAmount = this.dataForm.saleback_item0List[i].amount*item.fullName/100
|
||||
// }
|
||||
// })
|
||||
// debugger
|
||||
// }
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.saleback_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/saleback/Saleback',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/saleback/Saleback/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addsaleback_item0List() {
|
||||
let item = {
|
||||
licenseNum: undefined,
|
||||
materialName: undefined,
|
||||
settlement: undefined,
|
||||
unit: undefined,
|
||||
price: undefined,
|
||||
rate: undefined,
|
||||
amount: undefined,
|
||||
notAmount: undefined,
|
||||
pountUser: undefined,
|
||||
pountType: undefined,
|
||||
}
|
||||
this.dataForm.saleback_item0List.push(item)
|
||||
},
|
||||
delsaleback_item0List(index) {
|
||||
this.dataForm.saleback_item0List.splice(index, 1);
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
// _data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
|
||||
// _data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
|
||||
for (let i = 0; i < _data.saleback_item0List.length; i++) {
|
||||
var _list = _data.saleback_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
|
||||
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
|
||||
for (let i = 0; i < _dataAll.saleback_item0List.length; i++) {
|
||||
var _list = _dataAll.saleback_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue