日照客户添加新的字段销售订单

product
bawei 2 years ago
parent 2d2eb8fd04
commit 6cefae75b6

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,454 +1,504 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentNo" >
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="8">
<el-form-item label="单据编号"
prop="documentNo">
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="业务类型"
prop="type" >
<el-select v-model="dataForm.type"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务类型"
prop="type">
<el-select v-model="dataForm.type"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="来源单号"
prop="sourceNo" >
<popupSelect v-model="dataForm.sourceNo"
placeholder="请选择" clearable field="salesId" interfaceId="392956668264114117" :columnOptions="salesIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="来源单号"
prop="sourceNo">
<popupSelect v-model="dataForm.sourceNo"
placeholder="请选择" clearable field="salesId" interfaceId="392956668264114117"
:columnOptions="salesIdcolumnOptions" propsValue="id" relationField="document_no"
popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="出库金额"
prop="amount" >
<el-input v-model="dataForm.amount"
placeholder="请输入出库金额" readonly clearable :style='{"width":"100%"}' disabled>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库金额"
prop="amount">
<el-input v-model="dataForm.amount"
placeholder="请输入出库金额" readonly clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别"
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币别"
prop="currency">
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="出库数量"
prop="num" >
<el-input v-model="dataForm.num"
placeholder="请输入出库数量" readonly clearable :style='{"width":"100%"}' disabled>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="出库数量"
prop="num">
<el-input v-model="dataForm.num"
placeholder="请输入出库数量" readonly clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户"
prop="customerId" >
<popupSelect v-model="dataForm.customerId"
placeholder="请选择" clearable field="customerId" interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20" >
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户"
prop="customerId">
<popupSelect v-model="dataForm.customerId"
placeholder="请选择" clearable field="customerId" interfaceId="395936123471343749"
:columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm"
popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="备注"
prop="remark">
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12" >-->
<!-- <el-form-item label="出库日期"-->
<!-- prop="issueDate" >-->
<!-- <el-date-picker v-model="dataForm.issueDate"-->
<!-- placeholder="请选择出库日期" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >-->
</el-input>
</el-form-item>
</el-col>
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12" >-->
<!-- <el-form-item label="单据状态"-->
<!-- prop="status" >-->
<!-- <el-select v-model="dataForm.status"-->
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-tabs v-model="activezlqlfb" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24" >
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.receiptout_item0List" size='mini' show-summary :summary-method="getSummaries" >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="vehicleId" label="车牌号" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.vehicleId"
placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="398732963950472005" :columnOptions="receiptout_item0vehicleIdcolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
popupWidth="800px"
hasPage :pageSize="20" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称" align="center" width="180">
<template slot-scope="scope">
<popupSelect v-model="scope.row.materialId"
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="398719564478785669" :columnOptions="receiptout_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="reservoirareaId" label="库区名称" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.reservoirareaId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="381404161809350213" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupWidth="800px" @change="areaSelect"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库名称" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.warehouseId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="399117969575232581" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
popupWidth="800px" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="batchNo" label="批次号" align="center" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.batchNo"
placeholder="系统自动生成" readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="deliveryNum" label="出库数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.deliveryNum"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="计量单位" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rateAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.rateAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="poundType" label="磅单类型" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.poundType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in poundTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="50" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delreceiptout_item0List(scope.$index)" disabled>删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <div class="table-actions" @click="addreceiptout_item0List()" disabled="">-->
<!-- <el-button type="text" icon="el-icon-plus" disabled >添加</el-button>-->
<!-- </div>-->
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
<!-- <el-col :span="12" >-->
<!-- <el-form-item label="出库日期"-->
<!-- prop="issueDate" >-->
<!-- <el-date-picker v-model="dataForm.issueDate"-->
<!-- placeholder="请选择出库日期" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12" >-->
<!-- <el-form-item label="单据状态"-->
<!-- prop="status" >-->
<!-- <el-select v-model="dataForm.status"-->
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-tabs v-model="activezlqlfb" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.receiptout_item0List" size='mini' show-summary
:summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center"/>
<el-table-column prop="vehicleId" label="车牌号" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.vehicleId"
placeholder="请选择" clearable :field="'vehicleId'+scope.$index"
interfaceId="398732963950472005"
:columnOptions="receiptout_item0vehicleIdcolumnOptions" propsValue="id"
relationField="ticketno" popupType="dialog"
popupWidth="800px"
hasPage :pageSize="20" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称" align="center" width="180">
<template slot-scope="scope">
<popupSelect v-model="scope.row.materialId"
placeholder="请选择" clearable :field="'materialId'+scope.$index"
interfaceId="398719564478785669"
:columnOptions="receiptout_item0materialIdcolumnOptions" propsValue="id"
relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="reservoirareaId" label="库区名称" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.reservoirareaId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index"
interfaceId="381404161809350213"
:columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id"
relationField="areaname" popupType="dialog"
popupWidth="800px" @change="areaSelect"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库名称" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.warehouseId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index"
interfaceId="399117969575232581"
:columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id"
relationField="name" popupType="dialog"
popupWidth="800px" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="batchNo" label="批次号" align="center" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.batchNo"
placeholder="系统自动生成" readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="deliveryNum" label="出库数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.deliveryNum"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="计量单位" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rateAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.rateAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="poundType" label="磅单类型" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.poundType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in poundTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="50" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delreceiptout_item0List(scope.$index)" disabled>删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <div class="table-actions" @click="addreceiptout_item0List()" disabled="">-->
<!-- <el-button type="text" icon="el-icon-plus" disabled >添加</el-button>-->
<!-- </div>-->
</el-form-item>
</el-col>
</template>
</el-form>
</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-dialog>
</template>
<script>
import request from '@/utils/request'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentNo : '',
type : "0",
salesId : "",
amount : '',
currency : "0",
num : '',
customerId : '',
remark : '',
issueDate : '',
status : "0",
creatorTime : "",
creatorUserName : "",
lastModifyTime : "",
lastModifyUserName : "",
receiptout_item0List:[],
},
activezlqlfb:'0',
rules:
{
type: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
sourceNo: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
},
typeOptions:[{"fullName":"销售出库","id":"0"},{"fullName":"购销出库","id":"1"}],
salesIdcolumnOptions:[ {"label":"单据编号","value":"document_no"}, {"label":"币别","value":"currency"}, {"label":"客户名称","value":"customer_name"},],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"联系人","value":"contact_name"}, {"label":"地址","value":"address"},],
receiptout_item0vehicleIdcolumnOptions:[ {"label":"车辆号","value":"ticketno"}],
receiptout_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
receiptout_item0reservoirareaIdcolumnOptions:[ {"label":"库区名称","value":"areaname"}, {"label":"最高库存","value":"maximum"}, {"label":"安全库存","value":"safety"}, {"label":"最低库存","value":"minimum"}, {"label":"仓库名称","value":"name"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
rateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
poundTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"自加工","id":"1"},{"fullName":"委外","id":"2"},{"fullName":"倒运","id":"3"}],
}
},
computed: {},
watch: {},
created() {
import request from '@/utils/request'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentNo: '',
type: "0",
salesId: "",
amount: '',
currency: "0",
num: '',
customerId: '',
remark: '',
issueDate: '',
status: "0",
creatorTime: "",
creatorUserName: "",
lastModifyTime: "",
lastModifyUserName: "",
receiptout_item0List: [],
},
mounted() {},
methods: {
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 6 || index === 8 || index === 10 || index === 11 )) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
activezlqlfb: '0',
rules:
{
type: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
sourceNo: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
},
areaSelect(a,b){
for (let i = 0;i<this.dataForm.receiptout_item0List.length;i++) {
if (a == this.dataForm.receiptout_item0List[i].reservoirareaId) {
this.dataForm.receiptout_item0List[i].warehouseId = b.warehouse_id
typeOptions: [{"fullName": "销售出库", "id": "0"}, {"fullName": "购销出库", "id": "1"}],
salesIdcolumnOptions: [{"label": "单据编号", "value": "document_no"}, {
"label": "币别",
"value": "currency"
}, {"label": "客户名称", "value": "customer_name"},],
currencyOptions: [{"fullName": "人民币", "id": "0"}, {"fullName": "美元", "id": "1"}, {"fullName": "英镑", "id": "2"}],
statusOptions: [{"fullName": "已保存", "id": "0"}, {"fullName": "审批中", "id": "1"}, {"fullName": "已审批", "id": "2"}],
customerIdcolumnOptions: [{"label": "客户编码", "value": "supplier_cd"}, {
"label": "客户名称",
"value": "supplier_nm"
}, {"label": "联系人", "value": "contact_name"}, {"label": "地址", "value": "address"},],
receiptout_item0vehicleIdcolumnOptions: [{"label": "车辆号", "value": "ticketno"}],
receiptout_item0materialIdcolumnOptions: [{"label": "物料编码", "value": "item_code"}, {
"label": "物料名称",
"value": "item_name"
}, {"label": "单位", "value": "primary_unit_of_measure"}, {
"label": "默认入库区",
"value": "in_area"
}, {"label": "默认出库区", "value": "out_area"},],
receiptout_item0reservoirareaIdcolumnOptions: [{"label": "库区名称", "value": "areaname"}, {
"label": "最高库存",
"value": "maximum"
}, {"label": "安全库存", "value": "safety"}, {"label": "最低库存", "value": "minimum"}, {
"label": "仓库名称",
"value": "name"
},],
unitOptions: [{"fullName": "吨", "id": "0"}, {"fullName": "千克", "id": "1"}],
rateOptions: [{"fullName": "13", "id": "0"}, {"fullName": "9", "id": "1"}, {
"fullName": "6",
"id": "2"
}, {"fullName": "5", "id": "3"}, {"fullName": "3", "id": "4"}, {"fullName": "0", "id": "5"}],
poundTypeOptions: [{"fullName": "贸易", "id": "0"}, {"fullName": "自加工", "id": "1"}, {
"fullName": "委外",
"id": "2"
}, {"fullName": "倒运", "id": "3"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {
},
methods: {
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 6 || index === 8 || index === 10 || index === 11)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
areaSelect(a, b) {
for (let i = 0; i < this.dataForm.receiptout_item0List.length; i++) {
if (a == this.dataForm.receiptout_item0List[i].reservoirareaId) {
this.dataForm.receiptout_item0List[i].warehouseId = b.warehouse_id
}
}
},
receiptout_item0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.receiptout_item0List.length; i++) {
const e = this.dataForm.receiptout_item0List[i];
}
return isOk;
},
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(list) {
this.visible = true;
this.dataForm.documentNo = list[0].documentNo;
this.dataForm.amount = list[0].price;
this.dataForm.num = list[0].num;
this.dataForm.sourceNo = list[0].id;
this.dataForm.customerId = list[0].customerId;
debugger
this.dataForm.receiptout_item0List = list[0].list;
for (let i = 0; i < list[0].list.length; i++) {
this.dataForm.receiptout_item0List[i].amount = list[0].list[i].price;
this.dataForm.receiptout_item0List[i].price = list[0].list[i].unitPrice;
this.dataForm.receiptout_item0List[i].deliveryNum = list[0].list[i].settlement;
this.dataForm.receiptout_item0List[i].unit = list[0].list[i].poundEntity.unit;
this.dataForm.receiptout_item0List[i].poundType = list[0].list[i].poundEntity.poundType;
debugger
this.rateOptions.find((item) => {
if (this.dataForm.receiptout_item0List[i].rate == item.id) {
this.dataForm.receiptout_item0List[i].rateAmount = this.dataForm.receiptout_item0List[i].amount * item.fullName / 100
debugger
}
},
receiptout_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.receiptout_item0List.length;i++){
const e = this.dataForm.receiptout_item0List[i];
}
return isOk;
},
clearData(data){
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(list) {
this.visible = true;
this.dataForm.documentNo = list[0].documentNo;
this.dataForm.amount = list[0].price;
this.dataForm.num = list[0].num;
this.dataForm.sourceNo = list[0].id;
this.dataForm.customerId = list[0].customerId;
debugger
this.dataForm.receiptout_item0List = list[0].list;
for (let i = 0;i<list[0].list.length;i++){
this.dataForm.receiptout_item0List[i].amount = list[0].list[i].price;
this.dataForm.receiptout_item0List[i].price = list[0].list[i].unitPrice;
this.dataForm.receiptout_item0List[i].deliveryNum = list[0].list[i].settlement;
this.dataForm.receiptout_item0List[i].unit = list[0].list[i].poundEntity.unit;
this.dataForm.receiptout_item0List[i].poundType = list[0].list[i].poundEntity.poundType;
debugger
this.rateOptions.find((item) => {
if (this.dataForm.receiptout_item0List[i].rate == item.id) {
this.dataForm.receiptout_item0List[i].rateAmount = this.dataForm.receiptout_item0List[i].amount*item.fullName/100
debugger
}
})
}
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.receiptout_item0Exist()) return
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/receipout/Receiptout/saleordercreate',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/receipout/Receiptout/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
addreceiptout_item0List(){
let item = {
vehicleId:undefined,
materialId:undefined,
reservoirareaId:undefined,
warehouseId:undefined,
deliveryNum:undefined,
unit:undefined,
price:undefined,
rate:undefined,
amount:undefined,
rateAmount:undefined,
batchNo:undefined,
poundType:undefined,
}
this.dataForm.receiptout_item0List.push(item)
},
delreceiptout_item0List(index) {
this.dataForm.receiptout_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.receiptout_item0List.length;i++){
var _list = _data.receiptout_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.receiptout_item0List.length;i++){
var _list = _dataAll.receiptout_item0List[i];
}
this.dataForm = _dataAll
},
},
}
})
}
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.receiptout_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/receipout/Receiptout/saleordercreate',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/receipout/Receiptout/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
addreceiptout_item0List() {
let item = {
vehicleId: undefined,
materialId: undefined,
reservoirareaId: undefined,
warehouseId: undefined,
deliveryNum: undefined,
unit: undefined,
price: undefined,
rate: undefined,
amount: undefined,
rateAmount: undefined,
batchNo: undefined,
poundType: undefined,
}
this.dataForm.receiptout_item0List.push(item)
},
delreceiptout_item0List(index) {
this.dataForm.receiptout_item0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.receiptout_item0List.length; i++) {
var _list = _data.receiptout_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
for (let i = 0; i < _dataAll.receiptout_item0List.length; i++) {
var _list = _dataAll.receiptout_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -18,6 +18,8 @@
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="24">
</el-col>
<el-col :span="6">
<el-form-item label="物料名称" prop="materialId">
<popupSelect v-model="dataForm.materialId" placeholder="请选择物料编码" clearable field="materialId"

Loading…
Cancel
Save