12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220 |
- <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%"
- 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;
- console.log(this.billTypeList)
- });
- listCorpsList().then( response =>{
- this.fLineList = response.rows
- })
- shippingCompany().then( response =>{
- this.fBookagentList = response.rows
- })
- this.getDicts("data_status").then((response) => {
- console.log(response.data)
- 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.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,
- 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,
- remarks: null,
- 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() {
- 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("保存成功");
- }
- });
- }
- });
- }
- });
- },
- 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("是否确定返回列表?", "提示", {
- confirmButtonText: "确认返回",
- cancelButtonText: "立即保存",
- type: "warning",
- })
- .then(() => {
- this.cancel();
- })
- .catch(() => {
- this.saveForm();
- });
- },
- },
- 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>
|