product
17602169347 2 years ago
parent 0a9d1f84e2
commit 21e5c8dd37

@ -1,403 +1,466 @@
<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="请输入" clearable :style='{"width":"100%"}'>
<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%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="采购订单"
prop="purchaseOrderId" >
<popupSelect v-model="dataForm.purchaseOrderId"
placeholder="请选择" clearable field="purchaseOrderId" interfaceId="383149471917185157" :columnOptions="purchaseOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购订单" prop="purchaseOrderId">
<popupSelect v-model="dataForm.purchaseOrderId" placeholder="请选择" clearable
field="purchaseOrderId" interfaceId="383149471917185157"
:columnOptions="purchaseOrderIdcolumnOptions" 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>
</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"
clearable :style='{"width":"100%"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退货金额" prop="refundAmount">
<el-input v-model="dataForm.refundAmount" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="退货数量"
prop="refundNum" >
<el-input v-model="dataForm.refundNum"
clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退货数量" prop="refundNum">
<el-input v-model="dataForm.refundNum" clearable :style='{"width":"100%"}'>
</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="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="jnpf_jg_purchaseorder_jnpf_contractName" >
<el-input v-model=" dataForm.jnpf_jg_purchaseorder_jnpf_contractName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="供应商名称"
prop="jnpf_jg_purchaseorder_jnpf_supplierName" >
<el-input v-model=" dataForm.jnpf_jg_purchaseorder_jnpf_supplierName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="实退金额"
prop="actualAmount" >
<el-input v-model="dataForm.actualAmount"
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" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="创建时间"
prop="creatorTime" >
<el-input v-model="dataForm.creatorTime"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="创建人"
prop="creatorUserName" >
<el-input v-model="dataForm.creatorUserName"
placeholder="系统自动生成" readonly >
</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-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.purchaseback_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="383214061812227333" :bissId="dataForm.purchaseOrderId" :columnOptions="purchaseback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog"
popupWidth="800px"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pountUser" label="业务员">
<template slot-scope="scope">
<el-input v-model="scope.row.pountUser"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
<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-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>
</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-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.purchaseback_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="383214061812227333"
:bissId="dataForm.purchaseOrderId"
:columnOptions="purchaseback_item0licenseNumcolumnOptions"
propsValue="license_num" relationField="license_num"
popupType="dialog" popupWidth="800px" @change="popupSelectChange2">
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pountUser" label="业务员">
<template slot-scope="scope">
<el-input v-model="scope.row.pountUser" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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%"}'>
<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-tabs>
</el-col>
</template>
<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 { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
bissId: '380716763022647941',
visible: false,
loading: false,
isDetail: false,
dataForm: {
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:'',
},
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"}],
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: { },
props: [],
data() {
return {
bissId: '380716763022647941',
formVisible: false,
visible: false,
loading: false,
isDetail: false,
dataForm: {
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: '',
},
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"
}],
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"},],
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() {
},
mounted() {},
methods: {
purchaseback_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.purchaseback_item0List.length;i++){
const e = this.dataForm.purchaseback_item0List[i];
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"
}, ],
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() {},
mounted() {},
methods: {
popupSelectChange2(a, b){
for (let i = 0; i < this.dataForm.purchaseback_item0List.length; i++) {
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;
}
}
},
popupSelectChange(e,d){
this.dataForm.currency = d.currency;
},
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(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
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
},
},
}
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(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
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,283 +1,343 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()"/>
</el-tooltip>
<screenfull isContainer/>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
/>
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="0" align="left"
/>
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="0" align="left"
/>
<el-table-column prop="refundAmount" label="退货金额" width="0" align="left"
/>
<el-table-column prop="actualAmount" label="实退金额" width="0" align="left"
/>
<el-table-column label="币别 " width="0" prop="currency" algin="left"
>
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="refundNum" label="退货数量" width="0" align="left"
/>
<el-table-column label="单据状态 " width="0" prop="status" algin="left"
>
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="150" >
<template slot-scope="scope">
<el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text"
@click="goDetail(scope.row.id)">详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="单据编号">
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()" />
</el-tooltip>
<screenfull isContainer />
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange">
<el-table-column prop="documentNo" label="单据编号" width="0" align="left" />
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="0" align="left" />
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="0" align="left" />
<el-table-column prop="refundAmount" label="退货金额" width="0" align="left" />
<el-table-column prop="actualAmount" label="实退金额" width="0" align="left" />
<el-table-column label="币别 " width="0" prop="currency" algin="left">
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="refundNum" label="退货数量" width="0" align="left" />
<el-table-column label="单据状态 " width="0" prop="status" algin="left">
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left" />
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
</div>
</template>
<script>
import request from '@/utils/request'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import ExportBox from './ExportBox'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import Detail from './Detail'
import request from '@/utils/request'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import ExportBox from './ExportBox'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default {
components: {JNPFForm, ExportBox,Detail},
data() {
return {
detailVisible: false,
query: {
documentNo:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
exportBoxVisible: false,
columnList: [
{prop: 'documentNo', label: '单据编号'},
{prop: 'jg_purchaseorder.contractName', label: '合同名称'},
{prop: 'jg_purchaseorder.supplierName', label: '供应商名称'},
{prop: 'refundAmount', label: '退货金额'},
{prop: 'actualAmount', label: '实退金额'},
{prop: 'currency', label: '币别 '},
{prop: 'refundNum', label: '退货数量'},
{prop: 'status', label: '单据状态 '},
{prop: 'creatorTime', label: '创建时间'},
{prop: 'creatorUserName', label: '创建人'},
{prop: 'remark', label: '备注'},
],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
statusProps:{"label":"fullName","value":"id"},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
goDetail(id){
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId:this.menuId
};
request({
url: `/api/purchaseback/Purchaseback/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =[];
for(let i=0;i<res.data.list.length;i++){
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
documentNo: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
exportBoxVisible: false,
columnList: [{
prop: 'documentNo',
label: '单据编号'
},
{
prop: 'jg_purchaseorder.contractName',
label: '合同名称'
},
{
prop: 'jg_purchaseorder.supplierName',
label: '供应商名称'
},
{
prop: 'refundAmount',
label: '退货金额'
},
{
prop: 'actualAmount',
label: '实退金额'
},
{
prop: 'currency',
label: '币别 '
},
{
prop: 'refundNum',
label: '退货数量'
},
{
prop: 'status',
label: '单据状态 '
},
{
prop: 'creatorTime',
label: '创建时间'
},
{
prop: 'creatorUserName',
label: '创建人'
},
{
prop: 'remark',
label: '备注'
},
],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
currencyProps: {
"label": "fullName",
"value": "id"
},
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}],
statusProps: {
"label": "fullName",
"value": "id"
},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/purchaseback/Purchaseback/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = [];
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseback/Purchaseback/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
addOrUpdateHandle(id, isDetail) {
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.columnList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/purchaseback/Purchaseback/Actions/Export`,
method: 'GET',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseback/Purchaseback/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {});
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {})
},
addOrUpdateHandle(id, isDetail) {
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.columnList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/purchaseback/Purchaseback/Actions/Export`,
method: 'GET',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
</script>

@ -1,402 +1,462 @@
<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="请输入" clearable :style='{"width":"100%"}'>
<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%"}'>
</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" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</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" 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>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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="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="jnpf_jg_salesorder_jnpf_contractName" >
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_contractName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户名称"
prop="jnpf_jg_salesorder_jnpf_costomerName" >
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_costomerName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="实退金额"
prop="actualAmount" >
<el-input v-model="dataForm.actualAmount"
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" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="创建时间"
prop="creatorTime" >
<el-input v-model="dataForm.creatorTime"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="创建人"
prop="creatorUserName" >
<el-input v-model="dataForm.creatorUserName"
placeholder="系统自动生成" readonly >
</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" :columnOptions="saleback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog"
popupWidth="800px"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pountUser" label="业务员">
<template slot-scope="scope">
<el-input v-model="scope.row.pountUser"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
<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>
</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"
:columnOptions="saleback_item0licenseNumcolumnOptions"
propsValue="license_num" relationField="license_num"
popupType="dialog" popupWidth="800px" @change="popupSelectChange2">
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialName" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</el-input>
</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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
<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%"}'>
</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%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pountUser" label="业务员">
<template slot-scope="scope">
<el-input v-model="scope.row.pountUser" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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%"}'>
<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 {
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"}],
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: '',
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"
}],
saleback_item0licenseNumcolumnOptions:[ {"label":"车牌号","value":"license_num"}, {"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":"pound_user"}, {"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"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
saleback_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.saleback_item0List.length;i++){
const e = this.dataForm.saleback_item0List[i];
saleback_item0licenseNumcolumnOptions: [{
"label": "车牌号",
"value": "license_num"
}, {
"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": "pound_user"
}, {
"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"
}],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
popupSelectChange2(a, b){
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
if(a == this.dataForm.saleback_item0List[i].licenseNum){
this.dataForm.saleback_item0List[i].materialName = b.material_name;
this.dataForm.saleback_item0List[i].settlement = b.settlement;
this.dataForm.saleback_item0List[i].unit = b.unit;
this.dataForm.saleback_item0List[i].price = b.unit_price;
this.dataForm.saleback_item0List[i].rate = b.rate;
this.dataForm.saleback_item0List[i].amount = b.amount;
this.dataForm.saleback_item0List[i].notAmount = b.not_amount;
this.dataForm.saleback_item0List[i].pountUser = b.pound_user;
this.dataForm.saleback_item0List[i].pountType = b.pound_type;
}
}
},
popupSelectChange(e,d){
this.dataForm.currency = d.currency;
},
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(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/saleback/Saleback/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.saleback_item0Exist()) return
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/saleback/Saleback',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/saleback/Saleback/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
addsaleback_item0List(){
let item = {
licenseNum:undefined,
materialName:undefined,
settlement:undefined,
unit:undefined,
price:undefined,
rate:undefined,
amount:undefined,
notAmount:undefined,
pountUser:undefined,
pountType:undefined,
}
this.dataForm.saleback_item0List.push(item)
},
delsaleback_item0List(index) {
this.dataForm.saleback_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
_data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
for(let i=0;i<_data.saleback_item0List.length;i++){
var _list = _data.saleback_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
_dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for(let i=0;i<_dataAll.saleback_item0List.length;i++){
var _list = _dataAll.saleback_item0List[i];
}
this.dataForm = _dataAll
},
},
}
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(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/saleback/Saleback/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.saleback_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/saleback/Saleback',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/saleback/Saleback/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
addsaleback_item0List() {
let item = {
licenseNum: undefined,
materialName: undefined,
settlement: undefined,
unit: undefined,
price: undefined,
rate: undefined,
amount: undefined,
notAmount: undefined,
pountUser: undefined,
pountType: undefined,
}
this.dataForm.saleback_item0List.push(item)
},
delsaleback_item0List(index) {
this.dataForm.saleback_item0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
_data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
for (let i = 0; i < _data.saleback_item0List.length; i++) {
var _list = _data.saleback_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
_dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for (let i = 0; i < _dataAll.saleback_item0List.length; i++) {
var _list = _dataAll.saleback_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

Loading…
Cancel
Save