| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160 |
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button size="small" type="" style="margin-right: 8px"
- :loading="saveLoading" >预 览
- </el-button>
- <el-button size="small" type="warning" style="margin-right: 8px"
- :loading="saveLoading" >打 印
- </el-button>
- <el-button size="small" type="primary" style="margin-right: 8px" v-if="detailData.seeDisabled"
- :loading="saveLoading" @click="editHandle">编 辑
- </el-button>
- <el-button size="small" type="primary" style="margin-right: 8px" v-else
- :loading="saveLoading" @click="editCustomer">保 存
- </el-button>
- </div>
- </div>
- <div style="margin-top: 65px">
- <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
- <el-tab-pane label="委托信息" name="wt">
- <div>
- <div>
- <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
- <containerTitle title="基础资料"></containerTitle>
- <basic-container :showBtn="true">
- <el-row :gutter="60">
- <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
- <!--数组-->
- <div v-if="item instanceof Array" style="display: flex;align-items: center;justify-content: space-between">
- <el-row>
- <el-col :span="item[0].span?item[0].span:12">
- <el-form-item :label="item[0].label" :prop="item[0].prop" :rules="item[0].rules"
- :label-width="item[0].labelWidth">
- <span slot="label" v-if="item[0].label">
- <span style="color: #1e9fff">{{item[0].label}}</span>
- </span>
- <!--<div v-if="item[0].type == 'button'" style="width: 100%;background: #1eff11" class="buttomBlNO">-->
- <!--</div>-->
- <el-button v-if="item[0].type == 'button'" :disabled="item[0].disabled"
- size="small" type="success" icon="el-icon-edit" circle
- @click="applyforfun(item[0].label)" >
- </el-button>
- <search-query v-else-if="item[0].type == 'select'"
- :datalist="item[0].dicData"
- :selectValue="form[item[0].prop]"
- :filterable="true"
- :clearable="true"
- :remote="true"
- :disabled="detailData.seeDisabled || item[0].disabled"
- :buttonIf="false"
- :forParameter="item[0].forParameter"
- @remoteMethod="remoteMethod($event,item[0].prop)"
- @corpChange="corpChange($event,item[0].prop)"
- @corpFocus="remoteMethod($event,item[0].prop)" >
- </search-query>
- <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]"
- size="small" autocomplete="off"
- :disabled="detailData.seeDisabled || item[0].disabled"
- clearable :placeholder="'请输入' + item[0].label" ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="item[1].span?item[1].span:12">
- <el-form-item :label="item[1].label" :prop="item[1].prop" :rules="item[1].rules"
- :label-width="item[1].labelWidth">
- <span slot="label" v-if="item[1].label">
- <span style="color: #1e9fff">{{item[1].label}}</span>
- </span>
- <el-date-picker v-if="item[1].type == 'date'"
- v-model="form[item[1].prop]" clearable style="width: 100%;"
- type="date" size="small" :disabled="detailData.seeDisabled || item[1].disabled"
- value-format="yyyy-MM-dd HH:mm"
- placeholder="选择日期">
- </el-date-picker>
- <search-query v-else-if="item[1].type == 'select'"
- :datalist="item[1].dicData"
- :selectValue="form[item[1].prop]"
- :filterable="true"
- :clearable="true"
- :remote="true"
- :disabled="detailData.seeDisabled || item[1].disabled"
- :buttonIf="false"
- :forParameter="item[1].forParameter"
- @remoteMethod="remoteMethod($event,item[1].prop)"
- @corpChange="corpChange($event,item[1].prop)"
- @corpFocus="remoteMethod($event,item[1].prop)" >
- </search-query>
- <tree-select v-else-if="item[1].type == 'tree'"
- v-model="form[item[1].prop]" filterable
- :data="item[1].dicData"
- :props="item[1].forParameter"
- nodeKey="title"
- size="small"
- :disabled="detailData.seeDisabled || item[1].disabled"
- :multiple="false"
- @input="corpChange($event,item[1].prop)">
- </tree-select>
- <el-input v-else type="age" style="width: 100%;" v-model="form[item[1].prop]"
- size="small" autocomplete="off"
- :disabled="detailData.seeDisabled || item[1].disabled"
- clearable :placeholder="'请输入' + item[1].label" ></el-input>
- </el-form-item>
- </el-col>
- <el-col v-if="item[2]" :span="item[2].span?item[2].span:12">
- <el-form-item :label="item[2].label" :prop="item[2].prop" :rules="item[2].rules"
- :label-width="item[2].labelWidth">
- <span slot="label" v-if="item[2].label">
- <span style="color: #1e9fff">{{item[2].label}}</span>
- </span>
- <search-query v-if="item[2].type == 'select'"
- :datalist="item[2].dicData"
- :selectValue="form[item[2].prop]"
- :filterable="true"
- :clearable="true"
- :remote="true"
- :disabled="detailData.seeDisabled || item[2].disabled"
- :buttonIf="false"
- :forParameter="item[1].forParameter"
- @remoteMethod="remoteMethod($event,item[2].prop)"
- @corpChange="corpChange($event,item[2].prop)"
- @corpFocus="remoteMethod($event,item[2].prop)" >
- </search-query>
- <el-input v-else type="age" style="width: 100%;" v-model="form[item[2].prop]"
- size="small" autocomplete="off"
- :disabled="detailData.seeDisabled || item[1].disabled"
- clearable :placeholder="'请输入' + item[2].label" ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- <!--对象-->
- <div v-else>
- <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
- <span slot="label" v-if="item.label">
- <span style="color: #1e9fff">{{item.label}}</span>
- </span>
- <search-query v-if="item.type == 'select'"
- :datalist="item.dicData"
- :selectValue="form[item.prop]"
- :filterable="true"
- :clearable="true"
- :remote="true"
- :disabled="detailData.seeDisabled || item.disabled"
- :buttonIf="item.buttonIf"
- :forParameter="item.forParameter"
- @remoteMethod="remoteMethod($event,item.prop)"
- @corpChange="corpChange($event,item.prop)"
- @corpFocus="remoteMethod($event,item.prop)">
- <bcorps v-if="item.slot == 'bcorps'"></bcorps>
- <bcorpstypedefine v-if="item.slot == 'bcorpstypedefine'"></bcorpstypedefine>
- </search-query>
- <el-input v-else type="age" style="width: 100%;" v-model="form[item.prop]"
- size="small" autocomplete="off"
- :disabled="detailData.seeDisabled || item.disabled"
- clearable :placeholder="'请输入' + item.label" ></el-input>
- </el-form-item>
- </div>
- </el-col>
- </el-row>
- </basic-container>
- </el-form>
- </div>
- <div class="customer-main margintop">
- <containerTitle title="详细"></containerTitle>
- <basic-container :showBtn="true">
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
- <el-tab-pane label="委托详情" name="first">
- <entrustment-lnformation :assemblyForm="form" :detailData="detailData" @billsDetailfun="billsDetailfun(form.id)"></entrustment-lnformation>
- </el-tab-pane>
- <el-tab-pane label="配箱处理" name="second">
- <DistributionBox :assemblyForm="form" :detailData="detailData" @billsDetailfun="billsDetailfun(form.id)"></DistributionBox>
- </el-tab-pane>
- <el-tab-pane label="MB/L信息" name="third">
- <mbinformation :assemblyForm="form" :detailData="detailData"></mbinformation>
- </el-tab-pane>
- <el-tab-pane label="单证中心" name="fourth">
- <reports :id="form.id"></reports>
- </el-tab-pane>
- <el-tab-pane label="EDI CODE" name="sixth">
- <edicode :assemblyForm="form" :detailData="detailData"></edicode>
- </el-tab-pane>
- <el-tab-pane label="文件中心" name="seventh">
- <filescenter :assemblyForm="form" :detailData="detailData"></filescenter>
- </el-tab-pane>
- </el-tabs>
- </basic-container>
- <basic-container :showBtn="true" v-if="activeName == 'first' || activeName == 'third'">
- <formbottom :assemblyForm="form" :detailData="detailData"></formbottom>
- </basic-container>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="费用信息" name="fy">
- <feecenter :assemblyForm="form" :detailData="detailData" :pid="form.id" @billsDetailfun="billsDetailfun(form.id)"></feecenter>
- </el-tab-pane>
- <el-tab-pane label="分单列表" name="fd">
- <Split-list :detailData="detailData" :assemblyForm="form"
- :data="billsListAllData"
- @billsListAllfun="billsListAllfun(this.form.id)"></Split-list>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </template>
- <script>
- import EntrustmentLnformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue";
- import mbinformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/mbinformation.vue";
- import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
- import formbottom from "@/views/iosBasicData/SeafreightExportF/bills/assembly/formbottom.vue";
- import edicode from '@/views/iosBasicData/SeafreightExportF/bills/assembly/edicode.vue'
- import filescenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/filescenter.vue";
- import DistributionBox from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox.vue";
- import feecenter from '@/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue'
- import {getList as userGetList} from '@/api/system/user'
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
- import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
- import bcorps from "@/views/iosBasicData/bcorps/index.vue";
- import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
- import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
- import {getLazylist} from "@/api/basicData/agreement";
- import {getBcorpsList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
- import {getBlocationsList} from "@/api/iosBasicData/blocations";
- import {getBcorpsattnList} from "@/api/iosBasicData/bcorpsattn";
- import {getWorkDicts} from "@/api/system/dictbiz";
- import {getDeptLazyTree, getDeptTree, getLazyList} from "@/api/system/dept";
- import {billsDetail, billsGetBillNo, billsListAll, billsSubmit,deptGetDetailPol} from '@/api/iosBasicData/bills'
- import {dateFormat} from "@/util/date";
- export default {
- components:{
- SearchQuery,
- EntrustmentLnformation,
- formbottom,
- mbinformation,
- reports,
- edicode,
- filescenter,
- DistributionBox,
- feecenter,
- bcorps,
- bcorpstypedefine,
- SplitList,
- TreeSelect
- },
- props:{
- detailData: {
- type: Object
- }
- },
- data() {
- return {
- // 分单列表数据
- billsListAllData:[],
- pageLoading:false,
- saveLoading:false,
- // 详情数据
- form:{
- billDate:dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
- operatorName:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
- operatorId:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
- businessType:'SE', // 业务类型 默认 海运出口
- billType:'DD', // 单据类型 默认 直单
- accDeptName:'',// 核算部门 默认登录人的部门
- issueType:'正本', // 签单方式 默认 正本
- mpaymode:'PP', // 主单付费方式 默认PP
- hpaymode:'PP', // 分单付费方式 默认 PP
- loadType:'FCL', // 装箱方式默认整箱
- // srcType:'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
- numberOfObl:'THREE', // 正本份数 默认 THREE
- numberOfCopy:'ONE', // 副本份数 默认 ONE
- seaType:'E', // 进出口 默认出口 E=出口 I=进口"
- cargoType:'dry', // 货物类型默认普货
- filesList:[], // 文件中心
- },
- basicData:{
- column:[
- {
- label: "客户名称", // 调往来单位接口
- prop: "corpCnName",
- type:'select',
- dicData:[],
- disabled:false,
- buttonIf:true,
- slot:'bcorps',
- forParameter:{
- key:'id',
- label:'cnName',
- value:'cnName',
- },
- rules: [{
- required: true,
- message: "请输入客户名称",
- trigger: "blur"
- }]
- },
- [
- {
- label: "客户OP", // 客户联系人姓名 电话和邮箱带出来,可以修改 往来单位接口 需要传一个客户名称的值过去
- prop: "corpAttnName",
- type:'select',
- dicData:[],
- span:10,
- disabled:true,
- forParameter:{
- key:'id',
- label:'cname',
- value:'cname',
- },
- },
- {
- label: "", //客户联系人电话
- prop: "corpAttnTel",
- labelWidth:'10px',
- disabled:true,
- span:7,
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }]
- },
- {
- label: "", // 客户联系人邮箱
- prop: "corpAttnEmail",
- labelWidth:'10px',
- disabled:true,
- span:7,
- rules: [{
- required: true,
- message: "请输入客户联系人邮箱",
- trigger: "blur"
- }]
- },
- ],
- [
- {
- label: "业务来源", // OWN=公司 AGENT=代理 SALES=业务员
- prop: "srcType",
- type:'select',
- disabled:true,
- dicData:[
- {
- label:'公司',
- value:'OWN'
- },
- {
- label:'代理',
- value:'AGENT'
- },
- {
- label:'业务员',
- value:'SALES'
- }
- ],
- },
- {
- label: "",
- prop: "srcCnName", // 来源中文 公司不是下拉写死公司两字 业务员调用户管理列表 代理调往来单位四个代理数据
- labelWidth:'10px',
- type:'select',
- disabled:true,
- dicData:[],
- forParameter:{
- key:'id',
- label:'cnName',
- value:'cnName',
- },
- },
- ],
- [
- {
- label: "MB/L NO",
- prop: "mblno",
- span:19,
- disabled:false,
- },
- {
- label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
- prop: "mpaymode",
- type:'select',
- labelWidth:'10px',
- disabled:false,
- span:5,
- dicData:[
- {
- label:'预付',
- value:'PP'
- },
- {
- label:'到付',
- value:'CC'
- }
- ],
- },
- ],
- [
- {
- label: "申请B/L NO", //弹窗点击确认还是取消申请 调后台接口获取到一个编号
- prop: "申请B/L NO",
- type:'button',
- span:7,
- disabled:false,
- },
- {
- label: "",
- prop: "hblno",
- labelWidth:'10px',
- span:12,
- disabled:true,
- },
- {
- label: "", // HB/L 付款方式 PP=预付, CC=到付, FPA, Other', 申请之后默认 PP
- prop: "hpaymode",
- labelWidth:'10px',
- disabled:false,
- type:'select',
- span:5,
- dicData:[
- {
- label:'预付',
- value:'PP'
- },
- {
- label:'到付',
- value:'CC'
- }
- ],
- },
- ],
- {
- label: "booking NO", // 订舱号
- prop: "bookingNo",
- disabled:false,
- },
- {
- label: "外提单号", // Co-Loader 中文名称 往来单位 类别
- prop: "refno",
- disabled:false,
- },
- [
- {
- label: "业务编号",
- prop: "billNo",
- disabled:true,
- },
- {
- label: "单据日期",
- prop: "billDate",
- type:'date',
- disabled:false,
- rules: [{
- required: true,
- message: "请输入单据日期",
- trigger: "blur"
- }]
- },
- ],
- [
- {
- label: "OP", // 操作id 用户管理下拉 模糊搜索
- prop: "operatorName",
- type:'select',
- dicData:[],
- disabled:false,
- forParameter:{
- key:'id',
- label:'name',
- value:'name',
- },
- rules: [{
- required: true,
- message: "请选择OP",
- trigger: "blur"
- }]
- },
- {
- label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
- prop: "accDeptName",
- type:'tree',
- dicData:[],
- disabled:false,
- forParameter:{
- label: "title",
- children:'children'
- },
- rules: [{
- required: true,
- message: "请选择核算部门",
- trigger: "blur"
- }]
- },
- // {
- // label: "业务类型", // SE=海运出口 SI=海运进口"
- // prop: "businessType",
- // type:'select',
- // disabled:false,
- // dicData:[
- // {
- // label:'海运出口',
- // value:'SE'
- // },
- // {
- // label:'海运进口',
- // value:'SI'
- // },
- // ],
- // rules: [{
- // required: true,
- // message: "请输入业务类型",
- // trigger: "blur"
- // }]
- // },
- ],
- // [
- // {
- // label: "单据类型", // DD=直单(默认) MM=主单 MH=分单 HH=从分单
- // prop: "billType",
- // type:'select',
- // disabled:false,
- // dicData:[
- // {
- // label:'直单',
- // value:'DD'
- // },
- // {
- // label:'主单',
- // value:'MM'
- // },
- // {
- // label:'分单',
- // value:'MH'
- // }
- // ],
- // rules: [{
- // required: true,
- // message: "请输入单据类型",
- // trigger: "blur"
- // }]
- // },
- // {
- // label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
- // prop: "accDeptName",
- // type:'tree',
- // dicData:[],
- // disabled:false,
- // forParameter:{
- // label: "title",
- // children:'children'
- // },
- // rules: [{
- // required: true,
- // message: "请选择核算部门",
- // trigger: "blur"
- // }]
- // },
- // ],
- // [
- // {
- // label: "签单方式",
- // prop: "issueType",
- // type:'select',
- // dicData:[],
- // disabled:false,
- // forParameter:{
- // key:'dictKey',
- // label:'dictValue',
- // value:'dictValue',
- // },
- // rules: [{
- // required: true,
- // message: "请输入签单方式",
- // trigger: "blur"
- // }]
- // },
- // {
- // label: "装箱方式", // FCL=整箱, LCL=拼箱",
- // prop: "loadType",
- // type:'select',
- // disabled:false,
- // dicData:[
- // {
- // label:'整箱',
- // value:'FCL'
- // },
- // {
- // label:'拼箱',
- // value:'LCL'
- // }
- // ],
- // rules: [{
- // required: true,
- // message: "请输入装箱方式",
- // trigger: "blur"
- // }]
- // },
- // ],
- // {
- // label: "付费地点", // MB/L 付款地点 地点管理表
- // prop: "mPayplace",
- // type:'select',
- // dicData:[],
- // disabled:false,
- // buttonIf:false,
- // forParameter:{
- // key:'id',
- // label:'cnName',
- // value:'cnName',
- // },
- // },
- // {
- // label: "COLOADER", // Co-Loader 中文名称 往来单位 类别
- // prop: "coloaderCnName",
- // type:'select',
- // dicData:[],
- // slot:'bcorpstypedefine',
- // buttonIf:true,
- // disabled:false,
- // forParameter:{
- // key:'id',
- // label:'cnName',
- // value:'cnName',
- // },
- // },
- ]
- },
- activeName:'first',
- bigtabs:'wt',
- saberUserInfo:{}, // 当前登录人信息
- }
- },
- watch:{
- 'form.billType':{
- // 执行方法
- handler(oldValue,newValue) {
- // 只要分单不能编辑
- if (oldValue == 'MH') {
- this.columnforfun('hblno').disabled = true
- }else {
- this.columnforfun('hblno').disabled = false
- }
- },
- deep: true, // 深度监听
- immediate: true // 第一次改变就执行
- }
- },
- created() {
- this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
- // 判断是否员id, 有id 就不显示
- if (!this.form.id) {
- this.deptGetDetailPolfun() // 收货地 装货港 当前登录人的默认
- this.userGetListfun(undefined,true) // 获取用户管理数据
- }
- this.ownDeptLazyTreefun() // 获取公司数据
- this.getLazylistfun() // 获取审核数据
- },
- methods:{
- // 收货地 装货港 当前登录人的默认
- deptGetDetailPolfun(){
- deptGetDetailPol(this.saberUserInfo.dept_id).then(res=>{
- // 收货地
- this.form.placeReceiptName = res.data.data.polEnName
- this.form.placeReceiptId = res.data.data.polId
- this.form.placeReceiptNamePrint = res.data.data.polEnName
- // 装货港
- this.form.polCnName = res.data.data.polCnName
- this.form.polEnName = res.data.data.polEnName
- this.form.polId = res.data.data.polId
- this.form.polNamePrint = res.data.data.polEnName
- // 签单地点 默认 装货港
- this.$set(this.form,'issueAt',this.form.polCnName)
- // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
- if (this.form.mpaymode == 'PP') {
- this.$set(this.form,'mPayplace',this.form.polCnName)
- }
- // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
- if (this.form.hpaymode == 'PP') {
- this.$set(this.form,'hpayplace',this.form.polCnName)
- }
- })
- },
- // 获取用户管理数据
- userGetListfun(account = undefined,type = false,){
- userGetList(1,10,{account}).then(res=>{
- this.columnforfun('operatorName').dicData = res.data.data.records
- if (type) {
- // 核算部门 默认登录人的部门
- for (let item of this.columnforfun('operatorName').dicData) {
- if (item.name == this.form.operatorName) {
- this.$set(this.form,'accDeptName',item.deptName)
- this.$set(this.form,'accDeptId',item.deptId)
- }
- }
- }
- })
- },
- // 获取核算部分数据 // 机构管理接口
- getLazylistfun(){
- getDeptTree().then(res=>{
- this.columnforfun('accDeptName').dicData = res.data.data
- })
- },
- // 获取客户名称数据 往来单位数据
- getBcorpsListfun(cnName){
- getBcorpsList(1,10,{cnName}).then(res=>{
- this.columnforfun('corpCnName').dicData = res.data.data.records
- })
- },
- // 获取客户联系人 客户OP
- getBcorpsattnListfun(cnName){
- getBcorpsattnList(1,10,{pid:this.form.corpId,cnName}).then(res=>{
- this.columnforfun('corpAttnName').dicData = res.data.data.records
- })
- },
- // 获取地点信息
- getBlocationsListfun(cnName){
- getBlocationsList(1,10,{cnName}).then(res=>{
- this.columnforfun('mPayplace').dicData = res.data.data.records
- })
- },
- // 获取业务来源代理数据
- agentBcorpsListfun(cnName){
- let corpType = '1712285382575398914,1712285645314990082,1712285842321448962,1712286433378574338'
- getBcorpslistByType(1,10,{cnName,corpType}).then(res=>{
- this.columnforfun('srcCnName').dicData = res.data.data.records
- })
- },
- // 获取业务来源业务员数据
- salesUserGetListfun(account){
- userGetList(1,10,{account}).then(res=>{
- this.columnforfun('srcCnName').dicData = res.data.data.records
- })
- },
- // 获取公司名称 用户管理左侧
- ownDeptLazyTreefun(){
- getDeptLazyTree(0).then(res=>{
- this.columnforfun('srcCnName').dicData = res.data.data
- // 来源 内容 默认登录人所属公司
- // for(let item of this.columnforfun('srcCnName').dicData) {
- // if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id) {
- // this.$set(this.form,'srcId',item.id)
- // this.$set(this.form,'srcCnName',item.title)
- // this.$set(this.form,'srcEnName',item.title)
- // }
- // }
- })
- },
- // 申请B/L NO
- billsGetBillNofun(){
- let billNoFormat = ''
- if (this.form.cargoType == 'dry') {
- billNoFormat = 'HYCK-PH'
- }else if (this.form.cargoType == 'danger') {
- billNoFormat = 'HYCK-WXP'
- }else if (this.form.cargoType == 'reefer') {
- billNoFormat = 'HYCK-DG'
- }else {}
- billsGetBillNo({
- businessTypeCode:'HYCK',
- billNoFormat:billNoFormat
- }).then(res=>{
- this.columnforfun('hpaymode').disabled = false
- this.$set(this.form,'hblno',res.data.data)
- })
- },
- /* 远程模糊查询操作用户 */
- remoteMethod(value,name) {
- if (name == 'operatorName') {
- this.userGetListfun(value)
- }else if (name == 'accDeptName') {
- this.getLazylistfun(value)
- }else if (name == 'corpCnName') {
- this.getBcorpsListfun(value)
- }else if (name == 'mPayplace') {
- this.getBlocationsListfun(value)
- }else if (name == 'corpAttnName') {
- this.getBcorpsattnListfun(value)
- }else if (name == 'srcCnName') {
- if (this.form.srcType == 'SALES') {
- // 业务员
- this.salesUserGetListfun(value)
- }else if (this.form.srcType == 'AGENT') {
- // 代理
- this.agentBcorpsListfun(value)
- }else if (this.form.srcType == 'OWN') {
- // 公司
- this.ownDeptLazyTreefun()
- }else {}
- }else {
- }
- },
- // 下拉的监听事件
- corpChange(value,name){
- if (name == 'operatorName') {
- // OP 下拉赋值 用户管理列表
- for(let item of this.columnforfun('operatorName').dicData) {
- if (item.name == value) {
- this.form.operatorName = item.name
- this.form.operatorId = item.id
- }
- }
- }
- else if (name == 'accDeptName') {
- // OP 下拉赋值 用户管理列表
- for(let item of this.columnforfun('accDeptName').dicData) {
- if (item.title == value) {
- this.form.accDeptName = item.title
- this.form.accDeptId = item.id
- }
- }
- }
- else if (name == 'corpCnName') {
- if (value) {
- this.columnforfun('corpAttnName').disabled = false
- this.columnforfun('corpAttnTel').disabled = false
- this.columnforfun('corpAttnEmail').disabled = false
- }else {
- this.columnforfun('corpAttnName').disabled = true
- this.columnforfun('corpAttnTel').disabled = true
- this.columnforfun('corpAttnEmail').disabled = true
- // 如果点击清空按钮把值赋值为空
- this.form.corpCnName = ''
- this.form.corpEnName = ''
- this.form.corpId = ''
- this.form.corpCode = ''
- }
- // 往来单位
- for(let item of this.columnforfun('corpCnName').dicData) {
- if (item.cnName == value) {
- this.form.corpCnName = item.cnName
- this.form.corpEnName = item.enName
- this.form.corpId = item.id
- this.form.corpCode = item.code
- // 获取 客户op数据
- this.getBcorpsattnListfun()
- // 业务来源参数带出
- this.$set(this.form,'srcType',item.sourceType)
- this.$set(this.form,'srcId',item.srcId)
- this.$set(this.form,'srcCnName',item.srcCnName)
- this.$set(this.form,'srcEnName',item.srcEnName)
- this.columnforfun('srcType').disabled = false
- this.columnforfun('srcCnName').disabled = false
- }
- }
- }
- else if (name == 'corpAttnName') {
- for(let item of this.columnforfun('corpAttnName').dicData) {
- if (item.cname == value) {
- this.form.corpAttnName = item.cname
- this.form.corpAttnId = item.id
- this.$set(this.form,'corpAttnTel',item.tel)
- this.$set(this.form,'corpAttnEmail',item.email)
- }
- }
- }
- else if (name == 'srcType') {
- if (!value) {
- this.$set(this.form,'srcType','')
- // this.columnforfun('srcCnName').disabled = true
- return
- }
- this.$set(this.form,'srcId','')
- this.$set(this.form,'srcCnName','')
- this.$set(this.form,'srcEnName','')
- this.form[name] = value
- if (value == 'OWN') {
- // 公司
- // this.columnforfun('srcCnName').type = ''
- this.columnforfun('srcCnName').forParameter = { key:'id', label:'title', value:'title'}
- this.ownDeptLazyTreefun()
- // for(let item of this.columnforfun('srcCnName').dicData) {
- // if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id) {
- // this.$set(this.form,'srcId',item.id)
- // this.$set(this.form,'srcCnName',item.title)
- // this.$set(this.form,'srcEnName',item.title)
- // }
- // }
- // this.columnforfun('srcCnName').disabled = true
- }else if (value == 'AGENT') {
- // 代理
- this.columnforfun('srcCnName').type = 'select'
- this.columnforfun('srcCnName').forParameter = { key:'id', label:'cnName', value:'cnName'}
- this.columnforfun('srcCnName').disabled = false
- this.agentBcorpsListfun()
- }else if (value == 'SALES') {
- // 业务员
- this.columnforfun('srcCnName').type = 'select'
- this.columnforfun('srcCnName').forParameter = { key:'id', label:'name', value:'name'}
- this.columnforfun('srcCnName').disabled = false
- this.salesUserGetListfun()
- }else {}
- }
- else if (name == 'srcCnName'){
- for(let item of this.columnforfun('srcCnName').dicData) {
- if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
- if (this.form.srcType == 'SALES') {
- // 业务员
- this.$set(this.form,'srcId',item.id)
- this.$set(this.form,'srcCnName',item.name)
- this.$set(this.form,'srcEnName',item.name)
- }else if (this.form.srcType == 'AGENT') {
- // 代理
- this.$set(this.form,'srcId',item.id)
- this.$set(this.form,'srcCnName',item.cnName)
- this.$set(this.form,'srcEnName',item.enName)
- }else {}
- }
- }
- }
- else if (name == 'coloaderCnName') {
- for(let item of this.columnforfun('coloaderCnName').dicData) {
- if (item.cnName == value) {
- this.$set(this.form,'coloaderId',item.id)
- this.$set(this.form,'coloaderCnName',item.cnName)
- this.$set(this.form,'coloaderEnName',item.enName)
- }
- }
- }
- else {
- this.form[name] = value
- }
- },
- // 申请B/L NO
- applyforfun(text){
- // 如果不是分单
- if (this.form.billType != 'MH') {
- this.$message({
- message: '只要分单需要申请',
- type: 'warning'
- });
- return
- }
- if (this.form.hblno) {
- this.$message({
- message: 'B/L NO 只能申请一次',
- type: 'warning'
- });
- return
- }
- if (!this.form.businessType) {
- this.$message({
- message: '请先选择业务类型',
- type: 'warning'
- });
- return
- }
- if (!this.form.corpCnName) {
- this.$message({
- message: '请先选择客户名称',
- type: 'warning'
- });
- return
- }
- this.$confirm(`确定${text}?`, {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(res=>{
- this.billsGetBillNofun()
- })
- },
- // 配置项
- columnforfun(value){
- for(let item of this.basicData.column) {
- if (item instanceof Array) {
- for(let ite of item) {
- if (value == ite.prop) {
- return ite
- }
- }
- }else {
- if (value == item.prop) {
- return item
- }
- }
- }
- },
- //返回列表
- backToList() {
- this.$emit('goBack')
- },
- // 编辑按钮
- editHandle(){
- this.detailData.seeDisabled = false
- },
- // 大保存按钮
- editCustomer(){
- this.$refs.form.validate((valid)=>{
- if (valid) {
- this.billsSubmitfun()
- }
- })
- },
- // 主表保存接口大保存
- billsSubmitfun(){
- this.form.billNoFormat = 'HYCK'
- this.form.businessTypeCode = 'HYCK'
- // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
- this.searchSplit()
- // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
- console.log(this.form,985)
- billsSubmit(this.form).then(res=>{
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.detailData.seeDisabled = true
- this.billsDetailfun(res.data.data.id)
- })
- },
- // 详情接口
- async billsDetailfun(id){
- const res = await billsDetail(id)
- this.form = res.data.data;
- this.pageLoading = false
- console.log(this.form,1000)
- this.searchMontage() // 下拉 中文名称和编号拼接
- // 配箱最上面可以编辑
- for(let item of this.form.containersList) {
- item.edit = false
- }
- // 配箱最下面的
- for(let item of this.form.waitingBoxList) {
- this.$set(item,'editQuantity',item.quantity)
- this.$set(item,'editGrossWeight',item.grossWeight)
- this.$set(item,'editMeasurement',item.measurement)
- this.$set(item,'edit',false)
- }
- // 应收
- for(let item of this.form.feeCenterListD) {
- if (item.curCode == 'CNY') {
- this.$set(item,'rmbAmount',item.amount)
- this.$set(item,'usdAmount','')
- }else {
- this.$set(item,'usdAmount',item.amount)
- this.$set(item,'rmbAmount','')
- }
- item.edit = false
- }
- // 应付
- for(let item of this.form.feeCenterListC) {
- if (item.curCode == 'CNY') {
- this.$set(item,'rmbAmount',item.amount)
- this.$set(item,'usdAmount','')
- }else {
- this.$set(item,'usdAmount',item.amount)
- this.$set(item,'rmbAmount','')
- }
- item.edit = false
- }
- // 文件中心
- for(let item of this.form.filesList) {
- this.$set(item,'edit',false)
- }
- },
- // 下拉 把拼接的拆分
- searchSplit(){
- // 发货人
- if (this.form.hshipperCnName) {
- this.form.hshipperCnName = this.form.hshipperCnName.split(' - ')[0]
- }
- // 收货人
- if (this.form.hconsigneeCnName) {
- this.form.hconsigneeCnName = this.form.hconsigneeCnName.split(' - ')[0]
- }
- // 通知人
- if (this.form.hnotifyCnName) {
- this.form.hnotifyCnName = this.form.hnotifyCnName.split(' - ')[0]
- }
- // 船公司
- if (this.form.carrierCnName) {
- this.form.carrierCnName = this.form.carrierCnName.split(' - ')[0]
- }
- },
- // 下拉 中文名称和编号拼接
- searchMontage(){
- // 发货人
- if (this.form.hshipperCnName) {
- this.form.hshipperCnName = this.form.hshipperCnName + ' - ' + this.form.hShipperCode
- }
- // 收货人
- if (this.form.hconsigneeCnName) {
- this.form.hconsigneeCnName = this.form.hconsigneeCnName + ' - ' + this.form.hConsigneeCode
- }
- // 通知人
- if (this.form.hnotifyCnName) {
- this.form.hnotifyCnName = this.form.hnotifyCnName + ' - ' + this.form.hNotifyCode
- }
- // 船公司
- if (this.form.carrierCnName) {
- this.form.carrierCnName = this.form.carrierCnName + ' - ' + this.form.carrierCode
- }
- },
- // tbas切换
- handleClick(tba,event) {
- },
- // 大tbas切换
- bigHandleClick(){
- if (this.bigtabs == 'fd') {
- if (this.form.id) {
- this.billsListAllfun(this.form.id)
- }
- }
- },
- // 获取不分页的分单列表
- billsListAllfun(masterId){
- billsListAll({masterId}).then(res=>{
- this.billsListAllData = res.data.data
- })
- },
- },
- }
- </script>
- <style scoped>
- .borderless {
- height: 100%;
- box-sizing: border-box
- }
- .customer-main {
- margin-bottom: 15px;
- }
- .demo-ruleForm {
- font-size: 14px;
- }
- .margintop {
- margin-top: 10px;
- }
- ::v-deep.el-form-item {
- margin-bottom: 0;
- }
- .isShow {
- display: none;
- }
- </style>
|