product
17602169347 2 years ago
parent 0a9d1f84e2
commit 21e5c8dd37

@ -1,403 +1,466 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-row :gutter="15" class="">
width="1000px"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
<el-row :gutter="15" class=""> label-position="right">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" > <template v-if="!loading">
<template v-if="!loading"> <el-col :span="8">
<el-col :span="8" > <el-form-item label="单据编号" prop="documentNo">
<el-form-item label="单据编号" <el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
prop="documentNo" > :style='{"width":"100%"}'>
<el-input v-model="dataForm.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="采购订单" <el-form-item label="采购订单" prop="purchaseOrderId">
prop="purchaseOrderId" > <popupSelect v-model="dataForm.purchaseOrderId" placeholder="请选择" clearable
<popupSelect v-model="dataForm.purchaseOrderId" field="purchaseOrderId" interfaceId="383149471917185157"
placeholder="请选择" clearable field="purchaseOrderId" interfaceId="383149471917185157" :columnOptions="purchaseOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog" :columnOptions="purchaseOrderIdcolumnOptions" propsValue="id"
popupTitle="选择数据" popupWidth="800px" relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="币别 " <el-form-item label="币别 " prop="currency">
prop="currency" > <el-select v-model="dataForm.currency" placeholder="请选择" clearable
<el-select v-model="dataForm.currency" :style='{"width":"100%"}'>
placeholder="请选择" clearable :style='{"width":"100%"}'> <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="退货金额" <el-form-item label="退货金额" prop="refundAmount">
prop="refundAmount" > <el-input v-model="dataForm.refundAmount" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.refundAmount"
clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="退货数量" <el-form-item label="退货数量" prop="refundNum">
prop="refundNum" > <el-input v-model="dataForm.refundNum" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.refundNum"
clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="备注" <el-form-item label="备注" prop="remark">
prop="remark" > <el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="24">
<el-form-item label="合同名称" <el-tabs v-model="activeyrmekt" tab-position="top" class="mb-20">
prop="jnpf_jg_purchaseorder_jnpf_contractName" > <el-tab-pane label="磅单明细">
<el-input v-model=" dataForm.jnpf_jg_purchaseorder_jnpf_contractName" <el-col :span="24">
placeholder="请输入" clearable :style='{"width":"100%"}'> <el-form-item label-width="0">
</el-input> <div class="JNPF-common-title">
</el-form-item> <h2></h2>
</el-col> </div>
<el-col :span="8" > <el-table :data="dataForm.purchaseback_item0List" size='mini'>
<el-form-item label="供应商名称" <el-table-column type="index" width="50" label="序号" align="center" />
prop="jnpf_jg_purchaseorder_jnpf_supplierName" > <el-table-column prop="licenseNum" label="车牌号">
<el-input v-model=" dataForm.jnpf_jg_purchaseorder_jnpf_supplierName" <template slot-scope="scope">
placeholder="请输入" clearable :style='{"width":"100%"}'> <popupSelect v-model="scope.row.licenseNum" placeholder="请选择"
</el-input> clearable :field="'licenseNum'+scope.$index"
</el-form-item> interfaceId="383214061812227333"
</el-col> :bissId="dataForm.purchaseOrderId"
<el-col :span="8" > :columnOptions="purchaseback_item0licenseNumcolumnOptions"
<el-form-item label="实退金额" propsValue="license_num" relationField="license_num"
prop="actualAmount" > popupType="dialog" popupWidth="800px" @change="popupSelectChange2">
<el-input v-model="dataForm.actualAmount" </popupSelect>
placeholder="请输入" clearable :style='{"width":"100%"}'> </template>
</el-table-column>
</el-input> <el-table-column prop="materialName" label="物料名称">
</el-form-item> <template slot-scope="scope">
</el-col> <el-input v-model="scope.row.materialName" placeholder="请输入"
<el-col :span="8" > clearable :style='{"width":"100%"}'>
<el-form-item label="单据状态 " </el-input>
prop="status" > </template>
<el-select v-model="dataForm.status" </el-table-column>
placeholder="请选择" clearable :style='{"width":"100%"}'> <el-table-column prop="settlement" label="结算重量 ">
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <template slot-scope="scope">
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
</el-select> :style='{"width":"100%"}'>
</el-form-item> </el-input>
</el-col> </template>
<el-col :span="8" > </el-table-column>
<el-form-item label="创建时间" <el-table-column prop="unit" label="计量单位 ">
prop="creatorTime" > <template slot-scope="scope">
<el-input v-model="dataForm.creatorTime" <el-select v-model="scope.row.unit" placeholder="请选择" clearable
placeholder="系统自动生成" readonly > :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index"
</el-input> :label="item.fullName" :value="item.id"
</el-form-item> :disabled="item.disabled"></el-option>
</el-col> </el-select>
<el-col :span="8" > </template>
<el-form-item label="创建人" </el-table-column>
prop="creatorUserName" > <el-table-column prop="price" label="采购单价">
<el-input v-model="dataForm.creatorUserName" <template slot-scope="scope">
placeholder="系统自动生成" readonly > <el-input v-model="scope.row.price" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </template>
</el-col> </el-table-column>
<el-col :span="24"> <el-table-column prop="rate" label="税率 ">
<el-tabs v-model="activeyrmekt" tab-position="top" class="mb-20"> <template slot-scope="scope">
<el-tab-pane label="磅单明细"> <el-select v-model="scope.row.rate" placeholder="请选择" clearable
<el-col :span="24" > :style='{"width":"100%"}'>
<el-form-item label-width="0"> <el-option v-for="(item, index) in rateOptions" :key="index"
<div class="JNPF-common-title"> :label="item.fullName" :value="item.id"
<h2></h2> :disabled="item.disabled"></el-option>
</div> </el-select>
<el-table :data="dataForm.purchaseback_item0List" size='mini' > </template>
<el-table-column type="index" width="50" label="序号" align="center" /> </el-table-column>
<el-table-column prop="licenseNum" label="车牌号"> <el-table-column prop="amount" label="应退金额">
<template slot-scope="scope"> <template slot-scope="scope">
<popupSelect v-model="scope.row.licenseNum" <el-input v-model="scope.row.amount" placeholder="请输入" clearable
placeholder="请选择" clearable :field="'licenseNum'+scope.$index" interfaceId="383214061812227333" :bissId="dataForm.purchaseOrderId" :columnOptions="purchaseback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog" :style='{"width":"100%"}'>
popupWidth="800px" </el-input>
> </template>
</popupSelect> </el-table-column>
</template> <el-table-column prop="notAmount" label="税额">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="materialName" label="物料名称"> <el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
<template slot-scope="scope"> :style='{"width":"100%"}'>
<el-input v-model="scope.row.materialName" </el-input>
placeholder="请输入" clearable :style='{"width":"100%"}'> </template>
</el-input> </el-table-column>
</template> <el-table-column prop="pountUser" label="业务员">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="settlement" label="结算重量 "> <el-input v-model="scope.row.pountUser" placeholder="请输入" clearable
<template slot-scope="scope"> :style='{"width":"100%"}'>
<el-input v-model="scope.row.settlement" </el-input>
placeholder="请输入" clearable :style='{"width":"100%"}'> </template>
</el-input> </el-table-column>
</template> <el-table-column prop="pountType" label="磅单类型 ">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="unit" label="计量单位 "> <el-select v-model="scope.row.pountType" placeholder="请选择" clearable
<template slot-scope="scope"> :style='{"width":"100%"}'>
<el-select v-model="scope.row.unit" <el-option v-for="(item, index) in pountTypeOptions"
placeholder="请选择" clearable :style='{"width":"100%"}'> :key="index" :label="item.fullName" :value="item.id"
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> :disabled="item.disabled"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="采购单价"> <el-table-column label="操作" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.price" <el-button size="mini" type="text" class="JNPF-table-delBtn"
placeholder="请输入" clearable :style='{"width":"100%"}'> @click="delpurchaseback_item0List(scope.$index)">删除</el-button>
</el-input> </template>
</template> </el-table-column>
</el-table-column> </el-table>
<el-table-column prop="rate" label="税率 "> <div class="table-actions" @click="addpurchaseback_item0List()">
<template slot-scope="scope"> <el-button type="text" icon="el-icon-plus">添加</el-button>
<el-select v-model="scope.row.rate" </div>
placeholder="请选择" clearable :style='{"width":"100%"}'> </el-form-item>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> </el-col>
</el-select> </el-tab-pane>
</template> </el-tabs>
</el-table-column> </el-col>
<el-table-column prop="amount" label="应退金额"> </template>
<template slot-scope="scope"> <Form v-if="formVisible" ref="form" />
<el-input v-model="scope.row.amount" </el-form>
placeholder="请输入" clearable :style='{"width":"100%"}'> </el-row>
</el-input> <span slot="footer" class="dialog-footer">
</template> <el-button @click="visible = false"> </el-button>
</el-table-column> <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
<el-table-column prop="notAmount" label="税额"> </span>
<template slot-scope="scope"> </el-dialog>
<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>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' getDataInterfaceRes
export default { } from '@/api/systemData/dataInterface'
components: {}, import {
props: [], getDictionaryDataSelector
data() { } from '@/api/systemData/dictionary'
return { export default {
bissId: '380716763022647941', components: { },
visible: false, props: [],
loading: false, data() {
isDetail: false, return {
dataForm: { bissId: '380716763022647941',
documentNo : '', formVisible: false,
purchaseOrderId : "", visible: false,
currency : "0", loading: false,
refundAmount : '', isDetail: false,
refundNum : '', dataForm: {
remark : '', documentNo: '',
actualAmount : '', purchaseOrderId: "",
status : "0", currency: "0",
creatorTime : "", refundAmount: '',
creatorUserName : "", refundNum: '',
purchaseback_item0List:[], remark: '',
jg_purchaseorder: actualAmount: '',
{ status: "0",
contractName:'', creatorTime: "",
supplierName:'', creatorUserName: "",
}, purchaseback_item0List: [],
jnpf_jg_purchaseorder_jnpf_contractName:'', jg_purchaseorder: {
jnpf_jg_purchaseorder_jnpf_supplierName:'', contractName: '',
}, supplierName: '',
activeyrmekt:'0', },
rules: jnpf_jg_purchaseorder_jnpf_contractName: '',
{ jnpf_jg_purchaseorder_jnpf_supplierName: '',
}, },
purchaseOrderIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"采购订单号","value":"document_no"}, {"label":"合同名称","value":"contract_name"}, {"label":"供应商名称","value":"supplier_name"}, {"label":"币别","value":"currency"}, {"label":"状态","value":"status"},], activeyrmekt: '0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], rules: {},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}], 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"},], purchaseback_item0licenseNumcolumnOptions: [{
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], "label": "车牌号",
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"}], "value": "license_num"
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}], }, {
} "label": "物料名称",
}, "value": "material_name"
computed: {}, }, {
watch: {}, "label": "结算重量",
created() { "value": "settlement"
}, }, {
mounted() {}, "label": "计量单位",
methods: { "value": "unit"
purchaseback_item0Exist() { }, {
let isOk = true; "label": "采购单价",
for(let i=0;i<this.dataForm.purchaseback_item0List.length;i++){ "value": "price"
const e = this.dataForm.purchaseback_item0List[i]; }, {
"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; return isOk;
}, },
clearData(data){ clearData(data) {
for (let key in data) { for (let key in data) {
if (data[key] instanceof Array) { if (data[key] instanceof Array) {
data[key] = []; data[key] = [];
} else if (data[key] instanceof Object) { } else if (data[key] instanceof Object) {
this.clearData(data[key]); this.clearData(data[key]);
} else { } else {
data[key] = ""; data[key] = "";
} }
} }
}, },
init(id, isDetail) { init(id, isDetail) {
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.isDetail = isDetail || false; this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields(); this.$refs['elForm'].resetFields();
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/purchaseback/Purchaseback/'+this.dataForm.id, url: '/api/purchaseback/Purchaseback/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData(this.dataForm) this.clearData(this.dataForm)
} }
}); });
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['elForm'].validate((valid) => { this.$refs['elForm'].validate((valid) => {
if (valid) { if (valid) {
if (!this.purchaseback_item0Exist()) return if (!this.purchaseback_item0Exist()) return
this.request() this.request()
} }
}) })
}, },
request() { request() {
var _data =this.dataList() var _data = this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/purchaseback/Purchaseback', url: '/api/purchaseback/Purchaseback',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success', type: 'success',
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}) })
}else{ } else {
request({ request({
url: '/api/purchaseback/Purchaseback/'+this.dataForm.id, url: '/api/purchaseback/Purchaseback/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success', type: 'success',
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}) })
} }
}, },
addpurchaseback_item0List(){ addpurchaseback_item0List() {
let item = { let item = {
licenseNum:undefined, licenseNum: undefined,
materialName:undefined, materialName: undefined,
settlement:undefined, settlement: undefined,
unit:undefined, unit: undefined,
price:undefined, price: undefined,
rate:undefined, rate: undefined,
amount:undefined, amount: undefined,
notAmount:undefined, notAmount: undefined,
pountUser:undefined, pountUser: undefined,
pountType:undefined, pountType: undefined,
} }
this.dataForm.purchaseback_item0List.push(item) this.dataForm.purchaseback_item0List.push(item)
}, },
delpurchaseback_item0List(index) { delpurchaseback_item0List(index) {
this.dataForm.purchaseback_item0List.splice(index, 1); this.dataForm.purchaseback_item0List.splice(index, 1);
}, },
dataList(){ dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm)); var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.jg_purchaseorder.contractName = _data.jnpf_jg_purchaseorder_jnpf_contractName _data.jg_purchaseorder.contractName = _data.jnpf_jg_purchaseorder_jnpf_contractName
_data.jg_purchaseorder.supplierName = _data.jnpf_jg_purchaseorder_jnpf_supplierName _data.jg_purchaseorder.supplierName = _data.jnpf_jg_purchaseorder_jnpf_supplierName
for(let i=0;i<_data.purchaseback_item0List.length;i++){ for (let i = 0; i < _data.purchaseback_item0List.length; i++) {
var _list = _data.purchaseback_item0List[i]; var _list = _data.purchaseback_item0List[i];
} }
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
_dataAll.jnpf_jg_purchaseorder_jnpf_contractName = _dataAll.jg_purchaseorder.contractName _dataAll.jnpf_jg_purchaseorder_jnpf_contractName = _dataAll.jg_purchaseorder.contractName
_dataAll.jnpf_jg_purchaseorder_jnpf_supplierName = _dataAll.jg_purchaseorder.supplierName _dataAll.jnpf_jg_purchaseorder_jnpf_supplierName = _dataAll.jg_purchaseorder.supplierName
for(let i=0;i<_dataAll.purchaseback_item0List.length;i++){ for (let i = 0; i < _dataAll.purchaseback_item0List.length; i++) {
var _list = _dataAll.purchaseback_item0List[i]; var _list = _dataAll.purchaseback_item0List[i];
} }
this.dataForm = _dataAll this.dataForm = _dataAll
}, },
}, },
} }
</script> </script>

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

@ -1,402 +1,462 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:close-on-click-modal="false" append-to-body :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-row :gutter="15" class="">
width="1000px"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
<el-row :gutter="15" class=""> label-position="right">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" > <template v-if="!loading">
<template v-if="!loading"> <el-col :span="8">
<el-col :span="8" > <el-form-item label="单据编号" prop="documentNo">
<el-form-item label="单据编号" <el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
prop="documentNo" > :style='{"width":"100%"}'>
<el-input v-model="dataForm.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="销售订单" <el-form-item label="销售订单" prop="salesOrderId">
prop="salesOrderId" > <popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
<popupSelect v-model="dataForm.salesOrderId" field="salesOrderId" interfaceId="383568951197606085"
placeholder="请选择" clearable field="salesOrderId" interfaceId="383568951197606085" :columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog" :columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no"
popupTitle="选择数据" popupWidth="800px" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="币别" <el-form-item label="币别" prop="currency">
prop="currency" > <el-select v-model="dataForm.currency" placeholder="请选择" clearable
<el-select v-model="dataForm.currency" :style='{"width":"100%"}'>
placeholder="请选择" clearable :style='{"width":"100%"}'> <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> :value="item.id" :disabled="item.disabled"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="退款金额" <el-form-item label="退款金额" prop="refundAmount">
prop="refundAmount" > <el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.refundAmount"
readonly clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="退货数量" <el-form-item label="退货数量" prop="refundNum">
prop="refundNum" > <el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.refundNum"
readonly clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8">
<el-form-item label="备注" <el-form-item label="备注" prop="remark">
prop="remark" > <el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="24">
<el-form-item label="合同名称" <el-tabs v-model="activeqkzogz" tab-position="top" class="mb-20">
prop="jnpf_jg_salesorder_jnpf_contractName" > <el-tab-pane label="磅单明细">
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_contractName" <el-col :span="24">
placeholder="请输入" clearable :style='{"width":"100%"}'> <el-form-item label-width="0">
</el-input> <div class="JNPF-common-title">
</el-form-item> <h2></h2>
</el-col> </div>
<el-col :span="8" > <el-table :data="dataForm.saleback_item0List" size='mini'>
<el-form-item label="客户名称" <el-table-column type="index" width="50" label="序号" align="center" />
prop="jnpf_jg_salesorder_jnpf_costomerName" > <el-table-column prop="licenseNum" label="车牌号">
<el-input v-model=" dataForm.jnpf_jg_salesorder_jnpf_costomerName" <template slot-scope="scope">
placeholder="请输入" clearable :style='{"width":"100%"}'> <popupSelect v-model="scope.row.licenseNum" placeholder="请选择"
</el-input> clearable :field="'licenseNum'+scope.$index"
</el-form-item> interfaceId="383568082196537541" :bissId="dataForm.salesOrderId"
</el-col> :columnOptions="saleback_item0licenseNumcolumnOptions"
<el-col :span="8" > propsValue="license_num" relationField="license_num"
<el-form-item label="实退金额" popupType="dialog" popupWidth="800px" @change="popupSelectChange2">
prop="actualAmount" > </popupSelect>
<el-input v-model="dataForm.actualAmount" </template>
placeholder="请输入" clearable :style='{"width":"100%"}'> </el-table-column>
<el-table-column prop="materialName" label="物料名称">
</el-input> <template slot-scope="scope">
</el-form-item> <el-input v-model="scope.row.materialName" placeholder="请输入"
</el-col> clearable :style='{"width":"100%"}'>
<el-col :span="8" > </el-input>
<el-form-item label="单据状态 " </template>
prop="status" > </el-table-column>
<el-select v-model="dataForm.status" <el-table-column prop="settlement" label="结算重量 ">
placeholder="请选择" clearable :style='{"width":"100%"}'> <template slot-scope="scope">
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-input v-model="scope.row.settlement" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-select> </el-input>
</el-form-item> </template>
</el-col> </el-table-column>
<el-col :span="8" > <el-table-column prop="unit" label="计量单位 ">
<el-form-item label="创建时间" <template slot-scope="scope">
prop="creatorTime" > <el-select v-model="scope.row.unit" placeholder="请选择" clearable
<el-input v-model="dataForm.creatorTime" :style='{"width":"100%"}'>
placeholder="系统自动生成" readonly > <el-option v-for="(item, index) in unitOptions" :key="index"
:label="item.fullName" :value="item.id"
</el-input> :disabled="item.disabled"></el-option>
</el-form-item> </el-select>
</el-col> </template>
<el-col :span="8" > </el-table-column>
<el-form-item label="创建人" <el-table-column prop="price" label="采购单价">
prop="creatorUserName" > <template slot-scope="scope">
<el-input v-model="dataForm.creatorUserName" <el-input v-model="scope.row.price" placeholder="请输入" clearable
placeholder="系统自动生成" readonly > :style='{"width":"100%"}'>
</el-input>
</el-input> </template>
</el-form-item> </el-table-column>
</el-col> <el-table-column prop="rate" label="税率">
<el-col :span="24"> <template slot-scope="scope">
<el-tabs v-model="activeqkzogz" tab-position="top" class="mb-20"> <el-select v-model="scope.row.rate" placeholder="请选择" clearable
<el-tab-pane label="商品信息"> :style='{"width":"100%"}'>
<el-col :span="24" > <el-option v-for="(item, index) in rateOptions" :key="index"
<el-form-item label-width="0"> :label="item.fullName" :value="item.id"
<div class="JNPF-common-title"> :disabled="item.disabled"></el-option>
<h2></h2> </el-select>
</div> </template>
<el-table :data="dataForm.saleback_item0List" size='mini' > </el-table-column>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column prop="amount" label="应退金额">
<el-table-column prop="licenseNum" label="车牌号"> <template slot-scope="scope">
<template slot-scope="scope"> <el-input v-model="scope.row.amount" placeholder="请输入" clearable
<popupSelect v-model="scope.row.licenseNum" :style='{"width":"100%"}'>
placeholder="请选择" clearable :field="'licenseNum'+scope.$index" interfaceId="383568082196537541" :bissId="dataForm.salesOrderId" :columnOptions="saleback_item0licenseNumcolumnOptions" propsValue="license_num" relationField="license_num" popupType="dialog" </el-input>
popupWidth="800px" </template>
> </el-table-column>
</popupSelect> <el-table-column prop="notAmount" label="税额">
</template> <template slot-scope="scope">
</el-table-column> <el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
<el-table-column prop="materialName" label="物料名称"> :style='{"width":"100%"}'>
<template slot-scope="scope"> </el-input>
<el-input v-model="scope.row.materialName" </template>
placeholder="请输入" clearable :style='{"width":"100%"}'> </el-table-column>
</el-input> <el-table-column prop="pountUser" label="业务员">
</template> <template slot-scope="scope">
</el-table-column> <el-input v-model="scope.row.pountUser" placeholder="请输入" clearable
<el-table-column prop="settlement" label="结算重量 "> :style='{"width":"100%"}'>
<template slot-scope="scope"> </el-input>
<el-input v-model="scope.row.settlement" </template>
placeholder="请输入" clearable :style='{"width":"100%"}'> </el-table-column>
</el-input> <el-table-column prop="pountType" label="磅单类型 ">
</template> <template slot-scope="scope">
</el-table-column> <el-select v-model="scope.row.pountType" placeholder="请选择" clearable
<el-table-column prop="unit" label="计量单位 "> :style='{"width":"100%"}'>
<template slot-scope="scope"> <el-option v-for="(item, index) in pountTypeOptions"
<el-select v-model="scope.row.unit" :key="index" :label="item.fullName" :value="item.id"
placeholder="请选择" clearable :style='{"width":"100%"}'> :disabled="item.disabled"></el-option>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> </el-select>
</el-select> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="操作" width="50">
<el-table-column prop="price" label="采购单价"> <template slot-scope="scope">
<template slot-scope="scope"> <el-button size="mini" type="text" class="JNPF-table-delBtn"
<el-input v-model="scope.row.price" @click="delsaleback_item0List(scope.$index)">删除</el-button>
placeholder="请输入" clearable :style='{"width":"100%"}'> </template>
</el-input> </el-table-column>
</template> </el-table>
</el-table-column> <div class="table-actions" @click="addsaleback_item0List()">
<el-table-column prop="rate" label="税率"> <el-button type="text" icon="el-icon-plus">添加</el-button>
<template slot-scope="scope"> </div>
<el-select v-model="scope.row.rate" </el-form-item>
placeholder="请选择" clearable :style='{"width":"100%"}'> </el-col>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> </el-tab-pane>
</el-select> </el-tabs>
</template> </el-col>
</el-table-column> </template>
<el-table-column prop="amount" label="应退金额"> </el-form>
<template slot-scope="scope"> </el-row>
<el-input v-model="scope.row.amount" <span slot="footer" class="dialog-footer">
placeholder="请输入" clearable :style='{"width":"100%"}'> <el-button @click="visible = false"> </el-button>
</el-input> <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</template> </span>
</el-table-column> </el-dialog>
<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> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface' import {
import { getDictionaryDataSelector } from '@/api/systemData/dictionary' getDataInterfaceRes
export default { } from '@/api/systemData/dataInterface'
components: {}, import {
props: [], getDictionaryDataSelector
data() { } from '@/api/systemData/dictionary'
return { export default {
visible: false, components: {},
loading: false, props: [],
isDetail: false, data() {
dataForm: { return {
documentNo : '', visible: false,
salesOrderId : "", loading: false,
currency : "0", isDetail: false,
refundAmount : '', dataForm: {
refundNum : '', documentNo: '',
remark : '', salesOrderId: "",
actualAmount : '', currency: "0",
status : "0", refundAmount: '',
creatorTime : "", refundNum: '',
creatorUserName : "", remark: '',
saleback_item0List:[], actualAmount: '',
jg_salesorder: status: "0",
{ creatorTime: "",
contractName:'', creatorUserName: "",
costomerName:'', saleback_item0List: [],
}, jg_salesorder: {
jnpf_jg_salesorder_jnpf_contractName:'', contractName: '',
jnpf_jg_salesorder_jnpf_costomerName:'', costomerName: '',
}, },
activeqkzogz:'0', jnpf_jg_salesorder_jnpf_contractName: '',
rules: jnpf_jg_salesorder_jnpf_costomerName: '',
{ },
}, activeqkzogz: '0',
salesOrderIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"销售订单号","value":"document_no"}, {"label":"合同名称","value":"contract_name"}, {"label":"客户名称","value":"costomer_name"}, {"label":"币别","value":"currency"}, {"label":"状态","value":"status"},], rules: {},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], salesOrderIdcolumnOptions: [{
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}], "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"},], saleback_item0licenseNumcolumnOptions: [{
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], "label": "车牌号",
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"}], "value": "license_num"
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}], }, {
} "label": "物料名称",
}, "value": "material_name"
computed: {}, }, {
watch: {}, "label": "结算重量",
created() { "value": "settlement"
}, }, {
mounted() {}, "label": "计量单位",
methods: { "value": "unit"
saleback_item0Exist() { }, {
let isOk = true; "label": "采购单价",
for(let i=0;i<this.dataForm.saleback_item0List.length;i++){ "value": "unit_price"
const e = this.dataForm.saleback_item0List[i]; }, {
"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; return isOk;
}, },
clearData(data){ clearData(data) {
for (let key in data) { for (let key in data) {
if (data[key] instanceof Array) { if (data[key] instanceof Array) {
data[key] = []; data[key] = [];
} else if (data[key] instanceof Object) { } else if (data[key] instanceof Object) {
this.clearData(data[key]); this.clearData(data[key]);
} else { } else {
data[key] = ""; data[key] = "";
} }
} }
}, },
init(id, isDetail) { init(id, isDetail) {
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.isDetail = isDetail || false; this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields(); this.$refs['elForm'].resetFields();
if(this.dataForm.id){ if (this.dataForm.id) {
this.loading = true this.loading = true
request({ request({
url: '/api/saleback/Saleback/'+this.dataForm.id, url: '/api/saleback/Saleback/' + this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}); });
}else{ } else {
this.clearData(this.dataForm) this.clearData(this.dataForm)
} }
}); });
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['elForm'].validate((valid) => { this.$refs['elForm'].validate((valid) => {
if (valid) { if (valid) {
if (!this.saleback_item0Exist()) return if (!this.saleback_item0Exist()) return
this.request() this.request()
} }
}) })
}, },
request() { request() {
var _data =this.dataList() var _data = this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/saleback/Saleback', url: '/api/saleback/Saleback',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success', type: 'success',
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}) })
}else{ } else {
request({ request({
url: '/api/saleback/Saleback/'+this.dataForm.id, url: '/api/saleback/Saleback/' + this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success', type: 'success',
duration: 1000, duration: 1000,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refresh', true) this.$emit('refresh', true)
} }
}) })
}) })
} }
}, },
addsaleback_item0List(){ addsaleback_item0List() {
let item = { let item = {
licenseNum:undefined, licenseNum: undefined,
materialName:undefined, materialName: undefined,
settlement:undefined, settlement: undefined,
unit:undefined, unit: undefined,
price:undefined, price: undefined,
rate:undefined, rate: undefined,
amount:undefined, amount: undefined,
notAmount:undefined, notAmount: undefined,
pountUser:undefined, pountUser: undefined,
pountType:undefined, pountType: undefined,
} }
this.dataForm.saleback_item0List.push(item) this.dataForm.saleback_item0List.push(item)
}, },
delsaleback_item0List(index) { delsaleback_item0List(index) {
this.dataForm.saleback_item0List.splice(index, 1); this.dataForm.saleback_item0List.splice(index, 1);
}, },
dataList(){ dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm)); var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName _data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
_data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName _data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
for(let i=0;i<_data.saleback_item0List.length;i++){ for (let i = 0; i < _data.saleback_item0List.length; i++) {
var _list = _data.saleback_item0List[i]; var _list = _data.saleback_item0List[i];
} }
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll) {
let _dataAll =dataAll let _dataAll = dataAll
_dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
_dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for(let i=0;i<_dataAll.saleback_item0List.length;i++){ for (let i = 0; i < _dataAll.saleback_item0List.length; i++) {
var _list = _dataAll.saleback_item0List[i]; var _list = _dataAll.saleback_item0List[i];
} }
this.dataForm = _dataAll this.dataForm = _dataAll
}, },
}, },
} }
</script> </script>

Loading…
Cancel
Save