1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222 |
- <template>
- <div>
- <div
- style="display: flex; justify-content: space-between; margin-bottom: 15px"
- >
- <div style="display: flex; align-items: center">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item
- ><span style="font-weight: 700">运费规则</span></el-breadcrumb-item
- >
- <el-breadcrumb-item
- ><span style="font-weight: 700">运价维护</span></el-breadcrumb-item
- >
- </el-breadcrumb>
- <el-button
- style="margin-left: 10px"
- size="mini"
- icon="el-icon-arrow-left"
- @click="goBack"
- >返回列表</el-button
- >
- </div>
- </div>
- <el-form ref="form" :model="form" :rules="rules" label-width="100px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="船公司" prop="fCorpid">
- <el-select
- size="small"
- v-model="form.fCorpid"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 80%"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in fMblnoOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="起运港" prop="polId">
- <el-select
- size="small"
- v-model="form.polId"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 80%"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in podList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="目的港" prop="podId">
- <el-select
- size="small"
- v-model="form.podId"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 80%"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in podList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="有效期" prop="fValiddate">
- <el-date-picker
- v-model="form.fValiddate"
- type="date"
- placeholder="选择有效期"
- size="small"
- style="width: 80%"
- :clearable="false"
- value-format="timestamp"
- :disabled="formStatus"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人" prop="createBy">
- <el-input
- size="small"
- v-model="form.createBy"
- style="width: 80%"
- disabled
- laceholder="录入人"
- >
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="业务类型" prop="fBilltype">
- <el-select
- size="small"
- v-model="form.fBilltype"
- placeholder="请选择结算方式"
- clearable
- style="width: 80%"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in billTypeList"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="状态" prop="fBillstatus">
- <el-select
- size="small"
- clearable
- filterable
- placeholder="请选择"
- style="width: 80%"
- v-model="form.fBillstatus"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in statusList"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="航线" prop="fLineid">
- <el-select
- size="small"
- clearable
- filterable
- placeholder="请选择"
- style="width: 80%"
- v-model="form.fLineid"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in fLineList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="订舱代理" prop="fBookagentid">
- <el-select
- size="small"
- clearable
- filterable
- placeholder="请选择"
- style="width: 80%"
- v-model="form.fBookagentid"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in fBookagentList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="备注" prop="remarks">
- <el-input
- style="width: 94.5%"
- v-model="form.remarks"
- type="textarea"
- placeholder="请输入内容"
- :disabled="formStatus"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
- <el-tab-pane label="海运费" name="1">
- <div>
- <div
- style="
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- "
- >
- <div>
- <el-button
- type="primary"
- size="mini"
- @click="addDetailRow"
- :disabled="formStatus"
- >新增</el-button
- >
- <el-button
- type="success"
- size="mini"
- @click="saveForm"
- :disabled="formStatus"
- >保存</el-button
- >
- <el-button type="warning" size="mini" :disabled="formStatus"
- >打印</el-button
- >
- <el-button
- type="danger"
- size="mini"
- @click="submitForm"
- :disabled="formStatus"
- >请核</el-button
- >
- <el-button
- size="mini"
- type="info"
- @click="fixForm"
- :disabled="!formStatus"
- >修改</el-button
- >
- </div>
- <div>
- <el-button
- icon="el-icon-setting"
- size="mini"
- circle
- @click="showSetting = !showSetting"
- ></el-button>
- </div>
- </div>
- <el-table
- :data="detailList"
- tooltip-effect="dark"
- stripe
- @selection-change="Selectinventory"
- >
- <el-table-column type="selection" width="55" align="center" fixed />
- <el-table-column label="序号" type="index" width="50" fixed />
- <el-table-column
- v-for="(item, index) in getRowList"
- :key="index"
- :label="item.name"
- :width="item.width"
- :prop="item.label"
- align="center"
- :fixed="item.fixed"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="item.label == 'fFeeid'">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- placeholder="请选择"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in listFeesList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </span>
- <span v-else-if="item.label == 'fSpecification1'">
- <el-input
- v-model="scope.row.fSpecification1"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fSpecification2'">
- <el-input
- v-model="scope.row.fSpecification2"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fSpecification3'">
- <el-input
- v-model="scope.row.fSpecification3"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fSpecification4'">
- <el-input
- v-model="scope.row.fSpecification4"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fSpecification5'">
- <el-input
- v-model="scope.row.fSpecification5"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fSpecification6'">
- <el-input
- v-model="scope.row.fSpecification6"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'fExrate'">
- <el-input
- v-model="scope.row.fExrate"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </span>
- <span v-else-if="item.label == 'createTime'">
- {{ scope.row.createTime | fBsdateFormat }}
- </span>
- <span v-else-if="item.label == 'updateTime'">
- {{ scope.row.updateTime | fBsdateFormat }}
- </span>
- <span v-else-if="item.label == 'remark'">
- <el-input
- v-model="scope.row.remark"
- placeholder="备注"
- show-word-limit
- :disabled="formStatus"
- />
- </span>
- <span v-else>{{ scope.row[item.label] }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="操作"
- width="130px"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- @click.native.prevent="
- DeldetailRow(scope.row, scope.$index, detailList, 0)
- "
- size="small"
- :disabled="formStatus"
- >移除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-dialog
- title="自定义列显示"
- :visible.sync="showSetting"
- width="700px"
- v-dialogDrag
- :close-on-click-modal="false"
- >
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="
- display: inline-block;
- width: 3px;
- height: 20px;
- margin-right: 5px;
- float: left;
- margin-top: 2px;
- "
- ></span>
- </span>
- </div>
- </template>
- <div>配置排序列数据(拖动调整顺序)</div>
- <div style="margin-left: 17px">
- <el-checkbox
- v-model="allCheck"
- label="全选"
- @change="allChecked"
- ></el-checkbox>
- </div>
- <div style="padding: 4px; display: flex; justify-content: center">
- <draggable
- v-model="setRowList"
- group="site"
- animation="300"
- @start="onStart"
- @end="onEnd"
- handle=".indraggable"
- >
- <transition-group>
- <div
- v-for="item in setRowList"
- :key="item.surface"
- class="listStyle"
- >
- <div style="width: 500px" class="indraggable">
- <div class="progress" :style="{ width: item.width + 'px' }">
- <el-checkbox
- :label="item.name"
- v-model="item.checked"
- :true-label="0"
- :false-label="1"
- >{{ item.name }}
- </el-checkbox>
- </div>
- </div>
- <el-input-number
- v-model.number="item.width"
- controls-position="right"
- :min="1"
- :max="500"
- size="small"
- ></el-input-number>
- </div>
- </transition-group>
- </draggable>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="showSetting = false">取 消</el-button>
- <el-button @click="delRow" type="danger">重 置</el-button>
- <el-button type="primary" @click="save()">确 定</el-button>
- </span>
- </el-dialog>
- </el-tab-pane>
- <el-tab-pane label="杂项费" name="2">
- <div>
- <div style="display: flex; margin-bottom: 10px">
- <div>
- <el-button
- type="primary"
- size="mini"
- @click="addDetailRow2"
- :disabled="formStatus"
- >新增</el-button
- >
- <el-button
- type="success"
- size="mini"
- @click="saveForm"
- :disabled="formStatus"
- >保存</el-button
- >
- <el-button type="warning" size="mini" :disabled="formStatus"
- >打印</el-button
- >
- <el-button
- type="danger"
- size="mini"
- @click="submitForm"
- :disabled="formStatus"
- >请核</el-button
- >
- <el-button
- size="mini"
- type="info"
- @click="fixForm"
- :disabled="!formStatus"
- >修改</el-button
- >
- </div>
- </div>
- <el-table
- :data="detailList2"
- tooltip-effect="dark"
- stripe
- @selection-change="Selectinventory"
- >
- <el-table-column type="selection" width="55" align="center" fixed />
- <el-table-column label="序号" type="index" width="50" fixed />
- <el-table-column label="费用" prop="fFeeid" align="center" sortable>
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- placeholder="请选择"
- :disabled="formStatus"
- >
- <el-option
- v-for="(item, index) in listFeesList"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- label="单价"
- prop="fUnitprice"
- align="center"
- sortable
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fUnitprice"
- placeholder="请输入"
- v-input-limit="2"
- :disabled="formStatus"
- />
- </template>
- </el-table-column>
- <el-table-column label="备注" prop="remark" align="center" sortable>
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remark"
- placeholder="请输入"
- :disabled="formStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="录入人"
- prop="createBy"
- align="center"
- sortable
- />
- <el-table-column
- label="录入时间"
- prop="createTime"
- align="center"
- sortable
- >
- <template slot-scope="scope">
- {{ scope.row.createTime | fBsdateFormat }}
- </template>
- </el-table-column>
- <el-table-column
- label="最新修改人"
- prop="updateBy"
- align="center"
- sortable
- />
- <el-table-column
- label="最新修改时间"
- prop="updateTime"
- align="center"
- sortable
- >
- <template slot-scope="scope">
- {{ scope.row.updateTime | fBsdateFormat }}
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="操作"
- width="130px"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- @click.native.prevent="
- DeldetailRow(scope.row, scope.$index, detailList2, 1)
- "
- size="small"
- :disabled="formStatus"
- >移除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
- </el-tabs>
- <br />
- <div
- style="display: flex; justify-content: flex-end; margin-top: 10px"
- ></div>
- </div>
- </template>
- <script>
- import {
- checkCode,
- saveSeaprice,
- addSeaprice,
- getForm,
- listCorpsList,
- shippingCompany, listRoute
- } from "@/api/warehouseBusiness/shipping";
- import { listCorps } from "@/api/basicdata/corps";
- import { listFees } from "@/api/basicdata/fees";
- import { queryUserVal } from "@/api/system/user";
- import ApprovalComments from "@/views/startApproval";
- import AddOrUpdate from "@/views/viewApproval";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import Cookies from "js-cookie";
- import { addSet, select, resetModule } from "@/api/system/set";
- import draggable from "vuedraggable";
- export default {
- name: "inStock",
- props: {
- chiId: {
- type: Number,
- required: null,
- },
- copyStatus: {
- type: Number,
- required: null,
- },
- },
- components: {
- Treeselect,
- AddOrUpdate,
- ApprovalComments,
- draggable,
- },
- data() {
- return {
- pageNum: 1,
- pageSize: 10,
- fMblnoOptions: [],
- form: {},
- rules: {
- fBilltype: [{ required: true, message: " ", trigger: "blur" }],
- fCorpid: [{ required: true, message: " ", trigger: "blur" }],
- fBillstatus: [{ required: true, message: " ", trigger: "blur" }],
- polId: [{ required: true, message: " ", trigger: "blur" }],
- podId: [{ required: true, message: " ", trigger: "blur" }],
- // fValiddate: [{ required: true, message: " ", trigger: "blur" }],
- },
- drag: false,
- tableDate: [
- {
- surface: "1",
- label: "fFeeid",
- name: "费用",
- checked: 0,
- width: 120,
- },
- {
- surface: "2",
- label: "fSpecification1",
- name: "20GP",
- checked: 0,
- width: 120,
- },
- {
- surface: "3",
- label: "fSpecification2",
- name: "40GP",
- checked: 0,
- width: 100,
- },
- {
- surface: "4",
- label: "fSpecification3",
- name: "40HC",
- checked: 0,
- width: 100,
- },
- {
- surface: "5",
- label: "fSpecification4",
- name: "45HC",
- checked: 0,
- width: 100,
- },
- {
- surface: "6",
- label: "fSpecification5",
- name: "20RH",
- checked: 0,
- width: 100,
- },
- {
- surface: "7",
- label: "fSpecification6",
- name: "40RH",
- checked: 0,
- width: 100,
- },
- {
- surface: "8",
- label: "fExrate",
- name: "汇率",
- checked: 0,
- width: 120,
- },
- {
- surface: "10",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 120,
- },
- {
- surface: "11",
- label: "createBy",
- name: "录入人",
- checked: 0,
- width: 120,
- },
- {
- surface: "12",
- label: "createTime",
- name: "录入时间",
- checked: 0,
- width: 120,
- },
- {
- surface: "13",
- label: "updateBy",
- name: "最新修改人",
- checked: 0,
- width: 150,
- },
- {
- surface: "14",
- label: "updateTime",
- name: "最新修改时间",
- checked: 0,
- width: 150,
- },
- ],
- setRowList: [],
- getRowList: [],
- allCheck: false,
- showSetting: false,
- activeName: "1",
- detailList: [],
- detailList2: [],
- billTypeList: [],
- statusList: [],
- polList: [],
- podList: [],
- listFeesList: [],
- formStatus: false,
- deleteItem0: [],
- deleteItem1: [],
- fLineList: [],
- fBookagentList: [],
- };
- },
- created() {
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- listCorps({ type: 1 }).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- listFees().then((response) => {
- this.listFeesList = response.rows;
- });
- this.getDicts("data_billType").then((response) => {
- this.billTypeList = response.data;
- });
- listCorpsList().then( response =>{
- this.fLineList = response.rows
- })
- shippingCompany().then( response =>{
- this.fBookagentList = response.rows
- })
- this.getDicts("data_status").then((response) => {
- this.statusList = response.data;
- });
- // this.getDicts("port_start").then((response) => {
- // this.polList = response.data;
- // });
- // this.getDicts("port_end").then((response) => {
- // this.podList = response.data;
- // });
- listRoute({}).then(response => {
- response.rows.forEach(item=>item.fId = JSON.stringify(item.fId))
- this.podList = response.rows
- });
- this.form.fValiddate = new Date()
- this.queryUser();
- this.getRow();
- },
- filters: {
- fBsdateFormat(row) {
- if (row) {
- const dateMat = new Date(row);
- const year = dateMat.getFullYear();
- const month = dateMat.getMonth() + 1;
- const day = dateMat.getDate();
- const timeFormat = year + "-" + month + "-" + day;
- return timeFormat;
- }
- },
- },
- methods: {
- init() {
- this.resetForm("form");
- if(!this.copyStatus){
- this.formStatus = true;
- }
- this.getForm();
- },
- //列设置全选
- allChecked() {
- if (this.allCheck == true) {
- this.setRowList.map((e) => {
- return (e.checked = 0);
- });
- } else {
- this.setRowList.map((e) => {
- return (e.checked = 1);
- });
- }
- },
- //查询列数据
- getRow() {
- let that = this;
- this.data = {
- tableName: "运费规则",
- userId: Cookies.get("userName"),
- };
- select(this.data).then((res) => {
- if (res.data.length != 0) {
- this.getRowList = res.data.filter((e) => e.checked == 0);
- this.setRowList = res.data;
- this.setRowList = this.setRowList.reduce((res, item) => {
- res.push({
- surface: item.surface,
- label: item.label,
- name: item.name,
- checked: item.checked,
- width: item.width,
- fixed: item.fixed,
- });
- return res;
- }, []);
- }
- });
- },
- //重置列表
- delRow() {
- this.data = {
- tableName: "运费规则",
- userId: Cookies.get("userName"),
- };
- resetModule(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.setRowList = this.$options.data().tableDate;
- this.getRowList = this.$options.data().tableDate;
- }
- });
- },
- //保存列设置
- save() {
- this.showSetting = false;
- this.data = {
- tableName: "运费规则",
- userId: Cookies.get("userName"),
- sysTableSetList: this.setRowList,
- };
- addSet(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
- }
- });
- },
- //开始拖拽事件
- onStart() {
- this.drag = true;
- },
- //拖拽结束事件
- onEnd() {
- this.drag = false;
- },
- handleClick(tab, event) {
- console.log(tab, event);
- },
- Selectinventory() {},
- addDetailRow() {
- this.detailList.push({
- fFeeid: null,
- fSpecification1: null,
- fSpecification2: null,
- fSpecification3: null,
- fSpecification4: null,
- fSpecification5: null,
- fSpecification6: null,
- fExrate: null,
- remark:'箱量',
- createBy: this.userVal.userName,
- createTime: Date.parse(new Date()),
- updateBy: this.userVal.userName,
- updateTime: Date.parse(new Date()),
- });
- },
- addDetailRow2() {
- this.detailList2.push({
- fFeeid: null,
- fUnitprice: null,
- remark:'票',
- createBy: this.userVal.userName,
- createTime: Date.parse(new Date()),
- updateBy: this.userVal.userName,
- updateTime: Date.parse(new Date()),
- });
- },
- DeldetailRow(row, index, rows, status) {
- if (status == 0 && row.fId) {
- this.deleteItem0.push(row.fId);
- this.form.deleteItem0 = this.deleteItem0;
- console.log(this.form.deleteItem0);
- }
- if (status == 1 && row.fId) {
- this.deleteItem1.push(row.fId);
- this.form.deleteItem1 = this.deleteItem1;
- console.log(this.form.deleteItem1);
- }
- rows.splice(index, 1);
- },
- TFformdata(data) {
- data.fBilltype = data.fBilltype ? data.fBilltype.toString() : null;
- data.fBillstatus = JSON.stringify(data.fBillstatus).length > 0?JSON.stringify(data.fBillstatus):null
- data.polId = data.polId ? data.polId.toString() : null;
- data.podId = data.podId ? data.podId.toString() : null;
- data.fLineid = data.fLineid ? Number(data.fLineid):null
- data.fBookagentid = data.fBookagentid ? Number(data.fBookagentid):null
- data.fValiddate = data.fValiddate ? Date.parse(data.fValiddate) : null;
- this.form = data;
- },
- getForm() {
- getForm(this.chiId).then((response) => {
- this.TFformdata(response.data.seaprice);
- this.detailList = response.data.seapriceItem;
- this.detailList2 = response.data.seapriceFees;
- if (this.copyStatus) {
- this.form.fId = null;
- this.form.fDateChanged = null;
- this.detailList.map((e) => {
- e.fId = null;
- e.fPid = null;
- });
- this.detailList2.map((e) => {
- e.fId = null;
- e.fPid = null;
- });
- // this.$set(this.form, "fId", null);
- // this.detailList;
- // this.$set(this.detailList, index);
- }
- });
- },
- fixForm() {
- let checkData = {
- fId: this.form.fId,
- fType: "freight",
- codeVal: this.form.fDateChanged,
- };
- checkCode(checkData).then((response) => {
- if (!response) {
- this.$confirm("数据发生变化,请更新一下数据?", "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.getForm();
- });
- } else {
- this.formStatus = false;
- }
- });
- },
- saveForm(type) {
- let checkData = {
- fId: this.form.fId,
- fType: "freight",
- codeVal: this.form.fDateChanged,
- };
- checkCode(checkData).then((response) => {
- if (!response) {
- this.$confirm("数据发生变化,请更新一下数据?", "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.getForm();
- });
- } else {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- let formData = new window.FormData();
- formData.append("seaprice", JSON.stringify(this.form));
- // 库存明细1
- formData.append("seapriceItem", JSON.stringify(this.detailList));
- // 库存明细2
- formData.append(
- "seapriceFlees",
- JSON.stringify(this.detailList2)
- );
- saveSeaprice(formData).then((response) => {
- if (response.code == 200) {
- this.TFformdata(response.data.seaprice);
- this.detailList=response.data.itemList?response.data.itemList:[]
- this.detailList2=response.data.itemList2?response.data.itemList2:[]
- this.msgSuccess("保存成功");
- if (!type){
- this.cancel();
- }
- }
- });
- }
- });
- }
- });
- },
- submitForm() {
- let checkData = {
- fId: this.form.fId,
- fType: "freight",
- codeVal: this.form.fDateChanged,
- };
- checkCode(checkData).then((response) => {
- if (!response) {
- this.$confirm("数据发生变化,请更新一下数据?", "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.getForm();
- });
- } else {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (!this.detailList.length) {
- return this.$message.error("海运费不能为空");
- }
- for (let item in this.detailList) {
- if (!this.detailList[item].fFeeid) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行费用不能为空"
- );
- }
- if (this.detailList[item].fSpecification1.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行20GP不能为空"
- );
- }
- if (this.detailList[item].fSpecification2.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行40GP不能为空"
- );
- }
- if (this.detailList[item].fSpecification3.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行40HC不能为空"
- );
- }
- if (this.detailList[item].fSpecification4.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行45HC不能为空"
- );
- }
- if (this.detailList[item].fSpecification5.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行20RH不能为空"
- );
- }
- if (this.detailList[item].fSpecification6.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行40RH不能为空"
- );
- }
- if (this.detailList[item].fExrate.length < 1) {
- return this.$message.error(
- "海运费第" + (Number(item) + 1) + "行汇率不能为空"
- );
- }
- }
- if (!this.detailList2.length) {
- this.$message.error("杂项费不能为空");
- }
- for (let item in this.detailList2) {
- if (!this.detailList2[item].fFeeid) {
- return this.$message.error(
- "杂项费第" + (Number(item) + 1) + "行费用不能为空"
- );
- }
- if (!this.detailList2[item].fUnitprice) {
- return this.$message.error(
- "杂项费第" + (Number(item) + 1) + "行单价不能为空"
- );
- }
- }
- let formData = new window.FormData();
- formData.append("seaprice", JSON.stringify(this.form));
- formData.append("seapriceItem", JSON.stringify(this.detailList));
- formData.append(
- "seapriceFlees",
- JSON.stringify(this.detailList2)
- );
- addSeaprice(formData).then((response) => {
- if (response.code == 200) {
- this.msgSuccess("请核成功");
- this.cancel();
- }
- });
- }
- });
- }
- });
- },
- //获取登陆人
- queryUser() {
- queryUserVal().then((response) => {
- if (response.user !== null) {
- this.userVal = response.user;
- this.$set(this.form, "fDeptid", this.userVal.deptId);
- this.$set(this.form, "createBy", this.userVal.userName);
- this.$set(this.form, "fStorekeeper", this.userVal.nickName);
- this.$set(this.form, "fIfdamage", "1");
- this.$set(this.form, "fIfweigh", "1");
- this.$set(this.form, "fTrademodeid", "1");
- this.$set(this.form, "createTime", Date.parse(new Date()));
- this.$set(this.form, "fBstime", Date.parse(new Date()));
- }
- if (response.dept !== null) {
- this.deptOptions = [];
- this.deptOptions.push(response.dept);
- }
- });
- },
- cancel() {
- if (this.$route.query.id) {
- this.$router.push({ query: {} });
- }
- this.resetForm("form");
- this.$emit("changeShow", "true");
- },
- goBack() {
- this.$confirm("是否确定返回列表?", "提示", {
- cancelButtonText: "取消",
- confirmButtonText: "保存",
- type: "warning",
- }).then(() => {
- this.saveForm(false);
- }).catch(() => {
- this.cancel();
- });
- },
- },
- watch: {
- // 监听 addOrUpdateVisible 改变
- addOrUpdateVisible(oldVal, newVal) {
- this.showDialog = this.addOrUpdateVisible;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .tag-hover:hover {
- background-color: #d9ebfb;
- }
- .tag-hover {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- height: 15px;
- padding: 0px 1px;
- line-height: 12px;
- }
- .print-div {
- color: #000;
- }
- .print_table {
- table {
- border-right: 1px solid #000;
- border-bottom: 1px solid #000;
- font-size: 12px;
- margin-bottom: 5px;
- }
- table td {
- border-left: 1px solid #000;
- border-top: 1px solid #000;
- vertical-align: middle;
- padding: 2px;
- text-align: center;
- }
- }
- .print_form {
- font-size: 12px;
- }
- </style>
|